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
62fe5d134c10af7f0fd5875d524914eb22971a54
app/views/api/v1/wallpapers/index.json.jbuilder
app/views/api/v1/wallpapers/index.json.jbuilder
json.partial! 'api/v1/shared/paging', collection: @wallpapers json.wallpapers @wallpapers do |wallpaper| json.(wallpaper, :id, :purity, :favourites_count) json.views_count wallpaper.impressions_count json.url wallpaper_url(wallpaper) json.user wallpaper.user.try(:username) json.image do json.original do json.width wallpaper.image_width json.height wallpaper.image_height end if wallpaper.thumbnail_image.present? json.thumbnail do json.width Wallpaper::THUMBNAIL_WIDTH json.height Wallpaper::THUMBNAIL_HEIGHT json.url wallpaper.thumbnail_image_url end else json.thumbnail nil end end json.favourited wallpaper.favourited? if user_signed_in? end
json.partial! 'api/v1/shared/paging', collection: @wallpapers json.facets do json.tags @wallpapers.facets['tag']['terms'] json.categories @wallpapers.facets['category']['terms'] end json.wallpapers @wallpapers do |wallpaper| json.(wallpaper, :id, :purity, :favourites_count) json.views_count wallpaper.impressions_count json.url wallpaper_url(wallpaper) json.user wallpaper.user.try(:username) json.image do json.original do json.width wallpaper.image_width json.height wallpaper.image_height end if wallpaper.thumbnail_image.present? json.thumbnail do json.width Wallpaper::THUMBNAIL_WIDTH json.height Wallpaper::THUMBNAIL_HEIGHT json.url wallpaper.thumbnail_image_url end else json.thumbnail nil end end json.favourited wallpaper.favourited? if user_signed_in? end
Include facets in wallpaper index api
Include facets in wallpaper index api
Ruby
mit
wallgig/wallgig,wallgig/wallgig
ruby
## Code Before: json.partial! 'api/v1/shared/paging', collection: @wallpapers json.wallpapers @wallpapers do |wallpaper| json.(wallpaper, :id, :purity, :favourites_count) json.views_count wallpaper.impressions_count json.url wallpaper_url(wallpaper) json.user wallpaper.user.try(:username) json.image do json.original do json.width wallpaper.image_width json.height wallpaper.image_height end if wallpaper.thumbnail_image.present? json.thumbnail do json.width Wallpaper::THUMBNAIL_WIDTH json.height Wallpaper::THUMBNAIL_HEIGHT json.url wallpaper.thumbnail_image_url end else json.thumbnail nil end end json.favourited wallpaper.favourited? if user_signed_in? end ## Instruction: Include facets in wallpaper index api ## Code After: json.partial! 'api/v1/shared/paging', collection: @wallpapers json.facets do json.tags @wallpapers.facets['tag']['terms'] json.categories @wallpapers.facets['category']['terms'] end json.wallpapers @wallpapers do |wallpaper| json.(wallpaper, :id, :purity, :favourites_count) json.views_count wallpaper.impressions_count json.url wallpaper_url(wallpaper) json.user wallpaper.user.try(:username) json.image do json.original do json.width wallpaper.image_width json.height wallpaper.image_height end if wallpaper.thumbnail_image.present? json.thumbnail do json.width Wallpaper::THUMBNAIL_WIDTH json.height Wallpaper::THUMBNAIL_HEIGHT json.url wallpaper.thumbnail_image_url end else json.thumbnail nil end end json.favourited wallpaper.favourited? if user_signed_in? end
json.partial! 'api/v1/shared/paging', collection: @wallpapers + + json.facets do + json.tags @wallpapers.facets['tag']['terms'] + json.categories @wallpapers.facets['category']['terms'] + end json.wallpapers @wallpapers do |wallpaper| json.(wallpaper, :id, :purity, :favourites_count) json.views_count wallpaper.impressions_count json.url wallpaper_url(wallpaper) json.user wallpaper.user.try(:username) json.image do json.original do json.width wallpaper.image_width json.height wallpaper.image_height end if wallpaper.thumbnail_image.present? json.thumbnail do json.width Wallpaper::THUMBNAIL_WIDTH json.height Wallpaper::THUMBNAIL_HEIGHT json.url wallpaper.thumbnail_image_url end else json.thumbnail nil end end json.favourited wallpaper.favourited? if user_signed_in? end
5
0.185185
5
0
fa661c7eea630f504ccfd1526aab235fbb749b94
scss/components/_flex.scss
scss/components/_flex.scss
@mixin foundation-flex-classes { // Horizontal alignment using justify-content @each $hdir, $prop in map-remove($-zf-flex-justify, 'left') { .align-#{$hdir} { @include flex-align($x: $hdir); } } // Horizontal alignment Specifically for Vertical Menu @each $hdir, $prop in map-remove($-zf-flex-justify, 'left', 'justify', 'spaced') { .align-#{$hdir} { &.vertical.menu > li > a { @include flex-align($x: $hdir); } } } // Vertical alignment using align-items and align-self @each $vdir, $prop in $-zf-flex-align { .align-#{$vdir} { @include flex-align($y: $vdir); } .align-self-#{$vdir} { @include flex-align-self($y: $vdir); } } // Central alignment of content .align-center-middle { @include flex-align($x: center, $y: middle); align-content: center; } // Source ordering @include -zf-each-breakpoint { @for $i from 1 through 6 { .#{$-zf-size}-order-#{$i} { @include flex-order($i); } } } }
/// Default value for the count of source ordering` /// @type Number $flex-source-ordering-count: 6 !default; @mixin foundation-flex-classes { // Horizontal alignment using justify-content @each $hdir, $prop in map-remove($-zf-flex-justify, 'left') { .align-#{$hdir} { @include flex-align($x: $hdir); } } // Horizontal alignment Specifically for Vertical Menu @each $hdir, $prop in map-remove($-zf-flex-justify, 'left', 'justify', 'spaced') { .align-#{$hdir} { &.vertical.menu > li > a { @include flex-align($x: $hdir); } } } // Vertical alignment using align-items and align-self @each $vdir, $prop in $-zf-flex-align { .align-#{$vdir} { @include flex-align($y: $vdir); } .align-self-#{$vdir} { @include flex-align-self($y: $vdir); } } // Central alignment of content .align-center-middle { @include flex-align($x: center, $y: middle); align-content: center; } // Source ordering @include -zf-each-breakpoint { @for $i from 1 through $flex-source-ordering-count { .#{$-zf-size}-order-#{$i} { @include flex-order($i); } } } }
Make source ordering flexible in sass
Make source ordering flexible in sass Added a variable for the count!
SCSS
mit
Owlbertz/foundation,denisahac/foundation-sites,ucla/foundation-sites,abdullahsalem/foundation-sites,ucla/foundation-sites,abdullahsalem/foundation-sites,atmmarketing/foundation-sites,Owlbertz/foundation,jaylensoeur/foundation-sites-6,jamesstoneco/foundation-sites,jamesstoneco/foundation-sites,atmmarketing/foundation-sites,dragthor/foundation-sites,zurb/foundation-sites,abdullahsalem/foundation-sites,atmmarketing/foundation-sites,DaSchTour/foundation-sites,IamManchanda/foundation-sites,colin-marshall/foundation-sites,Owlbertz/foundation,dragthor/foundation-sites,zurb/foundation-sites,denisahac/foundation-sites,jamesstoneco/foundation-sites,zurb/foundation,DaSchTour/foundation-sites,aoimedia/foundation,colin-marshall/foundation-sites,Owlbertz/foundation,zurb/foundation,IamManchanda/foundation-sites,aoimedia/foundation,jaylensoeur/foundation-sites-6,jaylensoeur/foundation-sites-6,colin-marshall/foundation-sites,zurb/foundation-sites,dragthor/foundation-sites,IamManchanda/foundation-sites,zurb/foundation,aoimedia/foundation,ucla/foundation-sites,denisahac/foundation-sites
scss
## Code Before: @mixin foundation-flex-classes { // Horizontal alignment using justify-content @each $hdir, $prop in map-remove($-zf-flex-justify, 'left') { .align-#{$hdir} { @include flex-align($x: $hdir); } } // Horizontal alignment Specifically for Vertical Menu @each $hdir, $prop in map-remove($-zf-flex-justify, 'left', 'justify', 'spaced') { .align-#{$hdir} { &.vertical.menu > li > a { @include flex-align($x: $hdir); } } } // Vertical alignment using align-items and align-self @each $vdir, $prop in $-zf-flex-align { .align-#{$vdir} { @include flex-align($y: $vdir); } .align-self-#{$vdir} { @include flex-align-self($y: $vdir); } } // Central alignment of content .align-center-middle { @include flex-align($x: center, $y: middle); align-content: center; } // Source ordering @include -zf-each-breakpoint { @for $i from 1 through 6 { .#{$-zf-size}-order-#{$i} { @include flex-order($i); } } } } ## Instruction: Make source ordering flexible in sass Added a variable for the count! ## Code After: /// Default value for the count of source ordering` /// @type Number $flex-source-ordering-count: 6 !default; @mixin foundation-flex-classes { // Horizontal alignment using justify-content @each $hdir, $prop in map-remove($-zf-flex-justify, 'left') { .align-#{$hdir} { @include flex-align($x: $hdir); } } // Horizontal alignment Specifically for Vertical Menu @each $hdir, $prop in map-remove($-zf-flex-justify, 'left', 'justify', 'spaced') { .align-#{$hdir} { &.vertical.menu > li > a { @include flex-align($x: $hdir); } } } // Vertical alignment using align-items and align-self @each $vdir, $prop in $-zf-flex-align { .align-#{$vdir} { @include flex-align($y: $vdir); } .align-self-#{$vdir} { @include flex-align-self($y: $vdir); } } // Central alignment of content .align-center-middle { @include flex-align($x: center, $y: middle); align-content: center; } // Source ordering @include -zf-each-breakpoint { @for $i from 1 through $flex-source-ordering-count { .#{$-zf-size}-order-#{$i} { @include flex-order($i); } } } }
+ /// Default value for the count of source ordering` + /// @type Number + $flex-source-ordering-count: 6 !default; + @mixin foundation-flex-classes { // Horizontal alignment using justify-content @each $hdir, $prop in map-remove($-zf-flex-justify, 'left') { .align-#{$hdir} { @include flex-align($x: $hdir); } } // Horizontal alignment Specifically for Vertical Menu @each $hdir, $prop in map-remove($-zf-flex-justify, 'left', 'justify', 'spaced') { .align-#{$hdir} { &.vertical.menu > li > a { @include flex-align($x: $hdir); } } } // Vertical alignment using align-items and align-self @each $vdir, $prop in $-zf-flex-align { .align-#{$vdir} { @include flex-align($y: $vdir); } .align-self-#{$vdir} { @include flex-align-self($y: $vdir); } } // Central alignment of content .align-center-middle { @include flex-align($x: center, $y: middle); align-content: center; } // Source ordering @include -zf-each-breakpoint { - @for $i from 1 through 6 { + @for $i from 1 through $flex-source-ordering-count { .#{$-zf-size}-order-#{$i} { @include flex-order($i); } } } }
6
0.139535
5
1
583f84bf445b835f4db5b8995ceda30d47c48510
scripts/launch/ui-simulator.sh
scripts/launch/ui-simulator.sh
_ppid=$PPID echo "My pid $$, PPID=$PPID" if [[ "$1" == "" ]]; then v=$(uxterm -e "$(pwd)/$0 --" || echo bla) case $v in bla) echo "Update started" exit 20 ;; *) echo "Normal exit" ;; esac else while read l; do case "$l" in update) echo "Starting update.." sleep 1s kill -15 $_ppid ;; exit) echo "Exiting.." sleep 1s exit 0 ;; *) echo "Wrong command! Available: exit update" esac done fi
_ppid=$PPID echo "My pid $$, PPID=$PPID" if [[ "$1" == "" ]]; then v=$(uxterm -e "$(pwd)/$0 --" || echo bla) case $v in bla) echo "Update started" curl -X POST -kv https://127.0.0.1:8090/api/update/apply sleep 1s exit 20 ;; *) echo "Normal exit" ;; esac else while read l; do case "$l" in update) echo "Starting update.." sleep 1s kill -15 $_ppid ;; exit) echo "Exiting.." sleep 1s exit 0 ;; *) echo "Wrong command! Available: exit update" esac done fi
Update UI simulator to shutdown the node before exiting
[CSL-1855] Update UI simulator to shutdown the node before exiting
Shell
apache-2.0
input-output-hk/pos-haskell-prototype,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/cardano-sl,input-output-hk/pos-haskell-prototype,input-output-hk/cardano-sl
shell
## Code Before: _ppid=$PPID echo "My pid $$, PPID=$PPID" if [[ "$1" == "" ]]; then v=$(uxterm -e "$(pwd)/$0 --" || echo bla) case $v in bla) echo "Update started" exit 20 ;; *) echo "Normal exit" ;; esac else while read l; do case "$l" in update) echo "Starting update.." sleep 1s kill -15 $_ppid ;; exit) echo "Exiting.." sleep 1s exit 0 ;; *) echo "Wrong command! Available: exit update" esac done fi ## Instruction: [CSL-1855] Update UI simulator to shutdown the node before exiting ## Code After: _ppid=$PPID echo "My pid $$, PPID=$PPID" if [[ "$1" == "" ]]; then v=$(uxterm -e "$(pwd)/$0 --" || echo bla) case $v in bla) echo "Update started" curl -X POST -kv https://127.0.0.1:8090/api/update/apply sleep 1s exit 20 ;; *) echo "Normal exit" ;; esac else while read l; do case "$l" in update) echo "Starting update.." sleep 1s kill -15 $_ppid ;; exit) echo "Exiting.." sleep 1s exit 0 ;; *) echo "Wrong command! Available: exit update" esac done fi
_ppid=$PPID echo "My pid $$, PPID=$PPID" if [[ "$1" == "" ]]; then v=$(uxterm -e "$(pwd)/$0 --" || echo bla) case $v in bla) echo "Update started" + curl -X POST -kv https://127.0.0.1:8090/api/update/apply + sleep 1s exit 20 ;; *) echo "Normal exit" ;; esac else while read l; do case "$l" in update) echo "Starting update.." sleep 1s kill -15 $_ppid ;; exit) echo "Exiting.." sleep 1s exit 0 ;; *) echo "Wrong command! Available: exit update" esac done fi
2
0.057143
2
0
3d4fd638306f588c42f172d19d9d1bf8648c98c5
bootstrap.sh
bootstrap.sh
cd "$(dirname "${BASH_SOURCE}")" if [ "$1" != 'local' ] then git pull origin master fi function syncIt() { dirs=`find dotfiles -maxdepth 1 -mindepth 1 -type d` for d in $dirs do cp -r $d/. ~/.$(basename $d) done files=`find dotfiles -maxdepth 1 -mindepth 1 -type f` for f in $files do cp -r $f ~/.$(basename $f) done } function sourceIt() { source ~/.bash_profile } syncIt sourceIt unset syncIt unset sourceIt
cd "$(dirname "${BASH_SOURCE}")" if [ "$1" != 'local' ] then git pull origin master fi function syncIt() { dirs=`find dotfiles -maxdepth 1 -mindepth 1 -type d` for d in $dirs do cp -r $d/. ~/.$(basename $d) done files=`find dotfiles -maxdepth 1 -mindepth 1 -type f` for f in $files do cp -r $f ~/.$(basename $f) done links=`find dotfiles -maxdepth 1 -mindepth 1 -type l` for l in $links do dest=`readlink -f $l` ln -sf .$(basename $dest) ~/.$(basename $l) done } function sourceIt() { source ~/.bash_profile } syncIt sourceIt unset syncIt unset sourceIt
Change installation script to support symlinks
Change installation script to support symlinks
Shell
mit
deivid-rodriguez/dotfiles,deivid-rodriguez/dotfiles
shell
## Code Before: cd "$(dirname "${BASH_SOURCE}")" if [ "$1" != 'local' ] then git pull origin master fi function syncIt() { dirs=`find dotfiles -maxdepth 1 -mindepth 1 -type d` for d in $dirs do cp -r $d/. ~/.$(basename $d) done files=`find dotfiles -maxdepth 1 -mindepth 1 -type f` for f in $files do cp -r $f ~/.$(basename $f) done } function sourceIt() { source ~/.bash_profile } syncIt sourceIt unset syncIt unset sourceIt ## Instruction: Change installation script to support symlinks ## Code After: cd "$(dirname "${BASH_SOURCE}")" if [ "$1" != 'local' ] then git pull origin master fi function syncIt() { dirs=`find dotfiles -maxdepth 1 -mindepth 1 -type d` for d in $dirs do cp -r $d/. ~/.$(basename $d) done files=`find dotfiles -maxdepth 1 -mindepth 1 -type f` for f in $files do cp -r $f ~/.$(basename $f) done links=`find dotfiles -maxdepth 1 -mindepth 1 -type l` for l in $links do dest=`readlink -f $l` ln -sf .$(basename $dest) ~/.$(basename $l) done } function sourceIt() { source ~/.bash_profile } syncIt sourceIt unset syncIt unset sourceIt
cd "$(dirname "${BASH_SOURCE}")" if [ "$1" != 'local' ] then git pull origin master fi function syncIt() { dirs=`find dotfiles -maxdepth 1 -mindepth 1 -type d` for d in $dirs do cp -r $d/. ~/.$(basename $d) done files=`find dotfiles -maxdepth 1 -mindepth 1 -type f` for f in $files do cp -r $f ~/.$(basename $f) done + + links=`find dotfiles -maxdepth 1 -mindepth 1 -type l` + for l in $links + do + dest=`readlink -f $l` + ln -sf .$(basename $dest) ~/.$(basename $l) + done } function sourceIt() { source ~/.bash_profile } syncIt sourceIt unset syncIt unset sourceIt
7
0.21875
7
0
7f51b7a74df8e2c8d6756b8c3e95f7fbf47b291b
hashbrown/utils.py
hashbrown/utils.py
from django.conf import settings from .models import Switch def is_active(label, user=None): defaults = getattr(settings, 'HASHBROWN_SWITCH_DEFAULTS', {}) globally_active = defaults[label].get( 'globally_active', False) if label in defaults else False description = defaults[label].get( 'description', '') if label in defaults else '' switch, created = Switch.objects.get_or_create( label=label, defaults={ 'globally_active': globally_active, 'description': description, }) if created: return switch.globally_active if switch.globally_active or ( user and user.available_switches.filter(pk=switch.pk).exists() ): return True return False
from django.conf import settings from .models import Switch SETTINGS_KEY = 'HASHBROWN_SWITCH_DEFAULTS' def is_active(label, user=None): defaults = getattr(settings, SETTINGS_KEY, {}) globally_active = defaults[label].get( 'globally_active', False) if label in defaults else False description = defaults[label].get( 'description', '') if label in defaults else '' switch, created = Switch.objects.get_or_create( label=label, defaults={ 'globally_active': globally_active, 'description': description, }) if created: return switch.globally_active if switch.globally_active or ( user and user.available_switches.filter(pk=switch.pk).exists() ): return True return False
Use a constant for the 'HASHBROWN_SWITCH_DEFAULTS' settings key so it is easier to re-use.
Use a constant for the 'HASHBROWN_SWITCH_DEFAULTS' settings key so it is easier to re-use.
Python
bsd-2-clause
potatolondon/django-hashbrown
python
## Code Before: from django.conf import settings from .models import Switch def is_active(label, user=None): defaults = getattr(settings, 'HASHBROWN_SWITCH_DEFAULTS', {}) globally_active = defaults[label].get( 'globally_active', False) if label in defaults else False description = defaults[label].get( 'description', '') if label in defaults else '' switch, created = Switch.objects.get_or_create( label=label, defaults={ 'globally_active': globally_active, 'description': description, }) if created: return switch.globally_active if switch.globally_active or ( user and user.available_switches.filter(pk=switch.pk).exists() ): return True return False ## Instruction: Use a constant for the 'HASHBROWN_SWITCH_DEFAULTS' settings key so it is easier to re-use. ## Code After: from django.conf import settings from .models import Switch SETTINGS_KEY = 'HASHBROWN_SWITCH_DEFAULTS' def is_active(label, user=None): defaults = getattr(settings, SETTINGS_KEY, {}) globally_active = defaults[label].get( 'globally_active', False) if label in defaults else False description = defaults[label].get( 'description', '') if label in defaults else '' switch, created = Switch.objects.get_or_create( label=label, defaults={ 'globally_active': globally_active, 'description': description, }) if created: return switch.globally_active if switch.globally_active or ( user and user.available_switches.filter(pk=switch.pk).exists() ): return True return False
from django.conf import settings from .models import Switch + SETTINGS_KEY = 'HASHBROWN_SWITCH_DEFAULTS' + + def is_active(label, user=None): - defaults = getattr(settings, 'HASHBROWN_SWITCH_DEFAULTS', {}) + defaults = getattr(settings, SETTINGS_KEY, {}) globally_active = defaults[label].get( 'globally_active', False) if label in defaults else False description = defaults[label].get( 'description', '') if label in defaults else '' switch, created = Switch.objects.get_or_create( label=label, defaults={ 'globally_active': globally_active, 'description': description, }) if created: return switch.globally_active if switch.globally_active or ( user and user.available_switches.filter(pk=switch.pk).exists() ): return True return False
5
0.172414
4
1
44c9f337f29086c7dc226197e424820e29aec4d8
test/test.js
test/test.js
var assert = require('assert'); var domain = require('..'); describe('domain-regex', function() { // https://publicsuffix.org/list/effective_tld_names.dat it('should handle a wide array of domains', function() { var validDomains = ['some-example.construction', 'example.co.uk', 'example.aerodrome.aero', 'g.co']; validDomains.forEach(function(validDomain) { assert.equal(domain().test(validDomain), true); }); }); it('should not find a domain when it does not exist', function() { var invalidDomains = [ 'notvalid.com.', '.notvalid.com', 'not_valid.com', 'this.istoolongofatldrighthere.com', 'thisiswaytoolongofatldoverherebecausethereisalimitof64thisiswaytoolongofatldoverherebecausethereisalimitof64.com' ]; invalidDomains.forEach(function(invalidDomain) { assert.equal(domain().test(invalidDomain), false); }); }); });
var assert = require('assert'); var domain = require('..'); describe('domain-regex', function() { // https://publicsuffix.org/list/effective_tld_names.dat it('should handle a wide array of domains', function() { var validDomains = ['some-example.construction', 'example.co.uk', 'example.aerodrome.aero', 'g.co']; validDomains.forEach(function(validDomain) { assert.equal(domain().test(validDomain), true); }); }); it('should not find a domain when it does not exist', function() { var invalidDomains = [ 'notvalid.com.', '.notvalid.com', 'not_valid.com', '-notvalid.com', 'notvalid-.com', 'notvalid.com-', 'this.istoolongofatldrighthere.com', 'thisiswaytoolongofatldoverherebecausethereisalimitof64thisiswaytoolongofatldoverherebecausethereisalimitof64.com' ]; invalidDomains.forEach(function(invalidDomain) { assert.equal(domain().test(invalidDomain), false); }); }); });
Add a few '-' cases
Add a few '-' cases
JavaScript
mit
johnotander/domain-regex
javascript
## Code Before: var assert = require('assert'); var domain = require('..'); describe('domain-regex', function() { // https://publicsuffix.org/list/effective_tld_names.dat it('should handle a wide array of domains', function() { var validDomains = ['some-example.construction', 'example.co.uk', 'example.aerodrome.aero', 'g.co']; validDomains.forEach(function(validDomain) { assert.equal(domain().test(validDomain), true); }); }); it('should not find a domain when it does not exist', function() { var invalidDomains = [ 'notvalid.com.', '.notvalid.com', 'not_valid.com', 'this.istoolongofatldrighthere.com', 'thisiswaytoolongofatldoverherebecausethereisalimitof64thisiswaytoolongofatldoverherebecausethereisalimitof64.com' ]; invalidDomains.forEach(function(invalidDomain) { assert.equal(domain().test(invalidDomain), false); }); }); }); ## Instruction: Add a few '-' cases ## Code After: var assert = require('assert'); var domain = require('..'); describe('domain-regex', function() { // https://publicsuffix.org/list/effective_tld_names.dat it('should handle a wide array of domains', function() { var validDomains = ['some-example.construction', 'example.co.uk', 'example.aerodrome.aero', 'g.co']; validDomains.forEach(function(validDomain) { assert.equal(domain().test(validDomain), true); }); }); it('should not find a domain when it does not exist', function() { var invalidDomains = [ 'notvalid.com.', '.notvalid.com', 'not_valid.com', '-notvalid.com', 'notvalid-.com', 'notvalid.com-', 'this.istoolongofatldrighthere.com', 'thisiswaytoolongofatldoverherebecausethereisalimitof64thisiswaytoolongofatldoverherebecausethereisalimitof64.com' ]; invalidDomains.forEach(function(invalidDomain) { assert.equal(domain().test(invalidDomain), false); }); }); });
var assert = require('assert'); var domain = require('..'); describe('domain-regex', function() { // https://publicsuffix.org/list/effective_tld_names.dat it('should handle a wide array of domains', function() { var validDomains = ['some-example.construction', 'example.co.uk', 'example.aerodrome.aero', 'g.co']; validDomains.forEach(function(validDomain) { assert.equal(domain().test(validDomain), true); }); }); it('should not find a domain when it does not exist', function() { var invalidDomains = [ 'notvalid.com.', '.notvalid.com', 'not_valid.com', + '-notvalid.com', + 'notvalid-.com', + 'notvalid.com-', 'this.istoolongofatldrighthere.com', 'thisiswaytoolongofatldoverherebecausethereisalimitof64thisiswaytoolongofatldoverherebecausethereisalimitof64.com' ]; invalidDomains.forEach(function(invalidDomain) { assert.equal(domain().test(invalidDomain), false); }); }); });
3
0.115385
3
0
ae5937957c2b37dc4f10130fd59a9384e22f1637
generation_tests/main.cpp
generation_tests/main.cpp
extern void name(std::ostream&); ADD_TEST(test_anbncn); ADD_TEST(test_numbers); ADD_TEST(test_numbers_simple); ADD_TEST(test_tdh); ADD_TEST(test_turtle); typedef void (*test_fcn_t)(std::ostream&); void run_test(test_fcn_t test, const std::string& name) { std::cout << "Running test " << name << "..." << std::endl; std::ofstream results("./results/" + name + ".results"); test(results); } #define RUN_TEST(name) run_test(name, #name) int main() { RUN_TEST(test_anbncn); RUN_TEST(test_numbers_simple); RUN_TEST(test_numbers); RUN_TEST(test_turtle); RUN_TEST(test_tdh); return 0; }
extern void name(std::ostream&); ADD_TEST(test_anbncn); ADD_TEST(test_numbers); ADD_TEST(test_numbers_simple); ADD_TEST(test_tdh); ADD_TEST(test_turtle); typedef void (*test_fcn_t)(std::ostream&); void run_test(test_fcn_t test, const std::string& name) { std::cout << "Running test " << name << "..." << std::endl; std::ofstream results("./results/" + name + ".results"); test(results); } #ifndef COVERITY_BUILD #define RUN_TEST(name) run_test(name, #name) #else #include <coverity-test-separation.h> #define RUN_TEST(name) \ do { \ COVERITY_TS_START_TEST(#name); \ run_test(name, #name); \ COVERITY_TS_END_TEST(); \ } while (0) #endif int main() { #ifdef COVERITY_BUILD COVERITY_TS_SET_SUITE_NAME("generation_tests"); #endif RUN_TEST(test_anbncn); RUN_TEST(test_numbers_simple); RUN_TEST(test_numbers); RUN_TEST(test_turtle); RUN_TEST(test_tdh); return 0; }
Add test separation for generation tests.
Add test separation for generation tests.
C++
mit
Fifty-Nine/grune
c++
## Code Before: extern void name(std::ostream&); ADD_TEST(test_anbncn); ADD_TEST(test_numbers); ADD_TEST(test_numbers_simple); ADD_TEST(test_tdh); ADD_TEST(test_turtle); typedef void (*test_fcn_t)(std::ostream&); void run_test(test_fcn_t test, const std::string& name) { std::cout << "Running test " << name << "..." << std::endl; std::ofstream results("./results/" + name + ".results"); test(results); } #define RUN_TEST(name) run_test(name, #name) int main() { RUN_TEST(test_anbncn); RUN_TEST(test_numbers_simple); RUN_TEST(test_numbers); RUN_TEST(test_turtle); RUN_TEST(test_tdh); return 0; } ## Instruction: Add test separation for generation tests. ## Code After: extern void name(std::ostream&); ADD_TEST(test_anbncn); ADD_TEST(test_numbers); ADD_TEST(test_numbers_simple); ADD_TEST(test_tdh); ADD_TEST(test_turtle); typedef void (*test_fcn_t)(std::ostream&); void run_test(test_fcn_t test, const std::string& name) { std::cout << "Running test " << name << "..." << std::endl; std::ofstream results("./results/" + name + ".results"); test(results); } #ifndef COVERITY_BUILD #define RUN_TEST(name) run_test(name, #name) #else #include <coverity-test-separation.h> #define RUN_TEST(name) \ do { \ COVERITY_TS_START_TEST(#name); \ run_test(name, #name); \ COVERITY_TS_END_TEST(); \ } while (0) #endif int main() { #ifdef COVERITY_BUILD COVERITY_TS_SET_SUITE_NAME("generation_tests"); #endif RUN_TEST(test_anbncn); RUN_TEST(test_numbers_simple); RUN_TEST(test_numbers); RUN_TEST(test_turtle); RUN_TEST(test_tdh); return 0; }
extern void name(std::ostream&); + ADD_TEST(test_anbncn); ADD_TEST(test_numbers); ADD_TEST(test_numbers_simple); ADD_TEST(test_tdh); ADD_TEST(test_turtle); typedef void (*test_fcn_t)(std::ostream&); void run_test(test_fcn_t test, const std::string& name) { std::cout << "Running test " << name << "..." << std::endl; std::ofstream results("./results/" + name + ".results"); test(results); } + #ifndef COVERITY_BUILD #define RUN_TEST(name) run_test(name, #name) + #else + #include <coverity-test-separation.h> + #define RUN_TEST(name) \ + do { \ + COVERITY_TS_START_TEST(#name); \ + run_test(name, #name); \ + COVERITY_TS_END_TEST(); \ + } while (0) + #endif int main() { + #ifdef COVERITY_BUILD + COVERITY_TS_SET_SUITE_NAME("generation_tests"); + #endif RUN_TEST(test_anbncn); RUN_TEST(test_numbers_simple); RUN_TEST(test_numbers); RUN_TEST(test_turtle); RUN_TEST(test_tdh); return 0; }
14
0.482759
14
0
1549d977059e0d220ad1af7c65b8d994d9267623
lib/avro2kafka.rb
lib/avro2kafka.rb
require 'avro2kafka/version' require 'avro2kafka/avro_reader' require 'avro2kafka/kafka_publisher' class Avro2Kafka attr_reader :input_path, :kafka_broker, :kafka_topic, :kafka_key def initialize(options) @input_path = ARGV.first @kafka_broker = options.delete(:broker) @kafka_topic = options.delete(:topic) @kafka_key = options[:key] @options = options end def publish File.open(input_path, 'r') do |file| records = AvroReader.new(file).read KafkaPublisher.new(kafka_broker, kafka_topic, kafka_key).publish(records) end puts "Avro file published to #{kafka_topic} topic on #{kafka_broker}!" end end
require 'avro2kafka/version' require 'avro2kafka/avro_reader' require 'avro2kafka/kafka_publisher' class Avro2Kafka attr_reader :input_path, :kafka_broker, :kafka_topic, :kafka_key def initialize(options) @input_path = ARGV.first @kafka_broker = options.delete(:broker) @kafka_topic = options.delete(:topic) @kafka_key = options[:key] @options = options end def reader ARGF.lineno = 0 ARGF end def publish records = AvroReader.new(reader).read KafkaPublisher.new(kafka_broker, kafka_topic, kafka_key).publish(records) puts "Avro file published to #{kafka_topic} topic on #{kafka_broker}!" end end
Use ARGF to read the avro file
Use ARGF to read the avro file
Ruby
mit
sspinc/avro2kafka
ruby
## Code Before: require 'avro2kafka/version' require 'avro2kafka/avro_reader' require 'avro2kafka/kafka_publisher' class Avro2Kafka attr_reader :input_path, :kafka_broker, :kafka_topic, :kafka_key def initialize(options) @input_path = ARGV.first @kafka_broker = options.delete(:broker) @kafka_topic = options.delete(:topic) @kafka_key = options[:key] @options = options end def publish File.open(input_path, 'r') do |file| records = AvroReader.new(file).read KafkaPublisher.new(kafka_broker, kafka_topic, kafka_key).publish(records) end puts "Avro file published to #{kafka_topic} topic on #{kafka_broker}!" end end ## Instruction: Use ARGF to read the avro file ## Code After: require 'avro2kafka/version' require 'avro2kafka/avro_reader' require 'avro2kafka/kafka_publisher' class Avro2Kafka attr_reader :input_path, :kafka_broker, :kafka_topic, :kafka_key def initialize(options) @input_path = ARGV.first @kafka_broker = options.delete(:broker) @kafka_topic = options.delete(:topic) @kafka_key = options[:key] @options = options end def reader ARGF.lineno = 0 ARGF end def publish records = AvroReader.new(reader).read KafkaPublisher.new(kafka_broker, kafka_topic, kafka_key).publish(records) puts "Avro file published to #{kafka_topic} topic on #{kafka_broker}!" end end
require 'avro2kafka/version' require 'avro2kafka/avro_reader' require 'avro2kafka/kafka_publisher' class Avro2Kafka attr_reader :input_path, :kafka_broker, :kafka_topic, :kafka_key def initialize(options) @input_path = ARGV.first @kafka_broker = options.delete(:broker) @kafka_topic = options.delete(:topic) @kafka_key = options[:key] @options = options end + def reader + ARGF.lineno = 0 + ARGF + end + def publish - File.open(input_path, 'r') do |file| - records = AvroReader.new(file).read ? -- ^^^ + records = AvroReader.new(reader).read ? ^ ++++ - KafkaPublisher.new(kafka_broker, kafka_topic, kafka_key).publish(records) ? -- + KafkaPublisher.new(kafka_broker, kafka_topic, kafka_key).publish(records) - end puts "Avro file published to #{kafka_topic} topic on #{kafka_broker}!" end end
11
0.44
7
4
78f7d0fd99b1da16a495d292844f637af5f2c298
prettier.config.js
prettier.config.js
module.exports = { useTabs: true, tabWidth: 4, printWidth: 80, singleQuote: true, trailingComma: 'es5', bracketSpacing: true, parenSpacing: true, jsxBracketSameLine: false, semi: true, arrowParens: 'always', endOfLine: 'lf', };
module.exports = { useTabs: true, tabWidth: 4, printWidth: 80, singleQuote: true, trailingComma: 'es5', bracketSpacing: true, parenSpacing: true, jsxBracketSameLine: false, semi: true, arrowParens: 'always', };
Revert "chore: add `endOfLine` Prettier option `lf`"
Revert "chore: add `endOfLine` Prettier option `lf`" This reverts commit 319200d87e8102c482d394d11458ee5593a10bc0.
JavaScript
mit
ntwb/stylelint-config-wordpress,WordPress-Coding-Standards/stylelint-config-wordpress
javascript
## Code Before: module.exports = { useTabs: true, tabWidth: 4, printWidth: 80, singleQuote: true, trailingComma: 'es5', bracketSpacing: true, parenSpacing: true, jsxBracketSameLine: false, semi: true, arrowParens: 'always', endOfLine: 'lf', }; ## Instruction: Revert "chore: add `endOfLine` Prettier option `lf`" This reverts commit 319200d87e8102c482d394d11458ee5593a10bc0. ## Code After: module.exports = { useTabs: true, tabWidth: 4, printWidth: 80, singleQuote: true, trailingComma: 'es5', bracketSpacing: true, parenSpacing: true, jsxBracketSameLine: false, semi: true, arrowParens: 'always', };
module.exports = { useTabs: true, tabWidth: 4, printWidth: 80, singleQuote: true, trailingComma: 'es5', bracketSpacing: true, parenSpacing: true, jsxBracketSameLine: false, semi: true, arrowParens: 'always', - endOfLine: 'lf', };
1
0.076923
0
1
f00b1f7f2445043daeaafeaf4253cba167e3efb6
gcp/modules/gcp-stackdriver-monitoring/resources/alert_policies/couchdb_request_time.json
gcp/modules/gcp-stackdriver-monitoring/resources/alert_policies/couchdb_request_time.json
{ "display_name": "CouchDB request time stays within 100ms", "combiner": "OR", "conditions": [ { "condition_threshold": { "filter": "metric.type=\"custom.googleapis.com/couchdb/httpd_request_time\" resource.type=\"gke_container\"", "comparison": "COMPARISON_GT", "threshold_value": 100, "duration": { "seconds": 180, "nanos": 0 }, "trigger": { "count": 0, "percent": 0.0 }, "aggregations": [ { "alignment_period": { "seconds": 60, "nanos": 0 }, "per_series_aligner": "ALIGN_MEAN", "cross_series_reducer": "REDUCE_NONE", "group_by_fields": [] } ], "denominator_filter": "", "denominator_aggregations": [] }, "display_name": "CouchDB request time exceeded 100ms" } ], "notification_channels": [], "user_labels": {}, "enabled": { "value": true } }
{ "display_name": "CouchDB request time stays within 100ms", "combiner": "OR", "conditions": [ { "condition_threshold": { "filter": "metric.type=\"custom.googleapis.com/couchdb/httpd_request_time\" resource.type=\"gke_container\"", "comparison": "COMPARISON_GT", "threshold_value": 100, "duration": { "seconds": 180, "nanos": 0 }, "trigger": { "count": 0, "percent": 0.0 }, "aggregations": [ { "alignment_period": { "seconds": 60, "nanos": 0 }, "per_series_aligner": "ALIGN_MEAN", "cross_series_reducer": "REDUCE_NONE", "group_by_fields": [] } ], "denominator_filter": "", "denominator_aggregations": [] }, "display_name": "CouchDB request time exceeded 100ms" } ], "documentation": { "content": "Typical \"healthy\" response time for CouchDB is < 50ms.\n\nThat value is doubled to give it some buffer and used as a threshold for this policy.", "mime_type": "text/markdown" }, "notification_channels": [], "user_labels": {}, "enabled": { "value": true } }
Add documentation explaining the choice of treshold
Add documentation explaining the choice of treshold
JSON
bsd-3-clause
mrtyler/gpii-infra,mrtyler/gpii-infra,mrtyler/gpii-infra,mrtyler/gpii-infra
json
## Code Before: { "display_name": "CouchDB request time stays within 100ms", "combiner": "OR", "conditions": [ { "condition_threshold": { "filter": "metric.type=\"custom.googleapis.com/couchdb/httpd_request_time\" resource.type=\"gke_container\"", "comparison": "COMPARISON_GT", "threshold_value": 100, "duration": { "seconds": 180, "nanos": 0 }, "trigger": { "count": 0, "percent": 0.0 }, "aggregations": [ { "alignment_period": { "seconds": 60, "nanos": 0 }, "per_series_aligner": "ALIGN_MEAN", "cross_series_reducer": "REDUCE_NONE", "group_by_fields": [] } ], "denominator_filter": "", "denominator_aggregations": [] }, "display_name": "CouchDB request time exceeded 100ms" } ], "notification_channels": [], "user_labels": {}, "enabled": { "value": true } } ## Instruction: Add documentation explaining the choice of treshold ## Code After: { "display_name": "CouchDB request time stays within 100ms", "combiner": "OR", "conditions": [ { "condition_threshold": { "filter": "metric.type=\"custom.googleapis.com/couchdb/httpd_request_time\" resource.type=\"gke_container\"", "comparison": "COMPARISON_GT", "threshold_value": 100, "duration": { "seconds": 180, "nanos": 0 }, "trigger": { "count": 0, "percent": 0.0 }, "aggregations": [ { "alignment_period": { "seconds": 60, "nanos": 0 }, "per_series_aligner": "ALIGN_MEAN", "cross_series_reducer": "REDUCE_NONE", "group_by_fields": [] } ], "denominator_filter": "", "denominator_aggregations": [] }, "display_name": "CouchDB request time exceeded 100ms" } ], "documentation": { "content": "Typical \"healthy\" response time for CouchDB is < 50ms.\n\nThat value is doubled to give it some buffer and used as a threshold for this policy.", "mime_type": "text/markdown" }, "notification_channels": [], "user_labels": {}, "enabled": { "value": true } }
{ "display_name": "CouchDB request time stays within 100ms", "combiner": "OR", "conditions": [ { "condition_threshold": { "filter": "metric.type=\"custom.googleapis.com/couchdb/httpd_request_time\" resource.type=\"gke_container\"", "comparison": "COMPARISON_GT", "threshold_value": 100, "duration": { "seconds": 180, "nanos": 0 }, "trigger": { "count": 0, "percent": 0.0 }, "aggregations": [ { "alignment_period": { "seconds": 60, "nanos": 0 }, "per_series_aligner": "ALIGN_MEAN", "cross_series_reducer": "REDUCE_NONE", "group_by_fields": [] } ], "denominator_filter": "", "denominator_aggregations": [] }, "display_name": "CouchDB request time exceeded 100ms" } ], + "documentation": { + "content": "Typical \"healthy\" response time for CouchDB is < 50ms.\n\nThat value is doubled to give it some buffer and used as a threshold for this policy.", + "mime_type": "text/markdown" + }, "notification_channels": [], "user_labels": {}, "enabled": { "value": true } }
4
0.1
4
0
89a08a5072bc8642ffe613771d84d5ed3c6bd7c8
source/functions.2.sh
source/functions.2.sh
function title() { echo -n -e "\033]0;$1\007" } # Python makes a nice command line calculator. function calc() { python3 -c "from math import *; print($*)" } # Are we running on a Mac? function is_osx() { [[ "$OSTYPE" =~ ^darwin ]] } # Are we running on a Linux box? function is_linux() { [[ "$OSTYPE" =~ ^linux ]] } # Are we running on a BSD box? function is_bsd() { [[ "$OSTYPE" =~ ^bsd ]] } # Are we running on MSys on Windows? function is_msys() { [[ "$OSTYPE" =~ ^msys ]] } # Are we running on Cygwin on Windows? function is_cygwin() { [[ "$OSTYPE" =~ ^cygwin ]] } # Test if a binary is installed on the system. function is_installed() { if type $1 &> /dev/null; then return 0 else return 1 fi }
function title() { if [[ -n "$1" ]]; then echo -n -e "\033]0;$1\007" else echo -n -e "\033]0;${USER}@${HOSTNAME}\007" fi } # Python makes a nice command line calculator. function calc() { python3 -c "from math import *; print($*)" } # Are we running on a Mac? function is_osx() { [[ "$OSTYPE" =~ ^darwin ]] } # Are we running on a Linux box? function is_linux() { [[ "$OSTYPE" =~ ^linux ]] } # Are we running on a BSD box? function is_bsd() { [[ "$OSTYPE" =~ ^bsd ]] } # Are we running on MSys on Windows? function is_msys() { [[ "$OSTYPE" =~ ^msys ]] } # Are we running on Cygwin on Windows? function is_cygwin() { [[ "$OSTYPE" =~ ^cygwin ]] } # Test if a binary is installed on the system. function is_installed() { if type $1 &> /dev/null; then return 0 else return 1 fi }
Add default to title() function
Add default to title() function
Shell
unlicense
dmulholland/dotfiles,dmulholland/dotfiles
shell
## Code Before: function title() { echo -n -e "\033]0;$1\007" } # Python makes a nice command line calculator. function calc() { python3 -c "from math import *; print($*)" } # Are we running on a Mac? function is_osx() { [[ "$OSTYPE" =~ ^darwin ]] } # Are we running on a Linux box? function is_linux() { [[ "$OSTYPE" =~ ^linux ]] } # Are we running on a BSD box? function is_bsd() { [[ "$OSTYPE" =~ ^bsd ]] } # Are we running on MSys on Windows? function is_msys() { [[ "$OSTYPE" =~ ^msys ]] } # Are we running on Cygwin on Windows? function is_cygwin() { [[ "$OSTYPE" =~ ^cygwin ]] } # Test if a binary is installed on the system. function is_installed() { if type $1 &> /dev/null; then return 0 else return 1 fi } ## Instruction: Add default to title() function ## Code After: function title() { if [[ -n "$1" ]]; then echo -n -e "\033]0;$1\007" else echo -n -e "\033]0;${USER}@${HOSTNAME}\007" fi } # Python makes a nice command line calculator. function calc() { python3 -c "from math import *; print($*)" } # Are we running on a Mac? function is_osx() { [[ "$OSTYPE" =~ ^darwin ]] } # Are we running on a Linux box? function is_linux() { [[ "$OSTYPE" =~ ^linux ]] } # Are we running on a BSD box? function is_bsd() { [[ "$OSTYPE" =~ ^bsd ]] } # Are we running on MSys on Windows? function is_msys() { [[ "$OSTYPE" =~ ^msys ]] } # Are we running on Cygwin on Windows? function is_cygwin() { [[ "$OSTYPE" =~ ^cygwin ]] } # Test if a binary is installed on the system. function is_installed() { if type $1 &> /dev/null; then return 0 else return 1 fi }
function title() { + if [[ -n "$1" ]]; then - echo -n -e "\033]0;$1\007" + echo -n -e "\033]0;$1\007" ? ++++ + else + echo -n -e "\033]0;${USER}@${HOSTNAME}\007" + fi } # Python makes a nice command line calculator. function calc() { python3 -c "from math import *; print($*)" } # Are we running on a Mac? function is_osx() { [[ "$OSTYPE" =~ ^darwin ]] } # Are we running on a Linux box? function is_linux() { [[ "$OSTYPE" =~ ^linux ]] } # Are we running on a BSD box? function is_bsd() { [[ "$OSTYPE" =~ ^bsd ]] } # Are we running on MSys on Windows? function is_msys() { [[ "$OSTYPE" =~ ^msys ]] } # Are we running on Cygwin on Windows? function is_cygwin() { [[ "$OSTYPE" =~ ^cygwin ]] } # Test if a binary is installed on the system. function is_installed() { if type $1 &> /dev/null; then return 0 else return 1 fi }
6
0.142857
5
1
ae4af32bf5ca21b2c7d80e2034560ed23f6a2ea7
src/main-rpython.py
src/main-rpython.py
import sys from som.compiler.parse_error import ParseError from som.interp_type import is_ast_interpreter, is_bytecode_interpreter from som.vm.universe import main, Exit import os # __________ Entry points __________ def entry_point(argv): try: main(argv) except Exit as e: return e.code except ParseError as e: os.write(2, str(e)) return 1 except Exception as e: os.write(2, "ERROR: %s thrown during execution.\n" % e) return 1 return 1 # _____ Define and setup target ___ def target(driver, args): exe_name = 'som-' if is_ast_interpreter(): exe_name += 'ast-' elif is_bytecode_interpreter(): exe_name += 'bc-' if driver.config.translation.jit: exe_name += 'jit' else: exe_name += 'interp' driver.exe_name = exe_name return entry_point, None def jitpolicy(driver): from rpython.jit.codewriter.policy import JitPolicy return JitPolicy() if __name__ == '__main__': from rpython.translator.driver import TranslationDriver f, _ = target(TranslationDriver(), sys.argv) sys.exit(f(sys.argv))
import sys from som.compiler.parse_error import ParseError from som.interp_type import is_ast_interpreter, is_bytecode_interpreter from som.vm.universe import main, Exit import os try: import rpython.rlib except ImportError: print("Failed to load RPython library. Please make sure it is on PYTHONPATH") sys.exit(1) # __________ Entry points __________ def entry_point(argv): try: main(argv) except Exit as e: return e.code except ParseError as e: os.write(2, str(e)) return 1 except Exception as e: os.write(2, "ERROR: %s thrown during execution.\n" % e) return 1 return 1 # _____ Define and setup target ___ def target(driver, args): exe_name = 'som-' if is_ast_interpreter(): exe_name += 'ast-' elif is_bytecode_interpreter(): exe_name += 'bc-' if driver.config.translation.jit: exe_name += 'jit' else: exe_name += 'interp' driver.exe_name = exe_name return entry_point, None def jitpolicy(driver): from rpython.jit.codewriter.policy import JitPolicy return JitPolicy() if __name__ == '__main__': from rpython.translator.driver import TranslationDriver f, _ = target(TranslationDriver(), sys.argv) sys.exit(f(sys.argv))
Add error to make sure we have RPython when using the RPython main
Add error to make sure we have RPython when using the RPython main Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de>
Python
mit
SOM-st/RPySOM,smarr/PySOM,smarr/PySOM,SOM-st/PySOM,SOM-st/RPySOM,SOM-st/PySOM
python
## Code Before: import sys from som.compiler.parse_error import ParseError from som.interp_type import is_ast_interpreter, is_bytecode_interpreter from som.vm.universe import main, Exit import os # __________ Entry points __________ def entry_point(argv): try: main(argv) except Exit as e: return e.code except ParseError as e: os.write(2, str(e)) return 1 except Exception as e: os.write(2, "ERROR: %s thrown during execution.\n" % e) return 1 return 1 # _____ Define and setup target ___ def target(driver, args): exe_name = 'som-' if is_ast_interpreter(): exe_name += 'ast-' elif is_bytecode_interpreter(): exe_name += 'bc-' if driver.config.translation.jit: exe_name += 'jit' else: exe_name += 'interp' driver.exe_name = exe_name return entry_point, None def jitpolicy(driver): from rpython.jit.codewriter.policy import JitPolicy return JitPolicy() if __name__ == '__main__': from rpython.translator.driver import TranslationDriver f, _ = target(TranslationDriver(), sys.argv) sys.exit(f(sys.argv)) ## Instruction: Add error to make sure we have RPython when using the RPython main Signed-off-by: Stefan Marr <46f1a0bd5592a2f9244ca321b129902a06b53e03@stefan-marr.de> ## Code After: import sys from som.compiler.parse_error import ParseError from som.interp_type import is_ast_interpreter, is_bytecode_interpreter from som.vm.universe import main, Exit import os try: import rpython.rlib except ImportError: print("Failed to load RPython library. Please make sure it is on PYTHONPATH") sys.exit(1) # __________ Entry points __________ def entry_point(argv): try: main(argv) except Exit as e: return e.code except ParseError as e: os.write(2, str(e)) return 1 except Exception as e: os.write(2, "ERROR: %s thrown during execution.\n" % e) return 1 return 1 # _____ Define and setup target ___ def target(driver, args): exe_name = 'som-' if is_ast_interpreter(): exe_name += 'ast-' elif is_bytecode_interpreter(): exe_name += 'bc-' if driver.config.translation.jit: exe_name += 'jit' else: exe_name += 'interp' driver.exe_name = exe_name return entry_point, None def jitpolicy(driver): from rpython.jit.codewriter.policy import JitPolicy return JitPolicy() if __name__ == '__main__': from rpython.translator.driver import TranslationDriver f, _ = target(TranslationDriver(), sys.argv) sys.exit(f(sys.argv))
import sys from som.compiler.parse_error import ParseError from som.interp_type import is_ast_interpreter, is_bytecode_interpreter from som.vm.universe import main, Exit import os + + try: + import rpython.rlib + except ImportError: + print("Failed to load RPython library. Please make sure it is on PYTHONPATH") + sys.exit(1) # __________ Entry points __________ def entry_point(argv): try: main(argv) except Exit as e: return e.code except ParseError as e: os.write(2, str(e)) return 1 except Exception as e: os.write(2, "ERROR: %s thrown during execution.\n" % e) return 1 return 1 # _____ Define and setup target ___ def target(driver, args): exe_name = 'som-' if is_ast_interpreter(): exe_name += 'ast-' elif is_bytecode_interpreter(): exe_name += 'bc-' if driver.config.translation.jit: exe_name += 'jit' else: exe_name += 'interp' driver.exe_name = exe_name return entry_point, None def jitpolicy(driver): from rpython.jit.codewriter.policy import JitPolicy return JitPolicy() if __name__ == '__main__': from rpython.translator.driver import TranslationDriver f, _ = target(TranslationDriver(), sys.argv) sys.exit(f(sys.argv))
6
0.111111
6
0
2c595e930298d6fdb25090d98d126e380163336d
.travis.yml
.travis.yml
env: global: - CC_TEST_REPORTER_ID=6f07a33d1bf4060910c8b97cb9bf97230bbf1fad75765fef98f3cca9f29cd6b0 language: ruby before_install: - gem install bundler install: - bundle install --without local rvm: - 3.0.1 - 3.0.0 - 2.7.2 - 2.7.1 - 2.7.0 - 2.6.6 - 2.6.5 - 2.6.4 - 2.6.3 - 2.6.2 - 2.6.1 - 2.6.0 - 2.5.8 - 2.5.7 - 2.5.6 - 2.5.5 - 2.5.4 - 2.5.3 - 2.5.2 - 2.5.1 - 2.5.0 before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build script: - bundle exec rspec after_script: - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
env: global: - CC_TEST_REPORTER_ID=6f07a33d1bf4060910c8b97cb9bf97230bbf1fad75765fef98f3cca9f29cd6b0 language: ruby before_install: - gem install bundler install: - bundle install --without local rvm: - 3.0.1 - 3.0.0 - 2.7.3 - 2.7.2 - 2.7.1 - 2.7.0 - 2.6.7 - 2.6.6 - 2.6.5 - 2.6.4 - 2.6.3 - 2.6.2 - 2.6.1 - 2.6.0 - 2.5.9 - 2.5.8 - 2.5.7 - 2.5.6 - 2.5.5 - 2.5.4 - 2.5.3 - 2.5.2 - 2.5.1 - 2.5.0 before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build script: - bundle exec rspec after_script: - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
Add ruby 2.7.3, 2.6.7, 2.5.9 to CI build
Add ruby 2.7.3, 2.6.7, 2.5.9 to CI build
YAML
mit
gonzedge/rambling-trie
yaml
## Code Before: env: global: - CC_TEST_REPORTER_ID=6f07a33d1bf4060910c8b97cb9bf97230bbf1fad75765fef98f3cca9f29cd6b0 language: ruby before_install: - gem install bundler install: - bundle install --without local rvm: - 3.0.1 - 3.0.0 - 2.7.2 - 2.7.1 - 2.7.0 - 2.6.6 - 2.6.5 - 2.6.4 - 2.6.3 - 2.6.2 - 2.6.1 - 2.6.0 - 2.5.8 - 2.5.7 - 2.5.6 - 2.5.5 - 2.5.4 - 2.5.3 - 2.5.2 - 2.5.1 - 2.5.0 before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build script: - bundle exec rspec after_script: - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT ## Instruction: Add ruby 2.7.3, 2.6.7, 2.5.9 to CI build ## Code After: env: global: - CC_TEST_REPORTER_ID=6f07a33d1bf4060910c8b97cb9bf97230bbf1fad75765fef98f3cca9f29cd6b0 language: ruby before_install: - gem install bundler install: - bundle install --without local rvm: - 3.0.1 - 3.0.0 - 2.7.3 - 2.7.2 - 2.7.1 - 2.7.0 - 2.6.7 - 2.6.6 - 2.6.5 - 2.6.4 - 2.6.3 - 2.6.2 - 2.6.1 - 2.6.0 - 2.5.9 - 2.5.8 - 2.5.7 - 2.5.6 - 2.5.5 - 2.5.4 - 2.5.3 - 2.5.2 - 2.5.1 - 2.5.0 before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build script: - bundle exec rspec after_script: - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
env: global: - CC_TEST_REPORTER_ID=6f07a33d1bf4060910c8b97cb9bf97230bbf1fad75765fef98f3cca9f29cd6b0 language: ruby before_install: - gem install bundler install: - bundle install --without local rvm: - 3.0.1 - 3.0.0 + - 2.7.3 - 2.7.2 - 2.7.1 - 2.7.0 + - 2.6.7 - 2.6.6 - 2.6.5 - 2.6.4 - 2.6.3 - 2.6.2 - 2.6.1 - 2.6.0 + - 2.5.9 - 2.5.8 - 2.5.7 - 2.5.6 - 2.5.5 - 2.5.4 - 2.5.3 - 2.5.2 - 2.5.1 - 2.5.0 before_script: - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - chmod +x ./cc-test-reporter - ./cc-test-reporter before-build script: - bundle exec rspec after_script: - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
3
0.078947
3
0
5ae296eb7631fa9a0512358d3374b5f839a83f8d
lib/cloudkit/command.rb
lib/cloudkit/command.rb
module CloudKit class Command include CloudKit::Generator def run(args) return help unless command = args.first case command when 'run' run_app when 'help' help else @app_name = destination_root = command template_root = File.join(File.expand_path(File.dirname(__FILE__)), 'templates', 'gen') generate_app(template_root, destination_root) end end def generate_app(template_root, destination_root) FileUtils.mkdir(destination_root) copy_contents(template_root, destination_root) Formatador.display_line("[bold]#{@app_name} was created[/]") end def run_app `rackup config.ru` end def help Formatador.display_line("CloudKit") end end end
module CloudKit class Command include CloudKit::Generator def run(args) return help unless command = args.first case command when 'run' run_app when 'help' help else @app_name = destination_root = command template_root = File.join(File.expand_path(File.dirname(__FILE__)), 'templates', 'gen') generate_app(template_root, destination_root) end end def generate_app(template_root, destination_root) FileUtils.mkdir(destination_root) copy_contents(template_root, destination_root) Formatador.display_line("[bold]#{@app_name} was created[/]") end def run_app unless File.exist?('.bundle') Formatador.display_line("[yellow][bold]No gem bundle found.[/]") Formatador.display_line("[green]Bundling...[/]") `bundle install` end Formatador.display_line("[green][bold]Starting app...[/]") `rackup config.ru` end def help Formatador.display_line("CloudKit") end end end
Add naive bundler support to app runner
Add naive bundler support to app runner
Ruby
mit
jcrosby/cloudkit,asenchi/cloudkit,jcrosby/cloudkit,asenchi/cloudkit
ruby
## Code Before: module CloudKit class Command include CloudKit::Generator def run(args) return help unless command = args.first case command when 'run' run_app when 'help' help else @app_name = destination_root = command template_root = File.join(File.expand_path(File.dirname(__FILE__)), 'templates', 'gen') generate_app(template_root, destination_root) end end def generate_app(template_root, destination_root) FileUtils.mkdir(destination_root) copy_contents(template_root, destination_root) Formatador.display_line("[bold]#{@app_name} was created[/]") end def run_app `rackup config.ru` end def help Formatador.display_line("CloudKit") end end end ## Instruction: Add naive bundler support to app runner ## Code After: module CloudKit class Command include CloudKit::Generator def run(args) return help unless command = args.first case command when 'run' run_app when 'help' help else @app_name = destination_root = command template_root = File.join(File.expand_path(File.dirname(__FILE__)), 'templates', 'gen') generate_app(template_root, destination_root) end end def generate_app(template_root, destination_root) FileUtils.mkdir(destination_root) copy_contents(template_root, destination_root) Formatador.display_line("[bold]#{@app_name} was created[/]") end def run_app unless File.exist?('.bundle') Formatador.display_line("[yellow][bold]No gem bundle found.[/]") Formatador.display_line("[green]Bundling...[/]") `bundle install` end Formatador.display_line("[green][bold]Starting app...[/]") `rackup config.ru` end def help Formatador.display_line("CloudKit") end end end
module CloudKit class Command include CloudKit::Generator def run(args) return help unless command = args.first case command when 'run' run_app when 'help' help else @app_name = destination_root = command template_root = File.join(File.expand_path(File.dirname(__FILE__)), 'templates', 'gen') generate_app(template_root, destination_root) end end def generate_app(template_root, destination_root) FileUtils.mkdir(destination_root) copy_contents(template_root, destination_root) Formatador.display_line("[bold]#{@app_name} was created[/]") end def run_app + unless File.exist?('.bundle') + Formatador.display_line("[yellow][bold]No gem bundle found.[/]") + Formatador.display_line("[green]Bundling...[/]") + `bundle install` + end + Formatador.display_line("[green][bold]Starting app...[/]") `rackup config.ru` end def help Formatador.display_line("CloudKit") end end end
6
0.181818
6
0
dafcb48304d45a1756a96c9ff43babd03a63eb3d
setup.cfg
setup.cfg
[bumpversion] current_version = 0.8.1 commit = false tag = false [bumpversion:file:setup.py] [bumpversion:file:sumy/__init__.py] [tool:pytest] addopts = --quiet --tb=short --color=yes --cov=sumy --cov-report=term-missing --no-cov-on-fail [pep8] max-line-length = 160 [bdist_wheel] universal = 1
[bumpversion] current_version = 0.8.1 commit = false tag = false [bumpversion:file:setup.py] [bumpversion:file:sumy/__init__.py] [tool:pytest] addopts = --quiet --tb=short --color=yes --cov=sumy --cov-report=term-missing --no-cov-on-fail [pep8] max-line-length = 160 [flake8] inline-quotes = double multiline-quotes = double docstring-quotes = double [isort] multi_line_output = 5 [bdist_wheel] universal = 1
Fix bad quotes for wemake-python-styleguide
Fix bad quotes for wemake-python-styleguide
INI
apache-2.0
miso-belica/sumy,miso-belica/sumy
ini
## Code Before: [bumpversion] current_version = 0.8.1 commit = false tag = false [bumpversion:file:setup.py] [bumpversion:file:sumy/__init__.py] [tool:pytest] addopts = --quiet --tb=short --color=yes --cov=sumy --cov-report=term-missing --no-cov-on-fail [pep8] max-line-length = 160 [bdist_wheel] universal = 1 ## Instruction: Fix bad quotes for wemake-python-styleguide ## Code After: [bumpversion] current_version = 0.8.1 commit = false tag = false [bumpversion:file:setup.py] [bumpversion:file:sumy/__init__.py] [tool:pytest] addopts = --quiet --tb=short --color=yes --cov=sumy --cov-report=term-missing --no-cov-on-fail [pep8] max-line-length = 160 [flake8] inline-quotes = double multiline-quotes = double docstring-quotes = double [isort] multi_line_output = 5 [bdist_wheel] universal = 1
[bumpversion] current_version = 0.8.1 commit = false tag = false [bumpversion:file:setup.py] [bumpversion:file:sumy/__init__.py] [tool:pytest] addopts = --quiet --tb=short --color=yes --cov=sumy --cov-report=term-missing --no-cov-on-fail [pep8] max-line-length = 160 + [flake8] + inline-quotes = double + multiline-quotes = double + docstring-quotes = double + + [isort] + multi_line_output = 5 + [bdist_wheel] universal = 1
8
0.470588
8
0
e002bcd13c360255c939ff0f627573470abaf466
Cargo.toml
Cargo.toml
[package] name = "helion" version = "0.5.0" authors = ["jojo <jo@jo.zone>"] license = "AGPL-3.0" build = "build.rs" edition = "2018" [features] profiling = ["cpuprofiler"] [dependencies] serde = "1.0" serde_derive = "1.0" serde_json = "1.0" captrs = "0.3.0" clock_ticks = "0.1.0" serial = "0.3" # Optional dependencies cpuprofiler = { version = "0.0.3", optional = true }
[package] name = "helion" version = "0.5.0" authors = ["jojo <jo@jo.zone>"] description = "Ambilight clone. Stream color data of captured screen to Adalight device." repository = "https://github.com/bryal/Helion" readme = "README.md" keywords = ["ambilight", "adalight", "hyperion", "arduino", "light"] license = "AGPL-3.0" build = "build.rs" edition = "2018" [features] profiling = ["cpuprofiler"] [dependencies] serde = "1.0" serde_derive = "1.0" serde_json = "1.0" captrs = "0.3.0" clock_ticks = "0.1.0" serial = "0.3" # Optional dependencies cpuprofiler = { version = "0.0.3", optional = true }
Update manifest w attributes that crates.io wants
Update manifest w attributes that crates.io wants
TOML
agpl-3.0
bryal/Helion
toml
## Code Before: [package] name = "helion" version = "0.5.0" authors = ["jojo <jo@jo.zone>"] license = "AGPL-3.0" build = "build.rs" edition = "2018" [features] profiling = ["cpuprofiler"] [dependencies] serde = "1.0" serde_derive = "1.0" serde_json = "1.0" captrs = "0.3.0" clock_ticks = "0.1.0" serial = "0.3" # Optional dependencies cpuprofiler = { version = "0.0.3", optional = true } ## Instruction: Update manifest w attributes that crates.io wants ## Code After: [package] name = "helion" version = "0.5.0" authors = ["jojo <jo@jo.zone>"] description = "Ambilight clone. Stream color data of captured screen to Adalight device." repository = "https://github.com/bryal/Helion" readme = "README.md" keywords = ["ambilight", "adalight", "hyperion", "arduino", "light"] license = "AGPL-3.0" build = "build.rs" edition = "2018" [features] profiling = ["cpuprofiler"] [dependencies] serde = "1.0" serde_derive = "1.0" serde_json = "1.0" captrs = "0.3.0" clock_ticks = "0.1.0" serial = "0.3" # Optional dependencies cpuprofiler = { version = "0.0.3", optional = true }
[package] name = "helion" version = "0.5.0" authors = ["jojo <jo@jo.zone>"] + description = "Ambilight clone. Stream color data of captured screen to Adalight device." + repository = "https://github.com/bryal/Helion" + readme = "README.md" + keywords = ["ambilight", "adalight", "hyperion", "arduino", "light"] license = "AGPL-3.0" build = "build.rs" edition = "2018" [features] profiling = ["cpuprofiler"] [dependencies] serde = "1.0" serde_derive = "1.0" serde_json = "1.0" captrs = "0.3.0" clock_ticks = "0.1.0" serial = "0.3" # Optional dependencies cpuprofiler = { version = "0.0.3", optional = true }
4
0.190476
4
0
35430918b46d5ae7892573a9a14b54f24cf6122b
spec/controllers/clients_spec.rb
spec/controllers/clients_spec.rb
require 'rails_helper' describe ClientsController, :type => :controller do before do login @client = Client.make! end it "#index is 200" do get :index expect(response).to have_http_status 200 end it "it creates clients" do client = Client.make!(name: "TestName2", short_code: "12346") post :create, client: {name: client.name} expect(response).to_not render_template :new expect(response).to render_template nil end it "destroys Clients" do client = Client.create delete :destroy, { id: @client.id } expect(response).to redirect_to clients_path end end
require 'rails_helper' describe ClientsController, :type => :controller do before do login @client = Client.make! end it "#index is 200" do get :index expect(response).to have_http_status 200 end it "it creates clients" do client = Client.make!(name: "TestName2", short_code: "12346") post :create, client: {name: client.name} expect(response).to_not render_template :new expect(response).to render_template nil end it "destroys Clients" do client = Client.create delete :destroy, { id: @client.id } expect(response).to redirect_to clients_path end it "requires authentication" do logout if logged_in? get :index expect(response).to have_http_status 302 end end
Add Spec to Check for Login (Clients)
Add Spec to Check for Login (Clients)
Ruby
agpl-3.0
asm-products/mana-rails,asm-products/mana-rails
ruby
## Code Before: require 'rails_helper' describe ClientsController, :type => :controller do before do login @client = Client.make! end it "#index is 200" do get :index expect(response).to have_http_status 200 end it "it creates clients" do client = Client.make!(name: "TestName2", short_code: "12346") post :create, client: {name: client.name} expect(response).to_not render_template :new expect(response).to render_template nil end it "destroys Clients" do client = Client.create delete :destroy, { id: @client.id } expect(response).to redirect_to clients_path end end ## Instruction: Add Spec to Check for Login (Clients) ## Code After: require 'rails_helper' describe ClientsController, :type => :controller do before do login @client = Client.make! end it "#index is 200" do get :index expect(response).to have_http_status 200 end it "it creates clients" do client = Client.make!(name: "TestName2", short_code: "12346") post :create, client: {name: client.name} expect(response).to_not render_template :new expect(response).to render_template nil end it "destroys Clients" do client = Client.create delete :destroy, { id: @client.id } expect(response).to redirect_to clients_path end it "requires authentication" do logout if logged_in? get :index expect(response).to have_http_status 302 end end
require 'rails_helper' describe ClientsController, :type => :controller do before do login @client = Client.make! end it "#index is 200" do get :index expect(response).to have_http_status 200 end it "it creates clients" do client = Client.make!(name: "TestName2", short_code: "12346") post :create, client: {name: client.name} expect(response).to_not render_template :new expect(response).to render_template nil end it "destroys Clients" do client = Client.create delete :destroy, { id: @client.id } expect(response).to redirect_to clients_path end + + it "requires authentication" do + logout if logged_in? + get :index + expect(response).to have_http_status 302 + end end
6
0.222222
6
0
2c78e23b0f0e3eb36dfea4800d023b8c4b71e22e
app/template.rb
app/template.rb
apply "app/assets/javascripts/application.js.rb" copy_file "app/assets/stylesheets/application.css.scss" remove_file "app/assets/stylesheets/application.css" copy_file "app/controllers/home_controller.rb" copy_file "app/helpers/javascript_helper.rb" copy_file "app/helpers/layout_helper.rb" copy_file "app/helpers/retina_image_helper.rb" copy_file "app/views/layouts/application.html.erb", :force => true template "app/views/layouts/base.html.erb.tt" copy_file "app/views/shared/_flash.html.erb" copy_file "app/views/home/index.html.erb" empty_directory_with_keep_file "app/jobs" empty_directory_with_keep_file "app/workers"
apply "app/assets/javascripts/application.js.rb" copy_file "app/assets/stylesheets/application.css.scss" remove_file "app/assets/stylesheets/application.css" insert_into_file "app/controllers/application_controller.rb", :after => /protect_from_forgery.*\n/ do " ensure_security_headers\n" end copy_file "app/controllers/home_controller.rb" copy_file "app/helpers/javascript_helper.rb" copy_file "app/helpers/layout_helper.rb" copy_file "app/helpers/retina_image_helper.rb" copy_file "app/views/layouts/application.html.erb", :force => true template "app/views/layouts/base.html.erb.tt" copy_file "app/views/shared/_flash.html.erb" copy_file "app/views/home/index.html.erb" empty_directory_with_keep_file "app/jobs" empty_directory_with_keep_file "app/workers"
Add ensure_security_headers to app controller
Add ensure_security_headers to app controller
Ruby
mit
jeremymarc/rails-template,andersklenke/rails-template,andersklenke/rails-template,jeremymarc/rails-template,kgalli/rails-template,andersklenke/rails-template,mattbrictson/rails-template,mattbrictson/rails-template,kgalli/rails-template,jeremymarc/rails-template,mattbrictson/rails-template,kgalli/rails-template
ruby
## Code Before: apply "app/assets/javascripts/application.js.rb" copy_file "app/assets/stylesheets/application.css.scss" remove_file "app/assets/stylesheets/application.css" copy_file "app/controllers/home_controller.rb" copy_file "app/helpers/javascript_helper.rb" copy_file "app/helpers/layout_helper.rb" copy_file "app/helpers/retina_image_helper.rb" copy_file "app/views/layouts/application.html.erb", :force => true template "app/views/layouts/base.html.erb.tt" copy_file "app/views/shared/_flash.html.erb" copy_file "app/views/home/index.html.erb" empty_directory_with_keep_file "app/jobs" empty_directory_with_keep_file "app/workers" ## Instruction: Add ensure_security_headers to app controller ## Code After: apply "app/assets/javascripts/application.js.rb" copy_file "app/assets/stylesheets/application.css.scss" remove_file "app/assets/stylesheets/application.css" insert_into_file "app/controllers/application_controller.rb", :after => /protect_from_forgery.*\n/ do " ensure_security_headers\n" end copy_file "app/controllers/home_controller.rb" copy_file "app/helpers/javascript_helper.rb" copy_file "app/helpers/layout_helper.rb" copy_file "app/helpers/retina_image_helper.rb" copy_file "app/views/layouts/application.html.erb", :force => true template "app/views/layouts/base.html.erb.tt" copy_file "app/views/shared/_flash.html.erb" copy_file "app/views/home/index.html.erb" empty_directory_with_keep_file "app/jobs" empty_directory_with_keep_file "app/workers"
apply "app/assets/javascripts/application.js.rb" copy_file "app/assets/stylesheets/application.css.scss" remove_file "app/assets/stylesheets/application.css" + + insert_into_file "app/controllers/application_controller.rb", + :after => /protect_from_forgery.*\n/ do + " ensure_security_headers\n" + end copy_file "app/controllers/home_controller.rb" copy_file "app/helpers/javascript_helper.rb" copy_file "app/helpers/layout_helper.rb" copy_file "app/helpers/retina_image_helper.rb" copy_file "app/views/layouts/application.html.erb", :force => true template "app/views/layouts/base.html.erb.tt" copy_file "app/views/shared/_flash.html.erb" copy_file "app/views/home/index.html.erb" empty_directory_with_keep_file "app/jobs" empty_directory_with_keep_file "app/workers"
5
0.357143
5
0
ce5e0b35957e77cbb040a9be22e4edd3195c9d50
Form/TransUnitType.php
Form/TransUnitType.php
<?php namespace Lexik\Bundle\TranslationBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * TransUnit form type. * * @author Cédric Girard <c.girard@lexik.fr> */ class TransUnitType extends AbstractType { /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('key'); $builder->add('domain', 'choice', array( 'choices' => array_combine($options['domains'], $options['domains']), )); $builder->add('translations', 'collection', array( 'type' => new TranslationType(), 'required' => false, 'options' => array( 'data_class' => $options['translation_class'], ) )); } /** * {@inheritdoc} */ public function setDefaultOptions(OptionsResolverInterface $resolver) { parent::setDefaultOptions($resolver); $resolver->setDefaults(array( 'data_class' => null, 'domains' => array('messages'), 'translation_class' => null, )); } /** * {@inheritdoc} */ public function getName() { return 'trans_unit'; } }
<?php namespace Lexik\Bundle\TranslationBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * TransUnit form type. * * @author Cédric Girard <c.girard@lexik.fr> */ class TransUnitType extends AbstractType { /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('key', 'text', array( 'label' => 'translations.key', )); $builder->add('domain', 'choice', array( 'label' => 'translations.domain', 'choices' => array_combine($options['domains'], $options['domains']), )); $builder->add('translations', 'collection', array( 'type' => 'lxk_translation', 'label' => 'translations.page_title', 'required' => false, 'options' => array( 'data_class' => $options['translation_class'], ) )); } /** * {@inheritdoc} */ public function setDefaultOptions(OptionsResolverInterface $resolver) { parent::setDefaultOptions($resolver); $resolver->setDefaults(array( 'data_class' => null, 'domains' => array('messages'), 'translation_class' => null, )); } /** * {@inheritdoc} */ public function getName() { return 'trans_unit'; } }
Add label to be translated for form
Add label to be translated for form For the moment the form is not translated.
PHP
mit
BeneyluSchool/LexikTranslationBundle,lexik/LexikTranslationBundle,ubiedigital/LexikTranslationBundle,shakaran/LexikTranslationBundle,rvanlaarhoven/LexikTranslationBundle,lexik/LexikTranslationBundle,Atyz/LexikTranslationBundle,BeneyluSchool/LexikTranslationBundle,ubiedigital/LexikTranslationBundle,bdebon/LexikTranslationBundle,intexsys/LexikTranslationBundle,rvanlaarhoven/LexikTranslationBundle,Rvanlaak/LexikTranslationBundle,rvanlaarhoven/LexikTranslationBundle,shakaran/LexikTranslationBundle,bdebon/LexikTranslationBundle,shakaran/LexikTranslationBundle,Atyz/LexikTranslationBundle,Rvanlaak/LexikTranslationBundle,Atyz/LexikTranslationBundle,ubiedigital/LexikTranslationBundle,intexsys/LexikTranslationBundle,ubiedigital/LexikTranslationBundle,bdebon/LexikTranslationBundle,Rvanlaak/LexikTranslationBundle,BeneyluSchool/LexikTranslationBundle
php
## Code Before: <?php namespace Lexik\Bundle\TranslationBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * TransUnit form type. * * @author Cédric Girard <c.girard@lexik.fr> */ class TransUnitType extends AbstractType { /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('key'); $builder->add('domain', 'choice', array( 'choices' => array_combine($options['domains'], $options['domains']), )); $builder->add('translations', 'collection', array( 'type' => new TranslationType(), 'required' => false, 'options' => array( 'data_class' => $options['translation_class'], ) )); } /** * {@inheritdoc} */ public function setDefaultOptions(OptionsResolverInterface $resolver) { parent::setDefaultOptions($resolver); $resolver->setDefaults(array( 'data_class' => null, 'domains' => array('messages'), 'translation_class' => null, )); } /** * {@inheritdoc} */ public function getName() { return 'trans_unit'; } } ## Instruction: Add label to be translated for form For the moment the form is not translated. ## Code After: <?php namespace Lexik\Bundle\TranslationBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * TransUnit form type. * * @author Cédric Girard <c.girard@lexik.fr> */ class TransUnitType extends AbstractType { /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('key', 'text', array( 'label' => 'translations.key', )); $builder->add('domain', 'choice', array( 'label' => 'translations.domain', 'choices' => array_combine($options['domains'], $options['domains']), )); $builder->add('translations', 'collection', array( 'type' => 'lxk_translation', 'label' => 'translations.page_title', 'required' => false, 'options' => array( 'data_class' => $options['translation_class'], ) )); } /** * {@inheritdoc} */ public function setDefaultOptions(OptionsResolverInterface $resolver) { parent::setDefaultOptions($resolver); $resolver->setDefaults(array( 'data_class' => null, 'domains' => array('messages'), 'translation_class' => null, )); } /** * {@inheritdoc} */ public function getName() { return 'trans_unit'; } }
<?php namespace Lexik\Bundle\TranslationBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; /** * TransUnit form type. * * @author Cédric Girard <c.girard@lexik.fr> */ class TransUnitType extends AbstractType { /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { - $builder->add('key'); ? ^^ + $builder->add('key', 'text', array( ? ^^^^^^^^^^^^^^^^ + 'label' => 'translations.key', + )); $builder->add('domain', 'choice', array( + 'label' => 'translations.domain', 'choices' => array_combine($options['domains'], $options['domains']), )); $builder->add('translations', 'collection', array( - 'type' => new TranslationType(), ? ^^^^^ ^^^^^^ + 'type' => 'lxk_translation', ? ++++ ^^^^^^ ^ + 'label' => 'translations.page_title', 'required' => false, - 'options' => array( + 'options' => array( ? + 'data_class' => $options['translation_class'], ) )); } /** * {@inheritdoc} */ public function setDefaultOptions(OptionsResolverInterface $resolver) { parent::setDefaultOptions($resolver); $resolver->setDefaults(array( 'data_class' => null, 'domains' => array('messages'), 'translation_class' => null, )); } /** * {@inheritdoc} */ public function getName() { return 'trans_unit'; } }
10
0.181818
7
3
61a33e9a9662ac3cf0f169a819eb0ccfedf1458c
.travis.yml
.travis.yml
language: ruby rvm: - 2.4.2 - 2.3.5 - 2.2.8 gemfile: - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile - gemfiles/rails_5.1.gemfile addons: code_climate: repo_token: 50425d682162d68af0b65bd9e5160da8337d2159fc3ebc00d2a5b14386548ac5 after_success: - bundle exec codeclimate-test-reporter
language: ruby rvm: - 2.6.3 - 2.5.3 - 2.4.6 - 2.3.7 - 2.2.10 gemfile: - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile - gemfiles/rails_5.1.gemfile addons: code_climate: repo_token: 50425d682162d68af0b65bd9e5160da8337d2159fc3ebc00d2a5b14386548ac5 after_success: - bundle exec codeclimate-test-reporter
Add more recent Ruby versions to Travis
Add more recent Ruby versions to Travis
YAML
mit
ssaunier/github_webhook
yaml
## Code Before: language: ruby rvm: - 2.4.2 - 2.3.5 - 2.2.8 gemfile: - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile - gemfiles/rails_5.1.gemfile addons: code_climate: repo_token: 50425d682162d68af0b65bd9e5160da8337d2159fc3ebc00d2a5b14386548ac5 after_success: - bundle exec codeclimate-test-reporter ## Instruction: Add more recent Ruby versions to Travis ## Code After: language: ruby rvm: - 2.6.3 - 2.5.3 - 2.4.6 - 2.3.7 - 2.2.10 gemfile: - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile - gemfiles/rails_5.1.gemfile addons: code_climate: repo_token: 50425d682162d68af0b65bd9e5160da8337d2159fc3ebc00d2a5b14386548ac5 after_success: - bundle exec codeclimate-test-reporter
language: ruby rvm: + - 2.6.3 + - 2.5.3 - - 2.4.2 ? ^ + - 2.4.6 ? ^ - - 2.3.5 ? ^ + - 2.3.7 ? ^ - - 2.2.8 ? ^ + - 2.2.10 ? ^^ gemfile: - gemfiles/rails_4.2.gemfile - gemfiles/rails_5.0.gemfile - gemfiles/rails_5.1.gemfile addons: code_climate: repo_token: 50425d682162d68af0b65bd9e5160da8337d2159fc3ebc00d2a5b14386548ac5 after_success: - bundle exec codeclimate-test-reporter
8
0.571429
5
3
e5bb07527e3f65e455b14f40b4a72263fb196cab
check_tests/eas_check_to_junit.xsl
check_tests/eas_check_to_junit.xsl
<?xml version="1.0" encoding="Windows-1252"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:chk="http://check.sourceforge.net/ns"> <xsl:output encoding="utf-8" indent="yes"/> <xsl:template match="chk:testsuites"> <testsuites> <xsl:apply-templates select="chk:suite"/> </testsuites> </xsl:template> <xsl:template match="chk:suite"> <xsl:for-each select="chk:test"> <xsl:element name="testcase"> <xsl:attribute name="classname"> <xsl:value-of select="chk:description"/> </xsl:attribute> <xsl:attribute name="name"> <xsl:value-of select="chk:id"/> </xsl:attribute> </xsl:element> </xsl:for-each> </xsl:template> </xsl:stylesheet>
<?xml version="1.0" encoding="Windows-1252"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:chk="http://check.sourceforge.net/ns"> <xsl:output encoding="utf-8" indent="yes"/> <xsl:template match="chk:testsuites"> <testsuites> <xsl:apply-templates select="chk:suite"/> </testsuites> </xsl:template> <xsl:template match="chk:suite"> <testsuite> <properties/> <xsl:for-each select="chk:test"> <xsl:element name="testcase"> <xsl:attribute name="classname"> <xsl:value-of select="chk:description"/> </xsl:attribute> <xsl:attribute name="name"> <xsl:value-of select="chk:id"/> </xsl:attribute> </xsl:element> </xsl:for-each> </testsuite> </xsl:template> </xsl:stylesheet>
Fix bug in test results conversion script
Fix bug in test results conversion script
XSLT
lgpl-2.1
simo5/evolution-activesync,simo5/evolution-activesync,simo5/evolution-activesync
xslt
## Code Before: <?xml version="1.0" encoding="Windows-1252"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:chk="http://check.sourceforge.net/ns"> <xsl:output encoding="utf-8" indent="yes"/> <xsl:template match="chk:testsuites"> <testsuites> <xsl:apply-templates select="chk:suite"/> </testsuites> </xsl:template> <xsl:template match="chk:suite"> <xsl:for-each select="chk:test"> <xsl:element name="testcase"> <xsl:attribute name="classname"> <xsl:value-of select="chk:description"/> </xsl:attribute> <xsl:attribute name="name"> <xsl:value-of select="chk:id"/> </xsl:attribute> </xsl:element> </xsl:for-each> </xsl:template> </xsl:stylesheet> ## Instruction: Fix bug in test results conversion script ## Code After: <?xml version="1.0" encoding="Windows-1252"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:chk="http://check.sourceforge.net/ns"> <xsl:output encoding="utf-8" indent="yes"/> <xsl:template match="chk:testsuites"> <testsuites> <xsl:apply-templates select="chk:suite"/> </testsuites> </xsl:template> <xsl:template match="chk:suite"> <testsuite> <properties/> <xsl:for-each select="chk:test"> <xsl:element name="testcase"> <xsl:attribute name="classname"> <xsl:value-of select="chk:description"/> </xsl:attribute> <xsl:attribute name="name"> <xsl:value-of select="chk:id"/> </xsl:attribute> </xsl:element> </xsl:for-each> </testsuite> </xsl:template> </xsl:stylesheet>
<?xml version="1.0" encoding="Windows-1252"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:chk="http://check.sourceforge.net/ns"> <xsl:output encoding="utf-8" indent="yes"/> <xsl:template match="chk:testsuites"> <testsuites> <xsl:apply-templates select="chk:suite"/> </testsuites> </xsl:template> <xsl:template match="chk:suite"> + <testsuite> + <properties/> <xsl:for-each select="chk:test"> <xsl:element name="testcase"> <xsl:attribute name="classname"> <xsl:value-of select="chk:description"/> </xsl:attribute> <xsl:attribute name="name"> <xsl:value-of select="chk:id"/> </xsl:attribute> </xsl:element> </xsl:for-each> + </testsuite> </xsl:template> </xsl:stylesheet>
3
0.115385
3
0
9679bc4d2cc680bf7808c7a5cf7ac4701250d450
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
.github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Thank you for opening a Pull Request! Please provide answers to the following questions, delete examples. -------------------------------------------------------------------------------- ## Does this PR concern a dataset or tutorial? (Example) Tutorial (Example) Dataset ## What does this PR do? (Example) Adds a new tutorial (Example) Fixes an existing tutorial (Example) Adds a code sample for a dataset (Example) Adds code to process a dataset ## Does this PR address an issue (what number)? (Example) Closes #123 (Example) Addresses #123 (Example) No ## Does this PR concern a particular Earth Engine team member (who)? (Example) No (Example) Simon (Example) Gino
Thank you for opening a Pull Request! Please provide answers to the following questions, delete examples. -------------------------------------------------------------------------------- ## Does this PR concern a dataset or tutorial? (Example) Tutorial (Example) Dataset ## What does this PR do? (Example) Adds a new tutorial (Example) Fixes an existing tutorial (Example) Adds a code sample for a dataset (Example) Adds code to process a dataset ## Does this PR address an issue (what number)? (Example) Closes #123 (Example) Addresses #123 ## Does this PR concern a particular Earth Engine team member (who)? (Example) @gino-m
Remove "no" examples, use GH handle for name
Remove "no" examples, use GH handle for name
Markdown
apache-2.0
google/earthengine-community,google/earthengine-community,google/earthengine-community
markdown
## Code Before: Thank you for opening a Pull Request! Please provide answers to the following questions, delete examples. -------------------------------------------------------------------------------- ## Does this PR concern a dataset or tutorial? (Example) Tutorial (Example) Dataset ## What does this PR do? (Example) Adds a new tutorial (Example) Fixes an existing tutorial (Example) Adds a code sample for a dataset (Example) Adds code to process a dataset ## Does this PR address an issue (what number)? (Example) Closes #123 (Example) Addresses #123 (Example) No ## Does this PR concern a particular Earth Engine team member (who)? (Example) No (Example) Simon (Example) Gino ## Instruction: Remove "no" examples, use GH handle for name ## Code After: Thank you for opening a Pull Request! Please provide answers to the following questions, delete examples. -------------------------------------------------------------------------------- ## Does this PR concern a dataset or tutorial? (Example) Tutorial (Example) Dataset ## What does this PR do? (Example) Adds a new tutorial (Example) Fixes an existing tutorial (Example) Adds a code sample for a dataset (Example) Adds code to process a dataset ## Does this PR address an issue (what number)? (Example) Closes #123 (Example) Addresses #123 ## Does this PR concern a particular Earth Engine team member (who)? (Example) @gino-m
- Thank you for opening a Pull Request! ? - + Thank you for opening a Pull Request! Please provide answers to the following questions, delete examples. -------------------------------------------------------------------------------- ## Does this PR concern a dataset or tutorial? (Example) Tutorial (Example) Dataset ## What does this PR do? (Example) Adds a new tutorial (Example) Fixes an existing tutorial (Example) Adds a code sample for a dataset (Example) Adds code to process a dataset ## Does this PR address an issue (what number)? (Example) Closes #123 (Example) Addresses #123 - (Example) No ## Does this PR concern a particular Earth Engine team member (who)? - (Example) No - (Example) Simon - (Example) Gino ? ^ + (Example) @gino-m ? ^^ ++
7
0.241379
2
5
b7f2efe79e5a91ab78850842eafc73d1ee0a52cc
shortuuid/__init__.py
shortuuid/__init__.py
from shortuuid.main import ( encode, decode, uuid, get_alphabet, set_alphabet, ShortUUID, )
from shortuuid.main import ( encode, decode, uuid, random, get_alphabet, set_alphabet, ShortUUID, )
Include `random` in imports from shortuuid.main
Include `random` in imports from shortuuid.main When `random` was added to `main.py` the `__init__.py` file wasn't updated to expose it. Currently, to use, you have to do: `import shortuuid; shortuuid.main.random(24)`. With these changes you can do `import shortuuid; shortuuid.random()`. This better mirrors the behavior of `uuid`, etc.
Python
bsd-3-clause
skorokithakis/shortuuid,stochastic-technologies/shortuuid
python
## Code Before: from shortuuid.main import ( encode, decode, uuid, get_alphabet, set_alphabet, ShortUUID, ) ## Instruction: Include `random` in imports from shortuuid.main When `random` was added to `main.py` the `__init__.py` file wasn't updated to expose it. Currently, to use, you have to do: `import shortuuid; shortuuid.main.random(24)`. With these changes you can do `import shortuuid; shortuuid.random()`. This better mirrors the behavior of `uuid`, etc. ## Code After: from shortuuid.main import ( encode, decode, uuid, random, get_alphabet, set_alphabet, ShortUUID, )
from shortuuid.main import ( encode, decode, uuid, + random, get_alphabet, set_alphabet, ShortUUID, )
1
0.125
1
0
a06307a524685fddd961106e2a9ddba41e4a1e1e
README.md
README.md
Utility library for handy usage of exit statuses in Java software ## Related Resource All bookmarks to related resources are collected at [delicious](https://delicious.com/anton.vorobyev/exitsign)
"A picture is worth a thousand words" [![Build Status](https://travis-ci.org/antonvorobyev/exitsign.svg)](https://travis-ci.org/antonvorobyev/exitsign) # Exit Sign Exit Sign is utility library for handy usage of exit statuses in Java software. ## Continuous Integration Exit Sign loves continuous integration and we use wonderful [Travis CI](https://travis-ci.org/antonvorobyev/exitsign). Now our build status for master [![Build Status](https://travis-ci.org/antonvorobyev/exitsign.svg)](https://travis-ci.org/antonvorobyev/exitsign) ## Related Resource All bookmarks to related resources are collected at [Delicious](https://delicious.com/anton.vorobyev/exitsign).
Add info about continuous integration
Add info about continuous integration Refers to #12, #7
Markdown
apache-2.0
antonvorobyev/exitsign
markdown
## Code Before: Utility library for handy usage of exit statuses in Java software ## Related Resource All bookmarks to related resources are collected at [delicious](https://delicious.com/anton.vorobyev/exitsign) ## Instruction: Add info about continuous integration Refers to #12, #7 ## Code After: "A picture is worth a thousand words" [![Build Status](https://travis-ci.org/antonvorobyev/exitsign.svg)](https://travis-ci.org/antonvorobyev/exitsign) # Exit Sign Exit Sign is utility library for handy usage of exit statuses in Java software. ## Continuous Integration Exit Sign loves continuous integration and we use wonderful [Travis CI](https://travis-ci.org/antonvorobyev/exitsign). Now our build status for master [![Build Status](https://travis-ci.org/antonvorobyev/exitsign.svg)](https://travis-ci.org/antonvorobyev/exitsign) ## Related Resource All bookmarks to related resources are collected at [Delicious](https://delicious.com/anton.vorobyev/exitsign).
+ "A picture is worth a thousand words" + + [![Build Status](https://travis-ci.org/antonvorobyev/exitsign.svg)](https://travis-ci.org/antonvorobyev/exitsign) + + # Exit Sign + - Utility library for handy usage of exit statuses in Java software ? ^ + Exit Sign is utility library for handy usage of exit statuses in Java software. ? ^^^^^^^^^^^^^^ + + + ## Continuous Integration + + Exit Sign loves continuous integration and we use wonderful + [Travis CI](https://travis-ci.org/antonvorobyev/exitsign). + + Now our build status for master [![Build Status](https://travis-ci.org/antonvorobyev/exitsign.svg)](https://travis-ci.org/antonvorobyev/exitsign) ## Related Resource - All bookmarks to related resources are collected at [delicious](https://delicious.com/anton.vorobyev/exitsign) ? ^ + All bookmarks to related resources are collected at [Delicious](https://delicious.com/anton.vorobyev/exitsign). ? ^ +
17
3.4
15
2
66c2f23764952784ce212c2e57ff8b0250a5d2b5
resources/views/settings.blade.php
resources/views/settings.blade.php
<form method="POST" action="{{ action('SettingsController@update') }}"> <input type="hidden" name="_method" value="PATCH" /> {!! csrf_field() !!} @if(version_compare($version, '5.3.0') < 0) @include('geniusts_preferences::settings_5_2') @else @include('geniusts_preferences::settings_5_3') @endif <div class="row"> <div class="col-xs-12"> <button type="submit" class="btn btn-primary"> Save </button> </div> </div> </form>
<form method="POST" action="{{ action('SettingsController@update') }}"> @if($errors->count()) <div class="alert alert-danger alert-dismissible fade in"> <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> <ul> @foreach($errors->all() as $error) <li> {{ $error }} </li> @endforeach </ul> </div> @endif <input type="hidden" name="_method" value="PATCH"/> {!! csrf_field() !!} @if(version_compare($version, '5.3.0') < 0) @include('geniusts_preferences::settings_5_2') @else @include('geniusts_preferences::settings_5_3') @endif <div class="row"> <div class="col-xs-12"> <button type="submit" class="btn btn-primary"> Save </button> </div> </div> </form>
Add errors to the form
Add errors to the form
PHP
mit
GeniusTS/preferences,GeniusTS/preferences
php
## Code Before: <form method="POST" action="{{ action('SettingsController@update') }}"> <input type="hidden" name="_method" value="PATCH" /> {!! csrf_field() !!} @if(version_compare($version, '5.3.0') < 0) @include('geniusts_preferences::settings_5_2') @else @include('geniusts_preferences::settings_5_3') @endif <div class="row"> <div class="col-xs-12"> <button type="submit" class="btn btn-primary"> Save </button> </div> </div> </form> ## Instruction: Add errors to the form ## Code After: <form method="POST" action="{{ action('SettingsController@update') }}"> @if($errors->count()) <div class="alert alert-danger alert-dismissible fade in"> <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> <ul> @foreach($errors->all() as $error) <li> {{ $error }} </li> @endforeach </ul> </div> @endif <input type="hidden" name="_method" value="PATCH"/> {!! csrf_field() !!} @if(version_compare($version, '5.3.0') < 0) @include('geniusts_preferences::settings_5_2') @else @include('geniusts_preferences::settings_5_3') @endif <div class="row"> <div class="col-xs-12"> <button type="submit" class="btn btn-primary"> Save </button> </div> </div> </form>
<form method="POST" action="{{ action('SettingsController@update') }}"> + @if($errors->count()) + <div class="alert alert-danger alert-dismissible fade in"> + <button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button> + + <ul> + @foreach($errors->all() as $error) + <li> + {{ $error }} + </li> + @endforeach + </ul> + </div> + @endif + - <input type="hidden" name="_method" value="PATCH" /> ? - + <input type="hidden" name="_method" value="PATCH"/> {!! csrf_field() !!} @if(version_compare($version, '5.3.0') < 0) @include('geniusts_preferences::settings_5_2') @else @include('geniusts_preferences::settings_5_3') @endif <div class="row"> <div class="col-xs-12"> <button type="submit" class="btn btn-primary"> Save </button> </div> </div> </form>
16
0.888889
15
1
a402ef537dfb27a09291b14e230494a7b98e739f
app/activity/templates/card-created-notification.hbs
app/activity/templates/card-created-notification.hbs
<div class="notification-data"> <span class="notification-time text-muted">{{time}}</span> <p class="notification-text"> <span class="notification-actor">{{actor.username}}</span> created a card on board <a href="{{board.html_url}}" class="notification-board">{{board.name}}</a> </p> {{! .notification-text }} </div> {{! .notification-data }} <div class="notification-preview"> <img src="{{actor.gravatar_url}}" alt="{{actor.first_name}} {{actor.last_name}}" class="ui-avatar user-avatar md"> <div class="card is-item has-loaded-preview" data-type="{{card.type}}"> <a href="{{card.html_url}}" title="{{card.name}}"> {{#is card.type "note"}} {{partial "public-board/templates/note" card}} {{else}} {{partial "public-board/templates/file" card}} {{/is}} </a> {{! }} </div> {{! .card }} </div> {{! .notification-preview }}
<div class="notification-data"> <span class="notification-time text-muted">{{time}}</span> <p class="notification-text"> <span class="notification-actor">{{actor.username}}</span> created a card on board <a href="{{board.html_url}}" class="notification-board">{{board.name}}</a> </p> {{! .notification-text }} </div> {{! .notification-data }} <div class="notification-preview"> <img src="{{actor.gravatar_url}}" alt="{{actor.first_name}} {{actor.last_name}}" class="ui-avatar user-avatar md"> <div class="card is-item has-loaded-preview" data-type="{{card.type}}"> <a class="notification-preview-link" href="{{to-route card.html_url}}" title="{{card.name}}" data-route="true"> {{#is card.type "note"}} {{partial "public-board/templates/note" card}} {{else}} {{partial "public-board/templates/file" card}} {{/is}} </a> {{! .notification-preview-link }} </div> {{! .card }} </div> {{! .notification-preview }}
Fix card preview url on notifications page.
Fix card preview url on notifications page.
Handlebars
agpl-3.0
jessamynsmith/boards-web,GetBlimp/boards-web,jessamynsmith/boards-web
handlebars
## Code Before: <div class="notification-data"> <span class="notification-time text-muted">{{time}}</span> <p class="notification-text"> <span class="notification-actor">{{actor.username}}</span> created a card on board <a href="{{board.html_url}}" class="notification-board">{{board.name}}</a> </p> {{! .notification-text }} </div> {{! .notification-data }} <div class="notification-preview"> <img src="{{actor.gravatar_url}}" alt="{{actor.first_name}} {{actor.last_name}}" class="ui-avatar user-avatar md"> <div class="card is-item has-loaded-preview" data-type="{{card.type}}"> <a href="{{card.html_url}}" title="{{card.name}}"> {{#is card.type "note"}} {{partial "public-board/templates/note" card}} {{else}} {{partial "public-board/templates/file" card}} {{/is}} </a> {{! }} </div> {{! .card }} </div> {{! .notification-preview }} ## Instruction: Fix card preview url on notifications page. ## Code After: <div class="notification-data"> <span class="notification-time text-muted">{{time}}</span> <p class="notification-text"> <span class="notification-actor">{{actor.username}}</span> created a card on board <a href="{{board.html_url}}" class="notification-board">{{board.name}}</a> </p> {{! .notification-text }} </div> {{! .notification-data }} <div class="notification-preview"> <img src="{{actor.gravatar_url}}" alt="{{actor.first_name}} {{actor.last_name}}" class="ui-avatar user-avatar md"> <div class="card is-item has-loaded-preview" data-type="{{card.type}}"> <a class="notification-preview-link" href="{{to-route card.html_url}}" title="{{card.name}}" data-route="true"> {{#is card.type "note"}} {{partial "public-board/templates/note" card}} {{else}} {{partial "public-board/templates/file" card}} {{/is}} </a> {{! .notification-preview-link }} </div> {{! .card }} </div> {{! .notification-preview }}
<div class="notification-data"> <span class="notification-time text-muted">{{time}}</span> <p class="notification-text"> <span class="notification-actor">{{actor.username}}</span> created a card on board <a href="{{board.html_url}}" class="notification-board">{{board.name}}</a> </p> {{! .notification-text }} </div> {{! .notification-data }} <div class="notification-preview"> <img src="{{actor.gravatar_url}}" alt="{{actor.first_name}} {{actor.last_name}}" class="ui-avatar user-avatar md"> <div class="card is-item has-loaded-preview" data-type="{{card.type}}"> - <a href="{{card.html_url}}" title="{{card.name}}"> + <a class="notification-preview-link" href="{{to-route card.html_url}}" title="{{card.name}}" data-route="true"> {{#is card.type "note"}} {{partial "public-board/templates/note" card}} {{else}} {{partial "public-board/templates/file" card}} {{/is}} - </a> {{! }} + </a> {{! .notification-preview-link }} </div> {{! .card }} </div> {{! .notification-preview }}
4
0.190476
2
2
52cfb9934ef055cdbb3675692c7ddb8d0236e013
Code/Boot/phase3.lisp
Code/Boot/phase3.lisp
(cl:in-package #:sicl-boot) (defclass header () ((%class :initarg :class :accessor class) (%rack :initarg :rack :reader rack))) (defun define-allocate-general-instance (env) (setf (sicl-genv:fdefinition 'sicl-clos:allocate-general-instance env) (lambda (class size) (make-instance 'header :class class :rack (make-array size))))) (defun phase3 () (let ((r2 *phase2-mop-class-env*) (r3 *phase2-mop-accessor-env*)) (message "Start of phase 3~%") (ld "../CLOS/class-finalization-support.lisp" r2 r2) (define-allocate-general-instance r3) (message "End of phase 3~%")))
(cl:in-package #:sicl-boot) (defclass header () ((%class :initarg :class :accessor class) (%rack :initarg :rack :reader rack))) (defun define-allocate-general-instance (env) (setf (sicl-genv:fdefinition 'sicl-clos:allocate-general-instance env) (lambda (class size) (make-instance 'header :class class :rack (make-array size))))) (defun phase3 () (let ((r2 *phase2-mop-class-env*) (r3 *phase2-mop-accessor-env*)) (message "Start of phase 3~%") (ld "../CLOS/class-finalization-support.lisp" r2 r2) (ld "../CLOS/class-finalization-defuns.lisp" r2 r2) (define-allocate-general-instance r3) (message "End of phase 3~%")))
Load a file containing function definitions for class finalization.
Load a file containing function definitions for class finalization.
Common Lisp
bsd-2-clause
vtomole/SICL,clasp-developers/SICL,vtomole/SICL,vtomole/SICL,clasp-developers/SICL,clasp-developers/SICL,vtomole/SICL,clasp-developers/SICL
common-lisp
## Code Before: (cl:in-package #:sicl-boot) (defclass header () ((%class :initarg :class :accessor class) (%rack :initarg :rack :reader rack))) (defun define-allocate-general-instance (env) (setf (sicl-genv:fdefinition 'sicl-clos:allocate-general-instance env) (lambda (class size) (make-instance 'header :class class :rack (make-array size))))) (defun phase3 () (let ((r2 *phase2-mop-class-env*) (r3 *phase2-mop-accessor-env*)) (message "Start of phase 3~%") (ld "../CLOS/class-finalization-support.lisp" r2 r2) (define-allocate-general-instance r3) (message "End of phase 3~%"))) ## Instruction: Load a file containing function definitions for class finalization. ## Code After: (cl:in-package #:sicl-boot) (defclass header () ((%class :initarg :class :accessor class) (%rack :initarg :rack :reader rack))) (defun define-allocate-general-instance (env) (setf (sicl-genv:fdefinition 'sicl-clos:allocate-general-instance env) (lambda (class size) (make-instance 'header :class class :rack (make-array size))))) (defun phase3 () (let ((r2 *phase2-mop-class-env*) (r3 *phase2-mop-accessor-env*)) (message "Start of phase 3~%") (ld "../CLOS/class-finalization-support.lisp" r2 r2) (ld "../CLOS/class-finalization-defuns.lisp" r2 r2) (define-allocate-general-instance r3) (message "End of phase 3~%")))
(cl:in-package #:sicl-boot) (defclass header () ((%class :initarg :class :accessor class) (%rack :initarg :rack :reader rack))) (defun define-allocate-general-instance (env) (setf (sicl-genv:fdefinition 'sicl-clos:allocate-general-instance env) (lambda (class size) (make-instance 'header :class class :rack (make-array size))))) (defun phase3 () (let ((r2 *phase2-mop-class-env*) (r3 *phase2-mop-accessor-env*)) (message "Start of phase 3~%") (ld "../CLOS/class-finalization-support.lisp" r2 r2) + (ld "../CLOS/class-finalization-defuns.lisp" r2 r2) (define-allocate-general-instance r3) (message "End of phase 3~%")))
1
0.05
1
0
407e7466f368c48ea8d139e6db662030fe3c821b
.travis.yml
.travis.yml
language: python python: - 2.7 - 3.3 - 3.4 - 3.5 - 3.6 dist: trusty sudo: false matrix: include: - language: generic python: 2.7 os: osx - language: generic python: 3.3 os: osx - language: generic python: 3.4 os: osx - language: generic python: 3.5 os: osx - language: generic python: 3.6 os: osx before_install: - pip install --quiet codecov wheel install: - make install script: - make test after_success: - bash <(curl -s https://codecov.io/bash)
language: python python: - 2.7 - 3.3 - 3.4 - 3.5 - 3.6 - nightly - pypy-5.7.1 dist: trusty sudo: false matrix: include: - language: generic python: 2.7 os: osx - language: generic python: 3.3 os: osx - language: generic python: 3.4 os: osx - language: generic python: 3.5 os: osx - language: generic python: 3.6 os: osx before_install: - pip install --quiet codecov wheel install: - make install script: - make test after_success: - bash <(curl -s https://codecov.io/bash)
Add pypy and nightly runtimes
Add pypy and nightly runtimes
YAML
apache-2.0
kislyuk/rehash
yaml
## Code Before: language: python python: - 2.7 - 3.3 - 3.4 - 3.5 - 3.6 dist: trusty sudo: false matrix: include: - language: generic python: 2.7 os: osx - language: generic python: 3.3 os: osx - language: generic python: 3.4 os: osx - language: generic python: 3.5 os: osx - language: generic python: 3.6 os: osx before_install: - pip install --quiet codecov wheel install: - make install script: - make test after_success: - bash <(curl -s https://codecov.io/bash) ## Instruction: Add pypy and nightly runtimes ## Code After: language: python python: - 2.7 - 3.3 - 3.4 - 3.5 - 3.6 - nightly - pypy-5.7.1 dist: trusty sudo: false matrix: include: - language: generic python: 2.7 os: osx - language: generic python: 3.3 os: osx - language: generic python: 3.4 os: osx - language: generic python: 3.5 os: osx - language: generic python: 3.6 os: osx before_install: - pip install --quiet codecov wheel install: - make install script: - make test after_success: - bash <(curl -s https://codecov.io/bash)
language: python python: - 2.7 - 3.3 - 3.4 - 3.5 - 3.6 + - nightly + - pypy-5.7.1 dist: trusty sudo: false matrix: include: - language: generic python: 2.7 os: osx - language: generic python: 3.3 os: osx - language: generic python: 3.4 os: osx - language: generic python: 3.5 os: osx - language: generic python: 3.6 os: osx before_install: - pip install --quiet codecov wheel install: - make install script: - make test after_success: - bash <(curl -s https://codecov.io/bash)
2
0.05
2
0
3e68526c7cfacd575f254479ba1bbcf7cf185491
test/test_helper.rb
test/test_helper.rb
ENV['RAILS_ENV'] = 'test' require File.expand_path('../dummy/config/environment.rb', __FILE__) require 'rails/test_help' Minitest.backtrace_filter = Minitest::BacktraceFilter.new ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__) ActiveSupport::TestCase.fixtures :all
ENV['RAILS_ENV'] = 'test' require File.expand_path('../dummy/config/environment.rb', __FILE__) require 'rails/test_help' require 'minitest/pride' Minitest.backtrace_filter = Minitest::BacktraceFilter.new ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__) ActiveSupport::TestCase.fixtures :all
Add MiniTest Pride coloured output
Add MiniTest Pride coloured output
Ruby
mit
pbougie/dismissible_blocks,pbougie/dismissible_blocks,pbougie/dismissible_blocks
ruby
## Code Before: ENV['RAILS_ENV'] = 'test' require File.expand_path('../dummy/config/environment.rb', __FILE__) require 'rails/test_help' Minitest.backtrace_filter = Minitest::BacktraceFilter.new ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__) ActiveSupport::TestCase.fixtures :all ## Instruction: Add MiniTest Pride coloured output ## Code After: ENV['RAILS_ENV'] = 'test' require File.expand_path('../dummy/config/environment.rb', __FILE__) require 'rails/test_help' require 'minitest/pride' Minitest.backtrace_filter = Minitest::BacktraceFilter.new ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__) ActiveSupport::TestCase.fixtures :all
ENV['RAILS_ENV'] = 'test' require File.expand_path('../dummy/config/environment.rb', __FILE__) require 'rails/test_help' + require 'minitest/pride' Minitest.backtrace_filter = Minitest::BacktraceFilter.new ActiveSupport::TestCase.fixture_path = File.expand_path('../fixtures', __FILE__) ActiveSupport::TestCase.fixtures :all
1
0.125
1
0
3bb7653fa660fbbaa43db3881ed96ef9e442a8aa
automation_script.js
automation_script.js
var target = UIATarget.localTarget(); ListScreen.tapCellWithName("coffee") target.delay(0.5); var text = DetailScreen.displayedText(); if (text != "coffee") { UIALogger.logError("Expected to see 'coffee'"); } else { DetailScreen.tapBackButton(); } target.delay(0.5);
var target = UIATarget.localTarget(); ListScreen.tapCellWithName("coffee") target.delay(0.5); var text = DetailScreen.displayedText(); if (text != "coffee") { UIALogger.logError("Expected to see 'coffee'"); } else { UIALogger.logMessage("Saw 'coffee'!"); DetailScreen.tapBackButton(); } target.delay(0.5);
Print a message on success, too
Print a message on success, too
JavaScript
mit
jonathanpenn/AutomationExample,jonathanpenn/AutomationExample
javascript
## Code Before: var target = UIATarget.localTarget(); ListScreen.tapCellWithName("coffee") target.delay(0.5); var text = DetailScreen.displayedText(); if (text != "coffee") { UIALogger.logError("Expected to see 'coffee'"); } else { DetailScreen.tapBackButton(); } target.delay(0.5); ## Instruction: Print a message on success, too ## Code After: var target = UIATarget.localTarget(); ListScreen.tapCellWithName("coffee") target.delay(0.5); var text = DetailScreen.displayedText(); if (text != "coffee") { UIALogger.logError("Expected to see 'coffee'"); } else { UIALogger.logMessage("Saw 'coffee'!"); DetailScreen.tapBackButton(); } target.delay(0.5);
var target = UIATarget.localTarget(); ListScreen.tapCellWithName("coffee") target.delay(0.5); var text = DetailScreen.displayedText(); if (text != "coffee") { UIALogger.logError("Expected to see 'coffee'"); } else { + UIALogger.logMessage("Saw 'coffee'!"); DetailScreen.tapBackButton(); } target.delay(0.5);
1
0.066667
1
0
5ff18f77dd3f38c7209e2b7bca1f2f84d002b00a
tools/glidein_ls.py
tools/glidein_ls.py
import os import string import stat import sys sys.path.append("lib") sys.path.append("../lib") import glideinMonitor def createDirMonitorFile(monitor_file_name,monitor_control_relname, argv,condor_status): fd=open(monitor_file_name,"w") try: fd.write("#!/bin/sh\n") fd.write("outdir=`ls -lt .. | tail -1 | awk '{print $9}'`\n") fd.write("(cd ../$outdir; if [ $? -eq 0 ]; then ls %s; else echo Internal error; fi)\n"%(string.join(argv))) fd.write("echo Done > %s\n"%monitor_control_relname) finally: fd.close() os.chmod(monitor_file_name,stat.S_IRWXU) args=glideinMonitor.parseArgs(sys.argv[1:]) glideinMonitor.monitor(args['jid'],args['schedd_name'],args['pool_name'], args['timeout'], createDirMonitorFile,args['argv'])
import os,os.path import string import stat import sys sys.path.append(os.path.join(os.path[0],"lib")) sys.path.append(os.path.join(os.path[0],"../lib")) import glideinMonitor def createDirMonitorFile(monitor_file_name,monitor_control_relname, argv,condor_status): fd=open(monitor_file_name,"w") try: fd.write("#!/bin/sh\n") fd.write("outdir=`ls -lt .. | tail -1 | awk '{print $9}'`\n") fd.write("(cd ../$outdir; if [ $? -eq 0 ]; then ls %s; else echo Internal error; fi)\n"%(string.join(argv))) fd.write("echo Done > %s\n"%monitor_control_relname) finally: fd.close() os.chmod(monitor_file_name,stat.S_IRWXU) args=glideinMonitor.parseArgs(sys.argv[1:]) glideinMonitor.monitor(args['jid'],args['schedd_name'],args['pool_name'], args['timeout'], createDirMonitorFile,args['argv'])
Change rel paths into abspaths
Change rel paths into abspaths
Python
bsd-3-clause
bbockelm/glideinWMS,bbockelm/glideinWMS,holzman/glideinwms-old,bbockelm/glideinWMS,holzman/glideinwms-old,holzman/glideinwms-old,bbockelm/glideinWMS
python
## Code Before: import os import string import stat import sys sys.path.append("lib") sys.path.append("../lib") import glideinMonitor def createDirMonitorFile(monitor_file_name,monitor_control_relname, argv,condor_status): fd=open(monitor_file_name,"w") try: fd.write("#!/bin/sh\n") fd.write("outdir=`ls -lt .. | tail -1 | awk '{print $9}'`\n") fd.write("(cd ../$outdir; if [ $? -eq 0 ]; then ls %s; else echo Internal error; fi)\n"%(string.join(argv))) fd.write("echo Done > %s\n"%monitor_control_relname) finally: fd.close() os.chmod(monitor_file_name,stat.S_IRWXU) args=glideinMonitor.parseArgs(sys.argv[1:]) glideinMonitor.monitor(args['jid'],args['schedd_name'],args['pool_name'], args['timeout'], createDirMonitorFile,args['argv']) ## Instruction: Change rel paths into abspaths ## Code After: import os,os.path import string import stat import sys sys.path.append(os.path.join(os.path[0],"lib")) sys.path.append(os.path.join(os.path[0],"../lib")) import glideinMonitor def createDirMonitorFile(monitor_file_name,monitor_control_relname, argv,condor_status): fd=open(monitor_file_name,"w") try: fd.write("#!/bin/sh\n") fd.write("outdir=`ls -lt .. | tail -1 | awk '{print $9}'`\n") fd.write("(cd ../$outdir; if [ $? -eq 0 ]; then ls %s; else echo Internal error; fi)\n"%(string.join(argv))) fd.write("echo Done > %s\n"%monitor_control_relname) finally: fd.close() os.chmod(monitor_file_name,stat.S_IRWXU) args=glideinMonitor.parseArgs(sys.argv[1:]) glideinMonitor.monitor(args['jid'],args['schedd_name'],args['pool_name'], args['timeout'], createDirMonitorFile,args['argv'])
- import os + import os,os.path import string import stat import sys - sys.path.append("lib") - sys.path.append("../lib") + sys.path.append(os.path.join(os.path[0],"lib")) + sys.path.append(os.path.join(os.path[0],"../lib")) import glideinMonitor def createDirMonitorFile(monitor_file_name,monitor_control_relname, argv,condor_status): fd=open(monitor_file_name,"w") try: fd.write("#!/bin/sh\n") fd.write("outdir=`ls -lt .. | tail -1 | awk '{print $9}'`\n") fd.write("(cd ../$outdir; if [ $? -eq 0 ]; then ls %s; else echo Internal error; fi)\n"%(string.join(argv))) fd.write("echo Done > %s\n"%monitor_control_relname) finally: fd.close() os.chmod(monitor_file_name,stat.S_IRWXU) args=glideinMonitor.parseArgs(sys.argv[1:]) glideinMonitor.monitor(args['jid'],args['schedd_name'],args['pool_name'], args['timeout'], createDirMonitorFile,args['argv'])
6
0.206897
3
3
336d778a49e0e09996ea647b8a1c3c9e414dd313
jenkins/test/validators/common.py
jenkins/test/validators/common.py
''' Provide common utils to validators ''' import subprocess import sys # Run cli command. By default, exit when an error occurs def run_cli_cmd(cmd, exit_on_fail=True): '''Run a command and return its output''' print "Running system command: " + cmd proc = subprocess.Popen(cmd, bufsize=-1, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=False) stdout, stderr = proc.communicate() if proc.returncode != 0: if exit_on_fail: print stdout print "Unable to run " + " ".join(cmd) + " due to error: " + stderr sys.exit(proc.returncode) else: return False, stdout else: return True, stdout
''' Provide common utils to validators ''' import subprocess import sys # Run cli command. By default, exit when an error occurs def run_cli_cmd(cmd, exit_on_fail=True): '''Run a command and return its output''' print "Running system command: " + " ".join(cmd) proc = subprocess.Popen(cmd, bufsize=-1, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=False) stdout, stderr = proc.communicate() if proc.returncode != 0: if exit_on_fail: print stdout print "Unable to run " + " ".join(cmd) + " due to error: " + stderr sys.exit(proc.returncode) else: return False, stdout else: return True, stdout
Fix logging for system commands in CI
Fix logging for system commands in CI
Python
apache-2.0
tiwillia/openshift-tools,joelsmith/openshift-tools,tiwillia/openshift-tools,openshift/openshift-tools,joelddiaz/openshift-tools,joelddiaz/openshift-tools,twiest/openshift-tools,joelsmith/openshift-tools,blrm/openshift-tools,ivanhorvath/openshift-tools,rhdedgar/openshift-tools,rhdedgar/openshift-tools,drewandersonnz/openshift-tools,rhdedgar/openshift-tools,rhdedgar/openshift-tools,twiest/openshift-tools,openshift/openshift-tools,blrm/openshift-tools,tiwillia/openshift-tools,drewandersonnz/openshift-tools,openshift/openshift-tools,joelsmith/openshift-tools,joelddiaz/openshift-tools,rhdedgar/openshift-tools,twiest/openshift-tools,drewandersonnz/openshift-tools,twiest/openshift-tools,drewandersonnz/openshift-tools,twiest/openshift-tools,drewandersonnz/openshift-tools,blrm/openshift-tools,ivanhorvath/openshift-tools,blrm/openshift-tools,blrm/openshift-tools,openshift/openshift-tools,tiwillia/openshift-tools,drewandersonnz/openshift-tools,joelddiaz/openshift-tools,ivanhorvath/openshift-tools,ivanhorvath/openshift-tools,openshift/openshift-tools,ivanhorvath/openshift-tools,tiwillia/openshift-tools,twiest/openshift-tools,joelsmith/openshift-tools,openshift/openshift-tools,joelddiaz/openshift-tools,joelddiaz/openshift-tools,blrm/openshift-tools,ivanhorvath/openshift-tools
python
## Code Before: ''' Provide common utils to validators ''' import subprocess import sys # Run cli command. By default, exit when an error occurs def run_cli_cmd(cmd, exit_on_fail=True): '''Run a command and return its output''' print "Running system command: " + cmd proc = subprocess.Popen(cmd, bufsize=-1, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=False) stdout, stderr = proc.communicate() if proc.returncode != 0: if exit_on_fail: print stdout print "Unable to run " + " ".join(cmd) + " due to error: " + stderr sys.exit(proc.returncode) else: return False, stdout else: return True, stdout ## Instruction: Fix logging for system commands in CI ## Code After: ''' Provide common utils to validators ''' import subprocess import sys # Run cli command. By default, exit when an error occurs def run_cli_cmd(cmd, exit_on_fail=True): '''Run a command and return its output''' print "Running system command: " + " ".join(cmd) proc = subprocess.Popen(cmd, bufsize=-1, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=False) stdout, stderr = proc.communicate() if proc.returncode != 0: if exit_on_fail: print stdout print "Unable to run " + " ".join(cmd) + " due to error: " + stderr sys.exit(proc.returncode) else: return False, stdout else: return True, stdout
''' Provide common utils to validators ''' import subprocess import sys # Run cli command. By default, exit when an error occurs def run_cli_cmd(cmd, exit_on_fail=True): '''Run a command and return its output''' - print "Running system command: " + cmd + print "Running system command: " + " ".join(cmd) ? +++++++++ + proc = subprocess.Popen(cmd, bufsize=-1, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=False) stdout, stderr = proc.communicate() if proc.returncode != 0: if exit_on_fail: print stdout print "Unable to run " + " ".join(cmd) + " due to error: " + stderr sys.exit(proc.returncode) else: return False, stdout else: return True, stdout
2
0.105263
1
1
c765aab5a03cdf25bdc6ce5043aa0d8748695fc6
src/authentication/authenticator/get.js
src/authentication/authenticator/get.js
/** * This file is reserved for future development * * Not ready for use */ 'use strict'; /** * Module dependencies. */ import { Router } from 'express'; import { clone } from 'lodash'; module.exports = class CoreGETAuthenticator { /** * Do not override the constructor * * @param {string} name * @param {Object} settings * @param {Object} dependencies */ constructor(name, settings, dependencies) { this.router = Router(); this.settings = clone(settings); this.dependencies = dependencies; this.define(); } /** * Override this with a function to define router configuration */ define() { // Example: this.router.use(...) } };
/** * This file is reserved for future development * * Not ready for use */ 'use strict'; /** * Module dependencies. */ import { Router } from 'express'; import { clone } from 'lodash'; module.exports = class CoreGETAuthenticator { /** * Do not override the constructor * * @param {string} name * @param {Object} settings * @param {Object} dependencies */ constructor(name, settings, dependencies) { this.router = Router(); this.settings = clone(settings); this.dependencies = dependencies; } /** * Override this with a function to define an authenticator route */ hubToAuthenticator() { /** * Example code: * * return (req, res, next) => { * * } */ } };
Use proper method name in `CoreGETAuthenticator`
Use proper method name in `CoreGETAuthenticator`
JavaScript
mit
HiFaraz/identity-desk
javascript
## Code Before: /** * This file is reserved for future development * * Not ready for use */ 'use strict'; /** * Module dependencies. */ import { Router } from 'express'; import { clone } from 'lodash'; module.exports = class CoreGETAuthenticator { /** * Do not override the constructor * * @param {string} name * @param {Object} settings * @param {Object} dependencies */ constructor(name, settings, dependencies) { this.router = Router(); this.settings = clone(settings); this.dependencies = dependencies; this.define(); } /** * Override this with a function to define router configuration */ define() { // Example: this.router.use(...) } }; ## Instruction: Use proper method name in `CoreGETAuthenticator` ## Code After: /** * This file is reserved for future development * * Not ready for use */ 'use strict'; /** * Module dependencies. */ import { Router } from 'express'; import { clone } from 'lodash'; module.exports = class CoreGETAuthenticator { /** * Do not override the constructor * * @param {string} name * @param {Object} settings * @param {Object} dependencies */ constructor(name, settings, dependencies) { this.router = Router(); this.settings = clone(settings); this.dependencies = dependencies; } /** * Override this with a function to define an authenticator route */ hubToAuthenticator() { /** * Example code: * * return (req, res, next) => { * * } */ } };
/** * This file is reserved for future development * * Not ready for use */ 'use strict'; /** * Module dependencies. */ import { Router } from 'express'; import { clone } from 'lodash'; module.exports = class CoreGETAuthenticator { /** * Do not override the constructor * * @param {string} name * @param {Object} settings * @param {Object} dependencies */ constructor(name, settings, dependencies) { this.router = Router(); this.settings = clone(settings); this.dependencies = dependencies; - - this.define(); } /** - * Override this with a function to define router configuration ? --------------- + * Override this with a function to define an authenticator route ? +++++++++++++++++ */ - define() { - // Example: this.router.use(...) + hubToAuthenticator() { + /** + * Example code: + * + * return (req, res, next) => { + * + * } + */ } };
14
0.388889
9
5
d5b1a950f463643ef73adcf4bf5aeafa8d3f9fbb
app/controllers/permit_steps_controller.rb
app/controllers/permit_steps_controller.rb
require 'permit_params' require 'geokit' class PermitStepsController < ApplicationController include PermitParams include Wicked::Wizard steps :enter_address, :display_permits, :enter_details, :enter_repair, :display_summary def show @permit = current_permit render_wizard end def update @permit = current_permit params[:permit][:status] = step.to_s params[:permit][:status] = 'active' if step == steps.last case step when :enter_address sa_bounds = Geokit::Geocoders::MultiGeocoder.geocode('San Antonio, TX').suggested_bounds address = Geokit::Geocoders::MultiGeocoder.geocode(params[:permit][:owner_address], bias: sa_bounds) if valid_address?(address) params[:permit][:owner_address] = address.full_address else puts "erroring out" end end @permit.update_attributes(permit_params) render_wizard @permit end private def valid_address? address address != nil && address.lat != nil && address.lng != nil && address.full_address != nil && address.street_name != nil end end
require 'permit_params' require 'geokit' class PermitStepsController < ApplicationController include PermitParams include Wicked::Wizard steps :enter_address, :display_permits, :enter_details, :enter_repair, :display_summary def show @permit = current_permit case step when :enter_details skip_step if @permit.addition == nil || !@permit.addition end when :enter_repair skip_step if @permit.repair == nil || !@permit.repair end render_wizard end def update @permit = current_permit params[:permit][:status] = step.to_s params[:permit][:status] = 'active' if step == steps.last case step when :enter_address sa_bounds = Geokit::Geocoders::MultiGeocoder.geocode('San Antonio, TX').suggested_bounds address = Geokit::Geocoders::MultiGeocoder.geocode(params[:permit][:owner_address], bias: sa_bounds) if valid_address?(address) params[:permit][:owner_address] = address.full_address else puts "erroring out" end end @permit.update_attributes(permit_params) render_wizard @permit end private def valid_address? address address != nil && address.lat != nil && address.lng != nil && address.full_address != nil && address.street_name != nil end end
Make it possible to skip steps
Make it possible to skip steps
Ruby
isc
schlos/homebase,randy-r-masters/homebase,codeforamerica/homebase,codeforamerica/homebase,schlos/homebase,codeforamerica/homebase,randy-r-masters/homebase,randy-r-masters/homebase,schlos/homebase
ruby
## Code Before: require 'permit_params' require 'geokit' class PermitStepsController < ApplicationController include PermitParams include Wicked::Wizard steps :enter_address, :display_permits, :enter_details, :enter_repair, :display_summary def show @permit = current_permit render_wizard end def update @permit = current_permit params[:permit][:status] = step.to_s params[:permit][:status] = 'active' if step == steps.last case step when :enter_address sa_bounds = Geokit::Geocoders::MultiGeocoder.geocode('San Antonio, TX').suggested_bounds address = Geokit::Geocoders::MultiGeocoder.geocode(params[:permit][:owner_address], bias: sa_bounds) if valid_address?(address) params[:permit][:owner_address] = address.full_address else puts "erroring out" end end @permit.update_attributes(permit_params) render_wizard @permit end private def valid_address? address address != nil && address.lat != nil && address.lng != nil && address.full_address != nil && address.street_name != nil end end ## Instruction: Make it possible to skip steps ## Code After: require 'permit_params' require 'geokit' class PermitStepsController < ApplicationController include PermitParams include Wicked::Wizard steps :enter_address, :display_permits, :enter_details, :enter_repair, :display_summary def show @permit = current_permit case step when :enter_details skip_step if @permit.addition == nil || !@permit.addition end when :enter_repair skip_step if @permit.repair == nil || !@permit.repair end render_wizard end def update @permit = current_permit params[:permit][:status] = step.to_s params[:permit][:status] = 'active' if step == steps.last case step when :enter_address sa_bounds = Geokit::Geocoders::MultiGeocoder.geocode('San Antonio, TX').suggested_bounds address = Geokit::Geocoders::MultiGeocoder.geocode(params[:permit][:owner_address], bias: sa_bounds) if valid_address?(address) params[:permit][:owner_address] = address.full_address else puts "erroring out" end end @permit.update_attributes(permit_params) render_wizard @permit end private def valid_address? address address != nil && address.lat != nil && address.lng != nil && address.full_address != nil && address.street_name != nil end end
require 'permit_params' require 'geokit' class PermitStepsController < ApplicationController include PermitParams include Wicked::Wizard steps :enter_address, :display_permits, :enter_details, :enter_repair, :display_summary def show @permit = current_permit + + case step + + when :enter_details + skip_step if @permit.addition == nil || !@permit.addition + end + when :enter_repair + skip_step if @permit.repair == nil || !@permit.repair + end render_wizard + - end + end ? ++ def update @permit = current_permit params[:permit][:status] = step.to_s params[:permit][:status] = 'active' if step == steps.last case step when :enter_address sa_bounds = Geokit::Geocoders::MultiGeocoder.geocode('San Antonio, TX').suggested_bounds address = Geokit::Geocoders::MultiGeocoder.geocode(params[:permit][:owner_address], bias: sa_bounds) if valid_address?(address) params[:permit][:owner_address] = address.full_address else puts "erroring out" end end @permit.update_attributes(permit_params) render_wizard @permit end private def valid_address? address address != nil && address.lat != nil && address.lng != nil && address.full_address != nil && address.street_name != nil end end
12
0.27907
11
1
b1190ea4a7f207e40d4b1330b0145e17e33163ee
app/config/settings.php
app/config/settings.php
<?php error_reporting(E_ALL); // WH Test database settings define('DB_NAME', 'test'); define('DB_USER', 'root'); define('DB_PASS', ''); define('DB_HOST', '127.0.0.1'); define('DIR_BASE', dirname(dirname(dirname(__FILE__))).'/'); define('DIR_APP', DIR_BASE.'app'); define('DIR_CLASS', DIR_APP.'/class/'); define('DIR_LIB', DIR_BASE.'lib/'); define('DIR_SQL', './sql/'); define('BASE_URL', 'http://localhost/JD.meDev/'); define('SUB_DIR', '/JD.meDev/'); define('LOADED', true); // WH This is a general settings array. Some of our classes currently depend on this // but I plan on re-writing them to correct this. // $settings['sub_dir'] = '/JD.meDev/'; $settings['js'][] = 'main.js'; $settings['main_nav'] = array('home', 'about me', 'testimonials','blog','portfolio');
<?php error_reporting(E_ALL); // WH Test database settings define('DB_NAME', 'test'); define('DB_USER', 'root'); define('DB_PASS', ''); define('DB_HOST', '127.0.0.1'); define('DIR_BASE', dirname(dirname(dirname(__FILE__))).'/'); define('DIR_APP', DIR_BASE.'app'); define('DIR_CLASS', DIR_APP.'/class/'); define('DIR_LIB', DIR_BASE.'lib/'); define('DIR_SQL', './sql/'); define('BASE_URL', 'http://localhost/JD.meDev/'); define('SUB_DIR', '/JD.meDev/'); define('LOADED', true); // WH This is a general settings array. Some of our classes currently depend on this // but I plan on re-writing them to correct this. // $settings['sub_dir'] = '/JD.meDev/'; $settings['js'][] = 'main.js'; $settings['main_nav'] = array('home', 'about me', 'testimonials','blog','portfolio', 'contact');
Add contact page to nav
Add contact page to nav
PHP
mit
JohnDragonetti/JD.meDev,JohnDragonetti/JD.meDev,JohnDragonetti/JD.meDev,JohnDragonetti/JD.meDev
php
## Code Before: <?php error_reporting(E_ALL); // WH Test database settings define('DB_NAME', 'test'); define('DB_USER', 'root'); define('DB_PASS', ''); define('DB_HOST', '127.0.0.1'); define('DIR_BASE', dirname(dirname(dirname(__FILE__))).'/'); define('DIR_APP', DIR_BASE.'app'); define('DIR_CLASS', DIR_APP.'/class/'); define('DIR_LIB', DIR_BASE.'lib/'); define('DIR_SQL', './sql/'); define('BASE_URL', 'http://localhost/JD.meDev/'); define('SUB_DIR', '/JD.meDev/'); define('LOADED', true); // WH This is a general settings array. Some of our classes currently depend on this // but I plan on re-writing them to correct this. // $settings['sub_dir'] = '/JD.meDev/'; $settings['js'][] = 'main.js'; $settings['main_nav'] = array('home', 'about me', 'testimonials','blog','portfolio'); ## Instruction: Add contact page to nav ## Code After: <?php error_reporting(E_ALL); // WH Test database settings define('DB_NAME', 'test'); define('DB_USER', 'root'); define('DB_PASS', ''); define('DB_HOST', '127.0.0.1'); define('DIR_BASE', dirname(dirname(dirname(__FILE__))).'/'); define('DIR_APP', DIR_BASE.'app'); define('DIR_CLASS', DIR_APP.'/class/'); define('DIR_LIB', DIR_BASE.'lib/'); define('DIR_SQL', './sql/'); define('BASE_URL', 'http://localhost/JD.meDev/'); define('SUB_DIR', '/JD.meDev/'); define('LOADED', true); // WH This is a general settings array. Some of our classes currently depend on this // but I plan on re-writing them to correct this. // $settings['sub_dir'] = '/JD.meDev/'; $settings['js'][] = 'main.js'; $settings['main_nav'] = array('home', 'about me', 'testimonials','blog','portfolio', 'contact');
<?php error_reporting(E_ALL); // WH Test database settings define('DB_NAME', 'test'); define('DB_USER', 'root'); define('DB_PASS', ''); define('DB_HOST', '127.0.0.1'); define('DIR_BASE', dirname(dirname(dirname(__FILE__))).'/'); define('DIR_APP', DIR_BASE.'app'); define('DIR_CLASS', DIR_APP.'/class/'); define('DIR_LIB', DIR_BASE.'lib/'); define('DIR_SQL', './sql/'); define('BASE_URL', 'http://localhost/JD.meDev/'); define('SUB_DIR', '/JD.meDev/'); define('LOADED', true); // WH This is a general settings array. Some of our classes currently depend on this // but I plan on re-writing them to correct this. // $settings['sub_dir'] = '/JD.meDev/'; $settings['js'][] = 'main.js'; - $settings['main_nav'] = array('home', 'about me', 'testimonials','blog','portfolio'); + $settings['main_nav'] = array('home', 'about me', 'testimonials','blog','portfolio', 'contact'); ? +++++++++++
2
0.083333
1
1
7e1ec1b27d69882005ac5492809c8847c21e2198
baro.py
baro.py
from datetime import datetime class Baro: """This class represents a Baro item and is initialized with data in JSON format """ def __init__(self, data): self.config = data['Config'] self.start = datetime.fromtimestamp(data['Activation']['sec']) self.end = datetime.fromtimestamp(data['Expiry']['sec']) self.location = data['Node'] self.manifest = data['Manifest'] def __str__(self): """Returns a string with all the information about Baro offer """ baroItemString = "" if datetime.now() < self.start: return "None" else: for item in self.manifest: baroItemString += ('== '+ str(item["ItemType"]) +' ==\n' '- price: '+ str(item["PrimePrice"]) +' ducats + '+ str(item["RegularPrice"]) +'cr -\n\n' ) return baroItemString def get_eta_string(self): """Returns a string containing the Baro's ETA """ seconds = int((self.end - datetime.now()).total_seconds()) return '{} days, {} hrs, {} mins'.format((seconds // 86400), ((seconds % 86400) // 3600), (seconds % 3600) // 60) def get_start_string(self): """Returns a string containing the Baro's start """ seconds = int((self.start - datetime.now()).total_seconds()) return '{} days, {} hrs, {} mins'.format((seconds // 86400), ((seconds % 86400) // 3600), (seconds % 3600) // 60)
from datetime import datetime import utils class Baro: """This class contains info about the Void Trader and is initialized with data in JSON format """ def __init__(self, data): self.config = data['Config'] self.start = datetime.fromtimestamp(data['Activation']['sec']) self.end = datetime.fromtimestamp(data['Expiry']['sec']) self.location = data['Node'] self.manifest = data['Manifest'] def __str__(self): """Returns a string with all the information about Baro's offers """ baroItemString = "" if datetime.now() < self.start: return "None" else: for item in self.manifest: baroItemString += ('== '+ str(item["ItemType"]) +' ==\n' '- price: '+ str(item["PrimePrice"]) +' ducats + '+ str(item["RegularPrice"]) +'cr -\n\n' ) return baroItemString def get_end_string(self): """Returns a string containing Baro's departure time """ return timedelta_to_string(self.end - datetime.now()) def get_start_string(self): """Returns a string containing Baro's arrival time """ return timedelta_to_string(self.start - datetime.now())
Change class Baro to use timedelta_to_string, some fixes
Change class Baro to use timedelta_to_string, some fixes
Python
mit
pabletos/Hubot-Warframe,pabletos/Hubot-Warframe
python
## Code Before: from datetime import datetime class Baro: """This class represents a Baro item and is initialized with data in JSON format """ def __init__(self, data): self.config = data['Config'] self.start = datetime.fromtimestamp(data['Activation']['sec']) self.end = datetime.fromtimestamp(data['Expiry']['sec']) self.location = data['Node'] self.manifest = data['Manifest'] def __str__(self): """Returns a string with all the information about Baro offer """ baroItemString = "" if datetime.now() < self.start: return "None" else: for item in self.manifest: baroItemString += ('== '+ str(item["ItemType"]) +' ==\n' '- price: '+ str(item["PrimePrice"]) +' ducats + '+ str(item["RegularPrice"]) +'cr -\n\n' ) return baroItemString def get_eta_string(self): """Returns a string containing the Baro's ETA """ seconds = int((self.end - datetime.now()).total_seconds()) return '{} days, {} hrs, {} mins'.format((seconds // 86400), ((seconds % 86400) // 3600), (seconds % 3600) // 60) def get_start_string(self): """Returns a string containing the Baro's start """ seconds = int((self.start - datetime.now()).total_seconds()) return '{} days, {} hrs, {} mins'.format((seconds // 86400), ((seconds % 86400) // 3600), (seconds % 3600) // 60) ## Instruction: Change class Baro to use timedelta_to_string, some fixes ## Code After: from datetime import datetime import utils class Baro: """This class contains info about the Void Trader and is initialized with data in JSON format """ def __init__(self, data): self.config = data['Config'] self.start = datetime.fromtimestamp(data['Activation']['sec']) self.end = datetime.fromtimestamp(data['Expiry']['sec']) self.location = data['Node'] self.manifest = data['Manifest'] def __str__(self): """Returns a string with all the information about Baro's offers """ baroItemString = "" if datetime.now() < self.start: return "None" else: for item in self.manifest: baroItemString += ('== '+ str(item["ItemType"]) +' ==\n' '- price: '+ str(item["PrimePrice"]) +' ducats + '+ str(item["RegularPrice"]) +'cr -\n\n' ) return baroItemString def get_end_string(self): """Returns a string containing Baro's departure time """ return timedelta_to_string(self.end - datetime.now()) def get_start_string(self): """Returns a string containing Baro's arrival time """ return timedelta_to_string(self.start - datetime.now())
from datetime import datetime + import utils class Baro: - """This class represents a Baro item and is initialized with + """This class contains info about the Void Trader and is initialized with data in JSON format """ def __init__(self, data): self.config = data['Config'] self.start = datetime.fromtimestamp(data['Activation']['sec']) self.end = datetime.fromtimestamp(data['Expiry']['sec']) self.location = data['Node'] self.manifest = data['Manifest'] def __str__(self): - """Returns a string with all the information about Baro offer + """Returns a string with all the information about Baro's offers ? ++ + """ baroItemString = "" if datetime.now() < self.start: return "None" else: for item in self.manifest: baroItemString += ('== '+ str(item["ItemType"]) +' ==\n' '- price: '+ str(item["PrimePrice"]) +' ducats + '+ str(item["RegularPrice"]) +'cr -\n\n' ) return baroItemString - def get_eta_string(self): ? ^^ + def get_end_string(self): ? ^^ - """Returns a string containing the Baro's ETA ? ---- ^^^ + """Returns a string containing Baro's departure time ? ^^^^^^^^^^^^^^ """ + return timedelta_to_string(self.end - datetime.now()) - seconds = int((self.end - datetime.now()).total_seconds()) - return '{} days, {} hrs, {} mins'.format((seconds // 86400), ((seconds % 86400) // 3600), - (seconds % 3600) // 60) def get_start_string(self): - """Returns a string containing the Baro's start ? ---- -- + """Returns a string containing Baro's arrival time ? ++++++ +++ """ + return timedelta_to_string(self.start - datetime.now()) - seconds = int((self.start - datetime.now()).total_seconds()) - return '{} days, {} hrs, {} mins'.format((seconds // 86400), ((seconds % 86400) // 3600), - (seconds % 3600) // 60)
19
0.404255
8
11
eb362e900b252183bf6462cfe109e33aabb0a798
README.md
README.md
bd-stampy [![Build Status](https://travis-ci.org/bigdatr/bd-stampy.svg?branch=master)](https://travis-ci.org/bigdatr/bd-stampy) [![Code Climate](https://codeclimate.com/github/bigdatr/bd-stampy/badges/gpa.svg)](https://codeclimate.com/github/bigdatr/bd-stampy) [![Test Coverage](https://codeclimate.com/github/bigdatr/bd-stampy/badges/coverage.svg)](https://codeclimate.com/github/bigdatr/bd-stampy) ====== React UI Component Library [docs](http://bigdatr.github.io/bd-stampy/) ## Install ```sh npm install bd-stampy --save ``` ## Testing ```js npm test ``` ## License [BSD](https://github.com/bigdatr/bd-stampy/blob/master/LICENSE)
bd-stampy [![Build Status](https://travis-ci.org/bigdatr/bd-stampy.svg?branch=master)](https://travis-ci.org/bigdatr/bd-stampy) [![Code Climate](https://codeclimate.com/github/bigdatr/bd-stampy/badges/gpa.svg)](https://codeclimate.com/github/bigdatr/bd-stampy) [![Test Coverage](https://codeclimate.com/github/bigdatr/bd-stampy/badges/coverage.svg)](https://codeclimate.com/github/bigdatr/bd-stampy) ====== React UI Component Library ## Install ```sh npm install bd-stampy --save ``` ## Testing ```js npm test ``` ## License [BSD](https://github.com/bigdatr/bd-stampy/blob/master/LICENSE)
Remove old link to docs
Remove old link to docs
Markdown
bsd-3-clause
bigdatr/bd-stampy
markdown
## Code Before: bd-stampy [![Build Status](https://travis-ci.org/bigdatr/bd-stampy.svg?branch=master)](https://travis-ci.org/bigdatr/bd-stampy) [![Code Climate](https://codeclimate.com/github/bigdatr/bd-stampy/badges/gpa.svg)](https://codeclimate.com/github/bigdatr/bd-stampy) [![Test Coverage](https://codeclimate.com/github/bigdatr/bd-stampy/badges/coverage.svg)](https://codeclimate.com/github/bigdatr/bd-stampy) ====== React UI Component Library [docs](http://bigdatr.github.io/bd-stampy/) ## Install ```sh npm install bd-stampy --save ``` ## Testing ```js npm test ``` ## License [BSD](https://github.com/bigdatr/bd-stampy/blob/master/LICENSE) ## Instruction: Remove old link to docs ## Code After: bd-stampy [![Build Status](https://travis-ci.org/bigdatr/bd-stampy.svg?branch=master)](https://travis-ci.org/bigdatr/bd-stampy) [![Code Climate](https://codeclimate.com/github/bigdatr/bd-stampy/badges/gpa.svg)](https://codeclimate.com/github/bigdatr/bd-stampy) [![Test Coverage](https://codeclimate.com/github/bigdatr/bd-stampy/badges/coverage.svg)](https://codeclimate.com/github/bigdatr/bd-stampy) ====== React UI Component Library ## Install ```sh npm install bd-stampy --save ``` ## Testing ```js npm test ``` ## License [BSD](https://github.com/bigdatr/bd-stampy/blob/master/LICENSE)
bd-stampy [![Build Status](https://travis-ci.org/bigdatr/bd-stampy.svg?branch=master)](https://travis-ci.org/bigdatr/bd-stampy) [![Code Climate](https://codeclimate.com/github/bigdatr/bd-stampy/badges/gpa.svg)](https://codeclimate.com/github/bigdatr/bd-stampy) [![Test Coverage](https://codeclimate.com/github/bigdatr/bd-stampy/badges/coverage.svg)](https://codeclimate.com/github/bigdatr/bd-stampy) ====== React UI Component Library - - [docs](http://bigdatr.github.io/bd-stampy/) - ## Install ```sh npm install bd-stampy --save ``` ## Testing ```js npm test ``` ## License [BSD](https://github.com/bigdatr/bd-stampy/blob/master/LICENSE)
3
0.136364
0
3
b064d8dbc4be13c12c1c87491ebcb484ab71ac52
geopy/__init__.py
geopy/__init__.py
from geopy.point import Point from geopy.location import Location from geopy.geocoders import * # pylint: disable=W0401 from geopy.util import __version__
from geopy.location import Location from geopy.point import Point from geopy.util import __version__ from geopy.geocoders import * # noqa # geopy.geocoders.options must not be importable as `geopy.options`, # because that is ambiguous (which options are that). del options # noqa
Fix geocoder.options being also exported as `geopy.options`
Fix geocoder.options being also exported as `geopy.options`
Python
mit
geopy/geopy,jmb/geopy
python
## Code Before: from geopy.point import Point from geopy.location import Location from geopy.geocoders import * # pylint: disable=W0401 from geopy.util import __version__ ## Instruction: Fix geocoder.options being also exported as `geopy.options` ## Code After: from geopy.location import Location from geopy.point import Point from geopy.util import __version__ from geopy.geocoders import * # noqa # geopy.geocoders.options must not be importable as `geopy.options`, # because that is ambiguous (which options are that). del options # noqa
+ from geopy.location import Location from geopy.point import Point - from geopy.location import Location - from geopy.geocoders import * # pylint: disable=W0401 from geopy.util import __version__ + + from geopy.geocoders import * # noqa + # geopy.geocoders.options must not be importable as `geopy.options`, + # because that is ambiguous (which options are that). + del options # noqa
8
1.6
6
2
7517fc46387ee998ab3b517ca38e8c003c431a5d
setup.py
setup.py
try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': """MiniCPS is a lightweight simulator for accurate network traffic in an industrial control system, with basic support for physical layer interaction.""", 'author': 'scy-phy', 'url': 'https://github.com/scy-phy/minicps', 'download_url': 'https://github.com/scy-phy/minicps', 'author email': 'abc@gmail.com', 'version': '0.1.0', 'install_requires': [ 'cpppo', 'networkx', 'matplotlib', 'nose', 'nose-cover3', ], 'package': ['minicps'], 'scripts': [], 'name': 'minicps' } setup(**config)
try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': """MiniCPS is a lightweight simulator for accurate network traffic in an industrial control system, with basic support for physical layer interaction.""", 'author': 'scy-phy', 'url': 'https://github.com/scy-phy/minicps', 'download_url': 'https://github.com/scy-phy/minicps', 'author email': 'daniele_antonioli@sutd.edu.sg', 'version': '1.0.0', 'install_requires': [ 'cpppo', 'nose', 'coverage', ], 'package': ['minicps'], 'scripts': [], 'name': 'minicps' } setup(**config)
Update version, email and requirements
Update version, email and requirements [ci skip]
Python
mit
remmihsorp/minicps,scy-phy/minicps,scy-phy/minicps,remmihsorp/minicps
python
## Code Before: try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': """MiniCPS is a lightweight simulator for accurate network traffic in an industrial control system, with basic support for physical layer interaction.""", 'author': 'scy-phy', 'url': 'https://github.com/scy-phy/minicps', 'download_url': 'https://github.com/scy-phy/minicps', 'author email': 'abc@gmail.com', 'version': '0.1.0', 'install_requires': [ 'cpppo', 'networkx', 'matplotlib', 'nose', 'nose-cover3', ], 'package': ['minicps'], 'scripts': [], 'name': 'minicps' } setup(**config) ## Instruction: Update version, email and requirements [ci skip] ## Code After: try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': """MiniCPS is a lightweight simulator for accurate network traffic in an industrial control system, with basic support for physical layer interaction.""", 'author': 'scy-phy', 'url': 'https://github.com/scy-phy/minicps', 'download_url': 'https://github.com/scy-phy/minicps', 'author email': 'daniele_antonioli@sutd.edu.sg', 'version': '1.0.0', 'install_requires': [ 'cpppo', 'nose', 'coverage', ], 'package': ['minicps'], 'scripts': [], 'name': 'minicps' } setup(**config)
try: from setuptools import setup except ImportError: from distutils.core import setup config = { 'description': """MiniCPS is a lightweight simulator for accurate network traffic in an industrial control system, with basic support for physical layer interaction.""", 'author': 'scy-phy', 'url': 'https://github.com/scy-phy/minicps', 'download_url': 'https://github.com/scy-phy/minicps', - 'author email': 'abc@gmail.com', + 'author email': 'daniele_antonioli@sutd.edu.sg', - 'version': '0.1.0', ? -- + 'version': '1.0.0', ? ++ 'install_requires': [ 'cpppo', - 'networkx', - 'matplotlib', 'nose', - 'nose-cover3', ? ----- ^ + 'coverage', ? ^^^ ], 'package': ['minicps'], 'scripts': [], 'name': 'minicps' } setup(**config)
8
0.222222
3
5
b81a300af48da59dfa641fbc0492c19d4797a746
public/js/app/context/WebContext.jsx
public/js/app/context/WebContext.jsx
import React from 'react' const WebContext = React.createContext() const defaultConfig = { lang: 'sv', isAdmin: false, basicBreadcrumbs: [ { label: 'KTH', url: 'https://www-r.referens.sys.kth.se/' }, { label: 'Node', url: 'https://www-r.referens.sys.kth.se/node' }, ], proxyPrefixPath: { uri: 'node' }, message: 'howdi', } export const WebContextProvider = props => { const { configIn = {} } = props const config = { ...defaultConfig } for (const k in configIn) { if (Object.prototype.hasOwnProperty.call(configIn, k)) { if (typeof configIn[k] === 'object') { config[k] = JSON.parse(JSON.stringify(configIn[k])) } else { config[k] = configIn[k] } } } const [currentConfig, setConfig] = React.useState(config) const value = [currentConfig, setConfig] // eslint-disable-next-line react/jsx-props-no-spreading return <WebContext.Provider value={value} {...props} /> } export function useWebContext() { const context = React.useContext(WebContext) if (!context) { return [({}, () => {})] } return context } export function incrementCount() { const context = React.useContext(WebContext) const { count } = context console.log(`incrementcount`, count) // setConfig({ ...context, ...{ count: count + 1 } }) }
import React from 'react' const WebContext = React.createContext() const defaultConfig = { lang: 'sv', isAdmin: false, basicBreadcrumbs: [ { label: 'KTH', url: 'https://www-r.referens.sys.kth.se/' }, { label: 'Node', url: 'https://www-r.referens.sys.kth.se/node' }, ], proxyPrefixPath: { uri: 'node' }, message: 'howdi', } export const WebContextProvider = props => { const { configIn = {} } = props const config = { ...defaultConfig } for (const k in configIn) { if (Object.prototype.hasOwnProperty.call(configIn, k)) { if (typeof configIn[k] === 'object') { config[k] = JSON.parse(JSON.stringify(configIn[k])) } else { config[k] = configIn[k] } } } const [currentConfig, setConfig] = React.useState(config) const value = [currentConfig, setConfig] // eslint-disable-next-line react/jsx-props-no-spreading return <WebContext.Provider value={value} {...props} /> } export function useWebContext() { const context = React.useContext(WebContext) if (!context) { return [({}, () => {})] } return context }
Remove unused code in store
Remove unused code in store
JSX
mit
KTH/node-web,KTH/node-web
jsx
## Code Before: import React from 'react' const WebContext = React.createContext() const defaultConfig = { lang: 'sv', isAdmin: false, basicBreadcrumbs: [ { label: 'KTH', url: 'https://www-r.referens.sys.kth.se/' }, { label: 'Node', url: 'https://www-r.referens.sys.kth.se/node' }, ], proxyPrefixPath: { uri: 'node' }, message: 'howdi', } export const WebContextProvider = props => { const { configIn = {} } = props const config = { ...defaultConfig } for (const k in configIn) { if (Object.prototype.hasOwnProperty.call(configIn, k)) { if (typeof configIn[k] === 'object') { config[k] = JSON.parse(JSON.stringify(configIn[k])) } else { config[k] = configIn[k] } } } const [currentConfig, setConfig] = React.useState(config) const value = [currentConfig, setConfig] // eslint-disable-next-line react/jsx-props-no-spreading return <WebContext.Provider value={value} {...props} /> } export function useWebContext() { const context = React.useContext(WebContext) if (!context) { return [({}, () => {})] } return context } export function incrementCount() { const context = React.useContext(WebContext) const { count } = context console.log(`incrementcount`, count) // setConfig({ ...context, ...{ count: count + 1 } }) } ## Instruction: Remove unused code in store ## Code After: import React from 'react' const WebContext = React.createContext() const defaultConfig = { lang: 'sv', isAdmin: false, basicBreadcrumbs: [ { label: 'KTH', url: 'https://www-r.referens.sys.kth.se/' }, { label: 'Node', url: 'https://www-r.referens.sys.kth.se/node' }, ], proxyPrefixPath: { uri: 'node' }, message: 'howdi', } export const WebContextProvider = props => { const { configIn = {} } = props const config = { ...defaultConfig } for (const k in configIn) { if (Object.prototype.hasOwnProperty.call(configIn, k)) { if (typeof configIn[k] === 'object') { config[k] = JSON.parse(JSON.stringify(configIn[k])) } else { config[k] = configIn[k] } } } const [currentConfig, setConfig] = React.useState(config) const value = [currentConfig, setConfig] // eslint-disable-next-line react/jsx-props-no-spreading return <WebContext.Provider value={value} {...props} /> } export function useWebContext() { const context = React.useContext(WebContext) if (!context) { return [({}, () => {})] } return context }
import React from 'react' const WebContext = React.createContext() const defaultConfig = { lang: 'sv', isAdmin: false, basicBreadcrumbs: [ { label: 'KTH', url: 'https://www-r.referens.sys.kth.se/' }, { label: 'Node', url: 'https://www-r.referens.sys.kth.se/node' }, ], proxyPrefixPath: { uri: 'node' }, message: 'howdi', } export const WebContextProvider = props => { const { configIn = {} } = props const config = { ...defaultConfig } for (const k in configIn) { if (Object.prototype.hasOwnProperty.call(configIn, k)) { if (typeof configIn[k] === 'object') { config[k] = JSON.parse(JSON.stringify(configIn[k])) } else { config[k] = configIn[k] } } } const [currentConfig, setConfig] = React.useState(config) const value = [currentConfig, setConfig] // eslint-disable-next-line react/jsx-props-no-spreading return <WebContext.Provider value={value} {...props} /> } export function useWebContext() { const context = React.useContext(WebContext) if (!context) { return [({}, () => {})] } return context } - - export function incrementCount() { - const context = React.useContext(WebContext) - const { count } = context - - console.log(`incrementcount`, count) - // setConfig({ ...context, ...{ count: count + 1 } }) - }
8
0.166667
0
8
a0c5179d4c68e169d6deae210aec415db84fa161
examples/example-1.js
examples/example-1.js
let lib = require('../index'), Point2D = lib.Point2D, Intersection = lib.Intersection; let circle = { cx: new Point2D(0, 0), r: 50, }; let rectangle = { p1: new Point2D(0, 0), p2: new Point2D(60, 30) }; let result = Intersection.intersectCircleRectangle( circle.cx, circle.r, rectangle.p1, rectangle.p2 ); console.log(result);
let lib = require('../index'), Point2D = lib.Point2D, Intersection = lib.Intersection; let circle = { center: new Point2D(0, 0), radius: 50, }; let rectangle = { topLeft: new Point2D(0, 0), bottomRight: new Point2D(60, 30) }; let result = Intersection.intersectCircleRectangle( circle.center, circle.radius, rectangle.topLeft, rectangle.bottomRight ); console.log(result);
Fix property names in example
Fix property names in example Some of them were incorrect and others were not very descriptive. This updates the example to match what we have in the README file.
JavaScript
bsd-3-clause
thelonious/kld-intersections,thelonious/kld-intersections,thelonious/kld-intersections
javascript
## Code Before: let lib = require('../index'), Point2D = lib.Point2D, Intersection = lib.Intersection; let circle = { cx: new Point2D(0, 0), r: 50, }; let rectangle = { p1: new Point2D(0, 0), p2: new Point2D(60, 30) }; let result = Intersection.intersectCircleRectangle( circle.cx, circle.r, rectangle.p1, rectangle.p2 ); console.log(result); ## Instruction: Fix property names in example Some of them were incorrect and others were not very descriptive. This updates the example to match what we have in the README file. ## Code After: let lib = require('../index'), Point2D = lib.Point2D, Intersection = lib.Intersection; let circle = { center: new Point2D(0, 0), radius: 50, }; let rectangle = { topLeft: new Point2D(0, 0), bottomRight: new Point2D(60, 30) }; let result = Intersection.intersectCircleRectangle( circle.center, circle.radius, rectangle.topLeft, rectangle.bottomRight ); console.log(result);
let lib = require('../index'), Point2D = lib.Point2D, Intersection = lib.Intersection; let circle = { - cx: new Point2D(0, 0), ? ^ + center: new Point2D(0, 0), ? ^^^^^ - r: 50, + radius: 50, ? +++++ }; let rectangle = { - p1: new Point2D(0, 0), ? ^ + topLeft: new Point2D(0, 0), ? ++ ^^^^ - p2: new Point2D(60, 30) ? ^^ + bottomRight: new Point2D(60, 30) ? ^^^^^^^^^^^ }; let result = Intersection.intersectCircleRectangle( - circle.cx, circle.r, ? ^ + circle.center, circle.radius, ? ^^^^^ +++++ - rectangle.p1, rectangle.p2 + rectangle.topLeft, rectangle.bottomRight ); console.log(result);
12
0.571429
6
6
6502e38f2be6dc69b00e544cca71a047edc27107
app/views/rails_admin/main/_form_file_upload.html.haml
app/views/rails_admin/main/_form_file_upload.html.haml
- file = form.object.send(field.method_name).presence .toggle{:style => ('display:none;' if file && field.delete_method && form.object.send(field.delete_method) == '1')} - if value = field.pretty_value = value = form.file_field(field.name, field.html_attributes.reverse_merge({ :data => { :fileupload => true }})) - if field.optional? && field.errors.blank? && file && field.delete_method %a.btn.btn-info{:href => '#', :'data-toggle' => 'button', :onclick => "$(this).siblings('[type=checkbox]').click(); $(this).siblings('.toggle').toggle('slow'); jQuery(this).toggleClass('btn-danger btn-info'); return false"} %i.icon-white.icon-trash = I18n.t('admin.actions.delete.menu').capitalize + " #{field.method_name}" = form.check_box(field.delete_method, :style => 'display:none;' ) - if field.cache_method = form.hidden_field(field.cache_method)
- file = form.object.send(field.method_name).presence .toggle{:style => ('display:none;' if file && field.delete_method && form.object.send(field.delete_method) == '1')} - if value = field.pretty_value = value = form.file_field(field.name, field.html_attributes.reverse_merge({ :data => { :fileupload => true }})) - if field.optional? && field.errors.blank? && file && field.delete_method %a.btn.btn-info{:href => '#', :'data-toggle' => 'button', :onclick => "$(this).siblings('[type=checkbox]').click(); $(this).siblings('.toggle').toggle('slow'); jQuery(this).toggleClass('btn-danger btn-info'); return false"} %i.icon-white.icon-trash = I18n.t('admin.actions.delete.menu').capitalize + " #{field.label.downcase}" = form.check_box(field.delete_method, :style => 'display:none;' ) - if field.cache_method = form.hidden_field(field.cache_method)
Fix delete image button text.
Fix delete image button text.
Haml
mit
yakovenkodenis/rails_admin,diowa/rails_admin,VoroninNick/rails_admin_sigma,vanbumi/rails_admin,iangels/rails_admin,ipmobiletech/rails_admin,quarkstudio/rails_admin,dmitrypol/rails_admin,soupmatt/rails_admin,arturbrasil/rails_admin,react2media/rails_admin,rayzhng/rails_admin,igorkasyanchuk/rails_admin,engel/rails_admin,aliada-mx/rails_admin,react2media/rails_admin,dalpo/rails_admin,dmitrypol/rails_admin,onursarikaya/rails_admin,LevoLeague/rails_admin,goodinc/rails_admin_for_mag,vanbumi/rails_admin,aquajach/rails_admin,crashlytics/rails_admin,jemcode/rails_admin,impurist/rails_admin,jcoleman/rails_admin,JailtonSampaio/annotations_clone_rails_admin,aliada-mx/rails_admin,Versanity/ruby,meghaarora42/rails_admin,cob3/rails_admin,igorkasyanchuk/rails_admin,amankatoch/rails_admin,rayzhng/rails_admin,viewthespace/rails_admin,engel/rails_admin,josedonizetti/rails_admin,CPInc/rails_admin,ernestoe/rails_admin,LevoLeague/rails_admin,kimquy/rails_admin_062,olegantonyan/rails_admin,iangels/rails_admin,arturbrasil/rails_admin,yakovenkodenis/rails_admin,allori/rails_admin,olegantonyan/rails_admin,rubiety/rails_admin,quarkstudio/rails_admin,glooko/rails_admin,vanbumi/rails_admin,dwbutler/rails_admin,jasnow/rails_admin,wkirschbaum/rails_admin,allori/rails_admin,dalpo/rails_admin,wkirschbaum/rails_admin,sumitag/rails_admin,widgetworks/rails_admin,johanneskrtek/rails_admin,Balaraju/rails_admin,inaka/rails_admin,igorkasyanchuk/rails_admin,jasnow/rails_admin,onursarikaya/rails_admin,CodingZeal/rails_admin,kimquy/rails_admin_062,olegantonyan/rails_admin,jcoleman/rails_admin,Furi/rails_admin,soupmatt/rails_admin,coorasse/rails_admin,Furi/rails_admin,VoroninNick/rails_admin_sigma,Balaraju/rails_admin,laurelandwolf/rails_admin,jemcode/rails_admin,ombulabs/rails_admin,ombulabs/rails_admin,swipesense/rails_admin,hut8/rails_admin,inaka/rails_admin,Vinagility/rails_admin_old,CPInc/rails_admin,ombulabs/rails_admin,sortlist/rails_admin,laurelandwolf/rails_admin,impurist/rails_admin,rayzhng/rails_admin,onursarikaya/rails_admin,junglefunkyman/rails_admin,jcoleman/rails_admin,patleb/admineer,amankatoch/rails_admin,lokalebasen/rails_admin,CPInc/rails_admin,Exygy/rails_admin,dmilisic/rails_admin,rubiety/rails_admin,meghaarora42/rails_admin,voyera/rails_admin,coorasse/rails_admin,Vinagility/rails_admin_old,yakovenkodenis/rails_admin,meghaarora42/rails_admin,CodingZeal/rails_admin,ipmobiletech/rails_admin,Balaraju/rails_admin,dmilisic/rails_admin,sideci-sample/sideci-sample-rails_admin,engel/rails_admin,rubiety/rails_admin,lokalebasen/rails_admin,sferik/rails_admin,zapnap/rails_admin,aliada-mx/rails_admin,patleb/admineer,zambot/rails_admin,josedonizetti/rails_admin,vincentwoo/rails_admin,sferik/rails_admin,viewthespace/rails_admin,allori/rails_admin,sferik/rails_admin,Furi/rails_admin,sogilis/rails_admin,aquajach/rails_admin,dalpo/rails_admin,glooko/rails_admin,dmilisic/rails_admin,corbt/rails_admin,DonCuponesInternet/rails_admin,ipmobiletech/rails_admin,junglefunkyman/rails_admin,GeorgeZhukov/rails_admin,DonCuponesInternet/rails_admin,laurelandwolf/rails_admin,GeorgeZhukov/rails_admin,GeorgeZhukov/rails_admin,impurist/rails_admin,sumitag/rails_admin,DonCuponesInternet/rails_admin,zambot/rails_admin,iangels/rails_admin,amankatoch/rails_admin,cheerfulstoic/rails_admin,corbt/rails_admin,swipesense/rails_admin,hut8/rails_admin,bf4/rails_admin,Exygy/rails_admin,react2media/rails_admin,vincentwoo/rails_admin,LevoLeague/rails_admin,msobocin/rails_admin,quarkstudio/rails_admin,zambot/rails_admin,VoroninNick/rails_admin_sigma,zapnap/rails_admin,aravindgd/rails_admin,sogilis/rails_admin,kimquy/rails_admin_062,msobocin/rails_admin,junglefunkyman/rails_admin,widgetworks/rails_admin,JailtonSampaio/annotations_clone_rails_admin,aquajach/rails_admin,arturbrasil/rails_admin,Versanity/ruby,diowa/rails_admin,hut8/rails_admin,PhilipCastiglione/rails_admin,ernestoe/rails_admin,coorasse/rails_admin,markprzepiora-forks/rails_admin,voyera/rails_admin,jemcode/rails_admin,wkirschbaum/rails_admin,bf4/rails_admin,Exygy/rails_admin,sogilis/rails_admin,sortlist/rails_admin,soupmatt/rails_admin,johanneskrtek/rails_admin,markprzepiora-forks/rails_admin,msobocin/rails_admin,jasnow/rails_admin,sortlist/rails_admin,dwbutler/rails_admin,zapnap/rails_admin,cheerfulstoic/rails_admin,dwbutler/rails_admin,lokalebasen/rails_admin,Versanity/ruby,glooko/rails_admin,Vinagility/rails_admin_old,diowa/rails_admin,markprzepiora-forks/rails_admin,crashlytics/rails_admin,goodinc/rails_admin_for_mag,viewthespace/rails_admin,JailtonSampaio/annotations_clone_rails_admin,vincentwoo/rails_admin,cheerfulstoic/rails_admin,corbt/rails_admin,patleb/admineer,johanneskrtek/rails_admin,bf4/rails_admin,widgetworks/rails_admin,sideci-sample/sideci-sample-rails_admin,cob3/rails_admin,PhilipCastiglione/rails_admin,aravindgd/rails_admin,dmitrypol/rails_admin,CodingZeal/rails_admin,PhilipCastiglione/rails_admin,aravindgd/rails_admin,ernestoe/rails_admin,goodinc/rails_admin_for_mag,voyera/rails_admin,cob3/rails_admin,josedonizetti/rails_admin
haml
## Code Before: - file = form.object.send(field.method_name).presence .toggle{:style => ('display:none;' if file && field.delete_method && form.object.send(field.delete_method) == '1')} - if value = field.pretty_value = value = form.file_field(field.name, field.html_attributes.reverse_merge({ :data => { :fileupload => true }})) - if field.optional? && field.errors.blank? && file && field.delete_method %a.btn.btn-info{:href => '#', :'data-toggle' => 'button', :onclick => "$(this).siblings('[type=checkbox]').click(); $(this).siblings('.toggle').toggle('slow'); jQuery(this).toggleClass('btn-danger btn-info'); return false"} %i.icon-white.icon-trash = I18n.t('admin.actions.delete.menu').capitalize + " #{field.method_name}" = form.check_box(field.delete_method, :style => 'display:none;' ) - if field.cache_method = form.hidden_field(field.cache_method) ## Instruction: Fix delete image button text. ## Code After: - file = form.object.send(field.method_name).presence .toggle{:style => ('display:none;' if file && field.delete_method && form.object.send(field.delete_method) == '1')} - if value = field.pretty_value = value = form.file_field(field.name, field.html_attributes.reverse_merge({ :data => { :fileupload => true }})) - if field.optional? && field.errors.blank? && file && field.delete_method %a.btn.btn-info{:href => '#', :'data-toggle' => 'button', :onclick => "$(this).siblings('[type=checkbox]').click(); $(this).siblings('.toggle').toggle('slow'); jQuery(this).toggleClass('btn-danger btn-info'); return false"} %i.icon-white.icon-trash = I18n.t('admin.actions.delete.menu').capitalize + " #{field.label.downcase}" = form.check_box(field.delete_method, :style => 'display:none;' ) - if field.cache_method = form.hidden_field(field.cache_method)
- file = form.object.send(field.method_name).presence .toggle{:style => ('display:none;' if file && field.delete_method && form.object.send(field.delete_method) == '1')} - if value = field.pretty_value = value = form.file_field(field.name, field.html_attributes.reverse_merge({ :data => { :fileupload => true }})) - if field.optional? && field.errors.blank? && file && field.delete_method %a.btn.btn-info{:href => '#', :'data-toggle' => 'button', :onclick => "$(this).siblings('[type=checkbox]').click(); $(this).siblings('.toggle').toggle('slow'); jQuery(this).toggleClass('btn-danger btn-info'); return false"} %i.icon-white.icon-trash - = I18n.t('admin.actions.delete.menu').capitalize + " #{field.method_name}" ? ^ ^^ ^^ ^ + = I18n.t('admin.actions.delete.menu').capitalize + " #{field.label.downcase}" ? ^^^ ^^^ ^ + ^ = form.check_box(field.delete_method, :style => 'display:none;' ) - if field.cache_method = form.hidden_field(field.cache_method)
2
0.153846
1
1
5fc45c33eda63f6cf1f7b698ba2ef946aec6a1a8
templates/ambassador/ambassador-no-rbac.yaml
templates/ambassador/ambassador-no-rbac.yaml
--- apiVersion: v1 kind: Service metadata: labels: service: ambassador-admin name: ambassador-admin spec: type: NodePort ports: - name: ambassador-admin port: 8877 targetPort: 8877 selector: service: ambassador --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: ambassador spec: replicas: 3 template: metadata: annotations: sidecar.istio.io/inject: "false" labels: service: ambassador spec: containers: - name: ambassador image: {{AMBASSADOR_DOCKER_IMAGE}} resources: limits: cpu: 1 memory: 400Mi requests: cpu: 200m memory: 100Mi env: - name: AMBASSADOR_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace livenessProbe: httpGet: path: /ambassador/v0/check_alive port: 8877 initialDelaySeconds: 30 periodSeconds: 3 readinessProbe: httpGet: path: /ambassador/v0/check_ready port: 8877 initialDelaySeconds: 30 periodSeconds: 3 - name: statsd image: {{STATSD_DOCKER_IMAGE}} restartPolicy: Always
--- apiVersion: v1 kind: Service metadata: labels: service: ambassador-admin name: ambassador-admin spec: type: NodePort ports: - name: ambassador-admin port: 8877 targetPort: 8877 selector: service: ambassador --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: ambassador spec: replicas: 3 template: metadata: annotations: sidecar.istio.io/inject: "false" labels: service: ambassador spec: containers: - name: ambassador image: {{AMBASSADOR_DOCKER_IMAGE}} resources: limits: cpu: 1 memory: 400Mi requests: cpu: 200m memory: 100Mi env: - name: AMBASSADOR_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace livenessProbe: httpGet: path: /ambassador/v0/check_alive port: 8877 initialDelaySeconds: 30 periodSeconds: 3 readinessProbe: httpGet: path: /ambassador/v0/check_ready port: 8877 initialDelaySeconds: 30 periodSeconds: 3 restartPolicy: Always
Remove statsd reference from template
Remove statsd reference from template
YAML
apache-2.0
datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador,datawire/ambassador
yaml
## Code Before: --- apiVersion: v1 kind: Service metadata: labels: service: ambassador-admin name: ambassador-admin spec: type: NodePort ports: - name: ambassador-admin port: 8877 targetPort: 8877 selector: service: ambassador --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: ambassador spec: replicas: 3 template: metadata: annotations: sidecar.istio.io/inject: "false" labels: service: ambassador spec: containers: - name: ambassador image: {{AMBASSADOR_DOCKER_IMAGE}} resources: limits: cpu: 1 memory: 400Mi requests: cpu: 200m memory: 100Mi env: - name: AMBASSADOR_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace livenessProbe: httpGet: path: /ambassador/v0/check_alive port: 8877 initialDelaySeconds: 30 periodSeconds: 3 readinessProbe: httpGet: path: /ambassador/v0/check_ready port: 8877 initialDelaySeconds: 30 periodSeconds: 3 - name: statsd image: {{STATSD_DOCKER_IMAGE}} restartPolicy: Always ## Instruction: Remove statsd reference from template ## Code After: --- apiVersion: v1 kind: Service metadata: labels: service: ambassador-admin name: ambassador-admin spec: type: NodePort ports: - name: ambassador-admin port: 8877 targetPort: 8877 selector: service: ambassador --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: ambassador spec: replicas: 3 template: metadata: annotations: sidecar.istio.io/inject: "false" labels: service: ambassador spec: containers: - name: ambassador image: {{AMBASSADOR_DOCKER_IMAGE}} resources: limits: cpu: 1 memory: 400Mi requests: cpu: 200m memory: 100Mi env: - name: AMBASSADOR_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace livenessProbe: httpGet: path: /ambassador/v0/check_alive port: 8877 initialDelaySeconds: 30 periodSeconds: 3 readinessProbe: httpGet: path: /ambassador/v0/check_ready port: 8877 initialDelaySeconds: 30 periodSeconds: 3 restartPolicy: Always
--- apiVersion: v1 kind: Service metadata: labels: service: ambassador-admin name: ambassador-admin spec: type: NodePort ports: - name: ambassador-admin port: 8877 targetPort: 8877 selector: service: ambassador --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: ambassador spec: replicas: 3 template: metadata: annotations: sidecar.istio.io/inject: "false" labels: service: ambassador spec: containers: - name: ambassador image: {{AMBASSADOR_DOCKER_IMAGE}} resources: limits: cpu: 1 memory: 400Mi requests: cpu: 200m memory: 100Mi env: - name: AMBASSADOR_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace livenessProbe: httpGet: path: /ambassador/v0/check_alive port: 8877 initialDelaySeconds: 30 periodSeconds: 3 readinessProbe: httpGet: path: /ambassador/v0/check_ready port: 8877 initialDelaySeconds: 30 periodSeconds: 3 - - name: statsd - image: {{STATSD_DOCKER_IMAGE}} restartPolicy: Always
2
0.033898
0
2
4889cf377c78eaf839ed24569e9b3b38d4fa1d66
src/protocol/CMakeLists.txt
src/protocol/CMakeLists.txt
add_custom_command(OUTPUT xdg-shell-source.c xdg-shell-header.h COMMAND ${WAYLAND_SCANNER_EXE} code < xdg-shell-protocol.xml > xdg-shell-source.c COMMAND ${WAYLAND_SCANNER_EXE} server-header < xdg-shell-protocol.xml > xdg-shell-header.h DEPENDS xdg-shell-protocol.xml VERBATIM) set(SOURCE_FILES xdg-shell-source.c ) add_library(protocol OBJECT ${SOURCE_FILES} )
add_custom_command(OUTPUT xdg-shell-source.c xdg-shell-header.h COMMAND ${WAYLAND_SCANNER_EXE} code < xdg-shell-protocol.xml > xdg-shell-source.c COMMAND ${WAYLAND_SCANNER_EXE} server-header < xdg-shell-protocol.xml > xdg-shell-header.h DEPENDS xdg-shell-protocol.xml VERBATIM) include_directories( ${WAYLAND_CURSOR_INCLUDE_DIRS} ${WAYLAND_SERVER_INCLUDE_DIRS} ) add_definitions( ${WAYLAND_CURSOR_DEFINITIONS} ${WAYLAND_SERVER_DEFINITIONS} ) set(SOURCE_FILES xdg-shell-source.c ) add_library(protocol STATIC ${SOURCE_FILES} ) target_link_libraries(protocol ${WAYLAND_CURSOR_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} )
Make "protocol" a static library
Make "protocol" a static library
Text
lgpl-2.1
waysome/waysome,waysome/waysome
text
## Code Before: add_custom_command(OUTPUT xdg-shell-source.c xdg-shell-header.h COMMAND ${WAYLAND_SCANNER_EXE} code < xdg-shell-protocol.xml > xdg-shell-source.c COMMAND ${WAYLAND_SCANNER_EXE} server-header < xdg-shell-protocol.xml > xdg-shell-header.h DEPENDS xdg-shell-protocol.xml VERBATIM) set(SOURCE_FILES xdg-shell-source.c ) add_library(protocol OBJECT ${SOURCE_FILES} ) ## Instruction: Make "protocol" a static library ## Code After: add_custom_command(OUTPUT xdg-shell-source.c xdg-shell-header.h COMMAND ${WAYLAND_SCANNER_EXE} code < xdg-shell-protocol.xml > xdg-shell-source.c COMMAND ${WAYLAND_SCANNER_EXE} server-header < xdg-shell-protocol.xml > xdg-shell-header.h DEPENDS xdg-shell-protocol.xml VERBATIM) include_directories( ${WAYLAND_CURSOR_INCLUDE_DIRS} ${WAYLAND_SERVER_INCLUDE_DIRS} ) add_definitions( ${WAYLAND_CURSOR_DEFINITIONS} ${WAYLAND_SERVER_DEFINITIONS} ) set(SOURCE_FILES xdg-shell-source.c ) add_library(protocol STATIC ${SOURCE_FILES} ) target_link_libraries(protocol ${WAYLAND_CURSOR_LIBRARIES} ${WAYLAND_SERVER_LIBRARIES} )
add_custom_command(OUTPUT xdg-shell-source.c xdg-shell-header.h COMMAND ${WAYLAND_SCANNER_EXE} code < xdg-shell-protocol.xml > xdg-shell-source.c COMMAND ${WAYLAND_SCANNER_EXE} server-header < xdg-shell-protocol.xml > xdg-shell-header.h DEPENDS xdg-shell-protocol.xml VERBATIM) + include_directories( + ${WAYLAND_CURSOR_INCLUDE_DIRS} + ${WAYLAND_SERVER_INCLUDE_DIRS} + ) + + add_definitions( + ${WAYLAND_CURSOR_DEFINITIONS} + ${WAYLAND_SERVER_DEFINITIONS} + ) + set(SOURCE_FILES xdg-shell-source.c ) - add_library(protocol OBJECT ? ^^^^ - + add_library(protocol STATIC ? ^^^^^ ${SOURCE_FILES} ) + + target_link_libraries(protocol + ${WAYLAND_CURSOR_LIBRARIES} + ${WAYLAND_SERVER_LIBRARIES} + ) +
18
1.5
17
1
d944ba7271be897a89d4913917c84656b1dbc0fd
lib/activeadmin_addons/support/input_base.rb
lib/activeadmin_addons/support/input_base.rb
module ActiveAdminAddons class InputBase < Formtastic::Inputs::StringInput include InputOptionsHandler include InputMethods include InputHtmlHelpers def to_html load_input_class load_control_attributes render_custom_input if parts.any? return input_wrapping { parts_to_html } else super end end def input_html_options super.merge(control_attributes) end def parts_to_html parts.flatten.join("\n").html_safe end def load_input_class load_class(self.class.to_s.underscore.dasherize) end def load_control_attributes # Override on child classes if needed end def render_custom_input # Override on child classes if needed end def parts @parts ||= [] end def concat(part) parts << part end end end
module ActiveAdminAddons class InputBase < Formtastic::Inputs::StringInput include InputOptionsHandler include InputMethods include InputHtmlHelpers def to_html load_input_class load_control_attributes render_custom_input if parts.any? return input_wrapping { parts_to_html } else super end end def input_html_options # maxwidth and size are added by Formtastic::Inputs::StringInput # but according to the HTML standard these are not valid attributes # on the inputs provided by this module super.except(:maxlength, :size).merge(control_attributes) end def parts_to_html parts.flatten.join("\n").html_safe end def load_input_class load_class(self.class.to_s.underscore.dasherize) end def load_control_attributes # Override on child classes if needed end def render_custom_input # Override on child classes if needed end def parts @parts ||= [] end def concat(part) parts << part end end end
Remove invalid html attributes for inputs
Remove invalid html attributes for inputs
Ruby
mit
platanus/activeadmin_addons,platanus/activeadmin_addons,platanus/activeadmin_addons,platanus/activeadmin_addons
ruby
## Code Before: module ActiveAdminAddons class InputBase < Formtastic::Inputs::StringInput include InputOptionsHandler include InputMethods include InputHtmlHelpers def to_html load_input_class load_control_attributes render_custom_input if parts.any? return input_wrapping { parts_to_html } else super end end def input_html_options super.merge(control_attributes) end def parts_to_html parts.flatten.join("\n").html_safe end def load_input_class load_class(self.class.to_s.underscore.dasherize) end def load_control_attributes # Override on child classes if needed end def render_custom_input # Override on child classes if needed end def parts @parts ||= [] end def concat(part) parts << part end end end ## Instruction: Remove invalid html attributes for inputs ## Code After: module ActiveAdminAddons class InputBase < Formtastic::Inputs::StringInput include InputOptionsHandler include InputMethods include InputHtmlHelpers def to_html load_input_class load_control_attributes render_custom_input if parts.any? return input_wrapping { parts_to_html } else super end end def input_html_options # maxwidth and size are added by Formtastic::Inputs::StringInput # but according to the HTML standard these are not valid attributes # on the inputs provided by this module super.except(:maxlength, :size).merge(control_attributes) end def parts_to_html parts.flatten.join("\n").html_safe end def load_input_class load_class(self.class.to_s.underscore.dasherize) end def load_control_attributes # Override on child classes if needed end def render_custom_input # Override on child classes if needed end def parts @parts ||= [] end def concat(part) parts << part end end end
module ActiveAdminAddons class InputBase < Formtastic::Inputs::StringInput include InputOptionsHandler include InputMethods include InputHtmlHelpers def to_html load_input_class load_control_attributes render_custom_input if parts.any? return input_wrapping { parts_to_html } else super end end def input_html_options - super.merge(control_attributes) + # maxwidth and size are added by Formtastic::Inputs::StringInput + # but according to the HTML standard these are not valid attributes + # on the inputs provided by this module + super.except(:maxlength, :size).merge(control_attributes) end def parts_to_html parts.flatten.join("\n").html_safe end def load_input_class load_class(self.class.to_s.underscore.dasherize) end def load_control_attributes # Override on child classes if needed end def render_custom_input # Override on child classes if needed end def parts @parts ||= [] end def concat(part) parts << part end end end
5
0.108696
4
1
5c615b57ecc3b12100de53f812ab79fecb62d290
.travis.yml
.travis.yml
before_install: - ./test/customize_environment.sh install: - ./src/os/setup.sh -y language: generic script: - ./test/main.sh matrix: include: - os: osx osx_image: xcode7.3 env: - INSTALL_APPLICATION_IF_READABLE_NAME_MATCH_REGEX="^([a-jA-J0-9]|Bash|Java).*$" - os: osx osx_image: xcode7.3 env: - INSTALL_APPLICATION_IF_READABLE_NAME_MATCH_REGEX="^([h-zH-Z]|Bash|Java).*$"
before_install: - ./test/customize_environment.sh install: - ./src/os/setup.sh -y language: generic matrix: include: - os: osx osx_image: xcode8 env: - INSTALL_APPLICATION_IF_READABLE_NAME_MATCH_REGEX="^([a-jA-J0-9]|Bash|Java).*$" - os: osx osx_image: xcode8 env: - INSTALL_APPLICATION_IF_READABLE_NAME_MATCH_REGEX="^([h-zH-Z]|Bash|Java).*$" script: - ./test/main.sh sudo: required
Use xcode8 image to test macOS related code
[test] Use xcode8 image to test macOS related code
YAML
mit
wingy3181/dotfiles,wingy3181/dotfiles,wingy3181/dotfiles
yaml
## Code Before: before_install: - ./test/customize_environment.sh install: - ./src/os/setup.sh -y language: generic script: - ./test/main.sh matrix: include: - os: osx osx_image: xcode7.3 env: - INSTALL_APPLICATION_IF_READABLE_NAME_MATCH_REGEX="^([a-jA-J0-9]|Bash|Java).*$" - os: osx osx_image: xcode7.3 env: - INSTALL_APPLICATION_IF_READABLE_NAME_MATCH_REGEX="^([h-zH-Z]|Bash|Java).*$" ## Instruction: [test] Use xcode8 image to test macOS related code ## Code After: before_install: - ./test/customize_environment.sh install: - ./src/os/setup.sh -y language: generic matrix: include: - os: osx osx_image: xcode8 env: - INSTALL_APPLICATION_IF_READABLE_NAME_MATCH_REGEX="^([a-jA-J0-9]|Bash|Java).*$" - os: osx osx_image: xcode8 env: - INSTALL_APPLICATION_IF_READABLE_NAME_MATCH_REGEX="^([h-zH-Z]|Bash|Java).*$" script: - ./test/main.sh sudo: required
before_install: - ./test/customize_environment.sh install: - ./src/os/setup.sh -y language: generic - script: - - ./test/main.sh - matrix: include: - os: osx - osx_image: xcode7.3 ? ^^^ + osx_image: xcode8 ? ^ env: - INSTALL_APPLICATION_IF_READABLE_NAME_MATCH_REGEX="^([a-jA-J0-9]|Bash|Java).*$" - os: osx - osx_image: xcode7.3 ? ^^^ + osx_image: xcode8 ? ^ env: - INSTALL_APPLICATION_IF_READABLE_NAME_MATCH_REGEX="^([h-zH-Z]|Bash|Java).*$" + + script: + - ./test/main.sh + + sudo: required
12
0.545455
7
5
4d4417c9a68168c18e4f141eebb503914596e547
diskimage_builder/elements/ubuntu-minimal/environment.d/10-ubuntu-distro-name.bash
diskimage_builder/elements/ubuntu-minimal/environment.d/10-ubuntu-distro-name.bash
export DISTRO_NAME=ubuntu export DIB_RELEASE=${DIB_RELEASE:-xenial} export DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main,restricted,universe} if [ -n "${DIB_UBUNTU_DISTRIBUTION_MIRROR:-}" ]; then DIB_DISTRIBUTION_MIRROR=$DIB_UBUNTU_DISTRIBUTION_MIRROR fi export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-http://archive.ubuntu.com/ubuntu}
export DISTRO_NAME=ubuntu export DIB_RELEASE=${DIB_RELEASE:-xenial} export DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main,restricted,universe} if [ -n "${DIB_UBUNTU_DISTRIBUTION_MIRROR:-}" ]; then DIB_DISTRIBUTION_MIRROR=$DIB_UBUNTU_DISTRIBUTION_MIRROR fi # There are two default distro mirrors depending on architecture ARCH=${ARCH:-} if [[ "arm64 armhf powerpc ppc64el s390x" =~ "$ARCH" ]]; then default_ubuntu_mirror=http://ports.ubuntu.com/ubuntu-ports else default_ubuntu_mirror=http://archive.ubuntu.com/ubuntu fi export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-$default_ubuntu_mirror}
Use correct Ubuntu distro url on non-x86 arches
Use correct Ubuntu distro url on non-x86 arches diskimage-builder usually provides defaults that work out of the box. One default that does not work outside of x86 land is Ubuntu distro mirror url. Considering there are only two valid default options, we can automatically choose a better default. This patch changes behavior only for architectures known to be using http://ports.ubuntu.com/ubuntu-ports. All others still would use http://archive.ubuntu.com/ubuntu as default. It provides some guarantee that we do not introduce a regression. Change-Id: If95a64bac0c88f30736da4bae7f1fdce126c0bf6
Shell
apache-2.0
switch-ch/diskimage-builder,openstack/diskimage-builder,openstack/diskimage-builder,switch-ch/diskimage-builder
shell
## Code Before: export DISTRO_NAME=ubuntu export DIB_RELEASE=${DIB_RELEASE:-xenial} export DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main,restricted,universe} if [ -n "${DIB_UBUNTU_DISTRIBUTION_MIRROR:-}" ]; then DIB_DISTRIBUTION_MIRROR=$DIB_UBUNTU_DISTRIBUTION_MIRROR fi export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-http://archive.ubuntu.com/ubuntu} ## Instruction: Use correct Ubuntu distro url on non-x86 arches diskimage-builder usually provides defaults that work out of the box. One default that does not work outside of x86 land is Ubuntu distro mirror url. Considering there are only two valid default options, we can automatically choose a better default. This patch changes behavior only for architectures known to be using http://ports.ubuntu.com/ubuntu-ports. All others still would use http://archive.ubuntu.com/ubuntu as default. It provides some guarantee that we do not introduce a regression. Change-Id: If95a64bac0c88f30736da4bae7f1fdce126c0bf6 ## Code After: export DISTRO_NAME=ubuntu export DIB_RELEASE=${DIB_RELEASE:-xenial} export DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main,restricted,universe} if [ -n "${DIB_UBUNTU_DISTRIBUTION_MIRROR:-}" ]; then DIB_DISTRIBUTION_MIRROR=$DIB_UBUNTU_DISTRIBUTION_MIRROR fi # There are two default distro mirrors depending on architecture ARCH=${ARCH:-} if [[ "arm64 armhf powerpc ppc64el s390x" =~ "$ARCH" ]]; then default_ubuntu_mirror=http://ports.ubuntu.com/ubuntu-ports else default_ubuntu_mirror=http://archive.ubuntu.com/ubuntu fi export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-$default_ubuntu_mirror}
export DISTRO_NAME=ubuntu export DIB_RELEASE=${DIB_RELEASE:-xenial} export DIB_DEBIAN_COMPONENTS=${DIB_DEBIAN_COMPONENTS:-main,restricted,universe} if [ -n "${DIB_UBUNTU_DISTRIBUTION_MIRROR:-}" ]; then DIB_DISTRIBUTION_MIRROR=$DIB_UBUNTU_DISTRIBUTION_MIRROR fi + + # There are two default distro mirrors depending on architecture + ARCH=${ARCH:-} + if [[ "arm64 armhf powerpc ppc64el s390x" =~ "$ARCH" ]]; then + default_ubuntu_mirror=http://ports.ubuntu.com/ubuntu-ports + else + default_ubuntu_mirror=http://archive.ubuntu.com/ubuntu + fi + - export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-http://archive.ubuntu.com/ubuntu} ? ^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^ + export DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-$default_ubuntu_mirror} ? ^^^^^^^ ^ ^^^^^ ^
11
1.375
10
1
23420ec45061a33a0c4d7dc17dcdd8279a69e865
Cargo.toml
Cargo.toml
[package] name = "anup" version = "0.1.0" authors = ["Acizza <jonathanmce@gmail.com>"] build = "build.rs" [profile.release] lto = true [dependencies] base64 = "0.9" chrono = "0.4" clap = "2.31" failure = "0.1" directories = "0.10" lazy_static = "1.0" regex = "1.0" serde = "1.0" serde_derive = "1.0" toml = "0.4" [dependencies.mal] version = "0.8" default-features = false features = ["anime"] [target.'cfg(windows)'.dependencies.winapi] version = "0.3" features = ["shellapi", "synchapi"]
[package] name = "anup" version = "0.1.0" authors = ["Acizza <jonathanmce@gmail.com>"] build = "build.rs" [profile.release] lto = true codegen-units = 1 [dependencies] base64 = "0.9" chrono = "0.4" clap = "2.31" failure = "0.1" directories = "0.10" lazy_static = "1.0" regex = "1.0" serde = "1.0" serde_derive = "1.0" toml = "0.4" [dependencies.mal] version = "0.8" default-features = false features = ["anime"] [target.'cfg(windows)'.dependencies.winapi] version = "0.3" features = ["shellapi", "synchapi"]
Set codegen-units to 1 in release profile
Set codegen-units to 1 in release profile
TOML
agpl-3.0
Acizza/anitrack
toml
## Code Before: [package] name = "anup" version = "0.1.0" authors = ["Acizza <jonathanmce@gmail.com>"] build = "build.rs" [profile.release] lto = true [dependencies] base64 = "0.9" chrono = "0.4" clap = "2.31" failure = "0.1" directories = "0.10" lazy_static = "1.0" regex = "1.0" serde = "1.0" serde_derive = "1.0" toml = "0.4" [dependencies.mal] version = "0.8" default-features = false features = ["anime"] [target.'cfg(windows)'.dependencies.winapi] version = "0.3" features = ["shellapi", "synchapi"] ## Instruction: Set codegen-units to 1 in release profile ## Code After: [package] name = "anup" version = "0.1.0" authors = ["Acizza <jonathanmce@gmail.com>"] build = "build.rs" [profile.release] lto = true codegen-units = 1 [dependencies] base64 = "0.9" chrono = "0.4" clap = "2.31" failure = "0.1" directories = "0.10" lazy_static = "1.0" regex = "1.0" serde = "1.0" serde_derive = "1.0" toml = "0.4" [dependencies.mal] version = "0.8" default-features = false features = ["anime"] [target.'cfg(windows)'.dependencies.winapi] version = "0.3" features = ["shellapi", "synchapi"]
[package] name = "anup" version = "0.1.0" authors = ["Acizza <jonathanmce@gmail.com>"] build = "build.rs" [profile.release] lto = true + codegen-units = 1 [dependencies] base64 = "0.9" chrono = "0.4" clap = "2.31" failure = "0.1" directories = "0.10" lazy_static = "1.0" regex = "1.0" serde = "1.0" serde_derive = "1.0" toml = "0.4" [dependencies.mal] version = "0.8" default-features = false features = ["anime"] [target.'cfg(windows)'.dependencies.winapi] version = "0.3" features = ["shellapi", "synchapi"]
1
0.033333
1
0
530629f04e81ff03866b4080e101d7c85fb76bfe
angular/src/app/layout/topbar-languageswitch.component.html
angular/src/app/layout/topbar-languageswitch.component.html
<li class="dropdown"> <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button"> <i class="{{currentLanguage.icon}}" title="{{currentLanguage.displayName}}"></i> {{currentLanguage.displayName}} <b class="caret"></b> </a> <ul class="dropdown-menu pull-right"> <li *ngFor="let language of languages"> <a *ngIf="language.name != currentLanguage.name" href="#" (click)="changeLanguage(language.name)"><i class="{{language.icon}}"></i> {{language.displayName}}</a> </li> </ul> </li>
<li class="dropdown"> <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button"> <i class="{{currentLanguage.icon}}" title="{{currentLanguage.displayName}}"></i> {{currentLanguage.displayName}} <b class="caret"></b> </a> <ul class="dropdown-menu"> <li *ngFor="let language of languages"> <a *ngIf="language.name != currentLanguage.name" href="#" (click)="changeLanguage(language.name)"><i class="{{language.icon}}"></i> {{language.displayName}}</a> </li> </ul> </li>
Remove pull-right for lang dropdown
Remove pull-right for lang dropdown
HTML
mit
aspnetboilerplate/module-zero-core-template,abdllhbyrktr/module-zero-core-template,aspnetboilerplate/module-zero-core-template,abdllhbyrktr/module-zero-core-template,aspnetboilerplate/module-zero-core-template,abdllhbyrktr/module-zero-core-template,aspnetboilerplate/module-zero-core-template,abdllhbyrktr/module-zero-core-template,aspnetboilerplate/module-zero-core-template,abdllhbyrktr/module-zero-core-template
html
## Code Before: <li class="dropdown"> <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button"> <i class="{{currentLanguage.icon}}" title="{{currentLanguage.displayName}}"></i> {{currentLanguage.displayName}} <b class="caret"></b> </a> <ul class="dropdown-menu pull-right"> <li *ngFor="let language of languages"> <a *ngIf="language.name != currentLanguage.name" href="#" (click)="changeLanguage(language.name)"><i class="{{language.icon}}"></i> {{language.displayName}}</a> </li> </ul> </li> ## Instruction: Remove pull-right for lang dropdown ## Code After: <li class="dropdown"> <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button"> <i class="{{currentLanguage.icon}}" title="{{currentLanguage.displayName}}"></i> {{currentLanguage.displayName}} <b class="caret"></b> </a> <ul class="dropdown-menu"> <li *ngFor="let language of languages"> <a *ngIf="language.name != currentLanguage.name" href="#" (click)="changeLanguage(language.name)"><i class="{{language.icon}}"></i> {{language.displayName}}</a> </li> </ul> </li>
<li class="dropdown"> <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button"> <i class="{{currentLanguage.icon}}" title="{{currentLanguage.displayName}}"></i> {{currentLanguage.displayName}} <b class="caret"></b> </a> - <ul class="dropdown-menu pull-right"> ? ----------- + <ul class="dropdown-menu"> <li *ngFor="let language of languages"> <a *ngIf="language.name != currentLanguage.name" href="#" (click)="changeLanguage(language.name)"><i class="{{language.icon}}"></i> {{language.displayName}}</a> </li> </ul> </li>
2
0.166667
1
1
a559bae6840cc842385e5ba847f6a8fe8eeaad89
src/main/java/com/leafriend/flix/Flix.java
src/main/java/com/leafriend/flix/Flix.java
package com.leafriend.flix; import java.io.Console; public class Flix { private Options options; public static void main(String[] args) { Console console = System.console(); console.printf("Hello, FLiX\n"); public Flix(Options options) { this.options = options; } } }
package com.leafriend.flix; public class Flix { private Options options; public static void main(String[] args) { Options options = new Options(); new Flix(options).run(); } public Flix(Options options) { this.options = options; } public void run() { } }
Call run() for new instance
Call run() for new instance
Java
mit
leafriend/flix
java
## Code Before: package com.leafriend.flix; import java.io.Console; public class Flix { private Options options; public static void main(String[] args) { Console console = System.console(); console.printf("Hello, FLiX\n"); public Flix(Options options) { this.options = options; } } } ## Instruction: Call run() for new instance ## Code After: package com.leafriend.flix; public class Flix { private Options options; public static void main(String[] args) { Options options = new Options(); new Flix(options).run(); } public Flix(Options options) { this.options = options; } public void run() { } }
package com.leafriend.flix; - - import java.io.Console; public class Flix { private Options options; public static void main(String[] args) { - Console console = System.console(); + Options options = new Options(); - console.printf("Hello, FLiX\n"); + new Flix(options).run(); + + } + public Flix(Options options) { this.options = options; } + public void run() { } }
10
0.47619
6
4
90a5866424397d22f220f3d2980819d16a620084
examples/thrift/CMakeLists.txt
examples/thrift/CMakeLists.txt
set(MUDUO_THRIFT_SRCS ThriftConnection.cc ThriftServer.cc ) add_library(muduo_thrift ${MUDUO_THRIFT_SRCS}) target_link_libraries(muduo_thrift muduo_net thrift) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_subdirectory(tests)
set(MUDUO_THRIFT_SRCS ThriftConnection.cc ThriftServer.cc ) add_library(muduo_thrift ${MUDUO_THRIFT_SRCS}) target_link_libraries(muduo_thrift muduo_net thrift) if(THRIFT_COMPILER AND THRIFT_INCLUDE_DIR AND THRIFT_LIBRARY) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_subdirectory(tests) endif()
Fix build for no thrift
Fix build for no thrift
Text
bsd-3-clause
shenhzou654321/muduo,flyfeifan/muduo,jerk1991/muduo,wangweihao/muduo,lizhanhui/muduo,daodaoliang/muduo,SuperMXC/muduo,nestle1998/muduo,wangweihao/muduo,decimalbell/muduo,shuang-shuang/muduo,wangweihao/muduo,shenhzou654321/muduo,jerk1991/muduo,shenhzou654321/muduo,DongweiLee/muduo,lizhanhui/muduo,SuperMXC/muduo,guker/muduo,youprofit/muduo,lvshiling/muduo,Cofyc/muduo,huan80s/muduo,Cofyc/muduo,yunhappy/muduo,ywy2090/muduo,decimalbell/muduo,jxd134/muduo,decimalbell/muduo,pthreadself/muduo,Cofyc/muduo,westfly/muduo,Cofyc/muduo,daodaoliang/muduo,mitliucak/muduo,yunhappy/muduo,dhanzhang/muduo,zouzl/muduo-learning,jxd134/muduo,mitliucak/muduo,mitliucak/muduo,kidzyoung/muduo,SuperMXC/muduo,Cofyc/muduo,lvmaoxv/muduo,shuang-shuang/muduo,huan80s/muduo,fc500110/muduo,zhuangshi23/muduo,dhanzhang/muduo,zouzl/muduo-learning,wangweihao/muduo,lvshiling/muduo,zhuangshi23/muduo,shenhzou654321/muduo,fc500110/muduo,KublaikhanGeek/muduo,zhanMingming/muduo,zxylvlp/muduo,flyfeifan/muduo,zouzl/muduo-learning,june505/muduo,decimalbell/muduo,shenhzou654321/muduo,KunYi/muduo,zhanMingming/muduo,SuperMXC/muduo,mitliucak/muduo,westfly/muduo,dhanzhang/muduo,june505/muduo,xzmagic/muduo,xzmagic/muduo,huan80s/muduo,dhanzhang/muduo,kidzyoung/muduo,huan80s/muduo,zxylvlp/muduo,penyatree/muduo,mitliucak/muduo,KublaikhanGeek/muduo,dhanzhang/muduo,zxylvlp/muduo,tsh185/muduo,KunYi/muduo,nestle1998/muduo,youprofit/muduo,DongweiLee/muduo,westfly/muduo,guker/muduo,pthreadself/muduo,penyatree/muduo,wangweihao/muduo,lvmaoxv/muduo,tsh185/muduo,decimalbell/muduo,SuperMXC/muduo,ywy2090/muduo,zhuangshi23/muduo,huan80s/muduo
text
## Code Before: set(MUDUO_THRIFT_SRCS ThriftConnection.cc ThriftServer.cc ) add_library(muduo_thrift ${MUDUO_THRIFT_SRCS}) target_link_libraries(muduo_thrift muduo_net thrift) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_subdirectory(tests) ## Instruction: Fix build for no thrift ## Code After: set(MUDUO_THRIFT_SRCS ThriftConnection.cc ThriftServer.cc ) add_library(muduo_thrift ${MUDUO_THRIFT_SRCS}) target_link_libraries(muduo_thrift muduo_net thrift) if(THRIFT_COMPILER AND THRIFT_INCLUDE_DIR AND THRIFT_LIBRARY) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_subdirectory(tests) endif()
set(MUDUO_THRIFT_SRCS ThriftConnection.cc ThriftServer.cc ) add_library(muduo_thrift ${MUDUO_THRIFT_SRCS}) target_link_libraries(muduo_thrift muduo_net thrift) + if(THRIFT_COMPILER AND THRIFT_INCLUDE_DIR AND THRIFT_LIBRARY) - include_directories(${CMAKE_CURRENT_SOURCE_DIR}) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}) ? ++ - add_subdirectory(tests) + add_subdirectory(tests) ? ++ + endif()
6
0.666667
4
2
245ef55ac75f78921a5a180acd6b59cd336ac2eb
Source/Calculator.hs
Source/Calculator.hs
module Calculator where import Data.List.Split import Data.List calculate :: String -> Double calculate exp | isInfixOf "+" exp = (read $ head (splitOn "+" exp)) + (read $ last (splitOn "+" exp)) | otherwise = read exp
module Calculator where import Data.List.Split import Data.List calculate :: String -> Double calculate exp | "+" `isInfixOf` exp = read (head (splitOn "+" exp)) + read (last (splitOn "+" exp)) | otherwise = read exp
Refactor accordingly to compiler hints
Refactor accordingly to compiler hints
Haskell
mit
ksysu/Calculator
haskell
## Code Before: module Calculator where import Data.List.Split import Data.List calculate :: String -> Double calculate exp | isInfixOf "+" exp = (read $ head (splitOn "+" exp)) + (read $ last (splitOn "+" exp)) | otherwise = read exp ## Instruction: Refactor accordingly to compiler hints ## Code After: module Calculator where import Data.List.Split import Data.List calculate :: String -> Double calculate exp | "+" `isInfixOf` exp = read (head (splitOn "+" exp)) + read (last (splitOn "+" exp)) | otherwise = read exp
module Calculator where import Data.List.Split import Data.List calculate :: String -> Double calculate exp - | isInfixOf "+" exp = (read $ head (splitOn "+" exp)) + (read $ last (splitOn "+" exp)) ? --- - ^^ - ^^ + | "+" `isInfixOf` exp = read (head (splitOn "+" exp)) + read (last (splitOn "+" exp)) ? +++++ + ^ ^ | otherwise = read exp
2
0.222222
1
1
9684af3ecb0fd26deef87e2509a5de892a62e5f1
cloudsizzle/studyplanner/courselist/views.py
cloudsizzle/studyplanner/courselist/views.py
from django.shortcuts import render_to_response from studyplanner.courselist.models import Course from studyplanner.courselist.models import Faculty from studyplanner.courselist.models import Department def list_courses(request, faculty, department): department = Department.objects.get(slug=department) courses = department.courses.all() return render_to_response('list_courses.html', { 'department': department, 'courses': courses}) def list_faculties(request): faculties = Faculty.objects.all() return render_to_response('list_faculties.html', {'faculties': faculties}) def list_departments(request, faculty): faculty = Faculty.objects.get(slug=faculty) departments = faculty.departments.all() return render_to_response('list_departments.html', { 'faculty': faculty, 'departments': departments}) def show_course(request, faculty, department, course): faculty = Faculty.objects.get(slug=faculty) department = Department.objects.get(slug=department) course = Course.objects.get(slug=course) return render_to_response('show_course.html', { 'faculty': faculty, 'department': department, 'course': course})
from django.shortcuts import render_to_response from studyplanner.courselist.models import Course from studyplanner.courselist.models import Faculty from studyplanner.courselist.models import Department def list_courses(request, faculty, department): department = Department.objects.get(slug=department) courses = department.courses.all() return render_to_response('list_courses.html', {'user': request.user, 'department': department, 'courses': courses}) def list_faculties(request): faculties = Faculty.objects.all() return render_to_response('list_faculties.html', {'user': request.user, 'faculties': faculties}) def list_departments(request, faculty): faculty = Faculty.objects.get(slug=faculty) departments = faculty.departments.all() return render_to_response('list_departments.html', {'user': request.user, 'faculty': faculty, 'departments': departments}) def show_course(request, faculty, department, course): faculty = Faculty.objects.get(slug=faculty) department = Department.objects.get(slug=department) course = Course.objects.get(slug=course) return render_to_response('show_course.html', {'user': request.user, 'faculty': faculty, 'department': department, 'course': course})
Add user object to template context.
Add user object to template context.
Python
mit
jpvanhal/cloudsizzle,jpvanhal/cloudsizzle
python
## Code Before: from django.shortcuts import render_to_response from studyplanner.courselist.models import Course from studyplanner.courselist.models import Faculty from studyplanner.courselist.models import Department def list_courses(request, faculty, department): department = Department.objects.get(slug=department) courses = department.courses.all() return render_to_response('list_courses.html', { 'department': department, 'courses': courses}) def list_faculties(request): faculties = Faculty.objects.all() return render_to_response('list_faculties.html', {'faculties': faculties}) def list_departments(request, faculty): faculty = Faculty.objects.get(slug=faculty) departments = faculty.departments.all() return render_to_response('list_departments.html', { 'faculty': faculty, 'departments': departments}) def show_course(request, faculty, department, course): faculty = Faculty.objects.get(slug=faculty) department = Department.objects.get(slug=department) course = Course.objects.get(slug=course) return render_to_response('show_course.html', { 'faculty': faculty, 'department': department, 'course': course}) ## Instruction: Add user object to template context. ## Code After: from django.shortcuts import render_to_response from studyplanner.courselist.models import Course from studyplanner.courselist.models import Faculty from studyplanner.courselist.models import Department def list_courses(request, faculty, department): department = Department.objects.get(slug=department) courses = department.courses.all() return render_to_response('list_courses.html', {'user': request.user, 'department': department, 'courses': courses}) def list_faculties(request): faculties = Faculty.objects.all() return render_to_response('list_faculties.html', {'user': request.user, 'faculties': faculties}) def list_departments(request, faculty): faculty = Faculty.objects.get(slug=faculty) departments = faculty.departments.all() return render_to_response('list_departments.html', {'user': request.user, 'faculty': faculty, 'departments': departments}) def show_course(request, faculty, department, course): faculty = Faculty.objects.get(slug=faculty) department = Department.objects.get(slug=department) course = Course.objects.get(slug=course) return render_to_response('show_course.html', {'user': request.user, 'faculty': faculty, 'department': department, 'course': course})
from django.shortcuts import render_to_response from studyplanner.courselist.models import Course from studyplanner.courselist.models import Faculty from studyplanner.courselist.models import Department def list_courses(request, faculty, department): department = Department.objects.get(slug=department) courses = department.courses.all() - return render_to_response('list_courses.html', { + return render_to_response('list_courses.html', {'user': request.user, ? +++++++++++++++++++++ 'department': department, 'courses': courses}) def list_faculties(request): faculties = Faculty.objects.all() - return render_to_response('list_faculties.html', {'faculties': faculties}) ? --- ^^^ ^ ^^^ --- ^^ + return render_to_response('list_faculties.html', {'user': request.user, ? ^ ^ ^^^ ^^^^^^^ + 'faculties': faculties}) def list_departments(request, faculty): faculty = Faculty.objects.get(slug=faculty) departments = faculty.departments.all() - return render_to_response('list_departments.html', { + return render_to_response('list_departments.html', {'user': request.user, ? +++++++++++++++++++++ 'faculty': faculty, 'departments': departments}) def show_course(request, faculty, department, course): faculty = Faculty.objects.get(slug=faculty) department = Department.objects.get(slug=department) course = Course.objects.get(slug=course) - return render_to_response('show_course.html', { + return render_to_response('show_course.html', {'user': request.user, ? +++++++++++++++++++++ 'faculty': faculty, 'department': department, 'course': course})
9
0.333333
5
4
2f9f9e5122d1b14becf66cd4ae2b33173ea2215e
src/mobile/index.js
src/mobile/index.js
console.log('Hello, from React Native!');
import Expo from 'expo'; import React from 'react'; import { View } from 'react-native'; const App = () => { return React.createElement('div', null, 'Hello, from React Native!'); }; // we don't want this to require transformation class AwakeInDevApp extends React.Component { render() { return React.createElement( View, { style: { flex: 1, }, }, React.createElement(App), React.createElement(process.env.NODE_ENV === 'development' ? Expo.KeepAwake : View) ); } } Expo.registerRootComponent(AwakeInDevApp);
Implement Expo entry point for mobile bundles
Implement Expo entry point for mobile bundles
JavaScript
mit
sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-fullstack-starter-kit
javascript
## Code Before: console.log('Hello, from React Native!'); ## Instruction: Implement Expo entry point for mobile bundles ## Code After: import Expo from 'expo'; import React from 'react'; import { View } from 'react-native'; const App = () => { return React.createElement('div', null, 'Hello, from React Native!'); }; // we don't want this to require transformation class AwakeInDevApp extends React.Component { render() { return React.createElement( View, { style: { flex: 1, }, }, React.createElement(App), React.createElement(process.env.NODE_ENV === 'development' ? Expo.KeepAwake : View) ); } } Expo.registerRootComponent(AwakeInDevApp);
- console.log('Hello, from React Native!'); + import Expo from 'expo'; + import React from 'react'; + import { View } from 'react-native'; + + const App = () => { + return React.createElement('div', null, 'Hello, from React Native!'); + }; + + // we don't want this to require transformation + class AwakeInDevApp extends React.Component { + render() { + return React.createElement( + View, + { + style: { + flex: 1, + }, + }, + React.createElement(App), + React.createElement(process.env.NODE_ENV === 'development' ? Expo.KeepAwake : View) + ); + } + } + + Expo.registerRootComponent(AwakeInDevApp); +
27
27
26
1
c14813be504176dff995ad52c761b99355ba931e
src/SumoCoders/FrameworkCoreBundle/ValueObject/AbstractImage.php
src/SumoCoders/FrameworkCoreBundle/ValueObject/AbstractImage.php
<?php namespace SumoCoders\FrameworkCoreBundle\ValueObject; use Doctrine\ORM\Mapping as ORM; /** * The following things are mandatory to use this class. * * You need to implement the method getUploadDir. * When using this class in an entity certain life cycle callbacks should be called * prepareToUpload for @ORM\PrePersist() and @ORM\PreUpdate() * upload for @ORM\PostPersist() and @ORM\PostUpdate() * remove for @ORM\PostRemove() * * The following things are optional * A fallback image can be set by setting the full path of the image to the FALLBACK_IMAGE constant * By default we will use the fork way for image sizes (source, 100X100 etc) * if you don't want it set GENERATE_THUMBNAILS to false */ abstract class AbstractImage extends AbstractFile { /** * @var string|null */ const FALLBACK_IMAGE = null; /** * @return string */ public function getWebPath() { $webPath = parent::getWebPath(); if (empty($webPath)) { return static::FALLBACK_IMAGE; } return $webPath; } /** * @return null|string */ public function getFallbackImage() { return static::FALLBACK_IMAGE; } }
<?php namespace SumoCoders\FrameworkCoreBundle\ValueObject; use Doctrine\ORM\Mapping as ORM; /** * The following things are mandatory to use this class. * * You need to implement the method getUploadDir. * When using this class in an entity certain life cycle callbacks should be called * prepareToUpload for @ORM\PrePersist() and @ORM\PreUpdate() * upload for @ORM\PostPersist() and @ORM\PostUpdate() * remove for @ORM\PostRemove() * * The following things are optional * A fallback image can be set by setting the full path of the image to the FALLBACK_IMAGE constant */ abstract class AbstractImage extends AbstractFile { /** * @var string|null */ const FALLBACK_IMAGE = null; /** * @return string */ public function getWebPath() { $webPath = parent::getWebPath(); if (empty($webPath)) { return static::FALLBACK_IMAGE; } return $webPath; } /** * @return null|string */ public function getFallbackImage() { return static::FALLBACK_IMAGE; } }
Remove some fork specific documentation
Remove some fork specific documentation
PHP
mit
jonasdekeukelaere/Framework,sumocoders/Framework,sumocoders/Framework,jonasdekeukelaere/Framework,sumocoders/Framework,jonasdekeukelaere/Framework,jonasdekeukelaere/Framework,sumocoders/Framework
php
## Code Before: <?php namespace SumoCoders\FrameworkCoreBundle\ValueObject; use Doctrine\ORM\Mapping as ORM; /** * The following things are mandatory to use this class. * * You need to implement the method getUploadDir. * When using this class in an entity certain life cycle callbacks should be called * prepareToUpload for @ORM\PrePersist() and @ORM\PreUpdate() * upload for @ORM\PostPersist() and @ORM\PostUpdate() * remove for @ORM\PostRemove() * * The following things are optional * A fallback image can be set by setting the full path of the image to the FALLBACK_IMAGE constant * By default we will use the fork way for image sizes (source, 100X100 etc) * if you don't want it set GENERATE_THUMBNAILS to false */ abstract class AbstractImage extends AbstractFile { /** * @var string|null */ const FALLBACK_IMAGE = null; /** * @return string */ public function getWebPath() { $webPath = parent::getWebPath(); if (empty($webPath)) { return static::FALLBACK_IMAGE; } return $webPath; } /** * @return null|string */ public function getFallbackImage() { return static::FALLBACK_IMAGE; } } ## Instruction: Remove some fork specific documentation ## Code After: <?php namespace SumoCoders\FrameworkCoreBundle\ValueObject; use Doctrine\ORM\Mapping as ORM; /** * The following things are mandatory to use this class. * * You need to implement the method getUploadDir. * When using this class in an entity certain life cycle callbacks should be called * prepareToUpload for @ORM\PrePersist() and @ORM\PreUpdate() * upload for @ORM\PostPersist() and @ORM\PostUpdate() * remove for @ORM\PostRemove() * * The following things are optional * A fallback image can be set by setting the full path of the image to the FALLBACK_IMAGE constant */ abstract class AbstractImage extends AbstractFile { /** * @var string|null */ const FALLBACK_IMAGE = null; /** * @return string */ public function getWebPath() { $webPath = parent::getWebPath(); if (empty($webPath)) { return static::FALLBACK_IMAGE; } return $webPath; } /** * @return null|string */ public function getFallbackImage() { return static::FALLBACK_IMAGE; } }
<?php namespace SumoCoders\FrameworkCoreBundle\ValueObject; use Doctrine\ORM\Mapping as ORM; /** * The following things are mandatory to use this class. * * You need to implement the method getUploadDir. * When using this class in an entity certain life cycle callbacks should be called * prepareToUpload for @ORM\PrePersist() and @ORM\PreUpdate() * upload for @ORM\PostPersist() and @ORM\PostUpdate() * remove for @ORM\PostRemove() * * The following things are optional * A fallback image can be set by setting the full path of the image to the FALLBACK_IMAGE constant - * By default we will use the fork way for image sizes (source, 100X100 etc) - * if you don't want it set GENERATE_THUMBNAILS to false */ abstract class AbstractImage extends AbstractFile { /** * @var string|null */ const FALLBACK_IMAGE = null; /** * @return string */ public function getWebPath() { $webPath = parent::getWebPath(); if (empty($webPath)) { return static::FALLBACK_IMAGE; } return $webPath; } /** * @return null|string */ public function getFallbackImage() { return static::FALLBACK_IMAGE; } }
2
0.040816
0
2
efc50c7c3f5239dc1603101341a1e76c5dd3e66d
src/harmowatch/ngx-redux-core/decorators/index.ts
src/harmowatch/ngx-redux-core/decorators/index.ts
import { ReduxActionContextDecorator, ReduxActionContextDecoratorConfig, ReduxActionDecorator, ReduxActionDecoratorConfig, ReduxReducerDecorator, ReduxReducerDecoratorConfig, ReduxStateDecorator, ReduxStateDecoratorConfig, } from '@harmowatch/redux-decorators'; import { MethodType } from '@harmowatch/redux-decorators/lib/generic/generic-decorator'; export * from './redux-select.decorator'; export function ReduxAction(config?: ReduxActionDecoratorConfig): MethodType<Function> { return ReduxActionDecorator.forMethod(config); } export function ReduxActionContext(config?: ReduxActionContextDecoratorConfig) { return ReduxActionContextDecorator.forClass(config); } export function ReduxState(config?: ReduxStateDecoratorConfig) { return ReduxStateDecorator.forClass(config); } export function ReduxReducer(config?: ReduxReducerDecoratorConfig) { return ReduxReducerDecorator.forMethod(config); }
import { ReduxActionContextDecorator, ReduxActionDecorator, ReduxReducerDecorator, ReduxStateDecorator, } from '@harmowatch/redux-decorators'; export * from './redux-select.decorator'; export const ReduxAction = ReduxActionDecorator.forMethod; export const ReduxActionContext = ReduxActionContextDecorator.forClass; export const ReduxState = ReduxStateDecorator.forClass; export const ReduxReducer = ReduxReducerDecorator.forMethod;
Revert "try to export alias function to avoid angulars compiler issue "Only initialized variables and constants can be referenced in decorators ...""
Revert "try to export alias function to avoid angulars compiler issue "Only initialized variables and constants can be referenced in decorators ..."" This reverts commit ab01c7c
TypeScript
mit
HarmoWatch/ngx-redux-core,HarmoWatch/ngx-redux-core,HarmoWatch/ngx-redux-core
typescript
## Code Before: import { ReduxActionContextDecorator, ReduxActionContextDecoratorConfig, ReduxActionDecorator, ReduxActionDecoratorConfig, ReduxReducerDecorator, ReduxReducerDecoratorConfig, ReduxStateDecorator, ReduxStateDecoratorConfig, } from '@harmowatch/redux-decorators'; import { MethodType } from '@harmowatch/redux-decorators/lib/generic/generic-decorator'; export * from './redux-select.decorator'; export function ReduxAction(config?: ReduxActionDecoratorConfig): MethodType<Function> { return ReduxActionDecorator.forMethod(config); } export function ReduxActionContext(config?: ReduxActionContextDecoratorConfig) { return ReduxActionContextDecorator.forClass(config); } export function ReduxState(config?: ReduxStateDecoratorConfig) { return ReduxStateDecorator.forClass(config); } export function ReduxReducer(config?: ReduxReducerDecoratorConfig) { return ReduxReducerDecorator.forMethod(config); } ## Instruction: Revert "try to export alias function to avoid angulars compiler issue "Only initialized variables and constants can be referenced in decorators ..."" This reverts commit ab01c7c ## Code After: import { ReduxActionContextDecorator, ReduxActionDecorator, ReduxReducerDecorator, ReduxStateDecorator, } from '@harmowatch/redux-decorators'; export * from './redux-select.decorator'; export const ReduxAction = ReduxActionDecorator.forMethod; export const ReduxActionContext = ReduxActionContextDecorator.forClass; export const ReduxState = ReduxStateDecorator.forClass; export const ReduxReducer = ReduxReducerDecorator.forMethod;
import { ReduxActionContextDecorator, - ReduxActionContextDecoratorConfig, ReduxActionDecorator, - ReduxActionDecoratorConfig, ReduxReducerDecorator, - ReduxReducerDecoratorConfig, ReduxStateDecorator, - ReduxStateDecoratorConfig, } from '@harmowatch/redux-decorators'; - import { MethodType } from '@harmowatch/redux-decorators/lib/generic/generic-decorator'; export * from './redux-select.decorator'; + export const ReduxAction = ReduxActionDecorator.forMethod; - export function ReduxAction(config?: ReduxActionDecoratorConfig): MethodType<Function> { - return ReduxActionDecorator.forMethod(config); - } - - export function ReduxActionContext(config?: ReduxActionContextDecoratorConfig) { ? --- -- ^^^^^^^^^ ^^^^^^^^ + export const ReduxActionContext = ReduxActionContextDecorator.forClass; ? ++ ^^ ++++ ^^^^^ + export const ReduxState = ReduxStateDecorator.forClass; + export const ReduxReducer = ReduxReducerDecorator.forMethod; - return ReduxActionContextDecorator.forClass(config); - } - - export function ReduxState(config?: ReduxStateDecoratorConfig) { - return ReduxStateDecorator.forClass(config); - } - - export function ReduxReducer(config?: ReduxReducerDecoratorConfig) { - return ReduxReducerDecorator.forMethod(config); - }
24
0.827586
4
20
4ce4008b463dca661f969d33fb398a820de619be
.travis.yml
.travis.yml
rvm: - 1.8.7 - 1.9.2 - 1.9.3 - 2.0.0 - 2.1.5 gemfile: - gemfiles/3.1.gemfile - gemfiles/3.2.gemfile - gemfiles/4.0.gemfile - gemfiles/4.1.gemfile - gemfiles/4.2.gemfile matrix: exclude: - rvm: 1.8.7 gemfile: gemfiles/4.0.gemfile - rvm: 1.8.7 gemfile: gemfiles/4.1.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.0.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.1.gemfile
rvm: - 1.8.7 - 1.9.2 - 1.9.3 - 2.0.0 - 2.1.5 gemfile: - gemfiles/3.1.gemfile - gemfiles/3.2.gemfile - gemfiles/4.0.gemfile - gemfiles/4.1.gemfile - gemfiles/4.2.gemfile matrix: exclude: - rvm: 1.8.7 gemfile: gemfiles/4.0.gemfile - rvm: 1.8.7 gemfile: gemfiles/4.1.gemfile - rvm: 1.8.7 gemfile: gemfiles/4.2.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.0.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.1.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.2.gemfile
Exclude rails 4.2 from ruby < 1.9.3 build in Travis
Exclude rails 4.2 from ruby < 1.9.3 build in Travis
YAML
mit
moiristo/deep_cloneable
yaml
## Code Before: rvm: - 1.8.7 - 1.9.2 - 1.9.3 - 2.0.0 - 2.1.5 gemfile: - gemfiles/3.1.gemfile - gemfiles/3.2.gemfile - gemfiles/4.0.gemfile - gemfiles/4.1.gemfile - gemfiles/4.2.gemfile matrix: exclude: - rvm: 1.8.7 gemfile: gemfiles/4.0.gemfile - rvm: 1.8.7 gemfile: gemfiles/4.1.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.0.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.1.gemfile ## Instruction: Exclude rails 4.2 from ruby < 1.9.3 build in Travis ## Code After: rvm: - 1.8.7 - 1.9.2 - 1.9.3 - 2.0.0 - 2.1.5 gemfile: - gemfiles/3.1.gemfile - gemfiles/3.2.gemfile - gemfiles/4.0.gemfile - gemfiles/4.1.gemfile - gemfiles/4.2.gemfile matrix: exclude: - rvm: 1.8.7 gemfile: gemfiles/4.0.gemfile - rvm: 1.8.7 gemfile: gemfiles/4.1.gemfile - rvm: 1.8.7 gemfile: gemfiles/4.2.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.0.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.1.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.2.gemfile
rvm: - 1.8.7 - 1.9.2 - 1.9.3 - 2.0.0 - 2.1.5 gemfile: - gemfiles/3.1.gemfile - gemfiles/3.2.gemfile - gemfiles/4.0.gemfile - gemfiles/4.1.gemfile - gemfiles/4.2.gemfile matrix: exclude: - rvm: 1.8.7 gemfile: gemfiles/4.0.gemfile - rvm: 1.8.7 gemfile: gemfiles/4.1.gemfile + - rvm: 1.8.7 + gemfile: gemfiles/4.2.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.0.gemfile - rvm: 1.9.2 gemfile: gemfiles/4.1.gemfile + - rvm: 1.9.2 + gemfile: gemfiles/4.2.gemfile
4
0.166667
4
0
d0e634e4472dcd82009801626c8e51d0a16fcae6
cfp/management/commands/update_talks_and_workshops_from_applications.py
cfp/management/commands/update_talks_and_workshops_from_applications.py
from django.core.management.base import BaseCommand, CommandError from events.models import Event class Command(BaseCommand): help = "Copies talk title and descriptions from the application." def add_arguments(self, parser): parser.add_argument('event_id', type=int) def handle(self, *args, **options): event_id = options["event_id"] event = Event.objects.filter(pk=event_id).first() if not event: raise CommandError("Event id={} does not exist.".format(event_id)) talks = event.talks.all().order_by("title") talk_count = talks.count() workshops = event.workshops.all().order_by("title") workshop_count = workshops.count() if not talk_count and not workshops: raise CommandError("No talks or workshops matched.") print(f"Matched {talk_count} talks:") for talk in talks: print("> ", talk) print(f"\nMatched {workshop_count} workshops:") for workshop in workshops: print("> ", workshop) print("\nUpdate talk descriptions from talks?") input("Press any key to continue or Ctrl+C to abort") for talk in talks: talk.update_from_application() talk.save() print("Done.")
from django.core.management.base import BaseCommand, CommandError from events.models import Event class Command(BaseCommand): help = "Copies talk title and descriptions from the application." def add_arguments(self, parser): parser.add_argument('event_id', type=int) def handle(self, *args, **options): event_id = options["event_id"] event = Event.objects.filter(pk=event_id).first() if not event: raise CommandError("Event id={} does not exist.".format(event_id)) talks = event.talks.all().order_by("title") talk_count = talks.count() workshops = event.workshops.all().order_by("title") workshop_count = workshops.count() if not talk_count and not workshops: raise CommandError("No talks or workshops matched.") print(f"Matched {talk_count} talks:") for talk in talks: print("> ", talk) print(f"\nMatched {workshop_count} workshops:") for workshop in workshops: print("> ", workshop) print("\nUpdate talk descriptions from talks?") input("Press any key to continue or Ctrl+C to abort") for talk in talks: talk.update_from_application() talk.save() for workshop in workshops: workshop.update_from_application() workshop.save() print("Done.")
Update workshops as well as talks
Update workshops as well as talks
Python
bsd-3-clause
WebCampZg/conference-web,WebCampZg/conference-web,WebCampZg/conference-web
python
## Code Before: from django.core.management.base import BaseCommand, CommandError from events.models import Event class Command(BaseCommand): help = "Copies talk title and descriptions from the application." def add_arguments(self, parser): parser.add_argument('event_id', type=int) def handle(self, *args, **options): event_id = options["event_id"] event = Event.objects.filter(pk=event_id).first() if not event: raise CommandError("Event id={} does not exist.".format(event_id)) talks = event.talks.all().order_by("title") talk_count = talks.count() workshops = event.workshops.all().order_by("title") workshop_count = workshops.count() if not talk_count and not workshops: raise CommandError("No talks or workshops matched.") print(f"Matched {talk_count} talks:") for talk in talks: print("> ", talk) print(f"\nMatched {workshop_count} workshops:") for workshop in workshops: print("> ", workshop) print("\nUpdate talk descriptions from talks?") input("Press any key to continue or Ctrl+C to abort") for talk in talks: talk.update_from_application() talk.save() print("Done.") ## Instruction: Update workshops as well as talks ## Code After: from django.core.management.base import BaseCommand, CommandError from events.models import Event class Command(BaseCommand): help = "Copies talk title and descriptions from the application." def add_arguments(self, parser): parser.add_argument('event_id', type=int) def handle(self, *args, **options): event_id = options["event_id"] event = Event.objects.filter(pk=event_id).first() if not event: raise CommandError("Event id={} does not exist.".format(event_id)) talks = event.talks.all().order_by("title") talk_count = talks.count() workshops = event.workshops.all().order_by("title") workshop_count = workshops.count() if not talk_count and not workshops: raise CommandError("No talks or workshops matched.") print(f"Matched {talk_count} talks:") for talk in talks: print("> ", talk) print(f"\nMatched {workshop_count} workshops:") for workshop in workshops: print("> ", workshop) print("\nUpdate talk descriptions from talks?") input("Press any key to continue or Ctrl+C to abort") for talk in talks: talk.update_from_application() talk.save() for workshop in workshops: workshop.update_from_application() workshop.save() print("Done.")
from django.core.management.base import BaseCommand, CommandError from events.models import Event class Command(BaseCommand): help = "Copies talk title and descriptions from the application." def add_arguments(self, parser): parser.add_argument('event_id', type=int) def handle(self, *args, **options): event_id = options["event_id"] event = Event.objects.filter(pk=event_id).first() if not event: raise CommandError("Event id={} does not exist.".format(event_id)) talks = event.talks.all().order_by("title") talk_count = talks.count() workshops = event.workshops.all().order_by("title") workshop_count = workshops.count() if not talk_count and not workshops: raise CommandError("No talks or workshops matched.") print(f"Matched {talk_count} talks:") for talk in talks: print("> ", talk) print(f"\nMatched {workshop_count} workshops:") for workshop in workshops: print("> ", workshop) print("\nUpdate talk descriptions from talks?") input("Press any key to continue or Ctrl+C to abort") for talk in talks: talk.update_from_application() talk.save() + for workshop in workshops: + workshop.update_from_application() + workshop.save() + print("Done.")
4
0.093023
4
0
6e095c77dffb71cfa7be8ec434e0b054fb5b2ea9
app/assets/stylesheets/incidents.scss
app/assets/stylesheets/incidents.scss
.date-navigation{ display: flex; justify-content: center; button{ margin: 0 2em; } } table.incidents td em.incomplete{ background: firebrick; border-radius: 6px; color: white; padding: 8px 25px; } .staff-review{ background: #d9d9d9; border: 2px solid #a59a93; border-radius: 6px; margin-top: 10px; padding: 5px 2em; .data{ display: flex; margin-bottom: 5px; .staff-name{ font-weight: bold; } .time{ margin-left: 2em; margin-top: 7px; display: inline; font-size: small; } } p{ background: white; border-radius: 6px; padding: 5px 10px; } } form.new-review, form.edit-review{ display: block; &.edit-review{ display: none; } font-size: medium; margin-top: 10px; .field textarea{ border-radius: 6px; height: 4em; padding: 5px; width: 100%; } }
.date-navigation{ display: flex; justify-content: center; a{ &:hover{ background: inherit; } button{ margin: 0 2em; } } } table.incidents td em.incomplete{ background: firebrick; border-radius: 6px; color: white; padding: 8px 25px; } .staff-review{ background: #d9d9d9; border: 2px solid #a59a93; border-radius: 6px; margin-top: 10px; padding: 5px 2em; .data{ display: flex; margin-bottom: 5px; .staff-name{ font-weight: bold; } .time{ margin-left: 2em; margin-top: 7px; display: inline; font-size: small; } } p{ background: white; border-radius: 6px; padding: 5px 10px; } } form.new-review, form.edit-review{ display: block; &.edit-review{ display: none; } font-size: medium; margin-top: 10px; .field textarea{ border-radius: 6px; height: 4em; padding: 5px; width: 100%; } }
Stop date navigation links from being weird
Stop date navigation links from being weird
SCSS
mit
umts/incidents,umts/incidents,umts/incidents
scss
## Code Before: .date-navigation{ display: flex; justify-content: center; button{ margin: 0 2em; } } table.incidents td em.incomplete{ background: firebrick; border-radius: 6px; color: white; padding: 8px 25px; } .staff-review{ background: #d9d9d9; border: 2px solid #a59a93; border-radius: 6px; margin-top: 10px; padding: 5px 2em; .data{ display: flex; margin-bottom: 5px; .staff-name{ font-weight: bold; } .time{ margin-left: 2em; margin-top: 7px; display: inline; font-size: small; } } p{ background: white; border-radius: 6px; padding: 5px 10px; } } form.new-review, form.edit-review{ display: block; &.edit-review{ display: none; } font-size: medium; margin-top: 10px; .field textarea{ border-radius: 6px; height: 4em; padding: 5px; width: 100%; } } ## Instruction: Stop date navigation links from being weird ## Code After: .date-navigation{ display: flex; justify-content: center; a{ &:hover{ background: inherit; } button{ margin: 0 2em; } } } table.incidents td em.incomplete{ background: firebrick; border-radius: 6px; color: white; padding: 8px 25px; } .staff-review{ background: #d9d9d9; border: 2px solid #a59a93; border-radius: 6px; margin-top: 10px; padding: 5px 2em; .data{ display: flex; margin-bottom: 5px; .staff-name{ font-weight: bold; } .time{ margin-left: 2em; margin-top: 7px; display: inline; font-size: small; } } p{ background: white; border-radius: 6px; padding: 5px 10px; } } form.new-review, form.edit-review{ display: block; &.edit-review{ display: none; } font-size: medium; margin-top: 10px; .field textarea{ border-radius: 6px; height: 4em; padding: 5px; width: 100%; } }
.date-navigation{ display: flex; justify-content: center; + a{ + &:hover{ + background: inherit; + } - button{ + button{ ? ++ - margin: 0 2em; + margin: 0 2em; ? ++ + } } } table.incidents td em.incomplete{ background: firebrick; border-radius: 6px; color: white; padding: 8px 25px; } .staff-review{ background: #d9d9d9; border: 2px solid #a59a93; border-radius: 6px; margin-top: 10px; padding: 5px 2em; .data{ display: flex; margin-bottom: 5px; .staff-name{ font-weight: bold; } .time{ margin-left: 2em; margin-top: 7px; display: inline; font-size: small; } } p{ background: white; border-radius: 6px; padding: 5px 10px; } } form.new-review, form.edit-review{ display: block; &.edit-review{ display: none; } font-size: medium; margin-top: 10px; .field textarea{ border-radius: 6px; height: 4em; padding: 5px; width: 100%; } }
9
0.166667
7
2
fc66db188ecabbe21cea23c91a9e9b24bbf9d11e
bluebottle/homepage/views.py
bluebottle/homepage/views.py
from rest_framework import generics, response from .models import HomePage from .serializers import HomePageSerializer # Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object class HomePageDetail(generics.GenericAPIView): serializer_class = HomePageSerializer def get(self, request, language='en'): homepage = HomePage().get(language) serialized = HomePageSerializer().to_native(homepage) return response.Response(serialized)
from django.utils import translation from rest_framework import generics, response from .models import HomePage from .serializers import HomePageSerializer # Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object class HomePageDetail(generics.GenericAPIView): serializer_class = HomePageSerializer def get(self, request, language='en'): # Force requested language translation.activate(language) request.LANGUAGE_CODE = translation.get_language() homepage = HomePage().get(language) serialized = HomePageSerializer().to_native(homepage) return response.Response(serialized)
Fix translations for homepage stats
Fix translations for homepage stats
Python
bsd-3-clause
jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
python
## Code Before: from rest_framework import generics, response from .models import HomePage from .serializers import HomePageSerializer # Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object class HomePageDetail(generics.GenericAPIView): serializer_class = HomePageSerializer def get(self, request, language='en'): homepage = HomePage().get(language) serialized = HomePageSerializer().to_native(homepage) return response.Response(serialized) ## Instruction: Fix translations for homepage stats ## Code After: from django.utils import translation from rest_framework import generics, response from .models import HomePage from .serializers import HomePageSerializer # Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object class HomePageDetail(generics.GenericAPIView): serializer_class = HomePageSerializer def get(self, request, language='en'): # Force requested language translation.activate(language) request.LANGUAGE_CODE = translation.get_language() homepage = HomePage().get(language) serialized = HomePageSerializer().to_native(homepage) return response.Response(serialized)
+ from django.utils import translation + from rest_framework import generics, response from .models import HomePage from .serializers import HomePageSerializer # Instead of serving all the objects separately we combine Slide, Quote and Stats into a dummy object class HomePageDetail(generics.GenericAPIView): serializer_class = HomePageSerializer def get(self, request, language='en'): + + # Force requested language + translation.activate(language) + request.LANGUAGE_CODE = translation.get_language() + homepage = HomePage().get(language) serialized = HomePageSerializer().to_native(homepage) return response.Response(serialized)
7
0.5
7
0
d2b06462f560f7243dd3f29b67c50d6d6f76f569
util/generate.py
util/generate.py
import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' for f in os.listdir(TYPESDIR): basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True)
import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True)
Allow generating one specific xml file instead of the whole directory.
Allow generating one specific xml file instead of the whole directory.
Python
apache-2.0
loganj/foursquared,loganj/foursquared
python
## Code Before: import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' for f in os.listdir(TYPESDIR): basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) ## Instruction: Allow generating one specific xml file instead of the whole directory. ## Code After: import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True)
import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' - for f in os.listdir(TYPESDIR): + captures = sys.argv[1:] + if not captures: + captures = os.listdir(TYPESDIR) + + for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True)
6
0.272727
5
1
54b56da0e74263a657aa624ed799cd2bdfbcecc8
README.md
README.md
![GUNDAM image](doc/gundam.jpg) ![GUNDAM image](doc/gundam.jpg) [![Gem Version](https://badge.fury.io/rb/gitarro.svg)](https://badge.fury.io/rb/gitarro) [![Build Status Master branch](https://travis-ci.org/openSUSE/gitarro.svg?branch=master)](https://travis-ci.org/openSUSE/gitarro) ## Introduction gitarro allow you to run tests on Git Hub [Pull Requests](https://help.github.com/articles/about-pull-requests/) (also known as PRs) using almost any script, language or binary and providing easy integration with other tools, and testing env. (such containers, cloud, VMS, etc.) It can run on any system that is able to use ruby and [octokit](https://github.com/octokit/octokit.rb). ## Install ``` gem install gitarro ``` ## Documentation * [Basic concepts, installation, configuration, tests, syntax and a basic example](doc/BASICS.md) * [Advanced usage](doc/ADVANCED.md) * [Real life examples](doc/REAL_EXAMPLES.md) * [How to contribute to gitarro development](doc/CONTRIBUTING.md)
![GUNDAM image](doc/gundam.jpg) ![GUNDAM image](doc/gundam.jpg) [![Build Status Master branch](https://travis-ci.org/openSUSE/gitarro.svg?branch=master)](https://travis-ci.org/openSUSE/gitarro) ## Introduction gitarro allow you to run tests on Git Hub [Pull Requests](https://help.github.com/articles/about-pull-requests/) (also known as PRs) using almost any script, language or binary and providing easy integration with other tools, and testing env. (such containers, cloud, VMS, etc.) It can run on any system that is able to use ruby and [octokit](https://github.com/octokit/octokit.rb). ## Install ``` gem install gitarro ``` ## Documentation * [Basic concepts, installation, configuration, tests, syntax and a basic example](doc/BASICS.md) * [Advanced usage](doc/ADVANCED.md) * [Real life examples](doc/REAL_EXAMPLES.md) * [How to contribute to gitarro development](doc/CONTRIBUTING.md)
Remove gemversion since it is not updated the badge
Remove gemversion since it is not updated the badge
Markdown
mit
MalloZup/gitarro,juliogonzalez/gitbot,juliogonzalez/gitbot,MalloZup/gitarro
markdown
## Code Before: ![GUNDAM image](doc/gundam.jpg) ![GUNDAM image](doc/gundam.jpg) [![Gem Version](https://badge.fury.io/rb/gitarro.svg)](https://badge.fury.io/rb/gitarro) [![Build Status Master branch](https://travis-ci.org/openSUSE/gitarro.svg?branch=master)](https://travis-ci.org/openSUSE/gitarro) ## Introduction gitarro allow you to run tests on Git Hub [Pull Requests](https://help.github.com/articles/about-pull-requests/) (also known as PRs) using almost any script, language or binary and providing easy integration with other tools, and testing env. (such containers, cloud, VMS, etc.) It can run on any system that is able to use ruby and [octokit](https://github.com/octokit/octokit.rb). ## Install ``` gem install gitarro ``` ## Documentation * [Basic concepts, installation, configuration, tests, syntax and a basic example](doc/BASICS.md) * [Advanced usage](doc/ADVANCED.md) * [Real life examples](doc/REAL_EXAMPLES.md) * [How to contribute to gitarro development](doc/CONTRIBUTING.md) ## Instruction: Remove gemversion since it is not updated the badge ## Code After: ![GUNDAM image](doc/gundam.jpg) ![GUNDAM image](doc/gundam.jpg) [![Build Status Master branch](https://travis-ci.org/openSUSE/gitarro.svg?branch=master)](https://travis-ci.org/openSUSE/gitarro) ## Introduction gitarro allow you to run tests on Git Hub [Pull Requests](https://help.github.com/articles/about-pull-requests/) (also known as PRs) using almost any script, language or binary and providing easy integration with other tools, and testing env. (such containers, cloud, VMS, etc.) It can run on any system that is able to use ruby and [octokit](https://github.com/octokit/octokit.rb). ## Install ``` gem install gitarro ``` ## Documentation * [Basic concepts, installation, configuration, tests, syntax and a basic example](doc/BASICS.md) * [Advanced usage](doc/ADVANCED.md) * [Real life examples](doc/REAL_EXAMPLES.md) * [How to contribute to gitarro development](doc/CONTRIBUTING.md)
![GUNDAM image](doc/gundam.jpg) ![GUNDAM image](doc/gundam.jpg) - [![Gem Version](https://badge.fury.io/rb/gitarro.svg)](https://badge.fury.io/rb/gitarro) [![Build Status Master branch](https://travis-ci.org/openSUSE/gitarro.svg?branch=master)](https://travis-ci.org/openSUSE/gitarro) ## Introduction gitarro allow you to run tests on Git Hub [Pull Requests](https://help.github.com/articles/about-pull-requests/) (also known as PRs) using almost any script, language or binary and providing easy integration with other tools, and testing env. (such containers, cloud, VMS, etc.) It can run on any system that is able to use ruby and [octokit](https://github.com/octokit/octokit.rb). ## Install ``` gem install gitarro ``` ## Documentation * [Basic concepts, installation, configuration, tests, syntax and a basic example](doc/BASICS.md) * [Advanced usage](doc/ADVANCED.md) * [Real life examples](doc/REAL_EXAMPLES.md) * [How to contribute to gitarro development](doc/CONTRIBUTING.md)
1
0.043478
0
1
172b3da26be1b6e6c39ce91ab3019c73fa6dcf58
src/main/clojure/lazytest/group.clj
src/main/clojure/lazytest/group.clj
(ns lazytest.group (:use [lazytest.testable :only (Testable get-tests)] [lazytest.runnable-test :only (RunnableTest run-tests skip-or-pending try-expectations runnable-test?)] [lazytest.fixture :only (setup teardown fixture?)] [lazytest.test-result :only (result-group)])) (defrecord TestCase [fixtures f] Testable (get-tests [this] (list this)) RunnableTest (run-tests [this] (lazy-seq (list (or (skip-or-pending this) (try-expectations this (apply f (map setup fixtures)) (dorun (map teardown fixtures)))))))) (defn test-case [fixtures f] {:pre [(every? fixture? fixtures) (fn? f)]} (TestCase. fixtures f)) (defrecord TestGroup [children] Testable (get-tests [this] (list this)) RunnableTest (run-tests [this] (or (skip-or-pending this) (result-group this (lazy-seq (mapcat run-tests children)))))) (defn test-group [children] {:pre [(every? (runnable-test? children))]} (TestGroup. children))
(ns lazytest.group (:use [lazytest.testable :only (Testable get-tests)] [lazytest.runnable-test :only (RunnableTest run-tests skip-or-pending try-expectations runnable-test?)] [lazytest.fixture :only (setup teardown fixture?)] [lazytest.test-result :only (result-group)])) (defrecord TestCase [fixtures f] Testable (get-tests [this] (list this)) RunnableTest (run-tests [this] (lazy-seq (list (or (skip-or-pending this) (try-expectations this (apply f (map setup fixtures)) (dorun (map teardown fixtures)))))))) (defn test-case ([fixtures f] (test-case fixtures f nil)) ([fixtures f metadata] {:pre [(every? fixture? fixtures) (fn? f)]} (TestCase. fixtures f metadata nil))) (defrecord TestGroup [children] Testable (get-tests [this] (list this)) RunnableTest (run-tests [this] (or (skip-or-pending this) (result-group this (lazy-seq (mapcat run-tests children)))))) (defn test-group ([children] (test-group children nil)) ([children metadata] {:pre [(every? (runnable-test? children))]} (TestGroup. children metadata nil)))
Support metadata in TestCase and TestGroup constructors
Support metadata in TestCase and TestGroup constructors
Clojure
epl-1.0
stuartsierra/lazytest
clojure
## Code Before: (ns lazytest.group (:use [lazytest.testable :only (Testable get-tests)] [lazytest.runnable-test :only (RunnableTest run-tests skip-or-pending try-expectations runnable-test?)] [lazytest.fixture :only (setup teardown fixture?)] [lazytest.test-result :only (result-group)])) (defrecord TestCase [fixtures f] Testable (get-tests [this] (list this)) RunnableTest (run-tests [this] (lazy-seq (list (or (skip-or-pending this) (try-expectations this (apply f (map setup fixtures)) (dorun (map teardown fixtures)))))))) (defn test-case [fixtures f] {:pre [(every? fixture? fixtures) (fn? f)]} (TestCase. fixtures f)) (defrecord TestGroup [children] Testable (get-tests [this] (list this)) RunnableTest (run-tests [this] (or (skip-or-pending this) (result-group this (lazy-seq (mapcat run-tests children)))))) (defn test-group [children] {:pre [(every? (runnable-test? children))]} (TestGroup. children)) ## Instruction: Support metadata in TestCase and TestGroup constructors ## Code After: (ns lazytest.group (:use [lazytest.testable :only (Testable get-tests)] [lazytest.runnable-test :only (RunnableTest run-tests skip-or-pending try-expectations runnable-test?)] [lazytest.fixture :only (setup teardown fixture?)] [lazytest.test-result :only (result-group)])) (defrecord TestCase [fixtures f] Testable (get-tests [this] (list this)) RunnableTest (run-tests [this] (lazy-seq (list (or (skip-or-pending this) (try-expectations this (apply f (map setup fixtures)) (dorun (map teardown fixtures)))))))) (defn test-case ([fixtures f] (test-case fixtures f nil)) ([fixtures f metadata] {:pre [(every? fixture? fixtures) (fn? f)]} (TestCase. fixtures f metadata nil))) (defrecord TestGroup [children] Testable (get-tests [this] (list this)) RunnableTest (run-tests [this] (or (skip-or-pending this) (result-group this (lazy-seq (mapcat run-tests children)))))) (defn test-group ([children] (test-group children nil)) ([children metadata] {:pre [(every? (runnable-test? children))]} (TestGroup. children metadata nil)))
(ns lazytest.group (:use [lazytest.testable :only (Testable get-tests)] [lazytest.runnable-test :only (RunnableTest run-tests skip-or-pending try-expectations runnable-test?)] [lazytest.fixture :only (setup teardown fixture?)] [lazytest.test-result :only (result-group)])) (defrecord TestCase [fixtures f] Testable (get-tests [this] (list this)) RunnableTest (run-tests [this] (lazy-seq (list (or (skip-or-pending this) (try-expectations this (apply f (map setup fixtures)) (dorun (map teardown fixtures)))))))) - (defn test-case [fixtures f] + (defn test-case + ([fixtures f] (test-case fixtures f nil)) + ([fixtures f metadata] - {:pre [(every? fixture? fixtures) (fn? f)]} + {:pre [(every? fixture? fixtures) (fn? f)]} ? +++ - (TestCase. fixtures f)) + (TestCase. fixtures f metadata nil))) (defrecord TestGroup [children] Testable (get-tests [this] (list this)) RunnableTest (run-tests [this] (or (skip-or-pending this) (result-group this (lazy-seq (mapcat run-tests children)))))) - (defn test-group [children] + (defn test-group + ([children] (test-group children nil)) + ([children metadata] - {:pre [(every? (runnable-test? children))]} + {:pre [(every? (runnable-test? children))]} ? +++ - (TestGroup. children)) + (TestGroup. children metadata nil)))
16
0.421053
10
6
db40c2b6720bf3d4a5d99e75a20bbd1d88686e86
cookbooks/bcpc/recipes/rotate_chef_nginx_access_log.rb
cookbooks/bcpc/recipes/rotate_chef_nginx_access_log.rb
logrotate_app 'chef-server-nginx-access-log' do path '/var/log/chef-server/nginx/access.log' frequency 'daily' rotate 5 options %w(missingok compress) postrotate '/usr/bin/truncate --size=0 /var/log/chef-server/nginx/access.log' end
logrotate_app 'chef-server-nginx-access-log' do path '/var/log/chef-server/nginx/access.log' frequency 'daily' rotate 5 options %w(missingok notifempty compress delaycompress copytruncate) postrotate '/opt/chef-server/embedded/sbin/nginx -s reopen' end
Fix Chef server Nginx logrotate configuration - Add `copytruncate`, `notifempty` and `delaycompress` options to ensure we get the behavior we actually want. - With `copytruncate` chosen, we can then remove the existing `postrotate` command and replace it with a `SIGUSR1`, known as a `reopen` to the Nginx daemon, which will release any open log file handles.
Fix Chef server Nginx logrotate configuration - Add `copytruncate`, `notifempty` and `delaycompress` options to ensure we get the behavior we actually want. - With `copytruncate` chosen, we can then remove the existing `postrotate` command and replace it with a `SIGUSR1`, known as a `reopen` to the Nginx daemon, which will release any open log file handles.
Ruby
apache-2.0
pu239ppy/chef-bach,leochen4891/chef-bach,leochen4891/chef-bach,amithkanand/chef-bach,amithkanand/chef-bach,http-418/chef-bach,pu239ppy/chef-bach,kiiranh/chef-bach,kiiranh/chef-bach,pu239ppy/chef-bach,NinjaLabib/chef-bach,bloomberg/chef-bach,NinjaLabib/chef-bach,amithkanand/chef-bach,kiiranh/chef-bach,cbaenziger/chef-bach,leochen4891/chef-bach,cbaenziger/chef-bach,bloomberg/chef-bach,bloomberg/chef-bach,bloomberg/chef-bach,kiiranh/chef-bach,pu239ppy/chef-bach,NinjaLabib/chef-bach,cbaenziger/chef-bach,leochen4891/chef-bach,cbaenziger/chef-bach,http-418/chef-bach,amithkanand/chef-bach,NinjaLabib/chef-bach,http-418/chef-bach,http-418/chef-bach
ruby
## Code Before: logrotate_app 'chef-server-nginx-access-log' do path '/var/log/chef-server/nginx/access.log' frequency 'daily' rotate 5 options %w(missingok compress) postrotate '/usr/bin/truncate --size=0 /var/log/chef-server/nginx/access.log' end ## Instruction: Fix Chef server Nginx logrotate configuration - Add `copytruncate`, `notifempty` and `delaycompress` options to ensure we get the behavior we actually want. - With `copytruncate` chosen, we can then remove the existing `postrotate` command and replace it with a `SIGUSR1`, known as a `reopen` to the Nginx daemon, which will release any open log file handles. ## Code After: logrotate_app 'chef-server-nginx-access-log' do path '/var/log/chef-server/nginx/access.log' frequency 'daily' rotate 5 options %w(missingok notifempty compress delaycompress copytruncate) postrotate '/opt/chef-server/embedded/sbin/nginx -s reopen' end
logrotate_app 'chef-server-nginx-access-log' do path '/var/log/chef-server/nginx/access.log' frequency 'daily' rotate 5 - options %w(missingok compress) - postrotate '/usr/bin/truncate --size=0 /var/log/chef-server/nginx/access.log' + options %w(missingok notifempty compress delaycompress copytruncate) + postrotate '/opt/chef-server/embedded/sbin/nginx -s reopen' end
4
0.5
2
2
5c52fca74c061bad6625fb93ce920eccdf4741de
tabpy-server/setup.py
tabpy-server/setup.py
import versioneer try: from setuptools import setup except ImportError as err: print("Missing Python module requirement: setuptools.") raise err setup( name='tabpy-server', version=versioneer.get_version(), description='Web server Tableau uses to run Python scripts.', url='https://github.com/tableau/TabPy', author='Tableau', author_email='github@tableau.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Programming Language :: Python :: 3.5', "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Information Analysis", ], packages=['tabpy_server', 'tabpy_server.common', 'tabpy_server.management', 'tabpy_server.psws', 'tabpy_server.static'], package_data={'tabpy_server.static': ['*.*'], 'tabpy_server': ['startup.*', 'state.ini']}, license='MIT', # TODO Add tabpy_tools dependency when published on github install_requires=[ 'backports_abc', 'cloudpickle', 'configparser', 'decorator', 'future', 'futures', 'genson', 'jsonschema>=2.3.0', 'mock', 'numpy', 'python-dateutil', 'pyOpenSSL', 'requests', 'singledispatch', 'simplejson', 'tornado==5.1.1', 'Tornado-JSON' ], cmdclass=versioneer.get_cmdclass(), )
import versioneer try: from setuptools import setup except ImportError as err: print("Missing Python module requirement: setuptools.") raise err setup( name='tabpy-server', version=versioneer.get_version(), description='Web server Tableau uses to run Python scripts.', url='https://github.com/tableau/TabPy', author='Tableau', author_email='github@tableau.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Programming Language :: Python :: 3.5', "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Information Analysis", ], packages=['tabpy_server', 'tabpy_server.common', 'tabpy_server.management', 'tabpy_server.psws', 'tabpy_server.static'], package_data={'tabpy_server.static': ['*.*'], 'tabpy_server': ['startup.*', 'state.ini']}, license='MIT', install_requires=[ 'backports_abc', 'cloudpickle', 'configparser', 'decorator', 'future', 'futures', 'genson', 'jsonschema>=2.3.0', 'mock', 'numpy', 'python-dateutil', 'pyOpenSSL', 'requests', 'singledispatch', 'simplejson', 'tornado==5.1.1', 'Tornado-JSON' ], cmdclass=versioneer.get_cmdclass(), )
Address TODO comments in code
Address TODO comments in code
Python
mit
tableau/TabPy,tableau/TabPy,tableau/TabPy
python
## Code Before: import versioneer try: from setuptools import setup except ImportError as err: print("Missing Python module requirement: setuptools.") raise err setup( name='tabpy-server', version=versioneer.get_version(), description='Web server Tableau uses to run Python scripts.', url='https://github.com/tableau/TabPy', author='Tableau', author_email='github@tableau.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Programming Language :: Python :: 3.5', "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Information Analysis", ], packages=['tabpy_server', 'tabpy_server.common', 'tabpy_server.management', 'tabpy_server.psws', 'tabpy_server.static'], package_data={'tabpy_server.static': ['*.*'], 'tabpy_server': ['startup.*', 'state.ini']}, license='MIT', # TODO Add tabpy_tools dependency when published on github install_requires=[ 'backports_abc', 'cloudpickle', 'configparser', 'decorator', 'future', 'futures', 'genson', 'jsonschema>=2.3.0', 'mock', 'numpy', 'python-dateutil', 'pyOpenSSL', 'requests', 'singledispatch', 'simplejson', 'tornado==5.1.1', 'Tornado-JSON' ], cmdclass=versioneer.get_cmdclass(), ) ## Instruction: Address TODO comments in code ## Code After: import versioneer try: from setuptools import setup except ImportError as err: print("Missing Python module requirement: setuptools.") raise err setup( name='tabpy-server', version=versioneer.get_version(), description='Web server Tableau uses to run Python scripts.', url='https://github.com/tableau/TabPy', author='Tableau', author_email='github@tableau.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Programming Language :: Python :: 3.5', "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Information Analysis", ], packages=['tabpy_server', 'tabpy_server.common', 'tabpy_server.management', 'tabpy_server.psws', 'tabpy_server.static'], package_data={'tabpy_server.static': ['*.*'], 'tabpy_server': ['startup.*', 'state.ini']}, license='MIT', install_requires=[ 'backports_abc', 'cloudpickle', 'configparser', 'decorator', 'future', 'futures', 'genson', 'jsonschema>=2.3.0', 'mock', 'numpy', 'python-dateutil', 'pyOpenSSL', 'requests', 'singledispatch', 'simplejson', 'tornado==5.1.1', 'Tornado-JSON' ], cmdclass=versioneer.get_cmdclass(), )
import versioneer try: from setuptools import setup except ImportError as err: print("Missing Python module requirement: setuptools.") raise err setup( name='tabpy-server', version=versioneer.get_version(), description='Web server Tableau uses to run Python scripts.', url='https://github.com/tableau/TabPy', author='Tableau', author_email='github@tableau.com', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Programming Language :: Python :: 3.5', "Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering :: Information Analysis", ], packages=['tabpy_server', 'tabpy_server.common', 'tabpy_server.management', 'tabpy_server.psws', 'tabpy_server.static'], package_data={'tabpy_server.static': ['*.*'], 'tabpy_server': ['startup.*', 'state.ini']}, license='MIT', - # TODO Add tabpy_tools dependency when published on github install_requires=[ 'backports_abc', 'cloudpickle', 'configparser', 'decorator', 'future', 'futures', 'genson', 'jsonschema>=2.3.0', 'mock', 'numpy', 'python-dateutil', 'pyOpenSSL', 'requests', 'singledispatch', 'simplejson', 'tornado==5.1.1', 'Tornado-JSON' ], cmdclass=versioneer.get_cmdclass(), )
1
0.019231
0
1
6ce0f78b0b0c4f1022f7a8b432fa0ce9ce93f7f8
README.md
README.md
<img src="http://images4.fanpop.com/image/photos/20400000/Rainbow-Dash-my-little-pony-friendship-is-magic-20416585-555-375.jpg"/> # Overview `mon-api` is a RESTful API server that is designed with a layered architecture [layered architecture](http://en.wikipedia.org/wiki/Multilayered_architecture). ## Usage ``` mvn package java -jar target/mon-api.jar server config-file.yml ``` ## Design Overview ### Architectural layers Requests flow through the following architectural layers from top to bottom: * Resource * Serves as the entrypoint into the service. * Responsible for handling web service requests, and performing structural request validation. * Application * Responsible for providing application level implementations for specific use cases. * Domain * Contains the technology agnostic core domain model and domain service definitions. * Responsible for upholding invariants and defining state transitions. * Infrastructure * Contains technology specific implementations of domain services.
<img src="http://images4.fanpop.com/image/photos/20400000/Rainbow-Dash-my-little-pony-friendship-is-magic-20416585-555-375.jpg"/> # Overview `mon-api` is a RESTful API server that is designed with a layered architecture [layered architecture](http://en.wikipedia.org/wiki/Multilayered_architecture). ## Usage ``` mvn package java -jar target/mon-api.jar server config-file.yml ``` ## Design Overview ### Architectural layers Requests flow through the following architectural layers from top to bottom: * Resource * Serves as the entrypoint into the service. * Responsible for handling web service requests, and performing structural request validation. * Application * Responsible for providing application level implementations for specific use cases. * Domain * Contains the technology agnostic core domain model and domain service definitions. * Responsible for upholding invariants and defining state transitions. * Infrastructure * Contains technology specific implementations of domain services. ## Docs and Test Interface When running mon-api the API docs along with the API test interface can be accessed via: [http://localhost:8080/swagger-ui/](http://localhost:8080/swagger-ui/)
Update readme to add swagger-ui link
Update readme to add swagger-ui link
Markdown
apache-2.0
craigbr/mon-api,sapcc/monasca-api,oneilcin/monasca-events-api,stackforge/monasca-api,hpcloud-mon/monasca-events-api,craigbr/mon-api,openstack/monasca-api,oneilcin/monasca-events-api,craigbr/mon-api,stackforge/monasca-api,openstack/monasca-api,oneilcin/monasca-events-api,openstack/monasca-api,hpcloud-mon/monasca-events-api,oneilcin/monasca-events-api,sapcc/monasca-api,hpcloud-mon/monasca-events-api,sapcc/monasca-api,stackforge/monasca-api,hpcloud-mon/monasca-events-api,craigbr/mon-api,stackforge/monasca-api
markdown
## Code Before: <img src="http://images4.fanpop.com/image/photos/20400000/Rainbow-Dash-my-little-pony-friendship-is-magic-20416585-555-375.jpg"/> # Overview `mon-api` is a RESTful API server that is designed with a layered architecture [layered architecture](http://en.wikipedia.org/wiki/Multilayered_architecture). ## Usage ``` mvn package java -jar target/mon-api.jar server config-file.yml ``` ## Design Overview ### Architectural layers Requests flow through the following architectural layers from top to bottom: * Resource * Serves as the entrypoint into the service. * Responsible for handling web service requests, and performing structural request validation. * Application * Responsible for providing application level implementations for specific use cases. * Domain * Contains the technology agnostic core domain model and domain service definitions. * Responsible for upholding invariants and defining state transitions. * Infrastructure * Contains technology specific implementations of domain services. ## Instruction: Update readme to add swagger-ui link ## Code After: <img src="http://images4.fanpop.com/image/photos/20400000/Rainbow-Dash-my-little-pony-friendship-is-magic-20416585-555-375.jpg"/> # Overview `mon-api` is a RESTful API server that is designed with a layered architecture [layered architecture](http://en.wikipedia.org/wiki/Multilayered_architecture). ## Usage ``` mvn package java -jar target/mon-api.jar server config-file.yml ``` ## Design Overview ### Architectural layers Requests flow through the following architectural layers from top to bottom: * Resource * Serves as the entrypoint into the service. * Responsible for handling web service requests, and performing structural request validation. * Application * Responsible for providing application level implementations for specific use cases. * Domain * Contains the technology agnostic core domain model and domain service definitions. * Responsible for upholding invariants and defining state transitions. * Infrastructure * Contains technology specific implementations of domain services. ## Docs and Test Interface When running mon-api the API docs along with the API test interface can be accessed via: [http://localhost:8080/swagger-ui/](http://localhost:8080/swagger-ui/)
<img src="http://images4.fanpop.com/image/photos/20400000/Rainbow-Dash-my-little-pony-friendship-is-magic-20416585-555-375.jpg"/> # Overview `mon-api` is a RESTful API server that is designed with a layered architecture [layered architecture](http://en.wikipedia.org/wiki/Multilayered_architecture). ## Usage ``` mvn package java -jar target/mon-api.jar server config-file.yml ``` ## Design Overview ### Architectural layers Requests flow through the following architectural layers from top to bottom: * Resource * Serves as the entrypoint into the service. * Responsible for handling web service requests, and performing structural request validation. * Application * Responsible for providing application level implementations for specific use cases. * Domain * Contains the technology agnostic core domain model and domain service definitions. * Responsible for upholding invariants and defining state transitions. * Infrastructure * Contains technology specific implementations of domain services. + + ## Docs and Test Interface + + When running mon-api the API docs along with the API test interface can be accessed via: + + [http://localhost:8080/swagger-ui/](http://localhost:8080/swagger-ui/)
6
0.206897
6
0
488b36d7490dc4e9913f4d7f78e7b21750de65c9
lib/plz/commands/help.rb
lib/plz/commands/help.rb
module Plz module Commands class Help # @param options [Slop] # @param schema [JsonSchema::Schema] def initialize(options: nil, schema: nil) @options = options @schema = schema end # Logs out help message def call puts %<#{@options}\nExamples:\n#{links.join("\n")}> end private # @return [Array<String>] def links @schema.properties.map do |target_name, schema| schema.links.select do |link| link.href && link.method && link.title end.map do |link| str = " plz #{link.title.underscore} #{target_name}" if key = link.href[/{(.+)}/, 1] name = CGI.unescape(key).gsub(/[()]/, "").split("/").last if property = link.parent.properties[name] if example = property.data["example"] str << " #{name}=#{example}" end end end str end end.flatten end end end end
module Plz module Commands class Help # @param options [Slop] # @param schema [JsonSchema::Schema] def initialize(options: nil, schema: nil) @options = options @schema = schema end # Logs out help message def call puts %<#{@options}\nExamples:\n#{links.join("\n")}> end private # @return [Array<String>] def links @schema.properties.map do |target_name, schema| schema.links.select do |link| link.href && link.method && link.title end.map do |link| str = " plz #{link.title.underscore} #{target_name}" if key = link.href[/{(.+)}/, 1] path = CGI.unescape(key).gsub(/[()]/, "") name = path.split("/").last if property = JsonPointer.evaluate(@schema.data, path) if example = property["example"] str << " #{name}=#{example}" end end end str end end.flatten end end end end
Improve the logic to resolve URI Template in href
Improve the logic to resolve URI Template in href
Ruby
mit
r7kamura/plz,syskill/plz
ruby
## Code Before: module Plz module Commands class Help # @param options [Slop] # @param schema [JsonSchema::Schema] def initialize(options: nil, schema: nil) @options = options @schema = schema end # Logs out help message def call puts %<#{@options}\nExamples:\n#{links.join("\n")}> end private # @return [Array<String>] def links @schema.properties.map do |target_name, schema| schema.links.select do |link| link.href && link.method && link.title end.map do |link| str = " plz #{link.title.underscore} #{target_name}" if key = link.href[/{(.+)}/, 1] name = CGI.unescape(key).gsub(/[()]/, "").split("/").last if property = link.parent.properties[name] if example = property.data["example"] str << " #{name}=#{example}" end end end str end end.flatten end end end end ## Instruction: Improve the logic to resolve URI Template in href ## Code After: module Plz module Commands class Help # @param options [Slop] # @param schema [JsonSchema::Schema] def initialize(options: nil, schema: nil) @options = options @schema = schema end # Logs out help message def call puts %<#{@options}\nExamples:\n#{links.join("\n")}> end private # @return [Array<String>] def links @schema.properties.map do |target_name, schema| schema.links.select do |link| link.href && link.method && link.title end.map do |link| str = " plz #{link.title.underscore} #{target_name}" if key = link.href[/{(.+)}/, 1] path = CGI.unescape(key).gsub(/[()]/, "") name = path.split("/").last if property = JsonPointer.evaluate(@schema.data, path) if example = property["example"] str << " #{name}=#{example}" end end end str end end.flatten end end end end
module Plz module Commands class Help # @param options [Slop] # @param schema [JsonSchema::Schema] def initialize(options: nil, schema: nil) @options = options @schema = schema end # Logs out help message def call puts %<#{@options}\nExamples:\n#{links.join("\n")}> end private # @return [Array<String>] def links @schema.properties.map do |target_name, schema| schema.links.select do |link| link.href && link.method && link.title end.map do |link| str = " plz #{link.title.underscore} #{target_name}" if key = link.href[/{(.+)}/, 1] - name = CGI.unescape(key).gsub(/[()]/, "").split("/").last ? ^ ^^ ---------------- + path = CGI.unescape(key).gsub(/[()]/, "") ? ^ ^^ - if property = link.parent.properties[name] + name = path.split("/").last + if property = JsonPointer.evaluate(@schema.data, path) - if example = property.data["example"] ? ----- + if example = property["example"] str << " #{name}=#{example}" end end end str end end.flatten end end end end
7
0.179487
4
3
4ae6957ab38d3a8799a8f2a0a7eabf58e672152a
test/serialize.js
test/serialize.js
'use strict'; var compiler = require('../lib/compiler'); var mocha = require('mocha'); var assert = require('../lib/assert'); var datasets = require('./lib/datasets'); mocha.suite('serialize', function () { mocha.test('print;parse = id', function () { var examples = [ 'VAR x', 'QUOTE APP LAMBDA CURSOR VAR x VAR x HOLE', 'LETREC VAR i LAMBDA VAR x VAR x APP VAR i VAR i', ]; assert.inverses(compiler.parse, compiler.print, examples); }); mocha.test('works on datasets.codes', function () { assert.inverses(compiler.parse, compiler.print, datasets.codes); }); mocha.test('works on datasets.curryTerms', function () { assert.inverses(compiler.print, compiler.parse, datasets.curryTerms); }); });
'use strict'; var compiler = require('../lib/compiler'); var mocha = require('mocha'); var assert = require('../lib/assert'); var datasets = require('./lib/datasets'); mocha.suite('serialize', function () { mocha.test('print;parse = id', function () { var examples = [ 'VAR x', 'QUOTE APP LAMBDA CURSOR VAR x VAR x HOLE', 'LETREC VAR i LAMBDA VAR x VAR x APP VAR i VAR i', ]; assert.inverses(compiler.parse, compiler.print, examples); }); mocha.test('works on datasets.codes', function () { assert.inverses(compiler.parse, compiler.print, datasets.codes); }); mocha.test('works on datasets.curryTerms', function () { assert.inverses(compiler.print, compiler.parse, datasets.curryTerms); }); mocha.test('works on datasets.churchTerms', function () { assert.inverses(compiler.print, compiler.parse, datasets.churchTerms); }); });
Add test for parse;print of church terms
Add test for parse;print of church terms
JavaScript
mit
fritzo/puddle-syntax
javascript
## Code Before: 'use strict'; var compiler = require('../lib/compiler'); var mocha = require('mocha'); var assert = require('../lib/assert'); var datasets = require('./lib/datasets'); mocha.suite('serialize', function () { mocha.test('print;parse = id', function () { var examples = [ 'VAR x', 'QUOTE APP LAMBDA CURSOR VAR x VAR x HOLE', 'LETREC VAR i LAMBDA VAR x VAR x APP VAR i VAR i', ]; assert.inverses(compiler.parse, compiler.print, examples); }); mocha.test('works on datasets.codes', function () { assert.inverses(compiler.parse, compiler.print, datasets.codes); }); mocha.test('works on datasets.curryTerms', function () { assert.inverses(compiler.print, compiler.parse, datasets.curryTerms); }); }); ## Instruction: Add test for parse;print of church terms ## Code After: 'use strict'; var compiler = require('../lib/compiler'); var mocha = require('mocha'); var assert = require('../lib/assert'); var datasets = require('./lib/datasets'); mocha.suite('serialize', function () { mocha.test('print;parse = id', function () { var examples = [ 'VAR x', 'QUOTE APP LAMBDA CURSOR VAR x VAR x HOLE', 'LETREC VAR i LAMBDA VAR x VAR x APP VAR i VAR i', ]; assert.inverses(compiler.parse, compiler.print, examples); }); mocha.test('works on datasets.codes', function () { assert.inverses(compiler.parse, compiler.print, datasets.codes); }); mocha.test('works on datasets.curryTerms', function () { assert.inverses(compiler.print, compiler.parse, datasets.curryTerms); }); mocha.test('works on datasets.churchTerms', function () { assert.inverses(compiler.print, compiler.parse, datasets.churchTerms); }); });
'use strict'; var compiler = require('../lib/compiler'); var mocha = require('mocha'); var assert = require('../lib/assert'); var datasets = require('./lib/datasets'); mocha.suite('serialize', function () { mocha.test('print;parse = id', function () { var examples = [ 'VAR x', 'QUOTE APP LAMBDA CURSOR VAR x VAR x HOLE', 'LETREC VAR i LAMBDA VAR x VAR x APP VAR i VAR i', ]; assert.inverses(compiler.parse, compiler.print, examples); }); mocha.test('works on datasets.codes', function () { assert.inverses(compiler.parse, compiler.print, datasets.codes); }); mocha.test('works on datasets.curryTerms', function () { assert.inverses(compiler.print, compiler.parse, datasets.curryTerms); }); + + mocha.test('works on datasets.churchTerms', function () { + assert.inverses(compiler.print, compiler.parse, datasets.churchTerms); + }); });
4
0.153846
4
0
ce1e00ffe08ac93999ac87a1308096fa0a3e3673
SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.h
SmartDeviceLink-iOS/SmartDeviceLink/SDLProtocol.h
// SDLSmartDeviceLinkProtocol.h // #import "SDLAbstractProtocol.h" @class SDLProtocolHeader; @class SDLProtocolRecievedMessageRouter; @interface SDLProtocol : SDLAbstractProtocol <SDLProtocolListener> // Sending - (void)sendStartSessionWithType:(SDLServiceType)serviceType; - (void)sendEndSessionWithType:(SDLServiceType)serviceType sessionID:(Byte)sessionID; - (void)sendRPC:(SDLRPCMessage *)message; - (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - (void)sendHeartbeat; - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; // Recieving - (void)handleBytesFromTransport:(NSData *)receivedData; @end
// SDLSmartDeviceLinkProtocol.h // #import "SDLAbstractProtocol.h" @class SDLProtocolHeader; @class SDLProtocolRecievedMessageRouter; @interface SDLProtocol : SDLAbstractProtocol <SDLProtocolListener> // Sending - (void)sendStartSessionWithType:(SDLServiceType)serviceType; - (void)sendEndSessionWithType:(SDLServiceType)serviceType sessionID:(Byte)sessionID; - (void)sendRPC:(SDLRPCMessage *)message; - (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; // Recieving - (void)handleBytesFromTransport:(NSData *)receivedData; @end
Remove the public sendHeartbeat declaration
Remove the public sendHeartbeat declaration
C
bsd-3-clause
FordDev/sdl_ios,davidswi/sdl_ios,duydb2/sdl_ios,kshala-ford/sdl_ios,smartdevicelink/sdl_ios,APCVSRepo/sdl_ios,APCVSRepo/sdl_ios,duydb2/sdl_ios,APCVSRepo/sdl_ios,FordDev/sdl_ios,davidswi/sdl_ios,FordDev/sdl_ios,kshala-ford/sdl_ios,smartdevicelink/sdl_ios,kshala-ford/sdl_ios,smartdevicelink/sdl_ios,davidswi/sdl_ios,kshala-ford/sdl_ios,FordDev/sdl_ios,APCVSRepo/sdl_ios,kshala-ford/sdl_ios,davidswi/sdl_ios,FordDev/sdl_ios,duydb2/sdl_ios,davidswi/sdl_ios,smartdevicelink/sdl_ios,adein/sdl_ios,adein/sdl_ios,APCVSRepo/sdl_ios,smartdevicelink/sdl_ios
c
## Code Before: // SDLSmartDeviceLinkProtocol.h // #import "SDLAbstractProtocol.h" @class SDLProtocolHeader; @class SDLProtocolRecievedMessageRouter; @interface SDLProtocol : SDLAbstractProtocol <SDLProtocolListener> // Sending - (void)sendStartSessionWithType:(SDLServiceType)serviceType; - (void)sendEndSessionWithType:(SDLServiceType)serviceType sessionID:(Byte)sessionID; - (void)sendRPC:(SDLRPCMessage *)message; - (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - (void)sendHeartbeat; - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; // Recieving - (void)handleBytesFromTransport:(NSData *)receivedData; @end ## Instruction: Remove the public sendHeartbeat declaration ## Code After: // SDLSmartDeviceLinkProtocol.h // #import "SDLAbstractProtocol.h" @class SDLProtocolHeader; @class SDLProtocolRecievedMessageRouter; @interface SDLProtocol : SDLAbstractProtocol <SDLProtocolListener> // Sending - (void)sendStartSessionWithType:(SDLServiceType)serviceType; - (void)sendEndSessionWithType:(SDLServiceType)serviceType sessionID:(Byte)sessionID; - (void)sendRPC:(SDLRPCMessage *)message; - (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; // Recieving - (void)handleBytesFromTransport:(NSData *)receivedData; @end
// SDLSmartDeviceLinkProtocol.h // #import "SDLAbstractProtocol.h" @class SDLProtocolHeader; @class SDLProtocolRecievedMessageRouter; @interface SDLProtocol : SDLAbstractProtocol <SDLProtocolListener> // Sending - (void)sendStartSessionWithType:(SDLServiceType)serviceType; - (void)sendEndSessionWithType:(SDLServiceType)serviceType sessionID:(Byte)sessionID; - (void)sendRPC:(SDLRPCMessage *)message; - (void)sendRPCRequest:(SDLRPCRequest *)rpcRequest __deprecated_msg(("Use sendRPC: instead")); - - (void)sendHeartbeat; - (void)sendRawData:(NSData *)data withServiceType:(SDLServiceType)serviceType; // Recieving - (void)handleBytesFromTransport:(NSData *)receivedData; @end
1
0.045455
0
1
f3875b1d9aed5f847b11846a27f7652e4c548b6c
modules/karma.py
modules/karma.py
import discord from modules.botModule import BotModule class Karma(BotModule): name = 'karma' description = 'Monitors messages for reactions and adds karma accordingly.' help_text = 'This module has no callable functions' trigger_string = '!reddit' listen_for_reaction = True async def parse_command(self, message, client): pass async def on_reaction(self, reaction, client): print("karma_action triggered") msg = "I saw that!" + reaction.message.author.name + reaction.emoji await client.send_message(reaction.message.channel, msg)
import discord from modules.botModule import BotModule class Karma(BotModule): name = 'karma' description = 'Monitors messages for reactions and adds karma accordingly.' help_text = 'This module has no callable functions' trigger_string = '!reddit' module_db = 'karma.json' module_version = '0.1.0' listen_for_reaction = True async def parse_command(self, message, client): pass async def on_reaction(self, reaction, client): target_user = self.module_db.Query() if self.module_db.get(target_user.userid == reaction.message.author.id) == None: self.module_db.insert({'userid': reaction.message.author.id, 'karma': 1}) msg = 'New entry for ' + reaction.message.author.id + ' added.' await client.send_message(reaction.message.channel, msg) else: new_karma = self.module_db.get(target_user.userid == reaction.message.author.id)['karma'] + 1 self.module_db.update({'karma': new_karma}, target_user.userid == reaction.message.author.id) msg = 'Karma for ' + reaction.message.author.id + ' updated to ' + new_karma await client.send_message(reaction.message.channel, msg) #msg = "I saw that!" + reaction.message.author.name + reaction.emoji #await client.send_message(reaction.message.channel, msg)
Add logic and code for database operations (untested)
Add logic and code for database operations (untested)
Python
mit
suclearnub/scubot
python
## Code Before: import discord from modules.botModule import BotModule class Karma(BotModule): name = 'karma' description = 'Monitors messages for reactions and adds karma accordingly.' help_text = 'This module has no callable functions' trigger_string = '!reddit' listen_for_reaction = True async def parse_command(self, message, client): pass async def on_reaction(self, reaction, client): print("karma_action triggered") msg = "I saw that!" + reaction.message.author.name + reaction.emoji await client.send_message(reaction.message.channel, msg) ## Instruction: Add logic and code for database operations (untested) ## Code After: import discord from modules.botModule import BotModule class Karma(BotModule): name = 'karma' description = 'Monitors messages for reactions and adds karma accordingly.' help_text = 'This module has no callable functions' trigger_string = '!reddit' module_db = 'karma.json' module_version = '0.1.0' listen_for_reaction = True async def parse_command(self, message, client): pass async def on_reaction(self, reaction, client): target_user = self.module_db.Query() if self.module_db.get(target_user.userid == reaction.message.author.id) == None: self.module_db.insert({'userid': reaction.message.author.id, 'karma': 1}) msg = 'New entry for ' + reaction.message.author.id + ' added.' await client.send_message(reaction.message.channel, msg) else: new_karma = self.module_db.get(target_user.userid == reaction.message.author.id)['karma'] + 1 self.module_db.update({'karma': new_karma}, target_user.userid == reaction.message.author.id) msg = 'Karma for ' + reaction.message.author.id + ' updated to ' + new_karma await client.send_message(reaction.message.channel, msg) #msg = "I saw that!" + reaction.message.author.name + reaction.emoji #await client.send_message(reaction.message.channel, msg)
import discord from modules.botModule import BotModule class Karma(BotModule): name = 'karma' description = 'Monitors messages for reactions and adds karma accordingly.' help_text = 'This module has no callable functions' trigger_string = '!reddit' + module_db = 'karma.json' + + module_version = '0.1.0' + listen_for_reaction = True async def parse_command(self, message, client): pass async def on_reaction(self, reaction, client): - print("karma_action triggered") + target_user = self.module_db.Query() + if self.module_db.get(target_user.userid == reaction.message.author.id) == None: + self.module_db.insert({'userid': reaction.message.author.id, 'karma': 1}) + + msg = 'New entry for ' + reaction.message.author.id + ' added.' + await client.send_message(reaction.message.channel, msg) + else: + new_karma = self.module_db.get(target_user.userid == reaction.message.author.id)['karma'] + 1 + self.module_db.update({'karma': new_karma}, target_user.userid == reaction.message.author.id) + + msg = 'Karma for ' + reaction.message.author.id + ' updated to ' + new_karma + await client.send_message(reaction.message.channel, msg) + - msg = "I saw that!" + reaction.message.author.name + reaction.emoji + #msg = "I saw that!" + reaction.message.author.name + reaction.emoji ? + - await client.send_message(reaction.message.channel, msg) + #await client.send_message(reaction.message.channel, msg) ? +
22
1.047619
19
3
3185f0b569f415a396d3ec90b56e3e6249ff5ead
lib/templates/livereload-shell/index.html
lib/templates/livereload-shell/index.html
<html> <head> <meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1.0, user-scalable=no, minimal-ui"> <style type="text/css" media="all"> body { font-family: Arial, sans-serif; } </style> </head> <body> <h2>Welcome to corber</h2> <h3>Starting Live Reload</h3> <p> Redirecting to your app now; if you still see this page after a few seconds, make sure this device is connected to the same network that your corber build server is running on, and that your build server's address ({{liveReloadUrl}}) can be accessed by other devices on the network. </p> <script type="text/javascript"> var url = '{{liveReloadUrl}}'; var redirect = setInterval(function() { window.location.replace(url); }, 250); setTimeout(function() { clearInterval(redirect); var content = document.getElementsByTagName('p')[0].innerText; alert(content); }, 10000); </script> </body> </html>
<html> <head> <meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1.0, user-scalable=no, minimal-ui"> <style type="text/css" media="all"> body { font-family: Arial, sans-serif; } </style> </head> <body> <h2>Welcome to corber</h2> <h3>Starting Live Reload</h3> <p> Redirecting to your app now; if you still see this page after a few seconds, try clicking the 'Redirect' button. </p> <button id="button-redirect"> Redirect </button> <p> If that doesn't work, make sure this device is connected to the same network that your corber build server is running on, and that your build server's address ({{liveReloadUrl}}) can be accessed by other devices on the network. </p> <script type="text/javascript"> function redirect() { window.location.replace('{{liveReloadUrl}}'); } document.querySelector('#button-redirect').addEventListener('click', redirect); var delayedRedirect = setInterval(redirect, 250); setTimeout(function() { clearInterval(delayedRedirect); var content = document.getElementsByTagName('p')[0].innerText; alert(content); }, 10000); </script> </body> </html>
Add a 'Redirect' button in the live reload shell
Add a 'Redirect' button in the live reload shell
HTML
mit
isleofcode/corber,isleofcode/corber
html
## Code Before: <html> <head> <meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1.0, user-scalable=no, minimal-ui"> <style type="text/css" media="all"> body { font-family: Arial, sans-serif; } </style> </head> <body> <h2>Welcome to corber</h2> <h3>Starting Live Reload</h3> <p> Redirecting to your app now; if you still see this page after a few seconds, make sure this device is connected to the same network that your corber build server is running on, and that your build server's address ({{liveReloadUrl}}) can be accessed by other devices on the network. </p> <script type="text/javascript"> var url = '{{liveReloadUrl}}'; var redirect = setInterval(function() { window.location.replace(url); }, 250); setTimeout(function() { clearInterval(redirect); var content = document.getElementsByTagName('p')[0].innerText; alert(content); }, 10000); </script> </body> </html> ## Instruction: Add a 'Redirect' button in the live reload shell ## Code After: <html> <head> <meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1.0, user-scalable=no, minimal-ui"> <style type="text/css" media="all"> body { font-family: Arial, sans-serif; } </style> </head> <body> <h2>Welcome to corber</h2> <h3>Starting Live Reload</h3> <p> Redirecting to your app now; if you still see this page after a few seconds, try clicking the 'Redirect' button. </p> <button id="button-redirect"> Redirect </button> <p> If that doesn't work, make sure this device is connected to the same network that your corber build server is running on, and that your build server's address ({{liveReloadUrl}}) can be accessed by other devices on the network. </p> <script type="text/javascript"> function redirect() { window.location.replace('{{liveReloadUrl}}'); } document.querySelector('#button-redirect').addEventListener('click', redirect); var delayedRedirect = setInterval(redirect, 250); setTimeout(function() { clearInterval(delayedRedirect); var content = document.getElementsByTagName('p')[0].innerText; alert(content); }, 10000); </script> </body> </html>
<html> <head> <meta name="viewport" content="initial-scale=1, width=device-width, maximum-scale=1.0, user-scalable=no, minimal-ui"> <style type="text/css" media="all"> body { font-family: Arial, sans-serif; } </style> </head> <body> <h2>Welcome to corber</h2> <h3>Starting Live Reload</h3> <p> - Redirecting to your app now; if you still see this + Redirecting to your app now; if you still see this page after a few ? +++++++++++++++++ - page after a few seconds, make sure this device - is connected to the same network that your + seconds, try clicking the 'Redirect' button. + </p> + + <button id="button-redirect"> + Redirect + </button> + + <p> + If that doesn't work, make sure this device is connected to the same - corber build server is running on, and that + network that your corber build server is running on, and that your build ? ++++++++++++++++++ +++++++++++ - your build server's address ({{liveReloadUrl}}) - can be accessed by other devices on the network. + server's address ({{liveReloadUrl}}) can be accessed by other devices on + the network. </p> <script type="text/javascript"> - var url = '{{liveReloadUrl}}'; + function redirect() { + window.location.replace('{{liveReloadUrl}}'); + } + document.querySelector('#button-redirect').addEventListener('click', redirect); - var redirect = setInterval(function() { - window.location.replace(url); - }, 250); + var delayedRedirect = setInterval(redirect, 250); setTimeout(function() { - clearInterval(redirect); ? ^ + clearInterval(delayedRedirect); ? ^^^^^^^^ var content = document.getElementsByTagName('p')[0].innerText; alert(content); }, 10000); </script> </body> </html>
30
0.789474
19
11
60aa0462e986993f48de59f844f3aa0c8a66837e
lib/yammer-staging-strategy.rb
lib/yammer-staging-strategy.rb
require 'omniauth-oauth2' module OmniAuth module Strategies class YammerStaging < OmniAuth::Strategies::OAuth2 # Give your strategy a name. option :name, 'yammer_staging' option :client_options, { site: 'https://www.staging.yammer.com', authorize_url: '/dialog/oauth', token_url: '/oauth2/access_token.json' } # Available as request.env['omniauth.auth']['uid'] uid { raw_info['id'] } info do { access_token: access_token.token, email: primary_email, image: raw_info['mugshot_url'], name: raw_info['full_name'], nickname: raw_info['name'], yammer_profile_url: raw_info['web_url'] } end extra do { 'raw_info' => raw_info } end def build_access_token access_token = super token = YammerAccessToken.new(access_token.token).real_token @access_token = ::OAuth2::AccessToken.new(client, token, access_token.params) end private def raw_info @raw_info ||= access_token.params['user'] end def primary_email raw_info['contact']['email_addresses'].detect{|address| address['type'] == 'primary'}['address'] end end end end
require 'omniauth-oauth2' module OmniAuth module Strategies class YammerStaging < OmniAuth::Strategies::OAuth2 # Give your strategy a name. option :name, 'yammer_staging' option :client_options, { site: 'https://www.staging.yammer.com', authorize_url: '/dialog/oauth', token_url: '/oauth2/access_token.json' } # Available as request.env['omniauth.auth']['uid'] uid { raw_info['id'] } info do { access_token: access_token.token, email: primary_email, image: raw_info['mugshot_url'], name: raw_info['full_name'], nickname: raw_info['name'], yammer_network_id: raw_info['network_id'], yammer_profile_url: raw_info['web_url'] } end extra do { 'raw_info' => raw_info } end def build_access_token access_token = super token = YammerAccessToken.new(access_token.token).real_token @access_token = ::OAuth2::AccessToken.new(client, token, access_token.params) end private def raw_info @raw_info ||= access_token.params['user'] end def primary_email raw_info['contact']['email_addresses'].detect{|address| address['type'] == 'primary'}['address'] end end end end
Add yammer_network_id to yammer staging strategy
Add yammer_network_id to yammer staging strategy
Ruby
mit
YOTOV-LIMITED/sched.do,mauricionr/sched.do,yammer/sched.do,YOTOV-LIMITED/sched.do,yammer/sched.do,mauricionr/sched.do,YOTOV-LIMITED/sched.do,mauricionr/sched.do,mauricionr/sched.do,yammer/sched.do,yammer/sched.do,YOTOV-LIMITED/sched.do
ruby
## Code Before: require 'omniauth-oauth2' module OmniAuth module Strategies class YammerStaging < OmniAuth::Strategies::OAuth2 # Give your strategy a name. option :name, 'yammer_staging' option :client_options, { site: 'https://www.staging.yammer.com', authorize_url: '/dialog/oauth', token_url: '/oauth2/access_token.json' } # Available as request.env['omniauth.auth']['uid'] uid { raw_info['id'] } info do { access_token: access_token.token, email: primary_email, image: raw_info['mugshot_url'], name: raw_info['full_name'], nickname: raw_info['name'], yammer_profile_url: raw_info['web_url'] } end extra do { 'raw_info' => raw_info } end def build_access_token access_token = super token = YammerAccessToken.new(access_token.token).real_token @access_token = ::OAuth2::AccessToken.new(client, token, access_token.params) end private def raw_info @raw_info ||= access_token.params['user'] end def primary_email raw_info['contact']['email_addresses'].detect{|address| address['type'] == 'primary'}['address'] end end end end ## Instruction: Add yammer_network_id to yammer staging strategy ## Code After: require 'omniauth-oauth2' module OmniAuth module Strategies class YammerStaging < OmniAuth::Strategies::OAuth2 # Give your strategy a name. option :name, 'yammer_staging' option :client_options, { site: 'https://www.staging.yammer.com', authorize_url: '/dialog/oauth', token_url: '/oauth2/access_token.json' } # Available as request.env['omniauth.auth']['uid'] uid { raw_info['id'] } info do { access_token: access_token.token, email: primary_email, image: raw_info['mugshot_url'], name: raw_info['full_name'], nickname: raw_info['name'], yammer_network_id: raw_info['network_id'], yammer_profile_url: raw_info['web_url'] } end extra do { 'raw_info' => raw_info } end def build_access_token access_token = super token = YammerAccessToken.new(access_token.token).real_token @access_token = ::OAuth2::AccessToken.new(client, token, access_token.params) end private def raw_info @raw_info ||= access_token.params['user'] end def primary_email raw_info['contact']['email_addresses'].detect{|address| address['type'] == 'primary'}['address'] end end end end
require 'omniauth-oauth2' module OmniAuth module Strategies class YammerStaging < OmniAuth::Strategies::OAuth2 # Give your strategy a name. option :name, 'yammer_staging' option :client_options, { site: 'https://www.staging.yammer.com', authorize_url: '/dialog/oauth', token_url: '/oauth2/access_token.json' } # Available as request.env['omniauth.auth']['uid'] uid { raw_info['id'] } info do { access_token: access_token.token, email: primary_email, image: raw_info['mugshot_url'], name: raw_info['full_name'], nickname: raw_info['name'], + yammer_network_id: raw_info['network_id'], yammer_profile_url: raw_info['web_url'] } end extra do { 'raw_info' => raw_info } end def build_access_token access_token = super token = YammerAccessToken.new(access_token.token).real_token @access_token = ::OAuth2::AccessToken.new(client, token, access_token.params) end private def raw_info @raw_info ||= access_token.params['user'] end def primary_email raw_info['contact']['email_addresses'].detect{|address| address['type'] == 'primary'}['address'] end end end end
1
0.019231
1
0
c1a88a090a268cf68284442419bd061f00448c8e
client/src/Layout.js
client/src/Layout.js
import React, { PropTypes } from 'react' import Alert from 'react-s-alert'; const Layout = ({ children }) => ( <div> {children} <Alert stack={{ limit: 3 }} position="top-left" timeout={5000} html effect="stackslide" /> </div> ) Layout.propTypes = { children: PropTypes.element.isRequired, } export default Layout
import React, { PropTypes } from 'react' import Alert from 'react-s-alert'; const Layout = ({ children }) => ( <div> {children} <Alert stack={{ limit: 3 }} position="top-left" timeout={5000} effect="stackslide" offset={80} html /> </div> ) Layout.propTypes = { children: PropTypes.element.isRequired, } export default Layout
Add offset for header bar.
Alert: Add offset for header bar.
JavaScript
agpl-3.0
teikei/teikei,teikei/teikei,teikei/teikei
javascript
## Code Before: import React, { PropTypes } from 'react' import Alert from 'react-s-alert'; const Layout = ({ children }) => ( <div> {children} <Alert stack={{ limit: 3 }} position="top-left" timeout={5000} html effect="stackslide" /> </div> ) Layout.propTypes = { children: PropTypes.element.isRequired, } export default Layout ## Instruction: Alert: Add offset for header bar. ## Code After: import React, { PropTypes } from 'react' import Alert from 'react-s-alert'; const Layout = ({ children }) => ( <div> {children} <Alert stack={{ limit: 3 }} position="top-left" timeout={5000} effect="stackslide" offset={80} html /> </div> ) Layout.propTypes = { children: PropTypes.element.isRequired, } export default Layout
import React, { PropTypes } from 'react' import Alert from 'react-s-alert'; const Layout = ({ children }) => ( <div> {children} - <Alert stack={{ limit: 3 }} position="top-left" timeout={5000} html effect="stackslide" /> + <Alert + stack={{ limit: 3 }} + position="top-left" + timeout={5000} + effect="stackslide" + offset={80} + html + /> </div> ) Layout.propTypes = { children: PropTypes.element.isRequired, } export default Layout
9
0.6
8
1
4a695af7d8ac4ada301d37081f2abb268f37b250
roles/common/tasks/main.yaml
roles/common/tasks/main.yaml
--- - name: Set up locales locale_gen: name={{item}} state=present sudo: true with_items: - fr_FR.UTF-8 - en_US.UTF-8 - name: apt-get update apt: update_cache=yes cache_valid_time=3600 sudo: true - name: apt-get upgrade apt: upgrade=full sudo: true - name: Set hostname hostname: name={{inventory_hostname}} sudo: true - name: Install vim apt: pkg=vim state=installed sudo: true
--- - name: Set up locales locale_gen: name={{item}} state=present sudo: true with_items: - fr_FR.UTF-8 - en_US.UTF-8 - name: apt-get update apt: update_cache=yes cache_valid_time=3600 sudo: true - name: apt-get upgrade apt: upgrade=full sudo: true - name: Set hostname hostname: name={{inventory_hostname}} sudo: true - name: Setup new hostname to loopback in /etc/hosts lineinfile: 'dest=/etc/hosts regexp="^127.0.1.1" line="127.0.1.1 {{inventory_hostname}}"' sudo: true - name: Install vim apt: pkg=vim state=installed sudo: true
Fix hostname should resolve to loopback in /etc/hosts
Fix hostname should resolve to loopback in /etc/hosts
YAML
mit
adrienkohlbecker/hypervisor,adrienkohlbecker/hypervisor
yaml
## Code Before: --- - name: Set up locales locale_gen: name={{item}} state=present sudo: true with_items: - fr_FR.UTF-8 - en_US.UTF-8 - name: apt-get update apt: update_cache=yes cache_valid_time=3600 sudo: true - name: apt-get upgrade apt: upgrade=full sudo: true - name: Set hostname hostname: name={{inventory_hostname}} sudo: true - name: Install vim apt: pkg=vim state=installed sudo: true ## Instruction: Fix hostname should resolve to loopback in /etc/hosts ## Code After: --- - name: Set up locales locale_gen: name={{item}} state=present sudo: true with_items: - fr_FR.UTF-8 - en_US.UTF-8 - name: apt-get update apt: update_cache=yes cache_valid_time=3600 sudo: true - name: apt-get upgrade apt: upgrade=full sudo: true - name: Set hostname hostname: name={{inventory_hostname}} sudo: true - name: Setup new hostname to loopback in /etc/hosts lineinfile: 'dest=/etc/hosts regexp="^127.0.1.1" line="127.0.1.1 {{inventory_hostname}}"' sudo: true - name: Install vim apt: pkg=vim state=installed sudo: true
--- - name: Set up locales locale_gen: name={{item}} state=present sudo: true with_items: - fr_FR.UTF-8 - en_US.UTF-8 - name: apt-get update apt: update_cache=yes cache_valid_time=3600 sudo: true - name: apt-get upgrade apt: upgrade=full sudo: true - name: Set hostname hostname: name={{inventory_hostname}} sudo: true + - name: Setup new hostname to loopback in /etc/hosts + lineinfile: 'dest=/etc/hosts regexp="^127.0.1.1" line="127.0.1.1 {{inventory_hostname}}"' + sudo: true + - name: Install vim apt: pkg=vim state=installed sudo: true
4
0.166667
4
0
b547f234d5c481982516bb335fba97cd5d3c1287
electron-builder.yml
electron-builder.yml
productName: PixivDeck appId: io.github.akameco.PixivDeck files: - dist/ - node_modules/ - app.html - main.js - main.js.map - package.json mac: category: public.app-category.social-networking dmg: contents: - x: 130 y: 220 - x: 410 y: 220 type: link path: /Applications linux: target: - AppImage - deb publish: - provider: github owner: akameco directories: buildResources: res output: release win: target: - nsis - zip - 7z # nsis: # perMachine: true
productName: PixivDeck appId: io.github.akameco.PixivDeck files: - dist/ - node_modules/ - app.html - main.js - main.js.map - package.json mac: category: public.app-category.social-networking dmg: contents: - x: 130 y: 220 - x: 410 y: 220 type: link path: /Applications linux: target: - AppImage - deb publish: - provider: github owner: akameco directories: buildResources: res output: release win: target: - nsis - zip - 7z nsis: allowToChangeInstallationDirectory: true
Update builder settings for windows
Update builder settings for windows
YAML
mit
akameco/PixivDeck,akameco/PixivDeck
yaml
## Code Before: productName: PixivDeck appId: io.github.akameco.PixivDeck files: - dist/ - node_modules/ - app.html - main.js - main.js.map - package.json mac: category: public.app-category.social-networking dmg: contents: - x: 130 y: 220 - x: 410 y: 220 type: link path: /Applications linux: target: - AppImage - deb publish: - provider: github owner: akameco directories: buildResources: res output: release win: target: - nsis - zip - 7z # nsis: # perMachine: true ## Instruction: Update builder settings for windows ## Code After: productName: PixivDeck appId: io.github.akameco.PixivDeck files: - dist/ - node_modules/ - app.html - main.js - main.js.map - package.json mac: category: public.app-category.social-networking dmg: contents: - x: 130 y: 220 - x: 410 y: 220 type: link path: /Applications linux: target: - AppImage - deb publish: - provider: github owner: akameco directories: buildResources: res output: release win: target: - nsis - zip - 7z nsis: allowToChangeInstallationDirectory: true
productName: PixivDeck appId: io.github.akameco.PixivDeck files: - dist/ - node_modules/ - app.html - main.js - main.js.map - package.json mac: category: public.app-category.social-networking dmg: contents: - x: 130 y: 220 - x: 410 y: 220 type: link path: /Applications linux: target: - AppImage - deb publish: - provider: github owner: akameco directories: buildResources: res output: release win: target: - nsis - zip - 7z - # nsis: ? -- + nsis: - # perMachine: true + allowToChangeInstallationDirectory: true
4
0.111111
2
2
2bbba476d6672f768058eb31bdcf94ac3d128ce2
models/class_type.rb
models/class_type.rb
class ClassType TYPES_BY_ROLE = { 'Creation' => ['Builder', 'Factory', 'Pool', 'Prototype'], 'Interface' => ['Adapter', 'Interface'] } def self.roles TYPES_BY_ROLE.keys end def self.for_role(role) TYPES_BY_ROLE[role] || [] end end
class ClassType TYPES_BY_ROLE = { 'Business Object' => [''], 'Creation' => ['Builder', 'Factory', 'Pool', 'Prototype'], 'Interface' => ['Adapter', 'Interface'] } def self.roles TYPES_BY_ROLE.keys end def self.for_role(role) TYPES_BY_ROLE[role] || [] end end
Add plain business object as role
Add plain business object as role
Ruby
mit
ccurtisj/nominate,ccurtisj/nominate
ruby
## Code Before: class ClassType TYPES_BY_ROLE = { 'Creation' => ['Builder', 'Factory', 'Pool', 'Prototype'], 'Interface' => ['Adapter', 'Interface'] } def self.roles TYPES_BY_ROLE.keys end def self.for_role(role) TYPES_BY_ROLE[role] || [] end end ## Instruction: Add plain business object as role ## Code After: class ClassType TYPES_BY_ROLE = { 'Business Object' => [''], 'Creation' => ['Builder', 'Factory', 'Pool', 'Prototype'], 'Interface' => ['Adapter', 'Interface'] } def self.roles TYPES_BY_ROLE.keys end def self.for_role(role) TYPES_BY_ROLE[role] || [] end end
class ClassType TYPES_BY_ROLE = { + 'Business Object' => [''], - 'Creation' => ['Builder', 'Factory', 'Pool', 'Prototype'], + 'Creation' => ['Builder', 'Factory', 'Pool', 'Prototype'], ? ++++++ - 'Interface' => ['Adapter', 'Interface'] + 'Interface' => ['Adapter', 'Interface'] ? ++++++ } def self.roles TYPES_BY_ROLE.keys end def self.for_role(role) TYPES_BY_ROLE[role] || [] end end
5
0.333333
3
2
03438de28023ae1587ea583b0bc3fee85b15a2b5
index.js
index.js
!function(mocha) { 'use strict'; //mocha.checkLeaks(); mocha.options.ignoreLeaks = true; mocha.globals(['chai', 'BatchGl', 'mocha', 'BatchGlMocks']); mocha.run(); }(mocha);
!function(mocha) { 'use strict'; mocha.checkLeaks(); mocha.globals(['chai', 'BatchGl', 'mocha', 'BatchGlMocks']); mocha.run(); }(mocha);
Make Mocha check for leaks.
Make Mocha check for leaks.
JavaScript
mit
reissbaker/batchgl,reissbaker/batchgl
javascript
## Code Before: !function(mocha) { 'use strict'; //mocha.checkLeaks(); mocha.options.ignoreLeaks = true; mocha.globals(['chai', 'BatchGl', 'mocha', 'BatchGlMocks']); mocha.run(); }(mocha); ## Instruction: Make Mocha check for leaks. ## Code After: !function(mocha) { 'use strict'; mocha.checkLeaks(); mocha.globals(['chai', 'BatchGl', 'mocha', 'BatchGlMocks']); mocha.run(); }(mocha);
!function(mocha) { 'use strict'; - //mocha.checkLeaks(); ? -- + mocha.checkLeaks(); - mocha.options.ignoreLeaks = true; mocha.globals(['chai', 'BatchGl', 'mocha', 'BatchGlMocks']); mocha.run(); }(mocha);
3
0.375
1
2
5dc69c3e88ab4df897c9a1d632a47de42e5bc9c0
app.py
app.py
"""Module containing factory function for the application""" from flask import Flask, redirect from flask_restplus import Api from config import app_config from api_v1 import Blueprint_apiV1 from api_v1.models import db Api_V1 = Api( app=Blueprint_apiV1, title="Shopping List Api", description="An API for a Shopping List Application", contact="machariamarigi@gmail.com" ) def create_app(environment): """Factory function for the application""" app = Flask(__name__) app.config.from_object(app_config[environment]) db.init_app(app) app.register_blueprint(Blueprint_apiV1) # add namespaces here from api_v1 import authenticate Api_V1.add_namespace(authenticate.auth) from api_v1 import endpoints Api_V1.add_namespace(endpoints.sh_ns) @app.route('/') def reroute(): """Method to route root path to /api/v1""" return redirect('/api/v1') return app
"""Module containing factory function for the application""" from flask import Flask, redirect from flask_restplus import Api from flask_cors import CORS from config import app_config from api_v1 import Blueprint_apiV1 from api_v1.models import db Api_V1 = Api( app=Blueprint_apiV1, title="Shopping List Api", description="An API for a Shopping List Application", contact="machariamarigi@gmail.com" ) def create_app(environment): """Factory function for the application""" app = Flask(__name__) app.config.from_object(app_config[environment]) db.init_app(app) CORS(app) app.register_blueprint(Blueprint_apiV1) # add namespaces here from api_v1 import authenticate Api_V1.add_namespace(authenticate.auth) from api_v1 import endpoints Api_V1.add_namespace(endpoints.sh_ns) @app.route('/') def reroute(): """Method to route root path to /api/v1""" return redirect('/api/v1') return app
Enable Cross Origin Resource Sharing
[Update] Enable Cross Origin Resource Sharing
Python
mit
machariamarigi/shopping_list_api
python
## Code Before: """Module containing factory function for the application""" from flask import Flask, redirect from flask_restplus import Api from config import app_config from api_v1 import Blueprint_apiV1 from api_v1.models import db Api_V1 = Api( app=Blueprint_apiV1, title="Shopping List Api", description="An API for a Shopping List Application", contact="machariamarigi@gmail.com" ) def create_app(environment): """Factory function for the application""" app = Flask(__name__) app.config.from_object(app_config[environment]) db.init_app(app) app.register_blueprint(Blueprint_apiV1) # add namespaces here from api_v1 import authenticate Api_V1.add_namespace(authenticate.auth) from api_v1 import endpoints Api_V1.add_namespace(endpoints.sh_ns) @app.route('/') def reroute(): """Method to route root path to /api/v1""" return redirect('/api/v1') return app ## Instruction: [Update] Enable Cross Origin Resource Sharing ## Code After: """Module containing factory function for the application""" from flask import Flask, redirect from flask_restplus import Api from flask_cors import CORS from config import app_config from api_v1 import Blueprint_apiV1 from api_v1.models import db Api_V1 = Api( app=Blueprint_apiV1, title="Shopping List Api", description="An API for a Shopping List Application", contact="machariamarigi@gmail.com" ) def create_app(environment): """Factory function for the application""" app = Flask(__name__) app.config.from_object(app_config[environment]) db.init_app(app) CORS(app) app.register_blueprint(Blueprint_apiV1) # add namespaces here from api_v1 import authenticate Api_V1.add_namespace(authenticate.auth) from api_v1 import endpoints Api_V1.add_namespace(endpoints.sh_ns) @app.route('/') def reroute(): """Method to route root path to /api/v1""" return redirect('/api/v1') return app
"""Module containing factory function for the application""" from flask import Flask, redirect from flask_restplus import Api + from flask_cors import CORS from config import app_config from api_v1 import Blueprint_apiV1 from api_v1.models import db Api_V1 = Api( app=Blueprint_apiV1, title="Shopping List Api", description="An API for a Shopping List Application", contact="machariamarigi@gmail.com" ) def create_app(environment): """Factory function for the application""" app = Flask(__name__) app.config.from_object(app_config[environment]) db.init_app(app) + CORS(app) app.register_blueprint(Blueprint_apiV1) # add namespaces here from api_v1 import authenticate Api_V1.add_namespace(authenticate.auth) from api_v1 import endpoints Api_V1.add_namespace(endpoints.sh_ns) @app.route('/') def reroute(): """Method to route root path to /api/v1""" return redirect('/api/v1') return app
2
0.052632
2
0
746fc3d3bf7205bcce66d1c610e20f9289237726
tests/lib/Http/Client/ResponseTest.php
tests/lib/Http/Client/ResponseTest.php
<?php /** * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ namespace Test\Http\Client; use Guzzle\Stream\Stream; use GuzzleHttp\Message\Response as GuzzleResponse; use OC\Http\Client\Response; /** * Class ResponseTest */ class ResponseTest extends \Test\TestCase { /** @var Response */ private $response; /** @var GuzzleResponse */ private $guzzleResponse; public function setUp() { parent::setUp(); $this->guzzleResponse = new GuzzleResponse(1337); $this->response = new Response($this->guzzleResponse); } public function testGetStatusCode() { $this->assertEquals(1337, $this->response->getStatusCode()); } public function testGetHeader() { $this->guzzleResponse->setHeader('bar', 'foo'); $this->assertEquals('foo', $this->response->getHeader('bar')); } }
<?php /** * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ namespace Test\Http\Client; use GuzzleHttp\Stream\Stream; use GuzzleHttp\Message\Response as GuzzleResponse; use OC\Http\Client\Response; /** * Class ResponseTest */ class ResponseTest extends \Test\TestCase { /** @var Response */ private $response; /** @var GuzzleResponse */ private $guzzleResponse; public function setUp() { parent::setUp(); $this->guzzleResponse = new GuzzleResponse(1337); $this->response = new Response($this->guzzleResponse); } public function testGetBody() { $this->guzzleResponse->setBody(Stream::factory('MyResponse')); $this->assertSame('MyResponse', $this->response->getBody()); } public function testGetStatusCode() { $this->assertSame(1337, $this->response->getStatusCode()); } public function testGetHeader() { $this->guzzleResponse->setHeader('bar', 'foo'); $this->assertSame('foo', $this->response->getHeader('bar')); } public function testGetHeaders() { $this->guzzleResponse->setHeader('bar', 'foo'); $this->guzzleResponse->setHeader('x-awesome', 'yes'); $expected = [ 'bar' => [ 0 => 'foo', ], 'x-awesome' => [ 0 => 'yes', ], ]; $this->assertSame($expected, $this->response->getHeaders()); $this->assertSame('yes', $this->response->getHeader('x-awesome')); } }
Add 100% coverage for response.php
Add 100% coverage for response.php While already at https://github.com/nextcloud/server/pull/2911 I thought I can as well finish that one as well... Signed-off-by: Lukas Reschke <65adda4326914576405c9e3a62f4904d96573863@statuscode.ch>
PHP
agpl-3.0
endsguy/server,Ardinis/server,nextcloud/server,xx621998xx/server,Ardinis/server,jbicha/server,pmattern/server,endsguy/server,endsguy/server,michaelletzgus/nextcloud-server,whitekiba/server,whitekiba/server,pixelipo/server,nextcloud/server,andreas-p/nextcloud-server,nextcloud/server,pmattern/server,nextcloud/server,jbicha/server,pixelipo/server,Ardinis/server,pmattern/server,andreas-p/nextcloud-server,andreas-p/nextcloud-server,xx621998xx/server,whitekiba/server,xx621998xx/server,michaelletzgus/nextcloud-server,andreas-p/nextcloud-server,xx621998xx/server,pixelipo/server,pixelipo/server,jbicha/server,whitekiba/server,whitekiba/server,xx621998xx/server,endsguy/server,pixelipo/server,endsguy/server,pmattern/server,Ardinis/server,jbicha/server,pmattern/server,michaelletzgus/nextcloud-server,michaelletzgus/nextcloud-server,Ardinis/server,andreas-p/nextcloud-server,jbicha/server
php
## Code Before: <?php /** * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ namespace Test\Http\Client; use Guzzle\Stream\Stream; use GuzzleHttp\Message\Response as GuzzleResponse; use OC\Http\Client\Response; /** * Class ResponseTest */ class ResponseTest extends \Test\TestCase { /** @var Response */ private $response; /** @var GuzzleResponse */ private $guzzleResponse; public function setUp() { parent::setUp(); $this->guzzleResponse = new GuzzleResponse(1337); $this->response = new Response($this->guzzleResponse); } public function testGetStatusCode() { $this->assertEquals(1337, $this->response->getStatusCode()); } public function testGetHeader() { $this->guzzleResponse->setHeader('bar', 'foo'); $this->assertEquals('foo', $this->response->getHeader('bar')); } } ## Instruction: Add 100% coverage for response.php While already at https://github.com/nextcloud/server/pull/2911 I thought I can as well finish that one as well... Signed-off-by: Lukas Reschke <65adda4326914576405c9e3a62f4904d96573863@statuscode.ch> ## Code After: <?php /** * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ namespace Test\Http\Client; use GuzzleHttp\Stream\Stream; use GuzzleHttp\Message\Response as GuzzleResponse; use OC\Http\Client\Response; /** * Class ResponseTest */ class ResponseTest extends \Test\TestCase { /** @var Response */ private $response; /** @var GuzzleResponse */ private $guzzleResponse; public function setUp() { parent::setUp(); $this->guzzleResponse = new GuzzleResponse(1337); $this->response = new Response($this->guzzleResponse); } public function testGetBody() { $this->guzzleResponse->setBody(Stream::factory('MyResponse')); $this->assertSame('MyResponse', $this->response->getBody()); } public function testGetStatusCode() { $this->assertSame(1337, $this->response->getStatusCode()); } public function testGetHeader() { $this->guzzleResponse->setHeader('bar', 'foo'); $this->assertSame('foo', $this->response->getHeader('bar')); } public function testGetHeaders() { $this->guzzleResponse->setHeader('bar', 'foo'); $this->guzzleResponse->setHeader('x-awesome', 'yes'); $expected = [ 'bar' => [ 0 => 'foo', ], 'x-awesome' => [ 0 => 'yes', ], ]; $this->assertSame($expected, $this->response->getHeaders()); $this->assertSame('yes', $this->response->getHeader('x-awesome')); } }
<?php /** * Copyright (c) 2015 Lukas Reschke <lukas@owncloud.com> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ namespace Test\Http\Client; - use Guzzle\Stream\Stream; + use GuzzleHttp\Stream\Stream; ? ++++ use GuzzleHttp\Message\Response as GuzzleResponse; use OC\Http\Client\Response; /** * Class ResponseTest */ class ResponseTest extends \Test\TestCase { /** @var Response */ private $response; /** @var GuzzleResponse */ private $guzzleResponse; public function setUp() { parent::setUp(); $this->guzzleResponse = new GuzzleResponse(1337); $this->response = new Response($this->guzzleResponse); } + public function testGetBody() { + $this->guzzleResponse->setBody(Stream::factory('MyResponse')); + $this->assertSame('MyResponse', $this->response->getBody()); + } + public function testGetStatusCode() { - $this->assertEquals(1337, $this->response->getStatusCode()); ? ^^^ ^^ + $this->assertSame(1337, $this->response->getStatusCode()); ? ^ ^^ } public function testGetHeader() { $this->guzzleResponse->setHeader('bar', 'foo'); - $this->assertEquals('foo', $this->response->getHeader('bar')); ? ^^^ ^^ + $this->assertSame('foo', $this->response->getHeader('bar')); ? ^ ^^ + } + + public function testGetHeaders() { + $this->guzzleResponse->setHeader('bar', 'foo'); + $this->guzzleResponse->setHeader('x-awesome', 'yes'); + + $expected = [ + 'bar' => [ + 0 => 'foo', + ], + 'x-awesome' => [ + 0 => 'yes', + ], + ]; + $this->assertSame($expected, $this->response->getHeaders()); + $this->assertSame('yes', $this->response->getHeader('x-awesome')); } }
27
0.710526
24
3
776a596bd8d968cd1b3e9ba56146254f800aa1d5
prerequisites-software.rst
prerequisites-software.rst
Software ******** If you want to install Zammad, you need the following software. 1. Ruby Programming Language ============================ Zammad requires Ruby. All required rubygems like ruby on rails are listed in the Gemfile. The following Ruby version is supported: * Ruby 2.4.4 2. Database Server ================== Zammad will store all content in an RDBMS. You can choose between the following products: * MySQL 5.6+ * MariaDB 10.0+ * PostgreSQL 9.1+ Side note: We tend to recommend PostgreSQL. For the last 10 years we had the best experience with it. If you like to use MySQL/MariaDB get sure to use UTF8 encoding. utf8mb4 for example will fail. 3. Reverse Proxy ================ In a typical web environment today, you use a reverse proxy to deliver the static content of your application. Only the "expensive" app required HTTP requests are forwarded to the application server. The following reverse proxies are supported: * Nginx 1.3+ * Apache 2.2+ 4. Elasticsearch ================ For excellent search performance we use Elasticsearch. The following Elasticsearch versions are supported: * Elasticsearch 2.4 up to 5.5 with mapper-attachments plugin * Elasticsearch 5.6 with ingest-attachment plugin
Software ******** If you want to install Zammad, you need the following software. 1. Ruby Programming Language ============================ Zammad requires Ruby. All required rubygems like ruby on rails are listed in the Gemfile. The following Ruby version is supported: * Ruby 2.4.4 2. Database Server ================== Zammad will store all content in an RDBMS. You can choose between the following products: * MySQL 5.6+ * MariaDB 10.0+ * PostgreSQL 9.1+ Side note: We tend to recommend PostgreSQL. For the last 10 years we had the best experience with it. Required configuration for MySQL/MariaDB: * Use UTF8 encoding. utf8mb4 for example will fail. * Set max_allowed_packet to a value larger than the default of 4 MB (64 MB+ recommended). 3. Reverse Proxy ================ In a typical web environment today, you use a reverse proxy to deliver the static content of your application. Only the "expensive" app required HTTP requests are forwarded to the application server. The following reverse proxies are supported: * Nginx 1.3+ * Apache 2.2+ 4. Elasticsearch ================ For excellent search performance we use Elasticsearch. The following Elasticsearch versions are supported: * Elasticsearch 2.4 up to 5.5 with mapper-attachments plugin * Elasticsearch 5.6 with ingest-attachment plugin
Add max_allowed_packet requirement to software prerequisites
Add max_allowed_packet requirement to software prerequisites
reStructuredText
agpl-3.0
zammad/zammad-documentation,zammad/zammad-documentation
restructuredtext
## Code Before: Software ******** If you want to install Zammad, you need the following software. 1. Ruby Programming Language ============================ Zammad requires Ruby. All required rubygems like ruby on rails are listed in the Gemfile. The following Ruby version is supported: * Ruby 2.4.4 2. Database Server ================== Zammad will store all content in an RDBMS. You can choose between the following products: * MySQL 5.6+ * MariaDB 10.0+ * PostgreSQL 9.1+ Side note: We tend to recommend PostgreSQL. For the last 10 years we had the best experience with it. If you like to use MySQL/MariaDB get sure to use UTF8 encoding. utf8mb4 for example will fail. 3. Reverse Proxy ================ In a typical web environment today, you use a reverse proxy to deliver the static content of your application. Only the "expensive" app required HTTP requests are forwarded to the application server. The following reverse proxies are supported: * Nginx 1.3+ * Apache 2.2+ 4. Elasticsearch ================ For excellent search performance we use Elasticsearch. The following Elasticsearch versions are supported: * Elasticsearch 2.4 up to 5.5 with mapper-attachments plugin * Elasticsearch 5.6 with ingest-attachment plugin ## Instruction: Add max_allowed_packet requirement to software prerequisites ## Code After: Software ******** If you want to install Zammad, you need the following software. 1. Ruby Programming Language ============================ Zammad requires Ruby. All required rubygems like ruby on rails are listed in the Gemfile. The following Ruby version is supported: * Ruby 2.4.4 2. Database Server ================== Zammad will store all content in an RDBMS. You can choose between the following products: * MySQL 5.6+ * MariaDB 10.0+ * PostgreSQL 9.1+ Side note: We tend to recommend PostgreSQL. For the last 10 years we had the best experience with it. Required configuration for MySQL/MariaDB: * Use UTF8 encoding. utf8mb4 for example will fail. * Set max_allowed_packet to a value larger than the default of 4 MB (64 MB+ recommended). 3. Reverse Proxy ================ In a typical web environment today, you use a reverse proxy to deliver the static content of your application. Only the "expensive" app required HTTP requests are forwarded to the application server. The following reverse proxies are supported: * Nginx 1.3+ * Apache 2.2+ 4. Elasticsearch ================ For excellent search performance we use Elasticsearch. The following Elasticsearch versions are supported: * Elasticsearch 2.4 up to 5.5 with mapper-attachments plugin * Elasticsearch 5.6 with ingest-attachment plugin
Software ******** If you want to install Zammad, you need the following software. 1. Ruby Programming Language ============================ Zammad requires Ruby. All required rubygems like ruby on rails are listed in the Gemfile. The following Ruby version is supported: * Ruby 2.4.4 2. Database Server ================== Zammad will store all content in an RDBMS. You can choose between the following products: * MySQL 5.6+ * MariaDB 10.0+ * PostgreSQL 9.1+ Side note: We tend to recommend PostgreSQL. For the last 10 years we had the best experience with it. - If you like to use MySQL/MariaDB get sure to use UTF8 encoding. utf8mb4 for example will fail. + Required configuration for MySQL/MariaDB: + + * Use UTF8 encoding. utf8mb4 for example will fail. + * Set max_allowed_packet to a value larger than the default of 4 MB (64 MB+ recommended). 3. Reverse Proxy ================ In a typical web environment today, you use a reverse proxy to deliver the static content of your application. Only the "expensive" app required HTTP requests are forwarded to the application server. The following reverse proxies are supported: * Nginx 1.3+ * Apache 2.2+ 4. Elasticsearch ================ For excellent search performance we use Elasticsearch. The following Elasticsearch versions are supported: * Elasticsearch 2.4 up to 5.5 with mapper-attachments plugin * Elasticsearch 5.6 with ingest-attachment plugin
5
0.104167
4
1
470ff9529ff9c2e762d926328800220482167d2f
test/test_base32.rb
test/test_base32.rb
require "test/unit" require "otp/base32" class TestBase32 < Test::Unit::TestCase def assert_encode(encoded, plain) assert_equal(encoded, ::OTP::Base32.encode(plain)) end def assert_decode(plain, encoded) plain &&= plain.dup.force_encoding("binary") assert_equal(plain, ::OTP::Base32.decode(encoded)) end def assert_encode_decode(plain, encoded) assert_decode(plain, encoded) assert_encode(encoded, plain) end def test_base32 assert_encode_decode(nil, nil) assert_encode_decode("", "") assert_encode_decode("f", "MY======") assert_encode_decode("fo", "MZXQ====") assert_encode_decode("foo", "MZXW6===") assert_encode_decode("foob", "MZXW6YQ=") assert_encode_decode("fooba", "MZXW6YTB") assert_encode_decode("foobar", "MZXW6YTBOI======") assert_encode_decode("\u{3042}\u{3044}\u{3046}\u{3048}\u{304a}", "4OAYFY4BQTRYDBXDQGEOHAMK") end end
require "test/unit" require "otp/base32" class TestBase32 < Test::Unit::TestCase def assert_encode(encoded, plain) assert_equal(encoded, ::OTP::Base32.encode(plain)) end def assert_decode(plain, encoded) plain &&= plain.dup.force_encoding("binary") assert_equal(plain, ::OTP::Base32.decode(encoded)) end def assert_encode_decode(plain, encoded) assert_decode(plain, encoded) assert_encode(encoded, plain) end def test_base32 assert_encode_decode(nil, nil) assert_encode_decode("", "") assert_encode_decode("f", "MY======") assert_encode_decode("fo", "MZXQ====") assert_encode_decode("foo", "MZXW6===") assert_encode_decode("foob", "MZXW6YQ=") assert_encode_decode("fooba", "MZXW6YTB") assert_encode_decode("foobar", "MZXW6YTBOI======") assert_encode_decode("\u{3042}\u{3044}\u{3046}\u{3048}\u{304a}", "4OAYFY4BQTRYDBXDQGEOHAMK") end def test_truncated_decode assert_decode("f", "MY") assert_decode("fo", "MZXQ") assert_decode("foo", "MZXW6") assert_decode("foob", "MZXW6YQ") assert_decode("f", "my") assert_decode("fo", "mzxq") assert_decode("foo", "mzxw6") assert_decode("foob", "mzxw6yq") end end
Test for values which truncated trailing "=".
Test for values which truncated trailing "=".
Ruby
mit
gotoyuzo/otp
ruby
## Code Before: require "test/unit" require "otp/base32" class TestBase32 < Test::Unit::TestCase def assert_encode(encoded, plain) assert_equal(encoded, ::OTP::Base32.encode(plain)) end def assert_decode(plain, encoded) plain &&= plain.dup.force_encoding("binary") assert_equal(plain, ::OTP::Base32.decode(encoded)) end def assert_encode_decode(plain, encoded) assert_decode(plain, encoded) assert_encode(encoded, plain) end def test_base32 assert_encode_decode(nil, nil) assert_encode_decode("", "") assert_encode_decode("f", "MY======") assert_encode_decode("fo", "MZXQ====") assert_encode_decode("foo", "MZXW6===") assert_encode_decode("foob", "MZXW6YQ=") assert_encode_decode("fooba", "MZXW6YTB") assert_encode_decode("foobar", "MZXW6YTBOI======") assert_encode_decode("\u{3042}\u{3044}\u{3046}\u{3048}\u{304a}", "4OAYFY4BQTRYDBXDQGEOHAMK") end end ## Instruction: Test for values which truncated trailing "=". ## Code After: require "test/unit" require "otp/base32" class TestBase32 < Test::Unit::TestCase def assert_encode(encoded, plain) assert_equal(encoded, ::OTP::Base32.encode(plain)) end def assert_decode(plain, encoded) plain &&= plain.dup.force_encoding("binary") assert_equal(plain, ::OTP::Base32.decode(encoded)) end def assert_encode_decode(plain, encoded) assert_decode(plain, encoded) assert_encode(encoded, plain) end def test_base32 assert_encode_decode(nil, nil) assert_encode_decode("", "") assert_encode_decode("f", "MY======") assert_encode_decode("fo", "MZXQ====") assert_encode_decode("foo", "MZXW6===") assert_encode_decode("foob", "MZXW6YQ=") assert_encode_decode("fooba", "MZXW6YTB") assert_encode_decode("foobar", "MZXW6YTBOI======") assert_encode_decode("\u{3042}\u{3044}\u{3046}\u{3048}\u{304a}", "4OAYFY4BQTRYDBXDQGEOHAMK") end def test_truncated_decode assert_decode("f", "MY") assert_decode("fo", "MZXQ") assert_decode("foo", "MZXW6") assert_decode("foob", "MZXW6YQ") assert_decode("f", "my") assert_decode("fo", "mzxq") assert_decode("foo", "mzxw6") assert_decode("foob", "mzxw6yq") end end
require "test/unit" require "otp/base32" class TestBase32 < Test::Unit::TestCase def assert_encode(encoded, plain) assert_equal(encoded, ::OTP::Base32.encode(plain)) end def assert_decode(plain, encoded) plain &&= plain.dup.force_encoding("binary") assert_equal(plain, ::OTP::Base32.decode(encoded)) end def assert_encode_decode(plain, encoded) assert_decode(plain, encoded) assert_encode(encoded, plain) end def test_base32 assert_encode_decode(nil, nil) assert_encode_decode("", "") assert_encode_decode("f", "MY======") assert_encode_decode("fo", "MZXQ====") assert_encode_decode("foo", "MZXW6===") assert_encode_decode("foob", "MZXW6YQ=") assert_encode_decode("fooba", "MZXW6YTB") assert_encode_decode("foobar", "MZXW6YTBOI======") assert_encode_decode("\u{3042}\u{3044}\u{3046}\u{3048}\u{304a}", "4OAYFY4BQTRYDBXDQGEOHAMK") end + + def test_truncated_decode + assert_decode("f", "MY") + assert_decode("fo", "MZXQ") + assert_decode("foo", "MZXW6") + assert_decode("foob", "MZXW6YQ") + assert_decode("f", "my") + assert_decode("fo", "mzxq") + assert_decode("foo", "mzxw6") + assert_decode("foob", "mzxw6yq") + end end
11
0.366667
11
0
ce93fba288020cf737c04dea0fe0d04f23a1ca45
readthedocs/templates/builds/build_list.html
readthedocs/templates/builds/build_list.html
{% extends "projects/base_project_editing.html" %} {% load i18n %} {% load pagination_tags %} {% block title %}Builds{% endblock %} {% block content %} <div id="build_list"> <form action="" method="get"> {{ filter.form.as_p }} <input type="submit" value="Filter" /> </form> {% autopaginate filter 15 %} <!-- BEGIN builds list --> <div class="module"> <div class="module-wrapper"> <div class="module-header"> <h1>{% trans "Recent Builds" %}</h1> </div> <div class="module-list"> <div class="module-list-wrapper"> <ul> {% with filter as build_list %} {% include "core/build_list_detailed.html" %} {% endwith %} </ul> </div> </div> </div> </div> <!-- END builds list --> {% paginate %} </div> {% endblock %} {% block extra_scripts %} {{ block.super }} <script type="text/javascript" src="{{ MEDIA_URL }}javascript/build_updater.js"></script> <script type="text/javascript"> $(function() { {% for build in active_builds %} new BuildListUpdater({{ build.id }}).startPolling(); {% endfor %} }); </script> {% endblock %}
{% extends "projects/base_project_editing.html" %} {% load i18n %} {% load pagination_tags %} {% block title %}Builds{% endblock %} {% block content %} <div id="build_list"> {% comment %} <form action="" method="get"> {{ filter.form.as_p }} <input type="submit" value="Filter" /> </form> {% endcomment %} {% autopaginate build_list 15 %} <!-- BEGIN builds list --> <div class="module"> <div class="module-wrapper"> <div class="module-header"> <h1>{% trans "Recent Builds" %}</h1> </div> <div class="module-list"> <div class="module-list-wrapper"> <ul> {% include "core/build_list_detailed.html" %} </ul> </div> </div> </div> </div> <!-- END builds list --> {% paginate %} </div> {% endblock %} {% block extra_scripts %} {{ block.super }} <script type="text/javascript" src="{{ MEDIA_URL }}javascript/build_updater.js"></script> <script type="text/javascript"> $(function() { {% for build in active_builds %} new BuildListUpdater({{ build.id }}).startPolling(); {% endfor %} }); </script> {% endblock %}
Remove filters on build list page for now.
Remove filters on build list page for now.
HTML
mit
raven47git/readthedocs.org,safwanrahman/readthedocs.org,titiushko/readthedocs.org,KamranMackey/readthedocs.org,mhils/readthedocs.org,tddv/readthedocs.org,dirn/readthedocs.org,sid-kap/readthedocs.org,fujita-shintaro/readthedocs.org,dirn/readthedocs.org,royalwang/readthedocs.org,davidfischer/readthedocs.org,laplaceliu/readthedocs.org,GovReady/readthedocs.org,istresearch/readthedocs.org,cgourlay/readthedocs.org,asampat3090/readthedocs.org,mrshoki/readthedocs.org,soulshake/readthedocs.org,davidfischer/readthedocs.org,cgourlay/readthedocs.org,michaelmcandrew/readthedocs.org,mrshoki/readthedocs.org,royalwang/readthedocs.org,kenwang76/readthedocs.org,raven47git/readthedocs.org,KamranMackey/readthedocs.org,sunnyzwh/readthedocs.org,pombredanne/readthedocs.org,kdkeyser/readthedocs.org,techtonik/readthedocs.org,wanghaven/readthedocs.org,gjtorikian/readthedocs.org,royalwang/readthedocs.org,kenwang76/readthedocs.org,takluyver/readthedocs.org,tddv/readthedocs.org,sid-kap/readthedocs.org,sils1297/readthedocs.org,KamranMackey/readthedocs.org,techtonik/readthedocs.org,sid-kap/readthedocs.org,sils1297/readthedocs.org,safwanrahman/readthedocs.org,asampat3090/readthedocs.org,atsuyim/readthedocs.org,emawind84/readthedocs.org,kenwang76/readthedocs.org,laplaceliu/readthedocs.org,nikolas/readthedocs.org,GovReady/readthedocs.org,ojii/readthedocs.org,gjtorikian/readthedocs.org,techtonik/readthedocs.org,kenshinthebattosai/readthedocs.org,attakei/readthedocs-oauth,singingwolfboy/readthedocs.org,clarkperkins/readthedocs.org,cgourlay/readthedocs.org,davidfischer/readthedocs.org,wijerasa/readthedocs.org,LukasBoersma/readthedocs.org,stevepiercy/readthedocs.org,VishvajitP/readthedocs.org,sid-kap/readthedocs.org,Tazer/readthedocs.org,gjtorikian/readthedocs.org,safwanrahman/readthedocs.org,emawind84/readthedocs.org,dirn/readthedocs.org,jerel/readthedocs.org,kdkeyser/readthedocs.org,takluyver/readthedocs.org,ojii/readthedocs.org,wanghaven/readthedocs.org,rtfd/readthedocs.org,emawind84/readthedocs.org,stevepiercy/readthedocs.org,fujita-shintaro/readthedocs.org,nyergler/pythonslides,CedarLogic/readthedocs.org,titiushko/readthedocs.org,techtonik/readthedocs.org,laplaceliu/readthedocs.org,istresearch/readthedocs.org,sunnyzwh/readthedocs.org,LukasBoersma/readthedocs.org,stevepiercy/readthedocs.org,Tazer/readthedocs.org,pombredanne/readthedocs.org,nikolas/readthedocs.org,takluyver/readthedocs.org,sunnyzwh/readthedocs.org,dirn/readthedocs.org,attakei/readthedocs-oauth,fujita-shintaro/readthedocs.org,singingwolfboy/readthedocs.org,nyergler/pythonslides,ojii/readthedocs.org,raven47git/readthedocs.org,kenshinthebattosai/readthedocs.org,jerel/readthedocs.org,atsuyim/readthedocs.org,istresearch/readthedocs.org,attakei/readthedocs-oauth,sils1297/readthedocs.org,cgourlay/readthedocs.org,asampat3090/readthedocs.org,fujita-shintaro/readthedocs.org,d0ugal/readthedocs.org,safwanrahman/readthedocs.org,Tazer/readthedocs.org,wanghaven/readthedocs.org,kenwang76/readthedocs.org,espdev/readthedocs.org,tddv/readthedocs.org,atsuyim/readthedocs.org,d0ugal/readthedocs.org,hach-que/readthedocs.org,kenshinthebattosai/readthedocs.org,michaelmcandrew/readthedocs.org,agjohnson/readthedocs.org,Carreau/readthedocs.org,espdev/readthedocs.org,emawind84/readthedocs.org,Carreau/readthedocs.org,mhils/readthedocs.org,CedarLogic/readthedocs.org,jerel/readthedocs.org,kdkeyser/readthedocs.org,hach-que/readthedocs.org,nikolas/readthedocs.org,hach-que/readthedocs.org,jerel/readthedocs.org,Carreau/readthedocs.org,pombredanne/readthedocs.org,soulshake/readthedocs.org,Tazer/readthedocs.org,singingwolfboy/readthedocs.org,VishvajitP/readthedocs.org,agjohnson/readthedocs.org,agjohnson/readthedocs.org,clarkperkins/readthedocs.org,agjohnson/readthedocs.org,VishvajitP/readthedocs.org,singingwolfboy/readthedocs.org,ojii/readthedocs.org,davidfischer/readthedocs.org,wanghaven/readthedocs.org,royalwang/readthedocs.org,raven47git/readthedocs.org,nyergler/pythonslides,wijerasa/readthedocs.org,soulshake/readthedocs.org,titiushko/readthedocs.org,attakei/readthedocs-oauth,titiushko/readthedocs.org,istresearch/readthedocs.org,LukasBoersma/readthedocs.org,clarkperkins/readthedocs.org,SteveViss/readthedocs.org,espdev/readthedocs.org,michaelmcandrew/readthedocs.org,KamranMackey/readthedocs.org,espdev/readthedocs.org,CedarLogic/readthedocs.org,takluyver/readthedocs.org,espdev/readthedocs.org,CedarLogic/readthedocs.org,mhils/readthedocs.org,sils1297/readthedocs.org,rtfd/readthedocs.org,GovReady/readthedocs.org,gjtorikian/readthedocs.org,wijerasa/readthedocs.org,hach-que/readthedocs.org,mrshoki/readthedocs.org,d0ugal/readthedocs.org,wijerasa/readthedocs.org,Carreau/readthedocs.org,SteveViss/readthedocs.org,kenshinthebattosai/readthedocs.org,soulshake/readthedocs.org,mhils/readthedocs.org,laplaceliu/readthedocs.org,rtfd/readthedocs.org,mrshoki/readthedocs.org,SteveViss/readthedocs.org,asampat3090/readthedocs.org,stevepiercy/readthedocs.org,d0ugal/readthedocs.org,rtfd/readthedocs.org,GovReady/readthedocs.org,clarkperkins/readthedocs.org,nikolas/readthedocs.org,michaelmcandrew/readthedocs.org,atsuyim/readthedocs.org,VishvajitP/readthedocs.org,nyergler/pythonslides,kdkeyser/readthedocs.org,SteveViss/readthedocs.org,LukasBoersma/readthedocs.org,sunnyzwh/readthedocs.org
html
## Code Before: {% extends "projects/base_project_editing.html" %} {% load i18n %} {% load pagination_tags %} {% block title %}Builds{% endblock %} {% block content %} <div id="build_list"> <form action="" method="get"> {{ filter.form.as_p }} <input type="submit" value="Filter" /> </form> {% autopaginate filter 15 %} <!-- BEGIN builds list --> <div class="module"> <div class="module-wrapper"> <div class="module-header"> <h1>{% trans "Recent Builds" %}</h1> </div> <div class="module-list"> <div class="module-list-wrapper"> <ul> {% with filter as build_list %} {% include "core/build_list_detailed.html" %} {% endwith %} </ul> </div> </div> </div> </div> <!-- END builds list --> {% paginate %} </div> {% endblock %} {% block extra_scripts %} {{ block.super }} <script type="text/javascript" src="{{ MEDIA_URL }}javascript/build_updater.js"></script> <script type="text/javascript"> $(function() { {% for build in active_builds %} new BuildListUpdater({{ build.id }}).startPolling(); {% endfor %} }); </script> {% endblock %} ## Instruction: Remove filters on build list page for now. ## Code After: {% extends "projects/base_project_editing.html" %} {% load i18n %} {% load pagination_tags %} {% block title %}Builds{% endblock %} {% block content %} <div id="build_list"> {% comment %} <form action="" method="get"> {{ filter.form.as_p }} <input type="submit" value="Filter" /> </form> {% endcomment %} {% autopaginate build_list 15 %} <!-- BEGIN builds list --> <div class="module"> <div class="module-wrapper"> <div class="module-header"> <h1>{% trans "Recent Builds" %}</h1> </div> <div class="module-list"> <div class="module-list-wrapper"> <ul> {% include "core/build_list_detailed.html" %} </ul> </div> </div> </div> </div> <!-- END builds list --> {% paginate %} </div> {% endblock %} {% block extra_scripts %} {{ block.super }} <script type="text/javascript" src="{{ MEDIA_URL }}javascript/build_updater.js"></script> <script type="text/javascript"> $(function() { {% for build in active_builds %} new BuildListUpdater({{ build.id }}).startPolling(); {% endfor %} }); </script> {% endblock %}
{% extends "projects/base_project_editing.html" %} {% load i18n %} {% load pagination_tags %} {% block title %}Builds{% endblock %} {% block content %} <div id="build_list"> + {% comment %} <form action="" method="get"> {{ filter.form.as_p }} <input type="submit" value="Filter" /> </form> + {% endcomment %} - {% autopaginate filter 15 %} ? ^ -- + {% autopaginate build_list 15 %} ? ^^ +++++ <!-- BEGIN builds list --> <div class="module"> <div class="module-wrapper"> <div class="module-header"> <h1>{% trans "Recent Builds" %}</h1> </div> <div class="module-list"> <div class="module-list-wrapper"> <ul> - {% with filter as build_list %} {% include "core/build_list_detailed.html" %} - {% endwith %} </ul> </div> </div> </div> </div> <!-- END builds list --> {% paginate %} </div> {% endblock %} {% block extra_scripts %} {{ block.super }} <script type="text/javascript" src="{{ MEDIA_URL }}javascript/build_updater.js"></script> <script type="text/javascript"> $(function() { {% for build in active_builds %} new BuildListUpdater({{ build.id }}).startPolling(); {% endfor %} }); </script> {% endblock %}
6
0.103448
3
3
7cef87a81278c227db0cb07329d1b659dbd175b3
mail_factory/models.py
mail_factory/models.py
import django from django.conf import settings from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule def autodiscover(): """Auto-discover INSTALLED_APPS mails.py modules.""" for app in settings.INSTALLED_APPS: module = '%s.mails' % app # Attempt to import the app's 'mails' module try: import_module(module) except: # Decide whether to bubble up this error. If the app just # doesn't have a mails module, we can ignore the error # attempting to import it, otherwise we want it to bubble up. app_module = import_module(app) if module_has_submodule(app_module, 'mails'): raise # If we're using Django >= 1.7, use the new app-loading mecanism which is way # better. if django.VERSION < (1, 7): autodiscover()
import django from django.conf import settings from django.utils.module_loading import module_has_submodule try: from importlib import import_module except ImportError: # Compatibility for python-2.6 from django.utils.importlib import import_module def autodiscover(): """Auto-discover INSTALLED_APPS mails.py modules.""" for app in settings.INSTALLED_APPS: module = '%s.mails' % app # Attempt to import the app's 'mails' module try: import_module(module) except: # Decide whether to bubble up this error. If the app just # doesn't have a mails module, we can ignore the error # attempting to import it, otherwise we want it to bubble up. app_module = import_module(app) if module_has_submodule(app_module, 'mails'): raise # If we're using Django >= 1.7, use the new app-loading mecanism which is way # better. if django.VERSION < (1, 7): autodiscover()
Use standard library instead of django.utils.importlib
Use standard library instead of django.utils.importlib > django.utils.importlib is a compatibility library for when Python 2.6 was > still supported. It has been obsolete since Django 1.7, which dropped support > for Python 2.6, and is removed in 1.9 per the deprecation cycle. > Use Python's import_module function instead > — [1] References: [1] http://stackoverflow.com/a/32763639 [2] https://docs.djangoproject.com/en/1.9/internals/deprecation/#deprecation-removed-in-1-9
Python
bsd-3-clause
novafloss/django-mail-factory,novafloss/django-mail-factory
python
## Code Before: import django from django.conf import settings from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule def autodiscover(): """Auto-discover INSTALLED_APPS mails.py modules.""" for app in settings.INSTALLED_APPS: module = '%s.mails' % app # Attempt to import the app's 'mails' module try: import_module(module) except: # Decide whether to bubble up this error. If the app just # doesn't have a mails module, we can ignore the error # attempting to import it, otherwise we want it to bubble up. app_module = import_module(app) if module_has_submodule(app_module, 'mails'): raise # If we're using Django >= 1.7, use the new app-loading mecanism which is way # better. if django.VERSION < (1, 7): autodiscover() ## Instruction: Use standard library instead of django.utils.importlib > django.utils.importlib is a compatibility library for when Python 2.6 was > still supported. It has been obsolete since Django 1.7, which dropped support > for Python 2.6, and is removed in 1.9 per the deprecation cycle. > Use Python's import_module function instead > — [1] References: [1] http://stackoverflow.com/a/32763639 [2] https://docs.djangoproject.com/en/1.9/internals/deprecation/#deprecation-removed-in-1-9 ## Code After: import django from django.conf import settings from django.utils.module_loading import module_has_submodule try: from importlib import import_module except ImportError: # Compatibility for python-2.6 from django.utils.importlib import import_module def autodiscover(): """Auto-discover INSTALLED_APPS mails.py modules.""" for app in settings.INSTALLED_APPS: module = '%s.mails' % app # Attempt to import the app's 'mails' module try: import_module(module) except: # Decide whether to bubble up this error. If the app just # doesn't have a mails module, we can ignore the error # attempting to import it, otherwise we want it to bubble up. app_module = import_module(app) if module_has_submodule(app_module, 'mails'): raise # If we're using Django >= 1.7, use the new app-loading mecanism which is way # better. if django.VERSION < (1, 7): autodiscover()
import django from django.conf import settings - from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule + + try: + from importlib import import_module + except ImportError: + # Compatibility for python-2.6 + from django.utils.importlib import import_module def autodiscover(): """Auto-discover INSTALLED_APPS mails.py modules.""" for app in settings.INSTALLED_APPS: module = '%s.mails' % app # Attempt to import the app's 'mails' module try: import_module(module) except: # Decide whether to bubble up this error. If the app just # doesn't have a mails module, we can ignore the error # attempting to import it, otherwise we want it to bubble up. app_module = import_module(app) if module_has_submodule(app_module, 'mails'): raise # If we're using Django >= 1.7, use the new app-loading mecanism which is way # better. if django.VERSION < (1, 7): autodiscover()
7
0.259259
6
1
e6871000517791a4438fcd19fc3d1a36891b5a85
airtime_mvc/build/airtime-setup/forms/finish-settings.php
airtime_mvc/build/airtime-setup/forms/finish-settings.php
<?php ?> <form action="#" role="form" id="finishSettingsForm"> <h3 class="form-title">Setup Complete!</h3> <span id="helpBlock" class="help-block help-message"></span> <p> Looks like you're almost done! As a final step, run the following commands from the terminal: <br/><code>sudo service airtime-playout start</code> <br/><code>sudo service airtime-liquidsoap start</code> <br/><code>sudo service airtime-media-monitor start</code> </p> <p> Click "Done!" to bring up the Airtime configuration checklist; if your configuration is all green, you're ready to get started with your personal Airtime station! </p> <p> If you need to re-run the web installer, just remove <code>/etc/airtime/airtime.conf</code>. </p> <div> <input type="submit" formtarget="finishSettingsForm" class="btn btn-primary btn-next" value="Done!"/> </div> </form> <script> $("#finishSettingsForm").submit(function(e) { window.location.assign("/?config"); }); </script>
<?php ?> <form action="#" role="form" id="finishSettingsForm"> <h3 class="form-title">Setup Complete!</h3> <span id="helpBlock" class="help-block help-message"></span> <p> Looks like you're almost done! As a final step, run the following commands from the terminal: <br/><code>sudo service airtime-playout start</code> <br/><code>sudo service airtime-liquidsoap start</code> <br/><code>sudo service airtime-media-monitor start</code> </p> <p> Click "Done!" to bring up the Airtime configuration checklist; if your configuration is all green, you're ready to get started with your personal Airtime station! </p> <p> If you need to re-run the web installer, just remove <code>/etc/airtime/airtime.conf</code>. </p> <div> <input type="submit" formtarget="finishSettingsForm" class="btn btn-primary btn-next" value="Done!"/> </div> </form> <script> $("#finishSettingsForm").submit(function(e) { e.preventDefault(); window.location.assign("/?config"); }); </script>
Add preventDefault call to final setup page
Add preventDefault call to final setup page
PHP
agpl-3.0
Ryex/airtime,Ryex/airtime,Ryex/airtime,Ryex/airtime,Ryex/airtime,Ryex/airtime,Ryex/airtime
php
## Code Before: <?php ?> <form action="#" role="form" id="finishSettingsForm"> <h3 class="form-title">Setup Complete!</h3> <span id="helpBlock" class="help-block help-message"></span> <p> Looks like you're almost done! As a final step, run the following commands from the terminal: <br/><code>sudo service airtime-playout start</code> <br/><code>sudo service airtime-liquidsoap start</code> <br/><code>sudo service airtime-media-monitor start</code> </p> <p> Click "Done!" to bring up the Airtime configuration checklist; if your configuration is all green, you're ready to get started with your personal Airtime station! </p> <p> If you need to re-run the web installer, just remove <code>/etc/airtime/airtime.conf</code>. </p> <div> <input type="submit" formtarget="finishSettingsForm" class="btn btn-primary btn-next" value="Done!"/> </div> </form> <script> $("#finishSettingsForm").submit(function(e) { window.location.assign("/?config"); }); </script> ## Instruction: Add preventDefault call to final setup page ## Code After: <?php ?> <form action="#" role="form" id="finishSettingsForm"> <h3 class="form-title">Setup Complete!</h3> <span id="helpBlock" class="help-block help-message"></span> <p> Looks like you're almost done! As a final step, run the following commands from the terminal: <br/><code>sudo service airtime-playout start</code> <br/><code>sudo service airtime-liquidsoap start</code> <br/><code>sudo service airtime-media-monitor start</code> </p> <p> Click "Done!" to bring up the Airtime configuration checklist; if your configuration is all green, you're ready to get started with your personal Airtime station! </p> <p> If you need to re-run the web installer, just remove <code>/etc/airtime/airtime.conf</code>. </p> <div> <input type="submit" formtarget="finishSettingsForm" class="btn btn-primary btn-next" value="Done!"/> </div> </form> <script> $("#finishSettingsForm").submit(function(e) { e.preventDefault(); window.location.assign("/?config"); }); </script>
<?php ?> <form action="#" role="form" id="finishSettingsForm"> <h3 class="form-title">Setup Complete!</h3> <span id="helpBlock" class="help-block help-message"></span> <p> Looks like you're almost done! As a final step, run the following commands from the terminal: <br/><code>sudo service airtime-playout start</code> <br/><code>sudo service airtime-liquidsoap start</code> <br/><code>sudo service airtime-media-monitor start</code> </p> <p> Click "Done!" to bring up the Airtime configuration checklist; if your configuration is all green, you're ready to get started with your personal Airtime station! </p> <p> If you need to re-run the web installer, just remove <code>/etc/airtime/airtime.conf</code>. </p> <div> <input type="submit" formtarget="finishSettingsForm" class="btn btn-primary btn-next" value="Done!"/> </div> </form> <script> $("#finishSettingsForm").submit(function(e) { + e.preventDefault(); window.location.assign("/?config"); }); </script>
1
0.034483
1
0
20d67487dae2a38114898d3b55d312d521c17ef4
app/views/pay-foreign-marriage-certificates/index.html.erb
app/views/pay-foreign-marriage-certificates/index.html.erb
<%= render partial: "common/fco_dashboard", locals: { transaction_title: 'Payment for certificates to get married abroad', explanatory_copy: <<-HERE Service to pay the Foreign & Commonwealth Office (FCO) for documents you need to get married abroad. Figures on this page include only applications processed in the UK on GOV.UK. HERE } %>
<%= render partial: "common/fco_dashboard", locals: { transaction_title: 'Payment for certificates to get married abroad', explanatory_copy: <<-HERE Figures for applications processed on GOV.UK in the UK for the service to pay the Foreign & Commonwealth Office (FCO) for documents you need to get married abroad. HERE } %>
Update description for cert married abroad
Update description for cert married abroad
HTML+ERB
mit
gds-attic/limelight,gds-attic/limelight,gds-attic/limelight
html+erb
## Code Before: <%= render partial: "common/fco_dashboard", locals: { transaction_title: 'Payment for certificates to get married abroad', explanatory_copy: <<-HERE Service to pay the Foreign & Commonwealth Office (FCO) for documents you need to get married abroad. Figures on this page include only applications processed in the UK on GOV.UK. HERE } %> ## Instruction: Update description for cert married abroad ## Code After: <%= render partial: "common/fco_dashboard", locals: { transaction_title: 'Payment for certificates to get married abroad', explanatory_copy: <<-HERE Figures for applications processed on GOV.UK in the UK for the service to pay the Foreign & Commonwealth Office (FCO) for documents you need to get married abroad. HERE } %>
<%= render partial: "common/fco_dashboard", locals: { transaction_title: 'Payment for certificates to get married abroad', explanatory_copy: <<-HERE - Service to pay the Foreign & Commonwealth Office (FCO) for documents you need to get married abroad. ? ^ + Figures for applications processed on GOV.UK in the UK for the service to pay the Foreign & Commonwealth Office (FCO) for documents you need to get married abroad. ? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Figures on this page include only applications processed in the UK on GOV.UK. HERE } %>
3
0.428571
1
2
b8eb16ac78c081711236d73e5c099ed734f897ac
pyscriptic/refs.py
pyscriptic/refs.py
from pyscriptic.containers import CONTAINERS from pyscriptic.storage import STORAGE_LOCATIONS class Reference(object): """ Contains the information to either create or link a given container to a reference through a protocol via an intermediate name. Attributes ---------- container_id : str new : str store : dict of str, str discard bool Notes ----- .. [1] https://www.transcriptic.com/platform/#instr_access """ def __init__(self, container_id=None, new=None, store_where=None, discard=False): assert (container_id is not None) != (new is not None) assert (store_where is not None) != (discard) assert store_where in STORAGE_LOCATIONS.keys() or store_where is None assert new in CONTAINERS.keys() or new is None # XXX: Check container id? self.container_id = container_id self.new = new self.store = {"where": store_where} self.discard = discard
from pyscriptic.containers import CONTAINERS, list_containers from pyscriptic.storage import STORAGE_LOCATIONS _AVAILABLE_CONTAINERS_IDS = None def _available_container_ids(): """ This helper function fetchs a list of all containers available to the currently active organization. It then stores the container IDs so that we can compare against them later when creating new References. Returns ------- set of str """ global _AVAILABLE_CONTAINERS_IDS if _AVAILABLE_CONTAINERS_IDS is not None: return _AVAILABLE_CONTAINERS_IDS _AVAILABLE_CONTAINERS_IDS = set(i.container_id for i in list_containers()) class Reference(object): """ Contains the information to either create or link a given container to a reference through a protocol via an intermediate name. Attributes ---------- container_id : str new : str store : dict of str, str discard bool Notes ----- .. [1] https://www.transcriptic.com/platform/#instr_access """ def __init__(self, container_id=None, new=None, store_where=None, discard=False): assert (container_id is not None) != (new is not None) assert (store_where is not None) != (discard) assert store_where in STORAGE_LOCATIONS.keys() or store_where is None assert new in CONTAINERS.keys() or new is None if container_id is not None: assert container_id in _available_container_ids() self.container_id = container_id self.new = new self.store = {"where": store_where} self.discard = discard
Check container IDs when making new References
Check container IDs when making new References
Python
bsd-2-clause
naderm/pytranscriptic,naderm/pytranscriptic
python
## Code Before: from pyscriptic.containers import CONTAINERS from pyscriptic.storage import STORAGE_LOCATIONS class Reference(object): """ Contains the information to either create or link a given container to a reference through a protocol via an intermediate name. Attributes ---------- container_id : str new : str store : dict of str, str discard bool Notes ----- .. [1] https://www.transcriptic.com/platform/#instr_access """ def __init__(self, container_id=None, new=None, store_where=None, discard=False): assert (container_id is not None) != (new is not None) assert (store_where is not None) != (discard) assert store_where in STORAGE_LOCATIONS.keys() or store_where is None assert new in CONTAINERS.keys() or new is None # XXX: Check container id? self.container_id = container_id self.new = new self.store = {"where": store_where} self.discard = discard ## Instruction: Check container IDs when making new References ## Code After: from pyscriptic.containers import CONTAINERS, list_containers from pyscriptic.storage import STORAGE_LOCATIONS _AVAILABLE_CONTAINERS_IDS = None def _available_container_ids(): """ This helper function fetchs a list of all containers available to the currently active organization. It then stores the container IDs so that we can compare against them later when creating new References. Returns ------- set of str """ global _AVAILABLE_CONTAINERS_IDS if _AVAILABLE_CONTAINERS_IDS is not None: return _AVAILABLE_CONTAINERS_IDS _AVAILABLE_CONTAINERS_IDS = set(i.container_id for i in list_containers()) class Reference(object): """ Contains the information to either create or link a given container to a reference through a protocol via an intermediate name. Attributes ---------- container_id : str new : str store : dict of str, str discard bool Notes ----- .. [1] https://www.transcriptic.com/platform/#instr_access """ def __init__(self, container_id=None, new=None, store_where=None, discard=False): assert (container_id is not None) != (new is not None) assert (store_where is not None) != (discard) assert store_where in STORAGE_LOCATIONS.keys() or store_where is None assert new in CONTAINERS.keys() or new is None if container_id is not None: assert container_id in _available_container_ids() self.container_id = container_id self.new = new self.store = {"where": store_where} self.discard = discard
- from pyscriptic.containers import CONTAINERS + from pyscriptic.containers import CONTAINERS, list_containers ? +++++++++++++++++ from pyscriptic.storage import STORAGE_LOCATIONS + + _AVAILABLE_CONTAINERS_IDS = None + + def _available_container_ids(): + """ + This helper function fetchs a list of all containers available to the + currently active organization. It then stores the container IDs so that we + can compare against them later when creating new References. + + Returns + ------- + set of str + """ + + global _AVAILABLE_CONTAINERS_IDS + + if _AVAILABLE_CONTAINERS_IDS is not None: + return _AVAILABLE_CONTAINERS_IDS + + _AVAILABLE_CONTAINERS_IDS = set(i.container_id for i in list_containers()) class Reference(object): """ Contains the information to either create or link a given container to a reference through a protocol via an intermediate name. Attributes ---------- container_id : str new : str store : dict of str, str discard bool Notes ----- .. [1] https://www.transcriptic.com/platform/#instr_access """ def __init__(self, container_id=None, new=None, store_where=None, discard=False): assert (container_id is not None) != (new is not None) assert (store_where is not None) != (discard) assert store_where in STORAGE_LOCATIONS.keys() or store_where is None assert new in CONTAINERS.keys() or new is None - # XXX: Check container id? + if container_id is not None: + assert container_id in _available_container_ids() + self.container_id = container_id self.new = new self.store = {"where": store_where} self.discard = discard
26
0.8125
24
2
a174b827b36293d90babfcdf557bdbb9c9d0b655
ibei/__init__.py
ibei/__init__.py
from main import uibei, SQSolarcell, DeVosSolarcell
from main import uibei, SQSolarcell, DeVosSolarcell __version__ = "0.0.2"
Add version information in module
Add version information in module
Python
mit
jrsmith3/tec,jrsmith3/ibei,jrsmith3/tec
python
## Code Before: from main import uibei, SQSolarcell, DeVosSolarcell ## Instruction: Add version information in module ## Code After: from main import uibei, SQSolarcell, DeVosSolarcell __version__ = "0.0.2"
from main import uibei, SQSolarcell, DeVosSolarcell + + __version__ = "0.0.2"
2
1
2
0
0d37b8b083c0aff5ffd16502b096f6603fbb3f8e
.travis.yml
.travis.yml
sudo: required language: node_js node_js: - "4" services: - docker install: - mkdir -p .build/lambda/libraries - ./build-lambda-package.sh script: - ./run-integration-tests.sh
sudo: required language: node_js node_js: - "4" services: - docker # mkdir required here to avoid permission problem in script install: - mkdir -p .build/lambda/libraries - ./build-lambda-package.sh script: - ./run-integration-tests.sh
Add comment why mkdir is necessary
Add comment why mkdir is necessary
YAML
mit
choefele/swift-lambda-app,choefele/swift-lambda-app,choefele/swift-lambda-app
yaml
## Code Before: sudo: required language: node_js node_js: - "4" services: - docker install: - mkdir -p .build/lambda/libraries - ./build-lambda-package.sh script: - ./run-integration-tests.sh ## Instruction: Add comment why mkdir is necessary ## Code After: sudo: required language: node_js node_js: - "4" services: - docker # mkdir required here to avoid permission problem in script install: - mkdir -p .build/lambda/libraries - ./build-lambda-package.sh script: - ./run-integration-tests.sh
sudo: required language: node_js node_js: - "4" services: - docker + # mkdir required here to avoid permission problem in script install: - mkdir -p .build/lambda/libraries - ./build-lambda-package.sh script: - ./run-integration-tests.sh
1
0.071429
1
0
acc3768f7b3f7753698b08950cb65f55244e1dde
lib/travis/api/v3/models/log.rb
lib/travis/api/v3/models/log.rb
require 'forwardable' module Travis::API::V3::Models class Log extend Forwardable def_delegators :remote_log, :id, :attributes, :archived? attr_accessor :remote_log, :archived_content, :job def initialize(remote_log: nil, archived_content: nil, job: nil) @remote_log = remote_log @archived_content = archived_content @job = job end def content archived_content || remote_log.content end def log_parts return remote_log.log_parts if archived_content.nil? [archived_log_part] end def repository_private? job.repository.private? end private def archived_log_part { content: archived_content, final: true, number: 0 } end end end
require 'forwardable' module Travis::API::V3::Models class Log extend Forwardable def_delegators :remote_log, :id, :attributes, :archived? attr_accessor :remote_log, :archived_content, :job def initialize(remote_log: nil, archived_content: nil, job: nil) @remote_log = remote_log @archived_content = archived_content @job = job end def content archived_content || remote_log.content end def log_parts return remote_log.log_parts if archived_content.nil? [archived_log_part] end def repository_private? job.repository.private? unless job.nil? end private def archived_log_part { content: archived_content, final: true, number: 0 } end end end
Check if there's an existing job
Check if there's an existing job
Ruby
mit
travis-ci/travis-api,travis-ci/travis-api,travis-ci/travis-api
ruby
## Code Before: require 'forwardable' module Travis::API::V3::Models class Log extend Forwardable def_delegators :remote_log, :id, :attributes, :archived? attr_accessor :remote_log, :archived_content, :job def initialize(remote_log: nil, archived_content: nil, job: nil) @remote_log = remote_log @archived_content = archived_content @job = job end def content archived_content || remote_log.content end def log_parts return remote_log.log_parts if archived_content.nil? [archived_log_part] end def repository_private? job.repository.private? end private def archived_log_part { content: archived_content, final: true, number: 0 } end end end ## Instruction: Check if there's an existing job ## Code After: require 'forwardable' module Travis::API::V3::Models class Log extend Forwardable def_delegators :remote_log, :id, :attributes, :archived? attr_accessor :remote_log, :archived_content, :job def initialize(remote_log: nil, archived_content: nil, job: nil) @remote_log = remote_log @archived_content = archived_content @job = job end def content archived_content || remote_log.content end def log_parts return remote_log.log_parts if archived_content.nil? [archived_log_part] end def repository_private? job.repository.private? unless job.nil? end private def archived_log_part { content: archived_content, final: true, number: 0 } end end end
require 'forwardable' module Travis::API::V3::Models class Log extend Forwardable def_delegators :remote_log, :id, :attributes, :archived? attr_accessor :remote_log, :archived_content, :job def initialize(remote_log: nil, archived_content: nil, job: nil) @remote_log = remote_log @archived_content = archived_content @job = job end def content archived_content || remote_log.content end def log_parts return remote_log.log_parts if archived_content.nil? [archived_log_part] end def repository_private? - job.repository.private? + job.repository.private? unless job.nil? ? ++++++++++++++++ end private def archived_log_part { content: archived_content, final: true, number: 0 } end end end
2
0.05
1
1
78ef227e3f30a901785509a5d3dfeae602884af7
features/step_definitions/debug_steps.rb
features/step_definitions/debug_steps.rb
When /^I binding.pry$/ do binding.pry end When /^I save the page$/ do # Saves HTML to tmp/capybara. save_page end When /^I (save|take) a screenshot$/ do |_| # Saves png to tmp/capybara. path = Rails.root.join("tmp/capybara/#{SecureRandom.hex(8)}#{page.current_path.gsub('/', '-')}.png") FileUtils.mkdir_p(File.dirname(path)) page.save_screenshot(path) puts("screenshot saved to #{path}") end
When /^I binding.pry$/ do binding.pry end When /^I save the page$/ do # Saves HTML to tmp/capybara. save_page end When /^I (save|take) a screenshot$/ do |_| # Saves png to tmp/capybara. path = Rails.root.join("tmp/capybara/#{SecureRandom.hex(8)}#{page.current_path.gsub('/', '-')}.png") FileUtils.mkdir_p(File.dirname(path)) page.save_screenshot(path) puts("screenshot saved to #{path}") end When(/^I wait (.*?) seconds$/) do |seconds| sleep(seconds.to_i) end
Add a wait debug step to cucumber
Add a wait debug step to cucumber I sometimes find this useful to rule out timing issues
Ruby
agpl-3.0
EFForg/action-center-platform,EFForg/action-center-platform,EFForg/action-center-platform,EFForg/action-center-platform
ruby
## Code Before: When /^I binding.pry$/ do binding.pry end When /^I save the page$/ do # Saves HTML to tmp/capybara. save_page end When /^I (save|take) a screenshot$/ do |_| # Saves png to tmp/capybara. path = Rails.root.join("tmp/capybara/#{SecureRandom.hex(8)}#{page.current_path.gsub('/', '-')}.png") FileUtils.mkdir_p(File.dirname(path)) page.save_screenshot(path) puts("screenshot saved to #{path}") end ## Instruction: Add a wait debug step to cucumber I sometimes find this useful to rule out timing issues ## Code After: When /^I binding.pry$/ do binding.pry end When /^I save the page$/ do # Saves HTML to tmp/capybara. save_page end When /^I (save|take) a screenshot$/ do |_| # Saves png to tmp/capybara. path = Rails.root.join("tmp/capybara/#{SecureRandom.hex(8)}#{page.current_path.gsub('/', '-')}.png") FileUtils.mkdir_p(File.dirname(path)) page.save_screenshot(path) puts("screenshot saved to #{path}") end When(/^I wait (.*?) seconds$/) do |seconds| sleep(seconds.to_i) end
When /^I binding.pry$/ do binding.pry end When /^I save the page$/ do # Saves HTML to tmp/capybara. save_page end When /^I (save|take) a screenshot$/ do |_| # Saves png to tmp/capybara. path = Rails.root.join("tmp/capybara/#{SecureRandom.hex(8)}#{page.current_path.gsub('/', '-')}.png") FileUtils.mkdir_p(File.dirname(path)) page.save_screenshot(path) puts("screenshot saved to #{path}") end + + When(/^I wait (.*?) seconds$/) do |seconds| + sleep(seconds.to_i) + end
4
0.235294
4
0
93623d3bc8336073b65f586e2d1573831c492084
iatidataquality/__init__.py
iatidataquality/__init__.py
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__.split('.')[0]) app.config.from_pyfile('../config.py') db = SQLAlchemy(app) import api import routes import publishers import publisher_conditions import tests import organisations import organisations_feedback import registry import packages import indicators import aggregationtypes
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__.split('.')[0]) app.config.from_pyfile('../config.py') db = SQLAlchemy(app) import api import routes import publishers import publisher_conditions import tests import organisations import organisations_feedback import registry import packages import indicators import aggregationtypes import survey
Add survey controller to routes
Add survey controller to routes
Python
agpl-3.0
pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality
python
## Code Before: from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__.split('.')[0]) app.config.from_pyfile('../config.py') db = SQLAlchemy(app) import api import routes import publishers import publisher_conditions import tests import organisations import organisations_feedback import registry import packages import indicators import aggregationtypes ## Instruction: Add survey controller to routes ## Code After: from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__.split('.')[0]) app.config.from_pyfile('../config.py') db = SQLAlchemy(app) import api import routes import publishers import publisher_conditions import tests import organisations import organisations_feedback import registry import packages import indicators import aggregationtypes import survey
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__.split('.')[0]) app.config.from_pyfile('../config.py') db = SQLAlchemy(app) import api import routes import publishers import publisher_conditions import tests import organisations import organisations_feedback import registry import packages import indicators import aggregationtypes + import survey
1
0.052632
1
0
d3c77b738a6e1289f552667c58ffc85b80986694
config/routes.rb
config/routes.rb
Rails.application.routes.draw do namespace :https, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :smtp, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :xmpp, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :tls, id: /[^\/]+/ do get '/', action: :index get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :ssh, id: /[^\/]+/ do get '/', action: :index get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end get 'help' => 'site#help' get 'about' => 'site#about' get 'ciphers' => 'site#ciphers' get 'suite' => 'site#suite_index' get 'suite/:id' => 'site#suite' post 'suite' => 'site#suite' root 'site#index' post '/' => 'site#check' get 'sites' => 'site#sites' end
Rails.application.routes.draw do namespace :https, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :smtp, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :xmpp, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :tls, id: /[^\/]+/ do get '/', action: :index get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :ssh, id: /[^\/]+/ do get '/', action: :index get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end get 'help' => 'site#help' get 'about' => 'site#about' get 'ciphers' => 'site#ciphers' get 'suite' => 'site#suite_index' get 'suite/:id' => 'site#suite' post 'suite' => 'site#suite' root 'site#index' post '/' => 'site#check' get 'sites' => 'site#sites' if Rails.env.development? require 'sidekiq/web' mount Sidekiq::Web => '/sidekiq' end end
Enable Sidekiq UI on development
Enable Sidekiq UI on development
Ruby
agpl-3.0
aeris/cryptcheck-rails,aeris/cryptcheck-rails,aeris/cryptcheck-rails,aeris/cryptcheck-rails
ruby
## Code Before: Rails.application.routes.draw do namespace :https, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :smtp, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :xmpp, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :tls, id: /[^\/]+/ do get '/', action: :index get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :ssh, id: /[^\/]+/ do get '/', action: :index get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end get 'help' => 'site#help' get 'about' => 'site#about' get 'ciphers' => 'site#ciphers' get 'suite' => 'site#suite_index' get 'suite/:id' => 'site#suite' post 'suite' => 'site#suite' root 'site#index' post '/' => 'site#check' get 'sites' => 'site#sites' end ## Instruction: Enable Sidekiq UI on development ## Code After: Rails.application.routes.draw do namespace :https, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :smtp, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :xmpp, id: /[^\/]+/ do get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :tls, id: /[^\/]+/ do get '/', action: :index get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end namespace :ssh, id: /[^\/]+/ do get '/', action: :index get ':id/', action: :show get ':id/refresh', action: :refresh, as: :refresh end get 'help' => 'site#help' get 'about' => 'site#about' get 'ciphers' => 'site#ciphers' get 'suite' => 'site#suite_index' get 'suite/:id' => 'site#suite' post 'suite' => 'site#suite' root 'site#index' post '/' => 'site#check' get 'sites' => 'site#sites' if Rails.env.development? require 'sidekiq/web' mount Sidekiq::Web => '/sidekiq' end end
Rails.application.routes.draw do - namespace :https, id: /[^\/]+/ do ? ^ + namespace :https, id: /[^\/]+/ do ? ^^ - get ':id/', action: :show ? ^^ + get ':id/', action: :show ? ^^^^ - get ':id/refresh', action: :refresh, as: :refresh ? ^^ + get ':id/refresh', action: :refresh, as: :refresh ? ^^^^ - end + end - namespace :smtp, id: /[^\/]+/ do ? ^ + namespace :smtp, id: /[^\/]+/ do ? ^^ - get ':id/', action: :show ? ^^ + get ':id/', action: :show ? ^^^^ - get ':id/refresh', action: :refresh, as: :refresh ? ^^ + get ':id/refresh', action: :refresh, as: :refresh ? ^^^^ - end + end - namespace :xmpp, id: /[^\/]+/ do ? ^ + namespace :xmpp, id: /[^\/]+/ do ? ^^ - get ':id/', action: :show ? ^^ + get ':id/', action: :show ? ^^^^ - get ':id/refresh', action: :refresh, as: :refresh ? ^^ + get ':id/refresh', action: :refresh, as: :refresh ? ^^^^ - end + end - namespace :tls, id: /[^\/]+/ do ? ^ + namespace :tls, id: /[^\/]+/ do ? ^^ - get '/', action: :index ? ^^ + get '/', action: :index ? ^^^^ - get ':id/', action: :show ? ^^ + get ':id/', action: :show ? ^^^^ - get ':id/refresh', action: :refresh, as: :refresh ? ^^ + get ':id/refresh', action: :refresh, as: :refresh ? ^^^^ - end + end - namespace :ssh, id: /[^\/]+/ do ? ^ + namespace :ssh, id: /[^\/]+/ do ? ^^ - get '/', action: :index ? ^^ + get '/', action: :index ? ^^^^ - get ':id/', action: :show ? ^^ + get ':id/', action: :show ? ^^^^ - get ':id/refresh', action: :refresh, as: :refresh ? ^^ + get ':id/refresh', action: :refresh, as: :refresh ? ^^^^ - end + end - get 'help' => 'site#help' ? ^ + get 'help' => 'site#help' ? ^^ - get 'about' => 'site#about' ? ^ + get 'about' => 'site#about' ? ^^ - get 'ciphers' => 'site#ciphers' ? ^ + get 'ciphers' => 'site#ciphers' ? ^^ - get 'suite' => 'site#suite_index' ? ^ + get 'suite' => 'site#suite_index' ? ^^ - get 'suite/:id' => 'site#suite' ? ^ + get 'suite/:id' => 'site#suite' ? ^^ - post 'suite' => 'site#suite' ? ^ + post 'suite' => 'site#suite' ? ^^ - root 'site#index' ? ^ + root 'site#index' ? ^^ - post '/' => 'site#check' ? ^ + post '/' => 'site#check' ? ^^ - get 'sites' => 'site#sites' ? ^ + get 'sites' => 'site#sites' ? ^^ + + if Rails.env.development? + require 'sidekiq/web' + mount Sidekiq::Web => '/sidekiq' + end end
67
1.717949
36
31
1a4abf1d8ebcf6e207d958c4c81a4fd41bf0e7ad
bokehjs/src/coffee/models/transforms/jitter.coffee
bokehjs/src/coffee/models/transforms/jitter.coffee
_ = require "underscore" Transform = require "./transform" p = require "../../core/properties" math = require "../../core/util/math" class Jitter extends Transform.Model initialize: (attrs, options) -> super(attrs, options) @define { mean: [ p.Number, 0 ] width: [ p.Number, 1 ] distribution: [ p.String, 'uniform'] } compute: (x) -> # Apply the transform to a single value if @get('distribution') == 'uniform' return(x + @get('mean') + ((Math.random() - 0.5) * @get('width'))) if @get('distribution') == 'normal' return(x + math.rnorm(@get('mean'), @get('width'))) v_compute: (xs) -> # Apply the tranform to a vector of values result = new Float64Array(xs.length) for x, idx in xs result[idx] = this.compute(x) return result module.exports = Model: Jitter
_ = require "underscore" Transform = require "./transform" p = require "../../core/properties" bokeh_math = require "../../core/util/math" class Jitter extends Transform.Model initialize: (attrs, options) -> super(attrs, options) @define { mean: [ p.Number, 0 ] width: [ p.Number, 1 ] distribution: [ p.String, 'uniform'] } compute: (x) -> # Apply the transform to a single value if @get('distribution') == 'uniform' return(x + @get('mean') + ((Math.random() - 0.5) * @get('width'))) if @get('distribution') == 'normal' return(x + bokeh_math.rnorm(@get('mean'), @get('width'))) v_compute: (xs) -> # Apply the tranform to a vector of values result = new Float64Array(xs.length) for x, idx in xs result[idx] = this.compute(x) return result module.exports = Model: Jitter
Change imported name from "math" to "bokeh_math" to make it more obvious this is not related to the core JS "Math" facility.
Change imported name from "math" to "bokeh_math" to make it more obvious this is not related to the core JS "Math" facility.
CoffeeScript
bsd-3-clause
DuCorey/bokeh,ptitjano/bokeh,rs2/bokeh,aavanian/bokeh,DuCorey/bokeh,percyfal/bokeh,percyfal/bokeh,ericmjl/bokeh,mindriot101/bokeh,rs2/bokeh,Karel-van-de-Plassche/bokeh,azjps/bokeh,ptitjano/bokeh,timsnyder/bokeh,DuCorey/bokeh,rs2/bokeh,bokeh/bokeh,quasiben/bokeh,phobson/bokeh,aiguofer/bokeh,philippjfr/bokeh,justacec/bokeh,dennisobrien/bokeh,draperjames/bokeh,Karel-van-de-Plassche/bokeh,philippjfr/bokeh,justacec/bokeh,timsnyder/bokeh,schoolie/bokeh,draperjames/bokeh,phobson/bokeh,azjps/bokeh,jakirkham/bokeh,jakirkham/bokeh,mindriot101/bokeh,aavanian/bokeh,percyfal/bokeh,stonebig/bokeh,quasiben/bokeh,dennisobrien/bokeh,ericmjl/bokeh,ericmjl/bokeh,draperjames/bokeh,dennisobrien/bokeh,bokeh/bokeh,clairetang6/bokeh,quasiben/bokeh,DuCorey/bokeh,clairetang6/bokeh,rs2/bokeh,bokeh/bokeh,draperjames/bokeh,jakirkham/bokeh,azjps/bokeh,aiguofer/bokeh,schoolie/bokeh,justacec/bokeh,stonebig/bokeh,azjps/bokeh,clairetang6/bokeh,aiguofer/bokeh,bokeh/bokeh,schoolie/bokeh,mindriot101/bokeh,justacec/bokeh,aiguofer/bokeh,mindriot101/bokeh,jakirkham/bokeh,jakirkham/bokeh,timsnyder/bokeh,azjps/bokeh,ptitjano/bokeh,rs2/bokeh,dennisobrien/bokeh,ericmjl/bokeh,DuCorey/bokeh,aiguofer/bokeh,clairetang6/bokeh,aavanian/bokeh,philippjfr/bokeh,schoolie/bokeh,Karel-van-de-Plassche/bokeh,ptitjano/bokeh,Karel-van-de-Plassche/bokeh,percyfal/bokeh,philippjfr/bokeh,phobson/bokeh,bokeh/bokeh,aavanian/bokeh,phobson/bokeh,timsnyder/bokeh,aavanian/bokeh,phobson/bokeh,stonebig/bokeh,ericmjl/bokeh,philippjfr/bokeh,Karel-van-de-Plassche/bokeh,draperjames/bokeh,schoolie/bokeh,dennisobrien/bokeh,percyfal/bokeh,timsnyder/bokeh,ptitjano/bokeh,stonebig/bokeh
coffeescript
## Code Before: _ = require "underscore" Transform = require "./transform" p = require "../../core/properties" math = require "../../core/util/math" class Jitter extends Transform.Model initialize: (attrs, options) -> super(attrs, options) @define { mean: [ p.Number, 0 ] width: [ p.Number, 1 ] distribution: [ p.String, 'uniform'] } compute: (x) -> # Apply the transform to a single value if @get('distribution') == 'uniform' return(x + @get('mean') + ((Math.random() - 0.5) * @get('width'))) if @get('distribution') == 'normal' return(x + math.rnorm(@get('mean'), @get('width'))) v_compute: (xs) -> # Apply the tranform to a vector of values result = new Float64Array(xs.length) for x, idx in xs result[idx] = this.compute(x) return result module.exports = Model: Jitter ## Instruction: Change imported name from "math" to "bokeh_math" to make it more obvious this is not related to the core JS "Math" facility. ## Code After: _ = require "underscore" Transform = require "./transform" p = require "../../core/properties" bokeh_math = require "../../core/util/math" class Jitter extends Transform.Model initialize: (attrs, options) -> super(attrs, options) @define { mean: [ p.Number, 0 ] width: [ p.Number, 1 ] distribution: [ p.String, 'uniform'] } compute: (x) -> # Apply the transform to a single value if @get('distribution') == 'uniform' return(x + @get('mean') + ((Math.random() - 0.5) * @get('width'))) if @get('distribution') == 'normal' return(x + bokeh_math.rnorm(@get('mean'), @get('width'))) v_compute: (xs) -> # Apply the tranform to a vector of values result = new Float64Array(xs.length) for x, idx in xs result[idx] = this.compute(x) return result module.exports = Model: Jitter
_ = require "underscore" Transform = require "./transform" p = require "../../core/properties" - math = require "../../core/util/math" + bokeh_math = require "../../core/util/math" ? ++++++ class Jitter extends Transform.Model initialize: (attrs, options) -> super(attrs, options) @define { mean: [ p.Number, 0 ] width: [ p.Number, 1 ] distribution: [ p.String, 'uniform'] } compute: (x) -> # Apply the transform to a single value if @get('distribution') == 'uniform' return(x + @get('mean') + ((Math.random() - 0.5) * @get('width'))) if @get('distribution') == 'normal' - return(x + math.rnorm(@get('mean'), @get('width'))) + return(x + bokeh_math.rnorm(@get('mean'), @get('width'))) ? ++++++ v_compute: (xs) -> # Apply the tranform to a vector of values result = new Float64Array(xs.length) for x, idx in xs result[idx] = this.compute(x) return result module.exports = Model: Jitter
4
0.125
2
2
9b1d794d677cb809294c5eb4beac238920f734aa
_posts/2013-10-23-adopt-open-source-process-constraints.markdown
_posts/2013-10-23-adopt-open-source-process-constraints.markdown
--- layout: post title: "Your team should work like an open source project" date: 2013-10-23 time: 23:16:16 -0400 external-url: http://tomayko.com/writings/adopt-an-open-source-process-constraints --- Ryan Tomayko is a genius. He was employee #8 at GitHub and has been crucial (as one of the early employees) in molding the work environment at GitHub. In this post, he describes the way GitHub works &mdash; and the way he thinks your team should work. Ideally, your team will work as an open-source project: async, no managers, etc. I won't spoil it for you &mdash; go take a look.
--- layout: post title: "Your team should work like an open source project" date: 2013-10-23 time: 23:16:16 -0400 external-url: http://tomayko.com/writings/adopt-an-open-source-process-constraints --- Ryan Tomayko is a genius. He was employee #8 at GitHub and has been crucial (as one of the early employees) in molding the work environment at GitHub. In this post, he describes the way GitHub works &mdash; and the way he thinks your team should work. Ideally, your team will work as an open-source project: async, no managers, etc. I won't spoil it for you &mdash; go take a look. Favourite quotes: > I like to call it "learning by lurking." ... So people [e.g. new hires] > are able to learn all kinds of new things just by essentially sitting in > a chat room... And > Anything that you do has to be available to everyone in a way that is > asynchronous. ... This is really powerful. It means we can have people in > Australia that are just as in tune with what's going on in the company as > people [in the main office]. So we try to build [asynchronous tooling] > into every part of the GitHub process. ... Everything should have a URL. And > Be lock free. Don't require people to synchronize on a single resource in > order for people to get work done. Try to automate things to make sure > that people can act independently or with as little friction as possible. Speaking on company hiring: > A lot of companies are using open source to find people that they like > [and want to hire], but they're really not offering them this kind of > work environment where they excel. [i.e. in open source workflow]
Add quotes to rtomayko post.
Add quotes to rtomayko post.
Markdown
mit
parkr/stuff,parkr/stuff,parkr/stuff,parkr/stuff,parkr/stuff,parkr/stuff
markdown
## Code Before: --- layout: post title: "Your team should work like an open source project" date: 2013-10-23 time: 23:16:16 -0400 external-url: http://tomayko.com/writings/adopt-an-open-source-process-constraints --- Ryan Tomayko is a genius. He was employee #8 at GitHub and has been crucial (as one of the early employees) in molding the work environment at GitHub. In this post, he describes the way GitHub works &mdash; and the way he thinks your team should work. Ideally, your team will work as an open-source project: async, no managers, etc. I won't spoil it for you &mdash; go take a look. ## Instruction: Add quotes to rtomayko post. ## Code After: --- layout: post title: "Your team should work like an open source project" date: 2013-10-23 time: 23:16:16 -0400 external-url: http://tomayko.com/writings/adopt-an-open-source-process-constraints --- Ryan Tomayko is a genius. He was employee #8 at GitHub and has been crucial (as one of the early employees) in molding the work environment at GitHub. In this post, he describes the way GitHub works &mdash; and the way he thinks your team should work. Ideally, your team will work as an open-source project: async, no managers, etc. I won't spoil it for you &mdash; go take a look. Favourite quotes: > I like to call it "learning by lurking." ... So people [e.g. new hires] > are able to learn all kinds of new things just by essentially sitting in > a chat room... And > Anything that you do has to be available to everyone in a way that is > asynchronous. ... This is really powerful. It means we can have people in > Australia that are just as in tune with what's going on in the company as > people [in the main office]. So we try to build [asynchronous tooling] > into every part of the GitHub process. ... Everything should have a URL. And > Be lock free. Don't require people to synchronize on a single resource in > order for people to get work done. Try to automate things to make sure > that people can act independently or with as little friction as possible. Speaking on company hiring: > A lot of companies are using open source to find people that they like > [and want to hire], but they're really not offering them this kind of > work environment where they excel. [i.e. in open source workflow]
--- layout: post title: "Your team should work like an open source project" date: 2013-10-23 time: 23:16:16 -0400 external-url: http://tomayko.com/writings/adopt-an-open-source-process-constraints --- Ryan Tomayko is a genius. He was employee #8 at GitHub and has been crucial (as one of the early employees) in molding the work environment at GitHub. In this post, he describes the way GitHub works &mdash; and the way he thinks your team should work. Ideally, your team will work as an open-source project: async, no managers, etc. I won't spoil it for you &mdash; go take a look. + + Favourite quotes: + + > I like to call it "learning by lurking." ... So people [e.g. new hires] + > are able to learn all kinds of new things just by essentially sitting in + > a chat room... + + And + + > Anything that you do has to be available to everyone in a way that is + > asynchronous. ... This is really powerful. It means we can have people in + > Australia that are just as in tune with what's going on in the company as + > people [in the main office]. So we try to build [asynchronous tooling] + > into every part of the GitHub process. ... Everything should have a URL. + + And + + > Be lock free. Don't require people to synchronize on a single resource in + > order for people to get work done. Try to automate things to make sure + > that people can act independently or with as little friction as possible. + + Speaking on company hiring: + + > A lot of companies are using open source to find people that they like + > [and want to hire], but they're really not offering them this kind of + > work environment where they excel. [i.e. in open source workflow]
26
2
26
0
8e59011159004d5b6d3e58552c4cd7d53c67ceb3
app/models/translated_sentence.rb
app/models/translated_sentence.rb
class TranslatedSentence < ActiveRecord::Base belongs_to :ontology belongs_to :audience, class_name: Ontology.to_s belongs_to :sentence belongs_to :symbol_mapping has_one :locid, through: :sentence delegate :name, to: :sentence attr_accessible :audience, :ontology, :sentence, :symbol_mapping attr_accessible :translated_text def text translated_text end def display_text? false end # returns a translated sentence if # an applicable one could be found def self.choose_applicable(sentence, mapping) source = mapping.mapping.source where(audience_id: source, sentence_id: sentence).first || sentence end end
class TranslatedSentence < ActiveRecord::Base belongs_to :ontology belongs_to :audience, class_name: Ontology.to_s belongs_to :sentence belongs_to :symbol_mapping delegate :name, to: :sentence delegate :locid, to: :sentence attr_accessible :audience, :ontology, :sentence, :symbol_mapping attr_accessible :translated_text def text translated_text end def display_text? false end # returns a translated sentence if # an applicable one could be found def self.choose_applicable(sentence, mapping) source = mapping.mapping.source where(audience_id: source, sentence_id: sentence).first || sentence end end
Change has_one locid to delegate
Change has_one locid to delegate
Ruby
agpl-3.0
ontohub/ontohub,ontohub/ontohub,ontohub/ontohub,ontohub/ontohub,ontohub/ontohub,ontohub/ontohub
ruby
## Code Before: class TranslatedSentence < ActiveRecord::Base belongs_to :ontology belongs_to :audience, class_name: Ontology.to_s belongs_to :sentence belongs_to :symbol_mapping has_one :locid, through: :sentence delegate :name, to: :sentence attr_accessible :audience, :ontology, :sentence, :symbol_mapping attr_accessible :translated_text def text translated_text end def display_text? false end # returns a translated sentence if # an applicable one could be found def self.choose_applicable(sentence, mapping) source = mapping.mapping.source where(audience_id: source, sentence_id: sentence).first || sentence end end ## Instruction: Change has_one locid to delegate ## Code After: class TranslatedSentence < ActiveRecord::Base belongs_to :ontology belongs_to :audience, class_name: Ontology.to_s belongs_to :sentence belongs_to :symbol_mapping delegate :name, to: :sentence delegate :locid, to: :sentence attr_accessible :audience, :ontology, :sentence, :symbol_mapping attr_accessible :translated_text def text translated_text end def display_text? false end # returns a translated sentence if # an applicable one could be found def self.choose_applicable(sentence, mapping) source = mapping.mapping.source where(audience_id: source, sentence_id: sentence).first || sentence end end
class TranslatedSentence < ActiveRecord::Base belongs_to :ontology belongs_to :audience, class_name: Ontology.to_s belongs_to :sentence belongs_to :symbol_mapping - has_one :locid, through: :sentence delegate :name, to: :sentence + delegate :locid, to: :sentence attr_accessible :audience, :ontology, :sentence, :symbol_mapping attr_accessible :translated_text def text translated_text end def display_text? false end # returns a translated sentence if # an applicable one could be found def self.choose_applicable(sentence, mapping) source = mapping.mapping.source where(audience_id: source, sentence_id: sentence).first || sentence end end
2
0.074074
1
1
25ca9dcad76d5c4328c18dffe7f744cd2a2e531b
.travis.yml
.travis.yml
language: ruby dist: trusty sudo: false cache: bundler rvm: - 2.2.7 - 2.3.4 - 2.4.1 branches: only: - master before_install: - gem install bundler before_script: 'bundle exec rake alchemy:spec:prepare' script: 'bundle exec rspec' env: - DB=mysql - DB=postgresql
language: ruby dist: trusty sudo: false cache: bundler rvm: - 2.2.7 - 2.3.4 - 2.4.1 branches: only: - master before_install: - gem install bundler before_script: bundle exec rake alchemy:spec:prepare script: bundle exec rspec after_success: bundle exec codeclimate-test-reporter env: - DB=mysql - DB=postgresql
Send code coverage results after successful build
Send code coverage results after successful build
YAML
bsd-3-clause
AlchemyCMS/alchemy-devise,AlchemyCMS/alchemy-devise,AlchemyCMS/alchemy-devise
yaml
## Code Before: language: ruby dist: trusty sudo: false cache: bundler rvm: - 2.2.7 - 2.3.4 - 2.4.1 branches: only: - master before_install: - gem install bundler before_script: 'bundle exec rake alchemy:spec:prepare' script: 'bundle exec rspec' env: - DB=mysql - DB=postgresql ## Instruction: Send code coverage results after successful build ## Code After: language: ruby dist: trusty sudo: false cache: bundler rvm: - 2.2.7 - 2.3.4 - 2.4.1 branches: only: - master before_install: - gem install bundler before_script: bundle exec rake alchemy:spec:prepare script: bundle exec rspec after_success: bundle exec codeclimate-test-reporter env: - DB=mysql - DB=postgresql
language: ruby dist: trusty sudo: false cache: bundler rvm: - 2.2.7 - 2.3.4 - 2.4.1 branches: only: - master before_install: - gem install bundler - before_script: 'bundle exec rake alchemy:spec:prepare' ? - - + before_script: bundle exec rake alchemy:spec:prepare - script: 'bundle exec rspec' ? - - + script: bundle exec rspec + after_success: bundle exec codeclimate-test-reporter env: - DB=mysql - DB=postgresql
5
0.277778
3
2
3e274de29e7dfde17e86941c2ccdf05024e79a30
vim/setup.sh
vim/setup.sh
CONFIG=`pwd`/dotvimrc RCFILE=~/.vimrc if [ -f $RCFILE ]; then mv $RCFILE $RCFILE.`date +%Y-%m-%d_%H:%M:%S` fi ln -s $CONFIG $RCFILE git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim echo "Done config vim, but you need to install the bundles in vim!" echo "We need to install instant-markdown-d with node.js. Please refer to [vim-instant-markdown](https://github.com/suan/vim-instant-markdown)"
CONFIG=`pwd`/dotvimrc RCFILE=~/.vimrc if [ -f $RCFILE ]; then mv $RCFILE $RCFILE.`date +%Y-%m-%d_%H:%M:%S` fi ln -s $CONFIG $RCFILE git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim vim +BundleInstall +qall echo "Done config vim, but you need to install the bundles in vim!" echo "We need to install instant-markdown-d with node.js. Please refer to [vim-instant-markdown](https://github.com/suan/vim-instant-markdown)"
Add auto-install Bundles in scripts.
Add auto-install Bundles in scripts.
Shell
mit
RepoCastle/config
shell
## Code Before: CONFIG=`pwd`/dotvimrc RCFILE=~/.vimrc if [ -f $RCFILE ]; then mv $RCFILE $RCFILE.`date +%Y-%m-%d_%H:%M:%S` fi ln -s $CONFIG $RCFILE git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim echo "Done config vim, but you need to install the bundles in vim!" echo "We need to install instant-markdown-d with node.js. Please refer to [vim-instant-markdown](https://github.com/suan/vim-instant-markdown)" ## Instruction: Add auto-install Bundles in scripts. ## Code After: CONFIG=`pwd`/dotvimrc RCFILE=~/.vimrc if [ -f $RCFILE ]; then mv $RCFILE $RCFILE.`date +%Y-%m-%d_%H:%M:%S` fi ln -s $CONFIG $RCFILE git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim vim +BundleInstall +qall echo "Done config vim, but you need to install the bundles in vim!" echo "We need to install instant-markdown-d with node.js. Please refer to [vim-instant-markdown](https://github.com/suan/vim-instant-markdown)"
CONFIG=`pwd`/dotvimrc RCFILE=~/.vimrc if [ -f $RCFILE ]; then mv $RCFILE $RCFILE.`date +%Y-%m-%d_%H:%M:%S` fi ln -s $CONFIG $RCFILE git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim + vim +BundleInstall +qall echo "Done config vim, but you need to install the bundles in vim!" echo "We need to install instant-markdown-d with node.js. Please refer to [vim-instant-markdown](https://github.com/suan/vim-instant-markdown)"
1
0.071429
1
0
4ec0c51a2c9436d369d17700b42264bb6af3f60d
.styleci.yml
.styleci.yml
preset: psr2 risky: true finder: path: - "examples" - "src" - "tests" enabled: - binary_operator_spaces - ordered_imports - short_array_syntax
preset: psr2 risky: true finder: path: - "examples" - "src" - "tests" exclude: - "tests/Fixture/Definition" enabled: - binary_operator_spaces - ordered_imports - short_array_syntax
Exclude Definition Fixture directory from code style check
Exclude Definition Fixture directory from code style check
YAML
mit
woohoolabs/zen
yaml
## Code Before: preset: psr2 risky: true finder: path: - "examples" - "src" - "tests" enabled: - binary_operator_spaces - ordered_imports - short_array_syntax ## Instruction: Exclude Definition Fixture directory from code style check ## Code After: preset: psr2 risky: true finder: path: - "examples" - "src" - "tests" exclude: - "tests/Fixture/Definition" enabled: - binary_operator_spaces - ordered_imports - short_array_syntax
preset: psr2 risky: true finder: path: - "examples" - "src" - "tests" + exclude: + - "tests/Fixture/Definition" enabled: - binary_operator_spaces - ordered_imports - short_array_syntax
2
0.142857
2
0
6591e479e559690ca8a0737210b4a44d7409b03c
modules/vim/installed-config/plugin/keymap.vim
modules/vim/installed-config/plugin/keymap.vim
" set key code delay to 10ms " only wait a very short time for terminal key codes " these aren't used by modern terminals " This prevents delays when pressing ESC set ttimeoutlen=10 " change leader key from \ to space let mapleader=' ' " map space-e to open the file explorer map <leader>e :Explore<cr> map <leader><S-E> :Rexplore<cr> " map space-j and space-k to next and previous buffers map <leader>j :bnext<cr> map <leader>k :bprevious<cr> " Map unmapped easymotion commands map <Plug>(easymotion-prefix)l <Plug>(easymotion-lineforward) map <Plug>(easymotion-prefix)h <Plug>(easymotion-linebackward) map <Plug>(easymotion-prefix)/ <Plug>(easymotion-sn) omap <Plug>(easymotion-prefix)/ <Plug>(easymotion-tn)
" set key code delay to 10ms " only wait a very short time for terminal key codes " these aren't used by modern terminals " This prevents delays when pressing ESC set ttimeoutlen=10 " change leader key from \ to space let mapleader=' ' " change backspace behavior to be more like a typical editor set backspace=indent,eol,start " map space-e to open the file explorer map <leader>e :Explore<cr> map <leader><S-E> :Rexplore<cr> " map space-j and space-k to next and previous buffers map <leader>j :bnext<cr> map <leader>k :bprevious<cr> " Map unmapped easymotion commands map <Plug>(easymotion-prefix)l <Plug>(easymotion-lineforward) map <Plug>(easymotion-prefix)h <Plug>(easymotion-linebackward) map <Plug>(easymotion-prefix)/ <Plug>(easymotion-sn) omap <Plug>(easymotion-prefix)/ <Plug>(easymotion-tn)
Fix backspace behavior in vim for mac
Fix backspace behavior in vim for mac
VimL
mit
justinhoward/dotfiles,justinhoward/dotfiles
viml
## Code Before: " set key code delay to 10ms " only wait a very short time for terminal key codes " these aren't used by modern terminals " This prevents delays when pressing ESC set ttimeoutlen=10 " change leader key from \ to space let mapleader=' ' " map space-e to open the file explorer map <leader>e :Explore<cr> map <leader><S-E> :Rexplore<cr> " map space-j and space-k to next and previous buffers map <leader>j :bnext<cr> map <leader>k :bprevious<cr> " Map unmapped easymotion commands map <Plug>(easymotion-prefix)l <Plug>(easymotion-lineforward) map <Plug>(easymotion-prefix)h <Plug>(easymotion-linebackward) map <Plug>(easymotion-prefix)/ <Plug>(easymotion-sn) omap <Plug>(easymotion-prefix)/ <Plug>(easymotion-tn) ## Instruction: Fix backspace behavior in vim for mac ## Code After: " set key code delay to 10ms " only wait a very short time for terminal key codes " these aren't used by modern terminals " This prevents delays when pressing ESC set ttimeoutlen=10 " change leader key from \ to space let mapleader=' ' " change backspace behavior to be more like a typical editor set backspace=indent,eol,start " map space-e to open the file explorer map <leader>e :Explore<cr> map <leader><S-E> :Rexplore<cr> " map space-j and space-k to next and previous buffers map <leader>j :bnext<cr> map <leader>k :bprevious<cr> " Map unmapped easymotion commands map <Plug>(easymotion-prefix)l <Plug>(easymotion-lineforward) map <Plug>(easymotion-prefix)h <Plug>(easymotion-linebackward) map <Plug>(easymotion-prefix)/ <Plug>(easymotion-sn) omap <Plug>(easymotion-prefix)/ <Plug>(easymotion-tn)
" set key code delay to 10ms " only wait a very short time for terminal key codes " these aren't used by modern terminals " This prevents delays when pressing ESC set ttimeoutlen=10 " change leader key from \ to space let mapleader=' ' + + " change backspace behavior to be more like a typical editor + set backspace=indent,eol,start " map space-e to open the file explorer map <leader>e :Explore<cr> map <leader><S-E> :Rexplore<cr> " map space-j and space-k to next and previous buffers map <leader>j :bnext<cr> map <leader>k :bprevious<cr> " Map unmapped easymotion commands map <Plug>(easymotion-prefix)l <Plug>(easymotion-lineforward) map <Plug>(easymotion-prefix)h <Plug>(easymotion-linebackward) map <Plug>(easymotion-prefix)/ <Plug>(easymotion-sn) omap <Plug>(easymotion-prefix)/ <Plug>(easymotion-tn)
3
0.130435
3
0
9953cc0a4f596c33e6aab468bdbfe625b8b5114e
.travis.yml
.travis.yml
language: node_js node_js: - "0.10" before_script: - npm install -g gulp - npm install -g coffee-script - pwd - ls -lah ./ - ls -lah ./NBlast.Client script: gulp --gulpfile "./NBlast.Client/gulpfile.js" test
language: node_js node_js: - "0.10" before_script: - cd ./NBlast.Client - npm install -g gulp - npm install -g coffee-script - npm install - pwd - ls -lah ./ script: npm test
Use npm instead of direct gulp
[Build] Use npm instead of direct gulp
YAML
apache-2.0
vba/NBlast,vba/NBlast,vba/NBlast,vba/NBlast
yaml
## Code Before: language: node_js node_js: - "0.10" before_script: - npm install -g gulp - npm install -g coffee-script - pwd - ls -lah ./ - ls -lah ./NBlast.Client script: gulp --gulpfile "./NBlast.Client/gulpfile.js" test ## Instruction: [Build] Use npm instead of direct gulp ## Code After: language: node_js node_js: - "0.10" before_script: - cd ./NBlast.Client - npm install -g gulp - npm install -g coffee-script - npm install - pwd - ls -lah ./ script: npm test
language: node_js node_js: - "0.10" before_script: + - cd ./NBlast.Client - npm install -g gulp - npm install -g coffee-script + - npm install - pwd - ls -lah ./ + script: npm test - - ls -lah ./NBlast.Client - script: gulp --gulpfile "./NBlast.Client/gulpfile.js" test
5
0.5
3
2