commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0973942020260734e49a59cacb35d78c64aea566 | read_test.go | read_test.go | package maxreader_test
import (
"io/ioutil"
"strings"
"testing"
"."
)
func Test(t *testing.T) {
type entry struct {
s string
ok bool
}
table := []entry{
{"", true},
{"h", true},
{"hell", true},
{"hello", true},
{"hellow", false},
{"helloworld", false},
}
for _, e := range table {
b, err := ioutil.ReadAll(maxreader.New(strings.NewReader(e.s), 5))
if e.ok != (err == nil) {
t.Errorf(`input "%v" -> error %v`, e.s, err)
}
if err == nil {
l := len(e.s)
if l > 5 {
l = 5
}
if len(b) != l {
t.Errorf(`input "%v" -> length %v`, e.s, len(b))
}
} else if err != maxreader.ErrReadLimit {
t.Errorf(`input "%v" -> wrong error %v`, e.s, err)
}
}
}
| package maxreader_test
import (
"io/ioutil"
"strings"
"testing"
"github.com/ninchat/maxreader"
)
func Test(t *testing.T) {
type entry struct {
s string
ok bool
}
table := []entry{
{"", true},
{"h", true},
{"hell", true},
{"hello", true},
{"hellow", false},
{"helloworld", false},
}
for _, e := range table {
b, err := ioutil.ReadAll(maxreader.New(strings.NewReader(e.s), 5))
if e.ok != (err == nil) {
t.Errorf(`input "%v" -> error %v`, e.s, err)
}
if err == nil {
l := len(e.s)
if l > 5 {
l = 5
}
if len(b) != l {
t.Errorf(`input "%v" -> length %v`, e.s, len(b))
}
} else if err != maxreader.ErrReadLimit {
t.Errorf(`input "%v" -> wrong error %v`, e.s, err)
}
}
}
| Use absolute import in test | Use absolute import in test
| Go | bsd-2-clause | ninchat/maxreader | go | ## Code Before:
package maxreader_test
import (
"io/ioutil"
"strings"
"testing"
"."
)
func Test(t *testing.T) {
type entry struct {
s string
ok bool
}
table := []entry{
{"", true},
{"h", true},
{"hell", true},
{"hello", true},
{"hellow", false},
{"helloworld", false},
}
for _, e := range table {
b, err := ioutil.ReadAll(maxreader.New(strings.NewReader(e.s), 5))
if e.ok != (err == nil) {
t.Errorf(`input "%v" -> error %v`, e.s, err)
}
if err == nil {
l := len(e.s)
if l > 5 {
l = 5
}
if len(b) != l {
t.Errorf(`input "%v" -> length %v`, e.s, len(b))
}
} else if err != maxreader.ErrReadLimit {
t.Errorf(`input "%v" -> wrong error %v`, e.s, err)
}
}
}
## Instruction:
Use absolute import in test
## Code After:
package maxreader_test
import (
"io/ioutil"
"strings"
"testing"
"github.com/ninchat/maxreader"
)
func Test(t *testing.T) {
type entry struct {
s string
ok bool
}
table := []entry{
{"", true},
{"h", true},
{"hell", true},
{"hello", true},
{"hellow", false},
{"helloworld", false},
}
for _, e := range table {
b, err := ioutil.ReadAll(maxreader.New(strings.NewReader(e.s), 5))
if e.ok != (err == nil) {
t.Errorf(`input "%v" -> error %v`, e.s, err)
}
if err == nil {
l := len(e.s)
if l > 5 {
l = 5
}
if len(b) != l {
t.Errorf(`input "%v" -> length %v`, e.s, len(b))
}
} else if err != maxreader.ErrReadLimit {
t.Errorf(`input "%v" -> wrong error %v`, e.s, err)
}
}
}
| package maxreader_test
import (
"io/ioutil"
"strings"
"testing"
- "."
+ "github.com/ninchat/maxreader"
)
func Test(t *testing.T) {
type entry struct {
s string
ok bool
}
table := []entry{
{"", true},
{"h", true},
{"hell", true},
{"hello", true},
{"hellow", false},
{"helloworld", false},
}
for _, e := range table {
b, err := ioutil.ReadAll(maxreader.New(strings.NewReader(e.s), 5))
if e.ok != (err == nil) {
t.Errorf(`input "%v" -> error %v`, e.s, err)
}
if err == nil {
l := len(e.s)
if l > 5 {
l = 5
}
if len(b) != l {
t.Errorf(`input "%v" -> length %v`, e.s, len(b))
}
} else if err != maxreader.ErrReadLimit {
t.Errorf(`input "%v" -> wrong error %v`, e.s, err)
}
}
} | 2 | 0.043478 | 1 | 1 |
4fa1ae1199acd578918aa641f69c8de87e34abc3 | recipes/sgp4/manifest.patch | recipes/sgp4/manifest.patch | diff --git a/setup.py b/setup.py
index 6667adc..79f7482 100644
--- a/setup.py
+++ b/setup.py
@@ -29,4 +29,5 @@ setup(name = 'sgp4',
'Topic :: Scientific/Engineering :: Astronomy',
],
packages = ['sgp4'],
+ package_data={'sgp4': ['tcppver.out', 'SGP4-VER.TLE', 'LICENSE'],},
)
| diff --git a/setup.py b/setup.py
index 6667adc..79f7482 100644
--- a/setup.py
+++ b/setup.py
@@ -29,4 +29,5 @@ setup(name = 'sgp4',
'Topic :: Scientific/Engineering :: Astronomy',
],
packages = ['sgp4'],
+ package_data={'sgp4': ['tcppver.out', 'SGP4-VER.TLE', },
)
| Drop LICENSE from package data | Drop LICENSE from package data
| Diff | bsd-3-clause | Cashalow/staged-recipes,Juanlu001/staged-recipes,shadowwalkersb/staged-recipes,jochym/staged-recipes,hbredin/staged-recipes,bmabey/staged-recipes,stuertz/staged-recipes,ceholden/staged-recipes,basnijholt/staged-recipes,conda-forge/staged-recipes,caspervdw/staged-recipes,NOAA-ORR-ERD/staged-recipes,kwilcox/staged-recipes,goanpeca/staged-recipes,sannykr/staged-recipes,ocefpaf/staged-recipes,tylere/staged-recipes,ReimarBauer/staged-recipes,rmcgibbo/staged-recipes,glemaitre/staged-recipes,larray-project/staged-recipes,gqmelo/staged-recipes,patricksnape/staged-recipes,petrushy/staged-recipes,dschreij/staged-recipes,hadim/staged-recipes,guillochon/staged-recipes,jerowe/staged-recipes,jcb91/staged-recipes,atedstone/staged-recipes,SylvainCorlay/staged-recipes,benvandyke/staged-recipes,johannesring/staged-recipes,mcernak/staged-recipes,khallock/staged-recipes,Juanlu001/staged-recipes,cpaulik/staged-recipes,Savvysherpa/staged-recipes,kwilcox/staged-recipes,benvandyke/staged-recipes,asmeurer/staged-recipes,blowekamp/staged-recipes,sodre/staged-recipes,hadim/staged-recipes,mariusvniekerk/staged-recipes,bmabey/staged-recipes,jjhelmus/staged-recipes,sodre/staged-recipes,ocefpaf/staged-recipes,synapticarbors/staged-recipes,rvalieris/staged-recipes,jakirkham/staged-recipes,scopatz/staged-recipes,pmlandwehr/staged-recipes,NOAA-ORR-ERD/staged-recipes,hbredin/staged-recipes,ReimarBauer/staged-recipes,patricksnape/staged-recipes,dharhas/staged-recipes,koverholt/staged-recipes,igortg/staged-recipes,khallock/staged-recipes,isuruf/staged-recipes,chrisburr/staged-recipes,mariusvniekerk/staged-recipes,goanpeca/staged-recipes,johannesring/staged-recipes,planetarypy/staged-recipes,jakirkham/staged-recipes,johanneskoester/staged-recipes,larray-project/staged-recipes,scopatz/staged-recipes,birdsarah/staged-recipes,mcs07/staged-recipes,chohner/staged-recipes,glemaitre/staged-recipes,jerowe/staged-recipes,cpaulik/staged-recipes,pmlandwehr/staged-recipes,johanneskoester/staged-recipes,jochym/staged-recipes,grlee77/staged-recipes,sannykr/staged-recipes,JohnGreeley/staged-recipes,JohnGreeley/staged-recipes,dschreij/staged-recipes,gqmelo/staged-recipes,birdsarah/staged-recipes,conda-forge/staged-recipes,dfroger/staged-recipes,barkls/staged-recipes,chohner/staged-recipes,SylvainCorlay/staged-recipes,shadowwalkersb/staged-recipes,rmcgibbo/staged-recipes,pstjohn/staged-recipes,guillochon/staged-recipes,hajapy/staged-recipes,caspervdw/staged-recipes,isuruf/staged-recipes,petrushy/staged-recipes,vamega/staged-recipes,basnijholt/staged-recipes,tylere/staged-recipes,planetarypy/staged-recipes,barkls/staged-recipes,synapticarbors/staged-recipes,blowekamp/staged-recipes,pstjohn/staged-recipes,dfroger/staged-recipes,rvalieris/staged-recipes,ceholden/staged-recipes,hajapy/staged-recipes,sodre/staged-recipes,chrisburr/staged-recipes,grlee77/staged-recipes,dharhas/staged-recipes,igortg/staged-recipes,mcernak/staged-recipes,stuertz/staged-recipes,koverholt/staged-recipes,atedstone/staged-recipes,Cashalow/staged-recipes,jjhelmus/staged-recipes,vamega/staged-recipes,asmeurer/staged-recipes,Savvysherpa/staged-recipes,jcb91/staged-recipes,mcs07/staged-recipes | diff | ## Code Before:
diff --git a/setup.py b/setup.py
index 6667adc..79f7482 100644
--- a/setup.py
+++ b/setup.py
@@ -29,4 +29,5 @@ setup(name = 'sgp4',
'Topic :: Scientific/Engineering :: Astronomy',
],
packages = ['sgp4'],
+ package_data={'sgp4': ['tcppver.out', 'SGP4-VER.TLE', 'LICENSE'],},
)
## Instruction:
Drop LICENSE from package data
## Code After:
diff --git a/setup.py b/setup.py
index 6667adc..79f7482 100644
--- a/setup.py
+++ b/setup.py
@@ -29,4 +29,5 @@ setup(name = 'sgp4',
'Topic :: Scientific/Engineering :: Astronomy',
],
packages = ['sgp4'],
+ package_data={'sgp4': ['tcppver.out', 'SGP4-VER.TLE', },
)
| diff --git a/setup.py b/setup.py
index 6667adc..79f7482 100644
--- a/setup.py
+++ b/setup.py
@@ -29,4 +29,5 @@ setup(name = 'sgp4',
'Topic :: Scientific/Engineering :: Astronomy',
],
packages = ['sgp4'],
- + package_data={'sgp4': ['tcppver.out', 'SGP4-VER.TLE', 'LICENSE'],},
? -----------
+ + package_data={'sgp4': ['tcppver.out', 'SGP4-VER.TLE', },
) | 2 | 0.2 | 1 | 1 |
a7a1d513003a65c5c9772ba75631247decff444d | utils/utils.py | utils/utils.py | from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.contrib.syndication.views import add_domain
from django.contrib.sites.models import get_current_site
def get_site_url(request, path):
current_site = get_current_site(request)
return add_domain(current_site.domain, path, request.is_secure())
def do_paging(request, queryset):
paginator = Paginator(queryset, 25)
# Make sure page request is an int. If not, deliver first page.
try:
page = int(request.GET.get('page', '1'))
except ValueError:
page = 1
# If page request (9999) is out of range, deliver last page of results.
try:
objects = paginator.page(page)
except (EmptyPage, InvalidPage):
objects = paginator.page(paginator.num_pages)
return objects
| from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.contrib.syndication.views import add_domain
from django.contrib.sites.models import get_current_site
def get_site_url(request, path):
"""Retrieve current site site
Always returns as http (never https)
"""
current_site = get_current_site(request)
site_url = add_domain(current_site.domain, path, request.is_secure())
return site_url.replace('https', 'http')
def do_paging(request, queryset):
paginator = Paginator(queryset, 25)
# Make sure page request is an int. If not, deliver first page.
try:
page = int(request.GET.get('page', '1'))
except ValueError:
page = 1
# If page request (9999) is out of range, deliver last page of results.
try:
objects = paginator.page(page)
except (EmptyPage, InvalidPage):
objects = paginator.page(paginator.num_pages)
return objects
| Make site url be http, not https | Make site url be http, not https
| Python | bsd-3-clause | uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam | python | ## Code Before:
from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.contrib.syndication.views import add_domain
from django.contrib.sites.models import get_current_site
def get_site_url(request, path):
current_site = get_current_site(request)
return add_domain(current_site.domain, path, request.is_secure())
def do_paging(request, queryset):
paginator = Paginator(queryset, 25)
# Make sure page request is an int. If not, deliver first page.
try:
page = int(request.GET.get('page', '1'))
except ValueError:
page = 1
# If page request (9999) is out of range, deliver last page of results.
try:
objects = paginator.page(page)
except (EmptyPage, InvalidPage):
objects = paginator.page(paginator.num_pages)
return objects
## Instruction:
Make site url be http, not https
## Code After:
from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.contrib.syndication.views import add_domain
from django.contrib.sites.models import get_current_site
def get_site_url(request, path):
"""Retrieve current site site
Always returns as http (never https)
"""
current_site = get_current_site(request)
site_url = add_domain(current_site.domain, path, request.is_secure())
return site_url.replace('https', 'http')
def do_paging(request, queryset):
paginator = Paginator(queryset, 25)
# Make sure page request is an int. If not, deliver first page.
try:
page = int(request.GET.get('page', '1'))
except ValueError:
page = 1
# If page request (9999) is out of range, deliver last page of results.
try:
objects = paginator.page(page)
except (EmptyPage, InvalidPage):
objects = paginator.page(paginator.num_pages)
return objects
| from django.core.paginator import Paginator, EmptyPage, InvalidPage
from django.contrib.syndication.views import add_domain
from django.contrib.sites.models import get_current_site
def get_site_url(request, path):
+ """Retrieve current site site
+ Always returns as http (never https)
+ """
current_site = get_current_site(request)
- return add_domain(current_site.domain, path, request.is_secure())
? ^ ^ ^
+ site_url = add_domain(current_site.domain, path, request.is_secure())
? ^^^ ^ ^^^
+ return site_url.replace('https', 'http')
+
def do_paging(request, queryset):
paginator = Paginator(queryset, 25)
# Make sure page request is an int. If not, deliver first page.
try:
page = int(request.GET.get('page', '1'))
except ValueError:
page = 1
# If page request (9999) is out of range, deliver last page of results.
try:
objects = paginator.page(page)
except (EmptyPage, InvalidPage):
objects = paginator.page(paginator.num_pages)
return objects | 7 | 0.28 | 6 | 1 |
61dd80443c1ed9588dead6a44dff39cf39f63777 | build.ps1 | build.ps1 | if (-not (Test-Path env:APPVEYOR_BUILD_NUMBER)) { $env:APPVEYOR_BUILD_NUMBER = '0' }
$suffix = "build." + $env:APPVEYOR_BUILD_NUMBER
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
dotnet build src\LibLog.sln -c Release
dotnet test src\LibLog.Tests -c Release --no-build
Get-ChildItem ./src/*.pp -Recurse | ForEach-Object { Remove-Item $_ }
$files = (Get-ChildItem -Path ./src/LibLog -Filter *.cs -File) +
(Get-ChildItem -Path ./src/LibLog/LogProviders -Filter *.cs -File)
$files | ForEach-Object {
$in = (Get-Content $_.FullName).Replace('YourRootNamespace.', '$rootnamespace$.');
Set-Content ($_.FullName + ".pp") -Value '// <auto-generated/>', $in;
}
& $NUGET_EXE pack src/LibLog/LibLog.nuspec -Suffix $suffix -OutputDirectory artifacts
| function Run-Task
{
param(
[scriptblock] $block
)
& $block
if($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
}
if (-not (Test-Path env:APPVEYOR_BUILD_NUMBER)) { $env:APPVEYOR_BUILD_NUMBER = '0' }
$suffix = "build." + $env:APPVEYOR_BUILD_NUMBER
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
Run-Task { dotnet build src\LibLog.sln -c Release }
Run-Task { dotnet test src\LibLog.Tests -c Release --no-build }
Get-ChildItem ./src/*.pp -Recurse | ForEach-Object { Remove-Item $_ }
$files = (Get-ChildItem -Path ./src/LibLog -Filter *.cs -File) +
(Get-ChildItem -Path ./src/LibLog/LogProviders -Filter *.cs -File)
$files | ForEach-Object {
$in = (Get-Content $_.FullName).Replace('YourRootNamespace.', '$rootnamespace$.');
Set-Content ($_.FullName + ".pp") -Value '// <auto-generated/>', $in;
}
& $NUGET_EXE pack src/LibLog/LibLog.nuspec -Suffix $suffix -OutputDirectory artifacts
| Exit script of either of the dotnet task fails. | Exit script of either of the dotnet task fails.
| PowerShell | mit | damianh/LibLog | powershell | ## Code Before:
if (-not (Test-Path env:APPVEYOR_BUILD_NUMBER)) { $env:APPVEYOR_BUILD_NUMBER = '0' }
$suffix = "build." + $env:APPVEYOR_BUILD_NUMBER
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
dotnet build src\LibLog.sln -c Release
dotnet test src\LibLog.Tests -c Release --no-build
Get-ChildItem ./src/*.pp -Recurse | ForEach-Object { Remove-Item $_ }
$files = (Get-ChildItem -Path ./src/LibLog -Filter *.cs -File) +
(Get-ChildItem -Path ./src/LibLog/LogProviders -Filter *.cs -File)
$files | ForEach-Object {
$in = (Get-Content $_.FullName).Replace('YourRootNamespace.', '$rootnamespace$.');
Set-Content ($_.FullName + ".pp") -Value '// <auto-generated/>', $in;
}
& $NUGET_EXE pack src/LibLog/LibLog.nuspec -Suffix $suffix -OutputDirectory artifacts
## Instruction:
Exit script of either of the dotnet task fails.
## Code After:
function Run-Task
{
param(
[scriptblock] $block
)
& $block
if($LASTEXITCODE -ne 0)
{
exit $LASTEXITCODE
}
}
if (-not (Test-Path env:APPVEYOR_BUILD_NUMBER)) { $env:APPVEYOR_BUILD_NUMBER = '0' }
$suffix = "build." + $env:APPVEYOR_BUILD_NUMBER
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
Run-Task { dotnet build src\LibLog.sln -c Release }
Run-Task { dotnet test src\LibLog.Tests -c Release --no-build }
Get-ChildItem ./src/*.pp -Recurse | ForEach-Object { Remove-Item $_ }
$files = (Get-ChildItem -Path ./src/LibLog -Filter *.cs -File) +
(Get-ChildItem -Path ./src/LibLog/LogProviders -Filter *.cs -File)
$files | ForEach-Object {
$in = (Get-Content $_.FullName).Replace('YourRootNamespace.', '$rootnamespace$.');
Set-Content ($_.FullName + ".pp") -Value '// <auto-generated/>', $in;
}
& $NUGET_EXE pack src/LibLog/LibLog.nuspec -Suffix $suffix -OutputDirectory artifacts
| + function Run-Task
+ {
+ param(
+ [scriptblock] $block
+ )
+
+ & $block
+
+ if($LASTEXITCODE -ne 0)
+ {
+ exit $LASTEXITCODE
+ }
+ }
+
if (-not (Test-Path env:APPVEYOR_BUILD_NUMBER)) { $env:APPVEYOR_BUILD_NUMBER = '0' }
$suffix = "build." + $env:APPVEYOR_BUILD_NUMBER
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
- dotnet build src\LibLog.sln -c Release
+ Run-Task { dotnet build src\LibLog.sln -c Release }
? +++++++++++ ++
- dotnet test src\LibLog.Tests -c Release --no-build
+ Run-Task { dotnet test src\LibLog.Tests -c Release --no-build }
? +++++++++++ ++
Get-ChildItem ./src/*.pp -Recurse | ForEach-Object { Remove-Item $_ }
$files = (Get-ChildItem -Path ./src/LibLog -Filter *.cs -File) +
(Get-ChildItem -Path ./src/LibLog/LogProviders -Filter *.cs -File)
$files | ForEach-Object {
$in = (Get-Content $_.FullName).Replace('YourRootNamespace.', '$rootnamespace$.');
Set-Content ($_.FullName + ".pp") -Value '// <auto-generated/>', $in;
}
& $NUGET_EXE pack src/LibLog/LibLog.nuspec -Suffix $suffix -OutputDirectory artifacts | 18 | 0.947368 | 16 | 2 |
750e0e8e6787bd93a5a3ee6ad5fd4ea423b37484 | metadata.rb | metadata.rb | name 'php'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@getchef.com'
license 'Apache 2.0'
description 'Installs and maintains php and php modules'
version '1.7.0'
depends 'build-essential'
depends 'xml'
depends 'mysql', '>= 6.0.0'
depends 'yum-epel'
depends 'windows'
depends 'iis'
%w(debian ubuntu centos redhat fedora scientific amazon windows oracle).each do |os|
supports os
end
recipe 'php', 'Installs php'
recipe 'php::package', 'Installs php using packages.'
recipe 'php::source', 'Installs php from source.'
recipe 'php::module_apc', 'Install the php5-apc package'
recipe 'php::module_curl', 'Install the php5-curl package'
recipe 'php::module_fileinfo', 'Install the php5-fileinfo package'
recipe 'php::module_fpdf', 'Install the php-fpdf package'
recipe 'php::module_gd', 'Install the php5-gd package'
recipe 'php::module_ldap', 'Install the php5-ldap package'
recipe 'php::module_memcache', 'Install the php5-memcache package'
recipe 'php::module_mysql', 'Install the php5-mysql package'
recipe 'php::module_pgsql', 'Install the php5-pgsql packag'
recipe 'php::module_sqlite3', 'Install the php5-sqlite3 package'
| name 'php'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@getchef.com'
license 'Apache 2.0'
description 'Installs and maintains php and php modules'
version '1.7.0'
depends 'build-essential'
depends 'xml'
depends 'mysql'
depends 'yum-epel'
depends 'windows'
depends 'iis'
%w(debian ubuntu centos redhat fedora scientific amazon windows oracle).each do |os|
supports os
end
recipe 'php', 'Installs php'
recipe 'php::package', 'Installs php using packages.'
recipe 'php::source', 'Installs php from source.'
recipe 'php::module_apc', 'Install the php5-apc package'
recipe 'php::module_curl', 'Install the php5-curl package'
recipe 'php::module_fileinfo', 'Install the php5-fileinfo package'
recipe 'php::module_fpdf', 'Install the php-fpdf package'
recipe 'php::module_gd', 'Install the php5-gd package'
recipe 'php::module_ldap', 'Install the php5-ldap package'
recipe 'php::module_memcache', 'Install the php5-memcache package'
recipe 'php::module_mysql', 'Install the php5-mysql package'
recipe 'php::module_pgsql', 'Install the php5-pgsql packag'
recipe 'php::module_sqlite3', 'Install the php5-sqlite3 package'
| Remove mysql cookbook version constraint | Remove mysql cookbook version constraint | Ruby | apache-2.0 | beubi/cookbook-php,beubi/cookbook-php | ruby | ## Code Before:
name 'php'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@getchef.com'
license 'Apache 2.0'
description 'Installs and maintains php and php modules'
version '1.7.0'
depends 'build-essential'
depends 'xml'
depends 'mysql', '>= 6.0.0'
depends 'yum-epel'
depends 'windows'
depends 'iis'
%w(debian ubuntu centos redhat fedora scientific amazon windows oracle).each do |os|
supports os
end
recipe 'php', 'Installs php'
recipe 'php::package', 'Installs php using packages.'
recipe 'php::source', 'Installs php from source.'
recipe 'php::module_apc', 'Install the php5-apc package'
recipe 'php::module_curl', 'Install the php5-curl package'
recipe 'php::module_fileinfo', 'Install the php5-fileinfo package'
recipe 'php::module_fpdf', 'Install the php-fpdf package'
recipe 'php::module_gd', 'Install the php5-gd package'
recipe 'php::module_ldap', 'Install the php5-ldap package'
recipe 'php::module_memcache', 'Install the php5-memcache package'
recipe 'php::module_mysql', 'Install the php5-mysql package'
recipe 'php::module_pgsql', 'Install the php5-pgsql packag'
recipe 'php::module_sqlite3', 'Install the php5-sqlite3 package'
## Instruction:
Remove mysql cookbook version constraint
## Code After:
name 'php'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@getchef.com'
license 'Apache 2.0'
description 'Installs and maintains php and php modules'
version '1.7.0'
depends 'build-essential'
depends 'xml'
depends 'mysql'
depends 'yum-epel'
depends 'windows'
depends 'iis'
%w(debian ubuntu centos redhat fedora scientific amazon windows oracle).each do |os|
supports os
end
recipe 'php', 'Installs php'
recipe 'php::package', 'Installs php using packages.'
recipe 'php::source', 'Installs php from source.'
recipe 'php::module_apc', 'Install the php5-apc package'
recipe 'php::module_curl', 'Install the php5-curl package'
recipe 'php::module_fileinfo', 'Install the php5-fileinfo package'
recipe 'php::module_fpdf', 'Install the php-fpdf package'
recipe 'php::module_gd', 'Install the php5-gd package'
recipe 'php::module_ldap', 'Install the php5-ldap package'
recipe 'php::module_memcache', 'Install the php5-memcache package'
recipe 'php::module_mysql', 'Install the php5-mysql package'
recipe 'php::module_pgsql', 'Install the php5-pgsql packag'
recipe 'php::module_sqlite3', 'Install the php5-sqlite3 package'
| name 'php'
maintainer 'Chef Software, Inc.'
maintainer_email 'cookbooks@getchef.com'
license 'Apache 2.0'
description 'Installs and maintains php and php modules'
version '1.7.0'
depends 'build-essential'
depends 'xml'
- depends 'mysql', '>= 6.0.0'
+ depends 'mysql'
depends 'yum-epel'
depends 'windows'
depends 'iis'
%w(debian ubuntu centos redhat fedora scientific amazon windows oracle).each do |os|
supports os
end
recipe 'php', 'Installs php'
recipe 'php::package', 'Installs php using packages.'
recipe 'php::source', 'Installs php from source.'
recipe 'php::module_apc', 'Install the php5-apc package'
recipe 'php::module_curl', 'Install the php5-curl package'
recipe 'php::module_fileinfo', 'Install the php5-fileinfo package'
recipe 'php::module_fpdf', 'Install the php-fpdf package'
recipe 'php::module_gd', 'Install the php5-gd package'
recipe 'php::module_ldap', 'Install the php5-ldap package'
recipe 'php::module_memcache', 'Install the php5-memcache package'
recipe 'php::module_mysql', 'Install the php5-mysql package'
recipe 'php::module_pgsql', 'Install the php5-pgsql packag'
recipe 'php::module_sqlite3', 'Install the php5-sqlite3 package' | 2 | 0.064516 | 1 | 1 |
567d28fcdaf9215a446ddea7346cd12352090ee0 | config/test.js | config/test.js | module.exports = {
database: 'factory-girl-sequelize',
options: {
dialect: 'sqlite',
storage: 'test/tmp/test.db',
logging: null
}
};
| module.exports = {
database: 'factory-girl-sequelize',
options: {
dialect: 'sqlite',
storage: ':memory:',
logging: null
}
};
| Change to use in-memory SQLite | Change to use in-memory SQLite
| JavaScript | mit | aexmachina/factory-girl-sequelize | javascript | ## Code Before:
module.exports = {
database: 'factory-girl-sequelize',
options: {
dialect: 'sqlite',
storage: 'test/tmp/test.db',
logging: null
}
};
## Instruction:
Change to use in-memory SQLite
## Code After:
module.exports = {
database: 'factory-girl-sequelize',
options: {
dialect: 'sqlite',
storage: ':memory:',
logging: null
}
};
| module.exports = {
database: 'factory-girl-sequelize',
options: {
dialect: 'sqlite',
- storage: 'test/tmp/test.db',
+ storage: ':memory:',
logging: null
}
}; | 2 | 0.25 | 1 | 1 |
3ec5d9520dd17bb6e38d88e82bbc0a3b4e599fce | setup.cfg | setup.cfg | [metadata]
name = django-analog
version = 1.1.0.pre+gitver
description = Simple per-model log models for Django apps
long_description = file: README.rst
keywords = django, logging
url = https://github.com/andersinno/django-analog
author = Anders Innovations
author_email = support@anders.fi
license = MIT
license_file = LICENSE
platforms = any
[options]
include_package_data = True
packages = find:
install_requires =
Django
[options.packages.find]
exclude = analog_tests, analog_tests.*
[bdist_wheel]
universal = 1
[flake8]
exclude = .tox,dist,venv,docs
max-line-length = 79
max-complexity = 10
[pep257]
ignore = D100,D203
[tool:pytest]
DJANGO_SETTINGS_MODULE = analog_tests.settings
norecursedirs = .git venv*
[isort]
multi_line_output = 4
skip=.tox,dist,venv,docs
known_first_party=analog
known_third_party=django,pytest
[prequ]
requirements =
-e .
requirements-dev =
tox>=2.8
requirements-stylecheck =
flake8
flake8-isort
flake8-print
pep257
pep8-naming
requirements-test =
pytest>=5.0.0
pytest-cov
pytest-django
| [metadata]
name = django-analog
version = 1.1.0.pre+gitver
description = Simple per-model log models for Django apps
long_description = file: README.rst
keywords = django, logging
url = https://github.com/andersinno/django-analog
author = Anders Innovations
author_email = support@anders.fi
license = MIT
license_file = LICENSE
platforms = any
[options]
include_package_data = True
packages = find:
install_requires =
Django
[options.packages.find]
exclude = analog_tests, analog_tests.*
[flake8]
exclude = .tox,dist,venv,docs
max-line-length = 79
max-complexity = 10
[pep257]
ignore = D100,D203
[tool:pytest]
DJANGO_SETTINGS_MODULE = analog_tests.settings
norecursedirs = .git venv*
[isort]
multi_line_output = 4
skip=.tox,dist,venv,docs
known_first_party=analog
known_third_party=django,pytest
[prequ]
requirements =
-e .
requirements-dev =
tox>=2.8
requirements-stylecheck =
flake8
flake8-isort
flake8-print
pep257
pep8-naming
requirements-test =
pytest>=5.0.0
pytest-cov
pytest-django
| Mark wheel as no longer universal | Mark wheel as no longer universal
| INI | mit | andersinno/django-analog | ini | ## Code Before:
[metadata]
name = django-analog
version = 1.1.0.pre+gitver
description = Simple per-model log models for Django apps
long_description = file: README.rst
keywords = django, logging
url = https://github.com/andersinno/django-analog
author = Anders Innovations
author_email = support@anders.fi
license = MIT
license_file = LICENSE
platforms = any
[options]
include_package_data = True
packages = find:
install_requires =
Django
[options.packages.find]
exclude = analog_tests, analog_tests.*
[bdist_wheel]
universal = 1
[flake8]
exclude = .tox,dist,venv,docs
max-line-length = 79
max-complexity = 10
[pep257]
ignore = D100,D203
[tool:pytest]
DJANGO_SETTINGS_MODULE = analog_tests.settings
norecursedirs = .git venv*
[isort]
multi_line_output = 4
skip=.tox,dist,venv,docs
known_first_party=analog
known_third_party=django,pytest
[prequ]
requirements =
-e .
requirements-dev =
tox>=2.8
requirements-stylecheck =
flake8
flake8-isort
flake8-print
pep257
pep8-naming
requirements-test =
pytest>=5.0.0
pytest-cov
pytest-django
## Instruction:
Mark wheel as no longer universal
## Code After:
[metadata]
name = django-analog
version = 1.1.0.pre+gitver
description = Simple per-model log models for Django apps
long_description = file: README.rst
keywords = django, logging
url = https://github.com/andersinno/django-analog
author = Anders Innovations
author_email = support@anders.fi
license = MIT
license_file = LICENSE
platforms = any
[options]
include_package_data = True
packages = find:
install_requires =
Django
[options.packages.find]
exclude = analog_tests, analog_tests.*
[flake8]
exclude = .tox,dist,venv,docs
max-line-length = 79
max-complexity = 10
[pep257]
ignore = D100,D203
[tool:pytest]
DJANGO_SETTINGS_MODULE = analog_tests.settings
norecursedirs = .git venv*
[isort]
multi_line_output = 4
skip=.tox,dist,venv,docs
known_first_party=analog
known_third_party=django,pytest
[prequ]
requirements =
-e .
requirements-dev =
tox>=2.8
requirements-stylecheck =
flake8
flake8-isort
flake8-print
pep257
pep8-naming
requirements-test =
pytest>=5.0.0
pytest-cov
pytest-django
| [metadata]
name = django-analog
version = 1.1.0.pre+gitver
description = Simple per-model log models for Django apps
long_description = file: README.rst
keywords = django, logging
url = https://github.com/andersinno/django-analog
author = Anders Innovations
author_email = support@anders.fi
license = MIT
license_file = LICENSE
platforms = any
[options]
include_package_data = True
packages = find:
install_requires =
Django
[options.packages.find]
exclude = analog_tests, analog_tests.*
-
- [bdist_wheel]
- universal = 1
[flake8]
exclude = .tox,dist,venv,docs
max-line-length = 79
max-complexity = 10
[pep257]
ignore = D100,D203
[tool:pytest]
DJANGO_SETTINGS_MODULE = analog_tests.settings
norecursedirs = .git venv*
[isort]
multi_line_output = 4
skip=.tox,dist,venv,docs
known_first_party=analog
known_third_party=django,pytest
[prequ]
requirements =
-e .
requirements-dev =
tox>=2.8
requirements-stylecheck =
flake8
flake8-isort
flake8-print
pep257
pep8-naming
requirements-test =
pytest>=5.0.0
pytest-cov
pytest-django | 3 | 0.04918 | 0 | 3 |
573d59b0daae33cfb61cc64c3a7003ecc82bc500 | app/models/forem/ability.rb | app/models/forem/ability.rb | require 'cancan'
module Forem
module Ability
include CanCan::Ability
def self.included(target)
target.class_eval do
# Alias old class's initialize so we can get it to after
# Otherwise initialize attempts to go to an initialize that doesn't take an arg
alias_method :old_initialize, :initialize
def initialize(user)
# Let other permissions run before this
old_initialize(user)
user ||= User.new # anonymous user
if user.can_read_forem_forums?
can :read, Forem::Forum do |forum|
user.can_read_forem_forum?(forum)
end
end
can :read, Forem::Category do |category|
user.can_read_forem_category?(category)
end
end
end
can :read, :forums
end
end
end
| require 'cancan'
module Forem
module Ability
include CanCan::Ability
def self.included(target)
target.class_eval do
# Alias old class's initialize so we can get it to after
# Otherwise initialize attempts to go to an initialize that doesn't take an arg
alias_method :old_initialize, :initialize
def initialize(user)
# Let other permissions run before this
old_initialize(user)
user ||= User.new # anonymous user
if user.can_read_forem_forums?
can :read, Forem::Forum do |forum|
user.can_read_forem_forum?(forum)
end
end
can :read, Forem::Category do |category|
user.can_read_forem_category?(category)
end
end
end
end
end
end
| Remove erroneous can :read, :forums | Remove erroneous can :read, :forums
| Ruby | mit | frankel/forem,dmitry-ilyashevich/forem,frankel/forem,dmitry-ilyashevich/forem | ruby | ## Code Before:
require 'cancan'
module Forem
module Ability
include CanCan::Ability
def self.included(target)
target.class_eval do
# Alias old class's initialize so we can get it to after
# Otherwise initialize attempts to go to an initialize that doesn't take an arg
alias_method :old_initialize, :initialize
def initialize(user)
# Let other permissions run before this
old_initialize(user)
user ||= User.new # anonymous user
if user.can_read_forem_forums?
can :read, Forem::Forum do |forum|
user.can_read_forem_forum?(forum)
end
end
can :read, Forem::Category do |category|
user.can_read_forem_category?(category)
end
end
end
can :read, :forums
end
end
end
## Instruction:
Remove erroneous can :read, :forums
## Code After:
require 'cancan'
module Forem
module Ability
include CanCan::Ability
def self.included(target)
target.class_eval do
# Alias old class's initialize so we can get it to after
# Otherwise initialize attempts to go to an initialize that doesn't take an arg
alias_method :old_initialize, :initialize
def initialize(user)
# Let other permissions run before this
old_initialize(user)
user ||= User.new # anonymous user
if user.can_read_forem_forums?
can :read, Forem::Forum do |forum|
user.can_read_forem_forum?(forum)
end
end
can :read, Forem::Category do |category|
user.can_read_forem_category?(category)
end
end
end
end
end
end
| require 'cancan'
module Forem
module Ability
include CanCan::Ability
def self.included(target)
target.class_eval do
# Alias old class's initialize so we can get it to after
# Otherwise initialize attempts to go to an initialize that doesn't take an arg
alias_method :old_initialize, :initialize
def initialize(user)
# Let other permissions run before this
old_initialize(user)
user ||= User.new # anonymous user
if user.can_read_forem_forums?
can :read, Forem::Forum do |forum|
user.can_read_forem_forum?(forum)
end
end
can :read, Forem::Category do |category|
user.can_read_forem_category?(category)
end
end
end
-
- can :read, :forums
end
end
end | 2 | 0.058824 | 0 | 2 |
4afaabee62e13b6cb1947106e93deb928451f65d | peril/compareReactionSchema.ts | peril/compareReactionSchema.ts | import { buildSchema } from "graphql"
import { readFileSync } from "fs"
const { diff: schemaDiff } = require("@graphql-inspector/core")
import fetch from "node-fetch"
import { warn } from "danger"
// If there is a breaking change between the local schema,
// and the current Reaction one, warn.
export default async () => {
const forcePackageJSON = await (await fetch(
"https://raw.githubusercontent.com/artsy/force/release/package.json"
)).json()
const reactionVersion = forcePackageJSON["dependencies"]["@artsy/reaction"]
const reactionSchemaUrl = `https://github.com/artsy/reaction/raw/v${reactionVersion}/data/schema.graphql`
const reactionSchema = await (await fetch(reactionSchemaUrl)).text()
const localSchema = readFileSync("_schemaV2.graphql", "utf8")
const allChanges = schemaDiff(
buildSchema(reactionSchema),
buildSchema(localSchema)
)
const breakings = allChanges.filter(c => c.criticality.level === "BREAKING")
const messages = breakings.map(c => c.message)
if (messages.length) {
warn(
`The V2 schema in this PR has breaking changes with production Force. Remember to update Reaction if necessary:\n\n${messages}`
)
}
}
| import { buildSchema } from "graphql"
const { diff: schemaDiff } = require("@graphql-inspector/core")
import fetch from "node-fetch"
import { warn, danger } from "danger"
// If there is a breaking change between the local schema,
// and the current Reaction one, warn.
export default async () => {
const forcePackageJSON = await (await fetch(
"https://raw.githubusercontent.com/artsy/force/release/package.json"
)).json()
const reactionVersion = forcePackageJSON["dependencies"]["@artsy/reaction"]
const reactionSchemaUrl = `https://github.com/artsy/reaction/raw/v${reactionVersion}/data/schema.graphql`
const reactionSchema = await (await fetch(reactionSchemaUrl)).text()
const repo = danger.github.pr.head.repo.full_name
const sha = danger.github.pr.head.sha
const localSchema = await (await fetch(
`https://raw.githubusercontent.com/${repo}/${sha}/_schemaV2.graphql`
)).text()
const allChanges = schemaDiff(
buildSchema(reactionSchema),
buildSchema(localSchema)
)
const breakings = allChanges.filter(c => c.criticality.level === "BREAKING")
const messages = breakings.map(c => c.message)
if (messages.length) {
warn(
`The V2 schema in this PR has breaking changes with production Force. Remember to update Reaction if necessary:\n\n${messages}`
)
}
}
| Tweak schema check to infer URL to PR schema | [Peril] Tweak schema check to infer URL to PR schema
| TypeScript | mit | artsy/metaphysics,artsy/metaphysics,artsy/metaphysics | typescript | ## Code Before:
import { buildSchema } from "graphql"
import { readFileSync } from "fs"
const { diff: schemaDiff } = require("@graphql-inspector/core")
import fetch from "node-fetch"
import { warn } from "danger"
// If there is a breaking change between the local schema,
// and the current Reaction one, warn.
export default async () => {
const forcePackageJSON = await (await fetch(
"https://raw.githubusercontent.com/artsy/force/release/package.json"
)).json()
const reactionVersion = forcePackageJSON["dependencies"]["@artsy/reaction"]
const reactionSchemaUrl = `https://github.com/artsy/reaction/raw/v${reactionVersion}/data/schema.graphql`
const reactionSchema = await (await fetch(reactionSchemaUrl)).text()
const localSchema = readFileSync("_schemaV2.graphql", "utf8")
const allChanges = schemaDiff(
buildSchema(reactionSchema),
buildSchema(localSchema)
)
const breakings = allChanges.filter(c => c.criticality.level === "BREAKING")
const messages = breakings.map(c => c.message)
if (messages.length) {
warn(
`The V2 schema in this PR has breaking changes with production Force. Remember to update Reaction if necessary:\n\n${messages}`
)
}
}
## Instruction:
[Peril] Tweak schema check to infer URL to PR schema
## Code After:
import { buildSchema } from "graphql"
const { diff: schemaDiff } = require("@graphql-inspector/core")
import fetch from "node-fetch"
import { warn, danger } from "danger"
// If there is a breaking change between the local schema,
// and the current Reaction one, warn.
export default async () => {
const forcePackageJSON = await (await fetch(
"https://raw.githubusercontent.com/artsy/force/release/package.json"
)).json()
const reactionVersion = forcePackageJSON["dependencies"]["@artsy/reaction"]
const reactionSchemaUrl = `https://github.com/artsy/reaction/raw/v${reactionVersion}/data/schema.graphql`
const reactionSchema = await (await fetch(reactionSchemaUrl)).text()
const repo = danger.github.pr.head.repo.full_name
const sha = danger.github.pr.head.sha
const localSchema = await (await fetch(
`https://raw.githubusercontent.com/${repo}/${sha}/_schemaV2.graphql`
)).text()
const allChanges = schemaDiff(
buildSchema(reactionSchema),
buildSchema(localSchema)
)
const breakings = allChanges.filter(c => c.criticality.level === "BREAKING")
const messages = breakings.map(c => c.message)
if (messages.length) {
warn(
`The V2 schema in this PR has breaking changes with production Force. Remember to update Reaction if necessary:\n\n${messages}`
)
}
}
| import { buildSchema } from "graphql"
- import { readFileSync } from "fs"
const { diff: schemaDiff } = require("@graphql-inspector/core")
import fetch from "node-fetch"
- import { warn } from "danger"
+ import { warn, danger } from "danger"
? ++++++++
// If there is a breaking change between the local schema,
// and the current Reaction one, warn.
export default async () => {
const forcePackageJSON = await (await fetch(
"https://raw.githubusercontent.com/artsy/force/release/package.json"
)).json()
const reactionVersion = forcePackageJSON["dependencies"]["@artsy/reaction"]
const reactionSchemaUrl = `https://github.com/artsy/reaction/raw/v${reactionVersion}/data/schema.graphql`
const reactionSchema = await (await fetch(reactionSchemaUrl)).text()
- const localSchema = readFileSync("_schemaV2.graphql", "utf8")
+ const repo = danger.github.pr.head.repo.full_name
+ const sha = danger.github.pr.head.sha
+ const localSchema = await (await fetch(
+ `https://raw.githubusercontent.com/${repo}/${sha}/_schemaV2.graphql`
+ )).text()
const allChanges = schemaDiff(
buildSchema(reactionSchema),
buildSchema(localSchema)
)
const breakings = allChanges.filter(c => c.criticality.level === "BREAKING")
const messages = breakings.map(c => c.message)
if (messages.length) {
warn(
`The V2 schema in this PR has breaking changes with production Force. Remember to update Reaction if necessary:\n\n${messages}`
)
}
} | 9 | 0.3 | 6 | 3 |
0999529f64a0b8ac8317ef1e941ed56bb834f7a6 | freenas/scripts/api-v2.0-tests.sh | freenas/scripts/api-v2.0-tests.sh | PROGDIR="`realpath | sed 's|/scripts||g'`" ; export PROGDIR
# Source our Testing functions
. ${PROGDIR}/scripts/functions.sh
. ${PROGDIR}/scripts/functions-tests.sh
# Installl modules
pip3.6 install requests
#################################################################
# Run the tests now!
#################################################################
echo "Using API Address: http://${FNASTESTIP}/api/v2.0"
git clone https://www.github.com/freenas/freenas --depth=1 /freenas
cd /freenas/src/middlewared
pip3.6 uninstall -y middlewared.client
python3.6 setup_client.py install
cd /freenas/src/middlewared/middlewared/pytest
echo [Target] > target.conf
echo hostname = ${FNASTESTIP} >> target.conf
echo api = /api/v2.0/ >> target.conf
echo username = "root" >> target.conf
echo password = "testing" >> target.conf
sed -i '' "s|'freenas'|'testing'|g" functional/test_0001_authentication.py
python3.6 -m pytest -sv functional --junitxml=$RESULTSDIR/results.xml.v2.0
TOTALTESTS="14"
publish_pytest_results "$TOTALCOUNT"
exit 0
| PROGDIR="`realpath | sed 's|/scripts||g'`" ; export PROGDIR
# Source our Testing functions
. ${PROGDIR}/scripts/functions.sh
. ${PROGDIR}/scripts/functions-tests.sh
# Installl modules
pip3.6 install requests
#################################################################
# Run the tests now!
#################################################################
echo "Using API Address: http://${FNASTESTIP}/api/v2.0"
git clone https://www.github.com/freenas/freenas --depth=1 /freenas
cd /freenas/src/middlewared
pip3.6 uninstall -y middlewared.client
python3.6 setup_client.py install --single-version-externally-managed --record $(mktemp)
cd /freenas/src/middlewared/middlewared/pytest
echo [Target] > target.conf
echo hostname = ${FNASTESTIP} >> target.conf
echo api = /api/v2.0/ >> target.conf
echo username = "root" >> target.conf
echo password = "testing" >> target.conf
sed -i '' "s|'freenas'|'testing'|g" functional/test_0001_authentication.py
python3.6 -m pytest -sv functional --junitxml=$RESULTSDIR/results.xml.v2.0
TOTALTESTS="14"
publish_pytest_results "$TOTALCOUNT"
exit 0
| Install middlewared.client with --single-version-externally-managed so it can be imported correctly | Install middlewared.client with --single-version-externally-managed so
it can be imported correctly
| Shell | bsd-2-clause | iXsystems/ixbuild,iXsystems/ix-tests,iXsystems/ix-tests | shell | ## Code Before:
PROGDIR="`realpath | sed 's|/scripts||g'`" ; export PROGDIR
# Source our Testing functions
. ${PROGDIR}/scripts/functions.sh
. ${PROGDIR}/scripts/functions-tests.sh
# Installl modules
pip3.6 install requests
#################################################################
# Run the tests now!
#################################################################
echo "Using API Address: http://${FNASTESTIP}/api/v2.0"
git clone https://www.github.com/freenas/freenas --depth=1 /freenas
cd /freenas/src/middlewared
pip3.6 uninstall -y middlewared.client
python3.6 setup_client.py install
cd /freenas/src/middlewared/middlewared/pytest
echo [Target] > target.conf
echo hostname = ${FNASTESTIP} >> target.conf
echo api = /api/v2.0/ >> target.conf
echo username = "root" >> target.conf
echo password = "testing" >> target.conf
sed -i '' "s|'freenas'|'testing'|g" functional/test_0001_authentication.py
python3.6 -m pytest -sv functional --junitxml=$RESULTSDIR/results.xml.v2.0
TOTALTESTS="14"
publish_pytest_results "$TOTALCOUNT"
exit 0
## Instruction:
Install middlewared.client with --single-version-externally-managed so
it can be imported correctly
## Code After:
PROGDIR="`realpath | sed 's|/scripts||g'`" ; export PROGDIR
# Source our Testing functions
. ${PROGDIR}/scripts/functions.sh
. ${PROGDIR}/scripts/functions-tests.sh
# Installl modules
pip3.6 install requests
#################################################################
# Run the tests now!
#################################################################
echo "Using API Address: http://${FNASTESTIP}/api/v2.0"
git clone https://www.github.com/freenas/freenas --depth=1 /freenas
cd /freenas/src/middlewared
pip3.6 uninstall -y middlewared.client
python3.6 setup_client.py install --single-version-externally-managed --record $(mktemp)
cd /freenas/src/middlewared/middlewared/pytest
echo [Target] > target.conf
echo hostname = ${FNASTESTIP} >> target.conf
echo api = /api/v2.0/ >> target.conf
echo username = "root" >> target.conf
echo password = "testing" >> target.conf
sed -i '' "s|'freenas'|'testing'|g" functional/test_0001_authentication.py
python3.6 -m pytest -sv functional --junitxml=$RESULTSDIR/results.xml.v2.0
TOTALTESTS="14"
publish_pytest_results "$TOTALCOUNT"
exit 0
| PROGDIR="`realpath | sed 's|/scripts||g'`" ; export PROGDIR
# Source our Testing functions
. ${PROGDIR}/scripts/functions.sh
. ${PROGDIR}/scripts/functions-tests.sh
# Installl modules
pip3.6 install requests
#################################################################
# Run the tests now!
#################################################################
echo "Using API Address: http://${FNASTESTIP}/api/v2.0"
git clone https://www.github.com/freenas/freenas --depth=1 /freenas
cd /freenas/src/middlewared
pip3.6 uninstall -y middlewared.client
- python3.6 setup_client.py install
+ python3.6 setup_client.py install --single-version-externally-managed --record $(mktemp)
cd /freenas/src/middlewared/middlewared/pytest
echo [Target] > target.conf
echo hostname = ${FNASTESTIP} >> target.conf
echo api = /api/v2.0/ >> target.conf
echo username = "root" >> target.conf
echo password = "testing" >> target.conf
sed -i '' "s|'freenas'|'testing'|g" functional/test_0001_authentication.py
python3.6 -m pytest -sv functional --junitxml=$RESULTSDIR/results.xml.v2.0
TOTALTESTS="14"
publish_pytest_results "$TOTALCOUNT"
exit 0 | 2 | 0.064516 | 1 | 1 |
89a25989d69a05a34a8c3b7ae6d7308444034741 | lib/viera_play/player.rb | lib/viera_play/player.rb | module VieraPlay
class Player
def initialize(opts)
@tv = TV.new(opts.fetch(:tv_control_url))
@file_path = opts.fetch(:file_path)
@server = SingleFileServer.new(file_path, opts.fetch(:additional_mime_types, {}))
end
def call
trap_interrupt
play_and_wait
end
private
attr_reader :tv, :file_path, :server
def trap_interrupt
trap 'INT' do
tv.stop
server.shutdown
end
end
def play_and_wait
http_server_thread = Thread.new { server.start }
tv.play_uri(server.url)
http_server_thread.join
end
end
end
| require "curses"
module VieraPlay
class Player
def initialize(opts)
@tv = TV.new(opts.fetch(:tv_control_url))
@file_path = opts.fetch(:file_path)
@server = SingleFileServer.new(file_path, opts.fetch(:additional_mime_types, {}))
end
def call
trap_interrupt
play_and_wait
end
private
attr_reader :tv, :file_path, :server
def trap_interrupt
trap 'INT' do
tv.stop
server.shutdown
end
end
def play_and_wait
http_server_thread = Thread.new { server.start }
tv.play_uri(server.url)
Curses.noecho
Curses.init_screen
Curses.stdscr.keypad(true) # enable arrow keys
Curses.mousemask(Curses::BUTTON1_CLICKED)
win = Curses::Window.new(4, (Curses.cols - 2), Curses.lines/2 - 1, 1)
width = Curses.cols - 4
monitor = Thread.start do
loop do
sleep 1
info = tv.get_position_info
win.clear
win.box('|', '-', '+')
win.setpos(1,1)
win << '#' * (width * info.position.to_i/(info.duration.to_i + 0.0001))
win.setpos(2,1)
win.addstr("%s of %s - %20s" % [info.position, info.duration, info.track])
win.refresh
end
end
while c = Curses.getch
case c
when Curses::Key::LEFT
tv.seek_by(-30)
when Curses::Key::RIGHT
tv.seek_by(30)
when 'p'
tv.pause
when 'q'
tv.stop
server.shutdown
break
when Curses::KEY_MOUSE
if m = Curses.getmouse
v = (m.x - 2).to_f / (width) * tv.get_position_info.duration.to_i
tv.seek_to(v)
end
end
end
http_server_thread.join
monitor.kill
monitor.join
end
end
end
| Add basic UI, including click to seek! | Add basic UI, including click to seek!
| Ruby | mit | cwninja/viera_play | ruby | ## Code Before:
module VieraPlay
class Player
def initialize(opts)
@tv = TV.new(opts.fetch(:tv_control_url))
@file_path = opts.fetch(:file_path)
@server = SingleFileServer.new(file_path, opts.fetch(:additional_mime_types, {}))
end
def call
trap_interrupt
play_and_wait
end
private
attr_reader :tv, :file_path, :server
def trap_interrupt
trap 'INT' do
tv.stop
server.shutdown
end
end
def play_and_wait
http_server_thread = Thread.new { server.start }
tv.play_uri(server.url)
http_server_thread.join
end
end
end
## Instruction:
Add basic UI, including click to seek!
## Code After:
require "curses"
module VieraPlay
class Player
def initialize(opts)
@tv = TV.new(opts.fetch(:tv_control_url))
@file_path = opts.fetch(:file_path)
@server = SingleFileServer.new(file_path, opts.fetch(:additional_mime_types, {}))
end
def call
trap_interrupt
play_and_wait
end
private
attr_reader :tv, :file_path, :server
def trap_interrupt
trap 'INT' do
tv.stop
server.shutdown
end
end
def play_and_wait
http_server_thread = Thread.new { server.start }
tv.play_uri(server.url)
Curses.noecho
Curses.init_screen
Curses.stdscr.keypad(true) # enable arrow keys
Curses.mousemask(Curses::BUTTON1_CLICKED)
win = Curses::Window.new(4, (Curses.cols - 2), Curses.lines/2 - 1, 1)
width = Curses.cols - 4
monitor = Thread.start do
loop do
sleep 1
info = tv.get_position_info
win.clear
win.box('|', '-', '+')
win.setpos(1,1)
win << '#' * (width * info.position.to_i/(info.duration.to_i + 0.0001))
win.setpos(2,1)
win.addstr("%s of %s - %20s" % [info.position, info.duration, info.track])
win.refresh
end
end
while c = Curses.getch
case c
when Curses::Key::LEFT
tv.seek_by(-30)
when Curses::Key::RIGHT
tv.seek_by(30)
when 'p'
tv.pause
when 'q'
tv.stop
server.shutdown
break
when Curses::KEY_MOUSE
if m = Curses.getmouse
v = (m.x - 2).to_f / (width) * tv.get_position_info.duration.to_i
tv.seek_to(v)
end
end
end
http_server_thread.join
monitor.kill
monitor.join
end
end
end
| + require "curses"
+
module VieraPlay
class Player
def initialize(opts)
@tv = TV.new(opts.fetch(:tv_control_url))
@file_path = opts.fetch(:file_path)
@server = SingleFileServer.new(file_path, opts.fetch(:additional_mime_types, {}))
end
def call
trap_interrupt
play_and_wait
end
private
attr_reader :tv, :file_path, :server
def trap_interrupt
trap 'INT' do
tv.stop
server.shutdown
end
end
def play_and_wait
http_server_thread = Thread.new { server.start }
tv.play_uri(server.url)
+ Curses.noecho
+ Curses.init_screen
+ Curses.stdscr.keypad(true) # enable arrow keys
+
+ Curses.mousemask(Curses::BUTTON1_CLICKED)
+ win = Curses::Window.new(4, (Curses.cols - 2), Curses.lines/2 - 1, 1)
+ width = Curses.cols - 4
+ monitor = Thread.start do
+ loop do
+ sleep 1
+ info = tv.get_position_info
+ win.clear
+ win.box('|', '-', '+')
+ win.setpos(1,1)
+ win << '#' * (width * info.position.to_i/(info.duration.to_i + 0.0001))
+ win.setpos(2,1)
+ win.addstr("%s of %s - %20s" % [info.position, info.duration, info.track])
+ win.refresh
+ end
+ end
+
+ while c = Curses.getch
+ case c
+ when Curses::Key::LEFT
+ tv.seek_by(-30)
+ when Curses::Key::RIGHT
+ tv.seek_by(30)
+ when 'p'
+ tv.pause
+ when 'q'
+ tv.stop
+ server.shutdown
+ break
+ when Curses::KEY_MOUSE
+ if m = Curses.getmouse
+ v = (m.x - 2).to_f / (width) * tv.get_position_info.duration.to_i
+ tv.seek_to(v)
+ end
+ end
+ end
http_server_thread.join
+ monitor.kill
+ monitor.join
end
end
end | 44 | 1.466667 | 44 | 0 |
4cc2c1880edd2462eeafbb000f922ce51a728703 | elements-sk/package.json | elements-sk/package.json | {
"name": "elements-sk",
"version": "2.2.0",
"private": false,
"description": "A set of light-weight custom elements with a uniform style.",
"main": "index.js",
"homepage": "https://github.com/google/skia-buildbot/tree/master/ap/skia-elements",
"license": "Apache-2.0"
}
| {
"name": "elements-sk",
"version": "2.2.1",
"private": false,
"description": "A set of light-weight custom elements with a uniform style.",
"main": "index.js",
"homepage": "https://github.com/google/elements-sk/",
"license": "Apache-2.0"
}
| Update homepage since the repo has moved. | Update homepage since the repo has moved.
| JSON | apache-2.0 | google/elements-sk,google/elements-sk,google/elements-sk,google/elements-sk | json | ## Code Before:
{
"name": "elements-sk",
"version": "2.2.0",
"private": false,
"description": "A set of light-weight custom elements with a uniform style.",
"main": "index.js",
"homepage": "https://github.com/google/skia-buildbot/tree/master/ap/skia-elements",
"license": "Apache-2.0"
}
## Instruction:
Update homepage since the repo has moved.
## Code After:
{
"name": "elements-sk",
"version": "2.2.1",
"private": false,
"description": "A set of light-weight custom elements with a uniform style.",
"main": "index.js",
"homepage": "https://github.com/google/elements-sk/",
"license": "Apache-2.0"
}
| {
"name": "elements-sk",
- "version": "2.2.0",
? ^
+ "version": "2.2.1",
? ^
"private": false,
"description": "A set of light-weight custom elements with a uniform style.",
"main": "index.js",
- "homepage": "https://github.com/google/skia-buildbot/tree/master/ap/skia-elements",
+ "homepage": "https://github.com/google/elements-sk/",
"license": "Apache-2.0"
} | 4 | 0.444444 | 2 | 2 |
111cfeaca0bdca16a24f03e28cf7590b2fce5e2d | core/array/constructor_spec.rb | core/array/constructor_spec.rb | require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "Array.[]" do
it "returns a new array populated with the given elements" do
obj = Object.new
Array.[](5, true, nil, 'a', "Ruby", obj).should == [5, true, nil, "a", "Ruby", obj]
a = ArraySpecs::MyArray.[](5, true, nil, 'a', "Ruby", obj)
a.should be_kind_of(ArraySpecs::MyArray)
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
describe "Array[]" do
it "is a synonym for .[]" do
obj = Object.new
Array[5, true, nil, 'a', "Ruby", obj].should == Array.[](5, true, nil, "a", "Ruby", obj)
a = ArraySpecs::MyArray[5, true, nil, 'a', "Ruby", obj]
a.should be_kind_of(ArraySpecs::MyArray)
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
| require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "Array.[]" do
it "returns a new array populated with the given elements" do
obj = Object.new
Array.[](5, true, nil, 'a', "Ruby", obj).should == [5, true, nil, "a", "Ruby", obj]
a = ArraySpecs::MyArray.[](5, true, nil, 'a', "Ruby", obj)
a.should be_an_instance_of(ArraySpecs::MyArray)
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
describe "Array[]" do
it "is a synonym for .[]" do
obj = Object.new
Array[5, true, nil, 'a', "Ruby", obj].should == Array.[](5, true, nil, "a", "Ruby", obj)
a = ArraySpecs::MyArray[5, true, nil, 'a', "Ruby", obj]
a.should be_an_instance_of(ArraySpecs::MyArray)
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
| Fix spec instance~class matchers for Array.[] | Fix spec instance~class matchers for Array.[]
| Ruby | mit | kachick/rubyspec,eregon/rubyspec,DavidEGrayson/rubyspec,BanzaiMan/rubyspec,bl4ckdu5t/rubyspec,lucaspinto/rubyspec,scooter-dangle/rubyspec,askl56/rubyspec,agrimm/rubyspec,saturnflyer/rubyspec,chesterbr/rubyspec,ruby/rubyspec,Aesthetikx/rubyspec,eregon/rubyspec,mbj/rubyspec,sferik/rubyspec,yaauie/rubyspec,mbj/rubyspec,saturnflyer/rubyspec,BanzaiMan/rubyspec,benlovell/rubyspec,lucaspinto/rubyspec,bl4ckdu5t/rubyspec,sgarciac/spec,askl56/rubyspec,ericmeyer/rubyspec,atambo/rubyspec,Aesthetikx/rubyspec,DawidJanczak/rubyspec,jannishuebl/rubyspec,nobu/rubyspec,agrimm/rubyspec,DavidEGrayson/rubyspec,eregon/rubyspec,teleological/rubyspec,iainbeeston/rubyspec,kidaa/rubyspec,ruby/rubyspec,kachick/rubyspec,nobu/rubyspec,ruby/spec,josedonizetti/rubyspec,chesterbr/rubyspec,sgarciac/spec,iliabylich/rubyspec,alexch/rubyspec,scooter-dangle/rubyspec,josedonizetti/rubyspec,ericmeyer/rubyspec,atambo/rubyspec,ruby/spec,yous/rubyspec,sferik/rubyspec,alexch/rubyspec,wied03/rubyspec,bomatson/rubyspec,wied03/rubyspec,iainbeeston/rubyspec,kachick/rubyspec,iliabylich/rubyspec,wied03/rubyspec,ruby/spec,jannishuebl/rubyspec,benlovell/rubyspec,sgarciac/spec,teleological/rubyspec,bomatson/rubyspec,yaauie/rubyspec,nobu/rubyspec,kidaa/rubyspec,DawidJanczak/rubyspec,yous/rubyspec | ruby | ## Code Before:
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "Array.[]" do
it "returns a new array populated with the given elements" do
obj = Object.new
Array.[](5, true, nil, 'a', "Ruby", obj).should == [5, true, nil, "a", "Ruby", obj]
a = ArraySpecs::MyArray.[](5, true, nil, 'a', "Ruby", obj)
a.should be_kind_of(ArraySpecs::MyArray)
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
describe "Array[]" do
it "is a synonym for .[]" do
obj = Object.new
Array[5, true, nil, 'a', "Ruby", obj].should == Array.[](5, true, nil, "a", "Ruby", obj)
a = ArraySpecs::MyArray[5, true, nil, 'a', "Ruby", obj]
a.should be_kind_of(ArraySpecs::MyArray)
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
## Instruction:
Fix spec instance~class matchers for Array.[]
## Code After:
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "Array.[]" do
it "returns a new array populated with the given elements" do
obj = Object.new
Array.[](5, true, nil, 'a', "Ruby", obj).should == [5, true, nil, "a", "Ruby", obj]
a = ArraySpecs::MyArray.[](5, true, nil, 'a', "Ruby", obj)
a.should be_an_instance_of(ArraySpecs::MyArray)
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
describe "Array[]" do
it "is a synonym for .[]" do
obj = Object.new
Array[5, true, nil, 'a', "Ruby", obj].should == Array.[](5, true, nil, "a", "Ruby", obj)
a = ArraySpecs::MyArray[5, true, nil, 'a', "Ruby", obj]
a.should be_an_instance_of(ArraySpecs::MyArray)
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
| require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)
describe "Array.[]" do
it "returns a new array populated with the given elements" do
obj = Object.new
Array.[](5, true, nil, 'a', "Ruby", obj).should == [5, true, nil, "a", "Ruby", obj]
a = ArraySpecs::MyArray.[](5, true, nil, 'a', "Ruby", obj)
- a.should be_kind_of(ArraySpecs::MyArray)
? ^ ^
+ a.should be_an_instance_of(ArraySpecs::MyArray)
? ^^^ ^^^^^^
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end
describe "Array[]" do
it "is a synonym for .[]" do
obj = Object.new
Array[5, true, nil, 'a', "Ruby", obj].should == Array.[](5, true, nil, "a", "Ruby", obj)
a = ArraySpecs::MyArray[5, true, nil, 'a', "Ruby", obj]
- a.should be_kind_of(ArraySpecs::MyArray)
? ^ ^
+ a.should be_an_instance_of(ArraySpecs::MyArray)
? ^^^ ^^^^^^
a.inspect.should == [5, true, nil, "a", "Ruby", obj].inspect
end
end | 4 | 0.166667 | 2 | 2 |
5f06f558722a68b07c8e123b05c49d3bbece86fb | app/views/talks/_form.html.erb | app/views/talks/_form.html.erb | <%= form_for(@talk) do |f| %>
<% if @talk.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@talk.errors.count, "error") %> prohibited this talk from being saved:</h2>
<ul>
<% @talk.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<table>
<tr class="field">
<th><%= f.label :title %></th>
<td><%= f.text_field :title, class: 'form-control' %></td>
</tr>
<tr class="field">
<th><%= f.label :speaker %></th>
<td>
<%= f.select :speaker_id, Speaker.all.map {|speaker| [speaker.name, speaker.id] }, {include_blank: true}, {class: 'form-control'} %>
</td>
</tr>
<tr class="field">
<th><%= f.label :description %></th>
<td><%= f.text_area :description, class: 'form-control' %></td>
</tr>
<tr class="actions">
<td colspan="2"><%= f.submit class: 'btn btn-success' %></td>
</tr>
</table>
<% end %>
| <%= form_for(@talk) do |f| %>
<% if @talk.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@talk.errors.count, "error") %> prohibited this talk from being saved:</h2>
<ul>
<% @talk.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<table>
<tr class="field">
<th><%= f.label :title %></th>
<td><%= f.text_field :title, class: 'form-control' %></td>
</tr>
<tr class="field">
<th><%= f.label :speaker %></th>
<td>
<%= f.select :speaker_id, Speaker.all.map {|speaker| [speaker.name, speaker.id] }, {include_blank: true}, {class: 'form-control'} %>
</td>
</tr>
<tr class="field">
<th><%= f.label :description %></th>
<td><%= f.text_area :description, class: 'form-control' %></td>
</tr>
<tr class="field">
<th><%= f.label :meeting %></th>
<td><%= f.select :meeting_id, Meeting.upcoming.map {|meeting| [meeting.date, meeting.id] }, {include_blank: true}, {class: 'form-control'} %></td>
</tr>
<tr class="actions">
<td colspan="2"><%= f.submit class: 'btn btn-success' %></td>
</tr>
</table>
<% end %>
| Add dropdown to add a meeting to the talk | Add dropdown to add a meeting to the talk
| HTML+ERB | unlicense | danascheider/testrubypdx,danascheider/testrubypdx,danascheider/testrubypdx | html+erb | ## Code Before:
<%= form_for(@talk) do |f| %>
<% if @talk.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@talk.errors.count, "error") %> prohibited this talk from being saved:</h2>
<ul>
<% @talk.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<table>
<tr class="field">
<th><%= f.label :title %></th>
<td><%= f.text_field :title, class: 'form-control' %></td>
</tr>
<tr class="field">
<th><%= f.label :speaker %></th>
<td>
<%= f.select :speaker_id, Speaker.all.map {|speaker| [speaker.name, speaker.id] }, {include_blank: true}, {class: 'form-control'} %>
</td>
</tr>
<tr class="field">
<th><%= f.label :description %></th>
<td><%= f.text_area :description, class: 'form-control' %></td>
</tr>
<tr class="actions">
<td colspan="2"><%= f.submit class: 'btn btn-success' %></td>
</tr>
</table>
<% end %>
## Instruction:
Add dropdown to add a meeting to the talk
## Code After:
<%= form_for(@talk) do |f| %>
<% if @talk.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@talk.errors.count, "error") %> prohibited this talk from being saved:</h2>
<ul>
<% @talk.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<table>
<tr class="field">
<th><%= f.label :title %></th>
<td><%= f.text_field :title, class: 'form-control' %></td>
</tr>
<tr class="field">
<th><%= f.label :speaker %></th>
<td>
<%= f.select :speaker_id, Speaker.all.map {|speaker| [speaker.name, speaker.id] }, {include_blank: true}, {class: 'form-control'} %>
</td>
</tr>
<tr class="field">
<th><%= f.label :description %></th>
<td><%= f.text_area :description, class: 'form-control' %></td>
</tr>
<tr class="field">
<th><%= f.label :meeting %></th>
<td><%= f.select :meeting_id, Meeting.upcoming.map {|meeting| [meeting.date, meeting.id] }, {include_blank: true}, {class: 'form-control'} %></td>
</tr>
<tr class="actions">
<td colspan="2"><%= f.submit class: 'btn btn-success' %></td>
</tr>
</table>
<% end %>
| <%= form_for(@talk) do |f| %>
<% if @talk.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@talk.errors.count, "error") %> prohibited this talk from being saved:</h2>
<ul>
<% @talk.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>
<table>
<tr class="field">
<th><%= f.label :title %></th>
<td><%= f.text_field :title, class: 'form-control' %></td>
</tr>
<tr class="field">
- <th><%= f.label :speaker %></th>
? --
+ <th><%= f.label :speaker %></th>
- <td>
? --
+ <td>
- <%= f.select :speaker_id, Speaker.all.map {|speaker| [speaker.name, speaker.id] }, {include_blank: true}, {class: 'form-control'} %>
? --
+ <%= f.select :speaker_id, Speaker.all.map {|speaker| [speaker.name, speaker.id] }, {include_blank: true}, {class: 'form-control'} %>
- </td>
? --
+ </td>
</tr>
<tr class="field">
<th><%= f.label :description %></th>
<td><%= f.text_area :description, class: 'form-control' %></td>
+ </tr>
+ <tr class="field">
+ <th><%= f.label :meeting %></th>
+ <td><%= f.select :meeting_id, Meeting.upcoming.map {|meeting| [meeting.date, meeting.id] }, {include_blank: true}, {class: 'form-control'} %></td>
</tr>
<tr class="actions">
<td colspan="2"><%= f.submit class: 'btn btn-success' %></td>
</tr>
</table>
<% end %> | 12 | 0.363636 | 8 | 4 |
ab856c2e092814e87ffd840b25fe9a273b3cc173 | requirements.txt | requirements.txt | betamax==0.5.0
nose==1.3.7
PyYAML==3.11
requests==2.7.0
wheel==0.24.0
| betamax==0.5.0
matplotlib==1.4.3
nose==1.3.7
numpy==1.9.2
pyparsing==2.0.3
python-dateutil==2.4.2
pytz==2015.4
PyYAML==3.11
requests==2.7.0
six==1.9.0
wheel==0.24.0
| Add matplotlib package (and it's dependencies). | Add matplotlib package (and it's dependencies).
| Text | mit | mygulamali/rajab_roza | text | ## Code Before:
betamax==0.5.0
nose==1.3.7
PyYAML==3.11
requests==2.7.0
wheel==0.24.0
## Instruction:
Add matplotlib package (and it's dependencies).
## Code After:
betamax==0.5.0
matplotlib==1.4.3
nose==1.3.7
numpy==1.9.2
pyparsing==2.0.3
python-dateutil==2.4.2
pytz==2015.4
PyYAML==3.11
requests==2.7.0
six==1.9.0
wheel==0.24.0
| betamax==0.5.0
+ matplotlib==1.4.3
nose==1.3.7
+ numpy==1.9.2
+ pyparsing==2.0.3
+ python-dateutil==2.4.2
+ pytz==2015.4
PyYAML==3.11
requests==2.7.0
+ six==1.9.0
wheel==0.24.0 | 6 | 1.2 | 6 | 0 |
720102873c40b56b03acabc5a4a161d8df9029bb | src/main/java/org/ndexbio/model/object/network/Namespace.java | src/main/java/org/ndexbio/model/object/network/Namespace.java | package org.ndexbio.model.object.network;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Namespace extends NetworkElement
{
private String _prefix;
private String _uri;
/**************************************************************************
* Default constructor.
**************************************************************************/
public Namespace()
{
super();
_type = this.getClass().getSimpleName();
}
public String getPrefix()
{
return _prefix;
}
public void setPrefix(String prefix) //throws Exception
{
// if ( prefix == null ) throw new Exception("Prefix for Namespace can't be null.");
_prefix = prefix;
}
public String getUri()
{
return _uri;
}
public void setUri(String uri)
{
_uri = uri;
}
}
| package org.ndexbio.model.object.network;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Namespace extends PropertiedNetworkElement
{
private String _prefix;
private String _uri;
/**************************************************************************
* Default constructor.
**************************************************************************/
public Namespace()
{
super();
_type = this.getClass().getSimpleName();
}
public String getPrefix()
{
return _prefix;
}
public void setPrefix(String prefix) //throws Exception
{
// if ( prefix == null ) throw new Exception("Prefix for Namespace can't be null.");
_prefix = prefix;
}
public String getUri()
{
return _uri;
}
public void setUri(String uri)
{
_uri = uri;
}
}
| Extend namespace class from PropertiedNetworkElement. | Extend namespace class from PropertiedNetworkElement. | Java | bsd-3-clause | ndexbio/ndex-object-model | java | ## Code Before:
package org.ndexbio.model.object.network;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Namespace extends NetworkElement
{
private String _prefix;
private String _uri;
/**************************************************************************
* Default constructor.
**************************************************************************/
public Namespace()
{
super();
_type = this.getClass().getSimpleName();
}
public String getPrefix()
{
return _prefix;
}
public void setPrefix(String prefix) //throws Exception
{
// if ( prefix == null ) throw new Exception("Prefix for Namespace can't be null.");
_prefix = prefix;
}
public String getUri()
{
return _uri;
}
public void setUri(String uri)
{
_uri = uri;
}
}
## Instruction:
Extend namespace class from PropertiedNetworkElement.
## Code After:
package org.ndexbio.model.object.network;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class Namespace extends PropertiedNetworkElement
{
private String _prefix;
private String _uri;
/**************************************************************************
* Default constructor.
**************************************************************************/
public Namespace()
{
super();
_type = this.getClass().getSimpleName();
}
public String getPrefix()
{
return _prefix;
}
public void setPrefix(String prefix) //throws Exception
{
// if ( prefix == null ) throw new Exception("Prefix for Namespace can't be null.");
_prefix = prefix;
}
public String getUri()
{
return _uri;
}
public void setUri(String uri)
{
_uri = uri;
}
}
| package org.ndexbio.model.object.network;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
- public class Namespace extends NetworkElement
+ public class Namespace extends PropertiedNetworkElement
? ++++++++++
{
private String _prefix;
private String _uri;
/**************************************************************************
* Default constructor.
**************************************************************************/
public Namespace()
{
super();
_type = this.getClass().getSimpleName();
}
public String getPrefix()
{
return _prefix;
}
public void setPrefix(String prefix) //throws Exception
{
// if ( prefix == null ) throw new Exception("Prefix for Namespace can't be null.");
_prefix = prefix;
}
public String getUri()
{
return _uri;
}
public void setUri(String uri)
{
_uri = uri;
}
} | 2 | 0.046512 | 1 | 1 |
5006643b70ac72a6a1cdde851b9b1a416c55f829 | app/assets/javascripts/comment_editor.js | app/assets/javascripts/comment_editor.js | $(function(){
// initialize tinymce object for posts editor
tinymce.init({
selector: '#comment_editor',
width: 600,
height: 300,
menubar: false,
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'save table contextmenu directionality emoticons template paste textcolor'
],
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | preview media fullpage | forecolor backcolor emoticons',
});
}); | $(function(){
// initialize tinymce object for posts editor
tinymce.init({
selector: '#comment_editor',
width: 600,
menubar: false,
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'save table contextmenu directionality emoticons template paste textcolor'
],
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | preview media fullpage | forecolor backcolor emoticons',
});
}); | Change height of comment box | Change height of comment box
| JavaScript | mit | pratikmshah/myblog,pratikmshah/myblog,pratikmshah/myblog | javascript | ## Code Before:
$(function(){
// initialize tinymce object for posts editor
tinymce.init({
selector: '#comment_editor',
width: 600,
height: 300,
menubar: false,
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'save table contextmenu directionality emoticons template paste textcolor'
],
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | preview media fullpage | forecolor backcolor emoticons',
});
});
## Instruction:
Change height of comment box
## Code After:
$(function(){
// initialize tinymce object for posts editor
tinymce.init({
selector: '#comment_editor',
width: 600,
menubar: false,
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'save table contextmenu directionality emoticons template paste textcolor'
],
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | preview media fullpage | forecolor backcolor emoticons',
});
}); | $(function(){
// initialize tinymce object for posts editor
tinymce.init({
selector: '#comment_editor',
width: 600,
- height: 300,
menubar: false,
plugins: [
'advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker',
'searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking',
'save table contextmenu directionality emoticons template paste textcolor'
],
toolbar: 'insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | preview media fullpage | forecolor backcolor emoticons',
});
}); | 1 | 0.058824 | 0 | 1 |
4c2cc0e36c01c13532e70dfc7ac0e1fc3cbe1336 | .travis.yml | .travis.yml | language: c
compiler:
- gcc
- clang
script: autoreconf -f -i && CFLAGS=-Werror ./configure && make check
| env:
matrix:
- JANSSON_BUILD_METHOD=cmake JANSSON_CMAKE_OPTIONS="-DJANSSON_TEST_WITH_VALGRIND=ON" JANSSON_EXTRA_INSTALL="valgrind"
- JANSSON_BUILD_METHOD=autotools
language: c
compiler:
- gcc
- clang
install:
- sudo apt-get update -qq
- sudo apt-get install -y -qq cmake $JANSSON_EXTRA_INSTALL
script:
- if [ "$JANSSON_BUILD_METHOD" = "autotools" ]; then autoreconf -f -i && CFLAGS=-Werror ./configure && make check; fi
- if [ "$JANSSON_BUILD_METHOD" = "cmake" ]; then mkdir build && cd build && cmake .. $JANSSON_CMAKE_OPTIONS && cmake --build . && ctest --output-on-failure; fi
| Add CMake build to Travis config. | Add CMake build to Travis config.
| YAML | mit | OlehKulykov/jansson,Mephistophiles/jansson,bstarynk/jansson,markalanj/jansson,markalanj/jansson,akheron/jansson,wirebirdlabs/featherweight-jansson,AmesianX/jansson,liu3tao/jansson,Vorne/jansson,slackner/jansson,chrullrich/jansson,Mephistophiles/jansson,firepick1/jansson,OlehKulykov/jansson,AmesianX/jansson,markalanj/jansson,slackner/jansson,firepick1/jansson,wirebirdlabs/featherweight-jansson,bstarynk/jansson,npmccallum/jansson,firepick1/jansson,akheron/jansson,bstarynk/jansson,liu3tao/jansson,akheron/jansson,Vorne/jansson,npmccallum/jansson,chrullrich/jansson | yaml | ## Code Before:
language: c
compiler:
- gcc
- clang
script: autoreconf -f -i && CFLAGS=-Werror ./configure && make check
## Instruction:
Add CMake build to Travis config.
## Code After:
env:
matrix:
- JANSSON_BUILD_METHOD=cmake JANSSON_CMAKE_OPTIONS="-DJANSSON_TEST_WITH_VALGRIND=ON" JANSSON_EXTRA_INSTALL="valgrind"
- JANSSON_BUILD_METHOD=autotools
language: c
compiler:
- gcc
- clang
install:
- sudo apt-get update -qq
- sudo apt-get install -y -qq cmake $JANSSON_EXTRA_INSTALL
script:
- if [ "$JANSSON_BUILD_METHOD" = "autotools" ]; then autoreconf -f -i && CFLAGS=-Werror ./configure && make check; fi
- if [ "$JANSSON_BUILD_METHOD" = "cmake" ]; then mkdir build && cd build && cmake .. $JANSSON_CMAKE_OPTIONS && cmake --build . && ctest --output-on-failure; fi
| + env:
+ matrix:
+ - JANSSON_BUILD_METHOD=cmake JANSSON_CMAKE_OPTIONS="-DJANSSON_TEST_WITH_VALGRIND=ON" JANSSON_EXTRA_INSTALL="valgrind"
+ - JANSSON_BUILD_METHOD=autotools
language: c
compiler:
- gcc
- clang
- script: autoreconf -f -i && CFLAGS=-Werror ./configure && make check
+ install:
+ - sudo apt-get update -qq
+ - sudo apt-get install -y -qq cmake $JANSSON_EXTRA_INSTALL
+ script:
+ - if [ "$JANSSON_BUILD_METHOD" = "autotools" ]; then autoreconf -f -i && CFLAGS=-Werror ./configure && make check; fi
+ - if [ "$JANSSON_BUILD_METHOD" = "cmake" ]; then mkdir build && cd build && cmake .. $JANSSON_CMAKE_OPTIONS && cmake --build . && ctest --output-on-failure; fi | 11 | 2.2 | 10 | 1 |
f338a8952e41a0955b40c895c3f031091d1d0f3f | pyproject.toml | pyproject.toml | [build-system]
requires = ["setuptools", "wheel"]
[tool.black]
line-length = 99
skip-string-normalization = true
target-version = ['py27', 'py34', 'py35', 'py36', 'py37']
# Only include files in /flexget/, or directly in project root
include = '^/(flexget/.*)?[^/]*\.pyi?$'
exclude = '''
(
/(
\.git
| \.venv
| \.idea
| dist
| flexget/ui
)/
)
'''
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 99
not_skip = ['__init__.py']
not_known_standard_library = ['builtins']
known_future_library = ['future', 'past' , 'builtins']
known_first_party = ['flexget']
default_section = 'THIRDPARTY'
| [build-system]
requires = ["setuptools", "wheel"]
[tool.black]
line-length = 99
skip-string-normalization = true
target-version = ['py36', 'py37', 'py38']
# Only include files in /flexget/, or directly in project root
include = '^/(flexget/.*)?[^/]*\.pyi?$'
exclude = '''
(
/(
\.git
| \.venv
| \.idea
| dist
| flexget/ui
)/
)
'''
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 99
not_skip = ['__init__.py']
not_known_standard_library = ['builtins']
known_future_library = ['future', 'past' , 'builtins']
known_first_party = ['flexget']
default_section = 'THIRDPARTY'
| Update target-version config for black | Update target-version config for black
| TOML | mit | Flexget/Flexget,malkavi/Flexget,crawln45/Flexget,crawln45/Flexget,ianstalk/Flexget,Flexget/Flexget,Flexget/Flexget,crawln45/Flexget,malkavi/Flexget,crawln45/Flexget,ianstalk/Flexget,Flexget/Flexget,ianstalk/Flexget,malkavi/Flexget,malkavi/Flexget | toml | ## Code Before:
[build-system]
requires = ["setuptools", "wheel"]
[tool.black]
line-length = 99
skip-string-normalization = true
target-version = ['py27', 'py34', 'py35', 'py36', 'py37']
# Only include files in /flexget/, or directly in project root
include = '^/(flexget/.*)?[^/]*\.pyi?$'
exclude = '''
(
/(
\.git
| \.venv
| \.idea
| dist
| flexget/ui
)/
)
'''
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 99
not_skip = ['__init__.py']
not_known_standard_library = ['builtins']
known_future_library = ['future', 'past' , 'builtins']
known_first_party = ['flexget']
default_section = 'THIRDPARTY'
## Instruction:
Update target-version config for black
## Code After:
[build-system]
requires = ["setuptools", "wheel"]
[tool.black]
line-length = 99
skip-string-normalization = true
target-version = ['py36', 'py37', 'py38']
# Only include files in /flexget/, or directly in project root
include = '^/(flexget/.*)?[^/]*\.pyi?$'
exclude = '''
(
/(
\.git
| \.venv
| \.idea
| dist
| flexget/ui
)/
)
'''
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 99
not_skip = ['__init__.py']
not_known_standard_library = ['builtins']
known_future_library = ['future', 'past' , 'builtins']
known_first_party = ['flexget']
default_section = 'THIRDPARTY'
| [build-system]
requires = ["setuptools", "wheel"]
[tool.black]
line-length = 99
skip-string-normalization = true
- target-version = ['py27', 'py34', 'py35', 'py36', 'py37']
+ target-version = ['py36', 'py37', 'py38']
# Only include files in /flexget/, or directly in project root
include = '^/(flexget/.*)?[^/]*\.pyi?$'
exclude = '''
(
/(
\.git
| \.venv
| \.idea
| dist
| flexget/ui
)/
)
'''
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 99
not_skip = ['__init__.py']
not_known_standard_library = ['builtins']
known_future_library = ['future', 'past' , 'builtins']
known_first_party = ['flexget']
default_section = 'THIRDPARTY' | 2 | 0.0625 | 1 | 1 |
93510e324d577f43e69bb5f87fdb742e3871fc17 | .travis.yml | .travis.yml | language: php
php:
- "5.3"
- "5.4"
- "5.5"
- "hhvm"
before_script:
- curl -s https://getcomposer.org/installer | php && php composer.phar update --dev
script:
- mkdir -p build/logs
- php vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml -c SilMock/tests/phpunit.xml SilMock/tests/
after_script:
- php vendor/bin/coveralls -v
| language: php
php:
- "5.6"
- "7.0"
- "7.1"
before_script:
- curl -s https://getcomposer.org/installer | php && php composer.phar update --dev
script:
- mkdir -p build/logs
- php vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml -c SilMock/tests/phpunit.xml SilMock/tests/
after_script:
- php vendor/bin/coveralls -v
| Test against fewer, more recent PHP versions | Test against fewer, more recent PHP versions
| YAML | mit | silinternational/google-api-php-client-mock,silinternational/google-api-php-client-mock | yaml | ## Code Before:
language: php
php:
- "5.3"
- "5.4"
- "5.5"
- "hhvm"
before_script:
- curl -s https://getcomposer.org/installer | php && php composer.phar update --dev
script:
- mkdir -p build/logs
- php vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml -c SilMock/tests/phpunit.xml SilMock/tests/
after_script:
- php vendor/bin/coveralls -v
## Instruction:
Test against fewer, more recent PHP versions
## Code After:
language: php
php:
- "5.6"
- "7.0"
- "7.1"
before_script:
- curl -s https://getcomposer.org/installer | php && php composer.phar update --dev
script:
- mkdir -p build/logs
- php vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml -c SilMock/tests/phpunit.xml SilMock/tests/
after_script:
- php vendor/bin/coveralls -v
| language: php
php:
- - "5.3"
? ^
+ - "5.6"
? ^
- - "5.4"
? ^ ^
+ - "7.0"
? ^ ^
- - "5.5"
? ^ ^
+ - "7.1"
? ^ ^
- - "hhvm"
before_script:
- curl -s https://getcomposer.org/installer | php && php composer.phar update --dev
script:
- mkdir -p build/logs
- php vendor/bin/phpunit --coverage-clover ./build/logs/clover.xml -c SilMock/tests/phpunit.xml SilMock/tests/
after_script:
- php vendor/bin/coveralls -v | 7 | 0.4375 | 3 | 4 |
4d3323e58fb9bd2d2a122b6f2ee54abbc4c39c41 | vendor/assets/javascripts/jsboot.js | vendor/assets/javascripts/jsboot.js | function Jsboot(app, $) {
var jsb;
app.jsboot = app.jsboot || { callbacks: {} };
jsb = app.jsboot;
// callback functions expect one parameter, a
// data object that is stored in the inline
// application/json script tags
jsb.on = function(key, fun) {
key = key.replace('#', '-');
jsb.callbacks['jsboot-' + key] = fun;
};
jsb.runBootstrapping = function(el) {
var $el = $(el),
id = $el.attr('id'),
fun = jsb.callbacks[id],
jsonText, data;
if (typeof(fun) === 'function') {
jsonText = $el.html();
data = JSON.parse(jsonText);
fun(data);
}
};
jsb.runAllBootstrapping = function() {
$('script.jsboot-data').each(function(idx, el){
jsb.runBootstrapping(el);
});
Object.freeze(jsb.callbacks);
};
$(function(){
jsb.runAllBootstrapping();
});
}
| function Jsboot(app, $) {
var jsb;
app.jsboot = app.jsboot || { callbacks: {} };
jsb = app.jsboot;
// callback functions expect one parameter, a
// data object that is stored in the inline
// application/json script tags
jsb.on = function(key, fun) {
key = key.replace('#', '-');
jsb.callbacks['jsboot-' + key] = fun;
};
jsb.runBootstrapping = function(el) {
var $el = $(el),
id = $el.attr('id'),
fun = jsb.callbacks[id],
jsonText, data;
if (typeof(fun) === 'function') {
jsonText = $el.html();
if (jsonText === "") {
data = {};
} else {
data = JSON.parse(jsonText);
}
fun(data);
}
};
jsb.runAllBootstrapping = function() {
$('script.jsboot-data').each(function(idx, el){
jsb.runBootstrapping(el);
});
Object.freeze(jsb.callbacks);
};
$(function(){
jsb.runAllBootstrapping();
});
}
| Handle cases where a boot tag has no data | Handle cases where a boot tag has no data
This is useful if you want to use js boot but don't have data
you need to provide for bootstrapping
| JavaScript | mit | Kajabi/jsboot-rails,Kajabi/jsboot-rails | javascript | ## Code Before:
function Jsboot(app, $) {
var jsb;
app.jsboot = app.jsboot || { callbacks: {} };
jsb = app.jsboot;
// callback functions expect one parameter, a
// data object that is stored in the inline
// application/json script tags
jsb.on = function(key, fun) {
key = key.replace('#', '-');
jsb.callbacks['jsboot-' + key] = fun;
};
jsb.runBootstrapping = function(el) {
var $el = $(el),
id = $el.attr('id'),
fun = jsb.callbacks[id],
jsonText, data;
if (typeof(fun) === 'function') {
jsonText = $el.html();
data = JSON.parse(jsonText);
fun(data);
}
};
jsb.runAllBootstrapping = function() {
$('script.jsboot-data').each(function(idx, el){
jsb.runBootstrapping(el);
});
Object.freeze(jsb.callbacks);
};
$(function(){
jsb.runAllBootstrapping();
});
}
## Instruction:
Handle cases where a boot tag has no data
This is useful if you want to use js boot but don't have data
you need to provide for bootstrapping
## Code After:
function Jsboot(app, $) {
var jsb;
app.jsboot = app.jsboot || { callbacks: {} };
jsb = app.jsboot;
// callback functions expect one parameter, a
// data object that is stored in the inline
// application/json script tags
jsb.on = function(key, fun) {
key = key.replace('#', '-');
jsb.callbacks['jsboot-' + key] = fun;
};
jsb.runBootstrapping = function(el) {
var $el = $(el),
id = $el.attr('id'),
fun = jsb.callbacks[id],
jsonText, data;
if (typeof(fun) === 'function') {
jsonText = $el.html();
if (jsonText === "") {
data = {};
} else {
data = JSON.parse(jsonText);
}
fun(data);
}
};
jsb.runAllBootstrapping = function() {
$('script.jsboot-data').each(function(idx, el){
jsb.runBootstrapping(el);
});
Object.freeze(jsb.callbacks);
};
$(function(){
jsb.runAllBootstrapping();
});
}
| function Jsboot(app, $) {
var jsb;
app.jsboot = app.jsboot || { callbacks: {} };
jsb = app.jsboot;
// callback functions expect one parameter, a
// data object that is stored in the inline
// application/json script tags
jsb.on = function(key, fun) {
key = key.replace('#', '-');
jsb.callbacks['jsboot-' + key] = fun;
};
jsb.runBootstrapping = function(el) {
var $el = $(el),
id = $el.attr('id'),
fun = jsb.callbacks[id],
jsonText, data;
if (typeof(fun) === 'function') {
jsonText = $el.html();
+
+ if (jsonText === "") {
+ data = {};
+ } else {
- data = JSON.parse(jsonText);
+ data = JSON.parse(jsonText);
? ++
+ }
+
fun(data);
}
};
jsb.runAllBootstrapping = function() {
$('script.jsboot-data').each(function(idx, el){
jsb.runBootstrapping(el);
});
Object.freeze(jsb.callbacks);
};
$(function(){
jsb.runAllBootstrapping();
});
} | 8 | 0.205128 | 7 | 1 |
cebdb4653789554436ad5f5aca9decb289b606bc | app/helpers/admin/editions_helper.rb | app/helpers/admin/editions_helper.rb | module Admin::EditionsHelper
def format_content_diff( body )
ContentDiffFormatter.new(body).to_html
end
# All guides should have at least one part
# Those parts should be in the correct order
def tidy_up_parts_before_editing(resource)
resource.parts.build if resource.parts.empty?
resource.parts.replace(resource.parts.sort_by(&:order))
end
end
| module Admin::EditionsHelper
def format_content_diff( body )
ContentDiffFormatter.new(body).to_html
end
end
| Remove helper of a guide having at least one part | Remove helper of a guide having at least one part
This enforcement, needs to be done on a model level, not within a view helper.
| Ruby | mit | telekomatrix/publisher,leftees/publisher,theodi/publisher,telekomatrix/publisher,leftees/publisher,telekomatrix/publisher,theodi/publisher,alphagov/publisher,alphagov/publisher,theodi/publisher,theodi/publisher,alphagov/publisher,telekomatrix/publisher,leftees/publisher,leftees/publisher | ruby | ## Code Before:
module Admin::EditionsHelper
def format_content_diff( body )
ContentDiffFormatter.new(body).to_html
end
# All guides should have at least one part
# Those parts should be in the correct order
def tidy_up_parts_before_editing(resource)
resource.parts.build if resource.parts.empty?
resource.parts.replace(resource.parts.sort_by(&:order))
end
end
## Instruction:
Remove helper of a guide having at least one part
This enforcement, needs to be done on a model level, not within a view helper.
## Code After:
module Admin::EditionsHelper
def format_content_diff( body )
ContentDiffFormatter.new(body).to_html
end
end
| module Admin::EditionsHelper
def format_content_diff( body )
ContentDiffFormatter.new(body).to_html
end
-
- # All guides should have at least one part
- # Those parts should be in the correct order
- def tidy_up_parts_before_editing(resource)
- resource.parts.build if resource.parts.empty?
- resource.parts.replace(resource.parts.sort_by(&:order))
- end
end | 7 | 0.583333 | 0 | 7 |
27112782272e1be81a2ea021d9ec24908c1201f0 | app/views/admin/editions/_alerts.html.erb | app/views/admin/editions/_alerts.html.erb | <% if edition.force_published? %>
<div class="alert alert-error force_published">
<p><strong>Warning</strong> This edition was force published and has not yet been reviewed by a second pair of eyes.</p>
<% if edition.approvable_retrospectively_by?(current_user) %>
<p><%= link_to "View this on the website", preview_document_path(@edition), target: '_blank' %> and check everything thoroughly.</p>
<p><%= approve_retrospectively_edition_button(edition) %></p>
<% end %>
</div>
<% end %>
<% if edition.pre_publication? && edition.scheduled_publication.present? %>
<div class="alert alert-info scheduled-publication">
<% if edition.scheduled? %>
<p>Scheduled for publication on <%= l edition.scheduled_publication, format: :long %>. </p>
<% else %>
<p>Scheduled publication proposed for <%= l edition.scheduled_publication, format: :long %>. </p>
<% end %>
</div>
<% end %>
<% if warn_about_lack_of_contacts_in_body?(edition) %>
<div class="alert alert-info no-contacts">
<p>This press release has no contact information embedded in the
body. You may want to edit it and add some.</p>
</div>
<% end %>
| <% if edition.force_published? %>
<div class="alert alert-error force_published">
<p><strong>Warning</strong> This edition was force published and has not yet been reviewed by a second pair of eyes.</p>
<% if edition.approvable_retrospectively_by?(current_user) %>
<p><%= link_to "View this on the website", preview_document_path(@edition), target: '_blank' %> and check everything thoroughly.</p>
<p><%= approve_retrospectively_edition_button(edition) %></p>
<% else %>
<p> Please have an editor other than the original publisher review the document to clear this warning.</p>
<% end %>
</div>
<% end %>
<% if edition.pre_publication? && edition.scheduled_publication.present? %>
<div class="alert alert-info scheduled-publication">
<% if edition.scheduled? %>
<p>Scheduled for publication on <%= l edition.scheduled_publication, format: :long %>. </p>
<% else %>
<p>Scheduled publication proposed for <%= l edition.scheduled_publication, format: :long %>. </p>
<% end %>
</div>
<% end %>
<% if warn_about_lack_of_contacts_in_body?(edition) %>
<div class="alert alert-info no-contacts">
<p>This press release has no contact information embedded in the
body. You may want to edit it and add some.</p>
</div>
<% end %>
| Edit warning for force publish flag | Edit warning for force publish flag
https://www.pivotaltracker.com/story/show/56117956 | HTML+ERB | mit | alphagov/whitehall,ggoral/whitehall,robinwhittleton/whitehall,ggoral/whitehall,hotvulcan/whitehall,YOTOV-LIMITED/whitehall,alphagov/whitehall,askl56/whitehall,askl56/whitehall,askl56/whitehall,askl56/whitehall,alphagov/whitehall,hotvulcan/whitehall,YOTOV-LIMITED/whitehall,ggoral/whitehall,alphagov/whitehall,robinwhittleton/whitehall,robinwhittleton/whitehall,robinwhittleton/whitehall,ggoral/whitehall,hotvulcan/whitehall,YOTOV-LIMITED/whitehall,YOTOV-LIMITED/whitehall,hotvulcan/whitehall | html+erb | ## Code Before:
<% if edition.force_published? %>
<div class="alert alert-error force_published">
<p><strong>Warning</strong> This edition was force published and has not yet been reviewed by a second pair of eyes.</p>
<% if edition.approvable_retrospectively_by?(current_user) %>
<p><%= link_to "View this on the website", preview_document_path(@edition), target: '_blank' %> and check everything thoroughly.</p>
<p><%= approve_retrospectively_edition_button(edition) %></p>
<% end %>
</div>
<% end %>
<% if edition.pre_publication? && edition.scheduled_publication.present? %>
<div class="alert alert-info scheduled-publication">
<% if edition.scheduled? %>
<p>Scheduled for publication on <%= l edition.scheduled_publication, format: :long %>. </p>
<% else %>
<p>Scheduled publication proposed for <%= l edition.scheduled_publication, format: :long %>. </p>
<% end %>
</div>
<% end %>
<% if warn_about_lack_of_contacts_in_body?(edition) %>
<div class="alert alert-info no-contacts">
<p>This press release has no contact information embedded in the
body. You may want to edit it and add some.</p>
</div>
<% end %>
## Instruction:
Edit warning for force publish flag
https://www.pivotaltracker.com/story/show/56117956
## Code After:
<% if edition.force_published? %>
<div class="alert alert-error force_published">
<p><strong>Warning</strong> This edition was force published and has not yet been reviewed by a second pair of eyes.</p>
<% if edition.approvable_retrospectively_by?(current_user) %>
<p><%= link_to "View this on the website", preview_document_path(@edition), target: '_blank' %> and check everything thoroughly.</p>
<p><%= approve_retrospectively_edition_button(edition) %></p>
<% else %>
<p> Please have an editor other than the original publisher review the document to clear this warning.</p>
<% end %>
</div>
<% end %>
<% if edition.pre_publication? && edition.scheduled_publication.present? %>
<div class="alert alert-info scheduled-publication">
<% if edition.scheduled? %>
<p>Scheduled for publication on <%= l edition.scheduled_publication, format: :long %>. </p>
<% else %>
<p>Scheduled publication proposed for <%= l edition.scheduled_publication, format: :long %>. </p>
<% end %>
</div>
<% end %>
<% if warn_about_lack_of_contacts_in_body?(edition) %>
<div class="alert alert-info no-contacts">
<p>This press release has no contact information embedded in the
body. You may want to edit it and add some.</p>
</div>
<% end %>
| <% if edition.force_published? %>
<div class="alert alert-error force_published">
<p><strong>Warning</strong> This edition was force published and has not yet been reviewed by a second pair of eyes.</p>
<% if edition.approvable_retrospectively_by?(current_user) %>
<p><%= link_to "View this on the website", preview_document_path(@edition), target: '_blank' %> and check everything thoroughly.</p>
<p><%= approve_retrospectively_edition_button(edition) %></p>
+ <% else %>
+ <p> Please have an editor other than the original publisher review the document to clear this warning.</p>
- <% end %>
? ---
+ <% end %>
</div>
<% end %>
<% if edition.pre_publication? && edition.scheduled_publication.present? %>
<div class="alert alert-info scheduled-publication">
<% if edition.scheduled? %>
<p>Scheduled for publication on <%= l edition.scheduled_publication, format: :long %>. </p>
<% else %>
<p>Scheduled publication proposed for <%= l edition.scheduled_publication, format: :long %>. </p>
<% end %>
</div>
<% end %>
<% if warn_about_lack_of_contacts_in_body?(edition) %>
<div class="alert alert-info no-contacts">
<p>This press release has no contact information embedded in the
body. You may want to edit it and add some.</p>
</div>
<% end %>
| 4 | 0.153846 | 3 | 1 |
ee3bbaf7798915b1be92ccfc8848b31f93b51a65 | quicklook.sh | quicklook.sh | brew cask install qlmarkdown
# Preview plain text files without a file extension (README, CHANGELOG, etc.).
brew cask install qlstephen
# Preview source code files for various programming languages, with syntax highlighting.
brew cask install qlcolorcode
# Preview JSON files.
brew cask install quicklook-json
# Preview CSV files.
brew cask install quicklook-csv
# Preview diffs.
brew cask install qlprettypatch
# Preview archives (ZIP, tar, gzip, bzip2, ARJ, LZH, ISO, etc.).
brew cask install betterzipql
# Preview SSL/X509 certificate files (CRT, PEM, DER, etc.).
brew cask install cert-quicklook
# Reload QuickLook daemon, so new plugins will work.
qlmanage -r
| brew cask install qlmarkdown
# Preview plain text files without a file extension (README, CHANGELOG, etc.).
brew cask install qlstephen
# Preview source code files for various programming languages, with syntax highlighting.
brew cask install qlcolorcode
# Preview JSON files.
brew cask install quicklook-json
# Preview CSV files.
brew cask install quicklook-csv
# Preview diffs.
brew cask install qlprettypatch
# Preview archives (ZIP, tar, gzip, bzip2, ARJ, LZH, ISO, etc.).
brew cask install betterzipql
# Preview SSL/X509 certificate files (CRT, PEM, DER, etc.).
brew cask install cert-quicklook
# Reload QuickLook daemon, so new plugins will work.
qlmanage -r
# Enable text selection in QuickLook views.
defaults write com.apple.finder QLEnableTextSelection -bool TRUE
killall Finder
| Enable text selection in QuickLook views. | Enable text selection in QuickLook views.
| Shell | mit | boochtek/mac_config,boochtek/mac_config | shell | ## Code Before:
brew cask install qlmarkdown
# Preview plain text files without a file extension (README, CHANGELOG, etc.).
brew cask install qlstephen
# Preview source code files for various programming languages, with syntax highlighting.
brew cask install qlcolorcode
# Preview JSON files.
brew cask install quicklook-json
# Preview CSV files.
brew cask install quicklook-csv
# Preview diffs.
brew cask install qlprettypatch
# Preview archives (ZIP, tar, gzip, bzip2, ARJ, LZH, ISO, etc.).
brew cask install betterzipql
# Preview SSL/X509 certificate files (CRT, PEM, DER, etc.).
brew cask install cert-quicklook
# Reload QuickLook daemon, so new plugins will work.
qlmanage -r
## Instruction:
Enable text selection in QuickLook views.
## Code After:
brew cask install qlmarkdown
# Preview plain text files without a file extension (README, CHANGELOG, etc.).
brew cask install qlstephen
# Preview source code files for various programming languages, with syntax highlighting.
brew cask install qlcolorcode
# Preview JSON files.
brew cask install quicklook-json
# Preview CSV files.
brew cask install quicklook-csv
# Preview diffs.
brew cask install qlprettypatch
# Preview archives (ZIP, tar, gzip, bzip2, ARJ, LZH, ISO, etc.).
brew cask install betterzipql
# Preview SSL/X509 certificate files (CRT, PEM, DER, etc.).
brew cask install cert-quicklook
# Reload QuickLook daemon, so new plugins will work.
qlmanage -r
# Enable text selection in QuickLook views.
defaults write com.apple.finder QLEnableTextSelection -bool TRUE
killall Finder
| brew cask install qlmarkdown
# Preview plain text files without a file extension (README, CHANGELOG, etc.).
brew cask install qlstephen
# Preview source code files for various programming languages, with syntax highlighting.
brew cask install qlcolorcode
# Preview JSON files.
brew cask install quicklook-json
# Preview CSV files.
brew cask install quicklook-csv
# Preview diffs.
brew cask install qlprettypatch
# Preview archives (ZIP, tar, gzip, bzip2, ARJ, LZH, ISO, etc.).
brew cask install betterzipql
# Preview SSL/X509 certificate files (CRT, PEM, DER, etc.).
brew cask install cert-quicklook
# Reload QuickLook daemon, so new plugins will work.
qlmanage -r
+
+ # Enable text selection in QuickLook views.
+ defaults write com.apple.finder QLEnableTextSelection -bool TRUE
+ killall Finder | 4 | 0.16 | 4 | 0 |
246dd696b053acfb5d01986498f879268d59a5c8 | app/views/documents/_document_show.html.erb | app/views/documents/_document_show.html.erb | <%= div_for document, :class => 'content_size' do %>
<div class="document_show">
<%= link_to "", document, :class => icon75_class_for(document), :alt => document.title %>
</div>
<% end %>
| <%= div_for document, :class => 'content_size' do %>
<div class="document_show">
<iframe src="http://docs.google.com/viewer?url=http%3A%2F%2Fvishub.global.dit.upm.es<%=u download_document_path(document)%>&embedded=true" width="600" height="480" style="border: none;"></iframe>
</div>
<% end %>
| Add google docs embedded view | Add google docs embedded view
| HTML+ERB | agpl-3.0 | rogervaas/vish,ging/vish_orange,suec78/vish_storyrobin,nathanV38/vishTst,agordillo/vish,rogervaas/vish,ging/vish,ging/vish_orange,agordillo/vish,rogervaas/vish,suec78/vish_storyrobin,ging/vish,ging/vish,agordillo/vish,agordillo/vish,ging/vish_orange,nathanV38/vishTst,ging/vish,suec78/vish_storyrobin,ging/vish_orange,rogervaas/vish,ging/vish,suec78/vish_storyrobin,ging/vish_orange | html+erb | ## Code Before:
<%= div_for document, :class => 'content_size' do %>
<div class="document_show">
<%= link_to "", document, :class => icon75_class_for(document), :alt => document.title %>
</div>
<% end %>
## Instruction:
Add google docs embedded view
## Code After:
<%= div_for document, :class => 'content_size' do %>
<div class="document_show">
<iframe src="http://docs.google.com/viewer?url=http%3A%2F%2Fvishub.global.dit.upm.es<%=u download_document_path(document)%>&embedded=true" width="600" height="480" style="border: none;"></iframe>
</div>
<% end %>
| <%= div_for document, :class => 'content_size' do %>
<div class="document_show">
- <%= link_to "", document, :class => icon75_class_for(document), :alt => document.title %>
+ <iframe src="http://docs.google.com/viewer?url=http%3A%2F%2Fvishub.global.dit.upm.es<%=u download_document_path(document)%>&embedded=true" width="600" height="480" style="border: none;"></iframe>
</div>
<% end %> | 2 | 0.285714 | 1 | 1 |
a96dee7b1bff7fb409a798d52d283cd1b9c25175 | app/app/config/routes.jsx | app/app/config/routes.jsx | import React from 'react'
import Main from '../components/Main.jsx'
import CreateUser from '../components/CreateUser.jsx'
import CreateSerf from '../components/CreateSerf.jsx'
import Home from '../components/Home.jsx'
import {Route, IndexRoute} from 'react-router'
const routes = () =>
<Route path="/" component={Main}>
<Route path="users/new" component={CreateUser} />
<Route path="serfs/new" component={CreateSerf} />
<IndexRoute component={Home} />
</Route>
export default routes() | import React from 'react'
import Main from '../components/Main.jsx'
import CreateUser from '../components/user/CreateUser.jsx'
import Home from '../components/home/Home.jsx'
import Login from '../components/user/Login.jsx'
import {Route, IndexRoute} from 'react-router'
const CreateUserWrapper = () => <CreateUser myType={"users"} />
const CreateSerfWrapper = () => <CreateUser myType={"serfs"} />
const routes = () =>
<Route path="/" component={Main}>
<Route path="users/new" component={CreateUserWrapper} />
<Route path="serfs/new" component={CreateSerfWrapper} />
<Route path="sessions/new" component={Login} />
<IndexRoute component={Home} />
</Route>
export default routes() | Add new route for sessions | Add new route for sessions
| JSX | mit | taodav/MicroSerfs,taodav/MicroSerfs | jsx | ## Code Before:
import React from 'react'
import Main from '../components/Main.jsx'
import CreateUser from '../components/CreateUser.jsx'
import CreateSerf from '../components/CreateSerf.jsx'
import Home from '../components/Home.jsx'
import {Route, IndexRoute} from 'react-router'
const routes = () =>
<Route path="/" component={Main}>
<Route path="users/new" component={CreateUser} />
<Route path="serfs/new" component={CreateSerf} />
<IndexRoute component={Home} />
</Route>
export default routes()
## Instruction:
Add new route for sessions
## Code After:
import React from 'react'
import Main from '../components/Main.jsx'
import CreateUser from '../components/user/CreateUser.jsx'
import Home from '../components/home/Home.jsx'
import Login from '../components/user/Login.jsx'
import {Route, IndexRoute} from 'react-router'
const CreateUserWrapper = () => <CreateUser myType={"users"} />
const CreateSerfWrapper = () => <CreateUser myType={"serfs"} />
const routes = () =>
<Route path="/" component={Main}>
<Route path="users/new" component={CreateUserWrapper} />
<Route path="serfs/new" component={CreateSerfWrapper} />
<Route path="sessions/new" component={Login} />
<IndexRoute component={Home} />
</Route>
export default routes() | import React from 'react'
import Main from '../components/Main.jsx'
- import CreateUser from '../components/CreateUser.jsx'
+ import CreateUser from '../components/user/CreateUser.jsx'
? +++++
- import CreateSerf from '../components/CreateSerf.jsx'
- import Home from '../components/Home.jsx'
+ import Home from '../components/home/Home.jsx'
? +++++
+ import Login from '../components/user/Login.jsx'
import {Route, IndexRoute} from 'react-router'
+
+ const CreateUserWrapper = () => <CreateUser myType={"users"} />
+ const CreateSerfWrapper = () => <CreateUser myType={"serfs"} />
+
const routes = () =>
<Route path="/" component={Main}>
- <Route path="users/new" component={CreateUser} />
+ <Route path="users/new" component={CreateUserWrapper} />
? +++++++
- <Route path="serfs/new" component={CreateSerf} />
+ <Route path="serfs/new" component={CreateSerfWrapper} />
? +++++++
+ <Route path="sessions/new" component={Login} />
<IndexRoute component={Home} />
</Route>
export default routes() | 15 | 0.9375 | 10 | 5 |
020b7141e60007763068eb5ef51674f14b8aad94 | spec/models/site_spec.rb | spec/models/site_spec.rb | require 'rails_helper'
RSpec.describe Site, 'site attribut testing' do
it 'cannot save without a name' do
site = build(:site, name: nil)
result = site.save
expect(result).to be false
end
it 'can have many tracks' do
site = build(:site, :has_tracks)
expect(site.tracks.count).to eq(3)
end
end
| require 'rails_helper'
RSpec.describe Site, "validations" do
it { is_expected.to validate_presence_of(:name) }
end
RSpec.describe Site, 'obsolete association testing' do
it 'can have many tracks' do
site = build(:site, :has_tracks)
expect(site.tracks.count).to eq(3)
end
end
| Update site spec with shoulda gem | Update site spec with shoulda gem
| Ruby | mit | colinfike/ploosic,colinfike/ploosic,colinfike/ploosic,colinfike/ploosic | ruby | ## Code Before:
require 'rails_helper'
RSpec.describe Site, 'site attribut testing' do
it 'cannot save without a name' do
site = build(:site, name: nil)
result = site.save
expect(result).to be false
end
it 'can have many tracks' do
site = build(:site, :has_tracks)
expect(site.tracks.count).to eq(3)
end
end
## Instruction:
Update site spec with shoulda gem
## Code After:
require 'rails_helper'
RSpec.describe Site, "validations" do
it { is_expected.to validate_presence_of(:name) }
end
RSpec.describe Site, 'obsolete association testing' do
it 'can have many tracks' do
site = build(:site, :has_tracks)
expect(site.tracks.count).to eq(3)
end
end
| require 'rails_helper'
+ RSpec.describe Site, "validations" do
+ it { is_expected.to validate_presence_of(:name) }
- RSpec.describe Site, 'site attribut testing' do
- it 'cannot save without a name' do
- site = build(:site, name: nil)
- result = site.save
- expect(result).to be false
- end
? --
+ end
+ RSpec.describe Site, 'obsolete association testing' do
it 'can have many tracks' do
site = build(:site, :has_tracks)
expect(site.tracks.count).to eq(3)
end
end | 10 | 0.714286 | 4 | 6 |
9f784fbd423a95b98d452a6de80ad4779c8c232e | docs/documentation/autoloading_classes.rst | docs/documentation/autoloading_classes.rst | Autoloading classes
===================
Ouzo is compliant with [PSR-4](http://www.php-fig.org/psr/psr-4/) specification. By default newly created project derived from ouzo-app will have [PSR-4](http://www.php-fig.org/psr/psr-4/) structure as well. However, you can use any class loading method: [PSR-4](http://www.php-fig.org/psr/psr-4/), [PSR-0](http://www.php-fig.org/psr/psr-0/), classmap or whatever.
There are three types of classes which Ouzo is expecting to be in specific locations:
* Controllers - under \Application\Controller
* Models - under \Application\Model
* Widgets - under \Application\Widget
Changing the defaults
~~~~~~~~~~~~~~~~~~~~~
If you wish to change the defaults, it can be done easily with configuration settings:
::
$config['namespace']['controller'] = '\\My\\New\\Controller';
$config['namespace']['model'] = '\\My\\New\\Model';
$config['namespace']['widget'] = '\\My\\New\\Widget';
| Autoloading classes
===================
Ouzo is compliant with `PSR-4`_ specification. By default newly created project derived from ouzo-app will have `PSR-4`_ structure as well.
However, you can use any class loading method: `PSR-4`_, `PSR-0`_, classmap or whatever.
.. _`PSR-4`: http://www.php-fig.org/psr/psr-4/
.. _`PSR-0`: http://www.php-fig.org/psr/psr-0/
.. note::
There are three types of classes which Ouzo is expecting to be in specific locations:
* Controllers - under ``\Application\Controller``
* Models - under ``\Application\Model``
* Widgets - under ``\Application\Widget``
Changing the defaults
~~~~~~~~~~~~~~~~~~~~~
If you wish to change the defaults, it can be done easily with configuration settings:
::
$config['namespace']['controller'] = '\\My\\New\\Controller';
$config['namespace']['model'] = '\\My\\New\\Model';
$config['namespace']['widget'] = '\\My\\New\\Widget';
| Edit docs - autoloading classes. | Edit docs - autoloading classes.
| reStructuredText | mit | letsdrink/ouzo,letsdrink/ouzo,letsdrink/ouzo | restructuredtext | ## Code Before:
Autoloading classes
===================
Ouzo is compliant with [PSR-4](http://www.php-fig.org/psr/psr-4/) specification. By default newly created project derived from ouzo-app will have [PSR-4](http://www.php-fig.org/psr/psr-4/) structure as well. However, you can use any class loading method: [PSR-4](http://www.php-fig.org/psr/psr-4/), [PSR-0](http://www.php-fig.org/psr/psr-0/), classmap or whatever.
There are three types of classes which Ouzo is expecting to be in specific locations:
* Controllers - under \Application\Controller
* Models - under \Application\Model
* Widgets - under \Application\Widget
Changing the defaults
~~~~~~~~~~~~~~~~~~~~~
If you wish to change the defaults, it can be done easily with configuration settings:
::
$config['namespace']['controller'] = '\\My\\New\\Controller';
$config['namespace']['model'] = '\\My\\New\\Model';
$config['namespace']['widget'] = '\\My\\New\\Widget';
## Instruction:
Edit docs - autoloading classes.
## Code After:
Autoloading classes
===================
Ouzo is compliant with `PSR-4`_ specification. By default newly created project derived from ouzo-app will have `PSR-4`_ structure as well.
However, you can use any class loading method: `PSR-4`_, `PSR-0`_, classmap or whatever.
.. _`PSR-4`: http://www.php-fig.org/psr/psr-4/
.. _`PSR-0`: http://www.php-fig.org/psr/psr-0/
.. note::
There are three types of classes which Ouzo is expecting to be in specific locations:
* Controllers - under ``\Application\Controller``
* Models - under ``\Application\Model``
* Widgets - under ``\Application\Widget``
Changing the defaults
~~~~~~~~~~~~~~~~~~~~~
If you wish to change the defaults, it can be done easily with configuration settings:
::
$config['namespace']['controller'] = '\\My\\New\\Controller';
$config['namespace']['model'] = '\\My\\New\\Model';
$config['namespace']['widget'] = '\\My\\New\\Widget';
| Autoloading classes
===================
- Ouzo is compliant with [PSR-4](http://www.php-fig.org/psr/psr-4/) specification. By default newly created project derived from ouzo-app will have [PSR-4](http://www.php-fig.org/psr/psr-4/) structure as well. However, you can use any class loading method: [PSR-4](http://www.php-fig.org/psr/psr-4/), [PSR-0](http://www.php-fig.org/psr/psr-0/), classmap or whatever.
+ Ouzo is compliant with `PSR-4`_ specification. By default newly created project derived from ouzo-app will have `PSR-4`_ structure as well.
+ However, you can use any class loading method: `PSR-4`_, `PSR-0`_, classmap or whatever.
+ .. _`PSR-4`: http://www.php-fig.org/psr/psr-4/
+ .. _`PSR-0`: http://www.php-fig.org/psr/psr-0/
+
+ .. note::
+
- There are three types of classes which Ouzo is expecting to be in specific locations:
+ There are three types of classes which Ouzo is expecting to be in specific locations:
? ++++
+
- * Controllers - under \Application\Controller
+ * Controllers - under ``\Application\Controller``
? ++++ ++ ++
- * Models - under \Application\Model
+ * Models - under ``\Application\Model``
? ++++ ++ ++
- * Widgets - under \Application\Widget
+ * Widgets - under ``\Application\Widget``
? ++++ ++ ++
Changing the defaults
~~~~~~~~~~~~~~~~~~~~~
If you wish to change the defaults, it can be done easily with configuration settings:
::
$config['namespace']['controller'] = '\\My\\New\\Controller';
$config['namespace']['model'] = '\\My\\New\\Model';
$config['namespace']['widget'] = '\\My\\New\\Widget'; | 17 | 0.85 | 12 | 5 |
d2130b64c63bdcfdea854db39fb21c7efe0b24e1 | tests/test_httpheader.py | tests/test_httpheader.py |
import pytest
pytestmark = pytest.mark.asyncio
async def test_redirection(get_version):
assert await get_version("jmeter-plugins-manager", {
"source": "httpheader",
"url": "https://www.unifiedremote.com/download/linux-x64-deb",
"regex": r'urserver-([\d.]+).deb',
}) != None
|
import pytest
pytestmark = pytest.mark.asyncio
async def test_redirection(get_version):
assert await get_version("unifiedremote", {
"source": "httpheader",
"url": "https://www.unifiedremote.com/download/linux-x64-deb",
"regex": r'urserver-([\d.]+).deb',
}) != None
| Correct package name in httpheader test | Correct package name in httpheader test
| Python | mit | lilydjwg/nvchecker | python | ## Code Before:
import pytest
pytestmark = pytest.mark.asyncio
async def test_redirection(get_version):
assert await get_version("jmeter-plugins-manager", {
"source": "httpheader",
"url": "https://www.unifiedremote.com/download/linux-x64-deb",
"regex": r'urserver-([\d.]+).deb',
}) != None
## Instruction:
Correct package name in httpheader test
## Code After:
import pytest
pytestmark = pytest.mark.asyncio
async def test_redirection(get_version):
assert await get_version("unifiedremote", {
"source": "httpheader",
"url": "https://www.unifiedremote.com/download/linux-x64-deb",
"regex": r'urserver-([\d.]+).deb',
}) != None
|
import pytest
pytestmark = pytest.mark.asyncio
async def test_redirection(get_version):
- assert await get_version("jmeter-plugins-manager", {
+ assert await get_version("unifiedremote", {
"source": "httpheader",
"url": "https://www.unifiedremote.com/download/linux-x64-deb",
"regex": r'urserver-([\d.]+).deb',
}) != None
| 2 | 0.166667 | 1 | 1 |
87f7e19542e9c0b64d67c21b6b8178c7d7cbc343 | .travis.yml | .travis.yml | language: go
sudo: required
before_install:
# Queue (Beanstalkd)
- sudo apt-get update -qq
- sudo apt-get install -qq beanstalkd
- go get github.com/BurntSushi/toml
- go get github.com/rakyll/statik
- go get github.com/rakyll/statik/fs
- go get -d -t -v ./... && go build -v ./...
- beanstalkd -v
- beanstalkd -l 127.0.0.1 -p 11300 &
go:
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
script:
- go vet ./...
- go test -v -coverprofile=coverage.txt -covermode=atomic
after_success:
- bash <(curl -s https://codecov.io/bash) | language: go
sudo: required
before_install:
# Queue (Beanstalkd)
- sudo apt-get update -qq
- sudo apt-get install -qq beanstalkd
- go get github.com/BurntSushi/toml
- go get github.com/rakyll/statik
- go get github.com/rakyll/statik/fs
- go get -d -t -v ./... && go build -v ./...
- beanstalkd -v
- beanstalkd -l 127.0.0.1 -p 11300 &
go:
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
os:
- linux
- osx
env:
matrix:
- GOARCH=amd64
- GOARCH=386
script:
- go vet ./...
- go test -v -coverprofile=coverage.txt -covermode=atomic
after_success:
- bash <(curl -s https://codecov.io/bash) | Update Travis CI to include GOARCH=386 tests | Update Travis CI to include GOARCH=386 tests
| YAML | mit | xuri/aurora,Luxurioust/aurora,xuri/aurora,xuri/aurora,Luxurioust/aurora,Luxurioust/aurora | yaml | ## Code Before:
language: go
sudo: required
before_install:
# Queue (Beanstalkd)
- sudo apt-get update -qq
- sudo apt-get install -qq beanstalkd
- go get github.com/BurntSushi/toml
- go get github.com/rakyll/statik
- go get github.com/rakyll/statik/fs
- go get -d -t -v ./... && go build -v ./...
- beanstalkd -v
- beanstalkd -l 127.0.0.1 -p 11300 &
go:
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
script:
- go vet ./...
- go test -v -coverprofile=coverage.txt -covermode=atomic
after_success:
- bash <(curl -s https://codecov.io/bash)
## Instruction:
Update Travis CI to include GOARCH=386 tests
## Code After:
language: go
sudo: required
before_install:
# Queue (Beanstalkd)
- sudo apt-get update -qq
- sudo apt-get install -qq beanstalkd
- go get github.com/BurntSushi/toml
- go get github.com/rakyll/statik
- go get github.com/rakyll/statik/fs
- go get -d -t -v ./... && go build -v ./...
- beanstalkd -v
- beanstalkd -l 127.0.0.1 -p 11300 &
go:
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
os:
- linux
- osx
env:
matrix:
- GOARCH=amd64
- GOARCH=386
script:
- go vet ./...
- go test -v -coverprofile=coverage.txt -covermode=atomic
after_success:
- bash <(curl -s https://codecov.io/bash) | language: go
sudo: required
before_install:
# Queue (Beanstalkd)
- sudo apt-get update -qq
- sudo apt-get install -qq beanstalkd
- go get github.com/BurntSushi/toml
- go get github.com/rakyll/statik
- go get github.com/rakyll/statik/fs
- go get -d -t -v ./... && go build -v ./...
- beanstalkd -v
- beanstalkd -l 127.0.0.1 -p 11300 &
go:
- 1.6.x
- 1.7.x
- 1.8.x
- 1.9.x
+ os:
+ - linux
+ - osx
+
+ env:
+ matrix:
+ - GOARCH=amd64
+ - GOARCH=386
+
script:
- go vet ./...
- go test -v -coverprofile=coverage.txt -covermode=atomic
after_success:
- bash <(curl -s https://codecov.io/bash) | 9 | 0.333333 | 9 | 0 |
7cbdde4d8fa9855682e25b80056eb49e2847c99d | Sources/App/Models/Sighting.swift | Sources/App/Models/Sighting.swift | import Vapor
import HTTP
import Node
import Foundation
final class Sighting: Model {
var id: Node?
var bird: String
var time: Int
var exists: Bool = false
init(bird: String, time: Double) {
self.bird = bird
self.time = Int(time)
}
convenience init(bird: String) {
self.init(bird: bird, time: NSDate().timeIntervalSince1970.doubleValue)
}
init(node: Node, in context: Context) throws {
id = try node.extract("id")
bird = try node.extract("bird")
time = try node.extract("time")
}
func makeNode(context: Context) throws -> Node {
return try Node(node: [
"id": id,
"bird": bird,
"time": time
])
}
static func prepare(_ database: Database) throws {
try database.create("Sightings") { sightings in
sightings.id()
sightings.string("bird", optional: false)
sightings.int("time")
}
}
static func revert(_ database: Database) throws {
try database.delete("Sightings")
}
}
| import Vapor
import HTTP
import Node
import Foundation
final class Sighting: Model {
var id: Node?
var bird: String
var time: Int
var exists: Bool = false
init(bird: String, time: Double) {
self.bird = bird
self.time = Int(time)
}
convenience init(bird: String) {
self.init(bird: bird, time: NSDate().timeIntervalSince1970.doubleValue)
}
init(node: Node, in context: Context) throws {
id = try node.extract("id")
bird = try node.extract("bird")
time = try node.extract("time")
}
func makeNode(context: Context) throws -> Node {
return try Node(node: [
"id": id,
"bird": bird,
"time": time,
"date": DateFormatter.localizedString(from: NSDate(timeIntervalSince1970:TimeInterval(time)) as Date, dateStyle: .short, timeStyle: .short)
])
}
static func prepare(_ database: Database) throws {
try database.create("Sightings") { sightings in
sightings.id()
sightings.string("bird", optional: false)
sightings.int("time")
}
}
static func revert(_ database: Database) throws {
try database.delete("Sightings")
}
}
| Use readable date in sightings | Use readable date in sightings
| Swift | mit | imeraj/TestApp-Vapor1.0,imeraj/TestApp-Vapor1.0 | swift | ## Code Before:
import Vapor
import HTTP
import Node
import Foundation
final class Sighting: Model {
var id: Node?
var bird: String
var time: Int
var exists: Bool = false
init(bird: String, time: Double) {
self.bird = bird
self.time = Int(time)
}
convenience init(bird: String) {
self.init(bird: bird, time: NSDate().timeIntervalSince1970.doubleValue)
}
init(node: Node, in context: Context) throws {
id = try node.extract("id")
bird = try node.extract("bird")
time = try node.extract("time")
}
func makeNode(context: Context) throws -> Node {
return try Node(node: [
"id": id,
"bird": bird,
"time": time
])
}
static func prepare(_ database: Database) throws {
try database.create("Sightings") { sightings in
sightings.id()
sightings.string("bird", optional: false)
sightings.int("time")
}
}
static func revert(_ database: Database) throws {
try database.delete("Sightings")
}
}
## Instruction:
Use readable date in sightings
## Code After:
import Vapor
import HTTP
import Node
import Foundation
final class Sighting: Model {
var id: Node?
var bird: String
var time: Int
var exists: Bool = false
init(bird: String, time: Double) {
self.bird = bird
self.time = Int(time)
}
convenience init(bird: String) {
self.init(bird: bird, time: NSDate().timeIntervalSince1970.doubleValue)
}
init(node: Node, in context: Context) throws {
id = try node.extract("id")
bird = try node.extract("bird")
time = try node.extract("time")
}
func makeNode(context: Context) throws -> Node {
return try Node(node: [
"id": id,
"bird": bird,
"time": time,
"date": DateFormatter.localizedString(from: NSDate(timeIntervalSince1970:TimeInterval(time)) as Date, dateStyle: .short, timeStyle: .short)
])
}
static func prepare(_ database: Database) throws {
try database.create("Sightings") { sightings in
sightings.id()
sightings.string("bird", optional: false)
sightings.int("time")
}
}
static func revert(_ database: Database) throws {
try database.delete("Sightings")
}
}
| import Vapor
import HTTP
import Node
import Foundation
final class Sighting: Model {
var id: Node?
var bird: String
var time: Int
var exists: Bool = false
init(bird: String, time: Double) {
self.bird = bird
self.time = Int(time)
}
convenience init(bird: String) {
self.init(bird: bird, time: NSDate().timeIntervalSince1970.doubleValue)
}
init(node: Node, in context: Context) throws {
id = try node.extract("id")
bird = try node.extract("bird")
time = try node.extract("time")
}
func makeNode(context: Context) throws -> Node {
return try Node(node: [
"id": id,
"bird": bird,
- "time": time
+ "time": time,
? +
+ "date": DateFormatter.localizedString(from: NSDate(timeIntervalSince1970:TimeInterval(time)) as Date, dateStyle: .short, timeStyle: .short)
])
}
static func prepare(_ database: Database) throws {
try database.create("Sightings") { sightings in
sightings.id()
sightings.string("bird", optional: false)
sightings.int("time")
}
}
static func revert(_ database: Database) throws {
try database.delete("Sightings")
}
}
| 3 | 0.06383 | 2 | 1 |
d68ce51843726f2c5123a8f0aafefa9d82a15028 | core/src/main/scala/doobie/enum/parametermode.scala | core/src/main/scala/doobie/enum/parametermode.scala | package doobie.enum
import doobie.util.invariant._
import java.sql.ParameterMetaData._
import scalaz.Equal
import scalaz.std.anyVal.intInstance
object parametermode {
/** @group Implementation */
sealed abstract class ParameterMode(val toInt: Int)
/** @group Values */ case object ModeIn extends ParameterMode(parameterModeIn)
/** @group Values */ case object ModeOut extends ParameterMode(parameterModeOut)
/** @group Values */ case object ModeInOut extends ParameterMode(parameterModeInOut)
/** @group Implementation */
object ParameterMode {
def fromInt(n:Int): Option[ParameterMode] =
Some(n) collect {
case ModeIn.toInt => ModeIn
case ModeOut.toInt => ModeOut
case ModeInOut.toInt => ModeInOut
}
def unsafeFromInt(n: Int): ParameterMode =
fromInt(n).getOrElse(throw InvalidOrdinal[ParameterMode](n))
implicit val EqualParameterMode: Equal[ParameterMode] =
Equal.equalBy(_.toInt)
}
} | package doobie.enum
import doobie.util.invariant._
import java.sql.ParameterMetaData._
import scalaz.Equal
import scalaz.std.anyVal.intInstance
object parametermode {
/** @group Implementation */
sealed abstract class ParameterMode(val toInt: Int)
/** @group Values */ case object ModeIn extends ParameterMode(parameterModeIn)
/** @group Values */ case object ModeOut extends ParameterMode(parameterModeOut)
/** @group Values */ case object ModeInOut extends ParameterMode(parameterModeInOut)
/** @group Values */ case object ModeUnknown extends ParameterMode(parameterModeUnknown)
/** @group Implementation */
object ParameterMode {
def fromInt(n:Int): Option[ParameterMode] =
Some(n) collect {
case ModeIn.toInt => ModeIn
case ModeOut.toInt => ModeOut
case ModeInOut.toInt => ModeInOut
case ModeUnknown.toInt => ModeUnknown
}
def unsafeFromInt(n: Int): ParameterMode =
fromInt(n).getOrElse(throw InvalidOrdinal[ParameterMode](n))
implicit val EqualParameterMode: Equal[ParameterMode] =
Equal.equalBy(_.toInt)
}
}
| Add ModeUnknown to ParameterMode enum | Add ModeUnknown to ParameterMode enum
| Scala | mit | refried/doobie,refried/doobie,tpolecat/doobie,wedens/doobie,beni55/doobie,wedens/doobie,coltfred/doobie,jamescway/doobie,rperry/doobie,rperry/doobie,coltfred/doobie,beni55/doobie,jamescway/doobie | scala | ## Code Before:
package doobie.enum
import doobie.util.invariant._
import java.sql.ParameterMetaData._
import scalaz.Equal
import scalaz.std.anyVal.intInstance
object parametermode {
/** @group Implementation */
sealed abstract class ParameterMode(val toInt: Int)
/** @group Values */ case object ModeIn extends ParameterMode(parameterModeIn)
/** @group Values */ case object ModeOut extends ParameterMode(parameterModeOut)
/** @group Values */ case object ModeInOut extends ParameterMode(parameterModeInOut)
/** @group Implementation */
object ParameterMode {
def fromInt(n:Int): Option[ParameterMode] =
Some(n) collect {
case ModeIn.toInt => ModeIn
case ModeOut.toInt => ModeOut
case ModeInOut.toInt => ModeInOut
}
def unsafeFromInt(n: Int): ParameterMode =
fromInt(n).getOrElse(throw InvalidOrdinal[ParameterMode](n))
implicit val EqualParameterMode: Equal[ParameterMode] =
Equal.equalBy(_.toInt)
}
}
## Instruction:
Add ModeUnknown to ParameterMode enum
## Code After:
package doobie.enum
import doobie.util.invariant._
import java.sql.ParameterMetaData._
import scalaz.Equal
import scalaz.std.anyVal.intInstance
object parametermode {
/** @group Implementation */
sealed abstract class ParameterMode(val toInt: Int)
/** @group Values */ case object ModeIn extends ParameterMode(parameterModeIn)
/** @group Values */ case object ModeOut extends ParameterMode(parameterModeOut)
/** @group Values */ case object ModeInOut extends ParameterMode(parameterModeInOut)
/** @group Values */ case object ModeUnknown extends ParameterMode(parameterModeUnknown)
/** @group Implementation */
object ParameterMode {
def fromInt(n:Int): Option[ParameterMode] =
Some(n) collect {
case ModeIn.toInt => ModeIn
case ModeOut.toInt => ModeOut
case ModeInOut.toInt => ModeInOut
case ModeUnknown.toInt => ModeUnknown
}
def unsafeFromInt(n: Int): ParameterMode =
fromInt(n).getOrElse(throw InvalidOrdinal[ParameterMode](n))
implicit val EqualParameterMode: Equal[ParameterMode] =
Equal.equalBy(_.toInt)
}
}
| package doobie.enum
import doobie.util.invariant._
import java.sql.ParameterMetaData._
import scalaz.Equal
import scalaz.std.anyVal.intInstance
object parametermode {
/** @group Implementation */
sealed abstract class ParameterMode(val toInt: Int)
- /** @group Values */ case object ModeIn extends ParameterMode(parameterModeIn)
+ /** @group Values */ case object ModeIn extends ParameterMode(parameterModeIn)
? ++
- /** @group Values */ case object ModeOut extends ParameterMode(parameterModeOut)
+ /** @group Values */ case object ModeOut extends ParameterMode(parameterModeOut)
? ++
- /** @group Values */ case object ModeInOut extends ParameterMode(parameterModeInOut)
+ /** @group Values */ case object ModeInOut extends ParameterMode(parameterModeInOut)
? ++
+ /** @group Values */ case object ModeUnknown extends ParameterMode(parameterModeUnknown)
/** @group Implementation */
object ParameterMode {
def fromInt(n:Int): Option[ParameterMode] =
Some(n) collect {
- case ModeIn.toInt => ModeIn
+ case ModeIn.toInt => ModeIn
? ++
- case ModeOut.toInt => ModeOut
+ case ModeOut.toInt => ModeOut
? ++
- case ModeInOut.toInt => ModeInOut
+ case ModeInOut.toInt => ModeInOut
? ++
+ case ModeUnknown.toInt => ModeUnknown
}
def unsafeFromInt(n: Int): ParameterMode =
fromInt(n).getOrElse(throw InvalidOrdinal[ParameterMode](n))
implicit val EqualParameterMode: Equal[ParameterMode] =
Equal.equalBy(_.toInt)
}
} | 14 | 0.378378 | 8 | 6 |
116f1eee77abe96929663629bb1519e700641c91 | app/views/internal_results_mailer/send_results.txt.erb | app/views/internal_results_mailer/send_results.txt.erb |
Results for <%= @test_run.skill_test.title %>
Total score: <%= number_to_percentage(@test_run.score, precision:2)%>
Time taken: <%= "#{'%02i' % @time_taken[:minutes]}:#{'%02i' % @time_taken[:seconds]}" %>
<% @test_run.submitted_answers.each do |a| %>
Question <%= a.question_number %>
Score: <%= a.score %>/<%= a.max_score %>
<% if a.wrong_answers? %>
Wrong answers: <%= a.wrong_answers %>
<% end %>
<% end %>
|
Results for <%= @test_run.skill_test.title %>
Submitted by
<%= @test_run.user.name %>
<%= @test_run.user.email %>
<%= "http://github.com/#{@test_run.user.authentications.where(provider: :github).first.username}" %>
Total score: <%= number_to_percentage(@test_run.score, precision:2)%>
Time taken: <%= "#{'%02i' % @time_taken[:minutes]}:#{'%02i' % @time_taken[:seconds]}" %>
<% @test_run.submitted_answers.each do |a| %>
Question <%= a.question_number %>
Score: <%= a.score %>/<%= a.max_score %>
<% if a.wrong_answers? %>
Wrong answers: <%= a.wrong_answers %>
<% end %>
<% end %>
| Update email template with user info | Update email template with user info | HTML+ERB | mit | LandingJobs/conundrum,LandingJobs/conundrum | html+erb | ## Code Before:
Results for <%= @test_run.skill_test.title %>
Total score: <%= number_to_percentage(@test_run.score, precision:2)%>
Time taken: <%= "#{'%02i' % @time_taken[:minutes]}:#{'%02i' % @time_taken[:seconds]}" %>
<% @test_run.submitted_answers.each do |a| %>
Question <%= a.question_number %>
Score: <%= a.score %>/<%= a.max_score %>
<% if a.wrong_answers? %>
Wrong answers: <%= a.wrong_answers %>
<% end %>
<% end %>
## Instruction:
Update email template with user info
## Code After:
Results for <%= @test_run.skill_test.title %>
Submitted by
<%= @test_run.user.name %>
<%= @test_run.user.email %>
<%= "http://github.com/#{@test_run.user.authentications.where(provider: :github).first.username}" %>
Total score: <%= number_to_percentage(@test_run.score, precision:2)%>
Time taken: <%= "#{'%02i' % @time_taken[:minutes]}:#{'%02i' % @time_taken[:seconds]}" %>
<% @test_run.submitted_answers.each do |a| %>
Question <%= a.question_number %>
Score: <%= a.score %>/<%= a.max_score %>
<% if a.wrong_answers? %>
Wrong answers: <%= a.wrong_answers %>
<% end %>
<% end %>
|
Results for <%= @test_run.skill_test.title %>
+
+ Submitted by
+ <%= @test_run.user.name %>
+ <%= @test_run.user.email %>
+ <%= "http://github.com/#{@test_run.user.authentications.where(provider: :github).first.username}" %>
Total score: <%= number_to_percentage(@test_run.score, precision:2)%>
Time taken: <%= "#{'%02i' % @time_taken[:minutes]}:#{'%02i' % @time_taken[:seconds]}" %>
<% @test_run.submitted_answers.each do |a| %>
Question <%= a.question_number %>
Score: <%= a.score %>/<%= a.max_score %>
<% if a.wrong_answers? %>
Wrong answers: <%= a.wrong_answers %>
<% end %>
<% end %> | 5 | 0.384615 | 5 | 0 |
1d6a59aee21d8de9f5defd6058e3a5118d553dce | README.md | README.md |
Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.
To use it, add this line to your Gemfile:
gem "haml-rails"
Pretty fancy, eh?
Once you've done that, any time you generate a controller or scaffold, you'll get Haml instead of ERB templates. On top of that, when your Rails application loads, Haml will be loaded and initialized completely automatically! The modern world is just so amazing. |
Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.
To use it, add this line to your Gemfile:
gem "haml-rails"
Pretty fancy, eh?
Once you've done that, any time you generate a controller or scaffold, you'll get Haml instead of ERB templates. On top of that, when your Rails application loads, Haml will be loaded and initialized completely automatically! The modern world is just so amazing.
### Contributors
Haml generators originally from [rails3-generators](http://github.com/indirect/rails3-generators), and written by Paul Barry, Anuj Dutta, Louis T, and Chris Rhoden. | Add original generator authors to the readme | Add original generator authors to the readme
| Markdown | mit | ipmobiletech/haml-rails,charly/haml-rails,indirect/haml-rails,olivierlacan/haml-rails,indirect/haml-rails,serv/haml-rails,charly/haml-rails,ipmobiletech/haml-rails,olivierlacan/haml-rails | markdown | ## Code Before:
Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.
To use it, add this line to your Gemfile:
gem "haml-rails"
Pretty fancy, eh?
Once you've done that, any time you generate a controller or scaffold, you'll get Haml instead of ERB templates. On top of that, when your Rails application loads, Haml will be loaded and initialized completely automatically! The modern world is just so amazing.
## Instruction:
Add original generator authors to the readme
## Code After:
Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.
To use it, add this line to your Gemfile:
gem "haml-rails"
Pretty fancy, eh?
Once you've done that, any time you generate a controller or scaffold, you'll get Haml instead of ERB templates. On top of that, when your Rails application loads, Haml will be loaded and initialized completely automatically! The modern world is just so amazing.
### Contributors
Haml generators originally from [rails3-generators](http://github.com/indirect/rails3-generators), and written by Paul Barry, Anuj Dutta, Louis T, and Chris Rhoden. |
Haml-rails provides Haml generators for Rails 3. It also enables Haml as the templating engine for you, so you don't have to screw around in your own application.rb when your Gemfile already clearly indicated what templating engine you have installed. Hurrah.
To use it, add this line to your Gemfile:
gem "haml-rails"
Pretty fancy, eh?
Once you've done that, any time you generate a controller or scaffold, you'll get Haml instead of ERB templates. On top of that, when your Rails application loads, Haml will be loaded and initialized completely automatically! The modern world is just so amazing.
+
+ ### Contributors
+
+ Haml generators originally from [rails3-generators](http://github.com/indirect/rails3-generators), and written by Paul Barry, Anuj Dutta, Louis T, and Chris Rhoden. | 4 | 0.4 | 4 | 0 |
c6d50c3feed444f8f450c5c140e8470c6897f2bf | societies/models.py | societies/models.py |
from django.db import models
from django_countries.fields import CountryField
class GuitarSociety(models.Model):
"""
Represents a single guitar society.
.. versionadded:: 0.1
"""
#: the name of the society
#: ..versionadded:: 0.1
name = models.CharField(max_length=1024)
#: the society's url
#: ..versionadded:: 0.1
link = models.URLField(max_length=255)
#: The country in which the society resides
#: .. versionadded:: 0.1
country = CountryField()
#: A free form "city" or "region" field used to display where
#: exactly the society is within a country
#: .. versionadded:: 0.1
region = models.CharField(max_length=512, null=True, default=None, blank=True)
def __str__(self):
return 'GuitarSociety(name="{}", link="{}")'.format(self.name, self.link)
|
from django.db import models
from django_countries.fields import CountryField
class GuitarSociety(models.Model):
"""
Represents a single guitar society.
.. versionadded:: 0.1
"""
#: the name of the society
#: ..versionadded:: 0.1
name = models.CharField(max_length=1024)
#: the society's url
#: ..versionadded:: 0.1
link = models.URLField(max_length=255)
#: The country in which the society resides
#: .. versionadded:: 0.1
country = CountryField()
#: A free form "city" or "region" field used to display where
#: exactly the society is within a country
#: .. versionadded:: 0.1
region = models.CharField(max_length=512, null=True, default=None, blank=True)
def __str__(self):
return self.name
def __repr__(self):
return 'GuitarSociety("{}")'.format(self.name)
| Make the Guitar Society __str__ Method a bit more Logical | Make the Guitar Society __str__ Method a bit more Logical
| Python | bsd-3-clause | chrisguitarguy/GuitarSocieties.org,chrisguitarguy/GuitarSocieties.org | python | ## Code Before:
from django.db import models
from django_countries.fields import CountryField
class GuitarSociety(models.Model):
"""
Represents a single guitar society.
.. versionadded:: 0.1
"""
#: the name of the society
#: ..versionadded:: 0.1
name = models.CharField(max_length=1024)
#: the society's url
#: ..versionadded:: 0.1
link = models.URLField(max_length=255)
#: The country in which the society resides
#: .. versionadded:: 0.1
country = CountryField()
#: A free form "city" or "region" field used to display where
#: exactly the society is within a country
#: .. versionadded:: 0.1
region = models.CharField(max_length=512, null=True, default=None, blank=True)
def __str__(self):
return 'GuitarSociety(name="{}", link="{}")'.format(self.name, self.link)
## Instruction:
Make the Guitar Society __str__ Method a bit more Logical
## Code After:
from django.db import models
from django_countries.fields import CountryField
class GuitarSociety(models.Model):
"""
Represents a single guitar society.
.. versionadded:: 0.1
"""
#: the name of the society
#: ..versionadded:: 0.1
name = models.CharField(max_length=1024)
#: the society's url
#: ..versionadded:: 0.1
link = models.URLField(max_length=255)
#: The country in which the society resides
#: .. versionadded:: 0.1
country = CountryField()
#: A free form "city" or "region" field used to display where
#: exactly the society is within a country
#: .. versionadded:: 0.1
region = models.CharField(max_length=512, null=True, default=None, blank=True)
def __str__(self):
return self.name
def __repr__(self):
return 'GuitarSociety("{}")'.format(self.name)
|
from django.db import models
from django_countries.fields import CountryField
class GuitarSociety(models.Model):
"""
Represents a single guitar society.
.. versionadded:: 0.1
"""
#: the name of the society
#: ..versionadded:: 0.1
name = models.CharField(max_length=1024)
#: the society's url
#: ..versionadded:: 0.1
link = models.URLField(max_length=255)
#: The country in which the society resides
#: .. versionadded:: 0.1
country = CountryField()
#: A free form "city" or "region" field used to display where
#: exactly the society is within a country
#: .. versionadded:: 0.1
region = models.CharField(max_length=512, null=True, default=None, blank=True)
def __str__(self):
+ return self.name
+
+ def __repr__(self):
- return 'GuitarSociety(name="{}", link="{}")'.format(self.name, self.link)
? ---------------- -----------
+ return 'GuitarSociety("{}")'.format(self.name) | 5 | 0.16129 | 4 | 1 |
ffe8a5dd0cf68e18894c9c6d35ee223aee24f0c9 | styleguide/number.section.md | styleguide/number.section.md | All components in this section is built upon a private `<Number />` component. This has the effect that all props sent to either component below that are not specifically consumed by said component will *trickle down* to the `<Number />` component below.
This means that all components in this section can also take these additional props:
**Props**
| Name | Type | Description |
| :-------------- | :------------- | :---------- |
| className | string | The class(es) that should apply to the whole component |
| valueClass | string | The class(es) that should apply to the value part of the component |
| prefix | node | Anything that should go before the component. A node is either a string or a DOM node |
| prefixClass | string | The class(es) that should apply to the prefix of the component |
| prefixSeparator | string | A separator between the prefix and the value |
| suffix | node | Anything that should go after the component. A node is either a string or a DOM node |
| suffixClass | string | The class(es) that should apply to the suffix of the component |
| suffixSeparator | string | A separator between the suffix and the value |
| All components in this section is built upon a private `<Number />` component. This has the effect that all props sent to either component below that are not specifically consumed by said component will *trickle down* to the `<Number />` component below.
This means that all components in this section can also take these additional props:
**Props**
| Name | Type | Description |
| :-------------- | :------------- | :---------- |
| className | string | The class(es) that should apply to the whole component |
| valueClass | string | The class(es) that should apply to the value part of the component |
| valueStyle | object | The style(s) that should apply to the value part of the component |
| prefix | node | Anything that should go before the component. A node is either a string or a DOM node |
| prefixClass | string | The class(es) that should apply to the prefix of the component |
| prefixSeparator | string | A separator between the prefix and the value |
| prefixStyle | object | The style(s) that should apply to the prefix part of the component |
| suffix | node | Anything that should go after the component. A node is either a string or a DOM node |
| suffixClass | string | The class(es) that should apply to the suffix of the component |
| suffixSeparator | string | A separator between the suffix and the value |
| suffixStyle | object | The style(s) that should apply to the suffix part of the component |
| Add new *style props that can be added to any Number component | Add new *style props that can be added to any Number component
| Markdown | mit | nordnet/nordnet-component-kit | markdown | ## Code Before:
All components in this section is built upon a private `<Number />` component. This has the effect that all props sent to either component below that are not specifically consumed by said component will *trickle down* to the `<Number />` component below.
This means that all components in this section can also take these additional props:
**Props**
| Name | Type | Description |
| :-------------- | :------------- | :---------- |
| className | string | The class(es) that should apply to the whole component |
| valueClass | string | The class(es) that should apply to the value part of the component |
| prefix | node | Anything that should go before the component. A node is either a string or a DOM node |
| prefixClass | string | The class(es) that should apply to the prefix of the component |
| prefixSeparator | string | A separator between the prefix and the value |
| suffix | node | Anything that should go after the component. A node is either a string or a DOM node |
| suffixClass | string | The class(es) that should apply to the suffix of the component |
| suffixSeparator | string | A separator between the suffix and the value |
## Instruction:
Add new *style props that can be added to any Number component
## Code After:
All components in this section is built upon a private `<Number />` component. This has the effect that all props sent to either component below that are not specifically consumed by said component will *trickle down* to the `<Number />` component below.
This means that all components in this section can also take these additional props:
**Props**
| Name | Type | Description |
| :-------------- | :------------- | :---------- |
| className | string | The class(es) that should apply to the whole component |
| valueClass | string | The class(es) that should apply to the value part of the component |
| valueStyle | object | The style(s) that should apply to the value part of the component |
| prefix | node | Anything that should go before the component. A node is either a string or a DOM node |
| prefixClass | string | The class(es) that should apply to the prefix of the component |
| prefixSeparator | string | A separator between the prefix and the value |
| prefixStyle | object | The style(s) that should apply to the prefix part of the component |
| suffix | node | Anything that should go after the component. A node is either a string or a DOM node |
| suffixClass | string | The class(es) that should apply to the suffix of the component |
| suffixSeparator | string | A separator between the suffix and the value |
| suffixStyle | object | The style(s) that should apply to the suffix part of the component |
| All components in this section is built upon a private `<Number />` component. This has the effect that all props sent to either component below that are not specifically consumed by said component will *trickle down* to the `<Number />` component below.
This means that all components in this section can also take these additional props:
**Props**
| Name | Type | Description |
| :-------------- | :------------- | :---------- |
| className | string | The class(es) that should apply to the whole component |
| valueClass | string | The class(es) that should apply to the value part of the component |
+ | valueStyle | object | The style(s) that should apply to the value part of the component |
| prefix | node | Anything that should go before the component. A node is either a string or a DOM node |
| prefixClass | string | The class(es) that should apply to the prefix of the component |
| prefixSeparator | string | A separator between the prefix and the value |
+ | prefixStyle | object | The style(s) that should apply to the prefix part of the component |
| suffix | node | Anything that should go after the component. A node is either a string or a DOM node |
| suffixClass | string | The class(es) that should apply to the suffix of the component |
| suffixSeparator | string | A separator between the suffix and the value |
+ | suffixStyle | object | The style(s) that should apply to the suffix part of the component | | 3 | 0.1875 | 3 | 0 |
dd0aca7ef7d4a82deb9b974fbfaf7fdcb4f23968 | index.js | index.js | var hslToHex = require('tie-dye/hslToHex');
function hashbow(input, saturation, lightness) {
var toColor, sum;
var toColor, sum;
switch (typeof input) {
case 'object':
toColor = JSON.stringify(input);
break;
case 'number':
sum = input;
break;
case 'boolean':
return hslToHex(input ? 120 : 0, saturation || 100, lightness || 50);
break;
case 'function':
toColor = input.toString();
break;
case 'string':
default:
toColor = input;
}
if (sum === null) {
sum = 0;
toColor.split('').forEach(function (letter) {
sum += letter.charCodeAt(0);
});
}
sum = Math.abs(sum * sum);
var color = hslToHex(sum % 360, saturation || 100, lightness || 50);
return color;
}
module.exports = hashbow;
| var hslToHex = require('tie-dye/hslToHex');
function hashbow(input, saturation, lightness) {
var toColor, sum;
saturation = saturation || 100;
lightness = lightness || 50;
switch (typeof input) {
case 'object':
toColor = JSON.stringify(input);
break;
case 'number':
sum = input;
break;
case 'boolean':
return hslToHex(input ? 120 : 0, saturation, lightness);
break;
case 'function':
toColor = input.toString();
break;
case 'string':
default:
toColor = input;
}
if (sum === null) {
sum = 0;
toColor.split('').forEach(function (letter) {
sum += letter.charCodeAt(0);
});
}
sum = Math.abs(sum * sum);
return hslToHex(sum % 360, saturation, lightness);
}
module.exports = hashbow;
| Set default variables at start of function | Set default variables at start of function
| JavaScript | mit | supercrabtree/hashbow | javascript | ## Code Before:
var hslToHex = require('tie-dye/hslToHex');
function hashbow(input, saturation, lightness) {
var toColor, sum;
var toColor, sum;
switch (typeof input) {
case 'object':
toColor = JSON.stringify(input);
break;
case 'number':
sum = input;
break;
case 'boolean':
return hslToHex(input ? 120 : 0, saturation || 100, lightness || 50);
break;
case 'function':
toColor = input.toString();
break;
case 'string':
default:
toColor = input;
}
if (sum === null) {
sum = 0;
toColor.split('').forEach(function (letter) {
sum += letter.charCodeAt(0);
});
}
sum = Math.abs(sum * sum);
var color = hslToHex(sum % 360, saturation || 100, lightness || 50);
return color;
}
module.exports = hashbow;
## Instruction:
Set default variables at start of function
## Code After:
var hslToHex = require('tie-dye/hslToHex');
function hashbow(input, saturation, lightness) {
var toColor, sum;
saturation = saturation || 100;
lightness = lightness || 50;
switch (typeof input) {
case 'object':
toColor = JSON.stringify(input);
break;
case 'number':
sum = input;
break;
case 'boolean':
return hslToHex(input ? 120 : 0, saturation, lightness);
break;
case 'function':
toColor = input.toString();
break;
case 'string':
default:
toColor = input;
}
if (sum === null) {
sum = 0;
toColor.split('').forEach(function (letter) {
sum += letter.charCodeAt(0);
});
}
sum = Math.abs(sum * sum);
return hslToHex(sum % 360, saturation, lightness);
}
module.exports = hashbow;
| var hslToHex = require('tie-dye/hslToHex');
function hashbow(input, saturation, lightness) {
- var toColor, sum;
var toColor, sum;
+ saturation = saturation || 100;
+ lightness = lightness || 50;
switch (typeof input) {
case 'object':
toColor = JSON.stringify(input);
break;
case 'number':
sum = input;
break;
case 'boolean':
- return hslToHex(input ? 120 : 0, saturation || 100, lightness || 50);
? ------- ------
+ return hslToHex(input ? 120 : 0, saturation, lightness);
break;
case 'function':
toColor = input.toString();
break;
case 'string':
default:
toColor = input;
}
if (sum === null) {
sum = 0;
toColor.split('').forEach(function (letter) {
sum += letter.charCodeAt(0);
});
}
sum = Math.abs(sum * sum);
- var color = hslToHex(sum % 360, saturation || 100, lightness || 50);
? -- ^^^^^ ^^ ------- ------
+ return hslToHex(sum % 360, saturation, lightness);
? ^^^ ^
- return color;
}
module.exports = hashbow; | 8 | 0.205128 | 4 | 4 |
1776ce20b6ebaad39d04f1287b8cc994712b476f | lib/livereload-rails/middleware.rb | lib/livereload-rails/middleware.rb | require "monitor"
require "weak_observable"
require "filewatcher"
module Livereload
class Middleware
def initialize(app, assets: )
@app = app
@clients = WeakObservable.new
assets.configure do |environment|
@watcher = Watcher.new(environment.paths) do |path, event|
asset = environment.find_asset(path, bundle: false)
@clients.notify(asset.digest_path)
end
@watcher_thread = Thread.new do
Thread.current.abort_on_exception = true
@watcher.run
end
end
end
def call(env)
if env["HTTP_UPGRADE"] == "websocket" && env["PATH_INFO"] == "/livereload"
livereload(env)
else
@app.call(env)
end
end
def livereload(env)
Livereload::Client.listen(env) do |client, event|
puts "Client event: #{event}"
case event
when :open
@clients.add(client, :reload)
when :close
@clients.delete(client)
end
end
[-1, {}, []]
end
end
end
| require "monitor"
require "weak_observable"
require "filewatcher"
module Livereload
class Middleware
def initialize(app, assets: )
@app = app
@clients = WeakObservable.new
assets.configure do |environment|
@watcher = Watcher.new(environment.paths) do |path, event|
asset = environment.find_asset(path, bundle: false)
@clients.notify("#{assets.prefix}/#{asset.digest_path}")
end
@watcher_thread = Thread.new do
Thread.current.abort_on_exception = true
@watcher.run
end
end
end
def call(env)
if env["HTTP_UPGRADE"] == "websocket" && env["PATH_INFO"] == "/livereload"
livereload(env)
else
@app.call(env)
end
end
def livereload(env)
Livereload::Client.listen(env) do |client, event|
puts "Client event: #{event}"
case event
when :open
@clients.add(client, :reload)
when :close
@clients.delete(client)
end
end
[-1, {}, []]
end
end
end
| Append assets prefix path when livereloading | Append assets prefix path when livereloading | Ruby | mit | Burgestrand/livereload_rails,Burgestrand/livereload_rails,Burgestrand/livereload_rails,Burgestrand/livereload_rails | ruby | ## Code Before:
require "monitor"
require "weak_observable"
require "filewatcher"
module Livereload
class Middleware
def initialize(app, assets: )
@app = app
@clients = WeakObservable.new
assets.configure do |environment|
@watcher = Watcher.new(environment.paths) do |path, event|
asset = environment.find_asset(path, bundle: false)
@clients.notify(asset.digest_path)
end
@watcher_thread = Thread.new do
Thread.current.abort_on_exception = true
@watcher.run
end
end
end
def call(env)
if env["HTTP_UPGRADE"] == "websocket" && env["PATH_INFO"] == "/livereload"
livereload(env)
else
@app.call(env)
end
end
def livereload(env)
Livereload::Client.listen(env) do |client, event|
puts "Client event: #{event}"
case event
when :open
@clients.add(client, :reload)
when :close
@clients.delete(client)
end
end
[-1, {}, []]
end
end
end
## Instruction:
Append assets prefix path when livereloading
## Code After:
require "monitor"
require "weak_observable"
require "filewatcher"
module Livereload
class Middleware
def initialize(app, assets: )
@app = app
@clients = WeakObservable.new
assets.configure do |environment|
@watcher = Watcher.new(environment.paths) do |path, event|
asset = environment.find_asset(path, bundle: false)
@clients.notify("#{assets.prefix}/#{asset.digest_path}")
end
@watcher_thread = Thread.new do
Thread.current.abort_on_exception = true
@watcher.run
end
end
end
def call(env)
if env["HTTP_UPGRADE"] == "websocket" && env["PATH_INFO"] == "/livereload"
livereload(env)
else
@app.call(env)
end
end
def livereload(env)
Livereload::Client.listen(env) do |client, event|
puts "Client event: #{event}"
case event
when :open
@clients.add(client, :reload)
when :close
@clients.delete(client)
end
end
[-1, {}, []]
end
end
end
| require "monitor"
require "weak_observable"
require "filewatcher"
module Livereload
class Middleware
def initialize(app, assets: )
@app = app
@clients = WeakObservable.new
assets.configure do |environment|
@watcher = Watcher.new(environment.paths) do |path, event|
asset = environment.find_asset(path, bundle: false)
- @clients.notify(asset.digest_path)
+ @clients.notify("#{assets.prefix}/#{asset.digest_path}")
? ++++++++++++++++++++ ++
end
@watcher_thread = Thread.new do
Thread.current.abort_on_exception = true
@watcher.run
end
end
end
def call(env)
if env["HTTP_UPGRADE"] == "websocket" && env["PATH_INFO"] == "/livereload"
livereload(env)
else
@app.call(env)
end
end
def livereload(env)
Livereload::Client.listen(env) do |client, event|
puts "Client event: #{event}"
case event
when :open
@clients.add(client, :reload)
when :close
@clients.delete(client)
end
end
[-1, {}, []]
end
end
end | 2 | 0.042553 | 1 | 1 |
50b707577c5b3b73c4698d2e66c7cf65b6af7d9b | NoteWrangler/app/index.html | NoteWrangler/app/index.html | <!DOCTYPE html>
<html lang="en" ng-app="NoteWrangler">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Note Wrangler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<header>
<app-navbar></app-navbar>
</header>
<main class="container">
<div class="main-wrapper">
<div ng-view=""></div>
</div>
<footer>
<p>© 2016 Company, Inc.</p>
</footer>
</main>
<!-- Load Js libs -->
<script src="js/vendors/angular.js"></script>
<!-- Load app -->
<script src="js/app.module.js"></script>
<script src="js/routes.config.js"></script>
<!-- Controllers -->
<script src="assets/controllers.bundle.js"></script>
<script src="assets/directives.bundle.js"></script>
<script src="assets/services.bundle.js"></script>
<script src="assets/vendors.bundle.js"></script>
</body>
</html>
| <!DOCTYPE html>
<html lang="en" ng-app="NoteWrangler">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Note Wrangler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="assets/css/styles.css">
</head>
<body>
<header>
<app-navbar></app-navbar>
</header>
<main class="container">
<div class="main-wrapper">
<div ng-view=""></div>
</div>
<footer>
<p>© 2016 Company, Inc.</p>
</footer>
</main>
<!-- Load Js libs -->
<script src="js/vendors/angular.js"></script>
<!-- Load app -->
<script src="js/app.module.js"></script>
<script src="js/routes.config.js"></script>
<!-- Controllers -->
<script src="assets/js/controllers.bundle.js"></script>
<script src="assets/js/directives.bundle.js"></script>
<script src="assets/js/services.bundle.js"></script>
<script src="assets/js/vendors.bundle.js"></script>
</body>
</html>
| Edit parhs to js, css files | Edit parhs to js, css files
| HTML | mit | var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training,var-bin/angularjs-training | html | ## Code Before:
<!DOCTYPE html>
<html lang="en" ng-app="NoteWrangler">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Note Wrangler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<header>
<app-navbar></app-navbar>
</header>
<main class="container">
<div class="main-wrapper">
<div ng-view=""></div>
</div>
<footer>
<p>© 2016 Company, Inc.</p>
</footer>
</main>
<!-- Load Js libs -->
<script src="js/vendors/angular.js"></script>
<!-- Load app -->
<script src="js/app.module.js"></script>
<script src="js/routes.config.js"></script>
<!-- Controllers -->
<script src="assets/controllers.bundle.js"></script>
<script src="assets/directives.bundle.js"></script>
<script src="assets/services.bundle.js"></script>
<script src="assets/vendors.bundle.js"></script>
</body>
</html>
## Instruction:
Edit parhs to js, css files
## Code After:
<!DOCTYPE html>
<html lang="en" ng-app="NoteWrangler">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Note Wrangler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="assets/css/styles.css">
</head>
<body>
<header>
<app-navbar></app-navbar>
</header>
<main class="container">
<div class="main-wrapper">
<div ng-view=""></div>
</div>
<footer>
<p>© 2016 Company, Inc.</p>
</footer>
</main>
<!-- Load Js libs -->
<script src="js/vendors/angular.js"></script>
<!-- Load app -->
<script src="js/app.module.js"></script>
<script src="js/routes.config.js"></script>
<!-- Controllers -->
<script src="assets/js/controllers.bundle.js"></script>
<script src="assets/js/directives.bundle.js"></script>
<script src="assets/js/services.bundle.js"></script>
<script src="assets/js/vendors.bundle.js"></script>
</body>
</html>
| <!DOCTYPE html>
<html lang="en" ng-app="NoteWrangler">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Note Wrangler</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="css/bootstrap.css">
- <link rel="stylesheet" href="css/styles.css">
+ <link rel="stylesheet" href="assets/css/styles.css">
? +++++++
</head>
<body>
<header>
<app-navbar></app-navbar>
</header>
<main class="container">
<div class="main-wrapper">
<div ng-view=""></div>
</div>
<footer>
<p>© 2016 Company, Inc.</p>
</footer>
</main>
<!-- Load Js libs -->
<script src="js/vendors/angular.js"></script>
<!-- Load app -->
<script src="js/app.module.js"></script>
<script src="js/routes.config.js"></script>
<!-- Controllers -->
- <script src="assets/controllers.bundle.js"></script>
+ <script src="assets/js/controllers.bundle.js"></script>
? +++
- <script src="assets/directives.bundle.js"></script>
+ <script src="assets/js/directives.bundle.js"></script>
? +++
- <script src="assets/services.bundle.js"></script>
+ <script src="assets/js/services.bundle.js"></script>
? +++
- <script src="assets/vendors.bundle.js"></script>
+ <script src="assets/js/vendors.bundle.js"></script>
? +++
</body>
</html> | 11 | 0.323529 | 5 | 6 |
7bf02e9f50af733e0af28cfcb0dfb7e5f149a4bc | home/.config/starship.toml | home/.config/starship.toml | [directory]
truncate_to_repo = false
truncation_length = 8
truncation_symbol = "…/"
# https://starship.rs/config/#username
[username]
show_always = true
format = "[$user]($style) at "
# https://starship.rs/config/#hostname
[hostname]
ssh_only = false
| [directory]
truncate_to_repo = false
truncation_length = 8
truncation_symbol = "…/"
# https://starship.rs/config/#username
[username]
show_always = true
format = "[$user]($style) at "
# https://starship.rs/config/#hostname
[hostname]
ssh_only = false
# https://starship.rs/config/#command-duration
[cmd_duration]
show_milliseconds = true
| Make the spaceship took display more detailed | Make the spaceship took display more detailed
| TOML | mit | By-Vasiliy/dotfiles,By-Vasiliy/dotfiles | toml | ## Code Before:
[directory]
truncate_to_repo = false
truncation_length = 8
truncation_symbol = "…/"
# https://starship.rs/config/#username
[username]
show_always = true
format = "[$user]($style) at "
# https://starship.rs/config/#hostname
[hostname]
ssh_only = false
## Instruction:
Make the spaceship took display more detailed
## Code After:
[directory]
truncate_to_repo = false
truncation_length = 8
truncation_symbol = "…/"
# https://starship.rs/config/#username
[username]
show_always = true
format = "[$user]($style) at "
# https://starship.rs/config/#hostname
[hostname]
ssh_only = false
# https://starship.rs/config/#command-duration
[cmd_duration]
show_milliseconds = true
| [directory]
truncate_to_repo = false
truncation_length = 8
truncation_symbol = "…/"
# https://starship.rs/config/#username
[username]
show_always = true
format = "[$user]($style) at "
# https://starship.rs/config/#hostname
[hostname]
ssh_only = false
+
+ # https://starship.rs/config/#command-duration
+ [cmd_duration]
+ show_milliseconds = true | 4 | 0.307692 | 4 | 0 |
2d8546a86c43c2cb30df13899a96da4120d264a4 | memcached/content.md | memcached/content.md |
Memcached is a general-purpose distributed memory caching system. It is often
used to speed up dynamic database-driven websites by caching data and objects in
RAM to reduce the number of times an external data source (such as a database or
API) must be read.
Memcached's APIs provide a very large hash table distributed across multiple
machines. When the table is full, subsequent inserts cause older data to be
purged in least recently used order. Applications using Memcached typically
layer requests and additions into RAM before falling back on a slower backing
store, such as a database.
> [wikipedia.org/wiki/Memcached](https://en.wikipedia.org/wiki/Memcached)
# How to use this image
docker run --name my-memcache -d memcached
Start your memcached container with the above command and then you can connect
you app to it with standard linking:
docker run --link my-memcache:memcache -d my-app-image
The memcached server information would then be available through the ENV
variables generated by the link as well as through DNS as `memcache` from
`/etc/hosts`.
For infomation on configuring your memcached server, see the extensive [wiki](https://code.google.com/p/memcached/wiki/NewStart).
# Known Issues
As of 1.4.21, memcached does not handle `SIGTERM`, so a standard `docker stop`
will not stop it gracefully, but will resort to `SIGKILL` after the 10 second
timeout. Use `docker kill -s INT` to do a clean stop of the memcached
container. There is [a PR](https://github.com/memcached/memcached/pull/88) to
change this behavior upstream.
|
Memcached is a general-purpose distributed memory caching system. It is often
used to speed up dynamic database-driven websites by caching data and objects in
RAM to reduce the number of times an external data source (such as a database or
API) must be read.
Memcached's APIs provide a very large hash table distributed across multiple
machines. When the table is full, subsequent inserts cause older data to be
purged in least recently used order. Applications using Memcached typically
layer requests and additions into RAM before falling back on a slower backing
store, such as a database.
> [wikipedia.org/wiki/Memcached](https://en.wikipedia.org/wiki/Memcached)
# How to use this image
docker run --name my-memcache -d memcached
Start your memcached container with the above command and then you can connect
you app to it with standard linking:
docker run --link my-memcache:memcache -d my-app-image
The memcached server information would then be available through the ENV
variables generated by the link as well as through DNS as `memcache` from
`/etc/hosts`.
For infomation on configuring your memcached server, see the extensive [wiki](https://code.google.com/p/memcached/wiki/NewStart).
| Remove SIGTERM note from memcached docs | Remove SIGTERM note from memcached docs
As of 1.4.22, it's FIXED UPSTREAM! :tada:
| Markdown | mit | jakelly/docs,dmetzler/docker-library-docs,pydio/docs,crate/docker-docs,mysql/mysql-docker-docs,Lightstreamer/docs,hecklerm/docs,atyenoria/docs,Bonitasoft-Community/docker_docs,clakech/docs,dancrumb/docs,astawiarski/docs,crate/docker-docs,peterkuiper/docs,godu/docs,pierreozoux/docs,thaihau/docs,Scriptkiddi/docs,dpwspoon/docs,ceejatec/docs,orientechnologies/docker-docs,booyaa/docs,emilevauge/docs,infosiftr/docker-library-docs,Starefossen/docs,31z4/docs,tomitribe/docs,mpichette/docs,davidcurrie/docs,ros-infrastructure/docs,appropriate/docker-library-docs,esmail/docs,nagyistoce/odoo-docker-docs,Scriptkiddi/docs,sublimino/docs-1,nats-io/docker-docs,mattrobenolt/docs,hecklerm/docs,odoo/docker-docs,josegonzalez/docs,tiagolo/docs,wallyqs/docs,snailwalker/docs,jetty-project/docker-docs,dictybase-docker/docs,thaihau/docs,hoelzro/docker-library-docs,mattrobenolt/docs,c0b/official-images-docs,ceejatec/docs,tiagolo/docs,tfoote/docker-library-docs,JacerOmri/docs,31z4/docs,neo4j-contrib/docs,zendtech/docs,ros-infrastructure/docs,chaudum/docs,chorrell/docs,dgageot/docs,nats-io/docker-docs,Lightstreamer/docs,chorrell/docs,hoelzro/docker-library-docs,caoyangs/docs,JacerOmri/docs,resin-io-library/docs,bascht/docs,docker-solr/docs,hanwoody/docs,godu/docs,dancrumb/docs,resin-io-library/docs,davidcurrie/docs,car031/docs,BastianHofmann/docs-1,caoyangs/docs,volmarl/docs,appropriate/docker-library-docs,snailwalker/docs,dictybase-docker/docs,c0b/docs,docker-solr/docs,josegonzalez/docs,testshotagit/docs,Bonitasoft-Community/docker_docs,astawiarski/docs,vaygr/docker-library-docs,bascht/docs,emil10001/docs,avoinea/docs,BradleyA/docs,dpwspoon/docs,volmarl/docs,nghiant2710/docs,leon/docker-docs,peterkuiper/docs,pierreozoux/docs,yuriyf/docs,jperrin/docs,testshotagit/docs,alejdg/docs,jetty-project/docker-docs,orientechnologies/docker-docs,mysql/mysql-docker-docs,dinogun/docs,hanwoody/docs,avoinea/docs,odoo/docker-docs,vmassol/docs,rogeriopradoj/docs-1,docker-library/docs,EIrwin/docs,docker-flink/docs,yuriyf/docs,jakelly/docs,dinogun/docs,moander/docs,pydio/docs,atyenoria/docs,docker-library/docs,car031/docs,zhanggangbz/docs,infosiftr/docker-library-docs,rogeriopradoj/docs-1,docker-flink/docs,moander/docs,BradleyA/docs,nagyistoce/odoo-docker-docs,wallyqs/docs,c0b/official-images-docs,sandoracs/docs,zhanggangbz/docs,nghiant2710/docs,Acidburn0zzz/docs-5,neo4j-contrib/docs,zendtech/docs,tilosp-docker/library-docs,BastianHofmann/docs-1,Starefossen/docs,jperrin/docs,clakech/docs,dmetzler/docker-library-docs,leangjia/docs,Acidburn0zzz/docs-5,tilosp-docker/library-docs,sublimino/docs-1,leon/docker-docs,esmail/docs,leangjia/docs,mpichette/docs,tomitribe/docs,alejdg/docs,emil10001/docs,booyaa/docs,vaygr/docker-library-docs,dgageot/docs,gprivitera/docs,gprivitera/docs,vmassol/docs,sandoracs/docs,emilevauge/docs,c0b/docs,tfoote/docker-library-docs,chaudum/docs,EIrwin/docs | markdown | ## Code Before:
Memcached is a general-purpose distributed memory caching system. It is often
used to speed up dynamic database-driven websites by caching data and objects in
RAM to reduce the number of times an external data source (such as a database or
API) must be read.
Memcached's APIs provide a very large hash table distributed across multiple
machines. When the table is full, subsequent inserts cause older data to be
purged in least recently used order. Applications using Memcached typically
layer requests and additions into RAM before falling back on a slower backing
store, such as a database.
> [wikipedia.org/wiki/Memcached](https://en.wikipedia.org/wiki/Memcached)
# How to use this image
docker run --name my-memcache -d memcached
Start your memcached container with the above command and then you can connect
you app to it with standard linking:
docker run --link my-memcache:memcache -d my-app-image
The memcached server information would then be available through the ENV
variables generated by the link as well as through DNS as `memcache` from
`/etc/hosts`.
For infomation on configuring your memcached server, see the extensive [wiki](https://code.google.com/p/memcached/wiki/NewStart).
# Known Issues
As of 1.4.21, memcached does not handle `SIGTERM`, so a standard `docker stop`
will not stop it gracefully, but will resort to `SIGKILL` after the 10 second
timeout. Use `docker kill -s INT` to do a clean stop of the memcached
container. There is [a PR](https://github.com/memcached/memcached/pull/88) to
change this behavior upstream.
## Instruction:
Remove SIGTERM note from memcached docs
As of 1.4.22, it's FIXED UPSTREAM! :tada:
## Code After:
Memcached is a general-purpose distributed memory caching system. It is often
used to speed up dynamic database-driven websites by caching data and objects in
RAM to reduce the number of times an external data source (such as a database or
API) must be read.
Memcached's APIs provide a very large hash table distributed across multiple
machines. When the table is full, subsequent inserts cause older data to be
purged in least recently used order. Applications using Memcached typically
layer requests and additions into RAM before falling back on a slower backing
store, such as a database.
> [wikipedia.org/wiki/Memcached](https://en.wikipedia.org/wiki/Memcached)
# How to use this image
docker run --name my-memcache -d memcached
Start your memcached container with the above command and then you can connect
you app to it with standard linking:
docker run --link my-memcache:memcache -d my-app-image
The memcached server information would then be available through the ENV
variables generated by the link as well as through DNS as `memcache` from
`/etc/hosts`.
For infomation on configuring your memcached server, see the extensive [wiki](https://code.google.com/p/memcached/wiki/NewStart).
|
Memcached is a general-purpose distributed memory caching system. It is often
used to speed up dynamic database-driven websites by caching data and objects in
RAM to reduce the number of times an external data source (such as a database or
API) must be read.
Memcached's APIs provide a very large hash table distributed across multiple
machines. When the table is full, subsequent inserts cause older data to be
purged in least recently used order. Applications using Memcached typically
layer requests and additions into RAM before falling back on a slower backing
store, such as a database.
> [wikipedia.org/wiki/Memcached](https://en.wikipedia.org/wiki/Memcached)
# How to use this image
docker run --name my-memcache -d memcached
Start your memcached container with the above command and then you can connect
you app to it with standard linking:
docker run --link my-memcache:memcache -d my-app-image
The memcached server information would then be available through the ENV
variables generated by the link as well as through DNS as `memcache` from
`/etc/hosts`.
For infomation on configuring your memcached server, see the extensive [wiki](https://code.google.com/p/memcached/wiki/NewStart).
-
- # Known Issues
-
- As of 1.4.21, memcached does not handle `SIGTERM`, so a standard `docker stop`
- will not stop it gracefully, but will resort to `SIGKILL` after the 10 second
- timeout. Use `docker kill -s INT` to do a clean stop of the memcached
- container. There is [a PR](https://github.com/memcached/memcached/pull/88) to
- change this behavior upstream. | 8 | 0.222222 | 0 | 8 |
dd70fcd512962c5248928a1c9b897fc33249f567 | judge/utils/views.py | judge/utils/views.py | from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
__author__ = 'Quantum'
def generic_message(request, title, message):
return render_to_response('generic_message.jade', {
'message': message,
'title': title
}, context_instance=RequestContext(request))
class TitleMixin(object):
title = '(untitled)'
def get_context_data(self, **kwargs):
context = super(TitleMixin, self).get_context_data(**kwargs)
context['title'] = self.get_title()
return context
def get_title(self):
return self.title
class LoginRequiredMixin(object):
@classmethod
def as_view(cls, **initkwargs):
view = super(LoginRequiredMixin, cls).as_view(**initkwargs)
return login_required(view) | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
__author__ = 'Quantum'
def generic_message(request, title, message, status=None):
return render(request, 'generic_message.jade', {
'message': message,
'title': title
}, status=status)
class TitleMixin(object):
title = '(untitled)'
def get_context_data(self, **kwargs):
context = super(TitleMixin, self).get_context_data(**kwargs)
context['title'] = self.get_title()
return context
def get_title(self):
return self.title
class LoginRequiredMixin(object):
@classmethod
def as_view(cls, **initkwargs):
view = super(LoginRequiredMixin, cls).as_view(**initkwargs)
return login_required(view) | Use the render shortcut which defaults to RequestContext and allows passing a status code | Use the render shortcut which defaults to RequestContext and allows passing a status code
| Python | agpl-3.0 | Minkov/site,monouno/site,monouno/site,Phoenix1369/site,DMOJ/site,monouno/site,DMOJ/site,Minkov/site,Phoenix1369/site,DMOJ/site,Minkov/site,Phoenix1369/site,monouno/site,monouno/site,DMOJ/site,Minkov/site,Phoenix1369/site | python | ## Code Before:
from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
__author__ = 'Quantum'
def generic_message(request, title, message):
return render_to_response('generic_message.jade', {
'message': message,
'title': title
}, context_instance=RequestContext(request))
class TitleMixin(object):
title = '(untitled)'
def get_context_data(self, **kwargs):
context = super(TitleMixin, self).get_context_data(**kwargs)
context['title'] = self.get_title()
return context
def get_title(self):
return self.title
class LoginRequiredMixin(object):
@classmethod
def as_view(cls, **initkwargs):
view = super(LoginRequiredMixin, cls).as_view(**initkwargs)
return login_required(view)
## Instruction:
Use the render shortcut which defaults to RequestContext and allows passing a status code
## Code After:
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
__author__ = 'Quantum'
def generic_message(request, title, message, status=None):
return render(request, 'generic_message.jade', {
'message': message,
'title': title
}, status=status)
class TitleMixin(object):
title = '(untitled)'
def get_context_data(self, **kwargs):
context = super(TitleMixin, self).get_context_data(**kwargs)
context['title'] = self.get_title()
return context
def get_title(self):
return self.title
class LoginRequiredMixin(object):
@classmethod
def as_view(cls, **initkwargs):
view = super(LoginRequiredMixin, cls).as_view(**initkwargs)
return login_required(view) | from django.contrib.auth.decorators import login_required
- from django.shortcuts import render_to_response
? ------------
+ from django.shortcuts import render
- from django.template import RequestContext
__author__ = 'Quantum'
- def generic_message(request, title, message):
+ def generic_message(request, title, message, status=None):
? +++++++++++++
- return render_to_response('generic_message.jade', {
? ^^^^ ^^^^^^
+ return render(request, 'generic_message.jade', {
? ^ +++ ^^^
'message': message,
'title': title
- }, context_instance=RequestContext(request))
+ }, status=status)
class TitleMixin(object):
title = '(untitled)'
def get_context_data(self, **kwargs):
context = super(TitleMixin, self).get_context_data(**kwargs)
context['title'] = self.get_title()
return context
def get_title(self):
return self.title
class LoginRequiredMixin(object):
@classmethod
def as_view(cls, **initkwargs):
view = super(LoginRequiredMixin, cls).as_view(**initkwargs)
return login_required(view) | 9 | 0.290323 | 4 | 5 |
a50545a795cb934ce106b8dcf779eea6c5e981d7 | views/index.html | views/index.html | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Wordgrid - An online wordbrain</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" href="./css/style.css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<header class='text-center'>Wordgrid - An online wordbrain</header>
<div class="">
<div class="col-xs-5 col-xs-offset-1">
<canvas id="canvas" width="300" height="300"></canvas>
</div>
</div>
<script type="text/javascript" src="./js/RoundedBox.js"></script>
<script type="text/javascript" src="./js/Grid.js"></script>
<script type="text/javascript" src="./js/game.js"></script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Wordgrid - An online wordbrain</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" href="./css/style.css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<header class='text-center'>Wordgrid - An online wordbrain</header>
<div class="">
<div class="col-xs-5 col-xs-offset-1">
<canvas id="canvas" width="300" height="300">You're browser can't draw a canvas, if you want playing, change browser ;)</canvas>
</div>
</div>
<script type="text/javascript" src="./js/RoundedBox.js"></script>
<script type="text/javascript" src="./js/Grid.js"></script>
<script type="text/javascript" src="./js/game.js"></script>
</body>
</html>
| Add error message when canvas can't be draw by the browser | Add error message when canvas can't be draw by the browser
| HTML | mit | S0orax/Wordgrid,S0orax/Wordgrid | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Wordgrid - An online wordbrain</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" href="./css/style.css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<header class='text-center'>Wordgrid - An online wordbrain</header>
<div class="">
<div class="col-xs-5 col-xs-offset-1">
<canvas id="canvas" width="300" height="300"></canvas>
</div>
</div>
<script type="text/javascript" src="./js/RoundedBox.js"></script>
<script type="text/javascript" src="./js/Grid.js"></script>
<script type="text/javascript" src="./js/game.js"></script>
</body>
</html>
## Instruction:
Add error message when canvas can't be draw by the browser
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Wordgrid - An online wordbrain</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" href="./css/style.css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<header class='text-center'>Wordgrid - An online wordbrain</header>
<div class="">
<div class="col-xs-5 col-xs-offset-1">
<canvas id="canvas" width="300" height="300">You're browser can't draw a canvas, if you want playing, change browser ;)</canvas>
</div>
</div>
<script type="text/javascript" src="./js/RoundedBox.js"></script>
<script type="text/javascript" src="./js/Grid.js"></script>
<script type="text/javascript" src="./js/game.js"></script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Wordgrid - An online wordbrain</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" href="./css/style.css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<header class='text-center'>Wordgrid - An online wordbrain</header>
<div class="">
<div class="col-xs-5 col-xs-offset-1">
- <canvas id="canvas" width="300" height="300"></canvas>
+ <canvas id="canvas" width="300" height="300">You're browser can't draw a canvas, if you want playing, change browser ;)</canvas>
</div>
</div>
<script type="text/javascript" src="./js/RoundedBox.js"></script>
<script type="text/javascript" src="./js/Grid.js"></script>
<script type="text/javascript" src="./js/game.js"></script>
</body>
</html> | 2 | 0.086957 | 1 | 1 |
7fcde284455f6c2f7796c3af67ddde6851374266 | packages/la/language-qux.yaml | packages/la/language-qux.yaml | homepage: https://github.com/qux-lang/language-qux
changelog-type: ''
hash: 6358de5a8b49a16d285322dbcc8341b4623269373a0a39a54f39559fe47e9171
test-bench-deps: {}
maintainer: public@hjwylde.com
synopsis: Utilities for working with the Qux language
changelog: ''
basic-deps:
either: ==4.*
indents: ! '>=0.3.3 && <0.4'
base: ! '>=4.7 && <5'
parsec: ==3.*
containers: ==0.5.*
mtl: ==2.*
transformers: ==0.4.*
pretty: ! '>=1.1.2 && <2'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.1.0'
- '0.1.1.1'
author: Henry J. Wylde
latest: '0.1.1.1'
description-type: haddock
description: ''
license-name: BSD3
| homepage: https://github.com/qux-lang/language-qux
changelog-type: ''
hash: 44fcd0e9916fc87e7eac3961d9539f838d3c69adfa41f72cbc1d961c7f28681e
test-bench-deps: {}
maintainer: public@hjwylde.com
synopsis: Utilities for working with the Qux language
changelog: ''
basic-deps:
either: ==4.*
indents: ! '>=0.3.3 && <0.4'
base: ! '>=4.7 && <5'
parsec: ==3.*
containers: ==0.5.*
mtl: ==2.*
transformers: ==0.4.*
pretty: ! '>=1.1.2 && <2'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.1.0'
- '0.1.1.1'
- '0.1.1.2'
author: Henry J. Wylde
latest: '0.1.1.2'
description-type: haddock
description: ''
license-name: BSD3
| Update from Hackage at 2015-09-02T07:37:58+0000 | Update from Hackage at 2015-09-02T07:37:58+0000
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://github.com/qux-lang/language-qux
changelog-type: ''
hash: 6358de5a8b49a16d285322dbcc8341b4623269373a0a39a54f39559fe47e9171
test-bench-deps: {}
maintainer: public@hjwylde.com
synopsis: Utilities for working with the Qux language
changelog: ''
basic-deps:
either: ==4.*
indents: ! '>=0.3.3 && <0.4'
base: ! '>=4.7 && <5'
parsec: ==3.*
containers: ==0.5.*
mtl: ==2.*
transformers: ==0.4.*
pretty: ! '>=1.1.2 && <2'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.1.0'
- '0.1.1.1'
author: Henry J. Wylde
latest: '0.1.1.1'
description-type: haddock
description: ''
license-name: BSD3
## Instruction:
Update from Hackage at 2015-09-02T07:37:58+0000
## Code After:
homepage: https://github.com/qux-lang/language-qux
changelog-type: ''
hash: 44fcd0e9916fc87e7eac3961d9539f838d3c69adfa41f72cbc1d961c7f28681e
test-bench-deps: {}
maintainer: public@hjwylde.com
synopsis: Utilities for working with the Qux language
changelog: ''
basic-deps:
either: ==4.*
indents: ! '>=0.3.3 && <0.4'
base: ! '>=4.7 && <5'
parsec: ==3.*
containers: ==0.5.*
mtl: ==2.*
transformers: ==0.4.*
pretty: ! '>=1.1.2 && <2'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.1.0'
- '0.1.1.1'
- '0.1.1.2'
author: Henry J. Wylde
latest: '0.1.1.2'
description-type: haddock
description: ''
license-name: BSD3
| homepage: https://github.com/qux-lang/language-qux
changelog-type: ''
- hash: 6358de5a8b49a16d285322dbcc8341b4623269373a0a39a54f39559fe47e9171
+ hash: 44fcd0e9916fc87e7eac3961d9539f838d3c69adfa41f72cbc1d961c7f28681e
test-bench-deps: {}
maintainer: public@hjwylde.com
synopsis: Utilities for working with the Qux language
changelog: ''
basic-deps:
either: ==4.*
indents: ! '>=0.3.3 && <0.4'
base: ! '>=4.7 && <5'
parsec: ==3.*
containers: ==0.5.*
mtl: ==2.*
transformers: ==0.4.*
pretty: ! '>=1.1.2 && <2'
all-versions:
- '0.1.0.0'
- '0.1.0.1'
- '0.1.1.0'
- '0.1.1.1'
+ - '0.1.1.2'
author: Henry J. Wylde
- latest: '0.1.1.1'
? ^
+ latest: '0.1.1.2'
? ^
description-type: haddock
description: ''
license-name: BSD3 | 5 | 0.192308 | 3 | 2 |
6298f033763e87469fd68ad6fcc4e70298985e92 | split/readme.md | split/readme.md | Splitting out the project components is done with [git split](https://github.com/dflydev/git-subsplit).
| Splitting out the project components is done with [git split](https://github.com/dflydev/git-subsplit).
#### How to add a new component
- Place component under `components` folder.
- Commit and push the code to github.
- Create a new repository in [limoncello-php-dist](https://github.com/limoncello-php-dist);
- Update `components.sh` file.
- Run one of the split scripts.
- Submit the component to [packagist.org](https://packagist.org/).
- Add a hook on github to packagist.org, set up github wiki, issues, and etc.
| Add how-to add a new component. | Add how-to add a new component.
| Markdown | apache-2.0 | limoncello-php/framework,limoncello-php/framework,limoncello-php/framework,limoncello-php/framework | markdown | ## Code Before:
Splitting out the project components is done with [git split](https://github.com/dflydev/git-subsplit).
## Instruction:
Add how-to add a new component.
## Code After:
Splitting out the project components is done with [git split](https://github.com/dflydev/git-subsplit).
#### How to add a new component
- Place component under `components` folder.
- Commit and push the code to github.
- Create a new repository in [limoncello-php-dist](https://github.com/limoncello-php-dist);
- Update `components.sh` file.
- Run one of the split scripts.
- Submit the component to [packagist.org](https://packagist.org/).
- Add a hook on github to packagist.org, set up github wiki, issues, and etc.
| Splitting out the project components is done with [git split](https://github.com/dflydev/git-subsplit).
+
+ #### How to add a new component
+
+ - Place component under `components` folder.
+ - Commit and push the code to github.
+ - Create a new repository in [limoncello-php-dist](https://github.com/limoncello-php-dist);
+ - Update `components.sh` file.
+ - Run one of the split scripts.
+ - Submit the component to [packagist.org](https://packagist.org/).
+ - Add a hook on github to packagist.org, set up github wiki, issues, and etc. | 10 | 10 | 10 | 0 |
0d3325a6d10947de0b737b654c1768bd33a1c340 | script/add-key.cmd | script/add-key.cmd | openssl aes-256-cbc -k %ENCRYPTION_SECRET% -in .\build\resources\authenticode-signing-cert.p12.enc -out .\build\resources\authenticode-signing-cert.p12 -d -a
certutil -p %KEY_PASSWORD% -importpfx .\build\resources\authenticode-signing-cert.p12
| openssl aes-256-cbc -k %ENCRYPTION_SECRET% -in .\build\resources\authenticode-signing-cert.p12.enc -out .\build\resources\authenticode-signing-cert.p12 -d -a
certutil -p %KEY_PASSWORD% -user -importpfx .\build\resources\authenticode-signing-cert.p12 NoRoot
| Add key to user's store | Add key to user's store
| Batchfile | apache-2.0 | spark/particle-dev | batchfile | ## Code Before:
openssl aes-256-cbc -k %ENCRYPTION_SECRET% -in .\build\resources\authenticode-signing-cert.p12.enc -out .\build\resources\authenticode-signing-cert.p12 -d -a
certutil -p %KEY_PASSWORD% -importpfx .\build\resources\authenticode-signing-cert.p12
## Instruction:
Add key to user's store
## Code After:
openssl aes-256-cbc -k %ENCRYPTION_SECRET% -in .\build\resources\authenticode-signing-cert.p12.enc -out .\build\resources\authenticode-signing-cert.p12 -d -a
certutil -p %KEY_PASSWORD% -user -importpfx .\build\resources\authenticode-signing-cert.p12 NoRoot
| openssl aes-256-cbc -k %ENCRYPTION_SECRET% -in .\build\resources\authenticode-signing-cert.p12.enc -out .\build\resources\authenticode-signing-cert.p12 -d -a
- certutil -p %KEY_PASSWORD% -importpfx .\build\resources\authenticode-signing-cert.p12
+ certutil -p %KEY_PASSWORD% -user -importpfx .\build\resources\authenticode-signing-cert.p12 NoRoot
? ++++++ +++++++
| 2 | 1 | 1 | 1 |
ce2f4dca16bd755f7cae42d93a4c7089a309e31a | awx/ui/client/src/instance-groups/instances/instance-modal.block.less | awx/ui/client/src/instance-groups/instances/instance-modal.block.less | .Modal-backdrop {
position: fixed;
top: 0px;
left: 0px;
height:100%;
width:100%;
background: #000;
z-index: 2;
opacity: 0.5;
}
.Modal-holder {
position: fixed;
top: 1;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
z-index: 3;
overflow-y: scroll;
.modal-dialog {
padding-top: 100px;
}
}
| .Modal-backdrop {
background: #000;
height:100%;
left: 0px;
opacity: 0.25;
position: fixed;
top: 0px;
width:100%;
z-index: 1050;
}
.Modal-holder {
bottom: 0px;
left: 0px;
overflow-y: scroll;
position: fixed;
right: 0px;
top: 0px;
top: 1;
z-index: 1100;
.modal-dialog {
padding-top: 100px;
}
}
| Fix instance modal backdrop styles | Fix instance modal backdrop styles
| Less | apache-2.0 | wwitzel3/awx,wwitzel3/awx,wwitzel3/awx,wwitzel3/awx | less | ## Code Before:
.Modal-backdrop {
position: fixed;
top: 0px;
left: 0px;
height:100%;
width:100%;
background: #000;
z-index: 2;
opacity: 0.5;
}
.Modal-holder {
position: fixed;
top: 1;
left: 0px;
right: 0px;
top: 0px;
bottom: 0px;
z-index: 3;
overflow-y: scroll;
.modal-dialog {
padding-top: 100px;
}
}
## Instruction:
Fix instance modal backdrop styles
## Code After:
.Modal-backdrop {
background: #000;
height:100%;
left: 0px;
opacity: 0.25;
position: fixed;
top: 0px;
width:100%;
z-index: 1050;
}
.Modal-holder {
bottom: 0px;
left: 0px;
overflow-y: scroll;
position: fixed;
right: 0px;
top: 0px;
top: 1;
z-index: 1100;
.modal-dialog {
padding-top: 100px;
}
}
| .Modal-backdrop {
+ background: #000;
+ height:100%;
+ left: 0px;
+ opacity: 0.25;
position: fixed;
top: 0px;
- left: 0px;
- height:100%;
width:100%;
- background: #000;
- z-index: 2;
? ^
+ z-index: 1050;
? ^^^^
- opacity: 0.5;
}
.Modal-holder {
+ bottom: 0px;
+ left: 0px;
+ overflow-y: scroll;
position: fixed;
- top: 1;
- left: 0px;
right: 0px;
top: 0px;
- bottom: 0px;
+ top: 1;
- z-index: 3;
? ^
+ z-index: 1100;
? ^^^^
- overflow-y: scroll;
.modal-dialog {
padding-top: 100px;
}
} | 20 | 0.8 | 10 | 10 |
006665a5eba40510fbde07cf1cce117906769066 | resources/leiningen/new/kraken/config.edn | resources/leiningen/new/kraken/config.edn | {:rabbit-mq {:connection {:host #resource-config/env "RABBITMQ_PORT_5672_TCP_ADDR"
:port #resource-config/edn #resource-config/env "RABBITMQ_PORT_5672_TCP_PORT"}
:queues {"{{name}}.ok" {:exclusive false :auto-delete true}}}
:datomic {:uri "datomic:mem://{{name}}"
:partition :{{name}}
:intitialize true
:run-migrations true}}
| {:rabbit-mq {:connection {:host #resource-config/env "RABBITMQ_PORT_5672_TCP_ADDR"
:port #resource-config/edn #resource-config/env "RABBITMQ_PORT_5672_TCP_PORT"}
:queues {"{{name}}.ok" {:exclusive false :durable true :auto-delete false}}}
:datomic {:uri "datomic:mem://{{name}}"
:partition :{{name}}
:intitialize true
:run-migrations true}}
| Correct ususal Rabbit queue settings | [CS] Correct ususal Rabbit queue settings
| edn | epl-1.0 | democracyworks/kraken-works-lein-template,democracyworks/kraken-lein-template | edn | ## Code Before:
{:rabbit-mq {:connection {:host #resource-config/env "RABBITMQ_PORT_5672_TCP_ADDR"
:port #resource-config/edn #resource-config/env "RABBITMQ_PORT_5672_TCP_PORT"}
:queues {"{{name}}.ok" {:exclusive false :auto-delete true}}}
:datomic {:uri "datomic:mem://{{name}}"
:partition :{{name}}
:intitialize true
:run-migrations true}}
## Instruction:
[CS] Correct ususal Rabbit queue settings
## Code After:
{:rabbit-mq {:connection {:host #resource-config/env "RABBITMQ_PORT_5672_TCP_ADDR"
:port #resource-config/edn #resource-config/env "RABBITMQ_PORT_5672_TCP_PORT"}
:queues {"{{name}}.ok" {:exclusive false :durable true :auto-delete false}}}
:datomic {:uri "datomic:mem://{{name}}"
:partition :{{name}}
:intitialize true
:run-migrations true}}
| {:rabbit-mq {:connection {:host #resource-config/env "RABBITMQ_PORT_5672_TCP_ADDR"
:port #resource-config/edn #resource-config/env "RABBITMQ_PORT_5672_TCP_PORT"}
- :queues {"{{name}}.ok" {:exclusive false :auto-delete true}}}
? ^^^
+ :queues {"{{name}}.ok" {:exclusive false :durable true :auto-delete false}}}
? ++++++++++++++ ^^^^
:datomic {:uri "datomic:mem://{{name}}"
:partition :{{name}}
:intitialize true
:run-migrations true}} | 2 | 0.285714 | 1 | 1 |
4348d845232336ce697dec6226e3b85b6cdf4e0c | base/meegotouch/libmeegotouchviews/style/mstatusbarstyle.css | base/meegotouch/libmeegotouchviews/style/mstatusbarstyle.css | MStatusBarStyle
{
minimum-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
preferred-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
maximum-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
background-color: ;
use-swipe-gesture: true;
swipe-threshold: 30;
press-feedback : press;
}
| MStatusBarStyle
{
minimum-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
preferred-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
maximum-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
background-color: ;
use-swipe-gesture: true;
swipe-threshold: 30;
press-feedback : press;
press-dim-factor: 0.6;
}
| Add press dimming factor to MStatusBarStyle | Changes: Add press dimming factor to MStatusBarStyle
| CSS | lgpl-2.1 | nemomobile-graveyard/meegotouch-theme | css | ## Code Before:
MStatusBarStyle
{
minimum-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
preferred-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
maximum-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
background-color: ;
use-swipe-gesture: true;
swipe-threshold: 30;
press-feedback : press;
}
## Instruction:
Changes: Add press dimming factor to MStatusBarStyle
## Code After:
MStatusBarStyle
{
minimum-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
preferred-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
maximum-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
background-color: ;
use-swipe-gesture: true;
swipe-threshold: 30;
press-feedback : press;
press-dim-factor: 0.6;
}
| MStatusBarStyle
{
minimum-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
preferred-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
maximum-size: 100% $HEIGHT_STATUSBAR_WITH_REACTIVE_MARGIN;
background-color: ;
use-swipe-gesture: true;
swipe-threshold: 30;
press-feedback : press;
+ press-dim-factor: 0.6;
} | 1 | 0.1 | 1 | 0 |
d5cb2a3f9ba2e647224c7c17e9125ef344028a4a | package.json | package.json | {
"name": "beer-tab",
"version": "0.0.1",
"description": "beer as social currency",
"main": "server.js",
"repository": {
"type": "git",
"url": "git://github.com/ViridescentGrizzly/beer-tab.git"
},
"license": "MIT",
"author": "Viridescent Grizzly",
"contributors": [
{
"name": "Michael Kurrels",
"email": "mjkurrels@gmail.com"
},
{
"name": "Nate Meier",
"email": "iemanatemire@gmail.com"
},
{
"name": "Andrés Viesca",
"email": "viestat@icloud.com"
},
{
"name": "Steven Wu",
"email": "wucommasteven@gmail.com"
}],
}
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/ViridescentGrizzly/beer-tab.git"
},
"devDependencies": {},
"dependencies": {
"express": "^4.13.3",
"mongoose": "^4.1.1",
"morgan": "^1.6.1"
}
}
| {
"name": "beer-tab",
"version": "0.0.1",
"description": "beer as social currency",
"main": "server.js",
"repository": {
"type": "git",
"url": "git://github.com/ViridescentGrizzly/beer-tab.git"
},
"license": "MIT",
"author": "Viridescent Grizzly",
"contributors": [{
"name": "Michael Kurrels",
"email": "mjkurrels@gmail.com"
},{
"name": "Nate Meier",
"email": "iemanatemire@gmail.com"
},{
"name": "Andrés Viesca",
"email": "viestat@icloud.com"
},{
"name": "Steven Wu",
"email": "wucommasteven@gmail.com"
}
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/ViridescentGrizzly/beer-tab.git"
},
"devDependencies": {},
"dependencies": {
"express": "^4.13.3",
"mongoose": "^4.1.1",
"morgan": "^1.6.1"
}
}
| Add config file for mongoose setup | Add config file for mongoose setup
| JSON | mit | mKurrels/beer-tab,viestat/beer-tab,RHays91/beer-tab,jimtom2713/beer-tab,ViridescentGrizzly/beer-tab,csaden/beer-tab,RHays91/beer-tab,stvnwu/beer-tab,macklevine/beer-tab,jimtom2713/beer-tab,mKurrels/beer-tab,csaden/beer-tab,ViridescentGrizzly/beer-tab,metallic-gazelle/beer-tab,viestat/beer-tab,MaxBreakfast/beer-tab,stvnwu/beer-tab,MaxBreakfast/beer-tab,metallic-gazelle/beer-tab,kylebasu/beer-tab,trevorhanus/beer-tab,macklevine/beer-tab,kylebasu/beer-tab,trevorhanus/beer-tab,stvnwu/beer-tab | json | ## Code Before:
{
"name": "beer-tab",
"version": "0.0.1",
"description": "beer as social currency",
"main": "server.js",
"repository": {
"type": "git",
"url": "git://github.com/ViridescentGrizzly/beer-tab.git"
},
"license": "MIT",
"author": "Viridescent Grizzly",
"contributors": [
{
"name": "Michael Kurrels",
"email": "mjkurrels@gmail.com"
},
{
"name": "Nate Meier",
"email": "iemanatemire@gmail.com"
},
{
"name": "Andrés Viesca",
"email": "viestat@icloud.com"
},
{
"name": "Steven Wu",
"email": "wucommasteven@gmail.com"
}],
}
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/ViridescentGrizzly/beer-tab.git"
},
"devDependencies": {},
"dependencies": {
"express": "^4.13.3",
"mongoose": "^4.1.1",
"morgan": "^1.6.1"
}
}
## Instruction:
Add config file for mongoose setup
## Code After:
{
"name": "beer-tab",
"version": "0.0.1",
"description": "beer as social currency",
"main": "server.js",
"repository": {
"type": "git",
"url": "git://github.com/ViridescentGrizzly/beer-tab.git"
},
"license": "MIT",
"author": "Viridescent Grizzly",
"contributors": [{
"name": "Michael Kurrels",
"email": "mjkurrels@gmail.com"
},{
"name": "Nate Meier",
"email": "iemanatemire@gmail.com"
},{
"name": "Andrés Viesca",
"email": "viestat@icloud.com"
},{
"name": "Steven Wu",
"email": "wucommasteven@gmail.com"
}
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/ViridescentGrizzly/beer-tab.git"
},
"devDependencies": {},
"dependencies": {
"express": "^4.13.3",
"mongoose": "^4.1.1",
"morgan": "^1.6.1"
}
}
| {
"name": "beer-tab",
"version": "0.0.1",
"description": "beer as social currency",
"main": "server.js",
"repository": {
"type": "git",
"url": "git://github.com/ViridescentGrizzly/beer-tab.git"
},
"license": "MIT",
"author": "Viridescent Grizzly",
- "contributors": [
+ "contributors": [{
? +
- {
"name": "Michael Kurrels",
"email": "mjkurrels@gmail.com"
- },
+ },{
? +
- {
"name": "Nate Meier",
"email": "iemanatemire@gmail.com"
- },
+ },{
? +
- {
"name": "Andrés Viesca",
"email": "viestat@icloud.com"
- },
+ },{
? +
- {
"name": "Steven Wu",
"email": "wucommasteven@gmail.com"
- }],
}
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/ViridescentGrizzly/beer-tab.git"
},
"devDependencies": {},
"dependencies": {
"express": "^4.13.3",
"mongoose": "^4.1.1",
"morgan": "^1.6.1"
}
} | 13 | 0.309524 | 4 | 9 |
2639a46a5e67fb60764fa92b1205f2546262fb80 | Cargo.toml | Cargo.toml | [package]
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
name = "blog_os"
version = "0.1.0"
[dependencies]
bit_field = "0.5.0"
bitflags = "0.7.0"
once = "0.3.2"
rlibc = "0.1.4"
spin = "0.3.4"
[dependencies.hole_list_allocator]
path = "libs/hole_list_allocator"
[dependencies.multiboot2]
git = "https://github.com/phil-opp/multiboot2-elf64"
[dependencies.x86]
default-features = false
version = "0.7.1"
[dependencies.lazy_static]
version = "0.2.1"
features = ["spin_no_std"]
[lib]
crate-type = ["staticlib"]
[workspace]
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
| [package]
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
name = "blog_os"
version = "0.1.0"
[dependencies]
bit_field = "0.5.0"
bitflags = "0.7.0"
once = "0.3.2"
rlibc = "0.1.4"
spin = "0.3.4"
[dependencies.hole_list_allocator]
path = "libs/hole_list_allocator"
[dependencies.lazy_static]
features = ["spin_no_std"]
version = "0.2.1"
[dependencies.multiboot2]
git = "https://github.com/phil-opp/multiboot2-elf64"
[dependencies.x86]
default-features = false
version = "0.7.1"
[lib]
crate-type = ["staticlib"]
[profile]
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
[workspace]
| Reorder items to cargo-edit format | Reorder items to cargo-edit format
| TOML | apache-2.0 | phil-opp/blog_os,phil-opp/blog_os,phil-opp/blogOS,phil-opp/blogOS,phil-opp/blog_os,phil-opp/blog_os | toml | ## Code Before:
[package]
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
name = "blog_os"
version = "0.1.0"
[dependencies]
bit_field = "0.5.0"
bitflags = "0.7.0"
once = "0.3.2"
rlibc = "0.1.4"
spin = "0.3.4"
[dependencies.hole_list_allocator]
path = "libs/hole_list_allocator"
[dependencies.multiboot2]
git = "https://github.com/phil-opp/multiboot2-elf64"
[dependencies.x86]
default-features = false
version = "0.7.1"
[dependencies.lazy_static]
version = "0.2.1"
features = ["spin_no_std"]
[lib]
crate-type = ["staticlib"]
[workspace]
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
## Instruction:
Reorder items to cargo-edit format
## Code After:
[package]
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
name = "blog_os"
version = "0.1.0"
[dependencies]
bit_field = "0.5.0"
bitflags = "0.7.0"
once = "0.3.2"
rlibc = "0.1.4"
spin = "0.3.4"
[dependencies.hole_list_allocator]
path = "libs/hole_list_allocator"
[dependencies.lazy_static]
features = ["spin_no_std"]
version = "0.2.1"
[dependencies.multiboot2]
git = "https://github.com/phil-opp/multiboot2-elf64"
[dependencies.x86]
default-features = false
version = "0.7.1"
[lib]
crate-type = ["staticlib"]
[profile]
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
[workspace]
| [package]
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
name = "blog_os"
version = "0.1.0"
[dependencies]
bit_field = "0.5.0"
bitflags = "0.7.0"
once = "0.3.2"
rlibc = "0.1.4"
spin = "0.3.4"
[dependencies.hole_list_allocator]
path = "libs/hole_list_allocator"
+ [dependencies.lazy_static]
+ features = ["spin_no_std"]
+ version = "0.2.1"
+
[dependencies.multiboot2]
git = "https://github.com/phil-opp/multiboot2-elf64"
[dependencies.x86]
default-features = false
version = "0.7.1"
- [dependencies.lazy_static]
- version = "0.2.1"
- features = ["spin_no_std"]
-
[lib]
crate-type = ["staticlib"]
- [workspace]
+ [profile]
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
+
+ [workspace] | 12 | 0.333333 | 7 | 5 |
bfc0ce1298b9fe7a640dc31c6e5729d1c6360945 | langs/pystartup.py | langs/pystartup.py |
import atexit
import os
import readline
import rlcompleter
historyPath = os.path.expanduser("~/.pyhistory")
def save_history(path=historyPath):
import readline
readline.write_history_file(path)
if os.path.exists(historyPath):
readline.read_history_file(historyPath)
readline.parse_and_bind("tab: complete")
readline.parse_and_bind(r"\C-a: beginning-of-line")
readline.parse_and_bind(r"\C-e: end-of-line")
atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, historyPath
# vim: ft=python
|
import atexit
import os
import readline
import rlcompleter
historyPath = os.path.expanduser("~/.pyhistory")
def save_history(path=historyPath):
import readline
readline.write_history_file(path)
if os.path.exists(historyPath):
readline.read_history_file(historyPath)
try:
import __builtin__
except ImportError:
import builtins as __builtin__
__builtin__.true = True
__builtin__.false = False
__builtin__.null = None
readline.parse_and_bind("tab: complete")
readline.parse_and_bind(r"\C-a: beginning-of-line")
readline.parse_and_bind(r"\C-e: end-of-line")
atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, historyPath
# vim: ft=python
| Add json true/false/none in python repl | Add json true/false/none in python repl
https://mobile.twitter.com/mitsuhiko/status/1229385843585974272/photo/2
| Python | mit | keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles,keith/dotfiles | python | ## Code Before:
import atexit
import os
import readline
import rlcompleter
historyPath = os.path.expanduser("~/.pyhistory")
def save_history(path=historyPath):
import readline
readline.write_history_file(path)
if os.path.exists(historyPath):
readline.read_history_file(historyPath)
readline.parse_and_bind("tab: complete")
readline.parse_and_bind(r"\C-a: beginning-of-line")
readline.parse_and_bind(r"\C-e: end-of-line")
atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, historyPath
# vim: ft=python
## Instruction:
Add json true/false/none in python repl
https://mobile.twitter.com/mitsuhiko/status/1229385843585974272/photo/2
## Code After:
import atexit
import os
import readline
import rlcompleter
historyPath = os.path.expanduser("~/.pyhistory")
def save_history(path=historyPath):
import readline
readline.write_history_file(path)
if os.path.exists(historyPath):
readline.read_history_file(historyPath)
try:
import __builtin__
except ImportError:
import builtins as __builtin__
__builtin__.true = True
__builtin__.false = False
__builtin__.null = None
readline.parse_and_bind("tab: complete")
readline.parse_and_bind(r"\C-a: beginning-of-line")
readline.parse_and_bind(r"\C-e: end-of-line")
atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, historyPath
# vim: ft=python
|
import atexit
import os
import readline
import rlcompleter
historyPath = os.path.expanduser("~/.pyhistory")
def save_history(path=historyPath):
import readline
readline.write_history_file(path)
if os.path.exists(historyPath):
readline.read_history_file(historyPath)
+ try:
+ import __builtin__
+ except ImportError:
+ import builtins as __builtin__
+
+ __builtin__.true = True
+ __builtin__.false = False
+ __builtin__.null = None
+
readline.parse_and_bind("tab: complete")
readline.parse_and_bind(r"\C-a: beginning-of-line")
readline.parse_and_bind(r"\C-e: end-of-line")
atexit.register(save_history)
del os, atexit, readline, rlcompleter, save_history, historyPath
# vim: ft=python | 9 | 0.375 | 9 | 0 |
2f0a216c706725341b924c6484cd37fbb21630a9 | lib/rspec_api_documentation/dsl/endpoint/params.rb | lib/rspec_api_documentation/dsl/endpoint/params.rb | require 'rspec_api_documentation/dsl/endpoint/set_param'
module RspecApiDocumentation
module DSL
module Endpoint
class Params
attr_reader :example_group, :example
def initialize(example_group, example, extra_params)
@example_group = example_group
@example = example
@extra_params = extra_params
end
def call
parameters = example.metadata.fetch(:parameters, {}).inject({}) do |hash, param|
SetParam.new(self, hash, param).call
end
parameters.deep_merge!(extra_params)
parameters
end
private
attr_reader :extra_params
end
end
end
end
| require 'rspec_api_documentation/dsl/endpoint/set_param'
module RspecApiDocumentation
module DSL
module Endpoint
class Params
attr_reader :example_group, :example
def initialize(example_group, example, extra_params)
@example_group = example_group
@example = example
@extra_params = extra_params
end
def call
set_param = -> hash, param {
SetParam.new(self, hash, param).call
}
example.metadata.fetch(:parameters, {}).inject({}, &set_param)
.deep_merge(
example.metadata.fetch(:attributes, {}).inject({}, &set_param)
).deep_merge(extra_params)
end
private
attr_reader :extra_params
end
end
end
end
| Handle Attributes as Parameter for API Blueprint | Handle Attributes as Parameter for API Blueprint
This let spec successfully passed.
| Ruby | mit | zipmark/rspec_api_documentation,zipmark/rspec_api_documentation,zipmark/rspec_api_documentation | ruby | ## Code Before:
require 'rspec_api_documentation/dsl/endpoint/set_param'
module RspecApiDocumentation
module DSL
module Endpoint
class Params
attr_reader :example_group, :example
def initialize(example_group, example, extra_params)
@example_group = example_group
@example = example
@extra_params = extra_params
end
def call
parameters = example.metadata.fetch(:parameters, {}).inject({}) do |hash, param|
SetParam.new(self, hash, param).call
end
parameters.deep_merge!(extra_params)
parameters
end
private
attr_reader :extra_params
end
end
end
end
## Instruction:
Handle Attributes as Parameter for API Blueprint
This let spec successfully passed.
## Code After:
require 'rspec_api_documentation/dsl/endpoint/set_param'
module RspecApiDocumentation
module DSL
module Endpoint
class Params
attr_reader :example_group, :example
def initialize(example_group, example, extra_params)
@example_group = example_group
@example = example
@extra_params = extra_params
end
def call
set_param = -> hash, param {
SetParam.new(self, hash, param).call
}
example.metadata.fetch(:parameters, {}).inject({}, &set_param)
.deep_merge(
example.metadata.fetch(:attributes, {}).inject({}, &set_param)
).deep_merge(extra_params)
end
private
attr_reader :extra_params
end
end
end
end
| require 'rspec_api_documentation/dsl/endpoint/set_param'
module RspecApiDocumentation
module DSL
module Endpoint
class Params
attr_reader :example_group, :example
def initialize(example_group, example, extra_params)
@example_group = example_group
@example = example
@extra_params = extra_params
end
def call
- parameters = example.metadata.fetch(:parameters, {}).inject({}) do |hash, param|
+ set_param = -> hash, param {
SetParam.new(self, hash, param).call
- end
? ^^^
+ }
? ^
+
+ example.metadata.fetch(:parameters, {}).inject({}, &set_param)
+ .deep_merge(
+ example.metadata.fetch(:attributes, {}).inject({}, &set_param)
- parameters.deep_merge!(extra_params)
? ^^^^^^^^^^ -
+ ).deep_merge(extra_params)
? ^^^
- parameters
end
private
attr_reader :extra_params
end
end
end
end | 11 | 0.366667 | 7 | 4 |
e0256c2ae08d61c251d3d2a8a154f89a199ad05b | release/doc/en_US.ISO8859-1/hardware/Makefile | release/doc/en_US.ISO8859-1/hardware/Makefile |
RELN_ROOT?= ${.CURDIR}/../..
SUBDIR = alpha
SUBDIR+= amd64
SUBDIR+= ia64
SUBDIR+= i386
SUBDIR+= pc98
SUBDIR+= sparc64
.include "${RELN_ROOT}/share/mk/doc.relnotes.mk"
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
|
RELN_ROOT?= ${.CURDIR}/../..
SUBDIR= amd64
SUBDIR+= ia64
SUBDIR+= i386
SUBDIR+= pc98
SUBDIR+= sparc64
.include "${RELN_ROOT}/share/mk/doc.relnotes.mk"
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
| Prepare to shoot my own dog, decouple the alpha docs from the build. | Prepare to shoot my own dog, decouple the alpha docs from the build.
| unknown | bsd-3-clause | jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase | unknown | ## Code Before:
RELN_ROOT?= ${.CURDIR}/../..
SUBDIR = alpha
SUBDIR+= amd64
SUBDIR+= ia64
SUBDIR+= i386
SUBDIR+= pc98
SUBDIR+= sparc64
.include "${RELN_ROOT}/share/mk/doc.relnotes.mk"
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
## Instruction:
Prepare to shoot my own dog, decouple the alpha docs from the build.
## Code After:
RELN_ROOT?= ${.CURDIR}/../..
SUBDIR= amd64
SUBDIR+= ia64
SUBDIR+= i386
SUBDIR+= pc98
SUBDIR+= sparc64
.include "${RELN_ROOT}/share/mk/doc.relnotes.mk"
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
|
RELN_ROOT?= ${.CURDIR}/../..
- SUBDIR = alpha
- SUBDIR+= amd64
? -
+ SUBDIR= amd64
SUBDIR+= ia64
SUBDIR+= i386
SUBDIR+= pc98
SUBDIR+= sparc64
.include "${RELN_ROOT}/share/mk/doc.relnotes.mk"
.include "${DOC_PREFIX}/share/mk/doc.project.mk" | 3 | 0.25 | 1 | 2 |
f9b11ed9662b1fad567f918c6defa1d760a7a9e5 | docs/building/internals.md | docs/building/internals.md | Internals of build process
=========================================
The purpose of this document is to explain build process **internals** with subtle nuances.
This document is not by any means complete.
The ultimate source of truth is the code in `.\build.psm1` that's getting executed on the corresponding CI system.
This document assumes, that you can successfully build PowerShell from sources for your platform.
Top directory
-----------
We are calling `dotnet` tool build for `$Top` directory
- `src\powershell` for CoreCLR builds (all platforms)
- `src\Microsoft.PowerShell.ConsoleHost` for FullCLR builds (Windows only)
Modules
----------
There are 3 modules directories with the same purpose: they have **content** files (i.e. `*.psm1`, `*.psd1`)
which would be binplaced by `dotnet`
- `src\Modules` shared between all flavours
- `src\Microsoft.PowerShell.ConsoleHost\Modules` FullCLR (Windows)
- `src\powershell\Modules` CoreCLR (all platforms)
| Internals of build process
=========================================
The purpose of this document is to explain build process **internals** with subtle nuances.
This document is not by any means complete.
The ultimate source of truth is the code in `.\build.psm1` that's getting executed on the corresponding CI system.
This document assumes, that you can successfully build PowerShell from sources for your platform.
Top directory
-----------
We are calling `dotnet` tool build for `$Top` directory
- `src\powershell` for CoreCLR builds (all platforms)
- `src\Microsoft.PowerShell.ConsoleHost` for FullCLR builds (Windows only)
### Dummy dependencies
We use dummy dependencies between project.json files to leverage `dotnet` build functionality.
For example, `src\Microsoft.PowerShell.ConsoleHost\project.json` has dependency on `Microsoft.PowerShell.PSReadLine`,
but in reality, there is no build dependency.
Dummy dependencies allows us to build just `$Top` folder, instead of building several folders.
### Dummy dependencies rules
* If assembly is part of FullCLR build,
it should be listed as a dependency for FullCLR $Top folder (src\Microsoft.PowerShell.ConsoleHost)
* If assembly is part of CoreCLR build,
it should be listed as a dependency for CoreCLR $Top folder (src\powershell)
Modules
----------
There are 3 modules directories with the same purpose: they have **content** files (i.e. `*.psm1`, `*.psd1`)
which would be binplaced by `dotnet`
- `src\Modules` shared between all flavours
- `src\Microsoft.PowerShell.ConsoleHost\Modules` FullCLR (Windows)
- `src\powershell\Modules` CoreCLR (all platforms)
| Add info about dummy dependencies | Add info about dummy dependencies
| Markdown | mit | KarolKaczmarek/PowerShell,JamesWTruher/PowerShell-1,TravisEz13/PowerShell,bingbing8/PowerShell,JamesWTruher/PowerShell-1,bmanikm/PowerShell,bingbing8/PowerShell,PaulHigin/PowerShell,KarolKaczmarek/PowerShell,KarolKaczmarek/PowerShell,bingbing8/PowerShell,bmanikm/PowerShell,daxian-dbw/PowerShell,PaulHigin/PowerShell,bingbing8/PowerShell,bingbing8/PowerShell,daxian-dbw/PowerShell,kmosher/PowerShell,TravisEz13/PowerShell,TravisEz13/PowerShell,kmosher/PowerShell,kmosher/PowerShell,PaulHigin/PowerShell,jsoref/PowerShell,jsoref/PowerShell,bmanikm/PowerShell,bmanikm/PowerShell,daxian-dbw/PowerShell,PaulHigin/PowerShell,JamesWTruher/PowerShell-1,JamesWTruher/PowerShell-1,KarolKaczmarek/PowerShell,kmosher/PowerShell,jsoref/PowerShell,jsoref/PowerShell,KarolKaczmarek/PowerShell,TravisEz13/PowerShell,kmosher/PowerShell,daxian-dbw/PowerShell,jsoref/PowerShell,bmanikm/PowerShell | markdown | ## Code Before:
Internals of build process
=========================================
The purpose of this document is to explain build process **internals** with subtle nuances.
This document is not by any means complete.
The ultimate source of truth is the code in `.\build.psm1` that's getting executed on the corresponding CI system.
This document assumes, that you can successfully build PowerShell from sources for your platform.
Top directory
-----------
We are calling `dotnet` tool build for `$Top` directory
- `src\powershell` for CoreCLR builds (all platforms)
- `src\Microsoft.PowerShell.ConsoleHost` for FullCLR builds (Windows only)
Modules
----------
There are 3 modules directories with the same purpose: they have **content** files (i.e. `*.psm1`, `*.psd1`)
which would be binplaced by `dotnet`
- `src\Modules` shared between all flavours
- `src\Microsoft.PowerShell.ConsoleHost\Modules` FullCLR (Windows)
- `src\powershell\Modules` CoreCLR (all platforms)
## Instruction:
Add info about dummy dependencies
## Code After:
Internals of build process
=========================================
The purpose of this document is to explain build process **internals** with subtle nuances.
This document is not by any means complete.
The ultimate source of truth is the code in `.\build.psm1` that's getting executed on the corresponding CI system.
This document assumes, that you can successfully build PowerShell from sources for your platform.
Top directory
-----------
We are calling `dotnet` tool build for `$Top` directory
- `src\powershell` for CoreCLR builds (all platforms)
- `src\Microsoft.PowerShell.ConsoleHost` for FullCLR builds (Windows only)
### Dummy dependencies
We use dummy dependencies between project.json files to leverage `dotnet` build functionality.
For example, `src\Microsoft.PowerShell.ConsoleHost\project.json` has dependency on `Microsoft.PowerShell.PSReadLine`,
but in reality, there is no build dependency.
Dummy dependencies allows us to build just `$Top` folder, instead of building several folders.
### Dummy dependencies rules
* If assembly is part of FullCLR build,
it should be listed as a dependency for FullCLR $Top folder (src\Microsoft.PowerShell.ConsoleHost)
* If assembly is part of CoreCLR build,
it should be listed as a dependency for CoreCLR $Top folder (src\powershell)
Modules
----------
There are 3 modules directories with the same purpose: they have **content** files (i.e. `*.psm1`, `*.psd1`)
which would be binplaced by `dotnet`
- `src\Modules` shared between all flavours
- `src\Microsoft.PowerShell.ConsoleHost\Modules` FullCLR (Windows)
- `src\powershell\Modules` CoreCLR (all platforms)
| Internals of build process
=========================================
The purpose of this document is to explain build process **internals** with subtle nuances.
This document is not by any means complete.
The ultimate source of truth is the code in `.\build.psm1` that's getting executed on the corresponding CI system.
This document assumes, that you can successfully build PowerShell from sources for your platform.
Top directory
-----------
We are calling `dotnet` tool build for `$Top` directory
- `src\powershell` for CoreCLR builds (all platforms)
- `src\Microsoft.PowerShell.ConsoleHost` for FullCLR builds (Windows only)
+
+ ### Dummy dependencies
+
+ We use dummy dependencies between project.json files to leverage `dotnet` build functionality.
+ For example, `src\Microsoft.PowerShell.ConsoleHost\project.json` has dependency on `Microsoft.PowerShell.PSReadLine`,
+ but in reality, there is no build dependency.
+
+ Dummy dependencies allows us to build just `$Top` folder, instead of building several folders.
+
+ ### Dummy dependencies rules
+
+ * If assembly is part of FullCLR build,
+ it should be listed as a dependency for FullCLR $Top folder (src\Microsoft.PowerShell.ConsoleHost)
+
+ * If assembly is part of CoreCLR build,
+ it should be listed as a dependency for CoreCLR $Top folder (src\powershell)
+
+
Modules
----------
There are 3 modules directories with the same purpose: they have **content** files (i.e. `*.psm1`, `*.psd1`)
which would be binplaced by `dotnet`
- `src\Modules` shared between all flavours
- `src\Microsoft.PowerShell.ConsoleHost\Modules` FullCLR (Windows)
- `src\powershell\Modules` CoreCLR (all platforms) | 18 | 0.666667 | 18 | 0 |
86ef4815527aaaeede24435b49a6f654da6d9979 | cmd_remove.go | cmd_remove.go | package main
import (
"errors"
"fmt"
)
var cmdRemove = &Command{
Run: runRemove,
UsageLine: "remove NAME",
Short: "Remove saved password",
Long: `Remove saved password by input name.`,
}
func runRemove(ctx context, args []string) error {
if len(args) == 0 {
return errors.New("item name required")
}
cfg, err := GetConfig()
if err != nil {
return err
}
Initialize(cfg)
is, err := LoadItems(cfg.DataFile)
if err != nil {
return err
}
name := args[0]
fit := is.Find(name)
if fit == nil {
return fmt.Errorf("item not found: %s", name)
}
nis := Items(make([]Item, len(is)-1))
for _, it := range is {
if it.Name != fit.Name {
nis = append(nis, it)
}
}
nis.Save(cfg.DataFile)
fmt.Fprintln(ctx.out, fmt.Sprintf("password of '%s' is removed successfully", name))
return nil
}
| package main
import (
"errors"
"fmt"
)
var cmdRemove = &Command{
Run: runRemove,
UsageLine: "remove NAME",
Short: "Remove saved password",
Long: `Remove saved password by input name.`,
}
func runRemove(ctx context, args []string) error {
if len(args) == 0 {
return errors.New("item name required")
}
cfg, err := GetConfig()
if err != nil {
return err
}
Initialize(cfg)
is, err := LoadItems(cfg.DataFile)
if err != nil {
return err
}
name := args[0]
fit := is.Find(name)
if fit == nil {
return fmt.Errorf("item not found: %s", name)
}
nis := Items([]Item{})
for _, it := range is {
if it.Name != fit.Name {
nis = append(nis, it)
}
}
nis.Save(cfg.DataFile)
fmt.Fprintln(ctx.out, fmt.Sprintf("password of '%s' is removed successfully", name))
return nil
}
| Fix create empty item on remove | Fix create empty item on remove
| Go | mit | pinzolo/spwd | go | ## Code Before:
package main
import (
"errors"
"fmt"
)
var cmdRemove = &Command{
Run: runRemove,
UsageLine: "remove NAME",
Short: "Remove saved password",
Long: `Remove saved password by input name.`,
}
func runRemove(ctx context, args []string) error {
if len(args) == 0 {
return errors.New("item name required")
}
cfg, err := GetConfig()
if err != nil {
return err
}
Initialize(cfg)
is, err := LoadItems(cfg.DataFile)
if err != nil {
return err
}
name := args[0]
fit := is.Find(name)
if fit == nil {
return fmt.Errorf("item not found: %s", name)
}
nis := Items(make([]Item, len(is)-1))
for _, it := range is {
if it.Name != fit.Name {
nis = append(nis, it)
}
}
nis.Save(cfg.DataFile)
fmt.Fprintln(ctx.out, fmt.Sprintf("password of '%s' is removed successfully", name))
return nil
}
## Instruction:
Fix create empty item on remove
## Code After:
package main
import (
"errors"
"fmt"
)
var cmdRemove = &Command{
Run: runRemove,
UsageLine: "remove NAME",
Short: "Remove saved password",
Long: `Remove saved password by input name.`,
}
func runRemove(ctx context, args []string) error {
if len(args) == 0 {
return errors.New("item name required")
}
cfg, err := GetConfig()
if err != nil {
return err
}
Initialize(cfg)
is, err := LoadItems(cfg.DataFile)
if err != nil {
return err
}
name := args[0]
fit := is.Find(name)
if fit == nil {
return fmt.Errorf("item not found: %s", name)
}
nis := Items([]Item{})
for _, it := range is {
if it.Name != fit.Name {
nis = append(nis, it)
}
}
nis.Save(cfg.DataFile)
fmt.Fprintln(ctx.out, fmt.Sprintf("password of '%s' is removed successfully", name))
return nil
}
| package main
import (
"errors"
"fmt"
)
var cmdRemove = &Command{
Run: runRemove,
UsageLine: "remove NAME",
Short: "Remove saved password",
Long: `Remove saved password by input name.`,
}
func runRemove(ctx context, args []string) error {
if len(args) == 0 {
return errors.New("item name required")
}
cfg, err := GetConfig()
if err != nil {
return err
}
Initialize(cfg)
is, err := LoadItems(cfg.DataFile)
if err != nil {
return err
}
name := args[0]
fit := is.Find(name)
if fit == nil {
return fmt.Errorf("item not found: %s", name)
}
- nis := Items(make([]Item, len(is)-1))
+ nis := Items([]Item{})
for _, it := range is {
if it.Name != fit.Name {
nis = append(nis, it)
}
}
nis.Save(cfg.DataFile)
fmt.Fprintln(ctx.out, fmt.Sprintf("password of '%s' is removed successfully", name))
return nil
} | 2 | 0.045455 | 1 | 1 |
2deb42c97d1fd3e4314eb8612e080e4facfb92b6 | locales/es-CL/addon.properties | locales/es-CL/addon.properties | tooltip_play= Reproducir
tooltip_pause= Pausar
tooltip_mute= Silenciar
tooltip_unmute= Escuchar
tooltip_send_to_tab= Enviar a pestaña
tooltip_minimize= Minimizar
tooltip_maximize= Maximizar
tooltip_close= Cerrar
error_msg= Algo está mal con este video. Vuelve a intentarlo más tarde.
error_link= Abrir en nueva pestaña
# LOCALIZATION NOTE: 1st placeholder is media type, 2nd is domain name
content_menu_msg= Enviar a mini reproductor
| tooltip_play= Reproducir
tooltip_pause= Pausar
tooltip_mute= Silenciar
tooltip_unmute= Escuchar
tooltip_send_to_tab= Enviar a pestaña
tooltip_minimize= Minimizar
tooltip_maximize= Maximizar
tooltip_close= Cerrar
tooltip_switch_visual= Clic para cambiar la visualización
media_type_audio= audio
media_type_video= video
error_msg= Algo está mal con este video. Vuelve a intentarlo más tarde.
error_link= Abrir en nueva pestaña
# LOCALIZATION NOTE: 1st placeholder is media type, 2nd is domain name
loading_view_msg= Cargando %s desde %s
content_menu_msg= Enviar a mini reproductor
| Update Spanish (es-CL) localization of Test Pilot: Min Vid | Pontoon: Update Spanish (es-CL) localization of Test Pilot: Min Vid
Localization authors:
- ravmn <ravmn@ravmn.cl>
| INI | mpl-2.0 | meandavejustice/min-vid,meandavejustice/min-vid,meandavejustice/min-vid | ini | ## Code Before:
tooltip_play= Reproducir
tooltip_pause= Pausar
tooltip_mute= Silenciar
tooltip_unmute= Escuchar
tooltip_send_to_tab= Enviar a pestaña
tooltip_minimize= Minimizar
tooltip_maximize= Maximizar
tooltip_close= Cerrar
error_msg= Algo está mal con este video. Vuelve a intentarlo más tarde.
error_link= Abrir en nueva pestaña
# LOCALIZATION NOTE: 1st placeholder is media type, 2nd is domain name
content_menu_msg= Enviar a mini reproductor
## Instruction:
Pontoon: Update Spanish (es-CL) localization of Test Pilot: Min Vid
Localization authors:
- ravmn <ravmn@ravmn.cl>
## Code After:
tooltip_play= Reproducir
tooltip_pause= Pausar
tooltip_mute= Silenciar
tooltip_unmute= Escuchar
tooltip_send_to_tab= Enviar a pestaña
tooltip_minimize= Minimizar
tooltip_maximize= Maximizar
tooltip_close= Cerrar
tooltip_switch_visual= Clic para cambiar la visualización
media_type_audio= audio
media_type_video= video
error_msg= Algo está mal con este video. Vuelve a intentarlo más tarde.
error_link= Abrir en nueva pestaña
# LOCALIZATION NOTE: 1st placeholder is media type, 2nd is domain name
loading_view_msg= Cargando %s desde %s
content_menu_msg= Enviar a mini reproductor
| tooltip_play= Reproducir
tooltip_pause= Pausar
tooltip_mute= Silenciar
tooltip_unmute= Escuchar
tooltip_send_to_tab= Enviar a pestaña
tooltip_minimize= Minimizar
tooltip_maximize= Maximizar
tooltip_close= Cerrar
+ tooltip_switch_visual= Clic para cambiar la visualización
+ media_type_audio= audio
+ media_type_video= video
error_msg= Algo está mal con este video. Vuelve a intentarlo más tarde.
error_link= Abrir en nueva pestaña
# LOCALIZATION NOTE: 1st placeholder is media type, 2nd is domain name
+ loading_view_msg= Cargando %s desde %s
content_menu_msg= Enviar a mini reproductor | 4 | 0.333333 | 4 | 0 |
b39ffe08f43a554d8056db0c65ce8549a03b8891 | .travis.yml | .travis.yml | language: objective-c
matrix:
include:
- env: OSX=10.11
os: osx
osx_image: osx10.11
rvm: system
- env: OSX=10.10
os: osx
osx_image: xcode7
rvm: system
- env: OSX=10.9
os: osx
osx_image: beta-xcode6.2
rvm: system
before_install:
- brew update
- brew tap drolando/deadsnakes
- >
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
pushd "$(brew config | grep HOMEBREW_REPOSITORY | awk '{print $2}')/Library/Taps/drolando/homebrew-deadsnakes";
git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge:;
git checkout -qf FETCH_HEAD;
popd;
fi
install:
# Make sure python is installed
- brew list python || brew install python
- brew install python26
# Make sure python3 is installed
- brew list python3 || brew install python3
- brew install python31
- brew install python32
- brew install python33
- brew install python34
- brew install python35
script:
- brew test python26
- brew test python31
- brew test python32
- brew test python33
- brew test python34
- brew test python35
| language: objective-c
os: osx
rvm: system
matrix:
include:
- env: OSX=10.14
osx_image: xcode10.1
- env: OSX=10.13
osx_image: xcode9.4
- env: OSX=10.12
osx_image: xcode9.2
- env: OSX=10.11
osx_image: xcode8
before_install:
- brew update
install:
# Make sure python is installed
- brew list python || brew install python
- brew install Formula/python26.rb
# Make sure python3 is installed
- brew list python3 || brew install python3
- brew install Formula/python31.rb
- brew install Formula/python32.rb
- brew install Formula/python33.rb
- brew install Formula/python34.rb
- brew install Formula/python35.rb
script:
- brew test Formula/python26.rb
- brew test Formula/python31.rb
- brew test Formula/python32.rb
- brew test Formula/python33.rb
- brew test Formula/python34.rb
- brew test Formula/python35.rb
| Test on new macos versions and install the local formula. | Test on new macos versions and install the local formula.
Running `brew install Formula/python36.rb` makes brew install the
locally committed formula rather than pull the latest one from master.
That removes the need to tap drolando/homebrew-deadsnakes.
| YAML | mit | drolando/homebrew-deadsnakes | yaml | ## Code Before:
language: objective-c
matrix:
include:
- env: OSX=10.11
os: osx
osx_image: osx10.11
rvm: system
- env: OSX=10.10
os: osx
osx_image: xcode7
rvm: system
- env: OSX=10.9
os: osx
osx_image: beta-xcode6.2
rvm: system
before_install:
- brew update
- brew tap drolando/deadsnakes
- >
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
pushd "$(brew config | grep HOMEBREW_REPOSITORY | awk '{print $2}')/Library/Taps/drolando/homebrew-deadsnakes";
git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge:;
git checkout -qf FETCH_HEAD;
popd;
fi
install:
# Make sure python is installed
- brew list python || brew install python
- brew install python26
# Make sure python3 is installed
- brew list python3 || brew install python3
- brew install python31
- brew install python32
- brew install python33
- brew install python34
- brew install python35
script:
- brew test python26
- brew test python31
- brew test python32
- brew test python33
- brew test python34
- brew test python35
## Instruction:
Test on new macos versions and install the local formula.
Running `brew install Formula/python36.rb` makes brew install the
locally committed formula rather than pull the latest one from master.
That removes the need to tap drolando/homebrew-deadsnakes.
## Code After:
language: objective-c
os: osx
rvm: system
matrix:
include:
- env: OSX=10.14
osx_image: xcode10.1
- env: OSX=10.13
osx_image: xcode9.4
- env: OSX=10.12
osx_image: xcode9.2
- env: OSX=10.11
osx_image: xcode8
before_install:
- brew update
install:
# Make sure python is installed
- brew list python || brew install python
- brew install Formula/python26.rb
# Make sure python3 is installed
- brew list python3 || brew install python3
- brew install Formula/python31.rb
- brew install Formula/python32.rb
- brew install Formula/python33.rb
- brew install Formula/python34.rb
- brew install Formula/python35.rb
script:
- brew test Formula/python26.rb
- brew test Formula/python31.rb
- brew test Formula/python32.rb
- brew test Formula/python33.rb
- brew test Formula/python34.rb
- brew test Formula/python35.rb
| language: objective-c
+ os: osx
+ rvm: system
matrix:
include:
+ - env: OSX=10.14
+ osx_image: xcode10.1
+ - env: OSX=10.13
+ osx_image: xcode9.4
+ - env: OSX=10.12
+ osx_image: xcode9.2
- env: OSX=10.11
- os: osx
- osx_image: osx10.11
- rvm: system
- - env: OSX=10.10
- os: osx
- osx_image: xcode7
? ^
+ osx_image: xcode8
? ^
- rvm: system
- - env: OSX=10.9
- os: osx
- osx_image: beta-xcode6.2
- rvm: system
before_install:
- brew update
- - brew tap drolando/deadsnakes
- - >
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
- pushd "$(brew config | grep HOMEBREW_REPOSITORY | awk '{print $2}')/Library/Taps/drolando/homebrew-deadsnakes";
- git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge:;
- git checkout -qf FETCH_HEAD;
- popd;
- fi
install:
# Make sure python is installed
- brew list python || brew install python
- - brew install python26
+ - brew install Formula/python26.rb
? ++++++++ +++
# Make sure python3 is installed
- brew list python3 || brew install python3
- - brew install python31
+ - brew install Formula/python31.rb
? ++++++++ +++
- - brew install python32
+ - brew install Formula/python32.rb
? ++++++++ +++
- - brew install python33
+ - brew install Formula/python33.rb
? ++++++++ +++
- - brew install python34
+ - brew install Formula/python34.rb
? ++++++++ +++
- - brew install python35
+ - brew install Formula/python35.rb
? ++++++++ +++
script:
- - brew test python26
+ - brew test Formula/python26.rb
? ++++++++ +++
- - brew test python31
+ - brew test Formula/python31.rb
? ++++++++ +++
- - brew test python32
+ - brew test Formula/python32.rb
? ++++++++ +++
- - brew test python33
+ - brew test Formula/python33.rb
? ++++++++ +++
- - brew test python34
+ - brew test Formula/python34.rb
? ++++++++ +++
- - brew test python35
+ - brew test Formula/python35.rb
? ++++++++ +++
| 52 | 1.106383 | 21 | 31 |
e85f6e1454964f6be1db8d418759eda9494a9240 | lib/Button/ButtonAccessibilitySupport.js | lib/Button/ButtonAccessibilitySupport.js | var
kind = require('enyo/kind');
/**
* @name ButtonAccessibilityMixin
* @mixin
*/
module.exports = {
/**
* @private
*/
updateAccessibilityAttributes: kind.inherit(function (sup) {
return function () {
var enabled = !this.accessibilityDisabled,
id = this.$.client ? this.$.client.getId() : this.getId();
sup.apply(this, arguments);
this.setAttribute('aria-labelledby', enabled ? id : null);
};
})
}; | var
kind = require('enyo/kind');
/**
* @name ButtonAccessibilityMixin
* @mixin
*/
module.exports = {
/**
* @private
*/
updateAccessibilityAttributes: kind.inherit(function (sup) {
return function () {
var enabled = !this.accessibilityDisabled,
id = this.$.client ? this.$.client.getId() : this.getId();
sup.apply(this, arguments);
this.setAttribute('aria-labelledby', !this.accessibilityLabel && enabled ? id : null);
};
})
}; | Remove aria-labelledby when user adds accessibilityLabel to Button | ENYO-1912: Remove aria-labelledby when user adds accessibilityLabel to Button
https://jira2.lgsvl.com/browse/ENYO-1912
Enyo-DCO-1.1-Signed-off-by: Bongsub Kim <bongsub.kim@lgepartner.com>
Change-Id: I50a490dbd25c59e4b48a828ab5e397e07dd9d13f
| JavaScript | apache-2.0 | enyojs/moonstone | javascript | ## Code Before:
var
kind = require('enyo/kind');
/**
* @name ButtonAccessibilityMixin
* @mixin
*/
module.exports = {
/**
* @private
*/
updateAccessibilityAttributes: kind.inherit(function (sup) {
return function () {
var enabled = !this.accessibilityDisabled,
id = this.$.client ? this.$.client.getId() : this.getId();
sup.apply(this, arguments);
this.setAttribute('aria-labelledby', enabled ? id : null);
};
})
};
## Instruction:
ENYO-1912: Remove aria-labelledby when user adds accessibilityLabel to Button
https://jira2.lgsvl.com/browse/ENYO-1912
Enyo-DCO-1.1-Signed-off-by: Bongsub Kim <bongsub.kim@lgepartner.com>
Change-Id: I50a490dbd25c59e4b48a828ab5e397e07dd9d13f
## Code After:
var
kind = require('enyo/kind');
/**
* @name ButtonAccessibilityMixin
* @mixin
*/
module.exports = {
/**
* @private
*/
updateAccessibilityAttributes: kind.inherit(function (sup) {
return function () {
var enabled = !this.accessibilityDisabled,
id = this.$.client ? this.$.client.getId() : this.getId();
sup.apply(this, arguments);
this.setAttribute('aria-labelledby', !this.accessibilityLabel && enabled ? id : null);
};
})
}; | var
kind = require('enyo/kind');
/**
* @name ButtonAccessibilityMixin
* @mixin
*/
module.exports = {
/**
* @private
*/
updateAccessibilityAttributes: kind.inherit(function (sup) {
return function () {
var enabled = !this.accessibilityDisabled,
id = this.$.client ? this.$.client.getId() : this.getId();
sup.apply(this, arguments);
- this.setAttribute('aria-labelledby', enabled ? id : null);
+ this.setAttribute('aria-labelledby', !this.accessibilityLabel && enabled ? id : null);
? ++++++++++++++++++++++++++++
};
})
}; | 2 | 0.095238 | 1 | 1 |
4803d580155baf3c785cf48d1d8b8737d34b6279 | blocks/html5_audio_player_basic/auto.js | blocks/html5_audio_player_basic/auto.js | var JPAudioPlayerBlock = {
validate:function(){
var failed=0;
if ($("#audioBlock-singleAudio input[name=fID]").val() <= 0) {
alert(ccm_t('choose-file'));
failed = 1;
}
if(failed){
ccm_isBlockError=1;
return false;
}
return true;
}
}
ccmValidateBlockForm = function() { return JPAudioPlayerBlock.validate(); }
| /*
// Validation is currently broken in 5.7
var JPAudioPlayerBlock = {
validate:function(){
var failed=0;
if ($("#audioBlock-singleAudio input[name=fID]").val() <= 0) {
alert(ccm_t('choose-file'));
failed = 1;
}
if(failed){
ccm_isBlockError=1;
return false;
}
return true;
}
}
ccmValidateBlockForm = function() { return JPAudioPlayerBlock.validate(); }
*/ | Add note about block validation. | Add note about block validation.
| JavaScript | mit | cpill0789/HTML5-Audio-Player-Basic,cpill0789/HTML5-Audio-Player-Basic,cpill0789/HTML5-Audio-Player-Basic | javascript | ## Code Before:
var JPAudioPlayerBlock = {
validate:function(){
var failed=0;
if ($("#audioBlock-singleAudio input[name=fID]").val() <= 0) {
alert(ccm_t('choose-file'));
failed = 1;
}
if(failed){
ccm_isBlockError=1;
return false;
}
return true;
}
}
ccmValidateBlockForm = function() { return JPAudioPlayerBlock.validate(); }
## Instruction:
Add note about block validation.
## Code After:
/*
// Validation is currently broken in 5.7
var JPAudioPlayerBlock = {
validate:function(){
var failed=0;
if ($("#audioBlock-singleAudio input[name=fID]").val() <= 0) {
alert(ccm_t('choose-file'));
failed = 1;
}
if(failed){
ccm_isBlockError=1;
return false;
}
return true;
}
}
ccmValidateBlockForm = function() { return JPAudioPlayerBlock.validate(); }
*/ | + /*
+ // Validation is currently broken in 5.7
var JPAudioPlayerBlock = {
validate:function(){
var failed=0;
if ($("#audioBlock-singleAudio input[name=fID]").val() <= 0) {
alert(ccm_t('choose-file'));
failed = 1;
}
if(failed){
ccm_isBlockError=1;
return false;
}
return true;
}
}
ccmValidateBlockForm = function() { return JPAudioPlayerBlock.validate(); }
+ */ | 3 | 0.1875 | 3 | 0 |
5b2f5eefa1103c884f197458e774b1b43e2a6614 | package.json | package.json | {
"name": "environmental",
"version": "1.1.0",
"description": "Provides conventions and code to deal with unix environment vars in a pleasant way",
"homepage": "https://github.com/kvz/environmental",
"author": "Kevin van Zonneveld <kevin@vanzonneveld.net>",
"engines": {
"node": ">= 0.8.0"
},
"dependencies": {
"flat": "1.2.1",
"chai": "1.9.1",
"coffee-script": "1.7.1",
"coffeelint": "1.3.0",
"mocha": "1.18.2",
"cli": "~0.6.2"
},
"keywords": [
"environment",
"env",
"vars",
"unix",
"12factor",
"nodejitsu",
"heroku"
],
"bin": {
"environmental": "./bin/environmental"
},
"repository": {
"type": "git",
"url": "https://github.com/kvz/environmental.git"
},
"readmeFilename": "README.md",
"scripts": {
"test": "make test"
},
"license": "MIT"
}
| {
"name": "environmental",
"version": "1.1.0",
"description": "Provides conventions and code to deal with unix environment vars in a pleasant way",
"homepage": "https://github.com/kvz/environmental",
"author": "Kevin van Zonneveld <kevin@vanzonneveld.net>",
"engines": {
"node": ">= 0.8.0"
},
"dependencies": {
"flat": "git://github.com/kvz/flat.git#3e6ad9e6ab5c9a46e4a33d5371916acb41dbc824",
"chai": "1.9.1",
"coffee-script": "1.7.1",
"coffeelint": "1.3.0",
"mocha": "1.18.2",
"cli": "~0.6.2"
},
"keywords": [
"environment",
"env",
"vars",
"unix",
"12factor",
"nodejitsu",
"heroku"
],
"bin": {
"environmental": "./bin/environmental"
},
"repository": {
"type": "git",
"url": "https://github.com/kvz/environmental.git"
},
"readmeFilename": "README.md",
"scripts": {
"test": "make test"
},
"license": "MIT"
}
| Upgrade flat to own fork to support overrides | Upgrade flat to own fork to support overrides
https://github.com/hughsk/flat/issues/9
| JSON | mit | kvz/environmental,kvz/environmental | json | ## Code Before:
{
"name": "environmental",
"version": "1.1.0",
"description": "Provides conventions and code to deal with unix environment vars in a pleasant way",
"homepage": "https://github.com/kvz/environmental",
"author": "Kevin van Zonneveld <kevin@vanzonneveld.net>",
"engines": {
"node": ">= 0.8.0"
},
"dependencies": {
"flat": "1.2.1",
"chai": "1.9.1",
"coffee-script": "1.7.1",
"coffeelint": "1.3.0",
"mocha": "1.18.2",
"cli": "~0.6.2"
},
"keywords": [
"environment",
"env",
"vars",
"unix",
"12factor",
"nodejitsu",
"heroku"
],
"bin": {
"environmental": "./bin/environmental"
},
"repository": {
"type": "git",
"url": "https://github.com/kvz/environmental.git"
},
"readmeFilename": "README.md",
"scripts": {
"test": "make test"
},
"license": "MIT"
}
## Instruction:
Upgrade flat to own fork to support overrides
https://github.com/hughsk/flat/issues/9
## Code After:
{
"name": "environmental",
"version": "1.1.0",
"description": "Provides conventions and code to deal with unix environment vars in a pleasant way",
"homepage": "https://github.com/kvz/environmental",
"author": "Kevin van Zonneveld <kevin@vanzonneveld.net>",
"engines": {
"node": ">= 0.8.0"
},
"dependencies": {
"flat": "git://github.com/kvz/flat.git#3e6ad9e6ab5c9a46e4a33d5371916acb41dbc824",
"chai": "1.9.1",
"coffee-script": "1.7.1",
"coffeelint": "1.3.0",
"mocha": "1.18.2",
"cli": "~0.6.2"
},
"keywords": [
"environment",
"env",
"vars",
"unix",
"12factor",
"nodejitsu",
"heroku"
],
"bin": {
"environmental": "./bin/environmental"
},
"repository": {
"type": "git",
"url": "https://github.com/kvz/environmental.git"
},
"readmeFilename": "README.md",
"scripts": {
"test": "make test"
},
"license": "MIT"
}
| {
"name": "environmental",
"version": "1.1.0",
"description": "Provides conventions and code to deal with unix environment vars in a pleasant way",
"homepage": "https://github.com/kvz/environmental",
"author": "Kevin van Zonneveld <kevin@vanzonneveld.net>",
"engines": {
"node": ">= 0.8.0"
},
"dependencies": {
- "flat": "1.2.1",
+ "flat": "git://github.com/kvz/flat.git#3e6ad9e6ab5c9a46e4a33d5371916acb41dbc824",
"chai": "1.9.1",
"coffee-script": "1.7.1",
"coffeelint": "1.3.0",
"mocha": "1.18.2",
"cli": "~0.6.2"
},
"keywords": [
"environment",
"env",
"vars",
"unix",
"12factor",
"nodejitsu",
"heroku"
],
"bin": {
"environmental": "./bin/environmental"
},
"repository": {
"type": "git",
"url": "https://github.com/kvz/environmental.git"
},
"readmeFilename": "README.md",
"scripts": {
"test": "make test"
},
"license": "MIT"
} | 2 | 0.051282 | 1 | 1 |
850e5d24c3f76edaf23b6639af274446a34bf1c1 | .forestry/front_matter/templates/partial-hero.yml | .forestry/front_matter/templates/partial-hero.yml | ---
hide_body: false
is_partial: true
fields:
- type: field_group
name: hero
label: Hero
description: Hero Section
fields:
- type: text
name: color
label: Hex Color
description: 'e.g. #0093c9'
config:
required: false
default: "#0093c9"
- type: file
name: image
label: Background Image
description: Takes precedence over the hex color
| ---
hide_body: false
is_partial: true
fields:
- type: field_group
name: hero
label: Hero
description: Displayed at the Top
fields:
- type: text
name: color
label: Hex Color
description: 'e.g. #0093c9'
config:
required: false
default: "#0093c9"
- type: file
name: image
label: Background Image
description: Takes precedence over the hex color
| Update from Forestry.io - Updated Forestry configuration | Update from Forestry.io - Updated Forestry configuration | YAML | mit | truecodersio/truecoders.io,truecodersio/truecoders.io,truecodersio/truecoders.io | yaml | ## Code Before:
---
hide_body: false
is_partial: true
fields:
- type: field_group
name: hero
label: Hero
description: Hero Section
fields:
- type: text
name: color
label: Hex Color
description: 'e.g. #0093c9'
config:
required: false
default: "#0093c9"
- type: file
name: image
label: Background Image
description: Takes precedence over the hex color
## Instruction:
Update from Forestry.io - Updated Forestry configuration
## Code After:
---
hide_body: false
is_partial: true
fields:
- type: field_group
name: hero
label: Hero
description: Displayed at the Top
fields:
- type: text
name: color
label: Hex Color
description: 'e.g. #0093c9'
config:
required: false
default: "#0093c9"
- type: file
name: image
label: Background Image
description: Takes precedence over the hex color
| ---
hide_body: false
is_partial: true
fields:
- type: field_group
name: hero
label: Hero
- description: Hero Section
+ description: Displayed at the Top
fields:
- type: text
name: color
label: Hex Color
description: 'e.g. #0093c9'
config:
required: false
default: "#0093c9"
- type: file
name: image
label: Background Image
description: Takes precedence over the hex color | 2 | 0.1 | 1 | 1 |
7fb5f9b610f1edd3559521b159c24c3cc65ea04d | fish/functions/punch.fish | fish/functions/punch.fish | function punch --description "Creates directories leading up to and including the file"
set -l path (dirname $argv[1])
mkdir -p $path
touch $argv[1]
end | function punch --description "Creates directories leading up to and including the file"
for file in $argv
set -l path (dirname $file)
mkdir -p $path
touch $file
end
end | Extend to work with multiple arguments | Extend to work with multiple arguments
| fish | mit | adrianObel/dotfiles | fish | ## Code Before:
function punch --description "Creates directories leading up to and including the file"
set -l path (dirname $argv[1])
mkdir -p $path
touch $argv[1]
end
## Instruction:
Extend to work with multiple arguments
## Code After:
function punch --description "Creates directories leading up to and including the file"
for file in $argv
set -l path (dirname $file)
mkdir -p $path
touch $file
end
end | function punch --description "Creates directories leading up to and including the file"
-
+ for file in $argv
- set -l path (dirname $argv[1])
? ^^^^^^^
+ set -l path (dirname $file)
? ++ ^^^^
-
- mkdir -p $path
+ mkdir -p $path
? ++
- touch $argv[1]
-
+ touch $file
+ end
end | 11 | 1.375 | 5 | 6 |
0eb771862e6c830b68779ba53c380c009aee9b0f | spec/models/log_spec.rb | spec/models/log_spec.rb | require 'rails_helper'
describe Log, :type => :model do
it 'has valid factory' do
expect(FactoryGirl.build(:log)).to be_valid
end
context 'properties' do
before do
@log = FactoryGirl.build(:log)
end
it 'has many chapters' do
expect(@log).to respond_to(:chapters)
end
it 'belongs to a user' do
expect(@log).to respond_to(:user)
end
it 'responds to created at' do
expect(@log).to respond_to(:created_at)
end
end
context 'chapter-related methods' do
before do
@log = FactoryGirl.create(:log)
@chapter_one = FactoryGirl.create(:chapter, log: @log)
@chapter_two = FactoryGirl.create(:chapter, title: "Hey!", log: @log)
end
it 'knows its latest chapter' do
expect(@log.latest_chapter).to eq(@chapter_two)
end
end
context 'average calculations' do
it 'has an average weekly change in measurement when attempting to lose'
it 'has an average weekly change in measurement when attempting to gain'
it 'has an average weekly change in measurement when attempting to maintain'
it 'has an average weekly change in measurement overall'
end
end
| require 'rails_helper'
describe Log, :type => :model do
it 'has valid factory' do
expect(FactoryGirl.build(:log)).to be_valid
end
context 'properties' do
before do
@log = FactoryGirl.build(:log)
end
it 'has many chapters' do
expect(@log).to respond_to(:chapters)
end
it 'belongs to a user' do
expect(@log).to respond_to(:user)
end
it 'responds to created at' do
expect(@log).to respond_to(:created_at)
end
end
context 'chapter-related methods' do
before do
@log = FactoryGirl.create(:log)
@chapter_one = FactoryGirl.create(:chapter, log: @log, completed_at: Date.today - 3)
@chapter_two = FactoryGirl.create(:chapter, title: "Hey!", log: @log)
end
it 'knows its latest chapter' do
expect(@log.latest_chapter).to eq(@chapter_two)
end
it 'knows whether it has a chapter in progress' do
expect(@log.has_chapter_in_progress).to eq(true)
@log.latest_chapter.update(completed_at: Date.today)
expect(@log.has_chapter_in_progress).to eq(false)
end
end
context 'average calculations' do
it 'has an average weekly change in measurement when attempting to lose'
it 'has an average weekly change in measurement when attempting to gain'
it 'has an average weekly change in measurement when attempting to maintain'
it 'has an average weekly change in measurement overall'
end
end
| Add 'it knows whether it has a chapter in progress' to Log unit test | Add 'it knows whether it has a chapter in progress' to Log unit test
| Ruby | mit | viparthasarathy/fitness-tracker,viparthasarathy/fitness-tracker,viparthasarathy/fitness-tracker | ruby | ## Code Before:
require 'rails_helper'
describe Log, :type => :model do
it 'has valid factory' do
expect(FactoryGirl.build(:log)).to be_valid
end
context 'properties' do
before do
@log = FactoryGirl.build(:log)
end
it 'has many chapters' do
expect(@log).to respond_to(:chapters)
end
it 'belongs to a user' do
expect(@log).to respond_to(:user)
end
it 'responds to created at' do
expect(@log).to respond_to(:created_at)
end
end
context 'chapter-related methods' do
before do
@log = FactoryGirl.create(:log)
@chapter_one = FactoryGirl.create(:chapter, log: @log)
@chapter_two = FactoryGirl.create(:chapter, title: "Hey!", log: @log)
end
it 'knows its latest chapter' do
expect(@log.latest_chapter).to eq(@chapter_two)
end
end
context 'average calculations' do
it 'has an average weekly change in measurement when attempting to lose'
it 'has an average weekly change in measurement when attempting to gain'
it 'has an average weekly change in measurement when attempting to maintain'
it 'has an average weekly change in measurement overall'
end
end
## Instruction:
Add 'it knows whether it has a chapter in progress' to Log unit test
## Code After:
require 'rails_helper'
describe Log, :type => :model do
it 'has valid factory' do
expect(FactoryGirl.build(:log)).to be_valid
end
context 'properties' do
before do
@log = FactoryGirl.build(:log)
end
it 'has many chapters' do
expect(@log).to respond_to(:chapters)
end
it 'belongs to a user' do
expect(@log).to respond_to(:user)
end
it 'responds to created at' do
expect(@log).to respond_to(:created_at)
end
end
context 'chapter-related methods' do
before do
@log = FactoryGirl.create(:log)
@chapter_one = FactoryGirl.create(:chapter, log: @log, completed_at: Date.today - 3)
@chapter_two = FactoryGirl.create(:chapter, title: "Hey!", log: @log)
end
it 'knows its latest chapter' do
expect(@log.latest_chapter).to eq(@chapter_two)
end
it 'knows whether it has a chapter in progress' do
expect(@log.has_chapter_in_progress).to eq(true)
@log.latest_chapter.update(completed_at: Date.today)
expect(@log.has_chapter_in_progress).to eq(false)
end
end
context 'average calculations' do
it 'has an average weekly change in measurement when attempting to lose'
it 'has an average weekly change in measurement when attempting to gain'
it 'has an average weekly change in measurement when attempting to maintain'
it 'has an average weekly change in measurement overall'
end
end
| require 'rails_helper'
describe Log, :type => :model do
it 'has valid factory' do
expect(FactoryGirl.build(:log)).to be_valid
end
context 'properties' do
before do
@log = FactoryGirl.build(:log)
end
it 'has many chapters' do
expect(@log).to respond_to(:chapters)
end
it 'belongs to a user' do
expect(@log).to respond_to(:user)
end
it 'responds to created at' do
expect(@log).to respond_to(:created_at)
end
end
context 'chapter-related methods' do
before do
@log = FactoryGirl.create(:log)
- @chapter_one = FactoryGirl.create(:chapter, log: @log)
+ @chapter_one = FactoryGirl.create(:chapter, log: @log, completed_at: Date.today - 3)
? ++++++++++++++++++++++++++++++
@chapter_two = FactoryGirl.create(:chapter, title: "Hey!", log: @log)
end
it 'knows its latest chapter' do
expect(@log.latest_chapter).to eq(@chapter_two)
end
+
+ it 'knows whether it has a chapter in progress' do
+ expect(@log.has_chapter_in_progress).to eq(true)
+ @log.latest_chapter.update(completed_at: Date.today)
+ expect(@log.has_chapter_in_progress).to eq(false)
+ end
+
end
context 'average calculations' do
it 'has an average weekly change in measurement when attempting to lose'
it 'has an average weekly change in measurement when attempting to gain'
it 'has an average weekly change in measurement when attempting to maintain'
it 'has an average weekly change in measurement overall'
end
end | 9 | 0.195652 | 8 | 1 |
2db538b86bc8f93b28b645411ef78830bd675c76 | support/Config.php | support/Config.php | <?php
/*
* This file is part of Yolk - Gamer Network's PHP Framework.
*
* Copyright (c) 2015 Gamer Network Ltd.
*
* Distributed under the MIT License, a copy of which is available in the
* LICENSE file that was bundled with this package, or online at:
* https://github.com/gamernetwork/yolk-application
*/
namespace yolk\contracts\support;
interface Config extends collections\Dictionary {
/**
* Loads and parses a configuration file.
* The file must define an array variable $config from which the data will be loaded.
*
* @param string file location of the configuration file.
* @return self
* @throws \LogicException if $config is not defined or not an array
*/
public function load( $file );
/**
* Merge an array into the current configuration.
* @param array $data
* @return self
*/
public function merge( array $data );
}
// EOF | <?php
/*
* This file is part of Yolk - Gamer Network's PHP Framework.
*
* Copyright (c) 2015 Gamer Network Ltd.
*
* Distributed under the MIT License, a copy of which is available in the
* LICENSE file that was bundled with this package, or online at:
* https://github.com/gamernetwork/yolk-application
*/
namespace yolk\contracts\support;
interface Config extends collections\Dictionary {
/**
* Loads and parses a configuration file.
* The file must define an array variable $config from which the data will be loaded.
*
* @param string file location of the configuration file.
* @return self
* @throws \LogicException if $config is not defined or not an array
*/
public function load( $file, $key = '' );
/**
* Merge an array into the current configuration.
* @param array $data
* @return self
*/
public function merge( array $data );
}
// EOF | Support for loading a config file into a specific key | Support for loading a config file into a specific key
| PHP | mit | gamernetwork/yolk-contracts | php | ## Code Before:
<?php
/*
* This file is part of Yolk - Gamer Network's PHP Framework.
*
* Copyright (c) 2015 Gamer Network Ltd.
*
* Distributed under the MIT License, a copy of which is available in the
* LICENSE file that was bundled with this package, or online at:
* https://github.com/gamernetwork/yolk-application
*/
namespace yolk\contracts\support;
interface Config extends collections\Dictionary {
/**
* Loads and parses a configuration file.
* The file must define an array variable $config from which the data will be loaded.
*
* @param string file location of the configuration file.
* @return self
* @throws \LogicException if $config is not defined or not an array
*/
public function load( $file );
/**
* Merge an array into the current configuration.
* @param array $data
* @return self
*/
public function merge( array $data );
}
// EOF
## Instruction:
Support for loading a config file into a specific key
## Code After:
<?php
/*
* This file is part of Yolk - Gamer Network's PHP Framework.
*
* Copyright (c) 2015 Gamer Network Ltd.
*
* Distributed under the MIT License, a copy of which is available in the
* LICENSE file that was bundled with this package, or online at:
* https://github.com/gamernetwork/yolk-application
*/
namespace yolk\contracts\support;
interface Config extends collections\Dictionary {
/**
* Loads and parses a configuration file.
* The file must define an array variable $config from which the data will be loaded.
*
* @param string file location of the configuration file.
* @return self
* @throws \LogicException if $config is not defined or not an array
*/
public function load( $file, $key = '' );
/**
* Merge an array into the current configuration.
* @param array $data
* @return self
*/
public function merge( array $data );
}
// EOF | <?php
/*
* This file is part of Yolk - Gamer Network's PHP Framework.
*
* Copyright (c) 2015 Gamer Network Ltd.
*
* Distributed under the MIT License, a copy of which is available in the
* LICENSE file that was bundled with this package, or online at:
* https://github.com/gamernetwork/yolk-application
*/
namespace yolk\contracts\support;
interface Config extends collections\Dictionary {
/**
* Loads and parses a configuration file.
* The file must define an array variable $config from which the data will be loaded.
*
* @param string file location of the configuration file.
* @return self
* @throws \LogicException if $config is not defined or not an array
*/
- public function load( $file );
+ public function load( $file, $key = '' );
? +++++++++++
/**
* Merge an array into the current configuration.
* @param array $data
* @return self
*/
public function merge( array $data );
}
// EOF | 2 | 0.057143 | 1 | 1 |
f65f18ceec8abf468b1426cf819c806f2d1d7ff8 | auslib/migrate/versions/009_add_rule_alias.py | auslib/migrate/versions/009_add_rule_alias.py | from sqlalchemy import Column, String, MetaData, Table
def upgrade(migrate_engine):
metadata = MetaData(bind=migrate_engine)
def add_alias(table):
alias = Column('alias', String(50), unique=True)
alias.create(table)
add_alias(Table('rules', metadata, autoload=True))
add_alias(Table('rules_history', metadata, autoload=True))
def downgrade(migrate_engine):
metadata = MetaData(bind=migrate_engine)
Table('rules', metadata, autoload=True).c.alias.drop()
Table('rules_history', metadata, autoload=True).c.alias.drop()
| from sqlalchemy import Column, String, MetaData, Table
def upgrade(migrate_engine):
metadata = MetaData(bind=migrate_engine)
alias = Column("alias", String(50), unique=True)
alias.create(Table("rules", metadata, autoload=True), unique_name="alias_unique")
history_alias = Column("alias", String(50))
history_alias.create(Table('rules_history', metadata, autoload=True))
def downgrade(migrate_engine):
metadata = MetaData(bind=migrate_engine)
Table('rules', metadata, autoload=True).c.alias.drop()
Table('rules_history', metadata, autoload=True).c.alias.drop()
| Fix migration script to make column unique+add index. | Fix migration script to make column unique+add index.
| Python | mpl-2.0 | testbhearsum/balrog,nurav/balrog,aksareen/balrog,testbhearsum/balrog,tieu/balrog,aksareen/balrog,aksareen/balrog,tieu/balrog,nurav/balrog,nurav/balrog,testbhearsum/balrog,tieu/balrog,mozbhearsum/balrog,mozbhearsum/balrog,aksareen/balrog,mozbhearsum/balrog,nurav/balrog,testbhearsum/balrog,mozbhearsum/balrog,tieu/balrog | python | ## Code Before:
from sqlalchemy import Column, String, MetaData, Table
def upgrade(migrate_engine):
metadata = MetaData(bind=migrate_engine)
def add_alias(table):
alias = Column('alias', String(50), unique=True)
alias.create(table)
add_alias(Table('rules', metadata, autoload=True))
add_alias(Table('rules_history', metadata, autoload=True))
def downgrade(migrate_engine):
metadata = MetaData(bind=migrate_engine)
Table('rules', metadata, autoload=True).c.alias.drop()
Table('rules_history', metadata, autoload=True).c.alias.drop()
## Instruction:
Fix migration script to make column unique+add index.
## Code After:
from sqlalchemy import Column, String, MetaData, Table
def upgrade(migrate_engine):
metadata = MetaData(bind=migrate_engine)
alias = Column("alias", String(50), unique=True)
alias.create(Table("rules", metadata, autoload=True), unique_name="alias_unique")
history_alias = Column("alias", String(50))
history_alias.create(Table('rules_history', metadata, autoload=True))
def downgrade(migrate_engine):
metadata = MetaData(bind=migrate_engine)
Table('rules', metadata, autoload=True).c.alias.drop()
Table('rules_history', metadata, autoload=True).c.alias.drop()
| from sqlalchemy import Column, String, MetaData, Table
def upgrade(migrate_engine):
metadata = MetaData(bind=migrate_engine)
- def add_alias(table):
- alias = Column('alias', String(50), unique=True)
? ---- ^ ^
+ alias = Column("alias", String(50), unique=True)
? ^ ^
- alias.create(table)
- add_alias(Table('rules', metadata, autoload=True))
+ alias.create(Table("rules", metadata, autoload=True), unique_name="alias_unique")
+
+ history_alias = Column("alias", String(50))
- add_alias(Table('rules_history', metadata, autoload=True))
? ^^^
+ history_alias.create(Table('rules_history', metadata, autoload=True))
? ^^^^^^^ +++++++
def downgrade(migrate_engine):
metadata = MetaData(bind=migrate_engine)
Table('rules', metadata, autoload=True).c.alias.drop()
Table('rules_history', metadata, autoload=True).c.alias.drop() | 10 | 0.588235 | 5 | 5 |
f7bbf6599623eefcecef89c10ee3f6fcbb97c3f7 | roles/openshift_facts/tasks/main.yml | roles/openshift_facts/tasks/main.yml | ---
- name: Gather OpenShift facts
openshift_facts:
| ---
- name: Verify Ansible version is greater than 1.8.0 and not 1.9.0
assert:
that:
- ansible_version | version_compare('1.8.0', 'ge')
- ansible_version | version_compare('1.9.0', 'ne')
- name: Gather OpenShift facts
openshift_facts:
| Verify ansible is greater than 1.8.0 and not 1.9.0 | Verify ansible is greater than 1.8.0 and not 1.9.0
| YAML | apache-2.0 | markllama/openshift-ansible,jimmidyson/openshift-ansible,menren/openshift-ansible,wbrefvem/openshift-ansible,quantiply-fork/openshift-ansible,rjhowe/openshift-ansible,nak3/openshift-ansible,ewolinetz/openshift-ansible,ibotty/openshift-ansible,mwoodson/openshift-ansible,wbrefvem/openshift-ansible,Jandersoft/openshift-ansible,detiber/openshift-ansible,jdamick/openshift-ansible,stenwt/openshift-ansible,thoraxe/openshift-ansible,rjhowe/openshift-ansible,wbrefvem/openshift-ansible,christian-posta/openshift-ansible,akubicharm/openshift-ansible,smarterclayton/openshift-ansible,ttindell2/openshift-ansible,zhiwliu/openshift-ansible,jwhonce/openshift-ansible,henderb/openshift-ansible,openshift/openshift-ansible,cgwalters/openshift-ansible,abutcher/openshift-ansible,miminar/openshift-ansible,aweiteka/openshift-ansible,tomassedovic/openshift-ansible,wbrefvem/openshift-ansible,tagliateller/openshift-ansible,robotmaxtron/openshift-ansible,xuant/openshift-ansible,base2Services/openshift-ansible,rjhowe/openshift-ansible,jwhonce/openshift-ansible,maxamillion/openshift-ansible,sborenst/openshift-ansible,aveshagarwal/openshift-ansible,smarterclayton/openshift-ansible,tagliateller/openshift-ansible,akubicharm/openshift-ansible,henderb/openshift-ansible,tagliateller/openshift-ansible,rjhowe/openshift-ansible,stenwt/openshift-ansible,VeerMuchandi/openshift-ansible,maxamillion/openshift-ansible,BlueShells/openshift-ansible,git001/openshift-ansible,abutcher/openshift-ansible,gburges/openshift-ansible,git001/openshift-ansible,sosiouxme/openshift-ansible,ttindell2/openshift-ansible,johnjelinek/openshift-ansible,aveshagarwal/openshift-ansible,detiber/openshift-ansible,tagliateller/openshift-ansible,sborenst/openshift-ansible,henderb/openshift-ansible,brenton/openshift-ansible,codificat/openshift-ansible,anpingli/openshift-ansible,ttindell2/openshift-ansible,maxamillion/openshift-ansible,BlueShells/openshift-ansible,aveshagarwal/openshift-ansible,VeerMuchandi/openshift-ansible,git001/openshift-ansible,jwhonce/openshift-ansible,christian-posta/openshift-ansible,sdodson/openshift-ansible,brenton/openshift-ansible,jaryn/openshift-ansible,jaryn/openshift-ansible,sdodson/openshift-ansible,DG-i/openshift-ansible,EricMountain-1A/openshift-ansible,mmahut/openshift-ansible,jwhonce/openshift-ansible,liggitt/openshift-ansible,tagliateller/openshift-ansible,miminar/openshift-ansible,jwhonce/openshift-ansible,ewolinetz/openshift-ansible,markllama/openshift-ansible,mmahut/openshift-ansible,jdamick/openshift-ansible,base2Services/openshift-ansible,smarterclayton/openshift-ansible,ttindell2/openshift-ansible,nhr/openshift-ansible,liggitt/openshift-ansible,openshift/openshift-ansible,attakei/openshift-ansible,EricMountain-1A/openshift-ansible,DG-i/openshift-ansible,ibotty/openshift-ansible,rharrison10/openshift-ansible,Jandersolutions/openshift-ansible,miminar/openshift-ansible,bashburn/openshift-ansible,rjhowe/openshift-ansible,twiest/openshift-ansible,Jandersoft/openshift-ansible,brenton/openshift-ansible,menren/openshift-ansible,aweiteka/openshift-ansible,jimmidyson/openshift-ansible,jimmidyson/openshift-ansible,detiber/openshift-ansible,Jandersolutions/openshift-ansible,VeerMuchandi/openshift-ansible,detiber/openshift-ansible,wshearn/openshift-ansible,christian-posta/openshift-ansible,pkdevbox/openshift-ansible,sdodson/openshift-ansible,mmahut/openshift-ansible,spinolacastro/openshift-ansible,anpingli/openshift-ansible,DG-i/openshift-ansible,miminar/openshift-ansible,pkdevbox/openshift-ansible,aveshagarwal/openshift-ansible,codificat/openshift-ansible,LutzLange/openshift-ansible,aweiteka/openshift-ansible,nak3/openshift-ansible,menren/openshift-ansible,base2Services/openshift-ansible,liggitt/openshift-ansible,EricMountain-1A/openshift-ansible,quantiply-fork/openshift-ansible,liggitt/openshift-ansible,Jandersolutions/openshift-ansible,bashburn/openshift-ansible,akram/openshift-ansible,rharrison10/openshift-ansible,rhdedgar/openshift-ansible,johnjelinek/openshift-ansible,codificat/openshift-ansible,Maarc/openshift-ansible,bparees/openshift-ansible,nhr/openshift-ansible,pkdevbox/openshift-ansible,abutcher/openshift-ansible,markllama/openshift-ansible,carlosthe19916/openshift-ansible,spinolacastro/openshift-ansible,mwoodson/openshift-ansible,sosiouxme/openshift-ansible,bparees/openshift-ansible,maxamillion/openshift-ansible,akubicharm/openshift-ansible,git001/openshift-ansible,sosiouxme/openshift-ansible,twiest/openshift-ansible,zhiwliu/openshift-ansible,bashburn/openshift-ansible,kwoodson/openshift-ansible,carlosthe19916/openshift-ansible,sdodson/openshift-ansible,zhiwliu/openshift-ansible,sosiouxme/openshift-ansible,wbrefvem/openshift-ansible,kwoodson/openshift-ansible,akubicharm/openshift-ansible,zhiwliu/openshift-ansible,liggitt/openshift-ansible,twiest/openshift-ansible,ewolinetz/openshift-ansible,ewolinetz/openshift-ansible,ibotty/openshift-ansible,akubicharm/openshift-ansible,abutcher/openshift-ansible,carlosthe19916/openshift-ansible,cgwalters/openshift-ansible,sdodson/openshift-ansible,jdamick/openshift-ansible,tomassedovic/openshift-ansible,Maarc/openshift-ansible,johnjelinek/openshift-ansible,wshearn/openshift-ansible,EricMountain-1A/openshift-ansible,cgwalters/openshift-ansible,aveshagarwal/openshift-ansible,xuant/openshift-ansible,LutzLange/openshift-ansible,sosiouxme/openshift-ansible,jaryn/openshift-ansible,ttindell2/openshift-ansible,thoraxe/openshift-ansible,nhr/openshift-ansible,akram/openshift-ansible,stenwt/openshift-ansible,miminar/openshift-ansible,LutzLange/openshift-ansible,abutcher/openshift-ansible,thoraxe/openshift-ansible,thoraxe/openshift-ansible,BlueShells/openshift-ansible,maxamillion/openshift-ansible,markllama/openshift-ansible,ewolinetz/openshift-ansible,twiest/openshift-ansible,zhiwliu/openshift-ansible,Maarc/openshift-ansible,attakei/openshift-ansible,gburges/openshift-ansible,quantiply-fork/openshift-ansible,Jandersoft/openshift-ansible,mmahut/openshift-ansible,rhdedgar/openshift-ansible,EricMountain-1A/openshift-ansible,sborenst/openshift-ansible,detiber/openshift-ansible,mmahut/openshift-ansible,markllama/openshift-ansible,attakei/openshift-ansible,tomassedovic/openshift-ansible,DG-i/openshift-ansible,twiest/openshift-ansible,xuant/openshift-ansible,robotmaxtron/openshift-ansible | yaml | ## Code Before:
---
- name: Gather OpenShift facts
openshift_facts:
## Instruction:
Verify ansible is greater than 1.8.0 and not 1.9.0
## Code After:
---
- name: Verify Ansible version is greater than 1.8.0 and not 1.9.0
assert:
that:
- ansible_version | version_compare('1.8.0', 'ge')
- ansible_version | version_compare('1.9.0', 'ne')
- name: Gather OpenShift facts
openshift_facts:
| ---
+ - name: Verify Ansible version is greater than 1.8.0 and not 1.9.0
+ assert:
+ that:
+ - ansible_version | version_compare('1.8.0', 'ge')
+ - ansible_version | version_compare('1.9.0', 'ne')
+
- name: Gather OpenShift facts
openshift_facts: | 6 | 2 | 6 | 0 |
28f7b31d251fe9c07109ac21d5554250ef6f89eb | Cargo.toml | Cargo.toml | [package]
name = "filters"
version = "0.1.0"
authors = ["Matthias Beyer <mail@beyermatthias.de>"]
description = "Build filters/predicates with the builder pattern"
keywords = ["iterator", "filter", "builder", "util"]
readme = "./README.md"
license = "LGPL-2.1"
documentation = "https://matthiasbeyer.github.io/filters/filters/index.html"
repository = "https://github.com/matthiasbeyer/filters"
[dependencies]
| [package]
name = "filters"
version = "0.1.0"
authors = ["Matthias Beyer <mail@beyermatthias.de>",
"Marcel Müller <neikos@neikos.email>" ]
description = "Build filters/predicates with the builder pattern"
keywords = ["iterator", "filter", "builder", "util"]
readme = "./README.md"
license = "LGPL-2.1"
documentation = "https://matthiasbeyer.github.io/filters/filters/index.html"
repository = "https://github.com/matthiasbeyer/filters"
[dependencies]
| Add Marcel Müller als Author | Add Marcel Müller als Author
| TOML | mpl-2.0 | matthiasbeyer/filters | toml | ## Code Before:
[package]
name = "filters"
version = "0.1.0"
authors = ["Matthias Beyer <mail@beyermatthias.de>"]
description = "Build filters/predicates with the builder pattern"
keywords = ["iterator", "filter", "builder", "util"]
readme = "./README.md"
license = "LGPL-2.1"
documentation = "https://matthiasbeyer.github.io/filters/filters/index.html"
repository = "https://github.com/matthiasbeyer/filters"
[dependencies]
## Instruction:
Add Marcel Müller als Author
## Code After:
[package]
name = "filters"
version = "0.1.0"
authors = ["Matthias Beyer <mail@beyermatthias.de>",
"Marcel Müller <neikos@neikos.email>" ]
description = "Build filters/predicates with the builder pattern"
keywords = ["iterator", "filter", "builder", "util"]
readme = "./README.md"
license = "LGPL-2.1"
documentation = "https://matthiasbeyer.github.io/filters/filters/index.html"
repository = "https://github.com/matthiasbeyer/filters"
[dependencies]
| [package]
name = "filters"
version = "0.1.0"
- authors = ["Matthias Beyer <mail@beyermatthias.de>"]
? ^
+ authors = ["Matthias Beyer <mail@beyermatthias.de>",
? ^
+ "Marcel Müller <neikos@neikos.email>" ]
description = "Build filters/predicates with the builder pattern"
keywords = ["iterator", "filter", "builder", "util"]
readme = "./README.md"
license = "LGPL-2.1"
documentation = "https://matthiasbeyer.github.io/filters/filters/index.html"
repository = "https://github.com/matthiasbeyer/filters"
[dependencies] | 3 | 0.214286 | 2 | 1 |
5af9f2cd214f12e2d16b696a0c62856e389b1397 | test/test_doc.py | test/test_doc.py | import types
from mpi4py import MPI
import mpiunittest as unittest
ModuleType = type(MPI)
ClassType = type(MPI.Comm)
FunctionType = type(MPI.Init)
MethodDescrType = type(MPI.Comm.Get_rank)
GetSetDescrType = type(MPI.Comm.rank)
def getdocstr(mc, docstrings):
if type(mc) in (ModuleType, ClassType):
name = getattr(mc, '__name__')
if name in ('__builtin__', 'builtin'): return
doc = getattr(mc, '__doc__', None)
docstrings[name] = doc
for k, v in vars(mc).items():
getdocstr(v, docstrings)
elif type(mc) in (FunctionType, MethodDescrType, GetSetDescrType):
name = getattr(mc, '__name__')
if name in ('__builtin__', 'builtin'): return
doc = getattr(mc, '__doc__', None)
docstrings[name] = doc
class TestDoc(unittest.TestCase):
def testDoc(self):
missing = False
docs = { }
getdocstr(MPI, docs)
for k in docs:
if not k.startswith('_'):
doc = docs[k]
if doc is None:
print ("'%s': missing docstring" % k)
missing = True
else:
doc = doc.strip()
if not doc:
print ("'%s': empty docstring" % k)
missing = True
self.assertFalse(missing)
if __name__ == '__main__':
unittest.main()
| import types
from mpi4py import MPI
import mpiunittest as unittest
ModuleType = type(MPI)
ClassType = type(MPI.Comm)
FunctionType = type(MPI.Init)
MethodDescrType = type(MPI.Comm.Get_rank)
GetSetDescrType = type(MPI.Comm.rank)
def getdocstr(mc, docstrings, namespace=None):
name = getattr(mc, '__name__', None)
if name is None: return
if name in ('__builtin__', 'builtins'): return
if name.startswith('_'): return
if namespace: name = '%s.%s' % (namespace, name)
if type(mc) in (ModuleType, ClassType):
doc = getattr(mc, '__doc__', None)
docstrings[name] = doc
for k, v in vars(mc).items():
getdocstr(v, docstrings, name)
elif type(mc) in (FunctionType, MethodDescrType, GetSetDescrType):
doc = getattr(mc, '__doc__', None)
docstrings[name] = doc
class TestDoc(unittest.TestCase):
def testDoc(self):
missing = False
docs = { }
getdocstr(MPI, docs)
for k in docs:
if not k.startswith('_'):
doc = docs[k]
if doc is None:
print ("'%s': missing docstring" % k)
missing = True
else:
doc = doc.strip()
if not doc:
print ("'%s': empty docstring" % k)
missing = True
self.assertFalse(missing)
if __name__ == '__main__':
unittest.main()
| Improve test script, report namespaces for stuff missing docstrings | Improve test script, report namespaces for stuff missing docstrings | Python | bsd-2-clause | pressel/mpi4py,pressel/mpi4py,pressel/mpi4py,mpi4py/mpi4py,pressel/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py | python | ## Code Before:
import types
from mpi4py import MPI
import mpiunittest as unittest
ModuleType = type(MPI)
ClassType = type(MPI.Comm)
FunctionType = type(MPI.Init)
MethodDescrType = type(MPI.Comm.Get_rank)
GetSetDescrType = type(MPI.Comm.rank)
def getdocstr(mc, docstrings):
if type(mc) in (ModuleType, ClassType):
name = getattr(mc, '__name__')
if name in ('__builtin__', 'builtin'): return
doc = getattr(mc, '__doc__', None)
docstrings[name] = doc
for k, v in vars(mc).items():
getdocstr(v, docstrings)
elif type(mc) in (FunctionType, MethodDescrType, GetSetDescrType):
name = getattr(mc, '__name__')
if name in ('__builtin__', 'builtin'): return
doc = getattr(mc, '__doc__', None)
docstrings[name] = doc
class TestDoc(unittest.TestCase):
def testDoc(self):
missing = False
docs = { }
getdocstr(MPI, docs)
for k in docs:
if not k.startswith('_'):
doc = docs[k]
if doc is None:
print ("'%s': missing docstring" % k)
missing = True
else:
doc = doc.strip()
if not doc:
print ("'%s': empty docstring" % k)
missing = True
self.assertFalse(missing)
if __name__ == '__main__':
unittest.main()
## Instruction:
Improve test script, report namespaces for stuff missing docstrings
## Code After:
import types
from mpi4py import MPI
import mpiunittest as unittest
ModuleType = type(MPI)
ClassType = type(MPI.Comm)
FunctionType = type(MPI.Init)
MethodDescrType = type(MPI.Comm.Get_rank)
GetSetDescrType = type(MPI.Comm.rank)
def getdocstr(mc, docstrings, namespace=None):
name = getattr(mc, '__name__', None)
if name is None: return
if name in ('__builtin__', 'builtins'): return
if name.startswith('_'): return
if namespace: name = '%s.%s' % (namespace, name)
if type(mc) in (ModuleType, ClassType):
doc = getattr(mc, '__doc__', None)
docstrings[name] = doc
for k, v in vars(mc).items():
getdocstr(v, docstrings, name)
elif type(mc) in (FunctionType, MethodDescrType, GetSetDescrType):
doc = getattr(mc, '__doc__', None)
docstrings[name] = doc
class TestDoc(unittest.TestCase):
def testDoc(self):
missing = False
docs = { }
getdocstr(MPI, docs)
for k in docs:
if not k.startswith('_'):
doc = docs[k]
if doc is None:
print ("'%s': missing docstring" % k)
missing = True
else:
doc = doc.strip()
if not doc:
print ("'%s': empty docstring" % k)
missing = True
self.assertFalse(missing)
if __name__ == '__main__':
unittest.main()
| import types
from mpi4py import MPI
import mpiunittest as unittest
ModuleType = type(MPI)
ClassType = type(MPI.Comm)
FunctionType = type(MPI.Init)
MethodDescrType = type(MPI.Comm.Get_rank)
GetSetDescrType = type(MPI.Comm.rank)
- def getdocstr(mc, docstrings):
+ def getdocstr(mc, docstrings, namespace=None):
? ++++++++++++++++
+ name = getattr(mc, '__name__', None)
+ if name is None: return
+ if name in ('__builtin__', 'builtins'): return
+ if name.startswith('_'): return
+ if namespace: name = '%s.%s' % (namespace, name)
if type(mc) in (ModuleType, ClassType):
- name = getattr(mc, '__name__')
- if name in ('__builtin__', 'builtin'): return
doc = getattr(mc, '__doc__', None)
docstrings[name] = doc
for k, v in vars(mc).items():
- getdocstr(v, docstrings)
+ getdocstr(v, docstrings, name)
? ++++++
elif type(mc) in (FunctionType, MethodDescrType, GetSetDescrType):
- name = getattr(mc, '__name__')
- if name in ('__builtin__', 'builtin'): return
doc = getattr(mc, '__doc__', None)
docstrings[name] = doc
class TestDoc(unittest.TestCase):
def testDoc(self):
missing = False
docs = { }
getdocstr(MPI, docs)
for k in docs:
if not k.startswith('_'):
doc = docs[k]
if doc is None:
print ("'%s': missing docstring" % k)
missing = True
else:
doc = doc.strip()
if not doc:
print ("'%s': empty docstring" % k)
missing = True
self.assertFalse(missing)
if __name__ == '__main__':
unittest.main() | 13 | 0.282609 | 7 | 6 |
10667b336ddb09d92339a91543ca4acea85f8e5f | CONTRIBUTING.md | CONTRIBUTING.md |
We try to follow the [Golang coding standards](https://github.com/golang/go/wiki/CodeReviewComments) as close as possible.
Make sure to run `go fmt`, `go vet`, `goimports`, `golint` before you push your code.
## Dependency Management
Nginxbeats are using [godep](https://github.com/tools/godep) for dependency management.
For updating dependencies we have the following strategy:
* If possible use the most recent release
* If no release tag exist, try to stay as close as possible to master
NOTE, make sure `GO15VENDOREXPERIMENT=1` is set so that dependencies are living in the `vendor/` folder.
### Update Dependencies
Godep allows to update all dependencies at once. We DON'T do that. If a dependency
is updated, the newest dependency must be loaded into the `$GOPATH` through either
using
`go get your-go-package-path`
or by having the package already in the `$GOPATH`with the correct version / tag.
To then save the most recent packages into Godep, run
`godep update your-go-package-path`
Avoid using `godep save ./...` or `godep update ...` as this will update all packages at
once and in case of issues it will be hard to track which one cause the issue.
After you updated the package, open a pull request where you state which package
you updated.
|
We try to follow the [Golang coding standards](https://github.com/golang/go/wiki/CodeReviewComments) as close as possible. And, we also follow [the seven rules of a great git commit message](http://chris.beams.io/posts/git-commit/).
Anyway, make sure to run `go fmt`, `go vet`, `goimports`, `golint` before you push your code.
## Dependency Management
Nginxbeats are using [godep](https://github.com/tools/godep) for dependency management.
For updating dependencies we have the following strategy:
* If possible use the most recent release
* If no release tag exist, try to stay as close as possible to master
NOTE, make sure `GO15VENDOREXPERIMENT=1` is set so that dependencies are living in the `vendor/` folder.
### Update Dependencies
Godep allows to update all dependencies at once. We DON'T do that. If a dependency
is updated, the newest dependency must be loaded into the `$GOPATH` through either
using
`go get your-go-package-path`
or by having the package already in the `$GOPATH`with the correct version / tag.
To then save the most recent packages into Godep, run
`godep update your-go-package-path`
Avoid using `godep save ./...` or `godep update ...` as this will update all packages at
once and in case of issues it will be hard to track which one cause the issue.
After you updated the package, open a pull request where you state which package
you updated.
| Add commit message writing practice | Add commit message writing practice | Markdown | apache-2.0 | mrkschan/nginxbeat,mrkschan/nginxbeat,mrkschan/nginxbeat | markdown | ## Code Before:
We try to follow the [Golang coding standards](https://github.com/golang/go/wiki/CodeReviewComments) as close as possible.
Make sure to run `go fmt`, `go vet`, `goimports`, `golint` before you push your code.
## Dependency Management
Nginxbeats are using [godep](https://github.com/tools/godep) for dependency management.
For updating dependencies we have the following strategy:
* If possible use the most recent release
* If no release tag exist, try to stay as close as possible to master
NOTE, make sure `GO15VENDOREXPERIMENT=1` is set so that dependencies are living in the `vendor/` folder.
### Update Dependencies
Godep allows to update all dependencies at once. We DON'T do that. If a dependency
is updated, the newest dependency must be loaded into the `$GOPATH` through either
using
`go get your-go-package-path`
or by having the package already in the `$GOPATH`with the correct version / tag.
To then save the most recent packages into Godep, run
`godep update your-go-package-path`
Avoid using `godep save ./...` or `godep update ...` as this will update all packages at
once and in case of issues it will be hard to track which one cause the issue.
After you updated the package, open a pull request where you state which package
you updated.
## Instruction:
Add commit message writing practice
## Code After:
We try to follow the [Golang coding standards](https://github.com/golang/go/wiki/CodeReviewComments) as close as possible. And, we also follow [the seven rules of a great git commit message](http://chris.beams.io/posts/git-commit/).
Anyway, make sure to run `go fmt`, `go vet`, `goimports`, `golint` before you push your code.
## Dependency Management
Nginxbeats are using [godep](https://github.com/tools/godep) for dependency management.
For updating dependencies we have the following strategy:
* If possible use the most recent release
* If no release tag exist, try to stay as close as possible to master
NOTE, make sure `GO15VENDOREXPERIMENT=1` is set so that dependencies are living in the `vendor/` folder.
### Update Dependencies
Godep allows to update all dependencies at once. We DON'T do that. If a dependency
is updated, the newest dependency must be loaded into the `$GOPATH` through either
using
`go get your-go-package-path`
or by having the package already in the `$GOPATH`with the correct version / tag.
To then save the most recent packages into Godep, run
`godep update your-go-package-path`
Avoid using `godep save ./...` or `godep update ...` as this will update all packages at
once and in case of issues it will be hard to track which one cause the issue.
After you updated the package, open a pull request where you state which package
you updated.
|
- We try to follow the [Golang coding standards](https://github.com/golang/go/wiki/CodeReviewComments) as close as possible.
+ We try to follow the [Golang coding standards](https://github.com/golang/go/wiki/CodeReviewComments) as close as possible. And, we also follow [the seven rules of a great git commit message](http://chris.beams.io/posts/git-commit/).
+
- Make sure to run `go fmt`, `go vet`, `goimports`, `golint` before you push your code.
? ^
+ Anyway, make sure to run `go fmt`, `go vet`, `goimports`, `golint` before you push your code.
? ^^^^^^^^^
## Dependency Management
Nginxbeats are using [godep](https://github.com/tools/godep) for dependency management.
For updating dependencies we have the following strategy:
* If possible use the most recent release
* If no release tag exist, try to stay as close as possible to master
NOTE, make sure `GO15VENDOREXPERIMENT=1` is set so that dependencies are living in the `vendor/` folder.
### Update Dependencies
Godep allows to update all dependencies at once. We DON'T do that. If a dependency
is updated, the newest dependency must be loaded into the `$GOPATH` through either
using
`go get your-go-package-path`
or by having the package already in the `$GOPATH`with the correct version / tag.
To then save the most recent packages into Godep, run
`godep update your-go-package-path`
Avoid using `godep save ./...` or `godep update ...` as this will update all packages at
once and in case of issues it will be hard to track which one cause the issue.
After you updated the package, open a pull request where you state which package
you updated. | 5 | 0.147059 | 3 | 2 |
3c256a9e260b836a81503f924aa3d6cf9032b59c | docs/mobile-application/installation.md | docs/mobile-application/installation.md |
The mobile Android application is distributed through the [Google Play store] and requires a Google account.
## Download
1. Search for **PhotosynQ** in the [Google Play store].
2. Tab the **Install** button. Check your permissions and **Accept**
3. Start the app by selecting the app icon from your phone start screen.
## Permissions
The PhotosynQ Application is requesting the following permissions to allow its proper functionality.
| Permission | Application functionality |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Take Pictures & Videos | The camera access is needed to allow adding pictures to Measurements and scan barcodes |
| Approximate Location | The geo-location is needed to add the location information (longitude, latitude) to Measurements |
| Modify / delete content of SD card | Required for caching Measurements on the device |
| Full network access | Required for signing in, downloading Projects and Protocols and uploading Measurements. |
| Access Bluetooth settings | Required to connect the Instrument via Bluetooth with the device |
| Prevent phone from sleeping | The device is prevented from going to sleep to allow longer measurement protocols and easier working with the application in the field |
### Troubleshooting
Sometimes the app does not work as expected. Please try this first:
- Make sure you have the latest version of the app.
- Make sure you have the latest Android Updates installed.
- Restart the app.
- Make sure you have sufficient storage.
- Make sure you have an internet connection.
[Google Play store]: https://play.google.com |
The mobile Android application is available on [Google Play] and requires a Google account.
## Download
1. Open [Google Play]
2. Search for **PhotosynQ**
3. Tab the **Install** button. Check your permissions and **Accept**
4. Start the app by selecting the app icon from your phone start screen
## Permissions
The PhotosynQ Application is requesting the following permissions to allow its proper functionality.
| Permission | Application functionality |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Take Pictures & Videos | The camera access is needed to allow adding pictures to Measurements and scan barcodes |
| Approximate Location | The geo-location is needed to add the location information (longitude, latitude) to Measurements |
| Modify / delete content of SD card | Required for caching Measurements on the device |
| Full network access | Required for signing in, downloading Projects and Protocols and uploading Measurements. |
| Access Bluetooth settings | Required to connect the Instrument via Bluetooth with the device |
| Prevent phone from sleeping | The device is prevented from going to sleep to allow longer measurement protocols and easier working with the application in the field |
### Troubleshooting
Sometimes the app does not work as expected. Please try this first:
- Make sure you have the latest version of the app.
- Make sure you have the latest Android Updates installed.
- Restart the app.
- Make sure you have sufficient storage.
- Make sure you have an internet connection.
[Google Play]: https://play.google.com | Update wording to match google standards | Update wording to match google standards
| Markdown | mit | Photosynq/PhotosynQ-Documentation | markdown | ## Code Before:
The mobile Android application is distributed through the [Google Play store] and requires a Google account.
## Download
1. Search for **PhotosynQ** in the [Google Play store].
2. Tab the **Install** button. Check your permissions and **Accept**
3. Start the app by selecting the app icon from your phone start screen.
## Permissions
The PhotosynQ Application is requesting the following permissions to allow its proper functionality.
| Permission | Application functionality |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Take Pictures & Videos | The camera access is needed to allow adding pictures to Measurements and scan barcodes |
| Approximate Location | The geo-location is needed to add the location information (longitude, latitude) to Measurements |
| Modify / delete content of SD card | Required for caching Measurements on the device |
| Full network access | Required for signing in, downloading Projects and Protocols and uploading Measurements. |
| Access Bluetooth settings | Required to connect the Instrument via Bluetooth with the device |
| Prevent phone from sleeping | The device is prevented from going to sleep to allow longer measurement protocols and easier working with the application in the field |
### Troubleshooting
Sometimes the app does not work as expected. Please try this first:
- Make sure you have the latest version of the app.
- Make sure you have the latest Android Updates installed.
- Restart the app.
- Make sure you have sufficient storage.
- Make sure you have an internet connection.
[Google Play store]: https://play.google.com
## Instruction:
Update wording to match google standards
## Code After:
The mobile Android application is available on [Google Play] and requires a Google account.
## Download
1. Open [Google Play]
2. Search for **PhotosynQ**
3. Tab the **Install** button. Check your permissions and **Accept**
4. Start the app by selecting the app icon from your phone start screen
## Permissions
The PhotosynQ Application is requesting the following permissions to allow its proper functionality.
| Permission | Application functionality |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Take Pictures & Videos | The camera access is needed to allow adding pictures to Measurements and scan barcodes |
| Approximate Location | The geo-location is needed to add the location information (longitude, latitude) to Measurements |
| Modify / delete content of SD card | Required for caching Measurements on the device |
| Full network access | Required for signing in, downloading Projects and Protocols and uploading Measurements. |
| Access Bluetooth settings | Required to connect the Instrument via Bluetooth with the device |
| Prevent phone from sleeping | The device is prevented from going to sleep to allow longer measurement protocols and easier working with the application in the field |
### Troubleshooting
Sometimes the app does not work as expected. Please try this first:
- Make sure you have the latest version of the app.
- Make sure you have the latest Android Updates installed.
- Restart the app.
- Make sure you have sufficient storage.
- Make sure you have an internet connection.
[Google Play]: https://play.google.com |
- The mobile Android application is distributed through the [Google Play store] and requires a Google account.
? ^ ^^^^ ^^ - --- ^^^^^^^ ------
+ The mobile Android application is available on [Google Play] and requires a Google account.
? ^^^ ^^ ^ ^
## Download
- 1. Search for **PhotosynQ** in the [Google Play store].
+ 1. Open [Google Play]
+ 2. Search for **PhotosynQ**
- 2. Tab the **Install** button. Check your permissions and **Accept**
? ^
+ 3. Tab the **Install** button. Check your permissions and **Accept**
? ^
- 3. Start the app by selecting the app icon from your phone start screen.
? ^ -
+ 4. Start the app by selecting the app icon from your phone start screen
? ^
## Permissions
The PhotosynQ Application is requesting the following permissions to allow its proper functionality.
| Permission | Application functionality |
| ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| Take Pictures & Videos | The camera access is needed to allow adding pictures to Measurements and scan barcodes |
| Approximate Location | The geo-location is needed to add the location information (longitude, latitude) to Measurements |
| Modify / delete content of SD card | Required for caching Measurements on the device |
| Full network access | Required for signing in, downloading Projects and Protocols and uploading Measurements. |
| Access Bluetooth settings | Required to connect the Instrument via Bluetooth with the device |
| Prevent phone from sleeping | The device is prevented from going to sleep to allow longer measurement protocols and easier working with the application in the field |
### Troubleshooting
Sometimes the app does not work as expected. Please try this first:
- Make sure you have the latest version of the app.
- Make sure you have the latest Android Updates installed.
- Restart the app.
- Make sure you have sufficient storage.
- Make sure you have an internet connection.
- [Google Play store]: https://play.google.com
? ------
+ [Google Play]: https://play.google.com | 11 | 0.333333 | 6 | 5 |
39714a3b22baf75f693d2df1fe546682b7c3f35c | templates/accept_edit.html | templates/accept_edit.html | {% extends "base.html" %}
{% block menubar %}
{% include "includes/get_nav.html" %}
{% endblock menubar %}
{% block header %}
<link href="{{ STATIC_URL }}calendar.css" type="text/css"
rel="stylesheet" />
<link href="{{ STATIC_URL }}holidays.css" type="text/css"
rel="stylesheet" />
{% endblock header %}
{% block title %}
Accept/Edit Tracking Entry
{% endblock title %}
{% block content %}
<!--[if IE 7]>
<div id="isie" isie="true"></div>
<![endif]-->
<!--[if IE]>
<div id=IEFix>
<![endif]-->
<table id="full-table-wrapper">
<form action="{% url "overtime.views.accepted" %}" method="POST">
{% csrf_token %}
<tr>
<th>
<label for="id_user">Agent:</label>
</th>
<td>
<input id="id_user" name="user" type="text" value="{{ entry.user.name }}" readonly />
</td>
</tr>
{{ form.as_table }}
<tr>
<th>
<label for="submit">Submit:</label>
</th>
<td>
<input type="submit" />
</td>
</tr>
</form>
</table>
<!--[if IE]>
</div id=IEFix>
<![endif]-->
{% endblock content %}
| {% extends "base.html" %}
{% block menubar %}
{% include "includes/get_nav.html" %}
{% endblock menubar %}
{% block header %}
<link href="{{ STATIC_URL }}calendar.css" type="text/css"
rel="stylesheet" />
<link href="{{ STATIC_URL }}holidays.css" type="text/css"
rel="stylesheet" />
{% endblock header %}
{% block title %}
Accept/Edit Tracking Entry
{% endblock title %}
{% block content %}
<!--[if IE 7]>
<div id="isie" isie="true"></div>
<![endif]-->
<!--[if IE]>
<div id=IEFix>
<![endif]-->
<table id="full-table-wrapper">
<form action="{% url "overtime.views.accepted" %}" method="POST">
{% csrf_token %}
<tr>
<th>
<label for="id_user">Agent:</label>
</th>
<td>
<input id="id_user" name="user" type="text" value="{{ entry.user.name }}" readonly />
</td>
</tr>
{{ form.as_table }}
<tr>
<th>
<label for="status">Status:</label>
</th>
<td>
<select id="status" name="status">
<option value="approved" selected>Approved</option>
<option value="denied">Denied</option>
</select>
</td>
</tr>
<tr>
<th>
<label for="submit">Submit:</label>
</th>
<td>
<input id="submit" type="submit" />
</td>
</tr>
</form>
</table>
<!--[if IE]>
</div id=IEFix>
<![endif]-->
{% endblock content %}
| Use a select box for the status of the approval rather than two submit buttons. | Use a select box for the status of the approval rather than two submit buttons.
| HTML | bsd-3-clause | AeroNotix/django-timetracker,AeroNotix/django-timetracker,AeroNotix/django-timetracker | html | ## Code Before:
{% extends "base.html" %}
{% block menubar %}
{% include "includes/get_nav.html" %}
{% endblock menubar %}
{% block header %}
<link href="{{ STATIC_URL }}calendar.css" type="text/css"
rel="stylesheet" />
<link href="{{ STATIC_URL }}holidays.css" type="text/css"
rel="stylesheet" />
{% endblock header %}
{% block title %}
Accept/Edit Tracking Entry
{% endblock title %}
{% block content %}
<!--[if IE 7]>
<div id="isie" isie="true"></div>
<![endif]-->
<!--[if IE]>
<div id=IEFix>
<![endif]-->
<table id="full-table-wrapper">
<form action="{% url "overtime.views.accepted" %}" method="POST">
{% csrf_token %}
<tr>
<th>
<label for="id_user">Agent:</label>
</th>
<td>
<input id="id_user" name="user" type="text" value="{{ entry.user.name }}" readonly />
</td>
</tr>
{{ form.as_table }}
<tr>
<th>
<label for="submit">Submit:</label>
</th>
<td>
<input type="submit" />
</td>
</tr>
</form>
</table>
<!--[if IE]>
</div id=IEFix>
<![endif]-->
{% endblock content %}
## Instruction:
Use a select box for the status of the approval rather than two submit buttons.
## Code After:
{% extends "base.html" %}
{% block menubar %}
{% include "includes/get_nav.html" %}
{% endblock menubar %}
{% block header %}
<link href="{{ STATIC_URL }}calendar.css" type="text/css"
rel="stylesheet" />
<link href="{{ STATIC_URL }}holidays.css" type="text/css"
rel="stylesheet" />
{% endblock header %}
{% block title %}
Accept/Edit Tracking Entry
{% endblock title %}
{% block content %}
<!--[if IE 7]>
<div id="isie" isie="true"></div>
<![endif]-->
<!--[if IE]>
<div id=IEFix>
<![endif]-->
<table id="full-table-wrapper">
<form action="{% url "overtime.views.accepted" %}" method="POST">
{% csrf_token %}
<tr>
<th>
<label for="id_user">Agent:</label>
</th>
<td>
<input id="id_user" name="user" type="text" value="{{ entry.user.name }}" readonly />
</td>
</tr>
{{ form.as_table }}
<tr>
<th>
<label for="status">Status:</label>
</th>
<td>
<select id="status" name="status">
<option value="approved" selected>Approved</option>
<option value="denied">Denied</option>
</select>
</td>
</tr>
<tr>
<th>
<label for="submit">Submit:</label>
</th>
<td>
<input id="submit" type="submit" />
</td>
</tr>
</form>
</table>
<!--[if IE]>
</div id=IEFix>
<![endif]-->
{% endblock content %}
| {% extends "base.html" %}
{% block menubar %}
{% include "includes/get_nav.html" %}
{% endblock menubar %}
{% block header %}
<link href="{{ STATIC_URL }}calendar.css" type="text/css"
rel="stylesheet" />
<link href="{{ STATIC_URL }}holidays.css" type="text/css"
rel="stylesheet" />
{% endblock header %}
{% block title %}
Accept/Edit Tracking Entry
{% endblock title %}
{% block content %}
<!--[if IE 7]>
<div id="isie" isie="true"></div>
<![endif]-->
<!--[if IE]>
<div id=IEFix>
<![endif]-->
<table id="full-table-wrapper">
<form action="{% url "overtime.views.accepted" %}" method="POST">
{% csrf_token %}
<tr>
<th>
<label for="id_user">Agent:</label>
</th>
<td>
<input id="id_user" name="user" type="text" value="{{ entry.user.name }}" readonly />
</td>
</tr>
{{ form.as_table }}
<tr>
<th>
+ <label for="status">Status:</label>
+ </th>
+ <td>
+ <select id="status" name="status">
+ <option value="approved" selected>Approved</option>
+ <option value="denied">Denied</option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th>
<label for="submit">Submit:</label>
</th>
<td>
- <input type="submit" />
+ <input id="submit" type="submit" />
? ++++++++++++
</td>
</tr>
</form>
</table>
<!--[if IE]>
</div id=IEFix>
<![endif]-->
{% endblock content %} | 13 | 0.270833 | 12 | 1 |
86d1d05092b9c8e6b5c1723e6c7ad81c2aae7831 | .travis.yml | .travis.yml | sudo: false
language: php
php:
- 5.5
- 5.6
- 7.0
- hhvm
- nightly
matrix:
allow_failures:
- php: hhvm
- php: nightly
before_install:
# Update composer binary
- composer self-update
before_script:
# Install require & require-dev
- composer install --prefer-source
script:
- phpunit --configuration phpunit.xml.dist --coverage-text --coverage-clover build/logs/clover.xml --coverage-html build/coverage
- ./vendor/bin/phpcs
after_script:
# TestReporter seem desn't work with these version og PHP
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then ./vendor/bin/test-reporter; fi
# ApiGen generation
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then sh generate-website.sh; fi
| sudo: false
language: php
php:
- 5.5
- 5.6
- 7.0
- hhvm
- nightly
matrix:
allow_failures:
- php: hhvm
- php: nightly
before_install:
# Update composer binary
- composer self-update
before_script:
# Install require & require-dev
- composer install --prefer-source
script:
- ./vendor/bin/phpunit --configuration phpunit.xml.dist --coverage-text --coverage-clover build/logs/clover.xml --coverage-html build/coverage
- ./vendor/bin/phpcs
after_script:
# TestReporter seem desn't work with these version og PHP
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then ./vendor/bin/test-reporter; fi
# ApiGen generation
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then sh generate-website.sh; fi
| Use a selected version of phpUnit | Use a selected version of phpUnit
| YAML | mit | llaumgui/JunitXml | yaml | ## Code Before:
sudo: false
language: php
php:
- 5.5
- 5.6
- 7.0
- hhvm
- nightly
matrix:
allow_failures:
- php: hhvm
- php: nightly
before_install:
# Update composer binary
- composer self-update
before_script:
# Install require & require-dev
- composer install --prefer-source
script:
- phpunit --configuration phpunit.xml.dist --coverage-text --coverage-clover build/logs/clover.xml --coverage-html build/coverage
- ./vendor/bin/phpcs
after_script:
# TestReporter seem desn't work with these version og PHP
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then ./vendor/bin/test-reporter; fi
# ApiGen generation
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then sh generate-website.sh; fi
## Instruction:
Use a selected version of phpUnit
## Code After:
sudo: false
language: php
php:
- 5.5
- 5.6
- 7.0
- hhvm
- nightly
matrix:
allow_failures:
- php: hhvm
- php: nightly
before_install:
# Update composer binary
- composer self-update
before_script:
# Install require & require-dev
- composer install --prefer-source
script:
- ./vendor/bin/phpunit --configuration phpunit.xml.dist --coverage-text --coverage-clover build/logs/clover.xml --coverage-html build/coverage
- ./vendor/bin/phpcs
after_script:
# TestReporter seem desn't work with these version og PHP
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then ./vendor/bin/test-reporter; fi
# ApiGen generation
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then sh generate-website.sh; fi
| sudo: false
language: php
php:
- 5.5
- 5.6
- 7.0
- hhvm
- nightly
matrix:
allow_failures:
- php: hhvm
- php: nightly
before_install:
# Update composer binary
- composer self-update
before_script:
# Install require & require-dev
- composer install --prefer-source
script:
- - phpunit --configuration phpunit.xml.dist --coverage-text --coverage-clover build/logs/clover.xml --coverage-html build/coverage
+ - ./vendor/bin/phpunit --configuration phpunit.xml.dist --coverage-text --coverage-clover build/logs/clover.xml --coverage-html build/coverage
? +++++++++++++
- ./vendor/bin/phpcs
after_script:
# TestReporter seem desn't work with these version og PHP
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then ./vendor/bin/test-reporter; fi
# ApiGen generation
- if [ $TRAVIS_PHP_VERSION = '5.6' ] && [ $TRAVIS_BRANCH = 'master' ] && [ $TRAVIS_PULL_REQUEST = 'false' ]; then sh generate-website.sh; fi | 2 | 0.066667 | 1 | 1 |
dba82e22b486bf6d15b5e32810adc51c281319e5 | lib/rule.js | lib/rule.js | 'use strict';
/* rule.js
* Expresses CSS rules.
*/
const create = require('./create');
let Rule = create(function(names, list1, list2){
this.names = names;
if (typeof names === 'string') this.names = [names];
if (this.names.length > 1 || arguments.length === 2) {
this.type = 'selector';
this.selectors = this.names || [];
this.items = list1 || [];
} else if (this.names.length === 1 && this.names[0][0] === '@') {
this.type = 'at-rule';
if (arguments.length === 3) {
this.type += ' expressive';
this.name = this.names[0];
this.expression = list1 || [];
this.items = list2 || [];
} else if (arguments.length === 2) this.input = list1;
} else {
this.type = 'unknown';
this.items = [].concat(...(Array.prototype.slice.call(arguments, 1))) || [];
}
}, {
add: function(){
this.items.push(...arguments);
return this;
},
remove: function(loc){
this.items.splice(loc, 1);
return this;
},
set: function(loc, value){
this.items[loc] = value;
return this;
},
});
module.exports = exports = Rule;
| 'use strict';
/* rule.js
* Expresses CSS rules.
*/
const create = require('./create');
let Rule = create(function(name, list1, list2){
this.name = name;
if (this.name[0] !== '@') {
this.type = 'selector';
this.selector = this.name || [];
this.items = list1 || [];
} else if (this.name[0] === '@') {
this.type = 'at-rule';
if (arguments.length === 3) {
this.type += ' expressive';
this.name = this.name[0];
this.expression = list1 || [];
this.items = list2 || [];
} else if (arguments.length === 2) this.input = list1;
} else {
this.type = 'unknown';
this.items = [].concat(...(Array.prototype.slice.call(arguments, 1))) || [];
}
}, {
add: function(){
this.items.push(...arguments);
return this;
},
remove: function(loc){
this.items.splice(loc, 1);
return this;
},
set: function(loc, value){
this.items[loc] = value;
return this;
},
});
module.exports = exports = Rule;
| Change API for name to be string | Change API for name to be string
| JavaScript | mit | jamen/rpv | javascript | ## Code Before:
'use strict';
/* rule.js
* Expresses CSS rules.
*/
const create = require('./create');
let Rule = create(function(names, list1, list2){
this.names = names;
if (typeof names === 'string') this.names = [names];
if (this.names.length > 1 || arguments.length === 2) {
this.type = 'selector';
this.selectors = this.names || [];
this.items = list1 || [];
} else if (this.names.length === 1 && this.names[0][0] === '@') {
this.type = 'at-rule';
if (arguments.length === 3) {
this.type += ' expressive';
this.name = this.names[0];
this.expression = list1 || [];
this.items = list2 || [];
} else if (arguments.length === 2) this.input = list1;
} else {
this.type = 'unknown';
this.items = [].concat(...(Array.prototype.slice.call(arguments, 1))) || [];
}
}, {
add: function(){
this.items.push(...arguments);
return this;
},
remove: function(loc){
this.items.splice(loc, 1);
return this;
},
set: function(loc, value){
this.items[loc] = value;
return this;
},
});
module.exports = exports = Rule;
## Instruction:
Change API for name to be string
## Code After:
'use strict';
/* rule.js
* Expresses CSS rules.
*/
const create = require('./create');
let Rule = create(function(name, list1, list2){
this.name = name;
if (this.name[0] !== '@') {
this.type = 'selector';
this.selector = this.name || [];
this.items = list1 || [];
} else if (this.name[0] === '@') {
this.type = 'at-rule';
if (arguments.length === 3) {
this.type += ' expressive';
this.name = this.name[0];
this.expression = list1 || [];
this.items = list2 || [];
} else if (arguments.length === 2) this.input = list1;
} else {
this.type = 'unknown';
this.items = [].concat(...(Array.prototype.slice.call(arguments, 1))) || [];
}
}, {
add: function(){
this.items.push(...arguments);
return this;
},
remove: function(loc){
this.items.splice(loc, 1);
return this;
},
set: function(loc, value){
this.items[loc] = value;
return this;
},
});
module.exports = exports = Rule;
| 'use strict';
/* rule.js
* Expresses CSS rules.
*/
const create = require('./create');
- let Rule = create(function(names, list1, list2){
? -
+ let Rule = create(function(name, list1, list2){
- this.names = names;
? - -
+ this.name = name;
+ if (this.name[0] !== '@') {
- if (typeof names === 'string') this.names = [names];
-
- if (this.names.length > 1 || arguments.length === 2) {
this.type = 'selector';
- this.selectors = this.names || [];
? - -
+ this.selector = this.name || [];
this.items = list1 || [];
- } else if (this.names.length === 1 && this.names[0][0] === '@') {
+ } else if (this.name[0] === '@') {
this.type = 'at-rule';
if (arguments.length === 3) {
this.type += ' expressive';
- this.name = this.names[0];
? -
+ this.name = this.name[0];
this.expression = list1 || [];
this.items = list2 || [];
} else if (arguments.length === 2) this.input = list1;
} else {
this.type = 'unknown';
this.items = [].concat(...(Array.prototype.slice.call(arguments, 1))) || [];
}
}, {
add: function(){
this.items.push(...arguments);
return this;
},
remove: function(loc){
this.items.splice(loc, 1);
return this;
},
set: function(loc, value){
this.items[loc] = value;
return this;
},
});
module.exports = exports = Rule; | 14 | 0.291667 | 6 | 8 |
16fa8f7117b04e3dea5ee99427e0d946eaa601a6 | test/cli/commands/test_watch.rb | test/cli/commands/test_watch.rb |
class Nanoc::CLI::Commands::WatchTest < MiniTest::Unit::TestCase
include Nanoc::TestHelpers
def setup
super
@@warned ||= begin
STDERR.puts "\n(fssm deprecation warning can be ignored; master branch uses guard/listen)"
true
end
end
def test_run
with_site do |s|
watch_thread = Thread.new do
Nanoc::CLI.run %w( watch )
end
sleep 1
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
sleep 1
assert_equal 'Hello there!', File.read('output/index.html')
File.open('content/index.html', 'w') { |io| io.write('Hello there again!') }
sleep 1
assert_equal 'Hello there again!', File.read('output/index.html')
watch_thread.kill
end
end
def test_notify
old_path = ENV['PATH']
with_site do |s|
Thread.new do
Nanoc::CLI.run %w( watch )
end
sleep 1
ENV['PATH'] = '.' # so that neither which nor where can be found
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
sleep 1
assert_equal 'Hello there!', File.read('output/index.html')
end
ensure
ENV['PATH'] = old_path
end
end
|
class Nanoc::CLI::Commands::WatchTest < MiniTest::Unit::TestCase
include Nanoc::TestHelpers
def setup
super
@@warned ||= begin
STDERR.puts "\n(fssm deprecation warning can be ignored; master branch uses guard/listen)"
true
end
end
def test_run
with_site do |s|
watch_thread = Thread.new do
Nanoc::CLI.run %w( watch )
end
sleep 1
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
sleep 1
assert_equal 'Hello there!', File.read('output/index.html')
File.open('content/index.html', 'w') { |io| io.write('Hello there again!') }
sleep 1
assert_equal 'Hello there again!', File.read('output/index.html')
watch_thread.kill
end
end
def test_notify
old_path = ENV['PATH']
with_site do |s|
watch_thread = Thread.new do
Nanoc::CLI.run %w( watch )
end
sleep 1
ENV['PATH'] = '.' # so that neither which nor where can be found
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
sleep 1
assert_equal 'Hello there!', File.read('output/index.html')
watch_thread.kill
end
ensure
ENV['PATH'] = old_path
end
end
| Make watcher test case kill watcher thread to avoid garbage output | Make watcher test case kill watcher thread to avoid garbage output
| Ruby | mit | remko/nanoc,gjtorikian/nanoc,barraq/nanoc,hilohiro/nanoc,nanoc/nanoc,RubenVerborgh/nanoc,legallybrown/nanoc | ruby | ## Code Before:
class Nanoc::CLI::Commands::WatchTest < MiniTest::Unit::TestCase
include Nanoc::TestHelpers
def setup
super
@@warned ||= begin
STDERR.puts "\n(fssm deprecation warning can be ignored; master branch uses guard/listen)"
true
end
end
def test_run
with_site do |s|
watch_thread = Thread.new do
Nanoc::CLI.run %w( watch )
end
sleep 1
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
sleep 1
assert_equal 'Hello there!', File.read('output/index.html')
File.open('content/index.html', 'w') { |io| io.write('Hello there again!') }
sleep 1
assert_equal 'Hello there again!', File.read('output/index.html')
watch_thread.kill
end
end
def test_notify
old_path = ENV['PATH']
with_site do |s|
Thread.new do
Nanoc::CLI.run %w( watch )
end
sleep 1
ENV['PATH'] = '.' # so that neither which nor where can be found
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
sleep 1
assert_equal 'Hello there!', File.read('output/index.html')
end
ensure
ENV['PATH'] = old_path
end
end
## Instruction:
Make watcher test case kill watcher thread to avoid garbage output
## Code After:
class Nanoc::CLI::Commands::WatchTest < MiniTest::Unit::TestCase
include Nanoc::TestHelpers
def setup
super
@@warned ||= begin
STDERR.puts "\n(fssm deprecation warning can be ignored; master branch uses guard/listen)"
true
end
end
def test_run
with_site do |s|
watch_thread = Thread.new do
Nanoc::CLI.run %w( watch )
end
sleep 1
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
sleep 1
assert_equal 'Hello there!', File.read('output/index.html')
File.open('content/index.html', 'w') { |io| io.write('Hello there again!') }
sleep 1
assert_equal 'Hello there again!', File.read('output/index.html')
watch_thread.kill
end
end
def test_notify
old_path = ENV['PATH']
with_site do |s|
watch_thread = Thread.new do
Nanoc::CLI.run %w( watch )
end
sleep 1
ENV['PATH'] = '.' # so that neither which nor where can be found
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
sleep 1
assert_equal 'Hello there!', File.read('output/index.html')
watch_thread.kill
end
ensure
ENV['PATH'] = old_path
end
end
|
class Nanoc::CLI::Commands::WatchTest < MiniTest::Unit::TestCase
include Nanoc::TestHelpers
def setup
super
@@warned ||= begin
STDERR.puts "\n(fssm deprecation warning can be ignored; master branch uses guard/listen)"
true
end
end
def test_run
with_site do |s|
watch_thread = Thread.new do
Nanoc::CLI.run %w( watch )
end
sleep 1
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
sleep 1
assert_equal 'Hello there!', File.read('output/index.html')
File.open('content/index.html', 'w') { |io| io.write('Hello there again!') }
sleep 1
assert_equal 'Hello there again!', File.read('output/index.html')
watch_thread.kill
end
end
def test_notify
old_path = ENV['PATH']
with_site do |s|
- Thread.new do
+ watch_thread = Thread.new do
Nanoc::CLI.run %w( watch )
end
sleep 1
ENV['PATH'] = '.' # so that neither which nor where can be found
File.open('content/index.html', 'w') { |io| io.write('Hello there!') }
sleep 1
assert_equal 'Hello there!', File.read('output/index.html')
+
+ watch_thread.kill
end
ensure
ENV['PATH'] = old_path
end
end | 4 | 0.08 | 3 | 1 |
34feaa97c2815c60d4b4d5035c9a9b860558f9a0 | BothamNetworking/HTTPClient.swift | BothamNetworking/HTTPClient.swift | //
// HTTPClient.swift
// BothamNetworking
//
// Created by Pedro Vicente Gomez on 20/11/15.
// Copyright © 2015 GoKarumi S.L. All rights reserved.
//
import Foundation
import Foundation
import Result
public protocol HTTPClient {
func send(httpRequest: HTTPRequest, completion: (Result<HTTPResponse, NSError>) -> ())
func hasValidScheme(httpRequest: HTTPRequest) -> Bool
func isValidResponse(httpRespone: HTTPResponse) -> Bool
}
extension HTTPClient {
public func hasValidScheme(request: HTTPRequest) -> Bool {
return request.url.hasPrefix("http") || request.url.hasPrefix("https")
}
public func isValidResponse(response: HTTPResponse) -> Bool {
let containsValidHTTPStatusCode = 200..<300 ~= response.statusCode
let containsJsonContentType = response.headers?["Content-Type"] == "application/json"
return containsValidHTTPStatusCode && containsJsonContentType
}
} | //
// HTTPClient.swift
// BothamNetworking
//
// Created by Pedro Vicente Gomez on 20/11/15.
// Copyright © 2015 GoKarumi S.L. All rights reserved.
//
import Foundation
import Foundation
import Result
public protocol HTTPClient {
func send(httpRequest: HTTPRequest, completion: (Result<HTTPResponse, NSError>) -> ())
func hasValidScheme(httpRequest: HTTPRequest) -> Bool
func isValidResponse(httpRespone: HTTPResponse) -> Bool
}
extension HTTPClient {
public func hasValidScheme(request: HTTPRequest) -> Bool {
return request.url.hasPrefix("http") || request.url.hasPrefix("https")
}
public func isValidResponse(response: HTTPResponse) -> Bool {
let containsValidHTTPStatusCode = 200..<300 ~= response.statusCode
return containsValidHTTPStatusCode && containsJSONContentType(response.headers)
}
private func containsJSONContentType(headers: CaseInsensitiveDictionary<String>?) -> Bool {
let contentTypeHeader = headers?["Content-Type"]
return contentTypeHeader == "application/json" || contentTypeHeader == "application/json; charset=utf-8"
}
} | Add a new valid content type header | Add a new valid content type header
| Swift | apache-2.0 | Karumi/BothamNetworking,Karumi/BothamNetworking | swift | ## Code Before:
//
// HTTPClient.swift
// BothamNetworking
//
// Created by Pedro Vicente Gomez on 20/11/15.
// Copyright © 2015 GoKarumi S.L. All rights reserved.
//
import Foundation
import Foundation
import Result
public protocol HTTPClient {
func send(httpRequest: HTTPRequest, completion: (Result<HTTPResponse, NSError>) -> ())
func hasValidScheme(httpRequest: HTTPRequest) -> Bool
func isValidResponse(httpRespone: HTTPResponse) -> Bool
}
extension HTTPClient {
public func hasValidScheme(request: HTTPRequest) -> Bool {
return request.url.hasPrefix("http") || request.url.hasPrefix("https")
}
public func isValidResponse(response: HTTPResponse) -> Bool {
let containsValidHTTPStatusCode = 200..<300 ~= response.statusCode
let containsJsonContentType = response.headers?["Content-Type"] == "application/json"
return containsValidHTTPStatusCode && containsJsonContentType
}
}
## Instruction:
Add a new valid content type header
## Code After:
//
// HTTPClient.swift
// BothamNetworking
//
// Created by Pedro Vicente Gomez on 20/11/15.
// Copyright © 2015 GoKarumi S.L. All rights reserved.
//
import Foundation
import Foundation
import Result
public protocol HTTPClient {
func send(httpRequest: HTTPRequest, completion: (Result<HTTPResponse, NSError>) -> ())
func hasValidScheme(httpRequest: HTTPRequest) -> Bool
func isValidResponse(httpRespone: HTTPResponse) -> Bool
}
extension HTTPClient {
public func hasValidScheme(request: HTTPRequest) -> Bool {
return request.url.hasPrefix("http") || request.url.hasPrefix("https")
}
public func isValidResponse(response: HTTPResponse) -> Bool {
let containsValidHTTPStatusCode = 200..<300 ~= response.statusCode
return containsValidHTTPStatusCode && containsJSONContentType(response.headers)
}
private func containsJSONContentType(headers: CaseInsensitiveDictionary<String>?) -> Bool {
let contentTypeHeader = headers?["Content-Type"]
return contentTypeHeader == "application/json" || contentTypeHeader == "application/json; charset=utf-8"
}
} | //
// HTTPClient.swift
// BothamNetworking
//
// Created by Pedro Vicente Gomez on 20/11/15.
// Copyright © 2015 GoKarumi S.L. All rights reserved.
//
import Foundation
import Foundation
import Result
public protocol HTTPClient {
func send(httpRequest: HTTPRequest, completion: (Result<HTTPResponse, NSError>) -> ())
func hasValidScheme(httpRequest: HTTPRequest) -> Bool
func isValidResponse(httpRespone: HTTPResponse) -> Bool
}
extension HTTPClient {
public func hasValidScheme(request: HTTPRequest) -> Bool {
return request.url.hasPrefix("http") || request.url.hasPrefix("https")
}
public func isValidResponse(response: HTTPResponse) -> Bool {
let containsValidHTTPStatusCode = 200..<300 ~= response.statusCode
- let containsJsonContentType = response.headers?["Content-Type"] == "application/json"
- return containsValidHTTPStatusCode && containsJsonContentType
? ^^^
+ return containsValidHTTPStatusCode && containsJSONContentType(response.headers)
? ^^^ ++++++++++++++++++
+ }
+
+ private func containsJSONContentType(headers: CaseInsensitiveDictionary<String>?) -> Bool {
+ let contentTypeHeader = headers?["Content-Type"]
+ return contentTypeHeader == "application/json" || contentTypeHeader == "application/json; charset=utf-8"
}
} | 8 | 0.222222 | 6 | 2 |
ba848918fe4200458af4712ae2113fb5bfd1b3b6 | .travis.yml | .travis.yml | language: python
sudo: false
script: ./scripts/travis.sh
os:
- linux
python:
- 3.5
- 3.6
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
- python: 3.8
dist: xenial
sudo: true
- python: 3.9
dist: xenial
sudo: true
- python: 3.10
dist: focal
sudo: true
services:
- memcached
- redis-server
| language: python
sudo: false
script: ./scripts/travis.sh
os:
- linux
python:
- "3.5"
- "3.6"
matrix:
include:
- python: "3.7"
dist: "xenial"
sudo: true
- python: "3.8"
dist: "xenial"
sudo: true
- python: "3.9"
dist: "xenial"
sudo: true
- python: "3.10"
dist: "focal"
sudo: true
services:
- memcached
- redis-server
| Put 3.10 in Quotes for Travis | Put 3.10 in Quotes for Travis
| YAML | bsd-3-clause | datafolklabs/cement,datafolklabs/cement,datafolklabs/cement | yaml | ## Code Before:
language: python
sudo: false
script: ./scripts/travis.sh
os:
- linux
python:
- 3.5
- 3.6
matrix:
include:
- python: 3.7
dist: xenial
sudo: true
- python: 3.8
dist: xenial
sudo: true
- python: 3.9
dist: xenial
sudo: true
- python: 3.10
dist: focal
sudo: true
services:
- memcached
- redis-server
## Instruction:
Put 3.10 in Quotes for Travis
## Code After:
language: python
sudo: false
script: ./scripts/travis.sh
os:
- linux
python:
- "3.5"
- "3.6"
matrix:
include:
- python: "3.7"
dist: "xenial"
sudo: true
- python: "3.8"
dist: "xenial"
sudo: true
- python: "3.9"
dist: "xenial"
sudo: true
- python: "3.10"
dist: "focal"
sudo: true
services:
- memcached
- redis-server
| language: python
sudo: false
script: ./scripts/travis.sh
os:
- linux
python:
- - 3.5
+ - "3.5"
? + +
- - 3.6
+ - "3.6"
? + +
matrix:
include:
- - python: 3.7
+ - python: "3.7"
? + +
- dist: xenial
+ dist: "xenial"
? + +
sudo: true
- - python: 3.8
+ - python: "3.8"
? + +
- dist: xenial
+ dist: "xenial"
? + +
sudo: true
- - python: 3.9
+ - python: "3.9"
? + +
- dist: xenial
+ dist: "xenial"
? + +
sudo: true
- - python: 3.10
+ - python: "3.10"
? + +
- dist: focal
+ dist: "focal"
? + +
sudo: true
services:
- memcached
- redis-server | 20 | 0.8 | 10 | 10 |
4697787c33396ff0d55cae67c45bce391fc884fc | .travis.yml | .travis.yml | sudo: false
language: php
php:
- 7.1
- 7.2
addons:
apt:
packages:
- rabbitmq-server
services:
- rabbitmq
before_install:
- rabbitmq-plugins enable rabbitmq_management
- composer self-update --stable --no-interaction
before_script:
- composer install --prefer-source --no-interaction
script:
- php rabbit vhost:reset my_vhost_name -p guest
- php rabbit vhost:mapping:create examples/events.yml -p guest
- vendor/bin/phpunit
| language: php
php:
- 7.1
- 7.2
addons:
apt:
packages:
- rabbitmq-server
services:
- rabbitmq
before_install:
- sudo rabbitmq-plugins enable rabbitmq_management
- composer self-update --stable --no-interaction
before_script:
- composer install --prefer-source --no-interaction
script:
- php rabbit vhost:reset my_vhost_name -p guest
- php rabbit vhost:mapping:create examples/events.yml -p guest
- vendor/bin/phpunit
| Use sudo to enable the rabbitmq plugin | Use sudo to enable the rabbitmq plugin | YAML | mit | odolbeau/rabbit-mq-admin-toolkit | yaml | ## Code Before:
sudo: false
language: php
php:
- 7.1
- 7.2
addons:
apt:
packages:
- rabbitmq-server
services:
- rabbitmq
before_install:
- rabbitmq-plugins enable rabbitmq_management
- composer self-update --stable --no-interaction
before_script:
- composer install --prefer-source --no-interaction
script:
- php rabbit vhost:reset my_vhost_name -p guest
- php rabbit vhost:mapping:create examples/events.yml -p guest
- vendor/bin/phpunit
## Instruction:
Use sudo to enable the rabbitmq plugin
## Code After:
language: php
php:
- 7.1
- 7.2
addons:
apt:
packages:
- rabbitmq-server
services:
- rabbitmq
before_install:
- sudo rabbitmq-plugins enable rabbitmq_management
- composer self-update --stable --no-interaction
before_script:
- composer install --prefer-source --no-interaction
script:
- php rabbit vhost:reset my_vhost_name -p guest
- php rabbit vhost:mapping:create examples/events.yml -p guest
- vendor/bin/phpunit
| - sudo: false
-
language: php
php:
- 7.1
- 7.2
addons:
apt:
packages:
- rabbitmq-server
services:
- rabbitmq
before_install:
- - rabbitmq-plugins enable rabbitmq_management
+ - sudo rabbitmq-plugins enable rabbitmq_management
? +++++
- composer self-update --stable --no-interaction
before_script:
- composer install --prefer-source --no-interaction
script:
- php rabbit vhost:reset my_vhost_name -p guest
- php rabbit vhost:mapping:create examples/events.yml -p guest
- vendor/bin/phpunit | 4 | 0.148148 | 1 | 3 |
8d7051913c6940d4e0e87f5a6ea011d936f79742 | test/SemaCXX/old-style-cast.cpp | test/SemaCXX/old-style-cast.cpp | // RUN: %clang_cc1 -fsyntax-only -verify -Wold-style-cast %s
void test1() {
long x = (long)12; // expected-warning {{use of old-style cast}}
(long)x; // expected-warning {{use of old-style cast}} expected-warning {{expression result unused}}
(void**)x; // expected-warning {{use of old-style cast}} expected-warning {{expression result unused}}
long y = static_cast<long>(12);
(void)y;
typedef void VOID;
(VOID)y;
}
| // RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -verify -Wold-style-cast %s
void test1() {
long x = (long)12; // expected-warning {{use of old-style cast}}
(long)x; // expected-warning {{use of old-style cast}} expected-warning {{expression result unused}}
(void**)x; // expected-warning {{use of old-style cast}} expected-warning {{expression result unused}}
long y = static_cast<long>(12);
(void)y;
typedef void VOID;
(VOID)y;
}
| Add a triple to fix this test on Windows | Add a triple to fix this test on Windows
The warning from cmake-clang-x64-msc16-R was:
test\SemaCXX\old-style-cast.cpp Line 6: cast to 'void **' from smaller integer type 'long'
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@195813 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang | c++ | ## Code Before:
// RUN: %clang_cc1 -fsyntax-only -verify -Wold-style-cast %s
void test1() {
long x = (long)12; // expected-warning {{use of old-style cast}}
(long)x; // expected-warning {{use of old-style cast}} expected-warning {{expression result unused}}
(void**)x; // expected-warning {{use of old-style cast}} expected-warning {{expression result unused}}
long y = static_cast<long>(12);
(void)y;
typedef void VOID;
(VOID)y;
}
## Instruction:
Add a triple to fix this test on Windows
The warning from cmake-clang-x64-msc16-R was:
test\SemaCXX\old-style-cast.cpp Line 6: cast to 'void **' from smaller integer type 'long'
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@195813 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -verify -Wold-style-cast %s
void test1() {
long x = (long)12; // expected-warning {{use of old-style cast}}
(long)x; // expected-warning {{use of old-style cast}} expected-warning {{expression result unused}}
(void**)x; // expected-warning {{use of old-style cast}} expected-warning {{expression result unused}}
long y = static_cast<long>(12);
(void)y;
typedef void VOID;
(VOID)y;
}
| - // RUN: %clang_cc1 -fsyntax-only -verify -Wold-style-cast %s
+ // RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -verify -Wold-style-cast %s
? ++++++++++++++++++++++++++++
void test1() {
long x = (long)12; // expected-warning {{use of old-style cast}}
(long)x; // expected-warning {{use of old-style cast}} expected-warning {{expression result unused}}
(void**)x; // expected-warning {{use of old-style cast}} expected-warning {{expression result unused}}
long y = static_cast<long>(12);
(void)y;
typedef void VOID;
(VOID)y;
} | 2 | 0.181818 | 1 | 1 |
ab14020f31da3fda8d4c652485b311597a46e8fb | _includes/social/icon_partial.html | _includes/social/icon_partial.html | {% if include.isDisplayed %}
<li>
<a href="{{ include.url }}"
title="{{ site.data.language.str_follow_on }} {{ include.social }}">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-{{ include.social | downcase }} fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
{% endif %}
| {% if include.isDisplayed %}
<li>
<a href="{{ include.url }}"
title="{{ site.data.language.str_follow_on }} {{ include.social }}"
rel="me">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-{{ include.social | downcase }} fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
{% endif %}
| Use rel="me" for identity consolidation | Use rel="me" for identity consolidation
Adopt XFN specification
https://gmpg.org/xfn/and/#idconsolidation
| HTML | mit | Jeansen/jeansen.github.io,Jeansen/jeansen.github.io,Jeansen/jeansen.github.io | html | ## Code Before:
{% if include.isDisplayed %}
<li>
<a href="{{ include.url }}"
title="{{ site.data.language.str_follow_on }} {{ include.social }}">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-{{ include.social | downcase }} fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
{% endif %}
## Instruction:
Use rel="me" for identity consolidation
Adopt XFN specification
https://gmpg.org/xfn/and/#idconsolidation
## Code After:
{% if include.isDisplayed %}
<li>
<a href="{{ include.url }}"
title="{{ site.data.language.str_follow_on }} {{ include.social }}"
rel="me">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-{{ include.social | downcase }} fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
{% endif %}
| {% if include.isDisplayed %}
<li>
<a href="{{ include.url }}"
- title="{{ site.data.language.str_follow_on }} {{ include.social }}">
? -
+ title="{{ site.data.language.str_follow_on }} {{ include.social }}"
+ rel="me">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fab fa-{{ include.social | downcase }} fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
{% endif %} | 3 | 0.272727 | 2 | 1 |
bb8a08cf2550cef1d8901187e243fe3708f278eb | index.js | index.js | var utils = require('loader-utils');
var sass = require('node-sass');
var path = require('path');
module.exports = function(content) {
var root;
this.cacheable && this.cacheable();
var callback = this.async();
var opt = utils.parseQuery(this.query);
opt.data = content;
// set include path to fix imports
opt.includePaths = opt.includePaths || [];
opt.includePaths.push(path.dirname(this.resourcePath));
if (this.options.resolve && this.options.resolve.root) {
root = [].concat(this.options.resolve.root);
opt.includePaths = opt.includePaths.concat(root);
}
// output compressed by default
opt.outputStyle = opt.outputStyle || 'compressed';
opt.success = function(css) {
callback(null, css);
};
opt.error = function(err) {
throw err;
};
sass.render(opt);
}; | var nutil = require('util');
var utils = require('loader-utils');
var sass = require('node-sass');
var path = require('path');
module.exports = function(content) {
var root;
this.cacheable && this.cacheable();
var callback = this.async();
var opt = utils.parseQuery(this.query);
opt.data = content;
if (opt.contextDependencies) {
if (!nutil.isArray(opt.contextDependencies)) {
opt.contextDependencies = [opt.contextDependencies]
}
var loaderContext = this;
opt.contextDependencies.forEach(function(d) {
loaderContext.addContextDependency(d);
});
}
// set include path to fix imports
opt.includePaths = opt.includePaths || [];
opt.includePaths.push(path.dirname(this.resourcePath));
if (this.options.resolve && this.options.resolve.root) {
root = [].concat(this.options.resolve.root);
opt.includePaths = opt.includePaths.concat(root);
}
// output compressed by default
opt.outputStyle = opt.outputStyle || 'compressed';
opt.success = function(css) {
callback(null, css);
};
opt.error = function(err) {
throw err;
};
sass.render(opt);
};
| Allow contextDependencies to be specified | Allow contextDependencies to be specified | JavaScript | mit | endaaman/sass-loader,oliverturner/sass-loader,jorrit/sass-loader,endaaman/sass-loader,mcanthony/sass-loader,Tol1/sass-loader,gabriel-laet/sass-loader,Updater/sass-loader,stevemao/sass-loader,Updater/sass-loader,jorrit/sass-loader,modulexcite/sass-loader,dtothefp/sass-loader,stevemao/sass-loader,mcanthony/sass-loader,oddbird/sass-loader,gabriel-laet/sass-loader,jtangelder/sass-loader,oddbird/sass-loader,bebo/sass-loader,modulexcite/sass-loader,bholloway/sass-loader,dtothefp/sass-loader,bholloway/sass-loader,oliverturner/sass-loader,Tol1/sass-loader,bebo/sass-loader,janicduplessis/sass-loader,janicduplessis/sass-loader,jtangelder/sass-loader | javascript | ## Code Before:
var utils = require('loader-utils');
var sass = require('node-sass');
var path = require('path');
module.exports = function(content) {
var root;
this.cacheable && this.cacheable();
var callback = this.async();
var opt = utils.parseQuery(this.query);
opt.data = content;
// set include path to fix imports
opt.includePaths = opt.includePaths || [];
opt.includePaths.push(path.dirname(this.resourcePath));
if (this.options.resolve && this.options.resolve.root) {
root = [].concat(this.options.resolve.root);
opt.includePaths = opt.includePaths.concat(root);
}
// output compressed by default
opt.outputStyle = opt.outputStyle || 'compressed';
opt.success = function(css) {
callback(null, css);
};
opt.error = function(err) {
throw err;
};
sass.render(opt);
};
## Instruction:
Allow contextDependencies to be specified
## Code After:
var nutil = require('util');
var utils = require('loader-utils');
var sass = require('node-sass');
var path = require('path');
module.exports = function(content) {
var root;
this.cacheable && this.cacheable();
var callback = this.async();
var opt = utils.parseQuery(this.query);
opt.data = content;
if (opt.contextDependencies) {
if (!nutil.isArray(opt.contextDependencies)) {
opt.contextDependencies = [opt.contextDependencies]
}
var loaderContext = this;
opt.contextDependencies.forEach(function(d) {
loaderContext.addContextDependency(d);
});
}
// set include path to fix imports
opt.includePaths = opt.includePaths || [];
opt.includePaths.push(path.dirname(this.resourcePath));
if (this.options.resolve && this.options.resolve.root) {
root = [].concat(this.options.resolve.root);
opt.includePaths = opt.includePaths.concat(root);
}
// output compressed by default
opt.outputStyle = opt.outputStyle || 'compressed';
opt.success = function(css) {
callback(null, css);
};
opt.error = function(err) {
throw err;
};
sass.render(opt);
};
| + var nutil = require('util');
var utils = require('loader-utils');
var sass = require('node-sass');
var path = require('path');
module.exports = function(content) {
var root;
this.cacheable && this.cacheable();
var callback = this.async();
var opt = utils.parseQuery(this.query);
- opt.data = content;
? -
+ opt.data = content;
+
+ if (opt.contextDependencies) {
+ if (!nutil.isArray(opt.contextDependencies)) {
+ opt.contextDependencies = [opt.contextDependencies]
+ }
+ var loaderContext = this;
+ opt.contextDependencies.forEach(function(d) {
+ loaderContext.addContextDependency(d);
+ });
+ }
// set include path to fix imports
opt.includePaths = opt.includePaths || [];
opt.includePaths.push(path.dirname(this.resourcePath));
if (this.options.resolve && this.options.resolve.root) {
root = [].concat(this.options.resolve.root);
opt.includePaths = opt.includePaths.concat(root);
}
// output compressed by default
opt.outputStyle = opt.outputStyle || 'compressed';
opt.success = function(css) {
callback(null, css);
};
opt.error = function(err) {
throw err;
};
sass.render(opt);
}; | 13 | 0.371429 | 12 | 1 |
3d0a46f3e16889f2769ec9ec57affb3a21726c95 | app/models/course_membership.rb | app/models/course_membership.rb | class CourseMembership < ActiveRecord::Base
belongs_to :course
belongs_to :user
attr_accessible :auditing, :character_profile, :course_id, :instructor_of_record,
:user_id, :role
ROLES = %w(student professor gsi admin)
ROLES.each do |role|
scope role.pluralize, ->(course) { where role: role }
define_method("#{role}?") do
self.role == role
end
end
scope :auditing, -> { where( :auditing => true ) }
scope :being_graded, -> { where( :auditing => false) }
validates :instructor_of_record, instructor_of_record: true
def assign_role_from_lti(auth_hash)
return unless auth_hash['extra'] && auth_hash['extra']['raw_info'] && auth_hash['extra']['raw_info']['roles']
auth_hash['extra']['raw_info'].tap do |extra|
case extra['roles'].downcase
when /instructor/
self.update_attribute(:role, 'professor')
when /teachingassistant/
self.update_attribute(:role, 'gsi')
else
self.update_attribute(:role, 'student')
end
end
end
def staff?
professor? || gsi? || admin?
end
protected
def student_id
@student_id ||= user.id
end
end
| class CourseMembership < ActiveRecord::Base
belongs_to :course
belongs_to :user
attr_accessible :auditing, :character_profile, :course_id, :instructor_of_record,
:user_id, :role
ROLES = %w(student professor gsi admin)
ROLES.each do |role|
scope role.pluralize, ->(course) { where role: role }
define_method("#{role}?") do
self.role == role
end
end
scope :auditing, -> { where( :auditing => true ) }
scope :being_graded, -> { where( :auditing => false) }
validates :instructor_of_record, instructor_of_record: true
def assign_role_from_lti(auth_hash)
return unless auth_hash['extra'] && auth_hash['extra']['raw_info'] && auth_hash['extra']['raw_info']['roles']
auth_hash['extra']['raw_info'].tap do |extra|
case extra['roles'].downcase
when /instructor/
self.update_attribute(:role, 'professor')
self.update_attribute(:instructor_of_record, true)
when /teachingassistant/
self.update_attribute(:role, 'gsi')
self.update_attribute(:instructor_of_record, true)
else
self.update_attribute(:role, 'student')
self.update_attribute(:instructor_of_record, false)
end
end
end
def staff?
professor? || gsi? || admin?
end
protected
def student_id
@student_id ||= user.id
end
end
| Update the instructors of record when their roles are updated | Update the instructors of record when their roles are updated
| Ruby | agpl-3.0 | UM-USElab/gradecraft-development,peterkshultz/gradecraft-development,peterkshultz/gradecraft-development,UM-USElab/gradecraft-development,UM-USElab/gradecraft-development,mkoon/gradecraft-development,mkoon/gradecraft-development,UM-USElab/gradecraft-development,peterkshultz/gradecraft-development,mkoon/gradecraft-development | ruby | ## Code Before:
class CourseMembership < ActiveRecord::Base
belongs_to :course
belongs_to :user
attr_accessible :auditing, :character_profile, :course_id, :instructor_of_record,
:user_id, :role
ROLES = %w(student professor gsi admin)
ROLES.each do |role|
scope role.pluralize, ->(course) { where role: role }
define_method("#{role}?") do
self.role == role
end
end
scope :auditing, -> { where( :auditing => true ) }
scope :being_graded, -> { where( :auditing => false) }
validates :instructor_of_record, instructor_of_record: true
def assign_role_from_lti(auth_hash)
return unless auth_hash['extra'] && auth_hash['extra']['raw_info'] && auth_hash['extra']['raw_info']['roles']
auth_hash['extra']['raw_info'].tap do |extra|
case extra['roles'].downcase
when /instructor/
self.update_attribute(:role, 'professor')
when /teachingassistant/
self.update_attribute(:role, 'gsi')
else
self.update_attribute(:role, 'student')
end
end
end
def staff?
professor? || gsi? || admin?
end
protected
def student_id
@student_id ||= user.id
end
end
## Instruction:
Update the instructors of record when their roles are updated
## Code After:
class CourseMembership < ActiveRecord::Base
belongs_to :course
belongs_to :user
attr_accessible :auditing, :character_profile, :course_id, :instructor_of_record,
:user_id, :role
ROLES = %w(student professor gsi admin)
ROLES.each do |role|
scope role.pluralize, ->(course) { where role: role }
define_method("#{role}?") do
self.role == role
end
end
scope :auditing, -> { where( :auditing => true ) }
scope :being_graded, -> { where( :auditing => false) }
validates :instructor_of_record, instructor_of_record: true
def assign_role_from_lti(auth_hash)
return unless auth_hash['extra'] && auth_hash['extra']['raw_info'] && auth_hash['extra']['raw_info']['roles']
auth_hash['extra']['raw_info'].tap do |extra|
case extra['roles'].downcase
when /instructor/
self.update_attribute(:role, 'professor')
self.update_attribute(:instructor_of_record, true)
when /teachingassistant/
self.update_attribute(:role, 'gsi')
self.update_attribute(:instructor_of_record, true)
else
self.update_attribute(:role, 'student')
self.update_attribute(:instructor_of_record, false)
end
end
end
def staff?
professor? || gsi? || admin?
end
protected
def student_id
@student_id ||= user.id
end
end
| class CourseMembership < ActiveRecord::Base
belongs_to :course
belongs_to :user
attr_accessible :auditing, :character_profile, :course_id, :instructor_of_record,
:user_id, :role
ROLES = %w(student professor gsi admin)
ROLES.each do |role|
scope role.pluralize, ->(course) { where role: role }
define_method("#{role}?") do
self.role == role
end
end
scope :auditing, -> { where( :auditing => true ) }
scope :being_graded, -> { where( :auditing => false) }
validates :instructor_of_record, instructor_of_record: true
def assign_role_from_lti(auth_hash)
return unless auth_hash['extra'] && auth_hash['extra']['raw_info'] && auth_hash['extra']['raw_info']['roles']
auth_hash['extra']['raw_info'].tap do |extra|
case extra['roles'].downcase
when /instructor/
self.update_attribute(:role, 'professor')
+ self.update_attribute(:instructor_of_record, true)
when /teachingassistant/
self.update_attribute(:role, 'gsi')
+ self.update_attribute(:instructor_of_record, true)
else
self.update_attribute(:role, 'student')
+ self.update_attribute(:instructor_of_record, false)
end
end
end
def staff?
professor? || gsi? || admin?
end
protected
def student_id
@student_id ||= user.id
end
end | 3 | 0.06383 | 3 | 0 |
9c40ab5f06d152e679ce85ac177096813140ed5c | cookbooks/ondemand_base/recipes/windows.rb | cookbooks/ondemand_base/recipes/windows.rb | windows_feature "SNMP-Service"
action :install
end
#Install Powershell feature
windows_feature "PowerShell-ISE"
action :install
end
#Install .NET 3.5.1
windows_feature "NET-Framework-Core"
action :install
end
#Install MSMQ
windows_feature "MSMQ-Server"
action :install
end
#Turn off hibernation
execute powercfg do
command "powercfg.exe /h off"
action :run
end
#Set high performance power options
execute powercfg do
command "powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"
action :run
end
#Turn off IPv6
windows_registry 'HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' do
values 'DisabledComponents' => "0xffffffff"
end | windows_feature "SNMP-Service"
action :install
end
#Install Powershell feature
windows_feature "PowerShell-ISE"
action :install
end
#Install .NET 3.5.1
windows_feature "NET-Framework-Core"
action :install
end
#Install MSMQ
windows_feature "MSMQ-Server"
action :install
end
#Turn off hibernation
execute powercfg do
command "powercfg.exe /h off"
action :run
end
#Set high performance power options
execute powercfg do
command "powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"
action :run
end
#Turn off IPv6
windows_registry 'HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' do
values 'DisabledComponents' => "0xffffffff"
end
#Auto reboot on system crashes, log the crash to the event log, and create a crash dump
windows_registry 'HKLM\SYSTEM\CurrentControlSet\Control\CrashControl'
values 'AutoReboot' => "3"
values 'LogEvent' => "3"
values 'CrashDumpEnabled' => "3"
end
| Add auto rebooting on system crashes with dump creation and event log logging. | Add auto rebooting on system crashes with dump creation and event log logging.
| Ruby | apache-2.0 | scottymarshall/rundeck,scottymarshall/rundeck,scottymarshall/rundeck | ruby | ## Code Before:
windows_feature "SNMP-Service"
action :install
end
#Install Powershell feature
windows_feature "PowerShell-ISE"
action :install
end
#Install .NET 3.5.1
windows_feature "NET-Framework-Core"
action :install
end
#Install MSMQ
windows_feature "MSMQ-Server"
action :install
end
#Turn off hibernation
execute powercfg do
command "powercfg.exe /h off"
action :run
end
#Set high performance power options
execute powercfg do
command "powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"
action :run
end
#Turn off IPv6
windows_registry 'HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' do
values 'DisabledComponents' => "0xffffffff"
end
## Instruction:
Add auto rebooting on system crashes with dump creation and event log logging.
## Code After:
windows_feature "SNMP-Service"
action :install
end
#Install Powershell feature
windows_feature "PowerShell-ISE"
action :install
end
#Install .NET 3.5.1
windows_feature "NET-Framework-Core"
action :install
end
#Install MSMQ
windows_feature "MSMQ-Server"
action :install
end
#Turn off hibernation
execute powercfg do
command "powercfg.exe /h off"
action :run
end
#Set high performance power options
execute powercfg do
command "powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"
action :run
end
#Turn off IPv6
windows_registry 'HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' do
values 'DisabledComponents' => "0xffffffff"
end
#Auto reboot on system crashes, log the crash to the event log, and create a crash dump
windows_registry 'HKLM\SYSTEM\CurrentControlSet\Control\CrashControl'
values 'AutoReboot' => "3"
values 'LogEvent' => "3"
values 'CrashDumpEnabled' => "3"
end
| windows_feature "SNMP-Service"
action :install
end
#Install Powershell feature
windows_feature "PowerShell-ISE"
action :install
end
#Install .NET 3.5.1
windows_feature "NET-Framework-Core"
action :install
end
#Install MSMQ
windows_feature "MSMQ-Server"
action :install
end
#Turn off hibernation
execute powercfg do
command "powercfg.exe /h off"
action :run
end
#Set high performance power options
execute powercfg do
command "powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"
action :run
end
#Turn off IPv6
windows_registry 'HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' do
values 'DisabledComponents' => "0xffffffff"
end
+
+ #Auto reboot on system crashes, log the crash to the event log, and create a crash dump
+ windows_registry 'HKLM\SYSTEM\CurrentControlSet\Control\CrashControl'
+ values 'AutoReboot' => "3"
+ values 'LogEvent' => "3"
+ values 'CrashDumpEnabled' => "3"
+ end
+
+ | 9 | 0.257143 | 9 | 0 |
6fa5e57b0dd68f2d4c682328e915fe4cccc4213e | web_client/views/imageViewerWidget/base.js | web_client/views/imageViewerWidget/base.js | import { restRequest } from 'girder/rest';
import View from 'girder/views/View';
var ImageViewerWidget = View.extend({
initialize: function (settings) {
this.itemId = settings.itemId;
restRequest({
type: 'GET',
path: 'item/' + this.itemId + '/tiles'
}).done((resp) => {
this.levels = resp.levels;
this.tileWidth = resp.tileWidth;
this.tileHeight = resp.tileHeight;
this.sizeX = resp.sizeX;
this.sizeY = resp.sizeY;
this.render();
this.trigger('g:imageRendered', this);
});
},
/**
* Return a url for a specific tile. This can also be used to generate a
* template url if the level, x, and y parameters are template strings
* rather than integers.
*
* @param {number|string} level: the tile level or a template string.
* @param {number|string} x: the tile x position or a template string.
* @param {number|string} y: the tile y position or a template string.
* @param {object} [query]: optional query parameters to add to the url.
*/
_getTileUrl: function (level, x, y, query) {
var url = '/api/v1/item/' + this.itemId + '/tiles/zxy/' +
level + '/' + x + '/' + y;
if (query) {
url += '?' + $.param(query);
}
return url;
}
});
export default ImageViewerWidget;
| import { apiRoot, restRequest } from 'girder/rest';
import View from 'girder/views/View';
var ImageViewerWidget = View.extend({
initialize: function (settings) {
this.itemId = settings.itemId;
restRequest({
type: 'GET',
path: 'item/' + this.itemId + '/tiles'
}).done((resp) => {
this.levels = resp.levels;
this.tileWidth = resp.tileWidth;
this.tileHeight = resp.tileHeight;
this.sizeX = resp.sizeX;
this.sizeY = resp.sizeY;
this.render();
this.trigger('g:imageRendered', this);
});
},
/**
* Return a url for a specific tile. This can also be used to generate a
* template url if the level, x, and y parameters are template strings
* rather than integers.
*
* @param {number|string} level: the tile level or a template string.
* @param {number|string} x: the tile x position or a template string.
* @param {number|string} y: the tile y position or a template string.
* @param {object} [query]: optional query parameters to add to the url.
*/
_getTileUrl: function (level, x, y, query) {
var url = apiRoot + '/item/' + this.itemId + '/tiles/zxy/' +
level + '/' + x + '/' + y;
if (query) {
url += '?' + $.param(query);
}
return url;
}
});
export default ImageViewerWidget;
| Fix a hard-coded api root in the image viewer. | Fix a hard-coded api root in the image viewer.
| JavaScript | apache-2.0 | DigitalSlideArchive/large_image,DigitalSlideArchive/large_image,DigitalSlideArchive/large_image,girder/large_image,girder/large_image,girder/large_image | javascript | ## Code Before:
import { restRequest } from 'girder/rest';
import View from 'girder/views/View';
var ImageViewerWidget = View.extend({
initialize: function (settings) {
this.itemId = settings.itemId;
restRequest({
type: 'GET',
path: 'item/' + this.itemId + '/tiles'
}).done((resp) => {
this.levels = resp.levels;
this.tileWidth = resp.tileWidth;
this.tileHeight = resp.tileHeight;
this.sizeX = resp.sizeX;
this.sizeY = resp.sizeY;
this.render();
this.trigger('g:imageRendered', this);
});
},
/**
* Return a url for a specific tile. This can also be used to generate a
* template url if the level, x, and y parameters are template strings
* rather than integers.
*
* @param {number|string} level: the tile level or a template string.
* @param {number|string} x: the tile x position or a template string.
* @param {number|string} y: the tile y position or a template string.
* @param {object} [query]: optional query parameters to add to the url.
*/
_getTileUrl: function (level, x, y, query) {
var url = '/api/v1/item/' + this.itemId + '/tiles/zxy/' +
level + '/' + x + '/' + y;
if (query) {
url += '?' + $.param(query);
}
return url;
}
});
export default ImageViewerWidget;
## Instruction:
Fix a hard-coded api root in the image viewer.
## Code After:
import { apiRoot, restRequest } from 'girder/rest';
import View from 'girder/views/View';
var ImageViewerWidget = View.extend({
initialize: function (settings) {
this.itemId = settings.itemId;
restRequest({
type: 'GET',
path: 'item/' + this.itemId + '/tiles'
}).done((resp) => {
this.levels = resp.levels;
this.tileWidth = resp.tileWidth;
this.tileHeight = resp.tileHeight;
this.sizeX = resp.sizeX;
this.sizeY = resp.sizeY;
this.render();
this.trigger('g:imageRendered', this);
});
},
/**
* Return a url for a specific tile. This can also be used to generate a
* template url if the level, x, and y parameters are template strings
* rather than integers.
*
* @param {number|string} level: the tile level or a template string.
* @param {number|string} x: the tile x position or a template string.
* @param {number|string} y: the tile y position or a template string.
* @param {object} [query]: optional query parameters to add to the url.
*/
_getTileUrl: function (level, x, y, query) {
var url = apiRoot + '/item/' + this.itemId + '/tiles/zxy/' +
level + '/' + x + '/' + y;
if (query) {
url += '?' + $.param(query);
}
return url;
}
});
export default ImageViewerWidget;
| - import { restRequest } from 'girder/rest';
+ import { apiRoot, restRequest } from 'girder/rest';
? +++++++++
import View from 'girder/views/View';
var ImageViewerWidget = View.extend({
initialize: function (settings) {
this.itemId = settings.itemId;
restRequest({
type: 'GET',
path: 'item/' + this.itemId + '/tiles'
}).done((resp) => {
this.levels = resp.levels;
this.tileWidth = resp.tileWidth;
this.tileHeight = resp.tileHeight;
this.sizeX = resp.sizeX;
this.sizeY = resp.sizeY;
this.render();
this.trigger('g:imageRendered', this);
});
},
/**
* Return a url for a specific tile. This can also be used to generate a
* template url if the level, x, and y parameters are template strings
* rather than integers.
*
* @param {number|string} level: the tile level or a template string.
* @param {number|string} x: the tile x position or a template string.
* @param {number|string} y: the tile y position or a template string.
* @param {object} [query]: optional query parameters to add to the url.
*/
_getTileUrl: function (level, x, y, query) {
- var url = '/api/v1/item/' + this.itemId + '/tiles/zxy/' +
? -- ^^^
+ var url = apiRoot + '/item/' + this.itemId + '/tiles/zxy/' +
? ^^^^^^^^
level + '/' + x + '/' + y;
if (query) {
url += '?' + $.param(query);
}
return url;
}
});
export default ImageViewerWidget; | 4 | 0.095238 | 2 | 2 |
12f1024d559c300c7c04256362da78ec8d3a647b | data/models.py | data/models.py | from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_length=100)
homo = models.FloatField()
lumo = models.FloatField()
homo_orbital = models.IntegerField()
energy = models.FloatField()
dipole = models.FloatField()
band_gap = models.FloatField(null=True, blank=True)
def __unicode__(self):
return self.exact_name
| import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_length=100)
homo = models.FloatField()
lumo = models.FloatField()
homo_orbital = models.IntegerField()
energy = models.FloatField()
dipole = models.FloatField()
band_gap = models.FloatField(null=True, blank=True)
def __unicode__(self):
return self.exact_name
@classmethod
def get_data(cls):
data = DataPoint.objects.filter(band_gap__isnull=False,
exact_name__isnull=False,
decay_feature__isnull=False)
M = len(data)
HOMO = numpy.zeros((M, 1))
LUMO = numpy.zeros((M, 1))
GAP = numpy.zeros((M, 1))
vectors = []
for i, x in enumerate(data):
HOMO[i] = x.homo
LUMO[i] = x.lumo
GAP[i] = x.band_gap
vectors.append(ast.literal_eval(x.decay_feature))
FEATURE = numpy.matrix(vectors)
return FEATURE, HOMO, LUMO, GAP | Add method on DataPoint to get numpy matrices with all the ML data | Add method on DataPoint to get numpy matrices with all the ML data
| Python | mit | crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp,crcollins/chemtools-webapp | python | ## Code Before:
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_length=100)
homo = models.FloatField()
lumo = models.FloatField()
homo_orbital = models.IntegerField()
energy = models.FloatField()
dipole = models.FloatField()
band_gap = models.FloatField(null=True, blank=True)
def __unicode__(self):
return self.exact_name
## Instruction:
Add method on DataPoint to get numpy matrices with all the ML data
## Code After:
import numpy
import ast
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_length=100)
homo = models.FloatField()
lumo = models.FloatField()
homo_orbital = models.IntegerField()
energy = models.FloatField()
dipole = models.FloatField()
band_gap = models.FloatField(null=True, blank=True)
def __unicode__(self):
return self.exact_name
@classmethod
def get_data(cls):
data = DataPoint.objects.filter(band_gap__isnull=False,
exact_name__isnull=False,
decay_feature__isnull=False)
M = len(data)
HOMO = numpy.zeros((M, 1))
LUMO = numpy.zeros((M, 1))
GAP = numpy.zeros((M, 1))
vectors = []
for i, x in enumerate(data):
HOMO[i] = x.homo
LUMO[i] = x.lumo
GAP[i] = x.band_gap
vectors.append(ast.literal_eval(x.decay_feature))
FEATURE = numpy.matrix(vectors)
return FEATURE, HOMO, LUMO, GAP | + import numpy
+ import ast
+
from django.db import models
class DataPoint(models.Model):
name = models.CharField(max_length=600)
exact_name = models.CharField(max_length=1000, null=True, blank=True)
decay_feature = models.CharField(max_length=1000, null=True, blank=True)
options = models.CharField(max_length=100)
homo = models.FloatField()
lumo = models.FloatField()
homo_orbital = models.IntegerField()
energy = models.FloatField()
dipole = models.FloatField()
band_gap = models.FloatField(null=True, blank=True)
def __unicode__(self):
return self.exact_name
+
+ @classmethod
+ def get_data(cls):
+ data = DataPoint.objects.filter(band_gap__isnull=False,
+ exact_name__isnull=False,
+ decay_feature__isnull=False)
+ M = len(data)
+ HOMO = numpy.zeros((M, 1))
+ LUMO = numpy.zeros((M, 1))
+ GAP = numpy.zeros((M, 1))
+ vectors = []
+ for i, x in enumerate(data):
+ HOMO[i] = x.homo
+ LUMO[i] = x.lumo
+ GAP[i] = x.band_gap
+ vectors.append(ast.literal_eval(x.decay_feature))
+ FEATURE = numpy.matrix(vectors)
+ return FEATURE, HOMO, LUMO, GAP | 21 | 1.166667 | 21 | 0 |
274c0a242ea7b0fac26dfaa1ea7e6ff8967bc9da | packer/src/packlist.yaml | packer/src/packlist.yaml | mac:
mode: exact
basedir: mac
files:
frameworks:
- Flipper.app/Contents/Frameworks/
- Flipper.app/Contents/MacOS
- Flipper.app/Contents/PkgInfo
core:
- Flipper.app/Contents/Resources
- Flipper.app/Contents/Info.plist
linux:
mode: glob
basedir: linux-unpacked
files:
frameworks:
- '!resources/'
core:
- '!*'
- resources
windows:
mode: glob
basedir: win-unpacked
files:
frameworks:
- '!resources/'
core:
- '!*'
- resources
server-mac-x64:
mode: glob
basedir: flipper-server-mac-x64
files:
frameworks:
- '!*'
- 'node'
core:
- '!node'
- '*'
| mac:
mode: exact
basedir: mac
files:
frameworks:
- Flipper.app/Contents/Frameworks/
- Flipper.app/Contents/MacOS
- Flipper.app/Contents/PkgInfo
core:
- Flipper.app/Contents/Resources
- Flipper.app/Contents/Info.plist
linux:
mode: glob
basedir: linux-unpacked
files:
frameworks:
- '!resources/'
core:
- '!*'
- resources
windows:
mode: glob
basedir: win-unpacked
files:
frameworks:
- '!resources/'
core:
- '!*'
- resources
server-mac-x64:
mode: exact
basedir: flipper-server-mac-x64
files:
frameworks:
- Flipper.app/Contents/MacOS/
- Flipper.app/Contents/PkgInfo
core:
- Flipper.app/Contents/Resources
- Flipper.app/Contents/Info.plist
| Update mac server bundle layout | Update mac server bundle layout
Summary: Take changes from D36140809 into account.
Reviewed By: aigoncharov
Differential Revision: D36206155
fbshipit-source-id: 794f8dd60e47f14acc4fb5fd9fd3d98fa5afdadf
| YAML | mit | facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper,facebook/flipper | yaml | ## Code Before:
mac:
mode: exact
basedir: mac
files:
frameworks:
- Flipper.app/Contents/Frameworks/
- Flipper.app/Contents/MacOS
- Flipper.app/Contents/PkgInfo
core:
- Flipper.app/Contents/Resources
- Flipper.app/Contents/Info.plist
linux:
mode: glob
basedir: linux-unpacked
files:
frameworks:
- '!resources/'
core:
- '!*'
- resources
windows:
mode: glob
basedir: win-unpacked
files:
frameworks:
- '!resources/'
core:
- '!*'
- resources
server-mac-x64:
mode: glob
basedir: flipper-server-mac-x64
files:
frameworks:
- '!*'
- 'node'
core:
- '!node'
- '*'
## Instruction:
Update mac server bundle layout
Summary: Take changes from D36140809 into account.
Reviewed By: aigoncharov
Differential Revision: D36206155
fbshipit-source-id: 794f8dd60e47f14acc4fb5fd9fd3d98fa5afdadf
## Code After:
mac:
mode: exact
basedir: mac
files:
frameworks:
- Flipper.app/Contents/Frameworks/
- Flipper.app/Contents/MacOS
- Flipper.app/Contents/PkgInfo
core:
- Flipper.app/Contents/Resources
- Flipper.app/Contents/Info.plist
linux:
mode: glob
basedir: linux-unpacked
files:
frameworks:
- '!resources/'
core:
- '!*'
- resources
windows:
mode: glob
basedir: win-unpacked
files:
frameworks:
- '!resources/'
core:
- '!*'
- resources
server-mac-x64:
mode: exact
basedir: flipper-server-mac-x64
files:
frameworks:
- Flipper.app/Contents/MacOS/
- Flipper.app/Contents/PkgInfo
core:
- Flipper.app/Contents/Resources
- Flipper.app/Contents/Info.plist
| mac:
mode: exact
basedir: mac
files:
frameworks:
- Flipper.app/Contents/Frameworks/
- Flipper.app/Contents/MacOS
- Flipper.app/Contents/PkgInfo
core:
- Flipper.app/Contents/Resources
- Flipper.app/Contents/Info.plist
linux:
mode: glob
basedir: linux-unpacked
files:
frameworks:
- '!resources/'
core:
- '!*'
- resources
windows:
mode: glob
basedir: win-unpacked
files:
frameworks:
- '!resources/'
core:
- '!*'
- resources
server-mac-x64:
- mode: glob
+ mode: exact
basedir: flipper-server-mac-x64
files:
frameworks:
- - '!*'
- - 'node'
+ - Flipper.app/Contents/MacOS/
+ - Flipper.app/Contents/PkgInfo
core:
- - '!node'
- - '*'
+ - Flipper.app/Contents/Resources
+ - Flipper.app/Contents/Info.plist | 10 | 0.238095 | 5 | 5 |
e762c50fba4e25c6cff3152ab499c6ff310c95ee | src/components/UserVideos.js | src/components/UserVideos.js | import React from 'react'
import {connect} from 'react-redux'
import {Link} from 'react-router-dom'
import {compose} from 'recompose'
import {updateUserVideos} from '../actions/userVideos'
import {withDatabaseSubscribe} from './hocs'
import VideoPreviewsList from './VideoPreviewsList'
const mapStateToProps = ({userVideos}) => ({
userVideos,
})
const enhanceSubs = compose(
connect(mapStateToProps),
withDatabaseSubscribe(
'value',
(props) => (`user-videos/${props.userId}`),
(props) => (snapshot) => {
props.dispatch(updateUserVideos({
userId: props.userId,
userVideosSnapshot: snapshot.val(),
}))
}
),
)
const UserVideos = ({baseUrl, isEditable, userId, userVideos}) => (
<div>
{isEditable ?
<Link to='/videos/new'>New</Link> : ''
}
<VideoPreviewsList videoIds={userVideos[userId] ? Object.keys(userVideos[userId]) : []}/>
</div>
)
export default enhanceSubs(UserVideos)
| import React from 'react'
import {connect} from 'react-redux'
import {compose, withHandlers, withProps} from 'recompose'
import {updateUserVideos} from '../actions/userVideos'
import {createVideo, VideoOwnerTypes} from '../actions/videos'
import {withDatabaseSubscribe} from './hocs'
import VideoPreviewsList from './VideoPreviewsList'
const mapStateToProps = ({userVideos}) => ({
userVideos,
})
const enhanceSubs = compose(
connect(mapStateToProps),
withProps(({match}) => ({
userId: match.params.userId
})),
withHandlers(
{
onNewVideoSubmit: props => event => {
event.preventDefault()
props.dispatch(createVideo(
{
videoOwnerType: VideoOwnerTypes.USER_VIDEO,
ownerId: props.userId
})
)
}
}
),
withDatabaseSubscribe(
'value',
(props) => (`user-videos/${props.userId}`),
(props) => (snapshot) => {
props.dispatch(updateUserVideos(
{
userId: props.userId,
userVideosSnapshot: snapshot.val(),
}))
}
),
)
const UserVideos = ({baseUrl, isEditable, onNewVideoSubmit, userId, userVideos}) => (
<div>
<form onSubmit={onNewVideoSubmit}>
<input
type='submit'
value='submit'
/>
</form>
<VideoPreviewsList videoIds={userVideos[userId] ? Object.keys(userVideos[userId]) : []}/>
</div>
)
export default enhanceSubs(UserVideos)
| Make a user create video button | Make a user create video button
| JavaScript | mit | mg4tv/mg4tv-web,mg4tv/mg4tv-web | javascript | ## Code Before:
import React from 'react'
import {connect} from 'react-redux'
import {Link} from 'react-router-dom'
import {compose} from 'recompose'
import {updateUserVideos} from '../actions/userVideos'
import {withDatabaseSubscribe} from './hocs'
import VideoPreviewsList from './VideoPreviewsList'
const mapStateToProps = ({userVideos}) => ({
userVideos,
})
const enhanceSubs = compose(
connect(mapStateToProps),
withDatabaseSubscribe(
'value',
(props) => (`user-videos/${props.userId}`),
(props) => (snapshot) => {
props.dispatch(updateUserVideos({
userId: props.userId,
userVideosSnapshot: snapshot.val(),
}))
}
),
)
const UserVideos = ({baseUrl, isEditable, userId, userVideos}) => (
<div>
{isEditable ?
<Link to='/videos/new'>New</Link> : ''
}
<VideoPreviewsList videoIds={userVideos[userId] ? Object.keys(userVideos[userId]) : []}/>
</div>
)
export default enhanceSubs(UserVideos)
## Instruction:
Make a user create video button
## Code After:
import React from 'react'
import {connect} from 'react-redux'
import {compose, withHandlers, withProps} from 'recompose'
import {updateUserVideos} from '../actions/userVideos'
import {createVideo, VideoOwnerTypes} from '../actions/videos'
import {withDatabaseSubscribe} from './hocs'
import VideoPreviewsList from './VideoPreviewsList'
const mapStateToProps = ({userVideos}) => ({
userVideos,
})
const enhanceSubs = compose(
connect(mapStateToProps),
withProps(({match}) => ({
userId: match.params.userId
})),
withHandlers(
{
onNewVideoSubmit: props => event => {
event.preventDefault()
props.dispatch(createVideo(
{
videoOwnerType: VideoOwnerTypes.USER_VIDEO,
ownerId: props.userId
})
)
}
}
),
withDatabaseSubscribe(
'value',
(props) => (`user-videos/${props.userId}`),
(props) => (snapshot) => {
props.dispatch(updateUserVideos(
{
userId: props.userId,
userVideosSnapshot: snapshot.val(),
}))
}
),
)
const UserVideos = ({baseUrl, isEditable, onNewVideoSubmit, userId, userVideos}) => (
<div>
<form onSubmit={onNewVideoSubmit}>
<input
type='submit'
value='submit'
/>
</form>
<VideoPreviewsList videoIds={userVideos[userId] ? Object.keys(userVideos[userId]) : []}/>
</div>
)
export default enhanceSubs(UserVideos)
| import React from 'react'
import {connect} from 'react-redux'
+ import {compose, withHandlers, withProps} from 'recompose'
- import {Link} from 'react-router-dom'
- import {compose} from 'recompose'
import {updateUserVideos} from '../actions/userVideos'
+ import {createVideo, VideoOwnerTypes} from '../actions/videos'
import {withDatabaseSubscribe} from './hocs'
import VideoPreviewsList from './VideoPreviewsList'
+
const mapStateToProps = ({userVideos}) => ({
userVideos,
})
const enhanceSubs = compose(
connect(mapStateToProps),
+ withProps(({match}) => ({
+ userId: match.params.userId
+ })),
+ withHandlers(
+ {
+ onNewVideoSubmit: props => event => {
+ event.preventDefault()
+ props.dispatch(createVideo(
+ {
+ videoOwnerType: VideoOwnerTypes.USER_VIDEO,
+ ownerId: props.userId
+ })
+ )
+ }
+ }
+ ),
withDatabaseSubscribe(
'value',
(props) => (`user-videos/${props.userId}`),
(props) => (snapshot) => {
- props.dispatch(updateUserVideos({
? -
+ props.dispatch(updateUserVideos(
+ {
- userId: props.userId,
+ userId: props.userId,
? ++
- userVideosSnapshot: snapshot.val(),
+ userVideosSnapshot: snapshot.val(),
? ++
- }))
+ }))
? ++
}
),
)
- const UserVideos = ({baseUrl, isEditable, userId, userVideos}) => (
+ const UserVideos = ({baseUrl, isEditable, onNewVideoSubmit, userId, userVideos}) => (
? ++++++++++++++++++
<div>
- {isEditable ?
- <Link to='/videos/new'>New</Link> : ''
- }
+ <form onSubmit={onNewVideoSubmit}>
+ <input
+ type='submit'
+ value='submit'
+ />
+ </form>
<VideoPreviewsList videoIds={userVideos[userId] ? Object.keys(userVideos[userId]) : []}/>
</div>
)
export default enhanceSubs(UserVideos) | 41 | 1.108108 | 31 | 10 |
43e1069a059330ca7acbfd2186aac1f9a952d9d4 | Compiler/U3Windows/u3/u3windows.js | Compiler/U3Windows/u3/u3windows.js | window.registerMessageListener = null;
window.sendMessage = null;
(() => {
let queue = [];
let bridgeInstance = null;
console.log(window.chrome.webview.hostObjects);
console.log(window.chrome.webview.hostObjects.u3bridge);
window.chrome.webview.hostObjects.u3bridge.then(async bridge => {
bridgeInstance = bridge;
await bridgeInstance.sendToCSharp('bridgeReady', '{}');
if (queue.length > 0) {
for (let queuedItem of queue) {
await window.sendMessage(queuedItem.type, queuedItem.payloadStr);
}
queue = null;
}
}).catch(e => {
console.log(e);
});
window.sendMessage = async (msgType, msgPayload) => {
let msgPayloadStr = JSON.stringify(msgPayload);
if (bridgeInstance !== null) {
return bridgeInstance.sendToCSharp(msgType, msgPayloadStr);
} else {
queue.push({ type: msgType, payloadStr: msgPayloadStr });
}
return Promise.of(false);
};
let listener = null;
window.registerMessageListener = (cb) => { listener = cb; };
window.csharpToJavaScript = str => {
listener(JSON.parse(str));
};
})();
| window.registerMessageListener = null;
window.sendMessage = null;
(() => {
let queue = [];
let bridgeInstance = null;
window.chrome.webview.hostObjects.u3bridge.then(async bridge => {
bridgeInstance = bridge;
await bridgeInstance.sendToCSharp('bridgeReady', '{}');
if (queue.length > 0) {
for (let queuedItem of queue) {
await window.sendMessage(queuedItem.type, queuedItem.payloadStr);
}
queue = null;
}
}).catch(e => {
console.log(e);
});
window.sendMessage = async (msgType, msgPayload) => {
let msgPayloadStr = JSON.stringify(msgPayload);
if (bridgeInstance !== null) {
return bridgeInstance.sendToCSharp(msgType, msgPayloadStr);
} else {
queue.push({ type: msgType, payloadStr: msgPayloadStr });
}
return Promise.of(false);
};
let listener = null;
window.registerMessageListener = (cb) => { listener = cb; };
window.csharpToJavaScript = str => {
listener(JSON.parse(str));
};
})();
| Remove a couple of leftover debug console.logs | Remove a couple of leftover debug console.logs
| JavaScript | mit | blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon,blakeohare/crayon | javascript | ## Code Before:
window.registerMessageListener = null;
window.sendMessage = null;
(() => {
let queue = [];
let bridgeInstance = null;
console.log(window.chrome.webview.hostObjects);
console.log(window.chrome.webview.hostObjects.u3bridge);
window.chrome.webview.hostObjects.u3bridge.then(async bridge => {
bridgeInstance = bridge;
await bridgeInstance.sendToCSharp('bridgeReady', '{}');
if (queue.length > 0) {
for (let queuedItem of queue) {
await window.sendMessage(queuedItem.type, queuedItem.payloadStr);
}
queue = null;
}
}).catch(e => {
console.log(e);
});
window.sendMessage = async (msgType, msgPayload) => {
let msgPayloadStr = JSON.stringify(msgPayload);
if (bridgeInstance !== null) {
return bridgeInstance.sendToCSharp(msgType, msgPayloadStr);
} else {
queue.push({ type: msgType, payloadStr: msgPayloadStr });
}
return Promise.of(false);
};
let listener = null;
window.registerMessageListener = (cb) => { listener = cb; };
window.csharpToJavaScript = str => {
listener(JSON.parse(str));
};
})();
## Instruction:
Remove a couple of leftover debug console.logs
## Code After:
window.registerMessageListener = null;
window.sendMessage = null;
(() => {
let queue = [];
let bridgeInstance = null;
window.chrome.webview.hostObjects.u3bridge.then(async bridge => {
bridgeInstance = bridge;
await bridgeInstance.sendToCSharp('bridgeReady', '{}');
if (queue.length > 0) {
for (let queuedItem of queue) {
await window.sendMessage(queuedItem.type, queuedItem.payloadStr);
}
queue = null;
}
}).catch(e => {
console.log(e);
});
window.sendMessage = async (msgType, msgPayload) => {
let msgPayloadStr = JSON.stringify(msgPayload);
if (bridgeInstance !== null) {
return bridgeInstance.sendToCSharp(msgType, msgPayloadStr);
} else {
queue.push({ type: msgType, payloadStr: msgPayloadStr });
}
return Promise.of(false);
};
let listener = null;
window.registerMessageListener = (cb) => { listener = cb; };
window.csharpToJavaScript = str => {
listener(JSON.parse(str));
};
})();
| window.registerMessageListener = null;
window.sendMessage = null;
(() => {
let queue = [];
let bridgeInstance = null;
- console.log(window.chrome.webview.hostObjects);
- console.log(window.chrome.webview.hostObjects.u3bridge);
window.chrome.webview.hostObjects.u3bridge.then(async bridge => {
bridgeInstance = bridge;
await bridgeInstance.sendToCSharp('bridgeReady', '{}');
if (queue.length > 0) {
for (let queuedItem of queue) {
await window.sendMessage(queuedItem.type, queuedItem.payloadStr);
}
queue = null;
}
}).catch(e => {
console.log(e);
});
window.sendMessage = async (msgType, msgPayload) => {
let msgPayloadStr = JSON.stringify(msgPayload);
if (bridgeInstance !== null) {
return bridgeInstance.sendToCSharp(msgType, msgPayloadStr);
} else {
queue.push({ type: msgType, payloadStr: msgPayloadStr });
}
return Promise.of(false);
};
let listener = null;
window.registerMessageListener = (cb) => { listener = cb; };
window.csharpToJavaScript = str => {
listener(JSON.parse(str));
};
})(); | 2 | 0.051282 | 0 | 2 |
c725f1d9206e251cd6a21726ca9985f5a8ebb877 | src/third_party/stlplus3/CMakeLists.txt | src/third_party/stlplus3/CMakeLists.txt | project(stlplus C CXX)
file(GLOB LIBSLTPLUS_HPP_FILESYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/filesystemSimplified/*.hpp" )
file(GLOB LIBSLTPLUS_CPP_FILESYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/filesystemSimplified/*.cpp" )
list(APPEND LIBSLTPLUS_SRCS
${LIBSLTPLUS_HPP_FILESYSTEM} ${LIBSLTPLUS_CPP_FILESYSTEM})
add_library(openMVG_stlplus ${LIBSLTPLUS_SRCS})
target_include_directories(openMVG_stlplus PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/stlplus>)
set_property(TARGET openMVG_stlplus PROPERTY FOLDER OpenMVG/3rdParty)
install(
TARGETS openMVG_stlplus
DESTINATION lib
EXPORT openMVG-targets
)
if(STLPLUS_INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR ${STLPLUS_INCLUDE_INSTALL_DIR})
else()
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/stlplus")
endif()
install(
DIRECTORY ./filesystemSimplified
DESTINATION ${INCLUDE_INSTALL_DIR}
COMPONENT headers
FILES_MATCHING PATTERN "*.hpp"
)
| project(stlplus C CXX)
file(GLOB LIBSLTPLUS_HPP_FILESYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/filesystemSimplified/*.hpp" )
file(GLOB LIBSLTPLUS_CPP_FILESYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/filesystemSimplified/*.cpp" )
list(APPEND LIBSLTPLUS_SRCS
${LIBSLTPLUS_HPP_FILESYSTEM} ${LIBSLTPLUS_CPP_FILESYSTEM})
add_library(openMVG_stlplus ${LIBSLTPLUS_SRCS})
if(STLPLUS_INCLUDE_INSTALL_DIR)
target_include_directories(openMVG_stlplus PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/openMVG>
$<INSTALL_INTERFACE:${STLPLUS_INCLUDE_INSTALL_DIR}>/filesystemSimplified)
else()
target_include_directories(openMVG_stlplus PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/stlplus>)
endif()
set_property(TARGET openMVG_stlplus PROPERTY FOLDER OpenMVG/3rdParty)
install(
TARGETS openMVG_stlplus
DESTINATION lib
EXPORT openMVG-targets
)
if(STLPLUS_INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR ${STLPLUS_INCLUDE_INSTALL_DIR})
else()
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/stlplus")
endif()
install(
DIRECTORY ./filesystemSimplified
DESTINATION ${INCLUDE_INSTALL_DIR}
COMPONENT headers
FILES_MATCHING PATTERN "*.hpp"
)
| Enhance the transitive stlplus include path. | [build] Enhance the transitive stlplus include path.
| Text | mpl-2.0 | openMVG/openMVG,openMVG/openMVG,openMVG/openMVG,openMVG/openMVG,openMVG/openMVG | text | ## Code Before:
project(stlplus C CXX)
file(GLOB LIBSLTPLUS_HPP_FILESYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/filesystemSimplified/*.hpp" )
file(GLOB LIBSLTPLUS_CPP_FILESYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/filesystemSimplified/*.cpp" )
list(APPEND LIBSLTPLUS_SRCS
${LIBSLTPLUS_HPP_FILESYSTEM} ${LIBSLTPLUS_CPP_FILESYSTEM})
add_library(openMVG_stlplus ${LIBSLTPLUS_SRCS})
target_include_directories(openMVG_stlplus PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/stlplus>)
set_property(TARGET openMVG_stlplus PROPERTY FOLDER OpenMVG/3rdParty)
install(
TARGETS openMVG_stlplus
DESTINATION lib
EXPORT openMVG-targets
)
if(STLPLUS_INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR ${STLPLUS_INCLUDE_INSTALL_DIR})
else()
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/stlplus")
endif()
install(
DIRECTORY ./filesystemSimplified
DESTINATION ${INCLUDE_INSTALL_DIR}
COMPONENT headers
FILES_MATCHING PATTERN "*.hpp"
)
## Instruction:
[build] Enhance the transitive stlplus include path.
## Code After:
project(stlplus C CXX)
file(GLOB LIBSLTPLUS_HPP_FILESYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/filesystemSimplified/*.hpp" )
file(GLOB LIBSLTPLUS_CPP_FILESYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/filesystemSimplified/*.cpp" )
list(APPEND LIBSLTPLUS_SRCS
${LIBSLTPLUS_HPP_FILESYSTEM} ${LIBSLTPLUS_CPP_FILESYSTEM})
add_library(openMVG_stlplus ${LIBSLTPLUS_SRCS})
if(STLPLUS_INCLUDE_INSTALL_DIR)
target_include_directories(openMVG_stlplus PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/openMVG>
$<INSTALL_INTERFACE:${STLPLUS_INCLUDE_INSTALL_DIR}>/filesystemSimplified)
else()
target_include_directories(openMVG_stlplus PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/stlplus>)
endif()
set_property(TARGET openMVG_stlplus PROPERTY FOLDER OpenMVG/3rdParty)
install(
TARGETS openMVG_stlplus
DESTINATION lib
EXPORT openMVG-targets
)
if(STLPLUS_INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR ${STLPLUS_INCLUDE_INSTALL_DIR})
else()
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/stlplus")
endif()
install(
DIRECTORY ./filesystemSimplified
DESTINATION ${INCLUDE_INSTALL_DIR}
COMPONENT headers
FILES_MATCHING PATTERN "*.hpp"
)
| project(stlplus C CXX)
file(GLOB LIBSLTPLUS_HPP_FILESYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/filesystemSimplified/*.hpp" )
file(GLOB LIBSLTPLUS_CPP_FILESYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/filesystemSimplified/*.cpp" )
list(APPEND LIBSLTPLUS_SRCS
${LIBSLTPLUS_HPP_FILESYSTEM} ${LIBSLTPLUS_CPP_FILESYSTEM})
add_library(openMVG_stlplus ${LIBSLTPLUS_SRCS})
+ if(STLPLUS_INCLUDE_INSTALL_DIR)
- target_include_directories(openMVG_stlplus PUBLIC
+ target_include_directories(openMVG_stlplus PUBLIC
? ++
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
? ++
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/openMVG>
+ $<INSTALL_INTERFACE:${STLPLUS_INCLUDE_INSTALL_DIR}>/filesystemSimplified)
+ else()
+ target_include_directories(openMVG_stlplus PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/stlplus>)
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include/stlplus>)
? ++
+ endif()
set_property(TARGET openMVG_stlplus PROPERTY FOLDER OpenMVG/3rdParty)
install(
TARGETS openMVG_stlplus
DESTINATION lib
EXPORT openMVG-targets
)
if(STLPLUS_INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR ${STLPLUS_INCLUDE_INSTALL_DIR})
else()
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include/stlplus")
endif()
install(
DIRECTORY ./filesystemSimplified
DESTINATION ${INCLUDE_INSTALL_DIR}
COMPONENT headers
FILES_MATCHING PATTERN "*.hpp"
) | 13 | 0.40625 | 10 | 3 |
c6af73103ef0f77a0c86ce4058c6e44c6a724dc4 | bin/diff2marked.bash | bin/diff2marked.bash |
cat - > /dev/null
cd $MARKED_ORIGIN
git diff --no-color --word-diff -U99999 -- $MARKED_PATH |
sed -e '1,5d;s/ *{[-\.].*}$//g;s/\[-/{--/g;s/-\]/--}/g;s/{\+/{++/g;s/\+}/++}/g'
|
cd $MARKED_ORIGIN
if git diff --quiet -- $MARKED_PATH; then
cat -
exit
else
cat - > /dev/null
git diff --no-color --word-diff -U99999 -- $MARKED_PATH |
sed -e '1,5d;s/ *{[-\.].*}$//g;s/\[-/{--/g;s/-\]/--}/g;s/{\+/{++/g;s/\+}/++}/g'
fi
| Handle case of no differences in diff preprocessor | Handle case of no differences in diff preprocessor
| Shell | agpl-3.0 | alerque/casile,alerque/casile,alerque/casile,alerque/casile,alerque/casile | shell | ## Code Before:
cat - > /dev/null
cd $MARKED_ORIGIN
git diff --no-color --word-diff -U99999 -- $MARKED_PATH |
sed -e '1,5d;s/ *{[-\.].*}$//g;s/\[-/{--/g;s/-\]/--}/g;s/{\+/{++/g;s/\+}/++}/g'
## Instruction:
Handle case of no differences in diff preprocessor
## Code After:
cd $MARKED_ORIGIN
if git diff --quiet -- $MARKED_PATH; then
cat -
exit
else
cat - > /dev/null
git diff --no-color --word-diff -U99999 -- $MARKED_PATH |
sed -e '1,5d;s/ *{[-\.].*}$//g;s/\[-/{--/g;s/-\]/--}/g;s/{\+/{++/g;s/\+}/++}/g'
fi
|
- cat - > /dev/null
cd $MARKED_ORIGIN
+ if git diff --quiet -- $MARKED_PATH; then
+ cat -
+ exit
+ else
+ cat - > /dev/null
- git diff --no-color --word-diff -U99999 -- $MARKED_PATH |
+ git diff --no-color --word-diff -U99999 -- $MARKED_PATH |
? ++++
- sed -e '1,5d;s/ *{[-\.].*}$//g;s/\[-/{--/g;s/-\]/--}/g;s/{\+/{++/g;s/\+}/++}/g'
? ^
+ sed -e '1,5d;s/ *{[-\.].*}$//g;s/\[-/{--/g;s/-\]/--}/g;s/{\+/{++/g;s/\+}/++}/g'
? ^^^^^^^^
+ fi | 11 | 2.2 | 8 | 3 |
e3828ae72ae778461eee9b93ccc87167505f91f8 | validate.py | validate.py | """Check for inconsistancies in the database."""
from server.db import BuildingBuilder, BuildingType, load, UnitType
def main():
load()
for name in UnitType.resource_names():
if UnitType.count(getattr(UnitType, name) == 1):
continue
else:
print(f'There is no unit that can gather {name}.')
for bt in BuildingType.all():
if not BuildingBuilder.count(building_type_id=bt.id):
print(f'There is no way to build {bt.name}.')
if __name__ == '__main__':
try:
main()
except FileNotFoundError:
print('No database file exists.')
| """Check for inconsistancies in the database."""
from server.db import (
BuildingBuilder, BuildingRecruit, BuildingType, load, UnitType
)
def main():
load()
for name in UnitType.resource_names():
if UnitType.count(getattr(UnitType, name) >= 1):
continue
else:
print(f'There is no unit that can gather {name}.')
for bt in BuildingType.all():
if not BuildingBuilder.count(building_type_id=bt.id):
print(f'There is no way to build {bt.name}.')
for ut in UnitType.all():
if not BuildingRecruit.count(unit_type_id=ut.id):
print(f'There is no way to recruit {ut.get_name()}.')
if __name__ == '__main__':
try:
main()
except FileNotFoundError:
print('No database file exists.')
| Make sure all unit types can be recruited. | Make sure all unit types can be recruited.
| Python | mpl-2.0 | chrisnorman7/pyrts,chrisnorman7/pyrts,chrisnorman7/pyrts | python | ## Code Before:
"""Check for inconsistancies in the database."""
from server.db import BuildingBuilder, BuildingType, load, UnitType
def main():
load()
for name in UnitType.resource_names():
if UnitType.count(getattr(UnitType, name) == 1):
continue
else:
print(f'There is no unit that can gather {name}.')
for bt in BuildingType.all():
if not BuildingBuilder.count(building_type_id=bt.id):
print(f'There is no way to build {bt.name}.')
if __name__ == '__main__':
try:
main()
except FileNotFoundError:
print('No database file exists.')
## Instruction:
Make sure all unit types can be recruited.
## Code After:
"""Check for inconsistancies in the database."""
from server.db import (
BuildingBuilder, BuildingRecruit, BuildingType, load, UnitType
)
def main():
load()
for name in UnitType.resource_names():
if UnitType.count(getattr(UnitType, name) >= 1):
continue
else:
print(f'There is no unit that can gather {name}.')
for bt in BuildingType.all():
if not BuildingBuilder.count(building_type_id=bt.id):
print(f'There is no way to build {bt.name}.')
for ut in UnitType.all():
if not BuildingRecruit.count(unit_type_id=ut.id):
print(f'There is no way to recruit {ut.get_name()}.')
if __name__ == '__main__':
try:
main()
except FileNotFoundError:
print('No database file exists.')
| """Check for inconsistancies in the database."""
- from server.db import BuildingBuilder, BuildingType, load, UnitType
+ from server.db import (
+ BuildingBuilder, BuildingRecruit, BuildingType, load, UnitType
+ )
def main():
load()
for name in UnitType.resource_names():
- if UnitType.count(getattr(UnitType, name) == 1):
? ^
+ if UnitType.count(getattr(UnitType, name) >= 1):
? ^
continue
else:
print(f'There is no unit that can gather {name}.')
for bt in BuildingType.all():
if not BuildingBuilder.count(building_type_id=bt.id):
print(f'There is no way to build {bt.name}.')
+ for ut in UnitType.all():
+ if not BuildingRecruit.count(unit_type_id=ut.id):
+ print(f'There is no way to recruit {ut.get_name()}.')
if __name__ == '__main__':
try:
main()
except FileNotFoundError:
print('No database file exists.') | 9 | 0.409091 | 7 | 2 |
2c144d327c84875887fd1b22fa5418224c987c6d | Model.hs | Model.hs | {-# LANGUAGE TemplateHaskell, QuasiQuotes, TypeFamilies, GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
module Model where
import Prelude
import Yesod
import Data.Text (Text)
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
-- http://www.yesodweb.com/book/persistent/
share [mkPersist sqlSettings, mkMigrate "migrateAll"] $(persistFile "config/models")
data Sex = None | Male | Female
deriving (Show, Read, Eq, Ord, Enum, Bounded)
derivePersistField "Sex"
| {-# LANGUAGE TemplateHaskell, QuasiQuotes, TypeFamilies, GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Model where
import Prelude
import Yesod
import Data.Text (Text)
import Text.Blaze (ToHtml(toHtml))
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
-- http://www.yesodweb.com/book/persistent/
share [mkPersist sqlSettings, mkMigrate "migrateAll"] $(persistFile "config/models")
data Sex = None | Male | Female
deriving (Show, Read, Eq, Ord, Enum, Bounded)
derivePersistField "Sex"
instance ToHtml Sex where
toHtml = toHtml . show
| Declare ToHtml instance for Sex (compilation pass on cabal but failed on cabal-dev) | Declare ToHtml instance for Sex (compilation pass on cabal but failed on cabal-dev)
| Haskell | bsd-2-clause | cutsea110/tut | haskell | ## Code Before:
{-# LANGUAGE TemplateHaskell, QuasiQuotes, TypeFamilies, GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
module Model where
import Prelude
import Yesod
import Data.Text (Text)
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
-- http://www.yesodweb.com/book/persistent/
share [mkPersist sqlSettings, mkMigrate "migrateAll"] $(persistFile "config/models")
data Sex = None | Male | Female
deriving (Show, Read, Eq, Ord, Enum, Bounded)
derivePersistField "Sex"
## Instruction:
Declare ToHtml instance for Sex (compilation pass on cabal but failed on cabal-dev)
## Code After:
{-# LANGUAGE TemplateHaskell, QuasiQuotes, TypeFamilies, GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
module Model where
import Prelude
import Yesod
import Data.Text (Text)
import Text.Blaze (ToHtml(toHtml))
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
-- http://www.yesodweb.com/book/persistent/
share [mkPersist sqlSettings, mkMigrate "migrateAll"] $(persistFile "config/models")
data Sex = None | Male | Female
deriving (Show, Read, Eq, Ord, Enum, Bounded)
derivePersistField "Sex"
instance ToHtml Sex where
toHtml = toHtml . show
| {-# LANGUAGE TemplateHaskell, QuasiQuotes, TypeFamilies, GADTs #-}
{-# LANGUAGE FlexibleContexts #-}
+ {-# LANGUAGE OverloadedStrings #-}
module Model where
import Prelude
import Yesod
import Data.Text (Text)
+ import Text.Blaze (ToHtml(toHtml))
-- You can define all of your database entities in the entities file.
-- You can find more information on persistent and how to declare entities
-- at:
-- http://www.yesodweb.com/book/persistent/
share [mkPersist sqlSettings, mkMigrate "migrateAll"] $(persistFile "config/models")
data Sex = None | Male | Female
deriving (Show, Read, Eq, Ord, Enum, Bounded)
derivePersistField "Sex"
+
+ instance ToHtml Sex where
+ toHtml = toHtml . show | 5 | 0.277778 | 5 | 0 |
23331ac06f363d2d32beda7c94878981a8340dc2 | lib/nehm/commands/search_command.rb | lib/nehm/commands/search_command.rb | require 'nehm/tracks_view_command'
module Nehm
class SearchCommand < TracksViewCommand
def initialize
super
end
def execute
@query = @options[:args].join(' ')
super
end
def arguments
{ 'QUERY' => 'Search query' }
end
def program_name
'nehm search'
end
def summary
'Search tracks, print them nicely and download selected tracks'
end
def usage
"#{program_name} QUERY [OPTIONS]"
end
protected
def get_tracks
UI.term 'You must provide an argument' if @query.empty?
@track_manager.search(@query, @limit, @offset)
end
end
end
| require 'nehm/tracks_view_command'
module Nehm
class SearchCommand < TracksViewCommand
def initialize
super
add_option(:"-t", '-t PATH',
'Download track(s) to PATH')
add_option(:"-pl", '-pl PLAYLIST',
'Add track(s) to iTunes playlist with PLAYLIST name')
add_option(:"-lim", '-lim NUMBER',
'Show NUMBER tracks on each page')
end
def execute
# Convert dash-options to normal options
options_to_convert = { :"-t" => :to,
:"-pl" => :pl,
:"-lim" => :limit }
options_to_convert.each do |k,v|
value = @options[k]
@options.delete(k)
@options[v] = value unless value.nil?
end
@query = @options[:args].join(' ')
super
end
def arguments
{ 'QUERY' => 'Search query' }
end
def program_name
'nehm search'
end
def summary
'Search tracks, print them nicely and download selected tracks'
end
def usage
"#{program_name} QUERY [OPTIONS]"
end
protected
def get_tracks
UI.term 'You must provide an argument' if @query.empty?
@track_manager.search(@query, @limit)
end
end
end
| Use dash-options in search command | Use dash-options in search command
| Ruby | mit | bogem/nehm | ruby | ## Code Before:
require 'nehm/tracks_view_command'
module Nehm
class SearchCommand < TracksViewCommand
def initialize
super
end
def execute
@query = @options[:args].join(' ')
super
end
def arguments
{ 'QUERY' => 'Search query' }
end
def program_name
'nehm search'
end
def summary
'Search tracks, print them nicely and download selected tracks'
end
def usage
"#{program_name} QUERY [OPTIONS]"
end
protected
def get_tracks
UI.term 'You must provide an argument' if @query.empty?
@track_manager.search(@query, @limit, @offset)
end
end
end
## Instruction:
Use dash-options in search command
## Code After:
require 'nehm/tracks_view_command'
module Nehm
class SearchCommand < TracksViewCommand
def initialize
super
add_option(:"-t", '-t PATH',
'Download track(s) to PATH')
add_option(:"-pl", '-pl PLAYLIST',
'Add track(s) to iTunes playlist with PLAYLIST name')
add_option(:"-lim", '-lim NUMBER',
'Show NUMBER tracks on each page')
end
def execute
# Convert dash-options to normal options
options_to_convert = { :"-t" => :to,
:"-pl" => :pl,
:"-lim" => :limit }
options_to_convert.each do |k,v|
value = @options[k]
@options.delete(k)
@options[v] = value unless value.nil?
end
@query = @options[:args].join(' ')
super
end
def arguments
{ 'QUERY' => 'Search query' }
end
def program_name
'nehm search'
end
def summary
'Search tracks, print them nicely and download selected tracks'
end
def usage
"#{program_name} QUERY [OPTIONS]"
end
protected
def get_tracks
UI.term 'You must provide an argument' if @query.empty?
@track_manager.search(@query, @limit)
end
end
end
| require 'nehm/tracks_view_command'
module Nehm
class SearchCommand < TracksViewCommand
def initialize
super
+
+ add_option(:"-t", '-t PATH',
+ 'Download track(s) to PATH')
+
+ add_option(:"-pl", '-pl PLAYLIST',
+ 'Add track(s) to iTunes playlist with PLAYLIST name')
+
+ add_option(:"-lim", '-lim NUMBER',
+ 'Show NUMBER tracks on each page')
+
end
def execute
+ # Convert dash-options to normal options
+ options_to_convert = { :"-t" => :to,
+ :"-pl" => :pl,
+ :"-lim" => :limit }
+
+ options_to_convert.each do |k,v|
+ value = @options[k]
+ @options.delete(k)
+ @options[v] = value unless value.nil?
+ end
+
@query = @options[:args].join(' ')
super
end
def arguments
{ 'QUERY' => 'Search query' }
end
def program_name
'nehm search'
end
def summary
'Search tracks, print them nicely and download selected tracks'
end
def usage
"#{program_name} QUERY [OPTIONS]"
end
protected
def get_tracks
UI.term 'You must provide an argument' if @query.empty?
- @track_manager.search(@query, @limit, @offset)
? ---------
+ @track_manager.search(@query, @limit)
end
end
end | 23 | 0.560976 | 22 | 1 |
2b2a7c8b95155559d28138c9f2c62e7b5048b6ea | gateway/ci/make_tarball.sh | gateway/ci/make_tarball.sh |
set -e
SCRIPT_LOCATION=$(cd "$(dirname "$0")"; pwd)
if [ $# -lt 1 ]; then
echo "Usage: $0 <CernVM-FS source directory (the same as the build directory)>"
echo "This script builds packages for the current platform."
exit 1
fi
CVMFS_BUILD_LOCATION="$1"
shift 1
# run the build script
echo "switching to $CVMFS_BUILD_LOCATION..."
cd "$CVMFS_BUILD_LOCATION"
set +e
rebar3 as prod compile
cd _build/prod/lib/syslog
./rebar compile
cd -
rebar3 as prod release,tar
set -e
REPO_SERVICES_VERSION=$(grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+" apps/cvmfs_services/src/cvmfs_services.app.src)
mkdir -p $CVMFS_BUILD_LOCATION/tarballs
cp -v _build/prod/rel/cvmfs_services/cvmfs_services-$REPO_SERVICES_VERSION.tar.gz \
$CVMFS_BUILD_LOCATION/tarballs/cvmfs_services-$REPO_SERVICES_VERSION-$CVMFS_BUILD_PLATFORM-x86_64.tar.gz
|
set -e
SCRIPT_LOCATION=$(cd "$(dirname "$0")"; pwd)
if [ $# -lt 1 ]; then
echo "Usage: $0 <CernVM-FS source directory (the same as the build directory)>"
echo "This script builds packages for the current platform."
exit 1
fi
CVMFS_BUILD_LOCATION="$1"
shift 1
export REBAR_CACHE_DIR=$WORKSPACE
# run the build script
echo "switching to $CVMFS_BUILD_LOCATION..."
cd "$CVMFS_BUILD_LOCATION"
rebar3 as prod compile
cd _build/prod/lib/syslog
./rebar compile
cd -
rebar3 as prod release,tar
REPO_SERVICES_VERSION=$(grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+" apps/cvmfs_services/src/cvmfs_services.app.src)
mkdir -p $CVMFS_BUILD_LOCATION/tarballs
cp -v _build/prod/rel/cvmfs_services/cvmfs_services-$REPO_SERVICES_VERSION.tar.gz \
$CVMFS_BUILD_LOCATION/tarballs/cvmfs_services-$REPO_SERVICES_VERSION-$CVMFS_BUILD_PLATFORM-x86_64.tar.gz
| Set REBAR_CACHE_DIR to root of CI workspace | Set REBAR_CACHE_DIR to root of CI workspace
| Shell | bsd-3-clause | DrDaveD/cvmfs,DrDaveD/cvmfs,cvmfs/cvmfs,cvmfs/cvmfs,cvmfs/cvmfs,cvmfs/cvmfs,DrDaveD/cvmfs,DrDaveD/cvmfs,DrDaveD/cvmfs,cvmfs/cvmfs,DrDaveD/cvmfs,cvmfs/cvmfs,cvmfs/cvmfs,DrDaveD/cvmfs | shell | ## Code Before:
set -e
SCRIPT_LOCATION=$(cd "$(dirname "$0")"; pwd)
if [ $# -lt 1 ]; then
echo "Usage: $0 <CernVM-FS source directory (the same as the build directory)>"
echo "This script builds packages for the current platform."
exit 1
fi
CVMFS_BUILD_LOCATION="$1"
shift 1
# run the build script
echo "switching to $CVMFS_BUILD_LOCATION..."
cd "$CVMFS_BUILD_LOCATION"
set +e
rebar3 as prod compile
cd _build/prod/lib/syslog
./rebar compile
cd -
rebar3 as prod release,tar
set -e
REPO_SERVICES_VERSION=$(grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+" apps/cvmfs_services/src/cvmfs_services.app.src)
mkdir -p $CVMFS_BUILD_LOCATION/tarballs
cp -v _build/prod/rel/cvmfs_services/cvmfs_services-$REPO_SERVICES_VERSION.tar.gz \
$CVMFS_BUILD_LOCATION/tarballs/cvmfs_services-$REPO_SERVICES_VERSION-$CVMFS_BUILD_PLATFORM-x86_64.tar.gz
## Instruction:
Set REBAR_CACHE_DIR to root of CI workspace
## Code After:
set -e
SCRIPT_LOCATION=$(cd "$(dirname "$0")"; pwd)
if [ $# -lt 1 ]; then
echo "Usage: $0 <CernVM-FS source directory (the same as the build directory)>"
echo "This script builds packages for the current platform."
exit 1
fi
CVMFS_BUILD_LOCATION="$1"
shift 1
export REBAR_CACHE_DIR=$WORKSPACE
# run the build script
echo "switching to $CVMFS_BUILD_LOCATION..."
cd "$CVMFS_BUILD_LOCATION"
rebar3 as prod compile
cd _build/prod/lib/syslog
./rebar compile
cd -
rebar3 as prod release,tar
REPO_SERVICES_VERSION=$(grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+" apps/cvmfs_services/src/cvmfs_services.app.src)
mkdir -p $CVMFS_BUILD_LOCATION/tarballs
cp -v _build/prod/rel/cvmfs_services/cvmfs_services-$REPO_SERVICES_VERSION.tar.gz \
$CVMFS_BUILD_LOCATION/tarballs/cvmfs_services-$REPO_SERVICES_VERSION-$CVMFS_BUILD_PLATFORM-x86_64.tar.gz
|
set -e
SCRIPT_LOCATION=$(cd "$(dirname "$0")"; pwd)
if [ $# -lt 1 ]; then
echo "Usage: $0 <CernVM-FS source directory (the same as the build directory)>"
echo "This script builds packages for the current platform."
exit 1
fi
CVMFS_BUILD_LOCATION="$1"
shift 1
+ export REBAR_CACHE_DIR=$WORKSPACE
+
# run the build script
echo "switching to $CVMFS_BUILD_LOCATION..."
cd "$CVMFS_BUILD_LOCATION"
- set +e
rebar3 as prod compile
cd _build/prod/lib/syslog
./rebar compile
cd -
rebar3 as prod release,tar
- set -e
REPO_SERVICES_VERSION=$(grep -o "[0-9]\+\.[0-9]\+\.[0-9]\+" apps/cvmfs_services/src/cvmfs_services.app.src)
mkdir -p $CVMFS_BUILD_LOCATION/tarballs
cp -v _build/prod/rel/cvmfs_services/cvmfs_services-$REPO_SERVICES_VERSION.tar.gz \
$CVMFS_BUILD_LOCATION/tarballs/cvmfs_services-$REPO_SERVICES_VERSION-$CVMFS_BUILD_PLATFORM-x86_64.tar.gz | 4 | 0.142857 | 2 | 2 |
765e407b2f96bcad75a7c4dbe07f53d4fdd7a5d4 | README.txt | README.txt | The LLVM Compiler Infrastructure
================================
This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.
LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.
Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.
If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.
|
The swift-llvm repository is frozen and is preserved for historical purposes only.
Active development is now happening in the following repository: https://github.com/apple/llvm-project.
The LLVM Compiler Infrastructure
================================
This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.
LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.
Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.
If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.
| Update readme to point to monorepo | Update readme to point to monorepo | Text | apache-2.0 | apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm | text | ## Code Before:
The LLVM Compiler Infrastructure
================================
This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.
LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.
Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.
If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.
## Instruction:
Update readme to point to monorepo
## Code After:
The swift-llvm repository is frozen and is preserved for historical purposes only.
Active development is now happening in the following repository: https://github.com/apple/llvm-project.
The LLVM Compiler Infrastructure
================================
This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.
LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.
Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.
If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.
| +
+ The swift-llvm repository is frozen and is preserved for historical purposes only.
+ Active development is now happening in the following repository: https://github.com/apple/llvm-project.
+
The LLVM Compiler Infrastructure
================================
This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.
LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.
Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.
If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions. | 4 | 0.235294 | 4 | 0 |
712bd9ee6b06d0964f53418fe7cb338d35f59ed1 | certbot-nginx/tests/boulder-integration.sh | certbot-nginx/tests/boulder-integration.sh |
. ./tests/integration/_common.sh
export PATH="/usr/sbin:$PATH" # /usr/sbin/nginx
nginx_root="$root/nginx"
mkdir $nginx_root
root="$nginx_root" ./certbot-nginx/tests/boulder-integration.conf.sh > $nginx_root/nginx.conf
killall nginx || true
nginx -c $nginx_root/nginx.conf
certbot_test_nginx () {
certbot_test \
--configurator nginx \
--nginx-server-root $nginx_root \
"$@"
}
certbot_test_nginx --domains nginx.wtf run
echo | openssl s_client -connect localhost:5001 \
| openssl x509 -out $root/nginx.pem
diff -q $root/nginx.pem $root/conf/live/nginx.wtf/cert.pem
# note: not reached if anything above fails, hence "killall" at the
# top
nginx -c $nginx_root/nginx.conf -s stop
|
. ./tests/integration/_common.sh
export PATH="/usr/sbin:$PATH" # /usr/sbin/nginx
nginx_root="$root/nginx"
mkdir $nginx_root
root="$nginx_root" ./certbot-nginx/tests/boulder-integration.conf.sh > $nginx_root/nginx.conf
cp certbot-nginx/certbot_nginx/options-ssl-nginx.conf $nginx_root
killall nginx || true
nginx -c $nginx_root/nginx.conf
certbot_test_nginx () {
certbot_test \
--configurator nginx \
--nginx-server-root $nginx_root \
"$@"
}
certbot_test_nginx --domains nginx.wtf run
echo | openssl s_client -connect localhost:5001 \
| openssl x509 -out $root/nginx.pem
diff -q $root/nginx.pem $root/conf/live/nginx.wtf/cert.pem
# note: not reached if anything above fails, hence "killall" at the
# top
nginx -c $nginx_root/nginx.conf -s stop
| Copy nginx options file into integration testing environment | Copy nginx options file into integration testing environment
| Shell | apache-2.0 | stweil/letsencrypt,lmcro/letsencrypt,stweil/letsencrypt,jsha/letsencrypt,bsmr-misc-forks/letsencrypt,letsencrypt/letsencrypt,bsmr-misc-forks/letsencrypt,jtl999/certbot,lmcro/letsencrypt,jtl999/certbot,jsha/letsencrypt,letsencrypt/letsencrypt | shell | ## Code Before:
. ./tests/integration/_common.sh
export PATH="/usr/sbin:$PATH" # /usr/sbin/nginx
nginx_root="$root/nginx"
mkdir $nginx_root
root="$nginx_root" ./certbot-nginx/tests/boulder-integration.conf.sh > $nginx_root/nginx.conf
killall nginx || true
nginx -c $nginx_root/nginx.conf
certbot_test_nginx () {
certbot_test \
--configurator nginx \
--nginx-server-root $nginx_root \
"$@"
}
certbot_test_nginx --domains nginx.wtf run
echo | openssl s_client -connect localhost:5001 \
| openssl x509 -out $root/nginx.pem
diff -q $root/nginx.pem $root/conf/live/nginx.wtf/cert.pem
# note: not reached if anything above fails, hence "killall" at the
# top
nginx -c $nginx_root/nginx.conf -s stop
## Instruction:
Copy nginx options file into integration testing environment
## Code After:
. ./tests/integration/_common.sh
export PATH="/usr/sbin:$PATH" # /usr/sbin/nginx
nginx_root="$root/nginx"
mkdir $nginx_root
root="$nginx_root" ./certbot-nginx/tests/boulder-integration.conf.sh > $nginx_root/nginx.conf
cp certbot-nginx/certbot_nginx/options-ssl-nginx.conf $nginx_root
killall nginx || true
nginx -c $nginx_root/nginx.conf
certbot_test_nginx () {
certbot_test \
--configurator nginx \
--nginx-server-root $nginx_root \
"$@"
}
certbot_test_nginx --domains nginx.wtf run
echo | openssl s_client -connect localhost:5001 \
| openssl x509 -out $root/nginx.pem
diff -q $root/nginx.pem $root/conf/live/nginx.wtf/cert.pem
# note: not reached if anything above fails, hence "killall" at the
# top
nginx -c $nginx_root/nginx.conf -s stop
|
. ./tests/integration/_common.sh
export PATH="/usr/sbin:$PATH" # /usr/sbin/nginx
nginx_root="$root/nginx"
mkdir $nginx_root
root="$nginx_root" ./certbot-nginx/tests/boulder-integration.conf.sh > $nginx_root/nginx.conf
+ cp certbot-nginx/certbot_nginx/options-ssl-nginx.conf $nginx_root
killall nginx || true
nginx -c $nginx_root/nginx.conf
certbot_test_nginx () {
certbot_test \
--configurator nginx \
--nginx-server-root $nginx_root \
"$@"
}
certbot_test_nginx --domains nginx.wtf run
echo | openssl s_client -connect localhost:5001 \
| openssl x509 -out $root/nginx.pem
diff -q $root/nginx.pem $root/conf/live/nginx.wtf/cert.pem
# note: not reached if anything above fails, hence "killall" at the
# top
nginx -c $nginx_root/nginx.conf -s stop | 1 | 0.038462 | 1 | 0 |
f1623c3ec5e8f63d14fd2c2bbc1caaa7a1a365bc | src/app/space/create/apps/apps.component.less | src/app/space/create/apps/apps.component.less | @import (reference) '../../../../assets/stylesheets/shared/osio.less';
.env-card-title {
text-transform: capitalize;
}
.resource-card {
background: lightgrey;
padding-top: 0;
padding-bottom: 0;
margin-top: 0;
margin-bottom: 0;
}
.resource-card-body {
font-size: .8em;
}
.resource-title {
color: black;
cursor: pointer;
}
| @import (reference) '../../../../assets/stylesheets/shared/osio.less';
.env-card-title {
text-transform: capitalize;
}
.resource-card {
background: @color-pf-black-300;
padding-top: 0;
padding-bottom: 0;
margin-top: 0;
margin-bottom: 0;
}
.resource-card-body {
font-size: .8em;
}
.resource-title {
color: @color-pf-black;
cursor: pointer;
}
| Use patternfly colors for apps styling | (fix): Use patternfly colors for apps styling
| Less | apache-2.0 | fabric8io/fabric8-ui,fabric8-ui/fabric8-ui,fabric8io/fabric8-ui,fabric8-ui/fabric8-ui,fabric8io/fabric8-ui,fabric8io/fabric8-ui,fabric8-ui/fabric8-ui,fabric8io/fabric8-ui,fabric8-ui/fabric8-ui,fabric8-ui/fabric8-ui | less | ## Code Before:
@import (reference) '../../../../assets/stylesheets/shared/osio.less';
.env-card-title {
text-transform: capitalize;
}
.resource-card {
background: lightgrey;
padding-top: 0;
padding-bottom: 0;
margin-top: 0;
margin-bottom: 0;
}
.resource-card-body {
font-size: .8em;
}
.resource-title {
color: black;
cursor: pointer;
}
## Instruction:
(fix): Use patternfly colors for apps styling
## Code After:
@import (reference) '../../../../assets/stylesheets/shared/osio.less';
.env-card-title {
text-transform: capitalize;
}
.resource-card {
background: @color-pf-black-300;
padding-top: 0;
padding-bottom: 0;
margin-top: 0;
margin-bottom: 0;
}
.resource-card-body {
font-size: .8em;
}
.resource-title {
color: @color-pf-black;
cursor: pointer;
}
| @import (reference) '../../../../assets/stylesheets/shared/osio.less';
.env-card-title {
text-transform: capitalize;
}
.resource-card {
- background: lightgrey;
+ background: @color-pf-black-300;
padding-top: 0;
padding-bottom: 0;
margin-top: 0;
margin-bottom: 0;
}
.resource-card-body {
font-size: .8em;
}
.resource-title {
- color: black;
+ color: @color-pf-black;
? ++++++++++
cursor: pointer;
} | 4 | 0.181818 | 2 | 2 |
46c28ff6d9f266e8efb6f06cf949fb8e305ade18 | web/lib/assets/umakadata/lib/umakadata/service_description.rb | web/lib/assets/umakadata/lib/umakadata/service_description.rb | require 'umakadata/data_format'
module Umakadata
class ServiceDescription
include Umakadata::DataFormat
##
# return the type of service description
#
# @return [String]
attr_reader :type
##
# return service description
#
# @return [String]
attr_reader :text
##
# return response headers
#
# @return [String]
attr_reader :response_header
##
# return modified
#
# @return [String]
attr_reader :modified
def initialize(http_response)
@type = UNKNOWN
@text = nil
@modified = nil
@response_header = ''
body = http_response.body
data = triples(body, TURTLE)
if (!data.nil?)
@text = body
@type = TURTLE
else
data = triples(body, RDFXML)
if (!data.nil?)
@text = body
@type = RDFXML
else
return
end
end
time = []
data.each do |subject, predicate, object|
if predicate == RDF::URI("http://purl.org/dc/terms/modified")
time.push Time.parse(object.to_s) rescue time.push nil
end
end
@modified = time.compact.max
http_response.each_key do |key|
@response_header << key << ": " << http_response[key] << "\n"
end
end
end
end
| require 'umakadata/data_format'
module Umakadata
class ServiceDescription
include Umakadata::DataFormat
##
# return the type of service description
#
# @return [String]
attr_reader :type
##
# return service description
#
# @return [String]
attr_reader :text
##
# return response headers
#
# @return [String]
attr_reader :response_header
##
# return modified
#
# @return [String]
attr_reader :modified
def initialize(http_response)
@type = UNKNOWN
@text = nil
@modified = nil
@response_header = ''
body = http_response.body
unless body.nil?
body.force_encoding('UTF-8') unless body.encoding == Encoding::UTF_8
body = body.encode('UTF-16BE', :invalid => :replace, :undef => :replace, :replace => '?').encode("UTF-8") unless body.valid_encoding?
end
data = triples(body, TURTLE)
if (!data.nil?)
@text = body
@type = TURTLE
else
data = triples(body, RDFXML)
if (!data.nil?)
@text = body
@type = RDFXML
else
return
end
end
time = []
data.each do |subject, predicate, object|
if predicate == RDF::URI("http://purl.org/dc/terms/modified")
time.push Time.parse(object.to_s) rescue time.push nil
end
end
@modified = time.compact.max
http_response.each_key do |key|
@response_header << key << ": " << http_response[key] << "\n"
end
end
end
end
| Convert encoding of invalid string to utf-8 in service description | Convert encoding of invalid string to utf-8 in service description
| Ruby | mit | level-five/umakadata-1,dbcls/umakadata,dbcls/umakadata,level-five/umakadata-1,dbcls/umakadata,level-five/umakadata-1,dbcls/umakadata,level-five/umakadata-1 | ruby | ## Code Before:
require 'umakadata/data_format'
module Umakadata
class ServiceDescription
include Umakadata::DataFormat
##
# return the type of service description
#
# @return [String]
attr_reader :type
##
# return service description
#
# @return [String]
attr_reader :text
##
# return response headers
#
# @return [String]
attr_reader :response_header
##
# return modified
#
# @return [String]
attr_reader :modified
def initialize(http_response)
@type = UNKNOWN
@text = nil
@modified = nil
@response_header = ''
body = http_response.body
data = triples(body, TURTLE)
if (!data.nil?)
@text = body
@type = TURTLE
else
data = triples(body, RDFXML)
if (!data.nil?)
@text = body
@type = RDFXML
else
return
end
end
time = []
data.each do |subject, predicate, object|
if predicate == RDF::URI("http://purl.org/dc/terms/modified")
time.push Time.parse(object.to_s) rescue time.push nil
end
end
@modified = time.compact.max
http_response.each_key do |key|
@response_header << key << ": " << http_response[key] << "\n"
end
end
end
end
## Instruction:
Convert encoding of invalid string to utf-8 in service description
## Code After:
require 'umakadata/data_format'
module Umakadata
class ServiceDescription
include Umakadata::DataFormat
##
# return the type of service description
#
# @return [String]
attr_reader :type
##
# return service description
#
# @return [String]
attr_reader :text
##
# return response headers
#
# @return [String]
attr_reader :response_header
##
# return modified
#
# @return [String]
attr_reader :modified
def initialize(http_response)
@type = UNKNOWN
@text = nil
@modified = nil
@response_header = ''
body = http_response.body
unless body.nil?
body.force_encoding('UTF-8') unless body.encoding == Encoding::UTF_8
body = body.encode('UTF-16BE', :invalid => :replace, :undef => :replace, :replace => '?').encode("UTF-8") unless body.valid_encoding?
end
data = triples(body, TURTLE)
if (!data.nil?)
@text = body
@type = TURTLE
else
data = triples(body, RDFXML)
if (!data.nil?)
@text = body
@type = RDFXML
else
return
end
end
time = []
data.each do |subject, predicate, object|
if predicate == RDF::URI("http://purl.org/dc/terms/modified")
time.push Time.parse(object.to_s) rescue time.push nil
end
end
@modified = time.compact.max
http_response.each_key do |key|
@response_header << key << ": " << http_response[key] << "\n"
end
end
end
end
| require 'umakadata/data_format'
module Umakadata
class ServiceDescription
include Umakadata::DataFormat
##
# return the type of service description
#
# @return [String]
attr_reader :type
##
# return service description
#
# @return [String]
attr_reader :text
##
# return response headers
#
# @return [String]
attr_reader :response_header
##
# return modified
#
# @return [String]
attr_reader :modified
def initialize(http_response)
@type = UNKNOWN
@text = nil
@modified = nil
@response_header = ''
body = http_response.body
+ unless body.nil?
+ body.force_encoding('UTF-8') unless body.encoding == Encoding::UTF_8
+ body = body.encode('UTF-16BE', :invalid => :replace, :undef => :replace, :replace => '?').encode("UTF-8") unless body.valid_encoding?
+ end
data = triples(body, TURTLE)
if (!data.nil?)
@text = body
@type = TURTLE
else
data = triples(body, RDFXML)
if (!data.nil?)
@text = body
@type = RDFXML
else
return
end
end
time = []
data.each do |subject, predicate, object|
if predicate == RDF::URI("http://purl.org/dc/terms/modified")
time.push Time.parse(object.to_s) rescue time.push nil
end
end
@modified = time.compact.max
http_response.each_key do |key|
@response_header << key << ": " << http_response[key] << "\n"
end
end
end
end | 4 | 0.060606 | 4 | 0 |
7fd7bbb036b077f7a6eaad381c7884efeefa10de | build/ubuntufiles/client/usr/share/applications/sagetv.desktop | build/ubuntufiles/client/usr/share/applications/sagetv.desktop | [Desktop Entry]
Encoding=UTF-8
Type=Application
Name=SageTV Client 6.5.8
Comment=Client/Placeshifter for SageTV 6.5.8
Exec=/opt/sagetv/client/sageclient.sh
TryExec=/opt/sagetv/client/sageclient.sh
Terminal=false
Categories=Applications;AudioVideo
Icon=SageIcon64.png
| [Desktop Entry]
Encoding=UTF-8
Type=Application
Name=SageTV Client MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION
Comment=Client/Placeshifter for SageTV MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION
Exec=/opt/sagetv/client/sageclient.sh
TryExec=/opt/sagetv/client/sageclient.sh
Terminal=false
Categories=Applications;AudioVideo
Icon=SageIcon64.png
| Remove hard-coded SageTV versions in the Ubuntu desktop shortcut file. | Remove hard-coded SageTV versions in the Ubuntu desktop shortcut file.
| desktop | apache-2.0 | gilleslabelle/sagetv,OpenSageTV/sagetv,jason-bean/sagetv,shyamalschandra/sagetv,richard-nellist/sagetv,BartokW/sagetv,Slugger/sagetv,tmiranda1962/sagetv-1,peterSVS/sagetv,shyamalschandra/sagetv,BartokW/sagetv,OpenSageTV/sagetv,troll5501/sagetv,webernissle/sagetv,gasinger/sagetv,richard-nellist/sagetv,stuckless/sagetv,jason-bean/sagetv,tmiranda1962/sagetv-1,JREkiwi/sagetv,jlverhagen/sagetv,gilleslabelle/sagetv,andyvshr/sagetv,JasOXIII/sagetv,jfthibert/sagetv,JasOXIII/sagetv,ai7/sagetv,atarijeff/sagetv,JustFred51/sagetv,jusjoken/sagetv,jlverhagen/sagetv,stuckless/sagetv,JREkiwi/sagetv,JREkiwi/sagetv,OpenSageTV/sagetv,atarijeff/sagetv,jlverhagen/sagetv,JasOXIII/sagetv,stuckless/sagetv,ckewinjones/sagetv,google/sagetv,google/sagetv,jason-bean/sagetv,gilleslabelle/sagetv,peterSVS/sagetv,troll5501/sagetv,troll5501/sagetv,enternoescape/sagetv,jason-bean/sagetv,BartokW/sagetv,jreicheneker/sagetv,webernissle/sagetv,jrmull/sagetv,jusjoken/sagetv,jlverhagen/sagetv,ai7/sagetv,BartokW/sagetv,JustFred51/sagetv,gasinger/sagetv,shyamalschandra/sagetv,ai7/sagetv,shyamalschandra/sagetv,jfthibert/sagetv,skiingwiz/sagetv,jreicheneker/sagetv,coppit/sagetv,jusjoken/sagetv,peterSVS/sagetv,jrmull/sagetv,jfthibert/sagetv,webernissle/sagetv,rflitcroft/sagetv,jusjoken/sagetv,ckewinjones/sagetv,gasinger/sagetv,google/sagetv,jrmull/sagetv,atarijeff/sagetv,JREkiwi/sagetv,OpenSageTV/sagetv,skiingwiz/sagetv,richard-nellist/sagetv,jrmull/sagetv,jreicheneker/sagetv,coppit/sagetv,neurocis/sagetv,skiingwiz/sagetv,andyvshr/sagetv,ckewinjones/sagetv,peterSVS/sagetv,skiingwiz/sagetv,rflitcroft/sagetv,JustFred51/sagetv,neurocis/sagetv,enternoescape/sagetv,ai7/sagetv,andyvshr/sagetv,google/sagetv,tmiranda1962/sagetv-1,jreicheneker/sagetv,neurocis/sagetv,rflitcroft/sagetv,tmiranda1962/sagetv-1,enternoescape/sagetv,coppit/sagetv,andyvshr/sagetv,Slugger/sagetv,gasinger/sagetv,troll5501/sagetv,ckewinjones/sagetv,rflitcroft/sagetv,JustFred51/sagetv,atarijeff/sagetv,richard-nellist/sagetv,coppit/sagetv,Slugger/sagetv,neurocis/sagetv,stuckless/sagetv,JasOXIII/sagetv,Slugger/sagetv,enternoescape/sagetv,webernissle/sagetv,gilleslabelle/sagetv,jfthibert/sagetv | desktop | ## Code Before:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=SageTV Client 6.5.8
Comment=Client/Placeshifter for SageTV 6.5.8
Exec=/opt/sagetv/client/sageclient.sh
TryExec=/opt/sagetv/client/sageclient.sh
Terminal=false
Categories=Applications;AudioVideo
Icon=SageIcon64.png
## Instruction:
Remove hard-coded SageTV versions in the Ubuntu desktop shortcut file.
## Code After:
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=SageTV Client MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION
Comment=Client/Placeshifter for SageTV MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION
Exec=/opt/sagetv/client/sageclient.sh
TryExec=/opt/sagetv/client/sageclient.sh
Terminal=false
Categories=Applications;AudioVideo
Icon=SageIcon64.png
| [Desktop Entry]
Encoding=UTF-8
Type=Application
- Name=SageTV Client 6.5.8
- Comment=Client/Placeshifter for SageTV 6.5.8
+ Name=SageTV Client MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION
+ Comment=Client/Placeshifter for SageTV MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION
Exec=/opt/sagetv/client/sageclient.sh
TryExec=/opt/sagetv/client/sageclient.sh
Terminal=false
Categories=Applications;AudioVideo
Icon=SageIcon64.png | 4 | 0.4 | 2 | 2 |
b6ee92cc179bcc57252f646367a9ba55e538768b | docs/source/_templates/page.html | docs/source/_templates/page.html | {% extends "!page.html" %}
{% block footer %}
{{ super() }}
<link href="_static/nv.d3.css" rel="stylesheet">
<script src="_static/d3.min.js"></script>
<script src="_static/nv.d3.min.js"></script>
{% endblock %}
{% block extrahead %}
<link href="_static/nv.d3.css" rel="stylesheet">
<script src="_static/d3.min.js"></script>
<script src="_static/nv.d3.min.js"></script>
{% endblock %}
{%- block body %}
{{ super() }}
{%- endblock %}
| {% extends "!page.html" %}
{% block footer %}
{{ super() }}
{% endblock %}
{% block extrahead %}
<link href="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.10/d3.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js"></script>
{% endblock %}
{%- block body %}
{{ super() }}
{%- endblock %}
| Replace hard coded js with cloudflare | Replace hard coded js with cloudflare
| HTML | mit | Coxious/python-nvd3,vdloo/python-nvd3,pignacio/python-nvd3,yelster/python-nvd3,mgx2/python-nvd3,yelster/python-nvd3,mgx2/python-nvd3,pignacio/python-nvd3,oz123/python-nvd3,oz123/python-nvd3,BibMartin/python-nvd3,yelster/python-nvd3,BibMartin/python-nvd3,liang42hao/python-nvd3,vdloo/python-nvd3,BibMartin/python-nvd3,oz123/python-nvd3,Coxious/python-nvd3,mgx2/python-nvd3,pignacio/python-nvd3,liang42hao/python-nvd3,liang42hao/python-nvd3,Coxious/python-nvd3,vdloo/python-nvd3 | html | ## Code Before:
{% extends "!page.html" %}
{% block footer %}
{{ super() }}
<link href="_static/nv.d3.css" rel="stylesheet">
<script src="_static/d3.min.js"></script>
<script src="_static/nv.d3.min.js"></script>
{% endblock %}
{% block extrahead %}
<link href="_static/nv.d3.css" rel="stylesheet">
<script src="_static/d3.min.js"></script>
<script src="_static/nv.d3.min.js"></script>
{% endblock %}
{%- block body %}
{{ super() }}
{%- endblock %}
## Instruction:
Replace hard coded js with cloudflare
## Code After:
{% extends "!page.html" %}
{% block footer %}
{{ super() }}
{% endblock %}
{% block extrahead %}
<link href="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.10/d3.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js"></script>
{% endblock %}
{%- block body %}
{{ super() }}
{%- endblock %}
| {% extends "!page.html" %}
{% block footer %}
{{ super() }}
-
- <link href="_static/nv.d3.css" rel="stylesheet">
- <script src="_static/d3.min.js"></script>
- <script src="_static/nv.d3.min.js"></script>
{% endblock %}
{% block extrahead %}
+ <link href="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.css" rel="stylesheet">
+ <script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.10/d3.min.js"></script>
+ <script src="http://cdnjs.cloudflare.com/ajax/libs/nvd3/1.1.15-beta/nv.d3.min.js"></script>
-
- <link href="_static/nv.d3.css" rel="stylesheet">
- <script src="_static/d3.min.js"></script>
- <script src="_static/nv.d3.min.js"></script>
-
{% endblock %}
{%- block body %}
{{ super() }}
{%- endblock %} | 12 | 0.545455 | 3 | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.