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
654890776d31d75a5bcab4761341752890b39908
.github/ISSUE_TEMPLATE/mobile-issues.md
.github/ISSUE_TEMPLATE/mobile-issues.md
--- name: Mobile Report about: ⚠ Due to current development priorities we are not accepting mobile reports at this time. --- ⚠ **PLEASE READ** ⚠: Due to prioritising finishing the client for desktop first we are not accepting reports related to mobile platforms for the time being. Please check back in the future when the focus of development shifts towards mobile!
--- name: Mobile Report about: ⚠ Due to current development priorities we are not accepting mobile reports at this time (unless you're willing to fix them yourself!) --- ⚠ **PLEASE READ** ⚠: Due to prioritising finishing the client for desktop first we are not accepting reports related to mobile platforms for the time being, unless you're willing to fix them. If you'd like to report a problem or suggest a feature and then work on it, feel free to open an issue and highlight that you'd like to address it yourself in the issue body; mobile pull requests are also welcome. Otherwise, please check back in the future when the focus of development shifts towards mobile!
Add exemption for potential code contributors
Add exemption for potential code contributors Add an exemption clause allowing potential code contributors to submit issues if they state they would like to work on them, and note that mobile-related pull requests are still accepted. Suggested-by: Dean Herbert <1db828bcd41de75377dce59825af73ae7fca5651@ppy.sh>
Markdown
mit
UselessToucan/osu,ppy/osu,NeoAdonis/osu,peppy/osu,UselessToucan/osu,peppy/osu,smoogipoo/osu,ppy/osu,ppy/osu,peppy/osu-new,johnneijzen/osu,UselessToucan/osu,2yangk23/osu,2yangk23/osu,NeoAdonis/osu,smoogipooo/osu,johnneijzen/osu,EVAST9919/osu,EVAST9919/osu,peppy/osu,smoogipoo/osu,NeoAdonis/osu,smoogipoo/osu
markdown
## Code Before: --- name: Mobile Report about: ⚠ Due to current development priorities we are not accepting mobile reports at this time. --- ⚠ **PLEASE READ** ⚠: Due to prioritising finishing the client for desktop first we are not accepting reports related to mobile platforms for the time being. Please check back in the future when the focus of development shifts towards mobile! ## Instruction: Add exemption for potential code contributors Add an exemption clause allowing potential code contributors to submit issues if they state they would like to work on them, and note that mobile-related pull requests are still accepted. Suggested-by: Dean Herbert <1db828bcd41de75377dce59825af73ae7fca5651@ppy.sh> ## Code After: --- name: Mobile Report about: ⚠ Due to current development priorities we are not accepting mobile reports at this time (unless you're willing to fix them yourself!) --- ⚠ **PLEASE READ** ⚠: Due to prioritising finishing the client for desktop first we are not accepting reports related to mobile platforms for the time being, unless you're willing to fix them. If you'd like to report a problem or suggest a feature and then work on it, feel free to open an issue and highlight that you'd like to address it yourself in the issue body; mobile pull requests are also welcome. Otherwise, please check back in the future when the focus of development shifts towards mobile!
--- name: Mobile Report - about: ⚠ Due to current development priorities we are not accepting mobile reports at this time. ? ^ + about: ⚠ Due to current development priorities we are not accepting mobile reports at this time (unless you're willing to fix them yourself!) ? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --- - ⚠ **PLEASE READ** ⚠: Due to prioritising finishing the client for desktop first we are not accepting reports related to mobile platforms for the time being. + ⚠ **PLEASE READ** ⚠: Due to prioritising finishing the client for desktop first we are not accepting reports related to mobile platforms for the time being, unless you're willing to fix them. ? +++++++++++++++++++++++++++++++++++ + If you'd like to report a problem or suggest a feature and then work on it, feel free to open an issue and highlight that you'd like to address it yourself in the issue body; mobile pull requests are also welcome. - Please check back in the future when the focus of development shifts towards mobile! ? ^ + Otherwise, please check back in the future when the focus of development shifts towards mobile! ? ^^^^^^^^^^^^
7
1
4
3
874b593016c768eebb634311ebcaae5cc75a8ade
app/scripts/app/routes/Index.js
app/scripts/app/routes/Index.js
define([ 'ember', 'JST/index', ], function (Em) { 'use strict'; var IndexRoute = Em.Route.extend({ actions: { // error handler for when descendent // routes fail to resolve their model promises. // 'reason' is the value passed to the rejected promise. error: function (reason) { alert('Error transitioning to IndexRoute! The reason is: ' + reason); // you can try transitioning into another route. // descendent routes can implement this error handler too; // if it returns true, it'll bubble up to the parent's handler. // In this case, that's ApplicationRoute. // return true; }, }, redirect: function () { this.transitionTo('groups'); }, model: function () { }, }); return IndexRoute; });
define([ 'ember', 'JST/index', ], function (Em) { 'use strict'; var IndexRoute = Em.Route.extend({ actions: { // error handler for when descendent // routes fail to resolve their model promises. // 'reason' is the value passed to the rejected promise. error: function (reason) { alert('Error transitioning to IndexRoute! The reason is: ' + reason); // you can try transitioning into another route. // descendent routes can implement this error handler too; // if it returns true, it'll bubble up to the parent's handler. // In this case, that's ApplicationRoute. // return true; }, }, beforeModel: function () { this.transitionTo('groups'); }, }); return IndexRoute; });
Fix the way index redirect works for latest Ember
Fix the way index redirect works for latest Ember
JavaScript
mit
darvelo/wishlist,darvelo/wishlist
javascript
## Code Before: define([ 'ember', 'JST/index', ], function (Em) { 'use strict'; var IndexRoute = Em.Route.extend({ actions: { // error handler for when descendent // routes fail to resolve their model promises. // 'reason' is the value passed to the rejected promise. error: function (reason) { alert('Error transitioning to IndexRoute! The reason is: ' + reason); // you can try transitioning into another route. // descendent routes can implement this error handler too; // if it returns true, it'll bubble up to the parent's handler. // In this case, that's ApplicationRoute. // return true; }, }, redirect: function () { this.transitionTo('groups'); }, model: function () { }, }); return IndexRoute; }); ## Instruction: Fix the way index redirect works for latest Ember ## Code After: define([ 'ember', 'JST/index', ], function (Em) { 'use strict'; var IndexRoute = Em.Route.extend({ actions: { // error handler for when descendent // routes fail to resolve their model promises. // 'reason' is the value passed to the rejected promise. error: function (reason) { alert('Error transitioning to IndexRoute! The reason is: ' + reason); // you can try transitioning into another route. // descendent routes can implement this error handler too; // if it returns true, it'll bubble up to the parent's handler. // In this case, that's ApplicationRoute. // return true; }, }, beforeModel: function () { this.transitionTo('groups'); }, }); return IndexRoute; });
define([ 'ember', 'JST/index', ], function (Em) { 'use strict'; var IndexRoute = Em.Route.extend({ actions: { // error handler for when descendent // routes fail to resolve their model promises. // 'reason' is the value passed to the rejected promise. error: function (reason) { alert('Error transitioning to IndexRoute! The reason is: ' + reason); // you can try transitioning into another route. // descendent routes can implement this error handler too; // if it returns true, it'll bubble up to the parent's handler. // In this case, that's ApplicationRoute. // return true; }, }, - redirect: function () { ? -- ^^ + beforeModel: function () { ? ++++ ++ ^ this.transitionTo('groups'); - }, - - model: function () { - }, }); return IndexRoute; });
6
0.166667
1
5
c986e999c6de225793b6837f66b64149c622a4a9
README.md
README.md
Tanay's personal website ======================== Build Status: ![build-status](https://travis-ci.org/tanayseven/personal_website.svg?branch=master) This is my personal website which I use to post my own content (usually blogs)
Tanay's personal website ======================== Build Status: ![build-status](https://travis-ci.org/tanayseven/personal_website.svg?branch=master) This is my personal website which I use to post my own content (usually blogs) Instructions: ------------- ```bash # Install all the requirements (recommended to use an isolated Python 3.5 virtualenv) pip install -r requirements.txt # Build the project into static pages ./manage build # Run all the unit tests py.test # Run all the Radish based BDD acceptance tests radish features/ ```
Add instructions to build/run this project
Add instructions to build/run this project
Markdown
mit
tanayseven/personal_website,tanayseven/personal_website,tanayseven/personal_website,tanayseven/personal_website
markdown
## Code Before: Tanay's personal website ======================== Build Status: ![build-status](https://travis-ci.org/tanayseven/personal_website.svg?branch=master) This is my personal website which I use to post my own content (usually blogs) ## Instruction: Add instructions to build/run this project ## Code After: Tanay's personal website ======================== Build Status: ![build-status](https://travis-ci.org/tanayseven/personal_website.svg?branch=master) This is my personal website which I use to post my own content (usually blogs) Instructions: ------------- ```bash # Install all the requirements (recommended to use an isolated Python 3.5 virtualenv) pip install -r requirements.txt # Build the project into static pages ./manage build # Run all the unit tests py.test # Run all the Radish based BDD acceptance tests radish features/ ```
Tanay's personal website ======================== Build Status: ![build-status](https://travis-ci.org/tanayseven/personal_website.svg?branch=master) This is my personal website which I use to post my own content (usually blogs) + + Instructions: + ------------- + ```bash + # Install all the requirements (recommended to use an isolated Python 3.5 virtualenv) + pip install -r requirements.txt + + # Build the project into static pages + ./manage build + + # Run all the unit tests + py.test + + # Run all the Radish based BDD acceptance tests + radish features/ + ```
16
2.666667
16
0
c2cfd5e7d181daf7e495ae0c9ce1aa44b074c754
src/ZF1/Controller/AbstractController.php
src/ZF1/Controller/AbstractController.php
<?php namespace Del\Common\ZF1\Controller; use Del\Common\ContainerService; use Exception; use Zend_Auth; use Zend_Controller_Action; use Zend_Layout; class AbstractController extends Zend_Controller_Action { protected $container; public function init() { $this->container = ContainerService::getInstance()->getContainer(); } /** * @param $key * @return mixed */ public function getContainerObject($key) { return $this->container[$key]; } /** * */ public function sendJSONResponse(array $array) { Zend_Layout::getMvcInstance()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $this->getResponse()->setHeader('Content-Type', 'application/json'); $this->_helper->json($array); } public function getIdentity() { if(Zend_Auth::getInstance()->hasIdentity()) { return Zend_Auth::getInstance()->getIdentity(); } throw new Exception('No Identity.'); } }
<?php namespace Del\Common\ZF1\Controller; use Del\Common\ContainerService; use Exception; use Zend_Auth; use Zend_Controller_Action; use Zend_Layout; class AbstractController extends Zend_Controller_Action { protected $container; public function init() { $this->container = ContainerService::getInstance()->getContainer(); } /** * @param $key * @return mixed */ public function getContainerObject($key) { return $this->container[$key]; } /** * */ public function sendJSONResponse(array $array) { Zend_Layout::getMvcInstance()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $this->getResponse()->setHeader('Content-Type', 'application/json'); $this->_helper->json($array); } public function getIdentity() { if(Zend_Auth::getInstance()->hasIdentity()) { return Zend_Auth::getInstance()->getIdentity(); } throw new Exception('No Identity.'); } /** * @return Zend_Controller_Request_Http */ public function getRequest() { return parent::getRequest(); } }
Add getRequest that PHPStorm will complete (ZF1 bad design)
Add getRequest that PHPStorm will complete (ZF1 bad design)
PHP
mit
delboy1978uk/common
php
## Code Before: <?php namespace Del\Common\ZF1\Controller; use Del\Common\ContainerService; use Exception; use Zend_Auth; use Zend_Controller_Action; use Zend_Layout; class AbstractController extends Zend_Controller_Action { protected $container; public function init() { $this->container = ContainerService::getInstance()->getContainer(); } /** * @param $key * @return mixed */ public function getContainerObject($key) { return $this->container[$key]; } /** * */ public function sendJSONResponse(array $array) { Zend_Layout::getMvcInstance()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $this->getResponse()->setHeader('Content-Type', 'application/json'); $this->_helper->json($array); } public function getIdentity() { if(Zend_Auth::getInstance()->hasIdentity()) { return Zend_Auth::getInstance()->getIdentity(); } throw new Exception('No Identity.'); } } ## Instruction: Add getRequest that PHPStorm will complete (ZF1 bad design) ## Code After: <?php namespace Del\Common\ZF1\Controller; use Del\Common\ContainerService; use Exception; use Zend_Auth; use Zend_Controller_Action; use Zend_Layout; class AbstractController extends Zend_Controller_Action { protected $container; public function init() { $this->container = ContainerService::getInstance()->getContainer(); } /** * @param $key * @return mixed */ public function getContainerObject($key) { return $this->container[$key]; } /** * */ public function sendJSONResponse(array $array) { Zend_Layout::getMvcInstance()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $this->getResponse()->setHeader('Content-Type', 'application/json'); $this->_helper->json($array); } public function getIdentity() { if(Zend_Auth::getInstance()->hasIdentity()) { return Zend_Auth::getInstance()->getIdentity(); } throw new Exception('No Identity.'); } /** * @return Zend_Controller_Request_Http */ public function getRequest() { return parent::getRequest(); } }
<?php namespace Del\Common\ZF1\Controller; use Del\Common\ContainerService; use Exception; use Zend_Auth; use Zend_Controller_Action; use Zend_Layout; class AbstractController extends Zend_Controller_Action { protected $container; public function init() { $this->container = ContainerService::getInstance()->getContainer(); } /** * @param $key * @return mixed */ public function getContainerObject($key) { return $this->container[$key]; } /** * */ public function sendJSONResponse(array $array) { Zend_Layout::getMvcInstance()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); $this->getResponse()->setHeader('Content-Type', 'application/json'); $this->_helper->json($array); } public function getIdentity() { if(Zend_Auth::getInstance()->hasIdentity()) { return Zend_Auth::getInstance()->getIdentity(); } throw new Exception('No Identity.'); } + + /** + * @return Zend_Controller_Request_Http + */ + public function getRequest() + { + return parent::getRequest(); + } }
8
0.170213
8
0
f06cafdebd88bfb9d144bda0f87b722f45777815
run_ortmodule_mvp.sh
run_ortmodule_mvp.sh
cur_dir=$(basename `pwd`) if [[ ${cur_dir} != "RelWithDebInfo" ]] then echo "Going to build folder" cd build/Linux/RelWithDebInfo fi echo "Exporting PYTHONPATH to use build dir as onnxruntime package" export PYTHONPATH=/home/thiagofc/dev/github/onnxruntime/build/Linux/RelWithDebInfo/ echo "Copying PyTorch frontend source-code to build folder" cp -Rf ../../../orttraining/orttraining/python/training/* ../../../build/Linux/RelWithDebInfo/onnxruntime/training/ echo "Running MNIST through Optimized API (ORTTrainer) to get full training graph" python ../../../samples/python/mnist/ort_mnist.py --train-steps 1 --test-batch-size 0 --save-path "." echo "Splitting full training graph in forward and backward graphs" python ../../../orttraining/orttraining/test/python/orttraining_test_ortmodule_basic_transform_model.py model_with_training.onnx echo "Running Flexible API (ORTModule)" python ../../../orttraining/orttraining/test/python/orttraining_test_ortmodule_basic.py
cur_dir=$(basename `pwd`) if [[ ${cur_dir} != "RelWithDebInfo" ]] then echo "Going to build folder (aka build/Linux/RelWithDebInfo)" cd build/Linux/RelWithDebInfo fi echo "Exporting PYTHONPATH to use build dir as onnxruntime package" export PYTHONPATH=$(pwd) echo "Copying PyTorch frontend source-code to build folder" cp -Rf ../../../orttraining/orttraining/python/training/* ../../../build/Linux/RelWithDebInfo/onnxruntime/training/ echo "Running MNIST through Optimized API (ORTTrainer) to get full training graph" python ../../../samples/python/mnist/ort_mnist.py --train-steps 1 --test-batch-size 0 --save-path "." echo "Splitting full training graph in forward and backward graphs" python ../../../orttraining/orttraining/test/python/orttraining_test_ortmodule_basic_transform_model.py model_with_training.onnx echo "Running Flexible API (ORTModule)" python ../../../orttraining/orttraining/test/python/orttraining_test_ortmodule_basic.py
Fix path on test script
Fix path on test script
Shell
mit
microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime
shell
## Code Before: cur_dir=$(basename `pwd`) if [[ ${cur_dir} != "RelWithDebInfo" ]] then echo "Going to build folder" cd build/Linux/RelWithDebInfo fi echo "Exporting PYTHONPATH to use build dir as onnxruntime package" export PYTHONPATH=/home/thiagofc/dev/github/onnxruntime/build/Linux/RelWithDebInfo/ echo "Copying PyTorch frontend source-code to build folder" cp -Rf ../../../orttraining/orttraining/python/training/* ../../../build/Linux/RelWithDebInfo/onnxruntime/training/ echo "Running MNIST through Optimized API (ORTTrainer) to get full training graph" python ../../../samples/python/mnist/ort_mnist.py --train-steps 1 --test-batch-size 0 --save-path "." echo "Splitting full training graph in forward and backward graphs" python ../../../orttraining/orttraining/test/python/orttraining_test_ortmodule_basic_transform_model.py model_with_training.onnx echo "Running Flexible API (ORTModule)" python ../../../orttraining/orttraining/test/python/orttraining_test_ortmodule_basic.py ## Instruction: Fix path on test script ## Code After: cur_dir=$(basename `pwd`) if [[ ${cur_dir} != "RelWithDebInfo" ]] then echo "Going to build folder (aka build/Linux/RelWithDebInfo)" cd build/Linux/RelWithDebInfo fi echo "Exporting PYTHONPATH to use build dir as onnxruntime package" export PYTHONPATH=$(pwd) echo "Copying PyTorch frontend source-code to build folder" cp -Rf ../../../orttraining/orttraining/python/training/* ../../../build/Linux/RelWithDebInfo/onnxruntime/training/ echo "Running MNIST through Optimized API (ORTTrainer) to get full training graph" python ../../../samples/python/mnist/ort_mnist.py --train-steps 1 --test-batch-size 0 --save-path "." echo "Splitting full training graph in forward and backward graphs" python ../../../orttraining/orttraining/test/python/orttraining_test_ortmodule_basic_transform_model.py model_with_training.onnx echo "Running Flexible API (ORTModule)" python ../../../orttraining/orttraining/test/python/orttraining_test_ortmodule_basic.py
cur_dir=$(basename `pwd`) if [[ ${cur_dir} != "RelWithDebInfo" ]] then - echo "Going to build folder" + echo "Going to build folder (aka build/Linux/RelWithDebInfo)" cd build/Linux/RelWithDebInfo fi echo "Exporting PYTHONPATH to use build dir as onnxruntime package" - export PYTHONPATH=/home/thiagofc/dev/github/onnxruntime/build/Linux/RelWithDebInfo/ + export PYTHONPATH=$(pwd) echo "Copying PyTorch frontend source-code to build folder" cp -Rf ../../../orttraining/orttraining/python/training/* ../../../build/Linux/RelWithDebInfo/onnxruntime/training/ echo "Running MNIST through Optimized API (ORTTrainer) to get full training graph" python ../../../samples/python/mnist/ort_mnist.py --train-steps 1 --test-batch-size 0 --save-path "." echo "Splitting full training graph in forward and backward graphs" python ../../../orttraining/orttraining/test/python/orttraining_test_ortmodule_basic_transform_model.py model_with_training.onnx echo "Running Flexible API (ORTModule)" python ../../../orttraining/orttraining/test/python/orttraining_test_ortmodule_basic.py
4
0.173913
2
2
4c6ee4d232c271226daf479800a756bc7a73837c
core/config/elasticsearch.yml
core/config/elasticsearch.yml
development: elasticsearch: hostname: localhost port: 9200 cluster: factlink_development test: elasticsearch: hostname: localhost port: 9200 cluster: factlink_test testserver: elasticsearch: hostname: localhost port: 9200 cluster: factlink_testserver staging: elasticsearch: hostname: localhost port: 9200 cluster: factlink_staging production: elasticsearch: hostname: localhost port: 9200 cluster: factlink_production
development: elasticsearch: hostname: localhost port: 9200 cluster: factlink_development test: elasticsearch: hostname: localhost port: 9200 cluster: factlink_test testserver: elasticsearch: hostname: 89.188.27.177 port: 9200 cluster: factlink_testserver staging: elasticsearch: hostname: localhost port: 9200 cluster: factlink_staging production: elasticsearch: hostname: localhost port: 9200 cluster: factlink_production
Use dedicated ElasticSearch server for testserver environment
Use dedicated ElasticSearch server for testserver environment
YAML
mit
daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core
yaml
## Code Before: development: elasticsearch: hostname: localhost port: 9200 cluster: factlink_development test: elasticsearch: hostname: localhost port: 9200 cluster: factlink_test testserver: elasticsearch: hostname: localhost port: 9200 cluster: factlink_testserver staging: elasticsearch: hostname: localhost port: 9200 cluster: factlink_staging production: elasticsearch: hostname: localhost port: 9200 cluster: factlink_production ## Instruction: Use dedicated ElasticSearch server for testserver environment ## Code After: development: elasticsearch: hostname: localhost port: 9200 cluster: factlink_development test: elasticsearch: hostname: localhost port: 9200 cluster: factlink_test testserver: elasticsearch: hostname: 89.188.27.177 port: 9200 cluster: factlink_testserver staging: elasticsearch: hostname: localhost port: 9200 cluster: factlink_staging production: elasticsearch: hostname: localhost port: 9200 cluster: factlink_production
development: elasticsearch: hostname: localhost port: 9200 cluster: factlink_development test: elasticsearch: hostname: localhost port: 9200 cluster: factlink_test testserver: elasticsearch: - hostname: localhost + hostname: 89.188.27.177 port: 9200 cluster: factlink_testserver staging: elasticsearch: hostname: localhost port: 9200 cluster: factlink_staging production: elasticsearch: hostname: localhost port: 9200 cluster: factlink_production
2
0.068966
1
1
95bb055507b83288c9208d3ea7720f6cda433e1e
packages/as/ascii-predicates.yaml
packages/as/ascii-predicates.yaml
homepage: https://github.com/typeclasses/ascii changelog-type: text hash: f2142c926fbbcb48d9e627dbe116eceb2d6ab434a91fad4064b8d8707f841313 test-bench-deps: ascii-char: -any base: -any ascii-predicates: -any maintainer: Chris Martin, Julie Moronuki synopsis: Various categorizations of ASCII characters changelog: | 1.0.0.0 - 2020-05-05 - Initial release 1.0.0.2 - 2020-05-18 - Support GHC 8.10 1.0.0.4 - 2021-02-20 - Support GHC 9.0 1.0.0.6 - 2021-09-26 - Add a test suite 1.0.0.8 - 2022-01-09 - Support GHC 9.2 basic-deps: ascii-char: ^>=1.0 base: '>=4.11 && <4.17' all-versions: - 1.0.0.0 - 1.0.0.2 - 1.0.0.4 - 1.0.0.6 - 1.0.0.8 author: Chris Martin latest: 1.0.0.8 description-type: haddock description: This package provides a variety of predicates on the ASCII character set. license-name: Apache-2.0
homepage: https://github.com/typeclasses/ascii changelog-type: '' hash: 575c82ed825c40ee7ff00f742a2ec23cd0cf83deae30ada7c7c528d215e4435a test-bench-deps: ascii-char: ^>=1.0 base: '>=4.11 && <4.17' hedgehog: ^>=1.0 || ^>=1.1 ascii-predicates: -any maintainer: Chris Martin, Julie Moronuki synopsis: Various categorizations of ASCII characters changelog: '' basic-deps: ascii-char: ^>=1.0 base: '>=4.11 && <4.17' all-versions: - 1.0.0.0 - 1.0.0.2 - 1.0.0.4 - 1.0.0.6 - 1.0.0.8 - 1.0.0.10 author: Chris Martin latest: 1.0.0.10 description-type: haddock description: |- This package provides a variety of predicates on the ASCII character set. license-name: Apache-2.0
Update from Hackage at 2022-03-22T22:10:39Z
Update from Hackage at 2022-03-22T22:10:39Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://github.com/typeclasses/ascii changelog-type: text hash: f2142c926fbbcb48d9e627dbe116eceb2d6ab434a91fad4064b8d8707f841313 test-bench-deps: ascii-char: -any base: -any ascii-predicates: -any maintainer: Chris Martin, Julie Moronuki synopsis: Various categorizations of ASCII characters changelog: | 1.0.0.0 - 2020-05-05 - Initial release 1.0.0.2 - 2020-05-18 - Support GHC 8.10 1.0.0.4 - 2021-02-20 - Support GHC 9.0 1.0.0.6 - 2021-09-26 - Add a test suite 1.0.0.8 - 2022-01-09 - Support GHC 9.2 basic-deps: ascii-char: ^>=1.0 base: '>=4.11 && <4.17' all-versions: - 1.0.0.0 - 1.0.0.2 - 1.0.0.4 - 1.0.0.6 - 1.0.0.8 author: Chris Martin latest: 1.0.0.8 description-type: haddock description: This package provides a variety of predicates on the ASCII character set. license-name: Apache-2.0 ## Instruction: Update from Hackage at 2022-03-22T22:10:39Z ## Code After: homepage: https://github.com/typeclasses/ascii changelog-type: '' hash: 575c82ed825c40ee7ff00f742a2ec23cd0cf83deae30ada7c7c528d215e4435a test-bench-deps: ascii-char: ^>=1.0 base: '>=4.11 && <4.17' hedgehog: ^>=1.0 || ^>=1.1 ascii-predicates: -any maintainer: Chris Martin, Julie Moronuki synopsis: Various categorizations of ASCII characters changelog: '' basic-deps: ascii-char: ^>=1.0 base: '>=4.11 && <4.17' all-versions: - 1.0.0.0 - 1.0.0.2 - 1.0.0.4 - 1.0.0.6 - 1.0.0.8 - 1.0.0.10 author: Chris Martin latest: 1.0.0.10 description-type: haddock description: |- This package provides a variety of predicates on the ASCII character set. license-name: Apache-2.0
homepage: https://github.com/typeclasses/ascii - changelog-type: text ? ^^^^ + changelog-type: '' ? ^^ - hash: f2142c926fbbcb48d9e627dbe116eceb2d6ab434a91fad4064b8d8707f841313 + hash: 575c82ed825c40ee7ff00f742a2ec23cd0cf83deae30ada7c7c528d215e4435a test-bench-deps: - ascii-char: -any - base: -any + ascii-char: ^>=1.0 + base: '>=4.11 && <4.17' + hedgehog: ^>=1.0 || ^>=1.1 ascii-predicates: -any maintainer: Chris Martin, Julie Moronuki synopsis: Various categorizations of ASCII characters - changelog: | ? ^ + changelog: '' ? ^^ - 1.0.0.0 - 2020-05-05 - Initial release - 1.0.0.2 - 2020-05-18 - Support GHC 8.10 - 1.0.0.4 - 2021-02-20 - Support GHC 9.0 - 1.0.0.6 - 2021-09-26 - Add a test suite - 1.0.0.8 - 2022-01-09 - Support GHC 9.2 basic-deps: ascii-char: ^>=1.0 base: '>=4.11 && <4.17' all-versions: - 1.0.0.0 - 1.0.0.2 - 1.0.0.4 - 1.0.0.6 - 1.0.0.8 + - 1.0.0.10 author: Chris Martin - latest: 1.0.0.8 ? ^ + latest: 1.0.0.10 ? ^^ description-type: haddock - description: This package provides a variety of predicates on the ASCII character - set. + description: |- + This package provides a variety of predicates + on the ASCII character set. license-name: Apache-2.0
24
0.8
11
13
914e94f9e5531465fdf6028734fb99402fae3411
templates/html5/output.js
templates/html5/output.js
::if embeddedLibraries::::foreach (embeddedLibraries):: ::__current__::::end::::end:: // lime.embed namespace wrapper (function ($hx_exports, $global) { "use strict"; $hx_exports.lime = $hx_exports.lime || {}; $hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {}; $hx_exports.lime.$scripts["::APP_FILE::"] = (function(exports, global) { ::SOURCE_FILE:: }); // End namespace wrapper $hx_exports.lime.embed = function(projectName) { var exports = {}; $hx_exports.lime.$scripts[projectName](exports, $global); for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key]; exports.lime.embed.apply(exports.lime, arguments); return exports; }; })(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this);
var $hx_script = (function(exports, global) { ::SOURCE_FILE::}); (function ($hx_exports, $global) { "use strict"; $hx_exports.lime = $hx_exports.lime || {}; $hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {}; $hx_exports.lime.$scripts["::APP_FILE::"] = $hx_script; $hx_exports.lime.embed = function(projectName) { var exports = {}; $hx_exports.lime.$scripts[projectName](exports, $global); for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key]; exports.lime.embed.apply(exports.lime, arguments); return exports; }; })(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this); ::if embeddedLibraries::::foreach (embeddedLibraries)::::__current__:: ::end::::end::
Fix line numbers for HTML5 source maps
Fix line numbers for HTML5 source maps
JavaScript
mit
madrazo/lime-1,player-03/lime,madrazo/lime-1,MinoGames/lime,openfl/lime,player-03/lime,openfl/lime,madrazo/lime-1,madrazo/lime-1,MinoGames/lime,openfl/lime,openfl/lime,madrazo/lime-1,player-03/lime,MinoGames/lime,openfl/lime,player-03/lime,player-03/lime,MinoGames/lime,MinoGames/lime,MinoGames/lime,player-03/lime,madrazo/lime-1,player-03/lime,MinoGames/lime,openfl/lime,madrazo/lime-1,openfl/lime
javascript
## Code Before: ::if embeddedLibraries::::foreach (embeddedLibraries):: ::__current__::::end::::end:: // lime.embed namespace wrapper (function ($hx_exports, $global) { "use strict"; $hx_exports.lime = $hx_exports.lime || {}; $hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {}; $hx_exports.lime.$scripts["::APP_FILE::"] = (function(exports, global) { ::SOURCE_FILE:: }); // End namespace wrapper $hx_exports.lime.embed = function(projectName) { var exports = {}; $hx_exports.lime.$scripts[projectName](exports, $global); for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key]; exports.lime.embed.apply(exports.lime, arguments); return exports; }; })(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this); ## Instruction: Fix line numbers for HTML5 source maps ## Code After: var $hx_script = (function(exports, global) { ::SOURCE_FILE::}); (function ($hx_exports, $global) { "use strict"; $hx_exports.lime = $hx_exports.lime || {}; $hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {}; $hx_exports.lime.$scripts["::APP_FILE::"] = $hx_script; $hx_exports.lime.embed = function(projectName) { var exports = {}; $hx_exports.lime.$scripts[projectName](exports, $global); for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key]; exports.lime.embed.apply(exports.lime, arguments); return exports; }; })(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this); ::if embeddedLibraries::::foreach (embeddedLibraries)::::__current__:: ::end::::end::
+ var $hx_script = (function(exports, global) { ::SOURCE_FILE::}); - ::if embeddedLibraries::::foreach (embeddedLibraries):: - ::__current__::::end::::end:: - // lime.embed namespace wrapper (function ($hx_exports, $global) { "use strict"; $hx_exports.lime = $hx_exports.lime || {}; $hx_exports.lime.$scripts = $hx_exports.lime.$scripts || {}; + $hx_exports.lime.$scripts["::APP_FILE::"] = $hx_script; - $hx_exports.lime.$scripts["::APP_FILE::"] = (function(exports, global) { - ::SOURCE_FILE:: - }); - // End namespace wrapper $hx_exports.lime.embed = function(projectName) { var exports = {}; $hx_exports.lime.$scripts[projectName](exports, $global); for (var key in exports) $hx_exports[key] = $hx_exports[key] || exports[key]; exports.lime.embed.apply(exports.lime, arguments); return exports; }; })(typeof exports != "undefined" ? exports : typeof window != "undefined" ? window : typeof self != "undefined" ? self : this, typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this); + ::if embeddedLibraries::::foreach (embeddedLibraries)::::__current__:: + ::end::::end::
11
0.647059
4
7
60f786487b88b1a78df99038ff75430924a44a0d
app/javascript/app/styles/themes/card/card-light.scss
app/javascript/app/styles/themes/card/card-light.scss
@import '~styles/settings.scss'; .card { color: "pink"; border-radius: 6px; border-color: transparent; box-shadow: 0 2px 20px 0 #E8ECF5; margin: 0.9375rem; } .contentContainer { background-color: #ecf1fa; display: flex; align-items: center; padding: 0 30px; min-height: 70px; } .title { font-weight: $font-weight; } .data { background-color: white; }
@import '~styles/settings.scss'; .card { color: "pink"; border-radius: 6px; border-color: transparent; box-shadow: 0 2px 20px 0 #e8ecf5; margin: 15px; } .contentContainer { background-color: #ecf1fa; display: flex; align-items: center; padding: 0 30px; min-height: 70px; } .title { font-weight: $font-weight; } .data { background-color: white; }
Change margin in card-ligth style
Change margin in card-ligth style
SCSS
mit
Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch,Vizzuality/climate-watch
scss
## Code Before: @import '~styles/settings.scss'; .card { color: "pink"; border-radius: 6px; border-color: transparent; box-shadow: 0 2px 20px 0 #E8ECF5; margin: 0.9375rem; } .contentContainer { background-color: #ecf1fa; display: flex; align-items: center; padding: 0 30px; min-height: 70px; } .title { font-weight: $font-weight; } .data { background-color: white; } ## Instruction: Change margin in card-ligth style ## Code After: @import '~styles/settings.scss'; .card { color: "pink"; border-radius: 6px; border-color: transparent; box-shadow: 0 2px 20px 0 #e8ecf5; margin: 15px; } .contentContainer { background-color: #ecf1fa; display: flex; align-items: center; padding: 0 30px; min-height: 70px; } .title { font-weight: $font-weight; } .data { background-color: white; }
@import '~styles/settings.scss'; .card { color: "pink"; border-radius: 6px; border-color: transparent; - box-shadow: 0 2px 20px 0 #E8ECF5; ? ^ ^^^ + box-shadow: 0 2px 20px 0 #e8ecf5; ? ^ ^^^ - margin: 0.9375rem; + margin: 15px; } .contentContainer { background-color: #ecf1fa; display: flex; align-items: center; padding: 0 30px; min-height: 70px; } .title { font-weight: $font-weight; } .data { background-color: white; }
4
0.16
2
2
b5aea72295be2befeb7927497ce1c87fecec541f
app/controllers/pages.rb
app/controllers/pages.rb
class Pages < Application def index @pages = Page.all display @pages end # I wonder if merb-action-args could conceivably support nil defaults def show(id, version = '') @page = Page.first(:slug => id) @page.select_version!(version.to_i) unless version.empty? raise NotFound unless @page display @page end def new @page = Page.new render end def edit(id, version = '') @page = Page.first(:slug => id) @page.select_version!(version.to_i) unless version.empty? raise NotFound unless @page render end def create @page = Page.new(params[:page]) if @page.save redirect url(:page, @page) else render :new end end def update(id) @page = Page.first(:slug => id) raise NotFound unless @page if @page.update_attributes(:content => params[:page][:content]) redirect url(:page, @page) else raise BadRequest end end end
class Pages < Application def index @pages = Page.all display @pages end # I wonder if merb-action-args could conceivably support nil defaults def show(id, version = '') @page = Page.first(:slug => id) raise NotFound unless @page @page.select_version!(version.to_i) unless version.empty? display @page end def new @page = Page.new render end def edit(id, version = '') @page = Page.first(:slug => id) raise NotFound unless @page @page.select_version!(version.to_i) unless version.empty? render end def create @page = Page.new(params[:page]) if @page.save redirect url(:page, @page) else render :new end end def update(id) @page = Page.first(:slug => id) raise NotFound unless @page if @page.update_attributes(:content => params[:page][:content]) redirect url(:page, @page) else raise BadRequest end end end
Fix a 500 error when trying to show/edit an invalid page at a given version
Fix a 500 error when trying to show/edit an invalid page at a given version
Ruby
mit
kad3nce/collective,kad3nce/collective,kad3nce/collective,kad3nce/collective
ruby
## Code Before: class Pages < Application def index @pages = Page.all display @pages end # I wonder if merb-action-args could conceivably support nil defaults def show(id, version = '') @page = Page.first(:slug => id) @page.select_version!(version.to_i) unless version.empty? raise NotFound unless @page display @page end def new @page = Page.new render end def edit(id, version = '') @page = Page.first(:slug => id) @page.select_version!(version.to_i) unless version.empty? raise NotFound unless @page render end def create @page = Page.new(params[:page]) if @page.save redirect url(:page, @page) else render :new end end def update(id) @page = Page.first(:slug => id) raise NotFound unless @page if @page.update_attributes(:content => params[:page][:content]) redirect url(:page, @page) else raise BadRequest end end end ## Instruction: Fix a 500 error when trying to show/edit an invalid page at a given version ## Code After: class Pages < Application def index @pages = Page.all display @pages end # I wonder if merb-action-args could conceivably support nil defaults def show(id, version = '') @page = Page.first(:slug => id) raise NotFound unless @page @page.select_version!(version.to_i) unless version.empty? display @page end def new @page = Page.new render end def edit(id, version = '') @page = Page.first(:slug => id) raise NotFound unless @page @page.select_version!(version.to_i) unless version.empty? render end def create @page = Page.new(params[:page]) if @page.save redirect url(:page, @page) else render :new end end def update(id) @page = Page.first(:slug => id) raise NotFound unless @page if @page.update_attributes(:content => params[:page][:content]) redirect url(:page, @page) else raise BadRequest end end end
class Pages < Application def index @pages = Page.all display @pages end # I wonder if merb-action-args could conceivably support nil defaults def show(id, version = '') @page = Page.first(:slug => id) + raise NotFound unless @page @page.select_version!(version.to_i) unless version.empty? - raise NotFound unless @page display @page end def new @page = Page.new render end def edit(id, version = '') @page = Page.first(:slug => id) + raise NotFound unless @page @page.select_version!(version.to_i) unless version.empty? - raise NotFound unless @page render end def create @page = Page.new(params[:page]) if @page.save redirect url(:page, @page) else render :new end end def update(id) @page = Page.first(:slug => id) raise NotFound unless @page if @page.update_attributes(:content => params[:page][:content]) redirect url(:page, @page) else raise BadRequest end end end
4
0.088889
2
2
7d3fe54c7c8d15706f57bf1f3c381072219060c8
deploy.sh
deploy.sh
echo "Hold onto your butts" composer install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress npm install #bower install #bundle install gulp --prod
echo "Hold onto your butts" composer install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress npm install #bower install #bundle install gulp --prod chmod 777 storage chmod 777 storage/logs
Set permissions on storage dir
Set permissions on storage dir
Shell
mit
phpem/team-nfc-hack24,phpem/team-nfc-hack24,phpem/team-nfc-hack24,phpem/team-nfc-hack24
shell
## Code Before: echo "Hold onto your butts" composer install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress npm install #bower install #bundle install gulp --prod ## Instruction: Set permissions on storage dir ## Code After: echo "Hold onto your butts" composer install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress npm install #bower install #bundle install gulp --prod chmod 777 storage chmod 777 storage/logs
echo "Hold onto your butts" composer install --no-dev --verbose --prefer-dist --optimize-autoloader --no-progress npm install #bower install #bundle install gulp --prod + chmod 777 storage + chmod 777 storage/logs
2
0.333333
2
0
e95eb0f19da1f546377a43a39848e8e2648532f0
jquery.clickhold.js
jquery.clickhold.js
(function( $ ){ $.fn.clickHold = function( callback ) { var intervalTimer; return this.mousedown(function(){ callback(); intervalTimer = setInterval(function(){ callback(); }, 100); }).bind('mouseup mouseout', function(){ clearInterval(intervalTimer); }); } })( jQuery );
(function( $ ){ $.fn.clickHold = function( callback, completeCallback ) { var intervalTimer; var active; return this.mousedown(function(){ active = true; callback(); intervalTimer = setInterval(function(){ callback(); }, 100); }).bind('mouseup mouseout', function(){ if(active) { active = false; clearInterval(intervalTimer); if(typeof completeCallback !== 'undefined') { completeCallback(); } } }); } })( jQuery );
Exit bind() being called twice - once on mouseup, again on mouseout so added active flag to prevent double-running Added completeCallback - gets executed on mouseup/mouseout
Exit bind() being called twice - once on mouseup, again on mouseout so added active flag to prevent double-running Added completeCallback - gets executed on mouseup/mouseout
JavaScript
mit
chrisbarr/jQuery.clickHold
javascript
## Code Before: (function( $ ){ $.fn.clickHold = function( callback ) { var intervalTimer; return this.mousedown(function(){ callback(); intervalTimer = setInterval(function(){ callback(); }, 100); }).bind('mouseup mouseout', function(){ clearInterval(intervalTimer); }); } })( jQuery ); ## Instruction: Exit bind() being called twice - once on mouseup, again on mouseout so added active flag to prevent double-running Added completeCallback - gets executed on mouseup/mouseout ## Code After: (function( $ ){ $.fn.clickHold = function( callback, completeCallback ) { var intervalTimer; var active; return this.mousedown(function(){ active = true; callback(); intervalTimer = setInterval(function(){ callback(); }, 100); }).bind('mouseup mouseout', function(){ if(active) { active = false; clearInterval(intervalTimer); if(typeof completeCallback !== 'undefined') { completeCallback(); } } }); } })( jQuery );
(function( $ ){ - $.fn.clickHold = function( callback ) { + $.fn.clickHold = function( callback, completeCallback ) { ? ++++++++++++++++++ var intervalTimer; + var active; return this.mousedown(function(){ + active = true; callback(); intervalTimer = setInterval(function(){ callback(); }, 100); }).bind('mouseup mouseout', function(){ + if(active) + { + active = false; - clearInterval(intervalTimer); + clearInterval(intervalTimer); ? + + + if(typeof completeCallback !== 'undefined') + { + completeCallback(); + } + } }); } })( jQuery );
15
0.9375
13
2
cd79a3ead1532cdaba23d13a44f8cce06610af27
README.md
README.md
Authenticator.Net ================= (Google) Authenticator library for .NET. Work in progress.
Authenticator.Net ================= _Hobby project in progress - you should not attempt to use this for anything security related unless you know what you are doing and know how to verify the implementation._ Two factor authentication have become common on the web today. This library attempts to implement the open standards used in many places in .NET for easy consumption by .NET developers. These standards are: * [RFC 4226](https://tools.ietf.org/html/rfc4226): HMAC-Based One-time Password (HOTP) algorithm * [RFC 6238](https://tools.ietf.org/html/rfc6238): Time-based One-time Password (TOTP) algorithm The initial goal will be to provide the client side parts of the two RFCs, thus making it easy to implement a Google Authenticator style app in .NET, or embed one-time password generation in existing apps. Serverside functionality (Validating passwords) might be added later.
Add readme - project description.
Add readme - project description.
Markdown
mit
driis/Authenticator.Net
markdown
## Code Before: Authenticator.Net ================= (Google) Authenticator library for .NET. Work in progress. ## Instruction: Add readme - project description. ## Code After: Authenticator.Net ================= _Hobby project in progress - you should not attempt to use this for anything security related unless you know what you are doing and know how to verify the implementation._ Two factor authentication have become common on the web today. This library attempts to implement the open standards used in many places in .NET for easy consumption by .NET developers. These standards are: * [RFC 4226](https://tools.ietf.org/html/rfc4226): HMAC-Based One-time Password (HOTP) algorithm * [RFC 6238](https://tools.ietf.org/html/rfc6238): Time-based One-time Password (TOTP) algorithm The initial goal will be to provide the client side parts of the two RFCs, thus making it easy to implement a Google Authenticator style app in .NET, or embed one-time password generation in existing apps. Serverside functionality (Validating passwords) might be added later.
Authenticator.Net ================= - (Google) Authenticator library for .NET. Work in progress. + _Hobby project in progress - you should not attempt to use this for anything security related unless you know what you are doing and know how to verify the implementation._ + + Two factor authentication have become common on the web today. This library attempts to implement the open standards used in many places in .NET for easy consumption by .NET developers. + These standards are: + + * [RFC 4226](https://tools.ietf.org/html/rfc4226): HMAC-Based One-time Password (HOTP) algorithm + * [RFC 6238](https://tools.ietf.org/html/rfc6238): Time-based One-time Password (TOTP) algorithm + + The initial goal will be to provide the client side parts of the two RFCs, thus making it easy to implement a Google Authenticator style app in .NET, or embed one-time password generation in existing apps. + + Serverside functionality (Validating passwords) might be added later.
12
3
11
1
819e8f5689534157487e7670a0299b94c50ac11e
templates/test_helper.rb
templates/test_helper.rb
require 'simplecov' SimpleCov.start 'rails' ENV['RAILS_ENV'] = 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require 'minitest/rails' require 'minitest/rails/capybara' require 'minitest/focus' require 'minitest/colorize' require 'webmock/minitest' require 'database_cleaner' module Minitest::Expectations infect_an_assertion :assert_redirected_to, :must_redirect_to infect_an_assertion :assert_template, :must_render_template infect_an_assertion :assert_response, :must_respond_with end Dir[Rails.root.join('test/support/**/*.rb')].each{ |file| require file } class ActiveSupport::TestCase fixtures :all end class Minitest::Unit::TestCase class << self alias_method :context, :describe end end Capybara.javascript_driver = :poltergeist WebMock.disable_net_connect!(allow_localhost: true)
require 'simplecov' SimpleCov.start 'rails' ENV['RAILS_ENV'] = 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require 'minitest/rails' require 'minitest/rails/capybara' require 'capybara/poltergeist' require 'minitest/focus' require 'minitest/colorize' require 'webmock/minitest' require 'database_cleaner' module Minitest::Expectations infect_an_assertion :assert_redirected_to, :must_redirect_to infect_an_assertion :assert_template, :must_render_template infect_an_assertion :assert_response, :must_respond_with end Dir[Rails.root.join('test/support/**/*.rb')].each{ |file| require file } class ActiveSupport::TestCase fixtures :all end class Minitest::Unit::TestCase class << self alias_method :context, :describe end end Capybara.javascript_driver = :poltergeist Capybara.default_driver = :poltergeist WebMock.disable_net_connect!(allow_localhost: true)
Set poltergeist as default javascript driver
Set poltergeist as default javascript driver
Ruby
mit
mariochavez/tirantes,mariochavez/tirantes,mariochavez/tirantes
ruby
## Code Before: require 'simplecov' SimpleCov.start 'rails' ENV['RAILS_ENV'] = 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require 'minitest/rails' require 'minitest/rails/capybara' require 'minitest/focus' require 'minitest/colorize' require 'webmock/minitest' require 'database_cleaner' module Minitest::Expectations infect_an_assertion :assert_redirected_to, :must_redirect_to infect_an_assertion :assert_template, :must_render_template infect_an_assertion :assert_response, :must_respond_with end Dir[Rails.root.join('test/support/**/*.rb')].each{ |file| require file } class ActiveSupport::TestCase fixtures :all end class Minitest::Unit::TestCase class << self alias_method :context, :describe end end Capybara.javascript_driver = :poltergeist WebMock.disable_net_connect!(allow_localhost: true) ## Instruction: Set poltergeist as default javascript driver ## Code After: require 'simplecov' SimpleCov.start 'rails' ENV['RAILS_ENV'] = 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require 'minitest/rails' require 'minitest/rails/capybara' require 'capybara/poltergeist' require 'minitest/focus' require 'minitest/colorize' require 'webmock/minitest' require 'database_cleaner' module Minitest::Expectations infect_an_assertion :assert_redirected_to, :must_redirect_to infect_an_assertion :assert_template, :must_render_template infect_an_assertion :assert_response, :must_respond_with end Dir[Rails.root.join('test/support/**/*.rb')].each{ |file| require file } class ActiveSupport::TestCase fixtures :all end class Minitest::Unit::TestCase class << self alias_method :context, :describe end end Capybara.javascript_driver = :poltergeist Capybara.default_driver = :poltergeist WebMock.disable_net_connect!(allow_localhost: true)
require 'simplecov' SimpleCov.start 'rails' ENV['RAILS_ENV'] = 'test' require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' require 'minitest/rails' require 'minitest/rails/capybara' + require 'capybara/poltergeist' require 'minitest/focus' require 'minitest/colorize' require 'webmock/minitest' require 'database_cleaner' module Minitest::Expectations infect_an_assertion :assert_redirected_to, :must_redirect_to infect_an_assertion :assert_template, :must_render_template infect_an_assertion :assert_response, :must_respond_with end Dir[Rails.root.join('test/support/**/*.rb')].each{ |file| require file } class ActiveSupport::TestCase fixtures :all end class Minitest::Unit::TestCase class << self alias_method :context, :describe end end Capybara.javascript_driver = :poltergeist + Capybara.default_driver = :poltergeist + WebMock.disable_net_connect!(allow_localhost: true)
3
0.085714
3
0
654b7d622ef619602e05a30d10e74f3a9cd057f7
test/config/norbit.yaml
test/config/norbit.yaml
labwiki: #repos_dir: /tmp/lw_repos #sample_repo_dir: ~/tmp/foo repositories: foo: ~/tmp/labwiki plugins: experiment: ec_runner: ~/src/omf_labwiki/test/omf_exec/omf_exec-norbit.sh oml: host: norbit.npc.nicta.com.au user: oml2 pwd: omlisgoodforyou
labwiki: #repos_dir: /tmp/lw_repos #sample_repo_dir: ~/tmp/foo #ges_url: http://localhost:8002 repositories: foo: ~/tmp/labwiki plugins: experiment: ec_runner: ~/src/omf_labwiki/test/omf_exec/omf_exec-norbit.sh oml: host: norbit.npc.nicta.com.au user: oml2 pwd: omlisgoodforyou
Add gimi exp service base url to sample config file
Add gimi exp service base url to sample config file
YAML
mit
mytestbed/labwiki,mytestbed/labwiki,mytestbed/labwiki,mytestbed/labwiki
yaml
## Code Before: labwiki: #repos_dir: /tmp/lw_repos #sample_repo_dir: ~/tmp/foo repositories: foo: ~/tmp/labwiki plugins: experiment: ec_runner: ~/src/omf_labwiki/test/omf_exec/omf_exec-norbit.sh oml: host: norbit.npc.nicta.com.au user: oml2 pwd: omlisgoodforyou ## Instruction: Add gimi exp service base url to sample config file ## Code After: labwiki: #repos_dir: /tmp/lw_repos #sample_repo_dir: ~/tmp/foo #ges_url: http://localhost:8002 repositories: foo: ~/tmp/labwiki plugins: experiment: ec_runner: ~/src/omf_labwiki/test/omf_exec/omf_exec-norbit.sh oml: host: norbit.npc.nicta.com.au user: oml2 pwd: omlisgoodforyou
labwiki: #repos_dir: /tmp/lw_repos #sample_repo_dir: ~/tmp/foo + #ges_url: http://localhost:8002 repositories: foo: ~/tmp/labwiki plugins: experiment: ec_runner: ~/src/omf_labwiki/test/omf_exec/omf_exec-norbit.sh oml: host: norbit.npc.nicta.com.au user: oml2 pwd: omlisgoodforyou
1
0.076923
1
0
072526a6ec1794edc0f729f2ecb66c47ed38abb9
harmony/extensions/rng.py
harmony/extensions/rng.py
import random from discord.ext import commands class RNG: def __init__(self, bot): self.bot = bot @commands.command() async def roll(self, dice: str = None): """Roll some dice. Keyword arguments: dice -- number of dice (X) and faces (Y) in the format XdY """ if not dice: await self.bot.say('Usage: !roll XdY') return try: num_dice, num_faces = map(int, dice.split('d')) except Exception: await self.bot.say('Format is XdY') return if num_dice > 20 or num_faces > 1000: await self.bot.say('Max 20 dice and 1000 faces') return if num_dice < 1 or num_faces < 1: await self.bot.say('Stick to positive numbers') return total = sum((random.randrange(1, num_faces) for _ in range(int(num_dice)))) await self.bot.say(str(total)) @commands.command() async def choose(self, *choices: str): """ Choose between the options Keyword arguments: choices -- Space separated list of options """ await self.bot.say(random.choice(choices)) def setup(bot): bot.add_cog(RNG(bot))
import random from discord.ext import commands class RNG: def __init__(self, bot): self.bot = bot @commands.command() async def roll(self, dice: str): """Roll some dice. Keyword arguments: dice -- number of dice (X) and faces (Y) in the format XdY """ try: num_faces, num_dice = map(int, dice.split('d')) except Exception: await self.bot.say('Format is XdY!') return rolls = [random.randint(1, num_faces) for _ in range(num_dice)] await self.bot.say(', '.join(rolls) + ' (total {})'.format(sum(rolls))) @commands.command() async def choose(self, *choices: str): """ Choose between the options Keyword arguments: choices -- Space separated list of options """ await self.bot.say(random.choice(choices)) def setup(bot): bot.add_cog(RNG(bot))
Make roll better and worse
Make roll better and worse
Python
apache-2.0
knyghty/harmony
python
## Code Before: import random from discord.ext import commands class RNG: def __init__(self, bot): self.bot = bot @commands.command() async def roll(self, dice: str = None): """Roll some dice. Keyword arguments: dice -- number of dice (X) and faces (Y) in the format XdY """ if not dice: await self.bot.say('Usage: !roll XdY') return try: num_dice, num_faces = map(int, dice.split('d')) except Exception: await self.bot.say('Format is XdY') return if num_dice > 20 or num_faces > 1000: await self.bot.say('Max 20 dice and 1000 faces') return if num_dice < 1 or num_faces < 1: await self.bot.say('Stick to positive numbers') return total = sum((random.randrange(1, num_faces) for _ in range(int(num_dice)))) await self.bot.say(str(total)) @commands.command() async def choose(self, *choices: str): """ Choose between the options Keyword arguments: choices -- Space separated list of options """ await self.bot.say(random.choice(choices)) def setup(bot): bot.add_cog(RNG(bot)) ## Instruction: Make roll better and worse ## Code After: import random from discord.ext import commands class RNG: def __init__(self, bot): self.bot = bot @commands.command() async def roll(self, dice: str): """Roll some dice. Keyword arguments: dice -- number of dice (X) and faces (Y) in the format XdY """ try: num_faces, num_dice = map(int, dice.split('d')) except Exception: await self.bot.say('Format is XdY!') return rolls = [random.randint(1, num_faces) for _ in range(num_dice)] await self.bot.say(', '.join(rolls) + ' (total {})'.format(sum(rolls))) @commands.command() async def choose(self, *choices: str): """ Choose between the options Keyword arguments: choices -- Space separated list of options """ await self.bot.say(random.choice(choices)) def setup(bot): bot.add_cog(RNG(bot))
import random from discord.ext import commands class RNG: def __init__(self, bot): self.bot = bot @commands.command() - async def roll(self, dice: str = None): ? ------- + async def roll(self, dice: str): """Roll some dice. Keyword arguments: dice -- number of dice (X) and faces (Y) in the format XdY """ - - if not dice: + try: + num_faces, num_dice = map(int, dice.split('d')) + except Exception: - await self.bot.say('Usage: !roll XdY') ? ^ ---------- + await self.bot.say('Format is XdY!') ? ^^^^^^^^ + return - try: - num_dice, num_faces = map(int, dice.split('d')) - except Exception: - await self.bot.say('Format is XdY') - return - - if num_dice > 20 or num_faces > 1000: - await self.bot.say('Max 20 dice and 1000 faces') - return - - if num_dice < 1 or num_faces < 1: - await self.bot.say('Stick to positive numbers') - return - - total = sum((random.randrange(1, num_faces) for _ in range(int(num_dice)))) ? ^ -- ^^^^^ ^^ ^^ ---- ^^^ + rolls = [random.randint(1, num_faces) for _ in range(num_dice)] ? ^ ++ ^ ^ ^ ^ - await self.bot.say(str(total)) + await self.bot.say(', '.join(rolls) + ' (total {})'.format(sum(rolls))) @commands.command() async def choose(self, *choices: str): """ Choose between the options Keyword arguments: choices -- Space separated list of options """ await self.bot.say(random.choice(choices)) def setup(bot): bot.add_cog(RNG(bot))
27
0.529412
7
20
6c72e8d1773dfd286d68a86b20e51aeefc2c5539
src/stories/views/clubLayoutStories/ClubLayoutStories.js
src/stories/views/clubLayoutStories/ClubLayoutStories.js
import React from 'react'; import { storiesOf } from '@kadira/storybook'; import ClubLayout from 'vclub/views/clubLayout/ClubLayout'; import clubReducer from 'vclub/reducers/club'; const book = storiesOf('views.clubLayout.ClubLayout', module); book.setInitialStateFromReducer(clubReducer); book.addReduxStory('Default', dispatch => ( <ClubLayout dispatch={dispatch} /> )); book.addReduxStory('Default2', dispatch => ( <ClubLayout dispatch={dispatch} /> ), { data: { authenticated: true, }, });
import React from 'react'; import { storiesOf } from '@kadira/storybook'; import ClubLayout from 'vclub/views/clubLayout/ClubLayout'; import initialState from 'vclub/redux/initialState'; const book = storiesOf('views.clubLayout.ClubLayout', module); book.setInitialState(initialState.club); book.addReduxStory('Default', dispatch => ( <ClubLayout dispatch={dispatch} /> )); book.addReduxStory('Default2', dispatch => ( <ClubLayout dispatch={dispatch} /> ), { data: { authenticated: true, }, });
Fix stories according to new structure
Fix stories according to new structure
JavaScript
mit
BudIT/vclub,BudIT/vclub,VirtualClub/vclub,VirtualClub/vclub
javascript
## Code Before: import React from 'react'; import { storiesOf } from '@kadira/storybook'; import ClubLayout from 'vclub/views/clubLayout/ClubLayout'; import clubReducer from 'vclub/reducers/club'; const book = storiesOf('views.clubLayout.ClubLayout', module); book.setInitialStateFromReducer(clubReducer); book.addReduxStory('Default', dispatch => ( <ClubLayout dispatch={dispatch} /> )); book.addReduxStory('Default2', dispatch => ( <ClubLayout dispatch={dispatch} /> ), { data: { authenticated: true, }, }); ## Instruction: Fix stories according to new structure ## Code After: import React from 'react'; import { storiesOf } from '@kadira/storybook'; import ClubLayout from 'vclub/views/clubLayout/ClubLayout'; import initialState from 'vclub/redux/initialState'; const book = storiesOf('views.clubLayout.ClubLayout', module); book.setInitialState(initialState.club); book.addReduxStory('Default', dispatch => ( <ClubLayout dispatch={dispatch} /> )); book.addReduxStory('Default2', dispatch => ( <ClubLayout dispatch={dispatch} /> ), { data: { authenticated: true, }, });
import React from 'react'; import { storiesOf } from '@kadira/storybook'; import ClubLayout from 'vclub/views/clubLayout/ClubLayout'; - import clubReducer from 'vclub/reducers/club'; + import initialState from 'vclub/redux/initialState'; const book = storiesOf('views.clubLayout.ClubLayout', module); - book.setInitialStateFromReducer(clubReducer); + book.setInitialState(initialState.club); book.addReduxStory('Default', dispatch => ( <ClubLayout dispatch={dispatch} /> )); book.addReduxStory('Default2', dispatch => ( <ClubLayout dispatch={dispatch} /> ), { data: { authenticated: true, }, });
4
0.181818
2
2
e2aa5bbe1826546f93741b08ad112698323fe807
packages/com.github.ygini.roundcube/scripts/030_setup_db.sh
packages/com.github.ygini.roundcube/scripts/030_setup_db.sh
scriptdir=`dirname "$BASH_SOURCE"` source "$scriptdir/shared" mkdir "$RC_DB_SQLITE_FOLDER" sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/SQL/sqlite.initial.sql" sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/plugins/carddav/dbinit/sqlite3.sql" if [ $? -ne 0 ]; then exit 1 fi exit 0
scriptdir=`dirname "$BASH_SOURCE"` source "$scriptdir/shared" mkdir "$RC_DB_SQLITE_FOLDER" sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/SQL/sqlite.initial.sql" sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/plugins/carddav/dbmigrations/0000-dbinit/sqlite3.sql" if [ $? -ne 0 ]; then exit 1 fi exit 0
Use correct sqlite file for carddav plugin
Use correct sqlite file for carddav plugin
Shell
bsd-3-clause
ygini/autowebapp,ygini/webapp,ygini/autowebapp,ygini/webapp,ygini/autowebapp,ygini/webapp
shell
## Code Before: scriptdir=`dirname "$BASH_SOURCE"` source "$scriptdir/shared" mkdir "$RC_DB_SQLITE_FOLDER" sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/SQL/sqlite.initial.sql" sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/plugins/carddav/dbinit/sqlite3.sql" if [ $? -ne 0 ]; then exit 1 fi exit 0 ## Instruction: Use correct sqlite file for carddav plugin ## Code After: scriptdir=`dirname "$BASH_SOURCE"` source "$scriptdir/shared" mkdir "$RC_DB_SQLITE_FOLDER" sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/SQL/sqlite.initial.sql" sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/plugins/carddav/dbmigrations/0000-dbinit/sqlite3.sql" if [ $? -ne 0 ]; then exit 1 fi exit 0
scriptdir=`dirname "$BASH_SOURCE"` source "$scriptdir/shared" mkdir "$RC_DB_SQLITE_FOLDER" sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/SQL/sqlite.initial.sql" - sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/plugins/carddav/dbinit/sqlite3.sql" + sqlite3 "$RC_DB_SQLITE_PATH" < "$RC_PATH/plugins/carddav/dbmigrations/0000-dbinit/sqlite3.sql" ? ++++++++++++++++++ if [ $? -ne 0 ]; then exit 1 fi exit 0
2
0.153846
1
1
4fb253043d9b4841893bd8fd39bf27efee64c844
src/ice/runners/command_line_runner.py
src/ice/runners/command_line_runner.py
from ice_engine import IceEngine class CommandLineRunner(object): def run(self, argv): # TODO: Configure IceEngine based on the contents of argv engine = IceEngine() engine.run() # Keeps the console from closing (until the user hits enter) so they can # read any console output print "" print "Close the window, or hit enter to exit..." raw_input()
import argparse from ice_engine import IceEngine class CommandLineRunner(object): def get_command_line_args(self, argv): parser = argparse.ArgumentParser() parser.add_argument('-c', '--config', type=str, default=None) parser.add_argument('-C', '--consoles', type=str, default=None) parser.add_argument('-e', '--emulators', type=str, default=None) return parser.parse_args(argv) def run(self, argv): options = self.get_command_line_args(argv[1:]) engine = IceEngine( config_override=options.config, consoles_override=options.consoles, emulators_override=options.emulators, ) engine.run() # Keeps the console from closing (until the user hits enter) so they can # read any console output print "" print "Close the window, or hit enter to exit..." raw_input()
Allow passing in config/consoles/emulators.txt locations from command line
Allow passing in config/consoles/emulators.txt locations from command line Summary: This will be really useful for Integration tests, along with whenever we get the desktop app running (since it will communicate with Ice via the command line) Test Plan: Run `src/ice.py --config=/Path/to/different/config`, where the different config has a special backups directory location. Confirm that running Ice adds a backup to this location.
Python
mit
scottrice/Ice
python
## Code Before: from ice_engine import IceEngine class CommandLineRunner(object): def run(self, argv): # TODO: Configure IceEngine based on the contents of argv engine = IceEngine() engine.run() # Keeps the console from closing (until the user hits enter) so they can # read any console output print "" print "Close the window, or hit enter to exit..." raw_input() ## Instruction: Allow passing in config/consoles/emulators.txt locations from command line Summary: This will be really useful for Integration tests, along with whenever we get the desktop app running (since it will communicate with Ice via the command line) Test Plan: Run `src/ice.py --config=/Path/to/different/config`, where the different config has a special backups directory location. Confirm that running Ice adds a backup to this location. ## Code After: import argparse from ice_engine import IceEngine class CommandLineRunner(object): def get_command_line_args(self, argv): parser = argparse.ArgumentParser() parser.add_argument('-c', '--config', type=str, default=None) parser.add_argument('-C', '--consoles', type=str, default=None) parser.add_argument('-e', '--emulators', type=str, default=None) return parser.parse_args(argv) def run(self, argv): options = self.get_command_line_args(argv[1:]) engine = IceEngine( config_override=options.config, consoles_override=options.consoles, emulators_override=options.emulators, ) engine.run() # Keeps the console from closing (until the user hits enter) so they can # read any console output print "" print "Close the window, or hit enter to exit..." raw_input()
+ + import argparse from ice_engine import IceEngine class CommandLineRunner(object): + def get_command_line_args(self, argv): + parser = argparse.ArgumentParser() + parser.add_argument('-c', '--config', type=str, default=None) + parser.add_argument('-C', '--consoles', type=str, default=None) + parser.add_argument('-e', '--emulators', type=str, default=None) + return parser.parse_args(argv) + def run(self, argv): - # TODO: Configure IceEngine based on the contents of argv + options = self.get_command_line_args(argv[1:]) - engine = IceEngine() ? - + engine = IceEngine( + config_override=options.config, + consoles_override=options.consoles, + emulators_override=options.emulators, + ) engine.run() # Keeps the console from closing (until the user hits enter) so they can # read any console output print "" print "Close the window, or hit enter to exit..." raw_input()
17
1.133333
15
2
80e7002535929638de655e703a514df82597ceac
utils/ci/build_01_checks_and_unit_tests.sh
utils/ci/build_01_checks_and_unit_tests.sh
set -x docker build -t 'son-analyze-deploy' -f utils/docker/deploy.Dockerfile . docker build -t 'son-analyze-test' -f utils/docker/test.Dockerfile . if [ -n "${JENKINS_URL}" ]; then EXTRA_ENV="JENKINS_URL=${JENKINS_URL}" fi docker run -i --rm=true --env="${EXTRA_ENV}" -v "$(pwd)/outputs:/son-analyze/outputs" 'son-analyze-test' /bin/bash -c "scripts/clean.sh && scripts/all.py"
set -x docker build -t 'son-analyze-deploy' -f utils/docker/deploy.Dockerfile . docker build -t 'son-analyze-test' -f utils/docker/test.Dockerfile . if [ -n "${JENKINS_URL}" ]; then EXTRA_ENV="JENKINS_URL=${JENKINS_URL}" fi docker run -i --rm=true --env="${EXTRA_ENV}" -v "$(pwd)/outputs:/son-analyze/outputs" 'son-analyze-test' /bin/bash -c "scripts/clean.sh && scripts/all.py" # Fix outputs directory permissions chmod a+rwx outputs
Fix the outputs directory permission after being mounted in a volume
Fix the outputs directory permission after being mounted in a volume
Shell
apache-2.0
cgeoffroy/son-analyze,cgeoffroy/son-analyze
shell
## Code Before: set -x docker build -t 'son-analyze-deploy' -f utils/docker/deploy.Dockerfile . docker build -t 'son-analyze-test' -f utils/docker/test.Dockerfile . if [ -n "${JENKINS_URL}" ]; then EXTRA_ENV="JENKINS_URL=${JENKINS_URL}" fi docker run -i --rm=true --env="${EXTRA_ENV}" -v "$(pwd)/outputs:/son-analyze/outputs" 'son-analyze-test' /bin/bash -c "scripts/clean.sh && scripts/all.py" ## Instruction: Fix the outputs directory permission after being mounted in a volume ## Code After: set -x docker build -t 'son-analyze-deploy' -f utils/docker/deploy.Dockerfile . docker build -t 'son-analyze-test' -f utils/docker/test.Dockerfile . if [ -n "${JENKINS_URL}" ]; then EXTRA_ENV="JENKINS_URL=${JENKINS_URL}" fi docker run -i --rm=true --env="${EXTRA_ENV}" -v "$(pwd)/outputs:/son-analyze/outputs" 'son-analyze-test' /bin/bash -c "scripts/clean.sh && scripts/all.py" # Fix outputs directory permissions chmod a+rwx outputs
set -x docker build -t 'son-analyze-deploy' -f utils/docker/deploy.Dockerfile . docker build -t 'son-analyze-test' -f utils/docker/test.Dockerfile . if [ -n "${JENKINS_URL}" ]; then EXTRA_ENV="JENKINS_URL=${JENKINS_URL}" fi docker run -i --rm=true --env="${EXTRA_ENV}" -v "$(pwd)/outputs:/son-analyze/outputs" 'son-analyze-test' /bin/bash -c "scripts/clean.sh && scripts/all.py" + + # Fix outputs directory permissions + chmod a+rwx outputs
3
0.3
3
0
ed1c9d5b2c7b82f8d341bd2c6cbad4aadb34c8c7
en/eBook/08.5.md
en/eBook/08.5.md
In this chapter, I introduced you to several main stream web application development model. In section 8.1, I described the basic networking programming: Socket programming. Because the direction of the network being rapid evolution, and the Socket is the cornerstone of knowledge of this evolution, you must be mastered as a developer. In section 8.2, I described HTML5 WebSocket, the increasingly popular feature, the server can push messages through it, simplified the polling mode of AJAX. In section 8.3, we implemented a simple RESTful application, which is particularly suited to the development of network API; due to rapid develop of mobile applications, I believe it will be a trend. In section 8.4, we learned about Go RPC. Go provides good support above four kinds of development methods. Note that package `net` and its sub-packages is the place where network programming tools of Go are. If you want more in-depth understanding of the relevant implementation details, you should try to read source code of those packages. ## Links - [Directory](preface.md) - Previous section: [RPC](08.4.md) - Next chapter: [Security and encryption](09.0.md)
In this chapter, I introduced you to several mainstream web application development models. In section 8.1, I described the basics of network programming sockets. Because of the rapid evolution of network technology and infrastructure, and given that the Socket is the cornerstone of these changes, you must master the concepts behind socket programming in order to be a competent web developer. In section 8.2, I described HTML5 WebSockets which support full-duplex communications between client and server and eliminate the need for polling with AJAX. In section 8.3, we implemented a simple application using the REST architecture, which is particularly suitable for the development of network APIs; due to the rapid rise of mobile applications, I believe that RESTful APIs will be an ongoing trend. In section 8.4, we learned about Go RPCs. Go provides excellent support for the four kinds of development methods mentioned above. Note that the `net` package and its sub-packages is the place where Go's network programming tools Go reside. If you want a more in-depth understanding of the relevant implementation details, you should try reading the source code of those packages. ## Links - [Directory](preface.md) - Previous section: [RPC](08.4.md) - Next chapter: [Security and encryption](09.0.md)
Fix sentence structure and grammar
Fix sentence structure and grammar
Markdown
bsd-3-clause
upamune/build-web-application-with-golang,outcastgeek/build-web-application-with-golang,wmydz1/build-web-application-with-golang,PrimeGeekDad/build-web-application-with-golang,yeyuguo/build-web-application-with-golang,importcjj/build-web-application-with-golang,yuichi10/build-web-application-with-golang,zhangg/build-web-application-with-golang,echo-tang/build-web-application-with-golang,tonycoming/build-web-application-with-golang,ptomasroos/build-web-application-with-golang,tianruoxuanhe/build-web-application-with-golang,alex-golang/build-web-application-with-golang,Davidzhu001/build-web-application-with-golang,moltak/build-web-application-with-golang,wanghaoran1988/build-web-application-with-golang,yunnian/build-web-application-with-golang,echo-tang/build-web-application-with-golang,lizhongbo1988/build-web-application-with-golang,chamsiin1982/build-web-application-with-golang,dolohow/build-web-application-with-golang,ziozzang/build-web-application-with-golang,Baoyx007/build-web-application-with-golang,BenVim/build-web-application-with-golang,hustlibraco/build-web-application-with-golang,polyglotm/build-web-application-with-golang,sanata-/build-web-application-with-golang,csuideal/build-web-application-with-golang,xiexingguang/build-web-application-with-golang,admpub/build-web-application-with-golang,JasonAlcoholic/build-web-application-with-golang,yigen520/build-web-application-with-golang,ntko/build-web-application-with-golang,rayyang2000/build-web-application-with-golang,ziozzang/build-web-application-with-golang,rayyang2000/build-web-application-with-golang,ParkinWu/build-web-application-with-golang,dioclu/build-web-application-with-golang,icaroseara/build-web-application-with-golang,Rapplec/build-web-application-with-golang,mahata/build-web-application-with-golang,williamzhang2013/build-web-application-with-golang,adityamenon-iom/build-web-application-with-golang,helphi/build-web-application-with-golang,polyglotm/build-web-application-with-golang,WangKaimin/build-web-application-with-golang,WangKaimin/build-web-application-with-golang,Baoyx007/build-web-application-with-golang,bingeng99/build-web-application-with-golang,undersky/build-web-application-with-golang,trigrass2/build-web-application-with-golang,gcajpa/build-web-application-with-golang,likesea/build-web-application-with-golang,springning/build-web-application-with-golang,yuichi10/build-web-application-with-golang,uditagarwal/build-web-application-with-golang,songqii/build-web-application-with-golang,xianlubird/build-web-application-with-golang,legendtkl/build-web-application-with-golang,wxhzk/build-web-application-with-golang,mafia1986/build-web-application-with-golang,lizhongbo1988/build-web-application-with-golang,jacobxk/build-web-application-with-golang,springning/build-web-application-with-golang,ntko/build-web-application-with-golang,Xcq5678/build-web-application-with-golang,psychoss/build-web-application-with-golang,tianruoxuanhe/build-web-application-with-golang,Just-CJ/build-web-application-with-golang,imjerrybao/build-web-application-with-golang,liumingzhij26/build-web-application-with-golang,vizewang/build-web-application-with-golang,jinjiang2009/build-web-application-with-golang,hustlibraco/build-web-application-with-golang,stonegithubs/build-web-application-with-golang,ParkinWu/build-web-application-with-golang,AnuchitPrasertsang/build-web-application-with-golang,Compasses/build-web-application-with-golang,liumingzhij26/build-web-application-with-golang,spbsmile/build-web-application-with-golang,xiaoyanit/build-web-application-with-golang,1948448114/build-web-application-with-golang,abhishekgahlot/build-web-application-with-golang,hioop/build-web-application-with-golang,BenVim/build-web-application-with-golang,jiy1012/build-web-application-with-golang,xinwendashibaike/build-web-application-with-golang,wakingdreamer/golang-note,mafia1986/build-web-application-with-golang,wuweichi/build-web-application-with-golang,trigrass2/build-web-application-with-golang,undersky/build-web-application-with-golang,xqbumu/build-web-application-with-golang,zanjs/build-web-application-with-golang,bingeng99/build-web-application-with-golang,yannisl/build-web-application-with-golang,wuweichi/build-web-application-with-golang,chamsiin1982/build-web-application-with-golang,ptomasroos/build-web-application-with-golang,freeddser/build-web-application-with-golang,alex-golang/build-web-application-with-golang,leobcn/build-web-application-with-golang,beealone/build-web-application-with-golang,nwknu/build-web-application-with-golang,beealone/build-web-application-with-golang,xiexingguang/build-web-application-with-golang,stonegithubs/build-web-application-with-golang,spbsmile/build-web-application-with-golang,goodspb/build-web-application-with-golang,takasing/build-web-application-with-golang,imjerrybao/build-web-application-with-golang,xqbumu/build-web-application-with-golang,3hd/build-web-application-with-golang,jockchou/build-web-application-with-golang,pwelyn/build-web-application-with-golang,jockchou/build-web-application-with-golang,floydzhang315/build-web-application-with-golang,Goryudyuma/build-web-application-with-golang,xinwendashibaike/build-web-application-with-golang,PrimeGeekDad/build-web-application-with-golang,yeyuguo/build-web-application-with-golang,leobcn/build-web-application-with-golang,kylezhang/build-web-application-with-golang,dioclu/build-web-application-with-golang,hisery/build-web-application-with-golang,likesea/build-web-application-with-golang,abhishekgahlot/build-web-application-with-golang,gaoqc/build-web-application-with-golang,upamune/build-web-application-with-golang,mikeqian/build-web-application-with-golang,kylezhang/build-web-application-with-golang,freeddser/build-web-application-with-golang,mahata/build-web-application-with-golang,legendtkl/build-web-application-with-golang,goodspb/build-web-application-with-golang,DhruvKalaria/build-web-application-with-golang,xianlubird/build-web-application-with-golang,jinjiang2009/build-web-application-with-golang,importcjj/build-web-application-with-golang,icaroseara/build-web-application-with-golang,admpub/build-web-application-with-golang,csuideal/build-web-application-with-golang,DhruvKalaria/build-web-application-with-golang,takasing/build-web-application-with-golang,fyx912/build-web-application-with-golang,faxriddin/build-web-application-with-golang,oyoy8629/build-web-application-with-golang,zhangg/build-web-application-with-golang,AnuchitPrasertsang/build-web-application-with-golang,williamzhang2013/build-web-application-with-golang,helphi/build-web-application-with-golang,nwknu/build-web-application-with-golang,astaxie/build-web-application-with-golang,moltak/build-web-application-with-golang,gcajpa/build-web-application-with-golang,floydzhang315/build-web-application-with-golang,brunoksato/build-web-application-with-golang,afdnlw/build-web-application-with-golang,yunnian/build-web-application-with-golang,cywxer/build-web-application-with-golang,outcastgeek/build-web-application-with-golang,adityamenon-iom/build-web-application-with-golang,pengqiuyuan/build-web-application-with-golang,sanata-/build-web-application-with-golang,1948448114/build-web-application-with-golang,cywxer/build-web-application-with-golang,JasonAlcoholic/build-web-application-with-golang,oyvindsk/build-web-application-with-golang,pwelyn/build-web-application-with-golang,songqii/build-web-application-with-golang,vizewang/build-web-application-with-golang,hisery/build-web-application-with-golang,yigen520/build-web-application-with-golang,gaoqc/build-web-application-with-golang,fyx912/build-web-application-with-golang,jacobxk/build-web-application-with-golang,Compasses/build-web-application-with-golang,Davidzhu001/build-web-application-with-golang,uditagarwal/build-web-application-with-golang,MichaelRoshen/build-web-application-with-golang,tonycoming/build-web-application-with-golang,GoesToEleven/build-web-application-with-golang,jiy1012/build-web-application-with-golang,mikeqian/build-web-application-with-golang,astaxie/build-web-application-with-golang,astaxie/build-web-application-with-golang,dolohow/build-web-application-with-golang,henrylee2cn/build-web-application-with-golang,yannisl/build-web-application-with-golang,3hd/build-web-application-with-golang,afdnlw/build-web-application-with-golang,InfoHunter/build-web-application-with-golang,wanghaoran1988/build-web-application-with-golang,Rapplec/build-web-application-with-golang,gcorreaalves/build-web-application-with-golang,MichaelRoshen/build-web-application-with-golang,cnbin/build-web-application-with-golang,Just-CJ/build-web-application-with-golang,InfoHunter/build-web-application-with-golang,henrylee2cn/build-web-application-with-golang,pengqiuyuan/build-web-application-with-golang,GoesToEleven/build-web-application-with-golang,wmydz1/build-web-application-with-golang,oyoy8629/build-web-application-with-golang,admpub/build-web-application-with-golang,xiaoyanit/build-web-application-with-golang,gcorreaalves/build-web-application-with-golang,cnbin/build-web-application-with-golang,wxhzk/build-web-application-with-golang,psychoss/build-web-application-with-golang,oyvindsk/build-web-application-with-golang,faxriddin/build-web-application-with-golang,Goryudyuma/build-web-application-with-golang,admpub/build-web-application-with-golang,brunoksato/build-web-application-with-golang,hioop/build-web-application-with-golang,zanjs/build-web-application-with-golang,Xcq5678/build-web-application-with-golang
markdown
## Code Before: In this chapter, I introduced you to several main stream web application development model. In section 8.1, I described the basic networking programming: Socket programming. Because the direction of the network being rapid evolution, and the Socket is the cornerstone of knowledge of this evolution, you must be mastered as a developer. In section 8.2, I described HTML5 WebSocket, the increasingly popular feature, the server can push messages through it, simplified the polling mode of AJAX. In section 8.3, we implemented a simple RESTful application, which is particularly suited to the development of network API; due to rapid develop of mobile applications, I believe it will be a trend. In section 8.4, we learned about Go RPC. Go provides good support above four kinds of development methods. Note that package `net` and its sub-packages is the place where network programming tools of Go are. If you want more in-depth understanding of the relevant implementation details, you should try to read source code of those packages. ## Links - [Directory](preface.md) - Previous section: [RPC](08.4.md) - Next chapter: [Security and encryption](09.0.md) ## Instruction: Fix sentence structure and grammar ## Code After: In this chapter, I introduced you to several mainstream web application development models. In section 8.1, I described the basics of network programming sockets. Because of the rapid evolution of network technology and infrastructure, and given that the Socket is the cornerstone of these changes, you must master the concepts behind socket programming in order to be a competent web developer. In section 8.2, I described HTML5 WebSockets which support full-duplex communications between client and server and eliminate the need for polling with AJAX. In section 8.3, we implemented a simple application using the REST architecture, which is particularly suitable for the development of network APIs; due to the rapid rise of mobile applications, I believe that RESTful APIs will be an ongoing trend. In section 8.4, we learned about Go RPCs. Go provides excellent support for the four kinds of development methods mentioned above. Note that the `net` package and its sub-packages is the place where Go's network programming tools Go reside. If you want a more in-depth understanding of the relevant implementation details, you should try reading the source code of those packages. ## Links - [Directory](preface.md) - Previous section: [RPC](08.4.md) - Next chapter: [Security and encryption](09.0.md)
- In this chapter, I introduced you to several main stream web application development model. In section 8.1, I described the basic networking programming: Socket programming. Because the direction of the network being rapid evolution, and the Socket is the cornerstone of knowledge of this evolution, you must be mastered as a developer. In section 8.2, I described HTML5 WebSocket, the increasingly popular feature, the server can push messages through it, simplified the polling mode of AJAX. In section 8.3, we implemented a simple RESTful application, which is particularly suited to the development of network API; due to rapid develop of mobile applications, I believe it will be a trend. In section 8.4, we learned about Go RPC. + In this chapter, I introduced you to several mainstream web application development models. In section 8.1, I described the basics of network programming sockets. Because of the rapid evolution of network technology and infrastructure, and given that the Socket is the cornerstone of these changes, you must master the concepts behind socket programming in order to be a competent web developer. In section 8.2, I described HTML5 WebSockets which support full-duplex communications between client and server and eliminate the need for polling with AJAX. In section 8.3, we implemented a simple application using the REST architecture, which is particularly suitable for the development of network APIs; due to the rapid rise of mobile applications, I believe that RESTful APIs will be an ongoing trend. In section 8.4, we learned about Go RPCs. - Go provides good support above four kinds of development methods. Note that package `net` and its sub-packages is the place where network programming tools of Go are. If you want more in-depth understanding of the relevant implementation details, you should try to read source code of those packages. + Go provides excellent support for the four kinds of development methods mentioned above. Note that the `net` package and its sub-packages is the place where Go's network programming tools Go reside. If you want a more in-depth understanding of the relevant implementation details, you should try reading the source code of those packages. ## Links - [Directory](preface.md) - Previous section: [RPC](08.4.md) - Next chapter: [Security and encryption](09.0.md)
4
0.4
2
2
fa641fa0a973df4bd03c4c7093938bef65a43ba1
lib/middleware/hsts.js
lib/middleware/hsts.js
/* HTTP Strict Transport Security (HSTS) http://tools.ietf.org/html/rfc6797 */ module.exports = function (maxAge, includeSubdomains) { if (!maxAge) maxAge = '15768000'; // Approximately 6 months var header = "max-age=" + maxAge; if (includeSubdomains) header += '; includeSubdomains'; return function (req, res, next) { if (req.secure || req.headers['x-forwarded-proto'] == 'https') { res.setHeader('Strict-Transport-Security', header); } next(); }; };
/* HTTP Strict Transport Security (HSTS) http://tools.ietf.org/html/rfc6797 */ module.exports = function hsts (maxAge, includeSubdomains) { maxAge = maxAge || '15768000'; // approximately 6 months var header = 'max-age=' + maxAge; if (includeSubdomains) { header += '; includeSubdomains'; } return function hsts (req, res, next) { var isSecure = (req.secure) || (req.headers['front-end-https'] == 'on') || (req.headers['x-forwarded-proto'] == 'https'); if (isSecure) { res.setHeader('Strict-Transport-Security', header); } next(); }; };
Clean up the HSTS code a little bit
Clean up the HSTS code a little bit
JavaScript
mit
helmetjs/helmet,helmetjs/helmet
javascript
## Code Before: /* HTTP Strict Transport Security (HSTS) http://tools.ietf.org/html/rfc6797 */ module.exports = function (maxAge, includeSubdomains) { if (!maxAge) maxAge = '15768000'; // Approximately 6 months var header = "max-age=" + maxAge; if (includeSubdomains) header += '; includeSubdomains'; return function (req, res, next) { if (req.secure || req.headers['x-forwarded-proto'] == 'https') { res.setHeader('Strict-Transport-Security', header); } next(); }; }; ## Instruction: Clean up the HSTS code a little bit ## Code After: /* HTTP Strict Transport Security (HSTS) http://tools.ietf.org/html/rfc6797 */ module.exports = function hsts (maxAge, includeSubdomains) { maxAge = maxAge || '15768000'; // approximately 6 months var header = 'max-age=' + maxAge; if (includeSubdomains) { header += '; includeSubdomains'; } return function hsts (req, res, next) { var isSecure = (req.secure) || (req.headers['front-end-https'] == 'on') || (req.headers['x-forwarded-proto'] == 'https'); if (isSecure) { res.setHeader('Strict-Transport-Security', header); } next(); }; };
/* HTTP Strict Transport Security (HSTS) http://tools.ietf.org/html/rfc6797 */ - module.exports = function (maxAge, includeSubdomains) { + module.exports = function hsts (maxAge, includeSubdomains) { ? +++++ - if (!maxAge) maxAge = '15768000'; // Approximately 6 months - var header = "max-age=" + maxAge; + maxAge = maxAge || '15768000'; // approximately 6 months + + var header = 'max-age=' + maxAge; + if (includeSubdomains) { - if (includeSubdomains) header += '; includeSubdomains'; ? -- ^^^^^^^^^^^^^^^^^^^ + header += '; includeSubdomains'; ? ^^ - + } ? + + - return function (req, res, next) { + return function hsts (req, res, next) { ? +++++ + + var isSecure = (req.secure) || + (req.headers['front-end-https'] == 'on') || - if (req.secure || req.headers['x-forwarded-proto'] == 'https') { ? ^^ -------------- ^^ + (req.headers['x-forwarded-proto'] == 'https'); ? ^^^ ^ + + if (isSecure) { res.setHeader('Strict-Transport-Security', header); } + next(); }; + };
24
1.142857
17
7
04557bbff362ae3b89e7dd98a1fb11e0aaeba50e
common/djangoapps/student/migrations/0010_auto_20170207_0458.py
common/djangoapps/student/migrations/0010_auto_20170207_0458.py
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('student', '0009_auto_20170111_0422'), ] # This migration was to add a constraint that we lost in the Django # 1.4->1.8 upgrade. But since the constraint used to be created, production # would already have the constraint even before running the migration, and # running the migration would fail. We needed to make the migration # idempotent. Instead of reverting this migration while we did that, we # edited it to be a SQL no-op, so that people who had already applied it # wouldn't end up with a ghost migration. # It had been: # # migrations.RunSQL( # "create unique index email on auth_user (email);", # "drop index email on auth_user;" # ) operations = [ migrations.RunSQL( # Do nothing: "select 1", "select 1" ) ]
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('student', '0009_auto_20170111_0422'), ] # This migration was to add a constraint that we lost in the Django # 1.4->1.8 upgrade. But since the constraint used to be created, production # would already have the constraint even before running the migration, and # running the migration would fail. We needed to make the migration # idempotent. Instead of reverting this migration while we did that, we # edited it to be a SQL no-op, so that people who had already applied it # wouldn't end up with a ghost migration. # It had been: # # migrations.RunSQL( # "create unique index email on auth_user (email);", # "drop index email on auth_user;" # ) operations = [ # Nothing to do. ]
Make this no-op migration be a true no-op.
Make this no-op migration be a true no-op.
Python
agpl-3.0
philanthropy-u/edx-platform,lduarte1991/edx-platform,eduNEXT/edx-platform,msegado/edx-platform,cpennington/edx-platform,hastexo/edx-platform,a-parhom/edx-platform,ESOedX/edx-platform,angelapper/edx-platform,gymnasium/edx-platform,eduNEXT/edunext-platform,pepeportela/edx-platform,ESOedX/edx-platform,pepeportela/edx-platform,miptliot/edx-platform,BehavioralInsightsTeam/edx-platform,appsembler/edx-platform,msegado/edx-platform,appsembler/edx-platform,eduNEXT/edx-platform,TeachAtTUM/edx-platform,gymnasium/edx-platform,Lektorium-LLC/edx-platform,miptliot/edx-platform,edx/edx-platform,procangroup/edx-platform,mitocw/edx-platform,romain-li/edx-platform,miptliot/edx-platform,CredoReference/edx-platform,Lektorium-LLC/edx-platform,cpennington/edx-platform,proversity-org/edx-platform,fintech-circle/edx-platform,jolyonb/edx-platform,ahmedaljazzar/edx-platform,Stanford-Online/edx-platform,Stanford-Online/edx-platform,stvstnfrd/edx-platform,BehavioralInsightsTeam/edx-platform,gsehub/edx-platform,edx-solutions/edx-platform,teltek/edx-platform,cpennington/edx-platform,pepeportela/edx-platform,BehavioralInsightsTeam/edx-platform,arbrandes/edx-platform,raccoongang/edx-platform,stvstnfrd/edx-platform,ahmedaljazzar/edx-platform,hastexo/edx-platform,arbrandes/edx-platform,ESOedX/edx-platform,CredoReference/edx-platform,eduNEXT/edunext-platform,mitocw/edx-platform,stvstnfrd/edx-platform,fintech-circle/edx-platform,mitocw/edx-platform,pabloborrego93/edx-platform,gsehub/edx-platform,kmoocdev2/edx-platform,angelapper/edx-platform,jolyonb/edx-platform,gymnasium/edx-platform,eduNEXT/edx-platform,gsehub/edx-platform,msegado/edx-platform,teltek/edx-platform,TeachAtTUM/edx-platform,appsembler/edx-platform,pepeportela/edx-platform,Edraak/edraak-platform,pabloborrego93/edx-platform,a-parhom/edx-platform,fintech-circle/edx-platform,pabloborrego93/edx-platform,appsembler/edx-platform,lduarte1991/edx-platform,jolyonb/edx-platform,eduNEXT/edunext-platform,edx-solutions/edx-platform,teltek/edx-platform,proversity-org/edx-platform,proversity-org/edx-platform,edx-solutions/edx-platform,eduNEXT/edx-platform,Lektorium-LLC/edx-platform,edx/edx-platform,kmoocdev2/edx-platform,gsehub/edx-platform,lduarte1991/edx-platform,miptliot/edx-platform,procangroup/edx-platform,CredoReference/edx-platform,teltek/edx-platform,procangroup/edx-platform,philanthropy-u/edx-platform,arbrandes/edx-platform,EDUlib/edx-platform,Edraak/edraak-platform,Edraak/edraak-platform,jolyonb/edx-platform,raccoongang/edx-platform,gymnasium/edx-platform,fintech-circle/edx-platform,raccoongang/edx-platform,pabloborrego93/edx-platform,Stanford-Online/edx-platform,stvstnfrd/edx-platform,edx/edx-platform,kmoocdev2/edx-platform,proversity-org/edx-platform,CredoReference/edx-platform,ahmedaljazzar/edx-platform,lduarte1991/edx-platform,romain-li/edx-platform,philanthropy-u/edx-platform,ahmedaljazzar/edx-platform,kmoocdev2/edx-platform,romain-li/edx-platform,Edraak/edraak-platform,EDUlib/edx-platform,romain-li/edx-platform,cpennington/edx-platform,eduNEXT/edunext-platform,ESOedX/edx-platform,edx/edx-platform,Stanford-Online/edx-platform,romain-li/edx-platform,philanthropy-u/edx-platform,angelapper/edx-platform,edx-solutions/edx-platform,Lektorium-LLC/edx-platform,hastexo/edx-platform,hastexo/edx-platform,a-parhom/edx-platform,procangroup/edx-platform,BehavioralInsightsTeam/edx-platform,mitocw/edx-platform,kmoocdev2/edx-platform,msegado/edx-platform,EDUlib/edx-platform,arbrandes/edx-platform,TeachAtTUM/edx-platform,msegado/edx-platform,TeachAtTUM/edx-platform,angelapper/edx-platform,EDUlib/edx-platform,raccoongang/edx-platform,a-parhom/edx-platform
python
## Code Before: from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('student', '0009_auto_20170111_0422'), ] # This migration was to add a constraint that we lost in the Django # 1.4->1.8 upgrade. But since the constraint used to be created, production # would already have the constraint even before running the migration, and # running the migration would fail. We needed to make the migration # idempotent. Instead of reverting this migration while we did that, we # edited it to be a SQL no-op, so that people who had already applied it # wouldn't end up with a ghost migration. # It had been: # # migrations.RunSQL( # "create unique index email on auth_user (email);", # "drop index email on auth_user;" # ) operations = [ migrations.RunSQL( # Do nothing: "select 1", "select 1" ) ] ## Instruction: Make this no-op migration be a true no-op. ## Code After: from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('student', '0009_auto_20170111_0422'), ] # This migration was to add a constraint that we lost in the Django # 1.4->1.8 upgrade. But since the constraint used to be created, production # would already have the constraint even before running the migration, and # running the migration would fail. We needed to make the migration # idempotent. Instead of reverting this migration while we did that, we # edited it to be a SQL no-op, so that people who had already applied it # wouldn't end up with a ghost migration. # It had been: # # migrations.RunSQL( # "create unique index email on auth_user (email);", # "drop index email on auth_user;" # ) operations = [ # Nothing to do. ]
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('student', '0009_auto_20170111_0422'), ] # This migration was to add a constraint that we lost in the Django # 1.4->1.8 upgrade. But since the constraint used to be created, production # would already have the constraint even before running the migration, and # running the migration would fail. We needed to make the migration # idempotent. Instead of reverting this migration while we did that, we # edited it to be a SQL no-op, so that people who had already applied it # wouldn't end up with a ghost migration. # It had been: # # migrations.RunSQL( # "create unique index email on auth_user (email);", # "drop index email on auth_user;" # ) operations = [ + # Nothing to do. - migrations.RunSQL( - # Do nothing: - "select 1", - "select 1" - ) ]
6
0.181818
1
5
608c54e9ae0fe98feefa1ad929ed18febaa60927
app/views/languages/_form.html.erb
app/views/languages/_form.html.erb
<%= f.label "Name:" %> <%= f.text_field :name %>
<%= f.label "Name:" %> <%= f.text_field :name %><br> <%= f.label "About the language:" %> <%= f.text_area :description %><br>
Add description field to form.
Add description field to form.
HTML+ERB
mit
abonner1/code_learning_resources_manager,abonner1/code_learning_resources_manager,abonner1/sorter,abonner1/sorter,abonner1/code_learning_resources_manager,abonner1/sorter
html+erb
## Code Before: <%= f.label "Name:" %> <%= f.text_field :name %> ## Instruction: Add description field to form. ## Code After: <%= f.label "Name:" %> <%= f.text_field :name %><br> <%= f.label "About the language:" %> <%= f.text_area :description %><br>
<%= f.label "Name:" %> - <%= f.text_field :name %> + <%= f.text_field :name %><br> ? ++++ + <%= f.label "About the language:" %> + <%= f.text_area :description %><br>
4
2
3
1
cd338ddf8d4bed2b5436f8e42080cc911c1c2211
.travis.yml
.travis.yml
language: php sudo: required cache: directories: - $HOME/.composer/cache php: - 5.6 - 7.0 - 7.1 - hhvm install: - sudo apt-get install openssl - composer install - phpunit --self-update script: phpunit -c test/Unit/phpunit.xml.dist after_script: ## Code climate - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/test-reporter; fi
language: php sudo: required cache: directories: - $HOME/.composer/cache php: - 5.6 - 7.0 - 7.1 - hhvm install: - sudo apt-get install openssl - composer install script: phpunit -c test/Unit/phpunit.xml.dist after_script: ## Code climate - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/test-reporter; fi
Fix PHP7 phpunit self update
[CI] Fix PHP7 phpunit self update
YAML
mit
sciphp/numphp,sciphp/numphp,sciphp/numphp,sciphp/numphp
yaml
## Code Before: language: php sudo: required cache: directories: - $HOME/.composer/cache php: - 5.6 - 7.0 - 7.1 - hhvm install: - sudo apt-get install openssl - composer install - phpunit --self-update script: phpunit -c test/Unit/phpunit.xml.dist after_script: ## Code climate - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/test-reporter; fi ## Instruction: [CI] Fix PHP7 phpunit self update ## Code After: language: php sudo: required cache: directories: - $HOME/.composer/cache php: - 5.6 - 7.0 - 7.1 - hhvm install: - sudo apt-get install openssl - composer install script: phpunit -c test/Unit/phpunit.xml.dist after_script: ## Code climate - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/test-reporter; fi
language: php sudo: required cache: directories: - $HOME/.composer/cache php: - 5.6 - 7.0 - 7.1 - hhvm install: - sudo apt-get install openssl - composer install - - phpunit --self-update script: phpunit -c test/Unit/phpunit.xml.dist after_script: ## Code climate - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/test-reporter; fi
1
0.041667
0
1
e503c8876efe19b5dd088fcde4fa0ac352df6fd2
_data/next-event.yml
_data/next-event.yml
date: Wednesday, 15 January, 2014 time: 6.30pm – 9.30pm location: Eden House, 8 Spital Square, London E1 6DU talks: - speaker_name: Matthew Rudy Jacobs speaker_twitter: "@matthewrudy" info: "Ember and OAuth — a short tour of OAuth on the client side." image: images/matthew-2.jpg video_url: "/" - speaker_name: Ben Gillies speaker_twitter: "@bengillies" info: "Ember is designed for building large scale apps, but for truly large scale, with large amounts amounts of data, we need something extra: Threads." image: images/ben.jpg video_url: "/" - speaker_name: Andy Appleton speaker_twitter: "@appltn" info: Modular UI with Angular (and Ember). image: images/andy.jpg video_url: "/"
date: Wednesday, 15 January, 2014 time: 6.30pm – 9.30pm location: Eden House, 8 Spital Square, London E1 6DU talks: - speaker_name: Ben Gillies speaker_twitter: "@bengillies" info: "Ember is designed for building large scale apps, but for truly large scale, with large amounts amounts of data, we need something extra: Threads." image: images/ben.jpg video_url: "/" - speaker_name: Matthew Rudy Jacobs speaker_twitter: "@matthewrudy" info: "Ember and OAuth — a short tour of OAuth on the client side." image: images/matthew-2.jpg video_url: "/" - speaker_name: Andy Appleton speaker_twitter: "@appltn" info: Modular UI with Angular (and Ember). image: images/andy.jpg video_url: "/"
Adjust running order for Jan 2014
Adjust running order for Jan 2014
YAML
mit
emberlondon/emberlondon.github.io,emberlondon/emberlondon.github.io,emberlondon/emberlondon.github.io,emberlondon/emberlondon.github.io
yaml
## Code Before: date: Wednesday, 15 January, 2014 time: 6.30pm – 9.30pm location: Eden House, 8 Spital Square, London E1 6DU talks: - speaker_name: Matthew Rudy Jacobs speaker_twitter: "@matthewrudy" info: "Ember and OAuth — a short tour of OAuth on the client side." image: images/matthew-2.jpg video_url: "/" - speaker_name: Ben Gillies speaker_twitter: "@bengillies" info: "Ember is designed for building large scale apps, but for truly large scale, with large amounts amounts of data, we need something extra: Threads." image: images/ben.jpg video_url: "/" - speaker_name: Andy Appleton speaker_twitter: "@appltn" info: Modular UI with Angular (and Ember). image: images/andy.jpg video_url: "/" ## Instruction: Adjust running order for Jan 2014 ## Code After: date: Wednesday, 15 January, 2014 time: 6.30pm – 9.30pm location: Eden House, 8 Spital Square, London E1 6DU talks: - speaker_name: Ben Gillies speaker_twitter: "@bengillies" info: "Ember is designed for building large scale apps, but for truly large scale, with large amounts amounts of data, we need something extra: Threads." image: images/ben.jpg video_url: "/" - speaker_name: Matthew Rudy Jacobs speaker_twitter: "@matthewrudy" info: "Ember and OAuth — a short tour of OAuth on the client side." image: images/matthew-2.jpg video_url: "/" - speaker_name: Andy Appleton speaker_twitter: "@appltn" info: Modular UI with Angular (and Ember). image: images/andy.jpg video_url: "/"
date: Wednesday, 15 January, 2014 time: 6.30pm – 9.30pm location: Eden House, 8 Spital Square, London E1 6DU talks: + - speaker_name: Ben Gillies + speaker_twitter: "@bengillies" + info: "Ember is designed for building large scale apps, but for truly large scale, with large amounts amounts of data, we need something extra: Threads." + image: images/ben.jpg + video_url: "/" - speaker_name: Matthew Rudy Jacobs speaker_twitter: "@matthewrudy" info: "Ember and OAuth — a short tour of OAuth on the client side." image: images/matthew-2.jpg - video_url: "/" - - speaker_name: Ben Gillies - speaker_twitter: "@bengillies" - info: "Ember is designed for building large scale apps, but for truly large scale, with large amounts amounts of data, we need something extra: Threads." - image: images/ben.jpg video_url: "/" - speaker_name: Andy Appleton speaker_twitter: "@appltn" info: Modular UI with Angular (and Ember). image: images/andy.jpg video_url: "/"
10
0.526316
5
5
12c4395a7939f3b435060ce701fd9002c6be2d8f
src/sampleActivities.js
src/sampleActivities.js
const activitiesByTimestamp = { // activityTimestamps: [1488058736421, 1488058788421, 1488058446421, 1488051326421, 1488051326555] 1488058736421: { text: "hang at Golden Gate park 🍺", }, 1488078736421: { text: "soak up some 🌞 at Dolores park", }, 1488058788421: { text: "climb at Planet Granite -- 3 hours", }, 1488058446421: { text: "run 4.5 miles 🏃", }, 1488059646421: { text: "surfing 🏄 with Salar in Santa Cruz", }, 1488051326421: { text: "read Infinite Jest -- 40 pages", }, 1488051326555: { text: "read Code by Petzold -- 90 pages", } } export default activitiesByTimestamp;
const activitiesByTimestamp = { 1488058736421: { text: "hang at Golden Gate park 🍺", }, 1488078736421: { text: "soak up some 🌞 at Dolores park", }, 1487558788421: { text: "climb at Planet Granite -- 3 hours", }, 1488058446421: { text: "run 4.5 miles 🏃", }, 1486959646421: { text: "surfing 🏄 with Salar in Santa Cruz", }, 1488051326421: { text: "read Infinite Jest -- 40 pages", }, 1488051326555: { text: "read Code by Petzold -- 90 pages", } } export default activitiesByTimestamp;
Add some other dates into sample activities
Add some other dates into sample activities
JavaScript
mit
mknudsen01/today,mknudsen01/today
javascript
## Code Before: const activitiesByTimestamp = { // activityTimestamps: [1488058736421, 1488058788421, 1488058446421, 1488051326421, 1488051326555] 1488058736421: { text: "hang at Golden Gate park 🍺", }, 1488078736421: { text: "soak up some 🌞 at Dolores park", }, 1488058788421: { text: "climb at Planet Granite -- 3 hours", }, 1488058446421: { text: "run 4.5 miles 🏃", }, 1488059646421: { text: "surfing 🏄 with Salar in Santa Cruz", }, 1488051326421: { text: "read Infinite Jest -- 40 pages", }, 1488051326555: { text: "read Code by Petzold -- 90 pages", } } export default activitiesByTimestamp; ## Instruction: Add some other dates into sample activities ## Code After: const activitiesByTimestamp = { 1488058736421: { text: "hang at Golden Gate park 🍺", }, 1488078736421: { text: "soak up some 🌞 at Dolores park", }, 1487558788421: { text: "climb at Planet Granite -- 3 hours", }, 1488058446421: { text: "run 4.5 miles 🏃", }, 1486959646421: { text: "surfing 🏄 with Salar in Santa Cruz", }, 1488051326421: { text: "read Infinite Jest -- 40 pages", }, 1488051326555: { text: "read Code by Petzold -- 90 pages", } } export default activitiesByTimestamp;
const activitiesByTimestamp = { - // activityTimestamps: [1488058736421, 1488058788421, 1488058446421, 1488051326421, 1488051326555] 1488058736421: { text: "hang at Golden Gate park 🍺", }, 1488078736421: { text: "soak up some 🌞 at Dolores park", }, - 1488058788421: { ? ^^ + 1487558788421: { ? ^^ text: "climb at Planet Granite -- 3 hours", }, 1488058446421: { text: "run 4.5 miles 🏃", }, - 1488059646421: { ? ^^ + 1486959646421: { ? ^^ text: "surfing 🏄 with Salar in Santa Cruz", }, 1488051326421: { text: "read Infinite Jest -- 40 pages", }, 1488051326555: { text: "read Code by Petzold -- 90 pages", } } export default activitiesByTimestamp;
5
0.192308
2
3
b025ecdcfe04b600bdb02e2f257743c8b0864092
lib/sinatra/dynamicmatic.rb
lib/sinatra/dynamicmatic.rb
require 'sinatra/base' require 'staticmatic' module Sinatra module DynamicMatic def self.registered(app) app.set :compile_on_start, true app.set :public, Proc.new {app.root && File.join(app.root, 'site')} configuration = StaticMatic::Configuration.new config_file = "#{app.root}/src/configuration.rb" if File.exists?(config_file) config = File.read(config_file) eval(config) end staticmatic = StaticMatic::Base.new(app.root, configuration) staticmatic.run("build") if app.compile_on_start Dir[File.join(staticmatic.src_dir, "layouts", "*.haml")].each do |layout| name = layout[/([^\/]*)\.haml$/, 1].to_sym haml = File.read(layout) app.template(name) {haml} app.layout {haml} if name == :application end before do @staticmatic = staticmatic staticmatic.instance_variable_set('@current_page', request.path_info) end end end register DynamicMatic end
require 'sinatra/base' require 'staticmatic' module Sinatra module DynamicMatic def self.registered(app) app.set :compile_on_start, true app.set :lock, true app.set :public, Proc.new {app.root && File.join(app.root, 'site')} configuration = StaticMatic::Configuration.new config_file = "#{app.root}/src/configuration.rb" if File.exists?(config_file) config = File.read(config_file) eval(config) end staticmatic = StaticMatic::Base.new(app.root, configuration) staticmatic.run("build") if app.compile_on_start Dir[File.join(staticmatic.src_dir, "layouts", "*.haml")].each do |layout| name = layout[/([^\/]*)\.haml$/, 1].to_sym haml = File.read(layout) app.template(name) {haml} app.layout {haml} if name == :application end before do @staticmatic = staticmatic staticmatic.instance_variable_set('@current_page', request.path_info) end end end register DynamicMatic end
Set the :lock option to true.
Set the :lock option to true.
Ruby
mit
nex3/dynamicmatic
ruby
## Code Before: require 'sinatra/base' require 'staticmatic' module Sinatra module DynamicMatic def self.registered(app) app.set :compile_on_start, true app.set :public, Proc.new {app.root && File.join(app.root, 'site')} configuration = StaticMatic::Configuration.new config_file = "#{app.root}/src/configuration.rb" if File.exists?(config_file) config = File.read(config_file) eval(config) end staticmatic = StaticMatic::Base.new(app.root, configuration) staticmatic.run("build") if app.compile_on_start Dir[File.join(staticmatic.src_dir, "layouts", "*.haml")].each do |layout| name = layout[/([^\/]*)\.haml$/, 1].to_sym haml = File.read(layout) app.template(name) {haml} app.layout {haml} if name == :application end before do @staticmatic = staticmatic staticmatic.instance_variable_set('@current_page', request.path_info) end end end register DynamicMatic end ## Instruction: Set the :lock option to true. ## Code After: require 'sinatra/base' require 'staticmatic' module Sinatra module DynamicMatic def self.registered(app) app.set :compile_on_start, true app.set :lock, true app.set :public, Proc.new {app.root && File.join(app.root, 'site')} configuration = StaticMatic::Configuration.new config_file = "#{app.root}/src/configuration.rb" if File.exists?(config_file) config = File.read(config_file) eval(config) end staticmatic = StaticMatic::Base.new(app.root, configuration) staticmatic.run("build") if app.compile_on_start Dir[File.join(staticmatic.src_dir, "layouts", "*.haml")].each do |layout| name = layout[/([^\/]*)\.haml$/, 1].to_sym haml = File.read(layout) app.template(name) {haml} app.layout {haml} if name == :application end before do @staticmatic = staticmatic staticmatic.instance_variable_set('@current_page', request.path_info) end end end register DynamicMatic end
require 'sinatra/base' require 'staticmatic' module Sinatra module DynamicMatic def self.registered(app) app.set :compile_on_start, true + + app.set :lock, true app.set :public, Proc.new {app.root && File.join(app.root, 'site')} configuration = StaticMatic::Configuration.new config_file = "#{app.root}/src/configuration.rb" if File.exists?(config_file) config = File.read(config_file) eval(config) end staticmatic = StaticMatic::Base.new(app.root, configuration) staticmatic.run("build") if app.compile_on_start Dir[File.join(staticmatic.src_dir, "layouts", "*.haml")].each do |layout| name = layout[/([^\/]*)\.haml$/, 1].to_sym haml = File.read(layout) app.template(name) {haml} app.layout {haml} if name == :application end before do @staticmatic = staticmatic staticmatic.instance_variable_set('@current_page', request.path_info) end end end register DynamicMatic end
2
0.054054
2
0
8b55407a0cdd828dfa44a18d1c8c134095e5ac05
com/ydb_prior_ver_check.csh
com/ydb_prior_ver_check.csh
if ($?ydb_environment_init) then # This is not a GG setup. And so versions prior to V63000A have issues running in UTF-8 mode (due to icu # library naming conventions that changed). So disable UTF8 mode testing in case the older version is < V63000A. if (`expr "V63000A" \> "$1"`) then if ($?gtm_chset) then if ("UTF-8" == $gtm_chset) then $switch_chset M >>&! switch_chset_ydb.out rm -f rand.o >& /dev/null # usually created by random_ver.csh and could cause INVOBJFILE due to CHSET mismatch endif endif endif endif
if ($?ydb_environment_init) then # This is a YDB setup. And so versions prior to V63000A have issues running in UTF-8 mode (due to icu # library naming conventions that changed). So disable UTF8 mode testing in case the older version is < V63000A. if (`expr "V63000A" \> "$1"`) then if ($?gtm_chset) then if ("UTF-8" == $gtm_chset) then $switch_chset M >>&! switch_chset_ydb.out rm -f rand.o >& /dev/null # usually created by random_ver.csh and could cause INVOBJFILE due to CHSET mismatch endif endif endif # This is a YDB setup. On Arch Linux, versions <= V63000A have issues running with TLS (source server # issues TLSDLLNOOPEN error with detail "libgtmtls.so: undefined symbol: SSLv23_method"). So disable # TLS in case a version <= V63000A gets chosen. if (`expr "V63000A" \>= "$1"`) then setenv gtm_test_tls "FALSE" endif endif
Disable TLS if prior version is <= V63000A as that causes TLSDLLNOOPEN errors in source server on Arch Linux
Disable TLS if prior version is <= V63000A as that causes TLSDLLNOOPEN errors in source server on Arch Linux
Tcsh
agpl-3.0
nars1/YottaDBtest,nars1/YottaDBtest,nars1/YottaDBtest,nars1/YottaDBtest,nars1/YottaDBtest,nars1/YottaDBtest
tcsh
## Code Before: if ($?ydb_environment_init) then # This is not a GG setup. And so versions prior to V63000A have issues running in UTF-8 mode (due to icu # library naming conventions that changed). So disable UTF8 mode testing in case the older version is < V63000A. if (`expr "V63000A" \> "$1"`) then if ($?gtm_chset) then if ("UTF-8" == $gtm_chset) then $switch_chset M >>&! switch_chset_ydb.out rm -f rand.o >& /dev/null # usually created by random_ver.csh and could cause INVOBJFILE due to CHSET mismatch endif endif endif endif ## Instruction: Disable TLS if prior version is <= V63000A as that causes TLSDLLNOOPEN errors in source server on Arch Linux ## Code After: if ($?ydb_environment_init) then # This is a YDB setup. And so versions prior to V63000A have issues running in UTF-8 mode (due to icu # library naming conventions that changed). So disable UTF8 mode testing in case the older version is < V63000A. if (`expr "V63000A" \> "$1"`) then if ($?gtm_chset) then if ("UTF-8" == $gtm_chset) then $switch_chset M >>&! switch_chset_ydb.out rm -f rand.o >& /dev/null # usually created by random_ver.csh and could cause INVOBJFILE due to CHSET mismatch endif endif endif # This is a YDB setup. On Arch Linux, versions <= V63000A have issues running with TLS (source server # issues TLSDLLNOOPEN error with detail "libgtmtls.so: undefined symbol: SSLv23_method"). So disable # TLS in case a version <= V63000A gets chosen. if (`expr "V63000A" \>= "$1"`) then setenv gtm_test_tls "FALSE" endif endif
if ($?ydb_environment_init) then - # This is not a GG setup. And so versions prior to V63000A have issues running in UTF-8 mode (due to icu ? ---- ^^ + # This is a YDB setup. And so versions prior to V63000A have issues running in UTF-8 mode (due to icu ? ^^^ # library naming conventions that changed). So disable UTF8 mode testing in case the older version is < V63000A. if (`expr "V63000A" \> "$1"`) then if ($?gtm_chset) then if ("UTF-8" == $gtm_chset) then $switch_chset M >>&! switch_chset_ydb.out rm -f rand.o >& /dev/null # usually created by random_ver.csh and could cause INVOBJFILE due to CHSET mismatch endif endif endif + # This is a YDB setup. On Arch Linux, versions <= V63000A have issues running with TLS (source server + # issues TLSDLLNOOPEN error with detail "libgtmtls.so: undefined symbol: SSLv23_method"). So disable + # TLS in case a version <= V63000A gets chosen. + if (`expr "V63000A" \>= "$1"`) then + setenv gtm_test_tls "FALSE" + endif endif
8
0.666667
7
1
21831ceb44d6bb4bae042064ef08d5d2eb197176
docs/tutorials/rpc-basic/quicktry.rst
docs/tutorials/rpc-basic/quicktry.rst
Quickly Trying RPC ================== Before building your own RPC client and servers, you can see RPC with {{{product}}} in action using a provided client and an RPC server in the Datawire cloud. Step 1: Run the following command to install the {{{product}}} Python threaded integration: ``pip install {{{threaded_integration}}}`` Step 2: Move to the HelloRPC directory within your local {{{product}}} git repository. If you use the default location, do the following: ``cd ~/{{{github_directory}}}/examples/helloRPC`` Step 3: Run the client by executing the following command: ``python pyclient.py`` You should see the following in your terminal window (stdout): .. code-block:: none Request says 'Hello from Python!' Response says 'Responding to [Hello from Python!] from Datawire Cloud’ [[JMK insert exact response once the client is finalized]] You just used the provided Python helloRPC client to communicate with the helloRPC server in the Datawire cloud. Now, let’s see how to write a client that performs the same functionality as well as a local server that sends similar responses to that client via RPC. You’ll be able to switch your client back and forth so it communicates with either the local server or the server in the cloud.
Quickly Trying RPC ================== Before building your own RPC client and servers, you can see RPC with {{{product}}} in action using a provided client and an RPC server in the Datawire cloud. Step 1: Run the following command to install the {{{product}}} Python threaded integration: ``pip install {{{threaded_integration}}}`` Step 2: Move to the HelloRPC directory within your local {{{product}}} git repository. If you use the default location, do the following: ``cd ~/{{{github_directory}}}/examples/helloRPC`` Step 3: Run the client by executing the following command: ``python pyclient.py`` You should see the following in your terminal window (stdout): .. code-block:: none Request says 'Hello from Python!' Response says u"Responding to 'Hello from Python!' from Datawire Cloud!" You just used the provided Python helloRPC client to communicate with the helloRPC server in the Datawire cloud. Now, let’s see how to write a client that performs the same functionality as well as a local server that sends similar responses to that client via RPC. You’ll be able to switch your client back and forth so it communicates with either the local server or the server in the cloud.
Add exact reply from cloud server
Add exact reply from cloud server
reStructuredText
apache-2.0
datawire/quark,datawire/quark,datawire/quark,datawire/datawire-connect,datawire/quark,datawire/datawire-connect,bozzzzo/quark,bozzzzo/quark,datawire/quark,datawire/datawire-connect,datawire/datawire-connect,datawire/quark,bozzzzo/quark,bozzzzo/quark
restructuredtext
## Code Before: Quickly Trying RPC ================== Before building your own RPC client and servers, you can see RPC with {{{product}}} in action using a provided client and an RPC server in the Datawire cloud. Step 1: Run the following command to install the {{{product}}} Python threaded integration: ``pip install {{{threaded_integration}}}`` Step 2: Move to the HelloRPC directory within your local {{{product}}} git repository. If you use the default location, do the following: ``cd ~/{{{github_directory}}}/examples/helloRPC`` Step 3: Run the client by executing the following command: ``python pyclient.py`` You should see the following in your terminal window (stdout): .. code-block:: none Request says 'Hello from Python!' Response says 'Responding to [Hello from Python!] from Datawire Cloud’ [[JMK insert exact response once the client is finalized]] You just used the provided Python helloRPC client to communicate with the helloRPC server in the Datawire cloud. Now, let’s see how to write a client that performs the same functionality as well as a local server that sends similar responses to that client via RPC. You’ll be able to switch your client back and forth so it communicates with either the local server or the server in the cloud. ## Instruction: Add exact reply from cloud server ## Code After: Quickly Trying RPC ================== Before building your own RPC client and servers, you can see RPC with {{{product}}} in action using a provided client and an RPC server in the Datawire cloud. Step 1: Run the following command to install the {{{product}}} Python threaded integration: ``pip install {{{threaded_integration}}}`` Step 2: Move to the HelloRPC directory within your local {{{product}}} git repository. If you use the default location, do the following: ``cd ~/{{{github_directory}}}/examples/helloRPC`` Step 3: Run the client by executing the following command: ``python pyclient.py`` You should see the following in your terminal window (stdout): .. code-block:: none Request says 'Hello from Python!' Response says u"Responding to 'Hello from Python!' from Datawire Cloud!" You just used the provided Python helloRPC client to communicate with the helloRPC server in the Datawire cloud. Now, let’s see how to write a client that performs the same functionality as well as a local server that sends similar responses to that client via RPC. You’ll be able to switch your client back and forth so it communicates with either the local server or the server in the cloud.
Quickly Trying RPC ================== Before building your own RPC client and servers, you can see RPC with {{{product}}} in action using a provided client and an RPC server in the Datawire cloud. Step 1: Run the following command to install the {{{product}}} Python threaded integration: ``pip install {{{threaded_integration}}}`` Step 2: Move to the HelloRPC directory within your local {{{product}}} git repository. If you use the default location, do the following: ``cd ~/{{{github_directory}}}/examples/helloRPC`` Step 3: Run the client by executing the following command: ``python pyclient.py`` You should see the following in your terminal window (stdout): .. code-block:: none Request says 'Hello from Python!' - Response says 'Responding to [Hello from Python!] from Datawire Cloud’ ? ^ ^ ^ ^ + Response says u"Responding to 'Hello from Python!' from Datawire Cloud!" ? ^^ ^ ^ ^^ - - [[JMK insert exact response once the client is finalized]] You just used the provided Python helloRPC client to communicate with the helloRPC server in the Datawire cloud. Now, let’s see how to write a client that performs the same functionality as well as a local server that sends similar responses to that client via RPC. You’ll be able to switch your client back and forth so it communicates with either the local server or the server in the cloud.
4
0.173913
1
3
55b0d7eba281fc2c13505c956f5c23bb49b34988
tests/test_qiniu.py
tests/test_qiniu.py
import os from os.path import dirname, join import uuid import qiniu.conf import qiniu.io import qiniu.rs import qiniu.rsf QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') QINIU_BUCKET_DOMAIN = os.environ.get('QINIU_BUCKET_DOMAIN') qiniu.conf.ACCESS_KEY = QINIU_ACCESS_KEY qiniu.conf.SECRET_KEY = QINIU_SECRET_KEY QINIU_PUT_POLICY= qiniu.rs.PutPolicy(QINIU_BUCKET_NAME) def test_put_file(): ASSET_FILE_NAME = 'jquery-1.11.1.min.js' with open(join(dirname(__file__),'assets', ASSET_FILE_NAME), 'rb') as assset_file: text = assset_file.read() print "Test text: %s" % text token = QINIU_PUT_POLICY.token() ret, err = qiniu.io.put(token, join(str(uuid.uuid4()), ASSET_FILE_NAME), text) if err: raise IOError( "Error message: %s" % err)
import os from os.path import dirname, join import uuid import qiniu.conf import qiniu.io import qiniu.rs import qiniu.rsf QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') QINIU_BUCKET_DOMAIN = os.environ.get('QINIU_BUCKET_DOMAIN') qiniu.conf.ACCESS_KEY = QINIU_ACCESS_KEY qiniu.conf.SECRET_KEY = QINIU_SECRET_KEY QINIU_PUT_POLICY= qiniu.rs.PutPolicy(QINIU_BUCKET_NAME) def test_put_file(): ASSET_FILE_NAME = 'jquery-1.11.1.min.js' with open(join(dirname(__file__),'assets', ASSET_FILE_NAME), 'rb') as assset_file: text = assset_file.read() text = text[:len(text)/10] print "Test text: %s" % text token = QINIU_PUT_POLICY.token() ret, err = qiniu.io.put(token, join(str(uuid.uuid4()), ASSET_FILE_NAME), text) if err: raise IOError( "Error message: %s" % err)
Test with even smaller files
Test with even smaller files
Python
mit
glasslion/django-qiniu-storage,jeffrey4l/django-qiniu-storage,Mark-Shine/django-qiniu-storage,jackeyGao/django-qiniu-storage
python
## Code Before: import os from os.path import dirname, join import uuid import qiniu.conf import qiniu.io import qiniu.rs import qiniu.rsf QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') QINIU_BUCKET_DOMAIN = os.environ.get('QINIU_BUCKET_DOMAIN') qiniu.conf.ACCESS_KEY = QINIU_ACCESS_KEY qiniu.conf.SECRET_KEY = QINIU_SECRET_KEY QINIU_PUT_POLICY= qiniu.rs.PutPolicy(QINIU_BUCKET_NAME) def test_put_file(): ASSET_FILE_NAME = 'jquery-1.11.1.min.js' with open(join(dirname(__file__),'assets', ASSET_FILE_NAME), 'rb') as assset_file: text = assset_file.read() print "Test text: %s" % text token = QINIU_PUT_POLICY.token() ret, err = qiniu.io.put(token, join(str(uuid.uuid4()), ASSET_FILE_NAME), text) if err: raise IOError( "Error message: %s" % err) ## Instruction: Test with even smaller files ## Code After: import os from os.path import dirname, join import uuid import qiniu.conf import qiniu.io import qiniu.rs import qiniu.rsf QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') QINIU_BUCKET_DOMAIN = os.environ.get('QINIU_BUCKET_DOMAIN') qiniu.conf.ACCESS_KEY = QINIU_ACCESS_KEY qiniu.conf.SECRET_KEY = QINIU_SECRET_KEY QINIU_PUT_POLICY= qiniu.rs.PutPolicy(QINIU_BUCKET_NAME) def test_put_file(): ASSET_FILE_NAME = 'jquery-1.11.1.min.js' with open(join(dirname(__file__),'assets', ASSET_FILE_NAME), 'rb') as assset_file: text = assset_file.read() text = text[:len(text)/10] print "Test text: %s" % text token = QINIU_PUT_POLICY.token() ret, err = qiniu.io.put(token, join(str(uuid.uuid4()), ASSET_FILE_NAME), text) if err: raise IOError( "Error message: %s" % err)
import os from os.path import dirname, join import uuid import qiniu.conf import qiniu.io import qiniu.rs import qiniu.rsf QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') QINIU_BUCKET_DOMAIN = os.environ.get('QINIU_BUCKET_DOMAIN') qiniu.conf.ACCESS_KEY = QINIU_ACCESS_KEY qiniu.conf.SECRET_KEY = QINIU_SECRET_KEY QINIU_PUT_POLICY= qiniu.rs.PutPolicy(QINIU_BUCKET_NAME) def test_put_file(): ASSET_FILE_NAME = 'jquery-1.11.1.min.js' with open(join(dirname(__file__),'assets', ASSET_FILE_NAME), 'rb') as assset_file: text = assset_file.read() + text = text[:len(text)/10] print "Test text: %s" % text token = QINIU_PUT_POLICY.token() ret, err = qiniu.io.put(token, join(str(uuid.uuid4()), ASSET_FILE_NAME), text) if err: raise IOError( "Error message: %s" % err)
1
0.032258
1
0
5cbd269d194d14133bf920f3fa5609b50ae8ddc2
Package.swift
Package.swift
// swift-tools-version:4.2 import PackageDescription let package = Package( name: "Bagel", products: [ .library(name: "Bagel", targets: ["Bagel"]) ], dependencies: [ .package(url: "https://github.com/AccioSupport/CocoaAsyncSocket.git", .branch("master")), ], targets: [ .target( name: "Bagel", dependencies: ["CocoaAsyncSocket"], path: "iOS/Source" ) ] )
// swift-tools-version:4.2 import PackageDescription let package = Package( name: "Bagel", products: [ .library(name: "Bagel", targets: ["Bagel"]) ], dependencies: [ .package(url: "https://github.com/robbiehanson/CocoaAsyncSocket.git", .upToNextMajor(from: "7.6.4")), ], targets: [ .target( name: "Bagel", dependencies: ["CocoaAsyncSocket"], path: "iOS/Source" ) ] )
Use official release version of CocoaAsyncSocket
Use official release version of CocoaAsyncSocket
Swift
apache-2.0
yagiz/Bagel,yagiz/Bagel,yagiz/Bagel,yagiz/Bagel
swift
## Code Before: // swift-tools-version:4.2 import PackageDescription let package = Package( name: "Bagel", products: [ .library(name: "Bagel", targets: ["Bagel"]) ], dependencies: [ .package(url: "https://github.com/AccioSupport/CocoaAsyncSocket.git", .branch("master")), ], targets: [ .target( name: "Bagel", dependencies: ["CocoaAsyncSocket"], path: "iOS/Source" ) ] ) ## Instruction: Use official release version of CocoaAsyncSocket ## Code After: // swift-tools-version:4.2 import PackageDescription let package = Package( name: "Bagel", products: [ .library(name: "Bagel", targets: ["Bagel"]) ], dependencies: [ .package(url: "https://github.com/robbiehanson/CocoaAsyncSocket.git", .upToNextMajor(from: "7.6.4")), ], targets: [ .target( name: "Bagel", dependencies: ["CocoaAsyncSocket"], path: "iOS/Source" ) ] )
// swift-tools-version:4.2 import PackageDescription let package = Package( name: "Bagel", products: [ .library(name: "Bagel", targets: ["Bagel"]) ], dependencies: [ - .package(url: "https://github.com/AccioSupport/CocoaAsyncSocket.git", .branch("master")), + .package(url: "https://github.com/robbiehanson/CocoaAsyncSocket.git", .upToNextMajor(from: "7.6.4")), ], targets: [ .target( name: "Bagel", dependencies: ["CocoaAsyncSocket"], path: "iOS/Source" ) ] )
2
0.105263
1
1
e6e520d87c1493431d26961de0048ebe6aa8ad85
puppet/aliases.zsh
puppet/aliases.zsh
[[ -x ~/src/puppet/ext/envpuppet ]] && alias puppet="~/src/puppet/ext/envpuppet puppet" [[ -x ~/src/puppet/ext/envpuppet ]] && alias facter="~/src/puppet/ext/envpuppet facter" #[[ -x ~/src/puppet/ext/envpuppet ]] && alias mco="~/src/puppet/ext/envpuppet /Users/zach/src/marionette-collective/mco" [[ -x ~/src/puppet/ext/envpuppet ]] &&alias puppet-module="~/src/puppet/ext/envpuppet ~/src/puppet-module-tool/bin/puppet-module" alias mco="RUBYLIB=~/src/mcollective/lib ~/src/mcollective/bin/mco"
if [ -x ~/src/puppet/ext/envpuppet ]; then if [ -d ~/src/puppet ]; then alias puppet="~/src/puppet/ext/envpuppet puppet" alias puppet-module="~/src/puppet/ext/envpuppet ~/src/puppet-module-tool/bin/puppet-module" fi if [ -d ~/src/facter ]; then alias facter="~/src/puppet/ext/envpuppet facter" fi if [ -d ~/src/mcollective ]; then alias mco="~/src/puppet/ext/envpuppet /Users/zach/src/marionette-collective/mco" alias mco="RUBYLIB=~/src/mcollective/lib ~/src/mcollective/bin/mco" fi fi
Improve zsh alias loading for puppet
Improve zsh alias loading for puppet
Shell
mit
xaque208/dotfiles,xaque208/dotfiles,xaque208/dotfiles
shell
## Code Before: [[ -x ~/src/puppet/ext/envpuppet ]] && alias puppet="~/src/puppet/ext/envpuppet puppet" [[ -x ~/src/puppet/ext/envpuppet ]] && alias facter="~/src/puppet/ext/envpuppet facter" #[[ -x ~/src/puppet/ext/envpuppet ]] && alias mco="~/src/puppet/ext/envpuppet /Users/zach/src/marionette-collective/mco" [[ -x ~/src/puppet/ext/envpuppet ]] &&alias puppet-module="~/src/puppet/ext/envpuppet ~/src/puppet-module-tool/bin/puppet-module" alias mco="RUBYLIB=~/src/mcollective/lib ~/src/mcollective/bin/mco" ## Instruction: Improve zsh alias loading for puppet ## Code After: if [ -x ~/src/puppet/ext/envpuppet ]; then if [ -d ~/src/puppet ]; then alias puppet="~/src/puppet/ext/envpuppet puppet" alias puppet-module="~/src/puppet/ext/envpuppet ~/src/puppet-module-tool/bin/puppet-module" fi if [ -d ~/src/facter ]; then alias facter="~/src/puppet/ext/envpuppet facter" fi if [ -d ~/src/mcollective ]; then alias mco="~/src/puppet/ext/envpuppet /Users/zach/src/marionette-collective/mco" alias mco="RUBYLIB=~/src/mcollective/lib ~/src/mcollective/bin/mco" fi fi
- [[ -x ~/src/puppet/ext/envpuppet ]] && alias puppet="~/src/puppet/ext/envpuppet puppet" - [[ -x ~/src/puppet/ext/envpuppet ]] && alias facter="~/src/puppet/ext/envpuppet facter" - #[[ -x ~/src/puppet/ext/envpuppet ]] && alias mco="~/src/puppet/ext/envpuppet /Users/zach/src/marionette-collective/mco" + if [ -x ~/src/puppet/ext/envpuppet ]; then + if [ -d ~/src/puppet ]; then + alias puppet="~/src/puppet/ext/envpuppet puppet" - [[ -x ~/src/puppet/ext/envpuppet ]] &&alias puppet-module="~/src/puppet/ext/envpuppet ~/src/puppet-module-tool/bin/puppet-module" ? -- -- -------------------------- -- -- + alias puppet-module="~/src/puppet/ext/envpuppet ~/src/puppet-module-tool/bin/puppet-module" + fi + if [ -d ~/src/facter ]; then + alias facter="~/src/puppet/ext/envpuppet facter" + fi + + if [ -d ~/src/mcollective ]; then + alias mco="~/src/puppet/ext/envpuppet /Users/zach/src/marionette-collective/mco" - alias mco="RUBYLIB=~/src/mcollective/lib ~/src/mcollective/bin/mco" + alias mco="RUBYLIB=~/src/mcollective/lib ~/src/mcollective/bin/mco" ? ++++ + fi + fi +
20
3.333333
15
5
fabc9983afdfa17ff680ed9238be1d35f751137b
README.md
README.md
[![Latest Version][1]][2] Generate your license. Yet another [lice][3], but implement with Jinja. ## Install $ pip install licen ## Usage A gif is worth than a thousand words. ![demo_gif][gif] Or get detailed help message from the terminal. $ licen -h licen, generates license for you via command line Usage: licen [header] (-l | --list) licen [-y YEAR] [-f FULLNAME] [-e EMAIL] LICENSE_NAME licen header [-y YEAR] [-f FULLNAME] [-e EMAIL] LICENSE_HEADER licen --var NAME licen (-h | --help) licen (-V | --version) Options: -l --list List all the support licenses or headers. -y YEAR Specify the year. -f FULLNAME Specify the owner's fullname. -e EMAIL Specify the email. --var List all the variables in the template. -h --help Show the help message. -V --version Show the version info. ## License MIT. [1]: http://img.shields.io/pypi/v/licen.svg [2]: https://pypi.python.org/pypi/licen [3]: https://github.com/licenses/lice [gif]: https://github.com/lord63/licen/blob/master/licen_demo.gif
[![Latest Version][1]][2] [![Build Status][3]][4] Generate your license. Yet another [lice][3], but implement with Jinja. ## Install $ pip install licen ## Usage A gif is worth than a thousand words. ![demo_gif][gif] Or get detailed help message from the terminal. $ licen -h licen, generates license for you via command line Usage: licen [header] (-l | --list) licen [-y YEAR] [-f FULLNAME] [-e EMAIL] LICENSE_NAME licen header [-y YEAR] [-f FULLNAME] [-e EMAIL] LICENSE_HEADER licen --var NAME licen (-h | --help) licen (-V | --version) Options: -l --list List all the support licenses or headers. -y YEAR Specify the year. -f FULLNAME Specify the owner's fullname. -e EMAIL Specify the email. --var List all the variables in the template. -h --help Show the help message. -V --version Show the version info. ## License MIT. [1]: http://img.shields.io/pypi/v/licen.svg [2]: https://pypi.python.org/pypi/licen [3]: https://github.com/licenses/lice [3]: https://travis-ci.org/lord63/licen.svg [4]: https://travis-ci.org/lord63/licen [gif]: https://github.com/lord63/licen/blob/master/licen_demo.gif
Add badage for building status
Add badage for building status
Markdown
mit
lord63/licen
markdown
## Code Before: [![Latest Version][1]][2] Generate your license. Yet another [lice][3], but implement with Jinja. ## Install $ pip install licen ## Usage A gif is worth than a thousand words. ![demo_gif][gif] Or get detailed help message from the terminal. $ licen -h licen, generates license for you via command line Usage: licen [header] (-l | --list) licen [-y YEAR] [-f FULLNAME] [-e EMAIL] LICENSE_NAME licen header [-y YEAR] [-f FULLNAME] [-e EMAIL] LICENSE_HEADER licen --var NAME licen (-h | --help) licen (-V | --version) Options: -l --list List all the support licenses or headers. -y YEAR Specify the year. -f FULLNAME Specify the owner's fullname. -e EMAIL Specify the email. --var List all the variables in the template. -h --help Show the help message. -V --version Show the version info. ## License MIT. [1]: http://img.shields.io/pypi/v/licen.svg [2]: https://pypi.python.org/pypi/licen [3]: https://github.com/licenses/lice [gif]: https://github.com/lord63/licen/blob/master/licen_demo.gif ## Instruction: Add badage for building status ## Code After: [![Latest Version][1]][2] [![Build Status][3]][4] Generate your license. Yet another [lice][3], but implement with Jinja. ## Install $ pip install licen ## Usage A gif is worth than a thousand words. ![demo_gif][gif] Or get detailed help message from the terminal. $ licen -h licen, generates license for you via command line Usage: licen [header] (-l | --list) licen [-y YEAR] [-f FULLNAME] [-e EMAIL] LICENSE_NAME licen header [-y YEAR] [-f FULLNAME] [-e EMAIL] LICENSE_HEADER licen --var NAME licen (-h | --help) licen (-V | --version) Options: -l --list List all the support licenses or headers. -y YEAR Specify the year. -f FULLNAME Specify the owner's fullname. -e EMAIL Specify the email. --var List all the variables in the template. -h --help Show the help message. -V --version Show the version info. ## License MIT. [1]: http://img.shields.io/pypi/v/licen.svg [2]: https://pypi.python.org/pypi/licen [3]: https://github.com/licenses/lice [3]: https://travis-ci.org/lord63/licen.svg [4]: https://travis-ci.org/lord63/licen [gif]: https://github.com/lord63/licen/blob/master/licen_demo.gif
[![Latest Version][1]][2] + [![Build Status][3]][4] Generate your license. Yet another [lice][3], but implement with Jinja. ## Install $ pip install licen ## Usage A gif is worth than a thousand words. ![demo_gif][gif] Or get detailed help message from the terminal. $ licen -h licen, generates license for you via command line Usage: licen [header] (-l | --list) licen [-y YEAR] [-f FULLNAME] [-e EMAIL] LICENSE_NAME licen header [-y YEAR] [-f FULLNAME] [-e EMAIL] LICENSE_HEADER licen --var NAME licen (-h | --help) licen (-V | --version) Options: -l --list List all the support licenses or headers. -y YEAR Specify the year. -f FULLNAME Specify the owner's fullname. -e EMAIL Specify the email. --var List all the variables in the template. -h --help Show the help message. -V --version Show the version info. ## License MIT. [1]: http://img.shields.io/pypi/v/licen.svg [2]: https://pypi.python.org/pypi/licen [3]: https://github.com/licenses/lice + [3]: https://travis-ci.org/lord63/licen.svg + [4]: https://travis-ci.org/lord63/licen [gif]: https://github.com/lord63/licen/blob/master/licen_demo.gif
3
0.066667
3
0
c5a0c619246c272dfd9eefbec6b4deaf85c1dcbd
examples/examples.html
examples/examples.html
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <link type="text/css" rel="stylesheet" media="all" href="../dist/css/combobox.css"> <script src="https://fb.me/react-0.11.2.js"></script> <script src="../dist/js/combobox.js"></script> <script src="examples.js"></script> </head> <body> <div id="content"></div> </body> </html>
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <link type="text/css" rel="stylesheet" media="all" href="../dist/css/combobox.css"> <script src="//cdnjs.cloudflare.com/ajax/libs/react/0.11.2/react.js"></script> <script src="../dist/js/combobox.js"></script> <script src="examples.js"></script> </head> <body> <div id="content"></div> </body> </html>
Replace link to react lib with cdnjs CDN
Replace link to react lib with cdnjs CDN
HTML
mit
huston007/react-combo-box
html
## Code Before: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <link type="text/css" rel="stylesheet" media="all" href="../dist/css/combobox.css"> <script src="https://fb.me/react-0.11.2.js"></script> <script src="../dist/js/combobox.js"></script> <script src="examples.js"></script> </head> <body> <div id="content"></div> </body> </html> ## Instruction: Replace link to react lib with cdnjs CDN ## Code After: <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <link type="text/css" rel="stylesheet" media="all" href="../dist/css/combobox.css"> <script src="//cdnjs.cloudflare.com/ajax/libs/react/0.11.2/react.js"></script> <script src="../dist/js/combobox.js"></script> <script src="examples.js"></script> </head> <body> <div id="content"></div> </body> </html>
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> <link type="text/css" rel="stylesheet" media="all" href="../dist/css/combobox.css"> - <script src="https://fb.me/react-0.11.2.js"></script> + <script src="//cdnjs.cloudflare.com/ajax/libs/react/0.11.2/react.js"></script> <script src="../dist/js/combobox.js"></script> <script src="examples.js"></script> </head> <body> <div id="content"></div> </body> </html>
2
0.111111
1
1
a4451b11293bf465d623e6f336f3b4602f8ac201
scripts/use-ssh-git-repository.sh
scripts/use-ssh-git-repository.sh
cd ~/dotfiles git remote rm origin git remote add origin git@github.com:Benoth/dotfiles.git git push origin master echo "" echo "Do not forget to add in ~/.ssh/config :" echo " Host github.com" echo " HostName github.com" echo " User git" echo " IdentityFile ~/.ssh/keys/personnal-key.rsa" echo ""
cd ~/dotfiles git remote rm origin git remote add origin git@github.com:Benoth/dotfiles.git git push origin master git branch --set-upstream-to=origin/master master echo "" echo "Do not forget to add in ~/.ssh/config :" echo " Host github.com" echo " HostName github.com" echo " User git" echo " IdentityFile ~/.ssh/keys/personnal-key.rsa" echo ""
Add missing upstream to git script
Add missing upstream to git script
Shell
mit
Benoth/dotfiles,Benoth/dotfiles
shell
## Code Before: cd ~/dotfiles git remote rm origin git remote add origin git@github.com:Benoth/dotfiles.git git push origin master echo "" echo "Do not forget to add in ~/.ssh/config :" echo " Host github.com" echo " HostName github.com" echo " User git" echo " IdentityFile ~/.ssh/keys/personnal-key.rsa" echo "" ## Instruction: Add missing upstream to git script ## Code After: cd ~/dotfiles git remote rm origin git remote add origin git@github.com:Benoth/dotfiles.git git push origin master git branch --set-upstream-to=origin/master master echo "" echo "Do not forget to add in ~/.ssh/config :" echo " Host github.com" echo " HostName github.com" echo " User git" echo " IdentityFile ~/.ssh/keys/personnal-key.rsa" echo ""
cd ~/dotfiles git remote rm origin git remote add origin git@github.com:Benoth/dotfiles.git git push origin master + git branch --set-upstream-to=origin/master master echo "" echo "Do not forget to add in ~/.ssh/config :" echo " Host github.com" echo " HostName github.com" echo " User git" echo " IdentityFile ~/.ssh/keys/personnal-key.rsa" echo ""
1
0.071429
1
0
0c95e171bfb0e1be952f9da834983caa38caae90
app/assets/templates/addresses/address.html.slim
app/assets/templates/addresses/address.html.slim
.address dl.dl-horizontal dt Name dd(ng-bind='address.fullName()') dt Address dd | {{address.address1}} br(ng-if='address.address2') | {{address.address2}} dt City dd(ng-bind='address.city') dt State/Province dd(ng-bind='address.state.name') dt Country dd(ng-bind='address.country.name') dt Zip Code dd(ng-bind='address.zipcode') dt Phone dd(ng-bind='address.phone')
.address dl.dl-horizontal dt Name dd(ng-bind='address.fullName()') dt Address dd | {{address.address1}} br(ng-if='address.address2') | {{address.address2}} dt City dd(ng-bind='address.city') dt State/Province dd(ng-bind='address.actualStateName()') dt Country dd(ng-bind='address.country.name') dt Zip Code dd(ng-bind='address.zipcode') dt Phone dd(ng-bind='address.phone')
Use address.actualStateName() in address/address template
Use address.actualStateName() in address/address template
Slim
mit
sprangular/sprangular,sprangular/sprangular,sprangular/sprangular
slim
## Code Before: .address dl.dl-horizontal dt Name dd(ng-bind='address.fullName()') dt Address dd | {{address.address1}} br(ng-if='address.address2') | {{address.address2}} dt City dd(ng-bind='address.city') dt State/Province dd(ng-bind='address.state.name') dt Country dd(ng-bind='address.country.name') dt Zip Code dd(ng-bind='address.zipcode') dt Phone dd(ng-bind='address.phone') ## Instruction: Use address.actualStateName() in address/address template ## Code After: .address dl.dl-horizontal dt Name dd(ng-bind='address.fullName()') dt Address dd | {{address.address1}} br(ng-if='address.address2') | {{address.address2}} dt City dd(ng-bind='address.city') dt State/Province dd(ng-bind='address.actualStateName()') dt Country dd(ng-bind='address.country.name') dt Zip Code dd(ng-bind='address.zipcode') dt Phone dd(ng-bind='address.phone')
.address dl.dl-horizontal dt Name dd(ng-bind='address.fullName()') dt Address dd | {{address.address1}} br(ng-if='address.address2') | {{address.address2}} dt City dd(ng-bind='address.city') dt State/Province - dd(ng-bind='address.state.name') ? ^ ^^ + dd(ng-bind='address.actualStateName()') ? ^^^^^^^ ^ ++ dt Country dd(ng-bind='address.country.name') dt Zip Code dd(ng-bind='address.zipcode') dt Phone dd(ng-bind='address.phone')
2
0.08
1
1
4fec805a0a6c04ac16fd4439298a4fa05709c7ea
armstrong/hatband/tests/hatband_support/admin.py
armstrong/hatband/tests/hatband_support/admin.py
from armstrong import hatband from hatband_support import models from django.forms.widgets import TextInput class ArticleAdmin(hatband.ModelAdmin): class Meta: model = models.TestArticle class ArticleOverrideAdmin(hatband.ModelAdmin): formfield_overrides = { models.TextField: {'widget': TextInput}, } class Meta: model = models.TestArticle class ArticleTabbedInline(hatband.TabbedInline): class Meta: model = models.TestArticle class ArticleStackedInline(hatband.StackedInline): class Meta: model = models.TestArticle class CategoryAdminTabbed(hatband.ModelAdmin): inlines = ArticleTabbedInline class Meta: model = models.TestCategory class CategoryAdminStacked(hatband.ModelAdmin): inlines = ArticleStackedInline class Meta: model = models.TestCategory
from armstrong import hatband from . import models from django.db.models import TextField from django.forms.widgets import TextInput class ArticleAdmin(hatband.ModelAdmin): class Meta: model = models.TestArticle class ArticleOverrideAdmin(hatband.ModelAdmin): formfield_overrides = { TextField: {'widget': TextInput}, } class Meta: model = models.TestArticle class ArticleTabularInline(hatband.TabularInline): class Meta: model = models.TestArticle class ArticleStackedInline(hatband.StackedInline): class Meta: model = models.TestArticle class CategoryAdminTabbed(hatband.ModelAdmin): inlines = ArticleTabularInline class Meta: model = models.TestCategory class CategoryAdminStacked(hatband.ModelAdmin): inlines = ArticleStackedInline class Meta: model = models.TestCategory
Fix these class names and imports so it works
Fix these class names and imports so it works
Python
apache-2.0
armstrong/armstrong.hatband,texastribune/armstrong.hatband,texastribune/armstrong.hatband,armstrong/armstrong.hatband,armstrong/armstrong.hatband,texastribune/armstrong.hatband
python
## Code Before: from armstrong import hatband from hatband_support import models from django.forms.widgets import TextInput class ArticleAdmin(hatband.ModelAdmin): class Meta: model = models.TestArticle class ArticleOverrideAdmin(hatband.ModelAdmin): formfield_overrides = { models.TextField: {'widget': TextInput}, } class Meta: model = models.TestArticle class ArticleTabbedInline(hatband.TabbedInline): class Meta: model = models.TestArticle class ArticleStackedInline(hatband.StackedInline): class Meta: model = models.TestArticle class CategoryAdminTabbed(hatband.ModelAdmin): inlines = ArticleTabbedInline class Meta: model = models.TestCategory class CategoryAdminStacked(hatband.ModelAdmin): inlines = ArticleStackedInline class Meta: model = models.TestCategory ## Instruction: Fix these class names and imports so it works ## Code After: from armstrong import hatband from . import models from django.db.models import TextField from django.forms.widgets import TextInput class ArticleAdmin(hatband.ModelAdmin): class Meta: model = models.TestArticle class ArticleOverrideAdmin(hatband.ModelAdmin): formfield_overrides = { TextField: {'widget': TextInput}, } class Meta: model = models.TestArticle class ArticleTabularInline(hatband.TabularInline): class Meta: model = models.TestArticle class ArticleStackedInline(hatband.StackedInline): class Meta: model = models.TestArticle class CategoryAdminTabbed(hatband.ModelAdmin): inlines = ArticleTabularInline class Meta: model = models.TestCategory class CategoryAdminStacked(hatband.ModelAdmin): inlines = ArticleStackedInline class Meta: model = models.TestCategory
from armstrong import hatband - from hatband_support import models + from . import models + from django.db.models import TextField from django.forms.widgets import TextInput class ArticleAdmin(hatband.ModelAdmin): class Meta: model = models.TestArticle class ArticleOverrideAdmin(hatband.ModelAdmin): formfield_overrides = { - models.TextField: {'widget': TextInput}, ? ------- + TextField: {'widget': TextInput}, } class Meta: model = models.TestArticle - class ArticleTabbedInline(hatband.TabbedInline): ? ^^^ ^^^ + class ArticleTabularInline(hatband.TabularInline): ? ^^^^ ^^^^ class Meta: model = models.TestArticle class ArticleStackedInline(hatband.StackedInline): class Meta: model = models.TestArticle class CategoryAdminTabbed(hatband.ModelAdmin): - inlines = ArticleTabbedInline ? ^^^ + inlines = ArticleTabularInline ? ^^^^ class Meta: model = models.TestCategory class CategoryAdminStacked(hatband.ModelAdmin): inlines = ArticleStackedInline class Meta: model = models.TestCategory
9
0.191489
5
4
412ce2fc9bbd8de58153b276cb88996f67cab2e1
app/controllers/voice_extension/settings_controller.rb
app/controllers/voice_extension/settings_controller.rb
require_dependency "voice_extension/application_controller" module VoiceExtension class SettingsController < ApplicationController before_filter :authenticate_admin! def index @consume_phone_number = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_phone_number] || "" @consume_url = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_url] || "" end def update consume_phone_number = params[:consume_phone_number] consume_url = params[:consume_url] AP::VoiceExtension::Voice::Config.instance.configuration.merge!(consume_phone_number: consume_phone_number, consume_url: consume_url) # Try to set the consume url for the phone number begin twilio_wrapper = VoiceExtension::TwilioVoiceWrapper::Voice.new twilio_wrapper.update_voice_url(consume_phone_number, consume_url) rescue error = "Unable to setup the twilio phone number/url: #{$!.message}" Rails.logger.error(error) Rails.logger.error $!.backtrace.join("\n") flash[:error] = error end redirect_to settings_path end end end
require_dependency "voice_extension/application_controller" module VoiceExtension class SettingsController < ApplicationController before_filter :authenticate_admin! def index @consume_phone_number = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_phone_number] || "" @consume_url = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_url] || "http://<your_host>/api/voice_extension/consume" end def update consume_phone_number = params[:consume_phone_number] consume_url = params[:consume_url] AP::VoiceExtension::Voice::Config.instance.configuration.merge!(consume_phone_number: consume_phone_number, consume_url: consume_url) # Try to set the consume url for the phone number begin twilio_wrapper = VoiceExtension::TwilioVoiceWrapper::Voice.new twilio_wrapper.update_voice_url(consume_phone_number, consume_url) AP::VoiceExtension::Voice::Config.instance.configuration[:consume_phone_number] = consume_phone_number AP::VoiceExtension::Voice::Config.instance.configuration[:consume_url] = consume_url rescue error = "Unable to setup the twilio phone number/url: #{$!.message}" Rails.logger.error(error) Rails.logger.error $!.backtrace.join("\n") flash[:error] = error end redirect_to settings_path end end end
Set configuration to new values changed by the user.
Set configuration to new values changed by the user.
Ruby
mit
AnyPresence/voice_extension,AnyPresence/voice_extension
ruby
## Code Before: require_dependency "voice_extension/application_controller" module VoiceExtension class SettingsController < ApplicationController before_filter :authenticate_admin! def index @consume_phone_number = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_phone_number] || "" @consume_url = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_url] || "" end def update consume_phone_number = params[:consume_phone_number] consume_url = params[:consume_url] AP::VoiceExtension::Voice::Config.instance.configuration.merge!(consume_phone_number: consume_phone_number, consume_url: consume_url) # Try to set the consume url for the phone number begin twilio_wrapper = VoiceExtension::TwilioVoiceWrapper::Voice.new twilio_wrapper.update_voice_url(consume_phone_number, consume_url) rescue error = "Unable to setup the twilio phone number/url: #{$!.message}" Rails.logger.error(error) Rails.logger.error $!.backtrace.join("\n") flash[:error] = error end redirect_to settings_path end end end ## Instruction: Set configuration to new values changed by the user. ## Code After: require_dependency "voice_extension/application_controller" module VoiceExtension class SettingsController < ApplicationController before_filter :authenticate_admin! def index @consume_phone_number = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_phone_number] || "" @consume_url = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_url] || "http://<your_host>/api/voice_extension/consume" end def update consume_phone_number = params[:consume_phone_number] consume_url = params[:consume_url] AP::VoiceExtension::Voice::Config.instance.configuration.merge!(consume_phone_number: consume_phone_number, consume_url: consume_url) # Try to set the consume url for the phone number begin twilio_wrapper = VoiceExtension::TwilioVoiceWrapper::Voice.new twilio_wrapper.update_voice_url(consume_phone_number, consume_url) AP::VoiceExtension::Voice::Config.instance.configuration[:consume_phone_number] = consume_phone_number AP::VoiceExtension::Voice::Config.instance.configuration[:consume_url] = consume_url rescue error = "Unable to setup the twilio phone number/url: #{$!.message}" Rails.logger.error(error) Rails.logger.error $!.backtrace.join("\n") flash[:error] = error end redirect_to settings_path end end end
require_dependency "voice_extension/application_controller" module VoiceExtension class SettingsController < ApplicationController before_filter :authenticate_admin! def index @consume_phone_number = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_phone_number] || "" - @consume_url = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_url] || "" + @consume_url = AP::VoiceExtension::Voice::Config.instance.configuration[:consume_url] || "http://<your_host>/api/voice_extension/consume" ? ++++++++++++++++++++++++++++++++++++++++++++++ end def update consume_phone_number = params[:consume_phone_number] consume_url = params[:consume_url] AP::VoiceExtension::Voice::Config.instance.configuration.merge!(consume_phone_number: consume_phone_number, consume_url: consume_url) # Try to set the consume url for the phone number begin twilio_wrapper = VoiceExtension::TwilioVoiceWrapper::Voice.new twilio_wrapper.update_voice_url(consume_phone_number, consume_url) + AP::VoiceExtension::Voice::Config.instance.configuration[:consume_phone_number] = consume_phone_number + AP::VoiceExtension::Voice::Config.instance.configuration[:consume_url] = consume_url rescue error = "Unable to setup the twilio phone number/url: #{$!.message}" Rails.logger.error(error) Rails.logger.error $!.backtrace.join("\n") flash[:error] = error end redirect_to settings_path end end end
4
0.121212
3
1
ec05f3ac4daf1dd609656c418d07f8fdd08dca63
.travis.yml
.travis.yml
language: rust rust: - stable cache: cargo os: - linux sudo: required services: - xvfb before_script: - sudo apt-get update -qq - sudo apt-get install -y libx11-xcb-dev script: - cargo test
language: rust rust: - stable cache: cargo os: - linux sudo: required services: - xvfb before_script: - sudo apt-get update -qq - sudo apt-get install -y libxcb-shape0-dev libxcb-xfixes0-dev script: - cargo test
Fix dependencies install for xcb
Fix dependencies install for xcb Change the xcb package installed from libx11-xcb-dev to libxcb-shape0-dev and libxcb-xfixes0-dev, which now provide the missing libraries that cause ld to fail.
YAML
mit
quininer/x11-clipboard
yaml
## Code Before: language: rust rust: - stable cache: cargo os: - linux sudo: required services: - xvfb before_script: - sudo apt-get update -qq - sudo apt-get install -y libx11-xcb-dev script: - cargo test ## Instruction: Fix dependencies install for xcb Change the xcb package installed from libx11-xcb-dev to libxcb-shape0-dev and libxcb-xfixes0-dev, which now provide the missing libraries that cause ld to fail. ## Code After: language: rust rust: - stable cache: cargo os: - linux sudo: required services: - xvfb before_script: - sudo apt-get update -qq - sudo apt-get install -y libxcb-shape0-dev libxcb-xfixes0-dev script: - cargo test
language: rust rust: - stable cache: cargo os: - linux sudo: required services: - xvfb before_script: - sudo apt-get update -qq - - sudo apt-get install -y libx11-xcb-dev ? ^^ + - sudo apt-get install -y libxcb-shape0-dev libxcb-xfixes0-dev ? ^^ ++++++++++++++ ++++++++ script: - cargo test
2
0.142857
1
1
486b3f995e3ca9b8583809d86eec919a12bcbd13
src/client/products/product-tile.react.js
src/client/products/product-tile.react.js
import React from 'react'; import PureComponent from '../components/purecomponent.react'; import ProductImage from './product-image.react'; export default class ProductTile extends PureComponent { render() { const title = this.props.product.get('title'); const productNumber = this.props.product.get('productNumber'); const normalizedName = this.props.product.get('normalizedName'); return ( <div style={{textAlign: 'center'}} className='col-xs-6 col-sm-4 col-md-3 col-lg-3'> <div>{title}</div> <div><ProductImage productNumber={productNumber} normalizedName={normalizedName} alt={title}/></div> </div> ); } } ProductTile.propTypes = { product: React.PropTypes.shape({get: React.PropTypes.func.isRequired}).isRequired };
import React from 'react'; import PureComponent from '../components/purecomponent.react'; import ProductImage from './product-image.react'; export default class ProductTile extends PureComponent { render() { const title = this.props.product.get('title'); const productNumber = this.props.product.get('productNumber'); const normalizedName = this.props.product.get('normalizedName'); return ( <div style={{textAlign: 'center'}} className='col-xs-6 col-sm-4 col-md-3 col-lg-3'> <div style={{height: '60px'}}>{title}</div> <div><ProductImage productNumber={productNumber} normalizedName={normalizedName} alt={title}/></div> </div> ); } } ProductTile.propTypes = { product: React.PropTypes.shape({get: React.PropTypes.func.isRequired}).isRequired };
Fix height of product title to avoid weird tile positioning
Fix height of product title to avoid weird tile positioning
JavaScript
mit
lassecapel/este-isomorphic-app
javascript
## Code Before: import React from 'react'; import PureComponent from '../components/purecomponent.react'; import ProductImage from './product-image.react'; export default class ProductTile extends PureComponent { render() { const title = this.props.product.get('title'); const productNumber = this.props.product.get('productNumber'); const normalizedName = this.props.product.get('normalizedName'); return ( <div style={{textAlign: 'center'}} className='col-xs-6 col-sm-4 col-md-3 col-lg-3'> <div>{title}</div> <div><ProductImage productNumber={productNumber} normalizedName={normalizedName} alt={title}/></div> </div> ); } } ProductTile.propTypes = { product: React.PropTypes.shape({get: React.PropTypes.func.isRequired}).isRequired }; ## Instruction: Fix height of product title to avoid weird tile positioning ## Code After: import React from 'react'; import PureComponent from '../components/purecomponent.react'; import ProductImage from './product-image.react'; export default class ProductTile extends PureComponent { render() { const title = this.props.product.get('title'); const productNumber = this.props.product.get('productNumber'); const normalizedName = this.props.product.get('normalizedName'); return ( <div style={{textAlign: 'center'}} className='col-xs-6 col-sm-4 col-md-3 col-lg-3'> <div style={{height: '60px'}}>{title}</div> <div><ProductImage productNumber={productNumber} normalizedName={normalizedName} alt={title}/></div> </div> ); } } ProductTile.propTypes = { product: React.PropTypes.shape({get: React.PropTypes.func.isRequired}).isRequired };
import React from 'react'; import PureComponent from '../components/purecomponent.react'; import ProductImage from './product-image.react'; export default class ProductTile extends PureComponent { render() { const title = this.props.product.get('title'); const productNumber = this.props.product.get('productNumber'); const normalizedName = this.props.product.get('normalizedName'); return ( <div style={{textAlign: 'center'}} className='col-xs-6 col-sm-4 col-md-3 col-lg-3'> - <div>{title}</div> + <div style={{height: '60px'}}>{title}</div> <div><ProductImage productNumber={productNumber} normalizedName={normalizedName} alt={title}/></div> </div> ); } } ProductTile.propTypes = { product: React.PropTypes.shape({get: React.PropTypes.func.isRequired}).isRequired };
2
0.086957
1
1
784b165d67550cd159b05aabfd2872ebc746a9e2
pants/views.py
pants/views.py
from cornice import Service from tokenlib.errors import Error as TokenError callurl = Service(name='callurl', path='/call-url') call = Service(name='call', path='/call/{token}') def is_authenticated(request): """Validates that an user is authenticated and extracts its userid""" request.validated['userid'] = 'n1k0'; def is_token_valid(request): token = request.matchdict['token'] try: token = request.token_manager.parse_token(token.encode()) request.validated['token'] = token except TokenError as e: request.errors.add('querystring', 'token', e.message) @callurl.post(permission='create') def generate_callurl(request): """ Generate a callurl based on user ID. """ token = request.token_manager.make_token({ "userid": request.validated['userid'], }) call_url = '{root}/call/{token}'.format(root=request.application_url, token=token) return {'call-url': call_url} @call.get(validators=[is_token_valid], renderer='templates/call.jinja2') def display_app(request): return request.validated['token']
from pyramid.security import Allow, Authenticated, authenticated_userid from cornice import Service from tokenlib.errors import Error as TokenError callurl = Service(name='callurl', path='/call-url') call = Service(name='call', path='/call/{token}') def acl(request): return [(Allow, Authenticated, 'create-callurl')] def is_token_valid(request): token = request.matchdict['token'] try: token = request.token_manager.parse_token(token.encode()) request.validated['token'] = token except TokenError as e: request.errors.add('querystring', 'token', e.message) @callurl.post(permission='create-callurl', acl=acl) def generate_callurl(request): """ Generate a callurl based on user ID. """ userid = authenticated_userid(request) token = request.token_manager.make_token({"userid": userid}) call_url = '{root}/call/{token}'.format(root=request.application_url, token=token) return {'call-url': call_url} @call.get(validators=[is_token_valid], renderer='templates/call.jinja2') def display_app(request): return request.validated['token']
Implement ACL for call url creation
Implement ACL for call url creation
Python
mpl-2.0
ametaireau/pants-server,almet/pants-server
python
## Code Before: from cornice import Service from tokenlib.errors import Error as TokenError callurl = Service(name='callurl', path='/call-url') call = Service(name='call', path='/call/{token}') def is_authenticated(request): """Validates that an user is authenticated and extracts its userid""" request.validated['userid'] = 'n1k0'; def is_token_valid(request): token = request.matchdict['token'] try: token = request.token_manager.parse_token(token.encode()) request.validated['token'] = token except TokenError as e: request.errors.add('querystring', 'token', e.message) @callurl.post(permission='create') def generate_callurl(request): """ Generate a callurl based on user ID. """ token = request.token_manager.make_token({ "userid": request.validated['userid'], }) call_url = '{root}/call/{token}'.format(root=request.application_url, token=token) return {'call-url': call_url} @call.get(validators=[is_token_valid], renderer='templates/call.jinja2') def display_app(request): return request.validated['token'] ## Instruction: Implement ACL for call url creation ## Code After: from pyramid.security import Allow, Authenticated, authenticated_userid from cornice import Service from tokenlib.errors import Error as TokenError callurl = Service(name='callurl', path='/call-url') call = Service(name='call', path='/call/{token}') def acl(request): return [(Allow, Authenticated, 'create-callurl')] def is_token_valid(request): token = request.matchdict['token'] try: token = request.token_manager.parse_token(token.encode()) request.validated['token'] = token except TokenError as e: request.errors.add('querystring', 'token', e.message) @callurl.post(permission='create-callurl', acl=acl) def generate_callurl(request): """ Generate a callurl based on user ID. """ userid = authenticated_userid(request) token = request.token_manager.make_token({"userid": userid}) call_url = '{root}/call/{token}'.format(root=request.application_url, token=token) return {'call-url': call_url} @call.get(validators=[is_token_valid], renderer='templates/call.jinja2') def display_app(request): return request.validated['token']
+ from pyramid.security import Allow, Authenticated, authenticated_userid + from cornice import Service from tokenlib.errors import Error as TokenError callurl = Service(name='callurl', path='/call-url') call = Service(name='call', path='/call/{token}') + def acl(request): + return [(Allow, Authenticated, 'create-callurl')] - def is_authenticated(request): - """Validates that an user is authenticated and extracts its userid""" - request.validated['userid'] = 'n1k0'; - def is_token_valid(request): token = request.matchdict['token'] try: token = request.token_manager.parse_token(token.encode()) request.validated['token'] = token except TokenError as e: request.errors.add('querystring', 'token', e.message) - - @callurl.post(permission='create') + @callurl.post(permission='create-callurl', acl=acl) ? ++++++++ +++++++++ def generate_callurl(request): """ Generate a callurl based on user ID. """ + userid = authenticated_userid(request) - token = request.token_manager.make_token({ + token = request.token_manager.make_token({"userid": userid}) ? ++++++++++++++++++ - "userid": request.validated['userid'], - }) call_url = '{root}/call/{token}'.format(root=request.application_url, token=token) return {'call-url': call_url} @call.get(validators=[is_token_valid], renderer='templates/call.jinja2') def display_app(request): return request.validated['token']
16
0.432432
7
9
d29feeb291f2ed64311d25225632fb2016e4fe2f
tests/acceptance/characters-test.js
tests/acceptance/characters-test.js
import Ember from 'ember'; import { module, test } from 'qunit'; import startApp from 'superhero/tests/helpers/start-app'; import data from '../fixtures/characters'; var application, server; module('Acceptance: Characters', { beforeEach: function() { application = startApp(); var characters = data(); server = new Pretender(function() { this.get('/v1/public/characters', function(request) { return [ 200, {"Content-Type": "application/json"}, JSON.stringify(characters) ]; }); }); }, afterEach: function() { Ember.run(application, 'destroy'); } }); test('visiting /characters should show a list of characters', function(assert) { visit('/characters'); andThen(function() { assert.equal(currentURL(), '/characters'); assert.equal(find('div.character-card').length, 20, 'The page should have 20 characters'); }); }); test('Clicking the next page button should load a new page of characters', function(assert) { visit('/characters'); andThen(function() { click('button.button-next-page'); }); andThen(function() { assert.equal(currentURL(), '/characters?offset=20'); }); });
import Ember from 'ember'; import { module, test } from 'qunit'; import startApp from 'superhero/tests/helpers/start-app'; import data from '../fixtures/characters'; var application, server; module('Acceptance: Characters', { beforeEach: function() { application = startApp(); var characters = data(); server = new Pretender(function() { this.get('/v1/public/characters', function(request) { var responseData = JSON.stringify(characters); return [ 200, {"Content-Type": "application/json"}, responseData ]; }); }); }, afterEach: function() { Ember.run(application, 'destroy'); } }); test('visiting /characters should show a list of characters', function(assert) { visit('/characters'); andThen(function() { assert.equal(currentURL(), '/characters'); assert.equal(find('div.character-card').length, 20, 'The page should have 20 characters'); }); }); test('Clicking the next page button should load a new page of characters', function(assert) { visit('/characters'); andThen(function() { click('button.button-next-page'); }); andThen(function() { assert.equal(currentURL(), '/characters?offset=20'); assert.equal(find('div.character-card').length, 20, 'The page should have 20 characters'); }); });
Add next page response test
Add next page response test
JavaScript
mit
dtt101/superhero,dtt101/superhero
javascript
## Code Before: import Ember from 'ember'; import { module, test } from 'qunit'; import startApp from 'superhero/tests/helpers/start-app'; import data from '../fixtures/characters'; var application, server; module('Acceptance: Characters', { beforeEach: function() { application = startApp(); var characters = data(); server = new Pretender(function() { this.get('/v1/public/characters', function(request) { return [ 200, {"Content-Type": "application/json"}, JSON.stringify(characters) ]; }); }); }, afterEach: function() { Ember.run(application, 'destroy'); } }); test('visiting /characters should show a list of characters', function(assert) { visit('/characters'); andThen(function() { assert.equal(currentURL(), '/characters'); assert.equal(find('div.character-card').length, 20, 'The page should have 20 characters'); }); }); test('Clicking the next page button should load a new page of characters', function(assert) { visit('/characters'); andThen(function() { click('button.button-next-page'); }); andThen(function() { assert.equal(currentURL(), '/characters?offset=20'); }); }); ## Instruction: Add next page response test ## Code After: import Ember from 'ember'; import { module, test } from 'qunit'; import startApp from 'superhero/tests/helpers/start-app'; import data from '../fixtures/characters'; var application, server; module('Acceptance: Characters', { beforeEach: function() { application = startApp(); var characters = data(); server = new Pretender(function() { this.get('/v1/public/characters', function(request) { var responseData = JSON.stringify(characters); return [ 200, {"Content-Type": "application/json"}, responseData ]; }); }); }, afterEach: function() { Ember.run(application, 'destroy'); } }); test('visiting /characters should show a list of characters', function(assert) { visit('/characters'); andThen(function() { assert.equal(currentURL(), '/characters'); assert.equal(find('div.character-card').length, 20, 'The page should have 20 characters'); }); }); test('Clicking the next page button should load a new page of characters', function(assert) { visit('/characters'); andThen(function() { click('button.button-next-page'); }); andThen(function() { assert.equal(currentURL(), '/characters?offset=20'); assert.equal(find('div.character-card').length, 20, 'The page should have 20 characters'); }); });
import Ember from 'ember'; import { module, test } from 'qunit'; import startApp from 'superhero/tests/helpers/start-app'; import data from '../fixtures/characters'; var application, server; module('Acceptance: Characters', { beforeEach: function() { application = startApp(); var characters = data(); server = new Pretender(function() { this.get('/v1/public/characters', function(request) { + var responseData = JSON.stringify(characters); return [ 200, {"Content-Type": "application/json"}, - JSON.stringify(characters) + responseData ]; }); }); }, afterEach: function() { Ember.run(application, 'destroy'); } }); test('visiting /characters should show a list of characters', function(assert) { visit('/characters'); andThen(function() { assert.equal(currentURL(), '/characters'); assert.equal(find('div.character-card').length, 20, 'The page should have 20 characters'); }); }); test('Clicking the next page button should load a new page of characters', function(assert) { visit('/characters'); andThen(function() { click('button.button-next-page'); }); andThen(function() { assert.equal(currentURL(), '/characters?offset=20'); + assert.equal(find('div.character-card').length, 20, 'The page should have 20 characters'); }); });
4
0.076923
3
1
dd9cedad5aa1400bb6867137abb6b44368b81043
resources/docs/GitHub_page/run_page_locally.sh
resources/docs/GitHub_page/run_page_locally.sh
pages_dirpath='../gh-pages' config_filepath="$pages_dirpath"'/_config.yml' local_config_filepath="$pages_dirpath"'/_config_local.yml' config_entries_to_add=' github: [metadata]' cleanup () { rm -f "$local_config_filepath" } trap cleanup SIGINT SIGTERM SIGKILL cp -f "$config_filepath" "$local_config_filepath" echo "$config_entries_to_add" >> "$local_config_filepath" bundle exec jekyll serve --config "$local_config_filepath"
SCRIPT_NAME="${0##*/}" pages_dirpath='../gh-pages' config_filepath="$pages_dirpath"'/_config.yml' local_config_filepath="$pages_dirpath"'/_config_local.yml' local_config_entries=' github: [metadata]' cleanup () { rm -f "$local_config_filepath" } usage () { { echo "" echo "Usage: $SCRIPT_NAME [OPTIONS]..." echo "" echo "Options:" echo " -r, --release build site for release packages without having to run Jekyll server" echo " -h, --help display this help and exit" echo "" } 1>&2 exit 1 } #------------------------------------------------------------------------------- # Parse options while [[ "${1:0:1}" = "-" && "$1" != "--" ]]; do case "$1" in -r | --release ) local_config_entries="$local_config_entries"' is_release_build: true' ;; -h | --help ) usage ;; * ) [[ "$1" ]] && echo "error: unknown argument: $1" usage ;; esac shift done [[ "$1" = "--" ]] && shift #------------------------------------------------------------------------------- trap cleanup SIGINT SIGTERM SIGKILL echo "$local_config_entries" > "$local_config_filepath" bundle exec jekyll serve --config "$config_filepath,$local_config_filepath"
Add option to build HTML docs for release packages
docs: Add option to build HTML docs for release packages
Shell
bsd-3-clause
khalim19/gimp-plugin-export-layers,khalim19/gimp-plugin-export-layers
shell
## Code Before: pages_dirpath='../gh-pages' config_filepath="$pages_dirpath"'/_config.yml' local_config_filepath="$pages_dirpath"'/_config_local.yml' config_entries_to_add=' github: [metadata]' cleanup () { rm -f "$local_config_filepath" } trap cleanup SIGINT SIGTERM SIGKILL cp -f "$config_filepath" "$local_config_filepath" echo "$config_entries_to_add" >> "$local_config_filepath" bundle exec jekyll serve --config "$local_config_filepath" ## Instruction: docs: Add option to build HTML docs for release packages ## Code After: SCRIPT_NAME="${0##*/}" pages_dirpath='../gh-pages' config_filepath="$pages_dirpath"'/_config.yml' local_config_filepath="$pages_dirpath"'/_config_local.yml' local_config_entries=' github: [metadata]' cleanup () { rm -f "$local_config_filepath" } usage () { { echo "" echo "Usage: $SCRIPT_NAME [OPTIONS]..." echo "" echo "Options:" echo " -r, --release build site for release packages without having to run Jekyll server" echo " -h, --help display this help and exit" echo "" } 1>&2 exit 1 } #------------------------------------------------------------------------------- # Parse options while [[ "${1:0:1}" = "-" && "$1" != "--" ]]; do case "$1" in -r | --release ) local_config_entries="$local_config_entries"' is_release_build: true' ;; -h | --help ) usage ;; * ) [[ "$1" ]] && echo "error: unknown argument: $1" usage ;; esac shift done [[ "$1" = "--" ]] && shift #------------------------------------------------------------------------------- trap cleanup SIGINT SIGTERM SIGKILL echo "$local_config_entries" > "$local_config_filepath" bundle exec jekyll serve --config "$config_filepath,$local_config_filepath"
+ + SCRIPT_NAME="${0##*/}" pages_dirpath='../gh-pages' config_filepath="$pages_dirpath"'/_config.yml' local_config_filepath="$pages_dirpath"'/_config_local.yml' - config_entries_to_add=' + local_config_entries=' github: [metadata]' cleanup () { rm -f "$local_config_filepath" } + usage () { + { + echo "" + echo "Usage: $SCRIPT_NAME [OPTIONS]..." + echo "" + echo "Options:" + echo " -r, --release build site for release packages without having to run Jekyll server" + echo " -h, --help display this help and exit" + echo "" + } 1>&2 + + exit 1 + } + + #------------------------------------------------------------------------------- + + # Parse options + + while [[ "${1:0:1}" = "-" && "$1" != "--" ]]; do + case "$1" in + -r | --release ) + local_config_entries="$local_config_entries"' + is_release_build: true' + ;; + -h | --help ) + usage + ;; + * ) + [[ "$1" ]] && echo "error: unknown argument: $1" + usage + ;; + esac + + shift + + done + + [[ "$1" = "--" ]] && shift + + #------------------------------------------------------------------------------- + trap cleanup SIGINT SIGTERM SIGKILL - cp -f "$config_filepath" "$local_config_filepath" - echo "$config_entries_to_add" >> "$local_config_filepath" ? ------- - + echo "$local_config_entries" > "$local_config_filepath" ? ++++++ - bundle exec jekyll serve --config "$local_config_filepath" + bundle exec jekyll serve --config "$config_filepath,$local_config_filepath" ? +++++++++++++++++
50
2.777778
46
4
2b2be1879ea52c6bf0de9a2c2f56876baf3900b4
src/_shared/PickerBase.jsx
src/_shared/PickerBase.jsx
import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import moment from 'moment'; import DomainPropTypes from '../constants/prop-types'; /* eslint-disable react/sort-comp */ export default class PickerBase extends PureComponent { static propTypes = { value: DomainPropTypes.date, onChange: PropTypes.func.isRequired, autoOk: PropTypes.bool, returnMoment: PropTypes.bool, } static defaultProps = { value: new Date(), autoOk: false, returnMoment: false, } getValidDateOrCurrent = () => { const date = moment(this.props.value); return date.isValid() ? date : moment(); } state = { date: this.getValidDateOrCurrent(), } handleAccept = () => { const dateToReturn = this.props.returnMoment ? this.state.date : this.state.date.toDate(); this.props.onChange(dateToReturn); } handleDismiss = () => { this.setState({ date: this.getValidDateOrCurrent() }); } handleChange = (date, isFinish = true) => { this.setState({ date }, () => { if (isFinish && this.props.autoOk) { this.handleAccept(); this.togglePicker(); } }); } togglePicker = () => { this.wrapper.togglePicker(); } }
import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import moment from 'moment'; import DomainPropTypes from '../constants/prop-types'; /* eslint-disable react/sort-comp */ export default class PickerBase extends PureComponent { static propTypes = { value: DomainPropTypes.date, onChange: PropTypes.func.isRequired, autoOk: PropTypes.bool, returnMoment: PropTypes.bool, } static defaultProps = { value: new Date(), autoOk: false, returnMoment: false, } getValidDateOrCurrent = () => { const date = moment(this.props.value); return date.isValid() ? date : moment(); } state = { date: this.getValidDateOrCurrent(), } componentDidUpdate = (prevProps) => { if (this.props.value !== prevProps.value) { this.setState({ date: this.getValidDateOrCurrent() }); } } handleAccept = () => { const dateToReturn = this.props.returnMoment ? this.state.date : this.state.date.toDate(); this.props.onChange(dateToReturn); } handleDismiss = () => { this.setState({ date: this.getValidDateOrCurrent() }); } handleChange = (date, isFinish = true) => { this.setState({ date }, () => { if (isFinish && this.props.autoOk) { this.handleAccept(); this.togglePicker(); } }); } togglePicker = () => { this.wrapper.togglePicker(); } }
Fix not updating picker by changing value outside
Fix not updating picker by changing value outside
JSX
mit
mui-org/material-ui,mui-org/material-ui,dmtrKovalenko/material-ui-pickers,oliviertassinari/material-ui,mbrookes/material-ui,callemall/material-ui,rscnt/material-ui,oliviertassinari/material-ui,oliviertassinari/material-ui,mbrookes/material-ui,mui-org/material-ui,rscnt/material-ui,rscnt/material-ui,dmtrKovalenko/material-ui-pickers,callemall/material-ui,mbrookes/material-ui,callemall/material-ui,callemall/material-ui
jsx
## Code Before: import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import moment from 'moment'; import DomainPropTypes from '../constants/prop-types'; /* eslint-disable react/sort-comp */ export default class PickerBase extends PureComponent { static propTypes = { value: DomainPropTypes.date, onChange: PropTypes.func.isRequired, autoOk: PropTypes.bool, returnMoment: PropTypes.bool, } static defaultProps = { value: new Date(), autoOk: false, returnMoment: false, } getValidDateOrCurrent = () => { const date = moment(this.props.value); return date.isValid() ? date : moment(); } state = { date: this.getValidDateOrCurrent(), } handleAccept = () => { const dateToReturn = this.props.returnMoment ? this.state.date : this.state.date.toDate(); this.props.onChange(dateToReturn); } handleDismiss = () => { this.setState({ date: this.getValidDateOrCurrent() }); } handleChange = (date, isFinish = true) => { this.setState({ date }, () => { if (isFinish && this.props.autoOk) { this.handleAccept(); this.togglePicker(); } }); } togglePicker = () => { this.wrapper.togglePicker(); } } ## Instruction: Fix not updating picker by changing value outside ## Code After: import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import moment from 'moment'; import DomainPropTypes from '../constants/prop-types'; /* eslint-disable react/sort-comp */ export default class PickerBase extends PureComponent { static propTypes = { value: DomainPropTypes.date, onChange: PropTypes.func.isRequired, autoOk: PropTypes.bool, returnMoment: PropTypes.bool, } static defaultProps = { value: new Date(), autoOk: false, returnMoment: false, } getValidDateOrCurrent = () => { const date = moment(this.props.value); return date.isValid() ? date : moment(); } state = { date: this.getValidDateOrCurrent(), } componentDidUpdate = (prevProps) => { if (this.props.value !== prevProps.value) { this.setState({ date: this.getValidDateOrCurrent() }); } } handleAccept = () => { const dateToReturn = this.props.returnMoment ? this.state.date : this.state.date.toDate(); this.props.onChange(dateToReturn); } handleDismiss = () => { this.setState({ date: this.getValidDateOrCurrent() }); } handleChange = (date, isFinish = true) => { this.setState({ date }, () => { if (isFinish && this.props.autoOk) { this.handleAccept(); this.togglePicker(); } }); } togglePicker = () => { this.wrapper.togglePicker(); } }
import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import moment from 'moment'; import DomainPropTypes from '../constants/prop-types'; /* eslint-disable react/sort-comp */ export default class PickerBase extends PureComponent { static propTypes = { value: DomainPropTypes.date, onChange: PropTypes.func.isRequired, autoOk: PropTypes.bool, returnMoment: PropTypes.bool, } static defaultProps = { value: new Date(), autoOk: false, returnMoment: false, } getValidDateOrCurrent = () => { const date = moment(this.props.value); return date.isValid() ? date : moment(); } state = { date: this.getValidDateOrCurrent(), } + componentDidUpdate = (prevProps) => { + if (this.props.value !== prevProps.value) { + this.setState({ date: this.getValidDateOrCurrent() }); + } + } + handleAccept = () => { const dateToReturn = this.props.returnMoment ? this.state.date : this.state.date.toDate(); this.props.onChange(dateToReturn); } handleDismiss = () => { this.setState({ date: this.getValidDateOrCurrent() }); } handleChange = (date, isFinish = true) => { this.setState({ date }, () => { if (isFinish && this.props.autoOk) { this.handleAccept(); this.togglePicker(); } }); } togglePicker = () => { this.wrapper.togglePicker(); } }
6
0.109091
6
0
2bef7a88b0dbe0a37bdcac85d90476c2f06697df
recipes/faac/faac_1.24.bb
recipes/faac/faac_1.24.bb
DESCRIPTION = "Library for reading some sort of media format." SECTION = "libs" PRIORITY = "optional" DEPENDS = "" LICENSE = "LGPL" PR = "r1" inherit autotools SRC_URI = "${SOURCEFORGE_MIRROR}/faac/${PN}-${PV}.tar.gz" S = "${WORKDIR}/${PN}" PACKAGES =+ "lib${PN} lib${PN}-dev" FILES_${PN} = " ${bindir}/faac " FILES_lib${PN} = " ${libdir}/libfaac.so.*" FILES_lib${PN}-dev = " ${includedir}/faac.h ${includedir}/faaccfg.h ${libdir}/libfaac.so ${libdir}/libfaac.la ${libdir}/libfaac.a " SRC_URI[md5sum] = "e72dc74db17b42b06155613489077ad7" SRC_URI[sha256sum] = "a5844ff3bce0d7c885af71f41da01395d3253dcfc33863306a027a78a7cfad9e"
DESCRIPTION = "Library for reading some sort of media format." SECTION = "libs" PRIORITY = "optional" DEPENDS = "" LICENSE = "LGPLv2 LGPLv2.1" PR = "r2" inherit autotools SRC_URI = "${SOURCEFORGE_MIRROR}/faac/${PN}-${PV}.tar.gz" S = "${WORKDIR}/${PN}" PACKAGES =+ "lib${PN} lib${PN}-dev" FILES_${PN} = " ${bindir}/faac " FILES_lib${PN} = " ${libdir}/libfaac.so.*" FILES_lib${PN}-dev = " ${includedir}/faac.h ${includedir}/faaccfg.h ${libdir}/libfaac.so ${libdir}/libfaac.la ${libdir}/libfaac.a " SRC_URI[md5sum] = "e72dc74db17b42b06155613489077ad7" SRC_URI[sha256sum] = "a5844ff3bce0d7c885af71f41da01395d3253dcfc33863306a027a78a7cfad9e"
Update LICENSE field version to LGPLv2
faac: Update LICENSE field version to LGPLv2 * Updated LICENSE field version from generic LGPL to LGPLv2 to reflect the real license version. * This change was based on code inspection. Signed-off-by: Chase Maupin <5a5662f468a76e0fc4391e65fb9f536df44d7380@ti.com>
BitBake
mit
sledz/oe,sledz/oe,sledz/oe,mrchapp/arago-oe-dev,mrchapp/arago-oe-dev,mrchapp/arago-oe-dev,mrchapp/arago-oe-dev,mrchapp/arago-oe-dev,sledz/oe,sledz/oe,sledz/oe,mrchapp/arago-oe-dev,sledz/oe,mrchapp/arago-oe-dev
bitbake
## Code Before: DESCRIPTION = "Library for reading some sort of media format." SECTION = "libs" PRIORITY = "optional" DEPENDS = "" LICENSE = "LGPL" PR = "r1" inherit autotools SRC_URI = "${SOURCEFORGE_MIRROR}/faac/${PN}-${PV}.tar.gz" S = "${WORKDIR}/${PN}" PACKAGES =+ "lib${PN} lib${PN}-dev" FILES_${PN} = " ${bindir}/faac " FILES_lib${PN} = " ${libdir}/libfaac.so.*" FILES_lib${PN}-dev = " ${includedir}/faac.h ${includedir}/faaccfg.h ${libdir}/libfaac.so ${libdir}/libfaac.la ${libdir}/libfaac.a " SRC_URI[md5sum] = "e72dc74db17b42b06155613489077ad7" SRC_URI[sha256sum] = "a5844ff3bce0d7c885af71f41da01395d3253dcfc33863306a027a78a7cfad9e" ## Instruction: faac: Update LICENSE field version to LGPLv2 * Updated LICENSE field version from generic LGPL to LGPLv2 to reflect the real license version. * This change was based on code inspection. Signed-off-by: Chase Maupin <5a5662f468a76e0fc4391e65fb9f536df44d7380@ti.com> ## Code After: DESCRIPTION = "Library for reading some sort of media format." SECTION = "libs" PRIORITY = "optional" DEPENDS = "" LICENSE = "LGPLv2 LGPLv2.1" PR = "r2" inherit autotools SRC_URI = "${SOURCEFORGE_MIRROR}/faac/${PN}-${PV}.tar.gz" S = "${WORKDIR}/${PN}" PACKAGES =+ "lib${PN} lib${PN}-dev" FILES_${PN} = " ${bindir}/faac " FILES_lib${PN} = " ${libdir}/libfaac.so.*" FILES_lib${PN}-dev = " ${includedir}/faac.h ${includedir}/faaccfg.h ${libdir}/libfaac.so ${libdir}/libfaac.la ${libdir}/libfaac.a " SRC_URI[md5sum] = "e72dc74db17b42b06155613489077ad7" SRC_URI[sha256sum] = "a5844ff3bce0d7c885af71f41da01395d3253dcfc33863306a027a78a7cfad9e"
DESCRIPTION = "Library for reading some sort of media format." SECTION = "libs" PRIORITY = "optional" DEPENDS = "" - LICENSE = "LGPL" + LICENSE = "LGPLv2 LGPLv2.1" - PR = "r1" ? ^ + PR = "r2" ? ^ inherit autotools SRC_URI = "${SOURCEFORGE_MIRROR}/faac/${PN}-${PV}.tar.gz" S = "${WORKDIR}/${PN}" PACKAGES =+ "lib${PN} lib${PN}-dev" FILES_${PN} = " ${bindir}/faac " FILES_lib${PN} = " ${libdir}/libfaac.so.*" FILES_lib${PN}-dev = " ${includedir}/faac.h ${includedir}/faaccfg.h ${libdir}/libfaac.so ${libdir}/libfaac.la ${libdir}/libfaac.a " SRC_URI[md5sum] = "e72dc74db17b42b06155613489077ad7" SRC_URI[sha256sum] = "a5844ff3bce0d7c885af71f41da01395d3253dcfc33863306a027a78a7cfad9e"
4
0.181818
2
2
06b7b5fb29d4f62cc0ea42b59e5edcf0e81455ce
resources/views/components/adformat.blade.php
resources/views/components/adformat.blade.php
<?php $id = 'ID_'.md5(uniqid(rand(), true)); if (!isset($adformat)) $adformat = null; $create = $adformat == null ? true : false; $linkText = isset($linkText) ? $linkText : ($create ? 'Neues Werbeformat anlegen' : $adformat->name); ?> <a data-open="{{ $id }}">{{ $linkText }}{!! isset($linkHtml) ? $linkHtml : '' !!}</a> <div id="{{ $id }}" class="tiny reveal" data-reveal> <form method="POST" action="{{ !$create ? route('adformats.update', $adformat->id) : route('adformats.create', $issue->id) }}" autocomplete="off"> {!! csrf_field() !!} <label for="{{ $id }}_name">Name</label> <input type="text" value="{{ !$create ? $adformat->name : '' }}" placeholder="1/2 Seite bunt" name="name" id="{{ $id }}_name"> <div class="row collapse"> <label for="{{ $id }}_price">Preis</label> <div class="small-9 columns"> <input type="number" value="{{ !$create ? $adformat->price : '' }}" placeholder="1000" name="price" id="{{ $id }}_price"> </div> <div class="small-3 columns"> <span class="postfix">Cent</span> </div> </div> <button type="submit" class="button">{{ $create ? 'Anlegen' : 'Änderung speichern' }}</button> </form> </div>
<?php $id = 'ID_'.md5(uniqid(rand(), true)); if (!isset($adformat)) $adformat = null; $create = $adformat == null ? true : false; $linkText = isset($linkText) ? $linkText : ($create ? 'Neues Werbeformat anlegen' : $adformat->name); ?> <a data-open="{{ $id }}">{{ $linkText }}{!! isset($linkHtml) ? $linkHtml : '' !!}</a> <div id="{{ $id }}" class="tiny reveal" data-reveal> <form method="POST" action="{{ !$create ? route('adformats.update', $adformat->id) : route('adformats.create', $issue->id) }}" autocomplete="off"> {!! csrf_field() !!} <label for="{{ $id }}_name">Name</label> <input type="text" value="{{ !$create ? $adformat->name : '' }}" placeholder="1/2 Seite bunt" name="name" id="{{ $id }}_name"> <label for="{{ $id }}_price">Preis</label> <div class="input-group"> <input type="number" value="{{ !$create ? $adformat->price : '' }}" placeholder="1000" name="price" id="{{ $id }}_price" class="input-group-field"> <span class="input-group-label">Cent</span> </div> <button type="submit" class="button">{{ $create ? 'Anlegen' : 'Änderung speichern' }}</button> </form> </div>
Fix price input field styling.
Fix price input field styling.
PHP
mit
dthul/klecks-admanagement,dthul/klecks-admanagement
php
## Code Before: <?php $id = 'ID_'.md5(uniqid(rand(), true)); if (!isset($adformat)) $adformat = null; $create = $adformat == null ? true : false; $linkText = isset($linkText) ? $linkText : ($create ? 'Neues Werbeformat anlegen' : $adformat->name); ?> <a data-open="{{ $id }}">{{ $linkText }}{!! isset($linkHtml) ? $linkHtml : '' !!}</a> <div id="{{ $id }}" class="tiny reveal" data-reveal> <form method="POST" action="{{ !$create ? route('adformats.update', $adformat->id) : route('adformats.create', $issue->id) }}" autocomplete="off"> {!! csrf_field() !!} <label for="{{ $id }}_name">Name</label> <input type="text" value="{{ !$create ? $adformat->name : '' }}" placeholder="1/2 Seite bunt" name="name" id="{{ $id }}_name"> <div class="row collapse"> <label for="{{ $id }}_price">Preis</label> <div class="small-9 columns"> <input type="number" value="{{ !$create ? $adformat->price : '' }}" placeholder="1000" name="price" id="{{ $id }}_price"> </div> <div class="small-3 columns"> <span class="postfix">Cent</span> </div> </div> <button type="submit" class="button">{{ $create ? 'Anlegen' : 'Änderung speichern' }}</button> </form> </div> ## Instruction: Fix price input field styling. ## Code After: <?php $id = 'ID_'.md5(uniqid(rand(), true)); if (!isset($adformat)) $adformat = null; $create = $adformat == null ? true : false; $linkText = isset($linkText) ? $linkText : ($create ? 'Neues Werbeformat anlegen' : $adformat->name); ?> <a data-open="{{ $id }}">{{ $linkText }}{!! isset($linkHtml) ? $linkHtml : '' !!}</a> <div id="{{ $id }}" class="tiny reveal" data-reveal> <form method="POST" action="{{ !$create ? route('adformats.update', $adformat->id) : route('adformats.create', $issue->id) }}" autocomplete="off"> {!! csrf_field() !!} <label for="{{ $id }}_name">Name</label> <input type="text" value="{{ !$create ? $adformat->name : '' }}" placeholder="1/2 Seite bunt" name="name" id="{{ $id }}_name"> <label for="{{ $id }}_price">Preis</label> <div class="input-group"> <input type="number" value="{{ !$create ? $adformat->price : '' }}" placeholder="1000" name="price" id="{{ $id }}_price" class="input-group-field"> <span class="input-group-label">Cent</span> </div> <button type="submit" class="button">{{ $create ? 'Anlegen' : 'Änderung speichern' }}</button> </form> </div>
<?php $id = 'ID_'.md5(uniqid(rand(), true)); if (!isset($adformat)) $adformat = null; $create = $adformat == null ? true : false; $linkText = isset($linkText) ? $linkText : ($create ? 'Neues Werbeformat anlegen' : $adformat->name); ?> <a data-open="{{ $id }}">{{ $linkText }}{!! isset($linkHtml) ? $linkHtml : '' !!}</a> <div id="{{ $id }}" class="tiny reveal" data-reveal> <form method="POST" action="{{ !$create ? route('adformats.update', $adformat->id) : route('adformats.create', $issue->id) }}" autocomplete="off"> {!! csrf_field() !!} <label for="{{ $id }}_name">Name</label> - <input type="text" value="{{ !$create ? $adformat->name : '' }}" placeholder="1/2 Seite bunt" name="name" id="{{ $id }}_name"> ? ^^^^^^^^ + <input type="text" value="{{ !$create ? $adformat->name : '' }}" placeholder="1/2 Seite bunt" name="name" id="{{ $id }}_name"> ? ^^ - <div class="row collapse"> - <label for="{{ $id }}_price">Preis</label> ? ^^^^^^^^^^^^ + <label for="{{ $id }}_price">Preis</label> ? ^^ - <div class="small-9 columns"> + <div class="input-group"> - <input type="number" value="{{ !$create ? $adformat->price : '' }}" placeholder="1000" name="price" id="{{ $id }}_price"> ? ^^^^^^^^^^^^^^^^ + <input type="number" value="{{ !$create ? $adformat->price : '' }}" placeholder="1000" name="price" id="{{ $id }}_price" class="input-group-field"> ? ^^^ ++++++++++++++++++++++++++ + <span class="input-group-label">Cent</span> + </div> - </div> - <div class="small-3 columns"> - <span class="postfix">Cent</span> - </div> - </div> <button type="submit" class="button">{{ $create ? 'Anlegen' : 'Änderung speichern' }}</button> </form> </div>
16
0.615385
6
10
a1ceed3db9532aa9ffadebefe2b095708e2cacde
metadata/com.smartpack.packagemanager.yml
metadata/com.smartpack.packagemanager.yml
Categories: - System License: GPL-3.0-or-later AuthorName: sunilpaulmathew AuthorEmail: sunil.kde@gmail.com AuthorWebSite: https://smartpack.github.io WebSite: https://smartpack.github.io/pm SourceCode: https://github.com/SmartPack/PackageManager IssueTracker: https://github.com/SmartPack/PackageManager/issues Changelog: https://github.com/SmartPack/PackageManager/blob/HEAD/change-logs.md Donate: https://smartpack.github.io/donation AutoName: Package Manager RepoType: git Repo: https://github.com/SmartPack/PackageManager Builds: - versionName: v3.0 versionCode: 30 commit: v3.0 subdir: app gradle: - fdroid - versionName: v3.1 versionCode: 31 commit: v3.1 subdir: app gradle: - fdroid - versionName: v3.3 versionCode: 33 commit: v3.3 subdir: app gradle: - fdroid - versionName: v3.4 versionCode: 34 commit: v3.4 subdir: app gradle: - fdroid AutoUpdateMode: Version %v UpdateCheckMode: Tags CurrentVersion: v3.4 CurrentVersionCode: 34
Categories: - System License: GPL-3.0-or-later AuthorName: sunilpaulmathew AuthorEmail: sunil.kde@gmail.com AuthorWebSite: https://smartpack.github.io WebSite: https://smartpack.github.io/pm SourceCode: https://github.com/SmartPack/PackageManager IssueTracker: https://github.com/SmartPack/PackageManager/issues Changelog: https://github.com/SmartPack/PackageManager/blob/HEAD/change-logs.md Donate: https://smartpack.github.io/donation AutoName: Package Manager RepoType: git Repo: https://github.com/SmartPack/PackageManager Builds: - versionName: v3.0 versionCode: 30 commit: v3.0 subdir: app gradle: - fdroid - versionName: v3.1 versionCode: 31 commit: v3.1 subdir: app gradle: - fdroid - versionName: v3.3 versionCode: 33 commit: v3.3 subdir: app gradle: - fdroid - versionName: v3.4 versionCode: 34 commit: v3.4 subdir: app gradle: - fdroid - versionName: v3.5 versionCode: 35 commit: v3.5 subdir: app gradle: - fdroid AutoUpdateMode: Version %v UpdateCheckMode: Tags CurrentVersion: v3.5 CurrentVersionCode: 35
Update Package Manager to v3.5 (35)
Update Package Manager to v3.5 (35)
YAML
agpl-3.0
f-droid/fdroiddata,f-droid/fdroiddata
yaml
## Code Before: Categories: - System License: GPL-3.0-or-later AuthorName: sunilpaulmathew AuthorEmail: sunil.kde@gmail.com AuthorWebSite: https://smartpack.github.io WebSite: https://smartpack.github.io/pm SourceCode: https://github.com/SmartPack/PackageManager IssueTracker: https://github.com/SmartPack/PackageManager/issues Changelog: https://github.com/SmartPack/PackageManager/blob/HEAD/change-logs.md Donate: https://smartpack.github.io/donation AutoName: Package Manager RepoType: git Repo: https://github.com/SmartPack/PackageManager Builds: - versionName: v3.0 versionCode: 30 commit: v3.0 subdir: app gradle: - fdroid - versionName: v3.1 versionCode: 31 commit: v3.1 subdir: app gradle: - fdroid - versionName: v3.3 versionCode: 33 commit: v3.3 subdir: app gradle: - fdroid - versionName: v3.4 versionCode: 34 commit: v3.4 subdir: app gradle: - fdroid AutoUpdateMode: Version %v UpdateCheckMode: Tags CurrentVersion: v3.4 CurrentVersionCode: 34 ## Instruction: Update Package Manager to v3.5 (35) ## Code After: Categories: - System License: GPL-3.0-or-later AuthorName: sunilpaulmathew AuthorEmail: sunil.kde@gmail.com AuthorWebSite: https://smartpack.github.io WebSite: https://smartpack.github.io/pm SourceCode: https://github.com/SmartPack/PackageManager IssueTracker: https://github.com/SmartPack/PackageManager/issues Changelog: https://github.com/SmartPack/PackageManager/blob/HEAD/change-logs.md Donate: https://smartpack.github.io/donation AutoName: Package Manager RepoType: git Repo: https://github.com/SmartPack/PackageManager Builds: - versionName: v3.0 versionCode: 30 commit: v3.0 subdir: app gradle: - fdroid - versionName: v3.1 versionCode: 31 commit: v3.1 subdir: app gradle: - fdroid - versionName: v3.3 versionCode: 33 commit: v3.3 subdir: app gradle: - fdroid - versionName: v3.4 versionCode: 34 commit: v3.4 subdir: app gradle: - fdroid - versionName: v3.5 versionCode: 35 commit: v3.5 subdir: app gradle: - fdroid AutoUpdateMode: Version %v UpdateCheckMode: Tags CurrentVersion: v3.5 CurrentVersionCode: 35
Categories: - System License: GPL-3.0-or-later AuthorName: sunilpaulmathew AuthorEmail: sunil.kde@gmail.com AuthorWebSite: https://smartpack.github.io WebSite: https://smartpack.github.io/pm SourceCode: https://github.com/SmartPack/PackageManager IssueTracker: https://github.com/SmartPack/PackageManager/issues Changelog: https://github.com/SmartPack/PackageManager/blob/HEAD/change-logs.md Donate: https://smartpack.github.io/donation AutoName: Package Manager RepoType: git Repo: https://github.com/SmartPack/PackageManager Builds: - versionName: v3.0 versionCode: 30 commit: v3.0 subdir: app gradle: - fdroid - versionName: v3.1 versionCode: 31 commit: v3.1 subdir: app gradle: - fdroid - versionName: v3.3 versionCode: 33 commit: v3.3 subdir: app gradle: - fdroid - versionName: v3.4 versionCode: 34 commit: v3.4 subdir: app gradle: - fdroid + - versionName: v3.5 + versionCode: 35 + commit: v3.5 + subdir: app + gradle: + - fdroid + AutoUpdateMode: Version %v UpdateCheckMode: Tags - CurrentVersion: v3.4 ? ^ + CurrentVersion: v3.5 ? ^ - CurrentVersionCode: 34 ? ^ + CurrentVersionCode: 35 ? ^
11
0.22
9
2
46c1675d0bd55e6c7b653c1350b2774b0054864a
README.md
README.md
It's a simple library to create fake objects of exactly the same shape as passed class. It's designed to work with ES2015+ classes and their transpiled counterparts. It works well with TypeScript (since itself is written in TypeScript) and it's usability is proven in real-world projects. ## Usage ```js import { Deceiver } from 'deceiver-core'; class Foo { get foo () {return 'foo'; } aMethod () {} } const fooDeceiver = Deceiver(Foo); Object.prototype.hasOwnProperty.call(fooDeceiver, 'foo') //true fooDeceiver.aMethod() //undefined const fooDeceiverWithMixin = Deceiver(Foo, { foo: 'bar', aMethod () { return 'Hello!'; }, }); fooDeceiverWithMixin.foo //'bar' fooDeceiverWithMixin.aMethod //'Hello!' ```
[![CircleCI](https://circleci.com/gh/kapke/deceiver-core/tree/master.svg?style=svg)](https://circleci.com/gh/kapke/deceiver-core/tree/master) # Deceiver It's a simple library to create fake objects of exactly the same shape as passed class. It's designed to work with ES2015+ classes and their transpiled counterparts. It works well with TypeScript (since itself is written in TypeScript) and it's usability is proven in real-world projects. ## Usage ```js import { Deceiver } from 'deceiver-core'; class Foo { get foo () {return 'foo'; } aMethod () {} } const fooDeceiver = Deceiver(Foo); Object.prototype.hasOwnProperty.call(fooDeceiver, 'foo') //true fooDeceiver.aMethod() //undefined const fooDeceiverWithMixin = Deceiver(Foo, { foo: 'bar', aMethod () { return 'Hello!'; }, }); fooDeceiverWithMixin.foo //'bar' fooDeceiverWithMixin.aMethod //'Hello!' ```
Add badge for master build status
Add badge for master build status
Markdown
mit
kapke/deceiver-core
markdown
## Code Before: It's a simple library to create fake objects of exactly the same shape as passed class. It's designed to work with ES2015+ classes and their transpiled counterparts. It works well with TypeScript (since itself is written in TypeScript) and it's usability is proven in real-world projects. ## Usage ```js import { Deceiver } from 'deceiver-core'; class Foo { get foo () {return 'foo'; } aMethod () {} } const fooDeceiver = Deceiver(Foo); Object.prototype.hasOwnProperty.call(fooDeceiver, 'foo') //true fooDeceiver.aMethod() //undefined const fooDeceiverWithMixin = Deceiver(Foo, { foo: 'bar', aMethod () { return 'Hello!'; }, }); fooDeceiverWithMixin.foo //'bar' fooDeceiverWithMixin.aMethod //'Hello!' ``` ## Instruction: Add badge for master build status ## Code After: [![CircleCI](https://circleci.com/gh/kapke/deceiver-core/tree/master.svg?style=svg)](https://circleci.com/gh/kapke/deceiver-core/tree/master) # Deceiver It's a simple library to create fake objects of exactly the same shape as passed class. It's designed to work with ES2015+ classes and their transpiled counterparts. It works well with TypeScript (since itself is written in TypeScript) and it's usability is proven in real-world projects. ## Usage ```js import { Deceiver } from 'deceiver-core'; class Foo { get foo () {return 'foo'; } aMethod () {} } const fooDeceiver = Deceiver(Foo); Object.prototype.hasOwnProperty.call(fooDeceiver, 'foo') //true fooDeceiver.aMethod() //undefined const fooDeceiverWithMixin = Deceiver(Foo, { foo: 'bar', aMethod () { return 'Hello!'; }, }); fooDeceiverWithMixin.foo //'bar' fooDeceiverWithMixin.aMethod //'Hello!' ```
+ [![CircleCI](https://circleci.com/gh/kapke/deceiver-core/tree/master.svg?style=svg)](https://circleci.com/gh/kapke/deceiver-core/tree/master) + + # Deceiver It's a simple library to create fake objects of exactly the same shape as passed class. It's designed to work with ES2015+ classes and their transpiled counterparts. It works well with TypeScript (since itself is written in TypeScript) and it's usability is proven in real-world projects. ## Usage ```js import { Deceiver } from 'deceiver-core'; class Foo { get foo () {return 'foo'; } aMethod () {} } const fooDeceiver = Deceiver(Foo); Object.prototype.hasOwnProperty.call(fooDeceiver, 'foo') //true fooDeceiver.aMethod() //undefined const fooDeceiverWithMixin = Deceiver(Foo, { foo: 'bar', aMethod () { return 'Hello!'; }, }); fooDeceiverWithMixin.foo //'bar' fooDeceiverWithMixin.aMethod //'Hello!' ```
3
0.107143
3
0
2f3673021ca1020c341cf4bdef67f43dd8450119
scripts/facts.js
scripts/facts.js
module.exports = function(robot){ robot.facts = { sendFact: function(response){ var apiUrl = 'http://numbersapi.com/random', fact = ''; response.http(apiUrl).get()(function(err, res, body){ if (!!err) return; response.send('Did you know: ' + body + ' #bocbotfacts'); }); } }; robot.hear(/#(.*)fact/i, function(res){ robot.facts.sendFact(res); }); }
module.exports = function(robot){ robot.facts = { sendFact: function(response){ var apiUrl = 'http://numbersapi.com/random', fact = ''; response.http(apiUrl).get()(function(err, res, body){ if (!!err) return; response.send(body + ' #bocbotfacts'); }); } }; robot.hear(/#(.*)fact/i, function(res){ robot.facts.sendFact(res); }); }
Remove 'Did you know:' from beginning of fact
Remove 'Did you know:' from beginning of fact
JavaScript
mit
BallinOuttaControl/bocbot,BallinOuttaControl/bocbot
javascript
## Code Before: module.exports = function(robot){ robot.facts = { sendFact: function(response){ var apiUrl = 'http://numbersapi.com/random', fact = ''; response.http(apiUrl).get()(function(err, res, body){ if (!!err) return; response.send('Did you know: ' + body + ' #bocbotfacts'); }); } }; robot.hear(/#(.*)fact/i, function(res){ robot.facts.sendFact(res); }); } ## Instruction: Remove 'Did you know:' from beginning of fact ## Code After: module.exports = function(robot){ robot.facts = { sendFact: function(response){ var apiUrl = 'http://numbersapi.com/random', fact = ''; response.http(apiUrl).get()(function(err, res, body){ if (!!err) return; response.send(body + ' #bocbotfacts'); }); } }; robot.hear(/#(.*)fact/i, function(res){ robot.facts.sendFact(res); }); }
module.exports = function(robot){ robot.facts = { sendFact: function(response){ var apiUrl = 'http://numbersapi.com/random', fact = ''; response.http(apiUrl).get()(function(err, res, body){ if (!!err) return; - response.send('Did you know: ' + body + ' #bocbotfacts'); ? ------------------- + response.send(body + ' #bocbotfacts'); }); } }; robot.hear(/#(.*)fact/i, function(res){ robot.facts.sendFact(res); }); }
2
0.111111
1
1
689a3c955f8e79d3c07f66e596de7a0faf57fbab
src/scripts/test_allele_distances.ml
src/scripts/test_allele_distances.ml
open Util open Common let () = let open Mas_parser in let file = if Array.length Sys.argv < 2 then "A_gen" else Sys.argv.(1) in let mp = from_file (Common.to_alignment_file file) in List.iter mp.alt_elems ~f:(fun (al1, allele) -> let ds = allele_distances ~reference:mp.ref_elems ~allele |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) |> String.concat ~sep:";" in printf "ref vs %s: %s\n" al1 ds; List.iter mp.alt_elems ~f:(fun (al2, allele2) -> let dvs = allele_distances_between ~reference:mp.ref_elems ~allele1:allele ~allele2 |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) |> String.concat ~sep:";" in printf " %s vs %s: %s\n" al1 al2 dvs))
open Util open Common let () = if !Sys.interactive then () else let open Mas_parser in let n = Array.length Sys.argv in let file = if n < 2 then "A_gen" else Sys.argv.(1) in let mp = from_file (Common.to_alignment_file file) in List.iter mp.alt_elems ~f:(fun (al1, allele) -> let ds = allele_distances ~reference:mp.ref_elems ~allele |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) |> String.concat ~sep:";" in printf "ref vs %s: %s\n" al1 ds; List.iter mp.alt_elems ~f:(fun (al2, allele2) -> let dvs = allele_distances_between ~reference:mp.ref_elems ~allele1:allele ~allele2 |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) |> String.concat ~sep:";" in printf " %s vs %s: %s\n" al1 al2 dvs))
Add a check for interactive mode
Add a check for interactive mode
OCaml
apache-2.0
hammerlab/prohlatype
ocaml
## Code Before: open Util open Common let () = let open Mas_parser in let file = if Array.length Sys.argv < 2 then "A_gen" else Sys.argv.(1) in let mp = from_file (Common.to_alignment_file file) in List.iter mp.alt_elems ~f:(fun (al1, allele) -> let ds = allele_distances ~reference:mp.ref_elems ~allele |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) |> String.concat ~sep:";" in printf "ref vs %s: %s\n" al1 ds; List.iter mp.alt_elems ~f:(fun (al2, allele2) -> let dvs = allele_distances_between ~reference:mp.ref_elems ~allele1:allele ~allele2 |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) |> String.concat ~sep:";" in printf " %s vs %s: %s\n" al1 al2 dvs)) ## Instruction: Add a check for interactive mode ## Code After: open Util open Common let () = if !Sys.interactive then () else let open Mas_parser in let n = Array.length Sys.argv in let file = if n < 2 then "A_gen" else Sys.argv.(1) in let mp = from_file (Common.to_alignment_file file) in List.iter mp.alt_elems ~f:(fun (al1, allele) -> let ds = allele_distances ~reference:mp.ref_elems ~allele |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) |> String.concat ~sep:";" in printf "ref vs %s: %s\n" al1 ds; List.iter mp.alt_elems ~f:(fun (al2, allele2) -> let dvs = allele_distances_between ~reference:mp.ref_elems ~allele1:allele ~allele2 |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) |> String.concat ~sep:";" in printf " %s vs %s: %s\n" al1 al2 dvs))
open Util open Common let () = + if !Sys.interactive then () else - let open Mas_parser in + let open Mas_parser in ? ++ + let n = Array.length Sys.argv in - let file = if Array.length Sys.argv < 2 then "A_gen" else Sys.argv.(1) in ? -------- ------------ + let file = if n < 2 then "A_gen" else Sys.argv.(1) in ? ++ - let mp = from_file (Common.to_alignment_file file) in + let mp = from_file (Common.to_alignment_file file) in ? ++ - List.iter mp.alt_elems ~f:(fun (al1, allele) -> + List.iter mp.alt_elems ~f:(fun (al1, allele) -> ? ++ - let ds = allele_distances ~reference:mp.ref_elems ~allele + let ds = allele_distances ~reference:mp.ref_elems ~allele ? ++ - |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) + |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) ? ++ - |> String.concat ~sep:";" + |> String.concat ~sep:";" ? ++ - in - printf "ref vs %s: %s\n" al1 ds; - List.iter mp.alt_elems ~f:(fun (al2, allele2) -> - let dvs = - allele_distances_between ~reference:mp.ref_elems - ~allele1:allele ~allele2 - |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) - |> String.concat ~sep:";" in + printf "ref vs %s: %s\n" al1 ds; + List.iter mp.alt_elems ~f:(fun (al2, allele2) -> + let dvs = + allele_distances_between ~reference:mp.ref_elems + ~allele1:allele ~allele2 + |> List.map ~f:(fun d -> sprintf "%d" d.mismatches) + |> String.concat ~sep:";" + in - printf " %s vs %s: %s\n" al1 al2 dvs)) + printf " %s vs %s: %s\n" al1 al2 dvs)) ? ++
34
1.545455
18
16
5b33e1307e8061984128de6873eb79e0fba7a950
app/controllers/users_controller.rb
app/controllers/users_controller.rb
class UsersController < ApplicationController def new @user = User.new render :'users/new' end def create @user = User.new(reg_params) if @user.save redirect_to experiments_path else render new_user_path end end private def reg_params params.require(:user).permit(:role, :name, :email, :password) end end
class UsersController < ApplicationController def new @user = User.new render :'users/new' end def create @user = User.new(reg_params) if @user.save redirect_to new_session_path else render new_user_path end end private def reg_params params.require(:user).permit(:role, :name, :email, :password) end end
Change route for successul registration to login page
Change route for successul registration to login page
Ruby
mit
njarin/earp,njarin/earp,njarin/earp
ruby
## Code Before: class UsersController < ApplicationController def new @user = User.new render :'users/new' end def create @user = User.new(reg_params) if @user.save redirect_to experiments_path else render new_user_path end end private def reg_params params.require(:user).permit(:role, :name, :email, :password) end end ## Instruction: Change route for successul registration to login page ## Code After: class UsersController < ApplicationController def new @user = User.new render :'users/new' end def create @user = User.new(reg_params) if @user.save redirect_to new_session_path else render new_user_path end end private def reg_params params.require(:user).permit(:role, :name, :email, :password) end end
class UsersController < ApplicationController def new @user = User.new render :'users/new' end def create @user = User.new(reg_params) if @user.save - redirect_to experiments_path ? ^^ ^ ^^ -- + redirect_to new_session_path ? + ^^^ ^^ ^ else render new_user_path end end private def reg_params params.require(:user).permit(:role, :name, :email, :password) end end
2
0.1
1
1
d53f93f8652a3fedc14f4262a947dc4108b81dee
src/test/java/me/itszooti/geojson/GeoFeatureTest.java
src/test/java/me/itszooti/geojson/GeoFeatureTest.java
package me.itszooti.geojson; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.notNullValue; import org.junit.Before; import org.junit.Test; public class GeoFeatureTest { private GeoFeature feature; @Before public void before() { feature = new GeoFeature("a_test_feature", new GeoPoint(new GeoPosition(100.0, 0.0))); feature.setProperty("number", 2); feature.setProperty("letter", "B"); } @Test public void getId() { assertThat(feature.getId(), equalTo("a_test_feature")); } @Test public void getGeometry() { GeoGeometry geometry = feature.getGeometry(); assertThat(geometry, notNullValue()); assertThat(geometry, instanceOf(GeoPoint.class)); } @Test public void getProperty() { assertThat(feature.getProperty("number"), equalTo((Object)2)); assertThat(feature.getProperty("letter"), equalTo((Object)"B")); } @Test public void isGeoObject() { assertThat(feature, instanceOf(GeoObject.class)); } }
package me.itszooti.geojson; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.notNullValue; import java.util.Set; import org.junit.Before; import org.junit.Test; public class GeoFeatureTest { private GeoFeature feature; @Before public void before() { feature = new GeoFeature("a_test_feature", new GeoPoint(new GeoPosition(100.0, 0.0))); feature.setProperty("number", 2); feature.setProperty("letter", "B"); } @Test public void getId() { assertThat(feature.getId(), equalTo("a_test_feature")); } @Test public void getGeometry() { GeoGeometry geometry = feature.getGeometry(); assertThat(geometry, notNullValue()); assertThat(geometry, instanceOf(GeoPoint.class)); } @Test public void getProperty() { assertThat(feature.getProperty("number"), equalTo((Object)2)); assertThat(feature.getProperty("letter"), equalTo((Object)"B")); } @Test public void getPropertyNames() { Set<String> names = feature.getPropertyNames(); assertThat(names.size(), equalTo(2)); assertThat(names.contains("number"), equalTo(true)); assertThat(names.contains("letter"), equalTo(true)); } @Test public void isGeoObject() { assertThat(feature, instanceOf(GeoObject.class)); } }
Test for property names in GeoFeature
Test for property names in GeoFeature
Java
mit
itszootime/geojson-java
java
## Code Before: package me.itszooti.geojson; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.notNullValue; import org.junit.Before; import org.junit.Test; public class GeoFeatureTest { private GeoFeature feature; @Before public void before() { feature = new GeoFeature("a_test_feature", new GeoPoint(new GeoPosition(100.0, 0.0))); feature.setProperty("number", 2); feature.setProperty("letter", "B"); } @Test public void getId() { assertThat(feature.getId(), equalTo("a_test_feature")); } @Test public void getGeometry() { GeoGeometry geometry = feature.getGeometry(); assertThat(geometry, notNullValue()); assertThat(geometry, instanceOf(GeoPoint.class)); } @Test public void getProperty() { assertThat(feature.getProperty("number"), equalTo((Object)2)); assertThat(feature.getProperty("letter"), equalTo((Object)"B")); } @Test public void isGeoObject() { assertThat(feature, instanceOf(GeoObject.class)); } } ## Instruction: Test for property names in GeoFeature ## Code After: package me.itszooti.geojson; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.notNullValue; import java.util.Set; import org.junit.Before; import org.junit.Test; public class GeoFeatureTest { private GeoFeature feature; @Before public void before() { feature = new GeoFeature("a_test_feature", new GeoPoint(new GeoPosition(100.0, 0.0))); feature.setProperty("number", 2); feature.setProperty("letter", "B"); } @Test public void getId() { assertThat(feature.getId(), equalTo("a_test_feature")); } @Test public void getGeometry() { GeoGeometry geometry = feature.getGeometry(); assertThat(geometry, notNullValue()); assertThat(geometry, instanceOf(GeoPoint.class)); } @Test public void getProperty() { assertThat(feature.getProperty("number"), equalTo((Object)2)); assertThat(feature.getProperty("letter"), equalTo((Object)"B")); } @Test public void getPropertyNames() { Set<String> names = feature.getPropertyNames(); assertThat(names.size(), equalTo(2)); assertThat(names.contains("number"), equalTo(true)); assertThat(names.contains("letter"), equalTo(true)); } @Test public void isGeoObject() { assertThat(feature, instanceOf(GeoObject.class)); } }
package me.itszooti.geojson; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.instanceOf; import static org.hamcrest.Matchers.notNullValue; + + import java.util.Set; import org.junit.Before; import org.junit.Test; public class GeoFeatureTest { private GeoFeature feature; @Before public void before() { feature = new GeoFeature("a_test_feature", new GeoPoint(new GeoPosition(100.0, 0.0))); feature.setProperty("number", 2); feature.setProperty("letter", "B"); } @Test public void getId() { assertThat(feature.getId(), equalTo("a_test_feature")); } @Test public void getGeometry() { GeoGeometry geometry = feature.getGeometry(); assertThat(geometry, notNullValue()); assertThat(geometry, instanceOf(GeoPoint.class)); } @Test public void getProperty() { assertThat(feature.getProperty("number"), equalTo((Object)2)); assertThat(feature.getProperty("letter"), equalTo((Object)"B")); } @Test + public void getPropertyNames() { + Set<String> names = feature.getPropertyNames(); + assertThat(names.size(), equalTo(2)); + assertThat(names.contains("number"), equalTo(true)); + assertThat(names.contains("letter"), equalTo(true)); + } + + @Test public void isGeoObject() { assertThat(feature, instanceOf(GeoObject.class)); } }
10
0.222222
10
0
5d4eec08a19cb0f33eaa4d37490e30a00c496ba0
app/views/explore/projects/_project.html.haml
app/views/explore/projects/_project.html.haml
%li %h4.project-title .project-access-icon = visibility_level_icon(project.visibility_level) = link_to project.name_with_namespace, [project.namespace.becomes(Namespace), project] %span.pull-right %i.fa.fa-star = project.star_count .project-info - if project.description.present? %p.project-description.str-truncated = project.description .repo-info - unless project.empty_repo? = link_to pluralize(round_commit_count(project), 'commit'), namespace_project_commits_path(project.namespace, project, project.default_branch) &middot; = link_to pluralize(project.repository.branch_names.count, 'branch'), namespace_project_branches_path(project.namespace, project) &middot; = link_to pluralize(project.repository.tag_names.count, 'tag'), namespace_project_tags_path(project.namespace, project) - else %i.fa.fa-exclamation-triangle Empty repository
%li %h4.project-title .project-access-icon = visibility_level_icon(project.visibility_level) = link_to project.name_with_namespace, [project.namespace.becomes(Namespace), project] %span.pull-right %i.fa.fa-star = project.star_count .project-info - if project.description.present? .project-description.str-truncated = markdown(project.description, pipeline: :description) .repo-info - unless project.empty_repo? = link_to pluralize(round_commit_count(project), 'commit'), namespace_project_commits_path(project.namespace, project, project.default_branch) &middot; = link_to pluralize(project.repository.branch_names.count, 'branch'), namespace_project_branches_path(project.namespace, project) &middot; = link_to pluralize(project.repository.tag_names.count, 'tag'), namespace_project_tags_path(project.namespace, project) - else %i.fa.fa-exclamation-triangle Empty repository
Apply markdown filter for project descriptions on explore view
Apply markdown filter for project descriptions on explore view Signed-off-by: Sven Strickroth <a88b7dcd1a9e3e17770bbaa6d7515b31a2d7e85d@cs-ware.de>
Haml
mit
kemenaran/gitlabhq,pulkit21/gitlabhq,dplarson/gitlabhq,yfaizal/gitlabhq,whluwit/gitlabhq,nmav/gitlabhq,MauriceMohlek/gitlabhq,dukex/gitlabhq,larryli/gitlabhq,fgbreel/gitlabhq,hzy001/gitlabhq,liyakun/gitlabhq,axilleas/gitlabhq,Devin001/gitlabhq,k4zzk/gitlabhq,pjknkda/gitlabhq,dreampet/gitlab,sonalkr132/gitlabhq,dreampet/gitlab,OlegGirko/gitlab-ce,liyakun/gitlabhq,WSDC-NITWarangal/gitlabhq,TheWatcher/gitlabhq,pjknkda/gitlabhq,t-zuehlsdorff/gitlabhq,cui-liqiang/gitlab-ce,bozaro/gitlabhq,larryli/gitlabhq,stanhu/gitlabhq,jrjang/gitlab-ce,delkyd/gitlabhq,iiet/iiet-git,fantasywind/gitlabhq,fantasywind/gitlabhq,ksoichiro/gitlabhq,larryli/gitlabhq,SVArago/gitlabhq,pulkit21/gitlabhq,szechyjs/gitlabhq,icedwater/gitlabhq,ordiychen/gitlabhq,SVArago/gitlabhq,Razer6/gitlabhq,bbodenmiller/gitlabhq,michaKFromParis/gitlabhq,k4zzk/gitlabhq,allistera/gitlabhq,OlegGirko/gitlab-ce,whluwit/gitlabhq,copystudy/gitlabhq,screenpages/gitlabhq,dplarson/gitlabhq,koreamic/gitlabhq,michaKFromParis/sparkslab,rebecamendez/gitlabhq,mrb/gitlabhq,hacsoc/gitlabhq,pulkit21/gitlabhq,DanielZhangQingLong/gitlabhq,theonlydoo/gitlabhq,shinexiao/gitlabhq,sonalkr132/gitlabhq,vjustov/gitlabhq,htve/GitlabForChinese,ordiychen/gitlabhq,OlegGirko/gitlab-ce,liyakun/gitlabhq,jirutka/gitlabhq,fpgentil/gitlabhq,yatish27/gitlabhq,sue445/gitlabhq,duduribeiro/gitlabhq,LUMC/gitlabhq,louahola/gitlabhq,ferdinandrosario/gitlabhq,sekcheong/gitlabhq,Telekom-PD/gitlabhq,iiet/iiet-git,nmav/gitlabhq,yfaizal/gitlabhq,michaKFromParis/gitlabhq,cui-liqiang/gitlab-ce,wangcan2014/gitlabhq,DanielZhangQingLong/gitlabhq,Exeia/gitlabhq,salipro4ever/gitlabhq,jrjang/gitlabhq,SVArago/gitlabhq,yonglehou/gitlabhq,it33/gitlabhq,szechyjs/gitlabhq,dukex/gitlabhq,darkrasid/gitlabhq,mr-dxdy/gitlabhq,Soullivaneuh/gitlabhq,WSDC-NITWarangal/gitlabhq,salipro4ever/gitlabhq,hacsoc/gitlabhq,joalmeid/gitlabhq,mmkassem/gitlabhq,jaepyoung/gitlabhq,copystudy/gitlabhq,jrjang/gitlabhq,LUMC/gitlabhq,martinma4/gitlabhq,ikappas/gitlabhq,mmkassem/gitlabhq,Soullivaneuh/gitlabhq,stoplightio/gitlabhq,hq804116393/gitlabhq,Exeia/gitlabhq,duduribeiro/gitlabhq,H3Chief/gitlabhq,shinexiao/gitlabhq,martijnvermaat/gitlabhq,darkrasid/gitlabhq,openwide-java/gitlabhq,ferdinandrosario/gitlabhq,LUMC/gitlabhq,fgbreel/gitlabhq,cui-liqiang/gitlab-ce,Devin001/gitlabhq,mrb/gitlabhq,daiyu/gitlab-zh,darkrasid/gitlabhq,htve/GitlabForChinese,sekcheong/gitlabhq,icedwater/gitlabhq,fscherwi/gitlabhq,martinma4/gitlabhq,stanhu/gitlabhq,mr-dxdy/gitlabhq,copystudy/gitlabhq,icedwater/gitlabhq,ttasanen/gitlabhq,sonalkr132/gitlabhq,yatish27/gitlabhq,rumpelsepp/gitlabhq,sue445/gitlabhq,wangcan2014/gitlabhq,Burick/gitlabhq,wangcan2014/gitlabhq,ngpestelos/gitlabhq,allistera/gitlabhq,hq804116393/gitlabhq,pjknkda/gitlabhq,Tyrael/gitlabhq,joalmeid/gitlabhq,folpindo/gitlabhq,stoplightio/gitlabhq,since2014/gitlabhq,allysonbarros/gitlabhq,yatish27/gitlabhq,jirutka/gitlabhq,martijnvermaat/gitlabhq,jaepyoung/gitlabhq,bozaro/gitlabhq,stoplightio/gitlabhq,nmav/gitlabhq,DanielZhangQingLong/gitlabhq,sekcheong/gitlabhq,vjustov/gitlabhq,ttasanen/gitlabhq,t-zuehlsdorff/gitlabhq,fpgentil/gitlabhq,folpindo/gitlabhq,martinma4/gitlabhq,it33/gitlabhq,vjustov/gitlabhq,michaKFromParis/gitlabhqold,mrb/gitlabhq,michaKFromParis/sparkslab,pjknkda/gitlabhq,NKMR6194/gitlabhq,since2014/gitlabhq,allysonbarros/gitlabhq,whluwit/gitlabhq,iiet/iiet-git,since2014/gitlabhq,aaronsnyder/gitlabhq,louahola/gitlabhq,Devin001/gitlabhq,dwrensha/gitlabhq,k4zzk/gitlabhq,duduribeiro/gitlabhq,mr-dxdy/gitlabhq,hzy001/gitlabhq,iiet/iiet-git,theonlydoo/gitlabhq,vjustov/gitlabhq,stanhu/gitlabhq,H3Chief/gitlabhq,Tyrael/gitlabhq,tk23/gitlabhq,sonalkr132/gitlabhq,OtkurBiz/gitlabhq,DanielZhangQingLong/gitlabhq,LUMC/gitlabhq,yfaizal/gitlabhq,michaKFromParis/sparkslab,OlegGirko/gitlab-ce,tk23/gitlabhq,martinma4/gitlabhq,fscherwi/gitlabhq,folpindo/gitlabhq,yonglehou/gitlabhq,pulkit21/gitlabhq,copystudy/gitlabhq,TheWatcher/gitlabhq,nguyen-tien-mulodo/gitlabhq,hacsoc/gitlabhq,michaKFromParis/gitlabhqold,daiyu/gitlab-zh,dwrensha/gitlabhq,koreamic/gitlabhq,Burick/gitlabhq,jrjang/gitlabhq,Datacom/gitlabhq,delkyd/gitlabhq,ngpestelos/gitlabhq,bozaro/gitlabhq,ttasanen/gitlabhq,Burick/gitlabhq,fscherwi/gitlabhq,ksoichiro/gitlabhq,dwrensha/gitlabhq,larryli/gitlabhq,allistera/gitlabhq,gopeter/gitlabhq,aaronsnyder/gitlabhq,it33/gitlabhq,louahola/gitlabhq,hzy001/gitlabhq,chenrui2014/gitlabhq,joalmeid/gitlabhq,axilleas/gitlabhq,fpgentil/gitlabhq,MauriceMohlek/gitlabhq,delkyd/gitlabhq,Datacom/gitlabhq,OtkurBiz/gitlabhq,Burick/gitlabhq,hq804116393/gitlabhq,axilleas/gitlabhq,michaKFromParis/gitlabhqold,OtkurBiz/gitlabhq,stoplightio/gitlabhq,jrjang/gitlab-ce,jaepyoung/gitlabhq,ngpestelos/gitlabhq,szechyjs/gitlabhq,michaKFromParis/gitlabhqold,MauriceMohlek/gitlabhq,jrjang/gitlabhq,fantasywind/gitlabhq,openwide-java/gitlabhq,shinexiao/gitlabhq,t-zuehlsdorff/gitlabhq,duduribeiro/gitlabhq,sue445/gitlabhq,Devin001/gitlabhq,cui-liqiang/gitlab-ce,bozaro/gitlabhq,mrb/gitlabhq,fgbreel/gitlabhq,axilleas/gitlabhq,aaronsnyder/gitlabhq,stanhu/gitlabhq,Razer6/gitlabhq,daiyu/gitlab-zh,TheWatcher/gitlabhq,H3Chief/gitlabhq,screenpages/gitlabhq,ikappas/gitlabhq,chenrui2014/gitlabhq,ikappas/gitlabhq,mr-dxdy/gitlabhq,theonlydoo/gitlabhq,rumpelsepp/gitlabhq,sekcheong/gitlabhq,htve/GitlabForChinese,Datacom/gitlabhq,shinexiao/gitlabhq,chenrui2014/gitlabhq,nguyen-tien-mulodo/gitlabhq,k4zzk/gitlabhq,allistera/gitlabhq,Tyrael/gitlabhq,dplarson/gitlabhq,ksoichiro/gitlabhq,folpindo/gitlabhq,ordiychen/gitlabhq,dukex/gitlabhq,Telekom-PD/gitlabhq,fpgentil/gitlabhq,htve/GitlabForChinese,aaronsnyder/gitlabhq,wangcan2014/gitlabhq,daiyu/gitlab-zh,michaKFromParis/sparkslab,szechyjs/gitlabhq,michaKFromParis/gitlabhq,Exeia/gitlabhq,dreampet/gitlab,bbodenmiller/gitlabhq,openwide-java/gitlabhq,dreampet/gitlab,michaKFromParis/gitlabhq,gopeter/gitlabhq,delkyd/gitlabhq,sue445/gitlabhq,WSDC-NITWarangal/gitlabhq,liyakun/gitlabhq,salipro4ever/gitlabhq,ordiychen/gitlabhq,Razer6/gitlabhq,hzy001/gitlabhq,koreamic/gitlabhq,allysonbarros/gitlabhq,dukex/gitlabhq,chenrui2014/gitlabhq,ngpestelos/gitlabhq,gopeter/gitlabhq,hq804116393/gitlabhq,SVArago/gitlabhq,bbodenmiller/gitlabhq,Tyrael/gitlabhq,TheWatcher/gitlabhq,rebecamendez/gitlabhq,jirutka/gitlabhq,whluwit/gitlabhq,kemenaran/gitlabhq,louahola/gitlabhq,joalmeid/gitlabhq,WSDC-NITWarangal/gitlabhq,yonglehou/gitlabhq,H3Chief/gitlabhq,koreamic/gitlabhq,hacsoc/gitlabhq,NKMR6194/gitlabhq,OtkurBiz/gitlabhq,nguyen-tien-mulodo/gitlabhq,it33/gitlabhq,ttasanen/gitlabhq,fscherwi/gitlabhq,dplarson/gitlabhq,ikappas/gitlabhq,t-zuehlsdorff/gitlabhq,bbodenmiller/gitlabhq,since2014/gitlabhq,icedwater/gitlabhq,salipro4ever/gitlabhq,rebecamendez/gitlabhq,gopeter/gitlabhq,fantasywind/gitlabhq,rebecamendez/gitlabhq,screenpages/gitlabhq,Telekom-PD/gitlabhq,martijnvermaat/gitlabhq,allysonbarros/gitlabhq,ferdinandrosario/gitlabhq,NKMR6194/gitlabhq,Soullivaneuh/gitlabhq,nguyen-tien-mulodo/gitlabhq,kemenaran/gitlabhq,jrjang/gitlab-ce,Datacom/gitlabhq,ksoichiro/gitlabhq,MauriceMohlek/gitlabhq,martijnvermaat/gitlabhq,Exeia/gitlabhq,theonlydoo/gitlabhq,yonglehou/gitlabhq,Razer6/gitlabhq,mmkassem/gitlabhq,jaepyoung/gitlabhq,jirutka/gitlabhq,mmkassem/gitlabhq,kemenaran/gitlabhq,ferdinandrosario/gitlabhq,tk23/gitlabhq,tk23/gitlabhq,darkrasid/gitlabhq,openwide-java/gitlabhq,yatish27/gitlabhq,rumpelsepp/gitlabhq,NKMR6194/gitlabhq,dwrensha/gitlabhq,Telekom-PD/gitlabhq,rumpelsepp/gitlabhq,nmav/gitlabhq,screenpages/gitlabhq,yfaizal/gitlabhq,Soullivaneuh/gitlabhq,jrjang/gitlab-ce,fgbreel/gitlabhq
haml
## Code Before: %li %h4.project-title .project-access-icon = visibility_level_icon(project.visibility_level) = link_to project.name_with_namespace, [project.namespace.becomes(Namespace), project] %span.pull-right %i.fa.fa-star = project.star_count .project-info - if project.description.present? %p.project-description.str-truncated = project.description .repo-info - unless project.empty_repo? = link_to pluralize(round_commit_count(project), 'commit'), namespace_project_commits_path(project.namespace, project, project.default_branch) &middot; = link_to pluralize(project.repository.branch_names.count, 'branch'), namespace_project_branches_path(project.namespace, project) &middot; = link_to pluralize(project.repository.tag_names.count, 'tag'), namespace_project_tags_path(project.namespace, project) - else %i.fa.fa-exclamation-triangle Empty repository ## Instruction: Apply markdown filter for project descriptions on explore view Signed-off-by: Sven Strickroth <a88b7dcd1a9e3e17770bbaa6d7515b31a2d7e85d@cs-ware.de> ## Code After: %li %h4.project-title .project-access-icon = visibility_level_icon(project.visibility_level) = link_to project.name_with_namespace, [project.namespace.becomes(Namespace), project] %span.pull-right %i.fa.fa-star = project.star_count .project-info - if project.description.present? .project-description.str-truncated = markdown(project.description, pipeline: :description) .repo-info - unless project.empty_repo? = link_to pluralize(round_commit_count(project), 'commit'), namespace_project_commits_path(project.namespace, project, project.default_branch) &middot; = link_to pluralize(project.repository.branch_names.count, 'branch'), namespace_project_branches_path(project.namespace, project) &middot; = link_to pluralize(project.repository.tag_names.count, 'tag'), namespace_project_tags_path(project.namespace, project) - else %i.fa.fa-exclamation-triangle Empty repository
%li %h4.project-title .project-access-icon = visibility_level_icon(project.visibility_level) = link_to project.name_with_namespace, [project.namespace.becomes(Namespace), project] %span.pull-right %i.fa.fa-star = project.star_count .project-info - if project.description.present? - %p.project-description.str-truncated ? -- + .project-description.str-truncated - = project.description + = markdown(project.description, pipeline: :description) .repo-info - unless project.empty_repo? = link_to pluralize(round_commit_count(project), 'commit'), namespace_project_commits_path(project.namespace, project, project.default_branch) &middot; = link_to pluralize(project.repository.branch_names.count, 'branch'), namespace_project_branches_path(project.namespace, project) &middot; = link_to pluralize(project.repository.tag_names.count, 'tag'), namespace_project_tags_path(project.namespace, project) - else %i.fa.fa-exclamation-triangle Empty repository
4
0.166667
2
2
de06bb6da79d8726bfa36717fae66811b1629ab8
himan-bin/regression/vvms/vvms.sh
himan-bin/regression/vvms/vvms.sh
set -x if [ -z "$HIMAN" ]; then export HIMAN="../../himan" fi rm -f himan*.grib $HIMAN -d 5 -f vvms_ec1h.ini -t grib t.grib vv.grib grib_compare result.grib himan_VV-MS_2013012100.grib python test.py result.grib himan_VV-MS_2013012100.grib if [ $? -eq 0 ];then echo vvms success! else echo vvms failed exit 1 fi
set -x if [ -z "$HIMAN" ]; then export HIMAN="../../himan" fi rm -f himan*.grib $HIMAN -d 5 -f vvms_ec1h.ini -t grib t.grib vv.grib grib_compare result.grib himan_VV-MS_2013012100.grib if [ $? -eq 0 ];then echo vvms success! else echo vvms failed exit 1 fi python test.py result.grib himan_VV-MS_2013012100.grib if [ $? -eq 0 ];then echo vvms success! else echo vvms failed exit 1 fi
Check that grib metadata is the same between files
Check that grib metadata is the same between files
Shell
mit
fmidev/himan,fmidev/himan,fmidev/himan
shell
## Code Before: set -x if [ -z "$HIMAN" ]; then export HIMAN="../../himan" fi rm -f himan*.grib $HIMAN -d 5 -f vvms_ec1h.ini -t grib t.grib vv.grib grib_compare result.grib himan_VV-MS_2013012100.grib python test.py result.grib himan_VV-MS_2013012100.grib if [ $? -eq 0 ];then echo vvms success! else echo vvms failed exit 1 fi ## Instruction: Check that grib metadata is the same between files ## Code After: set -x if [ -z "$HIMAN" ]; then export HIMAN="../../himan" fi rm -f himan*.grib $HIMAN -d 5 -f vvms_ec1h.ini -t grib t.grib vv.grib grib_compare result.grib himan_VV-MS_2013012100.grib if [ $? -eq 0 ];then echo vvms success! else echo vvms failed exit 1 fi python test.py result.grib himan_VV-MS_2013012100.grib if [ $? -eq 0 ];then echo vvms success! else echo vvms failed exit 1 fi
set -x if [ -z "$HIMAN" ]; then export HIMAN="../../himan" fi rm -f himan*.grib $HIMAN -d 5 -f vvms_ec1h.ini -t grib t.grib vv.grib grib_compare result.grib himan_VV-MS_2013012100.grib + if [ $? -eq 0 ];then + echo vvms success! + else + echo vvms failed + exit 1 + fi + python test.py result.grib himan_VV-MS_2013012100.grib if [ $? -eq 0 ];then echo vvms success! else echo vvms failed exit 1 fi
7
0.333333
7
0
d8caaa2aedf97656c675fb852a193f61cf86d6f5
public/modules/socketio-area/views/socketio-area.client.view.html
public/modules/socketio-area/views/socketio-area.client.view.html
<section data-ng-controller="SocketioAreaController" > <h1 class="tweet--header__add-margin">Tweets in Columbus, OH</h1> <div ng-repeat="currentTweet in lastTenTweets" class="all-tweets"> <tweet tweet-data="currentTweet"></tweet> </div> </section>
<section data-ng-controller="SocketioAreaController" > <h1 class="tweet--header__add-margin">Tweets in Columbus, OH</h1> <div data-ng-if="lastTenTweets.length === 0"> <p>Waiting for tweets to arrive...</p> </div> <div ng-repeat="currentTweet in lastTenTweets" class="all-tweets"> <tweet tweet-data="currentTweet"></tweet> </div> </section>
Add a message "waiting for tweets"
Add a message "waiting for tweets"
HTML
mit
NeverOddOrEven/testarea,NeverOddOrEven/testarea
html
## Code Before: <section data-ng-controller="SocketioAreaController" > <h1 class="tweet--header__add-margin">Tweets in Columbus, OH</h1> <div ng-repeat="currentTweet in lastTenTweets" class="all-tweets"> <tweet tweet-data="currentTweet"></tweet> </div> </section> ## Instruction: Add a message "waiting for tweets" ## Code After: <section data-ng-controller="SocketioAreaController" > <h1 class="tweet--header__add-margin">Tweets in Columbus, OH</h1> <div data-ng-if="lastTenTweets.length === 0"> <p>Waiting for tweets to arrive...</p> </div> <div ng-repeat="currentTweet in lastTenTweets" class="all-tweets"> <tweet tweet-data="currentTweet"></tweet> </div> </section>
<section data-ng-controller="SocketioAreaController" > <h1 class="tweet--header__add-margin">Tweets in Columbus, OH</h1> + <div data-ng-if="lastTenTweets.length === 0"> + <p>Waiting for tweets to arrive...</p> + </div> <div ng-repeat="currentTweet in lastTenTweets" class="all-tweets"> <tweet tweet-data="currentTweet"></tweet> </div> </section>
3
0.375
3
0
a8bce6d99e94738fd6abf3429de078208d5221a0
controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockEnclaveAccessService.java
controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/aws/MockEnclaveAccessService.java
package com.yahoo.vespa.hosted.controller.api.integration.aws; import com.yahoo.config.provision.CloudAccount; import java.util.Set; import java.util.TreeSet; /** * @author jonmv */ public class MockEnclaveAccessService implements EnclaveAccessService { private volatile Set<CloudAccount> currentAccounts; public Set<CloudAccount> currentAccounts() { return currentAccounts; } @Override public void allowAccessFor(Set<CloudAccount> accounts) { currentAccounts = new TreeSet<>(accounts); } }
package com.yahoo.vespa.hosted.controller.api.integration.aws; import com.yahoo.config.provision.CloudAccount; import java.util.Set; import java.util.TreeSet; /** * @author jonmv */ public class MockEnclaveAccessService implements EnclaveAccessService { private volatile Set<CloudAccount> currentAccounts = new TreeSet<>(); public Set<CloudAccount> currentAccounts() { return currentAccounts; } @Override public void allowAccessFor(Set<CloudAccount> accounts) { currentAccounts = new TreeSet<>(accounts); } }
Fix test even more :'(
Fix test even more :'(
Java
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
java
## Code Before: package com.yahoo.vespa.hosted.controller.api.integration.aws; import com.yahoo.config.provision.CloudAccount; import java.util.Set; import java.util.TreeSet; /** * @author jonmv */ public class MockEnclaveAccessService implements EnclaveAccessService { private volatile Set<CloudAccount> currentAccounts; public Set<CloudAccount> currentAccounts() { return currentAccounts; } @Override public void allowAccessFor(Set<CloudAccount> accounts) { currentAccounts = new TreeSet<>(accounts); } } ## Instruction: Fix test even more :'( ## Code After: package com.yahoo.vespa.hosted.controller.api.integration.aws; import com.yahoo.config.provision.CloudAccount; import java.util.Set; import java.util.TreeSet; /** * @author jonmv */ public class MockEnclaveAccessService implements EnclaveAccessService { private volatile Set<CloudAccount> currentAccounts = new TreeSet<>(); public Set<CloudAccount> currentAccounts() { return currentAccounts; } @Override public void allowAccessFor(Set<CloudAccount> accounts) { currentAccounts = new TreeSet<>(accounts); } }
package com.yahoo.vespa.hosted.controller.api.integration.aws; import com.yahoo.config.provision.CloudAccount; import java.util.Set; import java.util.TreeSet; /** * @author jonmv */ public class MockEnclaveAccessService implements EnclaveAccessService { - private volatile Set<CloudAccount> currentAccounts; + private volatile Set<CloudAccount> currentAccounts = new TreeSet<>(); ? ++++++++++++++++++ public Set<CloudAccount> currentAccounts() { return currentAccounts; } @Override public void allowAccessFor(Set<CloudAccount> accounts) { currentAccounts = new TreeSet<>(accounts); } }
2
0.090909
1
1
061cb505ee357c9319c1a85098ce8aab1cf99e81
meta-oe/recipes-support/nspr/nspr/0001-md-Fix-build-with-musl.patch
meta-oe/recipes-support/nspr/nspr/0001-md-Fix-build-with-musl.patch
From 147f3c2acbd96d44025cec11800ded0282327764 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Mon, 18 Sep 2017 17:22:43 -0700 Subject: [PATCH] md: Fix build with musl The MIPS specific header <sgidefs.h> is not provided by musl linux kernel headers provide <asm/sgidefs.h> which has same definitions Signed-off-by: Khem Raj <raj.khem@gmail.com> --- Upstream-Status: Pending pr/include/md/_linux.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg index 640b19c..31296a8 100644 --- a/pr/include/md/_linux.cfg +++ b/pr/include/md/_linux.cfg @@ -499,7 +499,7 @@ #elif defined(__mips__) /* For _ABI64 */ -#include <sgidefs.h> +#include <asm/sgidefs.h> #ifdef __MIPSEB__ #define IS_BIG_ENDIAN 1 -- 2.14.1
From 147f3c2acbd96d44025cec11800ded0282327764 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Mon, 18 Sep 2017 17:22:43 -0700 Subject: [PATCH] md: Fix build with musl The MIPS specific header <sgidefs.h> is not provided by musl linux kernel headers provide <asm/sgidefs.h> which has same definitions Signed-off-by: Khem Raj <raj.khem@gmail.com> --- Upstream-Status: Pending pr/include/md/_linux.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/pr/include/md/_linux.cfg +++ b/pr/include/md/_linux.cfg @@ -499,7 +499,7 @@ #elif defined(__mips__) /* For _ABI64 */ -#include <sgidefs.h> +#include <asm/sgidefs.h> #ifdef __MIPSEB__ #define IS_BIG_ENDIAN 1 @@ -511,7 +511,7 @@ #error "Unknown MIPS endianness." #endif -#if _MIPS_SIM == _ABI64 +#if _MIPS_SIM == _MIPS_SIM_ABI64 #define IS_64
Use _MIPS_SIM_ABI64 instead of _ABI64
nspr: Use _MIPS_SIM_ABI64 instead of _ABI64 _ABI64 is glibc specific, to use a common define from asm/sgidefs.h will work in every case Signed-off-by: Khem Raj <729d64b6f67515e258459a5f6d20ec88b2caf8df@gmail.com>
Diff
mit
moto-timo/meta-openembedded,VCTLabs/meta-openembedded,lgirdk/meta-openembedded,VCTLabs/meta-openembedded,openembedded/meta-openembedded,moto-timo/meta-openembedded,moto-timo/meta-openembedded,openembedded/meta-openembedded,openembedded/meta-openembedded,lgirdk/meta-openembedded,openembedded/meta-openembedded,schnitzeltony/meta-openembedded,rehsack/meta-openembedded,moto-timo/meta-openembedded,VCTLabs/meta-openembedded,rehsack/meta-openembedded,moto-timo/meta-openembedded,VCTLabs/meta-openembedded,VCTLabs/meta-openembedded,victronenergy/meta-openembedded,lgirdk/meta-openembedded,victronenergy/meta-openembedded,schnitzeltony/meta-openembedded,openembedded/meta-openembedded,lgirdk/meta-openembedded,schnitzeltony/meta-openembedded,victronenergy/meta-openembedded,victronenergy/meta-openembedded,rehsack/meta-openembedded,schnitzeltony/meta-openembedded,victronenergy/meta-openembedded,VCTLabs/meta-openembedded,lgirdk/meta-openembedded,victronenergy/meta-openembedded,VCTLabs/meta-openembedded,lgirdk/meta-openembedded,openembedded/meta-openembedded,victronenergy/meta-openembedded,schnitzeltony/meta-openembedded,openembedded/meta-openembedded,schnitzeltony/meta-openembedded,schnitzeltony/meta-openembedded,lgirdk/meta-openembedded,openembedded/meta-openembedded,rehsack/meta-openembedded,rehsack/meta-openembedded,rehsack/meta-openembedded,rehsack/meta-openembedded,VCTLabs/meta-openembedded
diff
## Code Before: From 147f3c2acbd96d44025cec11800ded0282327764 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Mon, 18 Sep 2017 17:22:43 -0700 Subject: [PATCH] md: Fix build with musl The MIPS specific header <sgidefs.h> is not provided by musl linux kernel headers provide <asm/sgidefs.h> which has same definitions Signed-off-by: Khem Raj <raj.khem@gmail.com> --- Upstream-Status: Pending pr/include/md/_linux.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg index 640b19c..31296a8 100644 --- a/pr/include/md/_linux.cfg +++ b/pr/include/md/_linux.cfg @@ -499,7 +499,7 @@ #elif defined(__mips__) /* For _ABI64 */ -#include <sgidefs.h> +#include <asm/sgidefs.h> #ifdef __MIPSEB__ #define IS_BIG_ENDIAN 1 -- 2.14.1 ## Instruction: nspr: Use _MIPS_SIM_ABI64 instead of _ABI64 _ABI64 is glibc specific, to use a common define from asm/sgidefs.h will work in every case Signed-off-by: Khem Raj <729d64b6f67515e258459a5f6d20ec88b2caf8df@gmail.com> ## Code After: From 147f3c2acbd96d44025cec11800ded0282327764 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Mon, 18 Sep 2017 17:22:43 -0700 Subject: [PATCH] md: Fix build with musl The MIPS specific header <sgidefs.h> is not provided by musl linux kernel headers provide <asm/sgidefs.h> which has same definitions Signed-off-by: Khem Raj <raj.khem@gmail.com> --- Upstream-Status: Pending pr/include/md/_linux.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/pr/include/md/_linux.cfg +++ b/pr/include/md/_linux.cfg @@ -499,7 +499,7 @@ #elif defined(__mips__) /* For _ABI64 */ -#include <sgidefs.h> +#include <asm/sgidefs.h> #ifdef __MIPSEB__ #define IS_BIG_ENDIAN 1 @@ -511,7 +511,7 @@ #error "Unknown MIPS endianness." #endif -#if _MIPS_SIM == _ABI64 +#if _MIPS_SIM == _MIPS_SIM_ABI64 #define IS_64
From 147f3c2acbd96d44025cec11800ded0282327764 Mon Sep 17 00:00:00 2001 From: Khem Raj <raj.khem@gmail.com> Date: Mon, 18 Sep 2017 17:22:43 -0700 Subject: [PATCH] md: Fix build with musl The MIPS specific header <sgidefs.h> is not provided by musl linux kernel headers provide <asm/sgidefs.h> which has same definitions Signed-off-by: Khem Raj <raj.khem@gmail.com> --- Upstream-Status: Pending pr/include/md/_linux.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) - diff --git a/pr/include/md/_linux.cfg b/pr/include/md/_linux.cfg - index 640b19c..31296a8 100644 --- a/pr/include/md/_linux.cfg +++ b/pr/include/md/_linux.cfg @@ -499,7 +499,7 @@ #elif defined(__mips__) /* For _ABI64 */ -#include <sgidefs.h> +#include <asm/sgidefs.h> #ifdef __MIPSEB__ #define IS_BIG_ENDIAN 1 - -- - 2.14.1 - + @@ -511,7 +511,7 @@ + #error "Unknown MIPS endianness." + #endif + + -#if _MIPS_SIM == _ABI64 + +#if _MIPS_SIM == _MIPS_SIM_ABI64 + + #define IS_64 +
14
0.451613
9
5
4ce772e5ce03ef1f1bc5d27e80c644b169d9d747
incuna-sass/mixins/_image-replace.sass
incuna-sass/mixins/_image-replace.sass
// Use this helper when replacing text with an image in a block level element %image-replace background: color: transparent border: 0 overflow: hidden &:before content: '' display: block width: 0 height: 100% @if $project == 'web' .lt-ie8 & text-indent: -9999px
// Use this helper when replacing text with an image in a block level element %image-replace background: color: transparent border: 0 overflow: hidden &:before content: '' display: block width: 0 height: 100% @if support-legacy-browser("ie", "7") .lt-ie8 & text-indent: -9999px
Use support-legacy-browser() rather than project type
Use support-legacy-browser() rather than project type
Sass
mit
incuna/incuna-sass
sass
## Code Before: // Use this helper when replacing text with an image in a block level element %image-replace background: color: transparent border: 0 overflow: hidden &:before content: '' display: block width: 0 height: 100% @if $project == 'web' .lt-ie8 & text-indent: -9999px ## Instruction: Use support-legacy-browser() rather than project type ## Code After: // Use this helper when replacing text with an image in a block level element %image-replace background: color: transparent border: 0 overflow: hidden &:before content: '' display: block width: 0 height: 100% @if support-legacy-browser("ie", "7") .lt-ie8 & text-indent: -9999px
// Use this helper when replacing text with an image in a block level element %image-replace background: color: transparent border: 0 overflow: hidden &:before content: '' display: block width: 0 height: 100% - @if $project == 'web' + @if support-legacy-browser("ie", "7") .lt-ie8 & text-indent: -9999px
2
0.142857
1
1
59805ac73932e82daec10adb15eda0154ad56824
src/CMakeLists.txt
src/CMakeLists.txt
set(SOURCE_FILES graph/graph.hpp graph/graphi.hpp graph/matrix_graph.hpp graph/list_graph.hpp ) add_library(simple_graph SHARED ${SOURCE_FILES}) set_target_properties(simple_graph PROPERTIES LINKER_LANGUAGE CXX)
set(SOURCE_FILES graph/graph.hpp graph/graphi.hpp graph/matrix_graph.hpp graph/list_graph.hpp ) add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES}) set_target_properties(simple_graph PROPERTIES LINKER_LANGUAGE CXX)
Use cmake variable PROJECT_NAME as binary name
Use cmake variable PROJECT_NAME as binary name
Text
mit
sfod/simple-graph
text
## Code Before: set(SOURCE_FILES graph/graph.hpp graph/graphi.hpp graph/matrix_graph.hpp graph/list_graph.hpp ) add_library(simple_graph SHARED ${SOURCE_FILES}) set_target_properties(simple_graph PROPERTIES LINKER_LANGUAGE CXX) ## Instruction: Use cmake variable PROJECT_NAME as binary name ## Code After: set(SOURCE_FILES graph/graph.hpp graph/graphi.hpp graph/matrix_graph.hpp graph/list_graph.hpp ) add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES}) set_target_properties(simple_graph PROPERTIES LINKER_LANGUAGE CXX)
set(SOURCE_FILES graph/graph.hpp graph/graphi.hpp graph/matrix_graph.hpp graph/list_graph.hpp ) - add_library(simple_graph SHARED ${SOURCE_FILES}) + add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES}) set_target_properties(simple_graph PROPERTIES LINKER_LANGUAGE CXX)
2
0.25
1
1
007dd39aedebad6086bb39b23d6cfc2675752caa
conda-recipes/llvmlite/meta.yaml
conda-recipes/llvmlite/meta.yaml
package: name: llvmlite # GIT_DESCRIBE_TAG may not be set version: {{ environ.get('GIT_DESCRIBE_TAG', '').lstrip('v') }} source: # Using the local source tree helps test building without pushing changes path: ../.. build: number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }} requirements: build: - python # On channel https://anaconda.org/numba/ - llvmdev 4.0* - vs2015_runtime [win] # The DLL build uses cmake on Windows - cmake [win] - enum34 [py27] run: - python - enum34 [py27] - vs2015_runtime [win] test: imports: - llvmlite - llvmlite.binding about: home: https://github.com/numba/llvmlite license: New BSD License summary: A lightweight LLVM python binding for writing JIT compilers
package: name: llvmlite # GIT_DESCRIBE_TAG may not be set version: {{ environ.get('GIT_DESCRIBE_TAG', '').lstrip('v') }} source: # Using the local source tree helps test building without pushing changes path: ../.. build: number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }} script_env: - CFLAGS - CXXFLAGS - PY_VCRUNTIME_REDIST requirements: build: - python # On channel https://anaconda.org/numba/ - llvmdev 4.0* - vs2015_runtime [win] # The DLL build uses cmake on Windows - cmake [win] - enum34 [py27] run: - python - enum34 [py27] - vs2015_runtime [win] test: imports: - llvmlite - llvmlite.binding about: home: https://github.com/numba/llvmlite license: New BSD License summary: A lightweight LLVM python binding for writing JIT compilers
Add variables to pass through when doing conda-build
Add variables to pass through when doing conda-build CFLAGS, CXXFLAGS and PY_VCRUNTIME_REDIST need to be passed through to conda-build so that 32 bit cross compilation works.
YAML
bsd-2-clause
numba/llvmlite,numba/llvmlite,numba/llvmlite,numba/llvmlite
yaml
## Code Before: package: name: llvmlite # GIT_DESCRIBE_TAG may not be set version: {{ environ.get('GIT_DESCRIBE_TAG', '').lstrip('v') }} source: # Using the local source tree helps test building without pushing changes path: ../.. build: number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }} requirements: build: - python # On channel https://anaconda.org/numba/ - llvmdev 4.0* - vs2015_runtime [win] # The DLL build uses cmake on Windows - cmake [win] - enum34 [py27] run: - python - enum34 [py27] - vs2015_runtime [win] test: imports: - llvmlite - llvmlite.binding about: home: https://github.com/numba/llvmlite license: New BSD License summary: A lightweight LLVM python binding for writing JIT compilers ## Instruction: Add variables to pass through when doing conda-build CFLAGS, CXXFLAGS and PY_VCRUNTIME_REDIST need to be passed through to conda-build so that 32 bit cross compilation works. ## Code After: package: name: llvmlite # GIT_DESCRIBE_TAG may not be set version: {{ environ.get('GIT_DESCRIBE_TAG', '').lstrip('v') }} source: # Using the local source tree helps test building without pushing changes path: ../.. build: number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }} script_env: - CFLAGS - CXXFLAGS - PY_VCRUNTIME_REDIST requirements: build: - python # On channel https://anaconda.org/numba/ - llvmdev 4.0* - vs2015_runtime [win] # The DLL build uses cmake on Windows - cmake [win] - enum34 [py27] run: - python - enum34 [py27] - vs2015_runtime [win] test: imports: - llvmlite - llvmlite.binding about: home: https://github.com/numba/llvmlite license: New BSD License summary: A lightweight LLVM python binding for writing JIT compilers
package: name: llvmlite # GIT_DESCRIBE_TAG may not be set version: {{ environ.get('GIT_DESCRIBE_TAG', '').lstrip('v') }} source: # Using the local source tree helps test building without pushing changes path: ../.. build: number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }} + script_env: + - CFLAGS + - CXXFLAGS + - PY_VCRUNTIME_REDIST requirements: build: - python # On channel https://anaconda.org/numba/ - llvmdev 4.0* - vs2015_runtime [win] # The DLL build uses cmake on Windows - cmake [win] - enum34 [py27] run: - python - enum34 [py27] - vs2015_runtime [win] test: imports: - llvmlite - llvmlite.binding about: home: https://github.com/numba/llvmlite license: New BSD License summary: A lightweight LLVM python binding for writing JIT compilers
4
0.114286
4
0
9b59b7f3f3ce30f5fd2d4a652f0cfc5311c3553a
common/platform-dotnet/push-packages.cmd
common/platform-dotnet/push-packages.cmd
if "%NUGET_API_KEY%" == "" goto NO_KEY if "%1" == "" goto MISSING_INPUT_FOLDER REM dotnet nuget push %1\*.nupkg --api-key %NUGET_API_KEY% for %%f in (%1\*.nupkg) do dotnet nuget push %%f --api-key %NUGET_API_KEY% --source https://nuget.org/ GOTO END :NO_KEY ECHO Couldn't find 'NUGET_API_KEY' environment variable. EXIT /B 1 :MISSING_INPUT_FOLDER ECHO You must supply the folder in which the nuget packages live. EXIT /B 2 :END
@ECHO OFF if "%NUGET_API_KEY%" == "" goto NO_KEY if "%1" == "" goto MISSING_INPUT_FOLDER REM dotnet nuget push %1\*.nupkg --api-key %NUGET_API_KEY% for %%f in (%1\*.nupkg) do dotnet nuget push %%f --api-key %NUGET_API_KEY% --source https://nuget.org/ GOTO END :NO_KEY ECHO Couldn't find 'NUGET_API_KEY' environment variable. EXIT /B 1 :MISSING_INPUT_FOLDER ECHO You must supply the folder in which the nuget packages live. EXIT /B 2 :END
Remove echo so the API key doesn't appear on screen.
Remove echo so the API key doesn't appear on screen.
Batchfile
mit
SoundMetrics/aris-integration-sdk,SoundMetrics/aris-integration-sdk,SoundMetrics/aris-integration-sdk,SoundMetrics/aris-integration-sdk,SoundMetrics/aris-integration-sdk
batchfile
## Code Before: if "%NUGET_API_KEY%" == "" goto NO_KEY if "%1" == "" goto MISSING_INPUT_FOLDER REM dotnet nuget push %1\*.nupkg --api-key %NUGET_API_KEY% for %%f in (%1\*.nupkg) do dotnet nuget push %%f --api-key %NUGET_API_KEY% --source https://nuget.org/ GOTO END :NO_KEY ECHO Couldn't find 'NUGET_API_KEY' environment variable. EXIT /B 1 :MISSING_INPUT_FOLDER ECHO You must supply the folder in which the nuget packages live. EXIT /B 2 :END ## Instruction: Remove echo so the API key doesn't appear on screen. ## Code After: @ECHO OFF if "%NUGET_API_KEY%" == "" goto NO_KEY if "%1" == "" goto MISSING_INPUT_FOLDER REM dotnet nuget push %1\*.nupkg --api-key %NUGET_API_KEY% for %%f in (%1\*.nupkg) do dotnet nuget push %%f --api-key %NUGET_API_KEY% --source https://nuget.org/ GOTO END :NO_KEY ECHO Couldn't find 'NUGET_API_KEY' environment variable. EXIT /B 1 :MISSING_INPUT_FOLDER ECHO You must supply the folder in which the nuget packages live. EXIT /B 2 :END
+ @ECHO OFF + if "%NUGET_API_KEY%" == "" goto NO_KEY if "%1" == "" goto MISSING_INPUT_FOLDER REM dotnet nuget push %1\*.nupkg --api-key %NUGET_API_KEY% for %%f in (%1\*.nupkg) do dotnet nuget push %%f --api-key %NUGET_API_KEY% --source https://nuget.org/ GOTO END :NO_KEY ECHO Couldn't find 'NUGET_API_KEY' environment variable. EXIT /B 1 :MISSING_INPUT_FOLDER ECHO You must supply the folder in which the nuget packages live. EXIT /B 2 :END
2
0.105263
2
0
fc98f1079ce2c452f28c6853103895c6bafe1be0
readme.md
readme.md
A simple framework for implementing ABAC in your application. # Rules Rules implement business logic, the input for rule execution consists of: - source: The actor, usually the current user - target: The subject, the entity that the actor wishes to act upon - permission: The action the actor wishes to take - environment: The environment should contain anything else the business rules may need Rules are encouraged to do recursive access check. A typical rule could be `WriteImpliesRead`, since for most systems when you can write an object you can also read it. Implementation could look like this: ```php public function execute( object $source, object $target, string $permission, Environment $environment, AccessChecker $accessChecker ): bool { return $permission === 'read' && $accessChecker->check($source, $target, 'write'); } ``` ## Environment Consider a rule that allows access only during office hours. The current time should then be set in the environment. Reasoning behind this is that having 1 location for the environment allows for easy testing as well as a single source of truth. # Infinite loops Rules can contain infinite loops, we track recursion depth to detect these loops.
A simple framework for implementing ABAC in your application. # Rules Rules implement business logic, the input for rule execution consists of: - source: The actor, usually the current user - target: The subject, the entity that the actor wishes to act upon - permission: The action the actor wishes to take - environment: The environment should contain anything else the business rules may need Rules are encouraged to do recursive access check. A typical rule could be `WriteImpliesRead`, since for most systems when you can write an object you can also read it. Implementation could look like this: ```php public function execute( object $source, object $target, string $permission, Environment $environment, AccessChecker $accessChecker ): bool { return $permission === 'read' && $accessChecker->check($source, $target, 'write'); } ``` ## Environment Consider a rule that allows access only during office hours. The current time should then be set in the environment. Reasoning behind this is that having 1 location for the environment allows for easy testing as well as a single source of truth. # Infinite loops Rules can contain infinite loops, we track recursion depth to detect these loops. # External links - [What Is Attribute-Based Access Control (ABAC)? - by Keith Casey](https://www.okta.com/blog/2020/09/attribute-based-access-control-abac/) - [Attribute-based access control on Wikipedia](https://en.wikipedia.org/wiki/Attribute-based_access_control)
Add external links that explains ABAC
Add external links that explains ABAC Add external links that explains ABAC
Markdown
mit
SAM-IT/abac
markdown
## Code Before: A simple framework for implementing ABAC in your application. # Rules Rules implement business logic, the input for rule execution consists of: - source: The actor, usually the current user - target: The subject, the entity that the actor wishes to act upon - permission: The action the actor wishes to take - environment: The environment should contain anything else the business rules may need Rules are encouraged to do recursive access check. A typical rule could be `WriteImpliesRead`, since for most systems when you can write an object you can also read it. Implementation could look like this: ```php public function execute( object $source, object $target, string $permission, Environment $environment, AccessChecker $accessChecker ): bool { return $permission === 'read' && $accessChecker->check($source, $target, 'write'); } ``` ## Environment Consider a rule that allows access only during office hours. The current time should then be set in the environment. Reasoning behind this is that having 1 location for the environment allows for easy testing as well as a single source of truth. # Infinite loops Rules can contain infinite loops, we track recursion depth to detect these loops. ## Instruction: Add external links that explains ABAC Add external links that explains ABAC ## Code After: A simple framework for implementing ABAC in your application. # Rules Rules implement business logic, the input for rule execution consists of: - source: The actor, usually the current user - target: The subject, the entity that the actor wishes to act upon - permission: The action the actor wishes to take - environment: The environment should contain anything else the business rules may need Rules are encouraged to do recursive access check. A typical rule could be `WriteImpliesRead`, since for most systems when you can write an object you can also read it. Implementation could look like this: ```php public function execute( object $source, object $target, string $permission, Environment $environment, AccessChecker $accessChecker ): bool { return $permission === 'read' && $accessChecker->check($source, $target, 'write'); } ``` ## Environment Consider a rule that allows access only during office hours. The current time should then be set in the environment. Reasoning behind this is that having 1 location for the environment allows for easy testing as well as a single source of truth. # Infinite loops Rules can contain infinite loops, we track recursion depth to detect these loops. # External links - [What Is Attribute-Based Access Control (ABAC)? - by Keith Casey](https://www.okta.com/blog/2020/09/attribute-based-access-control-abac/) - [Attribute-based access control on Wikipedia](https://en.wikipedia.org/wiki/Attribute-based_access_control)
A simple framework for implementing ABAC in your application. # Rules Rules implement business logic, the input for rule execution consists of: - source: The actor, usually the current user - target: The subject, the entity that the actor wishes to act upon - permission: The action the actor wishes to take - environment: The environment should contain anything else the business rules may need Rules are encouraged to do recursive access check. A typical rule could be `WriteImpliesRead`, since for most systems when you can write an object you can also read it. Implementation could look like this: ```php public function execute( object $source, object $target, string $permission, Environment $environment, AccessChecker $accessChecker ): bool { return $permission === 'read' && $accessChecker->check($source, $target, 'write'); } ``` ## Environment Consider a rule that allows access only during office hours. The current time should then be set in the environment. Reasoning behind this is that having 1 location for the environment allows for easy testing as well as a single source of truth. # Infinite loops Rules can contain infinite loops, we track recursion depth to detect these loops. + + # External links + + - [What Is Attribute-Based Access Control (ABAC)? - by Keith Casey](https://www.okta.com/blog/2020/09/attribute-based-access-control-abac/) + - [Attribute-based access control on Wikipedia](https://en.wikipedia.org/wiki/Attribute-based_access_control)
5
0.172414
5
0
84b455c1cc973fb9cebdf7a3b63b42d1ef2afb0f
modules/whois.js
modules/whois.js
'use strict'; module.exports = function(config, ircbot) { ircbot.addListener('raw', function(message) { switch (message.command) { case 'rpl_whoisidle': ircbot._addWhoisData(message.args[1], 'signon', new Date(parseInt(message.args[3]) * 1000)); break; case '338': ircbot._addWhoisData(message.args[1], 'actual_host', message.args[2]); break; case '671': ircbot._addWhoisData(message.args[1], 'secure_connection', true); break; } }); ircbot.constructor.prototype.remoteWhois = function(nick, callback) { if (typeof callback === 'function') { var callbackWrapper = function(info) { if (info.nick.toLowerCase() == nick.toLowerCase()) { this.removeListener('whois', callbackWrapper); return callback.apply(this, arguments); } }; this.addListener('whois', callbackWrapper); } this.send('WHOIS', nick, nick); }; };
'use strict'; module.exports = function(config, ircbot) { ircbot.addListener('raw', function(message) { switch (message.command) { case 'rpl_whoisidle': ircbot._addWhoisData(message.args[1], 'signon', new Date(parseInt(message.args[3]) * 1000)); break; case '338': ircbot._addWhoisData(message.args[1], 'actual_host', message.args[2]); break; case '671': ircbot._addWhoisData(message.args[1], 'secure_connection', true); break; } }); ircbot.constructor.prototype.remoteWhois = function(nick, callback) { if (typeof callback === 'function') { var callbackWrapper = function(info) { let whoisNick = ''; try { whoisNick = info.nick.toLowerCase(); } catch (e) {} if (whoisNick == nick.toLowerCase()) { this.removeListener('whois', callbackWrapper); return callback.apply(this, arguments); } }; this.addListener('whois', callbackWrapper); } this.send('WHOIS', nick, nick); }; };
Make sure info.nick is always set
Make sure info.nick is always set
JavaScript
mit
initLab/irc-notifier
javascript
## Code Before: 'use strict'; module.exports = function(config, ircbot) { ircbot.addListener('raw', function(message) { switch (message.command) { case 'rpl_whoisidle': ircbot._addWhoisData(message.args[1], 'signon', new Date(parseInt(message.args[3]) * 1000)); break; case '338': ircbot._addWhoisData(message.args[1], 'actual_host', message.args[2]); break; case '671': ircbot._addWhoisData(message.args[1], 'secure_connection', true); break; } }); ircbot.constructor.prototype.remoteWhois = function(nick, callback) { if (typeof callback === 'function') { var callbackWrapper = function(info) { if (info.nick.toLowerCase() == nick.toLowerCase()) { this.removeListener('whois', callbackWrapper); return callback.apply(this, arguments); } }; this.addListener('whois', callbackWrapper); } this.send('WHOIS', nick, nick); }; }; ## Instruction: Make sure info.nick is always set ## Code After: 'use strict'; module.exports = function(config, ircbot) { ircbot.addListener('raw', function(message) { switch (message.command) { case 'rpl_whoisidle': ircbot._addWhoisData(message.args[1], 'signon', new Date(parseInt(message.args[3]) * 1000)); break; case '338': ircbot._addWhoisData(message.args[1], 'actual_host', message.args[2]); break; case '671': ircbot._addWhoisData(message.args[1], 'secure_connection', true); break; } }); ircbot.constructor.prototype.remoteWhois = function(nick, callback) { if (typeof callback === 'function') { var callbackWrapper = function(info) { let whoisNick = ''; try { whoisNick = info.nick.toLowerCase(); } catch (e) {} if (whoisNick == nick.toLowerCase()) { this.removeListener('whois', callbackWrapper); return callback.apply(this, arguments); } }; this.addListener('whois', callbackWrapper); } this.send('WHOIS', nick, nick); }; };
'use strict'; module.exports = function(config, ircbot) { ircbot.addListener('raw', function(message) { switch (message.command) { case 'rpl_whoisidle': ircbot._addWhoisData(message.args[1], 'signon', new Date(parseInt(message.args[3]) * 1000)); break; case '338': ircbot._addWhoisData(message.args[1], 'actual_host', message.args[2]); break; case '671': ircbot._addWhoisData(message.args[1], 'secure_connection', true); break; } }); ircbot.constructor.prototype.remoteWhois = function(nick, callback) { if (typeof callback === 'function') { var callbackWrapper = function(info) { + let whoisNick = ''; + + try { + whoisNick = info.nick.toLowerCase(); + } + catch (e) {} + - if (info.nick.toLowerCase() == nick.toLowerCase()) { ? ^^^^^ -------------- + if (whoisNick == nick.toLowerCase()) { ? +++ ^^ this.removeListener('whois', callbackWrapper); return callback.apply(this, arguments); } }; this.addListener('whois', callbackWrapper); } this.send('WHOIS', nick, nick); }; };
9
0.3
8
1
0fac5f70a4df041c71af3c1c63ff80152af9cfd3
bin.js
bin.js
var rimraf = require('./') var help = false var dashdash = false var args = process.argv.slice(2).filter(function(arg) { if (dashdash) return !!arg else if (arg === '--') dashdash = true else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true else return !!arg }); if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" var log = help ? console.log : console.error log('Usage: rimraf <path> [<path> ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') log(' -h, --help Display this usage info') process.exit(help ? 0 : 1) } else go(0) function go (n) { if (n >= args.length) return rimraf(args[n], function (er) { if (er) throw er go(n+1) }) }
var rimraf = require('./') var help = false var dashdash = false var noglob = false var args = process.argv.slice(2).filter(function(arg) { if (dashdash) return !!arg else if (arg === '--') dashdash = true else if (arg === '--no-glob' || arg === '-G') noglob = true else if (arg === '--glob' || arg === '-g') noglob = false else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true else return !!arg }) if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" var log = help ? console.log : console.error log('Usage: rimraf <path> [<path> ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') log(' -h, --help Display this usage info') log(' -G, --no-glob Do not expand glob patterns in arguments') log(' -g, --glob Expand glob patterns in arguments (default)') process.exit(help ? 0 : 1) } else go(0) function go (n) { if (n >= args.length) return var options = {} if (noglob) options = { glob: false } rimraf(args[n], options, function (er) { if (er) throw er go(n+1) }) }
Add --no-glob option to cli
Add --no-glob option to cli
JavaScript
isc
isaacs/rimraf,isaacs/rimraf
javascript
## Code Before: var rimraf = require('./') var help = false var dashdash = false var args = process.argv.slice(2).filter(function(arg) { if (dashdash) return !!arg else if (arg === '--') dashdash = true else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true else return !!arg }); if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" var log = help ? console.log : console.error log('Usage: rimraf <path> [<path> ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') log(' -h, --help Display this usage info') process.exit(help ? 0 : 1) } else go(0) function go (n) { if (n >= args.length) return rimraf(args[n], function (er) { if (er) throw er go(n+1) }) } ## Instruction: Add --no-glob option to cli ## Code After: var rimraf = require('./') var help = false var dashdash = false var noglob = false var args = process.argv.slice(2).filter(function(arg) { if (dashdash) return !!arg else if (arg === '--') dashdash = true else if (arg === '--no-glob' || arg === '-G') noglob = true else if (arg === '--glob' || arg === '-g') noglob = false else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true else return !!arg }) if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" var log = help ? console.log : console.error log('Usage: rimraf <path> [<path> ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') log(' -h, --help Display this usage info') log(' -G, --no-glob Do not expand glob patterns in arguments') log(' -g, --glob Expand glob patterns in arguments (default)') process.exit(help ? 0 : 1) } else go(0) function go (n) { if (n >= args.length) return var options = {} if (noglob) options = { glob: false } rimraf(args[n], options, function (er) { if (er) throw er go(n+1) }) }
var rimraf = require('./') var help = false var dashdash = false + var noglob = false var args = process.argv.slice(2).filter(function(arg) { if (dashdash) return !!arg else if (arg === '--') dashdash = true + else if (arg === '--no-glob' || arg === '-G') + noglob = true + else if (arg === '--glob' || arg === '-g') + noglob = false else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) help = true else return !!arg - }); ? - + }) if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" var log = help ? console.log : console.error log('Usage: rimraf <path> [<path> ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') log('Options:') log('') - log(' -h, --help Display this usage info') + log(' -h, --help Display this usage info') ? + + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') process.exit(help ? 0 : 1) } else go(0) function go (n) { if (n >= args.length) return + var options = {} + if (noglob) + options = { glob: false } - rimraf(args[n], function (er) { + rimraf(args[n], options, function (er) { ? +++++++++ if (er) throw er go(n+1) }) }
16
0.410256
13
3
6481e352adef0fcae06fdaad2b040a4e7b558593
modules/stomp/src/main/java/org/torquebox/stomp/component/DirectStompletComponent.java
modules/stomp/src/main/java/org/torquebox/stomp/component/DirectStompletComponent.java
package org.torquebox.stomp.component; import org.projectodd.stilts.stomp.StompException; import org.projectodd.stilts.stomp.StompMessage; import org.projectodd.stilts.stomplet.Stomplet; import org.projectodd.stilts.stomplet.StompletConfig; import org.projectodd.stilts.stomplet.Subscriber; public class DirectStompletComponent implements Stomplet { public DirectStompletComponent(XAStompletComponent component) { this.component = component; } @Override public void initialize(StompletConfig config) throws StompException { this.component._callRubyMethod( "configure", config ); } @Override public void destroy() throws StompException { this.component._callRubyMethod( "destroy" ); } @Override public void onMessage(StompMessage message) throws StompException { this.component._callRubyMethod( "on_message", message ); } @Override public void onSubscribe(Subscriber subscriber) throws StompException { this.component._callRubyMethod( "on_subscribe", subscriber ); } @Override public void onUnsubscribe(Subscriber subscriber) throws StompException { this.component._callRubyMethod( "on_unsubscribe", subscriber ); } private XAStompletComponent component; }
package org.torquebox.stomp.component; import org.projectodd.stilts.stomp.StompException; import org.projectodd.stilts.stomp.StompMessage; import org.projectodd.stilts.stomplet.Stomplet; import org.projectodd.stilts.stomplet.StompletConfig; import org.projectodd.stilts.stomplet.Subscriber; public class DirectStompletComponent implements Stomplet { public DirectStompletComponent(XAStompletComponent component) { this.component = component; } @Override public void initialize(StompletConfig config) throws StompException { this.component._callRubyMethodIfDefined( "configure", config ); } @Override public void destroy() throws StompException { this.component._callRubyMethodIfDefined( "destroy" ); } @Override public void onMessage(StompMessage message) throws StompException { this.component._callRubyMethodIfDefined( "on_message", message ); } @Override public void onSubscribe(Subscriber subscriber) throws StompException { this.component._callRubyMethodIfDefined( "on_subscribe", subscriber ); } @Override public void onUnsubscribe(Subscriber subscriber) throws StompException { this.component._callRubyMethodIfDefined( "on_unsubscribe", subscriber ); } private XAStompletComponent component; }
Call the methods only if they exist.
Call the methods only if they exist.
Java
apache-2.0
vaskoz/torquebox,samwgoldman/torquebox,samwgoldman/torquebox,vaskoz/torquebox,vaskoz/torquebox,torquebox/torquebox-release,torquebox/torquebox,samwgoldman/torquebox,mje113/torquebox,torquebox/torquebox-release,mje113/torquebox,mje113/torquebox,samwgoldman/torquebox,ksw2599/torquebox,ksw2599/torquebox,torquebox/torquebox-release,torquebox/torquebox,ksw2599/torquebox,torquebox/torquebox,mje113/torquebox,ksw2599/torquebox,torquebox/torquebox-release,torquebox/torquebox,vaskoz/torquebox
java
## Code Before: package org.torquebox.stomp.component; import org.projectodd.stilts.stomp.StompException; import org.projectodd.stilts.stomp.StompMessage; import org.projectodd.stilts.stomplet.Stomplet; import org.projectodd.stilts.stomplet.StompletConfig; import org.projectodd.stilts.stomplet.Subscriber; public class DirectStompletComponent implements Stomplet { public DirectStompletComponent(XAStompletComponent component) { this.component = component; } @Override public void initialize(StompletConfig config) throws StompException { this.component._callRubyMethod( "configure", config ); } @Override public void destroy() throws StompException { this.component._callRubyMethod( "destroy" ); } @Override public void onMessage(StompMessage message) throws StompException { this.component._callRubyMethod( "on_message", message ); } @Override public void onSubscribe(Subscriber subscriber) throws StompException { this.component._callRubyMethod( "on_subscribe", subscriber ); } @Override public void onUnsubscribe(Subscriber subscriber) throws StompException { this.component._callRubyMethod( "on_unsubscribe", subscriber ); } private XAStompletComponent component; } ## Instruction: Call the methods only if they exist. ## Code After: package org.torquebox.stomp.component; import org.projectodd.stilts.stomp.StompException; import org.projectodd.stilts.stomp.StompMessage; import org.projectodd.stilts.stomplet.Stomplet; import org.projectodd.stilts.stomplet.StompletConfig; import org.projectodd.stilts.stomplet.Subscriber; public class DirectStompletComponent implements Stomplet { public DirectStompletComponent(XAStompletComponent component) { this.component = component; } @Override public void initialize(StompletConfig config) throws StompException { this.component._callRubyMethodIfDefined( "configure", config ); } @Override public void destroy() throws StompException { this.component._callRubyMethodIfDefined( "destroy" ); } @Override public void onMessage(StompMessage message) throws StompException { this.component._callRubyMethodIfDefined( "on_message", message ); } @Override public void onSubscribe(Subscriber subscriber) throws StompException { this.component._callRubyMethodIfDefined( "on_subscribe", subscriber ); } @Override public void onUnsubscribe(Subscriber subscriber) throws StompException { this.component._callRubyMethodIfDefined( "on_unsubscribe", subscriber ); } private XAStompletComponent component; }
package org.torquebox.stomp.component; import org.projectodd.stilts.stomp.StompException; import org.projectodd.stilts.stomp.StompMessage; import org.projectodd.stilts.stomplet.Stomplet; import org.projectodd.stilts.stomplet.StompletConfig; import org.projectodd.stilts.stomplet.Subscriber; public class DirectStompletComponent implements Stomplet { public DirectStompletComponent(XAStompletComponent component) { this.component = component; } @Override public void initialize(StompletConfig config) throws StompException { - this.component._callRubyMethod( "configure", config ); + this.component._callRubyMethodIfDefined( "configure", config ); ? +++++++++ } @Override public void destroy() throws StompException { - this.component._callRubyMethod( "destroy" ); + this.component._callRubyMethodIfDefined( "destroy" ); ? +++++++++ } @Override public void onMessage(StompMessage message) throws StompException { - this.component._callRubyMethod( "on_message", message ); + this.component._callRubyMethodIfDefined( "on_message", message ); ? +++++++++ } @Override public void onSubscribe(Subscriber subscriber) throws StompException { - this.component._callRubyMethod( "on_subscribe", subscriber ); + this.component._callRubyMethodIfDefined( "on_subscribe", subscriber ); ? +++++++++ } @Override public void onUnsubscribe(Subscriber subscriber) throws StompException { - this.component._callRubyMethod( "on_unsubscribe", subscriber ); + this.component._callRubyMethodIfDefined( "on_unsubscribe", subscriber ); ? +++++++++ } private XAStompletComponent component; }
10
0.238095
5
5
bd395c7fa41e5715cc32461da5d4c7415287d743
.travis.yml
.travis.yml
language: node node: - 5.1 before_install: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 3 install: - npm install -g gulp - npm install script: - gulp test
language: node node: - 5.1 before_install: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 3 install: - npm install -g bower gulp - npm install - bower install script: - gulp test
Install bower files on Travis too
Install bower files on Travis too
YAML
mit
chuckeles/exponea-test,chuckeles/exponea-test
yaml
## Code Before: language: node node: - 5.1 before_install: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 3 install: - npm install -g gulp - npm install script: - gulp test ## Instruction: Install bower files on Travis too ## Code After: language: node node: - 5.1 before_install: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 3 install: - npm install -g bower gulp - npm install - bower install script: - gulp test
language: node node: - 5.1 before_install: - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - sleep 3 install: - - npm install -g gulp + - npm install -g bower gulp ? ++++++ - npm install + - bower install script: - gulp test
3
0.1875
2
1
6bfb283d92e58d08a3dd8122b24973d89db14cbe
src/main.rs
src/main.rs
extern crate tray_rust; use tray_rust::linalg; use tray_rust::film; use tray_rust::geometry; use tray_rust::geometry::Geometry; fn main() { let width = 800u; let height = 600u; let mut rt = film::RenderTarget::new(width, height); let camera = film::Camera::new(linalg::Transform::look_at( &linalg::Point::new(0.0, 0.0, -10.0), &linalg::Point::new(0.0, 0.0, 0.0), &linalg::Vector::new(0.0, 1.0, 0.0)), 40.0, rt.dimensions()); let sphere = geometry::Sphere::new(1.5); let instance = geometry::Instance::new(&sphere, linalg::Transform::translate(&linalg::Vector::new(0.0, 2.0, 0.0))); for y in range(0, height) { for x in range(0, width) { let px = (x as f32 + 0.5, y as f32 + 0.5); let mut ray = camera.generate_ray(px); match instance.intersect(&mut ray) { Some(_) => rt.write(px.0, px.1, &film::Colorf::broadcast(1.0)), None => {}, } } } film::write_ppm("out.ppm", width, height, rt.get_render().as_slice()); }
extern crate tray_rust; use tray_rust::linalg; use tray_rust::film; use tray_rust::geometry; use tray_rust::geometry::Geometry; fn main() { let width = 800u; let height = 600u; let mut rt = film::RenderTarget::new(width, height); let camera = film::Camera::new(linalg::Transform::look_at( &linalg::Point::new(0.0, 0.0, -10.0), &linalg::Point::new(0.0, 0.0, 0.0), &linalg::Vector::new(0.0, 1.0, 0.0)), 40.0, rt.dimensions()); let sphere = geometry::Sphere::new(1.5); let instance = geometry::Instance::new(&sphere, linalg::Transform::translate(&linalg::Vector::new(0.0, 2.0, 0.0))); for y in range(0, height) { for x in range(0, width) { let px = (x as f32 + 0.5, y as f32 + 0.5); let mut ray = camera.generate_ray(px); if let Some(_) = geometry::Intersection::from_diffgeom(instance.intersect(&mut ray)) { rt.write(px.0, px.1, &film::Colorf::broadcast(1.0)); } } } film::write_ppm("out.ppm", width, height, rt.get_render().as_slice()); }
Use new Intersection type in the simple hit marker render
Use new Intersection type in the simple hit marker render
Rust
mit
voidException/tray_rust,Twinklebear/tray_rust,GuzTech/tray_rust
rust
## Code Before: extern crate tray_rust; use tray_rust::linalg; use tray_rust::film; use tray_rust::geometry; use tray_rust::geometry::Geometry; fn main() { let width = 800u; let height = 600u; let mut rt = film::RenderTarget::new(width, height); let camera = film::Camera::new(linalg::Transform::look_at( &linalg::Point::new(0.0, 0.0, -10.0), &linalg::Point::new(0.0, 0.0, 0.0), &linalg::Vector::new(0.0, 1.0, 0.0)), 40.0, rt.dimensions()); let sphere = geometry::Sphere::new(1.5); let instance = geometry::Instance::new(&sphere, linalg::Transform::translate(&linalg::Vector::new(0.0, 2.0, 0.0))); for y in range(0, height) { for x in range(0, width) { let px = (x as f32 + 0.5, y as f32 + 0.5); let mut ray = camera.generate_ray(px); match instance.intersect(&mut ray) { Some(_) => rt.write(px.0, px.1, &film::Colorf::broadcast(1.0)), None => {}, } } } film::write_ppm("out.ppm", width, height, rt.get_render().as_slice()); } ## Instruction: Use new Intersection type in the simple hit marker render ## Code After: extern crate tray_rust; use tray_rust::linalg; use tray_rust::film; use tray_rust::geometry; use tray_rust::geometry::Geometry; fn main() { let width = 800u; let height = 600u; let mut rt = film::RenderTarget::new(width, height); let camera = film::Camera::new(linalg::Transform::look_at( &linalg::Point::new(0.0, 0.0, -10.0), &linalg::Point::new(0.0, 0.0, 0.0), &linalg::Vector::new(0.0, 1.0, 0.0)), 40.0, rt.dimensions()); let sphere = geometry::Sphere::new(1.5); let instance = geometry::Instance::new(&sphere, linalg::Transform::translate(&linalg::Vector::new(0.0, 2.0, 0.0))); for y in range(0, height) { for x in range(0, width) { let px = (x as f32 + 0.5, y as f32 + 0.5); let mut ray = camera.generate_ray(px); if let Some(_) = geometry::Intersection::from_diffgeom(instance.intersect(&mut ray)) { rt.write(px.0, px.1, &film::Colorf::broadcast(1.0)); } } } film::write_ppm("out.ppm", width, height, rt.get_render().as_slice()); }
extern crate tray_rust; use tray_rust::linalg; use tray_rust::film; use tray_rust::geometry; use tray_rust::geometry::Geometry; fn main() { let width = 800u; let height = 600u; let mut rt = film::RenderTarget::new(width, height); let camera = film::Camera::new(linalg::Transform::look_at( &linalg::Point::new(0.0, 0.0, -10.0), &linalg::Point::new(0.0, 0.0, 0.0), &linalg::Vector::new(0.0, 1.0, 0.0)), 40.0, rt.dimensions()); let sphere = geometry::Sphere::new(1.5); let instance = geometry::Instance::new(&sphere, linalg::Transform::translate(&linalg::Vector::new(0.0, 2.0, 0.0))); for y in range(0, height) { for x in range(0, width) { let px = (x as f32 + 0.5, y as f32 + 0.5); let mut ray = camera.generate_ray(px); - match instance.intersect(&mut ray) { + if let Some(_) = geometry::Intersection::from_diffgeom(instance.intersect(&mut ray)) { - Some(_) => rt.write(px.0, px.1, &film::Colorf::broadcast(1.0)), ? ----------- ^ + rt.write(px.0, px.1, &film::Colorf::broadcast(1.0)); ? ^ - None => {}, } } } film::write_ppm("out.ppm", width, height, rt.get_render().as_slice()); }
5
0.166667
2
3
c3328a636836106cc760aba10cb5bef2a3ee18dc
lib/chef/knife/secure_bag_edit.rb
lib/chef/knife/secure_bag_edit.rb
require 'chef/knife/secure_bag_base' require 'chef/knife/data_bag_edit' class Chef class Knife class SecureBagEdit < Knife::DataBagEdit include Knife::SecureBagBase banner "knife secure bag edit BAG [ITEM] (options)" category "secure bag" def load_item(bag, item_name) item = Chef::DataBagItem.load(bag, item_name) @raw_data = item.to_hash item = SecureDataBag::Item.from_item(item, key:read_secret) hash = item.to_hash(encoded: false) hash = data_for_edit(hash) hash end def edit_item(item) output = super output = data_for_save(output) item = SecureDataBag::Item.from_hash(output, key:read_secret) item.encoded_fields encoded_fields item.to_hash encoded:true end end end end
require 'chef/knife/secure_bag_base' require 'chef/knife/data_bag_edit' class Chef class Knife class SecureBagEdit < Knife::DataBagEdit include Knife::SecureBagBase banner "knife secure bag edit BAG [ITEM] (options)" category "secure bag" def load_item(bag, item_name) item = Chef::DataBagItem.load(bag, item_name) @raw_data = item.to_hash item = SecureDataBag::Item.from_item(item) hash = item.to_hash(encoded: false) hash = data_for_edit(hash) hash end def edit_data(data, *args) output = super output = data_for_save(output) item = SecureDataBag::Item.from_hash(output) item.encoded_fields encoded_fields item.to_hash encoded:true end end end end
Stop overriding keys in knife secure bag edit
Stop overriding keys in knife secure bag edit
Ruby
mit
JonathanSerafini/chef-secure_data_bag
ruby
## Code Before: require 'chef/knife/secure_bag_base' require 'chef/knife/data_bag_edit' class Chef class Knife class SecureBagEdit < Knife::DataBagEdit include Knife::SecureBagBase banner "knife secure bag edit BAG [ITEM] (options)" category "secure bag" def load_item(bag, item_name) item = Chef::DataBagItem.load(bag, item_name) @raw_data = item.to_hash item = SecureDataBag::Item.from_item(item, key:read_secret) hash = item.to_hash(encoded: false) hash = data_for_edit(hash) hash end def edit_item(item) output = super output = data_for_save(output) item = SecureDataBag::Item.from_hash(output, key:read_secret) item.encoded_fields encoded_fields item.to_hash encoded:true end end end end ## Instruction: Stop overriding keys in knife secure bag edit ## Code After: require 'chef/knife/secure_bag_base' require 'chef/knife/data_bag_edit' class Chef class Knife class SecureBagEdit < Knife::DataBagEdit include Knife::SecureBagBase banner "knife secure bag edit BAG [ITEM] (options)" category "secure bag" def load_item(bag, item_name) item = Chef::DataBagItem.load(bag, item_name) @raw_data = item.to_hash item = SecureDataBag::Item.from_item(item) hash = item.to_hash(encoded: false) hash = data_for_edit(hash) hash end def edit_data(data, *args) output = super output = data_for_save(output) item = SecureDataBag::Item.from_hash(output) item.encoded_fields encoded_fields item.to_hash encoded:true end end end end
require 'chef/knife/secure_bag_base' require 'chef/knife/data_bag_edit' class Chef class Knife class SecureBagEdit < Knife::DataBagEdit include Knife::SecureBagBase banner "knife secure bag edit BAG [ITEM] (options)" category "secure bag" def load_item(bag, item_name) item = Chef::DataBagItem.load(bag, item_name) @raw_data = item.to_hash - item = SecureDataBag::Item.from_item(item, key:read_secret) ? ----------------- + item = SecureDataBag::Item.from_item(item) hash = item.to_hash(encoded: false) hash = data_for_edit(hash) hash end - def edit_item(item) + def edit_data(data, *args) output = super output = data_for_save(output) - item = SecureDataBag::Item.from_hash(output, key:read_secret) ? ----------------- + item = SecureDataBag::Item.from_hash(output) item.encoded_fields encoded_fields item.to_hash encoded:true end end end end
6
0.176471
3
3
40a1f4968be0888aa3126597adaac239d7b1ca5b
tableau-gif.sh
tableau-gif.sh
convert $1 $1-frame-%06d.png # we wont ever have more than a million frames, will we? rm -f ./$1*.csv count=$(($(ls -1 | grep frame | wc -l) - 1)) echo '"x","y","r","g","b","frame"' >> $1.csv for FRAME in `seq -f %06g 0 $count`; do convert $1-frame-$FRAME.png $1-frame-$FRAME.txt sed "s/^\([0-9]\{1,3\}\),\([0-9]\{1,3\}\): ([ ]*\([0-9]\{1,3\}\),[ ]*\([0-9]\{1,3\}\),[ ]*\([0-9]\{1,3\}\).*/\1,\2,\3,\4,\5,$FRAME/g" $1-frame-$FRAME.txt >> $1.csv # agh done rm -f ./$1-frame* perl -p -e 's/\n/\r\n/' < $1.csv > $1_win.csv # windows line-endings
convert $1 -flip flipped-$1 # tableau's origin is different than imagemagick's convert flipped-$1 $1-frame-%06d.png # we wont ever have more than a million frames, will we? rm flipped-$1 rm -f ./$1*.csv count=$(($(ls -1 | grep frame | wc -l) - 1)) echo '"x","y","r","g","b","frame"' >> $1.csv for FRAME in `seq -f %06g 0 $count`; do convert $1-frame-$FRAME.png $1-frame-$FRAME.txt sed "s/^\([0-9]\{1,3\}\),\([0-9]\{1,3\}\): ([ ]*\([0-9]\{1,3\}\),[ ]*\([0-9]\{1,3\}\),[ ]*\([0-9]\{1,3\}\).*/\1,\2,\3,\4,\5,$FRAME/g" $1-frame-$FRAME.txt >> $1.csv # agh done rm -f ./$1-frame* perl -p -e 's/\n/\r\n/' < $1.csv > $1_win.csv # windows line-endings
Fix y being flipped in tableau
Fix y being flipped in tableau
Shell
mit
dlom/tableau-gif
shell
## Code Before: convert $1 $1-frame-%06d.png # we wont ever have more than a million frames, will we? rm -f ./$1*.csv count=$(($(ls -1 | grep frame | wc -l) - 1)) echo '"x","y","r","g","b","frame"' >> $1.csv for FRAME in `seq -f %06g 0 $count`; do convert $1-frame-$FRAME.png $1-frame-$FRAME.txt sed "s/^\([0-9]\{1,3\}\),\([0-9]\{1,3\}\): ([ ]*\([0-9]\{1,3\}\),[ ]*\([0-9]\{1,3\}\),[ ]*\([0-9]\{1,3\}\).*/\1,\2,\3,\4,\5,$FRAME/g" $1-frame-$FRAME.txt >> $1.csv # agh done rm -f ./$1-frame* perl -p -e 's/\n/\r\n/' < $1.csv > $1_win.csv # windows line-endings ## Instruction: Fix y being flipped in tableau ## Code After: convert $1 -flip flipped-$1 # tableau's origin is different than imagemagick's convert flipped-$1 $1-frame-%06d.png # we wont ever have more than a million frames, will we? rm flipped-$1 rm -f ./$1*.csv count=$(($(ls -1 | grep frame | wc -l) - 1)) echo '"x","y","r","g","b","frame"' >> $1.csv for FRAME in `seq -f %06g 0 $count`; do convert $1-frame-$FRAME.png $1-frame-$FRAME.txt sed "s/^\([0-9]\{1,3\}\),\([0-9]\{1,3\}\): ([ ]*\([0-9]\{1,3\}\),[ ]*\([0-9]\{1,3\}\),[ ]*\([0-9]\{1,3\}\).*/\1,\2,\3,\4,\5,$FRAME/g" $1-frame-$FRAME.txt >> $1.csv # agh done rm -f ./$1-frame* perl -p -e 's/\n/\r\n/' < $1.csv > $1_win.csv # windows line-endings
+ convert $1 -flip flipped-$1 # tableau's origin is different than imagemagick's - convert $1 $1-frame-%06d.png # we wont ever have more than a million frames, will we? + convert flipped-$1 $1-frame-%06d.png # we wont ever have more than a million frames, will we? ? ++++++++ + rm flipped-$1 rm -f ./$1*.csv count=$(($(ls -1 | grep frame | wc -l) - 1)) echo '"x","y","r","g","b","frame"' >> $1.csv for FRAME in `seq -f %06g 0 $count`; do convert $1-frame-$FRAME.png $1-frame-$FRAME.txt sed "s/^\([0-9]\{1,3\}\),\([0-9]\{1,3\}\): ([ ]*\([0-9]\{1,3\}\),[ ]*\([0-9]\{1,3\}\),[ ]*\([0-9]\{1,3\}\).*/\1,\2,\3,\4,\5,$FRAME/g" $1-frame-$FRAME.txt >> $1.csv # agh done rm -f ./$1-frame* perl -p -e 's/\n/\r\n/' < $1.csv > $1_win.csv # windows line-endings
4
0.307692
3
1
ea146316b0f0d854a750ecb913b95df2705d1257
autoformat.js
autoformat.js
// Autoformatter for Turing const fs = require('fs'), argv = require('minimist')(process.argv.slice(2), {boolean:true}); var files = argv._; // Check for flags, and process them var flags = argv.flags || null; var format = require('./format.js')(flags); console.log(argv) /** * Main procedure */ files.forEach(file => { fs.readFile(file, 'utf8', (err, data) => { var ext = (argv.e || argv.extension) || ""; var out = (argv.o || argv.out) || file + ext; if (err) throw err; data = format.format(data); if (argv.s || argv.stdio) { console.log(data); } else { fs.writeFile(out, data, err => { if (err) throw err; console.log(out + " has been saved"); }); } }); });
// Autoformatter for Turing const fs = require('fs'), argv = require('minimist')(process.argv.slice(2), {boolean:true}); var files = argv._; // Check for flags, and process them var flags = argv.flags || null; var format = require('./format.js')(flags); /** * Main procedure */ files.forEach(file => { fs.readFile(file, 'utf8', (err, data) => { var ext = (argv.e || argv.extension) || ""; var out = (argv.o || argv.out) || file + ext; if (err) throw err; data = format.format(data); if ((argv.e || argv.extension) || (argv.o || argv.out) || (argv.r || argv.replace)) { fs.writeFile(out, data, err => { if (err) throw err; console.log(out + " has been saved"); }); } else { console.log(data); } }); });
Change default output behaviour to output to STDIO
Change default output behaviour to output to STDIO
JavaScript
mit
tyxchen/turing-autoformat,tyxchen/turing-autoformat
javascript
## Code Before: // Autoformatter for Turing const fs = require('fs'), argv = require('minimist')(process.argv.slice(2), {boolean:true}); var files = argv._; // Check for flags, and process them var flags = argv.flags || null; var format = require('./format.js')(flags); console.log(argv) /** * Main procedure */ files.forEach(file => { fs.readFile(file, 'utf8', (err, data) => { var ext = (argv.e || argv.extension) || ""; var out = (argv.o || argv.out) || file + ext; if (err) throw err; data = format.format(data); if (argv.s || argv.stdio) { console.log(data); } else { fs.writeFile(out, data, err => { if (err) throw err; console.log(out + " has been saved"); }); } }); }); ## Instruction: Change default output behaviour to output to STDIO ## Code After: // Autoformatter for Turing const fs = require('fs'), argv = require('minimist')(process.argv.slice(2), {boolean:true}); var files = argv._; // Check for flags, and process them var flags = argv.flags || null; var format = require('./format.js')(flags); /** * Main procedure */ files.forEach(file => { fs.readFile(file, 'utf8', (err, data) => { var ext = (argv.e || argv.extension) || ""; var out = (argv.o || argv.out) || file + ext; if (err) throw err; data = format.format(data); if ((argv.e || argv.extension) || (argv.o || argv.out) || (argv.r || argv.replace)) { fs.writeFile(out, data, err => { if (err) throw err; console.log(out + " has been saved"); }); } else { console.log(data); } }); });
// Autoformatter for Turing const fs = require('fs'), argv = require('minimist')(process.argv.slice(2), {boolean:true}); var files = argv._; // Check for flags, and process them var flags = argv.flags || null; var format = require('./format.js')(flags); - console.log(argv) - /** * Main procedure */ files.forEach(file => { fs.readFile(file, 'utf8', (err, data) => { var ext = (argv.e || argv.extension) || ""; var out = (argv.o || argv.out) || file + ext; if (err) throw err; data = format.format(data); + if ((argv.e || argv.extension) || (argv.o || argv.out) || (argv.r || argv.replace)) { - if (argv.s || argv.stdio) { - console.log(data); - } else { fs.writeFile(out, data, err => { if (err) throw err; console.log(out + " has been saved"); }); + } else { + console.log(data); } }); });
8
0.216216
3
5
c830d67e6b640791e1a8d9117c75ca146ea5d6c8
spyral/core.py
spyral/core.py
import spyral import pygame def init(): spyral.event.init() pygame.init() pygame.font.init() def quit(): pygame.quit() spyral.director._stack = []
import spyral import pygame _inited = False def init(): global _inited if _inited: return _inited = True spyral.event.init() pygame.init() pygame.font.init() def quit(): pygame.quit() spyral.director._stack = []
Remove poor way of doing default styles
Remove poor way of doing default styles Signed-off-by: Robert Deaton <eb00a885478926d5d594195591fb94a03acb1062@udel.edu>
Python
lgpl-2.1
platipy/spyral
python
## Code Before: import spyral import pygame def init(): spyral.event.init() pygame.init() pygame.font.init() def quit(): pygame.quit() spyral.director._stack = [] ## Instruction: Remove poor way of doing default styles Signed-off-by: Robert Deaton <eb00a885478926d5d594195591fb94a03acb1062@udel.edu> ## Code After: import spyral import pygame _inited = False def init(): global _inited if _inited: return _inited = True spyral.event.init() pygame.init() pygame.font.init() def quit(): pygame.quit() spyral.director._stack = []
import spyral import pygame + _inited = False + def init(): + global _inited + if _inited: + return + _inited = True spyral.event.init() pygame.init() pygame.font.init() - def quit(): pygame.quit() spyral.director._stack = []
7
0.583333
6
1
5d2022ac13546f32f06a9c2c80c07b21b764811d
.buildkite/pipeline.sh
.buildkite/pipeline.sh
set -eu # If you build HEAD the pipeline.sh step, because it runs first, won't yet # have the updated commit SHA. So we have to figure it out ourselves. if [[ "${BUILDKITE_COMMIT:-HEAD}" == "HEAD" ]]; then commit=$(git show HEAD -s --pretty='%h') else commit="${BUILDKITE_COMMIT}" fi # We have to use cat because pipeline.yml $ interpolation doesn't work in YAML # keys, only values cat <<YAML steps: - label: run bats tests command: tests/ plugins: ${BUILDKITE_REPO}#${commit}: run: tests - wait - label: check secrets are exposed correctly command: env plugins: ${BUILDKITE_REPO}#${commit}: s3_bucket: my_test_bucket YAML
set -eu # If you build HEAD the pipeline.sh step, because it runs first, won't yet # have the updated commit SHA. So we have to figure it out ourselves. if [[ "${BUILDKITE_COMMIT:-HEAD}" == "HEAD" ]]; then commit=$(git show HEAD -s --pretty='%h') else commit="${BUILDKITE_COMMIT}" fi # We have to use cat because pipeline.yml $ interpolation doesn't work in YAML # keys, only values cat <<YAML steps: - label: run bats tests command: tests/ plugins: docker-compose#v1.2.1 run: tests - wait - label: check secrets are exposed correctly command: env plugins: ${BUILDKITE_REPO}#${commit}: s3_bucket: my_test_bucket YAML
Use the docker-compose plugin to runs tests
Use the docker-compose plugin to runs tests
Shell
mit
buildkite-plugins/s3-secrets-buildkite-plugin
shell
## Code Before: set -eu # If you build HEAD the pipeline.sh step, because it runs first, won't yet # have the updated commit SHA. So we have to figure it out ourselves. if [[ "${BUILDKITE_COMMIT:-HEAD}" == "HEAD" ]]; then commit=$(git show HEAD -s --pretty='%h') else commit="${BUILDKITE_COMMIT}" fi # We have to use cat because pipeline.yml $ interpolation doesn't work in YAML # keys, only values cat <<YAML steps: - label: run bats tests command: tests/ plugins: ${BUILDKITE_REPO}#${commit}: run: tests - wait - label: check secrets are exposed correctly command: env plugins: ${BUILDKITE_REPO}#${commit}: s3_bucket: my_test_bucket YAML ## Instruction: Use the docker-compose plugin to runs tests ## Code After: set -eu # If you build HEAD the pipeline.sh step, because it runs first, won't yet # have the updated commit SHA. So we have to figure it out ourselves. if [[ "${BUILDKITE_COMMIT:-HEAD}" == "HEAD" ]]; then commit=$(git show HEAD -s --pretty='%h') else commit="${BUILDKITE_COMMIT}" fi # We have to use cat because pipeline.yml $ interpolation doesn't work in YAML # keys, only values cat <<YAML steps: - label: run bats tests command: tests/ plugins: docker-compose#v1.2.1 run: tests - wait - label: check secrets are exposed correctly command: env plugins: ${BUILDKITE_REPO}#${commit}: s3_bucket: my_test_bucket YAML
set -eu # If you build HEAD the pipeline.sh step, because it runs first, won't yet # have the updated commit SHA. So we have to figure it out ourselves. if [[ "${BUILDKITE_COMMIT:-HEAD}" == "HEAD" ]]; then commit=$(git show HEAD -s --pretty='%h') else commit="${BUILDKITE_COMMIT}" fi # We have to use cat because pipeline.yml $ interpolation doesn't work in YAML # keys, only values cat <<YAML steps: - label: run bats tests command: tests/ plugins: - ${BUILDKITE_REPO}#${commit}: + docker-compose#v1.2.1 run: tests - wait - label: check secrets are exposed correctly command: env plugins: ${BUILDKITE_REPO}#${commit}: s3_bucket: my_test_bucket YAML
2
0.068966
1
1
87fbcbb49fc7209536ae1a28e774b5473c072668
app/views/ezine/mailer/verification_mail.ja.text.erb
app/views/ezine/mailer/verification_mail.ja.text.erb
<% message.subject = "[#{@node.name}] #{t('ezine.entry_type.' + @entry.entry_type)}確認" %> <%= @node.reply_upper_text %> メールアドレスの<%= t('ezine.entry_type.' + @entry.entry_type) %>を受け付けました。 以下のアドレスをクリックして<%= t('ezine.entry_type.' + @entry.entry_type) %>を完了してください。 <%= "#{@node.full_url}entry/verify?token=#{@entry.verification_token}" %> メールアドレス: <%= @entry.email %> 配信形式: <%= @entry.email_type %> このメールに心当たりのない方はお手数ですが本メールを破棄してください。 <%= @node.reply_lower_text %>
<% message.subject = "[#{@node.name}] #{t('ezine.entry_type.' + @entry.entry_type)}確認" %> <%= @node.reply_upper_text %> メールアドレスの<%= t('ezine.entry_type.' + @entry.entry_type) %>を受け付けました。 以下のアドレスをクリックして<%= t('ezine.entry_type.' + @entry.entry_type) %>を完了してください。 <%= "#{@node.full_url}entry/verify?token=#{@entry.verification_token}" %> メールアドレス: <%= @entry.email %> 配信形式: <%= @entry.email_type %> このメールに心当たりのない方はお手数ですが本メールを破棄してください。 <%= @node.reply_lower_text %> <%= @node.reply_signature %>
Add signature to verification mail
Add signature to verification mail
HTML+ERB
mit
shirasagi/shirasagi,tany/ss,shakkun/ss-temp,hotmix/shirasagi,shakkun/ss-temp,toyodundy/shirasagi,kaosf/shirasagi,tachikomapocket/shirasagi-_-shirasagi,mizoki/shirasagi,tany/ss,koba5884/shirasagi,tachikomapocket/shirasagi-_-shirasagi,toyodundy/shirasagi,tecyama/opendata,shirasagi/shirasagi,itowtips/shirasagi,masakiooba/shirasagi-1,masakiooba/shirasagi-1,masakiooba/shirasagi-1,sunny4381/shirasagi,itowtips/shirasagi,shirasagi/ss-handson,mizoki/shirasagi,t-wata-cldt/shirasagi,bee01/shirasagi,itowtips/ss-handson,itowtips/shirasagi,sunny4381/shirasagi,itowtips/ss-handson,shirasagi/ss-handson,tecoda/opendata,sunny4381/opendata,gouf/shirasagi,tecoda/opendata,tany/ss,mizoki/shirasagi,ShinjiTanimoto/shirasagi,kaosf/shirasagi,tecoda/opendata,sert-uw/shirasagi,tany/om,itowtips/ss-handson,sunny4381/opendata,tecoda/opendata,toyodundy/shirasagi,shirasagi/opendata,ShinjiTanimoto/shirasagi,sunny4381/ss-handson,bee01/shirasagi,sunny4381/opendata,tany/ss,MasakiInaya/shirasagi,toyodundy/shirasagi,t-wata-cldt/shirasagi,togusafish/shirasagi-_-shirasagi,tachikomapocket/shirasagi-_-shirasagi,MasakiInaya/shirasagi,sunny4381/shirasagi,gouf/shirasagi,shirasagi/ss-handson,koba5884/shirasagi,t-wata-cldt/shirasagi,shakkun/ss-temp,sunny4381/shirasagi,MasakiInaya/shirasagi,bee01/shirasagi,sert-uw/shirasagi,shirasagi/shirasagi,ShinjiTanimoto/shirasagi,togusafish/shirasagi-_-shirasagi,togusafish/shirasagi-_-shirasagi,sunny4381/ss-handson,shirasagi/opendata,MasakiInaya/shirasagi,gouf/shirasagi,itowtips/shirasagi,hotmix/shirasagi,tany/om,tecyama/opendata,itowtips/ss-handson,hotmix/shirasagi,togusafish/shirasagi-_-shirasagi,hotmix/shirasagi,tachikomapocket/shirasagi-_-shirasagi,shirasagi/opendata,gouf/shirasagi,shirasagi/opendata,tecyama/opendata,sert-uw/shirasagi,tany/om,shirasagi/shirasagi,sert-uw/shirasagi,bee01/shirasagi,sunny4381/ss-handson,kaosf/shirasagi,tecyama/opendata,tany/om,masakiooba/shirasagi-1,shirasagi/ss-handson,shakkun/ss-temp,ShinjiTanimoto/shirasagi,kaosf/shirasagi,koba5884/shirasagi,sunny4381/ss-handson,t-wata-cldt/shirasagi,koba5884/shirasagi,mizoki/shirasagi,sunny4381/opendata
html+erb
## Code Before: <% message.subject = "[#{@node.name}] #{t('ezine.entry_type.' + @entry.entry_type)}確認" %> <%= @node.reply_upper_text %> メールアドレスの<%= t('ezine.entry_type.' + @entry.entry_type) %>を受け付けました。 以下のアドレスをクリックして<%= t('ezine.entry_type.' + @entry.entry_type) %>を完了してください。 <%= "#{@node.full_url}entry/verify?token=#{@entry.verification_token}" %> メールアドレス: <%= @entry.email %> 配信形式: <%= @entry.email_type %> このメールに心当たりのない方はお手数ですが本メールを破棄してください。 <%= @node.reply_lower_text %> ## Instruction: Add signature to verification mail ## Code After: <% message.subject = "[#{@node.name}] #{t('ezine.entry_type.' + @entry.entry_type)}確認" %> <%= @node.reply_upper_text %> メールアドレスの<%= t('ezine.entry_type.' + @entry.entry_type) %>を受け付けました。 以下のアドレスをクリックして<%= t('ezine.entry_type.' + @entry.entry_type) %>を完了してください。 <%= "#{@node.full_url}entry/verify?token=#{@entry.verification_token}" %> メールアドレス: <%= @entry.email %> 配信形式: <%= @entry.email_type %> このメールに心当たりのない方はお手数ですが本メールを破棄してください。 <%= @node.reply_lower_text %> <%= @node.reply_signature %>
<% message.subject = "[#{@node.name}] #{t('ezine.entry_type.' + @entry.entry_type)}確認" %> <%= @node.reply_upper_text %> メールアドレスの<%= t('ezine.entry_type.' + @entry.entry_type) %>を受け付けました。 以下のアドレスをクリックして<%= t('ezine.entry_type.' + @entry.entry_type) %>を完了してください。 <%= "#{@node.full_url}entry/verify?token=#{@entry.verification_token}" %> メールアドレス: <%= @entry.email %> 配信形式: <%= @entry.email_type %> このメールに心当たりのない方はお手数ですが本メールを破棄してください。 <%= @node.reply_lower_text %> + + <%= @node.reply_signature %>
2
0.153846
2
0
5d43b21a89dc846bfeccada8f8ff5569891ee389
spec/spec_helper.rb
spec/spec_helper.rb
unless ENV['CI'] require 'simplecov' SimpleCov.start do add_group 'Tweetstream', 'lib/tweetstream' add_group 'Specs', 'spec' end end require 'tweetstream' require 'tweetstream/site_stream_client' require 'rspec' require 'webmock/rspec' require 'yajl' require 'json' RSpec.configure do |config| config.expect_with :rspec do |c| c.syntax = :expect end end def samples(fixture) samples = [] Yajl::Parser.parse(fixture(fixture), :symbolize_keys => true) do |hash| samples << hash end samples end def sample_tweets return @tweets if @tweets @tweets = samples('statuses.json') end def sample_direct_messages return @direct_messages if @direct_messages @direct_messages = samples('direct_messages.json') end def fixture_path File.expand_path("../fixtures", __FILE__) end def fixture(file) File.new(fixture_path + '/' + file) end FakeHttp = Class.new do def callback; end def errback; end end
unless ENV['CI'] require 'simplecov' SimpleCov.start do add_group 'Tweetstream', 'lib/tweetstream' add_group 'Specs', 'spec' end end require 'tweetstream' require 'tweetstream/site_stream_client' require 'rspec' require 'webmock/rspec' require 'yajl' RSpec.configure do |config| config.expect_with :rspec do |c| c.syntax = :expect end end def samples(fixture) samples = [] Yajl::Parser.parse(fixture(fixture), :symbolize_keys => true) do |hash| samples << hash end samples end def sample_tweets return @tweets if @tweets @tweets = samples('statuses.json') end def sample_direct_messages return @direct_messages if @direct_messages @direct_messages = samples('direct_messages.json') end def fixture_path File.expand_path("../fixtures", __FILE__) end def fixture(file) File.new(fixture_path + '/' + file) end FakeHttp = Class.new do def callback; end def errback; end end
Remove json (using YAJL instead)
Remove json (using YAJL instead)
Ruby
mit
carusocr/tweetstream,tweetstream/tweetstream,itsfabiojunior/Twitter,rayning0/tweetstream
ruby
## Code Before: unless ENV['CI'] require 'simplecov' SimpleCov.start do add_group 'Tweetstream', 'lib/tweetstream' add_group 'Specs', 'spec' end end require 'tweetstream' require 'tweetstream/site_stream_client' require 'rspec' require 'webmock/rspec' require 'yajl' require 'json' RSpec.configure do |config| config.expect_with :rspec do |c| c.syntax = :expect end end def samples(fixture) samples = [] Yajl::Parser.parse(fixture(fixture), :symbolize_keys => true) do |hash| samples << hash end samples end def sample_tweets return @tweets if @tweets @tweets = samples('statuses.json') end def sample_direct_messages return @direct_messages if @direct_messages @direct_messages = samples('direct_messages.json') end def fixture_path File.expand_path("../fixtures", __FILE__) end def fixture(file) File.new(fixture_path + '/' + file) end FakeHttp = Class.new do def callback; end def errback; end end ## Instruction: Remove json (using YAJL instead) ## Code After: unless ENV['CI'] require 'simplecov' SimpleCov.start do add_group 'Tweetstream', 'lib/tweetstream' add_group 'Specs', 'spec' end end require 'tweetstream' require 'tweetstream/site_stream_client' require 'rspec' require 'webmock/rspec' require 'yajl' RSpec.configure do |config| config.expect_with :rspec do |c| c.syntax = :expect end end def samples(fixture) samples = [] Yajl::Parser.parse(fixture(fixture), :symbolize_keys => true) do |hash| samples << hash end samples end def sample_tweets return @tweets if @tweets @tweets = samples('statuses.json') end def sample_direct_messages return @direct_messages if @direct_messages @direct_messages = samples('direct_messages.json') end def fixture_path File.expand_path("../fixtures", __FILE__) end def fixture(file) File.new(fixture_path + '/' + file) end FakeHttp = Class.new do def callback; end def errback; end end
unless ENV['CI'] require 'simplecov' SimpleCov.start do add_group 'Tweetstream', 'lib/tweetstream' add_group 'Specs', 'spec' end end require 'tweetstream' require 'tweetstream/site_stream_client' require 'rspec' require 'webmock/rspec' require 'yajl' - require 'json' RSpec.configure do |config| config.expect_with :rspec do |c| c.syntax = :expect end end def samples(fixture) samples = [] Yajl::Parser.parse(fixture(fixture), :symbolize_keys => true) do |hash| samples << hash end samples end def sample_tweets return @tweets if @tweets @tweets = samples('statuses.json') end def sample_direct_messages return @direct_messages if @direct_messages @direct_messages = samples('direct_messages.json') end def fixture_path File.expand_path("../fixtures", __FILE__) end def fixture(file) File.new(fixture_path + '/' + file) end FakeHttp = Class.new do def callback; end def errback; end end
1
0.019608
0
1
25cfda55014438e50ae38237841d12a9bb112852
meta/application.go
meta/application.go
package meta // Application contains third party application specific data. // // ref: https://www.xiph.org/flac/format.html#metadata_block_application type Application struct { // Registered application ID. // // ref: https://www.xiph.org/flac/id.html ID uint32 // Application data. Data []byte } // parseApplication reads and parses the body of an Application metadata block. func (block *Block) parseApplication() error { panic("not yet implemented.") }
package meta import ( "encoding/binary" "io/ioutil" ) // Application contains third party application specific data. // // ref: https://www.xiph.org/flac/format.html#metadata_block_application type Application struct { // Registered application ID. // // ref: https://www.xiph.org/flac/id.html ID uint32 // Application data. Data []byte } // parseApplication reads and parses the body of an Application metadata block. func (block *Block) parseApplication() error { app := new(Application) err := binary.Read(block.lr, binary.BigEndian, &app.ID) if err != nil { return err } app.Data, err = ioutil.ReadAll(block.lr) return err }
Implement the parseApplication method of Block.
meta: Implement the parseApplication method of Block.
Go
unlicense
mewkiz/flac
go
## Code Before: package meta // Application contains third party application specific data. // // ref: https://www.xiph.org/flac/format.html#metadata_block_application type Application struct { // Registered application ID. // // ref: https://www.xiph.org/flac/id.html ID uint32 // Application data. Data []byte } // parseApplication reads and parses the body of an Application metadata block. func (block *Block) parseApplication() error { panic("not yet implemented.") } ## Instruction: meta: Implement the parseApplication method of Block. ## Code After: package meta import ( "encoding/binary" "io/ioutil" ) // Application contains third party application specific data. // // ref: https://www.xiph.org/flac/format.html#metadata_block_application type Application struct { // Registered application ID. // // ref: https://www.xiph.org/flac/id.html ID uint32 // Application data. Data []byte } // parseApplication reads and parses the body of an Application metadata block. func (block *Block) parseApplication() error { app := new(Application) err := binary.Read(block.lr, binary.BigEndian, &app.ID) if err != nil { return err } app.Data, err = ioutil.ReadAll(block.lr) return err }
package meta + + import ( + "encoding/binary" + "io/ioutil" + ) // Application contains third party application specific data. // // ref: https://www.xiph.org/flac/format.html#metadata_block_application type Application struct { // Registered application ID. // // ref: https://www.xiph.org/flac/id.html ID uint32 // Application data. Data []byte } // parseApplication reads and parses the body of an Application metadata block. func (block *Block) parseApplication() error { - panic("not yet implemented.") + app := new(Application) + err := binary.Read(block.lr, binary.BigEndian, &app.ID) + if err != nil { + return err + } + app.Data, err = ioutil.ReadAll(block.lr) + return err }
13
0.722222
12
1
880bed71da59339538d55f83d6f746eb9ccd656e
includes/do.php
includes/do.php
<?php require __DIR__.'/../includes/init.php'; use App\RegExp; use App\HTTP; use App\Users; use App\CoreUtils; $permRedirectPattern = new RegExp('^\s*(.*?)\.php(\?.*)?$','i'); if (preg_match($permRedirectPattern, $_SERVER['REQUEST_URI'])) HTTP::redirect(preg_replace($permRedirectPattern, '$1$2', $_SERVER['REQUEST_URI'])); $decoded_uri = urldecode(CoreUtils::trim($_SERVER['REQUEST_URI'])); if (!preg_match($REWRITE_REGEX,strtok($decoded_uri,'?'),$matches)){ Users::authenticate(); CoreUtils::notFound(); } $do = empty($matches[1]) ? 'index' : $matches[1]; $data = $matches[2] ?? ''; require INCPATH.'routes.php'; /** @var $match array */ $match = $router->match($decoded_uri); if (!isset($match['target'])) CoreUtils::notFound(); (\App\RouteHelper::processHandler($match['target']))($match['params']);
<?php require __DIR__.'/../includes/init.php'; use App\RegExp; use App\HTTP; use App\Users; use App\CoreUtils; $permRedirectPattern = new RegExp('^\s*(.*?)\.php(\?.*)?$','i'); if (preg_match($permRedirectPattern, $_SERVER['REQUEST_URI'])) HTTP::redirect(preg_replace($permRedirectPattern, '$1$2', $_SERVER['REQUEST_URI'])); $decoded_uri = CoreUtils::trim(urldecode($_SERVER['REQUEST_URI'])); if (!preg_match($REWRITE_REGEX,strtok($decoded_uri,'?'),$matches)){ Users::authenticate(); CoreUtils::notFound(); } $do = empty($matches[1]) ? 'index' : $matches[1]; $data = $matches[2] ?? ''; require INCPATH.'routes.php'; /** @var $match array */ $match = $router->match($decoded_uri); if (!isset($match['target'])) CoreUtils::notFound(); (\App\RouteHelper::processHandler($match['target']))($match['params']);
Fix whitespace at the end of the URL breaking routing
Fix whitespace at the end of the URL breaking routing
PHP
mit
ponydevs/MLPVC-RR,ponydevs/MLPVC-RR,ponydevs/MLPVC-RR,ponydevs/MLPVC-RR
php
## Code Before: <?php require __DIR__.'/../includes/init.php'; use App\RegExp; use App\HTTP; use App\Users; use App\CoreUtils; $permRedirectPattern = new RegExp('^\s*(.*?)\.php(\?.*)?$','i'); if (preg_match($permRedirectPattern, $_SERVER['REQUEST_URI'])) HTTP::redirect(preg_replace($permRedirectPattern, '$1$2', $_SERVER['REQUEST_URI'])); $decoded_uri = urldecode(CoreUtils::trim($_SERVER['REQUEST_URI'])); if (!preg_match($REWRITE_REGEX,strtok($decoded_uri,'?'),$matches)){ Users::authenticate(); CoreUtils::notFound(); } $do = empty($matches[1]) ? 'index' : $matches[1]; $data = $matches[2] ?? ''; require INCPATH.'routes.php'; /** @var $match array */ $match = $router->match($decoded_uri); if (!isset($match['target'])) CoreUtils::notFound(); (\App\RouteHelper::processHandler($match['target']))($match['params']); ## Instruction: Fix whitespace at the end of the URL breaking routing ## Code After: <?php require __DIR__.'/../includes/init.php'; use App\RegExp; use App\HTTP; use App\Users; use App\CoreUtils; $permRedirectPattern = new RegExp('^\s*(.*?)\.php(\?.*)?$','i'); if (preg_match($permRedirectPattern, $_SERVER['REQUEST_URI'])) HTTP::redirect(preg_replace($permRedirectPattern, '$1$2', $_SERVER['REQUEST_URI'])); $decoded_uri = CoreUtils::trim(urldecode($_SERVER['REQUEST_URI'])); if (!preg_match($REWRITE_REGEX,strtok($decoded_uri,'?'),$matches)){ Users::authenticate(); CoreUtils::notFound(); } $do = empty($matches[1]) ? 'index' : $matches[1]; $data = $matches[2] ?? ''; require INCPATH.'routes.php'; /** @var $match array */ $match = $router->match($decoded_uri); if (!isset($match['target'])) CoreUtils::notFound(); (\App\RouteHelper::processHandler($match['target']))($match['params']);
<?php require __DIR__.'/../includes/init.php'; use App\RegExp; use App\HTTP; use App\Users; use App\CoreUtils; $permRedirectPattern = new RegExp('^\s*(.*?)\.php(\?.*)?$','i'); if (preg_match($permRedirectPattern, $_SERVER['REQUEST_URI'])) HTTP::redirect(preg_replace($permRedirectPattern, '$1$2', $_SERVER['REQUEST_URI'])); - $decoded_uri = urldecode(CoreUtils::trim($_SERVER['REQUEST_URI'])); ? ---------- + $decoded_uri = CoreUtils::trim(urldecode($_SERVER['REQUEST_URI'])); ? ++++++++++ if (!preg_match($REWRITE_REGEX,strtok($decoded_uri,'?'),$matches)){ Users::authenticate(); CoreUtils::notFound(); } $do = empty($matches[1]) ? 'index' : $matches[1]; $data = $matches[2] ?? ''; require INCPATH.'routes.php'; /** @var $match array */ $match = $router->match($decoded_uri); if (!isset($match['target'])) CoreUtils::notFound(); (\App\RouteHelper::processHandler($match['target']))($match['params']);
2
0.071429
1
1
eade7b1278bc562e14ce4d5de8ad609a8b512514
src/elements/forms/element_button.erl
src/elements/forms/element_button.erl
% vim: sw=4 ts=4 et ft=erlang % Nitrogen Web Framework for Erlang % Copyright (c) 2008-2010 Rusty Klophaus % See MIT-LICENSE for licensing information. -module (element_button). -include_lib ("wf.hrl"). -compile(export_all). reflect() -> record_info(fields, button). render_element(Record) -> ID = Record#button.id, Anchor = Record#button.anchor, case Record#button.postback of undefined -> ignore; Postback -> wf:wire(Anchor, #event { type=click, validation_group=ID, postback=Postback, delegate=Record#button.delegate }) end, case Record#button.click of undefined -> ignore; ClickActions -> wf:wire(Anchor, #event { type=click, actions=ClickActions }) end, Value = [" ", wf:html_encode(Record#button.text, Record#button.html_encode), " "], wf_tags:emit_tag(input, [ {id, Record#button.html_id}, {type, button}, {class, [button, Record#button.class]}, {style, Record#button.style}, {value, Value} ]).
% vim: sw=4 ts=4 et ft=erlang % Nitrogen Web Framework for Erlang % Copyright (c) 2008-2010 Rusty Klophaus % See MIT-LICENSE for licensing information. -module (element_button). -include_lib ("wf.hrl"). -compile(export_all). reflect() -> record_info(fields, button). render_element(Record) -> ID = Record#button.id, Anchor = Record#button.anchor, case Record#button.postback of undefined -> ignore; Postback -> wf:wire(Anchor, #event { type=click, validation_group=ID, postback=Postback, delegate=Record#button.delegate }) end, case Record#button.click of undefined -> ignore; ClickActions -> wf:wire(Anchor, #event { type=click, actions=ClickActions }) end, Value = wf:html_encode(Record#button.text, Record#button.html_encode), wf_tags:emit_tag(input, [ {id, Record#button.html_id}, {type, button}, {class, [button, Record#button.class]}, {style, Record#button.style}, {value, Value} ]).
Fix commas being removed from button values
Fix commas being removed from button values
Erlang
mit
nitrogen/nitrogen_core,choptastic/nitrogen_core,stuart-thackray/nitrogen_core,SovereignPrime/nitrogen_core,stuart-thackray/nitrogen_core,choptastic/nitrogen_core,stuart-thackray/nitrogen_core,SovereignPrime/nitrogen_core,nitrogen/nitrogen_core,nitrogen/nitrogen_core,SovereignPrime/nitrogen_core,nitrogen/nitrogen_core,choptastic/nitrogen_core
erlang
## Code Before: % vim: sw=4 ts=4 et ft=erlang % Nitrogen Web Framework for Erlang % Copyright (c) 2008-2010 Rusty Klophaus % See MIT-LICENSE for licensing information. -module (element_button). -include_lib ("wf.hrl"). -compile(export_all). reflect() -> record_info(fields, button). render_element(Record) -> ID = Record#button.id, Anchor = Record#button.anchor, case Record#button.postback of undefined -> ignore; Postback -> wf:wire(Anchor, #event { type=click, validation_group=ID, postback=Postback, delegate=Record#button.delegate }) end, case Record#button.click of undefined -> ignore; ClickActions -> wf:wire(Anchor, #event { type=click, actions=ClickActions }) end, Value = [" ", wf:html_encode(Record#button.text, Record#button.html_encode), " "], wf_tags:emit_tag(input, [ {id, Record#button.html_id}, {type, button}, {class, [button, Record#button.class]}, {style, Record#button.style}, {value, Value} ]). ## Instruction: Fix commas being removed from button values ## Code After: % vim: sw=4 ts=4 et ft=erlang % Nitrogen Web Framework for Erlang % Copyright (c) 2008-2010 Rusty Klophaus % See MIT-LICENSE for licensing information. -module (element_button). -include_lib ("wf.hrl"). -compile(export_all). reflect() -> record_info(fields, button). render_element(Record) -> ID = Record#button.id, Anchor = Record#button.anchor, case Record#button.postback of undefined -> ignore; Postback -> wf:wire(Anchor, #event { type=click, validation_group=ID, postback=Postback, delegate=Record#button.delegate }) end, case Record#button.click of undefined -> ignore; ClickActions -> wf:wire(Anchor, #event { type=click, actions=ClickActions }) end, Value = wf:html_encode(Record#button.text, Record#button.html_encode), wf_tags:emit_tag(input, [ {id, Record#button.html_id}, {type, button}, {class, [button, Record#button.class]}, {style, Record#button.style}, {value, Value} ]).
% vim: sw=4 ts=4 et ft=erlang % Nitrogen Web Framework for Erlang % Copyright (c) 2008-2010 Rusty Klophaus % See MIT-LICENSE for licensing information. -module (element_button). -include_lib ("wf.hrl"). -compile(export_all). reflect() -> record_info(fields, button). render_element(Record) -> ID = Record#button.id, Anchor = Record#button.anchor, case Record#button.postback of undefined -> ignore; Postback -> wf:wire(Anchor, #event { type=click, validation_group=ID, postback=Postback, delegate=Record#button.delegate }) end, case Record#button.click of undefined -> ignore; ClickActions -> wf:wire(Anchor, #event { type=click, actions=ClickActions }) end, - Value = [" ", wf:html_encode(Record#button.text, Record#button.html_encode), " "], ? ------- ------- + Value = wf:html_encode(Record#button.text, Record#button.html_encode), wf_tags:emit_tag(input, [ {id, Record#button.html_id}, {type, button}, {class, [button, Record#button.class]}, {style, Record#button.style}, {value, Value} ]).
2
0.0625
1
1
696af3becb5bf0a9bc2ca935f92b1473ab40fc6d
ngPrint.css
ngPrint.css
@media screen { #printSection { display: none; } } @media print { body * { visibility:hidden; } #printSection, #printSection * { visibility:visible; } #printSection { position:absolute; left:0; top:0; } }
@media screen { #printSection { display: none; } } @media print { body * { display:none; } #printSection, #printSection * { display: inline; } #printSection { position:absolute; left:0; top:0; } }
Fix 2 page display for 1 page content.
Fix 2 page display for 1 page content. visibility:hidden only hides the content, it still takes place on the page. In some cases, the displayed content might be only taking 1 page but the hidden content makes it take 2 pages. So to solve this, we remove the content from the print media altogether by using display:none instead of visibility:hidden.
CSS
mit
mbmihura/ngPrint,gilf/ngPrint
css
## Code Before: @media screen { #printSection { display: none; } } @media print { body * { visibility:hidden; } #printSection, #printSection * { visibility:visible; } #printSection { position:absolute; left:0; top:0; } } ## Instruction: Fix 2 page display for 1 page content. visibility:hidden only hides the content, it still takes place on the page. In some cases, the displayed content might be only taking 1 page but the hidden content makes it take 2 pages. So to solve this, we remove the content from the print media altogether by using display:none instead of visibility:hidden. ## Code After: @media screen { #printSection { display: none; } } @media print { body * { display:none; } #printSection, #printSection * { display: inline; } #printSection { position:absolute; left:0; top:0; } }
@media screen { #printSection { display: none; } } @media print { body * { - visibility:hidden; + display:none; } #printSection, #printSection * { - visibility:visible; + display: inline; } #printSection { position:absolute; left:0; top:0; } }
4
0.190476
2
2
6cbe8ba895eaf06497815b5617aa1cea69b9272c
libraries/egenesis/seed-nodes.txt
libraries/egenesis/seed-nodes.txt
// https://bitsharestalk.org/index.php/topic,23715.0.html "seed01.liondani.com:1776", // liondani (Germany) "bts.lafona.net:1776", // lafona (France) "bts-seed1.abit-more.com:62015", // abit (China) "seed.blckchnd.com:4243", // blckchnd (Germany) "seed.roelandp.nl:1776", // roelandp (Canada) "seed.bts.bangzi.info:55501", // Bangzi (Germany) "seed1.xbts.io:1776", // xbts.io (Germany) "seed2.xbts.io:1776", // xbts.io (Germany) "seed.bitshares.org:666", // bitshares.org (France) "seeds.btsnodes.com:1776", // Community
// https://bitsharestalk.org/index.php/topic,23715.0.html "seed01.liondani.com:1776", // liondani (Germany) "bts.lafona.net:1776", // lafona (France) "bts-seed1.abit-more.com:62015", // abit (China) "seed.roelandp.nl:1776", // roelandp (Canada) "seed.bts.bangzi.info:55501", // Bangzi (Germany) "seed1.xbts.io:1776", // xbts.io (Germany) "seed2.xbts.io:1776", // xbts.io (Germany) "seed.bitshares.org:666", // bitshares.org (France) "seeds.btsnodes.com:1776", // Community
Remove a dead seed node
Remove a dead seed node
Text
mit
bitshares/bitshares-2,bitshares/bitshares-2,bitshares/bitshares-2,bitshares/bitshares-2
text
## Code Before: // https://bitsharestalk.org/index.php/topic,23715.0.html "seed01.liondani.com:1776", // liondani (Germany) "bts.lafona.net:1776", // lafona (France) "bts-seed1.abit-more.com:62015", // abit (China) "seed.blckchnd.com:4243", // blckchnd (Germany) "seed.roelandp.nl:1776", // roelandp (Canada) "seed.bts.bangzi.info:55501", // Bangzi (Germany) "seed1.xbts.io:1776", // xbts.io (Germany) "seed2.xbts.io:1776", // xbts.io (Germany) "seed.bitshares.org:666", // bitshares.org (France) "seeds.btsnodes.com:1776", // Community ## Instruction: Remove a dead seed node ## Code After: // https://bitsharestalk.org/index.php/topic,23715.0.html "seed01.liondani.com:1776", // liondani (Germany) "bts.lafona.net:1776", // lafona (France) "bts-seed1.abit-more.com:62015", // abit (China) "seed.roelandp.nl:1776", // roelandp (Canada) "seed.bts.bangzi.info:55501", // Bangzi (Germany) "seed1.xbts.io:1776", // xbts.io (Germany) "seed2.xbts.io:1776", // xbts.io (Germany) "seed.bitshares.org:666", // bitshares.org (France) "seeds.btsnodes.com:1776", // Community
// https://bitsharestalk.org/index.php/topic,23715.0.html "seed01.liondani.com:1776", // liondani (Germany) "bts.lafona.net:1776", // lafona (France) "bts-seed1.abit-more.com:62015", // abit (China) - "seed.blckchnd.com:4243", // blckchnd (Germany) "seed.roelandp.nl:1776", // roelandp (Canada) "seed.bts.bangzi.info:55501", // Bangzi (Germany) "seed1.xbts.io:1776", // xbts.io (Germany) "seed2.xbts.io:1776", // xbts.io (Germany) "seed.bitshares.org:666", // bitshares.org (France) "seeds.btsnodes.com:1776", // Community
1
0.090909
0
1
7b935b23e17ef873a060fdfbefbfdf232fe8b8de
git_release/release.py
git_release/release.py
import subprocess from git_release import errors, git_helpers def _parse_tag(tag): major, minor = tag.split('.') return int(major), int(minor) def _increment_tag(tag, release_type): major, minor = _parse_tag(tag) if release_type == 'major': new_major = major + 1 new_minor = 0 else: new_major = major new_minor = minor + 1 return '{}.{}'.format(new_major, new_minor) def release(release_type, signed): if not git_helpers.is_master(): raise errors.NotMasterException("Current branch is not master.\nAborting.") tag = git_helpers.get_current_tag() if not tag: raise errors.NoTagException("Unable to get current tag.\nAborting.") new_tag = _increment_tag(tag) git_helpers.tag(signed, new_tag)
import subprocess from git_release import errors, git_helpers def _parse_tag(tag): major, minor = tag.split('.') return int(major), int(minor) def _increment_tag(tag, release_type): major, minor = _parse_tag(tag) if release_type == 'major': new_major = major + 1 new_minor = 0 else: new_major = major new_minor = minor + 1 return '{}.{}'.format(new_major, new_minor) def release(release_type, signed): if not git_helpers.is_master(): raise errors.NotMasterException("Current branch is not master.\nAborting.") tag = git_helpers.get_current_tag() if not tag: raise errors.NoTagException("Unable to get current tag.\nAborting.") new_tag = _increment_tag(tag, release_type) git_helpers.tag(signed, new_tag)
Add missing argument to _increment_tag call
Add missing argument to _increment_tag call
Python
mit
Authentise/git-release
python
## Code Before: import subprocess from git_release import errors, git_helpers def _parse_tag(tag): major, minor = tag.split('.') return int(major), int(minor) def _increment_tag(tag, release_type): major, minor = _parse_tag(tag) if release_type == 'major': new_major = major + 1 new_minor = 0 else: new_major = major new_minor = minor + 1 return '{}.{}'.format(new_major, new_minor) def release(release_type, signed): if not git_helpers.is_master(): raise errors.NotMasterException("Current branch is not master.\nAborting.") tag = git_helpers.get_current_tag() if not tag: raise errors.NoTagException("Unable to get current tag.\nAborting.") new_tag = _increment_tag(tag) git_helpers.tag(signed, new_tag) ## Instruction: Add missing argument to _increment_tag call ## Code After: import subprocess from git_release import errors, git_helpers def _parse_tag(tag): major, minor = tag.split('.') return int(major), int(minor) def _increment_tag(tag, release_type): major, minor = _parse_tag(tag) if release_type == 'major': new_major = major + 1 new_minor = 0 else: new_major = major new_minor = minor + 1 return '{}.{}'.format(new_major, new_minor) def release(release_type, signed): if not git_helpers.is_master(): raise errors.NotMasterException("Current branch is not master.\nAborting.") tag = git_helpers.get_current_tag() if not tag: raise errors.NoTagException("Unable to get current tag.\nAborting.") new_tag = _increment_tag(tag, release_type) git_helpers.tag(signed, new_tag)
import subprocess from git_release import errors, git_helpers def _parse_tag(tag): major, minor = tag.split('.') return int(major), int(minor) def _increment_tag(tag, release_type): major, minor = _parse_tag(tag) if release_type == 'major': new_major = major + 1 new_minor = 0 else: new_major = major new_minor = minor + 1 return '{}.{}'.format(new_major, new_minor) def release(release_type, signed): if not git_helpers.is_master(): raise errors.NotMasterException("Current branch is not master.\nAborting.") tag = git_helpers.get_current_tag() if not tag: raise errors.NoTagException("Unable to get current tag.\nAborting.") - new_tag = _increment_tag(tag) + new_tag = _increment_tag(tag, release_type) ? ++++++++++++++ git_helpers.tag(signed, new_tag)
2
0.068966
1
1
0b603285b246e6ede33478ee2c11fe81adeaaae7
jersey/src/main/java/com/example/Contact.java
jersey/src/main/java/com/example/Contact.java
package com.example; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Contact { public Integer id; public String email; public String firstName; public String lastName; public String middleName; public String dateOfBirth; public Integer sex; public Contact() { this.id = null; this.email = null; this.firstName = null; this.lastName = null; this.middleName = null; this.dateOfBirth = null; this.sex = null; } public Contact( Integer id, String email, String firstName, String lastName, String middleName, String dateOfBirth, Integer sex ) { this.id = id; this.email = email; this.firstName = firstName; this.lastName = lastName; this.middleName = middleName; this.dateOfBirth = dateOfBirth; this.sex = sex; } }
package com.example; import java.util.ArrayList; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Contact { public Integer id; public String email; public String firstName; public String lastName; public String middleName; public String dateOfBirth; public Integer sex; public ArrayList<Profile> profiles; public Contact() { this.id = null; this.email = null; this.firstName = null; this.lastName = null; this.middleName = null; this.dateOfBirth = null; this.sex = null; this.profiles = null; } public Contact( Integer id, String email, String firstName, String lastName, String middleName, String dateOfBirth, Integer sex ) { this.id = id; this.email = email; this.firstName = firstName; this.lastName = lastName; this.middleName = middleName; this.dateOfBirth = dateOfBirth; this.sex = sex; this.profiles = null; } }
Make profiles list null by default
Make profiles list null by default
Java
mit
konjoot/benches,konjoot/benches,konjoot/benches
java
## Code Before: package com.example; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Contact { public Integer id; public String email; public String firstName; public String lastName; public String middleName; public String dateOfBirth; public Integer sex; public Contact() { this.id = null; this.email = null; this.firstName = null; this.lastName = null; this.middleName = null; this.dateOfBirth = null; this.sex = null; } public Contact( Integer id, String email, String firstName, String lastName, String middleName, String dateOfBirth, Integer sex ) { this.id = id; this.email = email; this.firstName = firstName; this.lastName = lastName; this.middleName = middleName; this.dateOfBirth = dateOfBirth; this.sex = sex; } } ## Instruction: Make profiles list null by default ## Code After: package com.example; import java.util.ArrayList; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Contact { public Integer id; public String email; public String firstName; public String lastName; public String middleName; public String dateOfBirth; public Integer sex; public ArrayList<Profile> profiles; public Contact() { this.id = null; this.email = null; this.firstName = null; this.lastName = null; this.middleName = null; this.dateOfBirth = null; this.sex = null; this.profiles = null; } public Contact( Integer id, String email, String firstName, String lastName, String middleName, String dateOfBirth, Integer sex ) { this.id = id; this.email = email; this.firstName = firstName; this.lastName = lastName; this.middleName = middleName; this.dateOfBirth = dateOfBirth; this.sex = sex; this.profiles = null; } }
package com.example; + import java.util.ArrayList; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Contact { public Integer id; public String email; public String firstName; public String lastName; public String middleName; public String dateOfBirth; public Integer sex; + public ArrayList<Profile> profiles; public Contact() { this.id = null; this.email = null; this.firstName = null; this.lastName = null; this.middleName = null; this.dateOfBirth = null; this.sex = null; + this.profiles = null; } public Contact( Integer id, String email, String firstName, String lastName, String middleName, String dateOfBirth, Integer sex ) { this.id = id; this.email = email; this.firstName = firstName; this.lastName = lastName; this.middleName = middleName; this.dateOfBirth = dateOfBirth; this.sex = sex; + this.profiles = null; } }
4
0.095238
4
0
3c5bd3cedd3d5043725625b3f5b180c43eb9e5b3
src/main/java/com/gmail/nossr50/runnables/MobHealthDisplayUpdaterTask.java
src/main/java/com/gmail/nossr50/runnables/MobHealthDisplayUpdaterTask.java
package com.gmail.nossr50.runnables; import org.bukkit.entity.LivingEntity; import org.bukkit.scheduler.BukkitRunnable; import com.gmail.nossr50.mcMMO; public class MobHealthDisplayUpdaterTask extends BukkitRunnable { private LivingEntity target; private String oldName; private boolean oldNameVisible; public MobHealthDisplayUpdaterTask(LivingEntity target) { if (target.isValid()) { this.target = target; this.oldName = target.getMetadata(mcMMO.customNameKey).get(0).asString(); this.oldNameVisible = target.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean(); } } @Override public void run() { if (target.isValid()) { target.setCustomNameVisible(oldNameVisible); target.setCustomName(oldName); target.removeMetadata(mcMMO.customNameKey, mcMMO.p); target.removeMetadata(mcMMO.customVisibleKey, mcMMO.p); } } }
package com.gmail.nossr50.runnables; import org.bukkit.entity.LivingEntity; import org.bukkit.scheduler.BukkitRunnable; import com.gmail.nossr50.mcMMO; public class MobHealthDisplayUpdaterTask extends BukkitRunnable { private LivingEntity target; private String oldName; private boolean oldNameVisible; public MobHealthDisplayUpdaterTask(LivingEntity target) { if (target.isValid()) { this.target = target; this.oldName = target.getMetadata(mcMMO.customNameKey).get(0).asString(); this.oldNameVisible = target.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean(); } } @Override public void run() { if (target != null && target.isValid()) { target.setCustomNameVisible(oldNameVisible); target.setCustomName(oldName); target.removeMetadata(mcMMO.customNameKey, mcMMO.p); target.removeMetadata(mcMMO.customVisibleKey, mcMMO.p); } } }
Fix a NPE in MobHealthDisplayUpdateTask
Fix a NPE in MobHealthDisplayUpdateTask Band aid for broken isValid() function. Fixes #1396
Java
agpl-3.0
jhonMalcom79/mcMMO_pers,isokissa3/mcMMO,virustotalop/mcMMO,EvilOlaf/mcMMO,Maximvdw/mcMMO
java
## Code Before: package com.gmail.nossr50.runnables; import org.bukkit.entity.LivingEntity; import org.bukkit.scheduler.BukkitRunnable; import com.gmail.nossr50.mcMMO; public class MobHealthDisplayUpdaterTask extends BukkitRunnable { private LivingEntity target; private String oldName; private boolean oldNameVisible; public MobHealthDisplayUpdaterTask(LivingEntity target) { if (target.isValid()) { this.target = target; this.oldName = target.getMetadata(mcMMO.customNameKey).get(0).asString(); this.oldNameVisible = target.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean(); } } @Override public void run() { if (target.isValid()) { target.setCustomNameVisible(oldNameVisible); target.setCustomName(oldName); target.removeMetadata(mcMMO.customNameKey, mcMMO.p); target.removeMetadata(mcMMO.customVisibleKey, mcMMO.p); } } } ## Instruction: Fix a NPE in MobHealthDisplayUpdateTask Band aid for broken isValid() function. Fixes #1396 ## Code After: package com.gmail.nossr50.runnables; import org.bukkit.entity.LivingEntity; import org.bukkit.scheduler.BukkitRunnable; import com.gmail.nossr50.mcMMO; public class MobHealthDisplayUpdaterTask extends BukkitRunnable { private LivingEntity target; private String oldName; private boolean oldNameVisible; public MobHealthDisplayUpdaterTask(LivingEntity target) { if (target.isValid()) { this.target = target; this.oldName = target.getMetadata(mcMMO.customNameKey).get(0).asString(); this.oldNameVisible = target.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean(); } } @Override public void run() { if (target != null && target.isValid()) { target.setCustomNameVisible(oldNameVisible); target.setCustomName(oldName); target.removeMetadata(mcMMO.customNameKey, mcMMO.p); target.removeMetadata(mcMMO.customVisibleKey, mcMMO.p); } } }
package com.gmail.nossr50.runnables; import org.bukkit.entity.LivingEntity; import org.bukkit.scheduler.BukkitRunnable; import com.gmail.nossr50.mcMMO; public class MobHealthDisplayUpdaterTask extends BukkitRunnable { private LivingEntity target; private String oldName; private boolean oldNameVisible; public MobHealthDisplayUpdaterTask(LivingEntity target) { if (target.isValid()) { this.target = target; this.oldName = target.getMetadata(mcMMO.customNameKey).get(0).asString(); this.oldNameVisible = target.getMetadata(mcMMO.customVisibleKey).get(0).asBoolean(); } } @Override public void run() { - if (target.isValid()) { + if (target != null && target.isValid()) { ? ++++++++++++++++++ target.setCustomNameVisible(oldNameVisible); target.setCustomName(oldName); target.removeMetadata(mcMMO.customNameKey, mcMMO.p); target.removeMetadata(mcMMO.customVisibleKey, mcMMO.p); } } }
2
0.066667
1
1
90963666f22bea81d433724d232deaa0f3e2fec1
st2common/st2common/exceptions/db.py
st2common/st2common/exceptions/db.py
from st2common.exceptions import StackStormBaseException class StackStormDBObjectNotFoundError(StackStormBaseException): pass class StackStormDBObjectMalformedError(StackStormBaseException): pass
from st2common.exceptions import StackStormBaseException class StackStormDBObjectNotFoundError(StackStormBaseException): pass class StackStormDBObjectMalformedError(StackStormBaseException): pass class StackStormDBObjectConflictError(StackStormBaseException): """ Exception that captures a DB object conflict error. """ def __init__(self, message, conflict_id): super(StackStormDBObjectConflictError, self).__init__(message) self.conflict_id = conflict_id
Add a special exception for capturing object conflicts.
Add a special exception for capturing object conflicts.
Python
apache-2.0
jtopjian/st2,StackStorm/st2,StackStorm/st2,emedvedev/st2,dennybaa/st2,StackStorm/st2,alfasin/st2,pixelrebel/st2,nzlosh/st2,Itxaka/st2,StackStorm/st2,dennybaa/st2,punalpatel/st2,Plexxi/st2,lakshmi-kannan/st2,lakshmi-kannan/st2,grengojbo/st2,Itxaka/st2,jtopjian/st2,alfasin/st2,punalpatel/st2,peak6/st2,tonybaloney/st2,pinterb/st2,lakshmi-kannan/st2,tonybaloney/st2,Plexxi/st2,punalpatel/st2,emedvedev/st2,tonybaloney/st2,emedvedev/st2,alfasin/st2,Plexxi/st2,peak6/st2,Plexxi/st2,armab/st2,pinterb/st2,dennybaa/st2,nzlosh/st2,nzlosh/st2,Itxaka/st2,jtopjian/st2,pixelrebel/st2,armab/st2,peak6/st2,pixelrebel/st2,pinterb/st2,nzlosh/st2,grengojbo/st2,grengojbo/st2,armab/st2
python
## Code Before: from st2common.exceptions import StackStormBaseException class StackStormDBObjectNotFoundError(StackStormBaseException): pass class StackStormDBObjectMalformedError(StackStormBaseException): pass ## Instruction: Add a special exception for capturing object conflicts. ## Code After: from st2common.exceptions import StackStormBaseException class StackStormDBObjectNotFoundError(StackStormBaseException): pass class StackStormDBObjectMalformedError(StackStormBaseException): pass class StackStormDBObjectConflictError(StackStormBaseException): """ Exception that captures a DB object conflict error. """ def __init__(self, message, conflict_id): super(StackStormDBObjectConflictError, self).__init__(message) self.conflict_id = conflict_id
from st2common.exceptions import StackStormBaseException class StackStormDBObjectNotFoundError(StackStormBaseException): pass class StackStormDBObjectMalformedError(StackStormBaseException): pass + + + class StackStormDBObjectConflictError(StackStormBaseException): + """ + Exception that captures a DB object conflict error. + """ + def __init__(self, message, conflict_id): + super(StackStormDBObjectConflictError, self).__init__(message) + self.conflict_id = conflict_id
9
0.9
9
0
e7ec067b6b5e28747c13a5a69703b597b143e4ab
pkgs/tools/package-management/nix-update-source/default.nix
pkgs/tools/package-management/nix-update-source/default.nix
{ lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts }: python3Packages.buildPythonApplication rec { version = "0.2.2"; name = "nix-update-source-${version}"; src = fetchFromGitHub { owner = "timbertson"; repo = "nix-update-source"; rev = "version-${version}"; sha256 = "0liigkr37ib2xy269bcp53ivpir4mpg6lzwnfrsqc4kbkz3l16gg"; }; propagatedBuildInputs = [ nix-prefetch-scripts ]; passthru = { fetch = path: let fetchers = { # whitelist of allowed fetchers inherit (pkgs) fetchgit fetchurl fetchFromGitHub; }; json = lib.importJSON path; fetchFn = builtins.getAttr json.fetch.fn fetchers; src = fetchFn json.fetch.args; in json // json.fetch // { inherit src; }; }; meta = { description = "Utility to autimate updating of nix derivation sources"; maintainers = with lib.maintainers; [ timbertson ]; }; }
{ lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts }: python3Packages.buildPythonApplication rec { version = "0.2.1"; name = "nix-update-source-${version}"; src = fetchFromGitHub { owner = "timbertson"; repo = "nix-update-source"; rev = "version-${version}"; sha256 = "1w3aj0kjp8zhxkzqxnm5srrsqsvrmxhn4sqkr4kjffh61jg8jq8a"; }; propagatedBuildInputs = [ nix-prefetch-scripts ]; passthru = { fetch = path: let fetchers = { # whitelist of allowed fetchers inherit (pkgs) fetchgit fetchurl fetchFromGitHub; }; json = lib.importJSON path; fetchFn = builtins.getAttr json.fetch.fn fetchers; src = fetchFn json.fetch.args; in json // { inherit src; }; }; meta = { description = "Utility to autimate updating of nix derivation sources"; maintainers = with lib.maintainers; [ timbertson ]; }; }
Revert "nix-update-source: 0.2.1 -> 0.2.2"
Revert "nix-update-source: 0.2.1 -> 0.2.2" This reverts commit b984d5d25f3c5f4d8c700f3c5e0b41bd48cfcb79.
Nix
mit
SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs
nix
## Code Before: { lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts }: python3Packages.buildPythonApplication rec { version = "0.2.2"; name = "nix-update-source-${version}"; src = fetchFromGitHub { owner = "timbertson"; repo = "nix-update-source"; rev = "version-${version}"; sha256 = "0liigkr37ib2xy269bcp53ivpir4mpg6lzwnfrsqc4kbkz3l16gg"; }; propagatedBuildInputs = [ nix-prefetch-scripts ]; passthru = { fetch = path: let fetchers = { # whitelist of allowed fetchers inherit (pkgs) fetchgit fetchurl fetchFromGitHub; }; json = lib.importJSON path; fetchFn = builtins.getAttr json.fetch.fn fetchers; src = fetchFn json.fetch.args; in json // json.fetch // { inherit src; }; }; meta = { description = "Utility to autimate updating of nix derivation sources"; maintainers = with lib.maintainers; [ timbertson ]; }; } ## Instruction: Revert "nix-update-source: 0.2.1 -> 0.2.2" This reverts commit b984d5d25f3c5f4d8c700f3c5e0b41bd48cfcb79. ## Code After: { lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts }: python3Packages.buildPythonApplication rec { version = "0.2.1"; name = "nix-update-source-${version}"; src = fetchFromGitHub { owner = "timbertson"; repo = "nix-update-source"; rev = "version-${version}"; sha256 = "1w3aj0kjp8zhxkzqxnm5srrsqsvrmxhn4sqkr4kjffh61jg8jq8a"; }; propagatedBuildInputs = [ nix-prefetch-scripts ]; passthru = { fetch = path: let fetchers = { # whitelist of allowed fetchers inherit (pkgs) fetchgit fetchurl fetchFromGitHub; }; json = lib.importJSON path; fetchFn = builtins.getAttr json.fetch.fn fetchers; src = fetchFn json.fetch.args; in json // { inherit src; }; }; meta = { description = "Utility to autimate updating of nix derivation sources"; maintainers = with lib.maintainers; [ timbertson ]; }; }
{ lib, pkgs, fetchFromGitHub, python3Packages, nix-prefetch-scripts }: python3Packages.buildPythonApplication rec { - version = "0.2.2"; ? ^ + version = "0.2.1"; ? ^ name = "nix-update-source-${version}"; src = fetchFromGitHub { owner = "timbertson"; repo = "nix-update-source"; rev = "version-${version}"; - sha256 = "0liigkr37ib2xy269bcp53ivpir4mpg6lzwnfrsqc4kbkz3l16gg"; + sha256 = "1w3aj0kjp8zhxkzqxnm5srrsqsvrmxhn4sqkr4kjffh61jg8jq8a"; }; propagatedBuildInputs = [ nix-prefetch-scripts ]; passthru = { fetch = path: let fetchers = { # whitelist of allowed fetchers inherit (pkgs) fetchgit fetchurl fetchFromGitHub; }; json = lib.importJSON path; fetchFn = builtins.getAttr json.fetch.fn fetchers; src = fetchFn json.fetch.args; in - json // json.fetch // { inherit src; }; ? -------------- + json // { inherit src; }; }; meta = { description = "Utility to autimate updating of nix derivation sources"; maintainers = with lib.maintainers; [ timbertson ]; }; }
6
0.206897
3
3
4fc109c93daa3a5d39a184cd692ac7c6b19b9fab
simpleflow/swf/process/worker/dispatch/dynamic_dispatcher.py
simpleflow/swf/process/worker/dispatch/dynamic_dispatcher.py
import importlib from simpleflow.activity import Activity from .exceptions import DispatchError class Dispatcher(object): """ Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher but without a hierarchy. """ @staticmethod def dispatch_activity(name): """ :param name: :type name: str :return: :rtype: Activity :raise DispatchError: if doesn't exist or not an activity """ module_name, activity_name = name.rsplit('.', 1) module = importlib.import_module(module_name) activity = getattr(module, activity_name, None) if not activity: raise DispatchError("unable to import '{}'".format(name)) if not isinstance(activity, Activity): activity = Activity(activity, activity_name) return activity
import importlib from simpleflow.activity import Activity from .exceptions import DispatchError class Dispatcher(object): """ Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher but without a hierarchy. """ @staticmethod def dispatch_activity(name): """ :param name: :type name: str :return: :rtype: Activity :raise DispatchError: if doesn't exist or not an activity """ module_name, activity_name = name.rsplit('.', 1) module = importlib.import_module(module_name) activity = getattr(module, activity_name, None) if not activity: # We were not able to import a function at all. raise DispatchError("unable to import '{}'".format(name)) if not isinstance(activity, Activity): # We managed to import a function (or callable) but it's not an # "Activity". We will transform it into an Activity now. That way # we can accept functions that are *not* decorated with # "@activity.with_attributes()" or equivalent. This dispatcher is # used in the context of an activity worker, so we don't actually # care if the task is decorated or not. We only need the decorated # function for the decider (options to schedule, retry, fail, etc.). activity = Activity(activity, activity_name) return activity
Add comment to explain the choice in dynamic dispatcher
Add comment to explain the choice in dynamic dispatcher
Python
mit
botify-labs/simpleflow,botify-labs/simpleflow
python
## Code Before: import importlib from simpleflow.activity import Activity from .exceptions import DispatchError class Dispatcher(object): """ Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher but without a hierarchy. """ @staticmethod def dispatch_activity(name): """ :param name: :type name: str :return: :rtype: Activity :raise DispatchError: if doesn't exist or not an activity """ module_name, activity_name = name.rsplit('.', 1) module = importlib.import_module(module_name) activity = getattr(module, activity_name, None) if not activity: raise DispatchError("unable to import '{}'".format(name)) if not isinstance(activity, Activity): activity = Activity(activity, activity_name) return activity ## Instruction: Add comment to explain the choice in dynamic dispatcher ## Code After: import importlib from simpleflow.activity import Activity from .exceptions import DispatchError class Dispatcher(object): """ Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher but without a hierarchy. """ @staticmethod def dispatch_activity(name): """ :param name: :type name: str :return: :rtype: Activity :raise DispatchError: if doesn't exist or not an activity """ module_name, activity_name = name.rsplit('.', 1) module = importlib.import_module(module_name) activity = getattr(module, activity_name, None) if not activity: # We were not able to import a function at all. raise DispatchError("unable to import '{}'".format(name)) if not isinstance(activity, Activity): # We managed to import a function (or callable) but it's not an # "Activity". We will transform it into an Activity now. That way # we can accept functions that are *not* decorated with # "@activity.with_attributes()" or equivalent. This dispatcher is # used in the context of an activity worker, so we don't actually # care if the task is decorated or not. We only need the decorated # function for the decider (options to schedule, retry, fail, etc.). activity = Activity(activity, activity_name) return activity
import importlib from simpleflow.activity import Activity from .exceptions import DispatchError class Dispatcher(object): """ Dispatch by name, like simpleflow.swf.process.worker.dispatch.by_module.ModuleDispatcher but without a hierarchy. """ @staticmethod def dispatch_activity(name): """ :param name: :type name: str :return: :rtype: Activity :raise DispatchError: if doesn't exist or not an activity """ module_name, activity_name = name.rsplit('.', 1) module = importlib.import_module(module_name) activity = getattr(module, activity_name, None) if not activity: + # We were not able to import a function at all. raise DispatchError("unable to import '{}'".format(name)) if not isinstance(activity, Activity): + # We managed to import a function (or callable) but it's not an + # "Activity". We will transform it into an Activity now. That way + # we can accept functions that are *not* decorated with + # "@activity.with_attributes()" or equivalent. This dispatcher is + # used in the context of an activity worker, so we don't actually + # care if the task is decorated or not. We only need the decorated + # function for the decider (options to schedule, retry, fail, etc.). activity = Activity(activity, activity_name) return activity
8
0.266667
8
0
8127c6cf30e3b1410b8194773a07fdfb89435cee
gwt-ol3-client/src/test/java/ol/geom/GeometryCollectionTest.java
gwt-ol3-client/src/test/java/ol/geom/GeometryCollectionTest.java
package ol.geom; import ol.*; /** * A test case for {@link GeometryCollection}. * * @author sbaumhekel */ public class GeometryCollectionTest extends BaseTestCase { public void test() { Geometry[] geoms = new Geometry[] { OLFactory.createPoint(1, 2), OLFactory.createLineString( new Coordinate[] { OLFactory.createCoordinate(1, 2), OLFactory.createCoordinate(2, 3) }) }; GeometryCollection col = OLFactory.createGeometryCollection(geoms); assertNotNull(col); Geometry[] geoms2 = col.getGeometries(); assertNotNull(geoms2); assertEquals(2, geoms2.length); Geometry g1 = geoms2[0]; Geometry g2 = geoms2[1]; assertNotNull(g1); assertNotNull(g2); assertEquals(Geometry.POINT, g1.getType()); assertEquals(Geometry.LINE_STRING, g2.getType()); } }
package ol.geom; import ol.Coordinate; import ol.GwtOL3BaseTestCase; import ol.OLFactory; /** * A test case for {@link GeometryCollection}. * * @author sbaumhekel */ public class GeometryCollectionTest extends GwtOL3BaseTestCase { public void test() { Geometry[] geoms = new Geometry[] { OLFactory.createPoint(1, 2), OLFactory.createLineString( new Coordinate[] { OLFactory.createCoordinate(1, 2), OLFactory.createCoordinate(2, 3) }) }; GeometryCollection col = OLFactory.createGeometryCollection(geoms); assertNotNull(col); Geometry[] geoms2 = col.getGeometries(); assertNotNull(geoms2); assertEquals(2, geoms2.length); Geometry g1 = geoms2[0]; Geometry g2 = geoms2[1]; assertNotNull(g1); assertNotNull(g2); assertEquals("Point", g1.getType()); assertEquals("LineString", g2.getType()); } }
Update test for GWT 2.8
Update test for GWT 2.8
Java
apache-2.0
sebasbaumh/gwt-ol3,sebasbaumh/gwt-ol3,mazlixek/gwt-ol3,TDesjardins/gwt-ol3,mazlixek/gwt-ol3,TDesjardins/GWT-OL3-Playground,TDesjardins/gwt-ol3,TDesjardins/gwt-ol3,TDesjardins/GWT-OL3-Playground,sebasbaumh/gwt-ol3,TDesjardins/GWT-OL3-Playground,mazlixek/gwt-ol3
java
## Code Before: package ol.geom; import ol.*; /** * A test case for {@link GeometryCollection}. * * @author sbaumhekel */ public class GeometryCollectionTest extends BaseTestCase { public void test() { Geometry[] geoms = new Geometry[] { OLFactory.createPoint(1, 2), OLFactory.createLineString( new Coordinate[] { OLFactory.createCoordinate(1, 2), OLFactory.createCoordinate(2, 3) }) }; GeometryCollection col = OLFactory.createGeometryCollection(geoms); assertNotNull(col); Geometry[] geoms2 = col.getGeometries(); assertNotNull(geoms2); assertEquals(2, geoms2.length); Geometry g1 = geoms2[0]; Geometry g2 = geoms2[1]; assertNotNull(g1); assertNotNull(g2); assertEquals(Geometry.POINT, g1.getType()); assertEquals(Geometry.LINE_STRING, g2.getType()); } } ## Instruction: Update test for GWT 2.8 ## Code After: package ol.geom; import ol.Coordinate; import ol.GwtOL3BaseTestCase; import ol.OLFactory; /** * A test case for {@link GeometryCollection}. * * @author sbaumhekel */ public class GeometryCollectionTest extends GwtOL3BaseTestCase { public void test() { Geometry[] geoms = new Geometry[] { OLFactory.createPoint(1, 2), OLFactory.createLineString( new Coordinate[] { OLFactory.createCoordinate(1, 2), OLFactory.createCoordinate(2, 3) }) }; GeometryCollection col = OLFactory.createGeometryCollection(geoms); assertNotNull(col); Geometry[] geoms2 = col.getGeometries(); assertNotNull(geoms2); assertEquals(2, geoms2.length); Geometry g1 = geoms2[0]; Geometry g2 = geoms2[1]; assertNotNull(g1); assertNotNull(g2); assertEquals("Point", g1.getType()); assertEquals("LineString", g2.getType()); } }
package ol.geom; - import ol.*; + import ol.Coordinate; + import ol.GwtOL3BaseTestCase; + import ol.OLFactory; /** * A test case for {@link GeometryCollection}. - * ? - + * * @author sbaumhekel */ - public class GeometryCollectionTest extends BaseTestCase { + public class GeometryCollectionTest extends GwtOL3BaseTestCase { ? ++++++ public void test() { + - Geometry[] geoms = new Geometry[] { OLFactory.createPoint(1, 2), OLFactory.createLineString( ? ^ + Geometry[] geoms = new Geometry[] { OLFactory.createPoint(1, 2), OLFactory.createLineString( ? ^^^^^^^^ - new Coordinate[] { OLFactory.createCoordinate(1, 2), OLFactory.createCoordinate(2, 3) }) }; ? ^^ + new Coordinate[] { OLFactory.createCoordinate(1, 2), OLFactory.createCoordinate(2, 3) }) }; ? ^^^^^^^^^^^^^^^^ + - GeometryCollection col = OLFactory.createGeometryCollection(geoms); ? ^ + GeometryCollection col = OLFactory.createGeometryCollection(geoms); ? ^^^^^^^^ + - assertNotNull(col); ? ^ + assertNotNull(col); ? ^^^^^^^^ + - Geometry[] geoms2 = col.getGeometries(); ? ^ + Geometry[] geoms2 = col.getGeometries(); ? ^^^^^^^^ + - assertNotNull(geoms2); ? ^ + assertNotNull(geoms2); ? ^^^^^^^^ - assertEquals(2, geoms2.length); ? ^ + assertEquals(2, geoms2.length); ? ^^^^^^^^ + - Geometry g1 = geoms2[0]; ? ^ + Geometry g1 = geoms2[0]; ? ^^^^^^^^ - Geometry g2 = geoms2[1]; ? ^ + Geometry g2 = geoms2[1]; ? ^^^^^^^^ + - assertNotNull(g1); ? ^ + assertNotNull(g1); ? ^^^^^^^^ - assertNotNull(g2); ? ^ + assertNotNull(g2); ? ^^^^^^^^ - assertEquals(Geometry.POINT, g1.getType()); - assertEquals(Geometry.LINE_STRING, g2.getType()); + assertEquals("Point", g1.getType()); + assertEquals("LineString", g2.getType()); + } }
42
1.5
26
16
79a8dbcddb7b0065541eaabaf7c8ee718be26e80
lib/node_modules/@stdlib/utils/find/lib/index.js
lib/node_modules/@stdlib/utils/find/lib/index.js
'use strict'; /** * Find elements in an array-like object that satisfy a test condition. * * @module @stdlib/utils/find * * @example * var find = require( '@stdlib/utils/find' ); * * var data = [ 30, 20, 50, 60, 10 ]; * * function condition( val ) { * return val > 20; * } * * var vals = find( data, condition ); * // returns [ 0, 2, 3 ] * * data = [ 30, 20, 50, 60, 10 ]; * var opts = { * 'k': 2, * 'returns': 'values' * }; * vals = find( data, opts, condition ); * // returns [ 30, 50 ] */ // MODULES // var find = require( './find.js' ); // EXPORTS // module.exports = find;
'use strict'; /** * Find elements in an array-like object that satisfy a test condition. * * @module @stdlib/utils/find * * @example * var find = require( '@stdlib/utils/find' ); * * var data = [ 30, 20, 50, 60, 10 ]; * * function condition( val ) { * return val > 20; * } * * var vals = find( data, condition ); * // returns [ 0, 2, 3 ] * * data = [ 30, 20, 50, 60, 10 ]; * var opts = { * 'k': 2, * 'returns': 'values' * }; * vals = find( data, opts, condition ); * // returns [ 30, 50 ] */ // MODULES // var find = require( './find.js' ); // eslint-disable-line no-redeclare // EXPORTS // module.exports = find;
Disable no-redeclare for non-standard `find` identifier
Disable no-redeclare for non-standard `find` identifier
JavaScript
apache-2.0
stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib
javascript
## Code Before: 'use strict'; /** * Find elements in an array-like object that satisfy a test condition. * * @module @stdlib/utils/find * * @example * var find = require( '@stdlib/utils/find' ); * * var data = [ 30, 20, 50, 60, 10 ]; * * function condition( val ) { * return val > 20; * } * * var vals = find( data, condition ); * // returns [ 0, 2, 3 ] * * data = [ 30, 20, 50, 60, 10 ]; * var opts = { * 'k': 2, * 'returns': 'values' * }; * vals = find( data, opts, condition ); * // returns [ 30, 50 ] */ // MODULES // var find = require( './find.js' ); // EXPORTS // module.exports = find; ## Instruction: Disable no-redeclare for non-standard `find` identifier ## Code After: 'use strict'; /** * Find elements in an array-like object that satisfy a test condition. * * @module @stdlib/utils/find * * @example * var find = require( '@stdlib/utils/find' ); * * var data = [ 30, 20, 50, 60, 10 ]; * * function condition( val ) { * return val > 20; * } * * var vals = find( data, condition ); * // returns [ 0, 2, 3 ] * * data = [ 30, 20, 50, 60, 10 ]; * var opts = { * 'k': 2, * 'returns': 'values' * }; * vals = find( data, opts, condition ); * // returns [ 30, 50 ] */ // MODULES // var find = require( './find.js' ); // eslint-disable-line no-redeclare // EXPORTS // module.exports = find;
'use strict'; /** * Find elements in an array-like object that satisfy a test condition. * * @module @stdlib/utils/find * * @example * var find = require( '@stdlib/utils/find' ); * * var data = [ 30, 20, 50, 60, 10 ]; * * function condition( val ) { * return val > 20; * } * * var vals = find( data, condition ); * // returns [ 0, 2, 3 ] * * data = [ 30, 20, 50, 60, 10 ]; * var opts = { * 'k': 2, * 'returns': 'values' * }; * vals = find( data, opts, condition ); * // returns [ 30, 50 ] */ // MODULES // - var find = require( './find.js' ); + var find = require( './find.js' ); // eslint-disable-line no-redeclare // EXPORTS // module.exports = find;
2
0.055556
1
1
0925cc0d096093ba5c0342c9f79731f1a5674496
lib/javascripts/views/task-panes.js.jsx
lib/javascripts/views/task-panes.js.jsx
/** @jsx React.DOM */ //= require ./tasks-pane (function () { "use strict"; Nike.Views.TaskPanes = React.createClass({ displayName: "Nike.Views.TaskPanes", render: function () { return ( <section className="tasks-panes"> {this.props.taskPaneTasks.map(function (tasks, paneIndex) { return ( <Nike.Views.TasksPane key={paneIndex} index={paneIndex} parentTaskId={this.props.taskIds[paneIndex-1]} selectedTaskId={this.props.taskIds[paneIndex]} tasks={tasks} /> ); }, this)} <section className="h-spacer">&nbsp;</section> </section> ); }, componentDidMount: function () { var el = this.getDOMNode(); var width = el.scrollWidth; this.__minWidth = width; el.style.minWidth = width + "px"; }, componentDidUpdate: function () { var el = this.getDOMNode(); var scrollX = window.scrollX; var scrollY = window.scrollY; el.style.minWidth = null; var width = el.scrollWidth + scrollX; el.style.minWidth = width + "px"; window.scrollTo(scrollX, scrollY); } }); })();
/** @jsx React.DOM */ //= require ./tasks-pane (function () { "use strict"; Nike.Views.TaskPanes = React.createClass({ displayName: "Nike.Views.TaskPanes", render: function () { return ( <section className="tasks-panes"> {this.props.taskPaneTasks.map(function (tasks, paneIndex) { return ( <Nike.Views.TasksPane key={paneIndex} index={paneIndex} parentTaskId={this.props.taskIds[paneIndex-1]} selectedTaskId={this.props.taskIds[paneIndex]} tasks={tasks} /> ); }, this)} <section className="h-spacer">&nbsp;</section> </section> ); }, componentDidMount: function () { var el = this.getDOMNode(); var width = el.scrollWidth; this.__minWidth = width; el.style.minWidth = width + "px"; }, componentDidUpdate: function () { var el = this.getDOMNode(); var scrollX = window.scrollX; var scrollY = window.scrollY; el.style.minWidth = null; var scrollWidth = el.scrollWidth; var width; if (scrollWidth < this.__minWidth) { width = scrollWidth + scrollX; } else { width = scrollWidth; } this.__minWidth = width; el.style.minWidth = width + "px"; window.scrollTo(scrollX, scrollY); } }); })();
Fix infinite adding of scroll area
Fix infinite adding of scroll area
JSX
bsd-3-clause
cupcake/nike,cupcake/nike
jsx
## Code Before: /** @jsx React.DOM */ //= require ./tasks-pane (function () { "use strict"; Nike.Views.TaskPanes = React.createClass({ displayName: "Nike.Views.TaskPanes", render: function () { return ( <section className="tasks-panes"> {this.props.taskPaneTasks.map(function (tasks, paneIndex) { return ( <Nike.Views.TasksPane key={paneIndex} index={paneIndex} parentTaskId={this.props.taskIds[paneIndex-1]} selectedTaskId={this.props.taskIds[paneIndex]} tasks={tasks} /> ); }, this)} <section className="h-spacer">&nbsp;</section> </section> ); }, componentDidMount: function () { var el = this.getDOMNode(); var width = el.scrollWidth; this.__minWidth = width; el.style.minWidth = width + "px"; }, componentDidUpdate: function () { var el = this.getDOMNode(); var scrollX = window.scrollX; var scrollY = window.scrollY; el.style.minWidth = null; var width = el.scrollWidth + scrollX; el.style.minWidth = width + "px"; window.scrollTo(scrollX, scrollY); } }); })(); ## Instruction: Fix infinite adding of scroll area ## Code After: /** @jsx React.DOM */ //= require ./tasks-pane (function () { "use strict"; Nike.Views.TaskPanes = React.createClass({ displayName: "Nike.Views.TaskPanes", render: function () { return ( <section className="tasks-panes"> {this.props.taskPaneTasks.map(function (tasks, paneIndex) { return ( <Nike.Views.TasksPane key={paneIndex} index={paneIndex} parentTaskId={this.props.taskIds[paneIndex-1]} selectedTaskId={this.props.taskIds[paneIndex]} tasks={tasks} /> ); }, this)} <section className="h-spacer">&nbsp;</section> </section> ); }, componentDidMount: function () { var el = this.getDOMNode(); var width = el.scrollWidth; this.__minWidth = width; el.style.minWidth = width + "px"; }, componentDidUpdate: function () { var el = this.getDOMNode(); var scrollX = window.scrollX; var scrollY = window.scrollY; el.style.minWidth = null; var scrollWidth = el.scrollWidth; var width; if (scrollWidth < this.__minWidth) { width = scrollWidth + scrollX; } else { width = scrollWidth; } this.__minWidth = width; el.style.minWidth = width + "px"; window.scrollTo(scrollX, scrollY); } }); })();
/** @jsx React.DOM */ //= require ./tasks-pane (function () { "use strict"; Nike.Views.TaskPanes = React.createClass({ displayName: "Nike.Views.TaskPanes", render: function () { return ( <section className="tasks-panes"> {this.props.taskPaneTasks.map(function (tasks, paneIndex) { return ( <Nike.Views.TasksPane key={paneIndex} index={paneIndex} parentTaskId={this.props.taskIds[paneIndex-1]} selectedTaskId={this.props.taskIds[paneIndex]} tasks={tasks} /> ); }, this)} <section className="h-spacer">&nbsp;</section> </section> ); }, componentDidMount: function () { var el = this.getDOMNode(); var width = el.scrollWidth; this.__minWidth = width; el.style.minWidth = width + "px"; }, componentDidUpdate: function () { var el = this.getDOMNode(); var scrollX = window.scrollX; var scrollY = window.scrollY; el.style.minWidth = null; + var scrollWidth = el.scrollWidth; + var width; + if (scrollWidth < this.__minWidth) { - var width = el.scrollWidth + scrollX; ? ^^^^ --- + width = scrollWidth + scrollX; ? ^ + } else { + width = scrollWidth; + } + this.__minWidth = width; el.style.minWidth = width + "px"; window.scrollTo(scrollX, scrollY); } }); })();
9
0.191489
8
1
32f7ef7c1ee4cd252a382be5f1d7d990f7940192
server/server.go
server/server.go
package server import ( "fmt" "html/template" "net/http" "net/url" ) func RootHandler(w http.ResponseWriter, r *http.Request, processes []*Process) { tmpl, err := template.ParseFiles("templates/root.html") if err != nil { fmt.Printf("Error parsing template") } if err := tmpl.Execute(w, processes); err != nil { fmt.Printf(err.Error()) panic(err) } } func ElectionHandler(w http.ResponseWriter, r *http.Request, processes []*Process) { processes[1].God <- &Force{Election: &True} fmt.Fprintf(w, "Forcing an election") } func LagHandler(w http.ResponseWriter, r *http.Request) { if _, err := template.ParseFiles("templates/lag.html"); err != nil { http.Error(w, "Error parsing lag template", http.StatusInternalServerError) } else { if err := r.ParseForm(); err != nil { http.Error(w, "Error parsing lag", http.StatusInternalServerError) return } lag, err := getFormValues(&r.Form) if err != nil { http.Error(w, "Unable to get form values", http.StatusInternalServerError) } // t.Execute(w, userInput) fmt.Fprintf(w, "Adding %s lag", lag) } } func getFormValues(form *url.Values) (lag string, err error) { for key, value := range *form { switch key { case "lag": return value[0], nil case "processId": return value[0], nil default: return "", fmt.Errorf("Unable to parse form") } } return "", fmt.Errorf("No form values") }
package server import ( "fmt" "html/template" "net/http" ) func RootHandler(w http.ResponseWriter, r *http.Request, processes []*Process) { tmpl, err := template.ParseFiles("templates/root.html") if err != nil { fmt.Printf("Error parsing template") } if err := tmpl.Execute(w, processes); err != nil { fmt.Printf(err.Error()) panic(err) } } func ElectionHandler(w http.ResponseWriter, r *http.Request, processes []*Process) { processes[1].God <- &Force{Election: &True} fmt.Fprintf(w, "Forcing an election") } func LagHandler(w http.ResponseWriter, r *http.Request) { if _, err := template.ParseFiles("templates/lag.html"); err != nil { http.Error(w, "Error parsing lag template", http.StatusInternalServerError) } else { if err := r.ParseForm(); err != nil { http.Error(w, "Error parsing lag", http.StatusInternalServerError) return } fmt.Fprintf(w, "Adding lag") } }
Remove form submission, simply add lag
Remove form submission, simply add lag
Go
unlicense
dgottlieb/consensus,dgottlieb/consensus
go
## Code Before: package server import ( "fmt" "html/template" "net/http" "net/url" ) func RootHandler(w http.ResponseWriter, r *http.Request, processes []*Process) { tmpl, err := template.ParseFiles("templates/root.html") if err != nil { fmt.Printf("Error parsing template") } if err := tmpl.Execute(w, processes); err != nil { fmt.Printf(err.Error()) panic(err) } } func ElectionHandler(w http.ResponseWriter, r *http.Request, processes []*Process) { processes[1].God <- &Force{Election: &True} fmt.Fprintf(w, "Forcing an election") } func LagHandler(w http.ResponseWriter, r *http.Request) { if _, err := template.ParseFiles("templates/lag.html"); err != nil { http.Error(w, "Error parsing lag template", http.StatusInternalServerError) } else { if err := r.ParseForm(); err != nil { http.Error(w, "Error parsing lag", http.StatusInternalServerError) return } lag, err := getFormValues(&r.Form) if err != nil { http.Error(w, "Unable to get form values", http.StatusInternalServerError) } // t.Execute(w, userInput) fmt.Fprintf(w, "Adding %s lag", lag) } } func getFormValues(form *url.Values) (lag string, err error) { for key, value := range *form { switch key { case "lag": return value[0], nil case "processId": return value[0], nil default: return "", fmt.Errorf("Unable to parse form") } } return "", fmt.Errorf("No form values") } ## Instruction: Remove form submission, simply add lag ## Code After: package server import ( "fmt" "html/template" "net/http" ) func RootHandler(w http.ResponseWriter, r *http.Request, processes []*Process) { tmpl, err := template.ParseFiles("templates/root.html") if err != nil { fmt.Printf("Error parsing template") } if err := tmpl.Execute(w, processes); err != nil { fmt.Printf(err.Error()) panic(err) } } func ElectionHandler(w http.ResponseWriter, r *http.Request, processes []*Process) { processes[1].God <- &Force{Election: &True} fmt.Fprintf(w, "Forcing an election") } func LagHandler(w http.ResponseWriter, r *http.Request) { if _, err := template.ParseFiles("templates/lag.html"); err != nil { http.Error(w, "Error parsing lag template", http.StatusInternalServerError) } else { if err := r.ParseForm(); err != nil { http.Error(w, "Error parsing lag", http.StatusInternalServerError) return } fmt.Fprintf(w, "Adding lag") } }
package server import ( "fmt" "html/template" "net/http" - "net/url" ) func RootHandler(w http.ResponseWriter, r *http.Request, processes []*Process) { tmpl, err := template.ParseFiles("templates/root.html") if err != nil { fmt.Printf("Error parsing template") } if err := tmpl.Execute(w, processes); err != nil { fmt.Printf(err.Error()) panic(err) } } func ElectionHandler(w http.ResponseWriter, r *http.Request, processes []*Process) { processes[1].God <- &Force{Election: &True} fmt.Fprintf(w, "Forcing an election") } func LagHandler(w http.ResponseWriter, r *http.Request) { if _, err := template.ParseFiles("templates/lag.html"); err != nil { http.Error(w, "Error parsing lag template", http.StatusInternalServerError) } else { if err := r.ParseForm(); err != nil { http.Error(w, "Error parsing lag", http.StatusInternalServerError) return } - lag, err := getFormValues(&r.Form) - if err != nil { - http.Error(w, "Unable to get form values", http.StatusInternalServerError) - } - // t.Execute(w, userInput) - fmt.Fprintf(w, "Adding %s lag", lag) ? --- ----- + fmt.Fprintf(w, "Adding lag") } } - - func getFormValues(form *url.Values) (lag string, err error) { - for key, value := range *form { - switch key { - case "lag": - return value[0], nil - case "processId": - return value[0], nil - default: - return "", fmt.Errorf("Unable to parse form") - } - } - return "", fmt.Errorf("No form values") - }
22
0.4
1
21
07575ede4e9cee6546f36eb3bb5de54d93d813f9
app/models/company.rb
app/models/company.rb
class Company < ApplicationRecord end
class Company < ApplicationRecord validates :name, presence: true end
Validate presence of Company name
Validate presence of Company name
Ruby
mit
nicoschuele/railsplay,nicoschuele/railsplay,nicoschuele/railsplay
ruby
## Code Before: class Company < ApplicationRecord end ## Instruction: Validate presence of Company name ## Code After: class Company < ApplicationRecord validates :name, presence: true end
class Company < ApplicationRecord + validates :name, presence: true end
1
0.333333
1
0
54674b79fecf7eec4f09e885e7d68c9b6181efcf
mollie/api/objects/base.py
mollie/api/objects/base.py
class Base(dict): def _get_property(self, name): """Return the named property from dictionary values.""" if not self[name]: return None return self[name]
class Base(dict): def _get_property(self, name): """Return the named property from dictionary values.""" if name not in self: return None return self[name]
Make _get_property to return none when name does not exist
Make _get_property to return none when name does not exist
Python
bsd-2-clause
mollie/mollie-api-python
python
## Code Before: class Base(dict): def _get_property(self, name): """Return the named property from dictionary values.""" if not self[name]: return None return self[name] ## Instruction: Make _get_property to return none when name does not exist ## Code After: class Base(dict): def _get_property(self, name): """Return the named property from dictionary values.""" if name not in self: return None return self[name]
class Base(dict): def _get_property(self, name): """Return the named property from dictionary values.""" - if not self[name]: + if name not in self: return None return self[name]
2
0.285714
1
1
77a913f8584f5cb113d7688c983435c38d79c067
.travis.yml
.travis.yml
sudo: false language: node_js matrix: include: - node_js: "12" - node_js: "10" script: - ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage before_script: - npm install -g istanbul coveralls - node_js: "8" allow_failures: - node_js: "12"
sudo: false language: node_js matrix: include: - node_js: "12" - node_js: "10" script: - ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage before_script: - npm install -g istanbul coveralls - node_js: "8"
Add Node 12 to full build matrix on Travis
Add Node 12 to full build matrix on Travis Having removed the ui test dependencies out of package.json we can remove the 'allow failures' flag from the node 12 build. Given how close Node 12 is to being LTS, we really need to pay proper attention to it.
YAML
apache-2.0
HiroyasuNishiyama/node-red,node-red/node-red,node-red/node-red,mw75/node-red,node-red/node-red,btsimonh/node-red,mw75/node-red,HiroyasuNishiyama/node-red,namgk/node-red,btsimonh/node-red,btsimonh/node-red,mw75/node-red,HiroyasuNishiyama/node-red,mw75/node-red,namgk/node-red
yaml
## Code Before: sudo: false language: node_js matrix: include: - node_js: "12" - node_js: "10" script: - ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage before_script: - npm install -g istanbul coveralls - node_js: "8" allow_failures: - node_js: "12" ## Instruction: Add Node 12 to full build matrix on Travis Having removed the ui test dependencies out of package.json we can remove the 'allow failures' flag from the node 12 build. Given how close Node 12 is to being LTS, we really need to pay proper attention to it. ## Code After: sudo: false language: node_js matrix: include: - node_js: "12" - node_js: "10" script: - ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage before_script: - npm install -g istanbul coveralls - node_js: "8"
sudo: false language: node_js matrix: include: - node_js: "12" - node_js: "10" script: - ./node_modules/.bin/grunt && istanbul report text && ( cat coverage/lcov.info | $(npm get prefix)/bin/coveralls || true ) && rm -rf coverage before_script: - npm install -g istanbul coveralls - node_js: "8" - allow_failures: - - node_js: "12"
2
0.153846
0
2
02ac549093e9ca7996e840251b596bed48f5c465
.travis.yml
.travis.yml
language: python python: - "2.7" - "3.3" - "3.4" - "pypy" matrix: allow_failures: - python: "3.3" - python: "3.4" fast_finish: true install: - uname -a - sudo apt-get update -qq - sudo apt-get install -qq curl protobuf-compiler libprotobuf-dev libncurses5 libc6 wget - sudo wget https://raw.github.com/alavrik/piqi-binary/master/Linux-x86_64/piqi -O /usr/bin/piqi - sudo chmod +x /usr/bin/piqi - pip install --upgrade https://bitbucket.org/logilab/astroid/get/5ed6266cab78.zip - if [[ ${TRAVIS_PYTHON_VERSION:0:1} == '3' ]]; then pip install -r requirements-dev-py3.txt; else pip install -r requirements-dev-py2.txt; fi; - python setup.py build script: make test && make check
language: python python: - "2.7" - "3.3" - "3.4" - "3.5" - "3.5-dev" - "nightly" - "pypy" - "pypy3" matrix: allow_failures: - python: "3.3" - python: "3.4" - python: "3.5" - python: "3.5-dev" - python: "nightly" - python: "pypy3" fast_finish: true install: - uname -a - sudo apt-get update -qq - sudo apt-get install -qq curl protobuf-compiler libprotobuf-dev libncurses5 libc6 wget - sudo wget https://raw.github.com/alavrik/piqi-binary/master/Linux-x86_64/piqi -O /usr/bin/piqi - sudo chmod +x /usr/bin/piqi - pip install --upgrade https://bitbucket.org/logilab/astroid/get/5ed6266cab78.zip - if [[ ${TRAVIS_PYTHON_VERSION:0:1} == '3' ]]; then pip install -r requirements-dev-py3.txt; else pip install -r requirements-dev-py2.txt; fi; - python setup.py build script: make test && make check
Build with more Python versions
Build with more Python versions
YAML
mit
smarkets/smk_python_sdk
yaml
## Code Before: language: python python: - "2.7" - "3.3" - "3.4" - "pypy" matrix: allow_failures: - python: "3.3" - python: "3.4" fast_finish: true install: - uname -a - sudo apt-get update -qq - sudo apt-get install -qq curl protobuf-compiler libprotobuf-dev libncurses5 libc6 wget - sudo wget https://raw.github.com/alavrik/piqi-binary/master/Linux-x86_64/piqi -O /usr/bin/piqi - sudo chmod +x /usr/bin/piqi - pip install --upgrade https://bitbucket.org/logilab/astroid/get/5ed6266cab78.zip - if [[ ${TRAVIS_PYTHON_VERSION:0:1} == '3' ]]; then pip install -r requirements-dev-py3.txt; else pip install -r requirements-dev-py2.txt; fi; - python setup.py build script: make test && make check ## Instruction: Build with more Python versions ## Code After: language: python python: - "2.7" - "3.3" - "3.4" - "3.5" - "3.5-dev" - "nightly" - "pypy" - "pypy3" matrix: allow_failures: - python: "3.3" - python: "3.4" - python: "3.5" - python: "3.5-dev" - python: "nightly" - python: "pypy3" fast_finish: true install: - uname -a - sudo apt-get update -qq - sudo apt-get install -qq curl protobuf-compiler libprotobuf-dev libncurses5 libc6 wget - sudo wget https://raw.github.com/alavrik/piqi-binary/master/Linux-x86_64/piqi -O /usr/bin/piqi - sudo chmod +x /usr/bin/piqi - pip install --upgrade https://bitbucket.org/logilab/astroid/get/5ed6266cab78.zip - if [[ ${TRAVIS_PYTHON_VERSION:0:1} == '3' ]]; then pip install -r requirements-dev-py3.txt; else pip install -r requirements-dev-py2.txt; fi; - python setup.py build script: make test && make check
language: python python: - "2.7" - "3.3" - "3.4" + - "3.5" + - "3.5-dev" + - "nightly" - "pypy" + - "pypy3" matrix: allow_failures: - python: "3.3" - python: "3.4" + - python: "3.5" + - python: "3.5-dev" + - python: "nightly" + - python: "pypy3" fast_finish: true install: - uname -a - sudo apt-get update -qq - sudo apt-get install -qq curl protobuf-compiler libprotobuf-dev libncurses5 libc6 wget - sudo wget https://raw.github.com/alavrik/piqi-binary/master/Linux-x86_64/piqi -O /usr/bin/piqi - sudo chmod +x /usr/bin/piqi - pip install --upgrade https://bitbucket.org/logilab/astroid/get/5ed6266cab78.zip - if [[ ${TRAVIS_PYTHON_VERSION:0:1} == '3' ]]; then pip install -r requirements-dev-py3.txt; else pip install -r requirements-dev-py2.txt; fi; - python setup.py build script: make test && make check
8
0.333333
8
0
0cc571c16498b9adfd31ef00dc68ec20e34bcfa9
README.md
README.md
Glitches images.
Glitches images on a web page. ## Requirements `jquery` You can use bower to install this requirement if you want to run the demo.html yourself, just install bower and type `bower install`. ## Demo There is also a demo online at: https://danielsmith.eu/glitchy/
Update instructions and demo URL
Update instructions and demo URL
Markdown
bsd-2-clause
danielsmith-eu/glitchy
markdown
## Code Before: Glitches images. ## Instruction: Update instructions and demo URL ## Code After: Glitches images on a web page. ## Requirements `jquery` You can use bower to install this requirement if you want to run the demo.html yourself, just install bower and type `bower install`. ## Demo There is also a demo online at: https://danielsmith.eu/glitchy/
- Glitches images. + Glitches images on a web page. + ## Requirements + + `jquery` + + You can use bower to install this requirement if you want to run the demo.html yourself, just install bower and type `bower install`. + + ## Demo + + There is also a demo online at: + + https://danielsmith.eu/glitchy/ +
14
4.666667
13
1
62b7bad2a5fb5f1de53a54ffeaad104aa5d8c4b6
package.json
package.json
{ "name": "monaca-components", "version": "1.0.0", "description": "Monaca Shared Components", "main": "Gruntfile.js", "scripts": { "start": "grunt server", "build": "./node_modules/.bin/grunt", "test": "echo \"Add Tests\"" }, "repository": { "type": "git", "url": "git+https://github.com/monaca/cdn.monaca.io.git" }, "keywords": [ "Monaca" ], "author": "Erisu", "license": "Apache-2.0", "devDependencies": { "compass-sass-mixins": "^0.12.7", "grunt": "^1.0.1", "grunt-aws-s3": "^0.14.5", "grunt-cli": "^1.2.0", "grunt-contrib-connect": "^1.0.2", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-cssmin": "^1.0.2", "grunt-contrib-watch": "^1.0.0", "grunt-sass": "^1.2.1", "grunt-task-loader": "^0.6.0" } }
{ "name": "monaca-components", "version": "1.0.0", "description": "Monaca Shared Components", "main": "Gruntfile.js", "scripts": { "start": "./node_modules/.bin/grunt server", "build": "./node_modules/.bin/grunt", "test": "echo \"Add Tests\"" }, "repository": { "type": "git", "url": "git+https://github.com/monaca/cdn.monaca.io.git" }, "keywords": [ "Monaca" ], "author": "Erisu", "license": "Apache-2.0", "devDependencies": { "compass-sass-mixins": "^0.12.7", "grunt": "^1.0.1", "grunt-aws-s3": "^0.14.5", "grunt-cli": "^1.2.0", "grunt-contrib-connect": "^1.0.2", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-cssmin": "^1.0.2", "grunt-contrib-watch": "^1.0.0", "grunt-sass": "^1.2.1", "grunt-task-loader": "^0.6.0" } }
Make npm start command work for non-global grunt-cli
Make npm start command work for non-global grunt-cli
JSON
apache-2.0
erisu/cdn.monaca.io
json
## Code Before: { "name": "monaca-components", "version": "1.0.0", "description": "Monaca Shared Components", "main": "Gruntfile.js", "scripts": { "start": "grunt server", "build": "./node_modules/.bin/grunt", "test": "echo \"Add Tests\"" }, "repository": { "type": "git", "url": "git+https://github.com/monaca/cdn.monaca.io.git" }, "keywords": [ "Monaca" ], "author": "Erisu", "license": "Apache-2.0", "devDependencies": { "compass-sass-mixins": "^0.12.7", "grunt": "^1.0.1", "grunt-aws-s3": "^0.14.5", "grunt-cli": "^1.2.0", "grunt-contrib-connect": "^1.0.2", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-cssmin": "^1.0.2", "grunt-contrib-watch": "^1.0.0", "grunt-sass": "^1.2.1", "grunt-task-loader": "^0.6.0" } } ## Instruction: Make npm start command work for non-global grunt-cli ## Code After: { "name": "monaca-components", "version": "1.0.0", "description": "Monaca Shared Components", "main": "Gruntfile.js", "scripts": { "start": "./node_modules/.bin/grunt server", "build": "./node_modules/.bin/grunt", "test": "echo \"Add Tests\"" }, "repository": { "type": "git", "url": "git+https://github.com/monaca/cdn.monaca.io.git" }, "keywords": [ "Monaca" ], "author": "Erisu", "license": "Apache-2.0", "devDependencies": { "compass-sass-mixins": "^0.12.7", "grunt": "^1.0.1", "grunt-aws-s3": "^0.14.5", "grunt-cli": "^1.2.0", "grunt-contrib-connect": "^1.0.2", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-cssmin": "^1.0.2", "grunt-contrib-watch": "^1.0.0", "grunt-sass": "^1.2.1", "grunt-task-loader": "^0.6.0" } }
{ "name": "monaca-components", "version": "1.0.0", "description": "Monaca Shared Components", "main": "Gruntfile.js", "scripts": { - "start": "grunt server", + "start": "./node_modules/.bin/grunt server", "build": "./node_modules/.bin/grunt", "test": "echo \"Add Tests\"" }, "repository": { "type": "git", "url": "git+https://github.com/monaca/cdn.monaca.io.git" }, "keywords": [ "Monaca" ], "author": "Erisu", "license": "Apache-2.0", "devDependencies": { "compass-sass-mixins": "^0.12.7", "grunt": "^1.0.1", "grunt-aws-s3": "^0.14.5", "grunt-cli": "^1.2.0", "grunt-contrib-connect": "^1.0.2", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-cssmin": "^1.0.2", "grunt-contrib-watch": "^1.0.0", "grunt-sass": "^1.2.1", "grunt-task-loader": "^0.6.0" } }
2
0.0625
1
1
2b892b58049bd2b99ae97b62149f88c8001c82ca
ceph_deploy/tests/test_cli_osd.py
ceph_deploy/tests/test_cli_osd.py
import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', 'osd', '--help'], stdout=subprocess.PIPE, ) as p: result = p.stdout.read() assert 'usage: ceph-deploy osd' in result assert 'positional arguments' in result assert 'optional arguments' in result def test_bad_subcommand(tmpdir, cli): with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'osd', 'fakehost:/does-not-exist'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read() assert 'ceph-deploy osd: error' in result assert 'invalid choice' in result assert err.value.status == 2 def test_bad_no_disk(tmpdir, cli): with tmpdir.join('ceph.conf').open('w'): pass with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'osd'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read() assert 'usage: ceph-deploy osd' in result assert 'too few arguments' in result assert err.value.status == 2
import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', 'osd', '--help'], stdout=subprocess.PIPE, ) as p: result = p.stdout.read() assert 'usage: ceph-deploy osd' in result assert 'positional arguments' in result assert 'optional arguments' in result def test_bad_subcommand(tmpdir, cli): with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'osd', 'fakehost:/does-not-exist'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read() assert 'ceph-deploy osd: error' in result assert 'invalid choice' in result assert err.value.status == 2 def test_bad_no_disk(tmpdir, cli): with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'osd'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read() assert 'usage: ceph-deploy osd' in result assert 'too few arguments' in result assert err.value.status == 2
Remove unneeded creation of .conf file
[RM-11742] Remove unneeded creation of .conf file Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>
Python
mit
trhoden/ceph-deploy,branto1/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,branto1/ceph-deploy,ceph/ceph-deploy,SUSE/ceph-deploy,isyippee/ceph-deploy,ghxandsky/ceph-deploy,imzhulei/ceph-deploy,codenrhoden/ceph-deploy,codenrhoden/ceph-deploy,shenhequnying/ceph-deploy,zhouyuan/ceph-deploy,shenhequnying/ceph-deploy,ghxandsky/ceph-deploy,imzhulei/ceph-deploy,trhoden/ceph-deploy,zhouyuan/ceph-deploy,Vicente-Cheng/ceph-deploy,isyippee/ceph-deploy,osynge/ceph-deploy,SUSE/ceph-deploy,osynge/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,Vicente-Cheng/ceph-deploy,ceph/ceph-deploy
python
## Code Before: import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', 'osd', '--help'], stdout=subprocess.PIPE, ) as p: result = p.stdout.read() assert 'usage: ceph-deploy osd' in result assert 'positional arguments' in result assert 'optional arguments' in result def test_bad_subcommand(tmpdir, cli): with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'osd', 'fakehost:/does-not-exist'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read() assert 'ceph-deploy osd: error' in result assert 'invalid choice' in result assert err.value.status == 2 def test_bad_no_disk(tmpdir, cli): with tmpdir.join('ceph.conf').open('w'): pass with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'osd'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read() assert 'usage: ceph-deploy osd' in result assert 'too few arguments' in result assert err.value.status == 2 ## Instruction: [RM-11742] Remove unneeded creation of .conf file Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com> ## Code After: import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', 'osd', '--help'], stdout=subprocess.PIPE, ) as p: result = p.stdout.read() assert 'usage: ceph-deploy osd' in result assert 'positional arguments' in result assert 'optional arguments' in result def test_bad_subcommand(tmpdir, cli): with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'osd', 'fakehost:/does-not-exist'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read() assert 'ceph-deploy osd: error' in result assert 'invalid choice' in result assert err.value.status == 2 def test_bad_no_disk(tmpdir, cli): with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'osd'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read() assert 'usage: ceph-deploy osd' in result assert 'too few arguments' in result assert err.value.status == 2
import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', 'osd', '--help'], stdout=subprocess.PIPE, ) as p: result = p.stdout.read() assert 'usage: ceph-deploy osd' in result assert 'positional arguments' in result assert 'optional arguments' in result def test_bad_subcommand(tmpdir, cli): with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'osd', 'fakehost:/does-not-exist'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read() assert 'ceph-deploy osd: error' in result assert 'invalid choice' in result assert err.value.status == 2 def test_bad_no_disk(tmpdir, cli): - with tmpdir.join('ceph.conf').open('w'): - pass with pytest.raises(cli.Failed) as err: with cli( args=['ceph-deploy', 'osd'], stderr=subprocess.PIPE, ) as p: result = p.stderr.read() assert 'usage: ceph-deploy osd' in result assert 'too few arguments' in result assert err.value.status == 2
2
0.051282
0
2
ca0943342bd4374b10093c6474d41d6503581495
client/acp/package.json
client/acp/package.json
{ "name": "custom-fields-admin-panel", "version": "1.0.0", "description": "Client code for admin panel controls", "main": "index.js", "scripts": { "build": "browserify . -o ../../public/js/acp.js", "watch": "watchify index.js -o ../../public/js/acp.js --verbose", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "acp", "nodebb" ], "browserify": { "transform": [ "reactify", "envify" ] }, "author": "Nicolas Siver", "license": "MIT", "dependencies": { "flux": "^2.0.1", "react": "^0.13.1" }, "devDependencies": { "envify": "^3.4.0", "reactify": "^1.1.0" } }
{ "name": "custom-fields-admin-panel", "version": "1.0.0", "description": "Client code for admin panel controls", "main": "index.js", "scripts": { "build": "browserify . -o ../../public/js/acp.js", "watch": "watchify index.js -o ../../public/js/acp.js --verbose", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "acp", "nodebb" ], "browserify": { "transform": [ "reactify", "envify", "browserify-global-shim" ] }, "browserify-global-shim": { "jQuery": "$" }, "author": "Nicolas Siver", "license": "MIT", "dependencies": { "browser-request": "^0.3.3", "flux": "^2.0.1", "react": "^0.13.1" }, "devDependencies": { "browserify-global-shim": "^1.0.0", "envify": "^3.4.0", "reactify": "^1.1.0" } }
Use global jQuery browserify shim
Use global jQuery browserify shim
JSON
mit
NicolasSiver/nodebb-plugin-ns-custom-fields
json
## Code Before: { "name": "custom-fields-admin-panel", "version": "1.0.0", "description": "Client code for admin panel controls", "main": "index.js", "scripts": { "build": "browserify . -o ../../public/js/acp.js", "watch": "watchify index.js -o ../../public/js/acp.js --verbose", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "acp", "nodebb" ], "browserify": { "transform": [ "reactify", "envify" ] }, "author": "Nicolas Siver", "license": "MIT", "dependencies": { "flux": "^2.0.1", "react": "^0.13.1" }, "devDependencies": { "envify": "^3.4.0", "reactify": "^1.1.0" } } ## Instruction: Use global jQuery browserify shim ## Code After: { "name": "custom-fields-admin-panel", "version": "1.0.0", "description": "Client code for admin panel controls", "main": "index.js", "scripts": { "build": "browserify . -o ../../public/js/acp.js", "watch": "watchify index.js -o ../../public/js/acp.js --verbose", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "acp", "nodebb" ], "browserify": { "transform": [ "reactify", "envify", "browserify-global-shim" ] }, "browserify-global-shim": { "jQuery": "$" }, "author": "Nicolas Siver", "license": "MIT", "dependencies": { "browser-request": "^0.3.3", "flux": "^2.0.1", "react": "^0.13.1" }, "devDependencies": { "browserify-global-shim": "^1.0.0", "envify": "^3.4.0", "reactify": "^1.1.0" } }
{ "name": "custom-fields-admin-panel", "version": "1.0.0", "description": "Client code for admin panel controls", "main": "index.js", "scripts": { "build": "browserify . -o ../../public/js/acp.js", "watch": "watchify index.js -o ../../public/js/acp.js --verbose", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ "acp", "nodebb" ], "browserify": { "transform": [ "reactify", - "envify" + "envify", ? + + "browserify-global-shim" ] + }, + "browserify-global-shim": { + "jQuery": "$" }, "author": "Nicolas Siver", "license": "MIT", "dependencies": { + "browser-request": "^0.3.3", "flux": "^2.0.1", "react": "^0.13.1" }, "devDependencies": { + "browserify-global-shim": "^1.0.0", "envify": "^3.4.0", "reactify": "^1.1.0" } }
8
0.258065
7
1
e0fbefd53f29e0276c3d15c39877c05831c26010
CONTRIBUTORS.rst
CONTRIBUTORS.rst
Authors ======= * Jasper Berghoef * Boris Besemer Contributors ============ * Michael van Tellingen * Pim Vernooij * Tomasz Knapik
Authors ======= * Jasper Berghoef * Boris Besemer Contributors ============ * Michael van Tellingen * Pim Vernooij * Tomasz Knapik * Kaitlyn Crawford * Todd Dembrey * Nathan Begbie * Rob Moorman * Tom Dyson * Bertrand Bordage * Alex Muller * Saeed Marzban * Milton Madanda * Mike Dingjan
Update contributors list with all the committers
Update contributors list with all the committers
reStructuredText
mit
LabD/wagtail-personalisation,LabD/wagtail-personalisation,LabD/wagtail-personalisation
restructuredtext
## Code Before: Authors ======= * Jasper Berghoef * Boris Besemer Contributors ============ * Michael van Tellingen * Pim Vernooij * Tomasz Knapik ## Instruction: Update contributors list with all the committers ## Code After: Authors ======= * Jasper Berghoef * Boris Besemer Contributors ============ * Michael van Tellingen * Pim Vernooij * Tomasz Knapik * Kaitlyn Crawford * Todd Dembrey * Nathan Begbie * Rob Moorman * Tom Dyson * Bertrand Bordage * Alex Muller * Saeed Marzban * Milton Madanda * Mike Dingjan
Authors ======= * Jasper Berghoef * Boris Besemer Contributors ============ * Michael van Tellingen * Pim Vernooij * Tomasz Knapik + * Kaitlyn Crawford + * Todd Dembrey + * Nathan Begbie + * Rob Moorman + * Tom Dyson + * Bertrand Bordage + * Alex Muller + * Saeed Marzban + * Milton Madanda + * Mike Dingjan
10
1
10
0
0f4f943f76e1e7f92126b01671f3fee496ad380c
test/annotationsSpec.js
test/annotationsSpec.js
import annotations from '../src/annotations'; describe('A test', function () { it('will test something', function () { expect(annotations).to.be.an('object'); }); });
import annotations from '../src/annotations/annotations'; describe('A test', function () { it('will test something', function () { expect(annotations).to.be.an('object'); }); });
Correct path in annotations spec
Correct path in annotations spec
JavaScript
bsd-3-clause
Emigre/openseadragon-annotations
javascript
## Code Before: import annotations from '../src/annotations'; describe('A test', function () { it('will test something', function () { expect(annotations).to.be.an('object'); }); }); ## Instruction: Correct path in annotations spec ## Code After: import annotations from '../src/annotations/annotations'; describe('A test', function () { it('will test something', function () { expect(annotations).to.be.an('object'); }); });
- import annotations from '../src/annotations'; + import annotations from '../src/annotations/annotations'; ? ++++++++++++ describe('A test', function () { it('will test something', function () { expect(annotations).to.be.an('object'); }); });
2
0.222222
1
1