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
26fa72b9a0dfafa7f12f7f6d2c4070c51be8d175
package.json
package.json
{ "name": "botimize-botkit-middleware", "version": "0.0.1", "description": "The botimize middleware of botkit", "directories": { "lib": "./lib" }, "keywords": [ "botimize", "botkit", "middleware" ], "author": "botimize, Inc. <dev@botimize.io>", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/botimize/botimize-botkit-middleware.git" }, "scripts": { "build": "babel src -d lib" }, "main": "lib/botkit-middleware.js", "dependencies": { "request": "^2.74.0" }, "devDependencies": { "babel-cli": "^6.11.4", "babel-core": "^6.13.2", "babel-plugin-add-module-exports": "^0.2.1", "babel-preset-es2015": "^6.13.2" } }
{ "name": "botimize-botkit-middleware", "version": "0.0.1", "description": "The botimize middleware of botkit", "directories": { "lib": "./lib" }, "keywords": [ "botimize", "botkit", "middleware" ], "author": "botimize, Inc. <dev@botimize.io>", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/botimize/botimize-botkit-middleware.git" }, "scripts": { "build": "babel src -d lib", "prepublish": "npm run build" }, "main": "lib/botkit-middleware.js", "dependencies": { "botimize": "^0.0.2", "request": "^2.74.0" }, "devDependencies": { "babel-cli": "^6.11.4", "babel-core": "^6.13.2", "babel-plugin-add-module-exports": "^0.2.1", "babel-preset-es2015": "^6.13.2" }, "peerDependencies": { "botimize": "^0.0.2" } }
Add botimize as peer dependency
Add botimize as peer dependency
JSON
mit
botimize/botimize-botkit-middleware
json
## Code Before: { "name": "botimize-botkit-middleware", "version": "0.0.1", "description": "The botimize middleware of botkit", "directories": { "lib": "./lib" }, "keywords": [ "botimize", "botkit", "middleware" ], "author": "botimize, Inc. <dev@botimize.io>", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/botimize/botimize-botkit-middleware.git" }, "scripts": { "build": "babel src -d lib" }, "main": "lib/botkit-middleware.js", "dependencies": { "request": "^2.74.0" }, "devDependencies": { "babel-cli": "^6.11.4", "babel-core": "^6.13.2", "babel-plugin-add-module-exports": "^0.2.1", "babel-preset-es2015": "^6.13.2" } } ## Instruction: Add botimize as peer dependency ## Code After: { "name": "botimize-botkit-middleware", "version": "0.0.1", "description": "The botimize middleware of botkit", "directories": { "lib": "./lib" }, "keywords": [ "botimize", "botkit", "middleware" ], "author": "botimize, Inc. <dev@botimize.io>", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/botimize/botimize-botkit-middleware.git" }, "scripts": { "build": "babel src -d lib", "prepublish": "npm run build" }, "main": "lib/botkit-middleware.js", "dependencies": { "botimize": "^0.0.2", "request": "^2.74.0" }, "devDependencies": { "babel-cli": "^6.11.4", "babel-core": "^6.13.2", "babel-plugin-add-module-exports": "^0.2.1", "babel-preset-es2015": "^6.13.2" }, "peerDependencies": { "botimize": "^0.0.2" } }
{ "name": "botimize-botkit-middleware", "version": "0.0.1", "description": "The botimize middleware of botkit", "directories": { "lib": "./lib" }, "keywords": [ "botimize", "botkit", "middleware" ], "author": "botimize, Inc. <dev@botimize.io>", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/botimize/botimize-botkit-middleware.git" }, "scripts": { - "build": "babel src -d lib" + "build": "babel src -d lib", ? + + "prepublish": "npm run build" }, "main": "lib/botkit-middleware.js", "dependencies": { + "botimize": "^0.0.2", "request": "^2.74.0" }, "devDependencies": { "babel-cli": "^6.11.4", "babel-core": "^6.13.2", "babel-plugin-add-module-exports": "^0.2.1", "babel-preset-es2015": "^6.13.2" + }, + "peerDependencies": { + "botimize": "^0.0.2" } }
7
0.21875
6
1
6f666a8eb6e3a0f0c6909a6631eb8b3abc14d964
config/final.yml
config/final.yml
--- final_name: bosh-google-cpi blobstore: provider: s3 options: bucket_name: bosh-cpi-artifacts host: storage.googleapis.com
--- final_name: bosh-google-cpi blobstore: provider: s3 options: bucket: bosh-cpi-artifacts bucket_name: bosh-cpi-artifacts host: storage.googleapis.com endpoint: https://storage.googleapis.com
Support GCS blobstore client for un-authenticated use
config: Support GCS blobstore client for un-authenticated use
YAML
apache-2.0
cloudfoundry-incubator/bosh-google-cpi-release,evandbrown/bosh-google-cpi-release,cloudfoundry-incubator/bosh-google-cpi-release,erjohnso/bosh-google-cpi-release,evandbrown/bosh-google-cpi-release,erjohnso/bosh-google-cpi-release,evandbrown/bosh-google-cpi-release,cloudfoundry-incubator/bosh-google-cpi-release,evandbrown/bosh-google-cpi-release,erjohnso/bosh-google-cpi-release,erjohnso/bosh-google-cpi-release,cloudfoundry-incubator/bosh-google-cpi-release
yaml
## Code Before: --- final_name: bosh-google-cpi blobstore: provider: s3 options: bucket_name: bosh-cpi-artifacts host: storage.googleapis.com ## Instruction: config: Support GCS blobstore client for un-authenticated use ## Code After: --- final_name: bosh-google-cpi blobstore: provider: s3 options: bucket: bosh-cpi-artifacts bucket_name: bosh-cpi-artifacts host: storage.googleapis.com endpoint: https://storage.googleapis.com
--- final_name: bosh-google-cpi blobstore: provider: s3 options: + bucket: bosh-cpi-artifacts bucket_name: bosh-cpi-artifacts host: storage.googleapis.com + endpoint: https://storage.googleapis.com
2
0.285714
2
0
93b285cf8b90d2e208893e39b0f9e62786ecefc4
controllers/qpv.js
controllers/qpv.js
var express = require('express') , router = express.Router() , Qpv = require('../models/qpv.js') , geojson = require('../helpers/geojson.js') , isvalidgeo = require('../helpers/isvalidgeo') , turf = require('turf') router.get('/layer', function(req, res) { if (req.query.bbox){ var bbox = req.query.bbox.split(","); var geojsonbbox = turf.bboxPolygon(bbox); var isvalid = isvalidgeo(geojsonbbox); } if (isvalid || !req.bbox){ var qpv = Qpv.getLayer(bbox); qpv.then( function (data){ var featureCollection = geojson.rows_to_geojson(data, Qpv.properties); res.json(featureCollection); }).catch(function (err){ console.error(err) res.status(500).send({error:'something bad happens'}) }) } else{ res.status(500).send({error:'invalid GeoJSON'}) } }) router.post('/intersects', function(req, res) { var qpv = Qpv.intersects(req.query.geom); res.send(); }) module.exports = router
var express = require('express') , router = express.Router() , Qpv = require('../models/qpv.js') , geojson = require('../helpers/geojson.js') , isvalidgeo = require('../helpers/isvalidgeo') , turf = require('turf') router.get('/layer', function(req, res) { if (req.query.bbox){ var bbox = req.query.bbox.split(","); var geojsonbbox = turf.bboxPolygon(bbox); var isvalid = isvalidgeo(geojsonbbox); } if (isvalid || !req.query.bbox){ var qpv = Qpv.getLayer(bbox); qpv.then( function (data){ var featureCollection = geojson.rows_to_geojson(data, Qpv.properties); res.json(featureCollection); }).catch(function (err){ console.error(err) res.status(500).send({error:'something bad happens'}) }) } else{ res.status(500).send({error:'invalid bbox'}) } }) router.post('/intersects', function(req, res) { var qpv = Qpv.intersects(req.query.geom); res.send(); }) module.exports = router
Fix typo with the usage of req.query
Fix typo with the usage of req.query
JavaScript
mit
blackrez/apicarto-qpv,blackrez/apicarto-qpv
javascript
## Code Before: var express = require('express') , router = express.Router() , Qpv = require('../models/qpv.js') , geojson = require('../helpers/geojson.js') , isvalidgeo = require('../helpers/isvalidgeo') , turf = require('turf') router.get('/layer', function(req, res) { if (req.query.bbox){ var bbox = req.query.bbox.split(","); var geojsonbbox = turf.bboxPolygon(bbox); var isvalid = isvalidgeo(geojsonbbox); } if (isvalid || !req.bbox){ var qpv = Qpv.getLayer(bbox); qpv.then( function (data){ var featureCollection = geojson.rows_to_geojson(data, Qpv.properties); res.json(featureCollection); }).catch(function (err){ console.error(err) res.status(500).send({error:'something bad happens'}) }) } else{ res.status(500).send({error:'invalid GeoJSON'}) } }) router.post('/intersects', function(req, res) { var qpv = Qpv.intersects(req.query.geom); res.send(); }) module.exports = router ## Instruction: Fix typo with the usage of req.query ## Code After: var express = require('express') , router = express.Router() , Qpv = require('../models/qpv.js') , geojson = require('../helpers/geojson.js') , isvalidgeo = require('../helpers/isvalidgeo') , turf = require('turf') router.get('/layer', function(req, res) { if (req.query.bbox){ var bbox = req.query.bbox.split(","); var geojsonbbox = turf.bboxPolygon(bbox); var isvalid = isvalidgeo(geojsonbbox); } if (isvalid || !req.query.bbox){ var qpv = Qpv.getLayer(bbox); qpv.then( function (data){ var featureCollection = geojson.rows_to_geojson(data, Qpv.properties); res.json(featureCollection); }).catch(function (err){ console.error(err) res.status(500).send({error:'something bad happens'}) }) } else{ res.status(500).send({error:'invalid bbox'}) } }) router.post('/intersects', function(req, res) { var qpv = Qpv.intersects(req.query.geom); res.send(); }) module.exports = router
var express = require('express') , router = express.Router() , Qpv = require('../models/qpv.js') , geojson = require('../helpers/geojson.js') , isvalidgeo = require('../helpers/isvalidgeo') , turf = require('turf') router.get('/layer', function(req, res) { if (req.query.bbox){ var bbox = req.query.bbox.split(","); var geojsonbbox = turf.bboxPolygon(bbox); var isvalid = isvalidgeo(geojsonbbox); } - if (isvalid || !req.bbox){ + if (isvalid || !req.query.bbox){ ? ++++++ var qpv = Qpv.getLayer(bbox); qpv.then( function (data){ var featureCollection = geojson.rows_to_geojson(data, Qpv.properties); res.json(featureCollection); }).catch(function (err){ console.error(err) res.status(500).send({error:'something bad happens'}) }) } else{ - res.status(500).send({error:'invalid GeoJSON'}) ? ^^ ^^^^ + res.status(500).send({error:'invalid bbox'}) ? ^^ ^ } }) router.post('/intersects', function(req, res) { var qpv = Qpv.intersects(req.query.geom); res.send(); }) module.exports = router
4
0.117647
2
2
c2952e753452b083daef6ef25ea82185fd2ba7ec
.travis.yml
.travis.yml
language: python python: - "2.7" cache: pip install: - pip install -r requirements.txt -r test-requirements.txt - pip install coveralls # command to run tests script: - PYTHONPATH=${PYTHONPATH}:. py.test --cov gameserver gameserver/tests.py gameserver/wallet.py gameserver/wallet_sqlalchemy.py notifications: - slack: quernus:FSJYjitrzrSX83EAcD8MyNuE after_success: - coveralls
language: python python: - "2.7" cache: pip install: - pip install -U setuptools - pip install -r requirements.txt -r test-requirements.txt - pip install coveralls # command to run tests script: - PYTHONPATH=${PYTHONPATH}:. py.test --cov gameserver gameserver/tests.py gameserver/wallet.py gameserver/wallet_sqlalchemy.py notifications: - slack: quernus:FSJYjitrzrSX83EAcD8MyNuE after_success: - coveralls
Upgrade setuptools first before building;
Upgrade setuptools first before building;
YAML
apache-2.0
hammertoe/didactic-spork,hammertoe/didactic-spork,hammertoe/didactic-spork,hammertoe/didactic-spork
yaml
## Code Before: language: python python: - "2.7" cache: pip install: - pip install -r requirements.txt -r test-requirements.txt - pip install coveralls # command to run tests script: - PYTHONPATH=${PYTHONPATH}:. py.test --cov gameserver gameserver/tests.py gameserver/wallet.py gameserver/wallet_sqlalchemy.py notifications: - slack: quernus:FSJYjitrzrSX83EAcD8MyNuE after_success: - coveralls ## Instruction: Upgrade setuptools first before building; ## Code After: language: python python: - "2.7" cache: pip install: - pip install -U setuptools - pip install -r requirements.txt -r test-requirements.txt - pip install coveralls # command to run tests script: - PYTHONPATH=${PYTHONPATH}:. py.test --cov gameserver gameserver/tests.py gameserver/wallet.py gameserver/wallet_sqlalchemy.py notifications: - slack: quernus:FSJYjitrzrSX83EAcD8MyNuE after_success: - coveralls
language: python python: - "2.7" cache: pip install: + - pip install -U setuptools - pip install -r requirements.txt -r test-requirements.txt - pip install coveralls # command to run tests script: - PYTHONPATH=${PYTHONPATH}:. py.test --cov gameserver gameserver/tests.py gameserver/wallet.py gameserver/wallet_sqlalchemy.py notifications: - slack: quernus:FSJYjitrzrSX83EAcD8MyNuE after_success: - coveralls
1
0.071429
1
0
16f6e1122790113949b6a4fef9199a45099ecdbe
lib/middlewares/override_welcome_action.rb
lib/middlewares/override_welcome_action.rb
class OverrideWelcomeAction def initialize(app) @app = app end def call(env) # Load gobierto_site, used by route constraints full_domain = (env["HTTP_HOST"] || env["SERVER_NAME"] || env["SERVER_ADDR"]).split(":").first if site = Site.find_by_allowed_domain(full_domain) env["gobierto_site"] = site end if Rails.env.test? && site.nil? env["gobierto_site"] = ::GobiertoCore::CurrentScope.current_site || Site.first end # If the path is the homepage, the route should be the site root path if env["PATH_INFO"] == "/" && env["gobierto_site"].present? # A CMS page is handled by meta welcome controller if env["gobierto_site"].configuration.home_page != "GobiertoCms" env["PATH_INFO"] = env["gobierto_site"].root_path env["gobierto_welcome_override"] = true end end @app.call(env) end end
class OverrideWelcomeAction def initialize(app) @app = app end def call(env) # Load gobierto_site, used by route constraints full_domain = (env["HTTP_HOST"] || env["SERVER_NAME"] || env["SERVER_ADDR"]).split(":").first if site = Site.find_by_allowed_domain(full_domain) env["gobierto_site"] = site end if Rails.env.test? && site.nil? env["gobierto_site"] = ::GobiertoCore::CurrentScope.current_site || Site.first end # If the path is the homepage, the route should be the site root path if env["PATH_INFO"] == "/" && env["gobierto_site"].present? # A CMS page is handled by meta welcome controller home_page_module = env["gobierto_site"].configuration.home_page if home_page_module != "GobiertoCms" # GobiertoPeople has translations in paths, and the value in the cookie # is overrided I18n.locale = env["gobierto_site"].configuration.default_locale if home_page_module == "GobiertoPeople" env["PATH_INFO"] = env["gobierto_site"].root_path env["gobierto_welcome_override"] = true end end @app.call(env) end end
Set site default locale when module is GobiertoPeople in override welcome action for / path
Set site default locale when module is GobiertoPeople in override welcome action for / path
Ruby
agpl-3.0
PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto,PopulateTools/gobierto-dev,PopulateTools/gobierto-dev,PopulateTools/gobierto,PopulateTools/gobierto-dev
ruby
## Code Before: class OverrideWelcomeAction def initialize(app) @app = app end def call(env) # Load gobierto_site, used by route constraints full_domain = (env["HTTP_HOST"] || env["SERVER_NAME"] || env["SERVER_ADDR"]).split(":").first if site = Site.find_by_allowed_domain(full_domain) env["gobierto_site"] = site end if Rails.env.test? && site.nil? env["gobierto_site"] = ::GobiertoCore::CurrentScope.current_site || Site.first end # If the path is the homepage, the route should be the site root path if env["PATH_INFO"] == "/" && env["gobierto_site"].present? # A CMS page is handled by meta welcome controller if env["gobierto_site"].configuration.home_page != "GobiertoCms" env["PATH_INFO"] = env["gobierto_site"].root_path env["gobierto_welcome_override"] = true end end @app.call(env) end end ## Instruction: Set site default locale when module is GobiertoPeople in override welcome action for / path ## Code After: class OverrideWelcomeAction def initialize(app) @app = app end def call(env) # Load gobierto_site, used by route constraints full_domain = (env["HTTP_HOST"] || env["SERVER_NAME"] || env["SERVER_ADDR"]).split(":").first if site = Site.find_by_allowed_domain(full_domain) env["gobierto_site"] = site end if Rails.env.test? && site.nil? env["gobierto_site"] = ::GobiertoCore::CurrentScope.current_site || Site.first end # If the path is the homepage, the route should be the site root path if env["PATH_INFO"] == "/" && env["gobierto_site"].present? # A CMS page is handled by meta welcome controller home_page_module = env["gobierto_site"].configuration.home_page if home_page_module != "GobiertoCms" # GobiertoPeople has translations in paths, and the value in the cookie # is overrided I18n.locale = env["gobierto_site"].configuration.default_locale if home_page_module == "GobiertoPeople" env["PATH_INFO"] = env["gobierto_site"].root_path env["gobierto_welcome_override"] = true end end @app.call(env) end end
class OverrideWelcomeAction def initialize(app) @app = app end def call(env) # Load gobierto_site, used by route constraints full_domain = (env["HTTP_HOST"] || env["SERVER_NAME"] || env["SERVER_ADDR"]).split(":").first if site = Site.find_by_allowed_domain(full_domain) env["gobierto_site"] = site end if Rails.env.test? && site.nil? env["gobierto_site"] = ::GobiertoCore::CurrentScope.current_site || Site.first end # If the path is the homepage, the route should be the site root path if env["PATH_INFO"] == "/" && env["gobierto_site"].present? # A CMS page is handled by meta welcome controller - if env["gobierto_site"].configuration.home_page != "GobiertoCms" + home_page_module = env["gobierto_site"].configuration.home_page + if home_page_module != "GobiertoCms" + # GobiertoPeople has translations in paths, and the value in the cookie + # is overrided + I18n.locale = env["gobierto_site"].configuration.default_locale if home_page_module == "GobiertoPeople" env["PATH_INFO"] = env["gobierto_site"].root_path env["gobierto_welcome_override"] = true end end @app.call(env) end end
6
0.2
5
1
219c1ee272979e78c3fcf381e9000cadeb43c31f
appveyor.yml
appveyor.yml
version: 1.0.{build} environment: EveTestServer: http://evenet-testbed.herokuapp.com/ before_build: - cmd: nuget restore build: verbosity: minimal artifacts: - path: '.nupkg\**\*.nupkg' deploy: provider: NuGet api_key: secure: n79bIyukFqGL7AjtPzsYj/4BNjkyvmT7s2lsUIxjgG0R3VB2K7jJBjE6zltrUEJT skip_symbols: true on: branch: master appveyor_repo_tag: true
version: 1.0.{build} image: Visual Studio 2017 environment: EveTestServer: http://evenet-testbed.herokuapp.com/ before_build: - cmd: nuget restore build: verbosity: minimal artifacts: - path: '.nupkg\**\*.nupkg' deploy: provider: NuGet api_key: secure: n79bIyukFqGL7AjtPzsYj/4BNjkyvmT7s2lsUIxjgG0R3VB2K7jJBjE6zltrUEJT skip_symbols: true on: branch: master appveyor_repo_tag: true
Use VS2017 image on AppVeyor CI
Use VS2017 image on AppVeyor CI
YAML
bsd-3-clause
nicolaiarocci/Eve.NET
yaml
## Code Before: version: 1.0.{build} environment: EveTestServer: http://evenet-testbed.herokuapp.com/ before_build: - cmd: nuget restore build: verbosity: minimal artifacts: - path: '.nupkg\**\*.nupkg' deploy: provider: NuGet api_key: secure: n79bIyukFqGL7AjtPzsYj/4BNjkyvmT7s2lsUIxjgG0R3VB2K7jJBjE6zltrUEJT skip_symbols: true on: branch: master appveyor_repo_tag: true ## Instruction: Use VS2017 image on AppVeyor CI ## Code After: version: 1.0.{build} image: Visual Studio 2017 environment: EveTestServer: http://evenet-testbed.herokuapp.com/ before_build: - cmd: nuget restore build: verbosity: minimal artifacts: - path: '.nupkg\**\*.nupkg' deploy: provider: NuGet api_key: secure: n79bIyukFqGL7AjtPzsYj/4BNjkyvmT7s2lsUIxjgG0R3VB2K7jJBjE6zltrUEJT skip_symbols: true on: branch: master appveyor_repo_tag: true
version: 1.0.{build} + image: Visual Studio 2017 environment: EveTestServer: http://evenet-testbed.herokuapp.com/ before_build: - cmd: nuget restore build: verbosity: minimal artifacts: - path: '.nupkg\**\*.nupkg' deploy: provider: NuGet api_key: secure: n79bIyukFqGL7AjtPzsYj/4BNjkyvmT7s2lsUIxjgG0R3VB2K7jJBjE6zltrUEJT skip_symbols: true on: branch: master appveyor_repo_tag: true
1
0.058824
1
0
5ed63aee1fe6838185114717a0f2c10a8a9ddedb
README.md
README.md
By Matthias Noback ## Getting started Clone this project: git clone git@github.com:matthiasnoback/symfony-dependency-injection-workshop.git cd symfony-dependency-injection-workshop Install [Composer](https://getcomposer.org/download/) if you don't have it already. Run: composer install Try: php run.php You should see something like: URL for cat gif with id "vd": http://24.media.tumblr.com/tumblr_m1pgmg9Fe61qjahcpo1_1280.jpg A random URL of a cat gif: http://24.media.tumblr.com/tumblr_m2kkonCfCa1qejbiro1_500.jpg
By [Matthias Noback](http://php-and-symfony.matthiasnoback.nl/) ## Getting started Clone this project: git clone git@github.com:matthiasnoback/symfony-dependency-injection-workshop.git cd symfony-dependency-injection-workshop Install [Composer](https://getcomposer.org/download/) if you don't have it already. Run: composer install Try: php run.php You should see something like: URL for cat gif with id "vd": http://24.media.tumblr.com/tumblr_m1pgmg9Fe61qjahcpo1_1280.jpg A random URL of a cat gif: http://24.media.tumblr.com/tumblr_m2kkonCfCa1qejbiro1_500.jpg You may also try to run the tests: vendor/bin/phpunit This takes a couple of seconds and then you may either see a red or a green bar telling you that all tests succeeded, or one of them failed.
Add a note about the tests
Add a note about the tests
Markdown
mit
matthiasnoback/symfony-dependency-injection-workshop
markdown
## Code Before: By Matthias Noback ## Getting started Clone this project: git clone git@github.com:matthiasnoback/symfony-dependency-injection-workshop.git cd symfony-dependency-injection-workshop Install [Composer](https://getcomposer.org/download/) if you don't have it already. Run: composer install Try: php run.php You should see something like: URL for cat gif with id "vd": http://24.media.tumblr.com/tumblr_m1pgmg9Fe61qjahcpo1_1280.jpg A random URL of a cat gif: http://24.media.tumblr.com/tumblr_m2kkonCfCa1qejbiro1_500.jpg ## Instruction: Add a note about the tests ## Code After: By [Matthias Noback](http://php-and-symfony.matthiasnoback.nl/) ## Getting started Clone this project: git clone git@github.com:matthiasnoback/symfony-dependency-injection-workshop.git cd symfony-dependency-injection-workshop Install [Composer](https://getcomposer.org/download/) if you don't have it already. Run: composer install Try: php run.php You should see something like: URL for cat gif with id "vd": http://24.media.tumblr.com/tumblr_m1pgmg9Fe61qjahcpo1_1280.jpg A random URL of a cat gif: http://24.media.tumblr.com/tumblr_m2kkonCfCa1qejbiro1_500.jpg You may also try to run the tests: vendor/bin/phpunit This takes a couple of seconds and then you may either see a red or a green bar telling you that all tests succeeded, or one of them failed.
- By Matthias Noback + By [Matthias Noback](http://php-and-symfony.matthiasnoback.nl/) ## Getting started Clone this project: git clone git@github.com:matthiasnoback/symfony-dependency-injection-workshop.git cd symfony-dependency-injection-workshop Install [Composer](https://getcomposer.org/download/) if you don't have it already. Run: composer install Try: php run.php You should see something like: URL for cat gif with id "vd": http://24.media.tumblr.com/tumblr_m1pgmg9Fe61qjahcpo1_1280.jpg A random URL of a cat gif: http://24.media.tumblr.com/tumblr_m2kkonCfCa1qejbiro1_500.jpg + + You may also try to run the tests: + + vendor/bin/phpunit + + This takes a couple of seconds and then you may either see a red or a green bar telling you that all tests succeeded, + or one of them failed.
9
0.375
8
1
1eddf29307b02c2e877e77cf1fea4ba1066719fa
README.md
README.md
Pre-processed election results for California elections ## Code License See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).
[![Build Status](https://github.com/openelections/openelections-data-ca/actions/workflows/data_tests.yml/badge.svg?branch=master)](https://github.com/openelections/openelections-data-ca/actions) [![Build Status](https://github.com/openelections/openelections-data-ca/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/openelections/openelections-data-ca/actions) [![Build Status](https://github.com/openelections/openelections-data-ca/actions/workflows/format_tests.yml/badge.svg?branch=master)](https://github.com/openelections/openelections-data-ca/actions) # openelections-data-ca Pre-processed election results for California elections ## Code License See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).
Add badge to indicate status of data tests.
Add badge to indicate status of data tests.
Markdown
mit
openelections/openelections-data-ca,openelections/openelections-data-ca
markdown
## Code Before: Pre-processed election results for California elections ## Code License See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT). ## Instruction: Add badge to indicate status of data tests. ## Code After: [![Build Status](https://github.com/openelections/openelections-data-ca/actions/workflows/data_tests.yml/badge.svg?branch=master)](https://github.com/openelections/openelections-data-ca/actions) [![Build Status](https://github.com/openelections/openelections-data-ca/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/openelections/openelections-data-ca/actions) [![Build Status](https://github.com/openelections/openelections-data-ca/actions/workflows/format_tests.yml/badge.svg?branch=master)](https://github.com/openelections/openelections-data-ca/actions) # openelections-data-ca Pre-processed election results for California elections ## Code License See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).
+ [![Build Status](https://github.com/openelections/openelections-data-ca/actions/workflows/data_tests.yml/badge.svg?branch=master)](https://github.com/openelections/openelections-data-ca/actions) + [![Build Status](https://github.com/openelections/openelections-data-ca/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/openelections/openelections-data-ca/actions) + [![Build Status](https://github.com/openelections/openelections-data-ca/actions/workflows/format_tests.yml/badge.svg?branch=master)](https://github.com/openelections/openelections-data-ca/actions) + + # openelections-data-ca Pre-processed election results for California elections ## Code License See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).
5
1
5
0
ccbf62e3bff58f1a8047616539ad548c29fa8832
integration-tests/src/test/java/org/realityforge/arez/integration/EqualsAndHashCodeTest.java
integration-tests/src/test/java/org/realityforge/arez/integration/EqualsAndHashCodeTest.java
package org.realityforge.arez.integration; import org.realityforge.arez.Arez; import org.realityforge.guiceyloops.shared.ValueUtil; import org.testng.annotations.Test; import static org.testng.Assert.*; public class EqualsAndHashCodeTest { @Test public void equalsAndHashBasedOnId() { final PersonModel person1 = PersonModel.create( ValueUtil.randomString(), ValueUtil.randomString() ); final PersonModel person2 = PersonModel.create( ValueUtil.randomString(), ValueUtil.randomString() ); final PersonModel person3 = Arez.context().safeAction( () -> PersonModel.create( person1.getFirstName(), person1.getLastName() ) ); assertEquals( person1.hashCode(), person1.hashCode() ); assertNotEquals( person1.hashCode(), person2.hashCode() ); assertNotEquals( person1.hashCode(), person3.hashCode() ); //noinspection EqualsWithItself assertTrue( person1.equals( person1 ) ); assertFalse( person1.equals( person2 ) ); assertFalse( person1.equals( person3 ) ); } }
package org.realityforge.arez.integration; import javax.annotation.Nonnull; import org.realityforge.arez.Arez; import org.realityforge.arez.annotations.ArezComponent; import org.realityforge.arez.annotations.Observable; import org.realityforge.guiceyloops.shared.ValueUtil; import org.testng.annotations.Test; import static org.testng.Assert.*; public class EqualsAndHashCodeTest { @SuppressWarnings( "WeakerAccess" ) @ArezComponent public static class PersonModel { @Nonnull private String _firstName; @Nonnull public static PersonModel create( @Nonnull final String firstName ) { return new EqualsAndHashCodeTest$Arez_PersonModel( firstName ); } PersonModel( @Nonnull final String firstName ) { _firstName = firstName; } @Observable @Nonnull public String getFirstName() { return _firstName; } public void setFirstName( @Nonnull final String firstName ) { _firstName = firstName; } } @Test public void equalsAndHashBasedOnId() { final PersonModel person1 = PersonModel.create( ValueUtil.randomString() ); final PersonModel person2 = PersonModel.create( ValueUtil.randomString() ); final PersonModel person3 = Arez.context().safeAction( () -> PersonModel.create( person1.getFirstName() ) ); assertEquals( person1.hashCode(), person1.hashCode() ); assertNotEquals( person1.hashCode(), person2.hashCode() ); assertNotEquals( person1.hashCode(), person3.hashCode() ); //noinspection EqualsWithItself assertTrue( person1.equals( person1 ) ); assertFalse( person1.equals( person2 ) ); assertFalse( person1.equals( person3 ) ); } }
Use an isolated model so it does not interfere with other integration tests
Use an isolated model so it does not interfere with other integration tests
Java
apache-2.0
realityforge/arez,realityforge/arez,realityforge/arez
java
## Code Before: package org.realityforge.arez.integration; import org.realityforge.arez.Arez; import org.realityforge.guiceyloops.shared.ValueUtil; import org.testng.annotations.Test; import static org.testng.Assert.*; public class EqualsAndHashCodeTest { @Test public void equalsAndHashBasedOnId() { final PersonModel person1 = PersonModel.create( ValueUtil.randomString(), ValueUtil.randomString() ); final PersonModel person2 = PersonModel.create( ValueUtil.randomString(), ValueUtil.randomString() ); final PersonModel person3 = Arez.context().safeAction( () -> PersonModel.create( person1.getFirstName(), person1.getLastName() ) ); assertEquals( person1.hashCode(), person1.hashCode() ); assertNotEquals( person1.hashCode(), person2.hashCode() ); assertNotEquals( person1.hashCode(), person3.hashCode() ); //noinspection EqualsWithItself assertTrue( person1.equals( person1 ) ); assertFalse( person1.equals( person2 ) ); assertFalse( person1.equals( person3 ) ); } } ## Instruction: Use an isolated model so it does not interfere with other integration tests ## Code After: package org.realityforge.arez.integration; import javax.annotation.Nonnull; import org.realityforge.arez.Arez; import org.realityforge.arez.annotations.ArezComponent; import org.realityforge.arez.annotations.Observable; import org.realityforge.guiceyloops.shared.ValueUtil; import org.testng.annotations.Test; import static org.testng.Assert.*; public class EqualsAndHashCodeTest { @SuppressWarnings( "WeakerAccess" ) @ArezComponent public static class PersonModel { @Nonnull private String _firstName; @Nonnull public static PersonModel create( @Nonnull final String firstName ) { return new EqualsAndHashCodeTest$Arez_PersonModel( firstName ); } PersonModel( @Nonnull final String firstName ) { _firstName = firstName; } @Observable @Nonnull public String getFirstName() { return _firstName; } public void setFirstName( @Nonnull final String firstName ) { _firstName = firstName; } } @Test public void equalsAndHashBasedOnId() { final PersonModel person1 = PersonModel.create( ValueUtil.randomString() ); final PersonModel person2 = PersonModel.create( ValueUtil.randomString() ); final PersonModel person3 = Arez.context().safeAction( () -> PersonModel.create( person1.getFirstName() ) ); assertEquals( person1.hashCode(), person1.hashCode() ); assertNotEquals( person1.hashCode(), person2.hashCode() ); assertNotEquals( person1.hashCode(), person3.hashCode() ); //noinspection EqualsWithItself assertTrue( person1.equals( person1 ) ); assertFalse( person1.equals( person2 ) ); assertFalse( person1.equals( person3 ) ); } }
package org.realityforge.arez.integration; + import javax.annotation.Nonnull; import org.realityforge.arez.Arez; + import org.realityforge.arez.annotations.ArezComponent; + import org.realityforge.arez.annotations.Observable; import org.realityforge.guiceyloops.shared.ValueUtil; import org.testng.annotations.Test; import static org.testng.Assert.*; public class EqualsAndHashCodeTest { + + @SuppressWarnings( "WeakerAccess" ) + @ArezComponent + public static class PersonModel + { + @Nonnull + private String _firstName; + + @Nonnull + public static PersonModel create( @Nonnull final String firstName ) + { + return new EqualsAndHashCodeTest$Arez_PersonModel( firstName ); + } + + PersonModel( @Nonnull final String firstName ) + { + _firstName = firstName; + } + + @Observable + @Nonnull + public String getFirstName() + { + return _firstName; + } + + public void setFirstName( @Nonnull final String firstName ) + { + _firstName = firstName; + } + } + @Test public void equalsAndHashBasedOnId() { - final PersonModel person1 = PersonModel.create( ValueUtil.randomString(), ValueUtil.randomString() ); ? -------------------------- + final PersonModel person1 = PersonModel.create( ValueUtil.randomString() ); - final PersonModel person2 = PersonModel.create( ValueUtil.randomString(), ValueUtil.randomString() ); ? -------------------------- + final PersonModel person2 = PersonModel.create( ValueUtil.randomString() ); final PersonModel person3 = - Arez.context().safeAction( () -> PersonModel.create( person1.getFirstName(), person1.getLastName() ) ); ? ----------------------- + Arez.context().safeAction( () -> PersonModel.create( person1.getFirstName() ) ); assertEquals( person1.hashCode(), person1.hashCode() ); assertNotEquals( person1.hashCode(), person2.hashCode() ); assertNotEquals( person1.hashCode(), person3.hashCode() ); //noinspection EqualsWithItself assertTrue( person1.equals( person1 ) ); assertFalse( person1.equals( person2 ) ); assertFalse( person1.equals( person3 ) ); } }
41
1.518519
38
3
012d767d3099dd70c7c65df154dc189eb7ce85b8
composer.json
composer.json
{ "authors": [ { "name": "Edvinas Kručas", "email": "edv.krucas@gmail.com" } ], "require-dev": { "mockery/mockery": "0.9.*" }, "autoload": { "psr-0": { "Krucas\\Permissions": "src/" } } }
{ "authors": [ { "name": "Edvinas Kručas", "email": "edv.krucas@gmail.com" } ], "require-dev": { "phpunit/phpunit": "4.3.*", "mockery/mockery": "0.9.*" }, "autoload": { "psr-0": { "Krucas\\Permissions": "src/" } } }
Add phpunit as requirement for dev
Add phpunit as requirement for dev
JSON
mit
edvinaskrucas/permission
json
## Code Before: { "authors": [ { "name": "Edvinas Kručas", "email": "edv.krucas@gmail.com" } ], "require-dev": { "mockery/mockery": "0.9.*" }, "autoload": { "psr-0": { "Krucas\\Permissions": "src/" } } } ## Instruction: Add phpunit as requirement for dev ## Code After: { "authors": [ { "name": "Edvinas Kručas", "email": "edv.krucas@gmail.com" } ], "require-dev": { "phpunit/phpunit": "4.3.*", "mockery/mockery": "0.9.*" }, "autoload": { "psr-0": { "Krucas\\Permissions": "src/" } } }
{ "authors": [ { "name": "Edvinas Kručas", "email": "edv.krucas@gmail.com" } ], "require-dev": { + "phpunit/phpunit": "4.3.*", "mockery/mockery": "0.9.*" }, "autoload": { "psr-0": { "Krucas\\Permissions": "src/" } } }
1
0.0625
1
0
463bb231149c75bbfdd7ad4b7c75cbbc77cff197
ui/analyse/css/study/panel/_share.scss
ui/analyse/css/study/panel/_share.scss
.study__share { @extend %box-neat; background: $c-bg-box; padding: 1.5em 1.2em; input[type='text'] { font-family: monospace; width: 100%; font-size: 0.9em; } .ply-wrap { color: $c-font-dim; text-align: left; font-size: 0.9em; } .ply { cursor: pointer; input { margin-right: 0.3em; vertical-align: middle; } } .downloads { @extend %flex-around; margin-bottom: 2em; } }
.study__share { @extend %box-neat; background: $c-bg-box; padding: 1.5em 1.2em; input[type='text'] { font-family: monospace; width: 100%; font-size: 0.9em; } .ply-wrap { color: $c-font-dim; text-align: left; font-size: 0.9em; } .ply { cursor: pointer; input { margin-right: 0.3em; vertical-align: middle; } } .downloads { @extend %flex-center; justify-content: center; margin-bottom: 1.5em; .button { margin: 0 2px 0.5em 2px; } } }
Fix study share button wrapping
Fix study share button wrapping
SCSS
agpl-3.0
arex1337/lila,arex1337/lila,luanlv/lila,luanlv/lila,arex1337/lila,arex1337/lila,arex1337/lila,luanlv/lila,luanlv/lila,arex1337/lila,luanlv/lila,luanlv/lila,luanlv/lila,arex1337/lila
scss
## Code Before: .study__share { @extend %box-neat; background: $c-bg-box; padding: 1.5em 1.2em; input[type='text'] { font-family: monospace; width: 100%; font-size: 0.9em; } .ply-wrap { color: $c-font-dim; text-align: left; font-size: 0.9em; } .ply { cursor: pointer; input { margin-right: 0.3em; vertical-align: middle; } } .downloads { @extend %flex-around; margin-bottom: 2em; } } ## Instruction: Fix study share button wrapping ## Code After: .study__share { @extend %box-neat; background: $c-bg-box; padding: 1.5em 1.2em; input[type='text'] { font-family: monospace; width: 100%; font-size: 0.9em; } .ply-wrap { color: $c-font-dim; text-align: left; font-size: 0.9em; } .ply { cursor: pointer; input { margin-right: 0.3em; vertical-align: middle; } } .downloads { @extend %flex-center; justify-content: center; margin-bottom: 1.5em; .button { margin: 0 2px 0.5em 2px; } } }
.study__share { @extend %box-neat; background: $c-bg-box; padding: 1.5em 1.2em; input[type='text'] { font-family: monospace; width: 100%; font-size: 0.9em; } .ply-wrap { color: $c-font-dim; text-align: left; font-size: 0.9em; } .ply { cursor: pointer; input { margin-right: 0.3em; vertical-align: middle; } } .downloads { - @extend %flex-around; ? ^ ---- + @extend %flex-center; ? ^^^^^ + justify-content: center; - margin-bottom: 2em; ? ^ + margin-bottom: 1.5em; ? ^^^ + + .button { + margin: 0 2px 0.5em 2px; + } } }
9
0.272727
7
2
89b323667c9a869c21bc8c0b5bef5b128a970a5f
api-script-client/int_daily_build/run.sh
api-script-client/int_daily_build/run.sh
set -e; # Stop on error # Declare run specific parameters effectiveDate="2015-01-31" readmeEndDate="2014" isFirstTime=false headless=true extensionName="SNOMED CT International Edition" dataLocation=$1 previousPublishedPackageName="SnomedCT_Release_INT_20140731.zip" productName="SNOMED CT Release" buildName="Int Daily Build" echo "Configuration set to pull export files from $1" # Call api_client source ../api_client.sh
set -e; # Stop on error # Declare run specific parameters effectiveDate="2015-01-31" readmeEndDate="2014" isFirstTime=false headless=true extensionName="SNOMED CT International Edition" dataLocation=$1 previousPublishedPackageName="SnomedCT_Release_INT_20140731.zip" productName="SNOMED CT Release" buildName="Int Daily Build" packageName="Snomed Release Package echo "Configuration set to pull export files from $1" # Call api_client source ../api_client.sh
Package Name must match that being picked up by the daily comparison.
Package Name must match that being picked up by the daily comparison.
Shell
apache-2.0
IHTSDO/snomed-release-service,IHTSDO/snomed-release-service
shell
## Code Before: set -e; # Stop on error # Declare run specific parameters effectiveDate="2015-01-31" readmeEndDate="2014" isFirstTime=false headless=true extensionName="SNOMED CT International Edition" dataLocation=$1 previousPublishedPackageName="SnomedCT_Release_INT_20140731.zip" productName="SNOMED CT Release" buildName="Int Daily Build" echo "Configuration set to pull export files from $1" # Call api_client source ../api_client.sh ## Instruction: Package Name must match that being picked up by the daily comparison. ## Code After: set -e; # Stop on error # Declare run specific parameters effectiveDate="2015-01-31" readmeEndDate="2014" isFirstTime=false headless=true extensionName="SNOMED CT International Edition" dataLocation=$1 previousPublishedPackageName="SnomedCT_Release_INT_20140731.zip" productName="SNOMED CT Release" buildName="Int Daily Build" packageName="Snomed Release Package echo "Configuration set to pull export files from $1" # Call api_client source ../api_client.sh
set -e; # Stop on error # Declare run specific parameters effectiveDate="2015-01-31" readmeEndDate="2014" isFirstTime=false headless=true extensionName="SNOMED CT International Edition" dataLocation=$1 previousPublishedPackageName="SnomedCT_Release_INT_20140731.zip" productName="SNOMED CT Release" buildName="Int Daily Build" + packageName="Snomed Release Package echo "Configuration set to pull export files from $1" # Call api_client source ../api_client.sh
1
0.058824
1
0
dcccf28a67c44c4b864fbda6360b382a190f180f
src/components/Sidebar/index.js
src/components/Sidebar/index.js
import React from 'react'; import LazyLoad from 'react-lazyload'; import './index.scss'; const Sidebar = ({ post = false }) => ( <header className={` intro-header col-lg-2 col-xs-12 order-lg-1 ${post === true ? 'order-md-10 order-10' : 'order-1'} `} > <div className="site-heading text-center"> <div className="about-me"> <LazyLoad height={200}> <img className="avatar" src="https://calpa.me/img/profile.png" alt="Calpa" /> </LazyLoad> <h4>Calpa</h4> <p>夢裡不覺秋已深</p> <p>餘情豈是為他人</p> </div> </div> </header> ); export default Sidebar;
import React from 'react'; import LazyLoad from 'react-lazyload'; import PropTypes from 'prop-types'; import './index.scss'; const Sidebar = ({ post }) => ( <header className={`intro-header col-lg-2 col-xs-12 order-lg-1 ${post === true ? 'order-md-10 order-10' : 'order-1'}`} > <div className="site-heading text-center"> <div className="about-me"> <LazyLoad height={200}> <img className="avatar" src="https://calpa.me/img/profile.png" alt="Calpa" /> </LazyLoad> <h4>Calpa</h4> <p>夢裡不覺秋已深</p> <p>餘情豈是為他人</p> </div> </div> </header> ); Sidebar.propTypes = { post: PropTypes.bool, }; Sidebar.defaultProps = { post: false, }; export default Sidebar;
Fix sidebar classname multi-line problem
Fix sidebar classname multi-line problem
JavaScript
mit
calpa/blog
javascript
## Code Before: import React from 'react'; import LazyLoad from 'react-lazyload'; import './index.scss'; const Sidebar = ({ post = false }) => ( <header className={` intro-header col-lg-2 col-xs-12 order-lg-1 ${post === true ? 'order-md-10 order-10' : 'order-1'} `} > <div className="site-heading text-center"> <div className="about-me"> <LazyLoad height={200}> <img className="avatar" src="https://calpa.me/img/profile.png" alt="Calpa" /> </LazyLoad> <h4>Calpa</h4> <p>夢裡不覺秋已深</p> <p>餘情豈是為他人</p> </div> </div> </header> ); export default Sidebar; ## Instruction: Fix sidebar classname multi-line problem ## Code After: import React from 'react'; import LazyLoad from 'react-lazyload'; import PropTypes from 'prop-types'; import './index.scss'; const Sidebar = ({ post }) => ( <header className={`intro-header col-lg-2 col-xs-12 order-lg-1 ${post === true ? 'order-md-10 order-10' : 'order-1'}`} > <div className="site-heading text-center"> <div className="about-me"> <LazyLoad height={200}> <img className="avatar" src="https://calpa.me/img/profile.png" alt="Calpa" /> </LazyLoad> <h4>Calpa</h4> <p>夢裡不覺秋已深</p> <p>餘情豈是為他人</p> </div> </div> </header> ); Sidebar.propTypes = { post: PropTypes.bool, }; Sidebar.defaultProps = { post: false, }; export default Sidebar;
import React from 'react'; import LazyLoad from 'react-lazyload'; + import PropTypes from 'prop-types'; + import './index.scss'; - const Sidebar = ({ post = false }) => ( ? -------- + const Sidebar = ({ post }) => ( + <header className={`intro-header col-lg-2 col-xs-12 order-lg-1 ${post === true ? 'order-md-10 order-10' : 'order-1'}`} > - <header className={` - intro-header - col-lg-2 - col-xs-12 - order-lg-1 - ${post === true ? 'order-md-10 order-10' : 'order-1'} - `} - > <div className="site-heading text-center"> <div className="about-me"> <LazyLoad height={200}> <img className="avatar" src="https://calpa.me/img/profile.png" alt="Calpa" /> </LazyLoad> <h4>Calpa</h4> <p>夢裡不覺秋已深</p> <p>餘情豈是為他人</p> </div> </div> </header> ); + Sidebar.propTypes = { + post: PropTypes.bool, + }; + + Sidebar.defaultProps = { + post: false, + }; + export default Sidebar;
21
0.65625
12
9
fe8225bbfcb63e6db0ecd4227a61dde226a369b7
applications/calendar/src/app/helpers/timezoneSuggestion.ts
applications/calendar/src/app/helpers/timezoneSuggestion.ts
import { SHA256, binaryStringToArray, arrayToHexString } from 'pmcrypto'; const DAY_IN_MILLISECONDS = 86400000; const LOCALSTORAGE_TZ_KEY = 'tzSuggestion'; export const getTimezoneSuggestionKey = async (userID: string) => { const value = await SHA256(binaryStringToArray(`${LOCALSTORAGE_TZ_KEY}${userID}`)); return arrayToHexString(value); }; export const getLastTimezoneSuggestion = (key: string) => { const defaultDate = new Date(2000, 0, 1); try { const lastSuggestion = parseInt(`${window.localStorage.getItem(key)}`, 10); const date = new Date(lastSuggestion); if (Number.isNaN(+date)) { return defaultDate; } return date; } catch (e) { return defaultDate; } }; export const saveLastTimezoneSuggestion = (key: string) => { try { const timestamp = +new Date(); window.localStorage.setItem(key, `${timestamp}`); // eslint-disable-next-line no-empty } catch (e) {} }; export const canAskTimezoneSuggestion = (key: string) => { return Date.now() - +getLastTimezoneSuggestion(key) >= DAY_IN_MILLISECONDS; };
import { getSHA256String } from 'proton-shared/lib/helpers/hash'; const DAY_IN_MILLISECONDS = 86400000; const LOCALSTORAGE_TZ_KEY = 'tzSuggestion'; export const getTimezoneSuggestionKey = async (userID: string) => { return getSHA256String(`${LOCALSTORAGE_TZ_KEY}${userID}`); }; export const getLastTimezoneSuggestion = (key: string) => { const defaultDate = new Date(2000, 0, 1); try { const lastSuggestion = parseInt(`${window.localStorage.getItem(key)}`, 10); const date = new Date(lastSuggestion); if (Number.isNaN(+date)) { return defaultDate; } return date; } catch (e) { return defaultDate; } }; export const saveLastTimezoneSuggestion = (key: string) => { try { const timestamp = +new Date(); window.localStorage.setItem(key, `${timestamp}`); // eslint-disable-next-line no-empty } catch (e) {} }; export const canAskTimezoneSuggestion = (key: string) => { return Date.now() - +getLastTimezoneSuggestion(key) >= DAY_IN_MILLISECONDS; };
Use sha256 helper from proton-shared
Use sha256 helper from proton-shared
TypeScript
mit
ProtonMail/WebClient,ProtonMail/WebClient,ProtonMail/WebClient
typescript
## Code Before: import { SHA256, binaryStringToArray, arrayToHexString } from 'pmcrypto'; const DAY_IN_MILLISECONDS = 86400000; const LOCALSTORAGE_TZ_KEY = 'tzSuggestion'; export const getTimezoneSuggestionKey = async (userID: string) => { const value = await SHA256(binaryStringToArray(`${LOCALSTORAGE_TZ_KEY}${userID}`)); return arrayToHexString(value); }; export const getLastTimezoneSuggestion = (key: string) => { const defaultDate = new Date(2000, 0, 1); try { const lastSuggestion = parseInt(`${window.localStorage.getItem(key)}`, 10); const date = new Date(lastSuggestion); if (Number.isNaN(+date)) { return defaultDate; } return date; } catch (e) { return defaultDate; } }; export const saveLastTimezoneSuggestion = (key: string) => { try { const timestamp = +new Date(); window.localStorage.setItem(key, `${timestamp}`); // eslint-disable-next-line no-empty } catch (e) {} }; export const canAskTimezoneSuggestion = (key: string) => { return Date.now() - +getLastTimezoneSuggestion(key) >= DAY_IN_MILLISECONDS; }; ## Instruction: Use sha256 helper from proton-shared ## Code After: import { getSHA256String } from 'proton-shared/lib/helpers/hash'; const DAY_IN_MILLISECONDS = 86400000; const LOCALSTORAGE_TZ_KEY = 'tzSuggestion'; export const getTimezoneSuggestionKey = async (userID: string) => { return getSHA256String(`${LOCALSTORAGE_TZ_KEY}${userID}`); }; export const getLastTimezoneSuggestion = (key: string) => { const defaultDate = new Date(2000, 0, 1); try { const lastSuggestion = parseInt(`${window.localStorage.getItem(key)}`, 10); const date = new Date(lastSuggestion); if (Number.isNaN(+date)) { return defaultDate; } return date; } catch (e) { return defaultDate; } }; export const saveLastTimezoneSuggestion = (key: string) => { try { const timestamp = +new Date(); window.localStorage.setItem(key, `${timestamp}`); // eslint-disable-next-line no-empty } catch (e) {} }; export const canAskTimezoneSuggestion = (key: string) => { return Date.now() - +getLastTimezoneSuggestion(key) >= DAY_IN_MILLISECONDS; };
- import { SHA256, binaryStringToArray, arrayToHexString } from 'pmcrypto'; + import { getSHA256String } from 'proton-shared/lib/helpers/hash'; const DAY_IN_MILLISECONDS = 86400000; const LOCALSTORAGE_TZ_KEY = 'tzSuggestion'; export const getTimezoneSuggestionKey = async (userID: string) => { + return getSHA256String(`${LOCALSTORAGE_TZ_KEY}${userID}`); - const value = await SHA256(binaryStringToArray(`${LOCALSTORAGE_TZ_KEY}${userID}`)); - return arrayToHexString(value); }; export const getLastTimezoneSuggestion = (key: string) => { const defaultDate = new Date(2000, 0, 1); try { const lastSuggestion = parseInt(`${window.localStorage.getItem(key)}`, 10); const date = new Date(lastSuggestion); if (Number.isNaN(+date)) { return defaultDate; } return date; } catch (e) { return defaultDate; } }; export const saveLastTimezoneSuggestion = (key: string) => { try { const timestamp = +new Date(); window.localStorage.setItem(key, `${timestamp}`); // eslint-disable-next-line no-empty } catch (e) {} }; export const canAskTimezoneSuggestion = (key: string) => { return Date.now() - +getLastTimezoneSuggestion(key) >= DAY_IN_MILLISECONDS; };
5
0.142857
2
3
2b73139732663f8099d993b558f05f9ae129564c
ci_environment/phpenv/attributes/default.rb
ci_environment/phpenv/attributes/default.rb
default[:phpenv] = { :git => { :repository => "git://github.com/CHH/phpenv.git", :revision => "01a2c1e25096f8ff10f2f781428a5d470e1ecaba" } }
default[:phpenv] = { :git => { :repository => "git://github.com/CHH/phpenv.git", :revision => "44f89b8d124386d9920a2ae747caff288cf4d64c" } }
Update "phpenv" to the latest commit
Update "phpenv" to the latest commit
Ruby
mit
dracos/travis-cookbooks,dracos/travis-cookbooks,tianon/travis-cookbooks,Distelli/travis-cookbooks,Acidburn0zzz/travis-cookbooks,Zarthus/travis-cookbooks,Distelli/travis-cookbooks,ardock/travis-cookbooks,ardock/travis-cookbooks,gavioto/travis-cookbooks,travis-ci/travis-cookbooks,johanneswuerbach/travis-cookbooks,Distelli/travis-cookbooks,johanneswuerbach/travis-cookbooks,DanielG/travis-cookbooks,bd808/travis-cookbooks,vinaykaradia/travis-cookbook-cloned,dracos/travis-cookbooks,Acidburn0zzz/travis-cookbooks,gavioto/travis-cookbooks,gavioto/travis-cookbooks,bd808/travis-cookbooks,ardock/travis-cookbooks,dracos/travis-cookbooks,travis-ci/travis-cookbooks,Zarthus/travis-cookbooks,spurti-chopra/travis-cookbooks,DanielG/travis-cookbooks,spurti-chopra/travis-cookbooks,johanneswuerbach/travis-cookbooks,Zarthus/travis-cookbooks,tianon/travis-cookbooks,vinaykaradia/travis-cookbook-cloned,ljharb/travis-cookbooks,tianon/travis-cookbooks,ardock/travis-cookbooks,Zarthus/travis-cookbooks,Distelli/travis-cookbooks,tianon/travis-cookbooks,vinaykaradia/travis-cookbook-cloned,ljharb/travis-cookbooks,spurti-chopra/travis-cookbooks,travis-ci/travis-cookbooks,gavioto/travis-cookbooks,DanielG/travis-cookbooks,vinaykaradia/travis-cookbook-cloned,Acidburn0zzz/travis-cookbooks,Acidburn0zzz/travis-cookbooks,vinaykaradia/travis-cookbook-cloned,tianon/travis-cookbooks,bd808/travis-cookbooks,ljharb/travis-cookbooks,DanielG/travis-cookbooks
ruby
## Code Before: default[:phpenv] = { :git => { :repository => "git://github.com/CHH/phpenv.git", :revision => "01a2c1e25096f8ff10f2f781428a5d470e1ecaba" } } ## Instruction: Update "phpenv" to the latest commit ## Code After: default[:phpenv] = { :git => { :repository => "git://github.com/CHH/phpenv.git", :revision => "44f89b8d124386d9920a2ae747caff288cf4d64c" } }
default[:phpenv] = { :git => { :repository => "git://github.com/CHH/phpenv.git", - :revision => "01a2c1e25096f8ff10f2f781428a5d470e1ecaba" + :revision => "44f89b8d124386d9920a2ae747caff288cf4d64c" } }
2
0.333333
1
1
b4aaeaac7e5862dee254d72e063f3edf23e526a5
spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedContext.java
spring-boot/src/main/java/org/springframework/boot/context/embedded/tomcat/TomcatEmbeddedContext.java
/* * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.context.embedded.tomcat; import org.apache.catalina.Container; import org.apache.catalina.core.StandardContext; /** * Tomcat {@link StandardContext} used by {@link TomcatEmbeddedServletContainer} to * support deferred initialization. * * @author Phillip Webb */ class TomcatEmbeddedContext extends StandardContext { @Override public void loadOnStartup(Container[] children) { } public void deferredLoadOnStartup() { super.loadOnStartup(findChildren()); } }
/* * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.context.embedded.tomcat; import org.apache.catalina.Container; import org.apache.catalina.core.StandardContext; import org.springframework.util.ClassUtils; /** * Tomcat {@link StandardContext} used by {@link TomcatEmbeddedServletContainer} to * support deferred initialization. * * @author Phillip Webb */ class TomcatEmbeddedContext extends StandardContext { @Override public void loadOnStartup(Container[] children) { } public void deferredLoadOnStartup() { // Some older Servlet frameworks (e.g. Struts, BIRT) use the Thread context class // loader to create servlet instances in this phase. If they do that and then try // to initialize them later the class loader may have changed, so wrap the call to // loadOnStartup in what we think its going to be the main webapp classloader at // runtime. ClassLoader classLoader = getLoader().getClassLoader(); ClassLoader existingLoader = null; if (classLoader != null) { existingLoader = ClassUtils.overrideThreadContextClassLoader(classLoader); } super.loadOnStartup(findChildren()); if (existingLoader != null) { ClassUtils.overrideThreadContextClassLoader(existingLoader); } } }
Set Thread context class loader while Tomcat starts up
Set Thread context class loader while Tomcat starts up Fixes gh-1085
Java
apache-2.0
imranansari/spring-boot,wwadge/spring-boot,Charkui/spring-boot,ydsakyclguozi/spring-boot,SaravananParthasarathy/SPSDemo,jxblum/spring-boot,tbbost/spring-boot,jayarampradhan/spring-boot,balajinsr/spring-boot,buobao/spring-boot,nebhale/spring-boot,ChunPIG/spring-boot,ractive/spring-boot,donhuvy/spring-boot,drumonii/spring-boot,jrrickard/spring-boot,RainPlanter/spring-boot,PraveenkumarShethe/spring-boot,lexandro/spring-boot,xialeizhou/spring-boot,roymanish/spring-boot,roberthafner/spring-boot,marcellodesales/spring-boot,mosen11/spring-boot,vpavic/spring-boot,qerub/spring-boot,paweldolecinski/spring-boot,afroje-reshma/spring-boot-sample,RichardCSantana/spring-boot,nevenc-pivotal/spring-boot,rajendra-chola/jenkins2-course-spring-boot,MrMitchellMoore/spring-boot,yhj630520/spring-boot,ApiSecRay/spring-boot,habuma/spring-boot,yangdd1205/spring-boot,johnktims/spring-boot,end-user/spring-boot,pvorb/spring-boot,johnktims/spring-boot,olivergierke/spring-boot,felipeg48/spring-boot,murilobr/spring-boot,panbiping/spring-boot,durai145/spring-boot,jjankar/spring-boot,rizwan18/spring-boot,lburgazzoli/spring-boot,satheeshmb/spring-boot,Makhlab/spring-boot,linead/spring-boot,royclarkson/spring-boot,axelfontaine/spring-boot,nghiavo/spring-boot,panbiping/spring-boot,bjornlindstrom/spring-boot,nghialunhaiha/spring-boot,gauravbrills/spring-boot,ollie314/spring-boot,DONIKAN/spring-boot,jeremiahmarks/spring-boot,M3lkior/spring-boot,playleud/spring-boot,paddymahoney/spring-boot,playleud/spring-boot,nghiavo/spring-boot,Nowheresly/spring-boot,cleverjava/jenkins2-course-spring-boot,nevenc-pivotal/spring-boot,smilence1986/spring-boot,sebastiankirsch/spring-boot,sbuettner/spring-boot,olivergierke/spring-boot,RobertNickens/spring-boot,shangyi0102/spring-boot,trecloux/spring-boot,xingguang2013/spring-boot,raiamber1/spring-boot,imranansari/spring-boot,vandan16/Vandan,gauravbrills/spring-boot,AstaTus/spring-boot,lucassaldanha/spring-boot,herau/spring-boot,lcardito/spring-boot,neo4j-contrib/spring-boot,meloncocoo/spring-boot,minmay/spring-boot,durai145/spring-boot,master-slave/spring-boot,nebhale/spring-boot,5zzang/spring-boot,navarrogabriela/spring-boot,mosoft521/spring-boot,xingguang2013/spring-boot,zhanhb/spring-boot,joshiste/spring-boot,mbenson/spring-boot,herau/spring-boot,xingguang2013/spring-boot,spring-projects/spring-boot,izeye/spring-boot,sungha/spring-boot,xialeizhou/spring-boot,wilkinsona/spring-boot,izestrea/spring-boot,nevenc-pivotal/spring-boot,RichardCSantana/spring-boot,prasenjit-net/spring-boot,durai145/spring-boot,crackien/spring-boot,sebastiankirsch/spring-boot,huangyugui/spring-boot,xc145214/spring-boot,AstaTus/spring-boot,playleud/spring-boot,existmaster/spring-boot,izeye/spring-boot,jeremiahmarks/spring-boot,nevenc-pivotal/spring-boot,jxblum/spring-boot,lokbun/spring-boot,raiamber1/spring-boot,lburgazzoli/spring-boot,murilobr/spring-boot,coolcao/spring-boot,Xaerxess/spring-boot,fogone/spring-boot,bclozel/spring-boot,jxblum/spring-boot,mouadtk/spring-boot,dnsw83/spring-boot,donhuvy/spring-boot,mbenson/spring-boot,sungha/spring-boot,tbbost/spring-boot,mbrukman/spring-boot,lenicliu/spring-boot,clarklj001/spring-boot,frost2014/spring-boot,hklv/spring-boot,afroje-reshma/spring-boot-sample,philwebb/spring-boot,npcode/spring-boot,5zzang/spring-boot,trecloux/spring-boot,mrumpf/spring-boot,eddumelendez/spring-boot,qerub/spring-boot,javyzheng/spring-boot,fireshort/spring-boot,tiarebalbi/spring-boot,AngusZhu/spring-boot,nghiavo/spring-boot,nghialunhaiha/spring-boot,donhuvy/spring-boot,xc145214/spring-boot,npcode/spring-boot,mabernardo/spring-boot,joansmith/spring-boot,JiweiWong/spring-boot,ilayaperumalg/spring-boot,tbadie/spring-boot,eddumelendez/spring-boot,SaravananParthasarathy/SPSDemo,jcastaldoFoodEssentials/spring-boot,yuxiaole/spring-boot,mrumpf/spring-boot,Chomeh/spring-boot,kdvolder/spring-boot,paweldolecinski/spring-boot,orangesdk/spring-boot,drunklite/spring-boot,ractive/spring-boot,fjlopez/spring-boot,michael-simons/spring-boot,javyzheng/spring-boot,coolcao/spring-boot,linead/spring-boot,xc145214/spring-boot,izestrea/spring-boot,smayoorans/spring-boot,shakuzen/spring-boot,vpavic/spring-boot,JiweiWong/spring-boot,imranansari/spring-boot,tbadie/spring-boot,bclozel/spring-boot,neo4j-contrib/spring-boot,nebhale/spring-boot,nandakishorm/spring-boot,lokbun/spring-boot,frost2014/spring-boot,lokbun/spring-boot,xialeizhou/spring-boot,lenicliu/spring-boot,bbrouwer/spring-boot,yunbian/spring-boot,tiarebalbi/spring-boot,gregturn/spring-boot,domix/spring-boot,duandf35/spring-boot,royclarkson/spring-boot,prasenjit-net/spring-boot,meftaul/spring-boot,zorosteven/spring-boot,kamilszymanski/spring-boot,5zzang/spring-boot,NetoDevel/spring-boot,ilayaperumalg/spring-boot,meloncocoo/spring-boot,Buzzardo/spring-boot,fireshort/spring-boot,M3lkior/spring-boot,simonnordberg/spring-boot,SaravananParthasarathy/SPSDemo,duandf35/spring-boot,designreuse/spring-boot,mrumpf/spring-boot,joshiste/spring-boot,gregturn/spring-boot,ollie314/spring-boot,cbtpro/spring-boot,thomasdarimont/spring-boot,htynkn/spring-boot,soul2zimate/spring-boot,forestqqqq/spring-boot,navarrogabriela/spring-boot,ihoneymon/spring-boot,qq83387856/spring-boot,mabernardo/spring-boot,rweisleder/spring-boot,DONIKAN/spring-boot,brettwooldridge/spring-boot,jmnarloch/spring-boot,donthadineshkumar/spring-boot,wilkinsona/spring-boot,afroje-reshma/spring-boot-sample,jrrickard/spring-boot,mevasaroj/jenkins2-course-spring-boot,xdweleven/spring-boot,SaravananParthasarathy/SPSDemo,axelfontaine/spring-boot,isopov/spring-boot,sungha/spring-boot,bjornlindstrom/spring-boot,jack-luj/spring-boot,xiaoleiPENG/my-project,durai145/spring-boot,akmaharshi/jenkins,MrMitchellMoore/spring-boot,vpavic/spring-boot,AngusZhu/spring-boot,rmoorman/spring-boot,liupugong/spring-boot,mabernardo/spring-boot,fulvio-m/spring-boot,hklv/spring-boot,nelswadycki/spring-boot,mouadtk/spring-boot,cmsandiga/spring-boot,ydsakyclguozi/spring-boot,hqrt/jenkins2-course-spring-boot,prakashme/spring-boot,sankin/spring-boot,joansmith/spring-boot,izeye/spring-boot,RobertNickens/spring-boot,nurkiewicz/spring-boot,drunklite/spring-boot,kayelau/spring-boot,donthadineshkumar/spring-boot,jorgepgjr/spring-boot,jvz/spring-boot,linead/spring-boot,roberthafner/spring-boot,forestqqqq/spring-boot,jjankar/spring-boot,hello2009chen/spring-boot,shangyi0102/spring-boot,nelswadycki/spring-boot,M3lkior/spring-boot,jayeshmuralidharan/spring-boot,hqrt/jenkins2-course-spring-boot,prasenjit-net/spring-boot,michael-simons/spring-boot,master-slave/spring-boot,jbovet/spring-boot,sbcoba/spring-boot,wilkinsona/spring-boot,tiarebalbi/spring-boot,eric-stanley/spring-boot,nebhale/spring-boot,chrylis/spring-boot,fulvio-m/spring-boot,jrrickard/spring-boot,frost2014/spring-boot,axibase/spring-boot,ollie314/spring-boot,mackeprm/spring-boot,dnsw83/spring-boot,playleud/spring-boot,smilence1986/spring-boot,lucassaldanha/spring-boot,vandan16/Vandan,srikalyan/spring-boot,patrikbeno/spring-boot,5zzang/spring-boot,qq83387856/spring-boot,na-na/spring-boot,damoyang/spring-boot,nisuhw/spring-boot,designreuse/spring-boot,candrews/spring-boot,eonezhang/spring-boot,chrylis/spring-boot,balajinsr/spring-boot,clarklj001/spring-boot,durai145/spring-boot,isopov/spring-boot,duandf35/spring-boot,hello2009chen/spring-boot,kdvolder/spring-boot,ralenmandao/spring-boot,hehuabing/spring-boot,Nowheresly/spring-boot,lenicliu/spring-boot,fogone/spring-boot,nurkiewicz/spring-boot,mike-kukla/spring-boot,RainPlanter/spring-boot,bjornlindstrom/spring-boot,htynkn/spring-boot,nandakishorm/spring-boot,damoyang/spring-boot,axibase/spring-boot,nurkiewicz/spring-boot,xwjxwj30abc/spring-boot,PraveenkumarShethe/spring-boot,5zzang/spring-boot,frost2014/spring-boot,olivergierke/spring-boot,orangesdk/spring-boot,kayelau/spring-boot,vakninr/spring-boot,gauravbrills/spring-boot,mike-kukla/spring-boot,dreis2211/spring-boot,mbnshankar/spring-boot,buobao/spring-boot,liupd/spring-boot,mohican0607/spring-boot,philwebb/spring-boot,PraveenkumarShethe/spring-boot,snicoll/spring-boot,ralenmandao/spring-boot,pvorb/spring-boot,Chomeh/spring-boot,end-user/spring-boot,M3lkior/spring-boot,na-na/spring-boot,christian-posta/spring-boot,sungha/spring-boot,philwebb/spring-boot-concourse,prasenjit-net/spring-boot,mohican0607/spring-boot,jayeshmuralidharan/spring-boot,htynkn/spring-boot,scottfrederick/spring-boot,nisuhw/spring-boot,navarrogabriela/spring-boot,fjlopez/spring-boot,mackeprm/spring-boot,mohican0607/spring-boot,lif123/spring-boot,dfa1/spring-boot,vakninr/spring-boot,drumonii/spring-boot,lburgazzoli/spring-boot,AngusZhu/spring-boot,meloncocoo/spring-boot,SPNilsen/spring-boot,Pokbab/spring-boot,mouadtk/spring-boot,tbbost/spring-boot,i007422/jenkins2-course-spring-boot,philwebb/spring-boot-concourse,lingounet/spring-boot,RobertNickens/spring-boot,kamilszymanski/spring-boot,eonezhang/spring-boot,rams2588/spring-boot,imranansari/spring-boot,artembilan/spring-boot,philwebb/spring-boot,166yuan/spring-boot,dnsw83/spring-boot,mbenson/spring-boot,javyzheng/spring-boot,paddymahoney/spring-boot,Nowheresly/spring-boot,mbogoevici/spring-boot,cmsandiga/spring-boot,murilobr/spring-boot,srikalyan/spring-boot,keithsjohnson/spring-boot,DONIKAN/spring-boot,mackeprm/spring-boot,sbcoba/spring-boot,wilkinsona/spring-boot,linead/spring-boot,gorcz/spring-boot,okba1/spring-boot,johnktims/spring-boot,dfa1/spring-boot,jorgepgjr/spring-boot,meftaul/spring-boot,mbenson/spring-boot,AstaTus/spring-boot,keithsjohnson/spring-boot,kamilszymanski/spring-boot,10045125/spring-boot,dreis2211/spring-boot,VitDevelop/spring-boot,ihoneymon/spring-boot,lokbun/spring-boot,Buzzardo/spring-boot,gregturn/spring-boot,roberthafner/spring-boot,rickeysu/spring-boot,jforge/spring-boot,xc145214/spring-boot,joansmith/spring-boot,rizwan18/spring-boot,yhj630520/spring-boot,rstirling/spring-boot,joansmith/spring-boot,mbnshankar/spring-boot,fogone/spring-boot,tan9/spring-boot,neo4j-contrib/spring-boot,cbtpro/spring-boot,bbrouwer/spring-boot,liupugong/spring-boot,Makhlab/spring-boot,NetoDevel/spring-boot,crackien/spring-boot,ApiSecRay/spring-boot,mohican0607/spring-boot,jayarampradhan/spring-boot,okba1/spring-boot,paweldolecinski/spring-boot,cleverjava/jenkins2-course-spring-boot,wwadge/spring-boot,buobao/spring-boot,mdeinum/spring-boot,Buzzardo/spring-boot,sebastiankirsch/spring-boot,mosoft521/spring-boot,JiweiWong/spring-boot,zhangshuangquan/spring-root,tsachev/spring-boot,frost2014/spring-boot,scottfrederick/spring-boot,duandf35/spring-boot,dreis2211/spring-boot,qerub/spring-boot,meloncocoo/spring-boot,vaseemahmed01/spring-boot,philwebb/spring-boot-concourse,cleverjava/jenkins2-course-spring-boot,akmaharshi/jenkins,royclarkson/spring-boot,jbovet/spring-boot,eric-stanley/spring-boot,lingounet/spring-boot,smilence1986/spring-boot,SaravananParthasarathy/SPSDemo,izestrea/spring-boot,smayoorans/spring-boot,peteyan/spring-boot,nebhale/spring-boot,royclarkson/spring-boot,vandan16/Vandan,afroje-reshma/spring-boot-sample,shakuzen/spring-boot,ralenmandao/spring-boot,auvik/spring-boot,i007422/jenkins2-course-spring-boot,designreuse/spring-boot,bclozel/spring-boot,srikalyan/spring-boot,zorosteven/spring-boot,gauravbrills/spring-boot,kayelau/spring-boot,chrylis/spring-boot,akmaharshi/jenkins,ydsakyclguozi/spring-boot,DONIKAN/spring-boot,sbuettner/spring-boot,liupugong/spring-boot,mosen11/spring-boot,peteyan/spring-boot,fjlopez/spring-boot,sankin/spring-boot,eliudiaz/spring-boot,tsachev/spring-boot,mackeprm/spring-boot,mosen11/spring-boot,rweisleder/spring-boot,rizwan18/spring-boot,VitDevelop/spring-boot,michael-simons/spring-boot,johnktims/spring-boot,cleverjava/jenkins2-course-spring-boot,tan9/spring-boot,okba1/spring-boot,sungha/spring-boot,yuxiaole/spring-boot,xiaoleiPENG/my-project,jbovet/spring-boot,lingounet/spring-boot,jmnarloch/spring-boot,ameraljovic/spring-boot,yunbian/spring-boot,jbovet/spring-boot,htynkn/spring-boot,xiaoleiPENG/my-project,thomasdarimont/spring-boot,npcode/spring-boot,ihoneymon/spring-boot,eliudiaz/spring-boot,sebastiankirsch/spring-boot,mevasaroj/jenkins2-course-spring-boot,zorosteven/spring-boot,rams2588/spring-boot,dnsw83/spring-boot,Xaerxess/spring-boot,bclozel/spring-boot,rweisleder/spring-boot,brettwooldridge/spring-boot,jeremiahmarks/spring-boot,master-slave/spring-boot,Charkui/spring-boot,huangyugui/spring-boot,scottfrederick/spring-boot,prakashme/spring-boot,prasenjit-net/spring-boot,soul2zimate/spring-boot,roymanish/spring-boot,axelfontaine/spring-boot,mbogoevici/spring-boot,jorgepgjr/spring-boot,paweldolecinski/spring-boot,fireshort/spring-boot,felipeg48/spring-boot,brettwooldridge/spring-boot,166yuan/spring-boot,mosoft521/spring-boot,joshiste/spring-boot,minmay/spring-boot,SPNilsen/spring-boot,jayeshmuralidharan/spring-boot,MasterRoots/spring-boot,Nowheresly/spring-boot,ptahchiev/spring-boot,spring-projects/spring-boot,jjankar/spring-boot,gorcz/spring-boot,rmoorman/spring-boot,jjankar/spring-boot,eliudiaz/spring-boot,prakashme/spring-boot,ojacquemart/spring-boot,meftaul/spring-boot,dfa1/spring-boot,allyjunio/spring-boot,tbbost/spring-boot,DeezCashews/spring-boot,mevasaroj/jenkins2-course-spring-boot,krmcbride/spring-boot,rajendra-chola/jenkins2-course-spring-boot,RobertNickens/spring-boot,deki/spring-boot,damoyang/spring-boot,akmaharshi/jenkins,olivergierke/spring-boot,lexandro/spring-boot,rizwan18/spring-boot,isopov/spring-boot,peteyan/spring-boot,drumonii/spring-boot,DeezCashews/spring-boot,hehuabing/spring-boot,ameraljovic/spring-boot,bbrouwer/spring-boot,roberthafner/spring-boot,thomasdarimont/spring-boot,liupugong/spring-boot,tan9/spring-boot,fogone/spring-boot,hklv/spring-boot,Makhlab/spring-boot,neo4j-contrib/spring-boot,xwjxwj30abc/spring-boot,izestrea/spring-boot,kdvolder/spring-boot,clarklj001/spring-boot,bijukunjummen/spring-boot,RichardCSantana/spring-boot,zhanhb/spring-boot,mdeinum/spring-boot,buobao/spring-boot,xiaoleiPENG/my-project,soul2zimate/spring-boot,mosoft521/spring-boot,ameraljovic/spring-boot,xdweleven/spring-boot,philwebb/spring-boot,master-slave/spring-boot,minmay/spring-boot,mbrukman/spring-boot,eliudiaz/spring-boot,nandakishorm/spring-boot,raiamber1/spring-boot,eddumelendez/spring-boot,ChunPIG/spring-boot,habuma/spring-boot,snicoll/spring-boot,jforge/spring-boot,keithsjohnson/spring-boot,Charkui/spring-boot,MasterRoots/spring-boot,ralenmandao/spring-boot,mebinjacob/spring-boot,ApiSecRay/spring-boot,wwadge/spring-boot,coolcao/spring-boot,lenicliu/spring-boot,yuxiaole/spring-boot,Nowheresly/spring-boot,kiranbpatil/spring-boot,pnambiarsf/spring-boot,clarklj001/spring-boot,tsachev/spring-boot,zhanhb/spring-boot,SPNilsen/spring-boot,MasterRoots/spring-boot,patrikbeno/spring-boot,jorgepgjr/spring-boot,candrews/spring-boot,rmoorman/spring-boot,drumonii/spring-boot,rstirling/spring-boot,jayarampradhan/spring-boot,existmaster/spring-boot,pvorb/spring-boot,nareshmiriyala/spring-boot,christian-posta/spring-boot,philwebb/spring-boot-concourse,raiamber1/spring-boot,marcellodesales/spring-boot,mosen11/spring-boot,DONIKAN/spring-boot,drunklite/spring-boot,gauravbrills/spring-boot,deki/spring-boot,existmaster/spring-boot,jmnarloch/spring-boot,lcardito/spring-boot,sbuettner/spring-boot,SPNilsen/spring-boot,ApiSecRay/spring-boot,marcellodesales/spring-boot,wilkinsona/spring-boot,joshthornhill/spring-boot,yhj630520/spring-boot,raiamber1/spring-boot,donthadineshkumar/spring-boot,jack-luj/spring-boot,ilayaperumalg/spring-boot,isopov/spring-boot,mike-kukla/spring-boot,fulvio-m/spring-boot,htynkn/spring-boot,jayarampradhan/spring-boot,lif123/spring-boot,sebastiankirsch/spring-boot,patrikbeno/spring-boot,kiranbpatil/spring-boot,nelswadycki/spring-boot,roymanish/spring-boot,smilence1986/spring-boot,jayeshmuralidharan/spring-boot,NetoDevel/spring-boot,habuma/spring-boot,felipeg48/spring-boot,philwebb/spring-boot,tbadie/spring-boot,rams2588/spring-boot,joshiste/spring-boot,existmaster/spring-boot,hehuabing/spring-boot,hello2009chen/spring-boot,ihoneymon/spring-boot,joshthornhill/spring-boot,166yuan/spring-boot,gorcz/spring-boot,kdvolder/spring-boot,jmnarloch/spring-boot,vakninr/spring-boot,jjankar/spring-boot,mebinjacob/spring-boot,jcastaldoFoodEssentials/spring-boot,philwebb/spring-boot-concourse,kdvolder/spring-boot,hello2009chen/spring-boot,zorosteven/spring-boot,fulvio-m/spring-boot,kdvolder/spring-boot,jayeshmuralidharan/spring-boot,lburgazzoli/spring-boot,ilayaperumalg/spring-boot,fogone/spring-boot,ihoneymon/spring-boot,yunbian/spring-boot,jack-luj/spring-boot,jvz/spring-boot,existmaster/spring-boot,domix/spring-boot,snicoll/spring-boot,MasterRoots/spring-boot,joshiste/spring-boot,xc145214/spring-boot,liupd/spring-boot,balajinsr/spring-boot,end-user/spring-boot,satheeshmb/spring-boot,yunbian/spring-boot,MasterRoots/spring-boot,shangyi0102/spring-boot,sankin/spring-boot,afroje-reshma/spring-boot-sample,ihoneymon/spring-boot,jforge/spring-boot,zhangshuangquan/spring-root,aahlenst/spring-boot,donhuvy/spring-boot,mabernardo/spring-boot,chrylis/spring-boot,ydsakyclguozi/spring-boot,meftaul/spring-boot,zhangshuangquan/spring-root,linead/spring-boot,PraveenkumarShethe/spring-boot,vandan16/Vandan,trecloux/spring-boot,eddumelendez/spring-boot,pnambiarsf/spring-boot,166yuan/spring-boot,ollie314/spring-boot,dreis2211/spring-boot,ralenmandao/spring-boot,kiranbpatil/spring-boot,eonezhang/spring-boot,hello2009chen/spring-boot,ptahchiev/spring-boot,christian-posta/spring-boot,ptahchiev/spring-boot,ApiSecRay/spring-boot,liupugong/spring-boot,philwebb/spring-boot,Buzzardo/spring-boot,Charkui/spring-boot,murilobr/spring-boot,designreuse/spring-boot,M3lkior/spring-boot,pvorb/spring-boot,felipeg48/spring-boot,ractive/spring-boot,xwjxwj30abc/spring-boot,nisuhw/spring-boot,eliudiaz/spring-boot,cbtpro/spring-boot,kamilszymanski/spring-boot,candrews/spring-boot,rmoorman/spring-boot,yuxiaole/spring-boot,xwjxwj30abc/spring-boot,lcardito/spring-boot,habuma/spring-boot,Buzzardo/spring-boot,pvorb/spring-boot,tiarebalbi/spring-boot,mike-kukla/spring-boot,herau/spring-boot,fireshort/spring-boot,bijukunjummen/spring-boot,fireshort/spring-boot,i007422/jenkins2-course-spring-boot,navarrogabriela/spring-boot,qq83387856/spring-boot,shakuzen/spring-boot,christian-posta/spring-boot,liupd/spring-boot,vakninr/spring-boot,eric-stanley/spring-boot,ilayaperumalg/spring-boot,mebinjacob/spring-boot,ollie314/spring-boot,jxblum/spring-boot,nghiavo/spring-boot,patrikbeno/spring-boot,sankin/spring-boot,hqrt/jenkins2-course-spring-boot,hklv/spring-boot,pnambiarsf/spring-boot,mbrukman/spring-boot,cmsandiga/spring-boot,lif123/spring-boot,srinivasan01/spring-boot,xialeizhou/spring-boot,crackien/spring-boot,mackeprm/spring-boot,aahlenst/spring-boot,orangesdk/spring-boot,xdweleven/spring-boot,neo4j-contrib/spring-boot,drumonii/spring-boot,christian-posta/spring-boot,Xaerxess/spring-boot,nareshmiriyala/spring-boot,lburgazzoli/spring-boot,Chomeh/spring-boot,aahlenst/spring-boot,ractive/spring-boot,NetoDevel/spring-boot,Makhlab/spring-boot,PraveenkumarShethe/spring-boot,joshthornhill/spring-boot,michael-simons/spring-boot,ractive/spring-boot,kayelau/spring-boot,lokbun/spring-boot,sbuettner/spring-boot,Chomeh/spring-boot,vpavic/spring-boot,yhj630520/spring-boot,nevenc-pivotal/spring-boot,rickeysu/spring-boot,mbogoevici/spring-boot,AngusZhu/spring-boot,Pokbab/spring-boot,rajendra-chola/jenkins2-course-spring-boot,axibase/spring-boot,joshthornhill/spring-boot,chrylis/spring-boot,olivergierke/spring-boot,AngusZhu/spring-boot,felipeg48/spring-boot,dreis2211/spring-boot,JiweiWong/spring-boot,smilence1986/spring-boot,ojacquemart/spring-boot,jayarampradhan/spring-boot,michael-simons/spring-boot,vpavic/spring-boot,eric-stanley/spring-boot,orangesdk/spring-boot,mouadtk/spring-boot,gorcz/spring-boot,prakashme/spring-boot,auvik/spring-boot,mdeinum/spring-boot,mohican0607/spring-boot,mouadtk/spring-boot,cleverjava/jenkins2-course-spring-boot,end-user/spring-boot,fjlopez/spring-boot,panbiping/spring-boot,Charkui/spring-boot,vakninr/spring-boot,javyzheng/spring-boot,hehuabing/spring-boot,rickeysu/spring-boot,mbnshankar/spring-boot,jcastaldoFoodEssentials/spring-boot,mevasaroj/jenkins2-course-spring-boot,forestqqqq/spring-boot,eric-stanley/spring-boot,meftaul/spring-boot,rweisleder/spring-boot,imranansari/spring-boot,akmaharshi/jenkins,aahlenst/spring-boot,lcardito/spring-boot,eonezhang/spring-boot,axibase/spring-boot,roberthafner/spring-boot,herau/spring-boot,shakuzen/spring-boot,Pokbab/spring-boot,donhuvy/spring-boot,panbiping/spring-boot,Xaerxess/spring-boot,tsachev/spring-boot,jrrickard/spring-boot,artembilan/spring-boot,na-na/spring-boot,10045125/spring-boot,roymanish/spring-boot,tan9/spring-boot,satheeshmb/spring-boot,allyjunio/spring-boot,JiweiWong/spring-boot,rickeysu/spring-boot,domix/spring-boot,yangdd1205/spring-boot,allyjunio/spring-boot,mevasaroj/jenkins2-course-spring-boot,shangyi0102/spring-boot,RishikeshDarandale/spring-boot,izestrea/spring-boot,mdeinum/spring-boot,designreuse/spring-boot,NetoDevel/spring-boot,jcastaldoFoodEssentials/spring-boot,gorcz/spring-boot,RishikeshDarandale/spring-boot,wwadge/spring-boot,tbbost/spring-boot,VitDevelop/spring-boot,nelswadycki/spring-boot,end-user/spring-boot,forestqqqq/spring-boot,nandakishorm/spring-boot,bijukunjummen/spring-boot,trecloux/spring-boot,krmcbride/spring-boot,rmoorman/spring-boot,eonezhang/spring-boot,bjornlindstrom/spring-boot,mosoft521/spring-boot,yangdd1205/spring-boot,lcardito/spring-boot,nurkiewicz/spring-boot,candrews/spring-boot,jvz/spring-boot,lingounet/spring-boot,nurkiewicz/spring-boot,vandan16/Vandan,jorgepgjr/spring-boot,duandf35/spring-boot,nghiavo/spring-boot,coolcao/spring-boot,jvz/spring-boot,srikalyan/spring-boot,paddymahoney/spring-boot,Makhlab/spring-boot,mbenson/spring-boot,nghialunhaiha/spring-boot,royclarkson/spring-boot,huangyugui/spring-boot,domix/spring-boot,dfa1/spring-boot,lif123/spring-boot,yhj630520/spring-boot,tsachev/spring-boot,bsodzik/spring-boot,aahlenst/spring-boot,izeye/spring-boot,allyjunio/spring-boot,deki/spring-boot,jcastaldoFoodEssentials/spring-boot,lenicliu/spring-boot,RichardCSantana/spring-boot,nareshmiriyala/spring-boot,jack-luj/spring-boot,lucassaldanha/spring-boot,yuxiaole/spring-boot,peteyan/spring-boot,xwjxwj30abc/spring-boot,nisuhw/spring-boot,playleud/spring-boot,ydsakyclguozi/spring-boot,sbcoba/spring-boot,lexandro/spring-boot,damoyang/spring-boot,lexandro/spring-boot,nareshmiriyala/spring-boot,hqrt/jenkins2-course-spring-boot,ptahchiev/spring-boot,paweldolecinski/spring-boot,satheeshmb/spring-boot,wilkinsona/spring-boot,mrumpf/spring-boot,bsodzik/spring-boot,okba1/spring-boot,cmsandiga/spring-boot,RobertNickens/spring-boot,xdweleven/spring-boot,thomasdarimont/spring-boot,bbrouwer/spring-boot,MrMitchellMoore/spring-boot,MrMitchellMoore/spring-boot,htynkn/spring-boot,aahlenst/spring-boot,dreis2211/spring-boot,liupd/spring-boot,DeezCashews/spring-boot,kiranbpatil/spring-boot,jeremiahmarks/spring-boot,xdweleven/spring-boot,eddumelendez/spring-boot,rstirling/spring-boot,tan9/spring-boot,mlc0202/spring-boot,axibase/spring-boot,pnambiarsf/spring-boot,simonnordberg/spring-boot,smayoorans/spring-boot,roymanish/spring-boot,tiarebalbi/spring-boot,lif123/spring-boot,mbogoevici/spring-boot,clarklj001/spring-boot,rizwan18/spring-boot,zhangshuangquan/spring-root,marcellodesales/spring-boot,mbnshankar/spring-boot,mebinjacob/spring-boot,krmcbride/spring-boot,lucassaldanha/spring-boot,mbogoevici/spring-boot,zhanhb/spring-boot,i007422/jenkins2-course-spring-boot,krmcbride/spring-boot,joshiste/spring-boot,okba1/spring-boot,panbiping/spring-boot,bsodzik/spring-boot,qerub/spring-boot,ameraljovic/spring-boot,vaseemahmed01/spring-boot,qq83387856/spring-boot,fulvio-m/spring-boot,nareshmiriyala/spring-boot,jmnarloch/spring-boot,jforge/spring-boot,smayoorans/spring-boot,Pokbab/spring-boot,ptahchiev/spring-boot,jack-luj/spring-boot,VitDevelop/spring-boot,smayoorans/spring-boot,rstirling/spring-boot,zhanhb/spring-boot,rajendra-chola/jenkins2-course-spring-boot,DeezCashews/spring-boot,bsodzik/spring-boot,tsachev/spring-boot,jbovet/spring-boot,isopov/spring-boot,joshthornhill/spring-boot,donthadineshkumar/spring-boot,eddumelendez/spring-boot,mike-kukla/spring-boot,joansmith/spring-boot,auvik/spring-boot,npcode/spring-boot,wwadge/spring-boot,spring-projects/spring-boot,na-na/spring-boot,allyjunio/spring-boot,habuma/spring-boot,drunklite/spring-boot,johnktims/spring-boot,vaseemahmed01/spring-boot,keithsjohnson/spring-boot,soul2zimate/spring-boot,AstaTus/spring-boot,kiranbpatil/spring-boot,scottfrederick/spring-boot,rweisleder/spring-boot,10045125/spring-boot,Buzzardo/spring-boot,rams2588/spring-boot,bijukunjummen/spring-boot,VitDevelop/spring-boot,shangyi0102/spring-boot,mbnshankar/spring-boot,RainPlanter/spring-boot,fjlopez/spring-boot,mbrukman/spring-boot,rajendra-chola/jenkins2-course-spring-boot,i007422/jenkins2-course-spring-boot,prakashme/spring-boot,kamilszymanski/spring-boot,keithsjohnson/spring-boot,mrumpf/spring-boot,mbenson/spring-boot,bclozel/spring-boot,srinivasan01/spring-boot,zorosteven/spring-boot,crackien/spring-boot,RishikeshDarandale/spring-boot,master-slave/spring-boot,shakuzen/spring-boot,buobao/spring-boot,orangesdk/spring-boot,hqrt/jenkins2-course-spring-boot,bclozel/spring-boot,isopov/spring-boot,bsodzik/spring-boot,rickeysu/spring-boot,cbtpro/spring-boot,dfa1/spring-boot,tbadie/spring-boot,donhuvy/spring-boot,RichardCSantana/spring-boot,balajinsr/spring-boot,ameraljovic/spring-boot,npcode/spring-boot,chrylis/spring-boot,cbtpro/spring-boot,spring-projects/spring-boot,auvik/spring-boot,donthadineshkumar/spring-boot,rstirling/spring-boot,ptahchiev/spring-boot,thomasdarimont/spring-boot,rams2588/spring-boot,lucassaldanha/spring-boot,na-na/spring-boot,qerub/spring-boot,dnsw83/spring-boot,lexandro/spring-boot,mlc0202/spring-boot,jxblum/spring-boot,lingounet/spring-boot,scottfrederick/spring-boot,ChunPIG/spring-boot,meloncocoo/spring-boot,axelfontaine/spring-boot,RishikeshDarandale/spring-boot,paddymahoney/spring-boot,vaseemahmed01/spring-boot,bbrouwer/spring-boot,xialeizhou/spring-boot,xingguang2013/spring-boot,marcellodesales/spring-boot,drunklite/spring-boot,bjornlindstrom/spring-boot,RainPlanter/spring-boot,Chomeh/spring-boot,mdeinum/spring-boot,domix/spring-boot,satheeshmb/spring-boot,auvik/spring-boot,srinivasan01/spring-boot,deki/spring-boot,jvz/spring-boot,huangyugui/spring-boot,brettwooldridge/spring-boot,simonnordberg/spring-boot,artembilan/spring-boot,srikalyan/spring-boot,nghialunhaiha/spring-boot,liupd/spring-boot,jforge/spring-boot,ChunPIG/spring-boot,kayelau/spring-boot,tiarebalbi/spring-boot,crackien/spring-boot,spring-projects/spring-boot,ojacquemart/spring-boot,herau/spring-boot,habuma/spring-boot,rweisleder/spring-boot,mosen11/spring-boot,deki/spring-boot,patrikbeno/spring-boot,minmay/spring-boot,shakuzen/spring-boot,mlc0202/spring-boot,coolcao/spring-boot,hklv/spring-boot,spring-projects/spring-boot,hehuabing/spring-boot,jrrickard/spring-boot,mebinjacob/spring-boot,murilobr/spring-boot,tbadie/spring-boot,AstaTus/spring-boot,nandakishorm/spring-boot,mlc0202/spring-boot,mlc0202/spring-boot,ojacquemart/spring-boot,huangyugui/spring-boot,yunbian/spring-boot,paddymahoney/spring-boot,166yuan/spring-boot,ilayaperumalg/spring-boot,forestqqqq/spring-boot,simonnordberg/spring-boot,damoyang/spring-boot,trecloux/spring-boot,izeye/spring-boot,sbuettner/spring-boot,axelfontaine/spring-boot,SPNilsen/spring-boot,mdeinum/spring-boot,xingguang2013/spring-boot,soul2zimate/spring-boot,peteyan/spring-boot,sbcoba/spring-boot,drumonii/spring-boot,brettwooldridge/spring-boot,jxblum/spring-boot,zhangshuangquan/spring-root,qq83387856/spring-boot,vaseemahmed01/spring-boot,balajinsr/spring-boot,Pokbab/spring-boot,nelswadycki/spring-boot,simonnordberg/spring-boot,vpavic/spring-boot,DeezCashews/spring-boot,srinivasan01/spring-boot,RishikeshDarandale/spring-boot,xiaoleiPENG/my-project,ChunPIG/spring-boot,bijukunjummen/spring-boot,felipeg48/spring-boot,Xaerxess/spring-boot,cmsandiga/spring-boot,artembilan/spring-boot,nisuhw/spring-boot,artembilan/spring-boot,RainPlanter/spring-boot,jeremiahmarks/spring-boot,ojacquemart/spring-boot,javyzheng/spring-boot,mabernardo/spring-boot,zhanhb/spring-boot,scottfrederick/spring-boot,krmcbride/spring-boot,nghialunhaiha/spring-boot,minmay/spring-boot,michael-simons/spring-boot,pnambiarsf/spring-boot,MrMitchellMoore/spring-boot,mbrukman/spring-boot,navarrogabriela/spring-boot,sbcoba/spring-boot,candrews/spring-boot,sankin/spring-boot,srinivasan01/spring-boot
java
## Code Before: /* * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.context.embedded.tomcat; import org.apache.catalina.Container; import org.apache.catalina.core.StandardContext; /** * Tomcat {@link StandardContext} used by {@link TomcatEmbeddedServletContainer} to * support deferred initialization. * * @author Phillip Webb */ class TomcatEmbeddedContext extends StandardContext { @Override public void loadOnStartup(Container[] children) { } public void deferredLoadOnStartup() { super.loadOnStartup(findChildren()); } } ## Instruction: Set Thread context class loader while Tomcat starts up Fixes gh-1085 ## Code After: /* * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.context.embedded.tomcat; import org.apache.catalina.Container; import org.apache.catalina.core.StandardContext; import org.springframework.util.ClassUtils; /** * Tomcat {@link StandardContext} used by {@link TomcatEmbeddedServletContainer} to * support deferred initialization. * * @author Phillip Webb */ class TomcatEmbeddedContext extends StandardContext { @Override public void loadOnStartup(Container[] children) { } public void deferredLoadOnStartup() { // Some older Servlet frameworks (e.g. Struts, BIRT) use the Thread context class // loader to create servlet instances in this phase. If they do that and then try // to initialize them later the class loader may have changed, so wrap the call to // loadOnStartup in what we think its going to be the main webapp classloader at // runtime. ClassLoader classLoader = getLoader().getClassLoader(); ClassLoader existingLoader = null; if (classLoader != null) { existingLoader = ClassUtils.overrideThreadContextClassLoader(classLoader); } super.loadOnStartup(findChildren()); if (existingLoader != null) { ClassUtils.overrideThreadContextClassLoader(existingLoader); } } }
/* * Copyright 2012-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.context.embedded.tomcat; import org.apache.catalina.Container; import org.apache.catalina.core.StandardContext; + import org.springframework.util.ClassUtils; /** * Tomcat {@link StandardContext} used by {@link TomcatEmbeddedServletContainer} to * support deferred initialization. * * @author Phillip Webb */ class TomcatEmbeddedContext extends StandardContext { @Override public void loadOnStartup(Container[] children) { } public void deferredLoadOnStartup() { + // Some older Servlet frameworks (e.g. Struts, BIRT) use the Thread context class + // loader to create servlet instances in this phase. If they do that and then try + // to initialize them later the class loader may have changed, so wrap the call to + // loadOnStartup in what we think its going to be the main webapp classloader at + // runtime. + ClassLoader classLoader = getLoader().getClassLoader(); + ClassLoader existingLoader = null; + if (classLoader != null) { + existingLoader = ClassUtils.overrideThreadContextClassLoader(classLoader); + } super.loadOnStartup(findChildren()); + if (existingLoader != null) { + ClassUtils.overrideThreadContextClassLoader(existingLoader); + } } }
14
0.368421
14
0
a8a92630bec0bfaaf78b56c674e854b852714213
app/controllers/password-recovery.js
app/controllers/password-recovery.js
import { inject as service } from '@ember/service' import Controller from '@ember/controller' import { badRequest } from '../utils/request' export default Controller.extend({ pilasBloquesApi: service(), credentials: {}, usernameExists: true, // Default true for (no) error visualization wrongCredentials: false, actions: { checkUsername(cb) { this.pilasBloquesApi.passwordRecovery(this.credentials.username) .then((credentials) => { this.set("usernameExists", true) this.set("credentials", credentials) cb() }) .catch(notFound(() => { this.set("usernameExists", false) })) }, changePassword(cb) { this.set("wrongCredentials", false) this.pilasBloquesApi.changePassword(this.credentials) .then(cb) .catch(badRequest(() => { this.set("wrongCredentials", true) this.set("credentials.password", "") })) }, } })
import { inject as service } from '@ember/service' import Controller from '@ember/controller' import { badRequest, notFound } from '../utils/request' export default Controller.extend({ pilasBloquesApi: service(), queryParams: ['token'], token: null, credentials: {}, usernameExists: true, // Default true for (no) error visualization wrongCredentials: false, actions: { checkUsername(cb) { this.pilasBloquesApi.passwordRecovery(this.credentials.username) .then((credentials) => { this.set("usernameExists", true) this.set("credentials", credentials) cb() }) .catch(notFound(() => { this.set("usernameExists", false) })) }, changePassword(cb) { this.set("wrongCredentials", false) this.set("credentials.token", this.token) this.pilasBloquesApi.changePassword(this.credentials) .then(cb) .catch(badRequest(() => { this.set("wrongCredentials", true) this.set("credentials.password", "") })) }, } })
Send token on change password
Send token on change password
JavaScript
agpl-3.0
Program-AR/pilas-bloques,Program-AR/pilas-bloques,Program-AR/pilas-bloques
javascript
## Code Before: import { inject as service } from '@ember/service' import Controller from '@ember/controller' import { badRequest } from '../utils/request' export default Controller.extend({ pilasBloquesApi: service(), credentials: {}, usernameExists: true, // Default true for (no) error visualization wrongCredentials: false, actions: { checkUsername(cb) { this.pilasBloquesApi.passwordRecovery(this.credentials.username) .then((credentials) => { this.set("usernameExists", true) this.set("credentials", credentials) cb() }) .catch(notFound(() => { this.set("usernameExists", false) })) }, changePassword(cb) { this.set("wrongCredentials", false) this.pilasBloquesApi.changePassword(this.credentials) .then(cb) .catch(badRequest(() => { this.set("wrongCredentials", true) this.set("credentials.password", "") })) }, } }) ## Instruction: Send token on change password ## Code After: import { inject as service } from '@ember/service' import Controller from '@ember/controller' import { badRequest, notFound } from '../utils/request' export default Controller.extend({ pilasBloquesApi: service(), queryParams: ['token'], token: null, credentials: {}, usernameExists: true, // Default true for (no) error visualization wrongCredentials: false, actions: { checkUsername(cb) { this.pilasBloquesApi.passwordRecovery(this.credentials.username) .then((credentials) => { this.set("usernameExists", true) this.set("credentials", credentials) cb() }) .catch(notFound(() => { this.set("usernameExists", false) })) }, changePassword(cb) { this.set("wrongCredentials", false) this.set("credentials.token", this.token) this.pilasBloquesApi.changePassword(this.credentials) .then(cb) .catch(badRequest(() => { this.set("wrongCredentials", true) this.set("credentials.password", "") })) }, } })
import { inject as service } from '@ember/service' import Controller from '@ember/controller' - import { badRequest } from '../utils/request' + import { badRequest, notFound } from '../utils/request' ? ++++++++++ export default Controller.extend({ pilasBloquesApi: service(), + queryParams: ['token'], + token: null, credentials: {}, usernameExists: true, // Default true for (no) error visualization wrongCredentials: false, actions: { checkUsername(cb) { this.pilasBloquesApi.passwordRecovery(this.credentials.username) .then((credentials) => { this.set("usernameExists", true) this.set("credentials", credentials) cb() }) .catch(notFound(() => { this.set("usernameExists", false) })) }, changePassword(cb) { this.set("wrongCredentials", false) + this.set("credentials.token", this.token) this.pilasBloquesApi.changePassword(this.credentials) .then(cb) .catch(badRequest(() => { this.set("wrongCredentials", true) this.set("credentials.password", "") })) }, } })
5
0.147059
4
1
91c3fd2dd629ffa8798f6b23b2984446a15f84b7
tools/llvm-mca/CMakeLists.txt
tools/llvm-mca/CMakeLists.txt
set(LLVM_LINK_COMPONENTS AllTargetsAsmPrinters AllTargetsAsmParsers AllTargetsDescs AllTargetsDisassemblers AllTargetsInfos MC MCParser Support ) add_llvm_tool(llvm-mca Backend.cpp BackendPrinter.cpp CodeRegion.cpp Dispatch.cpp DispatchStatistics.cpp HWEventListener.cpp InstrBuilder.cpp Instruction.cpp InstructionInfoView.cpp InstructionTables.cpp LSUnit.cpp llvm-mca.cpp RegisterFileStatistics.cpp ResourcePressureView.cpp RetireControlUnitStatistics.cpp Scheduler.cpp SchedulerStatistics.cpp Support.cpp SummaryView.cpp TimelineView.cpp View.cpp )
set(LLVM_LINK_COMPONENTS AllTargetsAsmParsers AllTargetsDescs ) add_llvm_tool(llvm-mca Backend.cpp BackendPrinter.cpp CodeRegion.cpp Dispatch.cpp DispatchStatistics.cpp HWEventListener.cpp InstrBuilder.cpp Instruction.cpp InstructionInfoView.cpp InstructionTables.cpp LSUnit.cpp llvm-mca.cpp RegisterFileStatistics.cpp ResourcePressureView.cpp RetireControlUnitStatistics.cpp Scheduler.cpp SchedulerStatistics.cpp Support.cpp SummaryView.cpp TimelineView.cpp View.cpp )
Remove unused libraries from set LLVM_LINK_COMPONENTS.
[llvm-mca][CMake] Remove unused libraries from set LLVM_LINK_COMPONENTS. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@329807 91177308-0d34-0410-b5e6-96231b3b80d8
Text
apache-2.0
apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm
text
## Code Before: set(LLVM_LINK_COMPONENTS AllTargetsAsmPrinters AllTargetsAsmParsers AllTargetsDescs AllTargetsDisassemblers AllTargetsInfos MC MCParser Support ) add_llvm_tool(llvm-mca Backend.cpp BackendPrinter.cpp CodeRegion.cpp Dispatch.cpp DispatchStatistics.cpp HWEventListener.cpp InstrBuilder.cpp Instruction.cpp InstructionInfoView.cpp InstructionTables.cpp LSUnit.cpp llvm-mca.cpp RegisterFileStatistics.cpp ResourcePressureView.cpp RetireControlUnitStatistics.cpp Scheduler.cpp SchedulerStatistics.cpp Support.cpp SummaryView.cpp TimelineView.cpp View.cpp ) ## Instruction: [llvm-mca][CMake] Remove unused libraries from set LLVM_LINK_COMPONENTS. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@329807 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: set(LLVM_LINK_COMPONENTS AllTargetsAsmParsers AllTargetsDescs ) add_llvm_tool(llvm-mca Backend.cpp BackendPrinter.cpp CodeRegion.cpp Dispatch.cpp DispatchStatistics.cpp HWEventListener.cpp InstrBuilder.cpp Instruction.cpp InstructionInfoView.cpp InstructionTables.cpp LSUnit.cpp llvm-mca.cpp RegisterFileStatistics.cpp ResourcePressureView.cpp RetireControlUnitStatistics.cpp Scheduler.cpp SchedulerStatistics.cpp Support.cpp SummaryView.cpp TimelineView.cpp View.cpp )
set(LLVM_LINK_COMPONENTS - AllTargetsAsmPrinters AllTargetsAsmParsers AllTargetsDescs - AllTargetsDisassemblers - AllTargetsInfos - MC - MCParser - Support ) add_llvm_tool(llvm-mca Backend.cpp BackendPrinter.cpp CodeRegion.cpp Dispatch.cpp DispatchStatistics.cpp HWEventListener.cpp InstrBuilder.cpp Instruction.cpp InstructionInfoView.cpp InstructionTables.cpp LSUnit.cpp llvm-mca.cpp RegisterFileStatistics.cpp ResourcePressureView.cpp RetireControlUnitStatistics.cpp Scheduler.cpp SchedulerStatistics.cpp Support.cpp SummaryView.cpp TimelineView.cpp View.cpp )
6
0.176471
0
6
87f2ccd437ba6293806515c159ca438372776044
_sass/queercode/components/events.scss
_sass/queercode/components/events.scss
.event-list { display: flex; flex-wrap: wrap; } .event-list > div { margin-right: 1em; min-width: 50ch; }
.event-list { display: flex; flex-wrap: wrap; } .event-list > div { margin-right: 1em; } @media screen and (min-width: $tablet) { min-width: 50ch; }
Fix event list rendering on mobile devices
Fix event list rendering on mobile devices
SCSS
unlicense
QueerCodeOrg/queercodeberlin.github.io,QueerCodeOrg/queercodeberlin.github.io,QueerCodeBerlin/queercodeberlin.github.io,QueerCodeOrg/queercodeberlin.github.io
scss
## Code Before: .event-list { display: flex; flex-wrap: wrap; } .event-list > div { margin-right: 1em; min-width: 50ch; } ## Instruction: Fix event list rendering on mobile devices ## Code After: .event-list { display: flex; flex-wrap: wrap; } .event-list > div { margin-right: 1em; } @media screen and (min-width: $tablet) { min-width: 50ch; }
.event-list { display: flex; flex-wrap: wrap; } .event-list > div { margin-right: 1em; + } + + @media screen and (min-width: $tablet) { min-width: 50ch; }
3
0.333333
3
0
6d601067a115d5bba2f8617584149b9a532a29ba
tests/Stub/SessionTestStub.php
tests/Stub/SessionTestStub.php
<?php declare(strict_types=1); namespace Tests\Stub; use PHPUnit\Framework\TestCase; class SessionTestStub extends TestCase { private const SESSION_ID = '42'; protected function setUp(): void { session_id(self::SESSION_ID); } public function testOne(): void { $process = new StubbedParaunitProcess(); $this->assertTrue($process->isTerminated()); } public function testTwo(): void { $this->assertEquals(session_id(), self::SESSION_ID); } public function testThree(): void { $this->assertTrue(true); } }
<?php declare(strict_types=1); namespace Tests\Stub; use PHPUnit\Framework\TestCase; class SessionTestStub extends TestCase { private const SESSION_ID = '42'; protected function setUp(): void { session_id(self::SESSION_ID); } public function testOne(): void { $process = new StubbedParaunitProcess(); $this->assertTrue($process->isTerminated()); } public function testTwo(): void { $this->assertEquals(self::SESSION_ID, session_id()); } public function testThree(): void { $this->assertTrue(true); } }
Fix arguments order in assertion
Fix arguments order in assertion
PHP
apache-2.0
facile-it/paraunit,facile-it/paraunit
php
## Code Before: <?php declare(strict_types=1); namespace Tests\Stub; use PHPUnit\Framework\TestCase; class SessionTestStub extends TestCase { private const SESSION_ID = '42'; protected function setUp(): void { session_id(self::SESSION_ID); } public function testOne(): void { $process = new StubbedParaunitProcess(); $this->assertTrue($process->isTerminated()); } public function testTwo(): void { $this->assertEquals(session_id(), self::SESSION_ID); } public function testThree(): void { $this->assertTrue(true); } } ## Instruction: Fix arguments order in assertion ## Code After: <?php declare(strict_types=1); namespace Tests\Stub; use PHPUnit\Framework\TestCase; class SessionTestStub extends TestCase { private const SESSION_ID = '42'; protected function setUp(): void { session_id(self::SESSION_ID); } public function testOne(): void { $process = new StubbedParaunitProcess(); $this->assertTrue($process->isTerminated()); } public function testTwo(): void { $this->assertEquals(self::SESSION_ID, session_id()); } public function testThree(): void { $this->assertTrue(true); } }
<?php declare(strict_types=1); namespace Tests\Stub; use PHPUnit\Framework\TestCase; class SessionTestStub extends TestCase { private const SESSION_ID = '42'; protected function setUp(): void { session_id(self::SESSION_ID); } public function testOne(): void { $process = new StubbedParaunitProcess(); $this->assertTrue($process->isTerminated()); } public function testTwo(): void { - $this->assertEquals(session_id(), self::SESSION_ID); ? -------------- + $this->assertEquals(self::SESSION_ID, session_id()); ? ++++++++++++++ } public function testThree(): void { $this->assertTrue(true); } }
2
0.058824
1
1
f9dc378cfd2db6b647c8b2500ece282ab65b69ac
index.js
index.js
exports.express = function () { return require('./lib/express') } exports.koa = function () { return require('./lib/koa') }
exports = module.exports = require('./lib/express') exports.express = function () { return require('./lib/express') } exports.koa = function () { return require('./lib/koa') }
Load express implementation by default
Load express implementation by default
JavaScript
mit
woltemade/grant,bitinn/grant,jlabarbera11/grant,woltemade/grant,jcdenton/grant,bitinn/grant,fejalish/grant,jcdenton/grant,simov/grant,fejalish/grant
javascript
## Code Before: exports.express = function () { return require('./lib/express') } exports.koa = function () { return require('./lib/koa') } ## Instruction: Load express implementation by default ## Code After: exports = module.exports = require('./lib/express') exports.express = function () { return require('./lib/express') } exports.koa = function () { return require('./lib/koa') }
+ + exports = module.exports = require('./lib/express') exports.express = function () { return require('./lib/express') } exports.koa = function () { return require('./lib/koa') }
2
0.25
2
0
9ddd1787bde526c89d90669ba4fb00c35f6a7cb4
templates/html/mentoring_progress.html
templates/html/mentoring_progress.html
<script type="text/template" id="xblock-progress-template"> <% if (completed === "True") {{ %> <img src="{completed}"> <% }} else {{ %> (Not completed) <% }} %> </script>
<script type="text/template" id="xblock-progress-template"> <% if (completed === "True") {{ %> <img src="{completed}" alt="Completed"> <% }} else {{ %> (Not completed) <% }} %> </script>
Add `alt` to completion `<img>` for accessibility
html-css-review: Add `alt` to completion `<img>` for accessibility
HTML
agpl-3.0
proversity-org/problem-builder,open-craft/xblock-mentoring,open-craft/xblock-mentoring,proversity-org/problem-builder,gsehub/xblock-mentoring,open-craft/xblock-mentoring,gsehub/xblock-mentoring,proversity-org/problem-builder,edx-solutions/xblock-mentoring,edx-solutions/xblock-mentoring,edx-solutions/xblock-mentoring,gsehub/xblock-mentoring
html
## Code Before: <script type="text/template" id="xblock-progress-template"> <% if (completed === "True") {{ %> <img src="{completed}"> <% }} else {{ %> (Not completed) <% }} %> </script> ## Instruction: html-css-review: Add `alt` to completion `<img>` for accessibility ## Code After: <script type="text/template" id="xblock-progress-template"> <% if (completed === "True") {{ %> <img src="{completed}" alt="Completed"> <% }} else {{ %> (Not completed) <% }} %> </script>
<script type="text/template" id="xblock-progress-template"> <% if (completed === "True") {{ %> - <img src="{completed}"> + <img src="{completed}" alt="Completed"> ? ++++++++++++++++ <% }} else {{ %> (Not completed) <% }} %> </script>
2
0.285714
1
1
604c7d8889bc59dd53d2009fa12f576d40e3627f
.github/workflows/update.yml
.github/workflows/update.yml
name: update on: schedule: - cron: '0 9 * * *' jobs: update: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: update run: python3 generate.py >version.txt - name: commit run: git commit --author "GitHub <noreply@github.com>" -a -m "Update to 1.3.`cat version.txt`"" continue-on-error: true - name: create pr uses: peter-evans/create-pull-request@v4
name: update on: schedule: - cron: '0 9 * * *' workflow_dispatch: jobs: update: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: update run: python3 generate.py >version.txt - name: commit run: git commit --author "GitHub <noreply@github.com>" -a -m "Update to 1.3.`cat version.txt`"" continue-on-error: true - name: create pr uses: peter-evans/create-pull-request@v4
Allow to run the new workflow manually
Allow to run the new workflow manually
YAML
mit
zeux/volk,zeux/volk,zeux/volk
yaml
## Code Before: name: update on: schedule: - cron: '0 9 * * *' jobs: update: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: update run: python3 generate.py >version.txt - name: commit run: git commit --author "GitHub <noreply@github.com>" -a -m "Update to 1.3.`cat version.txt`"" continue-on-error: true - name: create pr uses: peter-evans/create-pull-request@v4 ## Instruction: Allow to run the new workflow manually ## Code After: name: update on: schedule: - cron: '0 9 * * *' workflow_dispatch: jobs: update: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: update run: python3 generate.py >version.txt - name: commit run: git commit --author "GitHub <noreply@github.com>" -a -m "Update to 1.3.`cat version.txt`"" continue-on-error: true - name: create pr uses: peter-evans/create-pull-request@v4
name: update on: schedule: - cron: '0 9 * * *' + workflow_dispatch: jobs: update: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: update run: python3 generate.py >version.txt - name: commit run: git commit --author "GitHub <noreply@github.com>" -a -m "Update to 1.3.`cat version.txt`"" continue-on-error: true - name: create pr uses: peter-evans/create-pull-request@v4
1
0.055556
1
0
6ac23761f8b81107b967ea60ec7e9907947f167f
tox.ini
tox.ini
[tox] envlist = py27, py33, py34, py35, py36, flake8 [testenv:flake8] basepython=python deps=flake8 commands=flake8 parglare [testenv] passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH setenv = PYTHONPATH = {toxinidir}:{toxinidir}/parglare deps = -r{toxinidir}/requirements_test.txt commands = coverage run --source=parglare --omit paglare/six.py -m pytest --basetemp={envtmpdir} tests/func coveralls
[tox] envlist = py27, py33, py34, py35, py36, flake8 [testenv:flake8] basepython=python deps=flake8 commands=flake8 parglare --exclude=six.py [testenv] passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH setenv = PYTHONPATH = {toxinidir}:{toxinidir}/parglare deps = -r{toxinidir}/requirements_test.txt commands = coverage run --source=parglare --omit paglare/six.py -m pytest --basetemp={envtmpdir} tests/func coveralls
Exclude six.py from flake8 test.
Exclude six.py from flake8 test.
INI
mit
igordejanovic/parglare,igordejanovic/parglare
ini
## Code Before: [tox] envlist = py27, py33, py34, py35, py36, flake8 [testenv:flake8] basepython=python deps=flake8 commands=flake8 parglare [testenv] passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH setenv = PYTHONPATH = {toxinidir}:{toxinidir}/parglare deps = -r{toxinidir}/requirements_test.txt commands = coverage run --source=parglare --omit paglare/six.py -m pytest --basetemp={envtmpdir} tests/func coveralls ## Instruction: Exclude six.py from flake8 test. ## Code After: [tox] envlist = py27, py33, py34, py35, py36, flake8 [testenv:flake8] basepython=python deps=flake8 commands=flake8 parglare --exclude=six.py [testenv] passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH setenv = PYTHONPATH = {toxinidir}:{toxinidir}/parglare deps = -r{toxinidir}/requirements_test.txt commands = coverage run --source=parglare --omit paglare/six.py -m pytest --basetemp={envtmpdir} tests/func coveralls
[tox] envlist = py27, py33, py34, py35, py36, flake8 [testenv:flake8] basepython=python deps=flake8 - commands=flake8 parglare + commands=flake8 parglare --exclude=six.py [testenv] passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH setenv = PYTHONPATH = {toxinidir}:{toxinidir}/parglare deps = -r{toxinidir}/requirements_test.txt commands = coverage run --source=parglare --omit paglare/six.py -m pytest --basetemp={envtmpdir} tests/func coveralls
2
0.117647
1
1
618d9c185a17d8b8e2a5b860e8c50ea1a7bde994
.travis.yml
.travis.yml
language: php php: - 5.5 - 5.6 - hhvm-nightly env: - DB=mysql matrix: allow_failures: - php: hhvm-nightly before_script: - composer --prefer-source --dev install - cp phpunit.xml.dist phpunit.xml - cp settings.default.php settings.php - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS dbmng2;" -uroot; fi - if [[ "$DB" == "mysql" ]]; then mysql dbmng2 < sql/dbmng2.sql -uroot; fi - if [[ "$DB" == "mysql" ]]; then mysql dbmng2 < sql/test.sql -uroot; fi
language: php php: - 5.5 - 5.6 - hhvm-nightly env: - DB=mysql matrix: allow_failures: - php: hhvm-nightly before_script: - sudo apt-get install apache2 - sudo a2enmod rewrite - sudo service apache2 restart - ln -s ../dbmng2 /var/www/ - composer --prefer-source --dev install - cp phpunit.xml.dist phpunit.xml - cp settings.default.php settings.php - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS dbmng2;" -uroot; fi - if [[ "$DB" == "mysql" ]]; then mysql dbmng2 < sql/dbmng2.sql -uroot; fi - if [[ "$DB" == "mysql" ]]; then mysql dbmng2 < sql/test.sql -uroot; fi
Install apache and dbmng2 (for testing api)
Install apache and dbmng2 (for testing api)
YAML
mit
diegoguidotti/dbmng2,diegoguidotti/dbmng2,diegoguidotti/dbmng2,diegoguidotti/dbmng2
yaml
## Code Before: language: php php: - 5.5 - 5.6 - hhvm-nightly env: - DB=mysql matrix: allow_failures: - php: hhvm-nightly before_script: - composer --prefer-source --dev install - cp phpunit.xml.dist phpunit.xml - cp settings.default.php settings.php - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS dbmng2;" -uroot; fi - if [[ "$DB" == "mysql" ]]; then mysql dbmng2 < sql/dbmng2.sql -uroot; fi - if [[ "$DB" == "mysql" ]]; then mysql dbmng2 < sql/test.sql -uroot; fi ## Instruction: Install apache and dbmng2 (for testing api) ## Code After: language: php php: - 5.5 - 5.6 - hhvm-nightly env: - DB=mysql matrix: allow_failures: - php: hhvm-nightly before_script: - sudo apt-get install apache2 - sudo a2enmod rewrite - sudo service apache2 restart - ln -s ../dbmng2 /var/www/ - composer --prefer-source --dev install - cp phpunit.xml.dist phpunit.xml - cp settings.default.php settings.php - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS dbmng2;" -uroot; fi - if [[ "$DB" == "mysql" ]]; then mysql dbmng2 < sql/dbmng2.sql -uroot; fi - if [[ "$DB" == "mysql" ]]; then mysql dbmng2 < sql/test.sql -uroot; fi
language: php php: - 5.5 - 5.6 - hhvm-nightly env: - DB=mysql matrix: allow_failures: - php: hhvm-nightly before_script: + - sudo apt-get install apache2 + - sudo a2enmod rewrite + - sudo service apache2 restart + - ln -s ../dbmng2 /var/www/ - composer --prefer-source --dev install - cp phpunit.xml.dist phpunit.xml - cp settings.default.php settings.php - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS dbmng2;" -uroot; fi - if [[ "$DB" == "mysql" ]]; then mysql dbmng2 < sql/dbmng2.sql -uroot; fi - if [[ "$DB" == "mysql" ]]; then mysql dbmng2 < sql/test.sql -uroot; fi
4
0.190476
4
0
4f1bd2889056dffb49f9dd45e1514fe99dff12c0
lib/edit-command-line.zsh
lib/edit-command-line.zsh
autoload -U edit-command-line zle -N edit-command-line bindkey '\C-x\C-e' edit-command-line
autoload -U edit-command-line zle -N edit-command-line bindkey '\C-x\C-e' edit-command-line zmodload -i zsh/parameter insert-last-command-output() { LBUFFER+="$(eval $history[$((HISTCMD-1))])" } zle -N insert-last-command-output bindkey '\C-x\C-i' insert-last-command-output
Use Ctrl-x, Ctrl-i insert output of last command
Use Ctrl-x, Ctrl-i insert output of last command
Shell
mit
toctan/oh-my-zsh,toctan/oh-my-zsh,toctan/oh-my-zsh
shell
## Code Before: autoload -U edit-command-line zle -N edit-command-line bindkey '\C-x\C-e' edit-command-line ## Instruction: Use Ctrl-x, Ctrl-i insert output of last command ## Code After: autoload -U edit-command-line zle -N edit-command-line bindkey '\C-x\C-e' edit-command-line zmodload -i zsh/parameter insert-last-command-output() { LBUFFER+="$(eval $history[$((HISTCMD-1))])" } zle -N insert-last-command-output bindkey '\C-x\C-i' insert-last-command-output
autoload -U edit-command-line zle -N edit-command-line bindkey '\C-x\C-e' edit-command-line + + zmodload -i zsh/parameter + insert-last-command-output() { + LBUFFER+="$(eval $history[$((HISTCMD-1))])" + } + zle -N insert-last-command-output + bindkey '\C-x\C-i' insert-last-command-output
7
2.333333
7
0
00352f3453eb0bb41d11c80b4a0666e91ad3092e
RuleDocumentation/UseConsistentIndentation.md
RuleDocumentation/UseConsistentIndentation.md
**Severity Level: Warning** ## Description Indentation should be consistent throughout the source file. **Note**: This rule is not enabled by default. The user needs to enable it through settings. ## Configuration ```powershell Rules = @{ PSUseConsistentIndentation = @{ Enable = $true IndentationSize = 4 } } ``` ### Parameters #### Enable: bool (Default value is `$false`) Enable or disable the rule during ScriptAnalyzer invocation. #### IndentationSize: bool (Default value is `4`) Indentation size in the number of space characters.
**Severity Level: Warning** ## Description Indentation should be consistent throughout the source file. **Note**: This rule is not enabled by default. The user needs to enable it through settings. ## Configuration ```powershell Rules = @{ PSUseConsistentIndentation = @{ Enable = $true IndentationSize = 4 } } ``` ### Parameters #### Enable: bool (Default value is `$false`) Enable or disable the rule during ScriptAnalyzer invocation. #### IndentationSize: bool (Default value is `4`) Indentation size in the number of space characters. #### Kind: string (Default value is `space`) Represents the kind of indentation to be used. Possible values are: `space`, `tab`. If any invalid value is given, the property defaults to `space`. `space` means `IndentationSize` number of `space` characters are used to provide one level of indentation. `tab` means a tab character, `\t`.
Add doc for Indentation.Kind parameter
Add doc for Indentation.Kind parameter
Markdown
mit
PowerShell/PSScriptAnalyzer,dlwyatt/PSScriptAnalyzer,daviwil/PSScriptAnalyzer
markdown
## Code Before: **Severity Level: Warning** ## Description Indentation should be consistent throughout the source file. **Note**: This rule is not enabled by default. The user needs to enable it through settings. ## Configuration ```powershell Rules = @{ PSUseConsistentIndentation = @{ Enable = $true IndentationSize = 4 } } ``` ### Parameters #### Enable: bool (Default value is `$false`) Enable or disable the rule during ScriptAnalyzer invocation. #### IndentationSize: bool (Default value is `4`) Indentation size in the number of space characters. ## Instruction: Add doc for Indentation.Kind parameter ## Code After: **Severity Level: Warning** ## Description Indentation should be consistent throughout the source file. **Note**: This rule is not enabled by default. The user needs to enable it through settings. ## Configuration ```powershell Rules = @{ PSUseConsistentIndentation = @{ Enable = $true IndentationSize = 4 } } ``` ### Parameters #### Enable: bool (Default value is `$false`) Enable or disable the rule during ScriptAnalyzer invocation. #### IndentationSize: bool (Default value is `4`) Indentation size in the number of space characters. #### Kind: string (Default value is `space`) Represents the kind of indentation to be used. Possible values are: `space`, `tab`. If any invalid value is given, the property defaults to `space`. `space` means `IndentationSize` number of `space` characters are used to provide one level of indentation. `tab` means a tab character, `\t`.
**Severity Level: Warning** ## Description Indentation should be consistent throughout the source file. **Note**: This rule is not enabled by default. The user needs to enable it through settings. ## Configuration ```powershell Rules = @{ PSUseConsistentIndentation = @{ Enable = $true IndentationSize = 4 } } ``` ### Parameters #### Enable: bool (Default value is `$false`) Enable or disable the rule during ScriptAnalyzer invocation. #### IndentationSize: bool (Default value is `4`) Indentation size in the number of space characters. + + #### Kind: string (Default value is `space`) + + Represents the kind of indentation to be used. Possible values are: `space`, `tab`. If any invalid value is given, the property defaults to `space`. + + `space` means `IndentationSize` number of `space` characters are used to provide one level of indentation. + `tab` means a tab character, `\t`.
7
0.241379
7
0
a6300723150d7d1ff9a58f4f3f1297e0fe2c6f78
css_updater/git/manager.py
css_updater/git/manager.py
"""manages github repos""" import os import tempfile from typing import Dict, Any import pygit2 as git from .webhook.handler import Handler class Manager(object): """handles git repos""" def __init__(self: Manager, handler: Handler) -> None: self.webhook_handler: Handler = handler self.temp_dir: tempfile.TemporaryDirectory = tempfile.TemporaryDirectory() self.repo: git.Repository = git.clone_repository( self.webhook_handler.git_url, path=self.temp_dir.name) with open(os.path.join(self.temp_dir.name, "css-updater.json")) as config: import json self.config: Dict[str, Any] = json.loads(config.read()) def __del__(self: Manager) -> None: self.temp_dir.cleanup()
"""manages github repos""" import os import tempfile from typing import Dict, Any import pygit2 as git from .webhook.handler import Handler class Manager(object): """handles git repos""" def __init__(self: Manager, handler: Handler) -> None: self.webhook_handler: Handler = handler self.temp_dir: tempfile.TemporaryDirectory = tempfile.TemporaryDirectory() self.repo: git.Repository = git.clone_repository( self.webhook_handler.git_url, path=self.temp_dir.name) with open(os.path.join(self.temp_dir.name, "css-updater.json")) as config: import json try: self.config: Dict[str, Any] = json.loads(config.read())["css_updater"] except KeyError as invalid_json: print(invalid_json) except IOError as io_error: print(io_error) def __del__(self: Manager) -> None: self.temp_dir.cleanup()
Check for errors in config
Check for errors in config
Python
mit
neoliberal/css-updater
python
## Code Before: """manages github repos""" import os import tempfile from typing import Dict, Any import pygit2 as git from .webhook.handler import Handler class Manager(object): """handles git repos""" def __init__(self: Manager, handler: Handler) -> None: self.webhook_handler: Handler = handler self.temp_dir: tempfile.TemporaryDirectory = tempfile.TemporaryDirectory() self.repo: git.Repository = git.clone_repository( self.webhook_handler.git_url, path=self.temp_dir.name) with open(os.path.join(self.temp_dir.name, "css-updater.json")) as config: import json self.config: Dict[str, Any] = json.loads(config.read()) def __del__(self: Manager) -> None: self.temp_dir.cleanup() ## Instruction: Check for errors in config ## Code After: """manages github repos""" import os import tempfile from typing import Dict, Any import pygit2 as git from .webhook.handler import Handler class Manager(object): """handles git repos""" def __init__(self: Manager, handler: Handler) -> None: self.webhook_handler: Handler = handler self.temp_dir: tempfile.TemporaryDirectory = tempfile.TemporaryDirectory() self.repo: git.Repository = git.clone_repository( self.webhook_handler.git_url, path=self.temp_dir.name) with open(os.path.join(self.temp_dir.name, "css-updater.json")) as config: import json try: self.config: Dict[str, Any] = json.loads(config.read())["css_updater"] except KeyError as invalid_json: print(invalid_json) except IOError as io_error: print(io_error) def __del__(self: Manager) -> None: self.temp_dir.cleanup()
"""manages github repos""" import os import tempfile from typing import Dict, Any import pygit2 as git from .webhook.handler import Handler class Manager(object): """handles git repos""" def __init__(self: Manager, handler: Handler) -> None: self.webhook_handler: Handler = handler self.temp_dir: tempfile.TemporaryDirectory = tempfile.TemporaryDirectory() self.repo: git.Repository = git.clone_repository( self.webhook_handler.git_url, path=self.temp_dir.name) with open(os.path.join(self.temp_dir.name, "css-updater.json")) as config: import json + try: - self.config: Dict[str, Any] = json.loads(config.read()) + self.config: Dict[str, Any] = json.loads(config.read())["css_updater"] ? ++++ +++++++++++++++ + except KeyError as invalid_json: + print(invalid_json) + except IOError as io_error: + print(io_error) def __del__(self: Manager) -> None: self.temp_dir.cleanup()
7
0.28
6
1
ca871796f957f0ac147298ae67743507a2ea3ca1
data/pests.txt
data/pests.txt
semalt\.com\/crawler\.php semaltmedia\.com buttons-for-website\.com makemoneyonline\.com buttons-for-your-website\.com best-seo-offer\.com 100dollars-seo\.com videos-for-your-business\.com video--production\.com justprofit\.xyz phatvidz\.com free-video-tool\.com 1-free-share-buttons\.com
1-free-share-buttons\.com 100dollars-seo\.com best-seo-offer\.com buttons-for-website\.com buttons-for-your-website\.com free-video-tool\.com justprofit\.xyz makemoneyonline\.com phatvidz\.com semalt\.com\/crawler\.php semaltmedia\.com video--production\.com videos-for-your-business\.com
Sort list of banned domains
Sort list of banned domains
Text
mit
mdippery/rack-pesticide
text
## Code Before: semalt\.com\/crawler\.php semaltmedia\.com buttons-for-website\.com makemoneyonline\.com buttons-for-your-website\.com best-seo-offer\.com 100dollars-seo\.com videos-for-your-business\.com video--production\.com justprofit\.xyz phatvidz\.com free-video-tool\.com 1-free-share-buttons\.com ## Instruction: Sort list of banned domains ## Code After: 1-free-share-buttons\.com 100dollars-seo\.com best-seo-offer\.com buttons-for-website\.com buttons-for-your-website\.com free-video-tool\.com justprofit\.xyz makemoneyonline\.com phatvidz\.com semalt\.com\/crawler\.php semaltmedia\.com video--production\.com videos-for-your-business\.com
+ 1-free-share-buttons\.com + 100dollars-seo\.com + best-seo-offer\.com + buttons-for-website\.com + buttons-for-your-website\.com + free-video-tool\.com + justprofit\.xyz + makemoneyonline\.com + phatvidz\.com semalt\.com\/crawler\.php semaltmedia\.com + video--production\.com - buttons-for-website\.com - makemoneyonline\.com - buttons-for-your-website\.com - best-seo-offer\.com - 100dollars-seo\.com videos-for-your-business\.com - video--production\.com - justprofit\.xyz - phatvidz\.com - free-video-tool\.com - 1-free-share-buttons\.com
20
1.538462
10
10
b9a0fa0ec1cde9d461a6a546a18c3605e34efdce
.travis.yml
.travis.yml
language: java jdk: - oraclejdk8 sudo: true before_install: - sudo apt-get -qq update - sudo apt-get install -y ntp - sudo service ntp start
language: java jdk: - oraclejdk8 sudo: true before_install: - sudo apt-get -qq update - sudo apt-get install -y ntp - sudo service ntp start script: - ./gradlew check - gradle publishToMavenLocal - cd examples/order && ./gradlew check
Include examples into the test sequence
Include examples into the test sequence
YAML
mpl-2.0
eventsourcing/es4j,yrashk/es4j,yrashk/es4j,eventsourcing/es4j,eventsourcing/es4j
yaml
## Code Before: language: java jdk: - oraclejdk8 sudo: true before_install: - sudo apt-get -qq update - sudo apt-get install -y ntp - sudo service ntp start ## Instruction: Include examples into the test sequence ## Code After: language: java jdk: - oraclejdk8 sudo: true before_install: - sudo apt-get -qq update - sudo apt-get install -y ntp - sudo service ntp start script: - ./gradlew check - gradle publishToMavenLocal - cd examples/order && ./gradlew check
language: java jdk: - oraclejdk8 sudo: true before_install: - sudo apt-get -qq update - sudo apt-get install -y ntp - sudo service ntp start + script: + - ./gradlew check + - gradle publishToMavenLocal + - cd examples/order && ./gradlew check
4
0.5
4
0
2fc2a0a216d4d57e8157622c69b59fe566b885a2
setup.py
setup.py
from __future__ import absolute_import, division, print_function import os, sys from setuptools import setup, find_packages setup( name='towncrier', maintainer='Amber Brown', maintainer_email='hawkowl@twistedmatrix.com', url="https://github.com/hawkowl/towncrier", classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", ], use_incremental=True, setup_requires=['incremental'], install_requires=[ 'Click', 'incremental', 'jinja2', 'toml', ], package_dir={"": "src"}, packages=find_packages('src'), license="MIT", zip_safe=False, include_package_data=True, description='Building newsfiles for your project.', long_description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'towncrier = towncrier:_main', ], } )
from __future__ import absolute_import, division, print_function import os, sys from setuptools import setup, find_packages setup( name='towncrier', maintainer='Amber Brown', maintainer_email='hawkowl@twistedmatrix.com', url="https://github.com/hawkowl/towncrier", classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", ], use_incremental=True, setup_requires=['incremental'], install_requires=[ 'Click', 'incremental', 'jinja2', 'toml', ], package_dir={"": "src"}, packages=find_packages('src'), license="MIT", zip_safe=False, include_package_data=True, description='Building newsfiles for your project.', long_description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'towncrier = towncrier:_main', ], } )
Stop being a legacy owl
Stop being a legacy owl
Python
mit
hawkowl/towncrier
python
## Code Before: from __future__ import absolute_import, division, print_function import os, sys from setuptools import setup, find_packages setup( name='towncrier', maintainer='Amber Brown', maintainer_email='hawkowl@twistedmatrix.com', url="https://github.com/hawkowl/towncrier", classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", ], use_incremental=True, setup_requires=['incremental'], install_requires=[ 'Click', 'incremental', 'jinja2', 'toml', ], package_dir={"": "src"}, packages=find_packages('src'), license="MIT", zip_safe=False, include_package_data=True, description='Building newsfiles for your project.', long_description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'towncrier = towncrier:_main', ], } ) ## Instruction: Stop being a legacy owl ## Code After: from __future__ import absolute_import, division, print_function import os, sys from setuptools import setup, find_packages setup( name='towncrier', maintainer='Amber Brown', maintainer_email='hawkowl@twistedmatrix.com', url="https://github.com/hawkowl/towncrier", classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", ], use_incremental=True, setup_requires=['incremental'], install_requires=[ 'Click', 'incremental', 'jinja2', 'toml', ], package_dir={"": "src"}, packages=find_packages('src'), license="MIT", zip_safe=False, include_package_data=True, description='Building newsfiles for your project.', long_description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'towncrier = towncrier:_main', ], } )
from __future__ import absolute_import, division, print_function import os, sys from setuptools import setup, find_packages setup( name='towncrier', maintainer='Amber Brown', maintainer_email='hawkowl@twistedmatrix.com', url="https://github.com/hawkowl/towncrier", classifiers = [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", ], use_incremental=True, setup_requires=['incremental'], install_requires=[ 'Click', 'incremental', 'jinja2', 'toml', ], package_dir={"": "src"}, packages=find_packages('src'), license="MIT", zip_safe=False, include_package_data=True, description='Building newsfiles for your project.', long_description=open('README.rst').read(), entry_points={ 'console_scripts': [ 'towncrier = towncrier:_main', ], } )
1
0.023256
1
0
4f4b7491df1566cb0804f02c9da720d2b9da2550
plugins/merge_helper/lib/db.rb
plugins/merge_helper/lib/db.rb
module Jetpants class DB def aggregator? return @aggregator unless @aggregator.nil? version_info = query_return_array('SHOW VARIABLES LIKE "%version%"') @aggregator = !version_info[:version_comment].nil? && version_info[:version_comment].downcase.include?("mariadb") end end end
module Jetpants class DB def aggregator? return @aggregator unless @aggregator.nil? version_info = query_return_array('SHOW VARIABLES LIKE "version"') @aggregator = !version_info.nil? && !version_info.empty? && version_info.first[:Value].downcase.include?("mariadb") end end end
Change aggregation flag check logic
Change aggregation flag check logic
Ruby
apache-2.0
fgbreel/jetpants,yonglehou/jetpants,fgbreel/jetpants,dallasmarlow/jetpants,yonglehou/jetpants,tumblr/jetpants,tumblr/jetpants,tumblr/jetpants,dallasmarlow/jetpants,tumblr/jetpants
ruby
## Code Before: module Jetpants class DB def aggregator? return @aggregator unless @aggregator.nil? version_info = query_return_array('SHOW VARIABLES LIKE "%version%"') @aggregator = !version_info[:version_comment].nil? && version_info[:version_comment].downcase.include?("mariadb") end end end ## Instruction: Change aggregation flag check logic ## Code After: module Jetpants class DB def aggregator? return @aggregator unless @aggregator.nil? version_info = query_return_array('SHOW VARIABLES LIKE "version"') @aggregator = !version_info.nil? && !version_info.empty? && version_info.first[:Value].downcase.include?("mariadb") end end end
module Jetpants class DB def aggregator? return @aggregator unless @aggregator.nil? - version_info = query_return_array('SHOW VARIABLES LIKE "%version%"') ? - - + version_info = query_return_array('SHOW VARIABLES LIKE "version"') - @aggregator = !version_info[:version_comment].nil? && version_info[:version_comment].downcase.include?("mariadb") ? ^^ ^ ^^^ ^^^^^ ^ ------------- + @aggregator = !version_info.nil? && !version_info.empty? && version_info.first[:Value].downcase.include?("mariadb") ? ^^^^^^^^^^ ^^^ ++ ^ ^ ++++++ ^^^^ end end end
4
0.4
2
2
fbc4bacd3b7551f6e1da2ff8be0e484c4e85fa53
.travis.yml
.travis.yml
language: ruby rvm: - 2.4 before_script: - bundle exec rake db:migrate - npm install -g istanbul
language: ruby rvm: - 2.4 before_script: - bundle exec rake db:schema:load - npm install -g istanbul
Use db:schema:load on tests, as it's faster
Use db:schema:load on tests, as it's faster
YAML
mit
aszecsei/dexterity.io,aszecsei/dexterity.io,aszecsei/dexterity.io
yaml
## Code Before: language: ruby rvm: - 2.4 before_script: - bundle exec rake db:migrate - npm install -g istanbul ## Instruction: Use db:schema:load on tests, as it's faster ## Code After: language: ruby rvm: - 2.4 before_script: - bundle exec rake db:schema:load - npm install -g istanbul
language: ruby rvm: - 2.4 before_script: - - bundle exec rake db:migrate ? --- ^^ + - bundle exec rake db:schema:load ? ++++ ^^^^^ - npm install -g istanbul
2
0.285714
1
1
2f637bd7450f1ada3de59b0fc86789ea72fef86b
sys/modules/linux/linux.sh
sys/modules/linux/linux.sh
FOUND=`kldstat -v | egrep 'linux(aout|elf)'` if [ "x$FOUND" != x ] ; then echo Linux driver already loaded exit 1 else kldload linux fi
FOUND=`kldstat -v | egrep 'linux(aout|elf)'` exitcode=0 if [ "x$FOUND" != x ] ; then echo Linux driver already loaded exitcode=1 else kldload linux exitcode=$? fi if [ -f /compat/linux/sbin/ldconfig ] ; then /compat/linux/sbin/ldconfig fi exit $exitcode
Add a run of Linux ldconfig.
Add a run of Linux ldconfig.
Shell
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
shell
## Code Before: FOUND=`kldstat -v | egrep 'linux(aout|elf)'` if [ "x$FOUND" != x ] ; then echo Linux driver already loaded exit 1 else kldload linux fi ## Instruction: Add a run of Linux ldconfig. ## Code After: FOUND=`kldstat -v | egrep 'linux(aout|elf)'` exitcode=0 if [ "x$FOUND" != x ] ; then echo Linux driver already loaded exitcode=1 else kldload linux exitcode=$? fi if [ -f /compat/linux/sbin/ldconfig ] ; then /compat/linux/sbin/ldconfig fi exit $exitcode
FOUND=`kldstat -v | egrep 'linux(aout|elf)'` + exitcode=0 + if [ "x$FOUND" != x ] ; then echo Linux driver already loaded - exit 1 + exitcode=1 else kldload linux + exitcode=$? fi + + if [ -f /compat/linux/sbin/ldconfig ] ; then + /compat/linux/sbin/ldconfig + fi + + exit $exitcode
11
1.222222
10
1
4c84845e6264c186347c6d347a30d90f699ef036
app/Http/Controllers/ChopsController.php
app/Http/Controllers/ChopsController.php
<?php namespace ChopBox\Http\Controllers; use ChopBox\helpers\PostChop; use ChopBox\Http\Requests\ChopsFormRequest; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Input as Input; class ChopsController extends Controller { /** * Store posted chops * * @param Request $request * * @return Response Redirect to homepage view */ public function store(ChopsFormRequest $request, PostChop $post) { $user = Auth::user(); $images = Input::file('image'); $chopsId = $post->saveChops($user, $request); if (! is_null($images[0])) { $shortened_url = $post->uploadImages($images); $post->saveUploads($user, $images, $shortened_url, $chopsId); } return redirect()->action('HomeController@index'); } }
<?php namespace ChopBox\Http\Controllers; use ChopBox\helpers\PostChop; use Illuminate\Support\Facades\Auth; use ChopBox\Http\Requests\ChopsFormRequest; use Illuminate\Support\Facades\Input as Input; class ChopsController extends Controller { /** * Store posted chops * * @param Request $request * * @return Response Redirect to homepage view */ public function store(ChopsFormRequest $request, PostChop $post) { $user = Auth::user(); $images = Input::file('image'); $chopsId = $post->saveChops($user, $request); if (! is_null($images[0])) { $shortened_url = $post->uploadImages($images); $post->saveUploads($user, $images, $shortened_url, $chopsId); } return redirect()->action('HomeController@index'); } }
Fix indentation and arrange imports from shortest tolongest
[ChopBox] Fix indentation and arrange imports from shortest tolongest
PHP
mit
andela/chopbox,andela/chopbox
php
## Code Before: <?php namespace ChopBox\Http\Controllers; use ChopBox\helpers\PostChop; use ChopBox\Http\Requests\ChopsFormRequest; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Input as Input; class ChopsController extends Controller { /** * Store posted chops * * @param Request $request * * @return Response Redirect to homepage view */ public function store(ChopsFormRequest $request, PostChop $post) { $user = Auth::user(); $images = Input::file('image'); $chopsId = $post->saveChops($user, $request); if (! is_null($images[0])) { $shortened_url = $post->uploadImages($images); $post->saveUploads($user, $images, $shortened_url, $chopsId); } return redirect()->action('HomeController@index'); } } ## Instruction: [ChopBox] Fix indentation and arrange imports from shortest tolongest ## Code After: <?php namespace ChopBox\Http\Controllers; use ChopBox\helpers\PostChop; use Illuminate\Support\Facades\Auth; use ChopBox\Http\Requests\ChopsFormRequest; use Illuminate\Support\Facades\Input as Input; class ChopsController extends Controller { /** * Store posted chops * * @param Request $request * * @return Response Redirect to homepage view */ public function store(ChopsFormRequest $request, PostChop $post) { $user = Auth::user(); $images = Input::file('image'); $chopsId = $post->saveChops($user, $request); if (! is_null($images[0])) { $shortened_url = $post->uploadImages($images); $post->saveUploads($user, $images, $shortened_url, $chopsId); } return redirect()->action('HomeController@index'); } }
<?php namespace ChopBox\Http\Controllers; use ChopBox\helpers\PostChop; + use Illuminate\Support\Facades\Auth; use ChopBox\Http\Requests\ChopsFormRequest; - use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Input as Input; class ChopsController extends Controller { /** * Store posted chops * * @param Request $request * * @return Response Redirect to homepage view */ public function store(ChopsFormRequest $request, PostChop $post) { $user = Auth::user(); $images = Input::file('image'); $chopsId = $post->saveChops($user, $request); if (! is_null($images[0])) { $shortened_url = $post->uploadImages($images); $post->saveUploads($user, $images, $shortened_url, $chopsId); } - - return redirect()->action('HomeController@index'); } }
4
0.114286
1
3
101a7c8e0e26089d6d1deb4e7728e4eb59274b74
app/main/forms.py
app/main/forms.py
from flask.ext.wtf import Form from wtforms import validators from dmutils.forms import StripWhitespaceStringField from .. import data_api_client class AdminEmailAddressValidator(object): def __init__(self, message=None): self.message = message def __call__(self, form, field): if not data_api_client.email_is_valid_for_admin_user(field.data): raise validators.StopValidation(self.message) class EmailAddressForm(Form): email_address = StripWhitespaceStringField('Email address', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message="Please enter a valid email address") ]) class MoveUserForm(Form): user_to_move_email_address = StripWhitespaceStringField('Move an existing user to this supplier', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message="Please enter a valid email address") ]) class EmailDomainForm(Form): new_buyer_domain = StripWhitespaceStringField('Add a buyer email domain', validators=[ validators.DataRequired(message="The domain field can not be empty.") ])
from flask.ext.wtf import Form from wtforms import RadioField, validators from dmutils.forms import StripWhitespaceStringField from .. import data_api_client class AdminEmailAddressValidator(object): def __init__(self, message=None): self.message = message def __call__(self, form, field): if not data_api_client.email_is_valid_for_admin_user(field.data): raise validators.StopValidation(self.message) class EmailAddressForm(Form): email_address = StripWhitespaceStringField('Email address', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message="Please enter a valid email address") ]) class MoveUserForm(Form): user_to_move_email_address = StripWhitespaceStringField('Move an existing user to this supplier', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message="Please enter a valid email address") ]) class EmailDomainForm(Form): new_buyer_domain = StripWhitespaceStringField('Add a buyer email domain', validators=[ validators.DataRequired(message="The domain field can not be empty.") ]) class InviteAdminForm(Form): role_choices = [ ('admin-ccs-category', 'Category'), ('admin-ccs-sourcing', 'Sourcing'), ('admin', 'Support'), ] email_address = StripWhitespaceStringField( 'Email address', validators=[ validators.DataRequired(message='You must provide an email address'), validators.Email(message='Please enter a valid email address'), AdminEmailAddressValidator(message='The email address must belong to an approved domain') ] ) role = RadioField( 'Permissions', validators=[validators.InputRequired(message='You must choose a permission')], choices=role_choices ) def __init__(self, *args, **kwargs): super(InviteAdminForm, self).__init__(*args, **kwargs) self.role.toolkit_macro_options = [{'value': i[0], 'label': i[1]} for i in self.role_choices]
Add InviteAdminForm with email_address and role fields
Add InviteAdminForm with email_address and role fields
Python
mit
alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend
python
## Code Before: from flask.ext.wtf import Form from wtforms import validators from dmutils.forms import StripWhitespaceStringField from .. import data_api_client class AdminEmailAddressValidator(object): def __init__(self, message=None): self.message = message def __call__(self, form, field): if not data_api_client.email_is_valid_for_admin_user(field.data): raise validators.StopValidation(self.message) class EmailAddressForm(Form): email_address = StripWhitespaceStringField('Email address', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message="Please enter a valid email address") ]) class MoveUserForm(Form): user_to_move_email_address = StripWhitespaceStringField('Move an existing user to this supplier', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message="Please enter a valid email address") ]) class EmailDomainForm(Form): new_buyer_domain = StripWhitespaceStringField('Add a buyer email domain', validators=[ validators.DataRequired(message="The domain field can not be empty.") ]) ## Instruction: Add InviteAdminForm with email_address and role fields ## Code After: from flask.ext.wtf import Form from wtforms import RadioField, validators from dmutils.forms import StripWhitespaceStringField from .. import data_api_client class AdminEmailAddressValidator(object): def __init__(self, message=None): self.message = message def __call__(self, form, field): if not data_api_client.email_is_valid_for_admin_user(field.data): raise validators.StopValidation(self.message) class EmailAddressForm(Form): email_address = StripWhitespaceStringField('Email address', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message="Please enter a valid email address") ]) class MoveUserForm(Form): user_to_move_email_address = StripWhitespaceStringField('Move an existing user to this supplier', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message="Please enter a valid email address") ]) class EmailDomainForm(Form): new_buyer_domain = StripWhitespaceStringField('Add a buyer email domain', validators=[ validators.DataRequired(message="The domain field can not be empty.") ]) class InviteAdminForm(Form): role_choices = [ ('admin-ccs-category', 'Category'), ('admin-ccs-sourcing', 'Sourcing'), ('admin', 'Support'), ] email_address = StripWhitespaceStringField( 'Email address', validators=[ validators.DataRequired(message='You must provide an email address'), validators.Email(message='Please enter a valid email address'), AdminEmailAddressValidator(message='The email address must belong to an approved domain') ] ) role = RadioField( 'Permissions', validators=[validators.InputRequired(message='You must choose a permission')], choices=role_choices ) def __init__(self, *args, **kwargs): super(InviteAdminForm, self).__init__(*args, **kwargs) self.role.toolkit_macro_options = [{'value': i[0], 'label': i[1]} for i in self.role_choices]
from flask.ext.wtf import Form - from wtforms import validators + from wtforms import RadioField, validators ? ++++++++++++ from dmutils.forms import StripWhitespaceStringField from .. import data_api_client class AdminEmailAddressValidator(object): def __init__(self, message=None): self.message = message def __call__(self, form, field): if not data_api_client.email_is_valid_for_admin_user(field.data): raise validators.StopValidation(self.message) class EmailAddressForm(Form): email_address = StripWhitespaceStringField('Email address', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message="Please enter a valid email address") ]) class MoveUserForm(Form): user_to_move_email_address = StripWhitespaceStringField('Move an existing user to this supplier', validators=[ validators.DataRequired(message="Email can not be empty"), validators.Email(message="Please enter a valid email address") ]) class EmailDomainForm(Form): new_buyer_domain = StripWhitespaceStringField('Add a buyer email domain', validators=[ validators.DataRequired(message="The domain field can not be empty.") ]) + + + class InviteAdminForm(Form): + role_choices = [ + ('admin-ccs-category', 'Category'), + ('admin-ccs-sourcing', 'Sourcing'), + ('admin', 'Support'), + ] + + email_address = StripWhitespaceStringField( + 'Email address', + validators=[ + validators.DataRequired(message='You must provide an email address'), + validators.Email(message='Please enter a valid email address'), + AdminEmailAddressValidator(message='The email address must belong to an approved domain') + ] + ) + role = RadioField( + 'Permissions', + validators=[validators.InputRequired(message='You must choose a permission')], + choices=role_choices + ) + + def __init__(self, *args, **kwargs): + super(InviteAdminForm, self).__init__(*args, **kwargs) + self.role.toolkit_macro_options = [{'value': i[0], 'label': i[1]} for i in self.role_choices]
28
0.777778
27
1
0367796657012e6de50acc4e6f8bafef340b3213
codecov.yml
codecov.yml
coverage: status: patch: false changes: false project: default: target: auto comment: off ignore: - "/bin"
coverage: status: patch: false changes: false project: default: target: auto threshold: 0.1% comment: off ignore: - "/bin"
Adjust coverage thresholds for PRs
Adjust coverage thresholds for PRs
YAML
apache-2.0
ampproject/amp-toolbox-php,ampproject/amp-toolbox-php
yaml
## Code Before: coverage: status: patch: false changes: false project: default: target: auto comment: off ignore: - "/bin" ## Instruction: Adjust coverage thresholds for PRs ## Code After: coverage: status: patch: false changes: false project: default: target: auto threshold: 0.1% comment: off ignore: - "/bin"
coverage: status: patch: false changes: false project: default: target: auto + threshold: 0.1% comment: off ignore: - "/bin"
1
0.083333
1
0
37a155226210640f16018e1033d4769b2fb36909
gitst.c
gitst.c
int main(int argc, char **argv) { char* gitbuff; int out = run_proc(&gitbuff, "git", "branch", "--list", 0); //int out = run_proc(&gitbuff, "ls", "-l", "-h", 0); if (out != 0) { fprintf(stderr, "Error running subprocess:%d\n", out); exit(1); } //printf("run_proc exit code = %d\nresponse= '''%s'''\n", out, gitbuff); char *br; br = gitbuff; putchar('('); while(*br++ != '*') {} // skip the '*' and the space after it br++; while(*br != '\n') { putchar(*br++); } putchar(')'); putchar('\n'); }
int main(int argc, char **argv) { char* gitbuff; int out = run_proc(&gitbuff, "git", "branch", "--list", 0); if (out != 0) { exit(1); } char *token; char *sep=" \r\n"; int next = 0; while((token = strsep(&gitbuff, sep)) != NULL) { if (token[0] == '*') { token = strsep(&gitbuff, sep); printf("(%s)", token); break; } } return 0; }
Use strsep to split output
Use strsep to split output
C
bsd-3-clause
wnh/prompt_utils
c
## Code Before: int main(int argc, char **argv) { char* gitbuff; int out = run_proc(&gitbuff, "git", "branch", "--list", 0); //int out = run_proc(&gitbuff, "ls", "-l", "-h", 0); if (out != 0) { fprintf(stderr, "Error running subprocess:%d\n", out); exit(1); } //printf("run_proc exit code = %d\nresponse= '''%s'''\n", out, gitbuff); char *br; br = gitbuff; putchar('('); while(*br++ != '*') {} // skip the '*' and the space after it br++; while(*br != '\n') { putchar(*br++); } putchar(')'); putchar('\n'); } ## Instruction: Use strsep to split output ## Code After: int main(int argc, char **argv) { char* gitbuff; int out = run_proc(&gitbuff, "git", "branch", "--list", 0); if (out != 0) { exit(1); } char *token; char *sep=" \r\n"; int next = 0; while((token = strsep(&gitbuff, sep)) != NULL) { if (token[0] == '*') { token = strsep(&gitbuff, sep); printf("(%s)", token); break; } } return 0; }
int main(int argc, char **argv) { - char* gitbuff; int out = run_proc(&gitbuff, "git", "branch", "--list", 0); - //int out = run_proc(&gitbuff, "ls", "-l", "-h", 0); if (out != 0) { - fprintf(stderr, "Error running subprocess:%d\n", out); exit(1); } - //printf("run_proc exit code = %d\nresponse= '''%s'''\n", out, gitbuff); + char *token; + char *sep=" \r\n"; + int next = 0; + while((token = strsep(&gitbuff, sep)) != NULL) - char *br; - - br = gitbuff; - putchar('('); - - while(*br++ != '*') {} - // skip the '*' and the space after it - br++; - while(*br != '\n') { - putchar(*br++); + if (token[0] == '*') { + token = strsep(&gitbuff, sep); + printf("(%s)", token); + break; + } - } + } ? + + return 0; - - putchar(')'); - putchar('\n'); } -
30
0.9375
11
19
31fe9a0d06fc2fbba018632a4f96ae7ca92b5d87
app/models/manageiq/providers/openstack/cloud_manager/vnf/status.rb
app/models/manageiq/providers/openstack/cloud_manager/vnf/status.rb
class ManageIQ::Providers::Openstack::CloudManager::Vnf::Status < ::OrchestrationStack::Status def succeeded? status.downcase == "active" end def failed? status.downcase =~ /failed$/ end def rolled_back? status.downcase == "rollback_complete" end def deleted? status.downcase == "delete_complete" end def updated? status.downcase == "update_complete" end end
class ManageIQ::Providers::Openstack::CloudManager::Vnf::Status < ::OrchestrationStack::Status def succeeded? status.downcase == "active" end def failed? status.downcase =~ /failed$/ || status.downcase == "error" end def rolled_back? status.downcase == "rollback_complete" end def deleted? status.downcase == "delete_complete" end def updated? status.downcase == "update_complete" end end
Handle VNF error state correctly
Handle VNF error state correctly Handle VNF error state correctly
Ruby
apache-2.0
kbrock/manageiq,maas-ufcg/manageiq,hstastna/manageiq,andyvesel/manageiq,josejulio/manageiq,josejulio/manageiq,KevinLoiseau/manageiq,gerikis/manageiq,NickLaMuro/manageiq,syncrou/manageiq,ailisp/manageiq,syncrou/manageiq,jntullo/manageiq,fbladilo/manageiq,pkomanek/manageiq,israel-hdez/manageiq,djberg96/manageiq,mkanoor/manageiq,andyvesel/manageiq,ailisp/manageiq,mzazrivec/manageiq,ManageIQ/manageiq,borod108/manageiq,durandom/manageiq,jameswnl/manageiq,hstastna/manageiq,agrare/manageiq,billfitzgerald0120/manageiq,tzumainn/manageiq,kbrock/manageiq,branic/manageiq,d-m-u/manageiq,syncrou/manageiq,tinaafitz/manageiq,jntullo/manageiq,pkomanek/manageiq,lpichler/manageiq,mresti/manageiq,d-m-u/manageiq,NickLaMuro/manageiq,yaacov/manageiq,tzumainn/manageiq,matobet/manageiq,gmcculloug/manageiq,durandom/manageiq,durandom/manageiq,jameswnl/manageiq,borod108/manageiq,gerikis/manageiq,matobet/manageiq,aufi/manageiq,maas-ufcg/manageiq,romaintb/manageiq,romaintb/manageiq,juliancheal/manageiq,fbladilo/manageiq,mkanoor/manageiq,agrare/manageiq,josejulio/manageiq,maas-ufcg/manageiq,aufi/manageiq,lpichler/manageiq,mfeifer/manageiq,KevinLoiseau/manageiq,hstastna/manageiq,mfeifer/manageiq,jrafanie/manageiq,chessbyte/manageiq,mzazrivec/manageiq,lpichler/manageiq,matobet/manageiq,jntullo/manageiq,tinaafitz/manageiq,gmcculloug/manageiq,aufi/manageiq,syncrou/manageiq,mresti/manageiq,mresti/manageiq,borod108/manageiq,juliancheal/manageiq,israel-hdez/manageiq,jrafanie/manageiq,jvlcek/manageiq,KevinLoiseau/manageiq,fbladilo/manageiq,gmcculloug/manageiq,KevinLoiseau/manageiq,tinaafitz/manageiq,romanblanco/manageiq,romaintb/manageiq,israel-hdez/manageiq,mfeifer/manageiq,KevinLoiseau/manageiq,NaNi-Z/manageiq,ailisp/manageiq,romanblanco/manageiq,billfitzgerald0120/manageiq,skateman/manageiq,kbrock/manageiq,branic/manageiq,borod108/manageiq,israel-hdez/manageiq,mfeifer/manageiq,agrare/manageiq,ManageIQ/manageiq,branic/manageiq,maas-ufcg/manageiq,NaNi-Z/manageiq,mkanoor/manageiq,NickLaMuro/manageiq,matobet/manageiq,romanblanco/manageiq,ilackarms/manageiq,gerikis/manageiq,billfitzgerald0120/manageiq,djberg96/manageiq,tzumainn/manageiq,yaacov/manageiq,durandom/manageiq,skateman/manageiq,chessbyte/manageiq,gerikis/manageiq,jrafanie/manageiq,jvlcek/manageiq,jrafanie/manageiq,pkomanek/manageiq,maas-ufcg/manageiq,ManageIQ/manageiq,ilackarms/manageiq,yaacov/manageiq,jameswnl/manageiq,djberg96/manageiq,hstastna/manageiq,lpichler/manageiq,branic/manageiq,skateman/manageiq,jvlcek/manageiq,NaNi-Z/manageiq,pkomanek/manageiq,KevinLoiseau/manageiq,d-m-u/manageiq,chessbyte/manageiq,mresti/manageiq,skateman/manageiq,romaintb/manageiq,juliancheal/manageiq,jvlcek/manageiq,andyvesel/manageiq,d-m-u/manageiq,romaintb/manageiq,NickLaMuro/manageiq,romanblanco/manageiq,chessbyte/manageiq,agrare/manageiq,jameswnl/manageiq,ManageIQ/manageiq,josejulio/manageiq,NaNi-Z/manageiq,mkanoor/manageiq,ilackarms/manageiq,gmcculloug/manageiq,andyvesel/manageiq,fbladilo/manageiq,yaacov/manageiq,djberg96/manageiq,tzumainn/manageiq,romaintb/manageiq,tinaafitz/manageiq,kbrock/manageiq,billfitzgerald0120/manageiq,mzazrivec/manageiq,juliancheal/manageiq,jntullo/manageiq,maas-ufcg/manageiq,ailisp/manageiq,aufi/manageiq,ilackarms/manageiq,mzazrivec/manageiq
ruby
## Code Before: class ManageIQ::Providers::Openstack::CloudManager::Vnf::Status < ::OrchestrationStack::Status def succeeded? status.downcase == "active" end def failed? status.downcase =~ /failed$/ end def rolled_back? status.downcase == "rollback_complete" end def deleted? status.downcase == "delete_complete" end def updated? status.downcase == "update_complete" end end ## Instruction: Handle VNF error state correctly Handle VNF error state correctly ## Code After: class ManageIQ::Providers::Openstack::CloudManager::Vnf::Status < ::OrchestrationStack::Status def succeeded? status.downcase == "active" end def failed? status.downcase =~ /failed$/ || status.downcase == "error" end def rolled_back? status.downcase == "rollback_complete" end def deleted? status.downcase == "delete_complete" end def updated? status.downcase == "update_complete" end end
class ManageIQ::Providers::Openstack::CloudManager::Vnf::Status < ::OrchestrationStack::Status def succeeded? status.downcase == "active" end def failed? - status.downcase =~ /failed$/ + status.downcase =~ /failed$/ || status.downcase == "error" end def rolled_back? status.downcase == "rollback_complete" end def deleted? status.downcase == "delete_complete" end def updated? status.downcase == "update_complete" end end
2
0.095238
1
1
be491a7fbc812722a9d6a973463f0999eeef0185
CHANGELOG.md
CHANGELOG.md
* Queryset cache on generic view * Add image thumb on ArticleBox * Send current site to template ``{{ SITE }}`` * In /rss feed, filter channels by **published** and **include_in_main_rss** * RSS Feed now renders in a template * Flatpage is content type Article * **Hotfix** fix *memory leak* (articles generic view) * Chekc OPPS_PAGINATE_NOT_APP app not used PAGINATE_SUFFIX * Used cache page ## 0.1.7 ## 0.1.6 ## 0.1.5 ## 0.1.4 ## 0.1.3 ## 0.1.0 * Initial release
* Content type (Container) * Isoled boxes application * ContainerBox, generic box (concept) * Used Container in all application * Archives, file manager * Images used archives * Used RST on README, pypi compatibility * Add contrib pattern (like django) * Upgrade haystack to 2.0 (stable) * Opps Generic Views * * New view format, used to URLs pattern ## 0.1.9 ## 0.1.8 * Queryset cache on generic view * Add image thumb on ArticleBox * Send current site to template ``{{ SITE }}`` * In /rss feed, filter channels by **published** and **include_in_main_rss** * RSS Feed now renders in a template * Flatpage is content type Article * **Hotfix** fix *memory leak* (articles generic view) * Chekc OPPS_PAGINATE_NOT_APP app not used PAGINATE_SUFFIX * Used cache page ## 0.1.7 ## 0.1.6 ## 0.1.5 ## 0.1.4 ## 0.1.3 ## 0.1.0 * Initial release
Update changelog to version 0.2
Update changelog to version 0.2
Markdown
mit
YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps,jeanmask/opps,opps/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,williamroot/opps,opps/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,opps/opps
markdown
## Code Before: * Queryset cache on generic view * Add image thumb on ArticleBox * Send current site to template ``{{ SITE }}`` * In /rss feed, filter channels by **published** and **include_in_main_rss** * RSS Feed now renders in a template * Flatpage is content type Article * **Hotfix** fix *memory leak* (articles generic view) * Chekc OPPS_PAGINATE_NOT_APP app not used PAGINATE_SUFFIX * Used cache page ## 0.1.7 ## 0.1.6 ## 0.1.5 ## 0.1.4 ## 0.1.3 ## 0.1.0 * Initial release ## Instruction: Update changelog to version 0.2 ## Code After: * Content type (Container) * Isoled boxes application * ContainerBox, generic box (concept) * Used Container in all application * Archives, file manager * Images used archives * Used RST on README, pypi compatibility * Add contrib pattern (like django) * Upgrade haystack to 2.0 (stable) * Opps Generic Views * * New view format, used to URLs pattern ## 0.1.9 ## 0.1.8 * Queryset cache on generic view * Add image thumb on ArticleBox * Send current site to template ``{{ SITE }}`` * In /rss feed, filter channels by **published** and **include_in_main_rss** * RSS Feed now renders in a template * Flatpage is content type Article * **Hotfix** fix *memory leak* (articles generic view) * Chekc OPPS_PAGINATE_NOT_APP app not used PAGINATE_SUFFIX * Used cache page ## 0.1.7 ## 0.1.6 ## 0.1.5 ## 0.1.4 ## 0.1.3 ## 0.1.0 * Initial release
+ + * Content type (Container) + * Isoled boxes application + * ContainerBox, generic box (concept) + * Used Container in all application + * Archives, file manager + * Images used archives + * Used RST on README, pypi compatibility + * Add contrib pattern (like django) + * Upgrade haystack to 2.0 (stable) + * Opps Generic Views + * * New view format, used to URLs pattern + + ## 0.1.9 + + ## 0.1.8 * Queryset cache on generic view * Add image thumb on ArticleBox * Send current site to template ``{{ SITE }}`` * In /rss feed, filter channels by **published** and **include_in_main_rss** * RSS Feed now renders in a template * Flatpage is content type Article * **Hotfix** fix *memory leak* (articles generic view) * Chekc OPPS_PAGINATE_NOT_APP app not used PAGINATE_SUFFIX * Used cache page ## 0.1.7 ## 0.1.6 ## 0.1.5 ## 0.1.4 ## 0.1.3 ## 0.1.0 * Initial release
16
0.666667
16
0
35786af3235a2ea0176f014807cfaaa947696188
.travis.yml
.travis.yml
language: ruby before_script: - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config script: "bundle exec rake spec" rvm: - 1.9.3 - 2.0.0 env: - PUPPET_GEM_VERSION="~> 3.1.0" - PUPPET_GEM_VERSION="~> 3.2.0" - PUPPET_GEM_VERSION="~> 3.3.0" - PUPPET_GEM_VERSION="~> 3.4.0" branches: only: - master matrix: exclude: - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.0.0" - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.1.0" notifications: email: false
language: ruby before_script: - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config script: "bundle exec rake spec" rvm: - 1.9.3 - 2.0.0 env: - PUPPET_GEM_VERSION="~> 3.1.0" - PUPPET_GEM_VERSION="~> 3.2.0" - PUPPET_GEM_VERSION="~> 3.3.0" - PUPPET_GEM_VERSION="~> 3.4.0" branches: only: - master matrix: allow_failures: - env: PUPPET_GEM_VERSION="~> 3.4.0" exclude: - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.0.0" - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.1.0" notifications: email: false
Allow failures for 3.4.x as it is a known bug with module_data
Allow failures for 3.4.x as it is a known bug with module_data
YAML
apache-2.0
cyberious/puppet-windows_java
yaml
## Code Before: language: ruby before_script: - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config script: "bundle exec rake spec" rvm: - 1.9.3 - 2.0.0 env: - PUPPET_GEM_VERSION="~> 3.1.0" - PUPPET_GEM_VERSION="~> 3.2.0" - PUPPET_GEM_VERSION="~> 3.3.0" - PUPPET_GEM_VERSION="~> 3.4.0" branches: only: - master matrix: exclude: - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.0.0" - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.1.0" notifications: email: false ## Instruction: Allow failures for 3.4.x as it is a known bug with module_data ## Code After: language: ruby before_script: - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config script: "bundle exec rake spec" rvm: - 1.9.3 - 2.0.0 env: - PUPPET_GEM_VERSION="~> 3.1.0" - PUPPET_GEM_VERSION="~> 3.2.0" - PUPPET_GEM_VERSION="~> 3.3.0" - PUPPET_GEM_VERSION="~> 3.4.0" branches: only: - master matrix: allow_failures: - env: PUPPET_GEM_VERSION="~> 3.4.0" exclude: - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.0.0" - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.1.0" notifications: email: false
language: ruby before_script: - echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config script: "bundle exec rake spec" rvm: - 1.9.3 - 2.0.0 env: - PUPPET_GEM_VERSION="~> 3.1.0" - PUPPET_GEM_VERSION="~> 3.2.0" - PUPPET_GEM_VERSION="~> 3.3.0" - PUPPET_GEM_VERSION="~> 3.4.0" branches: only: - master matrix: + allow_failures: + - env: PUPPET_GEM_VERSION="~> 3.4.0" exclude: - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.0.0" - rvm: 2.0.0 env: PUPPET_GEM_VERSION="~> 3.1.0" notifications: email: false
2
0.086957
2
0
95650d391e04f6e56da8a82085e92ac5b0c8d4f2
scripts/xcode-server.coffee
scripts/xcode-server.coffee
url = require('url') querystring = require('querystring') module.exports = (robot) -> robot.router.get "/hubot/xcode-publish-notify", (req, res) -> query = querystring.parse(url.parse(req.url).query) app = query.app || null success = query.success == "true" || false version = query.version || null number = query.number || null error = query.error || null if success robot.messageRoom '#publishmobileautomati', 'Built ' + app + ' ' + version + '-' + number + ' successfully. Currently available on Crashlytics for download.' else robot.messageRoom '#publishmobileautomati', 'BUILD FAILED: ' + app + ' with error ' + error res.writeHead 204, { 'Content-Length': 0} res.end()
url = require('url') querystring = require('querystring') module.exports = (robot) -> robot.router.get "/hubot/xcode-publish-notify", (req, res) -> query = querystring.parse(url.parse(req.url).query) app = query.app || null success = query.success == "true" || false version = query.version || null number = query.number || null error = query.error || null if success robot.messageRoom '#publishmobileautomati', 'Built ' + app + ' ' + version + '-' + number + ' successfully. Currently available on Crashlytics for download.' else robot.messageRoom '#publishmobileautomati', 'FAILED while building' + app + ' with error ' + error res.writeHead 204, { 'Content-Length': 0} res.end()
Update copy for a more natural sentence
Update copy for a more natural sentence
CoffeeScript
mit
brandnetworks/our-product-slack-hubot
coffeescript
## Code Before: url = require('url') querystring = require('querystring') module.exports = (robot) -> robot.router.get "/hubot/xcode-publish-notify", (req, res) -> query = querystring.parse(url.parse(req.url).query) app = query.app || null success = query.success == "true" || false version = query.version || null number = query.number || null error = query.error || null if success robot.messageRoom '#publishmobileautomati', 'Built ' + app + ' ' + version + '-' + number + ' successfully. Currently available on Crashlytics for download.' else robot.messageRoom '#publishmobileautomati', 'BUILD FAILED: ' + app + ' with error ' + error res.writeHead 204, { 'Content-Length': 0} res.end() ## Instruction: Update copy for a more natural sentence ## Code After: url = require('url') querystring = require('querystring') module.exports = (robot) -> robot.router.get "/hubot/xcode-publish-notify", (req, res) -> query = querystring.parse(url.parse(req.url).query) app = query.app || null success = query.success == "true" || false version = query.version || null number = query.number || null error = query.error || null if success robot.messageRoom '#publishmobileautomati', 'Built ' + app + ' ' + version + '-' + number + ' successfully. Currently available on Crashlytics for download.' else robot.messageRoom '#publishmobileautomati', 'FAILED while building' + app + ' with error ' + error res.writeHead 204, { 'Content-Length': 0} res.end()
url = require('url') querystring = require('querystring') module.exports = (robot) -> robot.router.get "/hubot/xcode-publish-notify", (req, res) -> query = querystring.parse(url.parse(req.url).query) app = query.app || null success = query.success == "true" || false version = query.version || null number = query.number || null error = query.error || null if success robot.messageRoom '#publishmobileautomati', 'Built ' + app + ' ' + version + '-' + number + ' successfully. Currently available on Crashlytics for download.' else - robot.messageRoom '#publishmobileautomati', 'BUILD FAILED: ' + app + ' with error ' + error ? ------ - + robot.messageRoom '#publishmobileautomati', 'FAILED while building' + app + ' with error ' + error ? ++++++++++++++ res.writeHead 204, { 'Content-Length': 0} res.end()
2
0.095238
1
1
08666f1c6270c81ec36b60a18eaf40c9879e8c8a
_config.yml
_config.yml
title: Restify email: wblankenship@netflix.com description: Jekyll Template for Project Websites providing documentation and blog post pages. baseurl: "" # the subpath of your site, e.g. /blog/ url: https://restify.github.io # the base hostname & protocol for your site git_address: https://github.com/restify/node-restify git_edit_address: https://github.com/restify/node-restify # Build settings markdown: kramdown highlighter: rouge gems: - jekyll-feed - jekyll-redirect-from - jekyll-seo-tag - jekyll-sitemap exclude: - Gemfile - Gemfile.lock - .idea/ - .gitignore - README.md timezone: America/Los_Angeles defaults: #- scope: # path: _posts # type: posts # values: # layout: post # sectionid: blog - scope: path: _docs/docs type: docs values: layout: docs sectionid: docs seo: type: "WebPage" collections: docs: permalink: /:collection/:path/ output: true posts: permalink: /blog/:year/:month/:day/:title/ output: true
title: Restify email: wblankenship@netflix.com description: A Node.js web service framework optimized for building semantically correct RESTful web services ready for production use at scale. restify optimizes for introspection and perfromance, and is used in some of the largest Node.js deployments on Earth. baseurl: "" # the subpath of your site, e.g. /blog/ url: https://restify.github.io # the base hostname & protocol for your site git_address: https://github.com/restify/node-restify git_edit_address: https://github.com/restify/node-restify # Build settings markdown: kramdown highlighter: rouge gems: - jekyll-feed - jekyll-redirect-from - jekyll-seo-tag - jekyll-sitemap exclude: - Gemfile - Gemfile.lock - .idea/ - .gitignore - README.md timezone: America/Los_Angeles defaults: #- scope: # path: _posts # type: posts # values: # layout: post # sectionid: blog - scope: path: _docs/docs type: docs values: layout: docs sectionid: docs seo: type: "WebPage" collections: docs: permalink: /:collection/:path/ output: true posts: permalink: /blog/:year/:month/:day/:title/ output: true
Make it have a better description in the googles
Make it have a better description in the googles Yeah this is showing up in search, it annoyed me so heres a fix
YAML
mit
restify/restify.github.io,restify/restify.github.io,restify/restify.github.io
yaml
## Code Before: title: Restify email: wblankenship@netflix.com description: Jekyll Template for Project Websites providing documentation and blog post pages. baseurl: "" # the subpath of your site, e.g. /blog/ url: https://restify.github.io # the base hostname & protocol for your site git_address: https://github.com/restify/node-restify git_edit_address: https://github.com/restify/node-restify # Build settings markdown: kramdown highlighter: rouge gems: - jekyll-feed - jekyll-redirect-from - jekyll-seo-tag - jekyll-sitemap exclude: - Gemfile - Gemfile.lock - .idea/ - .gitignore - README.md timezone: America/Los_Angeles defaults: #- scope: # path: _posts # type: posts # values: # layout: post # sectionid: blog - scope: path: _docs/docs type: docs values: layout: docs sectionid: docs seo: type: "WebPage" collections: docs: permalink: /:collection/:path/ output: true posts: permalink: /blog/:year/:month/:day/:title/ output: true ## Instruction: Make it have a better description in the googles Yeah this is showing up in search, it annoyed me so heres a fix ## Code After: title: Restify email: wblankenship@netflix.com description: A Node.js web service framework optimized for building semantically correct RESTful web services ready for production use at scale. restify optimizes for introspection and perfromance, and is used in some of the largest Node.js deployments on Earth. baseurl: "" # the subpath of your site, e.g. /blog/ url: https://restify.github.io # the base hostname & protocol for your site git_address: https://github.com/restify/node-restify git_edit_address: https://github.com/restify/node-restify # Build settings markdown: kramdown highlighter: rouge gems: - jekyll-feed - jekyll-redirect-from - jekyll-seo-tag - jekyll-sitemap exclude: - Gemfile - Gemfile.lock - .idea/ - .gitignore - README.md timezone: America/Los_Angeles defaults: #- scope: # path: _posts # type: posts # values: # layout: post # sectionid: blog - scope: path: _docs/docs type: docs values: layout: docs sectionid: docs seo: type: "WebPage" collections: docs: permalink: /:collection/:path/ output: true posts: permalink: /blog/:year/:month/:day/:title/ output: true
title: Restify email: wblankenship@netflix.com description: + A Node.js web service framework optimized for building semantically correct RESTful web services ready for production use at scale. restify optimizes for introspection and perfromance, and is used in some of the largest Node.js deployments on Earth. - Jekyll Template for Project Websites - providing documentation and blog post pages. baseurl: "" # the subpath of your site, e.g. /blog/ url: https://restify.github.io # the base hostname & protocol for your site git_address: https://github.com/restify/node-restify git_edit_address: https://github.com/restify/node-restify # Build settings markdown: kramdown highlighter: rouge gems: - jekyll-feed - jekyll-redirect-from - jekyll-seo-tag - jekyll-sitemap exclude: - Gemfile - Gemfile.lock - .idea/ - .gitignore - README.md timezone: America/Los_Angeles defaults: #- scope: # path: _posts # type: posts # values: # layout: post # sectionid: blog - scope: path: _docs/docs type: docs values: layout: docs sectionid: docs seo: type: "WebPage" collections: docs: permalink: /:collection/:path/ output: true posts: permalink: /blog/:year/:month/:day/:title/ output: true
3
0.058824
1
2
66ae3d60f4bbbe9f39107828ee89ce9d6c89ffa5
railseventstore.org/config.rb
railseventstore.org/config.rb
activate :aria_current activate :directory_indexes activate :syntax do |syntax| syntax.css_class = "syntax-highlight" end set :markdown, tables: true, autolink: true, gh_blockcode: true, fenced_code_blocks: true, with_toc_data: false set :markdown_engine, :redcarpet set :res_version, File.read('../RES_VERSION') page "/", layout: "landing" page "/docs/*", layout: "documentation"
activate :aria_current activate :directory_indexes activate :syntax do |syntax| syntax.css_class = "syntax-highlight" end set :markdown, tables: true, autolink: true, gh_blockcode: true, fenced_code_blocks: true, with_toc_data: false, no_intra_emphasis: true set :markdown_engine, :redcarpet set :res_version, File.read('../RES_VERSION') page "/", layout: "landing" page "/docs/*", layout: "documentation"
Make it easier on _ in names.
Make it easier on _ in names.
Ruby
mit
RailsEventStore/rails_event_store,mpraglowski/rails_event_store,arkency/rails_event_store,RailsEventStore/rails_event_store,mpraglowski/rails_event_store,RailsEventStore/rails_event_store,RailsEventStore/rails_event_store,mpraglowski/rails_event_store,arkency/rails_event_store,mpraglowski/rails_event_store,arkency/rails_event_store,arkency/rails_event_store
ruby
## Code Before: activate :aria_current activate :directory_indexes activate :syntax do |syntax| syntax.css_class = "syntax-highlight" end set :markdown, tables: true, autolink: true, gh_blockcode: true, fenced_code_blocks: true, with_toc_data: false set :markdown_engine, :redcarpet set :res_version, File.read('../RES_VERSION') page "/", layout: "landing" page "/docs/*", layout: "documentation" ## Instruction: Make it easier on _ in names. ## Code After: activate :aria_current activate :directory_indexes activate :syntax do |syntax| syntax.css_class = "syntax-highlight" end set :markdown, tables: true, autolink: true, gh_blockcode: true, fenced_code_blocks: true, with_toc_data: false, no_intra_emphasis: true set :markdown_engine, :redcarpet set :res_version, File.read('../RES_VERSION') page "/", layout: "landing" page "/docs/*", layout: "documentation"
activate :aria_current activate :directory_indexes activate :syntax do |syntax| syntax.css_class = "syntax-highlight" end - set :markdown, tables: true, autolink: true, gh_blockcode: true, fenced_code_blocks: true, with_toc_data: false + set :markdown, tables: true, autolink: true, gh_blockcode: true, fenced_code_blocks: true, with_toc_data: false, no_intra_emphasis: true ? +++++++++++++++++++++++++ set :markdown_engine, :redcarpet set :res_version, File.read('../RES_VERSION') page "/", layout: "landing" page "/docs/*", layout: "documentation"
2
0.166667
1
1
eee37a4079171491ff260102dcf7144f7e51d5ac
_includes/tag_link_formatter.html
_includes/tag_link_formatter.html
{% comment %} Format a link to a posts-with-tag page from "tag", a _data/tags.yml object, and "tag_separator". {% endcomment %} <a href="{{ site.baseurl }}/tag/{{ include.tag.slug }}">{{ include.tag.name }}</a>{% if forloop.last == false %}{{ include.tag_separator }}{% endif %}
{% comment %} Format a link to a posts-with-tag page from "tag", a _data/tags.yml object, and "tag_separator". {% endcomment %} {% if site.permalink == 'pretty' %} {% capture tag_page %}{{ include.tag.slug }}/{% endcapture %} {% else %} {% capture tag_page %}{{ include.tag.slug }}.html{% endcapture %} {% endif %} <a href="{{ site.baseurl }}/tag/{{ tag_page }}" title="Posts tagged '{{ include.tag.name }}'">{{ include.tag.name }}</a>{% if forloop.last == false %}{{ include.tag_separator }}{% endif %}
Fix tag links for 'ordinal', 'date', 'none' permalinks
Fix tag links for 'ordinal', 'date', 'none' permalinks
HTML
mit
awwnb/awwnb.github.io,awwnb/awwnb.github.io,awwnb/awwnb.github.io,awwnb/awwnb.github.io
html
## Code Before: {% comment %} Format a link to a posts-with-tag page from "tag", a _data/tags.yml object, and "tag_separator". {% endcomment %} <a href="{{ site.baseurl }}/tag/{{ include.tag.slug }}">{{ include.tag.name }}</a>{% if forloop.last == false %}{{ include.tag_separator }}{% endif %} ## Instruction: Fix tag links for 'ordinal', 'date', 'none' permalinks ## Code After: {% comment %} Format a link to a posts-with-tag page from "tag", a _data/tags.yml object, and "tag_separator". {% endcomment %} {% if site.permalink == 'pretty' %} {% capture tag_page %}{{ include.tag.slug }}/{% endcapture %} {% else %} {% capture tag_page %}{{ include.tag.slug }}.html{% endcapture %} {% endif %} <a href="{{ site.baseurl }}/tag/{{ tag_page }}" title="Posts tagged '{{ include.tag.name }}'">{{ include.tag.name }}</a>{% if forloop.last == false %}{{ include.tag_separator }}{% endif %}
{% comment %} Format a link to a posts-with-tag page from "tag", a _data/tags.yml object, and "tag_separator". {% endcomment %} + {% if site.permalink == 'pretty' %} + {% capture tag_page %}{{ include.tag.slug }}/{% endcapture %} + {% else %} + {% capture tag_page %}{{ include.tag.slug }}.html{% endcapture %} + {% endif %} + - <a href="{{ site.baseurl }}/tag/{{ include.tag.slug }}">{{ include.tag.name }}</a>{% if forloop.last == false %}{{ include.tag_separator }}{% endif %} ? ^^^^ + <a href="{{ site.baseurl }}/tag/{{ tag_page }}" title="Posts tagged '{{ include.tag.name }}'">{{ include.tag.name }}</a>{% if forloop.last == false %}{{ include.tag_separator }}{% endif %} ? +++++++++++++++++++++++++++++++++++++ ^^^^ +
8
1.6
7
1
32740ee0fe320bb929189f500e9cde3d336c1aee
src/character/audio.rs
src/character/audio.rs
use std::fs::File; use std::io::BufReader; use rodio; use rodio::Sink; use game::constants::PISTOL_AUDIO_PATH; pub struct CharacterAudio { sink: Sink, } impl CharacterAudio { pub fn new() -> CharacterAudio { let endpoint = rodio::get_default_endpoint().unwrap(); CharacterAudio { sink: Sink::new(&endpoint), } } pub fn play_pistol(&self) { if self.sink.empty() { let file = File::open(PISTOL_AUDIO_PATH).unwrap(); let pistol_data = rodio::Decoder::new(BufReader::new(file)).unwrap(); self.sink.append(pistol_data); } } }
use std::fs::File; use std::io::BufReader; use rodio; use rodio::Sink; use game::constants::PISTOL_AUDIO_PATH; pub struct CharacterAudio { sink: Sink, } impl CharacterAudio { pub fn new() -> CharacterAudio { #[allow(deprecated)] let endpoint = rodio::get_default_endpoint().unwrap(); CharacterAudio { sink: Sink::new(&endpoint), } } pub fn play_pistol(&self) { if self.sink.empty() { let file = File::open(PISTOL_AUDIO_PATH).unwrap(); let pistol_data = rodio::Decoder::new(BufReader::new(file)).unwrap(); self.sink.append(pistol_data); } } }
Allow use of deprecated "get_default_endpoint"
Allow use of deprecated "get_default_endpoint"
Rust
apache-2.0
Laastine/zombie-shooter,Laastine/zombie-shooter
rust
## Code Before: use std::fs::File; use std::io::BufReader; use rodio; use rodio::Sink; use game::constants::PISTOL_AUDIO_PATH; pub struct CharacterAudio { sink: Sink, } impl CharacterAudio { pub fn new() -> CharacterAudio { let endpoint = rodio::get_default_endpoint().unwrap(); CharacterAudio { sink: Sink::new(&endpoint), } } pub fn play_pistol(&self) { if self.sink.empty() { let file = File::open(PISTOL_AUDIO_PATH).unwrap(); let pistol_data = rodio::Decoder::new(BufReader::new(file)).unwrap(); self.sink.append(pistol_data); } } } ## Instruction: Allow use of deprecated "get_default_endpoint" ## Code After: use std::fs::File; use std::io::BufReader; use rodio; use rodio::Sink; use game::constants::PISTOL_AUDIO_PATH; pub struct CharacterAudio { sink: Sink, } impl CharacterAudio { pub fn new() -> CharacterAudio { #[allow(deprecated)] let endpoint = rodio::get_default_endpoint().unwrap(); CharacterAudio { sink: Sink::new(&endpoint), } } pub fn play_pistol(&self) { if self.sink.empty() { let file = File::open(PISTOL_AUDIO_PATH).unwrap(); let pistol_data = rodio::Decoder::new(BufReader::new(file)).unwrap(); self.sink.append(pistol_data); } } }
use std::fs::File; use std::io::BufReader; use rodio; use rodio::Sink; use game::constants::PISTOL_AUDIO_PATH; pub struct CharacterAudio { sink: Sink, } impl CharacterAudio { pub fn new() -> CharacterAudio { + #[allow(deprecated)] let endpoint = rodio::get_default_endpoint().unwrap(); CharacterAudio { sink: Sink::new(&endpoint), } } pub fn play_pistol(&self) { if self.sink.empty() { let file = File::open(PISTOL_AUDIO_PATH).unwrap(); let pistol_data = rodio::Decoder::new(BufReader::new(file)).unwrap(); self.sink.append(pistol_data); } } }
1
0.038462
1
0
de7dfdc176456db60319e12d22ad66d8b62ad9e9
tox.ini
tox.ini
[tox] envlist = py3 flake8 [testenv] commands = coverage run --source pyecore -m pytest -v --capture=sys coverage report -m deps = coverage pytest [testenv:flake8] commands = flake8 pyecore setup.py deps = flake8
[tox] envlist = py3 flake8 [testenv] commands = coverage run --source pyecore -m pytest -v --capture=sys coverage report -m deps = coverage pytest [testenv:flake8] commands = flake8 pyecore setup.py deps = flake8 [testenv:cosmic_ray] commands = cosmic-ray --verbose run --test-runner=pytest --baseline=10 example.json pyecore -- tests cosmic-ray report example.json deps = pytest cosmic_ray==1.1.0a1
Configure cosmic_ray for manual usage
Configure cosmic_ray for manual usage
INI
bsd-3-clause
pyecore/pyecore,aranega/pyecore
ini
## Code Before: [tox] envlist = py3 flake8 [testenv] commands = coverage run --source pyecore -m pytest -v --capture=sys coverage report -m deps = coverage pytest [testenv:flake8] commands = flake8 pyecore setup.py deps = flake8 ## Instruction: Configure cosmic_ray for manual usage ## Code After: [tox] envlist = py3 flake8 [testenv] commands = coverage run --source pyecore -m pytest -v --capture=sys coverage report -m deps = coverage pytest [testenv:flake8] commands = flake8 pyecore setup.py deps = flake8 [testenv:cosmic_ray] commands = cosmic-ray --verbose run --test-runner=pytest --baseline=10 example.json pyecore -- tests cosmic-ray report example.json deps = pytest cosmic_ray==1.1.0a1
[tox] envlist = py3 flake8 [testenv] commands = coverage run --source pyecore -m pytest -v --capture=sys coverage report -m deps = coverage pytest [testenv:flake8] commands = flake8 pyecore setup.py deps = flake8 + + [testenv:cosmic_ray] + commands = + cosmic-ray --verbose run --test-runner=pytest --baseline=10 example.json pyecore -- tests + cosmic-ray report example.json + deps = + pytest + cosmic_ray==1.1.0a1
8
0.444444
8
0
3d8ca43e1283bc2e785225a55662819ea96aa252
app/controllers/waitingroom_controller.rb
app/controllers/waitingroom_controller.rb
class WaitingroomController < ApplicationController def new end def index end def check if request.xhr? if Waitingroom.all.length == 1 render json: Waitingroom.all.length.to_json elsif Waitingroom.all.length == 2 players = Waitingroom.first(2).map { |e| e.party_id } rnd_key = match_key random_q = rand(1..30) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[0], player_num: 1) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[1], player_num: 2) render json: Waitingroom.all.length.to_json end end end def match players = Waitingroom.first(2).map { |e| e.party_id } rnd_key = match_key random_q = rand(1..30) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[0], player_num: 1) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[1], player_num: 2) redirect_to "/rounds/key/#{rnd_key}" end def match_key return [*"0".."9"].sample(6).join end def clearwaitingrooms Waitingroom.destroy_all end end
class WaitingroomController < ApplicationController def new end def index end def check if request.xhr? if Waitingroom.all.length == 1 render json: Waitingroom.all.length.to_json elsif Waitingroom.all.length == 2 players = Waitingroom.first(2).map { |e| e.party_id } rnd_key = match_key random_q = 1 Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[0], player_num: 1) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[1], player_num: 2) render json: Waitingroom.all.length.to_json end end end def match players = Waitingroom.first(2).map { |e| e.party_id } rnd_key = match_key random_q = rand(1..30) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[0], player_num: 1) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[1], player_num: 2) redirect_to "/rounds/key/#{rnd_key}" end def match_key return [*"0".."9"].sample(6).join end def clearwaitingrooms Waitingroom.destroy_all end end
Make all quizzes hardcoded to Question 1.
Make all quizzes hardcoded to Question 1.
Ruby
mit
susancal/Waitr,susancal/Waitr,susancal/Waitr
ruby
## Code Before: class WaitingroomController < ApplicationController def new end def index end def check if request.xhr? if Waitingroom.all.length == 1 render json: Waitingroom.all.length.to_json elsif Waitingroom.all.length == 2 players = Waitingroom.first(2).map { |e| e.party_id } rnd_key = match_key random_q = rand(1..30) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[0], player_num: 1) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[1], player_num: 2) render json: Waitingroom.all.length.to_json end end end def match players = Waitingroom.first(2).map { |e| e.party_id } rnd_key = match_key random_q = rand(1..30) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[0], player_num: 1) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[1], player_num: 2) redirect_to "/rounds/key/#{rnd_key}" end def match_key return [*"0".."9"].sample(6).join end def clearwaitingrooms Waitingroom.destroy_all end end ## Instruction: Make all quizzes hardcoded to Question 1. ## Code After: class WaitingroomController < ApplicationController def new end def index end def check if request.xhr? if Waitingroom.all.length == 1 render json: Waitingroom.all.length.to_json elsif Waitingroom.all.length == 2 players = Waitingroom.first(2).map { |e| e.party_id } rnd_key = match_key random_q = 1 Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[0], player_num: 1) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[1], player_num: 2) render json: Waitingroom.all.length.to_json end end end def match players = Waitingroom.first(2).map { |e| e.party_id } rnd_key = match_key random_q = rand(1..30) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[0], player_num: 1) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[1], player_num: 2) redirect_to "/rounds/key/#{rnd_key}" end def match_key return [*"0".."9"].sample(6).join end def clearwaitingrooms Waitingroom.destroy_all end end
class WaitingroomController < ApplicationController def new end def index end def check if request.xhr? if Waitingroom.all.length == 1 render json: Waitingroom.all.length.to_json elsif Waitingroom.all.length == 2 players = Waitingroom.first(2).map { |e| e.party_id } rnd_key = match_key - random_q = rand(1..30) ? ----- ----- + random_q = 1 Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[0], player_num: 1) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[1], player_num: 2) render json: Waitingroom.all.length.to_json end end end def match players = Waitingroom.first(2).map { |e| e.party_id } rnd_key = match_key random_q = rand(1..30) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[0], player_num: 1) Round.create(quiz_id: random_q, secret_key: rnd_key, party_id: players[1], player_num: 2) redirect_to "/rounds/key/#{rnd_key}" end def match_key return [*"0".."9"].sample(6).join end def clearwaitingrooms Waitingroom.destroy_all end end
2
0.04878
1
1
d834923e7b62d639f7005a413ebd3fb3cb86b81a
lib/Userbin/Resource.php
lib/Userbin/Resource.php
<?php class Userbin_Resource { protected $parent = null; protected $items = null; public function __construct($model, $items=null) { $this->model = $model; if (is_array($items)) { $this->items = $this->addItems($items); } } protected function createModel($attributes=null) { $instance = new $this->model($attributes); if (isset($this->parent)) { $instance->setParent($this->parent); } return $instance; } protected function loadItems(array $items=array()) { $this->items = array(); foreach ($items as $attributes) { $this->items[] = $this->createModel($attributes); } } public function setParent($parent) { $this->parent = $parent; } public function all($params=null) { if (is_array($this->items)) { return $this->items; } $instance = $this->createModel(); $items = $instance->get(); $this->loadItems($items); return $this->items; } public function create($attributes=null) { $instance = $this->createModel($attributes); return $instance->save(); } public function destroy($id) { $instance = new $this->model; $instance->setId($id); return $instance->delete(); } public function find($id) { $instance = new $this->model; $instance->setId($id); return $instance->fetch(); } }
<?php class Userbin_Resource { protected $parent = null; protected $items = null; public function __construct($model, $items=null) { $this->model = $model; if (is_array($items)) { $this->items = $this->addItems($items); } } protected function createModel($attributes=null) { $instance = new $this->model($attributes); if (isset($this->parent)) { $instance->setParent($this->parent); } return $instance; } protected function loadItems(array $items=array()) { $this->items = array(); foreach ($items as $attributes) { $this->items[] = $this->createModel($attributes); } } public function setParent($parent) { $this->parent = $parent; } public function all($params=null) { if (is_array($this->items)) { return $this->items; } $instance = $this->createModel(); $items = $instance->get(); $this->loadItems($items); return $this->items; } public function create($attributes=null) { $instance = $this->createModel($attributes); return $instance->save(); } public function destroy($id=null) { $instance = $this->createModel(); $instance->setId($id); return $instance->delete(); } public function find($id) { $instance = new $this->model; $instance->setId($id); return $instance->fetch(); } }
Fix destroy if there is no id
Fix destroy if there is no id
PHP
mit
castle/castle-php,castle/castle-php
php
## Code Before: <?php class Userbin_Resource { protected $parent = null; protected $items = null; public function __construct($model, $items=null) { $this->model = $model; if (is_array($items)) { $this->items = $this->addItems($items); } } protected function createModel($attributes=null) { $instance = new $this->model($attributes); if (isset($this->parent)) { $instance->setParent($this->parent); } return $instance; } protected function loadItems(array $items=array()) { $this->items = array(); foreach ($items as $attributes) { $this->items[] = $this->createModel($attributes); } } public function setParent($parent) { $this->parent = $parent; } public function all($params=null) { if (is_array($this->items)) { return $this->items; } $instance = $this->createModel(); $items = $instance->get(); $this->loadItems($items); return $this->items; } public function create($attributes=null) { $instance = $this->createModel($attributes); return $instance->save(); } public function destroy($id) { $instance = new $this->model; $instance->setId($id); return $instance->delete(); } public function find($id) { $instance = new $this->model; $instance->setId($id); return $instance->fetch(); } } ## Instruction: Fix destroy if there is no id ## Code After: <?php class Userbin_Resource { protected $parent = null; protected $items = null; public function __construct($model, $items=null) { $this->model = $model; if (is_array($items)) { $this->items = $this->addItems($items); } } protected function createModel($attributes=null) { $instance = new $this->model($attributes); if (isset($this->parent)) { $instance->setParent($this->parent); } return $instance; } protected function loadItems(array $items=array()) { $this->items = array(); foreach ($items as $attributes) { $this->items[] = $this->createModel($attributes); } } public function setParent($parent) { $this->parent = $parent; } public function all($params=null) { if (is_array($this->items)) { return $this->items; } $instance = $this->createModel(); $items = $instance->get(); $this->loadItems($items); return $this->items; } public function create($attributes=null) { $instance = $this->createModel($attributes); return $instance->save(); } public function destroy($id=null) { $instance = $this->createModel(); $instance->setId($id); return $instance->delete(); } public function find($id) { $instance = new $this->model; $instance->setId($id); return $instance->fetch(); } }
<?php class Userbin_Resource { protected $parent = null; protected $items = null; public function __construct($model, $items=null) { $this->model = $model; if (is_array($items)) { $this->items = $this->addItems($items); } } protected function createModel($attributes=null) { $instance = new $this->model($attributes); if (isset($this->parent)) { $instance->setParent($this->parent); } return $instance; } protected function loadItems(array $items=array()) { $this->items = array(); foreach ($items as $attributes) { $this->items[] = $this->createModel($attributes); } } public function setParent($parent) { $this->parent = $parent; } public function all($params=null) { if (is_array($this->items)) { return $this->items; } $instance = $this->createModel(); $items = $instance->get(); $this->loadItems($items); return $this->items; } public function create($attributes=null) { $instance = $this->createModel($attributes); return $instance->save(); } - public function destroy($id) + public function destroy($id=null) ? +++++ { - $instance = new $this->model; ? ---- ^ + $instance = $this->createModel(); ? ^^^^^^^ ++ $instance->setId($id); return $instance->delete(); } public function find($id) { $instance = new $this->model; $instance->setId($id); return $instance->fetch(); } }
4
0.057971
2
2
c7b4feb2c16236c771f8601d3ca5964a957643c9
hireme/index.html
hireme/index.html
--- layout: page title: Hire Me published: true --- <p>I'm a freelance web programmer, and I'm <span class="tag available">available</span> for hire.</p> <p> I specialize in planning and building Javascript front end applications using tools like React Native or Vue. I also build Node-based REST APIs and full-stack Javascript apps. </p> <p>I'm always interested in hearing about new opportunities, so <a href="mailto:hiccupingminor@gmail.com" class="tag-list">let me know</a> what you are building.</p>
--- layout: page title: Hire Me published: true --- <p>I'm a freelance web programmer, and I'm <span class="tag available">available</span> for hire.</p> <p> I specialize in planning and building Javascript front end applications using modern tools. I also build Node-based REST APIs and full-stack Javascript apps. </p> <p>I'm always interested in hearing about new opportunities, so <a href="mailto:hiccupingminor@gmail.com" class="tag-list">let me know</a> what you are building.</p>
Change wording on hireme page slightly
Change wording on hireme page slightly
HTML
mit
HiccupinGminor/HiccupinGminor.github.io,HiccupinGminor/HiccupinGminor.github.io,HiccupinGminor/HiccupinGminor.github.io
html
## Code Before: --- layout: page title: Hire Me published: true --- <p>I'm a freelance web programmer, and I'm <span class="tag available">available</span> for hire.</p> <p> I specialize in planning and building Javascript front end applications using tools like React Native or Vue. I also build Node-based REST APIs and full-stack Javascript apps. </p> <p>I'm always interested in hearing about new opportunities, so <a href="mailto:hiccupingminor@gmail.com" class="tag-list">let me know</a> what you are building.</p> ## Instruction: Change wording on hireme page slightly ## Code After: --- layout: page title: Hire Me published: true --- <p>I'm a freelance web programmer, and I'm <span class="tag available">available</span> for hire.</p> <p> I specialize in planning and building Javascript front end applications using modern tools. I also build Node-based REST APIs and full-stack Javascript apps. </p> <p>I'm always interested in hearing about new opportunities, so <a href="mailto:hiccupingminor@gmail.com" class="tag-list">let me know</a> what you are building.</p>
--- layout: page title: Hire Me published: true --- <p>I'm a freelance web programmer, and I'm <span class="tag available">available</span> for hire.</p> <p> - I specialize in planning and building Javascript front end applications using tools like React Native or Vue. I also build Node-based REST APIs and full-stack Javascript apps. ? ------------------------- + I specialize in planning and building Javascript front end applications using modern tools. I also build Node-based REST APIs and full-stack Javascript apps. ? +++++++ </p> <p>I'm always interested in hearing about new opportunities, so <a href="mailto:hiccupingminor@gmail.com" class="tag-list">let me know</a> what you are building.</p>
2
0.2
1
1
80776e99dd9d57f37f6f3641962ca0e542e908f3
README.md
README.md
This is the personal website of Sara Moore, served Github Pages as a 'user page.' This site was built using [Jekyll](http://jekyllrb.com/) and styled with [Bootstrap](http://getbootstrap.com/), as well as modified versions of the [sustain](http://www.github.com/biomadeira/sustain) and [vitae](http://github.com/biomadeira/vitae) themes.
[![Build Status](https://travis-ci.org/saraemoore/saraemoore.github.io.svg?branch=master)](https://travis-ci.org/saraemoore/saraemoore.github.io) This is the personal website of Sara Moore, served Github Pages as a 'user page.' This site was built using [Jekyll](http://jekyllrb.com/) and styled with [Bootstrap](http://getbootstrap.com/), as well as modified versions of the [sustain](http://www.github.com/biomadeira/sustain) and [vitae](http://github.com/biomadeira/vitae) themes.
Add travis ci build status badge
Add travis ci build status badge
Markdown
mit
saraemoore/saraemoore.github.io,saraemoore/saraemoore.github.io,saraemoore/saraemoore.github.io
markdown
## Code Before: This is the personal website of Sara Moore, served Github Pages as a 'user page.' This site was built using [Jekyll](http://jekyllrb.com/) and styled with [Bootstrap](http://getbootstrap.com/), as well as modified versions of the [sustain](http://www.github.com/biomadeira/sustain) and [vitae](http://github.com/biomadeira/vitae) themes. ## Instruction: Add travis ci build status badge ## Code After: [![Build Status](https://travis-ci.org/saraemoore/saraemoore.github.io.svg?branch=master)](https://travis-ci.org/saraemoore/saraemoore.github.io) This is the personal website of Sara Moore, served Github Pages as a 'user page.' This site was built using [Jekyll](http://jekyllrb.com/) and styled with [Bootstrap](http://getbootstrap.com/), as well as modified versions of the [sustain](http://www.github.com/biomadeira/sustain) and [vitae](http://github.com/biomadeira/vitae) themes.
+ [![Build Status](https://travis-ci.org/saraemoore/saraemoore.github.io.svg?branch=master)](https://travis-ci.org/saraemoore/saraemoore.github.io) + This is the personal website of Sara Moore, served Github Pages as a 'user page.' This site was built using [Jekyll](http://jekyllrb.com/) and styled with [Bootstrap](http://getbootstrap.com/), as well as modified versions of the [sustain](http://www.github.com/biomadeira/sustain) and [vitae](http://github.com/biomadeira/vitae) themes.
2
2
2
0
40109c646c4fb51ae7d463f0272e6c47b75dabc6
.travis.yml
.travis.yml
before_install: sudo apt-get install libzmq3-dev script: bundle exec rspec language: ruby rvm: - 1.9 - 2.0 - 2.1 - rbx-2 notifications: email: false irc: channels: - "chat.freenode.net#wires"
before_install: "git clone https://github.com/$LIBZMQ_REPO libzmq \ && cd libzmq \ && ./autogen.sh \ && ./configure --with-pgm \ && make \ && sudo make install \ && cd .." script: bundle exec rspec language: ruby rvm: - 1.9 - 2.0 - 2.1 - rbx-2 env: - LIBZMQ_REPO=zeromq/zeromq3-x - LIBZMQ_REPO=zeromq/zeromq4-x notifications: email: false irc: channels: - "chat.freenode.net#wires"
Add second dimension to Travis CI build matrix - libzmq version 3 and 4
Add second dimension to Travis CI build matrix - libzmq version 3 and 4
YAML
mit
jemc/0mq
yaml
## Code Before: before_install: sudo apt-get install libzmq3-dev script: bundle exec rspec language: ruby rvm: - 1.9 - 2.0 - 2.1 - rbx-2 notifications: email: false irc: channels: - "chat.freenode.net#wires" ## Instruction: Add second dimension to Travis CI build matrix - libzmq version 3 and 4 ## Code After: before_install: "git clone https://github.com/$LIBZMQ_REPO libzmq \ && cd libzmq \ && ./autogen.sh \ && ./configure --with-pgm \ && make \ && sudo make install \ && cd .." script: bundle exec rspec language: ruby rvm: - 1.9 - 2.0 - 2.1 - rbx-2 env: - LIBZMQ_REPO=zeromq/zeromq3-x - LIBZMQ_REPO=zeromq/zeromq4-x notifications: email: false irc: channels: - "chat.freenode.net#wires"
- before_install: sudo apt-get install libzmq3-dev + before_install: + "git clone https://github.com/$LIBZMQ_REPO libzmq \ + && cd libzmq \ + && ./autogen.sh \ + && ./configure --with-pgm \ + && make \ + && sudo make install \ + && cd .." + script: bundle exec rspec language: ruby rvm: - 1.9 - 2.0 - 2.1 - rbx-2 + env: + - LIBZMQ_REPO=zeromq/zeromq3-x + - LIBZMQ_REPO=zeromq/zeromq4-x notifications: email: false irc: channels: - "chat.freenode.net#wires"
13
1
12
1
258fcd1ce0f69a0dbe883480abb35b152b6a4b0b
.config/Code/User/settings.json
.config/Code/User/settings.json
{ "telemetry.telemetryLevel": "off", "workbench.colorTheme": "Gruvbox Dark (Hard)", "editor.formatOnSave": true, "window.titleBarStyle": "custom", "window.zoomLevel": 1, "editor.inlayHints.enabled": "offUnlessPressed", "keyboard.dispatch": "keyCode", "editor.bracketPairColorization.enabled": true, "workbench.colorCustomizations": { "editorBracketHighlight.foreground1": "#b16286", "editorBracketHighlight.foreground2": "#458588", "editorBracketHighlight.foreground3": "#689d6a", "editorBracketHighlight.foreground4": "#98971a", "editorBracketHighlight.foreground5": "#d79921", "editorBracketHighlight.foreground6": "#d65d0e", "editorBracketHighlight.unexpectedBracket.foreground": "#cc241d" } }
{ "telemetry.telemetryLevel": "off", "workbench.colorTheme": "Gruvbox Dark (Hard)", "editor.formatOnSave": true, "window.titleBarStyle": "custom", "window.zoomLevel": 1, "editor.inlayHints.enabled": "offUnlessPressed", "keyboard.dispatch": "keyCode", "editor.bracketPairColorization.enabled": true, "workbench.colorCustomizations": { "editorBracketHighlight.foreground1": "#b16286", "editorBracketHighlight.foreground2": "#458588", "editorBracketHighlight.foreground3": "#689d6a", "editorBracketHighlight.foreground4": "#98971a", "editorBracketHighlight.foreground5": "#d79921", "editorBracketHighlight.foreground6": "#d65d0e", "editorBracketHighlight.unexpectedBracket.foreground": "#cc241d", "editorRuler.foreground": "#282828" }, "editor.rulers": [ 80 ] }
Add ruler at 80 columns
Add ruler at 80 columns
JSON
isc
reillysiemens/dotfiles,reillysiemens/dotfiles
json
## Code Before: { "telemetry.telemetryLevel": "off", "workbench.colorTheme": "Gruvbox Dark (Hard)", "editor.formatOnSave": true, "window.titleBarStyle": "custom", "window.zoomLevel": 1, "editor.inlayHints.enabled": "offUnlessPressed", "keyboard.dispatch": "keyCode", "editor.bracketPairColorization.enabled": true, "workbench.colorCustomizations": { "editorBracketHighlight.foreground1": "#b16286", "editorBracketHighlight.foreground2": "#458588", "editorBracketHighlight.foreground3": "#689d6a", "editorBracketHighlight.foreground4": "#98971a", "editorBracketHighlight.foreground5": "#d79921", "editorBracketHighlight.foreground6": "#d65d0e", "editorBracketHighlight.unexpectedBracket.foreground": "#cc241d" } } ## Instruction: Add ruler at 80 columns ## Code After: { "telemetry.telemetryLevel": "off", "workbench.colorTheme": "Gruvbox Dark (Hard)", "editor.formatOnSave": true, "window.titleBarStyle": "custom", "window.zoomLevel": 1, "editor.inlayHints.enabled": "offUnlessPressed", "keyboard.dispatch": "keyCode", "editor.bracketPairColorization.enabled": true, "workbench.colorCustomizations": { "editorBracketHighlight.foreground1": "#b16286", "editorBracketHighlight.foreground2": "#458588", "editorBracketHighlight.foreground3": "#689d6a", "editorBracketHighlight.foreground4": "#98971a", "editorBracketHighlight.foreground5": "#d79921", "editorBracketHighlight.foreground6": "#d65d0e", "editorBracketHighlight.unexpectedBracket.foreground": "#cc241d", "editorRuler.foreground": "#282828" }, "editor.rulers": [ 80 ] }
{ "telemetry.telemetryLevel": "off", "workbench.colorTheme": "Gruvbox Dark (Hard)", "editor.formatOnSave": true, "window.titleBarStyle": "custom", "window.zoomLevel": 1, "editor.inlayHints.enabled": "offUnlessPressed", "keyboard.dispatch": "keyCode", "editor.bracketPairColorization.enabled": true, "workbench.colorCustomizations": { "editorBracketHighlight.foreground1": "#b16286", "editorBracketHighlight.foreground2": "#458588", "editorBracketHighlight.foreground3": "#689d6a", "editorBracketHighlight.foreground4": "#98971a", "editorBracketHighlight.foreground5": "#d79921", "editorBracketHighlight.foreground6": "#d65d0e", - "editorBracketHighlight.unexpectedBracket.foreground": "#cc241d" + "editorBracketHighlight.unexpectedBracket.foreground": "#cc241d", ? + + "editorRuler.foreground": "#282828" - } + }, ? + + "editor.rulers": [ + 80 + ] }
8
0.421053
6
2
448cee0d641ec8b3f75774a339d3044d6a86c037
src/core/team-core.js
src/core/team-core.js
const {knex} = require('../util/database').connect(); import _ from 'lodash'; import {deepChangeKeyCase} from '../util'; function getTeams() { return knex.raw(`SELECT teams.id, teams.name, SUM(COALESCE(action_types.value, 0)) AS score FROM teams LEFT JOIN actions ON teams.id = actions.team_id LEFT JOIN action_types ON actions.action_type_id = action_types.id GROUP BY teams.id, teams.name ORDER BY score DESC, teams.id`) .then(result => { return _.map(result.rows, row => deepChangeKeyCase(row, 'camelCase')); }); } export { getTeams };
const {knex} = require('../util/database').connect(); import _ from 'lodash'; import {deepChangeKeyCase} from '../util'; function getTeams() { return knex.raw(`SELECT teams.id, teams.name, teams.image_path, SUM(COALESCE(action_types.value, 0)) AS score FROM teams LEFT JOIN actions ON teams.id = actions.team_id LEFT JOIN action_types ON actions.action_type_id = action_types.id GROUP BY teams.id, teams.name ORDER BY score DESC, teams.id`) .then(result => { return _.map(result.rows, row => deepChangeKeyCase(row, 'camelCase')); }); } export { getTeams };
Return also teams.image_path from getTeams
Return also teams.image_path from getTeams
JavaScript
mit
futurice/wappuapp-backend,kaupunki-apina/prahapp-backend,futurice/wappuapp-backend,kaupunki-apina/prahapp-backend
javascript
## Code Before: const {knex} = require('../util/database').connect(); import _ from 'lodash'; import {deepChangeKeyCase} from '../util'; function getTeams() { return knex.raw(`SELECT teams.id, teams.name, SUM(COALESCE(action_types.value, 0)) AS score FROM teams LEFT JOIN actions ON teams.id = actions.team_id LEFT JOIN action_types ON actions.action_type_id = action_types.id GROUP BY teams.id, teams.name ORDER BY score DESC, teams.id`) .then(result => { return _.map(result.rows, row => deepChangeKeyCase(row, 'camelCase')); }); } export { getTeams }; ## Instruction: Return also teams.image_path from getTeams ## Code After: const {knex} = require('../util/database').connect(); import _ from 'lodash'; import {deepChangeKeyCase} from '../util'; function getTeams() { return knex.raw(`SELECT teams.id, teams.name, teams.image_path, SUM(COALESCE(action_types.value, 0)) AS score FROM teams LEFT JOIN actions ON teams.id = actions.team_id LEFT JOIN action_types ON actions.action_type_id = action_types.id GROUP BY teams.id, teams.name ORDER BY score DESC, teams.id`) .then(result => { return _.map(result.rows, row => deepChangeKeyCase(row, 'camelCase')); }); } export { getTeams };
const {knex} = require('../util/database').connect(); import _ from 'lodash'; import {deepChangeKeyCase} from '../util'; function getTeams() { - return knex.raw(`SELECT teams.id, teams.name, SUM(COALESCE(action_types.value, 0)) AS score + return knex.raw(`SELECT teams.id, teams.name, teams.image_path, SUM(COALESCE(action_types.value, 0)) AS score ? ++++++++++++++++++ FROM teams LEFT JOIN actions ON teams.id = actions.team_id LEFT JOIN action_types ON actions.action_type_id = action_types.id GROUP BY teams.id, teams.name ORDER BY score DESC, teams.id`) .then(result => { return _.map(result.rows, row => deepChangeKeyCase(row, 'camelCase')); }); } export { getTeams };
2
0.105263
1
1
0b5f74f9d0a3ab08b742a537e1e900765f8f52d8
packages/resourceful-redux/src/utils/get-resources.js
packages/resourceful-redux/src/utils/get-resources.js
// Returns a list of resources by IDs or label export default function(state, resourceName, idsOrLabel) { const resourceSlice = state[resourceName]; if (!resourceSlice) { return []; } const resources = resourceSlice.resources; let idsList; // This conditional handles the situation where `idsOrLabel` is an ID if (typeof idsOrLabel === 'string') { const label = resourceSlice.labels[idsOrLabel]; if (!label) { return []; } const labelIds = label.ids; if (!labelIds) { return []; } idsList = labelIds; } else { idsList = idsOrLabel; } if (!(idsList && idsList.length)) { return []; } return idsList.map(id => resources[id]).filter(Boolean); }
// Returns a list of resources by IDs or list name export default function(state, resourceName, idsOrList) { const resourceSlice = state[resourceName]; if (!resourceSlice) { return []; } const resources = resourceSlice.resources; let idsList; // This conditional handles the situation where `idsOrList` is an list name if (typeof idsOrList === 'string') { const list = resourceSlice.lists[idsOrList]; if (!list) { return []; } idsList = list.ids; } else { idsList = idsOrList; } if (!(idsList && idsList.length)) { return []; } return idsList.map(id => resources[id]).filter(Boolean); }
Update getResources to support lists, not labels
Update getResources to support lists, not labels
JavaScript
mit
jmeas/resourceful-redux,jmeas/resourceful-redux
javascript
## Code Before: // Returns a list of resources by IDs or label export default function(state, resourceName, idsOrLabel) { const resourceSlice = state[resourceName]; if (!resourceSlice) { return []; } const resources = resourceSlice.resources; let idsList; // This conditional handles the situation where `idsOrLabel` is an ID if (typeof idsOrLabel === 'string') { const label = resourceSlice.labels[idsOrLabel]; if (!label) { return []; } const labelIds = label.ids; if (!labelIds) { return []; } idsList = labelIds; } else { idsList = idsOrLabel; } if (!(idsList && idsList.length)) { return []; } return idsList.map(id => resources[id]).filter(Boolean); } ## Instruction: Update getResources to support lists, not labels ## Code After: // Returns a list of resources by IDs or list name export default function(state, resourceName, idsOrList) { const resourceSlice = state[resourceName]; if (!resourceSlice) { return []; } const resources = resourceSlice.resources; let idsList; // This conditional handles the situation where `idsOrList` is an list name if (typeof idsOrList === 'string') { const list = resourceSlice.lists[idsOrList]; if (!list) { return []; } idsList = list.ids; } else { idsList = idsOrList; } if (!(idsList && idsList.length)) { return []; } return idsList.map(id => resources[id]).filter(Boolean); }
- // Returns a list of resources by IDs or label ? ^ - + // Returns a list of resources by IDs or list name ? +++++ ^ - export default function(state, resourceName, idsOrLabel) { ? ^^^^ + export default function(state, resourceName, idsOrList) { ? ^^^ const resourceSlice = state[resourceName]; if (!resourceSlice) { return []; } const resources = resourceSlice.resources; let idsList; - // This conditional handles the situation where `idsOrLabel` is an ID ? ^^^^ ^^ + // This conditional handles the situation where `idsOrList` is an list name ? ^^^ ^^^^^^^^^ - if (typeof idsOrLabel === 'string') { ? ^^^^ + if (typeof idsOrList === 'string') { ? ^^^ - const label = resourceSlice.labels[idsOrLabel]; ? ^^^^ ^^^^ ^^^^ + const list = resourceSlice.lists[idsOrList]; ? ^^^ ^^^ ^^^ - if (!label) { ? ^^^^ + if (!list) { ? ^^^ return []; } - const labelIds = label.ids; - if (!labelIds) { - return []; - } - - idsList = labelIds; ? ^^^^^ + idsList = list.ids; ? ^^^^^ } else { - idsList = idsOrLabel; ? ^^^^ + idsList = idsOrList; ? ^^^ } if (!(idsList && idsList.length)) { return []; } return idsList.map(id => resources[id]).filter(Boolean); }
21
0.636364
8
13
327c39ad26d116eab8f00bc0c80d40c1edf31d2e
_data/sliders.yml
_data/sliders.yml
- selector: fkp_slider bullets: false captions: true images: - src: /assets/fkp/IMG_20170116_123330.jpg alt: Waiting for the plane to Vancouver, 2017 - data-src: /assets/fkp/IMG_20170117_172305.jpg alt: Enjoying some sushi, 2017 - data-src: /assets/fkp/IMG_201803.jpg alt: Las Vegas, 2018 settings: height: 400 initialHeight: maxHeight: interval: transitionDuration: effect: disableNav: keyboardNav: previousNavSelector: nextNavSelector:
- selector: fkp_slider bullets: false captions: true images: - src: /assets/fkp/IMG_20170116_123330.jpg alt: Waiting for the plane to Vancouver, 2017 - data-src: /assets/fkp/IMG_20170116_212756.jpg alt: Enjoying some sushi, 2017 - data-src: /assets/fkp/IMG_201803.jpg alt: Las Vegas, 2018 settings: height: 400 initialHeight: maxHeight: interval: transitionDuration: effect: "'fade'" disableNav: keyboardNav: previousNavSelector: nextNavSelector:
Clean up some code, troubleshoot data-src
Clean up some code, troubleshoot data-src
YAML
mit
sle3man/sle3man.github.io,sle3man/sle3man.github.io
yaml
## Code Before: - selector: fkp_slider bullets: false captions: true images: - src: /assets/fkp/IMG_20170116_123330.jpg alt: Waiting for the plane to Vancouver, 2017 - data-src: /assets/fkp/IMG_20170117_172305.jpg alt: Enjoying some sushi, 2017 - data-src: /assets/fkp/IMG_201803.jpg alt: Las Vegas, 2018 settings: height: 400 initialHeight: maxHeight: interval: transitionDuration: effect: disableNav: keyboardNav: previousNavSelector: nextNavSelector: ## Instruction: Clean up some code, troubleshoot data-src ## Code After: - selector: fkp_slider bullets: false captions: true images: - src: /assets/fkp/IMG_20170116_123330.jpg alt: Waiting for the plane to Vancouver, 2017 - data-src: /assets/fkp/IMG_20170116_212756.jpg alt: Enjoying some sushi, 2017 - data-src: /assets/fkp/IMG_201803.jpg alt: Las Vegas, 2018 settings: height: 400 initialHeight: maxHeight: interval: transitionDuration: effect: "'fade'" disableNav: keyboardNav: previousNavSelector: nextNavSelector:
- selector: fkp_slider bullets: false captions: true images: - - src: /assets/fkp/IMG_20170116_123330.jpg alt: Waiting for the plane to Vancouver, 2017 - - data-src: /assets/fkp/IMG_20170117_172305.jpg ? ------ + - data-src: /assets/fkp/IMG_20170116_212756.jpg ? +++++ + alt: Enjoying some sushi, 2017 - data-src: /assets/fkp/IMG_201803.jpg alt: Las Vegas, 2018 settings: height: 400 initialHeight: maxHeight: interval: transitionDuration: - effect: + effect: "'fade'" disableNav: keyboardNav: previousNavSelector: nextNavSelector:
5
0.227273
2
3
10d09367111d610e82344e9616aab98815bf9397
capture_chessboard.py
capture_chessboard.py
import time import cv2 import Calibration # Calibration pattern size pattern_size = ( 9, 6 ) # Get the camera camera = cv2.VideoCapture( 1 ) # Acquisition loop while( True ) : # Capture image-by-image _, image = camera.read() # Display the chessboard on the image chessboard = Calibration.PreviewChessboard( image, pattern_size ) # Display the resulting image cv2.imshow( 'USB Camera', chessboard ) # Keyboard interruption key = cv2.waitKey( 1 ) & 0xFF # Escape : quit the application if key == 27 : break # Space : save the image elif key == 32 : current_time = time.strftime( '%Y%m%d_%H%M%S' ) print( 'Save image {} to disk...'.format( current_time ) ) cv2.imwrite( 'image-{}.png'.format( current_time ), image ) # Release the camera camera.release() # Close OpenCV windows cv2.destroyAllWindows()
import time import cv2 import numpy as np import Calibration # Calibration pattern size pattern_size = ( 9, 6 ) # Get the camera camera = cv2.VideoCapture( 0 ) # Acquisition loop while( True ) : # Capture image-by-image _, image = camera.read() # Copy the image for display chessboard = np.copy( image ) # Display the chessboard on the image Calibration.PreviewChessboard( chessboard, pattern_size ) # Display the resulting image cv2.imshow( 'USB Camera', chessboard ) # Keyboard interruption key = cv2.waitKey( 1 ) & 0xFF # Escape : quit the application if key == 27 : break # Space : save the image elif key == 32 : current_time = time.strftime( '%Y%m%d_%H%M%S' ) print( 'Save image {} to disk...'.format( current_time ) ) cv2.imwrite( 'image-{}.png'.format( current_time ), image ) # Release the camera camera.release() # Close OpenCV windows cv2.destroyAllWindows()
Change camera index, and fix the chessboard preview.
Change camera index, and fix the chessboard preview.
Python
mit
microy/RobotVision,microy/RobotVision
python
## Code Before: import time import cv2 import Calibration # Calibration pattern size pattern_size = ( 9, 6 ) # Get the camera camera = cv2.VideoCapture( 1 ) # Acquisition loop while( True ) : # Capture image-by-image _, image = camera.read() # Display the chessboard on the image chessboard = Calibration.PreviewChessboard( image, pattern_size ) # Display the resulting image cv2.imshow( 'USB Camera', chessboard ) # Keyboard interruption key = cv2.waitKey( 1 ) & 0xFF # Escape : quit the application if key == 27 : break # Space : save the image elif key == 32 : current_time = time.strftime( '%Y%m%d_%H%M%S' ) print( 'Save image {} to disk...'.format( current_time ) ) cv2.imwrite( 'image-{}.png'.format( current_time ), image ) # Release the camera camera.release() # Close OpenCV windows cv2.destroyAllWindows() ## Instruction: Change camera index, and fix the chessboard preview. ## Code After: import time import cv2 import numpy as np import Calibration # Calibration pattern size pattern_size = ( 9, 6 ) # Get the camera camera = cv2.VideoCapture( 0 ) # Acquisition loop while( True ) : # Capture image-by-image _, image = camera.read() # Copy the image for display chessboard = np.copy( image ) # Display the chessboard on the image Calibration.PreviewChessboard( chessboard, pattern_size ) # Display the resulting image cv2.imshow( 'USB Camera', chessboard ) # Keyboard interruption key = cv2.waitKey( 1 ) & 0xFF # Escape : quit the application if key == 27 : break # Space : save the image elif key == 32 : current_time = time.strftime( '%Y%m%d_%H%M%S' ) print( 'Save image {} to disk...'.format( current_time ) ) cv2.imwrite( 'image-{}.png'.format( current_time ), image ) # Release the camera camera.release() # Close OpenCV windows cv2.destroyAllWindows()
import time import cv2 + import numpy as np import Calibration # Calibration pattern size pattern_size = ( 9, 6 ) # Get the camera - camera = cv2.VideoCapture( 1 ) ? ^ + camera = cv2.VideoCapture( 0 ) ? ^ # Acquisition loop while( True ) : # Capture image-by-image _, image = camera.read() + # Copy the image for display + chessboard = np.copy( image ) # Display the chessboard on the image - chessboard = Calibration.PreviewChessboard( image, pattern_size ) ? ------------- ^^ ^^ + Calibration.PreviewChessboard( chessboard, pattern_size ) ? ^^^^^^^ ^^ # Display the resulting image cv2.imshow( 'USB Camera', chessboard ) # Keyboard interruption key = cv2.waitKey( 1 ) & 0xFF # Escape : quit the application if key == 27 : break # Space : save the image elif key == 32 : current_time = time.strftime( '%Y%m%d_%H%M%S' ) print( 'Save image {} to disk...'.format( current_time ) ) cv2.imwrite( 'image-{}.png'.format( current_time ), image ) # Release the camera camera.release() # Close OpenCV windows cv2.destroyAllWindows()
7
0.241379
5
2
266aaa127973bf296eb1a51ae4ac57c19c8a0029
.circleci/config.yml
.circleci/config.yml
version: 2.1 orbs: ruby: circleci/ruby@1.1.2 jobs: test: parameters: version: type: string executor: name: ruby/default tag: << parameters.version >> steps: - checkout - run: name: Generate Gemfile.lock command: bundle lock - ruby/install-deps - run: name: Install CodeClimate test reporter command: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build - run: name: Run default Rake task command: bundle exec rake - run: name: Upload coverage report to CodeClimate command: ./cc-test-reporter after-build workflows: version: 2 default: jobs: - test: matrix: parameters: version: - "2.4" - "2.5" - "2.6" - "2.7"
version: 2.1 orbs: ruby: circleci/ruby@1.1.2 jobs: test: parameters: version: type: string executor: name: ruby/default tag: << parameters.version >> steps: - checkout - run: name: Generate Gemfile.lock command: bundle lock - ruby/install-deps - run: name: Install SVGO command: npm install -g svgo - run: name: Install CodeClimate test reporter command: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build - run: name: Run default Rake task command: bundle exec rake - run: name: Upload coverage report to CodeClimate command: ./cc-test-reporter after-build workflows: version: 2 default: jobs: - test: matrix: parameters: version: - "2.4-node" - "2.5-node" - "2.6-node" - "2.7-node"
Use *-node images and install SVGO
Use *-node images and install SVGO
YAML
mit
jgarber623/svgeez
yaml
## Code Before: version: 2.1 orbs: ruby: circleci/ruby@1.1.2 jobs: test: parameters: version: type: string executor: name: ruby/default tag: << parameters.version >> steps: - checkout - run: name: Generate Gemfile.lock command: bundle lock - ruby/install-deps - run: name: Install CodeClimate test reporter command: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build - run: name: Run default Rake task command: bundle exec rake - run: name: Upload coverage report to CodeClimate command: ./cc-test-reporter after-build workflows: version: 2 default: jobs: - test: matrix: parameters: version: - "2.4" - "2.5" - "2.6" - "2.7" ## Instruction: Use *-node images and install SVGO ## Code After: version: 2.1 orbs: ruby: circleci/ruby@1.1.2 jobs: test: parameters: version: type: string executor: name: ruby/default tag: << parameters.version >> steps: - checkout - run: name: Generate Gemfile.lock command: bundle lock - ruby/install-deps - run: name: Install SVGO command: npm install -g svgo - run: name: Install CodeClimate test reporter command: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build - run: name: Run default Rake task command: bundle exec rake - run: name: Upload coverage report to CodeClimate command: ./cc-test-reporter after-build workflows: version: 2 default: jobs: - test: matrix: parameters: version: - "2.4-node" - "2.5-node" - "2.6-node" - "2.7-node"
version: 2.1 orbs: ruby: circleci/ruby@1.1.2 jobs: test: parameters: version: type: string executor: name: ruby/default tag: << parameters.version >> steps: - checkout - run: name: Generate Gemfile.lock command: bundle lock - ruby/install-deps + - run: + name: Install SVGO + command: npm install -g svgo - run: name: Install CodeClimate test reporter command: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build - run: name: Run default Rake task command: bundle exec rake - run: name: Upload coverage report to CodeClimate command: ./cc-test-reporter after-build workflows: version: 2 default: jobs: - test: matrix: parameters: version: - - "2.4" + - "2.4-node" ? +++++ - - "2.5" + - "2.5-node" ? +++++ - - "2.6" + - "2.6-node" ? +++++ - - "2.7" + - "2.7-node" ? +++++
11
0.25
7
4
859a23790968c84cdbc4fa7467957a3a1ed1e069
greatbigcrane/project/forms.py
greatbigcrane/project/forms.py
from django import forms from project.models import Project class ProjectForm(forms.ModelForm): class Meta: model = Project class DjangoRecipeForm(forms.Form): settings = forms.CharField() version = forms.ChoiceField(choices=[ ("trunk", "trunk"), ("1.2", "1.2"), ("1.1.2", "1.1.2"), ("1.1", "1.1"), ("1.0.4", "1.04"), ("0.96", "0.96"), ]) eggs = forms.CharField() project = forms.CharField() extra_paths = forms.CharField() fcgi = forms.BooleanField() wsgi = forms.BooleanField() recipe_form_map = { 'djangorecipe': DjangoRecipeForm }
from django import forms from project.models import Project class ProjectForm(forms.ModelForm): class Meta: model = Project class DjangoRecipeForm(forms.Form): name = forms.CharField(initial="django") settings = forms.CharField() version = forms.ChoiceField(choices=[ ("trunk", "trunk"), ("1.2", "1.2"), ("1.1.2", "1.1.2"), ("1.1", "1.1"), ("1.0.4", "1.04"), ("0.96", "0.96"), ]) eggs = forms.CharField() project = forms.CharField() extra_paths = forms.CharField() fcgi = forms.BooleanField() wsgi = forms.BooleanField() recipe_form_map = { 'djangorecipe': DjangoRecipeForm }
Add a name for the recipe section
Add a name for the recipe section
Python
apache-2.0
pnomolos/greatbigcrane,pnomolos/greatbigcrane
python
## Code Before: from django import forms from project.models import Project class ProjectForm(forms.ModelForm): class Meta: model = Project class DjangoRecipeForm(forms.Form): settings = forms.CharField() version = forms.ChoiceField(choices=[ ("trunk", "trunk"), ("1.2", "1.2"), ("1.1.2", "1.1.2"), ("1.1", "1.1"), ("1.0.4", "1.04"), ("0.96", "0.96"), ]) eggs = forms.CharField() project = forms.CharField() extra_paths = forms.CharField() fcgi = forms.BooleanField() wsgi = forms.BooleanField() recipe_form_map = { 'djangorecipe': DjangoRecipeForm } ## Instruction: Add a name for the recipe section ## Code After: from django import forms from project.models import Project class ProjectForm(forms.ModelForm): class Meta: model = Project class DjangoRecipeForm(forms.Form): name = forms.CharField(initial="django") settings = forms.CharField() version = forms.ChoiceField(choices=[ ("trunk", "trunk"), ("1.2", "1.2"), ("1.1.2", "1.1.2"), ("1.1", "1.1"), ("1.0.4", "1.04"), ("0.96", "0.96"), ]) eggs = forms.CharField() project = forms.CharField() extra_paths = forms.CharField() fcgi = forms.BooleanField() wsgi = forms.BooleanField() recipe_form_map = { 'djangorecipe': DjangoRecipeForm }
from django import forms from project.models import Project class ProjectForm(forms.ModelForm): class Meta: model = Project class DjangoRecipeForm(forms.Form): + name = forms.CharField(initial="django") settings = forms.CharField() version = forms.ChoiceField(choices=[ ("trunk", "trunk"), ("1.2", "1.2"), ("1.1.2", "1.1.2"), ("1.1", "1.1"), ("1.0.4", "1.04"), ("0.96", "0.96"), ]) eggs = forms.CharField() project = forms.CharField() extra_paths = forms.CharField() fcgi = forms.BooleanField() wsgi = forms.BooleanField() recipe_form_map = { 'djangorecipe': DjangoRecipeForm }
1
0.035714
1
0
86c3859838c93df1bbe90bce8abc9971f0affe1f
setup.py
setup.py
from setuptools import setup setup(name='turtleart', version='0.2', description='Library to facilitate Turtle Art', author='Ava and Teo Lisitza', author_email='mlisitza+github@gmail.com', packages=['turtleart', 'turtleart.scripts'], entry_points={ 'console_scripts': [ 'qturtle = turtleart.scripts.qturtle:main' ] }, )
from setuptools import setup setup(name='turtleart', version='0.2', description='Library to facilitate Turtle Art', author='Ava and Teo Lisitza', author_email='mlisitza+github@gmail.com', packages=['turtleart', 'turtleart.scripts'], entry_points={ 'console_scripts': [ 'qturtle = turtleart.scripts.qturtle:main' ] }, install_requires=[ 'ipython', ] )
Make turtleart package require ipython
Make turtleart package require ipython
Python
apache-2.0
teolisitza/turtleart
python
## Code Before: from setuptools import setup setup(name='turtleart', version='0.2', description='Library to facilitate Turtle Art', author='Ava and Teo Lisitza', author_email='mlisitza+github@gmail.com', packages=['turtleart', 'turtleart.scripts'], entry_points={ 'console_scripts': [ 'qturtle = turtleart.scripts.qturtle:main' ] }, ) ## Instruction: Make turtleart package require ipython ## Code After: from setuptools import setup setup(name='turtleart', version='0.2', description='Library to facilitate Turtle Art', author='Ava and Teo Lisitza', author_email='mlisitza+github@gmail.com', packages=['turtleart', 'turtleart.scripts'], entry_points={ 'console_scripts': [ 'qturtle = turtleart.scripts.qturtle:main' ] }, install_requires=[ 'ipython', ] )
from setuptools import setup setup(name='turtleart', version='0.2', description='Library to facilitate Turtle Art', author='Ava and Teo Lisitza', author_email='mlisitza+github@gmail.com', packages=['turtleart', 'turtleart.scripts'], entry_points={ 'console_scripts': [ 'qturtle = turtleart.scripts.qturtle:main' ] }, + install_requires=[ + 'ipython', + ] )
3
0.214286
3
0
550ce1de2a4c18b23cee724e2221db1a0da7f0db
src/command/suggest.cr
src/command/suggest.cr
module Command command "suggest", "suggest someone to contact" do |_args, repository| confirmed = Proc(String, Bool).new do |answer| answer == "Y" || answer.empty? end contacts = repository.all.sort suggested_contact = contacts.first last_contact = suggested_contact.last_contacted days = if last_contact == :NEVER Float32::INFINITY else time_since_last_contact = Time.now - last_contact.as(Time) time_since_last_contact.total_days.ceil.to_i end suggestion_message = if last_contact == :NEVER "You haven't sent #{suggested_contact.name} an encouragement before! Would you like to do that now? [Y/n]" else "It's been #{days} day(s) since you last contacted\n#{suggested_contact.name}. Want to send them a quick encouragement now? [Y/n]" end print suggestion_message answer = gets.as(String).chomp.upcase if confirmed.call(answer) puts "Type your message to #{suggested_contact.name}, then press ENTER:" message_to_send = gets.as(String).strip MessageSender.send(suggested_contact, message_to_send) end :OK end end
module Command command "suggest", "suggest someone to contact" do |_args, repository| confirmed = Proc(String, Bool).new do |answer| answer == "Y" || answer.empty? end contacts = repository.all.sort suggested_contact = contacts.first last_contact = suggested_contact.last_contacted days = if last_contact == :NEVER Float32::INFINITY else time_since_last_contact = Time.now - last_contact.as(Time) time_since_last_contact.total_days.ceil.to_i end suggestion_message = if last_contact == :NEVER "You haven't sent #{suggested_contact.name} an encouragement before! Would you like to do that now? [Y/n]" else "It's been #{days} day(s) since you last contacted\n#{suggested_contact.name}. Want to send them a quick encouragement now? [Y/n]" end print suggestion_message answer = gets.as(String).chomp.upcase if confirmed.call(answer) puts "Type your message to #{suggested_contact.name}, then press ENTER:" message_to_send = gets.as(String).strip sent_successfully = MessageSender.send(suggested_contact, message_to_send) repository.mark_as_contacted(suggested_contact) if sent_successfully end :OK end end
Update contacted_at if message sent successfully
Update contacted_at if message sent successfully
Crystal
mit
anicholson/barnabas
crystal
## Code Before: module Command command "suggest", "suggest someone to contact" do |_args, repository| confirmed = Proc(String, Bool).new do |answer| answer == "Y" || answer.empty? end contacts = repository.all.sort suggested_contact = contacts.first last_contact = suggested_contact.last_contacted days = if last_contact == :NEVER Float32::INFINITY else time_since_last_contact = Time.now - last_contact.as(Time) time_since_last_contact.total_days.ceil.to_i end suggestion_message = if last_contact == :NEVER "You haven't sent #{suggested_contact.name} an encouragement before! Would you like to do that now? [Y/n]" else "It's been #{days} day(s) since you last contacted\n#{suggested_contact.name}. Want to send them a quick encouragement now? [Y/n]" end print suggestion_message answer = gets.as(String).chomp.upcase if confirmed.call(answer) puts "Type your message to #{suggested_contact.name}, then press ENTER:" message_to_send = gets.as(String).strip MessageSender.send(suggested_contact, message_to_send) end :OK end end ## Instruction: Update contacted_at if message sent successfully ## Code After: module Command command "suggest", "suggest someone to contact" do |_args, repository| confirmed = Proc(String, Bool).new do |answer| answer == "Y" || answer.empty? end contacts = repository.all.sort suggested_contact = contacts.first last_contact = suggested_contact.last_contacted days = if last_contact == :NEVER Float32::INFINITY else time_since_last_contact = Time.now - last_contact.as(Time) time_since_last_contact.total_days.ceil.to_i end suggestion_message = if last_contact == :NEVER "You haven't sent #{suggested_contact.name} an encouragement before! Would you like to do that now? [Y/n]" else "It's been #{days} day(s) since you last contacted\n#{suggested_contact.name}. Want to send them a quick encouragement now? [Y/n]" end print suggestion_message answer = gets.as(String).chomp.upcase if confirmed.call(answer) puts "Type your message to #{suggested_contact.name}, then press ENTER:" message_to_send = gets.as(String).strip sent_successfully = MessageSender.send(suggested_contact, message_to_send) repository.mark_as_contacted(suggested_contact) if sent_successfully end :OK end end
module Command command "suggest", "suggest someone to contact" do |_args, repository| confirmed = Proc(String, Bool).new do |answer| answer == "Y" || answer.empty? end contacts = repository.all.sort suggested_contact = contacts.first last_contact = suggested_contact.last_contacted days = if last_contact == :NEVER Float32::INFINITY else time_since_last_contact = Time.now - last_contact.as(Time) time_since_last_contact.total_days.ceil.to_i end suggestion_message = if last_contact == :NEVER "You haven't sent #{suggested_contact.name} an encouragement before! Would you like to do that now? [Y/n]" else "It's been #{days} day(s) since you last contacted\n#{suggested_contact.name}. Want to send them a quick encouragement now? [Y/n]" end print suggestion_message answer = gets.as(String).chomp.upcase if confirmed.call(answer) puts "Type your message to #{suggested_contact.name}, then press ENTER:" message_to_send = gets.as(String).strip - MessageSender.send(suggested_contact, message_to_send) + sent_successfully = MessageSender.send(suggested_contact, message_to_send) ? ++++++++++++++++++++ + + repository.mark_as_contacted(suggested_contact) if sent_successfully end :OK end end
4
0.097561
3
1
fb2f66adf5ba60d2cda934ef27125ce84057367e
PCbuild/rmpyc.py
PCbuild/rmpyc.py
def deltree(root): import os def rm(path): os.unlink(path) npyc = npyo = 0 dirs = [root] while dirs: dir = dirs.pop() for short in os.listdir(dir): full = os.path.join(dir, short) if os.path.isdir(full): dirs.append(full) elif short.endswith(".pyc"): npyc += 1 rm(full) elif short.endswith(".pyo"): npyo += 1 rm(full) return npyc, npyo npyc, npyo = deltree("../Lib") print npyc, ".pyc deleted,", npyo, ".pyo deleted"
def deltree(root): import os from os.path import join npyc = npyo = 0 for root, dirs, files in os.walk(root): for name in files: delete = False if name.endswith('.pyc'): delete = True npyc += 1 elif name.endswith('.pyo'): delete = True npyo += 1 if delete: os.remove(join(root, name)) return npyc, npyo npyc, npyo = deltree("../Lib") print npyc, ".pyc deleted,", npyo, ".pyo deleted"
Use os.walk() to find files to delete.
Use os.walk() to find files to delete.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
python
## Code Before: def deltree(root): import os def rm(path): os.unlink(path) npyc = npyo = 0 dirs = [root] while dirs: dir = dirs.pop() for short in os.listdir(dir): full = os.path.join(dir, short) if os.path.isdir(full): dirs.append(full) elif short.endswith(".pyc"): npyc += 1 rm(full) elif short.endswith(".pyo"): npyo += 1 rm(full) return npyc, npyo npyc, npyo = deltree("../Lib") print npyc, ".pyc deleted,", npyo, ".pyo deleted" ## Instruction: Use os.walk() to find files to delete. ## Code After: def deltree(root): import os from os.path import join npyc = npyo = 0 for root, dirs, files in os.walk(root): for name in files: delete = False if name.endswith('.pyc'): delete = True npyc += 1 elif name.endswith('.pyo'): delete = True npyo += 1 if delete: os.remove(join(root, name)) return npyc, npyo npyc, npyo = deltree("../Lib") print npyc, ".pyc deleted,", npyo, ".pyo deleted"
+ def deltree(root): import os - def rm(path): - os.unlink(path) + from os.path import join + npyc = npyo = 0 + for root, dirs, files in os.walk(root): + for name in files: + delete = False - dirs = [root] - while dirs: - dir = dirs.pop() - for short in os.listdir(dir): - full = os.path.join(dir, short) - if os.path.isdir(full): - dirs.append(full) - elif short.endswith(".pyc"): ? -- ^^^^^ ^ ^ + if name.endswith('.pyc'): ? ^^^^ ^ ^ + delete = True npyc += 1 - rm(full) - elif short.endswith(".pyo"): ? ^^^^^ ^ ^ + elif name.endswith('.pyo'): ? ^^^^ ^ ^ + delete = True npyo += 1 - rm(full) + + if delete: + os.remove(join(root, name)) + return npyc, npyo npyc, npyo = deltree("../Lib") print npyc, ".pyc deleted,", npyo, ".pyo deleted"
27
1.173913
14
13
cce0d06150aea15d80af653c534725a44ff08cd6
data/navigation.json
data/navigation.json
{ "header": { "/cfp": { "text": "Call for Proposals" }, "/#speakers": { "text": "Speakers", "anchor": true }, "/#venue": { "text": "Venue", "anchor": true }, "/#sponsor": { "text": "Sponsor", "anchor": true }, "/schedule": { "text": "Schedule" } }, "footer": { "/code_of_conduct": { "text": "Code of Conduct" }, "https://www.mozilla.org/en-US/privacy/": { "text": "Privacy", "offsite": true }, "https://www.mozilla.org/en-US/about/legal/terms/mozilla/": { "text": "Legal", "offsite": true }, "https://www.mozilla.org/en-US/privacy/websites/#cookies/": { "text": "Cookies", "offsite": true }, "mailto:viewsource-info@mozilla.com": { "text": "Contact Us", "offsite": true } } }
{ "header": { "/cfp": { "text": "Call for Proposals" }, "/#speakers": { "text": "Speakers", "anchor": true }, "/#venue": { "text": "Venue", "anchor": true }, "/#sponsor": { "text": "Sponsor", "anchor": true } }, "footer": { "/code_of_conduct": { "text": "Code of Conduct" }, "https://www.mozilla.org/en-US/privacy/": { "text": "Privacy", "offsite": true }, "https://www.mozilla.org/en-US/about/legal/terms/mozilla/": { "text": "Legal", "offsite": true }, "https://www.mozilla.org/en-US/privacy/websites/#cookies/": { "text": "Cookies", "offsite": true }, "mailto:viewsource-info@mozilla.com": { "text": "Contact Us", "offsite": true } } }
Remove schedule from header nav.
Remove schedule from header nav.
JSON
mpl-2.0
mdn/viewsourceconf,hoosteeno/viewsourceconf,hoosteeno/viewsourceconf,mdn/viewsourceconf,hoosteeno/viewsourceconf,mdn/viewsourceconf
json
## Code Before: { "header": { "/cfp": { "text": "Call for Proposals" }, "/#speakers": { "text": "Speakers", "anchor": true }, "/#venue": { "text": "Venue", "anchor": true }, "/#sponsor": { "text": "Sponsor", "anchor": true }, "/schedule": { "text": "Schedule" } }, "footer": { "/code_of_conduct": { "text": "Code of Conduct" }, "https://www.mozilla.org/en-US/privacy/": { "text": "Privacy", "offsite": true }, "https://www.mozilla.org/en-US/about/legal/terms/mozilla/": { "text": "Legal", "offsite": true }, "https://www.mozilla.org/en-US/privacy/websites/#cookies/": { "text": "Cookies", "offsite": true }, "mailto:viewsource-info@mozilla.com": { "text": "Contact Us", "offsite": true } } } ## Instruction: Remove schedule from header nav. ## Code After: { "header": { "/cfp": { "text": "Call for Proposals" }, "/#speakers": { "text": "Speakers", "anchor": true }, "/#venue": { "text": "Venue", "anchor": true }, "/#sponsor": { "text": "Sponsor", "anchor": true } }, "footer": { "/code_of_conduct": { "text": "Code of Conduct" }, "https://www.mozilla.org/en-US/privacy/": { "text": "Privacy", "offsite": true }, "https://www.mozilla.org/en-US/about/legal/terms/mozilla/": { "text": "Legal", "offsite": true }, "https://www.mozilla.org/en-US/privacy/websites/#cookies/": { "text": "Cookies", "offsite": true }, "mailto:viewsource-info@mozilla.com": { "text": "Contact Us", "offsite": true } } }
{ "header": { "/cfp": { "text": "Call for Proposals" }, "/#speakers": { "text": "Speakers", "anchor": true }, "/#venue": { "text": "Venue", "anchor": true }, "/#sponsor": { "text": "Sponsor", "anchor": true - }, - "/schedule": { - "text": "Schedule" } }, "footer": { "/code_of_conduct": { "text": "Code of Conduct" }, "https://www.mozilla.org/en-US/privacy/": { "text": "Privacy", "offsite": true }, "https://www.mozilla.org/en-US/about/legal/terms/mozilla/": { "text": "Legal", "offsite": true }, "https://www.mozilla.org/en-US/privacy/websites/#cookies/": { "text": "Cookies", "offsite": true }, "mailto:viewsource-info@mozilla.com": { "text": "Contact Us", "offsite": true } } }
3
0.069767
0
3
d4fd4c0e1435ae3d527be87fba745725c9e9df1b
shaq_overflow/app/controllers/votes_controller.rb
shaq_overflow/app/controllers/votes_controller.rb
class VotesController < ApplicationController def create if request.xhr? vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: 1, votable_id: params[:answerId]) answer = Answer.find(params[:answerId]) votes = answer.votes.count votes.to_json render json: votes end end end
class VotesController < ApplicationController def create if request.xhr? if params[:direction] == "up" vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: 1, votable_id: params[:answerId]) @answer = Answer.find(params[:answerId]) else vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: -1, votable_id: params[:answerId]) @answer = Answer.find(params[:answerId]) end @vote_values = [] @answer.votes.each {|vote| @vote_values << vote.value.to_i} @anna = @vote_values.reduce(:+) @anna.to_json render json: @anna end end end
Add conditional logic for up and down votes
Add conditional logic for up and down votes
Ruby
mit
lucasrsantos1/lucky-ambassador,lucasrsantos1/lucky-ambassador,lucasrsantos1/lucky-ambassador
ruby
## Code Before: class VotesController < ApplicationController def create if request.xhr? vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: 1, votable_id: params[:answerId]) answer = Answer.find(params[:answerId]) votes = answer.votes.count votes.to_json render json: votes end end end ## Instruction: Add conditional logic for up and down votes ## Code After: class VotesController < ApplicationController def create if request.xhr? if params[:direction] == "up" vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: 1, votable_id: params[:answerId]) @answer = Answer.find(params[:answerId]) else vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: -1, votable_id: params[:answerId]) @answer = Answer.find(params[:answerId]) end @vote_values = [] @answer.votes.each {|vote| @vote_values << vote.value.to_i} @anna = @vote_values.reduce(:+) @anna.to_json render json: @anna end end end
class VotesController < ApplicationController def create if request.xhr? + if params[:direction] == "up" - vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: 1, votable_id: params[:answerId]) + vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: 1, votable_id: params[:answerId]) ? ++ - answer = Answer.find(params[:answerId]) + @answer = Answer.find(params[:answerId]) ? +++ - votes = answer.votes.count - votes.to_json + else + vote = Vote.create(votable_type: params[:votableType], user_id: current_user.id, value: -1, votable_id: params[:answerId]) + @answer = Answer.find(params[:answerId]) + end + @vote_values = [] + @answer.votes.each {|vote| @vote_values << vote.value.to_i} + @anna = @vote_values.reduce(:+) + @anna.to_json - render json: votes ? ^^^^^ + render json: @anna ? ++ ^^^^^ end end end
17
1.307692
12
5
0076e9d9384fcce6e40b9c8f24ad57b986c5a68f
public/js/rss-reader.js
public/js/rss-reader.js
$(function() { setInterval(function () { $(".humantime").each(function () { var $time = $(this); $.get('/humantime', { stamp: this.dataset.stamp }, function(data) { $time.text(data) }); }); }, 90000); });
$(function() { setInterval(function () { $(".humantime").each(function () { var $time = $(this); $.get('/humantime', { stamp: this.dataset.stamp }, function(data) { $time.text(data) }); }); }, 90000); $("select#feeds").on('change', function () { window.location = '/feed/' + this.value; }); });
Add change function for feed select
Add change function for feed select
JavaScript
mit
JulianNicholls/ruby-rss-reader,JulianNicholls/ruby-rss-reader,JulianNicholls/ruby-rss-reader
javascript
## Code Before: $(function() { setInterval(function () { $(".humantime").each(function () { var $time = $(this); $.get('/humantime', { stamp: this.dataset.stamp }, function(data) { $time.text(data) }); }); }, 90000); }); ## Instruction: Add change function for feed select ## Code After: $(function() { setInterval(function () { $(".humantime").each(function () { var $time = $(this); $.get('/humantime', { stamp: this.dataset.stamp }, function(data) { $time.text(data) }); }); }, 90000); $("select#feeds").on('change', function () { window.location = '/feed/' + this.value; }); });
$(function() { setInterval(function () { $(".humantime").each(function () { var $time = $(this); $.get('/humantime', { stamp: this.dataset.stamp }, function(data) { $time.text(data) }); }); }, 90000); + + $("select#feeds").on('change', function () { + window.location = '/feed/' + this.value; + }); });
4
0.363636
4
0
5f3f4007b9ce06915ab3460019ac9dd4fe17a9ce
docs/source/tricks.rst
docs/source/tricks.rst
.. _chapter-tricks: =================== Tips, Tricks & FAQs =================== A collection of miscellanous tips, tricks and frequently asked questions Derivatives =========== The single most important bit of advice for users of Ceres Solver is to use analytic/automatic differentiation when you can. It is tempting to take the easy way out and use numeric differentiation. This is a bad idea. Numeric differentiation is slow, ill-behaved, hard to get right and results in poor convergence behaviour.
.. _chapter-tricks: =================== Tips, Tricks & FAQs =================== A collection of miscellanous tips, tricks and answers to frequently asked questions. 1. Use analytical/automatic derivatives when possible. This is the single most important piece of advice we can give to you. It is tempting to take the easy way out and use numeric differentiation. This is a bad idea. Numeric differentiation is slow, ill-behaved, hard to get right, and results in poor convergence behaviour. Ceres allows the user to define templated functors which will be automatically differentiated. For most situations this is enough and we recommend using this facility. In some cases the derivatives are simple enough or the performance considerations are such that the overhead of automatic differentiation is too much. In such cases, analytic derivatives are recommended. The use of numerical derivatives should be a measure of last resort, where it is simply not possible to write a templated implementation of the cost function. In many cases where it is not possible to do analytic or automatic differentiation of the entire cost function. But it is generally the case that it is possible to decompose the cost function into parts that need to be numerically differentiated and parts that can be automatically or analytically differentiated. To this end, Ceres has extensive support for mixing analytic, automatic and numeric differentiation. See :class:`NumericDiffFunctor` and :class:`CostFunctionToFunctor`. 2. Diagnosing convergence issues. TBD 3. Diagnoising performance issues. TBD
Extend the advice on derivatives.
Extend the advice on derivatives. Extend the tips/tricks section to include more comprehensive advice on derivatives. Change-Id: Iba5768055b32a65e36d70e6f4db62eca9b331253
reStructuredText
bsd-3-clause
ysonggit/ceres-solver,entylop/ceres-solver,timfel/ceres-bin,DougFirErickson/ceres-solver,timfel/ceres-bin,kartikkumar/ceres-solver,ikoruk/ceres-solver,kartikkumar/ceres-solver,stonier/ceres_solver,DougFirErickson/ceres-solver,ikoruk/ceres-solver,timfel/ceres-bin,kartikkumar/ceres-solver,ikoruk/ceres-solver,stonier/ceres_solver,whuaegeanse/ceres-solver,stonier/ceres_solver,whuaegeanse/ceres-solver,ysonggit/ceres-solver,ysonggit/ceres-solver,ysonggit/ceres-solver,DougFirErickson/ceres-solver,ikoruk/ceres-solver,stonier/ceres_solver,timfel/ceres-bin,whuaegeanse/ceres-solver,whuaegeanse/ceres-solver,entylop/ceres-solver,ikoruk/ceres-solver,entylop/ceres-solver,DougFirErickson/ceres-solver,kartikkumar/ceres-solver,entylop/ceres-solver
restructuredtext
## Code Before: .. _chapter-tricks: =================== Tips, Tricks & FAQs =================== A collection of miscellanous tips, tricks and frequently asked questions Derivatives =========== The single most important bit of advice for users of Ceres Solver is to use analytic/automatic differentiation when you can. It is tempting to take the easy way out and use numeric differentiation. This is a bad idea. Numeric differentiation is slow, ill-behaved, hard to get right and results in poor convergence behaviour. ## Instruction: Extend the advice on derivatives. Extend the tips/tricks section to include more comprehensive advice on derivatives. Change-Id: Iba5768055b32a65e36d70e6f4db62eca9b331253 ## Code After: .. _chapter-tricks: =================== Tips, Tricks & FAQs =================== A collection of miscellanous tips, tricks and answers to frequently asked questions. 1. Use analytical/automatic derivatives when possible. This is the single most important piece of advice we can give to you. It is tempting to take the easy way out and use numeric differentiation. This is a bad idea. Numeric differentiation is slow, ill-behaved, hard to get right, and results in poor convergence behaviour. Ceres allows the user to define templated functors which will be automatically differentiated. For most situations this is enough and we recommend using this facility. In some cases the derivatives are simple enough or the performance considerations are such that the overhead of automatic differentiation is too much. In such cases, analytic derivatives are recommended. The use of numerical derivatives should be a measure of last resort, where it is simply not possible to write a templated implementation of the cost function. In many cases where it is not possible to do analytic or automatic differentiation of the entire cost function. But it is generally the case that it is possible to decompose the cost function into parts that need to be numerically differentiated and parts that can be automatically or analytically differentiated. To this end, Ceres has extensive support for mixing analytic, automatic and numeric differentiation. See :class:`NumericDiffFunctor` and :class:`CostFunctionToFunctor`. 2. Diagnosing convergence issues. TBD 3. Diagnoising performance issues. TBD
.. _chapter-tricks: =================== Tips, Tricks & FAQs =================== - A collection of miscellanous tips, tricks and frequently asked ? ------ + A collection of miscellanous tips, tricks and answers to frequently ? +++++++++++ - questions + asked questions. + 1. Use analytical/automatic derivatives when possible. - Derivatives - =========== - The single most important bit of advice for users of Ceres Solver is - to use analytic/automatic differentiation when you can. It is tempting - to take the easy way out and use numeric differentiation. This is a - bad idea. Numeric differentiation is slow, ill-behaved, hard to get - right and results in poor convergence behaviour. + This is the single most important piece of advice we can give to + you. It is tempting to take the easy way out and use numeric + differentiation. This is a bad idea. Numeric differentiation is + slow, ill-behaved, hard to get right, and results in poor + convergence behaviour. + + Ceres allows the user to define templated functors which will + be automatically differentiated. For most situations this is enough + and we recommend using this facility. In some cases the derivatives + are simple enough or the performance considerations are such that + the overhead of automatic differentiation is too much. In such + cases, analytic derivatives are recommended. + + The use of numerical derivatives should be a measure of last + resort, where it is simply not possible to write a templated + implementation of the cost function. + + In many cases where it is not possible to do analytic or automatic + differentiation of the entire cost function. But it is generally + the case that it is possible to decompose the cost function into + parts that need to be numerically differentiated and parts that can + be automatically or analytically differentiated. + + To this end, Ceres has extensive support for mixing analytic, + automatic and numeric differentiation. See + :class:`NumericDiffFunctor` and :class:`CostFunctionToFunctor`. + + + 2. Diagnosing convergence issues. + + TBD + + 3. Diagnoising performance issues. + + TBD
47
2.764706
38
9
798f1ece02ee49b85b1b6a65d74f76e8b9938405
packages/dh/dhall-lex.yaml
packages/dh/dhall-lex.yaml
homepage: '' changelog-type: '' hash: 8fcf55f0ccb76069b8441a1dada75f894eb04698858fb22e961dffff2442c480 test-bench-deps: bytestring: -any base: -any hspec: -any criterion: -any dhall-lex: -any hspec-dirstream: ! '>=1.0.0.0' maintainer: vamchale@gmail.com synopsis: Lexer for the Dhall language changelog: '' basic-deps: bytestring: -any base: ! '>=4.8 && <5' array: -any deepseq: -any all-versions: - '0.1.0.0' author: Vanessa McHale latest: '0.1.0.0' description-type: markdown description: ! '# dhall-lex This is a library containing a lexer for the [Dhall](http://hackage.haskell.org/package/dhall) language. ' license-name: BSD3
homepage: '' changelog-type: '' hash: 4b9e298df794c3468ec43e53e96a4a90b725f8ce49d6336dee476c3fbb3dffe0 test-bench-deps: bytestring: -any base: -any hspec: -any criterion: -any dhall-lex: -any hspec-dirstream: ! '>=1.0.0.0' maintainer: vamchale@gmail.com synopsis: Lexer for the Dhall language changelog: '' basic-deps: bytestring: -any base: ! '>=4.8 && <5' array: -any deepseq: -any all-versions: - '0.1.0.0' - '0.1.0.1' author: Vanessa McHale latest: '0.1.0.1' description-type: markdown description: ! '# dhall-lex This is a library containing a lexer for the [Dhall](http://hackage.haskell.org/package/dhall) language. ' license-name: BSD3
Update from Hackage at 2018-03-25T05:47:21Z
Update from Hackage at 2018-03-25T05:47:21Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: '' changelog-type: '' hash: 8fcf55f0ccb76069b8441a1dada75f894eb04698858fb22e961dffff2442c480 test-bench-deps: bytestring: -any base: -any hspec: -any criterion: -any dhall-lex: -any hspec-dirstream: ! '>=1.0.0.0' maintainer: vamchale@gmail.com synopsis: Lexer for the Dhall language changelog: '' basic-deps: bytestring: -any base: ! '>=4.8 && <5' array: -any deepseq: -any all-versions: - '0.1.0.0' author: Vanessa McHale latest: '0.1.0.0' description-type: markdown description: ! '# dhall-lex This is a library containing a lexer for the [Dhall](http://hackage.haskell.org/package/dhall) language. ' license-name: BSD3 ## Instruction: Update from Hackage at 2018-03-25T05:47:21Z ## Code After: homepage: '' changelog-type: '' hash: 4b9e298df794c3468ec43e53e96a4a90b725f8ce49d6336dee476c3fbb3dffe0 test-bench-deps: bytestring: -any base: -any hspec: -any criterion: -any dhall-lex: -any hspec-dirstream: ! '>=1.0.0.0' maintainer: vamchale@gmail.com synopsis: Lexer for the Dhall language changelog: '' basic-deps: bytestring: -any base: ! '>=4.8 && <5' array: -any deepseq: -any all-versions: - '0.1.0.0' - '0.1.0.1' author: Vanessa McHale latest: '0.1.0.1' description-type: markdown description: ! '# dhall-lex This is a library containing a lexer for the [Dhall](http://hackage.haskell.org/package/dhall) language. ' license-name: BSD3
homepage: '' changelog-type: '' - hash: 8fcf55f0ccb76069b8441a1dada75f894eb04698858fb22e961dffff2442c480 + hash: 4b9e298df794c3468ec43e53e96a4a90b725f8ce49d6336dee476c3fbb3dffe0 test-bench-deps: bytestring: -any base: -any hspec: -any criterion: -any dhall-lex: -any hspec-dirstream: ! '>=1.0.0.0' maintainer: vamchale@gmail.com synopsis: Lexer for the Dhall language changelog: '' basic-deps: bytestring: -any base: ! '>=4.8 && <5' array: -any deepseq: -any all-versions: - '0.1.0.0' + - '0.1.0.1' author: Vanessa McHale - latest: '0.1.0.0' ? ^ + latest: '0.1.0.1' ? ^ description-type: markdown description: ! '# dhall-lex This is a library containing a lexer for the [Dhall](http://hackage.haskell.org/package/dhall) language. ' license-name: BSD3
5
0.15625
3
2
85ef77ab98a99e463eb17002e656d4f0dd4ef0b0
app/products/products.tpl.html
app/products/products.tpl.html
<nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#!/products">HUB GOURMET</a> </div> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav"> <li><a href="#!/products">PRODUCTS</a></li> </ul> <div shopping-cart-menu></div> </div> </div> </nav> <section class="container products-list"> <div class="row"> <div class="product-card pull-left col-md-4 img-responsive" ng-repeat="product in products.productsList"> <div class="img-product-card" ng-style="{'background-image':'url(../download.jpg)'}"> <div class="product-card-shop"> <button type="button" class="btn shop-button" ng-click="products.addItem(product, 1)"> <i class="glyphicon glyphicon-shopping-cart"></i> </button> <p class="add-to-cart">Añadir al carrito</p> </div> </div> <div class="product-description">{{ product.description }}</div> <div>{{ product.productUnitQuantity + product.productUnit }}</div> <div>{{ product.price | currency }}</div> </div> </div> </section>
<nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#!/products">HUB GOURMET</a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="#!/products">PRODUCTS</a></li> </ul> <div shopping-cart-menu></div> </div> </div> </nav> <section class="container products-list"> <div class="row"> <div class="product-card pull-left col-xs-12 col-md-6 col-lg-4" ng-repeat="product in products.productsList"> <div class="img-product-card" ng-style="{'background-image':'url(../download.jpg)'}"> <div class="product-card-shop"> <button type="button" class="btn shop-button" ng-click="products.addItem(product, 1)"> <i class="glyphicon glyphicon-shopping-cart"></i> </button> <p class="add-to-cart">Añadir al carrito</p> </div> </div> <div class="product-description">{{ product.description }}</div> <div>{{ product.productUnitQuantity + product.productUnit }}</div> <div>{{ product.price | currency }}</div> </div> </div> </section>
Fix grid system in products view
Fix grid system in products view
HTML
agpl-3.0
stivaliserna/hub-gourmet-client,stivaliserna/hub-gourmet-client
html
## Code Before: <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#!/products">HUB GOURMET</a> </div> <div class="collapse navbar-collapse navbar-ex1-collapse"> <ul class="nav navbar-nav"> <li><a href="#!/products">PRODUCTS</a></li> </ul> <div shopping-cart-menu></div> </div> </div> </nav> <section class="container products-list"> <div class="row"> <div class="product-card pull-left col-md-4 img-responsive" ng-repeat="product in products.productsList"> <div class="img-product-card" ng-style="{'background-image':'url(../download.jpg)'}"> <div class="product-card-shop"> <button type="button" class="btn shop-button" ng-click="products.addItem(product, 1)"> <i class="glyphicon glyphicon-shopping-cart"></i> </button> <p class="add-to-cart">Añadir al carrito</p> </div> </div> <div class="product-description">{{ product.description }}</div> <div>{{ product.productUnitQuantity + product.productUnit }}</div> <div>{{ product.price | currency }}</div> </div> </div> </section> ## Instruction: Fix grid system in products view ## Code After: <nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#!/products">HUB GOURMET</a> </div> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="#!/products">PRODUCTS</a></li> </ul> <div shopping-cart-menu></div> </div> </div> </nav> <section class="container products-list"> <div class="row"> <div class="product-card pull-left col-xs-12 col-md-6 col-lg-4" ng-repeat="product in products.productsList"> <div class="img-product-card" ng-style="{'background-image':'url(../download.jpg)'}"> <div class="product-card-shop"> <button type="button" class="btn shop-button" ng-click="products.addItem(product, 1)"> <i class="glyphicon glyphicon-shopping-cart"></i> </button> <p class="add-to-cart">Añadir al carrito</p> </div> </div> <div class="product-description">{{ product.description }}</div> <div>{{ product.productUnitQuantity + product.productUnit }}</div> <div>{{ product.price | currency }}</div> </div> </div> </section>
<nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#!/products">HUB GOURMET</a> </div> - <div class="collapse navbar-collapse navbar-ex1-collapse"> ? -------------------- + <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="#!/products">PRODUCTS</a></li> </ul> <div shopping-cart-menu></div> </div> </div> </nav> <section class="container products-list"> <div class="row"> - <div class="product-card pull-left col-md-4 img-responsive" ng-repeat="product in products.productsList"> ? ^ ^^ ^^^^^^^^^^ + <div class="product-card pull-left col-xs-12 col-md-6 col-lg-4" ng-repeat="product in products.productsList"> ? ++++++++++ ^ ^^^^^ ^ <div class="img-product-card" ng-style="{'background-image':'url(../download.jpg)'}"> <div class="product-card-shop"> <button type="button" class="btn shop-button" ng-click="products.addItem(product, 1)"> <i class="glyphicon glyphicon-shopping-cart"></i> </button> <p class="add-to-cart">Añadir al carrito</p> </div> </div> <div class="product-description">{{ product.description }}</div> <div>{{ product.productUnitQuantity + product.productUnit }}</div> <div>{{ product.price | currency }}</div> </div> </div> </section>
4
0.129032
2
2
943a6c173c366dad1207b53d79b35e4f97ed0062
src/server/handlers/badge.js
src/server/handlers/badge.js
import path from 'path'; import logging from '../logging'; const logger = logging.getLogger('express'); import { internalFindSnap, internalGetSnapBuilds } from './launchpad'; import { getGitHubRepoUrl } from '../../common/helpers/github-url'; import { snapBuildFromAPI } from '../../common/helpers/snap-builds'; const BADGES_PATH = path.join(__dirname, '../../common/images/badges'); export const badge = async (req, res) => { const repoUrl = getGitHubRepoUrl(req.params.owner, req.params.name); try { const snap = await internalFindSnap(repoUrl); const builds = await internalGetSnapBuilds(snap); let badgeName = 'never_built'; if (builds.length) { const latestBuild = snapBuildFromAPI(builds[0]); if (latestBuild.badge) { badgeName = latestBuild.badge; } } res.setHeader('Cache-Control', 'no-cache'); return res.sendFile(path.join(BADGES_PATH, `${badgeName}.svg`)); } catch (err) { logger.error(`Error generating badge for repo ${repoUrl}`, err); res.status(404).send('Not found'); } };
import path from 'path'; import logging from '../logging'; const logger = logging.getLogger('express'); import { internalFindSnap, internalGetSnapBuilds } from './launchpad'; import { getGitHubRepoUrl } from '../../common/helpers/github-url'; import { snapBuildFromAPI } from '../../common/helpers/snap-builds'; const BADGES_PATH = path.join(__dirname, '../../common/images/badges'); export const badge = async (req, res) => { const repoUrl = getGitHubRepoUrl(req.params.owner, req.params.name); try { const snap = await internalFindSnap(repoUrl); const builds = await internalGetSnapBuilds(snap); let badgeName = 'never_built'; if (builds.length) { const latestBuild = snapBuildFromAPI(builds[0]); if (latestBuild.badge) { badgeName = latestBuild.badge; } } res.setHeader('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate, value'); res.setHeader('Expires', 'Thu, 01 Jan 1970 00:00:00 GMT'); res.setHeader('Pragma', 'no-cache'); return res.sendFile(path.join(BADGES_PATH, `${badgeName}.svg`)); } catch (err) { logger.error(`Error generating badge for repo ${repoUrl}`, err); res.status(404).send('Not found'); } };
Add Extra Cache Headers To Build Badge Response
Add Extra Cache Headers To Build Badge Response Add extra cache prevention headers to the build badge response. This should help reduce caching on GitHub README's.
JavaScript
agpl-3.0
canonical-ols/build.snapcraft.io,canonical-ols/build.snapcraft.io,canonical-ols/build.snapcraft.io
javascript
## Code Before: import path from 'path'; import logging from '../logging'; const logger = logging.getLogger('express'); import { internalFindSnap, internalGetSnapBuilds } from './launchpad'; import { getGitHubRepoUrl } from '../../common/helpers/github-url'; import { snapBuildFromAPI } from '../../common/helpers/snap-builds'; const BADGES_PATH = path.join(__dirname, '../../common/images/badges'); export const badge = async (req, res) => { const repoUrl = getGitHubRepoUrl(req.params.owner, req.params.name); try { const snap = await internalFindSnap(repoUrl); const builds = await internalGetSnapBuilds(snap); let badgeName = 'never_built'; if (builds.length) { const latestBuild = snapBuildFromAPI(builds[0]); if (latestBuild.badge) { badgeName = latestBuild.badge; } } res.setHeader('Cache-Control', 'no-cache'); return res.sendFile(path.join(BADGES_PATH, `${badgeName}.svg`)); } catch (err) { logger.error(`Error generating badge for repo ${repoUrl}`, err); res.status(404).send('Not found'); } }; ## Instruction: Add Extra Cache Headers To Build Badge Response Add extra cache prevention headers to the build badge response. This should help reduce caching on GitHub README's. ## Code After: import path from 'path'; import logging from '../logging'; const logger = logging.getLogger('express'); import { internalFindSnap, internalGetSnapBuilds } from './launchpad'; import { getGitHubRepoUrl } from '../../common/helpers/github-url'; import { snapBuildFromAPI } from '../../common/helpers/snap-builds'; const BADGES_PATH = path.join(__dirname, '../../common/images/badges'); export const badge = async (req, res) => { const repoUrl = getGitHubRepoUrl(req.params.owner, req.params.name); try { const snap = await internalFindSnap(repoUrl); const builds = await internalGetSnapBuilds(snap); let badgeName = 'never_built'; if (builds.length) { const latestBuild = snapBuildFromAPI(builds[0]); if (latestBuild.badge) { badgeName = latestBuild.badge; } } res.setHeader('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate, value'); res.setHeader('Expires', 'Thu, 01 Jan 1970 00:00:00 GMT'); res.setHeader('Pragma', 'no-cache'); return res.sendFile(path.join(BADGES_PATH, `${badgeName}.svg`)); } catch (err) { logger.error(`Error generating badge for repo ${repoUrl}`, err); res.status(404).send('Not found'); } };
import path from 'path'; import logging from '../logging'; const logger = logging.getLogger('express'); import { internalFindSnap, internalGetSnapBuilds } from './launchpad'; import { getGitHubRepoUrl } from '../../common/helpers/github-url'; import { snapBuildFromAPI } from '../../common/helpers/snap-builds'; const BADGES_PATH = path.join(__dirname, '../../common/images/badges'); export const badge = async (req, res) => { const repoUrl = getGitHubRepoUrl(req.params.owner, req.params.name); try { const snap = await internalFindSnap(repoUrl); const builds = await internalGetSnapBuilds(snap); let badgeName = 'never_built'; if (builds.length) { const latestBuild = snapBuildFromAPI(builds[0]); if (latestBuild.badge) { badgeName = latestBuild.badge; } } + res.setHeader('Cache-Control', 'no-cache, no-store, max-age=0, must-revalidate, value'); + res.setHeader('Expires', 'Thu, 01 Jan 1970 00:00:00 GMT'); - res.setHeader('Cache-Control', 'no-cache'); ? ^ ^^^^^^^^^^^ + res.setHeader('Pragma', 'no-cache'); ? ^^ ^^^ return res.sendFile(path.join(BADGES_PATH, `${badgeName}.svg`)); } catch (err) { logger.error(`Error generating badge for repo ${repoUrl}`, err); res.status(404).send('Not found'); } };
4
0.1
3
1
1aee2e232edb2bdeeda563a612b1ba3f6a33b09a
undercloud/install.sh
undercloud/install.sh
set -eux set -o pipefail if [[ $USER != "stack" ]]; then echo "Must be run as stack user."; exit 1; fi sudo yum upgrade -y; sudo yum install -y ack vim libffi-devel libssl-devel openssl-devel python-devel; rm -rf ~/tripleo-ci git clone https://github.com/openstack-infra/tripleo-ci.git ~/tripleo-ci ~/tripleo-ci/scripts/tripleo.sh --repo-setup ~/tripleo-ci/scripts/tripleo.sh --undercloud ~/tripleo-ci/scripts/tripleo.sh --overcloud-images wget https://bootstrap.pypa.io/get-pip.py; sudo python get-pip.py; sudo pip install virtualenv git-review; git config --global user.email "dougal@redhat.com" git config --global user.name "Dougal Matthews" git config --global --add gitreview.username "dougal" git clone https://github.com/openstack/python-tripleoclient.git; git clone https://github.com/openstack/tripleo-common.git; git clone https://github.com/openstack/mistral.git; virtualenv ~/venv virtualenv ~/venv-tripleodash; ~/venv-tripleodash/bin/pip install python-tripleodash; ~/tripleo-util/undercloud/post-update.sh
set -eux set -o pipefail if [[ $USER != "stack" ]]; then echo "Must be run as stack user."; exit 1; fi sudo yum upgrade -y; sudo yum install -y ack vim libffi-devel libssl-devel openssl-devel python-devel; rm -rf ~/tripleo-ci git clone https://github.com/openstack-infra/tripleo-ci.git ~/tripleo-ci ~/tripleo-ci/scripts/tripleo.sh --repo-setup ~/tripleo-ci/scripts/tripleo.sh --undercloud ~/tripleo-ci/scripts/tripleo.sh --overcloud-images wget https://bootstrap.pypa.io/get-pip.py; sudo python get-pip.py; sudo pip install virtualenv git-review; git config --global user.email "dougal@redhat.com" git config --global user.name "Dougal Matthews" git config --global --add gitreview.username "dougal" git clone https://github.com/openstack/python-tripleoclient.git; git clone https://github.com/openstack/tripleo-common.git; git clone https://github.com/openstack/mistral.git; virtualenv ~/venv virtualenv ~/venv-tripleodash; ~/venv-tripleodash/bin/pip install python-tripleodash; ~/tripleo-util/post-update.sh
Update the location of the post update
Update the location of the post update
Shell
bsd-2-clause
d0ugal/tripleo-util,d0ugal/tripleo-util
shell
## Code Before: set -eux set -o pipefail if [[ $USER != "stack" ]]; then echo "Must be run as stack user."; exit 1; fi sudo yum upgrade -y; sudo yum install -y ack vim libffi-devel libssl-devel openssl-devel python-devel; rm -rf ~/tripleo-ci git clone https://github.com/openstack-infra/tripleo-ci.git ~/tripleo-ci ~/tripleo-ci/scripts/tripleo.sh --repo-setup ~/tripleo-ci/scripts/tripleo.sh --undercloud ~/tripleo-ci/scripts/tripleo.sh --overcloud-images wget https://bootstrap.pypa.io/get-pip.py; sudo python get-pip.py; sudo pip install virtualenv git-review; git config --global user.email "dougal@redhat.com" git config --global user.name "Dougal Matthews" git config --global --add gitreview.username "dougal" git clone https://github.com/openstack/python-tripleoclient.git; git clone https://github.com/openstack/tripleo-common.git; git clone https://github.com/openstack/mistral.git; virtualenv ~/venv virtualenv ~/venv-tripleodash; ~/venv-tripleodash/bin/pip install python-tripleodash; ~/tripleo-util/undercloud/post-update.sh ## Instruction: Update the location of the post update ## Code After: set -eux set -o pipefail if [[ $USER != "stack" ]]; then echo "Must be run as stack user."; exit 1; fi sudo yum upgrade -y; sudo yum install -y ack vim libffi-devel libssl-devel openssl-devel python-devel; rm -rf ~/tripleo-ci git clone https://github.com/openstack-infra/tripleo-ci.git ~/tripleo-ci ~/tripleo-ci/scripts/tripleo.sh --repo-setup ~/tripleo-ci/scripts/tripleo.sh --undercloud ~/tripleo-ci/scripts/tripleo.sh --overcloud-images wget https://bootstrap.pypa.io/get-pip.py; sudo python get-pip.py; sudo pip install virtualenv git-review; git config --global user.email "dougal@redhat.com" git config --global user.name "Dougal Matthews" git config --global --add gitreview.username "dougal" git clone https://github.com/openstack/python-tripleoclient.git; git clone https://github.com/openstack/tripleo-common.git; git clone https://github.com/openstack/mistral.git; virtualenv ~/venv virtualenv ~/venv-tripleodash; ~/venv-tripleodash/bin/pip install python-tripleodash; ~/tripleo-util/post-update.sh
set -eux set -o pipefail if [[ $USER != "stack" ]]; then echo "Must be run as stack user."; exit 1; fi sudo yum upgrade -y; sudo yum install -y ack vim libffi-devel libssl-devel openssl-devel python-devel; rm -rf ~/tripleo-ci git clone https://github.com/openstack-infra/tripleo-ci.git ~/tripleo-ci ~/tripleo-ci/scripts/tripleo.sh --repo-setup ~/tripleo-ci/scripts/tripleo.sh --undercloud ~/tripleo-ci/scripts/tripleo.sh --overcloud-images wget https://bootstrap.pypa.io/get-pip.py; sudo python get-pip.py; sudo pip install virtualenv git-review; git config --global user.email "dougal@redhat.com" git config --global user.name "Dougal Matthews" git config --global --add gitreview.username "dougal" git clone https://github.com/openstack/python-tripleoclient.git; git clone https://github.com/openstack/tripleo-common.git; git clone https://github.com/openstack/mistral.git; virtualenv ~/venv virtualenv ~/venv-tripleodash; ~/venv-tripleodash/bin/pip install python-tripleodash; - ~/tripleo-util/undercloud/post-update.sh ? ----------- + ~/tripleo-util/post-update.sh
2
0.057143
1
1
d72e19200de282072fecc4393031104f4b96793f
src/index.js
src/index.js
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import App from './components/app'; import reducers from './redux/reducers'; ReactDOM.render( <Provider store={createStore(reducers)}> <App /> </Provider>, document.querySelector('.container') );
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { createStore, compose } from 'redux'; import App from './components/app'; import reducers from './redux/reducers'; const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; ReactDOM.render( <Provider store={createStore(reducers, composeEnhancers())}> <App /> </Provider>, document.querySelector('.container') );
Add redux dev tool support
Add redux dev tool support
JavaScript
mit
JPStrydom/Sudoku-AI,JPStrydom/Sudoku-AI
javascript
## Code Before: import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import App from './components/app'; import reducers from './redux/reducers'; ReactDOM.render( <Provider store={createStore(reducers)}> <App /> </Provider>, document.querySelector('.container') ); ## Instruction: Add redux dev tool support ## Code After: import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; import { createStore, compose } from 'redux'; import App from './components/app'; import reducers from './redux/reducers'; const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; ReactDOM.render( <Provider store={createStore(reducers, composeEnhancers())}> <App /> </Provider>, document.querySelector('.container') );
import React from 'react'; import ReactDOM from 'react-dom'; import { Provider } from 'react-redux'; - import { createStore } from 'redux'; + import { createStore, compose } from 'redux'; ? +++++++++ + import App from './components/app'; import reducers from './redux/reducers'; + + const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; + ReactDOM.render( - <Provider store={createStore(reducers)}> + <Provider store={createStore(reducers, composeEnhancers())}> ? ++++++++++++++++++++ <App /> </Provider>, document.querySelector('.container') );
8
0.571429
6
2
dc4be3b4e6ba136fd4d2283d997051a2400a089e
pakyow-core/lib/core/helpers.rb
pakyow-core/lib/core/helpers.rb
module Pakyow # Helpers available anywhere # # @api public module Helpers def context @context or raise NoContextError end def logger request.logger end def router RouteLookup.new end def request context ? context.request : nil end alias_method :req, :request def response context ? context.response : nil end alias_method :res, :response def params request ? request.params : {} end def session request ? request.session : {} end def cookies request ? request.cookies : {} end def config Pakyow::Config end # Returns the primary app environment. # # @api public def env config.env end # Helpers for Pakyow::App # # @api public module App; end # Helpers for Pakyow::CallContext # # @api public module Context; end end end
module Pakyow # Helpers available anywhere # # @api public module Helpers def context @context or raise NoContextError end def logger request.logger || Pakyow.logger end def router RouteLookup.new end def request context ? context.request : nil end alias_method :req, :request def response context ? context.response : nil end alias_method :res, :response def params request ? request.params : {} end def session request ? request.session : {} end def cookies request ? request.cookies : {} end def config Pakyow::Config end # Returns the primary app environment. # # @api public def env config.env end # Helpers for Pakyow::App # # @api public module App; end # Helpers for Pakyow::CallContext # # @api public module Context; end end end
Use Pakyow.logger if req.logger isn't available
Use Pakyow.logger if req.logger isn't available The logger won’t be available on the request if the logging middleware isn’t enabled.
Ruby
mit
jphager2/pakyow,karimmtarek/pakyow,karimmtarek/pakyow,karimmtarek/pakyow,jphager2/pakyow,jphager2/pakyow
ruby
## Code Before: module Pakyow # Helpers available anywhere # # @api public module Helpers def context @context or raise NoContextError end def logger request.logger end def router RouteLookup.new end def request context ? context.request : nil end alias_method :req, :request def response context ? context.response : nil end alias_method :res, :response def params request ? request.params : {} end def session request ? request.session : {} end def cookies request ? request.cookies : {} end def config Pakyow::Config end # Returns the primary app environment. # # @api public def env config.env end # Helpers for Pakyow::App # # @api public module App; end # Helpers for Pakyow::CallContext # # @api public module Context; end end end ## Instruction: Use Pakyow.logger if req.logger isn't available The logger won’t be available on the request if the logging middleware isn’t enabled. ## Code After: module Pakyow # Helpers available anywhere # # @api public module Helpers def context @context or raise NoContextError end def logger request.logger || Pakyow.logger end def router RouteLookup.new end def request context ? context.request : nil end alias_method :req, :request def response context ? context.response : nil end alias_method :res, :response def params request ? request.params : {} end def session request ? request.session : {} end def cookies request ? request.cookies : {} end def config Pakyow::Config end # Returns the primary app environment. # # @api public def env config.env end # Helpers for Pakyow::App # # @api public module App; end # Helpers for Pakyow::CallContext # # @api public module Context; end end end
module Pakyow # Helpers available anywhere # # @api public module Helpers def context @context or raise NoContextError end def logger - request.logger + request.logger || Pakyow.logger end def router RouteLookup.new end def request context ? context.request : nil end alias_method :req, :request def response context ? context.response : nil end alias_method :res, :response def params request ? request.params : {} end def session request ? request.session : {} end def cookies request ? request.cookies : {} end def config Pakyow::Config end # Returns the primary app environment. # # @api public def env config.env end # Helpers for Pakyow::App # # @api public module App; end # Helpers for Pakyow::CallContext # # @api public module Context; end end end
2
0.032787
1
1
c5dfcd45b1a9fa5aad8f9718d3784af45e88920d
plugins/bwana/README.md
plugins/bwana/README.md
This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/). To use it add bwana to the plugins array in your zshrc file. ```bash plugins=(... bwana) ``` ## Functions | Function | Description | | -------- | ---------------------------------------- | | `bwana` | Works just like `man` |
This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/). To use it add bwana to the plugins array in your zshrc file. ```bash plugins=(... bwana) ``` The `bwana` function opens the man page of the passed argument in the Bwana app. For example: `bwana ln` opens the man page for `ln` in Bwana.
Simplify explanation of bwana function
Simplify explanation of bwana function
Markdown
mit
tekniklr/oh-my-zsh,tekniklr/oh-my-zsh
markdown
## Code Before: This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/). To use it add bwana to the plugins array in your zshrc file. ```bash plugins=(... bwana) ``` ## Functions | Function | Description | | -------- | ---------------------------------------- | | `bwana` | Works just like `man` | ## Instruction: Simplify explanation of bwana function ## Code After: This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/). To use it add bwana to the plugins array in your zshrc file. ```bash plugins=(... bwana) ``` The `bwana` function opens the man page of the passed argument in the Bwana app. For example: `bwana ln` opens the man page for `ln` in Bwana.
This plugin provides a function to open `man` pages directly with [Bwana](https://www.bruji.com/bwana/). To use it add bwana to the plugins array in your zshrc file. ```bash plugins=(... bwana) ``` + The `bwana` function opens the man page of the passed argument in the Bwana app. + For example: `bwana ln` opens the man page for `ln` in Bwana. - ## Functions - - | Function | Description | - | -------- | ---------------------------------------- | - | `bwana` | Works just like `man` |
7
0.5
2
5
2ffd701a4ef3a86ee6168eea22d7c1c298b2bc1b
README.md
README.md
Boogie ====== Git Pulling LibGDX-based pretty Application launcher <a href="http://i.imgur.com/lq4dXtc.png"><img src="http://i.imgur.com/lq4dXtc.png" width="33%"></a><a href="http://i.imgur.com/0YomHoH.png"><img src="http://i.imgur.com/0YomHoH.png" width="33%"></a><a href="http://i.imgur.com/UfipTj6.png"><img src="http://i.imgur.com/UfipTj6.png" width="33%"</a><img src="http://i.imgur.com/4ka0vSR.png" width="99%">
Boogie ====== Git Pulling LibGDX-based pretty Application launcher. [Learn more from the Wiki](https://github.com/nhydock/Boogie/wiki) <a href="http://i.imgur.com/lq4dXtc.png"><img src="http://i.imgur.com/lq4dXtc.png" width="33%"></a><a href="http://i.imgur.com/0YomHoH.png"><img src="http://i.imgur.com/0YomHoH.png" width="33%"></a><a href="http://i.imgur.com/UfipTj6.png"><img src="http://i.imgur.com/UfipTj6.png" width="33%"</a><img src="http://i.imgur.com/4ka0vSR.png" width="99%">
Add link to wiki to purposely direct people
Add link to wiki to purposely direct people
Markdown
apache-2.0
nhydock/Boogie
markdown
## Code Before: Boogie ====== Git Pulling LibGDX-based pretty Application launcher <a href="http://i.imgur.com/lq4dXtc.png"><img src="http://i.imgur.com/lq4dXtc.png" width="33%"></a><a href="http://i.imgur.com/0YomHoH.png"><img src="http://i.imgur.com/0YomHoH.png" width="33%"></a><a href="http://i.imgur.com/UfipTj6.png"><img src="http://i.imgur.com/UfipTj6.png" width="33%"</a><img src="http://i.imgur.com/4ka0vSR.png" width="99%"> ## Instruction: Add link to wiki to purposely direct people ## Code After: Boogie ====== Git Pulling LibGDX-based pretty Application launcher. [Learn more from the Wiki](https://github.com/nhydock/Boogie/wiki) <a href="http://i.imgur.com/lq4dXtc.png"><img src="http://i.imgur.com/lq4dXtc.png" width="33%"></a><a href="http://i.imgur.com/0YomHoH.png"><img src="http://i.imgur.com/0YomHoH.png" width="33%"></a><a href="http://i.imgur.com/UfipTj6.png"><img src="http://i.imgur.com/UfipTj6.png" width="33%"</a><img src="http://i.imgur.com/4ka0vSR.png" width="99%">
Boogie ====== - Git Pulling LibGDX-based pretty Application launcher + Git Pulling LibGDX-based pretty Application launcher. [Learn more from the Wiki](https://github.com/nhydock/Boogie/wiki) <a href="http://i.imgur.com/lq4dXtc.png"><img src="http://i.imgur.com/lq4dXtc.png" width="33%"></a><a href="http://i.imgur.com/0YomHoH.png"><img src="http://i.imgur.com/0YomHoH.png" width="33%"></a><a href="http://i.imgur.com/UfipTj6.png"><img src="http://i.imgur.com/UfipTj6.png" width="33%"</a><img src="http://i.imgur.com/4ka0vSR.png" width="99%">
2
0.333333
1
1
2358f2ac14aa76ed8c8f54085e143fcbf3b99eb3
db/migrate/20140217140257_add_state_to_documents_and_photos.rb
db/migrate/20140217140257_add_state_to_documents_and_photos.rb
class AddStateToDocumentsAndPhotos < ActiveRecord::Migration def change add_column :documents, :state, :string, :default => 'initialized' add_column :photos, :state, :string, :default => 'initialized' end end
class AddStateToDocumentsAndPhotos < ActiveRecord::Migration def up add_column :documents, :state, :string, :default => 'initialized' add_column :photos, :state, :string, :default => 'initialized' # set proper state for photos and documents Document.update_all({state: 'uploaded'}, 'file IS NOT NULL') Document.update_all({state: 'saved'}, 'name IS NOT NULL AND description IS NOT NULL') Photo.update_all({state: 'uploaded'}, 'file IS NOT NULL') Photo.update_all({state: 'saved'}, 'author IS NOT NULL AND date_taken IS NOT NULL') end def down remove_column :documents, :state remove_column :photos, :state end end
Modify migration to set proper state for photos and documents
Modify migration to set proper state for photos and documents
Ruby
bsd-3-clause
netkodo/otwartezabytki,netkodo/otwartezabytki,netkodo/otwartezabytki,netkodo/otwartezabytki
ruby
## Code Before: class AddStateToDocumentsAndPhotos < ActiveRecord::Migration def change add_column :documents, :state, :string, :default => 'initialized' add_column :photos, :state, :string, :default => 'initialized' end end ## Instruction: Modify migration to set proper state for photos and documents ## Code After: class AddStateToDocumentsAndPhotos < ActiveRecord::Migration def up add_column :documents, :state, :string, :default => 'initialized' add_column :photos, :state, :string, :default => 'initialized' # set proper state for photos and documents Document.update_all({state: 'uploaded'}, 'file IS NOT NULL') Document.update_all({state: 'saved'}, 'name IS NOT NULL AND description IS NOT NULL') Photo.update_all({state: 'uploaded'}, 'file IS NOT NULL') Photo.update_all({state: 'saved'}, 'author IS NOT NULL AND date_taken IS NOT NULL') end def down remove_column :documents, :state remove_column :photos, :state end end
class AddStateToDocumentsAndPhotos < ActiveRecord::Migration - def change + def up add_column :documents, :state, :string, :default => 'initialized' add_column :photos, :state, :string, :default => 'initialized' + + # set proper state for photos and documents + Document.update_all({state: 'uploaded'}, 'file IS NOT NULL') + Document.update_all({state: 'saved'}, 'name IS NOT NULL AND description IS NOT NULL') + + Photo.update_all({state: 'uploaded'}, 'file IS NOT NULL') + Photo.update_all({state: 'saved'}, 'author IS NOT NULL AND date_taken IS NOT NULL') + end + + def down + remove_column :documents, :state + remove_column :photos, :state end end
14
2.333333
13
1
69e3ea7dcd550462519a9db472b8f6b96de9e9ac
db/migrate/20151014161021_sets_visual_checks_for_pico.rb
db/migrate/20151014161021_sets_visual_checks_for_pico.rb
class SetsVisualChecksForPico < ActiveRecord::Migration def self.up ActiveRecord::Base.transaction do [*InstrumentProcess.find_by_name("Pico dilution")].each do |ip| ip.update_attributes({ :visual_check_required => true }) end [*InstrumentProcess.find_by_name("Pico assay plate creation")].each do |ip| ip.update_attributes({ :visual_check_required => true }) end end end def self.down ActiveRecord::Base.transaction do end end end
class SetsVisualChecksForPico < ActiveRecord::Migration def self.up ActiveRecord::Base.transaction do [*InstrumentProcess.find_by_key("slf_pico_dilution")].each do |ip| ip.update_attributes({ :visual_check_required => true }) end [*InstrumentProcess.find_by_key("slf_pico_assay_plates")].each do |ip| ip.update_attributes({ :visual_check_required => true }) end end end def self.down ActiveRecord::Base.transaction do end end end
Update by key, instead of name, that is not compatible between environments (uat,nr,prod,...)
Update by key, instead of name, that is not compatible between environments (uat,nr,prod,...)
Ruby
mit
JamesGlover/asset_audits,JamesGlover/asset_audits,emrojo/asset_audits,sanger/asset_audits,JamesGlover/asset_audits,emrojo/asset_audits,JamesGlover/asset_audits,emrojo/asset_audits,sanger/asset_audits,sanger/asset_audits,sanger/asset_audits,emrojo/asset_audits
ruby
## Code Before: class SetsVisualChecksForPico < ActiveRecord::Migration def self.up ActiveRecord::Base.transaction do [*InstrumentProcess.find_by_name("Pico dilution")].each do |ip| ip.update_attributes({ :visual_check_required => true }) end [*InstrumentProcess.find_by_name("Pico assay plate creation")].each do |ip| ip.update_attributes({ :visual_check_required => true }) end end end def self.down ActiveRecord::Base.transaction do end end end ## Instruction: Update by key, instead of name, that is not compatible between environments (uat,nr,prod,...) ## Code After: class SetsVisualChecksForPico < ActiveRecord::Migration def self.up ActiveRecord::Base.transaction do [*InstrumentProcess.find_by_key("slf_pico_dilution")].each do |ip| ip.update_attributes({ :visual_check_required => true }) end [*InstrumentProcess.find_by_key("slf_pico_assay_plates")].each do |ip| ip.update_attributes({ :visual_check_required => true }) end end end def self.down ActiveRecord::Base.transaction do end end end
class SetsVisualChecksForPico < ActiveRecord::Migration def self.up ActiveRecord::Base.transaction do - [*InstrumentProcess.find_by_name("Pico dilution")].each do |ip| ? ^^^ ^ ^ + [*InstrumentProcess.find_by_key("slf_pico_dilution")].each do |ip| ? ^ + ^^^^^ ^ ip.update_attributes({ :visual_check_required => true }) end - [*InstrumentProcess.find_by_name("Pico assay plate creation")].each do |ip| ? ^^^ ^ ^ ^ ^^^^^^^^^ + [*InstrumentProcess.find_by_key("slf_pico_assay_plates")].each do |ip| ? ^ + ^^^^^ ^ ^ ^ ip.update_attributes({ :visual_check_required => true }) end end end def self.down ActiveRecord::Base.transaction do end end end
4
0.190476
2
2
cb74629334b4e6dadd3dec9b1a2e2fb5dddc9144
res/raw/general_info.json
res/raw/general_info.json
{ "Opening hours": "<p>The festival site is accessible like this.</p>", "First aid": "<p>Where to go if help if you need a medic.</p>", "Infostand": "<p>Where you can find the infostand</p>", "Tickets": "<h2>Ticket prices</h2><p><strong>Premium ticket price</strong> <br /><strong>Economy ticket price<br /><strong>", "Lost and found": "<p>Lost and found location and description.</p>", "Accessibility": "<p>Accessibility details, such as how to go about if you have a wheelchair, etc.</p>" }
{ "Opening hours": "<p>The festival site is accessible like this.</p>", "First aid": "<p>Where to go if help if you need a medic.</p>", "Info stand": "<p>Where you can find the infostand</p>", "Ticket sales": "<h2>Test prices</h2><p><strong>Premium test price</strong> <br /><strong>Economy ticket price<br /><strong>", "Lost and found": "<p>Lost and found location and description.</p>", "Accessibility": "<p>Accessibility details, such as how to go about if you have a wheelchair, etc.</p>", "Safety instructions": "<p>Stay safe.</p>" }
Fix missing content in Info view
Fix missing content in Info view Because the contents of general_info.json is stored in the database, a reinstall or upgrade is required to update database entries. Fixes issue #44.
JSON
mit
futurice/festapp-android
json
## Code Before: { "Opening hours": "<p>The festival site is accessible like this.</p>", "First aid": "<p>Where to go if help if you need a medic.</p>", "Infostand": "<p>Where you can find the infostand</p>", "Tickets": "<h2>Ticket prices</h2><p><strong>Premium ticket price</strong> <br /><strong>Economy ticket price<br /><strong>", "Lost and found": "<p>Lost and found location and description.</p>", "Accessibility": "<p>Accessibility details, such as how to go about if you have a wheelchair, etc.</p>" } ## Instruction: Fix missing content in Info view Because the contents of general_info.json is stored in the database, a reinstall or upgrade is required to update database entries. Fixes issue #44. ## Code After: { "Opening hours": "<p>The festival site is accessible like this.</p>", "First aid": "<p>Where to go if help if you need a medic.</p>", "Info stand": "<p>Where you can find the infostand</p>", "Ticket sales": "<h2>Test prices</h2><p><strong>Premium test price</strong> <br /><strong>Economy ticket price<br /><strong>", "Lost and found": "<p>Lost and found location and description.</p>", "Accessibility": "<p>Accessibility details, such as how to go about if you have a wheelchair, etc.</p>", "Safety instructions": "<p>Stay safe.</p>" }
{ "Opening hours": "<p>The festival site is accessible like this.</p>", "First aid": "<p>Where to go if help if you need a medic.</p>", - "Infostand": "<p>Where you can find the infostand</p>", + "Info stand": "<p>Where you can find the infostand</p>", ? + - "Tickets": "<h2>Ticket prices</h2><p><strong>Premium ticket price</strong> <br /><strong>Economy ticket price<br /><strong>", ? --- --- + "Ticket sales": "<h2>Test prices</h2><p><strong>Premium test price</strong> <br /><strong>Economy ticket price<br /><strong>", ? +++++ + + "Lost and found": "<p>Lost and found location and description.</p>", - "Accessibility": "<p>Accessibility details, such as how to go about if you have a wheelchair, etc.</p>" + "Accessibility": "<p>Accessibility details, such as how to go about if you have a wheelchair, etc.</p>", ? + + "Safety instructions": "<p>Stay safe.</p>" }
7
0.875
4
3
642b131817043af4a378340bb2ae4949c9e45865
src/SfVlc/MainBundle/Mailer/Mailer.php
src/SfVlc/MainBundle/Mailer/Mailer.php
<?php namespace SfVlc\MainBundle\Mailer; use SfVlc\MainBundle\Form\Model\Contact; use SfVlc\MainBundle\Mailer\ContactConfigurationInterface; class Mailer { protected $mailer; protected $settings; function __construct($mailer, ContactConfigurationInterface $settings) { $this->mailer = $mailer; $this->settings = $settings; } public function sendContactEmail(Contact $contact) { $message = \Swift_Message::newInstance() ->setSubject($this->settings->getSubject()) ->setFrom($contact->email) ->setTo($this->settings->getTo()) ->setBody($contact->name . ' ' . $contact->message) ; $this->mailer->send($message); } }
<?php namespace SfVlc\MainBundle\Mailer; use SfVlc\MainBundle\Form\Model\Contact; use SfVlc\MainBundle\Mailer\ContactConfigurationInterface; class Mailer { protected $mailer; protected $settings; function __construct(\Swift_Mailer $mailer, ContactConfigurationInterface $settings) { $this->mailer = $mailer; $this->settings = $settings; } public function sendContactEmail(Contact $contact) { $message = \Swift_Message::newInstance() ->setSubject($this->settings->getSubject()) ->setFrom($contact->email) ->setTo($this->settings->getTo()) ->setBody($contact->name . ' ' . $contact->message) ; $this->mailer->send($message); } }
Add type of mailer in contructor
Add type of mailer in contructor
PHP
mit
symfonyvlc/symfonyvalencia
php
## Code Before: <?php namespace SfVlc\MainBundle\Mailer; use SfVlc\MainBundle\Form\Model\Contact; use SfVlc\MainBundle\Mailer\ContactConfigurationInterface; class Mailer { protected $mailer; protected $settings; function __construct($mailer, ContactConfigurationInterface $settings) { $this->mailer = $mailer; $this->settings = $settings; } public function sendContactEmail(Contact $contact) { $message = \Swift_Message::newInstance() ->setSubject($this->settings->getSubject()) ->setFrom($contact->email) ->setTo($this->settings->getTo()) ->setBody($contact->name . ' ' . $contact->message) ; $this->mailer->send($message); } } ## Instruction: Add type of mailer in contructor ## Code After: <?php namespace SfVlc\MainBundle\Mailer; use SfVlc\MainBundle\Form\Model\Contact; use SfVlc\MainBundle\Mailer\ContactConfigurationInterface; class Mailer { protected $mailer; protected $settings; function __construct(\Swift_Mailer $mailer, ContactConfigurationInterface $settings) { $this->mailer = $mailer; $this->settings = $settings; } public function sendContactEmail(Contact $contact) { $message = \Swift_Message::newInstance() ->setSubject($this->settings->getSubject()) ->setFrom($contact->email) ->setTo($this->settings->getTo()) ->setBody($contact->name . ' ' . $contact->message) ; $this->mailer->send($message); } }
<?php namespace SfVlc\MainBundle\Mailer; use SfVlc\MainBundle\Form\Model\Contact; use SfVlc\MainBundle\Mailer\ContactConfigurationInterface; class Mailer { protected $mailer; protected $settings; - function __construct($mailer, ContactConfigurationInterface $settings) + function __construct(\Swift_Mailer $mailer, ContactConfigurationInterface $settings) ? ++++++++++++++ { $this->mailer = $mailer; $this->settings = $settings; } public function sendContactEmail(Contact $contact) { $message = \Swift_Message::newInstance() ->setSubject($this->settings->getSubject()) ->setFrom($contact->email) ->setTo($this->settings->getTo()) ->setBody($contact->name . ' ' . $contact->message) ; $this->mailer->send($message); } }
2
0.066667
1
1
f503d0a877821e37c7b3d5bf6527bc327da69737
src/CMakeLists.txt
src/CMakeLists.txt
set(SOURCES main.cpp Font.cpp maxRectsBinPack/MaxRectsBinPack.cpp sdlSavePng/savepng.c tinyxml2/tinyxml2.cpp ConfigFile.cpp CharList.cpp ) if(MINGW) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") FIND_LIBRARY(SDL2MAIN_LIBRARY NAMES SDL2main) SET(SDL2PP_LIBRARIES ${MINGW32_LIBRARY} ${SDL2MAIN_LIBRARY} ${SDL2PP_LIBRARIES}) endif(MINGW) add_executable(fontbm ${SOURCES}) target_link_libraries(fontbm ${PNG_LIBRARIES} ${SDL2PP_LIBRARIES} ${Boost_LIBRARIES})
set(SOURCES main.cpp Font.cpp maxRectsBinPack/MaxRectsBinPack.cpp sdlSavePng/savepng.c tinyxml2/tinyxml2.cpp ConfigFile.cpp CharList.cpp ) if(MINGW) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") FIND_LIBRARY(SDL2MAIN_LIBRARY NAMES SDL2main) SET(SDL2PP_LIBRARIES ${MINGW32_LIBRARY} ${SDL2MAIN_LIBRARY} ${SDL2PP_LIBRARIES}) endif(MINGW) if(MSVC) FIND_LIBRARY(SDL2MAIN_LIBRARY NAMES SDL2main) SET(SDL2PP_LIBRARIES ${SDL2MAIN_LIBRARY} ${SDL2PP_LIBRARIES}) endif(MSVC) add_executable(fontbm ${SOURCES}) target_link_libraries(fontbm ${PNG_LIBRARIES} ${SDL2PP_LIBRARIES} ${Boost_LIBRARIES})
Add SDL2main lib to link
Add SDL2main lib to link
Text
mit
vladimirgamalian/fontbm,vladimirgamalian/fontbm,vladimirgamalian/fontbm
text
## Code Before: set(SOURCES main.cpp Font.cpp maxRectsBinPack/MaxRectsBinPack.cpp sdlSavePng/savepng.c tinyxml2/tinyxml2.cpp ConfigFile.cpp CharList.cpp ) if(MINGW) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") FIND_LIBRARY(SDL2MAIN_LIBRARY NAMES SDL2main) SET(SDL2PP_LIBRARIES ${MINGW32_LIBRARY} ${SDL2MAIN_LIBRARY} ${SDL2PP_LIBRARIES}) endif(MINGW) add_executable(fontbm ${SOURCES}) target_link_libraries(fontbm ${PNG_LIBRARIES} ${SDL2PP_LIBRARIES} ${Boost_LIBRARIES}) ## Instruction: Add SDL2main lib to link ## Code After: set(SOURCES main.cpp Font.cpp maxRectsBinPack/MaxRectsBinPack.cpp sdlSavePng/savepng.c tinyxml2/tinyxml2.cpp ConfigFile.cpp CharList.cpp ) if(MINGW) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") FIND_LIBRARY(SDL2MAIN_LIBRARY NAMES SDL2main) SET(SDL2PP_LIBRARIES ${MINGW32_LIBRARY} ${SDL2MAIN_LIBRARY} ${SDL2PP_LIBRARIES}) endif(MINGW) if(MSVC) FIND_LIBRARY(SDL2MAIN_LIBRARY NAMES SDL2main) SET(SDL2PP_LIBRARIES ${SDL2MAIN_LIBRARY} ${SDL2PP_LIBRARIES}) endif(MSVC) add_executable(fontbm ${SOURCES}) target_link_libraries(fontbm ${PNG_LIBRARIES} ${SDL2PP_LIBRARIES} ${Boost_LIBRARIES})
set(SOURCES main.cpp Font.cpp maxRectsBinPack/MaxRectsBinPack.cpp sdlSavePng/savepng.c tinyxml2/tinyxml2.cpp ConfigFile.cpp CharList.cpp ) if(MINGW) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") FIND_LIBRARY(SDL2MAIN_LIBRARY NAMES SDL2main) SET(SDL2PP_LIBRARIES ${MINGW32_LIBRARY} ${SDL2MAIN_LIBRARY} ${SDL2PP_LIBRARIES}) endif(MINGW) + if(MSVC) + FIND_LIBRARY(SDL2MAIN_LIBRARY NAMES SDL2main) + SET(SDL2PP_LIBRARIES ${SDL2MAIN_LIBRARY} ${SDL2PP_LIBRARIES}) + endif(MSVC) + add_executable(fontbm ${SOURCES}) target_link_libraries(fontbm ${PNG_LIBRARIES} ${SDL2PP_LIBRARIES} ${Boost_LIBRARIES})
5
0.263158
5
0
61be745b641689addc9f009311d28a5775d5a18b
ctconfig.py
ctconfig.py
import logging import json from tornado.options import define, options _CONFIG_FILENAME = "cutthroat.conf" def define_options(): """Define defaults for most custom options""" # Log file and config file paths options.log_file_prefix = "/var/log/cutthroat/cutthroat.log" define( "conf_file_path", default="/etc/cutthroat/{}".format(_CONFIG_FILENAME), help="Path for the JSON configuration file with customized options", type="str" ) # Port define( "port", default=8888, help="run on the given port", type=int ) # Database options define( "sqlite_db", default="cutthroat.db" ) # Options for testing define( "output_routes", default=False, type=bool, help="If enabled, outputs all application routes to `routes.json`" )
import logging import json from tornado.options import define, options _CONFIG_FILENAME = "cutthroat.conf" def define_options(): """Define defaults for most custom options""" # Log file and config file paths options.log_file_prefix = "/var/log/cutthroat/cutthroat.log" define( "conf_file_path", default="/etc/cutthroat/{}".format(_CONFIG_FILENAME), help="Path for the JSON configuration file with customized options", type="str" ) # Port define( "port", default=8888, help="run on the given port", type=int ) # Database options define( "sqlite_db", default="cutthroat.db" ) define( "output_routes", default=True, type=bool, help="If enabled, outputs all application routes to `routes.json`" )
Set `output_routes` to True by default
Set `output_routes` to True by default
Python
agpl-3.0
hfaran/LivesPool,hfaran/LivesPool,hfaran/LivesPool,hfaran/LivesPool
python
## Code Before: import logging import json from tornado.options import define, options _CONFIG_FILENAME = "cutthroat.conf" def define_options(): """Define defaults for most custom options""" # Log file and config file paths options.log_file_prefix = "/var/log/cutthroat/cutthroat.log" define( "conf_file_path", default="/etc/cutthroat/{}".format(_CONFIG_FILENAME), help="Path for the JSON configuration file with customized options", type="str" ) # Port define( "port", default=8888, help="run on the given port", type=int ) # Database options define( "sqlite_db", default="cutthroat.db" ) # Options for testing define( "output_routes", default=False, type=bool, help="If enabled, outputs all application routes to `routes.json`" ) ## Instruction: Set `output_routes` to True by default ## Code After: import logging import json from tornado.options import define, options _CONFIG_FILENAME = "cutthroat.conf" def define_options(): """Define defaults for most custom options""" # Log file and config file paths options.log_file_prefix = "/var/log/cutthroat/cutthroat.log" define( "conf_file_path", default="/etc/cutthroat/{}".format(_CONFIG_FILENAME), help="Path for the JSON configuration file with customized options", type="str" ) # Port define( "port", default=8888, help="run on the given port", type=int ) # Database options define( "sqlite_db", default="cutthroat.db" ) define( "output_routes", default=True, type=bool, help="If enabled, outputs all application routes to `routes.json`" )
import logging import json from tornado.options import define, options _CONFIG_FILENAME = "cutthroat.conf" def define_options(): """Define defaults for most custom options""" # Log file and config file paths options.log_file_prefix = "/var/log/cutthroat/cutthroat.log" define( "conf_file_path", default="/etc/cutthroat/{}".format(_CONFIG_FILENAME), help="Path for the JSON configuration file with customized options", type="str" ) # Port define( "port", default=8888, help="run on the given port", type=int ) # Database options define( "sqlite_db", default="cutthroat.db" ) - # Options for testing define( "output_routes", - default=False, ? ^^^^ + default=True, ? ^^^ type=bool, help="If enabled, outputs all application routes to `routes.json`" )
3
0.075
1
2
e24a9da1b580f24ea7bbf373e8bdb832cafc26d0
src/allejo/stakx/app/services.yml
src/allejo/stakx/app/services.yml
services: _defaults: autowire: true autoconfigure: true public: true allejo\stakx\Manager\: resource: '../Manager/*' calls: - { method: 'setLogger', arguments: ['@logger'] } allejo\stakx\Manager\ThemeManager: arguments: - null output: class: Symfony\Component\Console\Output\ConsoleOutput logger: class: allejo\stakx\Core\StakxLogger arguments: - '@output'
services: _defaults: autowire: true autoconfigure: true public: true allejo\stakx\Manager\: resource: '../Manager/*' calls: - { method: 'setLogger', arguments: ['@logger'] } - { method: 'setContainer', arguments: ['@service_container'] } allejo\stakx\Manager\ThemeManager: arguments: - null output: class: Symfony\Component\Console\Output\ConsoleOutput logger: class: allejo\stakx\Core\StakxLogger arguments: - '@output'
Add container to manager classes
Add container to manager classes
YAML
mit
stakx-io/stakx,allejo/stakx,allejo/stakx,stakx-io/stakx
yaml
## Code Before: services: _defaults: autowire: true autoconfigure: true public: true allejo\stakx\Manager\: resource: '../Manager/*' calls: - { method: 'setLogger', arguments: ['@logger'] } allejo\stakx\Manager\ThemeManager: arguments: - null output: class: Symfony\Component\Console\Output\ConsoleOutput logger: class: allejo\stakx\Core\StakxLogger arguments: - '@output' ## Instruction: Add container to manager classes ## Code After: services: _defaults: autowire: true autoconfigure: true public: true allejo\stakx\Manager\: resource: '../Manager/*' calls: - { method: 'setLogger', arguments: ['@logger'] } - { method: 'setContainer', arguments: ['@service_container'] } allejo\stakx\Manager\ThemeManager: arguments: - null output: class: Symfony\Component\Console\Output\ConsoleOutput logger: class: allejo\stakx\Core\StakxLogger arguments: - '@output'
services: _defaults: autowire: true autoconfigure: true public: true allejo\stakx\Manager\: resource: '../Manager/*' calls: - { method: 'setLogger', arguments: ['@logger'] } + - { method: 'setContainer', arguments: ['@service_container'] } allejo\stakx\Manager\ThemeManager: arguments: - null output: class: Symfony\Component\Console\Output\ConsoleOutput logger: class: allejo\stakx\Core\StakxLogger arguments: - '@output'
1
0.045455
1
0
b022636e2ba92ba24c738759bbfc1afd408f8a5b
docs/index.markdown
docs/index.markdown
--- layout: docs title: Quarks Documentation description: Documentation project for Quarks --- # Quarks Documentation Documentation for Quarks Project # Table of Content {% include nav.html context="/docs/"%} # New Documentation To request new documentation, please open an issue here: <form action="{{site.docsurl}}/issues/new" target="_blank"> <input type="submit" value="New Documentation"> </form> <br> # Providing Feedback To provide feedback on our documentation: 1. Navigate to the documentation page for which you are providing feedback. 1. Click on the **Feedback** button in the top right corner. This will open an issue for the page that you are currently visiting. # Contributing If you have ideas on how we can better document or explain some of the concepts, we would love to have your contribution! The quarks.documentation site uses Github's flavor of Markdown and Jekyll markdown for our documentation. Refer to this documentation on Github's flavor of Markdown: [Writing on Github](https://help.github.com/categories/writing-on-github) Refer to this documentation to get started: [Using Jekyll with Pages](https://help.github.com/articles/using-jekyll-with-pages/) To contribute, clone this project locally, make your changes, and create a [pull request](https://github.com/quarks-edge/quarks/pulls). To learn more, visit [Get Involved](docs/quarks/getinvolved)
--- layout: docs title: Quarks Documentation description: Documentation project for Quarks --- # Quarks Documentation Documentation for Quarks Project # Table of Contents {% include nav.html context="/docs/"%} # New Documentation Quarks is evolving, and so is the documentation. If the existing documentation hasn't answered your questions, you can request new or updated documentation by opening an issue. Click on "New Documentation" to open an issue: <form action="{{site.docsurl}}/issues/new" target="_blank"> <input type="submit" value="New Documentation"> </form> <br> # Providing Feedback To provide feedback on our documentation: 1. Navigate to the documentation page for which you are providing feedback. 1. Click on the **Feedback** button in the top right corner. This will open an issue for the page that you are currently visiting. # Contributing Documentation If you have ideas on how we can better document or explain some of the concepts, we would love to have your contribution! The quarks.documentation site uses Github's flavor of Markdown and Jekyll markdown for our documentation. Refer to this documentation on Github's flavor of Markdown: [Writing on Github](https://help.github.com/categories/writing-on-github) Refer to this documentation to get started: [Using Jekyll with Pages](https://help.github.com/articles/using-jekyll-with-pages/) To contribute, clone this project locally, make your changes, and create a [pull request](https://github.com/quarks-edge/quarks/pulls). To learn more, visit [Get Involved](docs/quarks/getinvolved)
Enhance New Documentation section to ensure that the purpose is clear.
Enhance New Documentation section to ensure that the purpose is clear.
Markdown
apache-2.0
quarks-edge/quarks.documentation,quarks-edge/quarks.documentation,quarks-edge/quarks.documentation,quarks-edge/quarks.documentation
markdown
## Code Before: --- layout: docs title: Quarks Documentation description: Documentation project for Quarks --- # Quarks Documentation Documentation for Quarks Project # Table of Content {% include nav.html context="/docs/"%} # New Documentation To request new documentation, please open an issue here: <form action="{{site.docsurl}}/issues/new" target="_blank"> <input type="submit" value="New Documentation"> </form> <br> # Providing Feedback To provide feedback on our documentation: 1. Navigate to the documentation page for which you are providing feedback. 1. Click on the **Feedback** button in the top right corner. This will open an issue for the page that you are currently visiting. # Contributing If you have ideas on how we can better document or explain some of the concepts, we would love to have your contribution! The quarks.documentation site uses Github's flavor of Markdown and Jekyll markdown for our documentation. Refer to this documentation on Github's flavor of Markdown: [Writing on Github](https://help.github.com/categories/writing-on-github) Refer to this documentation to get started: [Using Jekyll with Pages](https://help.github.com/articles/using-jekyll-with-pages/) To contribute, clone this project locally, make your changes, and create a [pull request](https://github.com/quarks-edge/quarks/pulls). To learn more, visit [Get Involved](docs/quarks/getinvolved) ## Instruction: Enhance New Documentation section to ensure that the purpose is clear. ## Code After: --- layout: docs title: Quarks Documentation description: Documentation project for Quarks --- # Quarks Documentation Documentation for Quarks Project # Table of Contents {% include nav.html context="/docs/"%} # New Documentation Quarks is evolving, and so is the documentation. If the existing documentation hasn't answered your questions, you can request new or updated documentation by opening an issue. Click on "New Documentation" to open an issue: <form action="{{site.docsurl}}/issues/new" target="_blank"> <input type="submit" value="New Documentation"> </form> <br> # Providing Feedback To provide feedback on our documentation: 1. Navigate to the documentation page for which you are providing feedback. 1. Click on the **Feedback** button in the top right corner. This will open an issue for the page that you are currently visiting. # Contributing Documentation If you have ideas on how we can better document or explain some of the concepts, we would love to have your contribution! The quarks.documentation site uses Github's flavor of Markdown and Jekyll markdown for our documentation. Refer to this documentation on Github's flavor of Markdown: [Writing on Github](https://help.github.com/categories/writing-on-github) Refer to this documentation to get started: [Using Jekyll with Pages](https://help.github.com/articles/using-jekyll-with-pages/) To contribute, clone this project locally, make your changes, and create a [pull request](https://github.com/quarks-edge/quarks/pulls). To learn more, visit [Get Involved](docs/quarks/getinvolved)
--- layout: docs title: Quarks Documentation description: Documentation project for Quarks --- # Quarks Documentation - Documentation for Quarks Project - # Table of Content + # Table of Contents ? + {% include nav.html context="/docs/"%} # New Documentation + Quarks is evolving, and so is the documentation. If the existing documentation hasn't answered your questions, you can request new or updated documentation by opening an issue. - To request new documentation, please open an issue here: + Click on "New Documentation" to open an issue: <form action="{{site.docsurl}}/issues/new" target="_blank"> <input type="submit" value="New Documentation"> </form> <br> # Providing Feedback To provide feedback on our documentation: 1. Navigate to the documentation page for which you are providing feedback. 1. Click on the **Feedback** button in the top right corner. This will open an issue for the page that you are currently visiting. - # Contributing + # Contributing Documentation If you have ideas on how we can better document or explain some of the concepts, we would love to have your contribution! The quarks.documentation site uses Github's flavor of Markdown and Jekyll markdown for our documentation. Refer to this documentation on Github's flavor of Markdown: [Writing on Github](https://help.github.com/categories/writing-on-github) Refer to this documentation to get started: [Using Jekyll with Pages](https://help.github.com/articles/using-jekyll-with-pages/) To contribute, clone this project locally, make your changes, and create a [pull request](https://github.com/quarks-edge/quarks/pulls). To learn more, visit [Get Involved](docs/quarks/getinvolved)
8
0.190476
4
4
e746218ba8915ee395e178e7e30dcbbdda4dfc50
types/react-router/test/WithRouter.tsx
types/react-router/test/WithRouter.tsx
import * as React from 'react'; import { withRouter, RouteComponentProps } from 'react-router-dom'; interface TOwnProps extends RouteComponentProps { username: string; } const ComponentFunction = (props: TOwnProps) => ( <h2>Welcome {props.username}</h2> ); class ComponentClass extends React.Component<TOwnProps> { render() { return <h2>Welcome {this.props.username}</h2>; } } const WithRouterComponentFunction = withRouter(ComponentFunction); const WithRouterComponentClass = withRouter(ComponentClass); const WithRouterTestFunction = () => ( <WithRouterComponentFunction username="John" /> ); const WithRouterTestClass = () => <WithRouterComponentClass username="John" />;
import * as React from 'react'; import { withRouter, RouteComponentProps } from 'react-router-dom'; interface TOwnProps extends RouteComponentProps { username: string; } const ComponentFunction = (props: TOwnProps) => ( <h2>Welcome {props.username}</h2> ); class ComponentClass extends React.Component<TOwnProps> { render() { return <h2>Welcome {this.props.username}</h2>; } } const WithRouterComponentFunction = withRouter(ComponentFunction); const WithRouterComponentClass = withRouter(ComponentClass); const WithRouterTestFunction = () => ( <WithRouterComponentFunction username="John" /> ); const WithRouterTestClass = () => <WithRouterComponentClass username="John" />; // union props { interface Book { kind: 'book'; author: string; } interface Magazine { kind: 'magazine'; issue: number; } type SomethingToRead = (Book | Magazine) & RouteComponentProps; const Readable: React.SFC<SomethingToRead> = props => { if (props.kind === 'magazine') { return <div>magazine #{props.issue}</div>; } return <div>magazine #{props.author}</div>; }; const RoutedReadable = withRouter(Readable); <RoutedReadable kind="book" author="Hejlsberg" />; <RoutedReadable kind="magazine" author="Hejlsberg" />; // $ExpectError }
Add failing test for union props
[react-router] Add failing test for union props
TypeScript
mit
georgemarshall/DefinitelyTyped,georgemarshall/DefinitelyTyped,georgemarshall/DefinitelyTyped,georgemarshall/DefinitelyTyped,borisyankov/DefinitelyTyped,dsebastien/DefinitelyTyped,markogresak/DefinitelyTyped,dsebastien/DefinitelyTyped,borisyankov/DefinitelyTyped,mcliment/DefinitelyTyped
typescript
## Code Before: import * as React from 'react'; import { withRouter, RouteComponentProps } from 'react-router-dom'; interface TOwnProps extends RouteComponentProps { username: string; } const ComponentFunction = (props: TOwnProps) => ( <h2>Welcome {props.username}</h2> ); class ComponentClass extends React.Component<TOwnProps> { render() { return <h2>Welcome {this.props.username}</h2>; } } const WithRouterComponentFunction = withRouter(ComponentFunction); const WithRouterComponentClass = withRouter(ComponentClass); const WithRouterTestFunction = () => ( <WithRouterComponentFunction username="John" /> ); const WithRouterTestClass = () => <WithRouterComponentClass username="John" />; ## Instruction: [react-router] Add failing test for union props ## Code After: import * as React from 'react'; import { withRouter, RouteComponentProps } from 'react-router-dom'; interface TOwnProps extends RouteComponentProps { username: string; } const ComponentFunction = (props: TOwnProps) => ( <h2>Welcome {props.username}</h2> ); class ComponentClass extends React.Component<TOwnProps> { render() { return <h2>Welcome {this.props.username}</h2>; } } const WithRouterComponentFunction = withRouter(ComponentFunction); const WithRouterComponentClass = withRouter(ComponentClass); const WithRouterTestFunction = () => ( <WithRouterComponentFunction username="John" /> ); const WithRouterTestClass = () => <WithRouterComponentClass username="John" />; // union props { interface Book { kind: 'book'; author: string; } interface Magazine { kind: 'magazine'; issue: number; } type SomethingToRead = (Book | Magazine) & RouteComponentProps; const Readable: React.SFC<SomethingToRead> = props => { if (props.kind === 'magazine') { return <div>magazine #{props.issue}</div>; } return <div>magazine #{props.author}</div>; }; const RoutedReadable = withRouter(Readable); <RoutedReadable kind="book" author="Hejlsberg" />; <RoutedReadable kind="magazine" author="Hejlsberg" />; // $ExpectError }
import * as React from 'react'; import { withRouter, RouteComponentProps } from 'react-router-dom'; interface TOwnProps extends RouteComponentProps { username: string; } const ComponentFunction = (props: TOwnProps) => ( <h2>Welcome {props.username}</h2> ); class ComponentClass extends React.Component<TOwnProps> { render() { return <h2>Welcome {this.props.username}</h2>; } } const WithRouterComponentFunction = withRouter(ComponentFunction); const WithRouterComponentClass = withRouter(ComponentClass); const WithRouterTestFunction = () => ( <WithRouterComponentFunction username="John" /> ); const WithRouterTestClass = () => <WithRouterComponentClass username="John" />; + + // union props + { + interface Book { + kind: 'book'; + author: string; + } + + interface Magazine { + kind: 'magazine'; + issue: number; + } + + type SomethingToRead = (Book | Magazine) & RouteComponentProps; + + const Readable: React.SFC<SomethingToRead> = props => { + if (props.kind === 'magazine') { + return <div>magazine #{props.issue}</div>; + } + + return <div>magazine #{props.author}</div>; + }; + + const RoutedReadable = withRouter(Readable); + + <RoutedReadable kind="book" author="Hejlsberg" />; + <RoutedReadable kind="magazine" author="Hejlsberg" />; // $ExpectError + }
28
1.166667
28
0
526c25828ba712b0f25cf3d069d9d56fe568cbf3
docs/docs/dev/virtlet-ci.md
docs/docs/dev/virtlet-ci.md
The details of CircleCI setup Using CircleCI with your fork of Virtlet
Virtlet uses [CircleCI](https://circleci.com/) for building binaries, docker images and running the tests. The CI configuration resides in [.circleci/config.yml](https://github.com/Mirantis/virtlet/blob/master/.circleci/config.yml) file. You can sign into CircleCI, and make it run tests for your own fork of Virtlet by connecting it to your [GitHub](https://github.com/) account. There are some conventions about branch naming that are respected by CircleCI. Namely, branches with names ending with `-net` will be checked with extra e2e jobs that examine Weave, Flannel and multi-CNI based network setups. For branches with names ending with `-docs` only documentation will be built. Also, you can append `[ci skip]` to your commit message to have CI skip the particular commit/PR altogether.
Add proper Virtlet CI docs
Add proper Virtlet CI docs
Markdown
apache-2.0
Mirantis/virtlet,Mirantis/virtlet
markdown
## Code Before: The details of CircleCI setup Using CircleCI with your fork of Virtlet ## Instruction: Add proper Virtlet CI docs ## Code After: Virtlet uses [CircleCI](https://circleci.com/) for building binaries, docker images and running the tests. The CI configuration resides in [.circleci/config.yml](https://github.com/Mirantis/virtlet/blob/master/.circleci/config.yml) file. You can sign into CircleCI, and make it run tests for your own fork of Virtlet by connecting it to your [GitHub](https://github.com/) account. There are some conventions about branch naming that are respected by CircleCI. Namely, branches with names ending with `-net` will be checked with extra e2e jobs that examine Weave, Flannel and multi-CNI based network setups. For branches with names ending with `-docs` only documentation will be built. Also, you can append `[ci skip]` to your commit message to have CI skip the particular commit/PR altogether.
- The details of CircleCI setup - Using CircleCI with your fork of Virtlet + Virtlet uses [CircleCI](https://circleci.com/) for building binaries, + docker images and running the tests. The CI configuration resides in + [.circleci/config.yml](https://github.com/Mirantis/virtlet/blob/master/.circleci/config.yml) + file. You can sign into CircleCI, and make it run tests for your own + fork of Virtlet by connecting it to your [GitHub](https://github.com/) + account. + + There are some conventions about branch naming that are respected by + CircleCI. Namely, branches with names ending with `-net` will be + checked with extra e2e jobs that examine Weave, Flannel and multi-CNI + based network setups. For branches with names ending with `-docs` only + documentation will be built. + + Also, you can append `[ci skip]` to your commit message to have CI + skip the particular commit/PR altogether.
17
5.666667
15
2
8da89aacf70d89f0f6ecdaff38ab91cbe4c64b6f
app/static/js/global.js
app/static/js/global.js
if(document.getElementById("resume") !== null) { PDFObject.embed("/static/gen/resume.pdf", "#resume"); }
if(document.getElementById("resume") !== null) { $(() => { PDFObject.embed("/static/gen/resume.pdf", "#resume"); }); }
Make sure pdf is loaded at the correct time
Make sure pdf is loaded at the correct time
JavaScript
mit
albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com
javascript
## Code Before: if(document.getElementById("resume") !== null) { PDFObject.embed("/static/gen/resume.pdf", "#resume"); } ## Instruction: Make sure pdf is loaded at the correct time ## Code After: if(document.getElementById("resume") !== null) { $(() => { PDFObject.embed("/static/gen/resume.pdf", "#resume"); }); }
if(document.getElementById("resume") !== null) { + $(() => { - PDFObject.embed("/static/gen/resume.pdf", "#resume"); + PDFObject.embed("/static/gen/resume.pdf", "#resume"); ? ++ + }); }
4
1.333333
3
1
fb11a6a3b4e13b16c537217e7e698467054febcc
mobile/src/main/java/com/stefanhoth/ropasclisp/achievements/AchievementObserver.java
mobile/src/main/java/com/stefanhoth/ropasclisp/achievements/AchievementObserver.java
package com.stefanhoth.ropasclisp.achievements; import com.stefanhoth.ropasclisp.games_sdk.PlayGamesClient; public class AchievementObserver { private final PlayGamesClient playGamesClient; private final boolean firstSessionToday; public AchievementObserver(PlayGamesClient playGamesClient, boolean firstSessionToday) { this.playGamesClient = playGamesClient; this.firstSessionToday = firstSessionToday; } public void onGameStart() { // first game start ever playGamesClient.unlockAchievement(ACHIEVEMENT.HELLO_THERE); // on X game starts per day if(! firstSessionToday){ playGamesClient.unlockAchievement(ACHIEVEMENT.CONNOISSEUR); playGamesClient.unlockAchievement(ACHIEVEMENT.ADDICT); } } public void onGameWin() { playGamesClient.unlockAchievement(ACHIEVEMENT.GOTCHA); playGamesClient.unlockAchievement(ACHIEVEMENT.ON_A_ROLL); playGamesClient.unlockAchievement(ACHIEVEMENT.POKER_FACE); } }
package com.stefanhoth.ropasclisp.achievements; import android.content.Context; import com.stefanhoth.ropasclisp.games_sdk.PlayGamesClient; public class AchievementObserver { private final PlayGamesClient playGamesClient; private final Context context; public AchievementObserver(PlayGamesClient playGamesClient, final Context context) { this.playGamesClient = playGamesClient; this.context = context; } public void onGameStart() { // first game start ever playGamesClient.unlockAchievement(ACHIEVEMENT.HELLO_THERE); DAILY_STATE dailyState = DAILY_STATE.with(context); // on X game starts per day if (!dailyState.isTodaysFirstStart()) { final int todaysStarts = dailyState.getTodaysStarts(); if (ACHIEVEMENT.ADDICT.isGoalReached(todaysStarts)) { playGamesClient.unlockAchievement(ACHIEVEMENT.ADDICT); } if (ACHIEVEMENT.CONNOISSEUR.isGoalReached(todaysStarts)) { playGamesClient.unlockAchievement(ACHIEVEMENT.CONNOISSEUR); } } } public void onGameWin() { playGamesClient.unlockAchievement(ACHIEVEMENT.GOTCHA); playGamesClient.unlockAchievement(ACHIEVEMENT.ON_A_ROLL); playGamesClient.unlockAchievement(ACHIEVEMENT.POKER_FACE); } }
Correct behavior for daily start awards
Correct behavior for daily start awards
Java
mit
stefanhoth/ropasclisp
java
## Code Before: package com.stefanhoth.ropasclisp.achievements; import com.stefanhoth.ropasclisp.games_sdk.PlayGamesClient; public class AchievementObserver { private final PlayGamesClient playGamesClient; private final boolean firstSessionToday; public AchievementObserver(PlayGamesClient playGamesClient, boolean firstSessionToday) { this.playGamesClient = playGamesClient; this.firstSessionToday = firstSessionToday; } public void onGameStart() { // first game start ever playGamesClient.unlockAchievement(ACHIEVEMENT.HELLO_THERE); // on X game starts per day if(! firstSessionToday){ playGamesClient.unlockAchievement(ACHIEVEMENT.CONNOISSEUR); playGamesClient.unlockAchievement(ACHIEVEMENT.ADDICT); } } public void onGameWin() { playGamesClient.unlockAchievement(ACHIEVEMENT.GOTCHA); playGamesClient.unlockAchievement(ACHIEVEMENT.ON_A_ROLL); playGamesClient.unlockAchievement(ACHIEVEMENT.POKER_FACE); } } ## Instruction: Correct behavior for daily start awards ## Code After: package com.stefanhoth.ropasclisp.achievements; import android.content.Context; import com.stefanhoth.ropasclisp.games_sdk.PlayGamesClient; public class AchievementObserver { private final PlayGamesClient playGamesClient; private final Context context; public AchievementObserver(PlayGamesClient playGamesClient, final Context context) { this.playGamesClient = playGamesClient; this.context = context; } public void onGameStart() { // first game start ever playGamesClient.unlockAchievement(ACHIEVEMENT.HELLO_THERE); DAILY_STATE dailyState = DAILY_STATE.with(context); // on X game starts per day if (!dailyState.isTodaysFirstStart()) { final int todaysStarts = dailyState.getTodaysStarts(); if (ACHIEVEMENT.ADDICT.isGoalReached(todaysStarts)) { playGamesClient.unlockAchievement(ACHIEVEMENT.ADDICT); } if (ACHIEVEMENT.CONNOISSEUR.isGoalReached(todaysStarts)) { playGamesClient.unlockAchievement(ACHIEVEMENT.CONNOISSEUR); } } } public void onGameWin() { playGamesClient.unlockAchievement(ACHIEVEMENT.GOTCHA); playGamesClient.unlockAchievement(ACHIEVEMENT.ON_A_ROLL); playGamesClient.unlockAchievement(ACHIEVEMENT.POKER_FACE); } }
package com.stefanhoth.ropasclisp.achievements; + + import android.content.Context; import com.stefanhoth.ropasclisp.games_sdk.PlayGamesClient; public class AchievementObserver { private final PlayGamesClient playGamesClient; - private final boolean firstSessionToday; + private final Context context; - public AchievementObserver(PlayGamesClient playGamesClient, boolean firstSessionToday) { ? -------- ^^^^^^^^ ^ ^^^ + public AchievementObserver(PlayGamesClient playGamesClient, final Context context) { ? ^^^^^ ^^^^^^ ^^^^^ this.playGamesClient = playGamesClient; - this.firstSessionToday = firstSessionToday; + this.context = context; } public void onGameStart() { // first game start ever playGamesClient.unlockAchievement(ACHIEVEMENT.HELLO_THERE); + DAILY_STATE dailyState = DAILY_STATE.with(context); + // on X game starts per day - if(! firstSessionToday){ + if (!dailyState.isTodaysFirstStart()) { + + final int todaysStarts = dailyState.getTodaysStarts(); + if (ACHIEVEMENT.ADDICT.isGoalReached(todaysStarts)) { + playGamesClient.unlockAchievement(ACHIEVEMENT.ADDICT); + } + if (ACHIEVEMENT.CONNOISSEUR.isGoalReached(todaysStarts)) { - playGamesClient.unlockAchievement(ACHIEVEMENT.CONNOISSEUR); + playGamesClient.unlockAchievement(ACHIEVEMENT.CONNOISSEUR); ? ++++ - playGamesClient.unlockAchievement(ACHIEVEMENT.ADDICT); + } + } } public void onGameWin() { playGamesClient.unlockAchievement(ACHIEVEMENT.GOTCHA); playGamesClient.unlockAchievement(ACHIEVEMENT.ON_A_ROLL); playGamesClient.unlockAchievement(ACHIEVEMENT.POKER_FACE); } }
23
0.741935
17
6
ce1dc7e9785d33676edf0d44a83456eae7af0831
README.md
README.md
Dependency Injection with Ninject ================================= This is a simple lunch presentation to demonstrate some common scenarios of using dependency injection with Ninject. Exercise 1 ---------- Tightly coupled code, no IoC used. Exercise 2 ---------- Added in manual dependency injection. Exercise 3 ----------- Replaced the manual injection with Ninject. Exercise 4 ---------- Demonstrates how Ninject will resolve dependency chains. Exercise 5 ---------- Shows an implementation of the decorator pattern.
Dependency Injection with Ninject ================================= NOTE ---- This presentation is probably out of date but may still be useful for basic examples. This is a simple lunch presentation to demonstrate some common scenarios of using dependency injection with Ninject. Exercise 1 ---------- Tightly coupled code, no IoC used. Exercise 2 ---------- Added in manual dependency injection. Exercise 3 ----------- Replaced the manual injection with Ninject. Exercise 4 ---------- Demonstrates how Ninject will resolve dependency chains. Exercise 5 ---------- Shows an implementation of the decorator pattern.
Add out of date warning
Add out of date warning
Markdown
mit
paulzerkel/di-ninject,paulzerkel/di-ninject,paulzerkel/di-ninject
markdown
## Code Before: Dependency Injection with Ninject ================================= This is a simple lunch presentation to demonstrate some common scenarios of using dependency injection with Ninject. Exercise 1 ---------- Tightly coupled code, no IoC used. Exercise 2 ---------- Added in manual dependency injection. Exercise 3 ----------- Replaced the manual injection with Ninject. Exercise 4 ---------- Demonstrates how Ninject will resolve dependency chains. Exercise 5 ---------- Shows an implementation of the decorator pattern. ## Instruction: Add out of date warning ## Code After: Dependency Injection with Ninject ================================= NOTE ---- This presentation is probably out of date but may still be useful for basic examples. This is a simple lunch presentation to demonstrate some common scenarios of using dependency injection with Ninject. Exercise 1 ---------- Tightly coupled code, no IoC used. Exercise 2 ---------- Added in manual dependency injection. Exercise 3 ----------- Replaced the manual injection with Ninject. Exercise 4 ---------- Demonstrates how Ninject will resolve dependency chains. Exercise 5 ---------- Shows an implementation of the decorator pattern.
Dependency Injection with Ninject ================================= + + NOTE + ---- + This presentation is probably out of date but may still be useful for basic examples. This is a simple lunch presentation to demonstrate some common scenarios of using dependency injection with Ninject. Exercise 1 ---------- Tightly coupled code, no IoC used. Exercise 2 ---------- Added in manual dependency injection. Exercise 3 ----------- Replaced the manual injection with Ninject. Exercise 4 ---------- Demonstrates how Ninject will resolve dependency chains. Exercise 5 ---------- Shows an implementation of the decorator pattern.
4
0.16
4
0
1a6015e73fbbfef228b0aa91827a0ad2da3deba0
vm/vm_internal.h
vm/vm_internal.h
typedef struct { vm_value reg[num_regs]; int return_address; int result_register; //TODO type for this should be heap_address int spilled_arguments; // Used for over-saturated calls. } stack_frame ; typedef struct { stack_frame stack[stack_size]; int stack_pointer; int program_pointer; vm_value *const_table; int const_table_length; } vm_state; #define current_frame (state->stack[state->stack_pointer]) #define next_frame (state->stack[state->stack_pointer + 1]) vm_value new_heap_string(char *content); char *read_string(vm_state *state, vm_value string_value); char *value_to_type_string(vm_value value); #endif
typedef struct { vm_value reg[num_regs]; int return_address; int result_register; heap_address spilled_arguments; // Used for over-saturated calls. } stack_frame ; typedef struct { stack_frame stack[stack_size]; int stack_pointer; int program_pointer; vm_value *const_table; int const_table_length; } vm_state; #define current_frame (state->stack[state->stack_pointer]) #define next_frame (state->stack[state->stack_pointer + 1]) vm_value new_heap_string(char *content); char *read_string(vm_state *state, vm_value string_value); char *value_to_type_string(vm_value value); #endif
Fix type for spilled arguments
Fix type for spilled arguments
C
mit
arne-schroppe/dash,arne-schroppe/dash
c
## Code Before: typedef struct { vm_value reg[num_regs]; int return_address; int result_register; //TODO type for this should be heap_address int spilled_arguments; // Used for over-saturated calls. } stack_frame ; typedef struct { stack_frame stack[stack_size]; int stack_pointer; int program_pointer; vm_value *const_table; int const_table_length; } vm_state; #define current_frame (state->stack[state->stack_pointer]) #define next_frame (state->stack[state->stack_pointer + 1]) vm_value new_heap_string(char *content); char *read_string(vm_state *state, vm_value string_value); char *value_to_type_string(vm_value value); #endif ## Instruction: Fix type for spilled arguments ## Code After: typedef struct { vm_value reg[num_regs]; int return_address; int result_register; heap_address spilled_arguments; // Used for over-saturated calls. } stack_frame ; typedef struct { stack_frame stack[stack_size]; int stack_pointer; int program_pointer; vm_value *const_table; int const_table_length; } vm_state; #define current_frame (state->stack[state->stack_pointer]) #define next_frame (state->stack[state->stack_pointer + 1]) vm_value new_heap_string(char *content); char *read_string(vm_state *state, vm_value string_value); char *value_to_type_string(vm_value value); #endif
typedef struct { vm_value reg[num_regs]; int return_address; int result_register; - //TODO type for this should be heap_address - int spilled_arguments; // Used for over-saturated calls. ? ^^^ + heap_address spilled_arguments; // Used for over-saturated calls. ? ^^^^^^^^^^^^ } stack_frame ; typedef struct { stack_frame stack[stack_size]; int stack_pointer; int program_pointer; vm_value *const_table; int const_table_length; } vm_state; #define current_frame (state->stack[state->stack_pointer]) #define next_frame (state->stack[state->stack_pointer + 1]) vm_value new_heap_string(char *content); char *read_string(vm_state *state, vm_value string_value); char *value_to_type_string(vm_value value); #endif
3
0.090909
1
2
d703396e3cafea68bee55f95ad91e8a0c9b0b6b3
.travis.yml
.travis.yml
language: python python: - "2.6" - "2.7" - "3.3" - "3.4" install: - "pip install -r requirements.txt" - "pip install -r test-requirements.txt" script: - tox -e pep8 - tox
language: python python: - "2.7" - "3.3" - "3.4" - "3.5" before_script: - eval "$(gimme 1.6)" - mkdir $HOME/go - export GOPATH="$HOME/go" - export PATH="$PATH:$GOPATH/bin" - echo $GOPATH - echo $PATH - go get -d github.com/ipfs/go-ipfs - pushd . && cd $GOPATH/src/github.com/ipfs/go-ipfs && make install && popd install: - "pip install -r requirements.txt" - "pip install -r test-requirements.txt" script: - ipfs init - ipfs daemon & - tox -e pep8 - tox
Fix TravisCI to run functional tests.
Fix TravisCI to run functional tests. TravisCI now installs the latest version of IPFS and runs the daemon before starting the testing suite. This means that the functional tests can now pass, whereas before they "failed to connect" to a non-running daemon. Unfortunately, TravisCI will "go get" IPFS, which gives us no control over the version. We will get whatever the latest commit is. As soon as go-ipfs v0.4.3 is finalized and released, the TravisCI config should be changed to install that instead. License: MIT Signed-off-by: Christopher Waldon <1aeea290623765390ce898fc0438b1ab661f56ee@us.ibm.com>
YAML
mit
alexander255/py-ipfs-api,ipfs/py-ipfs-api,ipfs/python-ipfs-api,ipfs/py-ipfs-api,alexander255/py-ipfs-api
yaml
## Code Before: language: python python: - "2.6" - "2.7" - "3.3" - "3.4" install: - "pip install -r requirements.txt" - "pip install -r test-requirements.txt" script: - tox -e pep8 - tox ## Instruction: Fix TravisCI to run functional tests. TravisCI now installs the latest version of IPFS and runs the daemon before starting the testing suite. This means that the functional tests can now pass, whereas before they "failed to connect" to a non-running daemon. Unfortunately, TravisCI will "go get" IPFS, which gives us no control over the version. We will get whatever the latest commit is. As soon as go-ipfs v0.4.3 is finalized and released, the TravisCI config should be changed to install that instead. License: MIT Signed-off-by: Christopher Waldon <1aeea290623765390ce898fc0438b1ab661f56ee@us.ibm.com> ## Code After: language: python python: - "2.7" - "3.3" - "3.4" - "3.5" before_script: - eval "$(gimme 1.6)" - mkdir $HOME/go - export GOPATH="$HOME/go" - export PATH="$PATH:$GOPATH/bin" - echo $GOPATH - echo $PATH - go get -d github.com/ipfs/go-ipfs - pushd . && cd $GOPATH/src/github.com/ipfs/go-ipfs && make install && popd install: - "pip install -r requirements.txt" - "pip install -r test-requirements.txt" script: - ipfs init - ipfs daemon & - tox -e pep8 - tox
language: python python: - - "2.6" - "2.7" - "3.3" - "3.4" + - "3.5" + before_script: + - eval "$(gimme 1.6)" + - mkdir $HOME/go + - export GOPATH="$HOME/go" + - export PATH="$PATH:$GOPATH/bin" + - echo $GOPATH + - echo $PATH + - go get -d github.com/ipfs/go-ipfs + - pushd . && cd $GOPATH/src/github.com/ipfs/go-ipfs && make install && popd install: - "pip install -r requirements.txt" - "pip install -r test-requirements.txt" script: + - ipfs init + - ipfs daemon & - tox -e pep8 - tox
13
1.083333
12
1
83d4f75727fa5fc486b571072b4e6061415ebdce
packages/google-trends-map/package.js
packages/google-trends-map/package.js
Package.describe({ name: 'google-trends-map', version: '0.0.1', summary: '', }); // Package.onUse(function(api) { api.versionsFrom('1.0.4.2'); api.use(['imon-data']); api.use(['mongo', 'widget', 'momentjs:moment', 'underscore', 'country-info', 'aldeed:collection2']); api.use(['http'], 'server'); api.use(['templating', 'epoch', 'd3js:d3'], 'client'); api.addFiles('google-trends-map.js'); api.addFiles(['server.js'], 'server'); api.addFiles([ 'client/lib/d3.geo.js', 'client/info.html', 'client/widget.html', 'client/widget.js', 'client/widget.css', 'client/settings.html', 'client/settings.js' ], 'client'); api.export('GoogleTrendsMap'); });
Package.describe({ name: 'google-trends-map', version: '0.0.1', summary: '', }); // Package.onUse(function(api) { api.versionsFrom('1.0.4.2'); api.use(['imon-data']); api.use(['mongo', 'widget', 'momentjs:moment', 'underscore', 'country-info', 'aldeed:collection2']); api.use(['http'], 'server'); api.use(['templating', 'epoch', 'd3js:d3'], 'client'); api.addFiles('google-trends-map.js'); api.addFiles(['server.js'], 'server'); api.addFiles([ 'client/lib/d3.geo.js', 'client/info.html', 'client/widget.html', 'client/widget.js', 'client/widget.css', 'client/settings.html', 'client/settings.js' ], 'client'); api.export('GoogleTrendsMap'); }); Npm.depends({ 'request': '2.76.0' });
Fix npm request dependency issue in google-trends
Fix npm request dependency issue in google-trends
JavaScript
mit
berkmancenter/internet_dashboard,berkmancenter/internet_dashboard,berkmancenter/internet_dashboard
javascript
## Code Before: Package.describe({ name: 'google-trends-map', version: '0.0.1', summary: '', }); // Package.onUse(function(api) { api.versionsFrom('1.0.4.2'); api.use(['imon-data']); api.use(['mongo', 'widget', 'momentjs:moment', 'underscore', 'country-info', 'aldeed:collection2']); api.use(['http'], 'server'); api.use(['templating', 'epoch', 'd3js:d3'], 'client'); api.addFiles('google-trends-map.js'); api.addFiles(['server.js'], 'server'); api.addFiles([ 'client/lib/d3.geo.js', 'client/info.html', 'client/widget.html', 'client/widget.js', 'client/widget.css', 'client/settings.html', 'client/settings.js' ], 'client'); api.export('GoogleTrendsMap'); }); ## Instruction: Fix npm request dependency issue in google-trends ## Code After: Package.describe({ name: 'google-trends-map', version: '0.0.1', summary: '', }); // Package.onUse(function(api) { api.versionsFrom('1.0.4.2'); api.use(['imon-data']); api.use(['mongo', 'widget', 'momentjs:moment', 'underscore', 'country-info', 'aldeed:collection2']); api.use(['http'], 'server'); api.use(['templating', 'epoch', 'd3js:d3'], 'client'); api.addFiles('google-trends-map.js'); api.addFiles(['server.js'], 'server'); api.addFiles([ 'client/lib/d3.geo.js', 'client/info.html', 'client/widget.html', 'client/widget.js', 'client/widget.css', 'client/settings.html', 'client/settings.js' ], 'client'); api.export('GoogleTrendsMap'); }); Npm.depends({ 'request': '2.76.0' });
Package.describe({ name: 'google-trends-map', version: '0.0.1', summary: '', }); // Package.onUse(function(api) { api.versionsFrom('1.0.4.2'); api.use(['imon-data']); api.use(['mongo', 'widget', 'momentjs:moment', 'underscore', 'country-info', 'aldeed:collection2']); api.use(['http'], 'server'); api.use(['templating', 'epoch', 'd3js:d3'], 'client'); api.addFiles('google-trends-map.js'); api.addFiles(['server.js'], 'server'); api.addFiles([ 'client/lib/d3.geo.js', 'client/info.html', 'client/widget.html', 'client/widget.js', 'client/widget.css', 'client/settings.html', 'client/settings.js' ], 'client'); api.export('GoogleTrendsMap'); }); + + Npm.depends({ 'request': '2.76.0' });
2
0.074074
2
0
19ac2442de6c725c7bc45fcd69cc62fe7b5a24cb
app/models/manageiq/providers/embedded_automation_manager.rb
app/models/manageiq/providers/embedded_automation_manager.rb
class ManageIQ::Providers::EmbeddedAutomationManager < ManageIQ::Providers::AutomationManager require_nested :Authentication require_nested :ConfigurationScript require_nested :ConfigurationScriptPayload require_nested :ConfigurationScriptSource require_nested :ConfiguredSystem require_nested :OrchestrationStack def supported_catalog_types %w(generic_ansible_playbook) end end
class ManageIQ::Providers::EmbeddedAutomationManager < ManageIQ::Providers::AutomationManager require_nested :Authentication require_nested :ConfigurationScript require_nested :ConfigurationScriptPayload require_nested :ConfigurationScriptSource require_nested :ConfiguredSystem require_nested :OrchestrationStack def supported_for_create? false end def supported_catalog_types %w(generic_ansible_playbook) end end
Disable creation of embedded automation managers
Disable creation of embedded automation managers
Ruby
apache-2.0
ManageIQ/manageiq,romanblanco/manageiq,djberg96/manageiq,jameswnl/manageiq,billfitzgerald0120/manageiq,pkomanek/manageiq,syncrou/manageiq,juliancheal/manageiq,borod108/manageiq,chessbyte/manageiq,mkanoor/manageiq,romanblanco/manageiq,agrare/manageiq,tinaafitz/manageiq,andyvesel/manageiq,jrafanie/manageiq,skateman/manageiq,juliancheal/manageiq,aufi/manageiq,kbrock/manageiq,billfitzgerald0120/manageiq,NickLaMuro/manageiq,juliancheal/manageiq,jrafanie/manageiq,aufi/manageiq,andyvesel/manageiq,branic/manageiq,jrafanie/manageiq,agrare/manageiq,jameswnl/manageiq,lpichler/manageiq,jameswnl/manageiq,mzazrivec/manageiq,mzazrivec/manageiq,hstastna/manageiq,aufi/manageiq,syncrou/manageiq,djberg96/manageiq,branic/manageiq,hstastna/manageiq,NickLaMuro/manageiq,chessbyte/manageiq,lpichler/manageiq,lpichler/manageiq,juliancheal/manageiq,aufi/manageiq,gmcculloug/manageiq,syncrou/manageiq,hstastna/manageiq,kbrock/manageiq,agrare/manageiq,ManageIQ/manageiq,ManageIQ/manageiq,tinaafitz/manageiq,jvlcek/manageiq,agrare/manageiq,gmcculloug/manageiq,billfitzgerald0120/manageiq,andyvesel/manageiq,tinaafitz/manageiq,kbrock/manageiq,d-m-u/manageiq,pkomanek/manageiq,yaacov/manageiq,skateman/manageiq,jrafanie/manageiq,yaacov/manageiq,gmcculloug/manageiq,hstastna/manageiq,yaacov/manageiq,mzazrivec/manageiq,lpichler/manageiq,d-m-u/manageiq,romanblanco/manageiq,syncrou/manageiq,kbrock/manageiq,borod108/manageiq,mzazrivec/manageiq,borod108/manageiq,NickLaMuro/manageiq,d-m-u/manageiq,skateman/manageiq,ManageIQ/manageiq,chessbyte/manageiq,NickLaMuro/manageiq,jvlcek/manageiq,mkanoor/manageiq,skateman/manageiq,mkanoor/manageiq,pkomanek/manageiq,jvlcek/manageiq,mkanoor/manageiq,jvlcek/manageiq,borod108/manageiq,romanblanco/manageiq,d-m-u/manageiq,pkomanek/manageiq,branic/manageiq,tinaafitz/manageiq,jameswnl/manageiq,chessbyte/manageiq,djberg96/manageiq,andyvesel/manageiq,gmcculloug/manageiq,djberg96/manageiq,yaacov/manageiq,billfitzgerald0120/manageiq,branic/manageiq
ruby
## Code Before: class ManageIQ::Providers::EmbeddedAutomationManager < ManageIQ::Providers::AutomationManager require_nested :Authentication require_nested :ConfigurationScript require_nested :ConfigurationScriptPayload require_nested :ConfigurationScriptSource require_nested :ConfiguredSystem require_nested :OrchestrationStack def supported_catalog_types %w(generic_ansible_playbook) end end ## Instruction: Disable creation of embedded automation managers ## Code After: class ManageIQ::Providers::EmbeddedAutomationManager < ManageIQ::Providers::AutomationManager require_nested :Authentication require_nested :ConfigurationScript require_nested :ConfigurationScriptPayload require_nested :ConfigurationScriptSource require_nested :ConfiguredSystem require_nested :OrchestrationStack def supported_for_create? false end def supported_catalog_types %w(generic_ansible_playbook) end end
class ManageIQ::Providers::EmbeddedAutomationManager < ManageIQ::Providers::AutomationManager require_nested :Authentication require_nested :ConfigurationScript require_nested :ConfigurationScriptPayload require_nested :ConfigurationScriptSource require_nested :ConfiguredSystem require_nested :OrchestrationStack + def supported_for_create? + false + end + def supported_catalog_types %w(generic_ansible_playbook) end end
4
0.333333
4
0
47b02511e8630039f4dd5485e03593ace196edc3
manager/templates/set/edit.html
manager/templates/set/edit.html
{% extends "base.html" %} {% load i18n %} <!-- Title --> {% block title %}{% trans "Set details" %}{% endblock %} <!-- Main Content --> {% block content %} <h2>{% trans "Edit" %} {{ day.description }}</h2> <form action="/workout/{{ workout.id}}/day/{{ day.id }}/edit/set/{% if set.id %}{{ set.id }}{% endif %}" method="post" class="ym-form"> <table> {% csrf_token %} {% include "form_snippet.html" with field=set_form.exercises css_class="ym-fbox-select" %} {% include "form_snippet.html" with field=set_form.order %} {% include "form_snippet.html" with field=set_form.sets %} <tr> <td><input type="submit" value="{% trans "Save" %}" /></td> <td></td> </tr> </table> </form> {% endblock %} <!-- Side bar --> {% block sidebar %} {% endblock %}
{% extends "base.html" %} {% load i18n %} <!-- Title --> {% block title %}{% trans "Set details" %}{% endblock %} <!-- Main Content --> {% block content %} <h2>{% trans "Edit" %} {{ day.description }}</h2> <form action="/workout/{{ workout.id}}/day/{{ day.id }}/edit/set/{% if set.id %}{{ set.id }}{% endif %}" method="post" class="ym-form"> {% csrf_token %} <table> {% include "form_snippet.html" with field=set_form.exercises css_class="ym-fbox-select" %} {% include "form_snippet.html" with field=set_form.order %} {% include "form_snippet.html" with field=set_form.sets %} <tr> <td><input type="submit" value="{% trans "Save" %}" /></td> <td></td> </tr> </table> </form> {% endblock %} <!-- Side bar --> {% block sidebar %} {% endblock %}
Fix position of hidden CSRF fields
Fix position of hidden CSRF fields
HTML
agpl-3.0
DeveloperMal/wger,petervanderdoes/wger,rolandgeider/wger,petervanderdoes/wger,wger-project/wger,petervanderdoes/wger,DeveloperMal/wger,kjagoo/wger_stark,wger-project/wger,DeveloperMal/wger,wger-project/wger,rolandgeider/wger,petervanderdoes/wger,kjagoo/wger_stark,rolandgeider/wger,wger-project/wger,DeveloperMal/wger,rolandgeider/wger,kjagoo/wger_stark,kjagoo/wger_stark
html
## Code Before: {% extends "base.html" %} {% load i18n %} <!-- Title --> {% block title %}{% trans "Set details" %}{% endblock %} <!-- Main Content --> {% block content %} <h2>{% trans "Edit" %} {{ day.description }}</h2> <form action="/workout/{{ workout.id}}/day/{{ day.id }}/edit/set/{% if set.id %}{{ set.id }}{% endif %}" method="post" class="ym-form"> <table> {% csrf_token %} {% include "form_snippet.html" with field=set_form.exercises css_class="ym-fbox-select" %} {% include "form_snippet.html" with field=set_form.order %} {% include "form_snippet.html" with field=set_form.sets %} <tr> <td><input type="submit" value="{% trans "Save" %}" /></td> <td></td> </tr> </table> </form> {% endblock %} <!-- Side bar --> {% block sidebar %} {% endblock %} ## Instruction: Fix position of hidden CSRF fields ## Code After: {% extends "base.html" %} {% load i18n %} <!-- Title --> {% block title %}{% trans "Set details" %}{% endblock %} <!-- Main Content --> {% block content %} <h2>{% trans "Edit" %} {{ day.description }}</h2> <form action="/workout/{{ workout.id}}/day/{{ day.id }}/edit/set/{% if set.id %}{{ set.id }}{% endif %}" method="post" class="ym-form"> {% csrf_token %} <table> {% include "form_snippet.html" with field=set_form.exercises css_class="ym-fbox-select" %} {% include "form_snippet.html" with field=set_form.order %} {% include "form_snippet.html" with field=set_form.sets %} <tr> <td><input type="submit" value="{% trans "Save" %}" /></td> <td></td> </tr> </table> </form> {% endblock %} <!-- Side bar --> {% block sidebar %} {% endblock %}
{% extends "base.html" %} {% load i18n %} <!-- Title --> {% block title %}{% trans "Set details" %}{% endblock %} <!-- Main Content --> {% block content %} <h2>{% trans "Edit" %} {{ day.description }}</h2> <form action="/workout/{{ workout.id}}/day/{{ day.id }}/edit/set/{% if set.id %}{{ set.id }}{% endif %}" method="post" class="ym-form"> + {% csrf_token %} <table> - {% csrf_token %} {% include "form_snippet.html" with field=set_form.exercises css_class="ym-fbox-select" %} {% include "form_snippet.html" with field=set_form.order %} {% include "form_snippet.html" with field=set_form.sets %} <tr> <td><input type="submit" value="{% trans "Save" %}" /></td> <td></td> </tr> </table> </form> {% endblock %} <!-- Side bar --> {% block sidebar %} {% endblock %}
2
0.04878
1
1
661930cc2795ffd551cf485003a987981b3f5342
example/index.html
example/index.html
<!doctype html> <html> <title>zlide example</title> <style> * { margin: 0; padding: 0; } </style> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css"> <link rel="stylesheet" type="text/css" href="react-zlide.css"> <link rel="stylesheet" type="text/css" href="zlide.theme.css"> <body> <div id="zlide-example" /> <script src="./index.js"></script> </body> </html>
<!doctype html> <html> <title>zlide example</title> <style> * { margin: 0; padding: 0; } </style> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css"> <link rel="stylesheet" type="text/css" href="zlide.theme.css"> <body> <div id="zlide-example" /> <script src="./index.js"></script> </body> </html>
Remove css link on example
Remove css link on example
HTML
mit
zalando/react-zlide,zalando/react-zlide
html
## Code Before: <!doctype html> <html> <title>zlide example</title> <style> * { margin: 0; padding: 0; } </style> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css"> <link rel="stylesheet" type="text/css" href="react-zlide.css"> <link rel="stylesheet" type="text/css" href="zlide.theme.css"> <body> <div id="zlide-example" /> <script src="./index.js"></script> </body> </html> ## Instruction: Remove css link on example ## Code After: <!doctype html> <html> <title>zlide example</title> <style> * { margin: 0; padding: 0; } </style> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css"> <link rel="stylesheet" type="text/css" href="zlide.theme.css"> <body> <div id="zlide-example" /> <script src="./index.js"></script> </body> </html>
<!doctype html> <html> <title>zlide example</title> <style> * { margin: 0; padding: 0; } </style> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css"> - <link rel="stylesheet" type="text/css" href="react-zlide.css"> <link rel="stylesheet" type="text/css" href="zlide.theme.css"> <body> <div id="zlide-example" /> <script src="./index.js"></script> </body> </html>
1
0.05
0
1
24b18d4a57776c6604203c64134f53b534ad84e0
README.markdown
README.markdown
Find Dispatch's documentation at http://dispatch-classic.databinder.net/
This is the classic version of Dispatch and is unmaintained. Find Dispatch Classic's documentation at http://dispatch-classic.databinder.net/ If you're looking for the modern Dispatch, check out https://github.com/dispatch/reboot
Update readme to link to reboot
Update readme to link to reboot
Markdown
lgpl-2.1
dispatch/dispatch
markdown
## Code Before: Find Dispatch's documentation at http://dispatch-classic.databinder.net/ ## Instruction: Update readme to link to reboot ## Code After: This is the classic version of Dispatch and is unmaintained. Find Dispatch Classic's documentation at http://dispatch-classic.databinder.net/ If you're looking for the modern Dispatch, check out https://github.com/dispatch/reboot
+ This is the classic version of Dispatch and is unmaintained. + - Find Dispatch's documentation at http://dispatch-classic.databinder.net/ + Find Dispatch Classic's documentation at http://dispatch-classic.databinder.net/ ? ++++++++ + + If you're looking for the modern Dispatch, check out https://github.com/dispatch/reboot
6
6
5
1
012ed05c46d3e6e2901675e78b239846da0c9e9c
docs/ota-client-guide/modules/ROOT/examples/sota-local.toml
docs/ota-client-guide/modules/ROOT/examples/sota-local.toml
[provision] provision_path = "credentials.zip" primary_ecu_hardware_id = "local-fake" [logger] loglevel = 1 [storage] path = "storage" [pacman] type = "none" [uptane] secondary_config_file = "virtualsec.json"
[provision] provision_path = "credentials.zip" primary_ecu_hardware_id = "local-fake" # This setting is for testing purposes only. Do not use in a real device. mode = "SharedCredReuse" [logger] loglevel = 1 [storage] path = "storage" [pacman] type = "none" images_path = "storage/images" [uptane] secondary_config_file = "virtualsec.json"
Add missing configuration values to simulate a device.
Add missing configuration values to simulate a device. Signed-off-by: Ignacio Lucero <cd2cdbf44ca497efa888e0ecb1bd58120467acb5@here.com>
TOML
mpl-2.0
advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/aktualizr,advancedtelematic/aktualizr
toml
## Code Before: [provision] provision_path = "credentials.zip" primary_ecu_hardware_id = "local-fake" [logger] loglevel = 1 [storage] path = "storage" [pacman] type = "none" [uptane] secondary_config_file = "virtualsec.json" ## Instruction: Add missing configuration values to simulate a device. Signed-off-by: Ignacio Lucero <cd2cdbf44ca497efa888e0ecb1bd58120467acb5@here.com> ## Code After: [provision] provision_path = "credentials.zip" primary_ecu_hardware_id = "local-fake" # This setting is for testing purposes only. Do not use in a real device. mode = "SharedCredReuse" [logger] loglevel = 1 [storage] path = "storage" [pacman] type = "none" images_path = "storage/images" [uptane] secondary_config_file = "virtualsec.json"
[provision] provision_path = "credentials.zip" primary_ecu_hardware_id = "local-fake" + # This setting is for testing purposes only. Do not use in a real device. + mode = "SharedCredReuse" [logger] loglevel = 1 [storage] path = "storage" [pacman] type = "none" + images_path = "storage/images" [uptane] secondary_config_file = "virtualsec.json"
3
0.2
3
0
9a29f976c8055820702e60e593144796cae1e7b7
app/imports/models.coffee
app/imports/models.coffee
if Meteor.isServer Parse = require 'parse/node' else Parse = require 'parse' exports.Survey = Parse.Object.extend 'Survey', getForms: (returnMeteorCollection, collection) -> query = @relation('forms').query() query.find().then (forms) -> if returnMeteorCollection and forms formCollection = collection or new Meteor.Collection null _.each forms, (form) -> props = _.extend {}, form.attributes props.parseId = form.id formCollection.insert props formCollection else forms exports.Form = Parse.Object.extend 'Form', getLastQuestionOrder: -> query = @relation('questions').query() query.descending 'order' query.select 'order' query.first().then (lastQuestion) -> lastQuestion?.get('order') exports.Question = Parse.Object.extend 'Question'
if Meteor.isServer Parse = require 'parse/node' else Parse = require 'parse' exports.Survey = Parse.Object.extend 'Survey', getForms: (returnMeteorCollection, collection) -> query = @relation('forms').query() query.find().then (forms) -> if returnMeteorCollection and forms formCollection = collection or new Meteor.Collection null _.each forms, (form) -> props = _.extend {}, form.attributes props.parseId = form.id formCollection.insert props formCollection else forms exports.Form = Parse.Object.extend 'Form', getQuestions: -> query = @relation('questions').query() query.find().then (questions) -> questions getLastQuestionOrder: -> query = @relation('questions').query() query.descending 'order' query.select 'order' query.first().then (lastQuestion) -> lastQuestion?.get('order') exports.Question = Parse.Object.extend 'Question'
Add getQuestions method to Form class
Add getQuestions method to Form class
CoffeeScript
apache-2.0
ecohealthalliance/mobile-survey,ecohealthalliance/mobile-survey,ecohealthalliance/mobile-survey
coffeescript
## Code Before: if Meteor.isServer Parse = require 'parse/node' else Parse = require 'parse' exports.Survey = Parse.Object.extend 'Survey', getForms: (returnMeteorCollection, collection) -> query = @relation('forms').query() query.find().then (forms) -> if returnMeteorCollection and forms formCollection = collection or new Meteor.Collection null _.each forms, (form) -> props = _.extend {}, form.attributes props.parseId = form.id formCollection.insert props formCollection else forms exports.Form = Parse.Object.extend 'Form', getLastQuestionOrder: -> query = @relation('questions').query() query.descending 'order' query.select 'order' query.first().then (lastQuestion) -> lastQuestion?.get('order') exports.Question = Parse.Object.extend 'Question' ## Instruction: Add getQuestions method to Form class ## Code After: if Meteor.isServer Parse = require 'parse/node' else Parse = require 'parse' exports.Survey = Parse.Object.extend 'Survey', getForms: (returnMeteorCollection, collection) -> query = @relation('forms').query() query.find().then (forms) -> if returnMeteorCollection and forms formCollection = collection or new Meteor.Collection null _.each forms, (form) -> props = _.extend {}, form.attributes props.parseId = form.id formCollection.insert props formCollection else forms exports.Form = Parse.Object.extend 'Form', getQuestions: -> query = @relation('questions').query() query.find().then (questions) -> questions getLastQuestionOrder: -> query = @relation('questions').query() query.descending 'order' query.select 'order' query.first().then (lastQuestion) -> lastQuestion?.get('order') exports.Question = Parse.Object.extend 'Question'
if Meteor.isServer Parse = require 'parse/node' else Parse = require 'parse' exports.Survey = Parse.Object.extend 'Survey', getForms: (returnMeteorCollection, collection) -> query = @relation('forms').query() query.find().then (forms) -> if returnMeteorCollection and forms formCollection = collection or new Meteor.Collection null _.each forms, (form) -> props = _.extend {}, form.attributes props.parseId = form.id formCollection.insert props formCollection else forms exports.Form = Parse.Object.extend 'Form', + getQuestions: -> + query = @relation('questions').query() + query.find().then (questions) -> + questions + getLastQuestionOrder: -> query = @relation('questions').query() query.descending 'order' query.select 'order' query.first().then (lastQuestion) -> lastQuestion?.get('order') exports.Question = Parse.Object.extend 'Question'
5
0.178571
5
0
1dd51b2e842e01a6752938320b7c96c1348d004f
Sources/StyledString.swift
Sources/StyledString.swift
// // StyledString.swift // // // Created by 1024jp on 2017/03/04. // // struct StyledString { let string: String let styles: [Style] } struct Style { let range: Range<String.Index> let type: Type } enum StyleType { case bold case strike case link(url: String) case image(url: String) }
// // StyledString.swift // // // Created by 1024jp on 2017/03/04. // // struct StyledString { let string: String let styles: [Style] } struct Style { let range: Range<String.Index> let type: Type enum Type { case bold case strike case link(url: String) case image(url: String) } }
Put styles type into Style
Put styles type into Style
Swift
mit
1024jp/MarkupParser
swift
## Code Before: // // StyledString.swift // // // Created by 1024jp on 2017/03/04. // // struct StyledString { let string: String let styles: [Style] } struct Style { let range: Range<String.Index> let type: Type } enum StyleType { case bold case strike case link(url: String) case image(url: String) } ## Instruction: Put styles type into Style ## Code After: // // StyledString.swift // // // Created by 1024jp on 2017/03/04. // // struct StyledString { let string: String let styles: [Style] } struct Style { let range: Range<String.Index> let type: Type enum Type { case bold case strike case link(url: String) case image(url: String) } }
// // StyledString.swift // // // Created by 1024jp on 2017/03/04. // // struct StyledString { let string: String let styles: [Style] } struct Style { let range: Range<String.Index> let type: Type + + + enum Type { + + case bold + case strike + case link(url: String) + case image(url: String) + } } - - - enum StyleType { - - case bold - case strike - case link(url: String) - case image(url: String) - }
18
0.62069
9
9
5b0543bda842f022289cae88a02498fa90d6a9a1
roles/openshift_node/tasks/storage_plugins/main.yml
roles/openshift_node/tasks/storage_plugins/main.yml
--- # The NFS storage plugin is always enabled since it doesn't require any # additional package dependencies - name: NFS storage plugin configuration include: nfs.yml when: not openshift.common.is_containerized | bool - name: GlusterFS storage plugin configuration include: glusterfs.yml when: "'glusterfs' in openshift.node.storage_plugin_deps and not openshift.common.is_containerized | bool " - name: Ceph storage plugin configuration include: ceph.yml when: "'ceph' in openshift.node.storage_plugin_deps and not openshift.common.is_containerized | bool"
--- # The NFS storage plugin is always enabled since it doesn't require any # additional package dependencies - name: NFS storage plugin configuration include: nfs.yml - name: GlusterFS storage plugin configuration include: glusterfs.yml when: "'glusterfs' in openshift.node.storage_plugin_deps" - name: Ceph storage plugin configuration include: ceph.yml when: "'ceph' in openshift.node.storage_plugin_deps"
Remove not is_containerized restriction on storage plugin includes.
Remove not is_containerized restriction on storage plugin includes.
YAML
apache-2.0
ewolinetz/openshift-ansible,anpingli/openshift-ansible,zhiwliu/openshift-ansible,abutcher/openshift-ansible,EricMountain-1A/openshift-ansible,jwhonce/openshift-ansible,nhr/openshift-ansible,thoraxe/openshift-ansible,EricMountain-1A/openshift-ansible,thoraxe/openshift-ansible,zhiwliu/openshift-ansible,akubicharm/openshift-ansible,markllama/openshift-ansible,akram/openshift-ansible,zhiwliu/openshift-ansible,sosiouxme/openshift-ansible,mwoodson/openshift-ansible,ewolinetz/openshift-ansible,twiest/openshift-ansible,ewolinetz/openshift-ansible,twiest/openshift-ansible,git001/openshift-ansible,miminar/openshift-ansible,nak3/openshift-ansible,liggitt/openshift-ansible,detiber/openshift-ansible,gburges/openshift-ansible,detiber/openshift-ansible,maxamillion/openshift-ansible,mmahut/openshift-ansible,tagliateller/openshift-ansible,akubicharm/openshift-ansible,aveshagarwal/openshift-ansible,gburges/openshift-ansible,rjhowe/openshift-ansible,markllama/openshift-ansible,detiber/openshift-ansible,openshift/openshift-ansible,spinolacastro/openshift-ansible,brenton/openshift-ansible,mmahut/openshift-ansible,twiest/openshift-ansible,rhdedgar/openshift-ansible,EricMountain-1A/openshift-ansible,maxamillion/openshift-ansible,rharrison10/openshift-ansible,EricMountain-1A/openshift-ansible,markllama/openshift-ansible,rhdedgar/openshift-ansible,akubicharm/openshift-ansible,jwhonce/openshift-ansible,sdodson/openshift-ansible,DG-i/openshift-ansible,spinolacastro/openshift-ansible,tagliateller/openshift-ansible,BlueShells/openshift-ansible,sosiouxme/openshift-ansible,sdodson/openshift-ansible,maxamillion/openshift-ansible,miminar/openshift-ansible,bparees/openshift-ansible,ttindell2/openshift-ansible,zhiwliu/openshift-ansible,detiber/openshift-ansible,wbrefvem/openshift-ansible,rjhowe/openshift-ansible,sosiouxme/openshift-ansible,akram/openshift-ansible,zhiwliu/openshift-ansible,git001/openshift-ansible,rjhowe/openshift-ansible,aveshagarwal/openshift-ansible,aveshagarwal/openshift-ansible,brenton/openshift-ansible,wshearn/openshift-ansible,jwhonce/openshift-ansible,maxamillion/openshift-ansible,git001/openshift-ansible,liggitt/openshift-ansible,LutzLange/openshift-ansible,mmahut/openshift-ansible,tagliateller/openshift-ansible,wbrefvem/openshift-ansible,tagliateller/openshift-ansible,mmahut/openshift-ansible,liggitt/openshift-ansible,wshearn/openshift-ansible,bparees/openshift-ansible,quantiply-fork/openshift-ansible,liggitt/openshift-ansible,mmahut/openshift-ansible,nhr/openshift-ansible,twiest/openshift-ansible,markllama/openshift-ansible,wbrefvem/openshift-ansible,miminar/openshift-ansible,markllama/openshift-ansible,LutzLange/openshift-ansible,sdodson/openshift-ansible,kwoodson/openshift-ansible,nak3/openshift-ansible,tagliateller/openshift-ansible,ttindell2/openshift-ansible,anpingli/openshift-ansible,thoraxe/openshift-ansible,openshift/openshift-ansible,EricMountain-1A/openshift-ansible,BlueShells/openshift-ansible,akubicharm/openshift-ansible,aveshagarwal/openshift-ansible,wbrefvem/openshift-ansible,rjhowe/openshift-ansible,thoraxe/openshift-ansible,kwoodson/openshift-ansible,BlueShells/openshift-ansible,DG-i/openshift-ansible,rjhowe/openshift-ansible,abutcher/openshift-ansible,maxamillion/openshift-ansible,abutcher/openshift-ansible,sosiouxme/openshift-ansible,twiest/openshift-ansible,ewolinetz/openshift-ansible,akubicharm/openshift-ansible,LutzLange/openshift-ansible,robotmaxtron/openshift-ansible,jwhonce/openshift-ansible,git001/openshift-ansible,DG-i/openshift-ansible,sosiouxme/openshift-ansible,miminar/openshift-ansible,ewolinetz/openshift-ansible,rharrison10/openshift-ansible,ttindell2/openshift-ansible,sdodson/openshift-ansible,detiber/openshift-ansible,liggitt/openshift-ansible,aveshagarwal/openshift-ansible,quantiply-fork/openshift-ansible,wbrefvem/openshift-ansible,quantiply-fork/openshift-ansible,DG-i/openshift-ansible,mwoodson/openshift-ansible,robotmaxtron/openshift-ansible,abutcher/openshift-ansible,miminar/openshift-ansible,sdodson/openshift-ansible,nhr/openshift-ansible,ttindell2/openshift-ansible,brenton/openshift-ansible,jwhonce/openshift-ansible,abutcher/openshift-ansible,ttindell2/openshift-ansible
yaml
## Code Before: --- # The NFS storage plugin is always enabled since it doesn't require any # additional package dependencies - name: NFS storage plugin configuration include: nfs.yml when: not openshift.common.is_containerized | bool - name: GlusterFS storage plugin configuration include: glusterfs.yml when: "'glusterfs' in openshift.node.storage_plugin_deps and not openshift.common.is_containerized | bool " - name: Ceph storage plugin configuration include: ceph.yml when: "'ceph' in openshift.node.storage_plugin_deps and not openshift.common.is_containerized | bool" ## Instruction: Remove not is_containerized restriction on storage plugin includes. ## Code After: --- # The NFS storage plugin is always enabled since it doesn't require any # additional package dependencies - name: NFS storage plugin configuration include: nfs.yml - name: GlusterFS storage plugin configuration include: glusterfs.yml when: "'glusterfs' in openshift.node.storage_plugin_deps" - name: Ceph storage plugin configuration include: ceph.yml when: "'ceph' in openshift.node.storage_plugin_deps"
--- # The NFS storage plugin is always enabled since it doesn't require any # additional package dependencies - name: NFS storage plugin configuration include: nfs.yml - when: not openshift.common.is_containerized | bool - name: GlusterFS storage plugin configuration include: glusterfs.yml - when: "'glusterfs' in openshift.node.storage_plugin_deps and not openshift.common.is_containerized | bool " + when: "'glusterfs' in openshift.node.storage_plugin_deps" - name: Ceph storage plugin configuration include: ceph.yml - when: "'ceph' in openshift.node.storage_plugin_deps and not openshift.common.is_containerized | bool" + when: "'ceph' in openshift.node.storage_plugin_deps"
5
0.357143
2
3
cbfe210eadfb6fc0fac9e78d184cb3ca7bade442
README.md
README.md
This wiki is the main source of documentation for OADA developers. Documentation will be built over time as the project progresses. We're in the early stages now, so please help build out some documentation, or check back soon for changes. | Contributing | Functional Spec | Rest API Spec | Demonstrations | |--------------|-----------------|---------------|----------------| | [Developer Guidelines](contributing/Developer-Guidelines.md) | [Functional Spec](functional-specs/README.md) | [Rest API Spec](rest-specs/README.md) | [Demonstrations](demo-specs/README.md) | | | [Overview Slides][slides] | &nbsp; | ## Questions For contributors to the OADA project, the best method for contact is the [oada-dev][oada-dev] mailing list on Google Groups. For those just getting started, the [oada-users][oada-users] mailing list on Google Groups is a good place to ask questions. [oada-dev]: https://groups.google.com/forum/#!forum/oada-dev [oada-users]: https://groups.google.com/forum/#!forum/oada-users [slides]: http://openag.io/OADA_Overview.pdf [api-slides]: http://openag.io/OADA_API_Overview.pdf
This wiki is the main source of documentation for OADA developers. Documentation will be built over time as the project progresses. We're in the early stages now, so please help build out some documentation, or check back soon for changes. | Contributing | Functional Spec | Rest API Spec | Demonstrations | |--------------|-----------------|---------------|----------------| | [Developer Guidelines](contributing/Developer-Guidelines.md) | [Functional Spec](functional-specs/README.md) | [Rest API Spec](rest-specs/README.md) | [Demonstrations](demo-specs/README.md) | ## Questions For contributors to the OADA project, the best method for contact is the [oada-dev][oada-dev] mailing list on Google Groups. For those just getting started, the [oada-users][oada-users] mailing list on Google Groups is a good place to ask questions. [oada-dev]: https://groups.google.com/forum/#!forum/oada-dev [oada-users]: https://groups.google.com/forum/#!forum/oada-users [slides]: http://openag.io/OADA_Overview.pdf [api-slides]: http://openag.io/OADA_API_Overview.pdf
Remove old link (new site apparently broke it)
Remove old link (new site apparently broke it)
Markdown
apache-2.0
OADA/oada-docs,OADA/oada-docs
markdown
## Code Before: This wiki is the main source of documentation for OADA developers. Documentation will be built over time as the project progresses. We're in the early stages now, so please help build out some documentation, or check back soon for changes. | Contributing | Functional Spec | Rest API Spec | Demonstrations | |--------------|-----------------|---------------|----------------| | [Developer Guidelines](contributing/Developer-Guidelines.md) | [Functional Spec](functional-specs/README.md) | [Rest API Spec](rest-specs/README.md) | [Demonstrations](demo-specs/README.md) | | | [Overview Slides][slides] | &nbsp; | ## Questions For contributors to the OADA project, the best method for contact is the [oada-dev][oada-dev] mailing list on Google Groups. For those just getting started, the [oada-users][oada-users] mailing list on Google Groups is a good place to ask questions. [oada-dev]: https://groups.google.com/forum/#!forum/oada-dev [oada-users]: https://groups.google.com/forum/#!forum/oada-users [slides]: http://openag.io/OADA_Overview.pdf [api-slides]: http://openag.io/OADA_API_Overview.pdf ## Instruction: Remove old link (new site apparently broke it) ## Code After: This wiki is the main source of documentation for OADA developers. Documentation will be built over time as the project progresses. We're in the early stages now, so please help build out some documentation, or check back soon for changes. | Contributing | Functional Spec | Rest API Spec | Demonstrations | |--------------|-----------------|---------------|----------------| | [Developer Guidelines](contributing/Developer-Guidelines.md) | [Functional Spec](functional-specs/README.md) | [Rest API Spec](rest-specs/README.md) | [Demonstrations](demo-specs/README.md) | ## Questions For contributors to the OADA project, the best method for contact is the [oada-dev][oada-dev] mailing list on Google Groups. For those just getting started, the [oada-users][oada-users] mailing list on Google Groups is a good place to ask questions. [oada-dev]: https://groups.google.com/forum/#!forum/oada-dev [oada-users]: https://groups.google.com/forum/#!forum/oada-users [slides]: http://openag.io/OADA_Overview.pdf [api-slides]: http://openag.io/OADA_API_Overview.pdf
This wiki is the main source of documentation for OADA developers. Documentation will be built over time as the project progresses. We're in the early stages now, so please help build out some documentation, or check back soon for changes. | Contributing | Functional Spec | Rest API Spec | Demonstrations | |--------------|-----------------|---------------|----------------| | [Developer Guidelines](contributing/Developer-Guidelines.md) | [Functional Spec](functional-specs/README.md) | [Rest API Spec](rest-specs/README.md) | [Demonstrations](demo-specs/README.md) | - | | [Overview Slides][slides] | &nbsp; | ## Questions For contributors to the OADA project, the best method for contact is the [oada-dev][oada-dev] mailing list on Google Groups. For those just getting started, the [oada-users][oada-users] mailing list on Google Groups is a good place to ask questions. [oada-dev]: https://groups.google.com/forum/#!forum/oada-dev [oada-users]: https://groups.google.com/forum/#!forum/oada-users [slides]: http://openag.io/OADA_Overview.pdf [api-slides]: http://openag.io/OADA_API_Overview.pdf
1
0.047619
0
1
18d460dda5125651e98adf349cef2469a6933a77
index.js
index.js
const Telegraf = require('telegraf'); const bot = new Telegraf(process.env.BOT_TOKEN); function repeatIt(messageText = '') { const timesPosition = messageText.indexOf(' '); const times = messageText.substring(0, timesPosition); const text = messageText.substring(timesPosition); let answer = ''; for (let i = 0; i < times; i += 1) { answer += text; } return answer || messageText; } bot.on('message', (ctx) => { const messageText = ctx.update.message.text; console.log(messageText); return ctx.reply(repeatIt(messageText)); }); bot.startPolling()
const Telegraf = require('telegraf'); const BOT_TOKEN = process.env.BOT_TOKEN || ''; const PORT = process.env.PORT || 3000; const URL = process.env.URL || ''; const bot = new Telegraf(BOT_TOKEN); bot.telegram.setWebhook(`${URL}/bot${BOT_TOKEN}`); bot.startWebhook(`/bot${BOT_TOKEN}`, null, PORT); function repeatIt(messageText = '') { const timesPosition = messageText.indexOf(' '); const times = messageText.substring(0, timesPosition); const text = messageText.substring(timesPosition + 1); let answer = ''; for (let i = 0; i < times; i += 1) { answer += text; } return answer || messageText; } bot.on('message', (ctx) => { const messageText = ctx.update.message.text; console.log(messageText); return ctx.reply(repeatIt(messageText)); }); // bot.startPolling()
Use webhooks and ready for heroku!
Use webhooks and ready for heroku!
JavaScript
mit
newvertex/repeatitbot
javascript
## Code Before: const Telegraf = require('telegraf'); const bot = new Telegraf(process.env.BOT_TOKEN); function repeatIt(messageText = '') { const timesPosition = messageText.indexOf(' '); const times = messageText.substring(0, timesPosition); const text = messageText.substring(timesPosition); let answer = ''; for (let i = 0; i < times; i += 1) { answer += text; } return answer || messageText; } bot.on('message', (ctx) => { const messageText = ctx.update.message.text; console.log(messageText); return ctx.reply(repeatIt(messageText)); }); bot.startPolling() ## Instruction: Use webhooks and ready for heroku! ## Code After: const Telegraf = require('telegraf'); const BOT_TOKEN = process.env.BOT_TOKEN || ''; const PORT = process.env.PORT || 3000; const URL = process.env.URL || ''; const bot = new Telegraf(BOT_TOKEN); bot.telegram.setWebhook(`${URL}/bot${BOT_TOKEN}`); bot.startWebhook(`/bot${BOT_TOKEN}`, null, PORT); function repeatIt(messageText = '') { const timesPosition = messageText.indexOf(' '); const times = messageText.substring(0, timesPosition); const text = messageText.substring(timesPosition + 1); let answer = ''; for (let i = 0; i < times; i += 1) { answer += text; } return answer || messageText; } bot.on('message', (ctx) => { const messageText = ctx.update.message.text; console.log(messageText); return ctx.reply(repeatIt(messageText)); }); // bot.startPolling()
const Telegraf = require('telegraf'); + + const BOT_TOKEN = process.env.BOT_TOKEN || ''; + const PORT = process.env.PORT || 3000; + const URL = process.env.URL || ''; + - const bot = new Telegraf(process.env.BOT_TOKEN); ? ------------ + const bot = new Telegraf(BOT_TOKEN); + bot.telegram.setWebhook(`${URL}/bot${BOT_TOKEN}`); + bot.startWebhook(`/bot${BOT_TOKEN}`, null, PORT); function repeatIt(messageText = '') { const timesPosition = messageText.indexOf(' '); const times = messageText.substring(0, timesPosition); - const text = messageText.substring(timesPosition); + const text = messageText.substring(timesPosition + 1); ? ++++ let answer = ''; for (let i = 0; i < times; i += 1) { answer += text; } return answer || messageText; } bot.on('message', (ctx) => { const messageText = ctx.update.message.text; console.log(messageText); return ctx.reply(repeatIt(messageText)); }); - bot.startPolling() + // bot.startPolling() ? +++
13
0.541667
10
3