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
c1978b28890a179660519dd1652ae7950782406c
app/views/curation_concerns/file_sets/upload/_tos_checkbox.html.erb
app/views/curation_concerns/file_sets/upload/_tos_checkbox.html.erb
<label> <%= check_box_tag 'terms_of_service', 1, nil, { data: { activate: 'activate-submit' } } %><strong> I have read and do agree to <%= link_to t('sufia.deposit_agreement'), '/agreement/', target: "_blank" %>.</strong> </label>
<label> <%= check_box_tag 'terms_of_service', 1, nil, { data: { activate: 'activate-submit' } } %><strong> I have read and do agree to <%= link_to t('sufia.deposit_agreement'), sufia.static_path(:agreement), target: "_blank" %>.</strong> </label>
Use resourceful route helper for link to upload agreement
Use resourceful route helper for link to upload agreement Fixes #1575
HTML+ERB
apache-2.0
samvera/hyrax,samvera/hyrax,samvera/hyrax,samvera/hyrax
html+erb
## Code Before: <label> <%= check_box_tag 'terms_of_service', 1, nil, { data: { activate: 'activate-submit' } } %><strong> I have read and do agree to <%= link_to t('sufia.deposit_agreement'), '/agreement/', target: "_blank" %>.</strong> </label> ## Instruction: Use resourceful route helper for link to upload agreement Fixes #1575 ## Code After: <label> <%= check_box_tag 'terms_of_service', 1, nil, { data: { activate: 'activate-submit' } } %><strong> I have read and do agree to <%= link_to t('sufia.deposit_agreement'), sufia.static_path(:agreement), target: "_blank" %>.</strong> </label>
<label> - <%= check_box_tag 'terms_of_service', 1, nil, { data: { activate: 'activate-submit' } } %><strong> I have read and do agree to <%= link_to t('sufia.deposit_agreement'), '/agreement/', target: "_blank" %>.</strong> ? ^^^^^^^^^^^^^ + <%= check_box_tag 'terms_of_service', 1, nil, { data: { activate: 'activate-submit' } } %><strong> I have read and do agree to <%= link_to t('sufia.deposit_agreement'), sufia.static_path(:agreement), target: "_blank" %>.</strong> ? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ </label>
2
0.666667
1
1
7e4bc4d9b3ab5e805e98502ab0a0dc95479fabcf
frappe/templates/emails/workflow_action.html
frappe/templates/emails/workflow_action.html
<p>{{ message }}</p> <div> <p style="margin: 2em 0 !important"> {% for action in actions %} <a class="btn" style="margin-right: 1em" href="{{ action.action_link }}">{{_(action.action_name)}}</a> {% endfor %} </p> </div>
<p>{{ message }}</p> <div> <p style="margin: 10px 0"> {% for action in actions %} <a class="btn {% if action.is_primary %} btn-primary {% endif %}" style="margin-right: 10px" href="{{ action.action_link }}">{{_(action.action_name)}}</a> {% endfor %} </p> </div>
Update workflow action email template style
fix: Update workflow action email template style
HTML
mit
saurabh6790/frappe,mhbu50/frappe,frappe/frappe,almeidapaulopt/frappe,saurabh6790/frappe,frappe/frappe,almeidapaulopt/frappe,mhbu50/frappe,frappe/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,StrellaGroup/frappe,almeidapaulopt/frappe,yashodhank/frappe,yashodhank/frappe,saurabh6790/frappe,mhbu50/frappe,yashodhank/frappe,saurabh6790/frappe,mhbu50/frappe,yashodhank/frappe,StrellaGroup/frappe
html
## Code Before: <p>{{ message }}</p> <div> <p style="margin: 2em 0 !important"> {% for action in actions %} <a class="btn" style="margin-right: 1em" href="{{ action.action_link }}">{{_(action.action_name)}}</a> {% endfor %} </p> </div> ## Instruction: fix: Update workflow action email template style ## Code After: <p>{{ message }}</p> <div> <p style="margin: 10px 0"> {% for action in actions %} <a class="btn {% if action.is_primary %} btn-primary {% endif %}" style="margin-right: 10px" href="{{ action.action_link }}">{{_(action.action_name)}}</a> {% endfor %} </p> </div>
<p>{{ message }}</p> <div> - <p style="margin: 2em 0 !important"> + <p style="margin: 10px 0"> {% for action in actions %} - <a class="btn" style="margin-right: 1em" href="{{ action.action_link }}">{{_(action.action_name)}}</a> ? ^^ + <a class="btn {% if action.is_primary %} btn-primary {% endif %}" style="margin-right: 10px" href="{{ action.action_link }}">{{_(action.action_name)}}</a> ? +++++++++++++++++++++++++++++++++++++++++++++++++++ ^^^ {% endfor %} </p> </div>
4
0.5
2
2
0dc535b7ddc972eed9a615cf06f4c1e5466956f1
README.md
README.md
fast-xml ======== (Currently incomplete and not operational) streaming XML parser using node-expat (requires node-gyp to compile). Uses XSD schema information to read XML into nice JavaScript structures. Downloads schema files and keeps a local cache in the file system. Handles arbitrarily large files using streaming. License ======= [The MIT License](https://raw.githubusercontent.com/charto/fast-xml/master/LICENSE) Copyright (c) 2015 BusFaster Ltd
fast-xml ======== (Currently incomplete and not operational) streaming XML parser using node-expat (requires node-gyp to compile). Uses XSD schema information to read XML into nice JavaScript structures. Downloads schema files and keeps a local cache in the file system. Handles arbitrarily large files using streaming. Parsing XSD schema files ------------------------ Schema handling is implemented in the `xsd` directory. Supported syntax elements are defined in its `types` subdirectory. Each element in the xsd namespace inherits from `types.Base` which has static and dynamic members that affect parser initialization. The `Base` class and its derived classes shouldn't have manually defined constructors, because the parser will instantiate objects to inspect the dynamic properties. Instead, an `init` function is called on constructed objects when creating them during actual parsing. The static members are mirrored as dynamic members of `BaseClass`. Any constructor of a class derived from `Base` can then be used as if it was a `BaseClass` instance. The static `mayContain` member function of syntax element types (classes derived from `types.base`) returns a list of other element types (defined as `BaseClass` instances) that it supports as direct children. The parser uses these to create a kind of state machine. Syntax elements may also have attributes. They should be initialized to `null` in the class definition (the TypeScript compiler will automatically generate a constructor to initialize them). The parser will construct an instance of each class it finds, and examine its automatically constructed dynamic members. During parsing, they will then be automatically initialized to attributes found in the schema being parsed. Unknown attributes will be ignored. License ======= [The MIT License](https://raw.githubusercontent.com/charto/fast-xml/master/LICENSE) Copyright (c) 2015 BusFaster Ltd
Add documentation about XSD parser internals.
Add documentation about XSD parser internals.
Markdown
mit
charto/cxsd,charto/cxsd,charto/fast-xml,charto/fast-xml
markdown
## Code Before: fast-xml ======== (Currently incomplete and not operational) streaming XML parser using node-expat (requires node-gyp to compile). Uses XSD schema information to read XML into nice JavaScript structures. Downloads schema files and keeps a local cache in the file system. Handles arbitrarily large files using streaming. License ======= [The MIT License](https://raw.githubusercontent.com/charto/fast-xml/master/LICENSE) Copyright (c) 2015 BusFaster Ltd ## Instruction: Add documentation about XSD parser internals. ## Code After: fast-xml ======== (Currently incomplete and not operational) streaming XML parser using node-expat (requires node-gyp to compile). Uses XSD schema information to read XML into nice JavaScript structures. Downloads schema files and keeps a local cache in the file system. Handles arbitrarily large files using streaming. Parsing XSD schema files ------------------------ Schema handling is implemented in the `xsd` directory. Supported syntax elements are defined in its `types` subdirectory. Each element in the xsd namespace inherits from `types.Base` which has static and dynamic members that affect parser initialization. The `Base` class and its derived classes shouldn't have manually defined constructors, because the parser will instantiate objects to inspect the dynamic properties. Instead, an `init` function is called on constructed objects when creating them during actual parsing. The static members are mirrored as dynamic members of `BaseClass`. Any constructor of a class derived from `Base` can then be used as if it was a `BaseClass` instance. The static `mayContain` member function of syntax element types (classes derived from `types.base`) returns a list of other element types (defined as `BaseClass` instances) that it supports as direct children. The parser uses these to create a kind of state machine. Syntax elements may also have attributes. They should be initialized to `null` in the class definition (the TypeScript compiler will automatically generate a constructor to initialize them). The parser will construct an instance of each class it finds, and examine its automatically constructed dynamic members. During parsing, they will then be automatically initialized to attributes found in the schema being parsed. Unknown attributes will be ignored. License ======= [The MIT License](https://raw.githubusercontent.com/charto/fast-xml/master/LICENSE) Copyright (c) 2015 BusFaster Ltd
fast-xml ======== (Currently incomplete and not operational) streaming XML parser using node-expat (requires node-gyp to compile). Uses XSD schema information to read XML into nice JavaScript structures. Downloads schema files and keeps a local cache in the file system. Handles arbitrarily large files using streaming. + Parsing XSD schema files + ------------------------ + + Schema handling is implemented in the `xsd` directory. Supported syntax elements are defined in its `types` subdirectory. Each element in the xsd namespace inherits from `types.Base` which has static and dynamic members that affect parser initialization. The `Base` class and its derived classes shouldn't have manually defined constructors, because the parser will instantiate objects to inspect the dynamic properties. Instead, an `init` function is called on constructed objects when creating them during actual parsing. + + The static members are mirrored as dynamic members of `BaseClass`. Any constructor of a class derived from `Base` can then be used as if it was a `BaseClass` instance. + + The static `mayContain` member function of syntax element types (classes derived from `types.base`) returns a list of other element types (defined as `BaseClass` instances) that it supports as direct children. The parser uses these to create a kind of state machine. + + Syntax elements may also have attributes. They should be initialized to `null` in the class definition (the TypeScript compiler will automatically generate a constructor to initialize them). The parser will construct an instance of each class it finds, and examine its automatically constructed dynamic members. During parsing, they will then be automatically initialized to attributes found in the schema being parsed. Unknown attributes will be ignored. + License ======= [The MIT License](https://raw.githubusercontent.com/charto/fast-xml/master/LICENSE) Copyright (c) 2015 BusFaster Ltd
11
0.647059
11
0
d314c4d46a02b7807da28514e44593ce7e49b6c9
code/run_open.sh
code/run_open.sh
FASTA=$1 OPEN_PATH=$(echo $FASTA | sed 's/fasta/open/') rm -rf $OPEN_PATH/ pick_open_reference_otus.py -i $FASTA -o $OPEN_PATH -m usearch61 -s 1 -p code/openref.params.txt --min_otu_size 1 --prefilter_percent_id 0.0 mothur "#set.dir(output=$OPEN_PATH); make.shared(biom=$OPEN_PATH/otu_table_mc1_w_tax_no_pynast_failures.biom)" R -e "source('code/shared_to_list.R'); shared_to_list('$OPEN_PATH/otu_table.shared')" rm -rf $OPEN_PATH/
FASTA=$1 OPEN_PATH=$(echo $FASTA | sed 's/fasta/open/') rm -rf $OPEN_PATH/ pick_open_reference_otus.py -i $FASTA -o $OPEN_PATH -m usearch61 -s 1 -p code/openref.params.txt --min_otu_size 1 --prefilter_percent_id 0.0 mothur "#set.dir(output=$OPEN_PATH); make.shared(biom=$OPEN_PATH/otu_table_mc1_w_tax_no_pynast_failures.biom)" R -e "source('code/shared_to_list.R'); shared_to_list('$OPEN_PATH/otu_table_mc1_w_tax_no_pynast_failures.shared')" rm -rf $OPEN_PATH/
Fix name of shared file in shared_to_list call
Fix name of shared file in shared_to_list call
Shell
mit
SchlossLab/Schloss_Cluster_PeerJ_2015,SchlossLab/Schloss_Cluster_PeerJ_2015,zhwcoder/Schloss_Cluster_PeerJ_2015,SchlossLab/Schloss_Cluster_PeerJ_2015,zhwcoder/Schloss_Cluster_PeerJ_2015
shell
## Code Before: FASTA=$1 OPEN_PATH=$(echo $FASTA | sed 's/fasta/open/') rm -rf $OPEN_PATH/ pick_open_reference_otus.py -i $FASTA -o $OPEN_PATH -m usearch61 -s 1 -p code/openref.params.txt --min_otu_size 1 --prefilter_percent_id 0.0 mothur "#set.dir(output=$OPEN_PATH); make.shared(biom=$OPEN_PATH/otu_table_mc1_w_tax_no_pynast_failures.biom)" R -e "source('code/shared_to_list.R'); shared_to_list('$OPEN_PATH/otu_table.shared')" rm -rf $OPEN_PATH/ ## Instruction: Fix name of shared file in shared_to_list call ## Code After: FASTA=$1 OPEN_PATH=$(echo $FASTA | sed 's/fasta/open/') rm -rf $OPEN_PATH/ pick_open_reference_otus.py -i $FASTA -o $OPEN_PATH -m usearch61 -s 1 -p code/openref.params.txt --min_otu_size 1 --prefilter_percent_id 0.0 mothur "#set.dir(output=$OPEN_PATH); make.shared(biom=$OPEN_PATH/otu_table_mc1_w_tax_no_pynast_failures.biom)" R -e "source('code/shared_to_list.R'); shared_to_list('$OPEN_PATH/otu_table_mc1_w_tax_no_pynast_failures.shared')" rm -rf $OPEN_PATH/
FASTA=$1 OPEN_PATH=$(echo $FASTA | sed 's/fasta/open/') rm -rf $OPEN_PATH/ pick_open_reference_otus.py -i $FASTA -o $OPEN_PATH -m usearch61 -s 1 -p code/openref.params.txt --min_otu_size 1 --prefilter_percent_id 0.0 mothur "#set.dir(output=$OPEN_PATH); make.shared(biom=$OPEN_PATH/otu_table_mc1_w_tax_no_pynast_failures.biom)" - R -e "source('code/shared_to_list.R'); shared_to_list('$OPEN_PATH/otu_table.shared')" + R -e "source('code/shared_to_list.R'); shared_to_list('$OPEN_PATH/otu_table_mc1_w_tax_no_pynast_failures.shared')" ? +++++++++++++++++++++++++++++ rm -rf $OPEN_PATH/
2
0.2
1
1
501289cd0322fd6e77c55e4ae43c7c1d027adac4
aqua/manifest.json
aqua/manifest.json
{ "display_name": "Aqua", "maintainer": "oran.moshai@aquasec.com", "manifest_version": "1.0.0", "name": "aqua", "metric_prefix": "aqua.", "metric_to_check": "", "creates_events": false, "short_description": "Full dev-to-prod security solution for containers and cloud native applications", "guid": "c269dad1-8db2-4e91-b25d-af646e80dbbf", "support": "contrib", "supported_os": [ "linux", "mac_os", "windows" ], "public_title": "Datadog-Aqua Integration", "categories": [ "security", "monitoring" ], "type": "check", "is_public": true }
{ "display_name": "Aqua", "maintainer": "oran.moshai@aquasec.com", "manifest_version": "1.0.0", "name": "aqua", "metric_prefix": "aqua.", "metric_to_check": "", "creates_events": false, "short_description": "Full dev-to-prod security solution for containers and cloud native applications", "guid": "c269dad1-8db2-4e91-b25d-af646e80dbbf", "support": "contrib", "supported_os": [ "linux", "mac_os", "windows" ], "public_title": "Datadog-Aqua Integration", "categories": [ "security", "monitoring", "log collection" ], "type": "check", "is_public": true }
Update Aqua to reflect Log collection instruction
Update Aqua to reflect Log collection instruction
JSON
bsd-3-clause
DataDog/integrations-extras,DataDog/integrations-extras,DataDog/integrations-extras,DataDog/integrations-extras,DataDog/integrations-extras
json
## Code Before: { "display_name": "Aqua", "maintainer": "oran.moshai@aquasec.com", "manifest_version": "1.0.0", "name": "aqua", "metric_prefix": "aqua.", "metric_to_check": "", "creates_events": false, "short_description": "Full dev-to-prod security solution for containers and cloud native applications", "guid": "c269dad1-8db2-4e91-b25d-af646e80dbbf", "support": "contrib", "supported_os": [ "linux", "mac_os", "windows" ], "public_title": "Datadog-Aqua Integration", "categories": [ "security", "monitoring" ], "type": "check", "is_public": true } ## Instruction: Update Aqua to reflect Log collection instruction ## Code After: { "display_name": "Aqua", "maintainer": "oran.moshai@aquasec.com", "manifest_version": "1.0.0", "name": "aqua", "metric_prefix": "aqua.", "metric_to_check": "", "creates_events": false, "short_description": "Full dev-to-prod security solution for containers and cloud native applications", "guid": "c269dad1-8db2-4e91-b25d-af646e80dbbf", "support": "contrib", "supported_os": [ "linux", "mac_os", "windows" ], "public_title": "Datadog-Aqua Integration", "categories": [ "security", "monitoring", "log collection" ], "type": "check", "is_public": true }
{ "display_name": "Aqua", "maintainer": "oran.moshai@aquasec.com", "manifest_version": "1.0.0", "name": "aqua", "metric_prefix": "aqua.", "metric_to_check": "", "creates_events": false, "short_description": "Full dev-to-prod security solution for containers and cloud native applications", "guid": "c269dad1-8db2-4e91-b25d-af646e80dbbf", "support": "contrib", "supported_os": [ "linux", "mac_os", "windows" ], "public_title": "Datadog-Aqua Integration", "categories": [ "security", - "monitoring" + "monitoring", ? + + "log collection" ], "type": "check", "is_public": true }
3
0.125
2
1
d4ee39f8d51172217d87311dd75292869c729a1f
website/addons/github/templates/github_user_settings.mako
website/addons/github/templates/github_user_settings.mako
<!-- Authorization --> <div> <h4 class="addon-title"> <img class="addon-icon" src="${addon_icon_url}"></img> GitHub <small class="authorized-by"> % if authorized: authorized by <a href="https://github.com/${authorized_github_user}" target="_blank"> <em>${authorized_github_user}</em> </a> <a id="githubDelKey" class="text-danger pull-right addon-auth">Disconnect Account</a> % else: <a id="githubAddKey" class="text-primary pull-right addon-auth"> Connect Account </a> % endif </small> </h4> </div> <%def name="submit_btn()"></%def> <%def name="on_submit()"></%def> <%include file="profile/addon_permissions.mako" />
<!-- Authorization --> <div> <h4 class="addon-title"> <img class="addon-icon" src="${addon_icon_url}"></img> GitHub <small class="authorized-by"> % if authorized: authorized by <em>${authorized_github_user}</em> <a id="githubDelKey" class="text-danger pull-right addon-auth">Disconnect Account</a> % else: <a id="githubAddKey" class="text-primary pull-right addon-auth"> Connect Account </a> % endif </small> </h4> </div> <%def name="submit_btn()"></%def> <%def name="on_submit()"></%def> <%include file="profile/addon_permissions.mako" />
Remove link to users github profile
Remove link to users github profile
Mako
apache-2.0
acshi/osf.io,monikagrabowska/osf.io,abought/osf.io,mfraezz/osf.io,binoculars/osf.io,cwisecarver/osf.io,Nesiehr/osf.io,baylee-d/osf.io,felliott/osf.io,kwierman/osf.io,Johnetordoff/osf.io,chennan47/osf.io,brandonPurvis/osf.io,petermalcolm/osf.io,TomHeatwole/osf.io,sbt9uc/osf.io,crcresearch/osf.io,billyhunt/osf.io,brianjgeiger/osf.io,reinaH/osf.io,wearpants/osf.io,alexschiller/osf.io,cslzchen/osf.io,erinspace/osf.io,DanielSBrown/osf.io,caseyrollins/osf.io,DanielSBrown/osf.io,cldershem/osf.io,kch8qx/osf.io,brandonPurvis/osf.io,reinaH/osf.io,emetsger/osf.io,TomBaxter/osf.io,samchrisinger/osf.io,amyshi188/osf.io,monikagrabowska/osf.io,leb2dg/osf.io,hmoco/osf.io,TomHeatwole/osf.io,SSJohns/osf.io,ZobairAlijan/osf.io,jmcarp/osf.io,jnayak1/osf.io,mluke93/osf.io,dplorimer/osf,Ghalko/osf.io,samanehsan/osf.io,SSJohns/osf.io,jolene-esposito/osf.io,jnayak1/osf.io,caneruguz/osf.io,brandonPurvis/osf.io,reinaH/osf.io,cldershem/osf.io,alexschiller/osf.io,jmcarp/osf.io,kch8qx/osf.io,doublebits/osf.io,laurenrevere/osf.io,billyhunt/osf.io,cwisecarver/osf.io,reinaH/osf.io,Nesiehr/osf.io,wearpants/osf.io,zamattiac/osf.io,samanehsan/osf.io,njantrania/osf.io,saradbowman/osf.io,mluo613/osf.io,monikagrabowska/osf.io,billyhunt/osf.io,MerlinZhang/osf.io,TomBaxter/osf.io,abought/osf.io,ckc6cz/osf.io,aaxelb/osf.io,ticklemepierce/osf.io,MerlinZhang/osf.io,hmoco/osf.io,GageGaskins/osf.io,sloria/osf.io,acshi/osf.io,aaxelb/osf.io,amyshi188/osf.io,samchrisinger/osf.io,mluo613/osf.io,caseyrollins/osf.io,haoyuchen1992/osf.io,icereval/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,chrisseto/osf.io,samchrisinger/osf.io,petermalcolm/osf.io,sloria/osf.io,GageGaskins/osf.io,baylee-d/osf.io,GageGaskins/osf.io,asanfilippo7/osf.io,caseyrygt/osf.io,KAsante95/osf.io,felliott/osf.io,chrisseto/osf.io,RomanZWang/osf.io,HalcyonChimera/osf.io,cosenal/osf.io,caseyrygt/osf.io,aaxelb/osf.io,cwisecarver/osf.io,wearpants/osf.io,cosenal/osf.io,brianjgeiger/osf.io,caseyrygt/osf.io,brianjgeiger/osf.io,doublebits/osf.io,sbt9uc/osf.io,HalcyonChimera/osf.io,cslzchen/osf.io,RomanZWang/osf.io,saradbowman/osf.io,Nesiehr/osf.io,chennan47/osf.io,chennan47/osf.io,RomanZWang/osf.io,adlius/osf.io,ZobairAlijan/osf.io,danielneis/osf.io,SSJohns/osf.io,mfraezz/osf.io,mluke93/osf.io,zamattiac/osf.io,emetsger/osf.io,samanehsan/osf.io,danielneis/osf.io,mattclark/osf.io,icereval/osf.io,mluke93/osf.io,arpitar/osf.io,chrisseto/osf.io,amyshi188/osf.io,abought/osf.io,dplorimer/osf,alexschiller/osf.io,sbt9uc/osf.io,kwierman/osf.io,leb2dg/osf.io,njantrania/osf.io,jmcarp/osf.io,cosenal/osf.io,Nesiehr/osf.io,njantrania/osf.io,rdhyee/osf.io,lyndsysimon/osf.io,acshi/osf.io,chrisseto/osf.io,crcresearch/osf.io,erinspace/osf.io,ticklemepierce/osf.io,petermalcolm/osf.io,MerlinZhang/osf.io,caneruguz/osf.io,crcresearch/osf.io,monikagrabowska/osf.io,DanielSBrown/osf.io,pattisdr/osf.io,mluke93/osf.io,felliott/osf.io,erinspace/osf.io,pattisdr/osf.io,cldershem/osf.io,cosenal/osf.io,mluo613/osf.io,pattisdr/osf.io,Ghalko/osf.io,zamattiac/osf.io,HalcyonChimera/osf.io,kch8qx/osf.io,leb2dg/osf.io,rdhyee/osf.io,zachjanicki/osf.io,caseyrollins/osf.io,billyhunt/osf.io,cslzchen/osf.io,hmoco/osf.io,ZobairAlijan/osf.io,kwierman/osf.io,leb2dg/osf.io,zachjanicki/osf.io,acshi/osf.io,ticklemepierce/osf.io,brandonPurvis/osf.io,alexschiller/osf.io,alexschiller/osf.io,jolene-esposito/osf.io,asanfilippo7/osf.io,TomBaxter/osf.io,CenterForOpenScience/osf.io,haoyuchen1992/osf.io,monikagrabowska/osf.io,arpitar/osf.io,HalcyonChimera/osf.io,MerlinZhang/osf.io,KAsante95/osf.io,mluo613/osf.io,acshi/osf.io,zamattiac/osf.io,TomHeatwole/osf.io,felliott/osf.io,emetsger/osf.io,mfraezz/osf.io,ckc6cz/osf.io,aaxelb/osf.io,GageGaskins/osf.io,amyshi188/osf.io,jnayak1/osf.io,TomHeatwole/osf.io,ckc6cz/osf.io,ckc6cz/osf.io,laurenrevere/osf.io,DanielSBrown/osf.io,adlius/osf.io,rdhyee/osf.io,CenterForOpenScience/osf.io,samanehsan/osf.io,Ghalko/osf.io,Ghalko/osf.io,cwisecarver/osf.io,dplorimer/osf,jmcarp/osf.io,adlius/osf.io,binoculars/osf.io,wearpants/osf.io,danielneis/osf.io,binoculars/osf.io,brianjgeiger/osf.io,laurenrevere/osf.io,petermalcolm/osf.io,jolene-esposito/osf.io,mattclark/osf.io,doublebits/osf.io,dplorimer/osf,KAsante95/osf.io,RomanZWang/osf.io,KAsante95/osf.io,arpitar/osf.io,HarryRybacki/osf.io,haoyuchen1992/osf.io,asanfilippo7/osf.io,SSJohns/osf.io,zachjanicki/osf.io,jnayak1/osf.io,njantrania/osf.io,ZobairAlijan/osf.io,caseyrygt/osf.io,samchrisinger/osf.io,jolene-esposito/osf.io,haoyuchen1992/osf.io,abought/osf.io,hmoco/osf.io,CenterForOpenScience/osf.io,brandonPurvis/osf.io,kch8qx/osf.io,ticklemepierce/osf.io,HarryRybacki/osf.io,lyndsysimon/osf.io,baylee-d/osf.io,zachjanicki/osf.io,mfraezz/osf.io,rdhyee/osf.io,mluo613/osf.io,KAsante95/osf.io,HarryRybacki/osf.io,RomanZWang/osf.io,doublebits/osf.io,lyndsysimon/osf.io,icereval/osf.io,arpitar/osf.io,Johnetordoff/osf.io,caneruguz/osf.io,cslzchen/osf.io,mattclark/osf.io,sloria/osf.io,GageGaskins/osf.io,billyhunt/osf.io,kch8qx/osf.io,lyndsysimon/osf.io,adlius/osf.io,emetsger/osf.io,HarryRybacki/osf.io,caneruguz/osf.io,kwierman/osf.io,sbt9uc/osf.io,asanfilippo7/osf.io,danielneis/osf.io,doublebits/osf.io,cldershem/osf.io
mako
## Code Before: <!-- Authorization --> <div> <h4 class="addon-title"> <img class="addon-icon" src="${addon_icon_url}"></img> GitHub <small class="authorized-by"> % if authorized: authorized by <a href="https://github.com/${authorized_github_user}" target="_blank"> <em>${authorized_github_user}</em> </a> <a id="githubDelKey" class="text-danger pull-right addon-auth">Disconnect Account</a> % else: <a id="githubAddKey" class="text-primary pull-right addon-auth"> Connect Account </a> % endif </small> </h4> </div> <%def name="submit_btn()"></%def> <%def name="on_submit()"></%def> <%include file="profile/addon_permissions.mako" /> ## Instruction: Remove link to users github profile ## Code After: <!-- Authorization --> <div> <h4 class="addon-title"> <img class="addon-icon" src="${addon_icon_url}"></img> GitHub <small class="authorized-by"> % if authorized: authorized by <em>${authorized_github_user}</em> <a id="githubDelKey" class="text-danger pull-right addon-auth">Disconnect Account</a> % else: <a id="githubAddKey" class="text-primary pull-right addon-auth"> Connect Account </a> % endif </small> </h4> </div> <%def name="submit_btn()"></%def> <%def name="on_submit()"></%def> <%include file="profile/addon_permissions.mako" />
<!-- Authorization --> <div> <h4 class="addon-title"> <img class="addon-icon" src="${addon_icon_url}"></img> GitHub <small class="authorized-by"> % if authorized: authorized by - <a href="https://github.com/${authorized_github_user}" target="_blank"> <em>${authorized_github_user}</em> - </a> <a id="githubDelKey" class="text-danger pull-right addon-auth">Disconnect Account</a> % else: <a id="githubAddKey" class="text-primary pull-right addon-auth"> Connect Account </a> % endif </small> </h4> </div> <%def name="submit_btn()"></%def> <%def name="on_submit()"></%def> <%include file="profile/addon_permissions.mako" />
2
0.08
0
2
9b20173dfbdae0e6bf522f05d81fb06f2b9c149a
test/unit/vagrant/ssh_test.rb
test/unit/vagrant/ssh_test.rb
require File.expand_path("../../base", __FILE__) describe Vagrant::SSH do context "check_key_permissions" do let(:key_path) { File.expand_path("../id_rsa", __FILE__) } let(:ssh_instance) { Vagrant::SSH.new(double) } before(:each) do File.open(key_path, 'w') do |file| file.write("hello!") end File.chmod(644, key_path) end after(:each) do FileUtils.rm(key_path) end it "should not raise an exception if we set a keyfile permission correctly" do ssh_instance.check_key_permissions(key_path) end end end
require File.expand_path("../../base", __FILE__) describe Vagrant::SSH do context "check_key_permissions" do let(:key_path) do # We create a tempfile to guarantee some level of uniqueness # then explicitly close/unlink but save the path so we can re-use temp = Tempfile.new("vagrant") result = Pathname.new(temp.path) temp.close temp.unlink result end let(:ssh_instance) { Vagrant::SSH.new(double) } before(:each) do key_path.open("w") do |f| f.write("hello!") end key_path.chmod(0644) end it "should not raise an exception if we set a keyfile permission correctly" do ssh_instance.check_key_permissions(key_path) end end end
Clean up some of the SSH key tests
Clean up some of the SSH key tests
Ruby
mit
invernizzi-at-google/vagrant,patrys/vagrant,jmanero/vagrant,bshurts/vagrant,krig/vagrant,wkolean/vagrant,ArloL/vagrant,juiceinc/vagrant,jfchevrette/vagrant,tjanez/vagrant,patrys/vagrant,samphippen/vagrant,gitebra/vagrant,samphippen/vagrant,jean/vagrant,fnewberg/vagrant,kamigerami/vagrant,vamegh/vagrant,theist/vagrant,signed8bit/vagrant,carlosefr/vagrant,philoserf/vagrant,Endika/vagrant,jkburges/vagrant,PatrickLang/vagrant,petems/vagrant,patrys/vagrant,gpkfr/vagrant,MiLk/vagrant,crashlytics/vagrant,stephancom/vagrant,muhanadra/vagrant,wangfakang/vagrant,doy/vagrant,tjanez/vagrant,tjanez/vagrant,carlosefr/vagrant,iNecas/vagrant,aaam/vagrant,gpkfr/vagrant,juiceinc/vagrant,dustymabe/vagrant,senglin/vagrant,lukebakken/vagrant,TheBigBear/vagrant,h4ck3rm1k3/vagrant,webcoyote/vagrant,petems/vagrant,mkuzmin/vagrant,crashlytics/vagrant,gpkfr/vagrant,myrjola/vagrant,h4ck3rm1k3/vagrant,BlakeMesdag/vagrant,MiLk/vagrant,myrjola/vagrant,philwrenn/vagrant,tknerr/vagrant,ferventcoder/vagrant,tbarrongh/vagrant,denisbr/vagrant,nickryand/vagrant,dharmab/vagrant,justincampbell/vagrant,genome21/vagrant,tbarrongh/vagrant,taliesins/vagrant,clinstid/vagrant,janek-warchol/vagrant,bshurts/vagrant,dustymabe/vagrant,jhoblitt/vagrant,benh57/vagrant,otagi/vagrant,benh57/vagrant,jkburges/vagrant,otagi/vagrant,justincampbell/vagrant,invernizzi-at-google/vagrant,marxarelli/vagrant,jtopper/vagrant,philoserf/vagrant,blueyed/vagrant,fnewberg/vagrant,doy/vagrant,jmanero/vagrant,modulexcite/vagrant,aneeshusa/vagrant,jfchevrette/vagrant,Ninir/vagrant,benizi/vagrant,gajdaw/vagrant,janek-warchol/vagrant,dharmab/vagrant,shtouff/vagrant,bheuvel/vagrant,webcoyote/vagrant,loren-osborn/vagrant,PatOShea/vagrant,kamazee/vagrant,mpoeter/vagrant,dharmab/vagrant,Chhunlong/vagrant,kamazee/vagrant,janek-warchol/vagrant,sni/vagrant,krig/vagrant,invernizzi-at-google/vagrant,loren-osborn/vagrant,Chhed13/vagrant,gajdaw/vagrant,sideci-sample/sideci-sample-vagrant,juiceinc/vagrant,sferik/vagrant,dustymabe/vagrant,bheuvel/vagrant,justincampbell/vagrant,Avira/vagrant,kalabiyau/vagrant,jkburges/vagrant,tbriggs-curse/vagrant,zsjohny/vagrant,BlakeMesdag/vagrant,pwnall/vagrant,jberends/vagrant,webcoyote/vagrant,blueyed/vagrant,muhanadra/vagrant,PatrickLang/vagrant,tjanez/vagrant,bryson/vagrant,sni/vagrant,bryson/vagrant,philwrenn/vagrant,gbarberi/vagrant,tknerr/vagrant,marxarelli/vagrant,vamegh/vagrant,sni/vagrant,aneeshusa/vagrant,tschortsch/vagrant,Endika/vagrant,dhoer/vagrant,justincampbell/vagrant,lonniev/vagrant,miguel250/vagrant,pwnall/vagrant,h4ck3rm1k3/vagrant,Chhunlong/vagrant,wkolean/vagrant,p0deje/vagrant,bshurts/vagrant,teotihuacanada/vagrant,channui/vagrant,PatrickLang/vagrant,gbarberi/vagrant,mkuzmin/vagrant,TheBigBear/vagrant,wangfakang/vagrant,tbarrongh/vagrant,jhoblitt/vagrant,dustymabe/vagrant,chrisvire/vagrant,myrjola/vagrant,jmanero/vagrant,tbriggs-curse/vagrant,johntron/vagrant,Avira/vagrant,mitchellh/vagrant,TheBigBear/vagrant,Chhed13/vagrant,h4ck3rm1k3/vagrant,benh57/vagrant,chrisroberts/vagrant,legal90/vagrant,Chhunlong/vagrant,gitebra/vagrant,ianmiell/vagrant,marxarelli/vagrant,benizi/vagrant,nickryand/vagrant,evverx/vagrant,theist/vagrant,Avira/vagrant,PatOShea/vagrant,philoserf/vagrant,krig/vagrant,darkn3rd/vagrant,jean/vagrant,juiceinc/vagrant,fnewberg/vagrant,tschortsch/vagrant,theist/vagrant,stephancom/vagrant,rivy/vagrant,kalabiyau/vagrant,iNecas/vagrant,obnoxxx/vagrant,bryson/vagrant,chrisvire/vagrant,tknerr/vagrant,glensc/vagrant,loren-osborn/vagrant,dhoer/vagrant,Endika/vagrant,gitebra/vagrant,legal90/vagrant,dhoer/vagrant,aneeshusa/vagrant,TheBigBear/vagrant,invernizzi-at-google/vagrant,p0deje/vagrant,lukebakken/vagrant,lonniev/vagrant,channui/vagrant,janek-warchol/vagrant,benizi/vagrant,johntron/vagrant,PatrickLang/vagrant,aneeshusa/vagrant,Chhunlong/vagrant,taliesins/vagrant,sni/vagrant,aaam/vagrant,jhoblitt/vagrant,jberends/vagrant,nickryand/vagrant,sferik/vagrant,marxarelli/vagrant,tknerr/vagrant,carlosefr/vagrant,obnoxxx/vagrant,tschortsch/vagrant,gitebra/vagrant,MiLk/vagrant,lukebakken/vagrant,mpoeter/vagrant,zsjohny/vagrant,dharmab/vagrant,ianmiell/vagrant,nickryand/vagrant,channui/vagrant,denisbr/vagrant,philoserf/vagrant,jkburges/vagrant,genome21/vagrant,BlakeMesdag/vagrant,doy/vagrant,PatOShea/vagrant,gpkfr/vagrant,glensc/vagrant,evverx/vagrant,rivy/vagrant,genome21/vagrant,petems/vagrant,teotihuacanada/vagrant,modulexcite/vagrant,zsjohny/vagrant,apertoso/vagrant,taliesins/vagrant,crashlytics/vagrant,cgvarela/vagrant,cgvarela/vagrant,philwrenn/vagrant,signed8bit/vagrant,kamigerami/vagrant,signed8bit/vagrant,tomfanning/vagrant,evverx/vagrant,Endika/vagrant,senglin/vagrant,sferik/vagrant,miguel250/vagrant,sax/vagrant,doy/vagrant,benizi/vagrant,jhoblitt/vagrant,kalabiyau/vagrant,kamigerami/vagrant,Sgoettschkes/vagrant,mitchellh/vagrant,pwnall/vagrant,bheuvel/vagrant,wkolean/vagrant,tbriggs-curse/vagrant,sax/vagrant,denisbr/vagrant,bdwyertech/vagrant,miguel250/vagrant,jtopper/vagrant,mwarren/vagrant,Avira/vagrant,wangfakang/vagrant,cgvarela/vagrant,teotihuacanada/vagrant,modulexcite/vagrant,chrisroberts/vagrant,jmanero/vagrant,shtouff/vagrant,aaam/vagrant,ianmiell/vagrant,krig/vagrant,apertoso/vagrant,bshurts/vagrant,tbriggs-curse/vagrant,tschortsch/vagrant,senglin/vagrant,theist/vagrant,shtouff/vagrant,wangfakang/vagrant,Sgoettschkes/vagrant,chrisvire/vagrant,bdwyertech/vagrant,blueyed/vagrant,mpoeter/vagrant,mkuzmin/vagrant,mitchellh/vagrant,vamegh/vagrant,ferventcoder/vagrant,bryson/vagrant,miguel250/vagrant,samphippen/vagrant,jfchevrette/vagrant,carlosefr/vagrant,zsjohny/vagrant,patrys/vagrant,chrisroberts/vagrant,jberends/vagrant,denisbr/vagrant,muhanadra/vagrant,mwarren/vagrant,aaam/vagrant,kamazee/vagrant,chrisroberts/vagrant,dhoer/vagrant,stephancom/vagrant,apertoso/vagrant,clinstid/vagrant,samphippen/vagrant,Sgoettschkes/vagrant,mwrock/vagrant,mwarren/vagrant,myrjola/vagrant,gajdaw/vagrant,mwrock/vagrant,stephancom/vagrant,otagi/vagrant,Chhed13/vagrant,rivy/vagrant,sideci-sample/sideci-sample-vagrant,mitchellh/vagrant,mwarren/vagrant,gbarberi/vagrant,tomfanning/vagrant,gbarberi/vagrant,vamegh/vagrant,shtouff/vagrant,kalabiyau/vagrant,muhanadra/vagrant,loren-osborn/vagrant,sax/vagrant,johntron/vagrant,Ninir/vagrant,ArloL/vagrant,Chhed13/vagrant,senglin/vagrant,modulexcite/vagrant,darkn3rd/vagrant,benh57/vagrant,fnewberg/vagrant,mkuzmin/vagrant,Sgoettschkes/vagrant,jberends/vagrant,ferventcoder/vagrant,webcoyote/vagrant,bdwyertech/vagrant,jtopper/vagrant,legal90/vagrant,johntron/vagrant,signed8bit/vagrant,tomfanning/vagrant,lukebakken/vagrant,kamazee/vagrant,sideci-sample/sideci-sample-vagrant,lonniev/vagrant,jean/vagrant,bdwyertech/vagrant,ianmiell/vagrant,genome21/vagrant,bheuvel/vagrant,p0deje/vagrant,tbarrongh/vagrant,taliesins/vagrant,ferventcoder/vagrant,mwrock/vagrant,Ninir/vagrant,pwnall/vagrant,mwrock/vagrant,jtopper/vagrant,iNecas/vagrant,petems/vagrant,sax/vagrant,teotihuacanada/vagrant,lonniev/vagrant,cgvarela/vagrant,obnoxxx/vagrant,PatOShea/vagrant,otagi/vagrant,wkolean/vagrant,darkn3rd/vagrant,tomfanning/vagrant,darkn3rd/vagrant,jean/vagrant,jfchevrette/vagrant,ArloL/vagrant,ArloL/vagrant,philwrenn/vagrant,apertoso/vagrant,crashlytics/vagrant,legal90/vagrant,clinstid/vagrant,rivy/vagrant,kamigerami/vagrant,blueyed/vagrant,mpoeter/vagrant,chrisvire/vagrant
ruby
## Code Before: require File.expand_path("../../base", __FILE__) describe Vagrant::SSH do context "check_key_permissions" do let(:key_path) { File.expand_path("../id_rsa", __FILE__) } let(:ssh_instance) { Vagrant::SSH.new(double) } before(:each) do File.open(key_path, 'w') do |file| file.write("hello!") end File.chmod(644, key_path) end after(:each) do FileUtils.rm(key_path) end it "should not raise an exception if we set a keyfile permission correctly" do ssh_instance.check_key_permissions(key_path) end end end ## Instruction: Clean up some of the SSH key tests ## Code After: require File.expand_path("../../base", __FILE__) describe Vagrant::SSH do context "check_key_permissions" do let(:key_path) do # We create a tempfile to guarantee some level of uniqueness # then explicitly close/unlink but save the path so we can re-use temp = Tempfile.new("vagrant") result = Pathname.new(temp.path) temp.close temp.unlink result end let(:ssh_instance) { Vagrant::SSH.new(double) } before(:each) do key_path.open("w") do |f| f.write("hello!") end key_path.chmod(0644) end it "should not raise an exception if we set a keyfile permission correctly" do ssh_instance.check_key_permissions(key_path) end end end
require File.expand_path("../../base", __FILE__) describe Vagrant::SSH do context "check_key_permissions" do - let(:key_path) { File.expand_path("../id_rsa", __FILE__) } + let(:key_path) do + # We create a tempfile to guarantee some level of uniqueness + # then explicitly close/unlink but save the path so we can re-use + temp = Tempfile.new("vagrant") + result = Pathname.new(temp.path) + temp.close + temp.unlink + + result + end + let(:ssh_instance) { Vagrant::SSH.new(double) } before(:each) do - File.open(key_path, 'w') do |file| + key_path.open("w") do |f| - file.write("hello!") ? --- + f.write("hello!") end - File.chmod(644, key_path) - end + key_path.chmod(0644) - after(:each) do - FileUtils.rm(key_path) end it "should not raise an exception if we set a keyfile permission correctly" do ssh_instance.check_key_permissions(key_path) end - end end
22
0.88
14
8
36217d356e801433b69183cf44e77df5d4bc4d7d
app/models/review.rb
app/models/review.rb
class Review < ApplicationRecord belongs_to :user belongs_to :restaurant has_many :review_cuisines has_many :cuisines, through: :review_cuisines validates_presence_of :restaurant_name, :date_visited, :rating validates :content, presence: true, length: { minimum: 10 } def restaurant_name #No db column for restaurant_name in Reviews table self.restaurant.name if self.restaurant end def restaurant_name=(name) #custom attribute writer to nested form for new Review (child) self.restaurant = Restaurant.find_or_create_by(name: name) #Restaurant (parent) end def cuisines_attributes=(cuisine_attributes) #custom attribute writer to save attr through Cuisine (parent); colc not needed for CAW. cuisine_attributes.values.each do |cuisine_attribute| #shadowing attr cuisine-name to check Cuisine exists & in-memory for Review model. cuisine = Cuisine.find_or_create_by(cuisine_attribute) #avoid duplicate cuisines self.cuisines << cuisine end end def self.by_user(user_id) #For filter search by User where(user: user_id) end def self.top_reviews(rating) #Top reviews where Excellent rating where(rating: "Excellent") end def self.order_by_date_visited Review.order(date_visited: :desc) #ActiveRecord method to order by most recent visit date end end
class Review < ApplicationRecord belongs_to :user belongs_to :restaurant has_many :review_cuisines has_many :cuisines, through: :review_cuisines before_save { self.restaurant_name = restaurant_name.upcase_first } validates_presence_of :restaurant_name, :date_visited, :rating validates :content, presence: true, length: { minimum: 10 } def restaurant_name #No db column for restaurant_name in Reviews table self.restaurant.name if self.restaurant end def restaurant_name=(name) #custom attribute writer to nested form for new Review (child) self.restaurant = Restaurant.find_or_create_by(name: name) #Restaurant (parent) end def cuisines_attributes=(cuisine_attributes) #custom attribute writer to save attr through Cuisine (parent); colc not needed for CAW. cuisine_attributes.values.each do |cuisine_attribute| #shadowing attr cuisine-name to check Cuisine exists & in-memory for Review model. cuisine = Cuisine.find_or_create_by(cuisine_attribute) #avoid duplicate cuisines self.cuisines << cuisine end end def self.by_user(user_id) #For filter search by User where(user: user_id) end def self.top_reviews(rating) #Top reviews where Excellent rating where(rating: "Excellent") end def self.order_by_date_visited Review.order(date_visited: :desc) #ActiveRecord method to order by most recent visit date end end
Add before_save { self.restaurant_name to capitalize first letter
Add before_save { self.restaurant_name to capitalize first letter
Ruby
mit
jffernan/rails-my-restaurant-review,jffernan/rails-my-restaurant-review,jffernan/rails-my-restaurant-review
ruby
## Code Before: class Review < ApplicationRecord belongs_to :user belongs_to :restaurant has_many :review_cuisines has_many :cuisines, through: :review_cuisines validates_presence_of :restaurant_name, :date_visited, :rating validates :content, presence: true, length: { minimum: 10 } def restaurant_name #No db column for restaurant_name in Reviews table self.restaurant.name if self.restaurant end def restaurant_name=(name) #custom attribute writer to nested form for new Review (child) self.restaurant = Restaurant.find_or_create_by(name: name) #Restaurant (parent) end def cuisines_attributes=(cuisine_attributes) #custom attribute writer to save attr through Cuisine (parent); colc not needed for CAW. cuisine_attributes.values.each do |cuisine_attribute| #shadowing attr cuisine-name to check Cuisine exists & in-memory for Review model. cuisine = Cuisine.find_or_create_by(cuisine_attribute) #avoid duplicate cuisines self.cuisines << cuisine end end def self.by_user(user_id) #For filter search by User where(user: user_id) end def self.top_reviews(rating) #Top reviews where Excellent rating where(rating: "Excellent") end def self.order_by_date_visited Review.order(date_visited: :desc) #ActiveRecord method to order by most recent visit date end end ## Instruction: Add before_save { self.restaurant_name to capitalize first letter ## Code After: class Review < ApplicationRecord belongs_to :user belongs_to :restaurant has_many :review_cuisines has_many :cuisines, through: :review_cuisines before_save { self.restaurant_name = restaurant_name.upcase_first } validates_presence_of :restaurant_name, :date_visited, :rating validates :content, presence: true, length: { minimum: 10 } def restaurant_name #No db column for restaurant_name in Reviews table self.restaurant.name if self.restaurant end def restaurant_name=(name) #custom attribute writer to nested form for new Review (child) self.restaurant = Restaurant.find_or_create_by(name: name) #Restaurant (parent) end def cuisines_attributes=(cuisine_attributes) #custom attribute writer to save attr through Cuisine (parent); colc not needed for CAW. cuisine_attributes.values.each do |cuisine_attribute| #shadowing attr cuisine-name to check Cuisine exists & in-memory for Review model. cuisine = Cuisine.find_or_create_by(cuisine_attribute) #avoid duplicate cuisines self.cuisines << cuisine end end def self.by_user(user_id) #For filter search by User where(user: user_id) end def self.top_reviews(rating) #Top reviews where Excellent rating where(rating: "Excellent") end def self.order_by_date_visited Review.order(date_visited: :desc) #ActiveRecord method to order by most recent visit date end end
class Review < ApplicationRecord belongs_to :user belongs_to :restaurant has_many :review_cuisines has_many :cuisines, through: :review_cuisines - + + before_save { self.restaurant_name = restaurant_name.upcase_first } + validates_presence_of :restaurant_name, :date_visited, :rating validates :content, presence: true, length: { minimum: 10 } def restaurant_name #No db column for restaurant_name in Reviews table self.restaurant.name if self.restaurant end def restaurant_name=(name) #custom attribute writer to nested form for new Review (child) self.restaurant = Restaurant.find_or_create_by(name: name) #Restaurant (parent) end def cuisines_attributes=(cuisine_attributes) #custom attribute writer to save attr through Cuisine (parent); colc not needed for CAW. cuisine_attributes.values.each do |cuisine_attribute| #shadowing attr cuisine-name to check Cuisine exists & in-memory for Review model. cuisine = Cuisine.find_or_create_by(cuisine_attribute) #avoid duplicate cuisines self.cuisines << cuisine end end def self.by_user(user_id) #For filter search by User where(user: user_id) end def self.top_reviews(rating) #Top reviews where Excellent rating where(rating: "Excellent") end def self.order_by_date_visited Review.order(date_visited: :desc) #ActiveRecord method to order by most recent visit date end end
4
0.105263
3
1
00ee7549c900d8c3bcae94141a8b8c774d943731
examples/new_member.py
examples/new_member.py
import discord class MyClient(discord.Client): async def on_ready(self): print('Logged in as') print(self.user.name) print(self.user.id) print('------') async def on_member_join(self, member): guild = member.guild await guild.default_channel.send('Welcome {0.mention} to {1.name}!'.format(member, guild)) client = MyClient() client.run('token')
import discord class MyClient(discord.Client): async def on_ready(self): print('Logged in as') print(self.user.name) print(self.user.id) print('------') async def on_member_join(self, member): guild = member.guild if guild.system_channel is not None: to_send = 'Welcome {0.mention} to {1.name}!'.format(member, guild) await guild.system_channel.send(to_send) client = MyClient() client.run('token')
Update new member example to not be broken.
Update new member example to not be broken. Took forever but better late than never.
Python
mit
imayhaveborkedit/discord.py,Harmon758/discord.py,Rapptz/discord.py,Harmon758/discord.py,khazhyk/discord.py,rapptz/discord.py
python
## Code Before: import discord class MyClient(discord.Client): async def on_ready(self): print('Logged in as') print(self.user.name) print(self.user.id) print('------') async def on_member_join(self, member): guild = member.guild await guild.default_channel.send('Welcome {0.mention} to {1.name}!'.format(member, guild)) client = MyClient() client.run('token') ## Instruction: Update new member example to not be broken. Took forever but better late than never. ## Code After: import discord class MyClient(discord.Client): async def on_ready(self): print('Logged in as') print(self.user.name) print(self.user.id) print('------') async def on_member_join(self, member): guild = member.guild if guild.system_channel is not None: to_send = 'Welcome {0.mention} to {1.name}!'.format(member, guild) await guild.system_channel.send(to_send) client = MyClient() client.run('token')
import discord class MyClient(discord.Client): async def on_ready(self): print('Logged in as') print(self.user.name) print(self.user.id) print('------') async def on_member_join(self, member): guild = member.guild + if guild.system_channel is not None: - await guild.default_channel.send('Welcome {0.mention} to {1.name}!'.format(member, guild)) ? ^^^^ ^^^^^^^^^^^^^^ -------- ^ - + to_send = 'Welcome {0.mention} to {1.name}!'.format(member, guild) ? ^^^^ ^ ^^^ + await guild.system_channel.send(to_send) + client = MyClient() client.run('token')
5
0.333333
4
1
c2a4e9464cc1c21e7a3ceb74647df07bf7b26865
index.js
index.js
var resourceful = require('resourceful'); var Riak = resourceful.engines.Riak = function(config) { if(config && config.bucket) { this.bucket = config.bucket; } else { throw new Error('bucket must be set in the config for each model.') } this.db = require('riak-js').getClient(config); this.cache = new resourceful.Cache(); } Riak.prototype.protocol = 'riak'; Riak.prototype.save = function (key, val, callback) { this.db.save(this.bucket, key, val, {}, callback); }; Riak.prototype.get = function (key, callback) { this.db.get(this.bucket, key, {}, function(e, value, meta) { value._id = meta.key; callback(e, value); }); } Riak.prototype.update = function(key, val, callback) { var that = this; that.get(key, function(err, old) { that.save(key, resourceful.mixin(old, val), callback); }); } Riak.prototype.all = function(callback) { this.db.getAll(this.bucket, callback); } Riak.prototype.destroy = function(key, callback) { this.db.remove(this.bucket, key, callback); }
var resourceful = require('resourceful'); var Riak = resourceful.engines.Riak = function(config) { if(config && config.bucket) { this.bucket = config.bucket; } else { throw new Error('bucket must be set in the config for each model.') } this.db = require('riak-js').getClient(config); this.cache = new resourceful.Cache(); } Riak.prototype.protocol = 'riak'; Riak.prototype.save = function (key, val, callback) { this.db.save(this.bucket, key, val, {}, callback); }; Riak.prototype.get = function (key, callback) { this.db.get(this.bucket, key, {}, function(e, value, meta) { value._id = meta.key; callback(e, value); }); } Riak.prototype.update = function(key, val, callback) { var that = this; that.get(key, function(err, old) { that.save(key, resourceful.mixin(old, val), callback); }); } Riak.prototype.all = function(callback) { this.db.getAll(this.bucket, function(e, all) { if(e) { callback(e); } else { var models = all.map(function(obj) { return obj.data; }); callback(null, models); } }); } Riak.prototype.destroy = function(key, callback) { this.db.remove(this.bucket, key, callback); }
Make Model.all work as expected.
Make Model.all work as expected.
JavaScript
apache-2.0
admazely/resourceful-riak
javascript
## Code Before: var resourceful = require('resourceful'); var Riak = resourceful.engines.Riak = function(config) { if(config && config.bucket) { this.bucket = config.bucket; } else { throw new Error('bucket must be set in the config for each model.') } this.db = require('riak-js').getClient(config); this.cache = new resourceful.Cache(); } Riak.prototype.protocol = 'riak'; Riak.prototype.save = function (key, val, callback) { this.db.save(this.bucket, key, val, {}, callback); }; Riak.prototype.get = function (key, callback) { this.db.get(this.bucket, key, {}, function(e, value, meta) { value._id = meta.key; callback(e, value); }); } Riak.prototype.update = function(key, val, callback) { var that = this; that.get(key, function(err, old) { that.save(key, resourceful.mixin(old, val), callback); }); } Riak.prototype.all = function(callback) { this.db.getAll(this.bucket, callback); } Riak.prototype.destroy = function(key, callback) { this.db.remove(this.bucket, key, callback); } ## Instruction: Make Model.all work as expected. ## Code After: var resourceful = require('resourceful'); var Riak = resourceful.engines.Riak = function(config) { if(config && config.bucket) { this.bucket = config.bucket; } else { throw new Error('bucket must be set in the config for each model.') } this.db = require('riak-js').getClient(config); this.cache = new resourceful.Cache(); } Riak.prototype.protocol = 'riak'; Riak.prototype.save = function (key, val, callback) { this.db.save(this.bucket, key, val, {}, callback); }; Riak.prototype.get = function (key, callback) { this.db.get(this.bucket, key, {}, function(e, value, meta) { value._id = meta.key; callback(e, value); }); } Riak.prototype.update = function(key, val, callback) { var that = this; that.get(key, function(err, old) { that.save(key, resourceful.mixin(old, val), callback); }); } Riak.prototype.all = function(callback) { this.db.getAll(this.bucket, function(e, all) { if(e) { callback(e); } else { var models = all.map(function(obj) { return obj.data; }); callback(null, models); } }); } Riak.prototype.destroy = function(key, callback) { this.db.remove(this.bucket, key, callback); }
var resourceful = require('resourceful'); var Riak = resourceful.engines.Riak = function(config) { if(config && config.bucket) { this.bucket = config.bucket; } else { throw new Error('bucket must be set in the config for each model.') } this.db = require('riak-js').getClient(config); this.cache = new resourceful.Cache(); } Riak.prototype.protocol = 'riak'; Riak.prototype.save = function (key, val, callback) { this.db.save(this.bucket, key, val, {}, callback); }; Riak.prototype.get = function (key, callback) { this.db.get(this.bucket, key, {}, function(e, value, meta) { value._id = meta.key; callback(e, value); }); } Riak.prototype.update = function(key, val, callback) { var that = this; that.get(key, function(err, old) { that.save(key, resourceful.mixin(old, val), callback); }); } Riak.prototype.all = function(callback) { - this.db.getAll(this.bucket, callback); ? ---- ^ + this.db.getAll(this.bucket, function(e, all) { ? +++ ++++++++ ^^ + if(e) { + callback(e); + } else { + var models = all.map(function(obj) { + return obj.data; + }); + callback(null, models); + } + }); } Riak.prototype.destroy = function(key, callback) { this.db.remove(this.bucket, key, callback); }
11
0.268293
10
1
21248480e1332125d91b19a2f74d7e592ee453f4
README.md
README.md
A simple [Buildkite](https://buildkite.com/) Docker plugin allowing you to run a command in a Docker container. If you need more control, please see the [docker-compose Buildkite Plugin](https://github.com/buildkite-plugins/docker-compose-buildkite-plugin). ## Example The following pipeline will run `yarn install` and `yarn run test` inside a Docker container using the [node:7 Docker image](https://hub.docker.com/_/node/): ```yml steps: - command: yarn install && yarn run test plugins: docker#v1.0.0: image: "node:7" workdir: /app ``` ## Configuration ### `image` The name of the Docker image to use. For example, `node:7`. ### `workdir` The working directory where the pipeline’s code will be mounted to, and run from, inside the container. For example, `/app`. ## License MIT (see [LICENSE](LICENSE))
A [Buildkite](https://buildkite.com/) Docker plugin allowing you to run a command in a [Docker](https://www.docker.com/) container. If you need more control, please see the [docker-compose Buildkite Plugin](https://github.com/buildkite-plugins/docker-compose-buildkite-plugin). ## Example The following pipeline will run `yarn install` and `yarn run test` inside a Docker container using the [node:7 Docker image](https://hub.docker.com/_/node/): ```yml steps: - command: yarn install && yarn run test plugins: docker#v1.0.0: image: "node:7" workdir: /app ``` ## Configuration ### `image` (required) The name of the Docker image to use. Example: `node:7` ### `workdir` (required) The working directory where the pipeline’s code will be mounted to, and run from, inside the container. Example: `/app` ## License MIT (see [LICENSE](LICENSE))
Clean up readme a little
Clean up readme a little
Markdown
mit
mikeknox/docker-buildkite-plugin
markdown
## Code Before: A simple [Buildkite](https://buildkite.com/) Docker plugin allowing you to run a command in a Docker container. If you need more control, please see the [docker-compose Buildkite Plugin](https://github.com/buildkite-plugins/docker-compose-buildkite-plugin). ## Example The following pipeline will run `yarn install` and `yarn run test` inside a Docker container using the [node:7 Docker image](https://hub.docker.com/_/node/): ```yml steps: - command: yarn install && yarn run test plugins: docker#v1.0.0: image: "node:7" workdir: /app ``` ## Configuration ### `image` The name of the Docker image to use. For example, `node:7`. ### `workdir` The working directory where the pipeline’s code will be mounted to, and run from, inside the container. For example, `/app`. ## License MIT (see [LICENSE](LICENSE)) ## Instruction: Clean up readme a little ## Code After: A [Buildkite](https://buildkite.com/) Docker plugin allowing you to run a command in a [Docker](https://www.docker.com/) container. If you need more control, please see the [docker-compose Buildkite Plugin](https://github.com/buildkite-plugins/docker-compose-buildkite-plugin). ## Example The following pipeline will run `yarn install` and `yarn run test` inside a Docker container using the [node:7 Docker image](https://hub.docker.com/_/node/): ```yml steps: - command: yarn install && yarn run test plugins: docker#v1.0.0: image: "node:7" workdir: /app ``` ## Configuration ### `image` (required) The name of the Docker image to use. Example: `node:7` ### `workdir` (required) The working directory where the pipeline’s code will be mounted to, and run from, inside the container. Example: `/app` ## License MIT (see [LICENSE](LICENSE))
- A simple [Buildkite](https://buildkite.com/) Docker plugin allowing you to run a command in a Docker container. If you need more control, please see the [docker-compose Buildkite Plugin](https://github.com/buildkite-plugins/docker-compose-buildkite-plugin). + A [Buildkite](https://buildkite.com/) Docker plugin allowing you to run a command in a [Docker](https://www.docker.com/) container. + + If you need more control, please see the [docker-compose Buildkite Plugin](https://github.com/buildkite-plugins/docker-compose-buildkite-plugin). ## Example The following pipeline will run `yarn install` and `yarn run test` inside a Docker container using the [node:7 Docker image](https://hub.docker.com/_/node/): ```yml steps: - command: yarn install && yarn run test plugins: docker#v1.0.0: image: "node:7" workdir: /app ``` ## Configuration - ### `image` + ### `image` (required) - The name of the Docker image to use. For example, `node:7`. ? ----------------------- + The name of the Docker image to use. - ### `workdir` + Example: `node:7` + ### `workdir` (required) + - The working directory where the pipeline’s code will be mounted to, and run from, inside the container. For example, `/app`. ? --------------------- + The working directory where the pipeline’s code will be mounted to, and run from, inside the container. + + Example: `/app` ## License MIT (see [LICENSE](LICENSE))
16
0.551724
11
5
3a755c2b4eebb5aa52cc198a7a5f49e30b2f67eb
heronsis-hermnonicii/index.html
heronsis-hermnonicii/index.html
<!DOCTYPE html> <head> <meta charset="utf-8"> <title>Heronsis Hermnonicii</title> <style> #canvas { border: 1px solid blue; } </style> </head> <body> <h1>Heronsis Hermnonicii</h1> <div style="text-align:center"> <canvas id="canvas" width="1200" height="400"> Your browser doesn't support displaying an HTML5 canvas. </canvas> <p>PLATE I. THE ORGANIZATION OF COLLAPSED CLARKSON'S ENTITIES (<i>Heronsis hermnonicii</i>) INTO PROTO-COHORTS AS A RUDIMENTARY METHOD OF PHYSIOGNOMETRIC DEFENCE</p> </div> </body> <script src="yoob/sprite-manager.js"></script> <script src="heronsis-hermnonicii.js"></script> <script> var t = new HeronsisHermnonicii(); t.init(document.getElementById('canvas')); </script>
<!DOCTYPE html> <head> <meta charset="utf-8"> <title>Heronsis Hermnonicii</title> <style> #canvas { border: 1px solid blue; } </style> </head> <body> <h1>Heronsis Hermnonicii</h1> <div style="text-align:center"> <canvas id="canvas" width="1200" height="400"> Your browser doesn't support displaying an HTML5 canvas. </canvas> <p>PLATE I. THE ORGANIZATION OF COLLAPSED CLARKSON'S ENTITIES (<i>Heronsis hermnonicii</i>) INTO PROTO-COHORTS AS A RUDIMENTARY METHOD OF PHYSIOGNOMETRIC DEFENCE</p> </div> </body> <script src="../common-yoob.js-0.5/animation-frame.js"></script> <script src="../common-yoob.js-0.5/sprite-manager.js"></script> <script src="heronsis-hermnonicii.js"></script> <script> var t = new HeronsisHermnonicii(); t.init(document.getElementById('canvas')); </script>
Fix links to Javascript files.
Fix links to Javascript files.
HTML
unlicense
catseye/HTML5-Gewgaws,catseye/HTML5-Gewgaws,catseye/HTML5-Gewgaws
html
## Code Before: <!DOCTYPE html> <head> <meta charset="utf-8"> <title>Heronsis Hermnonicii</title> <style> #canvas { border: 1px solid blue; } </style> </head> <body> <h1>Heronsis Hermnonicii</h1> <div style="text-align:center"> <canvas id="canvas" width="1200" height="400"> Your browser doesn't support displaying an HTML5 canvas. </canvas> <p>PLATE I. THE ORGANIZATION OF COLLAPSED CLARKSON'S ENTITIES (<i>Heronsis hermnonicii</i>) INTO PROTO-COHORTS AS A RUDIMENTARY METHOD OF PHYSIOGNOMETRIC DEFENCE</p> </div> </body> <script src="yoob/sprite-manager.js"></script> <script src="heronsis-hermnonicii.js"></script> <script> var t = new HeronsisHermnonicii(); t.init(document.getElementById('canvas')); </script> ## Instruction: Fix links to Javascript files. ## Code After: <!DOCTYPE html> <head> <meta charset="utf-8"> <title>Heronsis Hermnonicii</title> <style> #canvas { border: 1px solid blue; } </style> </head> <body> <h1>Heronsis Hermnonicii</h1> <div style="text-align:center"> <canvas id="canvas" width="1200" height="400"> Your browser doesn't support displaying an HTML5 canvas. </canvas> <p>PLATE I. THE ORGANIZATION OF COLLAPSED CLARKSON'S ENTITIES (<i>Heronsis hermnonicii</i>) INTO PROTO-COHORTS AS A RUDIMENTARY METHOD OF PHYSIOGNOMETRIC DEFENCE</p> </div> </body> <script src="../common-yoob.js-0.5/animation-frame.js"></script> <script src="../common-yoob.js-0.5/sprite-manager.js"></script> <script src="heronsis-hermnonicii.js"></script> <script> var t = new HeronsisHermnonicii(); t.init(document.getElementById('canvas')); </script>
<!DOCTYPE html> <head> <meta charset="utf-8"> <title>Heronsis Hermnonicii</title> <style> #canvas { border: 1px solid blue; } </style> </head> <body> <h1>Heronsis Hermnonicii</h1> <div style="text-align:center"> <canvas id="canvas" width="1200" height="400"> Your browser doesn't support displaying an HTML5 canvas. </canvas> <p>PLATE I. THE ORGANIZATION OF COLLAPSED CLARKSON'S ENTITIES (<i>Heronsis hermnonicii</i>) INTO PROTO-COHORTS AS A RUDIMENTARY METHOD OF PHYSIOGNOMETRIC DEFENCE</p> </div> </body> + <script src="../common-yoob.js-0.5/animation-frame.js"></script> - <script src="yoob/sprite-manager.js"></script> + <script src="../common-yoob.js-0.5/sprite-manager.js"></script> ? ++++++++++ +++++++ <script src="heronsis-hermnonicii.js"></script> <script> var t = new HeronsisHermnonicii(); t.init(document.getElementById('canvas')); </script>
3
0.107143
2
1
1c2c478ac6de8c5fc3141c9bc9c09139f9ca8beb
docs/source/index.rst
docs/source/index.rst
============================================ CuPy -- NumPy-like API accelerated with CUDA ============================================ This is the CuPy documentation. .. module:: cupy .. toctree:: :maxdepth: 1 install tutorial/index cupy-reference/index contribution compatibility license Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`
============================================ CuPy -- NumPy-like API accelerated with CUDA ============================================ This is the `CuPy <https://github.com/cupy/cupy>`_ documentation. .. module:: cupy .. toctree:: :maxdepth: 1 install tutorial/index cupy-reference/index contribution compatibility license Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`
Add link to CuPy repository
Add link to CuPy repository
reStructuredText
mit
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
restructuredtext
## Code Before: ============================================ CuPy -- NumPy-like API accelerated with CUDA ============================================ This is the CuPy documentation. .. module:: cupy .. toctree:: :maxdepth: 1 install tutorial/index cupy-reference/index contribution compatibility license Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` ## Instruction: Add link to CuPy repository ## Code After: ============================================ CuPy -- NumPy-like API accelerated with CUDA ============================================ This is the `CuPy <https://github.com/cupy/cupy>`_ documentation. .. module:: cupy .. toctree:: :maxdepth: 1 install tutorial/index cupy-reference/index contribution compatibility license Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`
============================================ CuPy -- NumPy-like API accelerated with CUDA ============================================ - This is the CuPy documentation. + This is the `CuPy <https://github.com/cupy/cupy>`_ documentation. .. module:: cupy .. toctree:: :maxdepth: 1 install tutorial/index cupy-reference/index contribution compatibility license Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search`
2
0.08
1
1
e9a9ac1dfc8898bf5afb577388b16b9f5df295e5
_notes/tool/github_actions.md
_notes/tool/github_actions.md
--- doc: https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions --- ## Setup a basic workflow ```shell mkdir -p .github/workflows touch .github/workflows/continuous-testing.yml ``` Example of basic .yml file: ```yml name: Continuous Testing on: push jobs: unit-test: name: Unit Tests runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Run command run: ls -al ``` `name` is the name of the workflow. `on` is when the workflow is triggered. `jobs.<id>` are run in different machines, in parallel by default. `jobs.<id>.name` is the name of the job. `jobs.<id>.runs-on` is the OS of the machine. `jobs.<id>.steps` each step to complete the job.
--- doc: https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions --- ## Setup a basic workflow ```shell mkdir -p .github/workflows touch .github/workflows/continuous-testing.yml ``` Example of basic .yml file: ```yml name: Continuous Testing on: push jobs: unit-test: name: Unit Tests runs-on: ubuntu-18.04 steps: - name: Checkout uses: actions/checkout@v2 - name: Cache uses: actions/cache@v2 with: path: ~/.cache key: cache - name: Run command run: ls -al ``` `name` is the name of the workflow. `on` is when the workflow is triggered. `jobs.<id>` are run in different machines, in parallel by default. `jobs.<id>.name` is the name of the job. `jobs.<id>.runs-on` is the OS of the machine. `jobs.<id>.steps` each step to complete the job. ### Actions - [Checkout](https://github.com/actions/checkout): Action for checking out a repo. - [Cache](https://github.com/actions/cache): Cache dependencies and build outputs. - [Pyenv](https://github.com/gabrielfalcao/pyenv-action): Enables pyenv within your workflow.
Update notes for GitHub Actions
Update notes for GitHub Actions
Markdown
mit
Yutsuten/Yutsuten.github.io,Yutsuten/Yutsuten.github.io,Yutsuten/Yutsuten.github.io
markdown
## Code Before: --- doc: https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions --- ## Setup a basic workflow ```shell mkdir -p .github/workflows touch .github/workflows/continuous-testing.yml ``` Example of basic .yml file: ```yml name: Continuous Testing on: push jobs: unit-test: name: Unit Tests runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v2 - name: Run command run: ls -al ``` `name` is the name of the workflow. `on` is when the workflow is triggered. `jobs.<id>` are run in different machines, in parallel by default. `jobs.<id>.name` is the name of the job. `jobs.<id>.runs-on` is the OS of the machine. `jobs.<id>.steps` each step to complete the job. ## Instruction: Update notes for GitHub Actions ## Code After: --- doc: https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions --- ## Setup a basic workflow ```shell mkdir -p .github/workflows touch .github/workflows/continuous-testing.yml ``` Example of basic .yml file: ```yml name: Continuous Testing on: push jobs: unit-test: name: Unit Tests runs-on: ubuntu-18.04 steps: - name: Checkout uses: actions/checkout@v2 - name: Cache uses: actions/cache@v2 with: path: ~/.cache key: cache - name: Run command run: ls -al ``` `name` is the name of the workflow. `on` is when the workflow is triggered. `jobs.<id>` are run in different machines, in parallel by default. `jobs.<id>.name` is the name of the job. `jobs.<id>.runs-on` is the OS of the machine. `jobs.<id>.steps` each step to complete the job. ### Actions - [Checkout](https://github.com/actions/checkout): Action for checking out a repo. - [Cache](https://github.com/actions/cache): Cache dependencies and build outputs. - [Pyenv](https://github.com/gabrielfalcao/pyenv-action): Enables pyenv within your workflow.
--- doc: https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions --- ## Setup a basic workflow ```shell mkdir -p .github/workflows touch .github/workflows/continuous-testing.yml ``` Example of basic .yml file: ```yml name: Continuous Testing on: push jobs: unit-test: name: Unit Tests - runs-on: ubuntu-latest ? ^^^^^^ + runs-on: ubuntu-18.04 ? ^^^^^ steps: - - name: Checkout repository ? ----------- + - name: Checkout uses: actions/checkout@v2 + - name: Cache + uses: actions/cache@v2 + with: + path: ~/.cache + key: cache - name: Run command run: ls -al ``` `name` is the name of the workflow. `on` is when the workflow is triggered. `jobs.<id>` are run in different machines, in parallel by default. `jobs.<id>.name` is the name of the job. `jobs.<id>.runs-on` is the OS of the machine. `jobs.<id>.steps` each step to complete the job. + + ### Actions + + - [Checkout](https://github.com/actions/checkout): Action for checking out a repo. + - [Cache](https://github.com/actions/cache): Cache dependencies and build outputs. + - [Pyenv](https://github.com/gabrielfalcao/pyenv-action): Enables pyenv within your workflow.
15
0.441176
13
2
20ec37ba3e3b28b9f86a6a94b0f53c89059587fe
lib/resque/vendor/utf8_util/utf8_util_19.rb
lib/resque/vendor/utf8_util/utf8_util_19.rb
module UTF8Util def self.clean!(str) str.force_encoding("binary").encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => REPLACEMENT_CHAR) end end
module UTF8Util def self.clean!(str) return str if str.encoding.to_s == "UTF-8" str.force_encoding("binary").encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => REPLACEMENT_CHAR) end end
Add check encoding to UTF8Util::clean!
Add check encoding to UTF8Util::clean!
Ruby
mit
CloudVLab/resque,resque/resque,coupa/resque,resque/resque,coupa/resque,CloudVLab/resque,xiangzhuyuan/resque,Shopify/resque,xiangzhuyuan/resque,resque/resque,Shopify/resque,Shopify/resque,xiangzhuyuan/resque,CloudVLab/resque,coupa/resque
ruby
## Code Before: module UTF8Util def self.clean!(str) str.force_encoding("binary").encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => REPLACEMENT_CHAR) end end ## Instruction: Add check encoding to UTF8Util::clean! ## Code After: module UTF8Util def self.clean!(str) return str if str.encoding.to_s == "UTF-8" str.force_encoding("binary").encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => REPLACEMENT_CHAR) end end
module UTF8Util def self.clean!(str) + return str if str.encoding.to_s == "UTF-8" str.force_encoding("binary").encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => REPLACEMENT_CHAR) end end
1
0.2
1
0
afc959e23f21e086f710cbc7f3bb56d0b4d93329
bin/set_deploy_permissions.py
bin/set_deploy_permissions.py
import os import sys import subprocess server_writable_directories = [ "vendor/solr/apache-solr-4.0.0/example/solr/collection1/data/", "vendor/solr/apache-solr-4.0.0/example/solr-webapp/", "lib/dotstorm/assets/dotstorm/uploads/", "lib/www/assets/group_logos/", "lib/www/assets/user_icons/", ] BASE = os.path.join(os.path.dirname(__file__), "..") def set_permissions(user): for path in server_writable_directories: print user, path if not os.path.exists(path): os.makedirs(path) subprocess.check_call(["chown", "-R", user, os.path.join(BASE, path)]) if __name__ == "__main__": try: target_user = sys.argv[1] except IndexError: print "Missing required parameter `target user`." print "Usage: set_deploy_permissions.py [username]" sys.exit(1) set_permissions(target_user)
import os import sys import subprocess server_writable_directories = [ "vendor/solr/apache-solr-4.0.0/example/solr/collection1/data/", "vendor/solr/apache-solr-4.0.0/example/solr-webapp/", "lib/dotstorm/assets/dotstorm/uploads/", "lib/www/assets/group_logos/", "lib/www/assets/user_icons/", "builtAssets/", ] BASE = os.path.join(os.path.dirname(__file__), "..") def set_permissions(user): for path in server_writable_directories: print user, path if not os.path.exists(path): os.makedirs(path) subprocess.check_call(["chown", "-R", user, os.path.join(BASE, path)]) if __name__ == "__main__": try: target_user = sys.argv[1] except IndexError: print "Missing required parameter `target user`." print "Usage: set_deploy_permissions.py [username]" sys.exit(1) set_permissions(target_user)
Add builtAssets to webserver-writable dirs
Add builtAssets to webserver-writable dirs
Python
bsd-2-clause
yourcelf/intertwinkles,yourcelf/intertwinkles
python
## Code Before: import os import sys import subprocess server_writable_directories = [ "vendor/solr/apache-solr-4.0.0/example/solr/collection1/data/", "vendor/solr/apache-solr-4.0.0/example/solr-webapp/", "lib/dotstorm/assets/dotstorm/uploads/", "lib/www/assets/group_logos/", "lib/www/assets/user_icons/", ] BASE = os.path.join(os.path.dirname(__file__), "..") def set_permissions(user): for path in server_writable_directories: print user, path if not os.path.exists(path): os.makedirs(path) subprocess.check_call(["chown", "-R", user, os.path.join(BASE, path)]) if __name__ == "__main__": try: target_user = sys.argv[1] except IndexError: print "Missing required parameter `target user`." print "Usage: set_deploy_permissions.py [username]" sys.exit(1) set_permissions(target_user) ## Instruction: Add builtAssets to webserver-writable dirs ## Code After: import os import sys import subprocess server_writable_directories = [ "vendor/solr/apache-solr-4.0.0/example/solr/collection1/data/", "vendor/solr/apache-solr-4.0.0/example/solr-webapp/", "lib/dotstorm/assets/dotstorm/uploads/", "lib/www/assets/group_logos/", "lib/www/assets/user_icons/", "builtAssets/", ] BASE = os.path.join(os.path.dirname(__file__), "..") def set_permissions(user): for path in server_writable_directories: print user, path if not os.path.exists(path): os.makedirs(path) subprocess.check_call(["chown", "-R", user, os.path.join(BASE, path)]) if __name__ == "__main__": try: target_user = sys.argv[1] except IndexError: print "Missing required parameter `target user`." print "Usage: set_deploy_permissions.py [username]" sys.exit(1) set_permissions(target_user)
import os import sys import subprocess server_writable_directories = [ "vendor/solr/apache-solr-4.0.0/example/solr/collection1/data/", "vendor/solr/apache-solr-4.0.0/example/solr-webapp/", "lib/dotstorm/assets/dotstorm/uploads/", "lib/www/assets/group_logos/", "lib/www/assets/user_icons/", + "builtAssets/", ] BASE = os.path.join(os.path.dirname(__file__), "..") def set_permissions(user): for path in server_writable_directories: print user, path if not os.path.exists(path): os.makedirs(path) subprocess.check_call(["chown", "-R", user, os.path.join(BASE, path)]) if __name__ == "__main__": try: target_user = sys.argv[1] except IndexError: print "Missing required parameter `target user`." print "Usage: set_deploy_permissions.py [username]" sys.exit(1) set_permissions(target_user)
1
0.035714
1
0
028f4383cd4c861ee76a26f389d80698355db46c
lms/templates/registration/activate_account_notice.html
lms/templates/registration/activate_account_notice.html
<%! from django.utils.translation import ugettext as _ %> <div class="wrapper-msg urgency-high"> <div class="msg"> <div class="msg-content"> <h2 class="title">${_("Thanks for Registering!")}</h2> <div class="copy"> <p class='activation-message'>${_( "You've successfully created an account on {platform_name}. We've sent an account " "activation message to {email}. To activate your account and start enrolling in " "courses, click the link in the message." ).format( email="<strong>{}</strong>".format(email), platform_name=platform_name, )} </p> <p> ${_( "If you're unable to find the activation email, " "please check your email account's \"Spam\" or \"Junk\" " "folders to ensure the message was not filtered." )} </p> </div> </div> </div> </div>
<%! from django.utils.translation import ugettext as _ %> <div class="wrapper-msg urgency-high"> <div class="msg"> <div class="msg-content"> <h2 class="title">${_("Just one more step!")}</h2> <div class="copy"> <p class='activation-message'>${_( "We've sent an account activation message to {email}. " "To activate your account on Edraak and start enrolling in " "courses, click the link in the message." ).format( email="<strong>{}</strong>".format(email), platform_name=platform_name, )} </p> <p><strong> ${_( "If you're unable to find the activation email, " "please check your email account's \"Spam\" or \"Junk\" " "folders to ensure the message was not filtered." )} </strong></p> </div> </div> </div> </div>
Change successful registration message text and style.
Change successful registration message text and style.
HTML
agpl-3.0
Edraak/circleci-edx-platform,Edraak/edx-platform,Edraak/edx-platform,Edraak/circleci-edx-platform,Edraak/circleci-edx-platform,Edraak/circleci-edx-platform,Edraak/edx-platform,Edraak/edx-platform,Edraak/edx-platform,Edraak/circleci-edx-platform
html
## Code Before: <%! from django.utils.translation import ugettext as _ %> <div class="wrapper-msg urgency-high"> <div class="msg"> <div class="msg-content"> <h2 class="title">${_("Thanks for Registering!")}</h2> <div class="copy"> <p class='activation-message'>${_( "You've successfully created an account on {platform_name}. We've sent an account " "activation message to {email}. To activate your account and start enrolling in " "courses, click the link in the message." ).format( email="<strong>{}</strong>".format(email), platform_name=platform_name, )} </p> <p> ${_( "If you're unable to find the activation email, " "please check your email account's \"Spam\" or \"Junk\" " "folders to ensure the message was not filtered." )} </p> </div> </div> </div> </div> ## Instruction: Change successful registration message text and style. ## Code After: <%! from django.utils.translation import ugettext as _ %> <div class="wrapper-msg urgency-high"> <div class="msg"> <div class="msg-content"> <h2 class="title">${_("Just one more step!")}</h2> <div class="copy"> <p class='activation-message'>${_( "We've sent an account activation message to {email}. " "To activate your account on Edraak and start enrolling in " "courses, click the link in the message." ).format( email="<strong>{}</strong>".format(email), platform_name=platform_name, )} </p> <p><strong> ${_( "If you're unable to find the activation email, " "please check your email account's \"Spam\" or \"Junk\" " "folders to ensure the message was not filtered." )} </strong></p> </div> </div> </div> </div>
<%! from django.utils.translation import ugettext as _ %> <div class="wrapper-msg urgency-high"> <div class="msg"> <div class="msg-content"> - <h2 class="title">${_("Thanks for Registering!")}</h2> ? ^^^ ^^ ^ ---- ^^^^ + <h2 class="title">${_("Just one more step!")}</h2> ? ^^^^^^ ^ ^ + ^ <div class="copy"> <p class='activation-message'>${_( - "You've successfully created an account on {platform_name}. We've sent an account " + "We've sent an account activation message to {email}. " - "activation message to {email}. To activate your account and start enrolling in " ? ------------------------------- + "To activate your account on Edraak and start enrolling in " ? ++++++++++ "courses, click the link in the message." ).format( email="<strong>{}</strong>".format(email), platform_name=platform_name, )} </p> - <p> + <p><strong> ? ++++++++ ${_( "If you're unable to find the activation email, " "please check your email account's \"Spam\" or \"Junk\" " "folders to ensure the message was not filtered." )} - </p> + </strong></p> ? +++++++++ </div> </div> </div> </div>
10
0.384615
5
5
f8e216b91879586d0ab5f9362ec8b5f2db89a410
lib/capistrano/tasks/arpane.rake
lib/capistrano/tasks/arpane.rake
namespace :arpane do namespace :php do task :reload do on roles(:web) do execute "( touch ~/restart_apache_to_clean_apc.txt && inotifywait --event delete --timeout 5 ~/restart_apache_to_clean_apc.txt || [ $? -eq 1 ] )" end end end end
namespace :arpane do namespace :php do task :reload do on roles(:web) do execute "( touch #{shared_path}/restart_apache_to_clean_apc.txt && ( inotifywait --event delete --timeout 5 #{shared_path}/restart_apache_to_clean_apc.txt || [ $? -eq 1 ] ) )" end end end end
Create file in shared path instead to prevent listening the whole user home
Create file in shared path instead to prevent listening the whole user home
Ruby
mit
le-phare/capistrano-lephare
ruby
## Code Before: namespace :arpane do namespace :php do task :reload do on roles(:web) do execute "( touch ~/restart_apache_to_clean_apc.txt && inotifywait --event delete --timeout 5 ~/restart_apache_to_clean_apc.txt || [ $? -eq 1 ] )" end end end end ## Instruction: Create file in shared path instead to prevent listening the whole user home ## Code After: namespace :arpane do namespace :php do task :reload do on roles(:web) do execute "( touch #{shared_path}/restart_apache_to_clean_apc.txt && ( inotifywait --event delete --timeout 5 #{shared_path}/restart_apache_to_clean_apc.txt || [ $? -eq 1 ] ) )" end end end end
namespace :arpane do namespace :php do task :reload do on roles(:web) do - execute "( touch ~/restart_apache_to_clean_apc.txt && inotifywait --event delete --timeout 5 ~/restart_apache_to_clean_apc.txt || [ $? -eq 1 ] )" ? ^ ^ + execute "( touch #{shared_path}/restart_apache_to_clean_apc.txt && ( inotifywait --event delete --timeout 5 #{shared_path}/restart_apache_to_clean_apc.txt || [ $? -eq 1 ] ) )" ? ^^^^^^^^^^^^^^ ++ ^^^^^^^^^^^^^^ ++ end end end end
2
0.222222
1
1
b0f3d3d7da790d71afa2227c03f0fe95232c1a91
locales/pt-PT/server-client-shared.properties
locales/pt-PT/server-client-shared.properties
remixGalleryTitle=Remisture um projeto para começar... ############ ## Editor ## ############ fileSavingIndicator=A guardar... renameProjectSaveBtn=Guardar publishBtn=Publicar publishDeleteBtn=Eliminar versão publicada publishChangesBtn=Atualizar versão publicada
remixGalleryTitle=Remisture um projeto para começar... ############ ## Editor ## ############ fileSavingIndicator=A guardar... renameProjectSaveBtn=Guardar publishBtn=Publicar publishDeleteBtn=Eliminar versão publicada publishChangesBtn=Atualizar versão publicada publishHeader=Publicar o seu projeto publishHeaderOnline=O seu projeto está online
Update Portuguese (Portugal) (pt-PT) localization of Thimble
Pontoon: Update Portuguese (Portugal) (pt-PT) localization of Thimble Localization authors: - Cláudio Esperança <cesperanc@gmail.com>
INI
mpl-2.0
mozilla/thimble.mozilla.org,mozilla/thimble.mozilla.org,mozilla/thimble.mozilla.org,mozilla/thimble.mozilla.org
ini
## Code Before: remixGalleryTitle=Remisture um projeto para começar... ############ ## Editor ## ############ fileSavingIndicator=A guardar... renameProjectSaveBtn=Guardar publishBtn=Publicar publishDeleteBtn=Eliminar versão publicada publishChangesBtn=Atualizar versão publicada ## Instruction: Pontoon: Update Portuguese (Portugal) (pt-PT) localization of Thimble Localization authors: - Cláudio Esperança <cesperanc@gmail.com> ## Code After: remixGalleryTitle=Remisture um projeto para começar... ############ ## Editor ## ############ fileSavingIndicator=A guardar... renameProjectSaveBtn=Guardar publishBtn=Publicar publishDeleteBtn=Eliminar versão publicada publishChangesBtn=Atualizar versão publicada publishHeader=Publicar o seu projeto publishHeaderOnline=O seu projeto está online
remixGalleryTitle=Remisture um projeto para começar... ############ ## Editor ## ############ fileSavingIndicator=A guardar... renameProjectSaveBtn=Guardar publishBtn=Publicar publishDeleteBtn=Eliminar versão publicada publishChangesBtn=Atualizar versão publicada + publishHeader=Publicar o seu projeto + publishHeaderOnline=O seu projeto está online
2
0.166667
2
0
b1779be06b86336355874fa03f89e6ea1d708e23
application/scripts/zap_schema.sh
application/scripts/zap_schema.sh
APPLICATION_ENV=development doctrine orm:schema-tool:drop --force doctrine orm:schema-tool:create /Applications/XAMPP/xamppfiles/bin/php addZendSPProduct.php /Applications/XAMPP/xamppfiles/bin/php addPhp3TierProduct.php
APPLICATION_ENV=development doctrine orm:schema-tool:drop --force doctrine orm:schema-tool:create /Applications/XAMPP/xamppfiles/bin/php addZendSPProduct.php /Applications/XAMPP/xamppfiles/bin/php addPhp3TierProduct.php /Applications/XAMPP/xamppfiles/bin/php addBaseLinuxProduct.php
Add base product to zap schema
Add base product to zap schema
Shell
mit
rgeyer/rs_selfservice,rgeyer/rs_selfservice,rgeyer/rs_selfservice,rgeyer/rs_selfservice,rgeyer/rs_selfservice
shell
## Code Before: APPLICATION_ENV=development doctrine orm:schema-tool:drop --force doctrine orm:schema-tool:create /Applications/XAMPP/xamppfiles/bin/php addZendSPProduct.php /Applications/XAMPP/xamppfiles/bin/php addPhp3TierProduct.php ## Instruction: Add base product to zap schema ## Code After: APPLICATION_ENV=development doctrine orm:schema-tool:drop --force doctrine orm:schema-tool:create /Applications/XAMPP/xamppfiles/bin/php addZendSPProduct.php /Applications/XAMPP/xamppfiles/bin/php addPhp3TierProduct.php /Applications/XAMPP/xamppfiles/bin/php addBaseLinuxProduct.php
APPLICATION_ENV=development doctrine orm:schema-tool:drop --force doctrine orm:schema-tool:create /Applications/XAMPP/xamppfiles/bin/php addZendSPProduct.php /Applications/XAMPP/xamppfiles/bin/php addPhp3TierProduct.php + /Applications/XAMPP/xamppfiles/bin/php addBaseLinuxProduct.php
1
0.125
1
0
478fdcf2be8befd75dd07cd09653d57993836394
data_bags/dirsrv/default.json
data_bags/dirsrv/default.json
{ "id": "default", "userdn": "s4rbe5fVCPa9mpnIEyxdFdUKkV7G3M1twWaZW/JNpJs=\n", "password": "r0+JXQb52Q37SBLlYLaiR5gRFZ/tDQ3TI0gExfSJiZw=\n" }
{ "id": "default", "userdn": "e1fNxVe+5JNdNfG5zZgqG/zQnN9ig8kSeMUCBGvaO4g=\n", "username": "ZzjkpvN07fosm5CMRa9g2w==\n", "password": "G5QZWCuLXxQuxRUXqV8H7i7xwu955QKQsYSuhBY/FQs=\n" }
Add username for the configuration directory credentials
Add username for the configuration directory credentials
JSON
apache-2.0
ripple/dirsrv-cookbook,RiotGamesCookbooks/dirsrv-cookbook,pakfur/dirsrv-cookbook,awillis/dirsrv-cookbook,Azrael808/dirsrv-cookbook,awillis/dirsrv-cookbook,Azrael808/dirsrv-cookbook,ripple/dirsrv-cookbook,RiotGamesCookbooks/dirsrv-cookbook,pakfur/dirsrv-cookbook
json
## Code Before: { "id": "default", "userdn": "s4rbe5fVCPa9mpnIEyxdFdUKkV7G3M1twWaZW/JNpJs=\n", "password": "r0+JXQb52Q37SBLlYLaiR5gRFZ/tDQ3TI0gExfSJiZw=\n" } ## Instruction: Add username for the configuration directory credentials ## Code After: { "id": "default", "userdn": "e1fNxVe+5JNdNfG5zZgqG/zQnN9ig8kSeMUCBGvaO4g=\n", "username": "ZzjkpvN07fosm5CMRa9g2w==\n", "password": "G5QZWCuLXxQuxRUXqV8H7i7xwu955QKQsYSuhBY/FQs=\n" }
{ "id": "default", - "userdn": "s4rbe5fVCPa9mpnIEyxdFdUKkV7G3M1twWaZW/JNpJs=\n", - "password": "r0+JXQb52Q37SBLlYLaiR5gRFZ/tDQ3TI0gExfSJiZw=\n" + "userdn": "e1fNxVe+5JNdNfG5zZgqG/zQnN9ig8kSeMUCBGvaO4g=\n", + "username": "ZzjkpvN07fosm5CMRa9g2w==\n", + "password": "G5QZWCuLXxQuxRUXqV8H7i7xwu955QKQsYSuhBY/FQs=\n" }
5
1
3
2
7cb9f692ce04d65d7533b2f458138374c2fe6ed6
lib/Resmon/ExtComm.pm
lib/Resmon/ExtComm.pm
package Resmon::ExtComm; use strict; use warnings; use base "Exporter"; our @EXPORT_OK = qw/cache_command run_command/; my %commhist; my %commcache; my %children; sub cache_command { my $expiry = pop; my @command = @_; my $command = join(" ", @command); my $now = time; if($commhist{$command}>$now) { return $commcache{$command}; } $commcache{$command} = run_command(@command); $commhist{$command} = $now + $expiry; return $commcache{$command}; } sub clean_up { # Kill off any child processes started by run_command and close any pipes # to them. This is called when a check times out and we may have processes # left over. while (my ($pid, $handle) = each %children) { kill 9, $pid; close ($handle); delete $children{$pid}; } } sub run_command { # Run a command just like `cmd`, but store the pid and stdout handles so # they can be cleaned up later. For use with alarm(). my @cmd = @_; my $pid = open(my $r, "-|", @cmd); die "Can't run $cmd[0]: $!\n" unless defined($pid); $children{$pid} = $r; my @lines = <$r>; delete $children{$pid}; close($r); return join("", @lines); } 1;
package Resmon::ExtComm; use strict; use warnings; use base "Exporter"; our @EXPORT_OK = qw/cache_command run_command/; my %commhist; my %commcache; my %children; sub cache_command { my $expiry = pop; my @command = @_; my $command = join(" ", @command); my $now = time; if(defined($commhist{$command}) && $commhist{$command}>$now) { return $commcache{$command}; } $commcache{$command} = run_command(@command); $commhist{$command} = $now + $expiry; return $commcache{$command}; } sub clean_up { # Kill off any child processes started by run_command and close any pipes # to them. This is called when a check times out and we may have processes # left over. while (my ($pid, $handle) = each %children) { kill 9, $pid; close ($handle); delete $children{$pid}; } } sub run_command { # Run a command just like `cmd`, but store the pid and stdout handles so # they can be cleaned up later. For use with alarm(). my @cmd = @_; my $pid = open(my $r, "-|", @cmd); die "Can't run $cmd[0]: $!\n" unless defined($pid); $children{$pid} = $r; my @lines = <$r>; delete $children{$pid}; close($r); return join("", @lines); } 1;
Make sure command is defined in commhist before referencing it
Make sure command is defined in commhist before referencing it
Perl
bsd-3-clause
omniti-labs/resmon,omniti-labs/resmon
perl
## Code Before: package Resmon::ExtComm; use strict; use warnings; use base "Exporter"; our @EXPORT_OK = qw/cache_command run_command/; my %commhist; my %commcache; my %children; sub cache_command { my $expiry = pop; my @command = @_; my $command = join(" ", @command); my $now = time; if($commhist{$command}>$now) { return $commcache{$command}; } $commcache{$command} = run_command(@command); $commhist{$command} = $now + $expiry; return $commcache{$command}; } sub clean_up { # Kill off any child processes started by run_command and close any pipes # to them. This is called when a check times out and we may have processes # left over. while (my ($pid, $handle) = each %children) { kill 9, $pid; close ($handle); delete $children{$pid}; } } sub run_command { # Run a command just like `cmd`, but store the pid and stdout handles so # they can be cleaned up later. For use with alarm(). my @cmd = @_; my $pid = open(my $r, "-|", @cmd); die "Can't run $cmd[0]: $!\n" unless defined($pid); $children{$pid} = $r; my @lines = <$r>; delete $children{$pid}; close($r); return join("", @lines); } 1; ## Instruction: Make sure command is defined in commhist before referencing it ## Code After: package Resmon::ExtComm; use strict; use warnings; use base "Exporter"; our @EXPORT_OK = qw/cache_command run_command/; my %commhist; my %commcache; my %children; sub cache_command { my $expiry = pop; my @command = @_; my $command = join(" ", @command); my $now = time; if(defined($commhist{$command}) && $commhist{$command}>$now) { return $commcache{$command}; } $commcache{$command} = run_command(@command); $commhist{$command} = $now + $expiry; return $commcache{$command}; } sub clean_up { # Kill off any child processes started by run_command and close any pipes # to them. This is called when a check times out and we may have processes # left over. while (my ($pid, $handle) = each %children) { kill 9, $pid; close ($handle); delete $children{$pid}; } } sub run_command { # Run a command just like `cmd`, but store the pid and stdout handles so # they can be cleaned up later. For use with alarm(). my @cmd = @_; my $pid = open(my $r, "-|", @cmd); die "Can't run $cmd[0]: $!\n" unless defined($pid); $children{$pid} = $r; my @lines = <$r>; delete $children{$pid}; close($r); return join("", @lines); } 1;
package Resmon::ExtComm; use strict; use warnings; use base "Exporter"; our @EXPORT_OK = qw/cache_command run_command/; my %commhist; my %commcache; my %children; sub cache_command { my $expiry = pop; my @command = @_; my $command = join(" ", @command); my $now = time; - if($commhist{$command}>$now) { + if(defined($commhist{$command}) && $commhist{$command}>$now) { return $commcache{$command}; } $commcache{$command} = run_command(@command); $commhist{$command} = $now + $expiry; return $commcache{$command}; } sub clean_up { # Kill off any child processes started by run_command and close any pipes # to them. This is called when a check times out and we may have processes # left over. while (my ($pid, $handle) = each %children) { kill 9, $pid; close ($handle); delete $children{$pid}; } } sub run_command { # Run a command just like `cmd`, but store the pid and stdout handles so # they can be cleaned up later. For use with alarm(). my @cmd = @_; my $pid = open(my $r, "-|", @cmd); die "Can't run $cmd[0]: $!\n" unless defined($pid); $children{$pid} = $r; my @lines = <$r>; delete $children{$pid}; close($r); return join("", @lines); } 1;
2
0.039216
1
1
65266777d554ff8b08ba47537f1b71f8357a4e2e
.travis.yml
.travis.yml
sudo: false language: scala cache: directories: - $HOME/.ivy2/cache - $HOME/.sbt/boot scala: - 2.11.7 jdk: - oraclejdk8 install: ./bin/build-deps.sh before_cache: - find $HOME/.sbt -name "*.lock" | xargs rm - find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm
sudo: false language: scala cache: directories: - $HOME/.ivy2/cache - $HOME/.sbt/boot scala: - 2.11.7 jdk: - oraclejdk8 install: ./bin/build-deps.sh before_cache: - find $HOME/.sbt -name "*.lock" | tee /dev/stderr | xargs rm - find $HOME/.ivy2 -name "ivydata-*.properties" | tee /dev/stderr | xargs rm
Debug pre cache clean operations
Debug pre cache clean operations
YAML
agpl-3.0
niklasf/lila-openingexplorer,niklasf/lila-openingexplorer
yaml
## Code Before: sudo: false language: scala cache: directories: - $HOME/.ivy2/cache - $HOME/.sbt/boot scala: - 2.11.7 jdk: - oraclejdk8 install: ./bin/build-deps.sh before_cache: - find $HOME/.sbt -name "*.lock" | xargs rm - find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm ## Instruction: Debug pre cache clean operations ## Code After: sudo: false language: scala cache: directories: - $HOME/.ivy2/cache - $HOME/.sbt/boot scala: - 2.11.7 jdk: - oraclejdk8 install: ./bin/build-deps.sh before_cache: - find $HOME/.sbt -name "*.lock" | tee /dev/stderr | xargs rm - find $HOME/.ivy2 -name "ivydata-*.properties" | tee /dev/stderr | xargs rm
sudo: false language: scala cache: directories: - $HOME/.ivy2/cache - $HOME/.sbt/boot scala: - 2.11.7 jdk: - oraclejdk8 install: ./bin/build-deps.sh before_cache: - - find $HOME/.sbt -name "*.lock" | xargs rm + - find $HOME/.sbt -name "*.lock" | tee /dev/stderr | xargs rm ? ++++++++++++++++++ - - find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm + - find $HOME/.ivy2 -name "ivydata-*.properties" | tee /dev/stderr | xargs rm ? ++++++++++++++++++
4
0.2
2
2
e8ec81abef3afaea17f324bba6ae6b313ba7ea0d
app/css/legacy.css
app/css/legacy.css
/* The old font we use, only has semi-bold at 600 (not 500 like SF UI does) */ .semi-bold { font-weight: 600; } body.new-nav, body.new-nav h1, body.new-nav h2, body.new-nav h3, body.new-nav h4, body.new-nav h5, body.new-nav input, body.new-nav select, body.new-nav textarea, body.new-nav button { font-family: "SF UI Text", Roboto, "Helvetica Neue", Helvetica, arial, freesans, clean, sans-serif; } body.new-nav .semi-bold { font-weight: 500; }
/* The old font we use, only has semi-bold at 600 (not 500 like SF UI does) */ .semi-bold { font-weight: 600; } body.new-nav, body.new-nav h1, body.new-nav h2, body.new-nav h3, body.new-nav h4, body.new-nav h5, body.new-nav input, body.new-nav select, body.new-nav textarea, body.new-nav button { font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Helvetica, sans-serif; } body.new-nav .semi-bold { font-weight: 500; }
Update system font stack to latest Bass
Update system font stack to latest Bass
CSS
mit
fotinakis/buildkite-frontend,buildkite/frontend,buildkite/frontend,fotinakis/buildkite-frontend
css
## Code Before: /* The old font we use, only has semi-bold at 600 (not 500 like SF UI does) */ .semi-bold { font-weight: 600; } body.new-nav, body.new-nav h1, body.new-nav h2, body.new-nav h3, body.new-nav h4, body.new-nav h5, body.new-nav input, body.new-nav select, body.new-nav textarea, body.new-nav button { font-family: "SF UI Text", Roboto, "Helvetica Neue", Helvetica, arial, freesans, clean, sans-serif; } body.new-nav .semi-bold { font-weight: 500; } ## Instruction: Update system font stack to latest Bass ## Code After: /* The old font we use, only has semi-bold at 600 (not 500 like SF UI does) */ .semi-bold { font-weight: 600; } body.new-nav, body.new-nav h1, body.new-nav h2, body.new-nav h3, body.new-nav h4, body.new-nav h5, body.new-nav input, body.new-nav select, body.new-nav textarea, body.new-nav button { font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Helvetica, sans-serif; } body.new-nav .semi-bold { font-weight: 500; }
/* The old font we use, only has semi-bold at 600 (not 500 like SF UI does) */ .semi-bold { font-weight: 600; } body.new-nav, body.new-nav h1, body.new-nav h2, body.new-nav h3, body.new-nav h4, body.new-nav h5, body.new-nav input, body.new-nav select, body.new-nav textarea, body.new-nav button { - font-family: "SF UI Text", Roboto, "Helvetica Neue", Helvetica, arial, freesans, clean, sans-serif; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Helvetica, sans-serif; } body.new-nav .semi-bold { font-weight: 500; }
2
0.095238
1
1
de03d876a5ddd7e82627441219d446e9f0d64275
server/controllers/students.js
server/controllers/students.js
//var Teachers = require('../models/teachers'); //var TeacherClasses = require('../models/Teacher_classes'); //var Classes = require('../models/classes'); //var ClassLessons = require('../models/class_lessons'); // var Lessons = require('../models/lessons'); //var RequestedResponses = require('../models/requested_responses'); module.exports = { readyStage : function(io, req, res, next) { //var studentInformation = req.body.studentData var pollResponse = { responseId: 1, type: 'thumbs', datetime: new Date(), lessonId: 13, }; io.on('connection', function(student){ student.emit('studentStandby', studentInformation); student.on('teacherConnect', function() { student.emit('teacherConnect'); }); student.on('newPoll', function(data) { student.emit(data); }); setTimeout(function(){ io.sockets.emit('responseFromStudent', pollResponse); }, 5000); }); res.status(200).send('Hello from the other side'); } };
//var Teachers = require('../models/teachers'); //var TeacherClasses = require('../models/Teacher_classes'); //var Classes = require('../models/classes'); //var ClassLessons = require('../models/class_lessons'); // var Lessons = require('../models/lessons'); //var RequestedResponses = require('../models/requested_responses'); module.exports = { readyStage : function(io, req, res, next) { //var studentInformation = req.body.studentData var pollResponse = { responseId: 1, type: 'thumbs', datetime: new Date(), lessonId: 13, }; io.on('connection', function(student){ student.emit('studentStandby', studentInformation); student.on('newPoll', function(data) { student.emit(data); }); setTimeout(function(){ io.sockets.emit('responseFromStudent', pollResponse); }, 5000); }); res.status(200).send('Hello from the student side'); } };
Remove teacherConnect socket event for frontend handling
Remove teacherConnect socket event for frontend handling
JavaScript
mit
shanemcgraw/thumbroll,Jakeyrob/thumbroll,absurdSquid/thumbroll,absurdSquid/thumbroll,Jakeyrob/thumbroll,Jakeyrob/thumbroll,shanemcgraw/thumbroll,shanemcgraw/thumbroll
javascript
## Code Before: //var Teachers = require('../models/teachers'); //var TeacherClasses = require('../models/Teacher_classes'); //var Classes = require('../models/classes'); //var ClassLessons = require('../models/class_lessons'); // var Lessons = require('../models/lessons'); //var RequestedResponses = require('../models/requested_responses'); module.exports = { readyStage : function(io, req, res, next) { //var studentInformation = req.body.studentData var pollResponse = { responseId: 1, type: 'thumbs', datetime: new Date(), lessonId: 13, }; io.on('connection', function(student){ student.emit('studentStandby', studentInformation); student.on('teacherConnect', function() { student.emit('teacherConnect'); }); student.on('newPoll', function(data) { student.emit(data); }); setTimeout(function(){ io.sockets.emit('responseFromStudent', pollResponse); }, 5000); }); res.status(200).send('Hello from the other side'); } }; ## Instruction: Remove teacherConnect socket event for frontend handling ## Code After: //var Teachers = require('../models/teachers'); //var TeacherClasses = require('../models/Teacher_classes'); //var Classes = require('../models/classes'); //var ClassLessons = require('../models/class_lessons'); // var Lessons = require('../models/lessons'); //var RequestedResponses = require('../models/requested_responses'); module.exports = { readyStage : function(io, req, res, next) { //var studentInformation = req.body.studentData var pollResponse = { responseId: 1, type: 'thumbs', datetime: new Date(), lessonId: 13, }; io.on('connection', function(student){ student.emit('studentStandby', studentInformation); student.on('newPoll', function(data) { student.emit(data); }); setTimeout(function(){ io.sockets.emit('responseFromStudent', pollResponse); }, 5000); }); res.status(200).send('Hello from the student side'); } };
//var Teachers = require('../models/teachers'); //var TeacherClasses = require('../models/Teacher_classes'); //var Classes = require('../models/classes'); //var ClassLessons = require('../models/class_lessons'); // var Lessons = require('../models/lessons'); //var RequestedResponses = require('../models/requested_responses'); module.exports = { readyStage : function(io, req, res, next) { //var studentInformation = req.body.studentData var pollResponse = { responseId: 1, type: 'thumbs', datetime: new Date(), lessonId: 13, }; io.on('connection', function(student){ student.emit('studentStandby', studentInformation); - student.on('teacherConnect', function() { - student.emit('teacherConnect'); - }); - student.on('newPoll', function(data) { student.emit(data); }); setTimeout(function(){ io.sockets.emit('responseFromStudent', pollResponse); }, 5000); }); - res.status(200).send('Hello from the other side'); ? ^ ^ ^ + res.status(200).send('Hello from the student side'); ? ^ ^^ ^^ } };
6
0.153846
1
5
1e20e5aca36c04a78c6a65a1824f5a6156811ed4
package.json
package.json
{ "name": "peerjs", "version": "0.3.10", "description": "PeerJS client", "main": "./lib/peer.js", "repository": { "type": "git", "url": "git://github.com/peers/peerjs.git" }, "author": "Michelle Bu, Eric Zhang", "license": "MIT", "scripts": { "prepublish": "./node_modules/.bin/grunt" }, "devDependencies": { "expect.js": "*", "grunt": "^0.4.5", "grunt-browserify": "^3.0.1", "grunt-cli": "^0.1.13", "grunt-contrib-concat": "^0.5.0", "grunt-contrib-uglify": "^0.5.1", "mocha": "*" }, "dependencies": { "eventemitter3": "^0.1.5", "js-binarypack": "git+https://github.com/lmb/js-binarypack.git", "reliable": "git+https://github.com/lmb/reliable.git" } }
{ "name": "peerjs", "version": "0.3.11", "description": "PeerJS client", "main": "./lib/peer.js", "repository": { "type": "git", "url": "git://github.com/peers/peerjs.git" }, "author": "Michelle Bu, Eric Zhang", "license": "MIT", "scripts": { "prepublish": "./node_modules/.bin/grunt" }, "devDependencies": { "expect.js": "*", "grunt": "^0.4.5", "grunt-browserify": "^3.0.1", "grunt-cli": "^0.1.13", "grunt-contrib-concat": "^0.5.0", "grunt-contrib-uglify": "^0.5.1", "mocha": "*" }, "dependencies": { "eventemitter3": "^0.1.5", "js-binarypack": "0.0.8", "reliable": "git+https://github.com/michelle/reliable.git" } }
Use npm version of js-binarypack, bump to 0.3.11
Use npm version of js-binarypack, bump to 0.3.11
JSON
mit
keppelen/peerjs,prowe214/peerjs,pirosikick/peerjs,martindale/peerjs,muthhus/peerjs,beni55/peerjs,thevuuranusls/peerjs,relekang/peerjs,tdkehoe/peerjs,fenghuilee/peerjs,diablojared/peerjs,mcanthony/peerjs,madwed/peerjs,NeXTs/peerjs,fenghuilee/peerjs,atyenoria/peerjs,madwed/peerjs,beni55/peerjs,NeXTs/peerjs,relekang/peerjs,davidcp90/peerjs,mcanthony/peerjs,LVBK/peerjs,ConeDeathAPS/peerjs,muthhus/peerjs,wancharle/peerjs,tdkehoe/peerjs,keppelen/peerjs,pculka/peerjs,atyenoria/peerjs,peers/peerjs,shelsonjava/peerjs,pculka/peerjs,LeoLeal/peerjs,78lab/peerjs,pirosikick/peerjs,ConeDeathAPS/peerjs,dnish/peerjs,wancharle/peerjs,shelsonjava/peerjs,LVBK/peerjs,prowe214/peerjs,martindale/peerjs,LeoLeal/peerjs,davidcp90/peerjs,thevuuranusls/peerjs,diablojared/peerjs,78lab/peerjs,dnish/peerjs
json
## Code Before: { "name": "peerjs", "version": "0.3.10", "description": "PeerJS client", "main": "./lib/peer.js", "repository": { "type": "git", "url": "git://github.com/peers/peerjs.git" }, "author": "Michelle Bu, Eric Zhang", "license": "MIT", "scripts": { "prepublish": "./node_modules/.bin/grunt" }, "devDependencies": { "expect.js": "*", "grunt": "^0.4.5", "grunt-browserify": "^3.0.1", "grunt-cli": "^0.1.13", "grunt-contrib-concat": "^0.5.0", "grunt-contrib-uglify": "^0.5.1", "mocha": "*" }, "dependencies": { "eventemitter3": "^0.1.5", "js-binarypack": "git+https://github.com/lmb/js-binarypack.git", "reliable": "git+https://github.com/lmb/reliable.git" } } ## Instruction: Use npm version of js-binarypack, bump to 0.3.11 ## Code After: { "name": "peerjs", "version": "0.3.11", "description": "PeerJS client", "main": "./lib/peer.js", "repository": { "type": "git", "url": "git://github.com/peers/peerjs.git" }, "author": "Michelle Bu, Eric Zhang", "license": "MIT", "scripts": { "prepublish": "./node_modules/.bin/grunt" }, "devDependencies": { "expect.js": "*", "grunt": "^0.4.5", "grunt-browserify": "^3.0.1", "grunt-cli": "^0.1.13", "grunt-contrib-concat": "^0.5.0", "grunt-contrib-uglify": "^0.5.1", "mocha": "*" }, "dependencies": { "eventemitter3": "^0.1.5", "js-binarypack": "0.0.8", "reliable": "git+https://github.com/michelle/reliable.git" } }
{ "name": "peerjs", - "version": "0.3.10", ? ^ + "version": "0.3.11", ? ^ "description": "PeerJS client", "main": "./lib/peer.js", "repository": { "type": "git", "url": "git://github.com/peers/peerjs.git" }, "author": "Michelle Bu, Eric Zhang", "license": "MIT", "scripts": { "prepublish": "./node_modules/.bin/grunt" }, "devDependencies": { "expect.js": "*", "grunt": "^0.4.5", "grunt-browserify": "^3.0.1", "grunt-cli": "^0.1.13", "grunt-contrib-concat": "^0.5.0", "grunt-contrib-uglify": "^0.5.1", "mocha": "*" }, "dependencies": { "eventemitter3": "^0.1.5", - "js-binarypack": "git+https://github.com/lmb/js-binarypack.git", + "js-binarypack": "0.0.8", - "reliable": "git+https://github.com/lmb/reliable.git" ? ^^ + "reliable": "git+https://github.com/michelle/reliable.git" ? +++++ ^^ } }
6
0.206897
3
3
ca7414b118bd567b11e9707defedbef6346761e4
packages/rt/rtcm.yaml
packages/rt/rtcm.yaml
homepage: http://github.com/swift-nav/librtcm changelog-type: '' hash: 17eb8a15b43a0ef4593befe0f102bd0fb978c48a4a8abc2b9d72995f5f98de9a test-bench-deps: base: -any basic-prelude: -any rtcm: -any criterion: -any tasty-hunit: -any tasty: -any maintainer: Mark Fine <dev@swiftnav.com> synopsis: RTCM Library. changelog: '' basic-deps: bytestring: -any base: ! '>=4.7 && <5' basic-prelude: -any word24: -any array: -any lens: -any binary: -any binary-bits: -any template-haskell: -any all-versions: - '0.1.0' - '0.1.2' author: Swift Navigation Inc. latest: '0.1.2' description-type: haddock description: ! 'Haskell bindings for Radio Technical Commission For Maritime Services (RTCM) standard, supporting GPS, GLONASS, Galileo and other satellite-based position systems operation with one reference station or a network.' license-name: BSD3
homepage: http://github.com/swift-nav/librtcm changelog-type: '' hash: fa3d811a7c8896546666aedcbbd60359a4b4fa267b532ff7c122aca195a9c681 test-bench-deps: base: -any basic-prelude: -any rtcm: -any criterion: -any tasty-hunit: -any tasty: -any maintainer: Mark Fine <dev@swiftnav.com> synopsis: RTCM Library. changelog: '' basic-deps: bytestring: -any base: ! '>=4.7 && <5' basic-prelude: -any word24: -any array: -any lens: -any binary: -any binary-bits: -any template-haskell: -any all-versions: - '0.1.0' - '0.1.2' - '0.1.3' author: Swift Navigation Inc. latest: '0.1.3' description-type: haddock description: ! 'Haskell bindings for Radio Technical Commission For Maritime Services (RTCM) standard, supporting GPS, GLONASS, Galileo and other satellite-based position systems operation with one reference station or a network.' license-name: BSD3
Update from Hackage at 2015-12-08T08:17:54+0000
Update from Hackage at 2015-12-08T08:17:54+0000
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: http://github.com/swift-nav/librtcm changelog-type: '' hash: 17eb8a15b43a0ef4593befe0f102bd0fb978c48a4a8abc2b9d72995f5f98de9a test-bench-deps: base: -any basic-prelude: -any rtcm: -any criterion: -any tasty-hunit: -any tasty: -any maintainer: Mark Fine <dev@swiftnav.com> synopsis: RTCM Library. changelog: '' basic-deps: bytestring: -any base: ! '>=4.7 && <5' basic-prelude: -any word24: -any array: -any lens: -any binary: -any binary-bits: -any template-haskell: -any all-versions: - '0.1.0' - '0.1.2' author: Swift Navigation Inc. latest: '0.1.2' description-type: haddock description: ! 'Haskell bindings for Radio Technical Commission For Maritime Services (RTCM) standard, supporting GPS, GLONASS, Galileo and other satellite-based position systems operation with one reference station or a network.' license-name: BSD3 ## Instruction: Update from Hackage at 2015-12-08T08:17:54+0000 ## Code After: homepage: http://github.com/swift-nav/librtcm changelog-type: '' hash: fa3d811a7c8896546666aedcbbd60359a4b4fa267b532ff7c122aca195a9c681 test-bench-deps: base: -any basic-prelude: -any rtcm: -any criterion: -any tasty-hunit: -any tasty: -any maintainer: Mark Fine <dev@swiftnav.com> synopsis: RTCM Library. changelog: '' basic-deps: bytestring: -any base: ! '>=4.7 && <5' basic-prelude: -any word24: -any array: -any lens: -any binary: -any binary-bits: -any template-haskell: -any all-versions: - '0.1.0' - '0.1.2' - '0.1.3' author: Swift Navigation Inc. latest: '0.1.3' description-type: haddock description: ! 'Haskell bindings for Radio Technical Commission For Maritime Services (RTCM) standard, supporting GPS, GLONASS, Galileo and other satellite-based position systems operation with one reference station or a network.' license-name: BSD3
homepage: http://github.com/swift-nav/librtcm changelog-type: '' - hash: 17eb8a15b43a0ef4593befe0f102bd0fb978c48a4a8abc2b9d72995f5f98de9a + hash: fa3d811a7c8896546666aedcbbd60359a4b4fa267b532ff7c122aca195a9c681 test-bench-deps: base: -any basic-prelude: -any rtcm: -any criterion: -any tasty-hunit: -any tasty: -any maintainer: Mark Fine <dev@swiftnav.com> synopsis: RTCM Library. changelog: '' basic-deps: bytestring: -any base: ! '>=4.7 && <5' basic-prelude: -any word24: -any array: -any lens: -any binary: -any binary-bits: -any template-haskell: -any all-versions: - '0.1.0' - '0.1.2' + - '0.1.3' author: Swift Navigation Inc. - latest: '0.1.2' ? ^ + latest: '0.1.3' ? ^ description-type: haddock description: ! 'Haskell bindings for Radio Technical Commission For Maritime Services (RTCM) standard, supporting GPS, GLONASS, Galileo and other satellite-based position systems operation with one reference station or a network.' license-name: BSD3
5
0.135135
3
2
739ae941cd4a5158bb942db5d0158ed86a0539df
lib/propr/property.rb
lib/propr/property.rb
module Propr class Property < Proc # @return [String] attr_reader :name # @return [Propr::Base] attr_reader :rand def initialize(name, rand, body) super(&body) @name, @rand = name, rand end # @return [Boolean] def check(*args) if block_given? iterations = 0..100 iterations.all? { call(*yield(@rand)) } else call(*args) end end end end
module Propr class Property #< Proc # @return [String] attr_reader :name # @return [Propr::Base] attr_reader :rand def initialize(name, rand, body) @name, @rand, @body = name, rand, body end # @return [Boolean] def check(*args) if block_given? iterations = 0..100 iterations.all? { call(*yield(@rand)) } else call(*args) end end def arity @body.arity end def call(*args, &block) @body.call(*args, &block) end def [](*args, &block) @body[*args, &block] end end end
Deal with Proc subclass problems
Deal with Proc subclass problems
Ruby
bsd-3-clause
rgordeev/propr
ruby
## Code Before: module Propr class Property < Proc # @return [String] attr_reader :name # @return [Propr::Base] attr_reader :rand def initialize(name, rand, body) super(&body) @name, @rand = name, rand end # @return [Boolean] def check(*args) if block_given? iterations = 0..100 iterations.all? { call(*yield(@rand)) } else call(*args) end end end end ## Instruction: Deal with Proc subclass problems ## Code After: module Propr class Property #< Proc # @return [String] attr_reader :name # @return [Propr::Base] attr_reader :rand def initialize(name, rand, body) @name, @rand, @body = name, rand, body end # @return [Boolean] def check(*args) if block_given? iterations = 0..100 iterations.all? { call(*yield(@rand)) } else call(*args) end end def arity @body.arity end def call(*args, &block) @body.call(*args, &block) end def [](*args, &block) @body[*args, &block] end end end
module Propr - class Property < Proc + class Property #< Proc ? + # @return [String] attr_reader :name # @return [Propr::Base] attr_reader :rand def initialize(name, rand, body) - super(&body) - @name, @rand = name, rand + @name, @rand, @body = name, rand, body ? +++++++ ++++++ end # @return [Boolean] def check(*args) if block_given? iterations = 0..100 iterations.all? { call(*yield(@rand)) } else call(*args) end end + def arity + @body.arity + end + + def call(*args, &block) + @body.call(*args, &block) + end + + def [](*args, &block) + @body[*args, &block] + end + end end
17
0.653846
14
3
9b319900ced61e72d08461d129b78c86e452f842
core/time/dup_spec.rb
core/time/dup_spec.rb
require File.expand_path('../../../spec_helper', __FILE__) describe "Time#dup" do it "returns a Time object that represents the same time" do t = Time.at(100) t.dup.tv_sec.should == t.tv_sec end it "copies the gmt state flag" do Time.now.gmtime.dup.gmt?.should == true end it "returns an independent Time object" do t = Time.now t2 = t.dup t.gmtime t2.gmt?.should == false end it "returns a subclass instance" do c = Class.new(Time) t = c.now t.should be_an_instance_of(c) t.dup.should be_an_instance_of(c) end end
require File.expand_path('../../../spec_helper', __FILE__) describe "Time#dup" do it "returns a Time object that represents the same time" do t = Time.at(100) t.dup.tv_sec.should == t.tv_sec end it "copies the gmt state flag" do Time.now.gmtime.dup.gmt?.should == true end it "returns an independent Time object" do t = Time.now t2 = t.dup t.gmtime t2.gmt?.should == false end it "returns a subclass instance" do c = Class.new(Time) t = c.now t.should be_an_instance_of(c) t.dup.should be_an_instance_of(c) end it "returns a clone of Time instance" do c = Time.dup t = c.now t.should be_an_instance_of(c) t.should_not be_an_instance_of(Time) t.dup.should be_an_instance_of(c) t.dup.should_not be_an_instance_of(Time) end end
Add spec for creating instances of a cloned Time class
Add spec for creating instances of a cloned Time class
Ruby
mit
sgarciac/spec,eregon/rubyspec,ruby/rubyspec,ruby/spec,ruby/spec,ruby/spec,nobu/rubyspec,ruby/rubyspec,nobu/rubyspec,kachick/rubyspec,eregon/rubyspec,sgarciac/spec,eregon/rubyspec,sgarciac/spec,kachick/rubyspec,kachick/rubyspec,nobu/rubyspec
ruby
## Code Before: require File.expand_path('../../../spec_helper', __FILE__) describe "Time#dup" do it "returns a Time object that represents the same time" do t = Time.at(100) t.dup.tv_sec.should == t.tv_sec end it "copies the gmt state flag" do Time.now.gmtime.dup.gmt?.should == true end it "returns an independent Time object" do t = Time.now t2 = t.dup t.gmtime t2.gmt?.should == false end it "returns a subclass instance" do c = Class.new(Time) t = c.now t.should be_an_instance_of(c) t.dup.should be_an_instance_of(c) end end ## Instruction: Add spec for creating instances of a cloned Time class ## Code After: require File.expand_path('../../../spec_helper', __FILE__) describe "Time#dup" do it "returns a Time object that represents the same time" do t = Time.at(100) t.dup.tv_sec.should == t.tv_sec end it "copies the gmt state flag" do Time.now.gmtime.dup.gmt?.should == true end it "returns an independent Time object" do t = Time.now t2 = t.dup t.gmtime t2.gmt?.should == false end it "returns a subclass instance" do c = Class.new(Time) t = c.now t.should be_an_instance_of(c) t.dup.should be_an_instance_of(c) end it "returns a clone of Time instance" do c = Time.dup t = c.now t.should be_an_instance_of(c) t.should_not be_an_instance_of(Time) t.dup.should be_an_instance_of(c) t.dup.should_not be_an_instance_of(Time) end end
require File.expand_path('../../../spec_helper', __FILE__) describe "Time#dup" do it "returns a Time object that represents the same time" do t = Time.at(100) t.dup.tv_sec.should == t.tv_sec end it "copies the gmt state flag" do Time.now.gmtime.dup.gmt?.should == true end it "returns an independent Time object" do t = Time.now t2 = t.dup t.gmtime t2.gmt?.should == false end it "returns a subclass instance" do c = Class.new(Time) t = c.now t.should be_an_instance_of(c) t.dup.should be_an_instance_of(c) end + + it "returns a clone of Time instance" do + c = Time.dup + t = c.now + + t.should be_an_instance_of(c) + t.should_not be_an_instance_of(Time) + + t.dup.should be_an_instance_of(c) + t.dup.should_not be_an_instance_of(Time) + end end
11
0.392857
11
0
9858c56188f4d6c81daf6535e7cd58ff23e20712
application/senic/nuimo_hub/tests/test_setup_wifi.py
application/senic/nuimo_hub/tests/test_setup_wifi.py
import pytest from mock import patch @pytest.fixture def url(route_url): return route_url('wifi_setup') def test_get_scanned_wifi(browser, url): assert browser.get_json(url).json == ['grandpausethisnetwork'] @pytest.fixture def no_such_wifi(settings): settings['wifi_networks_path'] = '/no/such/file' return settings def test_get_scanned_wifi_empty(no_such_wifi, browser, url): assert browser.get_json(url).json == [] @pytest.yield_fixture(autouse=True) def mocked_run(request): """don't run actual external commands during these tests """ with patch('senic.nuimo_hub.views.setup_wifi.run')\ as mocked_run: yield mocked_run def test_join_wifi(browser, url, mocked_run, settings): browser.post_json(url, dict( ssid='grandpausethisnetwork', password='foobar', device='wlan0')).json mocked_run.assert_called_once_with( [ 'sudo', '%s/join_wifi' % settings['bin_path'], '-c {fs_config_ini}'.format(**settings), 'grandpausethisnetwork', 'foobar', ] )
import pytest from mock import patch @pytest.fixture def setup_url(route_url): return route_url('wifi_setup') def test_get_scanned_wifi(browser, setup_url): assert browser.get_json(setup_url).json == ['grandpausethisnetwork'] @pytest.fixture def no_such_wifi(settings): settings['wifi_networks_path'] = '/no/such/file' return settings def test_get_scanned_wifi_empty(no_such_wifi, browser, setup_url): assert browser.get_json(setup_url).json == [] @pytest.yield_fixture(autouse=True) def mocked_run(request): """don't run actual external commands during these tests """ with patch('senic.nuimo_hub.views.setup_wifi.run')\ as mocked_run: yield mocked_run def test_join_wifi(browser, setup_url, mocked_run, settings): browser.post_json(setup_url, dict( ssid='grandpausethisnetwork', password='foobar', device='wlan0')).json mocked_run.assert_called_once_with( [ 'sudo', '%s/join_wifi' % settings['bin_path'], '-c {fs_config_ini}'.format(**settings), 'grandpausethisnetwork', 'foobar', ] )
Make `url` fixture less generic
Make `url` fixture less generic in preparation for additional endpoints
Python
mit
grunskis/nuimo-hub-backend,grunskis/nuimo-hub-backend,getsenic/senic-hub,grunskis/senic-hub,grunskis/senic-hub,grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/senic-hub,getsenic/senic-hub,grunskis/senic-hub,grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/nuimo-hub-backend
python
## Code Before: import pytest from mock import patch @pytest.fixture def url(route_url): return route_url('wifi_setup') def test_get_scanned_wifi(browser, url): assert browser.get_json(url).json == ['grandpausethisnetwork'] @pytest.fixture def no_such_wifi(settings): settings['wifi_networks_path'] = '/no/such/file' return settings def test_get_scanned_wifi_empty(no_such_wifi, browser, url): assert browser.get_json(url).json == [] @pytest.yield_fixture(autouse=True) def mocked_run(request): """don't run actual external commands during these tests """ with patch('senic.nuimo_hub.views.setup_wifi.run')\ as mocked_run: yield mocked_run def test_join_wifi(browser, url, mocked_run, settings): browser.post_json(url, dict( ssid='grandpausethisnetwork', password='foobar', device='wlan0')).json mocked_run.assert_called_once_with( [ 'sudo', '%s/join_wifi' % settings['bin_path'], '-c {fs_config_ini}'.format(**settings), 'grandpausethisnetwork', 'foobar', ] ) ## Instruction: Make `url` fixture less generic in preparation for additional endpoints ## Code After: import pytest from mock import patch @pytest.fixture def setup_url(route_url): return route_url('wifi_setup') def test_get_scanned_wifi(browser, setup_url): assert browser.get_json(setup_url).json == ['grandpausethisnetwork'] @pytest.fixture def no_such_wifi(settings): settings['wifi_networks_path'] = '/no/such/file' return settings def test_get_scanned_wifi_empty(no_such_wifi, browser, setup_url): assert browser.get_json(setup_url).json == [] @pytest.yield_fixture(autouse=True) def mocked_run(request): """don't run actual external commands during these tests """ with patch('senic.nuimo_hub.views.setup_wifi.run')\ as mocked_run: yield mocked_run def test_join_wifi(browser, setup_url, mocked_run, settings): browser.post_json(setup_url, dict( ssid='grandpausethisnetwork', password='foobar', device='wlan0')).json mocked_run.assert_called_once_with( [ 'sudo', '%s/join_wifi' % settings['bin_path'], '-c {fs_config_ini}'.format(**settings), 'grandpausethisnetwork', 'foobar', ] )
import pytest from mock import patch @pytest.fixture - def url(route_url): + def setup_url(route_url): ? ++++++ return route_url('wifi_setup') - def test_get_scanned_wifi(browser, url): + def test_get_scanned_wifi(browser, setup_url): ? ++++++ - assert browser.get_json(url).json == ['grandpausethisnetwork'] + assert browser.get_json(setup_url).json == ['grandpausethisnetwork'] ? ++++++ @pytest.fixture def no_such_wifi(settings): settings['wifi_networks_path'] = '/no/such/file' return settings - def test_get_scanned_wifi_empty(no_such_wifi, browser, url): + def test_get_scanned_wifi_empty(no_such_wifi, browser, setup_url): ? ++++++ - assert browser.get_json(url).json == [] + assert browser.get_json(setup_url).json == [] ? ++++++ @pytest.yield_fixture(autouse=True) def mocked_run(request): """don't run actual external commands during these tests """ with patch('senic.nuimo_hub.views.setup_wifi.run')\ as mocked_run: yield mocked_run - def test_join_wifi(browser, url, mocked_run, settings): + def test_join_wifi(browser, setup_url, mocked_run, settings): ? ++++++ - browser.post_json(url, dict( + browser.post_json(setup_url, dict( ? ++++++ ssid='grandpausethisnetwork', password='foobar', device='wlan0')).json mocked_run.assert_called_once_with( [ 'sudo', '%s/join_wifi' % settings['bin_path'], '-c {fs_config_ini}'.format(**settings), 'grandpausethisnetwork', 'foobar', ] )
14
0.304348
7
7
13975ebc0b8253e12b746d88f97d2a2d7f4c91ea
ui/app/controllers/application.js
ui/app/controllers/application.js
import Ember from 'ember'; const { Controller, computed } = Ember; export default Controller.extend({ error: null, errorStr: computed('error', function() { return this.get('error').toString(); }), errorCodes: computed('error', function() { const error = this.get('error'); const codes = [error.code]; if (error.errors) { error.errors.forEach(err => { codes.push(err.status); }); } return codes .compact() .uniq() .map(code => '' + code); }), is404: computed('errorCodes.[]', function() { return this.get('errorCodes').includes('404'); }), is500: computed('errorCodes.[]', function() { return this.get('errorCodes').includes('500'); }), });
import Ember from 'ember'; const { Controller, computed, inject, run, observer } = Ember; export default Controller.extend({ config: inject.service(), error: null, errorStr: computed('error', function() { return this.get('error').toString(); }), errorCodes: computed('error', function() { const error = this.get('error'); const codes = [error.code]; if (error.errors) { error.errors.forEach(err => { codes.push(err.status); }); } return codes .compact() .uniq() .map(code => '' + code); }), is404: computed('errorCodes.[]', function() { return this.get('errorCodes').includes('404'); }), is500: computed('errorCodes.[]', function() { return this.get('errorCodes').includes('500'); }), throwError: observer('error', function() { if (this.get('config.isDev')) { run.next(() => { throw this.get('error'); }); } }), });
Throw errors that cause a redirect to make debugging easier
Throw errors that cause a redirect to make debugging easier
JavaScript
mpl-2.0
Ashald/nomad,Ashald/nomad,nak3/nomad,dvusboy/nomad,dvusboy/nomad,burdandrei/nomad,nak3/nomad,Ashald/nomad,burdandrei/nomad,Ashald/nomad,dvusboy/nomad,nak3/nomad,dvusboy/nomad,hashicorp/nomad,Ashald/nomad,hashicorp/nomad,nak3/nomad,burdandrei/nomad,burdandrei/nomad,Ashald/nomad,dvusboy/nomad,nak3/nomad,hashicorp/nomad,dvusboy/nomad,hashicorp/nomad,burdandrei/nomad,burdandrei/nomad,nak3/nomad,Ashald/nomad,burdandrei/nomad,hashicorp/nomad,dvusboy/nomad,nak3/nomad,hashicorp/nomad
javascript
## Code Before: import Ember from 'ember'; const { Controller, computed } = Ember; export default Controller.extend({ error: null, errorStr: computed('error', function() { return this.get('error').toString(); }), errorCodes: computed('error', function() { const error = this.get('error'); const codes = [error.code]; if (error.errors) { error.errors.forEach(err => { codes.push(err.status); }); } return codes .compact() .uniq() .map(code => '' + code); }), is404: computed('errorCodes.[]', function() { return this.get('errorCodes').includes('404'); }), is500: computed('errorCodes.[]', function() { return this.get('errorCodes').includes('500'); }), }); ## Instruction: Throw errors that cause a redirect to make debugging easier ## Code After: import Ember from 'ember'; const { Controller, computed, inject, run, observer } = Ember; export default Controller.extend({ config: inject.service(), error: null, errorStr: computed('error', function() { return this.get('error').toString(); }), errorCodes: computed('error', function() { const error = this.get('error'); const codes = [error.code]; if (error.errors) { error.errors.forEach(err => { codes.push(err.status); }); } return codes .compact() .uniq() .map(code => '' + code); }), is404: computed('errorCodes.[]', function() { return this.get('errorCodes').includes('404'); }), is500: computed('errorCodes.[]', function() { return this.get('errorCodes').includes('500'); }), throwError: observer('error', function() { if (this.get('config.isDev')) { run.next(() => { throw this.get('error'); }); } }), });
import Ember from 'ember'; - const { Controller, computed } = Ember; + const { Controller, computed, inject, run, observer } = Ember; ? +++++++++++++++++++++++ export default Controller.extend({ + config: inject.service(), + error: null, errorStr: computed('error', function() { return this.get('error').toString(); }), errorCodes: computed('error', function() { const error = this.get('error'); const codes = [error.code]; if (error.errors) { error.errors.forEach(err => { codes.push(err.status); }); } return codes .compact() .uniq() .map(code => '' + code); }), is404: computed('errorCodes.[]', function() { return this.get('errorCodes').includes('404'); }), is500: computed('errorCodes.[]', function() { return this.get('errorCodes').includes('500'); }), + + throwError: observer('error', function() { + if (this.get('config.isDev')) { + run.next(() => { + throw this.get('error'); + }); + } + }), });
12
0.342857
11
1
251bafc19a415c4d8731b57dea77765cddb1fd3e
src/services/intl-api.ts
src/services/intl-api.ts
/** * Provides the methods to check if Intl APIs are supported. */ export class IntlAPI { public static hasIntl(): boolean { const hasIntl: boolean = Intl && typeof Intl === "object"; return hasIntl; } public static hasDateTimeFormat(): boolean { return IntlAPI.hasIntl && Intl​.hasOwnProperty​("DateTimeFormat"); } public static hasTimezone(): boolean { try { new Intl.DateTimeFormat('en-US', { timeZone: 'America/Los_Angeles' }).format(new Date()); } catch (e) { return false; } return true; } public static hasNumberFormat(): boolean { return IntlAPI.hasIntl && Intl.hasOwnProperty​("NumberFormat"); } public static hasCollator(): boolean { return IntlAPI.hasIntl && Intl.hasOwnProperty​("Collator"); } }
/** * Provides the methods to check if Intl APIs are supported. */ export class IntlAPI { public static hasIntl(): boolean { const hasIntl: boolean = typeof Intl === "object" && Intl; return hasIntl; } public static hasDateTimeFormat(): boolean { return IntlAPI.hasIntl && Intl​.hasOwnProperty​("DateTimeFormat"); } public static hasTimezone(): boolean { try { new Intl.DateTimeFormat('en-US', { timeZone: 'America/Los_Angeles' }).format(new Date()); } catch (e) { return false; } return true; } public static hasNumberFormat(): boolean { return IntlAPI.hasIntl && Intl.hasOwnProperty​("NumberFormat"); } public static hasCollator(): boolean { return IntlAPI.hasIntl && Intl.hasOwnProperty​("Collator"); } }
Fix Can't find variable: Intl for iOS/Safari
Fix Can't find variable: Intl for iOS/Safari On iOS device got thrown "Can't find variable: Intl". http://imgur.com/a/Q5vIC
TypeScript
mit
robisim74/angular-l10n,robisim74/angular-l10n,robisim74/angular-l10n,robisim74/angular2localization,robisim74/angular-l10n,robisim74/angular2localization
typescript
## Code Before: /** * Provides the methods to check if Intl APIs are supported. */ export class IntlAPI { public static hasIntl(): boolean { const hasIntl: boolean = Intl && typeof Intl === "object"; return hasIntl; } public static hasDateTimeFormat(): boolean { return IntlAPI.hasIntl && Intl​.hasOwnProperty​("DateTimeFormat"); } public static hasTimezone(): boolean { try { new Intl.DateTimeFormat('en-US', { timeZone: 'America/Los_Angeles' }).format(new Date()); } catch (e) { return false; } return true; } public static hasNumberFormat(): boolean { return IntlAPI.hasIntl && Intl.hasOwnProperty​("NumberFormat"); } public static hasCollator(): boolean { return IntlAPI.hasIntl && Intl.hasOwnProperty​("Collator"); } } ## Instruction: Fix Can't find variable: Intl for iOS/Safari On iOS device got thrown "Can't find variable: Intl". http://imgur.com/a/Q5vIC ## Code After: /** * Provides the methods to check if Intl APIs are supported. */ export class IntlAPI { public static hasIntl(): boolean { const hasIntl: boolean = typeof Intl === "object" && Intl; return hasIntl; } public static hasDateTimeFormat(): boolean { return IntlAPI.hasIntl && Intl​.hasOwnProperty​("DateTimeFormat"); } public static hasTimezone(): boolean { try { new Intl.DateTimeFormat('en-US', { timeZone: 'America/Los_Angeles' }).format(new Date()); } catch (e) { return false; } return true; } public static hasNumberFormat(): boolean { return IntlAPI.hasIntl && Intl.hasOwnProperty​("NumberFormat"); } public static hasCollator(): boolean { return IntlAPI.hasIntl && Intl.hasOwnProperty​("Collator"); } }
/** * Provides the methods to check if Intl APIs are supported. */ export class IntlAPI { public static hasIntl(): boolean { - const hasIntl: boolean = Intl && typeof Intl === "object"; ? -------- + const hasIntl: boolean = typeof Intl === "object" && Intl; ? ++++++++ return hasIntl; } public static hasDateTimeFormat(): boolean { return IntlAPI.hasIntl && Intl​.hasOwnProperty​("DateTimeFormat"); } public static hasTimezone(): boolean { try { new Intl.DateTimeFormat('en-US', { timeZone: 'America/Los_Angeles' }).format(new Date()); } catch (e) { return false; } return true; } public static hasNumberFormat(): boolean { return IntlAPI.hasIntl && Intl.hasOwnProperty​("NumberFormat"); } public static hasCollator(): boolean { return IntlAPI.hasIntl && Intl.hasOwnProperty​("Collator"); } }
2
0.0625
1
1
bf571a4c5c122312ee9d1968ebb3f9a5cddd3ed4
lib/rake/env.rb
lib/rake/env.rb
CC = ENV['CC'].nil? ? 'clang' : ENV['CC'] # cpp = ENV['CPP'].nil? ? 'clang++' : ENV['CPP'] AR = 'ar' LD = 'ld' IS_LINUX = `uname -s`.strip == 'Linux' VERSION = `cat ./VERSION`.strip # $ldflags = "-lpthread -L. #{include_env 'LDFLAGS'}".strip warnings = '-Wall -Wextra -Wconversion' cflags = "-g -fPIC #{warnings} -std=c99 -I. #{include_env 'CFLAGS'}".strip # Expose cflags and Lua for `cflags_for` CFLAGS = cflags LUA = 'lua5.1' # Settings for LLVM llvm_config = 'llvm-config' if `uname -s`.strip == 'Darwin' llvm_config = "#{`brew --prefix llvm`.strip}/bin/llvm-config" end LLVM_CONFIG = llvm_config LLVM_MODULES = 'core analysis mcjit native' LLVM_LIBDIR = `#{llvm_config} --libdir`.strip
CC = ENV['CC'].nil? ? 'clang' : ENV['CC'] # cpp = ENV['CPP'].nil? ? 'clang++' : ENV['CPP'] AR = 'ar' LD = 'ld' IS_LINUX = `uname -s`.strip == 'Linux' VERSION = `cat ./VERSION`.strip # $ldflags = "-lpthread -L. #{include_env 'LDFLAGS'}".strip warnings = '-Wall -Wextra -Wsign-conversion -Wconversion' cflags = "-g -fPIC -std=c11 -I. #{warnings} #{include_env 'CFLAGS'}".strip # Expose cflags and Lua for `cflags_for` CFLAGS = cflags LUA = 'lua5.1' # Settings for LLVM llvm_config = 'llvm-config' if `uname -s`.strip == 'Darwin' llvm_config = "#{`brew --prefix llvm`.strip}/bin/llvm-config" end LLVM_CONFIG = llvm_config LLVM_MODULES = 'core analysis mcjit native' LLVM_LIBDIR = `#{llvm_config} --libdir`.strip
Switch to C11 from C99
Switch to C11 from C99
Ruby
mpl-2.0
dirk/hivm,dirk/hivm,dirk/hivm,dirk/hivm
ruby
## Code Before: CC = ENV['CC'].nil? ? 'clang' : ENV['CC'] # cpp = ENV['CPP'].nil? ? 'clang++' : ENV['CPP'] AR = 'ar' LD = 'ld' IS_LINUX = `uname -s`.strip == 'Linux' VERSION = `cat ./VERSION`.strip # $ldflags = "-lpthread -L. #{include_env 'LDFLAGS'}".strip warnings = '-Wall -Wextra -Wconversion' cflags = "-g -fPIC #{warnings} -std=c99 -I. #{include_env 'CFLAGS'}".strip # Expose cflags and Lua for `cflags_for` CFLAGS = cflags LUA = 'lua5.1' # Settings for LLVM llvm_config = 'llvm-config' if `uname -s`.strip == 'Darwin' llvm_config = "#{`brew --prefix llvm`.strip}/bin/llvm-config" end LLVM_CONFIG = llvm_config LLVM_MODULES = 'core analysis mcjit native' LLVM_LIBDIR = `#{llvm_config} --libdir`.strip ## Instruction: Switch to C11 from C99 ## Code After: CC = ENV['CC'].nil? ? 'clang' : ENV['CC'] # cpp = ENV['CPP'].nil? ? 'clang++' : ENV['CPP'] AR = 'ar' LD = 'ld' IS_LINUX = `uname -s`.strip == 'Linux' VERSION = `cat ./VERSION`.strip # $ldflags = "-lpthread -L. #{include_env 'LDFLAGS'}".strip warnings = '-Wall -Wextra -Wsign-conversion -Wconversion' cflags = "-g -fPIC -std=c11 -I. #{warnings} #{include_env 'CFLAGS'}".strip # Expose cflags and Lua for `cflags_for` CFLAGS = cflags LUA = 'lua5.1' # Settings for LLVM llvm_config = 'llvm-config' if `uname -s`.strip == 'Darwin' llvm_config = "#{`brew --prefix llvm`.strip}/bin/llvm-config" end LLVM_CONFIG = llvm_config LLVM_MODULES = 'core analysis mcjit native' LLVM_LIBDIR = `#{llvm_config} --libdir`.strip
CC = ENV['CC'].nil? ? 'clang' : ENV['CC'] # cpp = ENV['CPP'].nil? ? 'clang++' : ENV['CPP'] AR = 'ar' LD = 'ld' IS_LINUX = `uname -s`.strip == 'Linux' VERSION = `cat ./VERSION`.strip # $ldflags = "-lpthread -L. #{include_env 'LDFLAGS'}".strip - warnings = '-Wall -Wextra -Wconversion' + warnings = '-Wall -Wextra -Wsign-conversion -Wconversion' ? ++++++++++++++++++ - cflags = "-g -fPIC #{warnings} -std=c99 -I. #{include_env 'CFLAGS'}".strip ? ------------- + cflags = "-g -fPIC -std=c11 -I. #{warnings} #{include_env 'CFLAGS'}".strip ? +++++++++++++ # Expose cflags and Lua for `cflags_for` CFLAGS = cflags LUA = 'lua5.1' # Settings for LLVM llvm_config = 'llvm-config' if `uname -s`.strip == 'Darwin' llvm_config = "#{`brew --prefix llvm`.strip}/bin/llvm-config" end LLVM_CONFIG = llvm_config LLVM_MODULES = 'core analysis mcjit native' LLVM_LIBDIR = `#{llvm_config} --libdir`.strip
4
0.173913
2
2
ec7cace24a7c1b9be9ace761ef573868908408be
config.json
config.json
{ "language": "Haxe", "active": false, "blurb": "", "checklist_issue": 2, "test_pattern": "test.*Test[.]hx", "exercises": [ { "slug": "hello-world", "uuid": "3596bbf7-66f0-49c0-8c3e-3472455f90c7", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null }, { "slug": "bob", "uuid": "46b447aa-b2b5-4f5c-ac73-8de47f897840", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null }, { "slug": "leap", "uuid": "d30952cf-0b7d-a980-9351-caedebfed16362c6a7a", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null } ] }
{ "language": "Haxe", "active": false, "blurb": "", "checklist_issue": 2, "test_pattern": "test.*Test[.]hx", "exercises": [ { "slug": "hello-world", "uuid": "3596bbf7-66f0-49c0-8c3e-3472455f90c7", "core": false, "auto_approve": true, "unlocked_by": null, "difficulty": 1, "topics": null }, { "slug": "bob", "uuid": "46b447aa-b2b5-4f5c-ac73-8de47f897840", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null }, { "slug": "leap", "uuid": "d30952cf-0b7d-a980-9351-caedebfed16362c6a7a", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null } ] }
Add auto_approve to hello-world exercise
Add auto_approve to hello-world exercise This adds the auto_approve property to the hello-world exercise as part of preparing tracks for the v2 launch. The current code on the server will automatically approve hello-world exercises anyway, but that is a temporary fix and will be removed in the future.
JSON
mit
exercism/xhaxe
json
## Code Before: { "language": "Haxe", "active": false, "blurb": "", "checklist_issue": 2, "test_pattern": "test.*Test[.]hx", "exercises": [ { "slug": "hello-world", "uuid": "3596bbf7-66f0-49c0-8c3e-3472455f90c7", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null }, { "slug": "bob", "uuid": "46b447aa-b2b5-4f5c-ac73-8de47f897840", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null }, { "slug": "leap", "uuid": "d30952cf-0b7d-a980-9351-caedebfed16362c6a7a", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null } ] } ## Instruction: Add auto_approve to hello-world exercise This adds the auto_approve property to the hello-world exercise as part of preparing tracks for the v2 launch. The current code on the server will automatically approve hello-world exercises anyway, but that is a temporary fix and will be removed in the future. ## Code After: { "language": "Haxe", "active": false, "blurb": "", "checklist_issue": 2, "test_pattern": "test.*Test[.]hx", "exercises": [ { "slug": "hello-world", "uuid": "3596bbf7-66f0-49c0-8c3e-3472455f90c7", "core": false, "auto_approve": true, "unlocked_by": null, "difficulty": 1, "topics": null }, { "slug": "bob", "uuid": "46b447aa-b2b5-4f5c-ac73-8de47f897840", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null }, { "slug": "leap", "uuid": "d30952cf-0b7d-a980-9351-caedebfed16362c6a7a", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null } ] }
{ "language": "Haxe", "active": false, "blurb": "", "checklist_issue": 2, "test_pattern": "test.*Test[.]hx", "exercises": [ { "slug": "hello-world", "uuid": "3596bbf7-66f0-49c0-8c3e-3472455f90c7", "core": false, + "auto_approve": true, "unlocked_by": null, "difficulty": 1, "topics": null }, { "slug": "bob", "uuid": "46b447aa-b2b5-4f5c-ac73-8de47f897840", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null }, { "slug": "leap", "uuid": "d30952cf-0b7d-a980-9351-caedebfed16362c6a7a", "core": false, "unlocked_by": null, "difficulty": 1, "topics": null } ] }
1
0.030303
1
0
8f270c02445c1565e07bce70e46f295778f503da
.travis.yml
.travis.yml
language: scala jdk: - oraclejdk8 scala: - 2.11.8 branches: only: - master notifications: webhooks: urls: - https://webhooks.gitter.im/e/ab0619f0b7e5b623966a on_success: always on_failure: always on_start: never
language: scala jdk: - oraclejdk8 scala: - 2.11.12 - 2.12.4 branches: only: - master notifications: webhooks: urls: - https://webhooks.gitter.im/e/ab0619f0b7e5b623966a on_success: always on_failure: always on_start: never
Add Scala 2.12.4 to the Travis cross-compile.
Add Scala 2.12.4 to the Travis cross-compile.
YAML
mit
hacklanta/lift-formality
yaml
## Code Before: language: scala jdk: - oraclejdk8 scala: - 2.11.8 branches: only: - master notifications: webhooks: urls: - https://webhooks.gitter.im/e/ab0619f0b7e5b623966a on_success: always on_failure: always on_start: never ## Instruction: Add Scala 2.12.4 to the Travis cross-compile. ## Code After: language: scala jdk: - oraclejdk8 scala: - 2.11.12 - 2.12.4 branches: only: - master notifications: webhooks: urls: - https://webhooks.gitter.im/e/ab0619f0b7e5b623966a on_success: always on_failure: always on_start: never
language: scala jdk: - oraclejdk8 scala: - - 2.11.8 ? ^ + - 2.11.12 ? ^^ + - 2.12.4 branches: only: - master notifications: webhooks: urls: - https://webhooks.gitter.im/e/ab0619f0b7e5b623966a on_success: always on_failure: always on_start: never
3
0.166667
2
1
c4f1586877424923134ff5e4e3c09309bb17cc49
requirements.txt
requirements.txt
aiopg aiohttp aiodocker sqlalchemy jinja2 pyyaml
aiopg aiohttp aiodocker sqlalchemy jinja2 pyyaml # Needed to build the scripts. # node-uglify # node-less # coffeescript
Make a note of the platform tools
Make a note of the platform tools
Text
mit
paultag/moxie,mileswwatkins/moxie,loandy/moxie,rshorey/moxie,mileswwatkins/moxie,rshorey/moxie,rshorey/moxie,loandy/moxie,mileswwatkins/moxie,tianon/moxie,paultag/moxie,loandy/moxie,tianon/moxie,paultag/moxie
text
## Code Before: aiopg aiohttp aiodocker sqlalchemy jinja2 pyyaml ## Instruction: Make a note of the platform tools ## Code After: aiopg aiohttp aiodocker sqlalchemy jinja2 pyyaml # Needed to build the scripts. # node-uglify # node-less # coffeescript
aiopg aiohttp aiodocker sqlalchemy jinja2 pyyaml + + + # Needed to build the scripts. + # node-uglify + # node-less + # coffeescript
6
1
6
0
9c7ed6916c410cd2de20247381c607b9021cbd73
app/service/ScalaTestRunner.scala
app/service/ScalaTestRunner.scala
package service import java.io.ByteArrayOutputStream import org.scalatest.Suite import scala.util.{Failure, Success, Try} /** * Runs scalatest library test suite using the 'execute' method */ object ScalaTestRunner { val failedMarker = "FAILED" val failedInRuntimeMarker = "failed in runtime" val userClass = "UserSolution" def execSuite(solution: String, suiteClass: Class[Suite], solutionTrait: Class[AnyRef]): String = { Try { val solutionInstance = createSolutionInstance(solution, solutionTrait) execSuite(suiteClass.getConstructor(solutionTrait).newInstance(solutionInstance)) } match { case Success(s) => s case Failure(e) => s"Test failed in runtime with error:\n${e.getMessage}'" } } def execSuite(suiteInstance: Suite): String = { val stream = new ByteArrayOutputStream Console.withOut(stream) { suiteInstance.execute(stats = true, shortstacks = true, durations = true) } stream.toString } private def createSolutionInstance(solution: String, solutionTrait: Class[AnyRef]): AnyRef = { import scala.reflect.runtime._ val cm = universe.runtimeMirror(getClass.getClassLoader) import scala.tools.reflect.ToolBox val tb = cm.mkToolBox() val patchedSolution = solution.replaceFirst("(class [A-Za-z0-9]* )", s"class $userClass extends ${solutionTrait.getSimpleName} ") val dynamicCode = s"import ${solutionTrait.getName}; $patchedSolution; new $userClass" tb.eval(tb.parse(dynamicCode)).asInstanceOf[AnyRef] } }
package service import java.io.ByteArrayOutputStream import org.scalatest.{run, Suite} import scala.util.{Failure, Success, Try} /** * Runs scalatest library test suite using the 'execute' method */ object ScalaTestRunner { val failedMarker = "FAILED" val failedInRuntimeMarker = "failed in runtime" val userClass = "UserSolution" def execSuite(solution: String, suiteClass: Class[Suite], solutionTrait: Class[AnyRef]): String = { Try { val solutionInstance = createSolutionInstance(solution, solutionTrait) execSuite(suiteClass.getConstructor(solutionTrait).newInstance(solutionInstance)) } match { case Success(s) => s case Failure(e) => s"Test failed in runtime with error:\n${e.getMessage}'" } } def execSuite(suiteInstance: Suite): String = { val stream = new ByteArrayOutputStream Console.withOut(stream) { suiteInstance.execute(color = false) } stream.toString } private def createSolutionInstance(solution: String, solutionTrait: Class[AnyRef]): AnyRef = { import scala.reflect.runtime._ val cm = universe.runtimeMirror(getClass.getClassLoader) import scala.tools.reflect.ToolBox val tb = cm.mkToolBox() val patchedSolution = solution.replaceFirst("(class [A-Za-z0-9]* )", s"class $userClass extends ${solutionTrait.getSimpleName} ") val dynamicCode = s"import ${solutionTrait.getName}; $patchedSolution; new $userClass" tb.eval(tb.parse(dynamicCode)).asInstanceOf[AnyRef] } }
Add "Write Whole Class" submission: improving the report output by removing color characters which can't be treated correctly in html
Add "Write Whole Class" submission: improving the report output by removing color characters which can't be treated correctly in html
Scala
apache-2.0
DmytroOrlov/devgym,DmytroOrlov/devgym
scala
## Code Before: package service import java.io.ByteArrayOutputStream import org.scalatest.Suite import scala.util.{Failure, Success, Try} /** * Runs scalatest library test suite using the 'execute' method */ object ScalaTestRunner { val failedMarker = "FAILED" val failedInRuntimeMarker = "failed in runtime" val userClass = "UserSolution" def execSuite(solution: String, suiteClass: Class[Suite], solutionTrait: Class[AnyRef]): String = { Try { val solutionInstance = createSolutionInstance(solution, solutionTrait) execSuite(suiteClass.getConstructor(solutionTrait).newInstance(solutionInstance)) } match { case Success(s) => s case Failure(e) => s"Test failed in runtime with error:\n${e.getMessage}'" } } def execSuite(suiteInstance: Suite): String = { val stream = new ByteArrayOutputStream Console.withOut(stream) { suiteInstance.execute(stats = true, shortstacks = true, durations = true) } stream.toString } private def createSolutionInstance(solution: String, solutionTrait: Class[AnyRef]): AnyRef = { import scala.reflect.runtime._ val cm = universe.runtimeMirror(getClass.getClassLoader) import scala.tools.reflect.ToolBox val tb = cm.mkToolBox() val patchedSolution = solution.replaceFirst("(class [A-Za-z0-9]* )", s"class $userClass extends ${solutionTrait.getSimpleName} ") val dynamicCode = s"import ${solutionTrait.getName}; $patchedSolution; new $userClass" tb.eval(tb.parse(dynamicCode)).asInstanceOf[AnyRef] } } ## Instruction: Add "Write Whole Class" submission: improving the report output by removing color characters which can't be treated correctly in html ## Code After: package service import java.io.ByteArrayOutputStream import org.scalatest.{run, Suite} import scala.util.{Failure, Success, Try} /** * Runs scalatest library test suite using the 'execute' method */ object ScalaTestRunner { val failedMarker = "FAILED" val failedInRuntimeMarker = "failed in runtime" val userClass = "UserSolution" def execSuite(solution: String, suiteClass: Class[Suite], solutionTrait: Class[AnyRef]): String = { Try { val solutionInstance = createSolutionInstance(solution, solutionTrait) execSuite(suiteClass.getConstructor(solutionTrait).newInstance(solutionInstance)) } match { case Success(s) => s case Failure(e) => s"Test failed in runtime with error:\n${e.getMessage}'" } } def execSuite(suiteInstance: Suite): String = { val stream = new ByteArrayOutputStream Console.withOut(stream) { suiteInstance.execute(color = false) } stream.toString } private def createSolutionInstance(solution: String, solutionTrait: Class[AnyRef]): AnyRef = { import scala.reflect.runtime._ val cm = universe.runtimeMirror(getClass.getClassLoader) import scala.tools.reflect.ToolBox val tb = cm.mkToolBox() val patchedSolution = solution.replaceFirst("(class [A-Za-z0-9]* )", s"class $userClass extends ${solutionTrait.getSimpleName} ") val dynamicCode = s"import ${solutionTrait.getName}; $patchedSolution; new $userClass" tb.eval(tb.parse(dynamicCode)).asInstanceOf[AnyRef] } }
package service import java.io.ByteArrayOutputStream - import org.scalatest.Suite + import org.scalatest.{run, Suite} ? ++++++ + import scala.util.{Failure, Success, Try} /** * Runs scalatest library test suite using the 'execute' method */ object ScalaTestRunner { val failedMarker = "FAILED" val failedInRuntimeMarker = "failed in runtime" val userClass = "UserSolution" def execSuite(solution: String, suiteClass: Class[Suite], solutionTrait: Class[AnyRef]): String = { Try { val solutionInstance = createSolutionInstance(solution, solutionTrait) execSuite(suiteClass.getConstructor(solutionTrait).newInstance(solutionInstance)) } match { case Success(s) => s case Failure(e) => s"Test failed in runtime with error:\n${e.getMessage}'" } } def execSuite(suiteInstance: Suite): String = { val stream = new ByteArrayOutputStream Console.withOut(stream) { - suiteInstance.execute(stats = true, shortstacks = true, durations = true) + suiteInstance.execute(color = false) } stream.toString } private def createSolutionInstance(solution: String, solutionTrait: Class[AnyRef]): AnyRef = { import scala.reflect.runtime._ val cm = universe.runtimeMirror(getClass.getClassLoader) import scala.tools.reflect.ToolBox val tb = cm.mkToolBox() val patchedSolution = solution.replaceFirst("(class [A-Za-z0-9]* )", s"class $userClass extends ${solutionTrait.getSimpleName} ") val dynamicCode = s"import ${solutionTrait.getName}; $patchedSolution; new $userClass" tb.eval(tb.parse(dynamicCode)).asInstanceOf[AnyRef] } }
4
0.083333
2
2
ebc8ab06f04e9b68fbb4952dca0db2377186a3e0
plugins/pg_search/db/migrate/20130320010063_create_indexes_for_search.rb
plugins/pg_search/db/migrate/20130320010063_create_indexes_for_search.rb
class CreateIndexesForSearch < ActiveRecord::Migration def self.up searchables = %w[ article comment qualifier national_region certifier profile license scrap category ] klasses = searchables.map {|searchable| searchable.camelize.constantize } klasses.each do |klass| fields = klass.pg_search_plugin_fields execute "create index pg_search_plugin_#{klass.name.singularize.downcase} on #{klass.table_name} using gin(to_tsvector('simple', #{fields}))" end end def self.down klasses.each do |klass| execute "drop index pg_search_plugin_#{klass.name.singularize.downcase}" end end end
class CreateIndexesForSearch < ActiveRecord::Migration Searchables = %w[ article comment qualifier national_region certifier profile license scrap category ] Klasses = Searchables.map {|searchable| searchable.camelize.constantize } def self.up Klasses.each do |klass| fields = klass.pg_search_plugin_fields execute "create index pg_search_plugin_#{klass.name.singularize.downcase} on #{klass.table_name} using gin(to_tsvector('simple', #{fields}))" end end def self.down Klasses.each do |klass| execute "drop index pg_search_plugin_#{klass.name.singularize.downcase}" end end end
Fix down migrate on pg_search plugin
Fix down migrate on pg_search plugin
Ruby
agpl-3.0
blogoosfero/noosfero,blogoosfero/noosfero,blogoosfero/noosfero,blogoosfero/noosfero,blogoosfero/noosfero,blogoosfero/noosfero,blogoosfero/noosfero
ruby
## Code Before: class CreateIndexesForSearch < ActiveRecord::Migration def self.up searchables = %w[ article comment qualifier national_region certifier profile license scrap category ] klasses = searchables.map {|searchable| searchable.camelize.constantize } klasses.each do |klass| fields = klass.pg_search_plugin_fields execute "create index pg_search_plugin_#{klass.name.singularize.downcase} on #{klass.table_name} using gin(to_tsvector('simple', #{fields}))" end end def self.down klasses.each do |klass| execute "drop index pg_search_plugin_#{klass.name.singularize.downcase}" end end end ## Instruction: Fix down migrate on pg_search plugin ## Code After: class CreateIndexesForSearch < ActiveRecord::Migration Searchables = %w[ article comment qualifier national_region certifier profile license scrap category ] Klasses = Searchables.map {|searchable| searchable.camelize.constantize } def self.up Klasses.each do |klass| fields = klass.pg_search_plugin_fields execute "create index pg_search_plugin_#{klass.name.singularize.downcase} on #{klass.table_name} using gin(to_tsvector('simple', #{fields}))" end end def self.down Klasses.each do |klass| execute "drop index pg_search_plugin_#{klass.name.singularize.downcase}" end end end
class CreateIndexesForSearch < ActiveRecord::Migration + + Searchables = %w[ article comment qualifier national_region certifier profile license scrap category ] + Klasses = Searchables.map {|searchable| searchable.camelize.constantize } + def self.up - searchables = %w[ article comment qualifier national_region certifier profile license scrap category ] - klasses = searchables.map {|searchable| searchable.camelize.constantize } - klasses.each do |klass| ? ^ + Klasses.each do |klass| ? ^ fields = klass.pg_search_plugin_fields execute "create index pg_search_plugin_#{klass.name.singularize.downcase} on #{klass.table_name} using gin(to_tsvector('simple', #{fields}))" end end def self.down - klasses.each do |klass| ? ^ + Klasses.each do |klass| ? ^ execute "drop index pg_search_plugin_#{klass.name.singularize.downcase}" end end end
10
0.625
6
4
dc1593090392ac8277a0503e70c040aa4e0cc908
CTestCustom.cmake.in
CTestCustom.cmake.in
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "33331") set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "33331")
set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "2000") set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "2000")
Reduce maximum number of warnings/errors. (they took GBs even for limited period of time)
Reduce maximum number of warnings/errors. (they took GBs even for limited period of time)
unknown
bsd-3-clause
ROCmSoftwarePlatform/hipeigen,toastedcrumpets/eigen,Zefz/eigen,pasuka/eigen,ritsu1228/eigen,pasuka/eigen,ROCmSoftwarePlatform/hipeigen,TSC21/Eigen,pasuka/eigen,pasuka/eigen,toastedcrumpets/eigen,ROCmSoftwarePlatform/hipeigen,Zefz/eigen,ROCmSoftwarePlatform/hipeigen,TSC21/Eigen,toastedcrumpets/eigen,TSC21/Eigen,ritsu1228/eigen,ritsu1228/eigen,ritsu1228/eigen,TSC21/Eigen,pasuka/eigen,Zefz/eigen,ritsu1228/eigen,toastedcrumpets/eigen,Zefz/eigen
unknown
## Code Before: set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "33331") set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "33331") ## Instruction: Reduce maximum number of warnings/errors. (they took GBs even for limited period of time) ## Code After: set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "2000") set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "2000")
+ - set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "33331") ? ^^^^^ + set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS "2000") ? ^^^^ - set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "33331") ? ^^^^^ + set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS "2000") ? ++ ^^^^
5
2.5
3
2
20f651a20ddf23cd2e1ab6d37b547c49176df43b
README.markdown
README.markdown
MultiSelect progessively enhances an ordinary multiple select control into elegant drop down list of checkboxes, stylable with ThemeRoller. ![Example](http://www.erichynds.com/examples/jquery-multiselect/screenshot-widget.gif) # License jScrollPane is dual-licensed under the [GPL 2 license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/GPL-LICENSE) and the [MIT license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/MIT-LICENSE).
MultiSelect progessively enhances an ordinary multiple select control into elegant drop down list of checkboxes, stylable with ThemeRoller. ![Example](http://www.erichynds.com/examples/jquery-multiselect/screenshot-widget.gif) # License MultiSelect is dual-licensed under the [GPL 2 license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/GPL-LICENSE) and the [MIT license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/MIT-LICENSE).
Correct project name in markdown.
Correct project name in markdown.
Markdown
mit
GerHobbelt/jquery-multiselect,GerHobbelt/jquery-multiselect,GerHobbelt/jquery-multiselect
markdown
## Code Before: MultiSelect progessively enhances an ordinary multiple select control into elegant drop down list of checkboxes, stylable with ThemeRoller. ![Example](http://www.erichynds.com/examples/jquery-multiselect/screenshot-widget.gif) # License jScrollPane is dual-licensed under the [GPL 2 license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/GPL-LICENSE) and the [MIT license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/MIT-LICENSE). ## Instruction: Correct project name in markdown. ## Code After: MultiSelect progessively enhances an ordinary multiple select control into elegant drop down list of checkboxes, stylable with ThemeRoller. ![Example](http://www.erichynds.com/examples/jquery-multiselect/screenshot-widget.gif) # License MultiSelect is dual-licensed under the [GPL 2 license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/GPL-LICENSE) and the [MIT license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/MIT-LICENSE).
MultiSelect progessively enhances an ordinary multiple select control into elegant drop down list of checkboxes, stylable with ThemeRoller. ![Example](http://www.erichynds.com/examples/jquery-multiselect/screenshot-widget.gif) # License - jScrollPane is dual-licensed under the [GPL 2 license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/GPL-LICENSE) and the [MIT license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/MIT-LICENSE). ? ^ ^^^^^^^^^ + MultiSelect is dual-licensed under the [GPL 2 license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/GPL-LICENSE) and the [MIT license](https://github.com/ehynds/jquery-ui-multiselect-widget/blob/master/MIT-LICENSE). ? ^^^^^ ^^^^^
2
0.25
1
1
0825778fd4720d22c56f892a75d8dfb697f1789f
src/SimplyTestable/WorkerBundle/Tests/Command/Task/ReportCompletionAllCommandTest.php
src/SimplyTestable/WorkerBundle/Tests/Command/Task/ReportCompletionAllCommandTest.php
<?php namespace SimplyTestable\WorkerBundle\Tests\Command\Task; use SimplyTestable\WorkerBundle\Tests\Command\ConsoleCommandBaseTestCase; use SimplyTestable\WorkerBundle\Entity\TimePeriod; class ReportCompletionAllCommandTest extends ConsoleCommandBaseTestCase { public static function setUpBeforeClass() { self::setupDatabaseIfNotExists(); } /** * @group standard */ public function testReportCompletionAll() { $this->setHttpFixtures($this->getHttpFixtures($this->getFixturesDataPath(__FUNCTION__ . '/HttpResponses'))); $taskProperties = $this->createTask('http://example.com/', 'HTML validation'); $task = $this->getTaskService()->getById($taskProperties->id); $taskTimePeriod = new TimePeriod(); $taskTimePeriod->setStartDateTime(new \DateTime('1970-01-01')); $taskTimePeriod->setEndDateTime(new \DateTime('1970-01-02')); $task->setTimePeriod($taskTimePeriod); $this->createCompletedTaskOutputForTask($task); $response = $this->runConsole('simplytestable:task:reportcompletion:all'); $this->assertEquals(0, $response); } }
<?php namespace SimplyTestable\WorkerBundle\Tests\Command\Task; use SimplyTestable\WorkerBundle\Tests\Command\ConsoleCommandBaseTestCase; use SimplyTestable\WorkerBundle\Entity\TimePeriod; class ReportCompletionAllCommandTest extends ConsoleCommandBaseTestCase { public static function setUpBeforeClass() { self::setupDatabaseIfNotExists(); } /** * @group standard */ public function testReportCompletionAll() { $this->setHttpFixtures($this->getHttpFixtures($this->getFixturesDataPath(__FUNCTION__ . '/HttpResponses'))); $this->removeAllTasks(); $taskProperties = $this->createTask('http://example.com/', 'HTML validation'); $task = $this->getTaskService()->getById($taskProperties->id); $taskTimePeriod = new TimePeriod(); $taskTimePeriod->setStartDateTime(new \DateTime('1970-01-01')); $taskTimePeriod->setEndDateTime(new \DateTime('1970-01-02')); $task->setTimePeriod($taskTimePeriod); $this->createCompletedTaskOutputForTask($task); $response = $this->runConsole('simplytestable:task:reportcompletion:all'); $this->assertEquals(0, $response); } }
Remove all tasks before testing report completion all
Remove all tasks before testing report completion all
PHP
mit
webignition/worker.simplytestable.com,webignition/worker.simplytestable.com,webignition/worker.simplytestable.com,webignition/worker.simplytestable.com,webignition/worker.simplytestable.com
php
## Code Before: <?php namespace SimplyTestable\WorkerBundle\Tests\Command\Task; use SimplyTestable\WorkerBundle\Tests\Command\ConsoleCommandBaseTestCase; use SimplyTestable\WorkerBundle\Entity\TimePeriod; class ReportCompletionAllCommandTest extends ConsoleCommandBaseTestCase { public static function setUpBeforeClass() { self::setupDatabaseIfNotExists(); } /** * @group standard */ public function testReportCompletionAll() { $this->setHttpFixtures($this->getHttpFixtures($this->getFixturesDataPath(__FUNCTION__ . '/HttpResponses'))); $taskProperties = $this->createTask('http://example.com/', 'HTML validation'); $task = $this->getTaskService()->getById($taskProperties->id); $taskTimePeriod = new TimePeriod(); $taskTimePeriod->setStartDateTime(new \DateTime('1970-01-01')); $taskTimePeriod->setEndDateTime(new \DateTime('1970-01-02')); $task->setTimePeriod($taskTimePeriod); $this->createCompletedTaskOutputForTask($task); $response = $this->runConsole('simplytestable:task:reportcompletion:all'); $this->assertEquals(0, $response); } } ## Instruction: Remove all tasks before testing report completion all ## Code After: <?php namespace SimplyTestable\WorkerBundle\Tests\Command\Task; use SimplyTestable\WorkerBundle\Tests\Command\ConsoleCommandBaseTestCase; use SimplyTestable\WorkerBundle\Entity\TimePeriod; class ReportCompletionAllCommandTest extends ConsoleCommandBaseTestCase { public static function setUpBeforeClass() { self::setupDatabaseIfNotExists(); } /** * @group standard */ public function testReportCompletionAll() { $this->setHttpFixtures($this->getHttpFixtures($this->getFixturesDataPath(__FUNCTION__ . '/HttpResponses'))); $this->removeAllTasks(); $taskProperties = $this->createTask('http://example.com/', 'HTML validation'); $task = $this->getTaskService()->getById($taskProperties->id); $taskTimePeriod = new TimePeriod(); $taskTimePeriod->setStartDateTime(new \DateTime('1970-01-01')); $taskTimePeriod->setEndDateTime(new \DateTime('1970-01-02')); $task->setTimePeriod($taskTimePeriod); $this->createCompletedTaskOutputForTask($task); $response = $this->runConsole('simplytestable:task:reportcompletion:all'); $this->assertEquals(0, $response); } }
<?php namespace SimplyTestable\WorkerBundle\Tests\Command\Task; use SimplyTestable\WorkerBundle\Tests\Command\ConsoleCommandBaseTestCase; use SimplyTestable\WorkerBundle\Entity\TimePeriod; class ReportCompletionAllCommandTest extends ConsoleCommandBaseTestCase { public static function setUpBeforeClass() { self::setupDatabaseIfNotExists(); } /** * @group standard */ public function testReportCompletionAll() { $this->setHttpFixtures($this->getHttpFixtures($this->getFixturesDataPath(__FUNCTION__ . '/HttpResponses'))); + $this->removeAllTasks(); $taskProperties = $this->createTask('http://example.com/', 'HTML validation'); $task = $this->getTaskService()->getById($taskProperties->id); $taskTimePeriod = new TimePeriod(); $taskTimePeriod->setStartDateTime(new \DateTime('1970-01-01')); $taskTimePeriod->setEndDateTime(new \DateTime('1970-01-02')); $task->setTimePeriod($taskTimePeriod); $this->createCompletedTaskOutputForTask($task); $response = $this->runConsole('simplytestable:task:reportcompletion:all'); $this->assertEquals(0, $response); } }
1
0.026316
1
0
3d8cb7b5bb3a65d562755fff1d5303cc989f7e24
_data/projects.yml
_data/projects.yml
- name: Votr url: https://votr.uniba.sk description: Votr ponúka študentom jednoduchší a pohodlnejší spôsob, ako robiť najčastejšie činnosti zo systému AIS. Zapíšte sa na skúšky, prezrite si vaše hodnotenia a skontrolujte si počet kreditov bez zbytočného klikania. uses: [python, werkzeug] - name: Candle url: https://candle.fmph.uniba.sk/ description: Prehľadný interaktívny rozvrh hodín. uses: [php, symfony] - name: Anketa url: https://anketa.uniba.sk/ description: Študentská anketa UK. Prezentuj svoj názor! uses: [php, symfony] - name: Gate url: https://github.com/fmfi-svt-gate/server/wiki description: Systém na odomykanie dverí pomocou RFID kariet (ISIC/ITIC). uses: [arm, c, python]
- name: Votr url: https://votr.uniba.sk description: Votr ponúka študentom jednoduchší a pohodlnejší spôsob, ako robiť najčastejšie činnosti zo systému AIS. Zapíšte sa na skúšky, prezrite si vaše hodnotenia a skontrolujte si počet kreditov bez zbytočného klikania. uses: [python, werkzeug] - name: Candle url: https://candle.fmph.uniba.sk/ description: Prehľadný interaktívny rozvrh hodín. uses: [php, symfony] - name: Anketa url: https://anketa.uniba.sk/ description: Študentská anketa UK. Prezentuj svoj názor! uses: [php, symfony] - name: Gate url: https://github.com/fmfi-svt-gate/server/wiki description: Systém na odomykanie dverí pomocou RFID kariet (ISIC/ITIC). uses: [arm, c, python] - name: Infoboard url: https://sluzby.fmph.uniba.sk/infoboard/ description: Informačné obrazovky a web stránka s ich obsahom uses: [python, php]
Add Infoboard to project list
Add Infoboard to project list
YAML
mit
Adman/fmfi-svt.github.io,fmfi-svt/fmfi-svt.github.io
yaml
## Code Before: - name: Votr url: https://votr.uniba.sk description: Votr ponúka študentom jednoduchší a pohodlnejší spôsob, ako robiť najčastejšie činnosti zo systému AIS. Zapíšte sa na skúšky, prezrite si vaše hodnotenia a skontrolujte si počet kreditov bez zbytočného klikania. uses: [python, werkzeug] - name: Candle url: https://candle.fmph.uniba.sk/ description: Prehľadný interaktívny rozvrh hodín. uses: [php, symfony] - name: Anketa url: https://anketa.uniba.sk/ description: Študentská anketa UK. Prezentuj svoj názor! uses: [php, symfony] - name: Gate url: https://github.com/fmfi-svt-gate/server/wiki description: Systém na odomykanie dverí pomocou RFID kariet (ISIC/ITIC). uses: [arm, c, python] ## Instruction: Add Infoboard to project list ## Code After: - name: Votr url: https://votr.uniba.sk description: Votr ponúka študentom jednoduchší a pohodlnejší spôsob, ako robiť najčastejšie činnosti zo systému AIS. Zapíšte sa na skúšky, prezrite si vaše hodnotenia a skontrolujte si počet kreditov bez zbytočného klikania. uses: [python, werkzeug] - name: Candle url: https://candle.fmph.uniba.sk/ description: Prehľadný interaktívny rozvrh hodín. uses: [php, symfony] - name: Anketa url: https://anketa.uniba.sk/ description: Študentská anketa UK. Prezentuj svoj názor! uses: [php, symfony] - name: Gate url: https://github.com/fmfi-svt-gate/server/wiki description: Systém na odomykanie dverí pomocou RFID kariet (ISIC/ITIC). uses: [arm, c, python] - name: Infoboard url: https://sluzby.fmph.uniba.sk/infoboard/ description: Informačné obrazovky a web stránka s ich obsahom uses: [python, php]
- name: Votr url: https://votr.uniba.sk description: Votr ponúka študentom jednoduchší a pohodlnejší spôsob, ako robiť najčastejšie činnosti zo systému AIS. Zapíšte sa na skúšky, prezrite si vaše hodnotenia a skontrolujte si počet kreditov bez zbytočného klikania. uses: [python, werkzeug] - name: Candle url: https://candle.fmph.uniba.sk/ description: Prehľadný interaktívny rozvrh hodín. uses: [php, symfony] - name: Anketa url: https://anketa.uniba.sk/ description: Študentská anketa UK. Prezentuj svoj názor! uses: [php, symfony] - name: Gate url: https://github.com/fmfi-svt-gate/server/wiki description: Systém na odomykanie dverí pomocou RFID kariet (ISIC/ITIC). uses: [arm, c, python] + + - name: Infoboard + url: https://sluzby.fmph.uniba.sk/infoboard/ + description: Informačné obrazovky a web stránka s ich obsahom + uses: [python, php]
5
0.25
5
0
d795d858e9f452347a0b5024ff9d253ca6d7b7c9
lib/card_sharks.rb
lib/card_sharks.rb
require "card_sharks/version" require "card_sharks/card" require "card_sharks/deck" module CardSharks # Your code goes here... end
require "card_sharks/version" require "card_sharks/card" require "card_sharks/deck" require "card_sharks/blackjack" require "card_sharks/player" require "card_sharks/dealer" module CardSharks # Your code goes here... end
Update file to include required files
Update file to include required files
Ruby
mit
FluffyCode/card_sharks
ruby
## Code Before: require "card_sharks/version" require "card_sharks/card" require "card_sharks/deck" module CardSharks # Your code goes here... end ## Instruction: Update file to include required files ## Code After: require "card_sharks/version" require "card_sharks/card" require "card_sharks/deck" require "card_sharks/blackjack" require "card_sharks/player" require "card_sharks/dealer" module CardSharks # Your code goes here... end
require "card_sharks/version" require "card_sharks/card" require "card_sharks/deck" + require "card_sharks/blackjack" + require "card_sharks/player" + require "card_sharks/dealer" module CardSharks # Your code goes here... end
3
0.428571
3
0
60b680b13e9c07aa6f5c03736dfecafcfd48fff9
lib/figurine/collaborator.rb
lib/figurine/collaborator.rb
require 'active_support/core_ext/hash/slice' module Figurine class Collaborator < ActiveSupport::BasicObject extend ActiveModel::Naming include ActiveModel::Conversion def initialize(given, whitelist) attributes = if given.respond_to?(:to_hash) given.to_hash elsif given.respond_to?(:attributes) given.attributes end attributes = attributes.slice(*whitelist) unless whitelist.empty? @attributes = (given[:id] ? attributes.merge!(:id => given[:id]) : attributes) @attributes.each do |name, val| self.class.define_method name do attributes[name] end self.class.define_method "#{name}=" do |val| attributes[name] = val end end end def method_missing(m, *args, &block) if @attributes.respond_to?(m) @attributes.send(m, *args, &block) else super end end def ==(other) @attributes == other end alias :eql? :== end end
require 'active_support/core_ext/hash/slice' module Figurine class Collaborator < ActiveSupport::BasicObject extend ActiveModel::Naming include ActiveModel::Conversion def initialize(given, whitelist) attributes = if given.respond_to?(:to_hash) given.to_hash elsif given.respond_to?(:attributes) given.attributes end attributes = attributes.slice(*whitelist) unless whitelist.empty? @attributes = (given[:id] ? attributes.merge!(:id => given[:id]) : attributes) @attributes.each do |name, val| self.class.send(:define_method, name) do attributes[name] end self.class.send(:define_method, "#{name}=") do |val| attributes[name] = val end end end def method_missing(m, *args, &block) if @attributes.respond_to?(m) @attributes.send(m, *args, &block) else super end end def ==(other) @attributes == other end alias :eql? :== end end
Use send to call define_method
Use send to call define_method
Ruby
mit
optimis/figurine
ruby
## Code Before: require 'active_support/core_ext/hash/slice' module Figurine class Collaborator < ActiveSupport::BasicObject extend ActiveModel::Naming include ActiveModel::Conversion def initialize(given, whitelist) attributes = if given.respond_to?(:to_hash) given.to_hash elsif given.respond_to?(:attributes) given.attributes end attributes = attributes.slice(*whitelist) unless whitelist.empty? @attributes = (given[:id] ? attributes.merge!(:id => given[:id]) : attributes) @attributes.each do |name, val| self.class.define_method name do attributes[name] end self.class.define_method "#{name}=" do |val| attributes[name] = val end end end def method_missing(m, *args, &block) if @attributes.respond_to?(m) @attributes.send(m, *args, &block) else super end end def ==(other) @attributes == other end alias :eql? :== end end ## Instruction: Use send to call define_method ## Code After: require 'active_support/core_ext/hash/slice' module Figurine class Collaborator < ActiveSupport::BasicObject extend ActiveModel::Naming include ActiveModel::Conversion def initialize(given, whitelist) attributes = if given.respond_to?(:to_hash) given.to_hash elsif given.respond_to?(:attributes) given.attributes end attributes = attributes.slice(*whitelist) unless whitelist.empty? @attributes = (given[:id] ? attributes.merge!(:id => given[:id]) : attributes) @attributes.each do |name, val| self.class.send(:define_method, name) do attributes[name] end self.class.send(:define_method, "#{name}=") do |val| attributes[name] = val end end end def method_missing(m, *args, &block) if @attributes.respond_to?(m) @attributes.send(m, *args, &block) else super end end def ==(other) @attributes == other end alias :eql? :== end end
require 'active_support/core_ext/hash/slice' module Figurine class Collaborator < ActiveSupport::BasicObject extend ActiveModel::Naming include ActiveModel::Conversion def initialize(given, whitelist) attributes = if given.respond_to?(:to_hash) given.to_hash elsif given.respond_to?(:attributes) given.attributes end attributes = attributes.slice(*whitelist) unless whitelist.empty? @attributes = (given[:id] ? attributes.merge!(:id => given[:id]) : attributes) @attributes.each do |name, val| - self.class.define_method name do + self.class.send(:define_method, name) do ? ++++++ + + attributes[name] end - self.class.define_method "#{name}=" do |val| + self.class.send(:define_method, "#{name}=") do |val| ? ++++++ + + attributes[name] = val end end end def method_missing(m, *args, &block) if @attributes.respond_to?(m) @attributes.send(m, *args, &block) else super end end def ==(other) @attributes == other end alias :eql? :== end end
4
0.1
2
2
c128d4f6c1346d1ad5456c420a4b177e8a81b7fb
db/migrate/1_create_retailers_retailers.rb
db/migrate/1_create_retailers_retailers.rb
class CreateRetailersRetailers < ActiveRecord::Migration def up create_table :refinery_retailers do |t| t.string :title t.string :contact t.string :address t.string :zipcode t.string :phone t.string :fax t.string :email t.string :website t.boolean :draft t.integer :position t.timestamps end end def down if defined?(::Refinery::UserPlugin) ::Refinery::UserPlugin.destroy_all({:name => "refinerycms-retailers"}) end if defined?(::Refinery::Page) ::Refinery::Page.delete_all({:link_url => "/retailers/retailers"}) end drop_table :refinery_retailers end end
class CreateRetailersRetailers < ActiveRecord::Migration def up create_table :refinery_retailers do |t| t.string :title t.string :contact t.string :address t.string :zipcode t.string :phone t.string :fax t.string :email t.string :website t.boolean :draft, default: true t.integer :position t.timestamps end end def down if defined?(::Refinery::UserPlugin) ::Refinery::UserPlugin.destroy_all({:name => "refinerycms-retailers"}) end if defined?(::Refinery::Page) ::Refinery::Page.delete_all({:link_url => "/retailers/retailers"}) end drop_table :refinery_retailers end end
Add default true to draft
Add default true to draft
Ruby
mit
bisscomm/refinerycms-retailers,bisscomm/refinerycms-retailers
ruby
## Code Before: class CreateRetailersRetailers < ActiveRecord::Migration def up create_table :refinery_retailers do |t| t.string :title t.string :contact t.string :address t.string :zipcode t.string :phone t.string :fax t.string :email t.string :website t.boolean :draft t.integer :position t.timestamps end end def down if defined?(::Refinery::UserPlugin) ::Refinery::UserPlugin.destroy_all({:name => "refinerycms-retailers"}) end if defined?(::Refinery::Page) ::Refinery::Page.delete_all({:link_url => "/retailers/retailers"}) end drop_table :refinery_retailers end end ## Instruction: Add default true to draft ## Code After: class CreateRetailersRetailers < ActiveRecord::Migration def up create_table :refinery_retailers do |t| t.string :title t.string :contact t.string :address t.string :zipcode t.string :phone t.string :fax t.string :email t.string :website t.boolean :draft, default: true t.integer :position t.timestamps end end def down if defined?(::Refinery::UserPlugin) ::Refinery::UserPlugin.destroy_all({:name => "refinerycms-retailers"}) end if defined?(::Refinery::Page) ::Refinery::Page.delete_all({:link_url => "/retailers/retailers"}) end drop_table :refinery_retailers end end
class CreateRetailersRetailers < ActiveRecord::Migration def up create_table :refinery_retailers do |t| t.string :title t.string :contact t.string :address t.string :zipcode t.string :phone t.string :fax t.string :email t.string :website - t.boolean :draft + t.boolean :draft, default: true t.integer :position t.timestamps end end def down if defined?(::Refinery::UserPlugin) ::Refinery::UserPlugin.destroy_all({:name => "refinerycms-retailers"}) end if defined?(::Refinery::Page) ::Refinery::Page.delete_all({:link_url => "/retailers/retailers"}) end drop_table :refinery_retailers end end
2
0.058824
1
1
6ccad1eb9d8e779d92517ac642dc0c8e4c899d49
lib/web/views/api/room_view.ex
lib/web/views/api/room_view.ex
defmodule Web.API.RoomView do use Web, :view alias Web.Endpoint alias Web.API.Link def render("index.json", %{pagination: pagination, rooms: rooms, zone: zone}) do %{ items: render_many(rooms, __MODULE__, "show.json"), links: [ %Link{ rel: :self, href: Routes.api_zone_room_path(Endpoint, :index, zone.id, page: pagination.current) } ] } end def render("show.json", %{room: room}) do %{ name: room.name, live?: not is_nil(room.live_at), links: [ %Link{ rel: :self, href: Routes.api_room_path(Endpoint, :show, room.id) } ] } end end
defmodule Web.API.RoomView do use Web, :view alias Web.Endpoint alias Web.API.Link def render("index.json", %{pagination: pagination, rooms: rooms, zone: zone}) do %{ items: render_many(rooms, __MODULE__, "show.json"), links: [ %Link{ rel: :self, href: Routes.api_zone_room_path(Endpoint, :index, zone.id, page: pagination.current) } ] } end def render("show.json", %{room: room}) do %{ name: room.name, description: room.description, live?: not is_nil(room.live_at), links: [ %Link{ rel: :self, href: Routes.api_room_path(Endpoint, :show, room.id) } ] } end end
Add description to the room response
Add description to the room response
Elixir
mit
oestrich/ex_venture,oestrich/ex_venture,oestrich/ex_venture
elixir
## Code Before: defmodule Web.API.RoomView do use Web, :view alias Web.Endpoint alias Web.API.Link def render("index.json", %{pagination: pagination, rooms: rooms, zone: zone}) do %{ items: render_many(rooms, __MODULE__, "show.json"), links: [ %Link{ rel: :self, href: Routes.api_zone_room_path(Endpoint, :index, zone.id, page: pagination.current) } ] } end def render("show.json", %{room: room}) do %{ name: room.name, live?: not is_nil(room.live_at), links: [ %Link{ rel: :self, href: Routes.api_room_path(Endpoint, :show, room.id) } ] } end end ## Instruction: Add description to the room response ## Code After: defmodule Web.API.RoomView do use Web, :view alias Web.Endpoint alias Web.API.Link def render("index.json", %{pagination: pagination, rooms: rooms, zone: zone}) do %{ items: render_many(rooms, __MODULE__, "show.json"), links: [ %Link{ rel: :self, href: Routes.api_zone_room_path(Endpoint, :index, zone.id, page: pagination.current) } ] } end def render("show.json", %{room: room}) do %{ name: room.name, description: room.description, live?: not is_nil(room.live_at), links: [ %Link{ rel: :self, href: Routes.api_room_path(Endpoint, :show, room.id) } ] } end end
defmodule Web.API.RoomView do use Web, :view alias Web.Endpoint alias Web.API.Link def render("index.json", %{pagination: pagination, rooms: rooms, zone: zone}) do %{ items: render_many(rooms, __MODULE__, "show.json"), links: [ %Link{ rel: :self, href: Routes.api_zone_room_path(Endpoint, :index, zone.id, page: pagination.current) } ] } end def render("show.json", %{room: room}) do %{ name: room.name, + description: room.description, live?: not is_nil(room.live_at), links: [ %Link{ rel: :self, href: Routes.api_room_path(Endpoint, :show, room.id) } ] } end end
1
0.032258
1
0
f7a537ab91263d1010d32938864ad20bcfce5567
Tests/Public/Foundation/DatabaseCoderTests.swift
Tests/Public/Foundation/DatabaseCoderTests.swift
import XCTest #if USING_SQLCIPHER import GRDBCipher #elseif USING_CUSTOMSQLITE import GRDBCustomSQLite #else import GRDB #endif class DatabaseCoderTests: GRDBTestCase { func testDatabaseCoder() { assertNoError { let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in try db.execute("CREATE TABLE arrays (array BLOB)") let array = [1,2,3] try db.execute("INSERT INTO arrays VALUES (?)", arguments: [DatabaseCoder(array)]) let row = Row.fetchOne(db, "SELECT * FROM arrays")! let fetchedArray = ((row.value(named: "array") as DatabaseCoder).object as! NSArray).map { $0 as! Int } XCTAssertEqual(array, fetchedArray) } } } }
import XCTest #if USING_SQLCIPHER import GRDBCipher #elseif USING_CUSTOMSQLITE import GRDBCustomSQLite #else import GRDB #endif class DatabaseCoderTests: GRDBTestCase { func testDatabaseCoder() { assertNoError { let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in try db.execute("CREATE TABLE arrays (array BLOB)") let array = [1,2,3] try db.execute("INSERT INTO arrays VALUES (?)", arguments: [DatabaseCoder(array)]) let row = Row.fetchOne(db, "SELECT * FROM arrays")! let fetchedArray = ((row.value(named: "array") as DatabaseCoder).object as! NSArray).map { $0 as! Int } XCTAssertEqual(array, fetchedArray) } } } func testDatabaseCoderInitNilFailure() { XCTAssertNil(DatabaseCoder(nil)) } func testDatabaseCoderFromDatabaseValueFailure() { let databaseValue_Null = DatabaseValue.Null let databaseValue_Int64 = Int64(1).databaseValue let databaseValue_String = "foo".databaseValue let databaseValue_Double = Double(100000.1).databaseValue XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_Null)) XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_Int64)) XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_Double)) XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_String)) } }
Increase test coverage of DatabaseCoder.swift
Increase test coverage of DatabaseCoder.swift Test failure cases.
Swift
mit
zmeyc/GRDB.swift,zmeyc/GRDB.swift,groue/GRDB.swift,groue/GRDB.swift,groue/GRDB.swift,groue/GRDB.swift,zmeyc/GRDB.swift,zmeyc/GRDB.swift
swift
## Code Before: import XCTest #if USING_SQLCIPHER import GRDBCipher #elseif USING_CUSTOMSQLITE import GRDBCustomSQLite #else import GRDB #endif class DatabaseCoderTests: GRDBTestCase { func testDatabaseCoder() { assertNoError { let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in try db.execute("CREATE TABLE arrays (array BLOB)") let array = [1,2,3] try db.execute("INSERT INTO arrays VALUES (?)", arguments: [DatabaseCoder(array)]) let row = Row.fetchOne(db, "SELECT * FROM arrays")! let fetchedArray = ((row.value(named: "array") as DatabaseCoder).object as! NSArray).map { $0 as! Int } XCTAssertEqual(array, fetchedArray) } } } } ## Instruction: Increase test coverage of DatabaseCoder.swift Test failure cases. ## Code After: import XCTest #if USING_SQLCIPHER import GRDBCipher #elseif USING_CUSTOMSQLITE import GRDBCustomSQLite #else import GRDB #endif class DatabaseCoderTests: GRDBTestCase { func testDatabaseCoder() { assertNoError { let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in try db.execute("CREATE TABLE arrays (array BLOB)") let array = [1,2,3] try db.execute("INSERT INTO arrays VALUES (?)", arguments: [DatabaseCoder(array)]) let row = Row.fetchOne(db, "SELECT * FROM arrays")! let fetchedArray = ((row.value(named: "array") as DatabaseCoder).object as! NSArray).map { $0 as! Int } XCTAssertEqual(array, fetchedArray) } } } func testDatabaseCoderInitNilFailure() { XCTAssertNil(DatabaseCoder(nil)) } func testDatabaseCoderFromDatabaseValueFailure() { let databaseValue_Null = DatabaseValue.Null let databaseValue_Int64 = Int64(1).databaseValue let databaseValue_String = "foo".databaseValue let databaseValue_Double = Double(100000.1).databaseValue XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_Null)) XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_Int64)) XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_Double)) XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_String)) } }
import XCTest #if USING_SQLCIPHER import GRDBCipher #elseif USING_CUSTOMSQLITE import GRDBCustomSQLite #else import GRDB #endif class DatabaseCoderTests: GRDBTestCase { func testDatabaseCoder() { assertNoError { let dbQueue = try makeDatabaseQueue() try dbQueue.inDatabase { db in try db.execute("CREATE TABLE arrays (array BLOB)") let array = [1,2,3] try db.execute("INSERT INTO arrays VALUES (?)", arguments: [DatabaseCoder(array)]) let row = Row.fetchOne(db, "SELECT * FROM arrays")! let fetchedArray = ((row.value(named: "array") as DatabaseCoder).object as! NSArray).map { $0 as! Int } XCTAssertEqual(array, fetchedArray) } } } + + func testDatabaseCoderInitNilFailure() { + XCTAssertNil(DatabaseCoder(nil)) + } + + func testDatabaseCoderFromDatabaseValueFailure() { + let databaseValue_Null = DatabaseValue.Null + let databaseValue_Int64 = Int64(1).databaseValue + let databaseValue_String = "foo".databaseValue + let databaseValue_Double = Double(100000.1).databaseValue + XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_Null)) + XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_Int64)) + XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_Double)) + XCTAssertNil(DatabaseCoder.fromDatabaseValue(databaseValue_String)) + } }
15
0.555556
15
0
247cf9d2436a3168addc1ef112c45b48a208d70c
lib/router.coffee
lib/router.coffee
Router.configure layoutTemplate: 'Layout' Router.route '/', -> return @redirect '/course/si' Router.route '/si', -> return @redirect '/course/si' Router.route '/tsi', -> return @redirect '/course/tsi' Router.route '/course/:course', name: 'course' waitOn: -> return [ Meteor.subscribe 'Grade' Meteor.subscribe 'userGradeInfo' ] action: -> course = @params.course.toLowerCase() if course not in ['si', 'tsi'] return @redirect '/course/si' Session.set 'grade', course Session.set 'grade-filter-status', @params.query.status @render 'Grade' fastRender: true Router.route '/my/:course/:email', name: 'my' waitOn: -> return [ Meteor.subscribe 'Grade' Meteor.subscribe 'userGradeInfo' ] action: -> course = @params.course.toLowerCase() if course not in ['si', 'tsi'] return @redirect "/course/si/#{params.email}" Session.set 'grade', course Session.set 'grade-filter-status', @params.query.status @render 'Grade', data: email: @params.email fastRender: true
Router.configure layoutTemplate: 'Layout' Router.route '/', -> return @redirect '/course/si' Router.route '/si', -> return @redirect '/course/si' Router.route '/tsi', -> return @redirect '/course/tsi' Router.route '/course/:course', name: 'course' waitOn: -> return [ Meteor.subscribe 'Grade' Meteor.subscribe 'userGradeInfo' ] action: -> course = @params.course.toLowerCase() if course not in ['si', 'tsi'] return @redirect '/course/si' Session.set 'grade', course Session.set 'grade-filter-status', @params.query.status @render 'Grade' fastRender: true Router.route '/my/:course/:email', name: 'my' waitOn: -> return [ Meteor.subscribe 'Grade' Meteor.subscribe 'userGradeInfo', @params.email ] action: -> course = @params.course.toLowerCase() if course not in ['si', 'tsi'] return @redirect "/course/si/#{@params.email}" Session.set 'grade', course Session.set 'grade-filter-status', @params.query.status @render 'Grade', data: email: @params.email fastRender: true
Fix bugs with shared url
Fix bugs with shared url
CoffeeScript
mit
rodrigok/GradeFaccat,rodrigok/GradeFaccat
coffeescript
## Code Before: Router.configure layoutTemplate: 'Layout' Router.route '/', -> return @redirect '/course/si' Router.route '/si', -> return @redirect '/course/si' Router.route '/tsi', -> return @redirect '/course/tsi' Router.route '/course/:course', name: 'course' waitOn: -> return [ Meteor.subscribe 'Grade' Meteor.subscribe 'userGradeInfo' ] action: -> course = @params.course.toLowerCase() if course not in ['si', 'tsi'] return @redirect '/course/si' Session.set 'grade', course Session.set 'grade-filter-status', @params.query.status @render 'Grade' fastRender: true Router.route '/my/:course/:email', name: 'my' waitOn: -> return [ Meteor.subscribe 'Grade' Meteor.subscribe 'userGradeInfo' ] action: -> course = @params.course.toLowerCase() if course not in ['si', 'tsi'] return @redirect "/course/si/#{params.email}" Session.set 'grade', course Session.set 'grade-filter-status', @params.query.status @render 'Grade', data: email: @params.email fastRender: true ## Instruction: Fix bugs with shared url ## Code After: Router.configure layoutTemplate: 'Layout' Router.route '/', -> return @redirect '/course/si' Router.route '/si', -> return @redirect '/course/si' Router.route '/tsi', -> return @redirect '/course/tsi' Router.route '/course/:course', name: 'course' waitOn: -> return [ Meteor.subscribe 'Grade' Meteor.subscribe 'userGradeInfo' ] action: -> course = @params.course.toLowerCase() if course not in ['si', 'tsi'] return @redirect '/course/si' Session.set 'grade', course Session.set 'grade-filter-status', @params.query.status @render 'Grade' fastRender: true Router.route '/my/:course/:email', name: 'my' waitOn: -> return [ Meteor.subscribe 'Grade' Meteor.subscribe 'userGradeInfo', @params.email ] action: -> course = @params.course.toLowerCase() if course not in ['si', 'tsi'] return @redirect "/course/si/#{@params.email}" Session.set 'grade', course Session.set 'grade-filter-status', @params.query.status @render 'Grade', data: email: @params.email fastRender: true
Router.configure layoutTemplate: 'Layout' Router.route '/', -> return @redirect '/course/si' Router.route '/si', -> return @redirect '/course/si' Router.route '/tsi', -> return @redirect '/course/tsi' Router.route '/course/:course', name: 'course' waitOn: -> return [ Meteor.subscribe 'Grade' Meteor.subscribe 'userGradeInfo' ] action: -> course = @params.course.toLowerCase() if course not in ['si', 'tsi'] return @redirect '/course/si' Session.set 'grade', course Session.set 'grade-filter-status', @params.query.status @render 'Grade' fastRender: true Router.route '/my/:course/:email', name: 'my' waitOn: -> return [ Meteor.subscribe 'Grade' - Meteor.subscribe 'userGradeInfo' + Meteor.subscribe 'userGradeInfo', @params.email ? +++++++++++++++ ] action: -> course = @params.course.toLowerCase() if course not in ['si', 'tsi'] - return @redirect "/course/si/#{params.email}" + return @redirect "/course/si/#{@params.email}" ? + Session.set 'grade', course Session.set 'grade-filter-status', @params.query.status @render 'Grade', - data: + data: ? + - email: @params.email + email: @params.email ? + fastRender: true
8
0.129032
4
4
859f5456a125c7b705733fbfe5585d390650821b
lib/pact_broker/api/decorators/version_decorator.rb
lib/pact_broker/api/decorators/version_decorator.rb
require_relative 'base_decorator' require_relative 'embedded_tag_decorator' module PactBroker module Api module Decorators class VersionDecorator < BaseDecorator property :number collection :tags, embedded: true, :extend => PactBroker::Api::Decorators::EmbeddedTagDecorator link :self do | options | { title: 'Version', name: represented.number, href: version_url(options.fetch(:base_url), represented) } end link :self do | options | { title: 'Version', name: represented.number, href: version_url(options.fetch(:base_url), represented) } end link :pacticipant do | options | { title: 'Pacticipant', name: represented.pacticipant.name, href: pacticipant_url(options.fetch(:base_url), represented.pacticipant) } end end end end end
require_relative 'base_decorator' require_relative 'embedded_tag_decorator' module PactBroker module Api module Decorators class VersionDecorator < BaseDecorator property :number collection :tags, embedded: true, :extend => PactBroker::Api::Decorators::EmbeddedTagDecorator link :self do | options | { title: 'Version', name: represented.number, href: version_url(options.fetch(:base_url), represented) } end link :pacticipant do | options | { title: 'Pacticipant', name: represented.pacticipant.name, href: pacticipant_url(options.fetch(:base_url), represented.pacticipant) } end end end end end
Remove duplicate :self block in VersionDecorator.
Remove duplicate :self block in VersionDecorator.
Ruby
mit
bethesque/pact_broker,tancnle/pact_broker,pact-foundation/pact_broker,tancnle/pact_broker,bethesque/pact_broker,bethesque/pact_broker,tancnle/pact_broker,pact-foundation/pact_broker,pact-foundation/pact_broker,bethesque/pact_broker,tancnle/pact_broker,pact-foundation/pact_broker
ruby
## Code Before: require_relative 'base_decorator' require_relative 'embedded_tag_decorator' module PactBroker module Api module Decorators class VersionDecorator < BaseDecorator property :number collection :tags, embedded: true, :extend => PactBroker::Api::Decorators::EmbeddedTagDecorator link :self do | options | { title: 'Version', name: represented.number, href: version_url(options.fetch(:base_url), represented) } end link :self do | options | { title: 'Version', name: represented.number, href: version_url(options.fetch(:base_url), represented) } end link :pacticipant do | options | { title: 'Pacticipant', name: represented.pacticipant.name, href: pacticipant_url(options.fetch(:base_url), represented.pacticipant) } end end end end end ## Instruction: Remove duplicate :self block in VersionDecorator. ## Code After: require_relative 'base_decorator' require_relative 'embedded_tag_decorator' module PactBroker module Api module Decorators class VersionDecorator < BaseDecorator property :number collection :tags, embedded: true, :extend => PactBroker::Api::Decorators::EmbeddedTagDecorator link :self do | options | { title: 'Version', name: represented.number, href: version_url(options.fetch(:base_url), represented) } end link :pacticipant do | options | { title: 'Pacticipant', name: represented.pacticipant.name, href: pacticipant_url(options.fetch(:base_url), represented.pacticipant) } end end end end end
require_relative 'base_decorator' require_relative 'embedded_tag_decorator' module PactBroker module Api module Decorators class VersionDecorator < BaseDecorator property :number collection :tags, embedded: true, :extend => PactBroker::Api::Decorators::EmbeddedTagDecorator - - link :self do | options | - { - title: 'Version', - name: represented.number, - href: version_url(options.fetch(:base_url), represented) - } - end link :self do | options | { title: 'Version', name: represented.number, href: version_url(options.fetch(:base_url), represented) } end link :pacticipant do | options | { title: 'Pacticipant', name: represented.pacticipant.name, href: pacticipant_url(options.fetch(:base_url), represented.pacticipant) } end end end end end
8
0.2
0
8
3518e9088ecbbc273f922ba418d2962d6af2dda5
feature_extraction/measurements/texture_haralick.py
feature_extraction/measurements/texture_haralick.py
from . import Measurement import feature_extraction.util.cleanup as cleanup class HaralickTexture(Measurement): def compute(self, image): return []
from . import Measurement import feature_extraction.util.cleanup as cleanup from skimage.morphology import binary_erosion, disk class HaralickTexture(Measurement): default_options = { 'clip_cell_borders': True, 'erode_cell': False, 'erode_cell_amount': False, } def __init__(self, options=None): super(HaralickTexture, self).__init__(options) def compute(self, image): # -- preprocessing if self.options.clip_cell_borders: # get the cell boundary mask mask = cleanup.cell_boundary_mask(image) # if we're told to, erode the mask with a disk by some amount if self.options.erode_cell: mask = binary_erosion(cleanup.cell_boundary_mask(), disk(self.options.erode_cell_amount)) # mask the image image = image[mask] # -- haralick setup and run return []
Add cell-boundary preprocessing to HaralickTexture measurement
Add cell-boundary preprocessing to HaralickTexture measurement
Python
apache-2.0
widoptimization-willett/feature-extraction
python
## Code Before: from . import Measurement import feature_extraction.util.cleanup as cleanup class HaralickTexture(Measurement): def compute(self, image): return [] ## Instruction: Add cell-boundary preprocessing to HaralickTexture measurement ## Code After: from . import Measurement import feature_extraction.util.cleanup as cleanup from skimage.morphology import binary_erosion, disk class HaralickTexture(Measurement): default_options = { 'clip_cell_borders': True, 'erode_cell': False, 'erode_cell_amount': False, } def __init__(self, options=None): super(HaralickTexture, self).__init__(options) def compute(self, image): # -- preprocessing if self.options.clip_cell_borders: # get the cell boundary mask mask = cleanup.cell_boundary_mask(image) # if we're told to, erode the mask with a disk by some amount if self.options.erode_cell: mask = binary_erosion(cleanup.cell_boundary_mask(), disk(self.options.erode_cell_amount)) # mask the image image = image[mask] # -- haralick setup and run return []
from . import Measurement import feature_extraction.util.cleanup as cleanup + from skimage.morphology import binary_erosion, disk class HaralickTexture(Measurement): + default_options = { + 'clip_cell_borders': True, + 'erode_cell': False, + 'erode_cell_amount': False, + } + def __init__(self, options=None): + super(HaralickTexture, self).__init__(options) + def compute(self, image): + # -- preprocessing + if self.options.clip_cell_borders: + # get the cell boundary mask + mask = cleanup.cell_boundary_mask(image) + + # if we're told to, erode the mask with a disk by some amount + if self.options.erode_cell: + mask = binary_erosion(cleanup.cell_boundary_mask(), disk(self.options.erode_cell_amount)) + + # mask the image + image = image[mask] + + # -- haralick setup and run + return []
23
3.833333
23
0
e94902f7fad7abf68ba84e58bb0028242ea2f827
spec/models/user_spec.rb
spec/models/user_spec.rb
require 'rails_helper' describe User do context "validations" do it { is_expected.to validate_presence_of :name } end context "associations" do it { is_expected.to have_many :timeslots} it { is_expected.to have_many :bookings} end end
require 'rails_helper' describe User do context "validations" do it { is_expected.to validate_presence_of :name } it { is_expected.to validate_presence_of :email_notify } it { is_expected.to validate_presence_of :text_notify } end context "when not requesting text notifications without a cellphone" do subject { User.new(text_notify: false) } it { is_expected.not_to validate_presence_of :cellphone } end context "when requesting text notifications without a cellphone" do subject { User.new(text_notify: true) } it { is_expected.to validate_presence_of(:cellphone) .with_message 'must be present for text notifications' } end context "associations" do it { is_expected.to have_many :timeslots} it { is_expected.to have_many :bookings} end end
Add specs for new User model validations
Add specs for new User model validations
Ruby
mit
theresaboard/theres-a-board,theresaboard/theres-a-board,theresaboard/theres-a-board
ruby
## Code Before: require 'rails_helper' describe User do context "validations" do it { is_expected.to validate_presence_of :name } end context "associations" do it { is_expected.to have_many :timeslots} it { is_expected.to have_many :bookings} end end ## Instruction: Add specs for new User model validations ## Code After: require 'rails_helper' describe User do context "validations" do it { is_expected.to validate_presence_of :name } it { is_expected.to validate_presence_of :email_notify } it { is_expected.to validate_presence_of :text_notify } end context "when not requesting text notifications without a cellphone" do subject { User.new(text_notify: false) } it { is_expected.not_to validate_presence_of :cellphone } end context "when requesting text notifications without a cellphone" do subject { User.new(text_notify: true) } it { is_expected.to validate_presence_of(:cellphone) .with_message 'must be present for text notifications' } end context "associations" do it { is_expected.to have_many :timeslots} it { is_expected.to have_many :bookings} end end
require 'rails_helper' describe User do context "validations" do it { is_expected.to validate_presence_of :name } + it { is_expected.to validate_presence_of :email_notify } + it { is_expected.to validate_presence_of :text_notify } + end + + context "when not requesting text notifications without a cellphone" do + subject { User.new(text_notify: false) } + it { is_expected.not_to validate_presence_of :cellphone } + end + + context "when requesting text notifications without a cellphone" do + subject { User.new(text_notify: true) } + it { + is_expected.to validate_presence_of(:cellphone) + .with_message 'must be present for text notifications' + } end context "associations" do it { is_expected.to have_many :timeslots} it { is_expected.to have_many :bookings} end end
15
1.153846
15
0
276d7e38954e9850701cd457b9b4dc52e8df3f6b
lib/handle_invalid_percent_encoding_requests/middleware.rb
lib/handle_invalid_percent_encoding_requests/middleware.rb
module HandleInvalidPercentEncodingRequests class Middleware def initialize(app, stdout=STDOUT) @app = app @logger = defined?(Rails.logger) ? Rails.logger : Logger.new(stdout) end def call(env) # calling env.dup here prevents bad things from happening request = Rack::Request.new(env.dup) # calling request.params is sufficient to trigger the error see # https://github.com/rack/rack/issues/337#issuecomment-46453404 request.params @app.call(env) # Rescue from that specific ArgumentError rescue ArgumentError => e raise unless e.message =~ /invalid %-encoding/ error_response end private def error_response @logger.info "Bad request. Returning 400 due to #{e.message}" + \ " from request with env #{request.inspect}" headers = { 'Content-Type' => "text/plain; charset=utf-8" } text = "Bad Request" [400, headers, [text]] end end end
module HandleInvalidPercentEncodingRequests class Middleware def initialize(app, stdout=STDOUT) @app = app @logger = defined?(Rails.logger) ? Rails.logger : Logger.new(stdout) end def call(env) # calling env.dup here prevents bad things from happening request = Rack::Request.new(env.dup) # calling request.params is sufficient to trigger the error see # https://github.com/rack/rack/issues/337#issuecomment-46453404 request.params @app.call(env) # Rescue from that specific ArgumentError rescue ArgumentError => e raise unless e.message =~ /invalid %-encoding/ @logger.info "Bad request. Returning 400 due to #{e.message} from request with env #{request.inspect}" error_response end private def error_response headers = { 'Content-Type' => "text/plain; charset=utf-8" } text = "Bad Request" [400, headers, [text]] end end end
Fix typo: error_message did not have access to variables request or e
Fix typo: error_message did not have access to variables request or e
Ruby
mit
sunny/handle_invalid_percent_encoding_requests
ruby
## Code Before: module HandleInvalidPercentEncodingRequests class Middleware def initialize(app, stdout=STDOUT) @app = app @logger = defined?(Rails.logger) ? Rails.logger : Logger.new(stdout) end def call(env) # calling env.dup here prevents bad things from happening request = Rack::Request.new(env.dup) # calling request.params is sufficient to trigger the error see # https://github.com/rack/rack/issues/337#issuecomment-46453404 request.params @app.call(env) # Rescue from that specific ArgumentError rescue ArgumentError => e raise unless e.message =~ /invalid %-encoding/ error_response end private def error_response @logger.info "Bad request. Returning 400 due to #{e.message}" + \ " from request with env #{request.inspect}" headers = { 'Content-Type' => "text/plain; charset=utf-8" } text = "Bad Request" [400, headers, [text]] end end end ## Instruction: Fix typo: error_message did not have access to variables request or e ## Code After: module HandleInvalidPercentEncodingRequests class Middleware def initialize(app, stdout=STDOUT) @app = app @logger = defined?(Rails.logger) ? Rails.logger : Logger.new(stdout) end def call(env) # calling env.dup here prevents bad things from happening request = Rack::Request.new(env.dup) # calling request.params is sufficient to trigger the error see # https://github.com/rack/rack/issues/337#issuecomment-46453404 request.params @app.call(env) # Rescue from that specific ArgumentError rescue ArgumentError => e raise unless e.message =~ /invalid %-encoding/ @logger.info "Bad request. Returning 400 due to #{e.message} from request with env #{request.inspect}" error_response end private def error_response headers = { 'Content-Type' => "text/plain; charset=utf-8" } text = "Bad Request" [400, headers, [text]] end end end
module HandleInvalidPercentEncodingRequests class Middleware def initialize(app, stdout=STDOUT) @app = app @logger = defined?(Rails.logger) ? Rails.logger : Logger.new(stdout) end def call(env) # calling env.dup here prevents bad things from happening request = Rack::Request.new(env.dup) # calling request.params is sufficient to trigger the error see # https://github.com/rack/rack/issues/337#issuecomment-46453404 request.params @app.call(env) # Rescue from that specific ArgumentError rescue ArgumentError => e raise unless e.message =~ /invalid %-encoding/ + + @logger.info "Bad request. Returning 400 due to #{e.message} from request with env #{request.inspect}" error_response end - private def error_response - @logger.info "Bad request. Returning 400 due to #{e.message}" + \ - " from request with env #{request.inspect}" - headers = { 'Content-Type' => "text/plain; charset=utf-8" } text = "Bad Request" [400, headers, [text]] end end end
6
0.157895
2
4
ac0e54801b8fc1389c1810f0d4ac6670ff8a5602
src/linker.coffee
src/linker.coffee
path = require 'path' fs = require './fs' CSON = require 'season' config = require './config' module.exports = class Linker run: (options) -> linkPath = path.resolve(process.cwd(), options.commandArgs.shift() ? '.') try packageName = CSON.readFileSync(CSON.resolve(path.join(linkPath, 'package'))).name packageName = path.basename(linkPath) unless packageName targetPath = path.join(config.getAtomDirectory(), 'packages', packageName) try fs.unlinkSync(targetPath) if fs.isLink(targetPath) fs.symlinkSync(linkPath, targetPath) console.log "#{targetPath} -> #{linkPath}" catch error console.error("Linking #{targetPath} to #{linkPath} failed") options.callback(error)
path = require 'path' fs = require './fs' CSON = require 'season' config = require './config' mkdir = require('mkdirp').sync module.exports = class Linker run: (options) -> linkPath = path.resolve(process.cwd(), options.commandArgs.shift() ? '.') try packageName = CSON.readFileSync(CSON.resolve(path.join(linkPath, 'package'))).name packageName = path.basename(linkPath) unless packageName targetPath = path.join(config.getAtomDirectory(), 'packages', packageName) try fs.unlinkSync(targetPath) if fs.isLink(targetPath) mkdir path.dirname(targetPath) fs.symlinkSync(linkPath, targetPath) console.log "#{targetPath} -> #{linkPath}" catch error console.error("Linking #{targetPath} to #{linkPath} failed") options.callback(error)
Create parent directories to symlink
Create parent directories to symlink
CoffeeScript
mit
atom/apm,pusateri/apm,pusateri/apm,AtaraxiaEta/apm,atom/apm,ethanp/apm,Nikpolik/apm,bronson/apm,bcoe/apm,jlord/apm,VandeurenGlenn/apm,fscherwi/apm,pusateri/apm,AtaraxiaEta/apm,bronson/apm,jlord/apm,VandeurenGlenn/apm,VandeurenGlenn/apm,AtaraxiaEta/apm,Nikpolik/apm,fscherwi/apm,ethanp/apm,ethanp/apm,jlord/apm,pusateri/apm,pusateri/apm,fscherwi/apm,jlord/apm,bcoe/apm,bronson/apm,VandeurenGlenn/apm,jlord/apm,bcoe/apm,ethanp/apm,gutsy/apm,fscherwi/apm,ethanp/apm,bcoe/apm,pusateri/apm,bcoe/apm,AtaraxiaEta/apm,AtaraxiaEta/apm,gutsy/apm,jlord/apm,bronson/apm,Nikpolik/apm,fscherwi/apm,VandeurenGlenn/apm,VandeurenGlenn/apm,AtaraxiaEta/apm,atom/apm,ethanp/apm,atom/apm,gutsy/apm,bcoe/apm,gutsy/apm,fscherwi/apm,Nikpolik/apm
coffeescript
## Code Before: path = require 'path' fs = require './fs' CSON = require 'season' config = require './config' module.exports = class Linker run: (options) -> linkPath = path.resolve(process.cwd(), options.commandArgs.shift() ? '.') try packageName = CSON.readFileSync(CSON.resolve(path.join(linkPath, 'package'))).name packageName = path.basename(linkPath) unless packageName targetPath = path.join(config.getAtomDirectory(), 'packages', packageName) try fs.unlinkSync(targetPath) if fs.isLink(targetPath) fs.symlinkSync(linkPath, targetPath) console.log "#{targetPath} -> #{linkPath}" catch error console.error("Linking #{targetPath} to #{linkPath} failed") options.callback(error) ## Instruction: Create parent directories to symlink ## Code After: path = require 'path' fs = require './fs' CSON = require 'season' config = require './config' mkdir = require('mkdirp').sync module.exports = class Linker run: (options) -> linkPath = path.resolve(process.cwd(), options.commandArgs.shift() ? '.') try packageName = CSON.readFileSync(CSON.resolve(path.join(linkPath, 'package'))).name packageName = path.basename(linkPath) unless packageName targetPath = path.join(config.getAtomDirectory(), 'packages', packageName) try fs.unlinkSync(targetPath) if fs.isLink(targetPath) mkdir path.dirname(targetPath) fs.symlinkSync(linkPath, targetPath) console.log "#{targetPath} -> #{linkPath}" catch error console.error("Linking #{targetPath} to #{linkPath} failed") options.callback(error)
path = require 'path' fs = require './fs' CSON = require 'season' config = require './config' + mkdir = require('mkdirp').sync module.exports = class Linker run: (options) -> linkPath = path.resolve(process.cwd(), options.commandArgs.shift() ? '.') try packageName = CSON.readFileSync(CSON.resolve(path.join(linkPath, 'package'))).name packageName = path.basename(linkPath) unless packageName targetPath = path.join(config.getAtomDirectory(), 'packages', packageName) try fs.unlinkSync(targetPath) if fs.isLink(targetPath) + mkdir path.dirname(targetPath) fs.symlinkSync(linkPath, targetPath) console.log "#{targetPath} -> #{linkPath}" catch error console.error("Linking #{targetPath} to #{linkPath} failed") options.callback(error)
2
0.095238
2
0
60b8c7a448cdf17677ae9383e4c0dcc7fb6fcbe1
app/scripts/components/Root/index.jsx
app/scripts/components/Root/index.jsx
import React from 'react'; import WelcomeModal from '../Modal/WelcomeModal'; class Root extends React.Component { constructor() { super(); this.state = { modalWelcomeOpen: false }; } componentDidMount() { if (sessionStorage.getItem('modalWelcomeOpened') === false || sessionStorage.getItem('modalWelcomeOpened') === null) { this.setState({ modalWelcomeOpen: true }); } } render() { return ( <div style={{height: '100%'}}> {this.props.children} {this.state.modalWelcomeOpen && <WelcomeModal title={"Welcome to Partnership for Resilience & Preparedness Beta Platform"} opened={this.state.modalWelcomeOpen} close={() => { this.setState({modalWelcomeOpen: false}); localStorage.setItem('modalWelcomeOpened', JSON.stringify(true)); } } hideCloseButton /> } </div> ); } } export default Root;
import React from 'react'; import WelcomeModal from '../Modal/WelcomeModal'; class Root extends React.Component { constructor() { super(); this.state = { modalWelcomeOpen: false }; } componentDidMount() { if (sessionStorage.getItem('modalWelcomeOpened') === false || sessionStorage.getItem('modalWelcomeOpened') === null) { this.setModalWelcome(); } } setModalWelcome() { if (this.props.location.pathname.indexOf('embed') === -1) { this.setState({ modalWelcomeOpen: true }); } } render() { return ( <div style={{ height: '100%' }}> {this.props.children} {this.state.modalWelcomeOpen && <WelcomeModal title={"Welcome to Partnership for Resilience & Preparedness Beta Platform"} opened={this.state.modalWelcomeOpen} close={() => { this.setState({ modalWelcomeOpen: false }); localStorage.setItem('modalWelcomeOpened', JSON.stringify(true)); } } hideCloseButton /> } </div> ); } } export default Root;
Hide beta modal in embed page
Hide beta modal in embed page
JSX
mit
resource-watch/prep-app,resource-watch/prep-app
jsx
## Code Before: import React from 'react'; import WelcomeModal from '../Modal/WelcomeModal'; class Root extends React.Component { constructor() { super(); this.state = { modalWelcomeOpen: false }; } componentDidMount() { if (sessionStorage.getItem('modalWelcomeOpened') === false || sessionStorage.getItem('modalWelcomeOpened') === null) { this.setState({ modalWelcomeOpen: true }); } } render() { return ( <div style={{height: '100%'}}> {this.props.children} {this.state.modalWelcomeOpen && <WelcomeModal title={"Welcome to Partnership for Resilience & Preparedness Beta Platform"} opened={this.state.modalWelcomeOpen} close={() => { this.setState({modalWelcomeOpen: false}); localStorage.setItem('modalWelcomeOpened', JSON.stringify(true)); } } hideCloseButton /> } </div> ); } } export default Root; ## Instruction: Hide beta modal in embed page ## Code After: import React from 'react'; import WelcomeModal from '../Modal/WelcomeModal'; class Root extends React.Component { constructor() { super(); this.state = { modalWelcomeOpen: false }; } componentDidMount() { if (sessionStorage.getItem('modalWelcomeOpened') === false || sessionStorage.getItem('modalWelcomeOpened') === null) { this.setModalWelcome(); } } setModalWelcome() { if (this.props.location.pathname.indexOf('embed') === -1) { this.setState({ modalWelcomeOpen: true }); } } render() { return ( <div style={{ height: '100%' }}> {this.props.children} {this.state.modalWelcomeOpen && <WelcomeModal title={"Welcome to Partnership for Resilience & Preparedness Beta Platform"} opened={this.state.modalWelcomeOpen} close={() => { this.setState({ modalWelcomeOpen: false }); localStorage.setItem('modalWelcomeOpened', JSON.stringify(true)); } } hideCloseButton /> } </div> ); } } export default Root;
import React from 'react'; import WelcomeModal from '../Modal/WelcomeModal'; class Root extends React.Component { constructor() { super(); this.state = { modalWelcomeOpen: false }; } componentDidMount() { if (sessionStorage.getItem('modalWelcomeOpened') === false || sessionStorage.getItem('modalWelcomeOpened') === null) { + this.setModalWelcome(); + } + } + + setModalWelcome() { + if (this.props.location.pathname.indexOf('embed') === -1) { this.setState({ modalWelcomeOpen: true }); } } render() { return ( - <div style={{height: '100%'}}> + <div style={{ height: '100%' }}> ? + + {this.props.children} {this.state.modalWelcomeOpen && - <WelcomeModal + <WelcomeModal ? ++ - title={"Welcome to Partnership for Resilience & Preparedness Beta Platform"} + title={"Welcome to Partnership for Resilience & Preparedness Beta Platform"} ? ++ - opened={this.state.modalWelcomeOpen} + opened={this.state.modalWelcomeOpen} ? ++ - close={() => { + close={() => { ? ++ - this.setState({modalWelcomeOpen: false}); + this.setState({ modalWelcomeOpen: false }); ? ++ + + - localStorage.setItem('modalWelcomeOpened', JSON.stringify(true)); + localStorage.setItem('modalWelcomeOpened', JSON.stringify(true)); ? ++ - } + } ? ++ - } + } ? ++ - hideCloseButton + hideCloseButton ? ++ - /> + /> ? ++ } </div> ); } } export default Root;
28
0.666667
17
11
3022ace387585aca7b2e58404ff54c34bb84f15c
circle.yml
circle.yml
machine: node: version: 6.1.0 test: override: - npm run ci - if [[ -e junitresults.xml ]]; then cp junitresults.xml $CIRCLE_TEST_REPORTS/test-results.xml; fi post: - npm run semantic-release || true
machine: node: version: 6.1.0 environment: YARN_VERSION: 0.18.1 PATH: "${PATH}:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin" dependencies: pre: - | if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then echo "Download and install Yarn." curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION else echo "The correct version of Yarn is already installed." fi override: - yarn install cache_directories: - ~/.yarn - ~/.cache/yarn test: override: - yarn run ci - if [[ -e junitresults.xml ]]; then cp junitresults.xml $CIRCLE_TEST_REPORTS/test-results.xml; fi post: - yarn run semantic-release || true
Replace npm with yarn at CircleCI
chore: Replace npm with yarn at CircleCI
YAML
mit
lingui/js-lingui,lingui/js-lingui
yaml
## Code Before: machine: node: version: 6.1.0 test: override: - npm run ci - if [[ -e junitresults.xml ]]; then cp junitresults.xml $CIRCLE_TEST_REPORTS/test-results.xml; fi post: - npm run semantic-release || true ## Instruction: chore: Replace npm with yarn at CircleCI ## Code After: machine: node: version: 6.1.0 environment: YARN_VERSION: 0.18.1 PATH: "${PATH}:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin" dependencies: pre: - | if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then echo "Download and install Yarn." curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION else echo "The correct version of Yarn is already installed." fi override: - yarn install cache_directories: - ~/.yarn - ~/.cache/yarn test: override: - yarn run ci - if [[ -e junitresults.xml ]]; then cp junitresults.xml $CIRCLE_TEST_REPORTS/test-results.xml; fi post: - yarn run semantic-release || true
machine: node: version: 6.1.0 + environment: + YARN_VERSION: 0.18.1 + PATH: "${PATH}:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin" + + dependencies: + pre: + - | + if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then + echo "Download and install Yarn." + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION + else + echo "The correct version of Yarn is already installed." + fi + override: + - yarn install + cache_directories: + - ~/.yarn + - ~/.cache/yarn test: override: - - npm run ci ? -- + - yarn run ci ? +++ - if [[ -e junitresults.xml ]]; then cp junitresults.xml $CIRCLE_TEST_REPORTS/test-results.xml; fi post: - - npm run semantic-release || true ? -- + - yarn run semantic-release || true ? +++
22
2
20
2
009f5f716a7414e5c0cc17aa5549a6d002560704
lib/ansible/modules/extras/.travis.yml
lib/ansible/modules/extras/.travis.yml
sudo: false language: python python: - "2.7" addons: apt: sources: - deadsnakes packages: - python2.4 - python2.6 - python3.5 before_install: - git config user.name "ansible" - git config user.email "ansible@ansible.com" - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then git rebase $TRAVIS_BRANCH; fi; install: - pip install git+https://github.com/ansible/ansible.git@devel#egg=ansible - pip install git+https://github.com/sivel/ansible-testing.git#egg=ansible_testing script: - python2.4 -m compileall -fq -x 'cloud/|monitoring/zabbix.*\.py|/dnf\.py|/layman\.py|/maven_artifact\.py|clustering/(consul.*|znode)\.py|notification/pushbullet\.py|database/influxdb/influxdb.*\.py' . - python2.6 -m compileall -fq . - python2.7 -m compileall -fq . - python3.4 -m compileall -fq system/at.py - python3.5 -m compileall -fq system/at.py - ansible-validate-modules . #- ./test-docs.sh extras
sudo: false language: python python: - "2.7" addons: apt: sources: - deadsnakes packages: - python2.4 - python2.6 - python3.5 before_install: - git config user.name "ansible" - git config user.email "ansible@ansible.com" - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then git rebase $TRAVIS_BRANCH; fi; install: - pip install git+https://github.com/ansible/ansible.git@devel#egg=ansible - pip install git+https://github.com/sivel/ansible-testing.git#egg=ansible_testing script: - python2.4 -m compileall -fq -x 'cloud/|monitoring/zabbix.*\.py|/dnf\.py|/layman\.py|/maven_artifact\.py|clustering/(consul.*|znode)\.py|notification/pushbullet\.py|database/influxdb/influxdb.*\.py' . - python2.6 -m compileall -fq . - python2.7 -m compileall -fq . - python3.4 -m compileall -fq system/at.py cloud/vmware cloud/lxc - python3.5 -m compileall -fq system/at.py cloud/vmware cloud/lxc - ansible-validate-modules . #- ./test-docs.sh extras
Add vmware and lxc to python3 checks
Add vmware and lxc to python3 checks
YAML
mit
thaim/ansible,thaim/ansible
yaml
## Code Before: sudo: false language: python python: - "2.7" addons: apt: sources: - deadsnakes packages: - python2.4 - python2.6 - python3.5 before_install: - git config user.name "ansible" - git config user.email "ansible@ansible.com" - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then git rebase $TRAVIS_BRANCH; fi; install: - pip install git+https://github.com/ansible/ansible.git@devel#egg=ansible - pip install git+https://github.com/sivel/ansible-testing.git#egg=ansible_testing script: - python2.4 -m compileall -fq -x 'cloud/|monitoring/zabbix.*\.py|/dnf\.py|/layman\.py|/maven_artifact\.py|clustering/(consul.*|znode)\.py|notification/pushbullet\.py|database/influxdb/influxdb.*\.py' . - python2.6 -m compileall -fq . - python2.7 -m compileall -fq . - python3.4 -m compileall -fq system/at.py - python3.5 -m compileall -fq system/at.py - ansible-validate-modules . #- ./test-docs.sh extras ## Instruction: Add vmware and lxc to python3 checks ## Code After: sudo: false language: python python: - "2.7" addons: apt: sources: - deadsnakes packages: - python2.4 - python2.6 - python3.5 before_install: - git config user.name "ansible" - git config user.email "ansible@ansible.com" - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then git rebase $TRAVIS_BRANCH; fi; install: - pip install git+https://github.com/ansible/ansible.git@devel#egg=ansible - pip install git+https://github.com/sivel/ansible-testing.git#egg=ansible_testing script: - python2.4 -m compileall -fq -x 'cloud/|monitoring/zabbix.*\.py|/dnf\.py|/layman\.py|/maven_artifact\.py|clustering/(consul.*|znode)\.py|notification/pushbullet\.py|database/influxdb/influxdb.*\.py' . - python2.6 -m compileall -fq . - python2.7 -m compileall -fq . - python3.4 -m compileall -fq system/at.py cloud/vmware cloud/lxc - python3.5 -m compileall -fq system/at.py cloud/vmware cloud/lxc - ansible-validate-modules . #- ./test-docs.sh extras
sudo: false language: python python: - "2.7" addons: apt: sources: - deadsnakes packages: - python2.4 - python2.6 - python3.5 before_install: - git config user.name "ansible" - git config user.email "ansible@ansible.com" - if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then git rebase $TRAVIS_BRANCH; fi; install: - pip install git+https://github.com/ansible/ansible.git@devel#egg=ansible - pip install git+https://github.com/sivel/ansible-testing.git#egg=ansible_testing script: - python2.4 -m compileall -fq -x 'cloud/|monitoring/zabbix.*\.py|/dnf\.py|/layman\.py|/maven_artifact\.py|clustering/(consul.*|znode)\.py|notification/pushbullet\.py|database/influxdb/influxdb.*\.py' . - python2.6 -m compileall -fq . - python2.7 -m compileall -fq . - - python3.4 -m compileall -fq system/at.py + - python3.4 -m compileall -fq system/at.py cloud/vmware cloud/lxc ? +++++++++++++++++++++++ - - python3.5 -m compileall -fq system/at.py + - python3.5 -m compileall -fq system/at.py cloud/vmware cloud/lxc ? +++++++++++++++++++++++ - ansible-validate-modules . #- ./test-docs.sh extras
4
0.148148
2
2
1a06cc550c26c046592fbea50f153818e471fc08
.travis.yml
.travis.yml
language: ruby rvm: - 2.0.0 services: - elasticsearch script: rspec
language: ruby rvm: - 2.0.0 services: - elasticsearch script: bundle exec rspec spec
Update RSpec call in the Travis CI configuration
Update RSpec call in the Travis CI configuration The last build failed because the command rspec could not be found. Maybe it has something to do that I call rspec directly. I changed the invocation to run it over bundle exec. Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com>
YAML
mit
platzhirsch/metadata-census
yaml
## Code Before: language: ruby rvm: - 2.0.0 services: - elasticsearch script: rspec ## Instruction: Update RSpec call in the Travis CI configuration The last build failed because the command rspec could not be found. Maybe it has something to do that I call rspec directly. I changed the invocation to run it over bundle exec. Signed-off-by: Konrad Reiche <4ff0213f56e2082fcd8c882d04c546881c579ce4@gmail.com> ## Code After: language: ruby rvm: - 2.0.0 services: - elasticsearch script: bundle exec rspec spec
language: ruby rvm: - 2.0.0 + services: - elasticsearch - script: rspec + + script: bundle exec rspec spec
4
0.666667
3
1
74acbae89969329dbfc046139b49f2a44dcf3e69
spec/mach/semaphore_spec.rb
spec/mach/semaphore_spec.rb
require 'spec_helper' require 'mach/error' require 'mach/functions' require 'mach/semaphore' module Mach describe 'low level semaphore functions' do include Functions it 'raises exception with invalid args' do p = proc { semaphore_create(mach_task_self, nil, 1234, 1) } p.must_raise Error::INVALID_ARGUMENT end end describe Semaphore do it 'creates a semaphore' do sem = Semaphore.new sem.destroy end it 'raises exception with invalid args' do p = proc { Semaphore.new(:sync_policy => :no_such) } p.must_raise ArgumentError # Error::INVALID_ARGUMENT end it 'signals/waits in same task' do sem = Semaphore.new(:value => 0) sem.signal sem.wait sem.destroy end end end
require 'spec_helper' require 'mach' module Mach describe 'low level semaphore functions' do include Functions it 'raises exception with invalid args' do p = proc { semaphore_create(mach_task_self, nil, 1234, 1) } p.must_raise Error::INVALID_ARGUMENT end end describe Semaphore do it 'creates a semaphore' do sem = Semaphore.new sem.destroy end it 'raises exception with invalid args' do p = proc { Semaphore.new(:sync_policy => :no_such) } p.must_raise ArgumentError # Error::INVALID_ARGUMENT end it 'signals/waits in same task' do sem = Semaphore.new(:value => 0) sem.signal sem.wait sem.destroy end it 'coordinates access to shared resource between two tasks' do sem = Semaphore.new(:value => 0) port = Port.new port.insert_right(:make_send) Task.self.set_bootstrap_port(port) child = fork do parent_port = Task.self.get_bootstrap_port Task.self.copy_send(parent_port) # parent will copy send rights to sem into child task sleep 0.5 sem.signal Kernel.exit! end child_task_port = port.receive_right start = Time.now.to_f sem.insert_right(:copy_send, :ipc_space => child_task_port) sem.wait elapsed = Time.now.to_f - start Process.wait child elapsed.must be_gt(0.4) end end end
Add test demonstrating copying semaphore from parent to child.
Add test demonstrating copying semaphore from parent to child.
Ruby
mit
pmahoney/process_shared,pmahoney/process_shared
ruby
## Code Before: require 'spec_helper' require 'mach/error' require 'mach/functions' require 'mach/semaphore' module Mach describe 'low level semaphore functions' do include Functions it 'raises exception with invalid args' do p = proc { semaphore_create(mach_task_self, nil, 1234, 1) } p.must_raise Error::INVALID_ARGUMENT end end describe Semaphore do it 'creates a semaphore' do sem = Semaphore.new sem.destroy end it 'raises exception with invalid args' do p = proc { Semaphore.new(:sync_policy => :no_such) } p.must_raise ArgumentError # Error::INVALID_ARGUMENT end it 'signals/waits in same task' do sem = Semaphore.new(:value => 0) sem.signal sem.wait sem.destroy end end end ## Instruction: Add test demonstrating copying semaphore from parent to child. ## Code After: require 'spec_helper' require 'mach' module Mach describe 'low level semaphore functions' do include Functions it 'raises exception with invalid args' do p = proc { semaphore_create(mach_task_self, nil, 1234, 1) } p.must_raise Error::INVALID_ARGUMENT end end describe Semaphore do it 'creates a semaphore' do sem = Semaphore.new sem.destroy end it 'raises exception with invalid args' do p = proc { Semaphore.new(:sync_policy => :no_such) } p.must_raise ArgumentError # Error::INVALID_ARGUMENT end it 'signals/waits in same task' do sem = Semaphore.new(:value => 0) sem.signal sem.wait sem.destroy end it 'coordinates access to shared resource between two tasks' do sem = Semaphore.new(:value => 0) port = Port.new port.insert_right(:make_send) Task.self.set_bootstrap_port(port) child = fork do parent_port = Task.self.get_bootstrap_port Task.self.copy_send(parent_port) # parent will copy send rights to sem into child task sleep 0.5 sem.signal Kernel.exit! end child_task_port = port.receive_right start = Time.now.to_f sem.insert_right(:copy_send, :ipc_space => child_task_port) sem.wait elapsed = Time.now.to_f - start Process.wait child elapsed.must be_gt(0.4) end end end
require 'spec_helper' - require 'mach/error' ? ------ + require 'mach' - require 'mach/functions' - require 'mach/semaphore' module Mach describe 'low level semaphore functions' do include Functions it 'raises exception with invalid args' do p = proc { semaphore_create(mach_task_self, nil, 1234, 1) } p.must_raise Error::INVALID_ARGUMENT end end describe Semaphore do it 'creates a semaphore' do sem = Semaphore.new sem.destroy end it 'raises exception with invalid args' do p = proc { Semaphore.new(:sync_policy => :no_such) } p.must_raise ArgumentError # Error::INVALID_ARGUMENT end it 'signals/waits in same task' do sem = Semaphore.new(:value => 0) sem.signal sem.wait sem.destroy end + + it 'coordinates access to shared resource between two tasks' do + sem = Semaphore.new(:value => 0) + + port = Port.new + port.insert_right(:make_send) + Task.self.set_bootstrap_port(port) + + child = fork do + parent_port = Task.self.get_bootstrap_port + Task.self.copy_send(parent_port) + # parent will copy send rights to sem into child task + sleep 0.5 + sem.signal + Kernel.exit! + end + + child_task_port = port.receive_right + + start = Time.now.to_f + sem.insert_right(:copy_send, :ipc_space => child_task_port) + sem.wait + elapsed = Time.now.to_f - start + + Process.wait child + + elapsed.must be_gt(0.4) + end end end
32
0.941176
29
3
acaf91c585e0b97d2b3dc93ec26f327d0abd9319
core/src/main/resources/hudson/model/View/sidepanel_sl.properties
core/src/main/resources/hudson/model/View/sidepanel_sl.properties
Build\ History=Zgodovina prevajanja Check\ File\ Fingerprint=Otisci guza Delete\ View=Izbri\u0161i pogled Edit\ View=Uredi pogled NewJob=Nov People=Uporabniki Project\ Relationship=With my ass
Build\ History=Zgodovina prevajanja Delete\ View=Izbri\u0161i pogled Edit\ View=Uredi pogled NewJob=Nov People=Uporabniki
Fix JENKINS-41756 - Indecently translated items
Fix JENKINS-41756 - Indecently translated items Removed false and indecently to slovene translated main menu items.
INI
mit
fbelzunc/jenkins,fbelzunc/jenkins,tfennelly/jenkins,amuniz/jenkins,aldaris/jenkins,hplatou/jenkins,MarkEWaite/jenkins,stephenc/jenkins,Ykus/jenkins,oleg-nenashev/jenkins,lilyJi/jenkins,daniel-beck/jenkins,DanielWeber/jenkins,ndeloof/jenkins,recena/jenkins,escoem/jenkins,azweb76/jenkins,ajshastri/jenkins,batmat/jenkins,jenkinsci/jenkins,kohsuke/hudson,tfennelly/jenkins,Jochen-A-Fuerbacher/jenkins,andresrc/jenkins,azweb76/jenkins,pjanouse/jenkins,godfath3r/jenkins,ajshastri/jenkins,tangkun75/jenkins,Jimilian/jenkins,godfath3r/jenkins,hplatou/jenkins,DanielWeber/jenkins,DanielWeber/jenkins,bpzhang/jenkins,kohsuke/hudson,Vlatombe/jenkins,Jimilian/jenkins,aldaris/jenkins,godfath3r/jenkins,DanielWeber/jenkins,escoem/jenkins,batmat/jenkins,ndeloof/jenkins,damianszczepanik/jenkins,Jimilian/jenkins,wuwen5/jenkins,Jimilian/jenkins,damianszczepanik/jenkins,tfennelly/jenkins,ajshastri/jenkins,jenkinsci/jenkins,batmat/jenkins,viqueen/jenkins,ikedam/jenkins,fbelzunc/jenkins,sathiya-mit/jenkins,ErikVerheul/jenkins,stephenc/jenkins,Ykus/jenkins,aldaris/jenkins,sathiya-mit/jenkins,lilyJi/jenkins,bkmeneguello/jenkins,ErikVerheul/jenkins,fbelzunc/jenkins,andresrc/jenkins,ndeloof/jenkins,viqueen/jenkins,Jochen-A-Fuerbacher/jenkins,Vlatombe/jenkins,azweb76/jenkins,damianszczepanik/jenkins,ikedam/jenkins,jenkinsci/jenkins,patbos/jenkins,ajshastri/jenkins,ErikVerheul/jenkins,patbos/jenkins,amuniz/jenkins,recena/jenkins,rsandell/jenkins,bpzhang/jenkins,viqueen/jenkins,MarkEWaite/jenkins,Jochen-A-Fuerbacher/jenkins,viqueen/jenkins,sathiya-mit/jenkins,ajshastri/jenkins,ErikVerheul/jenkins,stephenc/jenkins,damianszczepanik/jenkins,fbelzunc/jenkins,sathiya-mit/jenkins,dariver/jenkins,DanielWeber/jenkins,pjanouse/jenkins,MarkEWaite/jenkins,sathiya-mit/jenkins,viqueen/jenkins,amuniz/jenkins,amuniz/jenkins,escoem/jenkins,damianszczepanik/jenkins,jenkinsci/jenkins,amuniz/jenkins,hplatou/jenkins,stephenc/jenkins,bpzhang/jenkins,kohsuke/hudson,batmat/jenkins,andresrc/jenkins,dariver/jenkins,tangkun75/jenkins,tangkun75/jenkins,wuwen5/jenkins,ikedam/jenkins,andresrc/jenkins,Vlatombe/jenkins,hplatou/jenkins,dariver/jenkins,lilyJi/jenkins,dariver/jenkins,escoem/jenkins,Ykus/jenkins,dariver/jenkins,Ykus/jenkins,lilyJi/jenkins,DanielWeber/jenkins,Vlatombe/jenkins,sathiya-mit/jenkins,hplatou/jenkins,tangkun75/jenkins,Jochen-A-Fuerbacher/jenkins,azweb76/jenkins,wuwen5/jenkins,rsandell/jenkins,ndeloof/jenkins,daniel-beck/jenkins,escoem/jenkins,bpzhang/jenkins,Jimilian/jenkins,ajshastri/jenkins,lilyJi/jenkins,tfennelly/jenkins,bkmeneguello/jenkins,Vlatombe/jenkins,ikedam/jenkins,MarkEWaite/jenkins,godfath3r/jenkins,bkmeneguello/jenkins,recena/jenkins,rsandell/jenkins,sathiya-mit/jenkins,oleg-nenashev/jenkins,v1v/jenkins,kohsuke/hudson,DanielWeber/jenkins,Jochen-A-Fuerbacher/jenkins,MarkEWaite/jenkins,recena/jenkins,tfennelly/jenkins,Ykus/jenkins,wuwen5/jenkins,tfennelly/jenkins,escoem/jenkins,stephenc/jenkins,v1v/jenkins,oleg-nenashev/jenkins,daniel-beck/jenkins,ikedam/jenkins,Jochen-A-Fuerbacher/jenkins,hplatou/jenkins,wuwen5/jenkins,jenkinsci/jenkins,oleg-nenashev/jenkins,bpzhang/jenkins,aldaris/jenkins,tangkun75/jenkins,oleg-nenashev/jenkins,escoem/jenkins,MarkEWaite/jenkins,daniel-beck/jenkins,rsandell/jenkins,ErikVerheul/jenkins,bpzhang/jenkins,patbos/jenkins,v1v/jenkins,batmat/jenkins,fbelzunc/jenkins,ndeloof/jenkins,rsandell/jenkins,amuniz/jenkins,tangkun75/jenkins,pjanouse/jenkins,godfath3r/jenkins,bkmeneguello/jenkins,kohsuke/hudson,jenkinsci/jenkins,ErikVerheul/jenkins,pjanouse/jenkins,Vlatombe/jenkins,ikedam/jenkins,bkmeneguello/jenkins,Ykus/jenkins,godfath3r/jenkins,batmat/jenkins,jenkinsci/jenkins,daniel-beck/jenkins,viqueen/jenkins,dariver/jenkins,lilyJi/jenkins,stephenc/jenkins,rsandell/jenkins,oleg-nenashev/jenkins,bpzhang/jenkins,tangkun75/jenkins,v1v/jenkins,patbos/jenkins,bkmeneguello/jenkins,bkmeneguello/jenkins,ajshastri/jenkins,v1v/jenkins,ndeloof/jenkins,tfennelly/jenkins,daniel-beck/jenkins,damianszczepanik/jenkins,wuwen5/jenkins,pjanouse/jenkins,oleg-nenashev/jenkins,pjanouse/jenkins,ndeloof/jenkins,Jochen-A-Fuerbacher/jenkins,MarkEWaite/jenkins,recena/jenkins,batmat/jenkins,kohsuke/hudson,lilyJi/jenkins,Jimilian/jenkins,jenkinsci/jenkins,aldaris/jenkins,daniel-beck/jenkins,v1v/jenkins,azweb76/jenkins,andresrc/jenkins,stephenc/jenkins,MarkEWaite/jenkins,pjanouse/jenkins,patbos/jenkins,hplatou/jenkins,aldaris/jenkins,azweb76/jenkins,ikedam/jenkins,patbos/jenkins,fbelzunc/jenkins,Ykus/jenkins,aldaris/jenkins,ErikVerheul/jenkins,patbos/jenkins,kohsuke/hudson,rsandell/jenkins,recena/jenkins,andresrc/jenkins,dariver/jenkins,ikedam/jenkins,damianszczepanik/jenkins,amuniz/jenkins,kohsuke/hudson,Vlatombe/jenkins,daniel-beck/jenkins,andresrc/jenkins,rsandell/jenkins,recena/jenkins,godfath3r/jenkins,wuwen5/jenkins,damianszczepanik/jenkins,viqueen/jenkins,azweb76/jenkins,Jimilian/jenkins,v1v/jenkins
ini
## Code Before: Build\ History=Zgodovina prevajanja Check\ File\ Fingerprint=Otisci guza Delete\ View=Izbri\u0161i pogled Edit\ View=Uredi pogled NewJob=Nov People=Uporabniki Project\ Relationship=With my ass ## Instruction: Fix JENKINS-41756 - Indecently translated items Removed false and indecently to slovene translated main menu items. ## Code After: Build\ History=Zgodovina prevajanja Delete\ View=Izbri\u0161i pogled Edit\ View=Uredi pogled NewJob=Nov People=Uporabniki
Build\ History=Zgodovina prevajanja - Check\ File\ Fingerprint=Otisci guza Delete\ View=Izbri\u0161i pogled Edit\ View=Uredi pogled NewJob=Nov People=Uporabniki - Project\ Relationship=With my ass
2
0.25
0
2
9a42c33eafb48704ef964a0e9054f1e717a7f63c
pyconcz_2016/static/scss/pyconcz.scss
pyconcz_2016/static/scss/pyconcz.scss
@import "~normalize.css"; $base1: #b4beff; $base2: #eb718b; $base01: #333;
@import "~normalize.css"; $base1: #b4beff; $base2: #eb718b; $base01: #333; a { color: $base2; }
Use pycon color for links.
Use pycon color for links.
SCSS
mit
pyvec/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2016
scss
## Code Before: @import "~normalize.css"; $base1: #b4beff; $base2: #eb718b; $base01: #333; ## Instruction: Use pycon color for links. ## Code After: @import "~normalize.css"; $base1: #b4beff; $base2: #eb718b; $base01: #333; a { color: $base2; }
@import "~normalize.css"; $base1: #b4beff; $base2: #eb718b; $base01: #333; + + a { + color: $base2; + }
4
0.8
4
0
ac2ba89a120338ef4e2f339be9db077b033f0f02
vaadin-directory-description.md
vaadin-directory-description.md
[![Available in Vaadin_Directory](https://img.shields.io/vaadin-directory/v/vaadinvaadin-date-picker.svg)](https://vaadin.com/directory/component/vaadinvaadin-date-picker) [&lt;vaadin-date-picker&gt;](https://vaadin.com/components/vaadin-date-picker) is a [Polymer](http://polymer-project.org) element providing a date selection field which includes a scrollable month calendar view, part of the [Vaadin components](https://vaadin.com/components). [<img src="https://raw.githubusercontent.com/vaadin/vaadin-date-picker/master/screenshot.png" width="439" alt="Screenshot of vaadin-date-picker">](https://vaadin.com/components/vaadin-date-picker) ## Example Usage ```html <vaadin-date-picker label="Label" placeholder="Placeholder"> </vaadin-date-picker> ```
[![Available in Vaadin_Directory](https://img.shields.io/vaadin-directory/v/vaadinvaadin-date-picker.svg)](https://vaadin.com/directory/component/vaadinvaadin-date-picker) [&lt;vaadin-date-picker&gt;](https://vaadin.com/components/vaadin-date-picker) is a Web Component providing a date selection field which includes a scrollable month calendar view, part of the [Vaadin components](https://vaadin.com/components). [<img src="https://raw.githubusercontent.com/vaadin/vaadin-date-picker/master/screenshot.png" width="439" alt="Screenshot of vaadin-date-picker">](https://vaadin.com/components/vaadin-date-picker) ## Example Usage ```html <vaadin-date-picker label="Label" placeholder="Placeholder"> </vaadin-date-picker> ```
Align with skeleton: Remove Polymer 2 mention
Align with skeleton: Remove Polymer 2 mention
Markdown
apache-2.0
vaadin/vaadin-date-picker,vaadin/vaadin-date-picker
markdown
## Code Before: [![Available in Vaadin_Directory](https://img.shields.io/vaadin-directory/v/vaadinvaadin-date-picker.svg)](https://vaadin.com/directory/component/vaadinvaadin-date-picker) [&lt;vaadin-date-picker&gt;](https://vaadin.com/components/vaadin-date-picker) is a [Polymer](http://polymer-project.org) element providing a date selection field which includes a scrollable month calendar view, part of the [Vaadin components](https://vaadin.com/components). [<img src="https://raw.githubusercontent.com/vaadin/vaadin-date-picker/master/screenshot.png" width="439" alt="Screenshot of vaadin-date-picker">](https://vaadin.com/components/vaadin-date-picker) ## Example Usage ```html <vaadin-date-picker label="Label" placeholder="Placeholder"> </vaadin-date-picker> ``` ## Instruction: Align with skeleton: Remove Polymer 2 mention ## Code After: [![Available in Vaadin_Directory](https://img.shields.io/vaadin-directory/v/vaadinvaadin-date-picker.svg)](https://vaadin.com/directory/component/vaadinvaadin-date-picker) [&lt;vaadin-date-picker&gt;](https://vaadin.com/components/vaadin-date-picker) is a Web Component providing a date selection field which includes a scrollable month calendar view, part of the [Vaadin components](https://vaadin.com/components). [<img src="https://raw.githubusercontent.com/vaadin/vaadin-date-picker/master/screenshot.png" width="439" alt="Screenshot of vaadin-date-picker">](https://vaadin.com/components/vaadin-date-picker) ## Example Usage ```html <vaadin-date-picker label="Label" placeholder="Placeholder"> </vaadin-date-picker> ```
[![Available in Vaadin_Directory](https://img.shields.io/vaadin-directory/v/vaadinvaadin-date-picker.svg)](https://vaadin.com/directory/component/vaadinvaadin-date-picker) - [&lt;vaadin-date-picker&gt;](https://vaadin.com/components/vaadin-date-picker) is a [Polymer](http://polymer-project.org) element providing a date selection field which includes a scrollable month calendar view, part of the [Vaadin components](https://vaadin.com/components). + [&lt;vaadin-date-picker&gt;](https://vaadin.com/components/vaadin-date-picker) is a Web Component providing a date selection field which includes a scrollable month calendar view, part of the [Vaadin components](https://vaadin.com/components). [<img src="https://raw.githubusercontent.com/vaadin/vaadin-date-picker/master/screenshot.png" width="439" alt="Screenshot of vaadin-date-picker">](https://vaadin.com/components/vaadin-date-picker) ## Example Usage ```html <vaadin-date-picker label="Label" placeholder="Placeholder"> </vaadin-date-picker> ```
2
0.153846
1
1
d178fb001b8b6869038ed6ec288acf5fb427205c
rssmailer/tasks/mail.py
rssmailer/tasks/mail.py
from celery.decorators import task from django.core.mail import send_mail from ..models import Email @task(ignore_result=True, name="rssmailer.tasks.mail.send") def send(entry, **kwargs): logger = send.get_logger(**kwargs) logger.info("Sending entry: %s" % entry.title) emails_all = Email.objects.all() step = 3 # how many recipients in one e-mail for i in range(0, len(emails_all), step): recipients = map(lambda e: e.email, emails_all[i:i+step]) send_entry_to.delay(entry.title, entry.summary, recipients) @task(ignore_result=True, name="rssmailer.tasks.mail.send_entry_to") def send_entry_to(title, body, recipients, **kwargs): logger = send.get_logger(**kwargs) logger.info("Sending to: %s" % ','.join(recipients)) send_mail(title, body, "rssmailer@praus.net", recipients)
from celery.decorators import task from django.core.mail import send_mail from ..models import Email @task(ignore_result=True, name="rssmailer.tasks.send") def send(entry, **kwargs): logger = send.get_logger(**kwargs) logger.info("Sending entry: %s" % entry.title) emails_all = Email.objects.all() step = 3 # how many recipients in one e-mail for i in range(0, len(emails_all), step): recipients = map(lambda e: e.email, emails_all[i:i+step]) send_entry_to.delay(entry.title, entry.summary, recipients) @task(ignore_result=True, name="rssmailer.tasks.send_entry_to") def send_entry_to(title, body, recipients, **kwargs): logger = send.get_logger(**kwargs) logger.info("Sending to: %s" % ','.join(recipients)) send_mail(title, body, "rssmailer@praus.net", recipients)
Fix naming issues with tasks
Fix naming issues with tasks
Python
bsd-3-clause
praus/django-rssmailer
python
## Code Before: from celery.decorators import task from django.core.mail import send_mail from ..models import Email @task(ignore_result=True, name="rssmailer.tasks.mail.send") def send(entry, **kwargs): logger = send.get_logger(**kwargs) logger.info("Sending entry: %s" % entry.title) emails_all = Email.objects.all() step = 3 # how many recipients in one e-mail for i in range(0, len(emails_all), step): recipients = map(lambda e: e.email, emails_all[i:i+step]) send_entry_to.delay(entry.title, entry.summary, recipients) @task(ignore_result=True, name="rssmailer.tasks.mail.send_entry_to") def send_entry_to(title, body, recipients, **kwargs): logger = send.get_logger(**kwargs) logger.info("Sending to: %s" % ','.join(recipients)) send_mail(title, body, "rssmailer@praus.net", recipients) ## Instruction: Fix naming issues with tasks ## Code After: from celery.decorators import task from django.core.mail import send_mail from ..models import Email @task(ignore_result=True, name="rssmailer.tasks.send") def send(entry, **kwargs): logger = send.get_logger(**kwargs) logger.info("Sending entry: %s" % entry.title) emails_all = Email.objects.all() step = 3 # how many recipients in one e-mail for i in range(0, len(emails_all), step): recipients = map(lambda e: e.email, emails_all[i:i+step]) send_entry_to.delay(entry.title, entry.summary, recipients) @task(ignore_result=True, name="rssmailer.tasks.send_entry_to") def send_entry_to(title, body, recipients, **kwargs): logger = send.get_logger(**kwargs) logger.info("Sending to: %s" % ','.join(recipients)) send_mail(title, body, "rssmailer@praus.net", recipients)
from celery.decorators import task from django.core.mail import send_mail from ..models import Email - @task(ignore_result=True, name="rssmailer.tasks.mail.send") ? ----- + @task(ignore_result=True, name="rssmailer.tasks.send") def send(entry, **kwargs): logger = send.get_logger(**kwargs) logger.info("Sending entry: %s" % entry.title) emails_all = Email.objects.all() step = 3 # how many recipients in one e-mail for i in range(0, len(emails_all), step): recipients = map(lambda e: e.email, emails_all[i:i+step]) send_entry_to.delay(entry.title, entry.summary, recipients) - @task(ignore_result=True, name="rssmailer.tasks.mail.send_entry_to") ? ----- + @task(ignore_result=True, name="rssmailer.tasks.send_entry_to") def send_entry_to(title, body, recipients, **kwargs): logger = send.get_logger(**kwargs) logger.info("Sending to: %s" % ','.join(recipients)) - send_mail(title, body, "rssmailer@praus.net", recipients) + send_mail(title, body, "rssmailer@praus.net", recipients) ? +
6
0.26087
3
3
f96d26e8686cb2d1a15860414b90e48418e41f38
tests/integration/conftest.py
tests/integration/conftest.py
import pytest import io import contextlib import tempfile import shutil import os from xd.docker.client import * DOCKER_HOST = os.environ.get('DOCKER_HOST', None) @pytest.fixture(scope="module") def docker(request): return DockerClient(host=DOCKER_HOST) class StreamRedirector(object): def __init__(self): self.stream = io.StringIO() def redirect(self): return contextlib.redirect_stdout(self.stream) def get(self): return self.stream.getvalue() def getlines(self): return self.stream.getvalue().rstrip('\n').split('\n') def lastline(self): lines = self.getlines() if not lines: return None return lines[-1] @pytest.fixture def stdout(): return StreamRedirector() @pytest.fixture def cleandir(request): newdir = tempfile.mkdtemp() os.chdir(newdir) def remove_cleandir(): shutil.rmtree(newdir) request.addfinalizer(remove_cleandir) return newdir
import pytest import io import contextlib import tempfile import shutil import os from xd.docker.client import * DOCKER_HOST = os.environ.get('DOCKER_HOST', None) @pytest.fixture(scope="function") def docker(request): os.system("for c in `docker ps -a -q`;do docker rm $c;done") os.system("for i in `docker images -q`;do docker rmi $i;done") return DockerClient(host=DOCKER_HOST) class StreamRedirector(object): def __init__(self): self.stream = io.StringIO() def redirect(self): return contextlib.redirect_stdout(self.stream) def get(self): return self.stream.getvalue() def getlines(self): return self.stream.getvalue().rstrip('\n').split('\n') def lastline(self): lines = self.getlines() if not lines: return None return lines[-1] @pytest.fixture def stdout(): return StreamRedirector() @pytest.fixture def cleandir(request): newdir = tempfile.mkdtemp() os.chdir(newdir) def remove_cleandir(): shutil.rmtree(newdir) request.addfinalizer(remove_cleandir) return newdir
Purge images and containers before each test
tests: Purge images and containers before each test Signed-off-by: Esben Haabendal <da90c138e4a9573086862393cde34fa33d74f6e5@haabendal.dk>
Python
mit
XD-embedded/xd-docker,XD-embedded/xd-docker,esben/xd-docker,esben/xd-docker
python
## Code Before: import pytest import io import contextlib import tempfile import shutil import os from xd.docker.client import * DOCKER_HOST = os.environ.get('DOCKER_HOST', None) @pytest.fixture(scope="module") def docker(request): return DockerClient(host=DOCKER_HOST) class StreamRedirector(object): def __init__(self): self.stream = io.StringIO() def redirect(self): return contextlib.redirect_stdout(self.stream) def get(self): return self.stream.getvalue() def getlines(self): return self.stream.getvalue().rstrip('\n').split('\n') def lastline(self): lines = self.getlines() if not lines: return None return lines[-1] @pytest.fixture def stdout(): return StreamRedirector() @pytest.fixture def cleandir(request): newdir = tempfile.mkdtemp() os.chdir(newdir) def remove_cleandir(): shutil.rmtree(newdir) request.addfinalizer(remove_cleandir) return newdir ## Instruction: tests: Purge images and containers before each test Signed-off-by: Esben Haabendal <da90c138e4a9573086862393cde34fa33d74f6e5@haabendal.dk> ## Code After: import pytest import io import contextlib import tempfile import shutil import os from xd.docker.client import * DOCKER_HOST = os.environ.get('DOCKER_HOST', None) @pytest.fixture(scope="function") def docker(request): os.system("for c in `docker ps -a -q`;do docker rm $c;done") os.system("for i in `docker images -q`;do docker rmi $i;done") return DockerClient(host=DOCKER_HOST) class StreamRedirector(object): def __init__(self): self.stream = io.StringIO() def redirect(self): return contextlib.redirect_stdout(self.stream) def get(self): return self.stream.getvalue() def getlines(self): return self.stream.getvalue().rstrip('\n').split('\n') def lastline(self): lines = self.getlines() if not lines: return None return lines[-1] @pytest.fixture def stdout(): return StreamRedirector() @pytest.fixture def cleandir(request): newdir = tempfile.mkdtemp() os.chdir(newdir) def remove_cleandir(): shutil.rmtree(newdir) request.addfinalizer(remove_cleandir) return newdir
import pytest import io import contextlib import tempfile import shutil import os from xd.docker.client import * DOCKER_HOST = os.environ.get('DOCKER_HOST', None) - @pytest.fixture(scope="module") ? ^ ^^^^ + @pytest.fixture(scope="function") ? ^^^^^^ ^ def docker(request): + os.system("for c in `docker ps -a -q`;do docker rm $c;done") + os.system("for i in `docker images -q`;do docker rmi $i;done") return DockerClient(host=DOCKER_HOST) class StreamRedirector(object): def __init__(self): self.stream = io.StringIO() def redirect(self): return contextlib.redirect_stdout(self.stream) def get(self): return self.stream.getvalue() def getlines(self): return self.stream.getvalue().rstrip('\n').split('\n') def lastline(self): lines = self.getlines() if not lines: return None return lines[-1] @pytest.fixture def stdout(): return StreamRedirector() @pytest.fixture def cleandir(request): newdir = tempfile.mkdtemp() os.chdir(newdir) def remove_cleandir(): shutil.rmtree(newdir) request.addfinalizer(remove_cleandir) return newdir
4
0.076923
3
1
dcbb172b619e70c8d497a96a7076bacb3b9b039a
src/scss/generic/_reset.scss
src/scss/generic/_reset.scss
//sass-lint:disable-all @import './node_modules/reset-css/_reset';
//sass-lint:disable-all @import './node_modules/reset-css/_reset'; em { font-style: italic; } img { display: block; max-width: 100%; }
Redefine some attributes after reset adjusts
Redefine some attributes after reset adjusts
SCSS
mit
getninjas/gaiden,getninjas/gaiden
scss
## Code Before: //sass-lint:disable-all @import './node_modules/reset-css/_reset'; ## Instruction: Redefine some attributes after reset adjusts ## Code After: //sass-lint:disable-all @import './node_modules/reset-css/_reset'; em { font-style: italic; } img { display: block; max-width: 100%; }
//sass-lint:disable-all @import './node_modules/reset-css/_reset'; + + em { + font-style: italic; + } + + img { + display: block; + max-width: 100%; + }
9
4.5
9
0
0350eddfb48085144201078b5d0b18aa9050cdbd
src/main/java/de/prob2/ui/verifications/cbc/CBCFormulaFindStateItem.java
src/main/java/de/prob2/ui/verifications/cbc/CBCFormulaFindStateItem.java
package de.prob2.ui.verifications.cbc; import java.util.Objects; import de.prob.statespace.Trace; public class CBCFormulaFindStateItem extends CBCFormulaItem { private Trace example; public CBCFormulaFindStateItem(String name, String code, CBCType type) { super(name, code, type); this.example = null; } public void setExample(Trace example) { this.example = example; } public Trace getExample() { return example; } @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CBCFormulaFindStateItem)) { return false; } CBCFormulaFindStateItem otherItem = (CBCFormulaFindStateItem) obj; return otherItem.getName().equals(this.getName()) && otherItem.getCode().equals(this.getCode()) && otherItem.getType().equals(this.getType()); } @Override public int hashCode() { return Objects.hash(name, code, type); } }
package de.prob2.ui.verifications.cbc; import java.util.Objects; import de.prob.statespace.Trace; public class CBCFormulaFindStateItem extends CBCFormulaItem { private transient Trace example; public CBCFormulaFindStateItem(String name, String code, CBCType type) { super(name, code, type); this.example = null; } public void setExample(Trace example) { this.example = example; } public Trace getExample() { return example; } @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CBCFormulaFindStateItem)) { return false; } CBCFormulaFindStateItem otherItem = (CBCFormulaFindStateItem) obj; return otherItem.getName().equals(this.getName()) && otherItem.getCode().equals(this.getCode()) && otherItem.getType().equals(this.getType()); } @Override public int hashCode() { return Objects.hash(name, code, type); } }
Fix an exception when loading project
Fix an exception when loading project
Java
epl-1.0
bendisposto/prob2-ui,bendisposto/prob2-ui,bendisposto/prob2-ui,bendisposto/prob2-ui
java
## Code Before: package de.prob2.ui.verifications.cbc; import java.util.Objects; import de.prob.statespace.Trace; public class CBCFormulaFindStateItem extends CBCFormulaItem { private Trace example; public CBCFormulaFindStateItem(String name, String code, CBCType type) { super(name, code, type); this.example = null; } public void setExample(Trace example) { this.example = example; } public Trace getExample() { return example; } @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CBCFormulaFindStateItem)) { return false; } CBCFormulaFindStateItem otherItem = (CBCFormulaFindStateItem) obj; return otherItem.getName().equals(this.getName()) && otherItem.getCode().equals(this.getCode()) && otherItem.getType().equals(this.getType()); } @Override public int hashCode() { return Objects.hash(name, code, type); } } ## Instruction: Fix an exception when loading project ## Code After: package de.prob2.ui.verifications.cbc; import java.util.Objects; import de.prob.statespace.Trace; public class CBCFormulaFindStateItem extends CBCFormulaItem { private transient Trace example; public CBCFormulaFindStateItem(String name, String code, CBCType type) { super(name, code, type); this.example = null; } public void setExample(Trace example) { this.example = example; } public Trace getExample() { return example; } @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CBCFormulaFindStateItem)) { return false; } CBCFormulaFindStateItem otherItem = (CBCFormulaFindStateItem) obj; return otherItem.getName().equals(this.getName()) && otherItem.getCode().equals(this.getCode()) && otherItem.getType().equals(this.getType()); } @Override public int hashCode() { return Objects.hash(name, code, type); } }
package de.prob2.ui.verifications.cbc; import java.util.Objects; import de.prob.statespace.Trace; public class CBCFormulaFindStateItem extends CBCFormulaItem { - private Trace example; + private transient Trace example; ? ++++++++++ public CBCFormulaFindStateItem(String name, String code, CBCType type) { super(name, code, type); this.example = null; } public void setExample(Trace example) { this.example = example; } public Trace getExample() { return example; } @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CBCFormulaFindStateItem)) { return false; } CBCFormulaFindStateItem otherItem = (CBCFormulaFindStateItem) obj; return otherItem.getName().equals(this.getName()) && otherItem.getCode().equals(this.getCode()) && otherItem.getType().equals(this.getType()); } @Override public int hashCode() { return Objects.hash(name, code, type); } }
2
0.046512
1
1
e2c324b4277efa3d16fd6dbb3c4e88e047bf8b88
_config.yml
_config.yml
--- title: My Brain on Embryology timezone: America/Indiana/Indianapolis collections: posts: title: Posts output: true slides: title: Slides output: true uploads: title: Uploads output: true defaults: - scope: path: '' type: posts values: layout: post permalink: "/posts/:title/" - scope: path: '' type: pages values: layout: page - scope: path: '' type: slides values: layout: slide permalink: "/slides/:title/" links: - link_text: slide: permalink: pretty cases: - title: A Curious Cardiovascular Case slide: Intro email: barbieaklein@gmail.com description: My Brain on Anatomy contains interactive flipped classes for embryology and histology developed by Barbie Klein. markdown: kramdown gems: - jekyll-feed exclude: - Gemfile - Gemfile.lock - README.md - node_modules/ - package.json - gulpfile.js
--- title: My Brain on Embryology timezone: America/Indiana/Indianapolis collections: posts: title: Posts output: true slides: title: Slides output: true uploads: title: Uploads output: true defaults: - scope: path: '' type: posts values: layout: post permalink: "/posts/:title/" - scope: path: '' type: pages values: layout: page - scope: path: '' type: slides values: layout: slide links: - link_text: slide: permalink: pretty cases: - title: A Curious Cardiovascular Case slide: Intro email: barbieaklein@gmail.com description: My Brain on Anatomy contains interactive flipped classes for embryology and histology developed by Barbie Klein. markdown: kramdown gems: - jekyll-feed exclude: - Gemfile - Gemfile.lock - README.md - node_modules/ - package.json - gulpfile.js
Remove permalink default field from slides
Remove permalink default field from slides
YAML
mit
dajocarter/static-mboa,dajocarter/static-mboa,dajocarter/static-mboa
yaml
## Code Before: --- title: My Brain on Embryology timezone: America/Indiana/Indianapolis collections: posts: title: Posts output: true slides: title: Slides output: true uploads: title: Uploads output: true defaults: - scope: path: '' type: posts values: layout: post permalink: "/posts/:title/" - scope: path: '' type: pages values: layout: page - scope: path: '' type: slides values: layout: slide permalink: "/slides/:title/" links: - link_text: slide: permalink: pretty cases: - title: A Curious Cardiovascular Case slide: Intro email: barbieaklein@gmail.com description: My Brain on Anatomy contains interactive flipped classes for embryology and histology developed by Barbie Klein. markdown: kramdown gems: - jekyll-feed exclude: - Gemfile - Gemfile.lock - README.md - node_modules/ - package.json - gulpfile.js ## Instruction: Remove permalink default field from slides ## Code After: --- title: My Brain on Embryology timezone: America/Indiana/Indianapolis collections: posts: title: Posts output: true slides: title: Slides output: true uploads: title: Uploads output: true defaults: - scope: path: '' type: posts values: layout: post permalink: "/posts/:title/" - scope: path: '' type: pages values: layout: page - scope: path: '' type: slides values: layout: slide links: - link_text: slide: permalink: pretty cases: - title: A Curious Cardiovascular Case slide: Intro email: barbieaklein@gmail.com description: My Brain on Anatomy contains interactive flipped classes for embryology and histology developed by Barbie Klein. markdown: kramdown gems: - jekyll-feed exclude: - Gemfile - Gemfile.lock - README.md - node_modules/ - package.json - gulpfile.js
--- title: My Brain on Embryology timezone: America/Indiana/Indianapolis collections: posts: title: Posts output: true slides: title: Slides output: true uploads: title: Uploads output: true defaults: - scope: path: '' type: posts values: layout: post permalink: "/posts/:title/" - scope: path: '' type: pages values: layout: page - scope: path: '' type: slides values: layout: slide - permalink: "/slides/:title/" links: - - link_text: ? - + - link_text: - slide: ? - + slide: permalink: pretty cases: - title: A Curious Cardiovascular Case slide: Intro email: barbieaklein@gmail.com description: My Brain on Anatomy contains interactive flipped classes for embryology and histology developed by Barbie Klein. markdown: kramdown gems: - jekyll-feed exclude: - Gemfile - Gemfile.lock - README.md - node_modules/ - package.json - gulpfile.js
5
0.098039
2
3
366e09d668b3b908aa7cfaeebf6359b221108c18
app/mailers/user_mailer.rb
app/mailers/user_mailer.rb
class UserMailer < ActionMailer::Base default from: "from@example.com" def password_reset_notification(user) @user = user @url = passwords_path(user.password_reset_token) mail(to: user.email, subject: "Your password reset request") end end
class UserMailer < ActionMailer::Base default from: Rails.configuration.noreply_email def password_reset_notification(user) @user = user @url = passwords_url(token: user.password_reset_token) mail(to: user.email, subject: "Your password reset request") end end
Use rails configuration for from email
Use rails configuration for from email
Ruby
mit
ministryofjustice/scs_appraisals,ministryofjustice/scs_appraisals,ministryofjustice/scs_appraisals
ruby
## Code Before: class UserMailer < ActionMailer::Base default from: "from@example.com" def password_reset_notification(user) @user = user @url = passwords_path(user.password_reset_token) mail(to: user.email, subject: "Your password reset request") end end ## Instruction: Use rails configuration for from email ## Code After: class UserMailer < ActionMailer::Base default from: Rails.configuration.noreply_email def password_reset_notification(user) @user = user @url = passwords_url(token: user.password_reset_token) mail(to: user.email, subject: "Your password reset request") end end
class UserMailer < ActionMailer::Base - default from: "from@example.com" + default from: Rails.configuration.noreply_email def password_reset_notification(user) @user = user - @url = passwords_path(user.password_reset_token) ? ^^ ^^ + @url = passwords_url(token: user.password_reset_token) ? ^^^^ ^^^^^^ mail(to: user.email, subject: "Your password reset request") end end
4
0.363636
2
2
9d4531e2e502b637a1d2347f96ae990543f28abd
.travis.yml
.travis.yml
language: haskell - 7.8 - 7.6 - 7.4 before_install: - echo $PATH - find /usr/local/ghc -type f -ls install: script: after_script:
language: haskell ghc: - 7.8 - 7.6 - 7.4 before_install: - date - echo $PATH - find /usr/local/ghc -type f -ls install: script: - echo script after_script: - date
Fix and add timestamp command.
Fix and add timestamp command.
YAML
bsd-3-clause
khibino/travis-ci-haskell
yaml
## Code Before: language: haskell - 7.8 - 7.6 - 7.4 before_install: - echo $PATH - find /usr/local/ghc -type f -ls install: script: after_script: ## Instruction: Fix and add timestamp command. ## Code After: language: haskell ghc: - 7.8 - 7.6 - 7.4 before_install: - date - echo $PATH - find /usr/local/ghc -type f -ls install: script: - echo script after_script: - date
language: haskell + ghc: - 7.8 - 7.6 - 7.4 before_install: + - date - echo $PATH - find /usr/local/ghc -type f -ls install: script: + - echo script after_script: + - date
4
0.285714
4
0
851dc3c21b3b98d60965cda6368623a3750c3c22
client/webpack.common.config.js
client/webpack.common.config.js
// Common webpack configuration used by webpack.hot.config and webpack.rails.config. const path = require('path'); module.exports = { // the project dir context: __dirname, entry: ['jquery', 'jquery-ujs', './assets/javascripts/App'], resolve: { root: [ path.join(__dirname, 'scripts'), path.join(__dirname, 'assets/javascripts'), ], extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.scss', '.css', 'config.js'], }, module: { loaders: [ // React is necessary for the client rendering: {test: require.resolve('react'), loader: 'expose?React'}, {test: require.resolve('jquery'), loader: 'expose?jQuery'}, ], }, };
// Common webpack configuration used by webpack.hot.config and webpack.rails.config. const path = require('path'); module.exports = { // the project dir context: __dirname, entry: ['jquery', 'jquery-ujs', './assets/javascripts/App'], resolve: { root: [ path.join(__dirname, 'scripts'), path.join(__dirname, 'assets/javascripts'), ], extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.scss', '.css', 'config.js'], }, module: { loaders: [ // React is necessary for the client rendering: {test: require.resolve('react'), loader: 'expose?React'}, {test: require.resolve('jquery'), loader: 'expose?jQuery'}, {test: require.resolve('jquery'), loader: 'expose?$'}, ], }, };
Add additional jquery expose-loader to global $
Add additional jquery expose-loader to global $
JavaScript
mit
szyablitsky/react-webpack-rails-tutorial,yakovenkodenis/react-webpack-rails-tutorial,roxolan/react-webpack-rails-tutorial,janklimo/react-webpack-rails-tutorial,shunwen/react-webpack-rails-tutorial,Rvor/react-webpack-rails-tutorial,jeffthemaximum/jeffline,janklimo/react-webpack-rails-tutorial,suzukaze/react-webpack-rails-tutorial,thiagoc7/react-webpack-rails-tutorial,jeffthemaximum/Teachers-Dont-Pay-Jeff,thiagoc7/react-webpack-rails-tutorial,phosphene/react-on-rails-cherrypick,justin808/react-webpack-rails-tutorial,StanBoyet/react-webpack-rails-tutorial,thiagoc7/react-webpack-rails-tutorial,shilu89757/react-webpack-rails-tutorial,suzukaze/react-webpack-rails-tutorial,szyablitsky/react-webpack-rails-tutorial,shakacode/react-webpack-rails-tutorial,szyablitsky/react-webpack-rails-tutorial,StanBoyet/react-webpack-rails-tutorial,shakacode/react-webpack-rails-tutorial,csterritt/react-webpack-rails-tutorial,shunwen/react-webpack-rails-tutorial,jeffthemaximum/jeffline,szyablitsky/react-webpack-rails-tutorial,shilu89757/react-webpack-rails-tutorial,bsy/react-webpack-rails-tutorial,shilu89757/react-webpack-rails-tutorial,suzukaze/react-webpack-rails-tutorial,Rvor/react-webpack-rails-tutorial,jeffthemaximum/Teachers-Dont-Pay-Jeff,jeffthemaximum/Teachers-Dont-Pay-Jeff,yakovenkodenis/react-webpack-rails-tutorial,csterritt/react-webpack-rails-tutorial,roxolan/react-webpack-rails-tutorial,phosphene/react-on-rails-cherrypick,shakacode/react-webpack-rails-tutorial,cacheflow/react-webpack-rails-tutorial,suzukaze/react-webpack-rails-tutorial,thiagoc7/react-webpack-rails-tutorial,justin808/react-webpack-rails-tutorial,jeffthemaximum/jeffline,Johnnycus/react-webpack-rails-tutorial,roxolan/react-webpack-rails-tutorial,yakovenkodenis/react-webpack-rails-tutorial,cacheflow/react-webpack-rails-tutorial,roxolan/react-webpack-rails-tutorial,justin808/react-webpack-rails-tutorial,Johnnycus/react-webpack-rails-tutorial,janklimo/react-webpack-rails-tutorial,phosphene/react-on-rails-cherrypick,bsy/react-webpack-rails-tutorial,phosphene/react-on-rails-cherrypick,justin808/react-webpack-rails-tutorial,janklimo/react-webpack-rails-tutorial,Johnnycus/react-webpack-rails-tutorial,Johnnycus/react-webpack-rails-tutorial,csterritt/react-webpack-rails-tutorial,cacheflow/react-webpack-rails-tutorial,jeffthemaximum/Teachers-Dont-Pay-Jeff,shakacode/react-webpack-rails-tutorial,shilu89757/react-webpack-rails-tutorial,Rvor/react-webpack-rails-tutorial,csterritt/react-webpack-rails-tutorial,shunwen/react-webpack-rails-tutorial,mscienski/stpauls,yakovenkodenis/react-webpack-rails-tutorial,StanBoyet/react-webpack-rails-tutorial,shunwen/react-webpack-rails-tutorial,jeffthemaximum/jeffline,bsy/react-webpack-rails-tutorial,mscienski/stpauls,Rvor/react-webpack-rails-tutorial,jeffthemaximum/jeffline,bsy/react-webpack-rails-tutorial,jeffthemaximum/Teachers-Dont-Pay-Jeff,StanBoyet/react-webpack-rails-tutorial,cacheflow/react-webpack-rails-tutorial
javascript
## Code Before: // Common webpack configuration used by webpack.hot.config and webpack.rails.config. const path = require('path'); module.exports = { // the project dir context: __dirname, entry: ['jquery', 'jquery-ujs', './assets/javascripts/App'], resolve: { root: [ path.join(__dirname, 'scripts'), path.join(__dirname, 'assets/javascripts'), ], extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.scss', '.css', 'config.js'], }, module: { loaders: [ // React is necessary for the client rendering: {test: require.resolve('react'), loader: 'expose?React'}, {test: require.resolve('jquery'), loader: 'expose?jQuery'}, ], }, }; ## Instruction: Add additional jquery expose-loader to global $ ## Code After: // Common webpack configuration used by webpack.hot.config and webpack.rails.config. const path = require('path'); module.exports = { // the project dir context: __dirname, entry: ['jquery', 'jquery-ujs', './assets/javascripts/App'], resolve: { root: [ path.join(__dirname, 'scripts'), path.join(__dirname, 'assets/javascripts'), ], extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.scss', '.css', 'config.js'], }, module: { loaders: [ // React is necessary for the client rendering: {test: require.resolve('react'), loader: 'expose?React'}, {test: require.resolve('jquery'), loader: 'expose?jQuery'}, {test: require.resolve('jquery'), loader: 'expose?$'}, ], }, };
// Common webpack configuration used by webpack.hot.config and webpack.rails.config. const path = require('path'); module.exports = { // the project dir context: __dirname, entry: ['jquery', 'jquery-ujs', './assets/javascripts/App'], resolve: { root: [ path.join(__dirname, 'scripts'), path.join(__dirname, 'assets/javascripts'), ], extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.scss', '.css', 'config.js'], }, module: { loaders: [ // React is necessary for the client rendering: {test: require.resolve('react'), loader: 'expose?React'}, {test: require.resolve('jquery'), loader: 'expose?jQuery'}, + {test: require.resolve('jquery'), loader: 'expose?$'}, ], }, };
1
0.038462
1
0
5abd4c1b23962d38db3a4beae0db46d6a83cdb16
.travis.yml
.travis.yml
language: ruby bundler_args: --without development services: - rabbitmq rvm: - '2.1' - '2.0' - '1.9.3' - jruby - rbx gemfile: - gemfiles/Gemfile.rails-4-1 - gemfiles/Gemfile.rails-4-0 - gemfiles/Gemfile.rails-3-2 env: - BUNNY_VERSION="~> 1.6" - BUNNY_VERSION="~> 1.5.0" - BUNNY_VERSION="~> 1.4.0" matrix: allow_failures: - rvm: jruby - rvm: rbx script: - bundle exec rake spec:msgr - bundle exec rake spec:integration
sudo : false language: ruby bundler_args: --without development services: - rabbitmq rvm: - '2.1' - '2.0' - jruby - rbx gemfile: - gemfiles/Gemfile.rails-4-1 - gemfiles/Gemfile.rails-4-0 - gemfiles/Gemfile.rails-3-2 env: - BUNNY_VERSION="~> 1.6" - BUNNY_VERSION="~> 1.5.0" - BUNNY_VERSION="~> 1.4.0" matrix: allow_failures: - rvm: jruby - rvm: rbx script: - bundle exec rake spec:msgr - bundle exec rake spec:integration
Drop 1.9.3 from CI and enable container
Drop 1.9.3 from CI and enable container
YAML
mit
jgraichen/msgr,jgraichen/msgr
yaml
## Code Before: language: ruby bundler_args: --without development services: - rabbitmq rvm: - '2.1' - '2.0' - '1.9.3' - jruby - rbx gemfile: - gemfiles/Gemfile.rails-4-1 - gemfiles/Gemfile.rails-4-0 - gemfiles/Gemfile.rails-3-2 env: - BUNNY_VERSION="~> 1.6" - BUNNY_VERSION="~> 1.5.0" - BUNNY_VERSION="~> 1.4.0" matrix: allow_failures: - rvm: jruby - rvm: rbx script: - bundle exec rake spec:msgr - bundle exec rake spec:integration ## Instruction: Drop 1.9.3 from CI and enable container ## Code After: sudo : false language: ruby bundler_args: --without development services: - rabbitmq rvm: - '2.1' - '2.0' - jruby - rbx gemfile: - gemfiles/Gemfile.rails-4-1 - gemfiles/Gemfile.rails-4-0 - gemfiles/Gemfile.rails-3-2 env: - BUNNY_VERSION="~> 1.6" - BUNNY_VERSION="~> 1.5.0" - BUNNY_VERSION="~> 1.4.0" matrix: allow_failures: - rvm: jruby - rvm: rbx script: - bundle exec rake spec:msgr - bundle exec rake spec:integration
+ sudo : false language: ruby bundler_args: --without development services: - rabbitmq rvm: - '2.1' - '2.0' - - '1.9.3' - jruby - rbx gemfile: - gemfiles/Gemfile.rails-4-1 - gemfiles/Gemfile.rails-4-0 - gemfiles/Gemfile.rails-3-2 env: - BUNNY_VERSION="~> 1.6" - BUNNY_VERSION="~> 1.5.0" - BUNNY_VERSION="~> 1.4.0" matrix: allow_failures: - rvm: jruby - rvm: rbx script: - bundle exec rake spec:msgr - bundle exec rake spec:integration
2
0.08
1
1
1809d5dbb1f918377cdf7246e9d0a4c3602fd751
configuration/salt/state/run-tracking-db/init.sls
configuration/salt/state/run-tracking-db/init.sls
butler_admin_user: postgres_user.present: - name: {{ pillar['postgres.user'] }} - createdb: True - superuser: True - password: {{ pillar['postgres.password'] }} - user: postgres - db_host: localhost /data/run_tracking/db: file.directory: - user: postgres - group: postgres - mode: 744 - makedirs: True /data/run_tracking/indexes: file.directory: - user: postgres - group: postgres - mode: 744 - makedirs: True run_tablespace: postgres_tablespace.present: - name: run_dbspace - owner: {{ pillar['postgres.user'] }} - directory: /data/run_tracking/db - user: postgres butler_indexspace: postgres_tablespace.present: - name: run_indexspace - owner: {{ pillar['postgres.user'] }} - directory: /data/run_tracking/indexes - user: postgres run_tracking_db: postgres_database.present: - name: pillar['run_tracking_db_name'] - owner: {{ pillar['postgres.user'] }} - tablespace: run_dbspace - user: postgres
butler_admin_user: postgres_user.present: - name: {{ pillar['postgres.user'] }} - createdb: True - superuser: True - password: {{ pillar['postgres.password'] }} - user: postgres - db_host: localhost - db_user: postgres /data/run_tracking/db: file.directory: - user: postgres - group: postgres - mode: 744 - makedirs: True /data/run_tracking/indexes: file.directory: - user: postgres - group: postgres - mode: 744 - makedirs: True run_tablespace: postgres_tablespace.present: - name: run_dbspace - owner: {{ pillar['postgres.user'] }} - directory: /data/run_tracking/db - user: postgres butler_indexspace: postgres_tablespace.present: - name: run_indexspace - owner: {{ pillar['postgres.user'] }} - directory: /data/run_tracking/indexes - user: postgres run_tracking_db: postgres_database.present: - name: pillar['run_tracking_db_name'] - owner: {{ pillar['postgres.user'] }} - tablespace: run_dbspace - user: postgres
Make sure to use postgres user for adding the butler_admin user
Make sure to use postgres user for adding the butler_admin user
SaltStack
mit
llevar/germline-regenotyper,llevar/germline-regenotyper
saltstack
## Code Before: butler_admin_user: postgres_user.present: - name: {{ pillar['postgres.user'] }} - createdb: True - superuser: True - password: {{ pillar['postgres.password'] }} - user: postgres - db_host: localhost /data/run_tracking/db: file.directory: - user: postgres - group: postgres - mode: 744 - makedirs: True /data/run_tracking/indexes: file.directory: - user: postgres - group: postgres - mode: 744 - makedirs: True run_tablespace: postgres_tablespace.present: - name: run_dbspace - owner: {{ pillar['postgres.user'] }} - directory: /data/run_tracking/db - user: postgres butler_indexspace: postgres_tablespace.present: - name: run_indexspace - owner: {{ pillar['postgres.user'] }} - directory: /data/run_tracking/indexes - user: postgres run_tracking_db: postgres_database.present: - name: pillar['run_tracking_db_name'] - owner: {{ pillar['postgres.user'] }} - tablespace: run_dbspace - user: postgres ## Instruction: Make sure to use postgres user for adding the butler_admin user ## Code After: butler_admin_user: postgres_user.present: - name: {{ pillar['postgres.user'] }} - createdb: True - superuser: True - password: {{ pillar['postgres.password'] }} - user: postgres - db_host: localhost - db_user: postgres /data/run_tracking/db: file.directory: - user: postgres - group: postgres - mode: 744 - makedirs: True /data/run_tracking/indexes: file.directory: - user: postgres - group: postgres - mode: 744 - makedirs: True run_tablespace: postgres_tablespace.present: - name: run_dbspace - owner: {{ pillar['postgres.user'] }} - directory: /data/run_tracking/db - user: postgres butler_indexspace: postgres_tablespace.present: - name: run_indexspace - owner: {{ pillar['postgres.user'] }} - directory: /data/run_tracking/indexes - user: postgres run_tracking_db: postgres_database.present: - name: pillar['run_tracking_db_name'] - owner: {{ pillar['postgres.user'] }} - tablespace: run_dbspace - user: postgres
butler_admin_user: postgres_user.present: - name: {{ pillar['postgres.user'] }} - createdb: True - superuser: True - password: {{ pillar['postgres.password'] }} - user: postgres - db_host: localhost + - db_user: postgres /data/run_tracking/db: file.directory: - user: postgres - group: postgres - mode: 744 - makedirs: True /data/run_tracking/indexes: file.directory: - user: postgres - group: postgres - mode: 744 - makedirs: True run_tablespace: postgres_tablespace.present: - name: run_dbspace - owner: {{ pillar['postgres.user'] }} - directory: /data/run_tracking/db - user: postgres butler_indexspace: postgres_tablespace.present: - name: run_indexspace - owner: {{ pillar['postgres.user'] }} - directory: /data/run_tracking/indexes - user: postgres run_tracking_db: postgres_database.present: - name: pillar['run_tracking_db_name'] - owner: {{ pillar['postgres.user'] }} - tablespace: run_dbspace - user: postgres
1
0.022222
1
0
09ad44d687f09a1a6f0ba3efa3eb076ccf46644c
model/src/main/java/pw/scho/battleship/model/Game.java
model/src/main/java/pw/scho/battleship/model/Game.java
package pw.scho.battleship.model; import java.util.UUID; public class Game { private Board firstBoard; private Board secondBoard; private UUID firstPlayerId; private UUID secondPlayerId; private UUID id; public Game() { this.id = UUID.randomUUID(); } public UUID getId() { return id; } public Board getFirstBoard() { return firstBoard; } public void setFirstBoard(Board firstBoard) { this.firstBoard = firstBoard; } public Board getSecondBoard() { return secondBoard; } public void setSecondBoard(Board secondBoard) { this.secondBoard = secondBoard; } public UUID getFirstPlayerId() { return firstPlayerId; } public void setFirstPlayerId(UUID firstPlayerId) { this.firstPlayerId = firstPlayerId; } public UUID getSecondPlayerId() { return secondPlayerId; } public void setSecondPlayerId(UUID secondPlayerId) { this.secondPlayerId = secondPlayerId; } }
package pw.scho.battleship.model; import java.util.UUID; public class Game { private Board firstBoard; private Board secondBoard; private Player firstPlayer; private Player secondPlayer; private UUID id; public Game() { this.id = UUID.randomUUID(); } public Player getSecondPlayer() { return secondPlayer; } public void setSecondPlayer(Player secondPlayer) { this.secondPlayer = secondPlayer; } public Player getFirstPlayer() { return firstPlayer; } public void setFirstPlayer(Player firstPlayer) { this.firstPlayer = firstPlayer; } public UUID getId() { return id; } public Board getFirstBoard() { return firstBoard; } public void setFirstBoard(Board firstBoard) { this.firstBoard = firstBoard; } public Board getSecondBoard() { return secondBoard; } public void setSecondBoard(Board secondBoard) { this.secondBoard = secondBoard; } }
Replace player ids with player objects
Replace player ids with player objects This is no longer needed, since in memory storage keeps all references
Java
mit
scho/battleship,scho/battleship
java
## Code Before: package pw.scho.battleship.model; import java.util.UUID; public class Game { private Board firstBoard; private Board secondBoard; private UUID firstPlayerId; private UUID secondPlayerId; private UUID id; public Game() { this.id = UUID.randomUUID(); } public UUID getId() { return id; } public Board getFirstBoard() { return firstBoard; } public void setFirstBoard(Board firstBoard) { this.firstBoard = firstBoard; } public Board getSecondBoard() { return secondBoard; } public void setSecondBoard(Board secondBoard) { this.secondBoard = secondBoard; } public UUID getFirstPlayerId() { return firstPlayerId; } public void setFirstPlayerId(UUID firstPlayerId) { this.firstPlayerId = firstPlayerId; } public UUID getSecondPlayerId() { return secondPlayerId; } public void setSecondPlayerId(UUID secondPlayerId) { this.secondPlayerId = secondPlayerId; } } ## Instruction: Replace player ids with player objects This is no longer needed, since in memory storage keeps all references ## Code After: package pw.scho.battleship.model; import java.util.UUID; public class Game { private Board firstBoard; private Board secondBoard; private Player firstPlayer; private Player secondPlayer; private UUID id; public Game() { this.id = UUID.randomUUID(); } public Player getSecondPlayer() { return secondPlayer; } public void setSecondPlayer(Player secondPlayer) { this.secondPlayer = secondPlayer; } public Player getFirstPlayer() { return firstPlayer; } public void setFirstPlayer(Player firstPlayer) { this.firstPlayer = firstPlayer; } public UUID getId() { return id; } public Board getFirstBoard() { return firstBoard; } public void setFirstBoard(Board firstBoard) { this.firstBoard = firstBoard; } public Board getSecondBoard() { return secondBoard; } public void setSecondBoard(Board secondBoard) { this.secondBoard = secondBoard; } }
package pw.scho.battleship.model; import java.util.UUID; public class Game { private Board firstBoard; private Board secondBoard; - private UUID firstPlayerId; ? ^^^^ -- + private Player firstPlayer; ? ^^^^^^ - private UUID secondPlayerId; ? ^^^^ -- + private Player secondPlayer; ? ^^^^^^ private UUID id; public Game() { this.id = UUID.randomUUID(); + } + + public Player getSecondPlayer() { + return secondPlayer; + } + + public void setSecondPlayer(Player secondPlayer) { + this.secondPlayer = secondPlayer; + } + + public Player getFirstPlayer() { + return firstPlayer; + } + + public void setFirstPlayer(Player firstPlayer) { + this.firstPlayer = firstPlayer; } public UUID getId() { return id; } public Board getFirstBoard() { return firstBoard; } public void setFirstBoard(Board firstBoard) { this.firstBoard = firstBoard; } public Board getSecondBoard() { return secondBoard; } public void setSecondBoard(Board secondBoard) { this.secondBoard = secondBoard; } - - public UUID getFirstPlayerId() { - return firstPlayerId; - } - - public void setFirstPlayerId(UUID firstPlayerId) { - this.firstPlayerId = firstPlayerId; - } - - public UUID getSecondPlayerId() { - return secondPlayerId; - } - - public void setSecondPlayerId(UUID secondPlayerId) { - this.secondPlayerId = secondPlayerId; - } }
36
0.692308
18
18
46e2ebe38708291ba5e61f2df534f0c61ab40584
locales/ta/email.properties
locales/ta/email.properties
your_gift_help_us=உங்கள் நன்கொடை உலகின் தேவைகளை இணையத்தில் உருவாக்க உதவுகிறது. # Subject line for recurring donations dear_name=வணக்கம் %%முதல்பெயர்%%, first_paragraph_email=மொசில்லாவுக்கு நன்கொடை வழங்கியதற்கு உங்களுக்கு மிக்க நன்றி. உங்கள் அன்பளிப்பு மூலம், ஒரு திறந்த இணையத்தை உருவாக்கும் மற்றும் பாதுகாக்கும் எங்களின் நோக்கம் தொடரும்.
your_gift_help_us=உங்கள் நன்கொடை உலகின் தேவைகளை இணையத்தில் உருவாக்க உதவுகிறது. # Subject line for recurring donations stripe_charge_succeeded_2014_recurring_subject=நீங்கள் தொடர்ந்து மொசில்லாவிற்கு நன்கொடை வழங்கியமைக்கு மிக்க நன்றி. dear_name=வணக்கம் %%முதல்பெயர்%%, first_paragraph_email=மொசில்லாவுக்கு நன்கொடை வழங்கியதற்கு உங்களுக்கு மிக்க நன்றி. உங்கள் அன்பளிப்பு மூலம், ஒரு திறந்த இணையத்தை உருவாக்கும் மற்றும் பாதுகாக்கும் எங்களின் நோக்கம் தொடரும்.
Update Tamil (ta) localization of Fundraising
Pontoon: Update Tamil (ta) localization of Fundraising Localization authors: - Arun Kumar|அருண் குமார் <thangam.arunx@gmail.com>
INI
mpl-2.0
mozilla/donate.mozilla.org
ini
## Code Before: your_gift_help_us=உங்கள் நன்கொடை உலகின் தேவைகளை இணையத்தில் உருவாக்க உதவுகிறது. # Subject line for recurring donations dear_name=வணக்கம் %%முதல்பெயர்%%, first_paragraph_email=மொசில்லாவுக்கு நன்கொடை வழங்கியதற்கு உங்களுக்கு மிக்க நன்றி. உங்கள் அன்பளிப்பு மூலம், ஒரு திறந்த இணையத்தை உருவாக்கும் மற்றும் பாதுகாக்கும் எங்களின் நோக்கம் தொடரும். ## Instruction: Pontoon: Update Tamil (ta) localization of Fundraising Localization authors: - Arun Kumar|அருண் குமார் <thangam.arunx@gmail.com> ## Code After: your_gift_help_us=உங்கள் நன்கொடை உலகின் தேவைகளை இணையத்தில் உருவாக்க உதவுகிறது. # Subject line for recurring donations stripe_charge_succeeded_2014_recurring_subject=நீங்கள் தொடர்ந்து மொசில்லாவிற்கு நன்கொடை வழங்கியமைக்கு மிக்க நன்றி. dear_name=வணக்கம் %%முதல்பெயர்%%, first_paragraph_email=மொசில்லாவுக்கு நன்கொடை வழங்கியதற்கு உங்களுக்கு மிக்க நன்றி. உங்கள் அன்பளிப்பு மூலம், ஒரு திறந்த இணையத்தை உருவாக்கும் மற்றும் பாதுகாக்கும் எங்களின் நோக்கம் தொடரும்.
your_gift_help_us=உங்கள் நன்கொடை உலகின் தேவைகளை இணையத்தில் உருவாக்க உதவுகிறது. # Subject line for recurring donations + stripe_charge_succeeded_2014_recurring_subject=நீங்கள் தொடர்ந்து மொசில்லாவிற்கு நன்கொடை வழங்கியமைக்கு மிக்க நன்றி. dear_name=வணக்கம் %%முதல்பெயர்%%, first_paragraph_email=மொசில்லாவுக்கு நன்கொடை வழங்கியதற்கு உங்களுக்கு மிக்க நன்றி. உங்கள் அன்பளிப்பு மூலம், ஒரு திறந்த இணையத்தை உருவாக்கும் மற்றும் பாதுகாக்கும் எங்களின் நோக்கம் தொடரும்.
1
0.2
1
0
7e5e7075a56b484236c3f930c83226eeaf7a099c
README.md
README.md
Google BigQuery API client library ## Installation Add this line to your application's Gemfile: gem 'big_query', github: "yancya/big_query" And then execute: $ bundle Or build and install it yourself as: $ git clone git@github.com:yancya/big_query.git $ cd big_query $ rake install ## Usage ```rb bq = BigQuery.new( key_path: "path_to_secret_key" issuer: "mail@address" ) job = bq.projects.list.first.query( project_id: "name_of_project", sql: "select 1 as a, 2 as b, 3 as c" ) begin result = job.query_results end until result["jobComplete"] result["schema"]["fields"].map{|f| f["name"]}.join(",") #=> "a,b,c" result["rows"].map{|row| row["f"].map{|col| col["v"]}.join(",")} #=> ["1,2,3"] ``` ## Google BigQuery API Reference https://developers.google.com/bigquery/docs/reference/v2/ ## Contributing 1. Fork it ( https://github.com/yancya/big_query/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request
Google BigQuery API client library ## Installation Add this line to your application's Gemfile: gem 'big_query', github: "yancya/big_query" And then execute: $ bundle Or build and install it yourself as: $ git clone git@github.com:yancya/big_query.git $ cd big_query $ rake install ## Usage ```rb bq = BigQuery.new( key_path: "path_to_secret_key" issuer: "mail@address" ) job = bq.jobs.query( project_id: "name_of_project", sql: "select 1 as a, 2 as b, 3 as c" ) begin result = job.query_results end until result["jobComplete"] result["schema"]["fields"].map{|f| f["name"]}.join(",") #=> "a,b,c" result["rows"].map{|row| row["f"].map{|col| col["v"]}.join(",")} #=> ["1,2,3"] ``` ## Google BigQuery API Reference https://developers.google.com/bigquery/docs/reference/v2/ ## Contributing 1. Fork it ( https://github.com/yancya/big_query/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request
Update usage. Query method receiver changed to jobs
Update usage. Query method receiver changed to jobs
Markdown
mit
yancya/big_query
markdown
## Code Before: Google BigQuery API client library ## Installation Add this line to your application's Gemfile: gem 'big_query', github: "yancya/big_query" And then execute: $ bundle Or build and install it yourself as: $ git clone git@github.com:yancya/big_query.git $ cd big_query $ rake install ## Usage ```rb bq = BigQuery.new( key_path: "path_to_secret_key" issuer: "mail@address" ) job = bq.projects.list.first.query( project_id: "name_of_project", sql: "select 1 as a, 2 as b, 3 as c" ) begin result = job.query_results end until result["jobComplete"] result["schema"]["fields"].map{|f| f["name"]}.join(",") #=> "a,b,c" result["rows"].map{|row| row["f"].map{|col| col["v"]}.join(",")} #=> ["1,2,3"] ``` ## Google BigQuery API Reference https://developers.google.com/bigquery/docs/reference/v2/ ## Contributing 1. Fork it ( https://github.com/yancya/big_query/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request ## Instruction: Update usage. Query method receiver changed to jobs ## Code After: Google BigQuery API client library ## Installation Add this line to your application's Gemfile: gem 'big_query', github: "yancya/big_query" And then execute: $ bundle Or build and install it yourself as: $ git clone git@github.com:yancya/big_query.git $ cd big_query $ rake install ## Usage ```rb bq = BigQuery.new( key_path: "path_to_secret_key" issuer: "mail@address" ) job = bq.jobs.query( project_id: "name_of_project", sql: "select 1 as a, 2 as b, 3 as c" ) begin result = job.query_results end until result["jobComplete"] result["schema"]["fields"].map{|f| f["name"]}.join(",") #=> "a,b,c" result["rows"].map{|row| row["f"].map{|col| col["v"]}.join(",")} #=> ["1,2,3"] ``` ## Google BigQuery API Reference https://developers.google.com/bigquery/docs/reference/v2/ ## Contributing 1. Fork it ( https://github.com/yancya/big_query/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request
Google BigQuery API client library ## Installation Add this line to your application's Gemfile: gem 'big_query', github: "yancya/big_query" And then execute: $ bundle Or build and install it yourself as: $ git clone git@github.com:yancya/big_query.git $ cd big_query $ rake install ## Usage ```rb bq = BigQuery.new( key_path: "path_to_secret_key" issuer: "mail@address" ) - job = bq.projects.list.first.query( + job = bq.jobs.query( project_id: "name_of_project", sql: "select 1 as a, 2 as b, 3 as c" ) begin result = job.query_results end until result["jobComplete"] result["schema"]["fields"].map{|f| f["name"]}.join(",") #=> "a,b,c" result["rows"].map{|row| row["f"].map{|col| col["v"]}.join(",")} #=> ["1,2,3"] ``` ## Google BigQuery API Reference https://developers.google.com/bigquery/docs/reference/v2/ ## Contributing 1. Fork it ( https://github.com/yancya/big_query/fork ) 2. Create your feature branch (`git checkout -b my-new-feature`) 3. Commit your changes (`git commit -am 'Add some feature'`) 4. Push to the branch (`git push origin my-new-feature`) 5. Create a new Pull Request
2
0.039216
1
1
4322e295c6524a32cff69502fb1d3304a019611f
graf2d/graf/CMakeLists.txt
graf2d/graf/CMakeLists.txt
set(libname Graf) if(WIN32) set(mathtextlib ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libmathtext.lib) else() set(mathtextlib ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libmathtext.a) endif() ROOT_USE_PACKAGE(core) ROOT_USE_PACKAGE(math/matrix) ROOT_USE_PACKAGE(io/io) ROOT_USE_PACKAGE(graf2d/mathtext) include_directories(${CMAKE_SOURCE_DIR}/hist/hist/inc) # This is to avoid a circular dependency graf <--> hist ROOT_GENERATE_DICTIONARY(G__${libname} *.h LINKDEF LinkDef.h) ROOT_GENERATE_ROOTMAP(${libname} LINKDEF LinkDef.h DEPENDENCIES Hist Matrix MathCore RIO) include_directories(${FREETYPE_INCLUDE_DIRS}) ROOT_LINKER_LIBRARY(${libname} *.cxx G__${libname}.cxx LIBRARIES ${FREETYPE_LIBRARIES} ${mathtextlib} DEPENDENCIES Hist Matrix MathCore RIO) if(builtin_freetype) add_dependencies(${libname} FREETYPE) endif() ROOT_INSTALL_HEADERS()
set(libname Graf) ROOT_USE_PACKAGE(core) ROOT_USE_PACKAGE(math/matrix) ROOT_USE_PACKAGE(io/io) ROOT_USE_PACKAGE(graf2d/mathtext) include_directories(${CMAKE_SOURCE_DIR}/hist/hist/inc) # This is to avoid a circular dependency graf <--> hist ROOT_GENERATE_DICTIONARY(G__${libname} *.h LINKDEF LinkDef.h) ROOT_GENERATE_ROOTMAP(${libname} LINKDEF LinkDef.h DEPENDENCIES Hist Matrix MathCore RIO) include_directories(${FREETYPE_INCLUDE_DIRS}) ROOT_LINKER_LIBRARY(${libname} *.cxx G__${libname}.cxx LIBRARIES ${FREETYPE_LIBRARIES} mathtext DEPENDENCIES Hist Matrix MathCore RIO) if(builtin_freetype) add_dependencies(${libname} FREETYPE) endif() ROOT_INSTALL_HEADERS()
Revert the last changes. According to Pere it should be like this.
Revert the last changes. According to Pere it should be like this. git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@46976 27541ba8-7e3a-0410-8455-c3a389f83636
Text
lgpl-2.1
bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT,bbannier/ROOT
text
## Code Before: set(libname Graf) if(WIN32) set(mathtextlib ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libmathtext.lib) else() set(mathtextlib ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libmathtext.a) endif() ROOT_USE_PACKAGE(core) ROOT_USE_PACKAGE(math/matrix) ROOT_USE_PACKAGE(io/io) ROOT_USE_PACKAGE(graf2d/mathtext) include_directories(${CMAKE_SOURCE_DIR}/hist/hist/inc) # This is to avoid a circular dependency graf <--> hist ROOT_GENERATE_DICTIONARY(G__${libname} *.h LINKDEF LinkDef.h) ROOT_GENERATE_ROOTMAP(${libname} LINKDEF LinkDef.h DEPENDENCIES Hist Matrix MathCore RIO) include_directories(${FREETYPE_INCLUDE_DIRS}) ROOT_LINKER_LIBRARY(${libname} *.cxx G__${libname}.cxx LIBRARIES ${FREETYPE_LIBRARIES} ${mathtextlib} DEPENDENCIES Hist Matrix MathCore RIO) if(builtin_freetype) add_dependencies(${libname} FREETYPE) endif() ROOT_INSTALL_HEADERS() ## Instruction: Revert the last changes. According to Pere it should be like this. git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@46976 27541ba8-7e3a-0410-8455-c3a389f83636 ## Code After: set(libname Graf) ROOT_USE_PACKAGE(core) ROOT_USE_PACKAGE(math/matrix) ROOT_USE_PACKAGE(io/io) ROOT_USE_PACKAGE(graf2d/mathtext) include_directories(${CMAKE_SOURCE_DIR}/hist/hist/inc) # This is to avoid a circular dependency graf <--> hist ROOT_GENERATE_DICTIONARY(G__${libname} *.h LINKDEF LinkDef.h) ROOT_GENERATE_ROOTMAP(${libname} LINKDEF LinkDef.h DEPENDENCIES Hist Matrix MathCore RIO) include_directories(${FREETYPE_INCLUDE_DIRS}) ROOT_LINKER_LIBRARY(${libname} *.cxx G__${libname}.cxx LIBRARIES ${FREETYPE_LIBRARIES} mathtext DEPENDENCIES Hist Matrix MathCore RIO) if(builtin_freetype) add_dependencies(${libname} FREETYPE) endif() ROOT_INSTALL_HEADERS()
set(libname Graf) - - if(WIN32) - set(mathtextlib ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libmathtext.lib) - else() - set(mathtextlib ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libmathtext.a) - endif() ROOT_USE_PACKAGE(core) ROOT_USE_PACKAGE(math/matrix) ROOT_USE_PACKAGE(io/io) ROOT_USE_PACKAGE(graf2d/mathtext) include_directories(${CMAKE_SOURCE_DIR}/hist/hist/inc) # This is to avoid a circular dependency graf <--> hist ROOT_GENERATE_DICTIONARY(G__${libname} *.h LINKDEF LinkDef.h) ROOT_GENERATE_ROOTMAP(${libname} LINKDEF LinkDef.h DEPENDENCIES Hist Matrix MathCore RIO) include_directories(${FREETYPE_INCLUDE_DIRS}) - ROOT_LINKER_LIBRARY(${libname} *.cxx G__${libname}.cxx LIBRARIES ${FREETYPE_LIBRARIES} ${mathtextlib} DEPENDENCIES Hist Matrix MathCore RIO) ? -- ---- + ROOT_LINKER_LIBRARY(${libname} *.cxx G__${libname}.cxx LIBRARIES ${FREETYPE_LIBRARIES} mathtext DEPENDENCIES Hist Matrix MathCore RIO) if(builtin_freetype) add_dependencies(${libname} FREETYPE) endif() ROOT_INSTALL_HEADERS()
8
0.307692
1
7
54498cb23b8b3e50e9dad44cbd8509916e917ae3
test/select.js
test/select.js
var test = require("tape") var h = require("hyperscript") var FormData = require("../index") test("FormData works with <select> elements", function (assert) { var elements = { foo: h("select", [ h("option", { value: "one" }) , h("option", { value: "two", selected: true }) , h("option", { value: "three" }) ]) } var data = FormData(elements) assert.deepEqual(data, { foo: "two" }) assert.end() })
var test = require("tape") var h = require("hyperscript") var FormData = require("../index") var getFormData = require("../element") test("FormData works with <select> elements", function (assert) { var elements = { foo: h("select", [ h("option", { value: "one" }) , h("option", { value: "two", selected: true }) , h("option", { value: "three" }) ]) } var data = FormData(elements) assert.deepEqual(data, { foo: "two" }) assert.end() }) test("getFormData works when root element has a name", function(assert) { var element = h("select", { name: "foo" }, [ h("option", { value: "one" }) , h("option", { value: "two", selected: true }) ]) var data = getFormData(element) assert.deepEqual(data, { foo: "two" }) assert.end() })
Add test for rootElm with name prop fix.
Add test for rootElm with name prop fix.
JavaScript
mit
Raynos/form-data-set
javascript
## Code Before: var test = require("tape") var h = require("hyperscript") var FormData = require("../index") test("FormData works with <select> elements", function (assert) { var elements = { foo: h("select", [ h("option", { value: "one" }) , h("option", { value: "two", selected: true }) , h("option", { value: "three" }) ]) } var data = FormData(elements) assert.deepEqual(data, { foo: "two" }) assert.end() }) ## Instruction: Add test for rootElm with name prop fix. ## Code After: var test = require("tape") var h = require("hyperscript") var FormData = require("../index") var getFormData = require("../element") test("FormData works with <select> elements", function (assert) { var elements = { foo: h("select", [ h("option", { value: "one" }) , h("option", { value: "two", selected: true }) , h("option", { value: "three" }) ]) } var data = FormData(elements) assert.deepEqual(data, { foo: "two" }) assert.end() }) test("getFormData works when root element has a name", function(assert) { var element = h("select", { name: "foo" }, [ h("option", { value: "one" }) , h("option", { value: "two", selected: true }) ]) var data = getFormData(element) assert.deepEqual(data, { foo: "two" }) assert.end() })
var test = require("tape") var h = require("hyperscript") var FormData = require("../index") + var getFormData = require("../element") test("FormData works with <select> elements", function (assert) { var elements = { foo: h("select", [ h("option", { value: "one" }) , h("option", { value: "two", selected: true }) , h("option", { value: "three" }) ]) } var data = FormData(elements) assert.deepEqual(data, { foo: "two" }) assert.end() }) + + test("getFormData works when root element has a name", function(assert) { + var element = h("select", { + name: "foo" + }, [ + h("option", { value: "one" }) + , h("option", { value: "two", selected: true }) + ]) + + var data = getFormData(element) + + assert.deepEqual(data, { + foo: "two" + }) + + assert.end() + })
18
0.818182
18
0
7fd5c11fa7984982f343f4c5db2594e96f27fa29
plasmoid/contents/ui/Player.qml
plasmoid/contents/ui/Player.qml
import QtQuick 2.8 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.4 import org.kde.plasma.components 3.0 as PC import "controls" ColumnLayout { spacing: 1 Layout.margins: units.smallSpacing Layout.preferredWidth: parent.width property bool showTrackSlider: true property bool showVolumeSlider: true property bool showStopButton: true // playback controls RowLayout { spacing: 1 PC.ToolButton { icon.name: 'configure' onClicked: zoneMenu.open(this) } PrevButton { Layout.leftMargin: 15 } PlayPauseButton {} StopButton { visible: showStopButton } NextButton {} VolumeControl { showSlider: showVolumeSlider } } // track pos TrackPosControl { showSlider: showTrackSlider showLabel: showTrackSlider } }
import QtQuick 2.8 import QtQuick.Layouts 1.3 import org.kde.plasma.components 3.0 as PC import "controls" // playback controls RowLayout { property bool showVolumeSlider: true property bool showStopButton: true spacing: 0 PC.ToolButton { icon.name: 'configure' onClicked: zoneMenu.open(this) } PrevButton {} PlayPauseButton {} StopButton { visible: showStopButton } NextButton {} VolumeControl { showSlider: showVolumeSlider } }
Remove track pos control, reformat layouts
Remove track pos control, reformat layouts
QML
mit
noee/mcwsplasmoid
qml
## Code Before: import QtQuick 2.8 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.4 import org.kde.plasma.components 3.0 as PC import "controls" ColumnLayout { spacing: 1 Layout.margins: units.smallSpacing Layout.preferredWidth: parent.width property bool showTrackSlider: true property bool showVolumeSlider: true property bool showStopButton: true // playback controls RowLayout { spacing: 1 PC.ToolButton { icon.name: 'configure' onClicked: zoneMenu.open(this) } PrevButton { Layout.leftMargin: 15 } PlayPauseButton {} StopButton { visible: showStopButton } NextButton {} VolumeControl { showSlider: showVolumeSlider } } // track pos TrackPosControl { showSlider: showTrackSlider showLabel: showTrackSlider } } ## Instruction: Remove track pos control, reformat layouts ## Code After: import QtQuick 2.8 import QtQuick.Layouts 1.3 import org.kde.plasma.components 3.0 as PC import "controls" // playback controls RowLayout { property bool showVolumeSlider: true property bool showStopButton: true spacing: 0 PC.ToolButton { icon.name: 'configure' onClicked: zoneMenu.open(this) } PrevButton {} PlayPauseButton {} StopButton { visible: showStopButton } NextButton {} VolumeControl { showSlider: showVolumeSlider } }
import QtQuick 2.8 import QtQuick.Layouts 1.3 - import QtQuick.Controls 2.4 import org.kde.plasma.components 3.0 as PC import "controls" + // playback controls + RowLayout { - ColumnLayout { - spacing: 1 - Layout.margins: units.smallSpacing - Layout.preferredWidth: parent.width - - property bool showTrackSlider: true property bool showVolumeSlider: true property bool showStopButton: true - // playback controls - RowLayout { - spacing: 1 + spacing: 0 - PC.ToolButton { - icon.name: 'configure' - onClicked: zoneMenu.open(this) - } + PC.ToolButton { + icon.name: 'configure' + onClicked: zoneMenu.open(this) - PrevButton { Layout.leftMargin: 15 } - PlayPauseButton {} - StopButton { visible: showStopButton } - NextButton {} - VolumeControl { showSlider: showVolumeSlider } } - // track pos - TrackPosControl { - showSlider: showTrackSlider - showLabel: showTrackSlider - } + PrevButton {} + PlayPauseButton {} + StopButton { visible: showStopButton } + NextButton {} + VolumeControl { showSlider: showVolumeSlider } }
35
1
11
24
ddf225c2c0b35718277a3f2b88d83e30dcbd5817
README.md
README.md
This project is a quick attempt at beginning to replace built-in GWT generators with APT code generation, allowing the javac process to do the code generation up front and out of the gwtc process. In theory this should give compilation to JS a bit less to worry about. This code relies on the `<generate-with>` statements to remain in GWT, and assumes that they will continue to generate to the same class. That assumption lets us generate code, and lets the old GWT Generator see that its work has already been done - use code does not need to change at all, it can still call `GWT.create(MyTemplate.class)` to get a real implementation. Projects that use this will need to be sure that their `target/generated-sources/annotations` directory is available for gwtc compilation.
Migration of GWT 2.x's SafeHtml packages to an external project, including rewriting the Generator into an annotation process for use in general Java, not just within GWT client code. The processor was written before I really knew what I was doing, and it needs another look before usage in real projects. Before this gets to 1.0, a deep look should be taken at the differences and similarities between this and https://github.com/google/safe-html-types/, looking for opportunities for reuse and code sharing. At this point, tests pass and it appears usable, but additional GwtTestCases would be good to have. SafeCss needs to be migrated out as well, and this annotation processor should switch to generally available versions of the html parser to properly eliminated dependencies on upstream GWT.
Update readme for new upstream
Update readme for new upstream
Markdown
apache-2.0
gwtproject/gwt-safehtml
markdown
## Code Before: This project is a quick attempt at beginning to replace built-in GWT generators with APT code generation, allowing the javac process to do the code generation up front and out of the gwtc process. In theory this should give compilation to JS a bit less to worry about. This code relies on the `<generate-with>` statements to remain in GWT, and assumes that they will continue to generate to the same class. That assumption lets us generate code, and lets the old GWT Generator see that its work has already been done - use code does not need to change at all, it can still call `GWT.create(MyTemplate.class)` to get a real implementation. Projects that use this will need to be sure that their `target/generated-sources/annotations` directory is available for gwtc compilation. ## Instruction: Update readme for new upstream ## Code After: Migration of GWT 2.x's SafeHtml packages to an external project, including rewriting the Generator into an annotation process for use in general Java, not just within GWT client code. The processor was written before I really knew what I was doing, and it needs another look before usage in real projects. Before this gets to 1.0, a deep look should be taken at the differences and similarities between this and https://github.com/google/safe-html-types/, looking for opportunities for reuse and code sharing. At this point, tests pass and it appears usable, but additional GwtTestCases would be good to have. SafeCss needs to be migrated out as well, and this annotation processor should switch to generally available versions of the html parser to properly eliminated dependencies on upstream GWT.
+ Migration of GWT 2.x's SafeHtml packages to an external project, including rewriting + the Generator into an annotation process for use in general Java, not just within + GWT client code. - This project is a quick attempt at beginning to replace built-in GWT generators - with APT code generation, allowing the javac process to do the code generation - up front and out of the gwtc process. In theory this should give compilation - to JS a bit less to worry about. + The processor was written before I really knew what I was doing, and it needs another + look before usage in real projects. - This code relies on the `<generate-with>` statements to remain in GWT, and - assumes that they will continue to generate to the same class. That assumption - lets us generate code, and lets the old GWT Generator see that its work has - already been done - use code does not need to change at all, it can still - call `GWT.create(MyTemplate.class)` to get a real implementation. - Projects that use this will need to be sure that their - `target/generated-sources/annotations` directory is available for gwtc - compilation. + Before this gets to 1.0, a deep look should be taken at the differences and + similarities between this and https://github.com/google/safe-html-types/, looking for + opportunities for reuse and code sharing. + + At this point, tests pass and it appears usable, but additional GwtTestCases would + be good to have. SafeCss needs to be migrated out as well, and this annotation + processor should switch to generally available versions of the html parser to + properly eliminated dependencies on upstream GWT.
25
1.785714
13
12
f48a90459287da81a3d9ecd0681af44b4c2a6e77
src/adhocracy/templates/plain.html
src/adhocracy/templates/plain.html
<%namespace name="model" module="adhocracy.model" /><%namespace name="components" file="/components.html" /><!DOCTYPE html> <html> <head> ${components.head()} <link rel="stylesheet" type="text/css" href="${h.base_url('/style/plain.css', None)}" /> </head> <body lang="${c.locale.language}"> <div id="frame"> <div id="page"> <div class="content"> ${self.body()} <div style="clear: both;"></div> </div> </div> </div> <%include file="piwik.html"/> </body> </html>
<%namespace name="model" module="adhocracy.model" /><%namespace name="components" file="/components.html" /><!DOCTYPE html> <html> <head> ${components.head(self.title)} <link rel="stylesheet" type="text/css" href="${h.base_url('/style/plain.css', None)}" /> </head> <body lang="${c.locale.language}"> <div id="frame"> <div id="page"> <div class="content"> ${self.body()} <div style="clear: both;"></div> </div> </div> </div> <%include file="piwik.html"/> </body> </html>
Fix simple formatted static page view
Fix simple formatted static page view This got accidently broken in db968b18f77cbb5af073623ef0f09549a9694624.
HTML
agpl-3.0
alkadis/vcv,phihag/adhocracy,alkadis/vcv,phihag/adhocracy,DanielNeugebauer/adhocracy,DanielNeugebauer/adhocracy,alkadis/vcv,phihag/adhocracy,liqd/adhocracy,DanielNeugebauer/adhocracy,DanielNeugebauer/adhocracy,liqd/adhocracy,liqd/adhocracy,phihag/adhocracy,alkadis/vcv,phihag/adhocracy,SysTheron/adhocracy,SysTheron/adhocracy,DanielNeugebauer/adhocracy,liqd/adhocracy,alkadis/vcv,SysTheron/adhocracy
html
## Code Before: <%namespace name="model" module="adhocracy.model" /><%namespace name="components" file="/components.html" /><!DOCTYPE html> <html> <head> ${components.head()} <link rel="stylesheet" type="text/css" href="${h.base_url('/style/plain.css', None)}" /> </head> <body lang="${c.locale.language}"> <div id="frame"> <div id="page"> <div class="content"> ${self.body()} <div style="clear: both;"></div> </div> </div> </div> <%include file="piwik.html"/> </body> </html> ## Instruction: Fix simple formatted static page view This got accidently broken in db968b18f77cbb5af073623ef0f09549a9694624. ## Code After: <%namespace name="model" module="adhocracy.model" /><%namespace name="components" file="/components.html" /><!DOCTYPE html> <html> <head> ${components.head(self.title)} <link rel="stylesheet" type="text/css" href="${h.base_url('/style/plain.css', None)}" /> </head> <body lang="${c.locale.language}"> <div id="frame"> <div id="page"> <div class="content"> ${self.body()} <div style="clear: both;"></div> </div> </div> </div> <%include file="piwik.html"/> </body> </html>
<%namespace name="model" module="adhocracy.model" /><%namespace name="components" file="/components.html" /><!DOCTYPE html> <html> <head> - ${components.head()} + ${components.head(self.title)} ? ++++++++++ <link rel="stylesheet" type="text/css" href="${h.base_url('/style/plain.css', None)}" /> </head> <body lang="${c.locale.language}"> <div id="frame"> <div id="page"> <div class="content"> ${self.body()} <div style="clear: both;"></div> </div> </div> </div> <%include file="piwik.html"/> </body> </html>
2
0.086957
1
1
bde2904e2639ae99192d499983add186eb3a0fcd
cookbooks/homebrew/recipes/brew.rb
cookbooks/homebrew/recipes/brew.rb
brew 'awscli' brew 'circleci' brew 'colordiff' brew 'coreutils' brew 'direnv' brew 'exa' brew 'fd' brew 'fish' brew 'fzf' brew 'gh' brew 'ghq' brew 'git' brew 'git-secrets' brew 'github-nippou' brew 'glow' brew 'gnupg' brew 'go' brew 'helm' brew 'heroku' brew 'hub' brew 'ipcalc' brew 'jq' brew 'krew' brew 'kubectl' { directory_name 'kubernetes-cli' } brew 'lua-language-server' brew 'mas' brew 'minikube' brew 'neovim' { head true } brew 'node' brew 'packer' brew 'pinentry-mac' brew 'pstree' brew 'python' { use_cellar_option true } brew 'ripgrep' brew 'ruby' brew 'rust-analyzer' brew 'rustup-init' brew 's3-edit' brew 'stern' brew 'terminal-notifier' brew 'terraform' brew 'terraform-ls' brew 'tflint' brew 'tig' brew 'tmux' brew 'tree' brew 'typescript' brew 'watch' brew 'whalebrew' brew 'yamlls' brew 'yarn'
brew 'awscli' brew 'circleci' brew 'colordiff' brew 'coreutils' brew 'direnv' brew 'exa' brew 'fd' brew 'fish' brew 'fzf' brew 'gh' brew 'ghq' brew 'git' brew 'git-secrets' brew 'github-nippou' brew 'glow' brew 'gnupg' brew 'go' brew 'helm' brew 'heroku' brew 'hub' brew 'ipcalc' brew 'jq' brew 'krew' brew 'kubectl' { directory_name 'kubernetes-cli' } brew 'lua-language-server' brew 'mas' brew 'minikube' brew 'neovim' { head true } brew 'node' brew 'packer' brew 'php' brew 'pinentry-mac' brew 'pstree' brew 'python' { use_cellar_option true } brew 'ripgrep' brew 'ruby' brew 'rust-analyzer' brew 'rustup-init' brew 's3-edit' brew 'stern' brew 'terminal-notifier' brew 'terraform' brew 'terraform-ls' brew 'tflint' brew 'tig' brew 'tmux' brew 'tree' brew 'typescript' brew 'watch' brew 'whalebrew' brew 'yamlls' brew 'yarn'
Install php for macOS Monterey
Install php for macOS Monterey PHP requires in alfred-github-workflow
Ruby
mit
tsub/dotfiles,tsub/dotfiles,tsub/dotfiles,tsub/dotfiles,tsub/dotfiles
ruby
## Code Before: brew 'awscli' brew 'circleci' brew 'colordiff' brew 'coreutils' brew 'direnv' brew 'exa' brew 'fd' brew 'fish' brew 'fzf' brew 'gh' brew 'ghq' brew 'git' brew 'git-secrets' brew 'github-nippou' brew 'glow' brew 'gnupg' brew 'go' brew 'helm' brew 'heroku' brew 'hub' brew 'ipcalc' brew 'jq' brew 'krew' brew 'kubectl' { directory_name 'kubernetes-cli' } brew 'lua-language-server' brew 'mas' brew 'minikube' brew 'neovim' { head true } brew 'node' brew 'packer' brew 'pinentry-mac' brew 'pstree' brew 'python' { use_cellar_option true } brew 'ripgrep' brew 'ruby' brew 'rust-analyzer' brew 'rustup-init' brew 's3-edit' brew 'stern' brew 'terminal-notifier' brew 'terraform' brew 'terraform-ls' brew 'tflint' brew 'tig' brew 'tmux' brew 'tree' brew 'typescript' brew 'watch' brew 'whalebrew' brew 'yamlls' brew 'yarn' ## Instruction: Install php for macOS Monterey PHP requires in alfred-github-workflow ## Code After: brew 'awscli' brew 'circleci' brew 'colordiff' brew 'coreutils' brew 'direnv' brew 'exa' brew 'fd' brew 'fish' brew 'fzf' brew 'gh' brew 'ghq' brew 'git' brew 'git-secrets' brew 'github-nippou' brew 'glow' brew 'gnupg' brew 'go' brew 'helm' brew 'heroku' brew 'hub' brew 'ipcalc' brew 'jq' brew 'krew' brew 'kubectl' { directory_name 'kubernetes-cli' } brew 'lua-language-server' brew 'mas' brew 'minikube' brew 'neovim' { head true } brew 'node' brew 'packer' brew 'php' brew 'pinentry-mac' brew 'pstree' brew 'python' { use_cellar_option true } brew 'ripgrep' brew 'ruby' brew 'rust-analyzer' brew 'rustup-init' brew 's3-edit' brew 'stern' brew 'terminal-notifier' brew 'terraform' brew 'terraform-ls' brew 'tflint' brew 'tig' brew 'tmux' brew 'tree' brew 'typescript' brew 'watch' brew 'whalebrew' brew 'yamlls' brew 'yarn'
brew 'awscli' brew 'circleci' brew 'colordiff' brew 'coreutils' brew 'direnv' brew 'exa' brew 'fd' brew 'fish' brew 'fzf' brew 'gh' brew 'ghq' brew 'git' brew 'git-secrets' brew 'github-nippou' brew 'glow' brew 'gnupg' brew 'go' brew 'helm' brew 'heroku' brew 'hub' brew 'ipcalc' brew 'jq' brew 'krew' brew 'kubectl' { directory_name 'kubernetes-cli' } brew 'lua-language-server' brew 'mas' brew 'minikube' brew 'neovim' { head true } brew 'node' brew 'packer' + brew 'php' brew 'pinentry-mac' brew 'pstree' brew 'python' { use_cellar_option true } brew 'ripgrep' brew 'ruby' brew 'rust-analyzer' brew 'rustup-init' brew 's3-edit' brew 'stern' brew 'terminal-notifier' brew 'terraform' brew 'terraform-ls' brew 'tflint' brew 'tig' brew 'tmux' brew 'tree' brew 'typescript' brew 'watch' brew 'whalebrew' brew 'yamlls' brew 'yarn'
1
0.019608
1
0
6a22861f4c52a420b3bb9adc21e1199b81cee985
lib/msgr.rb
lib/msgr.rb
require 'msgr/version' require 'celluloid' require 'active_support' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/module/delegation' require 'active_support/core_ext/string/inflections' require 'msgr/logging' require 'msgr/binding' require 'msgr/client' require 'msgr/connection' require 'msgr/consumer' require 'msgr/dispatcher' require 'msgr/errors' require 'msgr/message' require 'msgr/pool' require 'msgr/route' require 'msgr/routes' require 'msgr/railtie' if defined? Rails module Msgr class << self def logger @logger ||= Logger.new($stdout).tap do |logger| logger.level = Logger::Severity::INFO end end def logger=(logger) @logger = logger end def start # stub end def publish # stub end end end
require 'msgr/version' require 'celluloid' require 'active_support' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/module/delegation' require 'active_support/core_ext/string/inflections' require 'active_support/core_ext/hash/reverse_merge' require 'msgr/logging' require 'msgr/binding' require 'msgr/client' require 'msgr/connection' require 'msgr/consumer' require 'msgr/dispatcher' require 'msgr/errors' require 'msgr/message' require 'msgr/pool' require 'msgr/route' require 'msgr/routes' require 'msgr/railtie' if defined? Rails module Msgr class << self attr_accessor :client delegate :publish, to: :client def logger if @logger.nil? @logger = Logger.new $stdout @logger.level = Logger::Severity::INFO end @logger end def logger=(logger) @logger = logger end end end
Improve logger setting. Set to false to disable logging.
Improve logger setting. Set to false to disable logging.
Ruby
mit
jgraichen/msgr,jgraichen/msgr
ruby
## Code Before: require 'msgr/version' require 'celluloid' require 'active_support' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/module/delegation' require 'active_support/core_ext/string/inflections' require 'msgr/logging' require 'msgr/binding' require 'msgr/client' require 'msgr/connection' require 'msgr/consumer' require 'msgr/dispatcher' require 'msgr/errors' require 'msgr/message' require 'msgr/pool' require 'msgr/route' require 'msgr/routes' require 'msgr/railtie' if defined? Rails module Msgr class << self def logger @logger ||= Logger.new($stdout).tap do |logger| logger.level = Logger::Severity::INFO end end def logger=(logger) @logger = logger end def start # stub end def publish # stub end end end ## Instruction: Improve logger setting. Set to false to disable logging. ## Code After: require 'msgr/version' require 'celluloid' require 'active_support' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/module/delegation' require 'active_support/core_ext/string/inflections' require 'active_support/core_ext/hash/reverse_merge' require 'msgr/logging' require 'msgr/binding' require 'msgr/client' require 'msgr/connection' require 'msgr/consumer' require 'msgr/dispatcher' require 'msgr/errors' require 'msgr/message' require 'msgr/pool' require 'msgr/route' require 'msgr/routes' require 'msgr/railtie' if defined? Rails module Msgr class << self attr_accessor :client delegate :publish, to: :client def logger if @logger.nil? @logger = Logger.new $stdout @logger.level = Logger::Severity::INFO end @logger end def logger=(logger) @logger = logger end end end
require 'msgr/version' require 'celluloid' require 'active_support' require 'active_support/core_ext/object/blank' require 'active_support/core_ext/module/delegation' require 'active_support/core_ext/string/inflections' + require 'active_support/core_ext/hash/reverse_merge' require 'msgr/logging' require 'msgr/binding' require 'msgr/client' require 'msgr/connection' require 'msgr/consumer' require 'msgr/dispatcher' require 'msgr/errors' require 'msgr/message' require 'msgr/pool' require 'msgr/route' require 'msgr/routes' require 'msgr/railtie' if defined? Rails module Msgr class << self + attr_accessor :client + delegate :publish, to: :client + def logger - @logger ||= Logger.new($stdout).tap do |logger| + if @logger.nil? + @logger = Logger.new $stdout - logger.level = Logger::Severity::INFO + @logger.level = Logger::Severity::INFO ? + end + + @logger end def logger=(logger) @logger = logger end - - def start - # stub - end - - def publish - # stub - end end end
19
0.44186
9
10
21c7232081483c05752e6db3d60692a04d482d24
dakota/tests/test_dakota_base.py
dakota/tests/test_dakota_base.py
import os import filecmp from nose.tools import * from dakota.dakota_base import DakotaBase # Fixtures ------------------------------------------------------------- def setup_module(): """Called before any tests are performed.""" print('\n*** DakotaBase tests') def teardown_module(): """Called after all tests have completed.""" pass # Tests ---------------------------------------------------------------- @raises(TypeError) def test_instantiate(): """Test whether DakotaBase fails to instantiate.""" d = DakotaBase()
from nose.tools import * from dakota.dakota_base import DakotaBase # Helpers -------------------------------------------------------------- class Concrete(DakotaBase): """A subclass of DakotaBase used for testing.""" def __init__(self): DakotaBase.__init__(self) # Fixtures ------------------------------------------------------------- def setup_module(): """Called before any tests are performed.""" print('\n*** DakotaBase tests') global c c = Concrete() def teardown_module(): """Called after all tests have completed.""" pass # Tests ---------------------------------------------------------------- @raises(TypeError) def test_instantiate(): """Test whether DakotaBase fails to instantiate.""" d = DakotaBase() def test_environment_block(): """Test type of environment_block method results.""" s = c.environment_block() assert_true(type(s) is str) def test_method_block(): """Test type of method_block method results.""" s = c.method_block() assert_true(type(s) is str) def test_variables_block(): """Test type of variables_block method results.""" s = c.variables_block() assert_true(type(s) is str) def test_interface_block(): """Test type of interface_block method results.""" s = c.interface_block() assert_true(type(s) is str) def test_responses_block(): """Test type of responses_block method results.""" s = c.responses_block() assert_true(type(s) is str) def test_autogenerate_descriptors(): """Test autogenerate_descriptors method.""" c.n_variables, c.n_responses = 1, 1 c.autogenerate_descriptors() assert_true(len(c.variable_descriptors) == 1) assert_true(len(c.response_descriptors) == 1)
Add tests for dakota.dakota_base module
Add tests for dakota.dakota_base module Make a subclass of DakotaBase to use for testing. Add tests for the "block" sections used to define an input file.
Python
mit
csdms/dakota,csdms/dakota
python
## Code Before: import os import filecmp from nose.tools import * from dakota.dakota_base import DakotaBase # Fixtures ------------------------------------------------------------- def setup_module(): """Called before any tests are performed.""" print('\n*** DakotaBase tests') def teardown_module(): """Called after all tests have completed.""" pass # Tests ---------------------------------------------------------------- @raises(TypeError) def test_instantiate(): """Test whether DakotaBase fails to instantiate.""" d = DakotaBase() ## Instruction: Add tests for dakota.dakota_base module Make a subclass of DakotaBase to use for testing. Add tests for the "block" sections used to define an input file. ## Code After: from nose.tools import * from dakota.dakota_base import DakotaBase # Helpers -------------------------------------------------------------- class Concrete(DakotaBase): """A subclass of DakotaBase used for testing.""" def __init__(self): DakotaBase.__init__(self) # Fixtures ------------------------------------------------------------- def setup_module(): """Called before any tests are performed.""" print('\n*** DakotaBase tests') global c c = Concrete() def teardown_module(): """Called after all tests have completed.""" pass # Tests ---------------------------------------------------------------- @raises(TypeError) def test_instantiate(): """Test whether DakotaBase fails to instantiate.""" d = DakotaBase() def test_environment_block(): """Test type of environment_block method results.""" s = c.environment_block() assert_true(type(s) is str) def test_method_block(): """Test type of method_block method results.""" s = c.method_block() assert_true(type(s) is str) def test_variables_block(): """Test type of variables_block method results.""" s = c.variables_block() assert_true(type(s) is str) def test_interface_block(): """Test type of interface_block method results.""" s = c.interface_block() assert_true(type(s) is str) def test_responses_block(): """Test type of responses_block method results.""" s = c.responses_block() assert_true(type(s) is str) def test_autogenerate_descriptors(): """Test autogenerate_descriptors method.""" c.n_variables, c.n_responses = 1, 1 c.autogenerate_descriptors() assert_true(len(c.variable_descriptors) == 1) assert_true(len(c.response_descriptors) == 1)
- import os - import filecmp from nose.tools import * from dakota.dakota_base import DakotaBase + # Helpers -------------------------------------------------------------- + + class Concrete(DakotaBase): + """A subclass of DakotaBase used for testing.""" + def __init__(self): + DakotaBase.__init__(self) # Fixtures ------------------------------------------------------------- def setup_module(): """Called before any tests are performed.""" print('\n*** DakotaBase tests') + global c + c = Concrete() def teardown_module(): """Called after all tests have completed.""" pass # Tests ---------------------------------------------------------------- @raises(TypeError) def test_instantiate(): """Test whether DakotaBase fails to instantiate.""" d = DakotaBase() + + def test_environment_block(): + """Test type of environment_block method results.""" + s = c.environment_block() + assert_true(type(s) is str) + + def test_method_block(): + """Test type of method_block method results.""" + s = c.method_block() + assert_true(type(s) is str) + + def test_variables_block(): + """Test type of variables_block method results.""" + s = c.variables_block() + assert_true(type(s) is str) + + def test_interface_block(): + """Test type of interface_block method results.""" + s = c.interface_block() + assert_true(type(s) is str) + + def test_responses_block(): + """Test type of responses_block method results.""" + s = c.responses_block() + assert_true(type(s) is str) + + def test_autogenerate_descriptors(): + """Test autogenerate_descriptors method.""" + c.n_variables, c.n_responses = 1, 1 + c.autogenerate_descriptors() + assert_true(len(c.variable_descriptors) == 1) + assert_true(len(c.response_descriptors) == 1)
42
1.826087
40
2
a8651f175b12c7a8a893ca357bb42f4c18ade53e
app/views/spree/users/_card_admin.html.erb
app/views/spree/users/_card_admin.html.erb
<%= content_for :head do %> <%= javascript_tag do -%> <%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> <% end -%> <% end %> <% if @cards.present? %> <div id='card_notice'></div> <h2>Credit Cards on File</h2> <p class="field"> <table class="existing-credit-card-list" style="width:545px;"> <thead> <tr> <th>Card Number(last four)</th> <th>Exp Month</th> <th>Exp Year</th> <th></th> </tr> </thead> <tbody> <% @cards.each do |card| %> <tr id="<%= spree_dom_id(card)%>" class="<%= cycle('even', 'odd') %>"> <td align="center"><%= card.last_digits %></td> <td align="center"><%= card.month %></td> <td align="center"><%= card.year %></td> <td> <%= link_to (icon('delete') + ' ' + t(:delete)), spree.credit_card_url(card), :remote => true, :method => :delete, :confirm => 'Are you sure?' %> </td> </tr> <% end %> </tbody> </table> </p> <% end %>
<%= content_for :head do %> <%= javascript_tag do -%> <%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> <% end -%> <% end %> <% if @cards.present? %> <div id='card_notice'></div> <h2>Credit Cards on File</h2> <p class="field"> <table class="existing-credit-card-list" style="width:545px;"> <thead> <tr> <th>Card Number (last four)</th> <th>Exp Month</th> <th>Exp Year</th> <th></th> </tr> </thead> <tbody> <% @cards.each do |card| %> <tr id="<%= spree_dom_id(card)%>" class="<%= cycle('even', 'odd') %>"> <td align="center"><%= card.last_digits %></td> <td align="center"><%= card.month %></td> <td align="center"><%= card.year %></td> <td> <%= link_to (image_tag("icons/delete.png") + " " + t(:delete)), spree.credit_card_url(card), :remote => true, :method => :delete, :confirm => 'Are you sure?' %> </td> </tr> <% end %> </tbody> </table> </p> <% end %>
Clean up _card_admin partial a bit
Clean up _card_admin partial a bit
HTML+ERB
bsd-3-clause
jtapia/spree_reuse_credit_card,hecbuma/spree_reuse_credit_card,jtapia/spree_reuse_credit_card,hecbuma/spree_reuse_credit_card,hecbuma/spree_reuse_credit_card
html+erb
## Code Before: <%= content_for :head do %> <%= javascript_tag do -%> <%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> <% end -%> <% end %> <% if @cards.present? %> <div id='card_notice'></div> <h2>Credit Cards on File</h2> <p class="field"> <table class="existing-credit-card-list" style="width:545px;"> <thead> <tr> <th>Card Number(last four)</th> <th>Exp Month</th> <th>Exp Year</th> <th></th> </tr> </thead> <tbody> <% @cards.each do |card| %> <tr id="<%= spree_dom_id(card)%>" class="<%= cycle('even', 'odd') %>"> <td align="center"><%= card.last_digits %></td> <td align="center"><%= card.month %></td> <td align="center"><%= card.year %></td> <td> <%= link_to (icon('delete') + ' ' + t(:delete)), spree.credit_card_url(card), :remote => true, :method => :delete, :confirm => 'Are you sure?' %> </td> </tr> <% end %> </tbody> </table> </p> <% end %> ## Instruction: Clean up _card_admin partial a bit ## Code After: <%= content_for :head do %> <%= javascript_tag do -%> <%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> <% end -%> <% end %> <% if @cards.present? %> <div id='card_notice'></div> <h2>Credit Cards on File</h2> <p class="field"> <table class="existing-credit-card-list" style="width:545px;"> <thead> <tr> <th>Card Number (last four)</th> <th>Exp Month</th> <th>Exp Year</th> <th></th> </tr> </thead> <tbody> <% @cards.each do |card| %> <tr id="<%= spree_dom_id(card)%>" class="<%= cycle('even', 'odd') %>"> <td align="center"><%= card.last_digits %></td> <td align="center"><%= card.month %></td> <td align="center"><%= card.year %></td> <td> <%= link_to (image_tag("icons/delete.png") + " " + t(:delete)), spree.credit_card_url(card), :remote => true, :method => :delete, :confirm => 'Are you sure?' %> </td> </tr> <% end %> </tbody> </table> </p> <% end %>
<%= content_for :head do %> <%= javascript_tag do -%> <%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %> <% end -%> <% end %> <% if @cards.present? %> <div id='card_notice'></div> <h2>Credit Cards on File</h2> <p class="field"> <table class="existing-credit-card-list" style="width:545px;"> <thead> <tr> - <th>Card Number(last four)</th> + <th>Card Number (last four)</th> ? + <th>Exp Month</th> <th>Exp Year</th> <th></th> </tr> </thead> <tbody> <% @cards.each do |card| %> <tr id="<%= spree_dom_id(card)%>" class="<%= cycle('even', 'odd') %>"> <td align="center"><%= card.last_digits %></td> <td align="center"><%= card.month %></td> <td align="center"><%= card.year %></td> <td> - <%= link_to (icon('delete') + ' ' + t(:delete)), ? ^^ ^ ^ ^ + <%= link_to (image_tag("icons/delete.png") + " " + t(:delete)), ? +++++++++++ ^^ ^^^^^ ^ ^ spree.credit_card_url(card), :remote => true, :method => :delete, :confirm => 'Are you sure?' %> </td> </tr> <% end %> </tbody> </table> </p> <% end %>
4
0.097561
2
2
3602759b633f0643979c8f0970e088f29644b758
icekit/plugins/brightcove/models.py
icekit/plugins/brightcove/models.py
from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from fluent_contents.models import ContentItem try: from django_brightcove.fields import BrightcoveField except ImportError: raise NotImplementedError( _( 'Please install `django_brightcove`to use the icekit.plugins.brightcove plugin.' ) ) @python_2_unicode_compatible class BrightcoveItem(ContentItem): """ Media from brightcove. Brightcove is a video editing and management product which can be found at http://brightcove.com/. They have in built APIs and players. The BrightcoveField is a django specific implementation to allow the embedding of videos. It anticipates the video ID will be used as a lookup value. In the template to be rendered you will need to include: <script type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js" > </script> """ video = BrightcoveField( help_text=_('Provide the video ID from the brightcove video.') ) class Meta: verbose_name = _('Brightcove Video') verbose_name_plural = _('Brightcove Videos') def __str__(self): return str(self.video)
from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from fluent_contents.models import ContentItem try: from django_brightcove.fields import BrightcoveField except ImportError: raise NotImplementedError( _( 'Please install `django_brightcove`to use the icekit.plugins.brightcove plugin.' ) ) @python_2_unicode_compatible class BrightcoveItem(ContentItem): """ Media from brightcove. Brightcove is a video editing and management product which can be found at http://brightcove.com/. They have in built APIs and players. The BrightcoveField is a django specific implementation to allow the embedding of videos. It anticipates the video ID will be used as a lookup value. """ video = BrightcoveField( help_text=_('Provide the video ID from the brightcove video.') ) class Meta: verbose_name = _('Brightcove Video') verbose_name_plural = _('Brightcove Videos') def __str__(self): return str(self.video)
Remove comment as media addition automatically happens.
Remove comment as media addition automatically happens.
Python
mit
ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit
python
## Code Before: from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from fluent_contents.models import ContentItem try: from django_brightcove.fields import BrightcoveField except ImportError: raise NotImplementedError( _( 'Please install `django_brightcove`to use the icekit.plugins.brightcove plugin.' ) ) @python_2_unicode_compatible class BrightcoveItem(ContentItem): """ Media from brightcove. Brightcove is a video editing and management product which can be found at http://brightcove.com/. They have in built APIs and players. The BrightcoveField is a django specific implementation to allow the embedding of videos. It anticipates the video ID will be used as a lookup value. In the template to be rendered you will need to include: <script type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js" > </script> """ video = BrightcoveField( help_text=_('Provide the video ID from the brightcove video.') ) class Meta: verbose_name = _('Brightcove Video') verbose_name_plural = _('Brightcove Videos') def __str__(self): return str(self.video) ## Instruction: Remove comment as media addition automatically happens. ## Code After: from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from fluent_contents.models import ContentItem try: from django_brightcove.fields import BrightcoveField except ImportError: raise NotImplementedError( _( 'Please install `django_brightcove`to use the icekit.plugins.brightcove plugin.' ) ) @python_2_unicode_compatible class BrightcoveItem(ContentItem): """ Media from brightcove. Brightcove is a video editing and management product which can be found at http://brightcove.com/. They have in built APIs and players. The BrightcoveField is a django specific implementation to allow the embedding of videos. It anticipates the video ID will be used as a lookup value. """ video = BrightcoveField( help_text=_('Provide the video ID from the brightcove video.') ) class Meta: verbose_name = _('Brightcove Video') verbose_name_plural = _('Brightcove Videos') def __str__(self): return str(self.video)
from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from fluent_contents.models import ContentItem try: from django_brightcove.fields import BrightcoveField except ImportError: raise NotImplementedError( _( 'Please install `django_brightcove`to use the icekit.plugins.brightcove plugin.' ) ) @python_2_unicode_compatible class BrightcoveItem(ContentItem): """ Media from brightcove. Brightcove is a video editing and management product which can be found at http://brightcove.com/. They have in built APIs and players. The BrightcoveField is a django specific implementation to allow the embedding of videos. It anticipates the video ID will be used as a lookup value. - - In the template to be rendered you will need to include: - <script - type="text/javascript" - src="http://admin.brightcove.com/js/BrightcoveExperiences.js" - > - </script> """ video = BrightcoveField( help_text=_('Provide the video ID from the brightcove video.') ) class Meta: verbose_name = _('Brightcove Video') verbose_name_plural = _('Brightcove Videos') def __str__(self): return str(self.video)
7
0.152174
0
7
51f55de2c2908c5e74e1a1940a54652744f2fcb3
README.md
README.md
Simple Api ========== Simple Json API example. **Pet Project** only.
Simple Api ========== Simple Json API example. **Pet Project** only, used at [Restfolia](https://github.com/rogerleite/restfolia) samples. Install and Usage ----------------- $ git clone $ cd simple_api $ bundle install $ bundle exec rackup Try http://localhost:9292/recursos/busca I recommend to use JSONView extension on Chrome or Firefox.
Install and Usage section on Readme
Install and Usage section on Readme
Markdown
mit
rogerleite/simple_api
markdown
## Code Before: Simple Api ========== Simple Json API example. **Pet Project** only. ## Instruction: Install and Usage section on Readme ## Code After: Simple Api ========== Simple Json API example. **Pet Project** only, used at [Restfolia](https://github.com/rogerleite/restfolia) samples. Install and Usage ----------------- $ git clone $ cd simple_api $ bundle install $ bundle exec rackup Try http://localhost:9292/recursos/busca I recommend to use JSONView extension on Chrome or Firefox.
Simple Api ========== - Simple Json API example. **Pet Project** only. + Simple Json API example. **Pet Project** only, used at [Restfolia](https://github.com/rogerleite/restfolia) samples. + + Install and Usage + ----------------- + + $ git clone + $ cd simple_api + $ bundle install + $ bundle exec rackup + + Try http://localhost:9292/recursos/busca + I recommend to use JSONView extension on Chrome or Firefox.
13
3.25
12
1
2ffddf16ff34ad7beaeef555fca94edd030d8aac
app/assets/javascripts/components/tickets/tickets_table_row.jsx
app/assets/javascripts/components/tickets/tickets_table_row.jsx
import React from 'react'; import { Link } from 'react-router-dom'; import { STATUSES } from './util'; import TicketStatusHandler from './ticket_status_handler'; import TicketOwnerHandler from './ticket_owner_handler'; const TicketsTableRow = ({ ticket }) => { const { sender, sender_email } = ticket; const senderName = sender.real_name || sender.username || sender_email; return ( <tr className={ticket.status === 0 ? 'table-row--faded' : ''}> <td className="w10"> {senderName || 'Unknown User Record' } </td> <td className="w15"> {ticket.subject} </td> <td className="w25"> { ticket.project.id ? <Link to={`/courses/${ticket.project.slug}`}>{ ticket.project.title }</Link> : 'Course Unknown' } </td> <td className="w20"> { STATUSES[ticket.status] } <TicketStatusHandler ticket={ticket} /> </td> <td className="w20"> { ticket.owner.username } <TicketOwnerHandler ticket={ticket} /> </td> <td className="w10"> <Link className="button" to={`/tickets/dashboard/${ticket.id}`}>Show</Link> </td> </tr> ); }; export default TicketsTableRow;
import React from 'react'; import { Link } from 'react-router-dom'; import { STATUSES } from './util'; import TicketStatusHandler from './ticket_status_handler'; import TicketOwnerHandler from './ticket_owner_handler'; const TicketsTableRow = ({ ticket }) => { const { sender, sender_email } = ticket; const senderName = sender.real_name || sender.username || sender_email; return ( <tr className={ticket.status === 0 ? 'table-row--faded' : ''}> <td className="w10"> {senderName || 'Unknown User Record' } </td> <td className="w15"> {ticket.subject && ticket.subject.replace(/_/g, ' ')} </td> <td className="w25"> { ticket.project.id ? <Link to={`/courses/${ticket.project.slug}`}>{ ticket.project.title }</Link> : 'Course Unknown' } </td> <td className="w20"> { STATUSES[ticket.status] } <TicketStatusHandler ticket={ticket} /> </td> <td className="w20"> { ticket.owner.username } <TicketOwnerHandler ticket={ticket} /> </td> <td className="w10"> <Link className="button" to={`/tickets/dashboard/${ticket.id}`}>Show</Link> </td> </tr> ); }; export default TicketsTableRow;
Replace underscores in ticket subjects, for better linebreaks
Replace underscores in ticket subjects, for better linebreaks
JSX
mit
WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard,WikiEducationFoundation/WikiEduDashboard
jsx
## Code Before: import React from 'react'; import { Link } from 'react-router-dom'; import { STATUSES } from './util'; import TicketStatusHandler from './ticket_status_handler'; import TicketOwnerHandler from './ticket_owner_handler'; const TicketsTableRow = ({ ticket }) => { const { sender, sender_email } = ticket; const senderName = sender.real_name || sender.username || sender_email; return ( <tr className={ticket.status === 0 ? 'table-row--faded' : ''}> <td className="w10"> {senderName || 'Unknown User Record' } </td> <td className="w15"> {ticket.subject} </td> <td className="w25"> { ticket.project.id ? <Link to={`/courses/${ticket.project.slug}`}>{ ticket.project.title }</Link> : 'Course Unknown' } </td> <td className="w20"> { STATUSES[ticket.status] } <TicketStatusHandler ticket={ticket} /> </td> <td className="w20"> { ticket.owner.username } <TicketOwnerHandler ticket={ticket} /> </td> <td className="w10"> <Link className="button" to={`/tickets/dashboard/${ticket.id}`}>Show</Link> </td> </tr> ); }; export default TicketsTableRow; ## Instruction: Replace underscores in ticket subjects, for better linebreaks ## Code After: import React from 'react'; import { Link } from 'react-router-dom'; import { STATUSES } from './util'; import TicketStatusHandler from './ticket_status_handler'; import TicketOwnerHandler from './ticket_owner_handler'; const TicketsTableRow = ({ ticket }) => { const { sender, sender_email } = ticket; const senderName = sender.real_name || sender.username || sender_email; return ( <tr className={ticket.status === 0 ? 'table-row--faded' : ''}> <td className="w10"> {senderName || 'Unknown User Record' } </td> <td className="w15"> {ticket.subject && ticket.subject.replace(/_/g, ' ')} </td> <td className="w25"> { ticket.project.id ? <Link to={`/courses/${ticket.project.slug}`}>{ ticket.project.title }</Link> : 'Course Unknown' } </td> <td className="w20"> { STATUSES[ticket.status] } <TicketStatusHandler ticket={ticket} /> </td> <td className="w20"> { ticket.owner.username } <TicketOwnerHandler ticket={ticket} /> </td> <td className="w10"> <Link className="button" to={`/tickets/dashboard/${ticket.id}`}>Show</Link> </td> </tr> ); }; export default TicketsTableRow;
import React from 'react'; import { Link } from 'react-router-dom'; import { STATUSES } from './util'; import TicketStatusHandler from './ticket_status_handler'; import TicketOwnerHandler from './ticket_owner_handler'; const TicketsTableRow = ({ ticket }) => { const { sender, sender_email } = ticket; const senderName = sender.real_name || sender.username || sender_email; return ( <tr className={ticket.status === 0 ? 'table-row--faded' : ''}> <td className="w10"> {senderName || 'Unknown User Record' } </td> <td className="w15"> - {ticket.subject} + {ticket.subject && ticket.subject.replace(/_/g, ' ')} </td> <td className="w25"> { ticket.project.id ? <Link to={`/courses/${ticket.project.slug}`}>{ ticket.project.title }</Link> : 'Course Unknown' } </td> <td className="w20"> { STATUSES[ticket.status] } <TicketStatusHandler ticket={ticket} /> </td> <td className="w20"> { ticket.owner.username } <TicketOwnerHandler ticket={ticket} /> </td> <td className="w10"> <Link className="button" to={`/tickets/dashboard/${ticket.id}`}>Show</Link> </td> </tr> ); }; export default TicketsTableRow;
2
0.04878
1
1
8abada25b9fba743fb20e7388a1c09206ee0cfd8
lib/vagrant/provisioners/puppet_server.rb
lib/vagrant/provisioners/puppet_server.rb
module Vagrant module Provisioners class PuppetServerError < Vagrant::Errors::VagrantError error_namespace("vagrant.provisioners.puppet_server") end class PuppetServer < Base class Config < Vagrant::Config::Base attr_accessor :puppet_server attr_accessor :puppet_node attr_accessor :options def initialize @puppet_server = "puppet" @puppet_node = "puppet_node" @options = [] end end def self.config_class Config end def provision! verify_binary("puppetd") run_puppetd_client end def verify_binary(binary) env[:vm].channel.sudo("which #{binary}", :error_class => PuppetServerError, :error_key => :puppetd_not_detected, :binary => binary) end def run_puppetd_client options = config.options options = options.join(" ") if options.is_a?(Array) if config.puppet_node cn = config.puppet_node else cn = env[:vm].config.vm.box end command = "puppetd #{options} --server #{config.puppet_server} --certname #{cn}" env.ui.info I18n.t("vagrant.provisioners.puppet_server.running_puppetd") env[:vm].channel.sudo(command) do |type, data| env.ui.info(data) end end end end end
module Vagrant module Provisioners class PuppetServerError < Vagrant::Errors::VagrantError error_namespace("vagrant.provisioners.puppet_server") end class PuppetServer < Base class Config < Vagrant::Config::Base attr_accessor :puppet_server attr_accessor :puppet_node attr_accessor :options def initialize @puppet_server = "puppet" @puppet_node = "puppet_node" @options = [] end end def self.config_class Config end def provision! verify_binary("puppetd") run_puppetd_client end def verify_binary(binary) env[:vm].channel.sudo("which #{binary}", :error_class => PuppetServerError, :error_key => :puppetd_not_detected, :binary => binary) end def run_puppetd_client options = config.options options = options.join(" ") if options.is_a?(Array) if config.puppet_node cn = config.puppet_node else cn = env[:vm].config.vm.box end command = "puppetd #{options} --server #{config.puppet_server} --certname #{cn}" env[:ui].info I18n.t("vagrant.provisioners.puppet_server.running_puppetd") env[:vm].channel.sudo(command) do |type, data| # Output the data with the proper color based on the stream. color = type == :stdout ? :green : :red # Note: Be sure to chomp the data to avoid the newlines that the # Chef outputs. env[:ui].info(data.chomp, :color => color, :prefix => false) end end end end end
Fix poor variable reference in puppet server. Also colorize output
Fix poor variable reference in puppet server. Also colorize output
Ruby
mit
tknerr/vagrant,tknerr/vagrant,bheuvel/vagrant,shtouff/vagrant,kamazee/vagrant,modulexcite/vagrant,PatrickLang/vagrant,modulexcite/vagrant,gajdaw/vagrant,chrisvire/vagrant,kamigerami/vagrant,bryson/vagrant,gitebra/vagrant,ianmiell/vagrant,carlosefr/vagrant,petems/vagrant,TheBigBear/vagrant,bdwyertech/vagrant,bdwyertech/vagrant,carlosefr/vagrant,teotihuacanada/vagrant,jfchevrette/vagrant,legal90/vagrant,rivy/vagrant,aneeshusa/vagrant,johntron/vagrant,rivy/vagrant,jhoblitt/vagrant,sax/vagrant,wangfakang/vagrant,tknerr/vagrant,chrisvire/vagrant,patrys/vagrant,lonniev/vagrant,msabramo/vagrant,dharmab/vagrant,Ninir/vagrant,msabramo/vagrant,miguel250/vagrant,wkolean/vagrant,shtouff/vagrant,bdwyertech/vagrant,chrisroberts/vagrant,stephancom/vagrant,nickryand/vagrant,wangfakang/vagrant,bshurts/vagrant,tbarrongh/vagrant,ferventcoder/vagrant,tschortsch/vagrant,myrjola/vagrant,tomfanning/vagrant,muhanadra/vagrant,blueyed/vagrant,cgvarela/vagrant,dustymabe/vagrant,miguel250/vagrant,bheuvel/vagrant,jtopper/vagrant,patrys/vagrant,Sgoettschkes/vagrant,mwrock/vagrant,vamegh/vagrant,gajdaw/vagrant,crashlytics/vagrant,nickryand/vagrant,justincampbell/vagrant,pwnall/vagrant,dhoer/vagrant,denisbr/vagrant,tjanez/vagrant,h4ck3rm1k3/vagrant,marxarelli/vagrant,vamegh/vagrant,theist/vagrant,kalabiyau/vagrant,nickryand/vagrant,obnoxxx/vagrant,muhanadra/vagrant,zsjohny/vagrant,apertoso/vagrant,tbriggs-curse/vagrant,Sgoettschkes/vagrant,petems/vagrant,dharmab/vagrant,kalabiyau/vagrant,Ninir/vagrant,tschortsch/vagrant,tomfanning/vagrant,PatOShea/vagrant,legal90/vagrant,johntron/vagrant,darkn3rd/vagrant,dharmab/vagrant,Chhed13/vagrant,h4ck3rm1k3/vagrant,evverx/vagrant,mephaust/vagrant,p0deje/vagrant,aneeshusa/vagrant,mitchellh/vagrant,juiceinc/vagrant,senglin/vagrant,johntron/vagrant,blueyed/vagrant,iNecas/vagrant,kamazee/vagrant,patrys/vagrant,sideci-sample/sideci-sample-vagrant,MiLk/vagrant,philoserf/vagrant,apertoso/vagrant,dharmab/vagrant,BlakeMesdag/vagrant,wangfakang/vagrant,mitchellh/vagrant,benh57/vagrant,tbriggs-curse/vagrant,otagi/vagrant,darkn3rd/vagrant,sideci-sample/sideci-sample-vagrant,aneeshusa/vagrant,glensc/vagrant,doy/vagrant,invernizzi-at-google/vagrant,fnewberg/vagrant,darkn3rd/vagrant,tjanez/vagrant,obnoxxx/vagrant,mwrock/vagrant,iNecas/vagrant,modulexcite/vagrant,benh57/vagrant,jkburges/vagrant,benizi/vagrant,TheBigBear/vagrant,Chhed13/vagrant,bdwyertech/vagrant,invernizzi-at-google/vagrant,loren-osborn/vagrant,h4ck3rm1k3/vagrant,marxarelli/vagrant,mephaust/vagrant,darkn3rd/vagrant,muhanadra/vagrant,myrjola/vagrant,muhanadra/vagrant,fnewberg/vagrant,blueyed/vagrant,juiceinc/vagrant,philwrenn/vagrant,mpoeter/vagrant,lukebakken/vagrant,ArloL/vagrant,taliesins/vagrant,janek-warchol/vagrant,msabramo/vagrant,benh57/vagrant,Chhunlong/vagrant,denisbr/vagrant,kalabiyau/vagrant,bryson/vagrant,jtopper/vagrant,theist/vagrant,stephancom/vagrant,MiLk/vagrant,PatOShea/vagrant,lonniev/vagrant,ferventcoder/vagrant,mitchellh/vagrant,webcoyote/vagrant,johntron/vagrant,aneeshusa/vagrant,otagi/vagrant,signed8bit/vagrant,MiLk/vagrant,gpkfr/vagrant,stephancom/vagrant,mwarren/vagrant,signed8bit/vagrant,philoserf/vagrant,ArloL/vagrant,sni/vagrant,senglin/vagrant,cgvarela/vagrant,lukebakken/vagrant,obnoxxx/vagrant,vamegh/vagrant,benizi/vagrant,teotihuacanada/vagrant,samphippen/vagrant,janek-warchol/vagrant,kamazee/vagrant,blueyed/vagrant,tbarrongh/vagrant,jean/vagrant,Avira/vagrant,loren-osborn/vagrant,Chhunlong/vagrant,channui/vagrant,signed8bit/vagrant,mkuzmin/vagrant,ianmiell/vagrant,aaam/vagrant,myrjola/vagrant,tknerr/vagrant,mitchellh/vagrant,mpoeter/vagrant,apertoso/vagrant,PatOShea/vagrant,tomfanning/vagrant,pwnall/vagrant,jhoblitt/vagrant,doy/vagrant,clinstid/vagrant,samphippen/vagrant,webcoyote/vagrant,evverx/vagrant,msabramo/vagrant,jmanero/vagrant,legal90/vagrant,sni/vagrant,taliesins/vagrant,jean/vagrant,aaam/vagrant,bshurts/vagrant,dhoer/vagrant,clinstid/vagrant,PatrickLang/vagrant,jmanero/vagrant,crashlytics/vagrant,kamigerami/vagrant,chrisroberts/vagrant,bryson/vagrant,sni/vagrant,lukebakken/vagrant,jmanero/vagrant,mwrock/vagrant,TheBigBear/vagrant,taliesins/vagrant,jfchevrette/vagrant,vamegh/vagrant,ferventcoder/vagrant,signed8bit/vagrant,PatOShea/vagrant,ArloL/vagrant,genome21/vagrant,gitebra/vagrant,sni/vagrant,cgvarela/vagrant,sax/vagrant,sferik/vagrant,BlakeMesdag/vagrant,lonniev/vagrant,PatrickLang/vagrant,sferik/vagrant,pwnall/vagrant,sax/vagrant,mephaust/vagrant,denisbr/vagrant,tschortsch/vagrant,myrjola/vagrant,ianmiell/vagrant,theist/vagrant,jtopper/vagrant,ferventcoder/vagrant,jfchevrette/vagrant,Sgoettschkes/vagrant,justincampbell/vagrant,tbarrongh/vagrant,tschortsch/vagrant,channui/vagrant,apertoso/vagrant,wkolean/vagrant,aaam/vagrant,fnewberg/vagrant,Avira/vagrant,bheuvel/vagrant,kamigerami/vagrant,tomfanning/vagrant,jfchevrette/vagrant,krig/vagrant,rivy/vagrant,gbarberi/vagrant,channui/vagrant,benizi/vagrant,chrisroberts/vagrant,bheuvel/vagrant,Avira/vagrant,h4ck3rm1k3/vagrant,gajdaw/vagrant,benh57/vagrant,mwarren/vagrant,jtopper/vagrant,Endika/vagrant,senglin/vagrant,glensc/vagrant,mephaust/vagrant,philoserf/vagrant,doy/vagrant,Chhed13/vagrant,Endika/vagrant,jberends/vagrant,cgvarela/vagrant,rivy/vagrant,gbarberi/vagrant,tjanez/vagrant,tjanez/vagrant,doy/vagrant,Chhunlong/vagrant,ArloL/vagrant,webcoyote/vagrant,krig/vagrant,iNecas/vagrant,patrys/vagrant,pwnall/vagrant,clinstid/vagrant,chrisvire/vagrant,bmhatfield/vagrant,BlakeMesdag/vagrant,carlosefr/vagrant,wkolean/vagrant,krig/vagrant,petems/vagrant,genome21/vagrant,evverx/vagrant,teotihuacanada/vagrant,janek-warchol/vagrant,legal90/vagrant,p0deje/vagrant,miguel250/vagrant,marxarelli/vagrant,teotihuacanada/vagrant,mkuzmin/vagrant,jhoblitt/vagrant,invernizzi-at-google/vagrant,chrisvire/vagrant,senglin/vagrant,janek-warchol/vagrant,justincampbell/vagrant,jmanero/vagrant,miguel250/vagrant,PatrickLang/vagrant,philoserf/vagrant,zsjohny/vagrant,jkburges/vagrant,bmhatfield/vagrant,wkolean/vagrant,gpkfr/vagrant,Sgoettschkes/vagrant,Endika/vagrant,mpoeter/vagrant,denisbr/vagrant,TheBigBear/vagrant,taliesins/vagrant,stephancom/vagrant,jberends/vagrant,juiceinc/vagrant,dustymabe/vagrant,sax/vagrant,fnewberg/vagrant,crashlytics/vagrant,carlosefr/vagrant,p0deje/vagrant,mwrock/vagrant,lonniev/vagrant,jberends/vagrant,bryson/vagrant,dustymabe/vagrant,zsjohny/vagrant,philwrenn/vagrant,petems/vagrant,kamazee/vagrant,loren-osborn/vagrant,samphippen/vagrant,Endika/vagrant,shtouff/vagrant,sideci-sample/sideci-sample-vagrant,Ninir/vagrant,gpkfr/vagrant,benizi/vagrant,bmhatfield/vagrant,otagi/vagrant,modulexcite/vagrant,Chhunlong/vagrant,mkuzmin/vagrant,gpkfr/vagrant,genome21/vagrant,bshurts/vagrant,philwrenn/vagrant,theist/vagrant,gitebra/vagrant,jberends/vagrant,otagi/vagrant,Chhed13/vagrant,tbriggs-curse/vagrant,jkburges/vagrant,jean/vagrant,Avira/vagrant,dhoer/vagrant,krig/vagrant,tbriggs-curse/vagrant,gbarberi/vagrant,juiceinc/vagrant,shtouff/vagrant,nickryand/vagrant,kalabiyau/vagrant,invernizzi-at-google/vagrant,chrisroberts/vagrant,webcoyote/vagrant,crashlytics/vagrant,justincampbell/vagrant,mwarren/vagrant,loren-osborn/vagrant,mpoeter/vagrant,mkuzmin/vagrant,bshurts/vagrant,aaam/vagrant,genome21/vagrant,lukebakken/vagrant,gbarberi/vagrant,zsjohny/vagrant,sferik/vagrant,ianmiell/vagrant,gitebra/vagrant,dhoer/vagrant,philwrenn/vagrant,jhoblitt/vagrant,dustymabe/vagrant,mwarren/vagrant,jean/vagrant,tbarrongh/vagrant,samphippen/vagrant,jkburges/vagrant,kamigerami/vagrant,wangfakang/vagrant,marxarelli/vagrant
ruby
## Code Before: module Vagrant module Provisioners class PuppetServerError < Vagrant::Errors::VagrantError error_namespace("vagrant.provisioners.puppet_server") end class PuppetServer < Base class Config < Vagrant::Config::Base attr_accessor :puppet_server attr_accessor :puppet_node attr_accessor :options def initialize @puppet_server = "puppet" @puppet_node = "puppet_node" @options = [] end end def self.config_class Config end def provision! verify_binary("puppetd") run_puppetd_client end def verify_binary(binary) env[:vm].channel.sudo("which #{binary}", :error_class => PuppetServerError, :error_key => :puppetd_not_detected, :binary => binary) end def run_puppetd_client options = config.options options = options.join(" ") if options.is_a?(Array) if config.puppet_node cn = config.puppet_node else cn = env[:vm].config.vm.box end command = "puppetd #{options} --server #{config.puppet_server} --certname #{cn}" env.ui.info I18n.t("vagrant.provisioners.puppet_server.running_puppetd") env[:vm].channel.sudo(command) do |type, data| env.ui.info(data) end end end end end ## Instruction: Fix poor variable reference in puppet server. Also colorize output ## Code After: module Vagrant module Provisioners class PuppetServerError < Vagrant::Errors::VagrantError error_namespace("vagrant.provisioners.puppet_server") end class PuppetServer < Base class Config < Vagrant::Config::Base attr_accessor :puppet_server attr_accessor :puppet_node attr_accessor :options def initialize @puppet_server = "puppet" @puppet_node = "puppet_node" @options = [] end end def self.config_class Config end def provision! verify_binary("puppetd") run_puppetd_client end def verify_binary(binary) env[:vm].channel.sudo("which #{binary}", :error_class => PuppetServerError, :error_key => :puppetd_not_detected, :binary => binary) end def run_puppetd_client options = config.options options = options.join(" ") if options.is_a?(Array) if config.puppet_node cn = config.puppet_node else cn = env[:vm].config.vm.box end command = "puppetd #{options} --server #{config.puppet_server} --certname #{cn}" env[:ui].info I18n.t("vagrant.provisioners.puppet_server.running_puppetd") env[:vm].channel.sudo(command) do |type, data| # Output the data with the proper color based on the stream. color = type == :stdout ? :green : :red # Note: Be sure to chomp the data to avoid the newlines that the # Chef outputs. env[:ui].info(data.chomp, :color => color, :prefix => false) end end end end end
module Vagrant module Provisioners class PuppetServerError < Vagrant::Errors::VagrantError error_namespace("vagrant.provisioners.puppet_server") end class PuppetServer < Base class Config < Vagrant::Config::Base attr_accessor :puppet_server attr_accessor :puppet_node attr_accessor :options def initialize @puppet_server = "puppet" @puppet_node = "puppet_node" @options = [] end end def self.config_class Config end def provision! verify_binary("puppetd") run_puppetd_client end def verify_binary(binary) env[:vm].channel.sudo("which #{binary}", :error_class => PuppetServerError, :error_key => :puppetd_not_detected, :binary => binary) end def run_puppetd_client options = config.options options = options.join(" ") if options.is_a?(Array) if config.puppet_node cn = config.puppet_node else cn = env[:vm].config.vm.box end command = "puppetd #{options} --server #{config.puppet_server} --certname #{cn}" - env.ui.info I18n.t("vagrant.provisioners.puppet_server.running_puppetd") ? ^ + env[:ui].info I18n.t("vagrant.provisioners.puppet_server.running_puppetd") ? ^^ + env[:vm].channel.sudo(command) do |type, data| - env.ui.info(data) + # Output the data with the proper color based on the stream. + color = type == :stdout ? :green : :red + + # Note: Be sure to chomp the data to avoid the newlines that the + # Chef outputs. + env[:ui].info(data.chomp, :color => color, :prefix => false) end end end end end
9
0.166667
7
2
8d250856263f43307320d429b18ab7123c3aa5de
README.md
README.md
Previeweet is browser extension which provides Twitter users with small image previews to the right of tweets. ## HOWTO use it Download the Chrome-extension: http://previeweet.com ## Supported Services * Twitter (pic.twitter.com) * Instagram * Photobucket * Facebook * Apple * Yfrog * Twitpic * Twitvid * Flickr * Imgur ## License (MIT) Copyright (c) 2012 Giuseppe Gurgone This work is licensed for reuse under the MIT license. See the included [LICENSE] (LICENSE) file for details.
Previeweet is an awesome browser extension that provides Twitter users with small image previews to the right of tweets. ## HOWTO use it Download the Chrome-extension: http://previeweet.com ## Supported Services * Twitter (pic.twitter.com) * Instagram * Photobucket * Facebook * Apple * Yfrog * Twitpic * Twitvid * Flickr * Imgur and many more! ## License (MIT) Copyright (c) 2012 Giuseppe Gurgone This work is licensed for reuse under the MIT license. See the included [LICENSE] (LICENSE) file for details.
Fix description and Support services list
Fix description and Support services list
Markdown
mit
giuseppeg/Previeweet
markdown
## Code Before: Previeweet is browser extension which provides Twitter users with small image previews to the right of tweets. ## HOWTO use it Download the Chrome-extension: http://previeweet.com ## Supported Services * Twitter (pic.twitter.com) * Instagram * Photobucket * Facebook * Apple * Yfrog * Twitpic * Twitvid * Flickr * Imgur ## License (MIT) Copyright (c) 2012 Giuseppe Gurgone This work is licensed for reuse under the MIT license. See the included [LICENSE] (LICENSE) file for details. ## Instruction: Fix description and Support services list ## Code After: Previeweet is an awesome browser extension that provides Twitter users with small image previews to the right of tweets. ## HOWTO use it Download the Chrome-extension: http://previeweet.com ## Supported Services * Twitter (pic.twitter.com) * Instagram * Photobucket * Facebook * Apple * Yfrog * Twitpic * Twitvid * Flickr * Imgur and many more! ## License (MIT) Copyright (c) 2012 Giuseppe Gurgone This work is licensed for reuse under the MIT license. See the included [LICENSE] (LICENSE) file for details.
- Previeweet is browser extension which provides Twitter users with small image previews to the right of tweets. ? ^ ^^^ + Previeweet is an awesome browser extension that provides Twitter users with small image previews to the right of tweets. ? +++++++++++ ^ ^^ ## HOWTO use it Download the Chrome-extension: http://previeweet.com ## Supported Services * Twitter (pic.twitter.com) * Instagram * Photobucket * Facebook * Apple * Yfrog * Twitpic * Twitvid * Flickr * Imgur + and many more! + ## License (MIT) Copyright (c) 2012 Giuseppe Gurgone This work is licensed for reuse under the MIT license. See the included [LICENSE] (LICENSE) file for details.
4
0.148148
3
1
81be4f67a968a955197fc37d8f804feb6486c217
gulpfile.js
gulpfile.js
var gulp = require('gulp'); var serv = require('gulp-webserver'); var jshint = require('gulp-jshint'); var nodemon = require('gulp-nodemon'); var paths = { javascript: './js/**/*.js' }; gulp.task('server', function () { return gulp.src('./') .pipe(serv({ open: true })); }); gulp.task('api', function () { return nodemon({ script: './api/image.js' }); }); gulp.task('lint', function () { return gulp.src(paths.javascript) .pipe(jshint()) .pipe(jshint.reporter('jshint-stylish')); }); gulp.task('default', ['server', 'api']);
var gulp = require('gulp'); var serv = require('gulp-webserver'); var jshint = require('gulp-jshint'); var nodemon = require('gulp-nodemon'); var paths = { javascript: './js/**/*.js' }; gulp.task('server', function () { return gulp.src('./') .pipe(serv({ open: true })); }); gulp.task('api', function () { return nodemon({ script: './api/image.js' }); }); gulp.task('jshint', function () { return gulp.src(paths.javascript) .pipe(jshint()) .pipe(jshint.reporter('jshint-stylish')); }); gulp.task('default', ['server', 'api', 'jshint']);
Add task to default, change name to jslint
Add task to default, change name to jslint
JavaScript
mit
jillesme/ng-movies
javascript
## Code Before: var gulp = require('gulp'); var serv = require('gulp-webserver'); var jshint = require('gulp-jshint'); var nodemon = require('gulp-nodemon'); var paths = { javascript: './js/**/*.js' }; gulp.task('server', function () { return gulp.src('./') .pipe(serv({ open: true })); }); gulp.task('api', function () { return nodemon({ script: './api/image.js' }); }); gulp.task('lint', function () { return gulp.src(paths.javascript) .pipe(jshint()) .pipe(jshint.reporter('jshint-stylish')); }); gulp.task('default', ['server', 'api']); ## Instruction: Add task to default, change name to jslint ## Code After: var gulp = require('gulp'); var serv = require('gulp-webserver'); var jshint = require('gulp-jshint'); var nodemon = require('gulp-nodemon'); var paths = { javascript: './js/**/*.js' }; gulp.task('server', function () { return gulp.src('./') .pipe(serv({ open: true })); }); gulp.task('api', function () { return nodemon({ script: './api/image.js' }); }); gulp.task('jshint', function () { return gulp.src(paths.javascript) .pipe(jshint()) .pipe(jshint.reporter('jshint-stylish')); }); gulp.task('default', ['server', 'api', 'jshint']);
var gulp = require('gulp'); var serv = require('gulp-webserver'); var jshint = require('gulp-jshint'); var nodemon = require('gulp-nodemon'); var paths = { javascript: './js/**/*.js' }; gulp.task('server', function () { return gulp.src('./') .pipe(serv({ open: true })); }); gulp.task('api', function () { return nodemon({ script: './api/image.js' }); }); - gulp.task('lint', function () { ? ^ + gulp.task('jshint', function () { ? ^^^ return gulp.src(paths.javascript) .pipe(jshint()) .pipe(jshint.reporter('jshint-stylish')); }); - gulp.task('default', ['server', 'api']); + gulp.task('default', ['server', 'api', 'jshint']); ? ++++++++++
4
0.148148
2
2
429a56d480c647e6a51bed43befffc9401171e37
.archlinux/bootstrap.sh
.archlinux/bootstrap.sh
set -e # Change the working directory to this one cd "$(dirname "$0")" # Get administrative privileges sudo -v # Keep pinging sudo until this script finishes # Source: https://gist.github.com/cowboy/3118588 while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & # Install PKGBUILDs make package=tari-core make package=bspwm-round-corners-git make package=color-scripts make package=xeventbind # Install yay make aur package=yay # Install aur packages with yay yay -S rtv yay -S polybar yay -S shotgun yay -S ranger-git # Additional settings make fontconfig make yarnconfig # Revoke privileges sudo -K # Install dotfiles make -C .. # Change the color scheme to a sane default wal --theme base16-tomorrow-night # Run vim for the first time (i.e. install plugins and exit) nvim
set -e # Change the working directory to this one cd "$(dirname "$0")" # Get administrative privileges sudo -v # Keep pinging sudo until this script finishes # Source: https://gist.github.com/cowboy/3118588 while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & # Refresh GPG keys before installing packages make refresh-keys # Install PKGBUILDs make package=tari-core make package=bspwm-round-corners-git make package=color-scripts make package=xeventbind # Install yay make aur package=yay # Install aur packages with yay yay -S rtv yay -S polybar yay -S shotgun yay -S ranger-git # Additional settings make fontconfig make yarnconfig # Revoke privileges sudo -K # Install dotfiles make -C .. # Change the color scheme to a sane default wal --theme base16-tomorrow-night # Run vim for the first time (i.e. install plugins and exit) nvim
Refresh keys before installing packages
archlinux: Refresh keys before installing packages This fixes an issue where some packages cannot be verified if they use new keys.
Shell
mit
GloverDonovan/new-start
shell
## Code Before: set -e # Change the working directory to this one cd "$(dirname "$0")" # Get administrative privileges sudo -v # Keep pinging sudo until this script finishes # Source: https://gist.github.com/cowboy/3118588 while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & # Install PKGBUILDs make package=tari-core make package=bspwm-round-corners-git make package=color-scripts make package=xeventbind # Install yay make aur package=yay # Install aur packages with yay yay -S rtv yay -S polybar yay -S shotgun yay -S ranger-git # Additional settings make fontconfig make yarnconfig # Revoke privileges sudo -K # Install dotfiles make -C .. # Change the color scheme to a sane default wal --theme base16-tomorrow-night # Run vim for the first time (i.e. install plugins and exit) nvim ## Instruction: archlinux: Refresh keys before installing packages This fixes an issue where some packages cannot be verified if they use new keys. ## Code After: set -e # Change the working directory to this one cd "$(dirname "$0")" # Get administrative privileges sudo -v # Keep pinging sudo until this script finishes # Source: https://gist.github.com/cowboy/3118588 while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & # Refresh GPG keys before installing packages make refresh-keys # Install PKGBUILDs make package=tari-core make package=bspwm-round-corners-git make package=color-scripts make package=xeventbind # Install yay make aur package=yay # Install aur packages with yay yay -S rtv yay -S polybar yay -S shotgun yay -S ranger-git # Additional settings make fontconfig make yarnconfig # Revoke privileges sudo -K # Install dotfiles make -C .. # Change the color scheme to a sane default wal --theme base16-tomorrow-night # Run vim for the first time (i.e. install plugins and exit) nvim
set -e # Change the working directory to this one cd "$(dirname "$0")" # Get administrative privileges sudo -v # Keep pinging sudo until this script finishes # Source: https://gist.github.com/cowboy/3118588 while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & + + # Refresh GPG keys before installing packages + make refresh-keys # Install PKGBUILDs make package=tari-core make package=bspwm-round-corners-git make package=color-scripts make package=xeventbind # Install yay make aur package=yay # Install aur packages with yay yay -S rtv yay -S polybar yay -S shotgun yay -S ranger-git # Additional settings make fontconfig make yarnconfig # Revoke privileges sudo -K # Install dotfiles make -C .. # Change the color scheme to a sane default wal --theme base16-tomorrow-night # Run vim for the first time (i.e. install plugins and exit) nvim
3
0.071429
3
0
a67ccbd9031dde4168428521b1cdaa752300739a
app/models/EloquentBuilder.php
app/models/EloquentBuilder.php
<?php class EloquentBuilder extends \Illuminate\Database\Eloquent\Builder { /** * Eager load pivot relations. * * @param array $models * @return void */ protected function loadPivotRelations($models) { $query = head($models)->pivot->newQuery()->with('unit'); $pivots = array_pluck($models, 'pivot'); $pivots = head($pivots)->newCollection($pivots); $pivots->load($this->getPivotRelations()); } /** * Get the pivot relations to be eager loaded. * * @return array */ protected function getPivotRelations() { $relations = array_filter(array_keys($this->eagerLoad), function ($relation) { return $relation != 'pivot'; }); return array_map(function ($relation) { return substr($relation, strlen('pivot.')); }, $relations); } /** * Override. Eager load relations of pivot models. * Eagerly load the relationship on a set of models. * * @param array $models * @param string $name * @param \Closure $constraints * @return array */ protected function loadRelation(array $models, $name, Closure $constraints) { // In this part, if the relation name is 'pivot', // therefore there are relations in a pivot to be eager loaded. if ($name === 'pivot') { $this->loadPivotRelations($models); return $models; } return parent::loadRelation($models, $name, $constraints); } }
<?php class EloquentBuilder extends \Illuminate\Database\Eloquent\Builder { /** * Eager load pivot relations. * * @param array $models * @return void */ protected function loadPivotRelations($models) { $query = head($models)->pivot->newQuery()->with('unit'); $pivots = array_pluck($models, 'pivot'); $pivots = head($pivots)->newCollection($pivots); $pivots->load($this->getPivotRelations()); } /** * Get the pivot relations to be eager loaded. * * @return array */ protected function getPivotRelations() { $relations = array_filter(array_keys($this->eagerLoad), function ($relation) { return $relation != 'pivot' && str_contains($relation, 'pivot'); }); return array_map(function ($relation) { return substr($relation, strlen('pivot.')); }, $relations); } /** * Override. Eager load relations of pivot models. * Eagerly load the relationship on a set of models. * * @param array $models * @param string $name * @param \Closure $constraints * @return array */ protected function loadRelation(array $models, $name, Closure $constraints) { // In this part, if the relation name is 'pivot', // therefore there are relations in a pivot to be eager loaded. if ($name === 'pivot') { $this->loadPivotRelations($models); return $models; } return parent::loadRelation($models, $name, $constraints); } }
Fix condition, make sure not to include non-pivot relations
Fix condition, make sure not to include non-pivot relations
PHP
mit
ajcastro/iprocure,ajcastro/iprocure
php
## Code Before: <?php class EloquentBuilder extends \Illuminate\Database\Eloquent\Builder { /** * Eager load pivot relations. * * @param array $models * @return void */ protected function loadPivotRelations($models) { $query = head($models)->pivot->newQuery()->with('unit'); $pivots = array_pluck($models, 'pivot'); $pivots = head($pivots)->newCollection($pivots); $pivots->load($this->getPivotRelations()); } /** * Get the pivot relations to be eager loaded. * * @return array */ protected function getPivotRelations() { $relations = array_filter(array_keys($this->eagerLoad), function ($relation) { return $relation != 'pivot'; }); return array_map(function ($relation) { return substr($relation, strlen('pivot.')); }, $relations); } /** * Override. Eager load relations of pivot models. * Eagerly load the relationship on a set of models. * * @param array $models * @param string $name * @param \Closure $constraints * @return array */ protected function loadRelation(array $models, $name, Closure $constraints) { // In this part, if the relation name is 'pivot', // therefore there are relations in a pivot to be eager loaded. if ($name === 'pivot') { $this->loadPivotRelations($models); return $models; } return parent::loadRelation($models, $name, $constraints); } } ## Instruction: Fix condition, make sure not to include non-pivot relations ## Code After: <?php class EloquentBuilder extends \Illuminate\Database\Eloquent\Builder { /** * Eager load pivot relations. * * @param array $models * @return void */ protected function loadPivotRelations($models) { $query = head($models)->pivot->newQuery()->with('unit'); $pivots = array_pluck($models, 'pivot'); $pivots = head($pivots)->newCollection($pivots); $pivots->load($this->getPivotRelations()); } /** * Get the pivot relations to be eager loaded. * * @return array */ protected function getPivotRelations() { $relations = array_filter(array_keys($this->eagerLoad), function ($relation) { return $relation != 'pivot' && str_contains($relation, 'pivot'); }); return array_map(function ($relation) { return substr($relation, strlen('pivot.')); }, $relations); } /** * Override. Eager load relations of pivot models. * Eagerly load the relationship on a set of models. * * @param array $models * @param string $name * @param \Closure $constraints * @return array */ protected function loadRelation(array $models, $name, Closure $constraints) { // In this part, if the relation name is 'pivot', // therefore there are relations in a pivot to be eager loaded. if ($name === 'pivot') { $this->loadPivotRelations($models); return $models; } return parent::loadRelation($models, $name, $constraints); } }
<?php class EloquentBuilder extends \Illuminate\Database\Eloquent\Builder { /** * Eager load pivot relations. * * @param array $models * @return void */ protected function loadPivotRelations($models) { $query = head($models)->pivot->newQuery()->with('unit'); $pivots = array_pluck($models, 'pivot'); $pivots = head($pivots)->newCollection($pivots); $pivots->load($this->getPivotRelations()); } /** * Get the pivot relations to be eager loaded. * * @return array */ protected function getPivotRelations() { $relations = array_filter(array_keys($this->eagerLoad), function ($relation) { - return $relation != 'pivot'; + return $relation != 'pivot' && str_contains($relation, 'pivot'); }); return array_map(function ($relation) { return substr($relation, strlen('pivot.')); }, $relations); } /** * Override. Eager load relations of pivot models. * Eagerly load the relationship on a set of models. * * @param array $models * @param string $name * @param \Closure $constraints * @return array */ protected function loadRelation(array $models, $name, Closure $constraints) { // In this part, if the relation name is 'pivot', // therefore there are relations in a pivot to be eager loaded. if ($name === 'pivot') { $this->loadPivotRelations($models); return $models; } return parent::loadRelation($models, $name, $constraints); } }
2
0.035714
1
1
91f4c50a25be6defe0bd495821d274fe5ed59053
app/assets/stylesheets/admin/user_needs.scss
app/assets/stylesheets/admin/user_needs.scss
background-color: $yellow-50; padding: 0.5em 1em; .notice { font-size: 19px; } h2.enhanced { cursor: pointer; font-size: 21px; } } .add-user-need { span { display: block; margin-bottom: 5px; } span label { min-width: 4em; display: inline-block; text-align: right; } .choice { margin-top: 1.2em; } label, input { display: inline; width: auto; margin: 0 0.2em; } }
background-color: $yellow-50; padding: 0.5em 1em; .notice { font-size: 19px; } h2.enhanced { cursor: pointer; font-size: 21px; } } .add-user-need { span { display: block; margin-bottom: 5px; } span label { min-width: 4em; display: inline-block; text-align: right; } .choice { margin-top: 1.2em; } label, input { display: inline; width: auto; margin: 0 0.2em; } }
Tidy spacing in user needs CSS
Tidy spacing in user needs CSS
SCSS
mit
alphagov/whitehall,ggoral/whitehall,alphagov/whitehall,YOTOV-LIMITED/whitehall,askl56/whitehall,hotvulcan/whitehall,hotvulcan/whitehall,askl56/whitehall,YOTOV-LIMITED/whitehall,ggoral/whitehall,ggoral/whitehall,alphagov/whitehall,askl56/whitehall,robinwhittleton/whitehall,alphagov/whitehall,robinwhittleton/whitehall,hotvulcan/whitehall,YOTOV-LIMITED/whitehall,YOTOV-LIMITED/whitehall,ggoral/whitehall,askl56/whitehall,hotvulcan/whitehall,robinwhittleton/whitehall,robinwhittleton/whitehall
scss
## Code Before: background-color: $yellow-50; padding: 0.5em 1em; .notice { font-size: 19px; } h2.enhanced { cursor: pointer; font-size: 21px; } } .add-user-need { span { display: block; margin-bottom: 5px; } span label { min-width: 4em; display: inline-block; text-align: right; } .choice { margin-top: 1.2em; } label, input { display: inline; width: auto; margin: 0 0.2em; } } ## Instruction: Tidy spacing in user needs CSS ## Code After: background-color: $yellow-50; padding: 0.5em 1em; .notice { font-size: 19px; } h2.enhanced { cursor: pointer; font-size: 21px; } } .add-user-need { span { display: block; margin-bottom: 5px; } span label { min-width: 4em; display: inline-block; text-align: right; } .choice { margin-top: 1.2em; } label, input { display: inline; width: auto; margin: 0 0.2em; } }
- background-color: $yellow-50; ? ------ + background-color: $yellow-50; - padding: 0.5em 1em; + padding: 0.5em 1em; .notice { - font-size: 19px; ? ----------- + font-size: 19px; } h2.enhanced { - cursor: pointer; + cursor: pointer; - font-size: 21px; ? ----------- + font-size: 21px; } } .add-user-need { span { - display: block; + display: block; - margin-bottom: 5px; ? ------- + margin-bottom: 5px; } span label { - min-width: 4em; ? ----------- + min-width: 4em; - display: inline-block; ? ------------- + display: inline-block; - text-align: right; ? ---------- + text-align: right; } .choice { - margin-top: 1.2em; ? ---------- + margin-top: 1.2em; } label, input { - display: inline; ? ------------- + display: inline; - width: auto; - margin: 0 0.2em; + width: auto; + margin: 0 0.2em; } }
28
0.777778
14
14
fbd8ea74a7d833318c86f223ffeac90c64142720
doc/css/extra.css
doc/css/extra.css
/* Give the main header an underline. */ h1 { padding-bottom: 21px; margin-bottom: 21px; border-bottom: 1px solid #ddd; } /* Add small subtitles. */ .subtitle { margin-top: -10.5px; color: #bbb; } /* Lay out definition lists list tables. */ dl { display: flex; flex-flow: row wrap; } dt { flex-basis: 20%; font-weight: normal; text-align: right; padding: 2px 4px; } dd { flex-basis: 70%; flex-grow: 1; margin: 0; padding: 2px 4px; }
/* Give the main header an underline. */ h1 { padding-bottom: 21px; margin-bottom: 21px; border-bottom: 1px solid #ddd; } /* Add small subtitles. */ .subtitle { margin-top: -10.5px; color: #bbb; } /* Display definition lists in grid form. */ dl { display: grid; grid-template-columns: fit-content(25%) auto } dt { font-weight: normal; text-align: right; padding: 2px 4px; } dd { margin: 0; padding: 2px 4px; }
Improve CSS for definition list grids
Improve CSS for definition list grids
CSS
bsd-3-clause
jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000,jimporter/bfg9000
css
## Code Before: /* Give the main header an underline. */ h1 { padding-bottom: 21px; margin-bottom: 21px; border-bottom: 1px solid #ddd; } /* Add small subtitles. */ .subtitle { margin-top: -10.5px; color: #bbb; } /* Lay out definition lists list tables. */ dl { display: flex; flex-flow: row wrap; } dt { flex-basis: 20%; font-weight: normal; text-align: right; padding: 2px 4px; } dd { flex-basis: 70%; flex-grow: 1; margin: 0; padding: 2px 4px; } ## Instruction: Improve CSS for definition list grids ## Code After: /* Give the main header an underline. */ h1 { padding-bottom: 21px; margin-bottom: 21px; border-bottom: 1px solid #ddd; } /* Add small subtitles. */ .subtitle { margin-top: -10.5px; color: #bbb; } /* Display definition lists in grid form. */ dl { display: grid; grid-template-columns: fit-content(25%) auto } dt { font-weight: normal; text-align: right; padding: 2px 4px; } dd { margin: 0; padding: 2px 4px; }
/* Give the main header an underline. */ h1 { padding-bottom: 21px; margin-bottom: 21px; border-bottom: 1px solid #ddd; } /* Add small subtitles. */ .subtitle { margin-top: -10.5px; color: #bbb; } - /* Lay out definition lists list tables. */ + /* Display definition lists in grid form. */ dl { - display: flex; ? ^^^^ + display: grid; ? ^^^^ - flex-flow: row wrap; + grid-template-columns: fit-content(25%) auto } dt { - flex-basis: 20%; font-weight: normal; text-align: right; padding: 2px 4px; } dd { - flex-basis: 70%; - flex-grow: 1; margin: 0; padding: 2px 4px; }
9
0.257143
3
6
e9f8505fc6d26f94ace5b6147496b062b3edbf7e
blueprints/gke_cluster/gke_cluster.json
blueprints/gke_cluster/gke_cluster.json
{ "any-group-can-deploy": true, "build-items": [ { "continue-on-failure": false, "deploy-seq": 1, "description": null, "execute-in-parallel": false, "id": "38", "name": "Create GKE Cluster", "run-on-scale-up": true, "show-on-order-form": true, "type": "plugin" } ], "create-service": true, "description": "Provisions a Kubernetes cluster into an existing Google Compute Engine environment using Google Kubernetes Engine. The cluster will be imported as a Container Orchestrator, and the nodes as Servers.", "id": "20", "is-orderable": true, "name": "GKE Cluster", "service-management-actions": [], "teardown-items": [ { "continue-on-failure": false, "deploy-seq": -1, "description": null, "execute-in-parallel": false, "id": "39", "name": "Delete GKE Cluster", "type": "teardown_plugin" } ] }
{ "any-group-can-deploy": true, "build-items": [ { "continue-on-failure": false, "deploy-seq": 1, "description": null, "execute-in-parallel": false, "id": "38", "name": "Create GKE Cluster", "run-on-scale-up": true, "show-on-order-form": true, "type": "plugin" } ], "create-service": true, "description": "Provisions a Kubernetes cluster into an existing Google Compute Engine environment using Google Kubernetes Engine. The cluster will be imported as a Container Orchestrator, and the nodes as Servers.\n\nThis blueprint requires the google-api-python-client library, which comes installed by default on CloudBolt 7.7. For prior versions, run `pip install google-api-python-client` on the CloudBolt appliance to install it.", "id": "20", "is-orderable": true, "name": "Google Kubernetes Engine Cluster", "service-management-actions": [], "teardown-items": [ { "continue-on-failure": false, "deploy-seq": -1, "description": null, "execute-in-parallel": false, "id": "39", "name": "Delete GKE Cluster", "type": "teardown_plugin" } ] }
Adjust title and description on GKE blueprint
Adjust title and description on GKE blueprint [#153200879]
JSON
apache-2.0
CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge
json
## Code Before: { "any-group-can-deploy": true, "build-items": [ { "continue-on-failure": false, "deploy-seq": 1, "description": null, "execute-in-parallel": false, "id": "38", "name": "Create GKE Cluster", "run-on-scale-up": true, "show-on-order-form": true, "type": "plugin" } ], "create-service": true, "description": "Provisions a Kubernetes cluster into an existing Google Compute Engine environment using Google Kubernetes Engine. The cluster will be imported as a Container Orchestrator, and the nodes as Servers.", "id": "20", "is-orderable": true, "name": "GKE Cluster", "service-management-actions": [], "teardown-items": [ { "continue-on-failure": false, "deploy-seq": -1, "description": null, "execute-in-parallel": false, "id": "39", "name": "Delete GKE Cluster", "type": "teardown_plugin" } ] } ## Instruction: Adjust title and description on GKE blueprint [#153200879] ## Code After: { "any-group-can-deploy": true, "build-items": [ { "continue-on-failure": false, "deploy-seq": 1, "description": null, "execute-in-parallel": false, "id": "38", "name": "Create GKE Cluster", "run-on-scale-up": true, "show-on-order-form": true, "type": "plugin" } ], "create-service": true, "description": "Provisions a Kubernetes cluster into an existing Google Compute Engine environment using Google Kubernetes Engine. The cluster will be imported as a Container Orchestrator, and the nodes as Servers.\n\nThis blueprint requires the google-api-python-client library, which comes installed by default on CloudBolt 7.7. For prior versions, run `pip install google-api-python-client` on the CloudBolt appliance to install it.", "id": "20", "is-orderable": true, "name": "Google Kubernetes Engine Cluster", "service-management-actions": [], "teardown-items": [ { "continue-on-failure": false, "deploy-seq": -1, "description": null, "execute-in-parallel": false, "id": "39", "name": "Delete GKE Cluster", "type": "teardown_plugin" } ] }
{ "any-group-can-deploy": true, "build-items": [ { "continue-on-failure": false, "deploy-seq": 1, "description": null, "execute-in-parallel": false, "id": "38", "name": "Create GKE Cluster", "run-on-scale-up": true, "show-on-order-form": true, "type": "plugin" } ], "create-service": true, - "description": "Provisions a Kubernetes cluster into an existing Google Compute Engine environment using Google Kubernetes Engine. The cluster will be imported as a Container Orchestrator, and the nodes as Servers.", + "description": "Provisions a Kubernetes cluster into an existing Google Compute Engine environment using Google Kubernetes Engine. The cluster will be imported as a Container Orchestrator, and the nodes as Servers.\n\nThis blueprint requires the google-api-python-client library, which comes installed by default on CloudBolt 7.7. For prior versions, run `pip install google-api-python-client` on the CloudBolt appliance to install it.", "id": "20", "is-orderable": true, - "name": "GKE Cluster", + "name": "Google Kubernetes Engine Cluster", "service-management-actions": [], "teardown-items": [ { "continue-on-failure": false, "deploy-seq": -1, "description": null, "execute-in-parallel": false, "id": "39", "name": "Delete GKE Cluster", "type": "teardown_plugin" } ] }
4
0.121212
2
2
a6c06c61e9fa11c6b441fdf2a5075ca35015d7e0
tests/test_windows.py
tests/test_windows.py
import pytest import mdct.windows def test_kbd(): mdct.windows.kaiser_derived(50)
import pytest import mdct.windows def test_kbd(): mdct.windows.kaiser_derived(50) with pytest.raises(ValueError): mdct.windows.kaiser_derived(51)
Test that asserts odd numbered windows dont work
Test that asserts odd numbered windows dont work
Python
mit
audiolabs/mdct
python
## Code Before: import pytest import mdct.windows def test_kbd(): mdct.windows.kaiser_derived(50) ## Instruction: Test that asserts odd numbered windows dont work ## Code After: import pytest import mdct.windows def test_kbd(): mdct.windows.kaiser_derived(50) with pytest.raises(ValueError): mdct.windows.kaiser_derived(51)
import pytest import mdct.windows def test_kbd(): mdct.windows.kaiser_derived(50) + + with pytest.raises(ValueError): + mdct.windows.kaiser_derived(51)
3
0.5
3
0
03153bc0671b5b0c8292f902c6a5f0a792a383b3
code/jobs/CheckComposerUpdatesJob.php
code/jobs/CheckComposerUpdatesJob.php
<?php /** * Composer Update checker job. Runs the check as a queuedjob. * * @author Peter Thaleikis * @license MIT */ class CheckComposerUpdatesJob extends AbstractQueuedJob implements QueuedJob { /** * The task to run * * @var BuildTask */ protected $task; /** * define the title * * @return string */ public function getTitle() { return _t( 'ComposerUpdateChecker.Title', 'Check if composer updates are available' ); } /** * define the type. */ public function getJobType() { $this->totalSteps = 1; return QueuedJob::QUEUED; } /** * init */ public function setup() { // create the instance of the task $this->task = new CheckComposerUpdatesTask(); } /** * process the */ public function process() { $this->task->run(new SS_HTTPRequest()); } }
<?php /** * Composer Update checker job. Runs the check as a queuedjob. * * @author Peter Thaleikis * @license MIT */ class CheckComposerUpdatesJob extends AbstractQueuedJob implements QueuedJob { /** * The task to run * * @var BuildTask */ protected $task; /** * define the title * * @return string */ public function getTitle() { return _t( 'ComposerUpdateChecker.Title', 'Check if composer updates are available' ); } /** * define the type. */ public function getJobType() { $this->totalSteps = 1; return QueuedJob::QUEUED; } /** * init */ public function setup() { // create the instance of the task $this->task = new CheckComposerUpdatesTask(); } /** * processes the task as a job */ public function process() { // run the task $this->task->run(new SS_HTTPRequest()); // mark job as completed $this->isComplete = true; } }
Implement the job better - minor bugfix
Implement the job better - minor bugfix
PHP
mit
spekulatius/silverstripe-composer-update-checker
php
## Code Before: <?php /** * Composer Update checker job. Runs the check as a queuedjob. * * @author Peter Thaleikis * @license MIT */ class CheckComposerUpdatesJob extends AbstractQueuedJob implements QueuedJob { /** * The task to run * * @var BuildTask */ protected $task; /** * define the title * * @return string */ public function getTitle() { return _t( 'ComposerUpdateChecker.Title', 'Check if composer updates are available' ); } /** * define the type. */ public function getJobType() { $this->totalSteps = 1; return QueuedJob::QUEUED; } /** * init */ public function setup() { // create the instance of the task $this->task = new CheckComposerUpdatesTask(); } /** * process the */ public function process() { $this->task->run(new SS_HTTPRequest()); } } ## Instruction: Implement the job better - minor bugfix ## Code After: <?php /** * Composer Update checker job. Runs the check as a queuedjob. * * @author Peter Thaleikis * @license MIT */ class CheckComposerUpdatesJob extends AbstractQueuedJob implements QueuedJob { /** * The task to run * * @var BuildTask */ protected $task; /** * define the title * * @return string */ public function getTitle() { return _t( 'ComposerUpdateChecker.Title', 'Check if composer updates are available' ); } /** * define the type. */ public function getJobType() { $this->totalSteps = 1; return QueuedJob::QUEUED; } /** * init */ public function setup() { // create the instance of the task $this->task = new CheckComposerUpdatesTask(); } /** * processes the task as a job */ public function process() { // run the task $this->task->run(new SS_HTTPRequest()); // mark job as completed $this->isComplete = true; } }
<?php /** * Composer Update checker job. Runs the check as a queuedjob. * * @author Peter Thaleikis * @license MIT */ class CheckComposerUpdatesJob extends AbstractQueuedJob implements QueuedJob { /** * The task to run * * @var BuildTask */ protected $task; /** * define the title * * @return string */ public function getTitle() { return _t( 'ComposerUpdateChecker.Title', 'Check if composer updates are available' ); } /** * define the type. */ public function getJobType() { $this->totalSteps = 1; return QueuedJob::QUEUED; } /** * init */ public function setup() { // create the instance of the task $this->task = new CheckComposerUpdatesTask(); } /** - * process the + * processes the task as a job */ public function process() { + // run the task $this->task->run(new SS_HTTPRequest()); + + // mark job as completed + $this->isComplete = true; } }
6
0.12
5
1
154632b0ab27d36b63c302a550589a182a319ef8
distance_matrix.py
distance_matrix.py
from GamTools import corr import numpy as np import argparse parser = argparse.ArgumentParser(description='Calculate coverage over different window sizes for a list of bam files.') parser.add_argument('npz_frequencies_file', help='An npz file containing co-segregation frequencies to convert to correlations') args = parser.parse_args() correlation_file = args.npz_frequencies_file.split('.') correlation_file = correlation_file[0] + '.correlations.npz' freqs = np.load(args.npz_frequencies_file)['freqs'] def flatten_freqs(freqs): freqs_shape = freqs.shape flat_shape = ( freqs_shape[0] * freqs_shape[1], freqs_shape[2], freqs_shape[3]) return freqs.reshape(flat_shape) distances = np.array(map(corr, flatten_freqs(freqs))).reshape(freqs.shape[:2]) np.save_compressed(correlation_file, corr=distances)
from GamTools import corr import numpy as np import argparse parser = argparse.ArgumentParser(description='Calculate coverage over different window sizes for a list of bam files.') parser.add_argument('npz_frequencies_file', help='An npz file containing co-segregation frequencies to convert to correlations') args = parser.parse_args() correlation_file = args.npz_frequencies_file.split('.') correlation_file[correlation_file.index('chrom')] = "corr" correlation_file = '.'.join(correlation_file) freqs = np.load(args.npz_frequencies_file)['freqs'] def flatten_freqs(freqs): freqs_shape = freqs.shape flat_shape = ( freqs_shape[0] * freqs_shape[1], freqs_shape[2], freqs_shape[3]) return freqs.reshape(flat_shape) distances = np.array(map(corr, flatten_freqs(freqs))).reshape(freqs.shape[:2]) np.savez_compressed(correlation_file, corr=distances)
Change how/where to save the file
Change how/where to save the file
Python
apache-2.0
pombo-lab/gamtools,pombo-lab/gamtools
python
## Code Before: from GamTools import corr import numpy as np import argparse parser = argparse.ArgumentParser(description='Calculate coverage over different window sizes for a list of bam files.') parser.add_argument('npz_frequencies_file', help='An npz file containing co-segregation frequencies to convert to correlations') args = parser.parse_args() correlation_file = args.npz_frequencies_file.split('.') correlation_file = correlation_file[0] + '.correlations.npz' freqs = np.load(args.npz_frequencies_file)['freqs'] def flatten_freqs(freqs): freqs_shape = freqs.shape flat_shape = ( freqs_shape[0] * freqs_shape[1], freqs_shape[2], freqs_shape[3]) return freqs.reshape(flat_shape) distances = np.array(map(corr, flatten_freqs(freqs))).reshape(freqs.shape[:2]) np.save_compressed(correlation_file, corr=distances) ## Instruction: Change how/where to save the file ## Code After: from GamTools import corr import numpy as np import argparse parser = argparse.ArgumentParser(description='Calculate coverage over different window sizes for a list of bam files.') parser.add_argument('npz_frequencies_file', help='An npz file containing co-segregation frequencies to convert to correlations') args = parser.parse_args() correlation_file = args.npz_frequencies_file.split('.') correlation_file[correlation_file.index('chrom')] = "corr" correlation_file = '.'.join(correlation_file) freqs = np.load(args.npz_frequencies_file)['freqs'] def flatten_freqs(freqs): freqs_shape = freqs.shape flat_shape = ( freqs_shape[0] * freqs_shape[1], freqs_shape[2], freqs_shape[3]) return freqs.reshape(flat_shape) distances = np.array(map(corr, flatten_freqs(freqs))).reshape(freqs.shape[:2]) np.savez_compressed(correlation_file, corr=distances)
from GamTools import corr import numpy as np import argparse parser = argparse.ArgumentParser(description='Calculate coverage over different window sizes for a list of bam files.') parser.add_argument('npz_frequencies_file', help='An npz file containing co-segregation frequencies to convert to correlations') args = parser.parse_args() correlation_file = args.npz_frequencies_file.split('.') - correlation_file = correlation_file[0] + '.correlations.npz' + correlation_file[correlation_file.index('chrom')] = "corr" + correlation_file = '.'.join(correlation_file) freqs = np.load(args.npz_frequencies_file)['freqs'] def flatten_freqs(freqs): freqs_shape = freqs.shape flat_shape = ( freqs_shape[0] * freqs_shape[1], freqs_shape[2], freqs_shape[3]) return freqs.reshape(flat_shape) distances = np.array(map(corr, flatten_freqs(freqs))).reshape(freqs.shape[:2]) - np.save_compressed(correlation_file, corr=distances) + np.savez_compressed(correlation_file, corr=distances) ? +
5
0.217391
3
2
6f4a4acbc64493ede78fcab5fa35da1944bc69ba
base/i18n/icu_util_nacl_win64.cc
base/i18n/icu_util_nacl_win64.cc
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/i18n/icu_util.h" namespace icu_util { bool Initialize() { return true; } } // namespace icu_util
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/i18n/icu_util.h" namespace base { namespace i18n { BASE_I18N_EXPORT bool InitializeICU() { return true; } } // namespace i18n } // namespace base
Build Fix for Win: Make base_i18n_nacl_win64.dll.lib to be generated
Build Fix for Win: Make base_i18n_nacl_win64.dll.lib to be generated Since r219164, using GYP_DEFINES=component=shared_library causes build error with missing base_i18n_nacl_win64.dll.lib. This patch changes to use full qualified name of base::i18n::InitializeICU() renamed by r219164 from icu_util::Initialize(). BUG=n/a TBR= tfarina@chromium.org Review URL: https://codereview.chromium.org/23003029 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@219255 0039d316-1c4b-4281-b951-d872f2087c98
C++
bsd-3-clause
crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,bright-sparks/chromium-spacewalk,mogoweb/chromium-crosswalk,ChromiumWebApps/chromium,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,anirudhSK/chromium,mogoweb/chromium-crosswalk,patrickm/chromium.src,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,littlstar/chromium.src,Jonekee/chromium.src,dednal/chromium.src,Just-D/chromium-1,dednal/chromium.src,anirudhSK/chromium,anirudhSK/chromium,dushu1203/chromium.src,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,patrickm/chromium.src,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,krieger-od/nwjs_chromium.src,ltilve/chromium,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,littlstar/chromium.src,PeterWangIntel/chromium-crosswalk,ChromiumWebApps/chromium,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,M4sse/chromium.src,M4sse/chromium.src,ChromiumWebApps/chromium,markYoungH/chromium.src,chuan9/chromium-crosswalk,anirudhSK/chromium,anirudhSK/chromium,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,jaruba/chromium.src,axinging/chromium-crosswalk,dednal/chromium.src,Chilledheart/chromium,fujunwei/chromium-crosswalk,patrickm/chromium.src,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,ltilve/chromium,dushu1203/chromium.src,littlstar/chromium.src,Jonekee/chromium.src,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,anirudhSK/chromium,ChromiumWebApps/chromium,markYoungH/chromium.src,patrickm/chromium.src,axinging/chromium-crosswalk,ChromiumWebApps/chromium,dednal/chromium.src,ltilve/chromium,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,mogoweb/chromium-crosswalk,jaruba/chromium.src,dednal/chromium.src,dushu1203/chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,jaruba/chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,axinging/chromium-crosswalk,ltilve/chromium,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,chuan9/chromium-crosswalk,mogoweb/chromium-crosswalk,patrickm/chromium.src,anirudhSK/chromium,chuan9/chromium-crosswalk,Just-D/chromium-1,anirudhSK/chromium,littlstar/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,littlstar/chromium.src,jaruba/chromium.src,Chilledheart/chromium,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,littlstar/chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,jaruba/chromium.src,jaruba/chromium.src,markYoungH/chromium.src,markYoungH/chromium.src,littlstar/chromium.src,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,Fireblend/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,Just-D/chromium-1,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,Jonekee/chromium.src,dednal/chromium.src,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,M4sse/chromium.src,jaruba/chromium.src,patrickm/chromium.src,krieger-od/nwjs_chromium.src,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,axinging/chromium-crosswalk,Just-D/chromium-1,Fireblend/chromium-crosswalk,dushu1203/chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,fujunwei/chromium-crosswalk,Jonekee/chromium.src,mogoweb/chromium-crosswalk,patrickm/chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,patrickm/chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,ondra-novak/chromium.src,Chilledheart/chromium,Chilledheart/chromium,patrickm/chromium.src,mogoweb/chromium-crosswalk,anirudhSK/chromium,M4sse/chromium.src,fujunwei/chromium-crosswalk,littlstar/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,Fireblend/chromium-crosswalk,Chilledheart/chromium,dednal/chromium.src,ChromiumWebApps/chromium,ltilve/chromium,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,M4sse/chromium.src,dushu1203/chromium.src,ltilve/chromium,hgl888/chromium-crosswalk,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,anirudhSK/chromium,fujunwei/chromium-crosswalk,M4sse/chromium.src,ondra-novak/chromium.src,PeterWangIntel/chromium-crosswalk,ltilve/chromium,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,ltilve/chromium,jaruba/chromium.src,dednal/chromium.src,anirudhSK/chromium,dushu1203/chromium.src,Fireblend/chromium-crosswalk,ltilve/chromium,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,Jonekee/chromium.src,ondra-novak/chromium.src,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,axinging/chromium-crosswalk,anirudhSK/chromium,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src
c++
## Code Before: // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/i18n/icu_util.h" namespace icu_util { bool Initialize() { return true; } } // namespace icu_util ## Instruction: Build Fix for Win: Make base_i18n_nacl_win64.dll.lib to be generated Since r219164, using GYP_DEFINES=component=shared_library causes build error with missing base_i18n_nacl_win64.dll.lib. This patch changes to use full qualified name of base::i18n::InitializeICU() renamed by r219164 from icu_util::Initialize(). BUG=n/a TBR= tfarina@chromium.org Review URL: https://codereview.chromium.org/23003029 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@219255 0039d316-1c4b-4281-b951-d872f2087c98 ## Code After: // Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/i18n/icu_util.h" namespace base { namespace i18n { BASE_I18N_EXPORT bool InitializeICU() { return true; } } // namespace i18n } // namespace base
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/i18n/icu_util.h" - namespace icu_util { + namespace base { + namespace i18n { - bool Initialize() { + BASE_I18N_EXPORT bool InitializeICU() { return true; } - } // namespace icu_util ? ^^^^^^^ + } // namespace i18n ? ^^^ + } // namespace base
8
0.615385
5
3
28d4c72e803b672f4b3e44984af0ece769561395
README.md
README.md
GeoPatterns =========== Generate beautiful SVG patterns from a string. This is a Python-port of [Jason Long][1]'s [Ruby library][2]. [1]: https://github.com/jasonlong/ [2]: https://github.com/jasonlong/geopatterns/ Installation ------------ GeoPatterns is installable via `pip`: ```shell $ pip install geopatterns ``` Usage ----- Create a new pattern by initializing `GeoPattern()` with a string and a generator. ```python >>> from geopatterns import GeoPattern >>> pattern = GeoPattern('A string for your consideration.', generator='xes') ``` Currently available generators are: * 'hexagons' * 'overlappingcircles' * 'rings' * 'sinewaves' * 'squares' * 'xes' Get the SVG string: ```python >>> print(pattern.svg_string) u'<svg xmlns="http://www.w3.org/2000/svg" ... ``` Get the Base64-encoded string: ```python >>> print(pattern.base64_string) 'PHN2ZyB4bWxucz0iaHR0cDov... ```
GeoPatterns =========== Generate beautiful SVG patterns from a string. This is a Python-port of [Jason Long][1]'s [Ruby library][2]. [1]: https://github.com/jasonlong/ [2]: https://github.com/jasonlong/geopatterns/ Installation ------------ GeoPatterns is installable via `pip`: ```shell $ pip install geopatterns ``` Usage ----- Create a new pattern by initializing `GeoPattern()` with a string and a generator. ```python >>> from geopatterns import GeoPattern >>> pattern = GeoPattern('A string for your consideration.', generator='xes') ``` Currently available generators are: * `hexagons` * `overlappingcircles` * `rings` * `sinewaves` * `squares` * `xes` Get the SVG string: ```python >>> print(pattern.svg_string) u'<svg xmlns="http://www.w3.org/2000/svg" ... ``` Get the Base64-encoded string: ```python >>> print(pattern.base64_string) 'PHN2ZyB4bWxucz0iaHR0cDov... ```
Make that list a list.
Make that list a list.
Markdown
mit
01walid/geopatterns,bryanveloso/geopatterns,shassard/geopatterns
markdown
## Code Before: GeoPatterns =========== Generate beautiful SVG patterns from a string. This is a Python-port of [Jason Long][1]'s [Ruby library][2]. [1]: https://github.com/jasonlong/ [2]: https://github.com/jasonlong/geopatterns/ Installation ------------ GeoPatterns is installable via `pip`: ```shell $ pip install geopatterns ``` Usage ----- Create a new pattern by initializing `GeoPattern()` with a string and a generator. ```python >>> from geopatterns import GeoPattern >>> pattern = GeoPattern('A string for your consideration.', generator='xes') ``` Currently available generators are: * 'hexagons' * 'overlappingcircles' * 'rings' * 'sinewaves' * 'squares' * 'xes' Get the SVG string: ```python >>> print(pattern.svg_string) u'<svg xmlns="http://www.w3.org/2000/svg" ... ``` Get the Base64-encoded string: ```python >>> print(pattern.base64_string) 'PHN2ZyB4bWxucz0iaHR0cDov... ``` ## Instruction: Make that list a list. ## Code After: GeoPatterns =========== Generate beautiful SVG patterns from a string. This is a Python-port of [Jason Long][1]'s [Ruby library][2]. [1]: https://github.com/jasonlong/ [2]: https://github.com/jasonlong/geopatterns/ Installation ------------ GeoPatterns is installable via `pip`: ```shell $ pip install geopatterns ``` Usage ----- Create a new pattern by initializing `GeoPattern()` with a string and a generator. ```python >>> from geopatterns import GeoPattern >>> pattern = GeoPattern('A string for your consideration.', generator='xes') ``` Currently available generators are: * `hexagons` * `overlappingcircles` * `rings` * `sinewaves` * `squares` * `xes` Get the SVG string: ```python >>> print(pattern.svg_string) u'<svg xmlns="http://www.w3.org/2000/svg" ... ``` Get the Base64-encoded string: ```python >>> print(pattern.base64_string) 'PHN2ZyB4bWxucz0iaHR0cDov... ```
GeoPatterns =========== Generate beautiful SVG patterns from a string. This is a Python-port of [Jason Long][1]'s [Ruby library][2]. [1]: https://github.com/jasonlong/ [2]: https://github.com/jasonlong/geopatterns/ Installation ------------ GeoPatterns is installable via `pip`: ```shell $ pip install geopatterns ``` Usage ----- Create a new pattern by initializing `GeoPattern()` with a string and a generator. ```python >>> from geopatterns import GeoPattern >>> pattern = GeoPattern('A string for your consideration.', generator='xes') ``` Currently available generators are: - * 'hexagons' + * `hexagons` - * 'overlappingcircles' ? ---- ^ ^ + * `overlappingcircles` ? ^ ^ - * 'rings' - * 'sinewaves' - * 'squares' - * 'xes' + * `rings` + * `sinewaves` + * `squares` + * `xes` Get the SVG string: ```python >>> print(pattern.svg_string) u'<svg xmlns="http://www.w3.org/2000/svg" ... ``` Get the Base64-encoded string: ```python >>> print(pattern.base64_string) 'PHN2ZyB4bWxucz0iaHR0cDov... ```
12
0.235294
6
6
bba6634e4664a068d37c56e2a6229d927b1e8e12
.github/workflows/test-dev-stability.yml
.github/workflows/test-dev-stability.yml
name: "Dev dependencies stability check" on: schedule: - cron: "0 0 * * 0" jobs: phpunit: name: "PHPUnit" runs-on: "ubuntu-20.04" env: SYMFONY_REQUIRE: ${{matrix.symfony-require}} strategy: fail-fast: false matrix: php-version: - "8.1" dependencies: - "highest" stability: - "dev" symfony-require: - "" - "6.*" steps: - name: "Checkout" uses: "actions/checkout@v2" with: fetch-depth: 2 - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" ini-values: "zend.assertions=1" extensions: "pdo_sqlite" - name: "Globally install symfony/flex" run: "composer require --no-progress --no-scripts --no-plugins symfony/flex" - name: "Require symfony/messenger" run: "composer require --dev symfony/messenger --no-update" if: "${{ startsWith(matrix.symfony-require, '4.') }}" - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v1" with: dependency-versions: "${{ matrix.dependencies }}" composer-options: "--prefer-dist" - name: "Run PHPUnit" run: "vendor/bin/phpunit"
name: "Dev dependencies stability check" on: schedule: - cron: "0 0 * * 0" jobs: phpunit: name: "PHPUnit" runs-on: "ubuntu-20.04" env: SYMFONY_REQUIRE: ${{matrix.symfony-require}} strategy: fail-fast: false matrix: php-version: - "8.1" dependencies: - "highest" stability: - "dev" symfony-require: - "" - "6.*" steps: - name: "Checkout" uses: "actions/checkout@v2" with: fetch-depth: 2 - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" ini-values: "zend.assertions=1" extensions: "pdo_sqlite" - name: "Globally install symfony/flex" run: "composer require --no-progress --no-scripts --no-plugins symfony/flex" - name: "Require symfony/messenger" run: "composer require --dev symfony/messenger --no-update" if: "${{ startsWith(matrix.symfony-require, '4.') }}" - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v1" with: dependency-versions: "${{ matrix.dependencies }}" composer-options: "--prefer-dist" - name: "Run PHPUnit" run: "SYMFONY_DEPRECATIONS_HELPER=${{env.GITHUB_WORKSPACE}}/tests/baseline-ignore vendor/bin/phpunit"
Fix path to deprecations baseline file
CI: Fix path to deprecations baseline file
YAML
mit
doctrine/DoctrineBundle
yaml
## Code Before: name: "Dev dependencies stability check" on: schedule: - cron: "0 0 * * 0" jobs: phpunit: name: "PHPUnit" runs-on: "ubuntu-20.04" env: SYMFONY_REQUIRE: ${{matrix.symfony-require}} strategy: fail-fast: false matrix: php-version: - "8.1" dependencies: - "highest" stability: - "dev" symfony-require: - "" - "6.*" steps: - name: "Checkout" uses: "actions/checkout@v2" with: fetch-depth: 2 - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" ini-values: "zend.assertions=1" extensions: "pdo_sqlite" - name: "Globally install symfony/flex" run: "composer require --no-progress --no-scripts --no-plugins symfony/flex" - name: "Require symfony/messenger" run: "composer require --dev symfony/messenger --no-update" if: "${{ startsWith(matrix.symfony-require, '4.') }}" - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v1" with: dependency-versions: "${{ matrix.dependencies }}" composer-options: "--prefer-dist" - name: "Run PHPUnit" run: "vendor/bin/phpunit" ## Instruction: CI: Fix path to deprecations baseline file ## Code After: name: "Dev dependencies stability check" on: schedule: - cron: "0 0 * * 0" jobs: phpunit: name: "PHPUnit" runs-on: "ubuntu-20.04" env: SYMFONY_REQUIRE: ${{matrix.symfony-require}} strategy: fail-fast: false matrix: php-version: - "8.1" dependencies: - "highest" stability: - "dev" symfony-require: - "" - "6.*" steps: - name: "Checkout" uses: "actions/checkout@v2" with: fetch-depth: 2 - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" ini-values: "zend.assertions=1" extensions: "pdo_sqlite" - name: "Globally install symfony/flex" run: "composer require --no-progress --no-scripts --no-plugins symfony/flex" - name: "Require symfony/messenger" run: "composer require --dev symfony/messenger --no-update" if: "${{ startsWith(matrix.symfony-require, '4.') }}" - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v1" with: dependency-versions: "${{ matrix.dependencies }}" composer-options: "--prefer-dist" - name: "Run PHPUnit" run: "SYMFONY_DEPRECATIONS_HELPER=${{env.GITHUB_WORKSPACE}}/tests/baseline-ignore vendor/bin/phpunit"
name: "Dev dependencies stability check" on: schedule: - cron: "0 0 * * 0" jobs: phpunit: name: "PHPUnit" runs-on: "ubuntu-20.04" env: SYMFONY_REQUIRE: ${{matrix.symfony-require}} strategy: fail-fast: false matrix: php-version: - "8.1" dependencies: - "highest" stability: - "dev" symfony-require: - "" - "6.*" steps: - name: "Checkout" uses: "actions/checkout@v2" with: fetch-depth: 2 - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: php-version: "${{ matrix.php-version }}" ini-values: "zend.assertions=1" extensions: "pdo_sqlite" - name: "Globally install symfony/flex" run: "composer require --no-progress --no-scripts --no-plugins symfony/flex" - name: "Require symfony/messenger" run: "composer require --dev symfony/messenger --no-update" if: "${{ startsWith(matrix.symfony-require, '4.') }}" - name: "Install dependencies with Composer" uses: "ramsey/composer-install@v1" with: dependency-versions: "${{ matrix.dependencies }}" composer-options: "--prefer-dist" - name: "Run PHPUnit" - run: "vendor/bin/phpunit" + run: "SYMFONY_DEPRECATIONS_HELPER=${{env.GITHUB_WORKSPACE}}/tests/baseline-ignore vendor/bin/phpunit"
2
0.036364
1
1