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
6aa9020c71960d6532142e649d9cfab0427e8d94
spec/store_spec.rb
spec/store_spec.rb
require 'spec_helper' require 'riak-shim/store' describe Riak::Shim::Store do let(:store) { Riak::Shim::Store.new } describe '#config_location' do it 'keeps a path of the database config file' do path = store.config_location path.should_not be_nil end end context 'with test config' do before do tmpdir = Dir.tmpdir FileUtils.cp('./spec/support/database.yml', tmpdir) store.stub(:config_location).and_return("#{tmpdir}/database.yml") end describe '#read_config' do it 'reads yaml from config_location' do store.read_config.should == DB_CONFIG end end describe '#config' do context 'with RACK_ENV=test' do before do @stashed_rack_env = ENV['RACK_ENV'] ENV['RACK_ENV'] = 'test' end after do ENV['RACK_ENV'] = @stashed_rack_env end it "says prefix is test_" do store.config['bucket_prefix'].should == 'test_' end end end describe '#bucket_prefix' do it 'uses the prefix from the config' do store.bucket_prefix.should == 'test_' end end end end
require 'spec_helper' require 'riak-shim/store' describe Riak::Shim::Store do let(:store) { Riak::Shim::Store.new } describe '#config_location' do it 'keeps a path of the database config file' do path = store.config_location path.should_not be_nil end end context 'with test config' do before do tmpdir = Dir.tmpdir FileUtils.cp('./spec/support/database.yml', tmpdir) store.stub(:config_location).and_return("#{tmpdir}/database.yml") end describe '#read_config' do it 'reads yaml from config_location' do store.read_config.should == DB_CONFIG end end describe 'default config' do context 'with RACK_ENV not explicitly configured in database.yml' do before do @stashed_rack_env = ENV['RACK_ENV'] ENV['RACK_ENV'] = 'production' end after do ENV['RACK_ENV'] = @stashed_rack_env end it "says prefix is test_" do store.config['http_port'].should == 8098 end end end describe '#config' do context 'with RACK_ENV=test' do before do @stashed_rack_env = ENV['RACK_ENV'] ENV['RACK_ENV'] = 'test' end after do ENV['RACK_ENV'] = @stashed_rack_env end it "says prefix is test_" do store.config['bucket_prefix'].should == 'test_' end end end describe '#bucket_prefix' do it 'uses the prefix from the config' do store.bucket_prefix.should == 'test_' end end end end
Add test to demonstrate default configuration not being read.
Add test to demonstrate default configuration not being read.
Ruby
mit
mkb/riak-shim
ruby
## Code Before: require 'spec_helper' require 'riak-shim/store' describe Riak::Shim::Store do let(:store) { Riak::Shim::Store.new } describe '#config_location' do it 'keeps a path of the database config file' do path = store.config_location path.should_not be_nil end end context 'with test config' do before do tmpdir = Dir.tmpdir FileUtils.cp('./spec/support/database.yml', tmpdir) store.stub(:config_location).and_return("#{tmpdir}/database.yml") end describe '#read_config' do it 'reads yaml from config_location' do store.read_config.should == DB_CONFIG end end describe '#config' do context 'with RACK_ENV=test' do before do @stashed_rack_env = ENV['RACK_ENV'] ENV['RACK_ENV'] = 'test' end after do ENV['RACK_ENV'] = @stashed_rack_env end it "says prefix is test_" do store.config['bucket_prefix'].should == 'test_' end end end describe '#bucket_prefix' do it 'uses the prefix from the config' do store.bucket_prefix.should == 'test_' end end end end ## Instruction: Add test to demonstrate default configuration not being read. ## Code After: require 'spec_helper' require 'riak-shim/store' describe Riak::Shim::Store do let(:store) { Riak::Shim::Store.new } describe '#config_location' do it 'keeps a path of the database config file' do path = store.config_location path.should_not be_nil end end context 'with test config' do before do tmpdir = Dir.tmpdir FileUtils.cp('./spec/support/database.yml', tmpdir) store.stub(:config_location).and_return("#{tmpdir}/database.yml") end describe '#read_config' do it 'reads yaml from config_location' do store.read_config.should == DB_CONFIG end end describe 'default config' do context 'with RACK_ENV not explicitly configured in database.yml' do before do @stashed_rack_env = ENV['RACK_ENV'] ENV['RACK_ENV'] = 'production' end after do ENV['RACK_ENV'] = @stashed_rack_env end it "says prefix is test_" do store.config['http_port'].should == 8098 end end end describe '#config' do context 'with RACK_ENV=test' do before do @stashed_rack_env = ENV['RACK_ENV'] ENV['RACK_ENV'] = 'test' end after do ENV['RACK_ENV'] = @stashed_rack_env end it "says prefix is test_" do store.config['bucket_prefix'].should == 'test_' end end end describe '#bucket_prefix' do it 'uses the prefix from the config' do store.bucket_prefix.should == 'test_' end end end end
require 'spec_helper' require 'riak-shim/store' describe Riak::Shim::Store do let(:store) { Riak::Shim::Store.new } describe '#config_location' do it 'keeps a path of the database config file' do path = store.config_location path.should_not be_nil end end context 'with test config' do before do tmpdir = Dir.tmpdir FileUtils.cp('./spec/support/database.yml', tmpdir) store.stub(:config_location).and_return("#{tmpdir}/database.yml") end describe '#read_config' do it 'reads yaml from config_location' do store.read_config.should == DB_CONFIG end end + describe 'default config' do + context 'with RACK_ENV not explicitly configured in database.yml' do + before do + @stashed_rack_env = ENV['RACK_ENV'] + ENV['RACK_ENV'] = 'production' + end + + after do + ENV['RACK_ENV'] = @stashed_rack_env + end + + it "says prefix is test_" do + store.config['http_port'].should == 8098 + end + end + end + describe '#config' do context 'with RACK_ENV=test' do before do @stashed_rack_env = ENV['RACK_ENV'] ENV['RACK_ENV'] = 'test' end after do ENV['RACK_ENV'] = @stashed_rack_env end it "says prefix is test_" do store.config['bucket_prefix'].should == 'test_' end end end describe '#bucket_prefix' do it 'uses the prefix from the config' do store.bucket_prefix.should == 'test_' end end end end
17
0.333333
17
0
333d8e21e5d2d96c568f72f75938c89d1dab499c
README.md
README.md
* Documentation: [bosh.io/docs](https://bosh.io/docs) * IRC: [`#bosh` on freenode](https://webchat.freenode.net/?channels=bosh) * Mailing list: [cf-bosh](https://lists.cloudfoundry.org/pipermail/cf-bosh) * CI: [https://main.bosh-ci.cf-app.com/pipelines/openstack-cpi](https://main.bosh-ci.cf-app.com/pipelines/openstack-cpi) * Roadmap: [Pivotal Tracker](https://www.pivotaltracker.com/n/projects/1133984) (label:openstack) This is a BOSH release for the Openstack CPI. See [Initializing a BOSH environment on Openstack](https://bosh.io/docs/init-openstack.html) for example usage. ## Development See [development doc](docs/development.md). testing
* Documentation: [bosh.io/docs](https://bosh.io/docs) * IRC: [`#bosh` on freenode](https://webchat.freenode.net/?channels=bosh) * Mailing list: [cf-bosh](https://lists.cloudfoundry.org/pipermail/cf-bosh) * CI: [https://main.bosh-ci.cf-app.com/pipelines/openstack-cpi](https://main.bosh-ci.cf-app.com/pipelines/openstack-cpi) * Roadmap: [Pivotal Tracker](https://www.pivotaltracker.com/n/projects/1133984) (label:openstack) This is a BOSH release for the Openstack CPI. See [Initializing a BOSH environment on Openstack](https://bosh.io/docs/init-openstack.html) for example usage. ## Development See [development doc](docs/development.md). ### Deploying concourse locally Below instructions assume you have a local concourse running and a BOSH environment on Openstack. See [Concourse - Getting Started](http://concourse.ci/getting-started.html) Configure concourse with your [pipeline.yml](ci/pipeline.yml), see how [parameters are passed](http://concourse.ci/fly-cli.html#fly-configure). ``` fly configure -c ci/pipeline.yml -vf /path/to/secrets.yml ```
Add instructions for deploying concourse locally
Add instructions for deploying concourse locally [#97031240](https://www.pivotaltracker.com/story/show/97031240) Signed-off-by: Wagner Camarao <9e4bfaf3f26123bf9b57fb85d8a79f98fea9b2ca@vmware.com>
Markdown
apache-2.0
voelzmo/bosh-openstack-cpi-release,voelzmo/bosh-openstack-cpi-release,cloudfoundry-incubator/bosh-openstack-cpi-release,wcamarao/bosh-openstack-cpi-release,loewenstein/bosh-openstack-cpi-release,loewenstein/bosh-openstack-cpi-release,voelzmo/bosh-openstack-cpi-release,wcamarao/bosh-openstack-cpi-release,loewenstein/bosh-openstack-cpi-release,wcamarao/bosh-openstack-cpi-release,cloudfoundry-incubator/bosh-openstack-cpi-release,cloudfoundry-incubator/bosh-openstack-cpi-release
markdown
## Code Before: * Documentation: [bosh.io/docs](https://bosh.io/docs) * IRC: [`#bosh` on freenode](https://webchat.freenode.net/?channels=bosh) * Mailing list: [cf-bosh](https://lists.cloudfoundry.org/pipermail/cf-bosh) * CI: [https://main.bosh-ci.cf-app.com/pipelines/openstack-cpi](https://main.bosh-ci.cf-app.com/pipelines/openstack-cpi) * Roadmap: [Pivotal Tracker](https://www.pivotaltracker.com/n/projects/1133984) (label:openstack) This is a BOSH release for the Openstack CPI. See [Initializing a BOSH environment on Openstack](https://bosh.io/docs/init-openstack.html) for example usage. ## Development See [development doc](docs/development.md). testing ## Instruction: Add instructions for deploying concourse locally [#97031240](https://www.pivotaltracker.com/story/show/97031240) Signed-off-by: Wagner Camarao <9e4bfaf3f26123bf9b57fb85d8a79f98fea9b2ca@vmware.com> ## Code After: * Documentation: [bosh.io/docs](https://bosh.io/docs) * IRC: [`#bosh` on freenode](https://webchat.freenode.net/?channels=bosh) * Mailing list: [cf-bosh](https://lists.cloudfoundry.org/pipermail/cf-bosh) * CI: [https://main.bosh-ci.cf-app.com/pipelines/openstack-cpi](https://main.bosh-ci.cf-app.com/pipelines/openstack-cpi) * Roadmap: [Pivotal Tracker](https://www.pivotaltracker.com/n/projects/1133984) (label:openstack) This is a BOSH release for the Openstack CPI. See [Initializing a BOSH environment on Openstack](https://bosh.io/docs/init-openstack.html) for example usage. ## Development See [development doc](docs/development.md). ### Deploying concourse locally Below instructions assume you have a local concourse running and a BOSH environment on Openstack. See [Concourse - Getting Started](http://concourse.ci/getting-started.html) Configure concourse with your [pipeline.yml](ci/pipeline.yml), see how [parameters are passed](http://concourse.ci/fly-cli.html#fly-configure). ``` fly configure -c ci/pipeline.yml -vf /path/to/secrets.yml ```
* Documentation: [bosh.io/docs](https://bosh.io/docs) * IRC: [`#bosh` on freenode](https://webchat.freenode.net/?channels=bosh) * Mailing list: [cf-bosh](https://lists.cloudfoundry.org/pipermail/cf-bosh) * CI: [https://main.bosh-ci.cf-app.com/pipelines/openstack-cpi](https://main.bosh-ci.cf-app.com/pipelines/openstack-cpi) * Roadmap: [Pivotal Tracker](https://www.pivotaltracker.com/n/projects/1133984) (label:openstack) This is a BOSH release for the Openstack CPI. See [Initializing a BOSH environment on Openstack](https://bosh.io/docs/init-openstack.html) for example usage. ## Development See [development doc](docs/development.md). - testing + + ### Deploying concourse locally + + Below instructions assume you have a local concourse running and a BOSH environment on Openstack. + + See [Concourse - Getting Started](http://concourse.ci/getting-started.html) + + Configure concourse with your [pipeline.yml](ci/pipeline.yml), see how [parameters are passed](http://concourse.ci/fly-cli.html#fly-configure). + + ``` + fly configure -c ci/pipeline.yml -vf /path/to/secrets.yml + ```
13
0.866667
12
1
745bf00086e397609aaae555411b8d42a8fdc5cf
packages/ba/basement-cd.yaml
packages/ba/basement-cd.yaml
homepage: https://github.com/cdornan/basement-cd#readme changelog-type: '' hash: b41b0cd85142c1b1591b4c4625944d8588400f6c73d0e4bc8b29a215ebfef1c6 test-bench-deps: {} maintainer: chris@chrisdornan.com synopsis: Foundation scrap box of array & string changelog: '' basic-deps: base: '>=4.9 && <4.17' ghc-prim: -any all-versions: - 0.0.12.1 author: '' latest: 0.0.12.1 description-type: haddock description: Foundation most basic primitives without any dependencies license-name: BSD-3-Clause
homepage: https://github.com/haskell-cryptography/basement-cd#readme changelog-type: '' hash: 986d3e8fdd481d1457b2b0d9f067d6f4da39fc6185fb52686253faf61b49e78b test-bench-deps: {} maintainer: chris@chrisdornan.com synopsis: Foundation scrap box of array & string changelog: '' basic-deps: base: '>=4.9 && <4.17' ghc-prim: -any all-versions: - 0.0.12.1 author: '' latest: 0.0.12.1 description-type: haddock description: Foundation most basic primitives without any dependencies license-name: BSD-3-Clause
Update from Hackage at 2022-01-09T00:42:27Z
Update from Hackage at 2022-01-09T00:42:27Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://github.com/cdornan/basement-cd#readme changelog-type: '' hash: b41b0cd85142c1b1591b4c4625944d8588400f6c73d0e4bc8b29a215ebfef1c6 test-bench-deps: {} maintainer: chris@chrisdornan.com synopsis: Foundation scrap box of array & string changelog: '' basic-deps: base: '>=4.9 && <4.17' ghc-prim: -any all-versions: - 0.0.12.1 author: '' latest: 0.0.12.1 description-type: haddock description: Foundation most basic primitives without any dependencies license-name: BSD-3-Clause ## Instruction: Update from Hackage at 2022-01-09T00:42:27Z ## Code After: homepage: https://github.com/haskell-cryptography/basement-cd#readme changelog-type: '' hash: 986d3e8fdd481d1457b2b0d9f067d6f4da39fc6185fb52686253faf61b49e78b test-bench-deps: {} maintainer: chris@chrisdornan.com synopsis: Foundation scrap box of array & string changelog: '' basic-deps: base: '>=4.9 && <4.17' ghc-prim: -any all-versions: - 0.0.12.1 author: '' latest: 0.0.12.1 description-type: haddock description: Foundation most basic primitives without any dependencies license-name: BSD-3-Clause
- homepage: https://github.com/cdornan/basement-cd#readme ? ^ - ^ + homepage: https://github.com/haskell-cryptography/basement-cd#readme ? ++++++++ ^^^^ + ^^^ changelog-type: '' - hash: b41b0cd85142c1b1591b4c4625944d8588400f6c73d0e4bc8b29a215ebfef1c6 + hash: 986d3e8fdd481d1457b2b0d9f067d6f4da39fc6185fb52686253faf61b49e78b test-bench-deps: {} maintainer: chris@chrisdornan.com synopsis: Foundation scrap box of array & string changelog: '' basic-deps: base: '>=4.9 && <4.17' ghc-prim: -any all-versions: - 0.0.12.1 author: '' latest: 0.0.12.1 description-type: haddock description: Foundation most basic primitives without any dependencies license-name: BSD-3-Clause
4
0.235294
2
2
4757eab52a2d649ab60fa5efd9fc94d199b91455
package.json
package.json
{ "name": "shepherd", "version": "0.6.14", "description": "Guide your users through a tour of your app.", "authors": [ "Adam Schwartz <adam.flynn.schwartz@gmail.com>", "Zack Bloom <zackbloom@gmail.com>" ], "license": "MIT", "devDependencies": { "coffee-script": "~1.6.3", "gulp": "~3.4.0", "gulp-header": "~1.0.2", "gulp-uglify": "~0.1.0", "gulp-compass": "~1.0.3", "gulp-coffee": "~1.2.5", "gulp-concat": "~2.1.7", "gulp-rename": "~0.2.1", "gulp-util": "~2.2.9", "gulp-bower": "0.0.1", "gulp-wrap-umd": "*" }, "spm": { "main": "shepherd.js" } }
{ "name": "shepherd", "version": "0.6.14", "description": "Guide your users through a tour of your app.", "authors": [ "Adam Schwartz <adam.flynn.schwartz@gmail.com>", "Zack Bloom <zackbloom@gmail.com>" ], "license": "MIT", "devDependencies": { "coffee-script": "~1.6.3", "gulp": "~3.4.0", "gulp-header": "~1.0.2", "gulp-uglify": "~0.1.0", "gulp-compass": "~1.0.3", "gulp-coffee": "~1.2.5", "gulp-concat": "~2.1.7", "gulp-rename": "~0.2.1", "gulp-util": "~2.2.9", "gulp-bower": "0.0.1", "gulp-wrap-umd": "*" }, "main": "shepherd.js", "spm": { "main": "shepherd.js" } }
Add js file to main property
Add js file to main property
JSON
mit
Planwise/shepherd,ministrycentered/shepherd,HubSpot/shepherd,mcanthony/shepherd,haidaxiaocong/--,dieface/shepherd,GerHobbelt/shepherd,jasonpang/shepherd
json
## Code Before: { "name": "shepherd", "version": "0.6.14", "description": "Guide your users through a tour of your app.", "authors": [ "Adam Schwartz <adam.flynn.schwartz@gmail.com>", "Zack Bloom <zackbloom@gmail.com>" ], "license": "MIT", "devDependencies": { "coffee-script": "~1.6.3", "gulp": "~3.4.0", "gulp-header": "~1.0.2", "gulp-uglify": "~0.1.0", "gulp-compass": "~1.0.3", "gulp-coffee": "~1.2.5", "gulp-concat": "~2.1.7", "gulp-rename": "~0.2.1", "gulp-util": "~2.2.9", "gulp-bower": "0.0.1", "gulp-wrap-umd": "*" }, "spm": { "main": "shepherd.js" } } ## Instruction: Add js file to main property ## Code After: { "name": "shepherd", "version": "0.6.14", "description": "Guide your users through a tour of your app.", "authors": [ "Adam Schwartz <adam.flynn.schwartz@gmail.com>", "Zack Bloom <zackbloom@gmail.com>" ], "license": "MIT", "devDependencies": { "coffee-script": "~1.6.3", "gulp": "~3.4.0", "gulp-header": "~1.0.2", "gulp-uglify": "~0.1.0", "gulp-compass": "~1.0.3", "gulp-coffee": "~1.2.5", "gulp-concat": "~2.1.7", "gulp-rename": "~0.2.1", "gulp-util": "~2.2.9", "gulp-bower": "0.0.1", "gulp-wrap-umd": "*" }, "main": "shepherd.js", "spm": { "main": "shepherd.js" } }
{ "name": "shepherd", "version": "0.6.14", "description": "Guide your users through a tour of your app.", "authors": [ "Adam Schwartz <adam.flynn.schwartz@gmail.com>", "Zack Bloom <zackbloom@gmail.com>" ], "license": "MIT", "devDependencies": { "coffee-script": "~1.6.3", "gulp": "~3.4.0", "gulp-header": "~1.0.2", "gulp-uglify": "~0.1.0", "gulp-compass": "~1.0.3", "gulp-coffee": "~1.2.5", "gulp-concat": "~2.1.7", "gulp-rename": "~0.2.1", "gulp-util": "~2.2.9", "gulp-bower": "0.0.1", "gulp-wrap-umd": "*" }, + "main": "shepherd.js", "spm": { "main": "shepherd.js" } }
1
0.038462
1
0
00ce59d43c4208846234652a0746f048836493f2
src/ggrc/services/signals.py
src/ggrc/services/signals.py
from blinker import Namespace class Signals(object): signals = Namespace() custom_attribute_changed = signals.signal( "Custom Attribute updated", """ Indicates that a custom attribute was successfully saved to database. :obj: The model instance :value: New custom attribute value :service: The instance of model handling the Custom Attribute update operation """, )
from blinker import Namespace class Signals(object): signals = Namespace() custom_attribute_changed = signals.signal( "Custom Attribute updated", """ Indicates that a custom attribute was successfully saved to database. :obj: The model instance :value: New custom attribute value :service: The instance of model handling the Custom Attribute update operation """, )
Fix new CA signal message
Fix new CA signal message
Python
apache-2.0
selahssea/ggrc-core,josthkko/ggrc-core,edofic/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,selahssea/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,NejcZupec/ggrc-core,edofic/ggrc-core,j0gurt/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,kr41/ggrc-core,VinnieJohns/ggrc-core,NejcZupec/ggrc-core,prasannav7/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,kr41/ggrc-core,prasannav7/ggrc-core,VinnieJohns/ggrc-core,josthkko/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc-core,NejcZupec/ggrc-core,AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,edofic/ggrc-core,prasannav7/ggrc-core,kr41/ggrc-core,josthkko/ggrc-core,AleksNeStu/ggrc-core,edofic/ggrc-core,andrei-karalionak/ggrc-core,prasannav7/ggrc-core,NejcZupec/ggrc-core
python
## Code Before: from blinker import Namespace class Signals(object): signals = Namespace() custom_attribute_changed = signals.signal( "Custom Attribute updated", """ Indicates that a custom attribute was successfully saved to database. :obj: The model instance :value: New custom attribute value :service: The instance of model handling the Custom Attribute update operation """, ) ## Instruction: Fix new CA signal message ## Code After: from blinker import Namespace class Signals(object): signals = Namespace() custom_attribute_changed = signals.signal( "Custom Attribute updated", """ Indicates that a custom attribute was successfully saved to database. :obj: The model instance :value: New custom attribute value :service: The instance of model handling the Custom Attribute update operation """, )
from blinker import Namespace + class Signals(object): signals = Namespace() custom_attribute_changed = signals.signal( - "Custom Attribute updated", + "Custom Attribute updated", ? ++ - """ + """ ? ++ - Indicates that a custom attribute was successfully saved to database. + Indicates that a custom attribute was successfully saved to database. ? ++ - :obj: The model instance + :obj: The model instance ? ++ - :value: New custom attribute value + :value: New custom attribute value ? ++ - :service: The instance of model handling the Custom Attribute update + :service: The instance of model handling the Custom Attribute update ? ++ - operation + operation ? ++ - """, + """, ? ++ ) -
18
0.947368
9
9
b701ab1ee2b3705385da4fb3e25345761c6b9eaf
src/containers/DemoPieChart.js
src/containers/DemoPieChart.js
import {connect} from 'react-redux' import {createSelector} from 'reselect' import DemoPieChart from '../components/DemoPieChart' import {countLetters} from '../utils/stringStats' import {incrementRenderCount, piechartToggleFilter} from '../actions' import toJS from '../toJS' const getText = state => state.get('text') const getHover = state => state.get('hover') const getFilterEnabled = state => state.get('piechartFilterEnabled') const selectHover = createSelector( [getHover, getFilterEnabled], (hover, filter) => { return filter ? hover : null } ) const selectData = createSelector([getText, selectHover], (text, hover) => { return text.reduce((result, userText, user) => { const nbOfLetters = countLetters(userText, hover ? hover.toJS() : null) if (nbOfLetters > 0) { result.push({ name: user, value: nbOfLetters }) } return result }, []) }) const mapStateToProps = (state, ownProps) => { return { data: selectData(state), hover: selectHover(state), filter: state.get('piechartFilterEnabled') } } const mapDispatchToProps = (dispatch, ownProps) => { return { incrementRenderCount: mode => dispatch(incrementRenderCount('piechart', mode)), toggleFilter: () => dispatch(piechartToggleFilter()) } } export default connect(mapStateToProps, mapDispatchToProps)(toJS(DemoPieChart))
import {connect} from 'react-redux' import {createSelector} from 'reselect' import DemoPieChart from '../components/DemoPieChart' import {countLetters} from '../utils/stringStats' import {incrementRenderCount, piechartToggleFilter} from '../actions' import toJS from '../toJS' const getText = state => state.get('text') const getHover = state => state.get('hover') const getFilterEnabled = state => state.get('piechartFilterEnabled') const selectHover = createSelector( [getHover, getFilterEnabled], (hover, filter) => { return filter ? hover : null } ) const selectData = createSelector([getText, selectHover], (text, hover) => { return text.reduce((result, userText, user) => { const nbOfLetters = countLetters(userText, hover ? hover.toJS() : null) result.push({ name: user, value: nbOfLetters }) return result }, []) }) const mapStateToProps = (state, ownProps) => { return { data: selectData(state), hover: selectHover(state), filter: state.get('piechartFilterEnabled') } } const mapDispatchToProps = (dispatch, ownProps) => { return { incrementRenderCount: mode => dispatch(incrementRenderCount('piechart', mode)), toggleFilter: () => dispatch(piechartToggleFilter()) } } export default connect(mapStateToProps, mapDispatchToProps)(toJS(DemoPieChart))
Fix piechart on 0 chars
Fix piechart on 0 chars
JavaScript
mit
tibotiber/rd3,tibotiber/rd3
javascript
## Code Before: import {connect} from 'react-redux' import {createSelector} from 'reselect' import DemoPieChart from '../components/DemoPieChart' import {countLetters} from '../utils/stringStats' import {incrementRenderCount, piechartToggleFilter} from '../actions' import toJS from '../toJS' const getText = state => state.get('text') const getHover = state => state.get('hover') const getFilterEnabled = state => state.get('piechartFilterEnabled') const selectHover = createSelector( [getHover, getFilterEnabled], (hover, filter) => { return filter ? hover : null } ) const selectData = createSelector([getText, selectHover], (text, hover) => { return text.reduce((result, userText, user) => { const nbOfLetters = countLetters(userText, hover ? hover.toJS() : null) if (nbOfLetters > 0) { result.push({ name: user, value: nbOfLetters }) } return result }, []) }) const mapStateToProps = (state, ownProps) => { return { data: selectData(state), hover: selectHover(state), filter: state.get('piechartFilterEnabled') } } const mapDispatchToProps = (dispatch, ownProps) => { return { incrementRenderCount: mode => dispatch(incrementRenderCount('piechart', mode)), toggleFilter: () => dispatch(piechartToggleFilter()) } } export default connect(mapStateToProps, mapDispatchToProps)(toJS(DemoPieChart)) ## Instruction: Fix piechart on 0 chars ## Code After: import {connect} from 'react-redux' import {createSelector} from 'reselect' import DemoPieChart from '../components/DemoPieChart' import {countLetters} from '../utils/stringStats' import {incrementRenderCount, piechartToggleFilter} from '../actions' import toJS from '../toJS' const getText = state => state.get('text') const getHover = state => state.get('hover') const getFilterEnabled = state => state.get('piechartFilterEnabled') const selectHover = createSelector( [getHover, getFilterEnabled], (hover, filter) => { return filter ? hover : null } ) const selectData = createSelector([getText, selectHover], (text, hover) => { return text.reduce((result, userText, user) => { const nbOfLetters = countLetters(userText, hover ? hover.toJS() : null) result.push({ name: user, value: nbOfLetters }) return result }, []) }) const mapStateToProps = (state, ownProps) => { return { data: selectData(state), hover: selectHover(state), filter: state.get('piechartFilterEnabled') } } const mapDispatchToProps = (dispatch, ownProps) => { return { incrementRenderCount: mode => dispatch(incrementRenderCount('piechart', mode)), toggleFilter: () => dispatch(piechartToggleFilter()) } } export default connect(mapStateToProps, mapDispatchToProps)(toJS(DemoPieChart))
import {connect} from 'react-redux' import {createSelector} from 'reselect' import DemoPieChart from '../components/DemoPieChart' import {countLetters} from '../utils/stringStats' import {incrementRenderCount, piechartToggleFilter} from '../actions' import toJS from '../toJS' const getText = state => state.get('text') const getHover = state => state.get('hover') const getFilterEnabled = state => state.get('piechartFilterEnabled') const selectHover = createSelector( [getHover, getFilterEnabled], (hover, filter) => { return filter ? hover : null } ) const selectData = createSelector([getText, selectHover], (text, hover) => { return text.reduce((result, userText, user) => { const nbOfLetters = countLetters(userText, hover ? hover.toJS() : null) - if (nbOfLetters > 0) { - result.push({ ? -- + result.push({ - name: user, ? -- + name: user, - value: nbOfLetters ? -- + value: nbOfLetters - }) - } + }) ? + return result }, []) }) const mapStateToProps = (state, ownProps) => { return { data: selectData(state), hover: selectHover(state), filter: state.get('piechartFilterEnabled') } } const mapDispatchToProps = (dispatch, ownProps) => { return { incrementRenderCount: mode => dispatch(incrementRenderCount('piechart', mode)), toggleFilter: () => dispatch(piechartToggleFilter()) } } export default connect(mapStateToProps, mapDispatchToProps)(toJS(DemoPieChart))
10
0.208333
4
6
c730184a6ec826f9773fa4130e59121c0fd06e4d
api_v3/misc/oauth2.py
api_v3/misc/oauth2.py
from urlparse import urljoin from django.conf import settings import jwt from social_core.backends.oauth import BaseOAuth2 class KeycloakOAuth2(BaseOAuth2): """Keycloak OAuth authentication backend""" name = 'keycloak' ID_KEY = 'email' BASE_URL = settings.SOCIAL_AUTH_KEYCLOAK_BASE USERINFO_URL = urljoin(BASE_URL, 'protocol/openid-connect/userinfo') AUTHORIZATION_URL = urljoin(BASE_URL, 'protocol/openid-connect/auth') ACCESS_TOKEN_URL = urljoin(BASE_URL, 'protocol/openid-connect/token') ACCESS_TOKEN_METHOD = 'POST' def get_user_details(self, response): clients = response.get('resource_access', {}) client = clients.get(settings.SOCIAL_AUTH_KEYCLOAK_KEY, {}) roles = set(client.get('roles', [])) return { 'username': response.get('preferred_username'), 'email': response.get('email'), 'first_name': response.get('given_name'), 'last_name': response.get('family_name'), 'is_staff': 'staff' in roles, 'is_superuser': 'superuser' in roles, } def user_data(self, access_token, *args, **kwargs): return jwt.decode(access_token, verify=False) def activate_user(backend, user, response, *args, **kwargs): user.is_active = True user.save()
from urlparse import urljoin from django.conf import settings import jwt from social_core.backends.oauth import BaseOAuth2 class KeycloakOAuth2(BaseOAuth2): """Keycloak OAuth authentication backend""" name = 'keycloak' ID_KEY = 'email' BASE_URL = settings.SOCIAL_AUTH_KEYCLOAK_BASE USERINFO_URL = urljoin(BASE_URL, 'protocol/openid-connect/userinfo') AUTHORIZATION_URL = urljoin(BASE_URL, 'protocol/openid-connect/auth') ACCESS_TOKEN_URL = urljoin(BASE_URL, 'protocol/openid-connect/token') ACCESS_TOKEN_METHOD = 'POST' def get_user_details(self, response): clients = response.get('resource_access', {}) client = clients.get(settings.SOCIAL_AUTH_KEYCLOAK_KEY, {}) roles = set(client.get('roles', [])) return { 'email': response.get('email'), 'first_name': response.get('given_name'), 'last_name': response.get('family_name'), 'is_staff': 'staff' in roles, 'is_superuser': 'superuser' in roles, } def user_data(self, access_token, *args, **kwargs): return jwt.decode(access_token, verify=False) def activate_user(backend, user, response, *args, **kwargs): user.is_active = True user.save()
Remove `username` from keycloack payload.
Remove `username` from keycloack payload.
Python
mit
occrp/id-backend
python
## Code Before: from urlparse import urljoin from django.conf import settings import jwt from social_core.backends.oauth import BaseOAuth2 class KeycloakOAuth2(BaseOAuth2): """Keycloak OAuth authentication backend""" name = 'keycloak' ID_KEY = 'email' BASE_URL = settings.SOCIAL_AUTH_KEYCLOAK_BASE USERINFO_URL = urljoin(BASE_URL, 'protocol/openid-connect/userinfo') AUTHORIZATION_URL = urljoin(BASE_URL, 'protocol/openid-connect/auth') ACCESS_TOKEN_URL = urljoin(BASE_URL, 'protocol/openid-connect/token') ACCESS_TOKEN_METHOD = 'POST' def get_user_details(self, response): clients = response.get('resource_access', {}) client = clients.get(settings.SOCIAL_AUTH_KEYCLOAK_KEY, {}) roles = set(client.get('roles', [])) return { 'username': response.get('preferred_username'), 'email': response.get('email'), 'first_name': response.get('given_name'), 'last_name': response.get('family_name'), 'is_staff': 'staff' in roles, 'is_superuser': 'superuser' in roles, } def user_data(self, access_token, *args, **kwargs): return jwt.decode(access_token, verify=False) def activate_user(backend, user, response, *args, **kwargs): user.is_active = True user.save() ## Instruction: Remove `username` from keycloack payload. ## Code After: from urlparse import urljoin from django.conf import settings import jwt from social_core.backends.oauth import BaseOAuth2 class KeycloakOAuth2(BaseOAuth2): """Keycloak OAuth authentication backend""" name = 'keycloak' ID_KEY = 'email' BASE_URL = settings.SOCIAL_AUTH_KEYCLOAK_BASE USERINFO_URL = urljoin(BASE_URL, 'protocol/openid-connect/userinfo') AUTHORIZATION_URL = urljoin(BASE_URL, 'protocol/openid-connect/auth') ACCESS_TOKEN_URL = urljoin(BASE_URL, 'protocol/openid-connect/token') ACCESS_TOKEN_METHOD = 'POST' def get_user_details(self, response): clients = response.get('resource_access', {}) client = clients.get(settings.SOCIAL_AUTH_KEYCLOAK_KEY, {}) roles = set(client.get('roles', [])) return { 'email': response.get('email'), 'first_name': response.get('given_name'), 'last_name': response.get('family_name'), 'is_staff': 'staff' in roles, 'is_superuser': 'superuser' in roles, } def user_data(self, access_token, *args, **kwargs): return jwt.decode(access_token, verify=False) def activate_user(backend, user, response, *args, **kwargs): user.is_active = True user.save()
from urlparse import urljoin from django.conf import settings import jwt from social_core.backends.oauth import BaseOAuth2 class KeycloakOAuth2(BaseOAuth2): """Keycloak OAuth authentication backend""" name = 'keycloak' ID_KEY = 'email' BASE_URL = settings.SOCIAL_AUTH_KEYCLOAK_BASE USERINFO_URL = urljoin(BASE_URL, 'protocol/openid-connect/userinfo') AUTHORIZATION_URL = urljoin(BASE_URL, 'protocol/openid-connect/auth') ACCESS_TOKEN_URL = urljoin(BASE_URL, 'protocol/openid-connect/token') ACCESS_TOKEN_METHOD = 'POST' def get_user_details(self, response): clients = response.get('resource_access', {}) client = clients.get(settings.SOCIAL_AUTH_KEYCLOAK_KEY, {}) roles = set(client.get('roles', [])) return { - 'username': response.get('preferred_username'), 'email': response.get('email'), 'first_name': response.get('given_name'), 'last_name': response.get('family_name'), 'is_staff': 'staff' in roles, 'is_superuser': 'superuser' in roles, } def user_data(self, access_token, *args, **kwargs): return jwt.decode(access_token, verify=False) def activate_user(backend, user, response, *args, **kwargs): user.is_active = True user.save()
1
0.025
0
1
69d8e2c63395fa5471eb24e62fbe46d798a4f6a9
README.rst
README.rst
Navigator_. =========== .. image:: https://secure.travis-ci.org/treffynnon/Navigator.png?branch=master :alt: Build Status :target: http://travis-ci.org/treffynnon/Navigator A PHP library for geographic calculations: * Calculate the distance between two coordinate points on the earth's surface (using Vincenty, Haversine, Great Circle or The Cosine Law) * Conversion between units (metres to kilometres, nautical miles and miles). * Convert coordinate notation (decimals to degrees, minutes & seconds and back again). This is an improved (PHP5.3+) and tested version of `Geographic Calculations in PHP`_. For more information and documentation please see `navigator.simonholywell.com`_. Documentation ''''''''''''' * `API (phpDocumentor) Docs`_. Licence ''''''' This library is under a permissive `BSD 2-Clause License`_. .. _Geographic Calculations in PHP: https://github.com/treffynnon/Geographic-Calculations-in-PHP .. _BSD 2-Clause License: http://www.opensource.org/licenses/bsd-license.php .. _navigator.simonholywell.com: http://navigator.simonholywell.com .. _Navigator: http://navigator.simonholywell.com .. _API (phpDocumentor) Docs: http://navigator.simonholywell.com/apidocs/namespaces/Treffynnon.html
Navigator_ ========== .. image:: https://secure.travis-ci.org/treffynnon/Navigator.png?branch=master :alt: Build Status :target: http://travis-ci.org/treffynnon/Navigator A PHP library for geographic calculations: * Calculate the distance between two coordinate points on the earth's surface (using Vincenty, Haversine, Great Circle or The Cosine Law) * Conversion between units (metres to kilometres, nautical miles and miles). * Convert coordinate notation (decimals to degrees, minutes & seconds and back again). This is an improved (PHP5.3+) and tested version of `Geographic Calculations in PHP`_. For more information and documentation please see `navigator.simonholywell.com`_. Documentation ''''''''''''' * `Read The Docs`_ Licence ''''''' This library is under a permissive `BSD 2-Clause License`_. .. _Geographic Calculations in PHP: https://github.com/treffynnon/Geographic-Calculations-in-PHP .. _BSD 2-Clause License: http://www.opensource.org/licenses/bsd-license.php .. _navigator.simonholywell.com: http://navigator.simonholywell.com .. _Navigator: http://navigator.simonholywell.com .. _Read The Docs: http://navigator.simonholywell.com
Fix up links and remove errant formatting
Fix up links and remove errant formatting
reStructuredText
bsd-2-clause
treffynnon/Navigator
restructuredtext
## Code Before: Navigator_. =========== .. image:: https://secure.travis-ci.org/treffynnon/Navigator.png?branch=master :alt: Build Status :target: http://travis-ci.org/treffynnon/Navigator A PHP library for geographic calculations: * Calculate the distance between two coordinate points on the earth's surface (using Vincenty, Haversine, Great Circle or The Cosine Law) * Conversion between units (metres to kilometres, nautical miles and miles). * Convert coordinate notation (decimals to degrees, minutes & seconds and back again). This is an improved (PHP5.3+) and tested version of `Geographic Calculations in PHP`_. For more information and documentation please see `navigator.simonholywell.com`_. Documentation ''''''''''''' * `API (phpDocumentor) Docs`_. Licence ''''''' This library is under a permissive `BSD 2-Clause License`_. .. _Geographic Calculations in PHP: https://github.com/treffynnon/Geographic-Calculations-in-PHP .. _BSD 2-Clause License: http://www.opensource.org/licenses/bsd-license.php .. _navigator.simonholywell.com: http://navigator.simonholywell.com .. _Navigator: http://navigator.simonholywell.com .. _API (phpDocumentor) Docs: http://navigator.simonholywell.com/apidocs/namespaces/Treffynnon.html ## Instruction: Fix up links and remove errant formatting ## Code After: Navigator_ ========== .. image:: https://secure.travis-ci.org/treffynnon/Navigator.png?branch=master :alt: Build Status :target: http://travis-ci.org/treffynnon/Navigator A PHP library for geographic calculations: * Calculate the distance between two coordinate points on the earth's surface (using Vincenty, Haversine, Great Circle or The Cosine Law) * Conversion between units (metres to kilometres, nautical miles and miles). * Convert coordinate notation (decimals to degrees, minutes & seconds and back again). This is an improved (PHP5.3+) and tested version of `Geographic Calculations in PHP`_. For more information and documentation please see `navigator.simonholywell.com`_. Documentation ''''''''''''' * `Read The Docs`_ Licence ''''''' This library is under a permissive `BSD 2-Clause License`_. .. _Geographic Calculations in PHP: https://github.com/treffynnon/Geographic-Calculations-in-PHP .. _BSD 2-Clause License: http://www.opensource.org/licenses/bsd-license.php .. _navigator.simonholywell.com: http://navigator.simonholywell.com .. _Navigator: http://navigator.simonholywell.com .. _Read The Docs: http://navigator.simonholywell.com
- Navigator_. ? - + Navigator_ - =========== ? - + ========== .. image:: https://secure.travis-ci.org/treffynnon/Navigator.png?branch=master :alt: Build Status :target: http://travis-ci.org/treffynnon/Navigator A PHP library for geographic calculations: * Calculate the distance between two coordinate points on the earth's surface (using Vincenty, Haversine, Great Circle or The Cosine Law) * Conversion between units (metres to kilometres, nautical miles and miles). * Convert coordinate notation (decimals to degrees, minutes & seconds and back again). This is an improved (PHP5.3+) and tested version of `Geographic Calculations in PHP`_. For more information and documentation please see `navigator.simonholywell.com`_. Documentation ''''''''''''' - * `API (phpDocumentor) Docs`_. + * `Read The Docs`_ Licence ''''''' This library is under a permissive `BSD 2-Clause License`_. .. _Geographic Calculations in PHP: https://github.com/treffynnon/Geographic-Calculations-in-PHP .. _BSD 2-Clause License: http://www.opensource.org/licenses/bsd-license.php .. _navigator.simonholywell.com: http://navigator.simonholywell.com .. _Navigator: http://navigator.simonholywell.com - .. _API (phpDocumentor) Docs: http://navigator.simonholywell.com/apidocs/namespaces/Treffynnon.html + .. _Read The Docs: http://navigator.simonholywell.com
8
0.25
4
4
77de73cac8dcd14812f2bb90bfc48fa17ae3c189
src/renderers/shaders/ShaderLib/sprite_frag.glsl
src/renderers/shaders/ShaderLib/sprite_frag.glsl
uniform vec3 diffuse; uniform float opacity; #include <common> #include <packing> #include <uv_pars_fragment> #include <map_pars_fragment> #include <fog_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include <clipping_planes_fragment> #include <logdepthbuf_fragment> #include <map_fragment> #include <alphatest_fragment> outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include <fog_fragment> }
uniform vec3 diffuse; uniform float opacity; #include <common> #include <packing> #include <uv_pars_fragment> #include <map_pars_fragment> #include <fog_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include <logdepthbuf_fragment> #include <map_fragment> #include <alphatest_fragment> outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> }
Add tonemapping and encoding support
Add tonemapping and encoding support
GLSL
mit
julapy/three.js,Itee/three.js,fraguada/three.js,framelab/three.js,TristanVALCKE/three.js,QingchaoHu/three.js,TristanVALCKE/three.js,pailhead/three.js,fyoudine/three.js,cadenasgmbh/three.js,hsimpson/three.js,mrdoob/three.js,jpweeks/three.js,rfm1201/rfm.three.js,SpinVR/three.js,jee7/three.js,SpinVR/three.js,TristanVALCKE/three.js,Aldrien-/three.js,sherousee/three.js,mrdoob/three.js,sttz/three.js,Amritesh/three.js,zhoushijie163/three.js,donmccurdy/three.js,rfm1201/rfm.three.js,Aldrien-/three.js,fraguada/three.js,fyoudine/three.js,Liuer/three.js,greggman/three.js,WestLangley/three.js,Amritesh/three.js,opensim-org/three.js,fraguada/three.js,fernandojsg/three.js,jee7/three.js,fraguada/three.js,aardgoose/three.js,06wj/three.js,looeee/three.js,Samsy/three.js,pailhead/three.js,gero3/three.js,Samsy/three.js,hsimpson/three.js,WestLangley/three.js,makc/three.js.fork,stanford-gfx/three.js,Samsy/three.js,greggman/three.js,jpweeks/three.js,fraguada/three.js,framelab/three.js,pailhead/three.js,stanford-gfx/three.js,Samsy/three.js,jee7/three.js,zhoushijie163/three.js,kaisalmen/three.js,donmccurdy/three.js,Aldrien-/three.js,julapy/three.js,framelab/three.js,kaisalmen/three.js,Mugen87/three.js,fernandojsg/three.js,sttz/three.js,rfm1201/rfm.three.js,fernandojsg/three.js,cadenasgmbh/three.js,Itee/three.js,hsimpson/three.js,looeee/three.js,fraguada/three.js,aardgoose/three.js,TristanVALCKE/three.js,sherousee/three.js,Liuer/three.js,06wj/three.js,makc/three.js.fork,QingchaoHu/three.js,julapy/three.js,TristanVALCKE/three.js,sherousee/three.js,gero3/three.js,Mugen87/three.js,Aldrien-/three.js,opensim-org/three.js,Aldrien-/three.js,Samsy/three.js,Mugen87/three.js,Aldrien-/three.js,Samsy/three.js,Amritesh/three.js,TristanVALCKE/three.js
glsl
## Code Before: uniform vec3 diffuse; uniform float opacity; #include <common> #include <packing> #include <uv_pars_fragment> #include <map_pars_fragment> #include <fog_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include <clipping_planes_fragment> #include <logdepthbuf_fragment> #include <map_fragment> #include <alphatest_fragment> outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include <fog_fragment> } ## Instruction: Add tonemapping and encoding support ## Code After: uniform vec3 diffuse; uniform float opacity; #include <common> #include <packing> #include <uv_pars_fragment> #include <map_pars_fragment> #include <fog_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { #include <clipping_planes_fragment> vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); #include <logdepthbuf_fragment> #include <map_fragment> #include <alphatest_fragment> outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); #include <tonemapping_fragment> #include <encodings_fragment> #include <fog_fragment> }
uniform vec3 diffuse; uniform float opacity; #include <common> #include <packing> #include <uv_pars_fragment> #include <map_pars_fragment> #include <fog_pars_fragment> #include <logdepthbuf_pars_fragment> #include <clipping_planes_pars_fragment> void main() { + #include <clipping_planes_fragment> + vec3 outgoingLight = vec3( 0.0 ); vec4 diffuseColor = vec4( diffuse, opacity ); - #include <clipping_planes_fragment> #include <logdepthbuf_fragment> #include <map_fragment> #include <alphatest_fragment> outgoingLight = diffuseColor.rgb; gl_FragColor = vec4( outgoingLight, diffuseColor.a ); + #include <tonemapping_fragment> + #include <encodings_fragment> #include <fog_fragment> }
5
0.178571
4
1
fec22dc41e822964861c709a3be41bf1a86ab9ee
src/main.js
src/main.js
import localforage from 'localforage'; import Vue from 'vue' import Vuex from 'vuex' import SpotifyWebApi from 'spotify-web-api-js' import App from './App.vue' Vue.use(Vuex); var store = new Vuex.Store({ state: { loggedIn: false }, mutations: { LOGGED_IN (state) { state.loggedIn = true; }, LOGGED_OUT (state) { state.loggedIn = false; } }, // learned_that::actions recieve a context object exposing same methods on store instance actions: { logOut(context) { localforage.clear() .then(() => { context.commit('LOGGED_OUT'); }) .catch((err) => console.error(err)); } } }) var spotify = new SpotifyWebApi(); Object.defineProperty(Vue.prototype, '$spotify', {value: spotify}); localforage.config({ name: 'sortzzi' }); window.vm = new Vue({ el: '#app', store, render: h => h(App) });
import localforage from 'localforage'; import Vue from 'vue' import Vuex from 'vuex' import SpotifyWebApi from 'spotify-web-api-js' import App from './App.vue' Vue.use(Vuex); var store = new Vuex.Store({ state: { loggedIn: false, trackCart: [] }, mutations: { LOGGED_IN (state) { state.loggedIn = true; }, LOGGED_OUT (state) { state.loggedIn = false; }, ADD_TO_TRACK_CART (state, payload) { if(!state.trackCart.includes(payload) && payload != undefined) state.trackCart.push(payload); }, REMOVE_FROM_TRACK_CART(state, payload){ if(state.trackCart.includes(payload)) state.trackCart = state.trackCart.filter(item => item != payload); }, }, // learned_that::actions recieve a context object exposing same methods on store instance actions: { logOut(context) { localforage.clear() .then(() => { context.commit('LOGGED_OUT'); }) .catch((err) => console.error(err)); } } }) var spotify = new SpotifyWebApi(); Object.defineProperty(Vue.prototype, '$spotify', {value: spotify}); localforage.config({ name: 'sortzzi' }); window.vm = new Vue({ el: '#app', store, render: h => h(App) });
Add simple track cart state management to Vuex store.
Add simple track cart state management to Vuex store.
JavaScript
apache-2.0
eamonnbell/sortzzi,eamonnbell/sortzzi
javascript
## Code Before: import localforage from 'localforage'; import Vue from 'vue' import Vuex from 'vuex' import SpotifyWebApi from 'spotify-web-api-js' import App from './App.vue' Vue.use(Vuex); var store = new Vuex.Store({ state: { loggedIn: false }, mutations: { LOGGED_IN (state) { state.loggedIn = true; }, LOGGED_OUT (state) { state.loggedIn = false; } }, // learned_that::actions recieve a context object exposing same methods on store instance actions: { logOut(context) { localforage.clear() .then(() => { context.commit('LOGGED_OUT'); }) .catch((err) => console.error(err)); } } }) var spotify = new SpotifyWebApi(); Object.defineProperty(Vue.prototype, '$spotify', {value: spotify}); localforage.config({ name: 'sortzzi' }); window.vm = new Vue({ el: '#app', store, render: h => h(App) }); ## Instruction: Add simple track cart state management to Vuex store. ## Code After: import localforage from 'localforage'; import Vue from 'vue' import Vuex from 'vuex' import SpotifyWebApi from 'spotify-web-api-js' import App from './App.vue' Vue.use(Vuex); var store = new Vuex.Store({ state: { loggedIn: false, trackCart: [] }, mutations: { LOGGED_IN (state) { state.loggedIn = true; }, LOGGED_OUT (state) { state.loggedIn = false; }, ADD_TO_TRACK_CART (state, payload) { if(!state.trackCart.includes(payload) && payload != undefined) state.trackCart.push(payload); }, REMOVE_FROM_TRACK_CART(state, payload){ if(state.trackCart.includes(payload)) state.trackCart = state.trackCart.filter(item => item != payload); }, }, // learned_that::actions recieve a context object exposing same methods on store instance actions: { logOut(context) { localforage.clear() .then(() => { context.commit('LOGGED_OUT'); }) .catch((err) => console.error(err)); } } }) var spotify = new SpotifyWebApi(); Object.defineProperty(Vue.prototype, '$spotify', {value: spotify}); localforage.config({ name: 'sortzzi' }); window.vm = new Vue({ el: '#app', store, render: h => h(App) });
import localforage from 'localforage'; import Vue from 'vue' import Vuex from 'vuex' import SpotifyWebApi from 'spotify-web-api-js' import App from './App.vue' Vue.use(Vuex); var store = new Vuex.Store({ state: { - loggedIn: false + loggedIn: false, ? + + trackCart: [] }, mutations: { LOGGED_IN (state) { state.loggedIn = true; }, LOGGED_OUT (state) { state.loggedIn = false; - } + }, ? + + ADD_TO_TRACK_CART (state, payload) { + if(!state.trackCart.includes(payload) && payload != undefined) + state.trackCart.push(payload); + }, + REMOVE_FROM_TRACK_CART(state, payload){ + if(state.trackCart.includes(payload)) + state.trackCart = state.trackCart.filter(item => item != payload); + }, }, // learned_that::actions recieve a context object exposing same methods on store instance actions: { logOut(context) { localforage.clear() .then(() => { context.commit('LOGGED_OUT'); }) .catch((err) => console.error(err)); } } }) var spotify = new SpotifyWebApi(); Object.defineProperty(Vue.prototype, '$spotify', {value: spotify}); localforage.config({ name: 'sortzzi' }); window.vm = new Vue({ el: '#app', store, render: h => h(App) });
13
0.270833
11
2
6ca8829029688d04ef12912b36134843af482c50
src/index.js
src/index.js
var matter = exports; matter.parsers = require('./parsers'); matter.register = matter.parsers.register; matter.defaults = matter.parsers.defaults; matter.parse = matter.parsers.registry; // register the bundled parsers require('./parsers/json'); require('./parsers/yaml'); matter.yaml = matter.parse.yaml; matter.json = matter.parse.json;
var matter = exports; matter.parsers = require('./parsers'); matter.parse = matter.parsers.registry; // register the bundled parsers require('./parsers/json'); require('./parsers/yaml'); matter.yaml = matter.parse.yaml; matter.json = matter.parse.json;
Make the api a bit more sane
Make the api a bit more sane
JavaScript
mit
justinvdm/matter
javascript
## Code Before: var matter = exports; matter.parsers = require('./parsers'); matter.register = matter.parsers.register; matter.defaults = matter.parsers.defaults; matter.parse = matter.parsers.registry; // register the bundled parsers require('./parsers/json'); require('./parsers/yaml'); matter.yaml = matter.parse.yaml; matter.json = matter.parse.json; ## Instruction: Make the api a bit more sane ## Code After: var matter = exports; matter.parsers = require('./parsers'); matter.parse = matter.parsers.registry; // register the bundled parsers require('./parsers/json'); require('./parsers/yaml'); matter.yaml = matter.parse.yaml; matter.json = matter.parse.json;
var matter = exports; matter.parsers = require('./parsers'); - matter.register = matter.parsers.register; - matter.defaults = matter.parsers.defaults; matter.parse = matter.parsers.registry; // register the bundled parsers require('./parsers/json'); require('./parsers/yaml'); matter.yaml = matter.parse.yaml; matter.json = matter.parse.json;
2
0.153846
0
2
325c06fbc499aa4da1ce50d9b85dbf5c6ed3321e
activestorage/test/service/azure_storage_service_test.rb
activestorage/test/service/azure_storage_service_test.rb
require "service/shared_service_tests" require "uri" if SERVICE_CONFIGURATIONS[:azure] class ActiveStorage::Service::AzureStorageServiceTest < ActiveSupport::TestCase SERVICE = ActiveStorage::Service.configure(:azure, SERVICE_CONFIGURATIONS) include ActiveStorage::Service::SharedServiceTests test "signed URL generation" do url = @service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: ActiveStorage::Filename.new("avatar.png"), content_type: "image/png") assert_match(/(\S+)&rscd=inline%3B\+filename%3D%22avatar.png%22&rsct=image%2Fpng/, url) assert_match SERVICE_CONFIGURATIONS[:azure][:container], url end end else puts "Skipping Azure Storage Service tests because no Azure configuration was supplied" end
require "service/shared_service_tests" require "uri" if SERVICE_CONFIGURATIONS[:azure] class ActiveStorage::Service::AzureStorageServiceTest < ActiveSupport::TestCase SERVICE = ActiveStorage::Service.configure(:azure, SERVICE_CONFIGURATIONS) include ActiveStorage::Service::SharedServiceTests test "signed URL generation" do url = @service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: ActiveStorage::Filename.new("avatar.png"), content_type: "image/png") assert_match(/(\S+)&rscd=inline%3B\+filename%3D%22avatar\.png%22%3B\+filename\*%3DUTF-8%27%27avatar\.png&rsct=image%2Fpng/, url) assert_match SERVICE_CONFIGURATIONS[:azure][:container], url end end else puts "Skipping Azure Storage Service tests because no Azure configuration was supplied" end
Fix `test "signed URL generation"` failure
Fix `test "signed URL generation"` failure https://travis-ci.org/rails/rails/jobs/281044755#L5582-L5586
Ruby
mit
iainbeeston/rails,mohitnatoo/rails,joonyou/rails,kmcphillips/rails,joonyou/rails,arunagw/rails,schuetzm/rails,prathamesh-sonpatki/rails,jeremy/rails,yasslab/railsguides.jp,kamipo/rails,rails/rails,tjschuck/rails,MSP-Greg/rails,georgeclaghorn/rails,Vasfed/rails,eileencodes/rails,pvalena/rails,notapatch/rails,shioyama/rails,fabianoleittes/rails,BlakeWilliams/rails,illacceptanything/illacceptanything,esparta/rails,rafaelfranca/omg-rails,yhirano55/rails,notapatch/rails,shioyama/rails,bogdanvlviv/rails,aditya-kapoor/rails,schuetzm/rails,baerjam/rails,yalab/rails,georgeclaghorn/rails,mohitnatoo/rails,fabianoleittes/rails,rafaelfranca/omg-rails,eileencodes/rails,mechanicles/rails,betesh/rails,vipulnsward/rails,kirs/rails-1,yahonda/rails,EmmaB/rails-1,MSP-Greg/rails,Vasfed/rails,aditya-kapoor/rails,printercu/rails,yawboakye/rails,repinel/rails,Envek/rails,assain/rails,aditya-kapoor/rails,kirs/rails-1,prathamesh-sonpatki/rails,esparta/rails,schuetzm/rails,yasslab/railsguides.jp,travisofthenorth/rails,tgxworld/rails,mohitnatoo/rails,tjschuck/rails,felipecvo/rails,printercu/rails,illacceptanything/illacceptanything,yahonda/rails,lcreid/rails,Vasfed/rails,tgxworld/rails,kmcphillips/rails,iainbeeston/rails,baerjam/rails,deraru/rails,odedniv/rails,Erol/rails,vipulnsward/rails,assain/rails,BlakeWilliams/rails,lcreid/rails,Stellenticket/rails,travisofthenorth/rails,rails/rails,bogdanvlviv/rails,assain/rails,prathamesh-sonpatki/rails,yhirano55/rails,yalab/rails,flanger001/rails,gfvcastro/rails,palkan/rails,georgeclaghorn/rails,deraru/rails,assain/rails,esparta/rails,lcreid/rails,Vasfed/rails,untidy-hair/rails,travisofthenorth/rails,kamipo/rails,rails/rails,Edouard-chin/rails,Stellenticket/rails,deraru/rails,flanger001/rails,yhirano55/rails,betesh/rails,Edouard-chin/rails,bogdanvlviv/rails,palkan/rails,gauravtiwari/rails,utilum/rails,pvalena/rails,flanger001/rails,utilum/rails,starknx/rails,lcreid/rails,tjschuck/rails,utilum/rails,illacceptanything/illacceptanything,schuetzm/rails,MSP-Greg/rails,pvalena/rails,starknx/rails,kmcphillips/rails,travisofthenorth/rails,arunagw/rails,illacceptanything/illacceptanything,baerjam/rails,fabianoleittes/rails,tjschuck/rails,vipulnsward/rails,yasslab/railsguides.jp,repinel/rails,Erol/rails,untidy-hair/rails,gauravtiwari/rails,felipecvo/rails,Envek/rails,arunagw/rails,baerjam/rails,mechanicles/rails,betesh/rails,Erol/rails,illacceptanything/illacceptanything,arunagw/rails,notapatch/rails,yalab/rails,rails/rails,EmmaB/rails-1,untidy-hair/rails,flanger001/rails,felipecvo/rails,bogdanvlviv/rails,prathamesh-sonpatki/rails,BlakeWilliams/rails,betesh/rails,illacceptanything/illacceptanything,illacceptanything/illacceptanything,shioyama/rails,EmmaB/rails-1,odedniv/rails,untidy-hair/rails,vipulnsward/rails,kddeisz/rails,Stellenticket/rails,yhirano55/rails,kirs/rails-1,illacceptanything/illacceptanything,aditya-kapoor/rails,BlakeWilliams/rails,MSP-Greg/rails,illacceptanything/illacceptanything,utilum/rails,eileencodes/rails,yalab/rails,yahonda/rails,illacceptanything/illacceptanything,brchristian/rails,yawboakye/rails,rafaelfranca/omg-rails,kddeisz/rails,palkan/rails,iainbeeston/rails,gfvcastro/rails,printercu/rails,illacceptanything/illacceptanything,yawboakye/rails,joonyou/rails,jeremy/rails,printercu/rails,illacceptanything/illacceptanything,yawboakye/rails,mechanicles/rails,kmcphillips/rails,Edouard-chin/rails,Edouard-chin/rails,odedniv/rails,yahonda/rails,repinel/rails,pvalena/rails,deraru/rails,Stellenticket/rails,Erol/rails,jeremy/rails,gfvcastro/rails,brchristian/rails,yasslab/railsguides.jp,starknx/rails,illacceptanything/illacceptanything,tgxworld/rails,brchristian/rails,mohitnatoo/rails,illacceptanything/illacceptanything,jeremy/rails,Envek/rails,notapatch/rails,Envek/rails,illacceptanything/illacceptanything,shioyama/rails,gfvcastro/rails,iainbeeston/rails,joonyou/rails,kddeisz/rails,palkan/rails,esparta/rails,fabianoleittes/rails,repinel/rails,gauravtiwari/rails,kddeisz/rails,eileencodes/rails,georgeclaghorn/rails,mechanicles/rails,kamipo/rails,tgxworld/rails
ruby
## Code Before: require "service/shared_service_tests" require "uri" if SERVICE_CONFIGURATIONS[:azure] class ActiveStorage::Service::AzureStorageServiceTest < ActiveSupport::TestCase SERVICE = ActiveStorage::Service.configure(:azure, SERVICE_CONFIGURATIONS) include ActiveStorage::Service::SharedServiceTests test "signed URL generation" do url = @service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: ActiveStorage::Filename.new("avatar.png"), content_type: "image/png") assert_match(/(\S+)&rscd=inline%3B\+filename%3D%22avatar.png%22&rsct=image%2Fpng/, url) assert_match SERVICE_CONFIGURATIONS[:azure][:container], url end end else puts "Skipping Azure Storage Service tests because no Azure configuration was supplied" end ## Instruction: Fix `test "signed URL generation"` failure https://travis-ci.org/rails/rails/jobs/281044755#L5582-L5586 ## Code After: require "service/shared_service_tests" require "uri" if SERVICE_CONFIGURATIONS[:azure] class ActiveStorage::Service::AzureStorageServiceTest < ActiveSupport::TestCase SERVICE = ActiveStorage::Service.configure(:azure, SERVICE_CONFIGURATIONS) include ActiveStorage::Service::SharedServiceTests test "signed URL generation" do url = @service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: ActiveStorage::Filename.new("avatar.png"), content_type: "image/png") assert_match(/(\S+)&rscd=inline%3B\+filename%3D%22avatar\.png%22%3B\+filename\*%3DUTF-8%27%27avatar\.png&rsct=image%2Fpng/, url) assert_match SERVICE_CONFIGURATIONS[:azure][:container], url end end else puts "Skipping Azure Storage Service tests because no Azure configuration was supplied" end
require "service/shared_service_tests" require "uri" if SERVICE_CONFIGURATIONS[:azure] class ActiveStorage::Service::AzureStorageServiceTest < ActiveSupport::TestCase SERVICE = ActiveStorage::Service.configure(:azure, SERVICE_CONFIGURATIONS) include ActiveStorage::Service::SharedServiceTests test "signed URL generation" do url = @service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: ActiveStorage::Filename.new("avatar.png"), content_type: "image/png") - assert_match(/(\S+)&rscd=inline%3B\+filename%3D%22avatar.png%22&rsct=image%2Fpng/, url) + assert_match(/(\S+)&rscd=inline%3B\+filename%3D%22avatar\.png%22%3B\+filename\*%3DUTF-8%27%27avatar\.png&rsct=image%2Fpng/, url) ? + ++++++++++++++++++++++++++++++++++++++++ assert_match SERVICE_CONFIGURATIONS[:azure][:container], url end end else puts "Skipping Azure Storage Service tests because no Azure configuration was supplied" end
2
0.095238
1
1
cc9a4b3ea9a1d5cec1b4da0f3611216173b5d05e
spec/server-pure/helpers.js
spec/server-pure/helpers.js
var requirejs = require('requirejs'); var path = require('path'); require('backbone').$ = require('jquery'); requirejs.config({ baseUrl: path.join(process.cwd(), 'app') }); requirejs.config(requirejs('config'));
var requirejs = require('requirejs'); var path = require('path'); require('backbone').$ = require('jquery'); requirejs.config({ baseUrl: path.join(process.cwd(), 'app') }); requirejs.config(requirejs('config')); global._ = require('lodash'); global.isServer = true; global.config = {};
Add global vars to server-side test helper
Add global vars to server-side test helper Some global properties are required by modules, so we need to set them to default values in the setup for server-side tests.
JavaScript
mit
keithiopia/spotlight,keithiopia/spotlight,alphagov/spotlight,keithiopia/spotlight,alphagov/spotlight,tijmenb/spotlight,tijmenb/spotlight,alphagov/spotlight,tijmenb/spotlight
javascript
## Code Before: var requirejs = require('requirejs'); var path = require('path'); require('backbone').$ = require('jquery'); requirejs.config({ baseUrl: path.join(process.cwd(), 'app') }); requirejs.config(requirejs('config')); ## Instruction: Add global vars to server-side test helper Some global properties are required by modules, so we need to set them to default values in the setup for server-side tests. ## Code After: var requirejs = require('requirejs'); var path = require('path'); require('backbone').$ = require('jquery'); requirejs.config({ baseUrl: path.join(process.cwd(), 'app') }); requirejs.config(requirejs('config')); global._ = require('lodash'); global.isServer = true; global.config = {};
var requirejs = require('requirejs'); var path = require('path'); require('backbone').$ = require('jquery'); requirejs.config({ baseUrl: path.join(process.cwd(), 'app') }); requirejs.config(requirejs('config')); + + global._ = require('lodash'); + global.isServer = true; + global.config = {};
4
0.4
4
0
3078537b6afc4256460b2ba5c38d60acb77445a2
pkgs/development/libraries/x264/default.nix
pkgs/development/libraries/x264/default.nix
{stdenv, fetchurl, yasm, enable10bit ? false}: stdenv.mkDerivation rec { version = "20141218-2245"; name = "x264-${version}"; src = fetchurl { url = "http://download.videolan.org/x264/snapshots/x264-snapshot-${version}-stable.tar.bz2"; sha256 = "1gp1f0382vh2hmgc23ldqyywcfljg8lsgl2849ymr14r6gxfh69m"; }; patchPhase = '' sed -i s,/bin/bash,${stdenv.shell}, configure version.sh ''; outputs = [ "out" "lib" ]; # leaving 52 kB of headers configureFlags = [ "--enable-shared" ] ++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic" ++ stdenv.lib.optional (enable10bit) "--bit-depth=10"; buildInputs = [ yasm ]; meta = with stdenv.lib; { description = "library for encoding H264/AVC video streams"; homepage = http://www.videolan.org/developers/x264.html; license = licenses.gpl2; platforms = platforms.unix; maintainers = [ maintainers.spwhitt ]; }; }
{stdenv, fetchurl, yasm, enable10bit ? false}: stdenv.mkDerivation rec { version = "20160615-2245"; name = "x264-${version}"; src = fetchurl { url = "http://download.videolan.org/x264/snapshots/x264-snapshot-${version}-stable.tar.bz2"; sha256 = "0w5l77gm8bsmafzimzyc5s27kcw79r6nai3bpccqy0spyxhjsdc2"; }; patchPhase = '' sed -i s,/bin/bash,${stdenv.shell}, configure version.sh ''; outputs = [ "out" "lib" ]; # leaving 52 kB of headers configureFlags = [ "--enable-shared" ] ++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic" ++ stdenv.lib.optional (enable10bit) "--bit-depth=10"; buildInputs = [ yasm ]; meta = with stdenv.lib; { description = "library for encoding H264/AVC video streams"; homepage = http://www.videolan.org/developers/x264.html; license = licenses.gpl2; platforms = platforms.unix; maintainers = [ maintainers.spwhitt ]; }; }
Update x264 to a recent snapshot (1,5 years update)
Update x264 to a recent snapshot (1,5 years update)
Nix
mit
SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs
nix
## Code Before: {stdenv, fetchurl, yasm, enable10bit ? false}: stdenv.mkDerivation rec { version = "20141218-2245"; name = "x264-${version}"; src = fetchurl { url = "http://download.videolan.org/x264/snapshots/x264-snapshot-${version}-stable.tar.bz2"; sha256 = "1gp1f0382vh2hmgc23ldqyywcfljg8lsgl2849ymr14r6gxfh69m"; }; patchPhase = '' sed -i s,/bin/bash,${stdenv.shell}, configure version.sh ''; outputs = [ "out" "lib" ]; # leaving 52 kB of headers configureFlags = [ "--enable-shared" ] ++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic" ++ stdenv.lib.optional (enable10bit) "--bit-depth=10"; buildInputs = [ yasm ]; meta = with stdenv.lib; { description = "library for encoding H264/AVC video streams"; homepage = http://www.videolan.org/developers/x264.html; license = licenses.gpl2; platforms = platforms.unix; maintainers = [ maintainers.spwhitt ]; }; } ## Instruction: Update x264 to a recent snapshot (1,5 years update) ## Code After: {stdenv, fetchurl, yasm, enable10bit ? false}: stdenv.mkDerivation rec { version = "20160615-2245"; name = "x264-${version}"; src = fetchurl { url = "http://download.videolan.org/x264/snapshots/x264-snapshot-${version}-stable.tar.bz2"; sha256 = "0w5l77gm8bsmafzimzyc5s27kcw79r6nai3bpccqy0spyxhjsdc2"; }; patchPhase = '' sed -i s,/bin/bash,${stdenv.shell}, configure version.sh ''; outputs = [ "out" "lib" ]; # leaving 52 kB of headers configureFlags = [ "--enable-shared" ] ++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic" ++ stdenv.lib.optional (enable10bit) "--bit-depth=10"; buildInputs = [ yasm ]; meta = with stdenv.lib; { description = "library for encoding H264/AVC video streams"; homepage = http://www.videolan.org/developers/x264.html; license = licenses.gpl2; platforms = platforms.unix; maintainers = [ maintainers.spwhitt ]; }; }
{stdenv, fetchurl, yasm, enable10bit ? false}: stdenv.mkDerivation rec { - version = "20141218-2245"; ? ^ ^^^ + version = "20160615-2245"; ? ^^^ ^ name = "x264-${version}"; src = fetchurl { url = "http://download.videolan.org/x264/snapshots/x264-snapshot-${version}-stable.tar.bz2"; - sha256 = "1gp1f0382vh2hmgc23ldqyywcfljg8lsgl2849ymr14r6gxfh69m"; + sha256 = "0w5l77gm8bsmafzimzyc5s27kcw79r6nai3bpccqy0spyxhjsdc2"; }; patchPhase = '' sed -i s,/bin/bash,${stdenv.shell}, configure version.sh ''; outputs = [ "out" "lib" ]; # leaving 52 kB of headers configureFlags = [ "--enable-shared" ] ++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic" ++ stdenv.lib.optional (enable10bit) "--bit-depth=10"; buildInputs = [ yasm ]; meta = with stdenv.lib; { description = "library for encoding H264/AVC video streams"; homepage = http://www.videolan.org/developers/x264.html; license = licenses.gpl2; platforms = platforms.unix; maintainers = [ maintainers.spwhitt ]; }; }
4
0.129032
2
2
57aabe3fb386d3067dad69c23a43572b4552e24b
_config.yml
_config.yml
url: http://jsonapi.org lsi: false source: . destination: ./public exclude: - Rakefile - README.md - Gemfile - Gemfile.lock - CNAME - .gitignore - ./public - ./stylesheets/*.scss markdown: redcarpet redcarpet: extensions: ["tables"] highlighter: pygments port: 9876 collections: format: output: true defaults: - scope: path: "" type: format values: layout: page show_sidebar: true is_spec_page: true latest_version: 1.0 # `safe `must be set false for jekyll-redirect-from # to run in development. (Github Pages will override # `safe` to be true on deploy, but it makes an # exception for jekyll-redirect from.) safe: false gems: - jekyll-redirect-from navigation: - title: JSON API url: / - title: Specification url: /format/ - title: Extensions url: /extensions/ - title: Recommendations url: /recommendations/ - title: Examples url: /examples/ - title: Implementations url: /implementations/ - title: FAQ url: /faq/ - title: About url: /about/ quicklinks: - title: View the specification url: /format/ - title: Contribute on GitHub url: https://github.com/json-api/json-api
url: http://jsonapi.org lsi: false source: . destination: ./public exclude: - Rakefile - README.md - Gemfile - Gemfile.lock - CNAME - .gitignore - ./public - ./stylesheets/*.scss markdown: redcarpet redcarpet: extensions: ["tables"] highlighter: pygments port: 9876 collections: format: output: true defaults: - scope: path: "" type: format values: layout: page show_sidebar: true is_spec_page: true latest_version: 1.0 excerpt_separator: "" # `safe `must be set false for jekyll-redirect-from # to run in development. (Github Pages will override # `safe` to be true on deploy, but it makes an # exception for jekyll-redirect from.) safe: false gems: - jekyll-redirect-from navigation: - title: JSON API url: / - title: Specification url: /format/ - title: Extensions url: /extensions/ - title: Recommendations url: /recommendations/ - title: Examples url: /examples/ - title: Implementations url: /implementations/ - title: FAQ url: /faq/ - title: About url: /about/ quicklinks: - title: View the specification url: /format/ - title: Contribute on GitHub url: https://github.com/json-api/json-api
Work around jekyll 2 -> 3 issue
Work around jekyll 2 -> 3 issue
YAML
cc0-1.0
RavelLaw/json-api,jamesdixon/json-api,beauby/json-api,RavelLaw/json-api,json-api/json-api,RavelLaw/json-api,beauby/json-api,jamesdixon/json-api,jamesdixon/json-api,json-api/json-api,json-api/json-api,RavelLaw/json-api,RavelLaw/json-api,json-api/json-api,beauby/json-api,json-api/json-api
yaml
## Code Before: url: http://jsonapi.org lsi: false source: . destination: ./public exclude: - Rakefile - README.md - Gemfile - Gemfile.lock - CNAME - .gitignore - ./public - ./stylesheets/*.scss markdown: redcarpet redcarpet: extensions: ["tables"] highlighter: pygments port: 9876 collections: format: output: true defaults: - scope: path: "" type: format values: layout: page show_sidebar: true is_spec_page: true latest_version: 1.0 # `safe `must be set false for jekyll-redirect-from # to run in development. (Github Pages will override # `safe` to be true on deploy, but it makes an # exception for jekyll-redirect from.) safe: false gems: - jekyll-redirect-from navigation: - title: JSON API url: / - title: Specification url: /format/ - title: Extensions url: /extensions/ - title: Recommendations url: /recommendations/ - title: Examples url: /examples/ - title: Implementations url: /implementations/ - title: FAQ url: /faq/ - title: About url: /about/ quicklinks: - title: View the specification url: /format/ - title: Contribute on GitHub url: https://github.com/json-api/json-api ## Instruction: Work around jekyll 2 -> 3 issue ## Code After: url: http://jsonapi.org lsi: false source: . destination: ./public exclude: - Rakefile - README.md - Gemfile - Gemfile.lock - CNAME - .gitignore - ./public - ./stylesheets/*.scss markdown: redcarpet redcarpet: extensions: ["tables"] highlighter: pygments port: 9876 collections: format: output: true defaults: - scope: path: "" type: format values: layout: page show_sidebar: true is_spec_page: true latest_version: 1.0 excerpt_separator: "" # `safe `must be set false for jekyll-redirect-from # to run in development. (Github Pages will override # `safe` to be true on deploy, but it makes an # exception for jekyll-redirect from.) safe: false gems: - jekyll-redirect-from navigation: - title: JSON API url: / - title: Specification url: /format/ - title: Extensions url: /extensions/ - title: Recommendations url: /recommendations/ - title: Examples url: /examples/ - title: Implementations url: /implementations/ - title: FAQ url: /faq/ - title: About url: /about/ quicklinks: - title: View the specification url: /format/ - title: Contribute on GitHub url: https://github.com/json-api/json-api
url: http://jsonapi.org lsi: false source: . destination: ./public exclude: - Rakefile - README.md - Gemfile - Gemfile.lock - CNAME - .gitignore - ./public - ./stylesheets/*.scss markdown: redcarpet redcarpet: extensions: ["tables"] highlighter: pygments port: 9876 collections: format: output: true defaults: - scope: path: "" type: format values: layout: page show_sidebar: true is_spec_page: true latest_version: 1.0 - + excerpt_separator: "" # `safe `must be set false for jekyll-redirect-from # to run in development. (Github Pages will override # `safe` to be true on deploy, but it makes an # exception for jekyll-redirect from.) safe: false gems: - jekyll-redirect-from navigation: - title: JSON API url: / - title: Specification url: /format/ - title: Extensions url: /extensions/ - title: Recommendations url: /recommendations/ - title: Examples url: /examples/ - title: Implementations url: /implementations/ - title: FAQ url: /faq/ - title: About url: /about/ quicklinks: - title: View the specification url: /format/ - title: Contribute on GitHub url: https://github.com/json-api/json-api
2
0.029851
1
1
39b01c20e59fb63231162b9d6adc214c0685b9a0
app/assets/javascripts/commons/bootstrap.js
app/assets/javascripts/commons/bootstrap.js
import $ from 'jquery'; // bootstrap jQuery plugins import 'bootstrap'; // custom jQuery functions $.fn.extend({ disable() { return $(this) .prop('disabled', true) .addClass('disabled'); }, enable() { return $(this) .prop('disabled', false) .removeClass('disabled'); }, });
import $ from 'jquery'; // bootstrap jQuery plugins import 'bootstrap'; // custom jQuery functions $.fn.extend({ disable() { return $(this) .prop('disabled', true) .addClass('disabled'); }, enable() { return $(this) .prop('disabled', false) .removeClass('disabled'); }, }); /* Starting with bootstrap 4.3.1, bootstrap sanitizes html used for tooltips / popovers. This extends the default whitelists with more elements / attributes: https://getbootstrap.com/docs/4.3/getting-started/javascript/#sanitizer */ const whitelist = $.fn.tooltip.Constructor.Default.whiteList; const inputAttributes = ['value', 'type']; const dataAttributes = [ 'data-toggle', 'data-placement', 'data-container', 'data-title', 'data-class', 'data-clipboard-text', 'data-placement', ]; // Whitelisting data attributes whitelist['*'] = [ ...whitelist['*'], ...dataAttributes, 'title', 'width height', 'abbr', 'datetime', 'name', 'width', 'height', ]; // Whitelist missing elements: whitelist.label = ['for']; whitelist.button = [...inputAttributes]; whitelist.input = [...inputAttributes]; whitelist.tt = []; whitelist.samp = []; whitelist.kbd = []; whitelist.var = []; whitelist.dfn = []; whitelist.cite = []; whitelist.big = []; whitelist.address = []; whitelist.dl = []; whitelist.dt = []; whitelist.dd = []; whitelist.abbr = []; whitelist.acronym = []; whitelist.blockquote = []; whitelist.del = []; whitelist.ins = []; whitelist['gl-emoji'] = []; // Whitelisting SVG tags and attributes whitelist.svg = ['viewBox']; whitelist.use = ['xlink:href']; whitelist.path = ['d'];
Whitelist additional elements and attributes
Whitelist additional elements and attributes Bootstrap 4.3.1 introduced sanitation for HTML popovers / tooltips. The rules are rather strict, so we extend the default whitelists with safe attributes / tags.
JavaScript
mit
iiet/iiet-git,mmkassem/gitlabhq,stoplightio/gitlabhq,mmkassem/gitlabhq,stoplightio/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,iiet/iiet-git,stoplightio/gitlabhq,mmkassem/gitlabhq,mmkassem/gitlabhq,iiet/iiet-git
javascript
## Code Before: import $ from 'jquery'; // bootstrap jQuery plugins import 'bootstrap'; // custom jQuery functions $.fn.extend({ disable() { return $(this) .prop('disabled', true) .addClass('disabled'); }, enable() { return $(this) .prop('disabled', false) .removeClass('disabled'); }, }); ## Instruction: Whitelist additional elements and attributes Bootstrap 4.3.1 introduced sanitation for HTML popovers / tooltips. The rules are rather strict, so we extend the default whitelists with safe attributes / tags. ## Code After: import $ from 'jquery'; // bootstrap jQuery plugins import 'bootstrap'; // custom jQuery functions $.fn.extend({ disable() { return $(this) .prop('disabled', true) .addClass('disabled'); }, enable() { return $(this) .prop('disabled', false) .removeClass('disabled'); }, }); /* Starting with bootstrap 4.3.1, bootstrap sanitizes html used for tooltips / popovers. This extends the default whitelists with more elements / attributes: https://getbootstrap.com/docs/4.3/getting-started/javascript/#sanitizer */ const whitelist = $.fn.tooltip.Constructor.Default.whiteList; const inputAttributes = ['value', 'type']; const dataAttributes = [ 'data-toggle', 'data-placement', 'data-container', 'data-title', 'data-class', 'data-clipboard-text', 'data-placement', ]; // Whitelisting data attributes whitelist['*'] = [ ...whitelist['*'], ...dataAttributes, 'title', 'width height', 'abbr', 'datetime', 'name', 'width', 'height', ]; // Whitelist missing elements: whitelist.label = ['for']; whitelist.button = [...inputAttributes]; whitelist.input = [...inputAttributes]; whitelist.tt = []; whitelist.samp = []; whitelist.kbd = []; whitelist.var = []; whitelist.dfn = []; whitelist.cite = []; whitelist.big = []; whitelist.address = []; whitelist.dl = []; whitelist.dt = []; whitelist.dd = []; whitelist.abbr = []; whitelist.acronym = []; whitelist.blockquote = []; whitelist.del = []; whitelist.ins = []; whitelist['gl-emoji'] = []; // Whitelisting SVG tags and attributes whitelist.svg = ['viewBox']; whitelist.use = ['xlink:href']; whitelist.path = ['d'];
import $ from 'jquery'; // bootstrap jQuery plugins import 'bootstrap'; // custom jQuery functions $.fn.extend({ disable() { return $(this) .prop('disabled', true) .addClass('disabled'); }, enable() { return $(this) .prop('disabled', false) .removeClass('disabled'); }, }); + + /* + Starting with bootstrap 4.3.1, bootstrap sanitizes html used for tooltips / popovers. + This extends the default whitelists with more elements / attributes: + https://getbootstrap.com/docs/4.3/getting-started/javascript/#sanitizer + */ + const whitelist = $.fn.tooltip.Constructor.Default.whiteList; + + const inputAttributes = ['value', 'type']; + + const dataAttributes = [ + 'data-toggle', + 'data-placement', + 'data-container', + 'data-title', + 'data-class', + 'data-clipboard-text', + 'data-placement', + ]; + + // Whitelisting data attributes + whitelist['*'] = [ + ...whitelist['*'], + ...dataAttributes, + 'title', + 'width height', + 'abbr', + 'datetime', + 'name', + 'width', + 'height', + ]; + + // Whitelist missing elements: + whitelist.label = ['for']; + whitelist.button = [...inputAttributes]; + whitelist.input = [...inputAttributes]; + + whitelist.tt = []; + whitelist.samp = []; + whitelist.kbd = []; + whitelist.var = []; + whitelist.dfn = []; + whitelist.cite = []; + whitelist.big = []; + whitelist.address = []; + whitelist.dl = []; + whitelist.dt = []; + whitelist.dd = []; + whitelist.abbr = []; + whitelist.acronym = []; + whitelist.blockquote = []; + whitelist.del = []; + whitelist.ins = []; + whitelist['gl-emoji'] = []; + + // Whitelisting SVG tags and attributes + whitelist.svg = ['viewBox']; + whitelist.use = ['xlink:href']; + whitelist.path = ['d'];
60
3.333333
60
0
2915ce66f0d828919f436320897f5dea89c4859a
src/core/events.js
src/core/events.js
import EventEmitter from 'eventemitter2' import store from '../store/store' import { actions } from '../store/actions' const events = new EventEmitter() store.subscribe(handleEvent) const authenticated = (state) => state.globals.authenticated const hasDocumentCaptured = (state) => state.globals.hasDocumentCaptured const hasFaceCaptured = (state) => state.globals.hasFaceCaptured function handleEvent () { const state = store.getState() const { documentCaptures, faceCaptures } = state const data = { documentCaptures: documentCaptures[0] || null, faceCaptures: faceCaptures[0] || null } if (authenticated(state)) { events.emit('ready') } if (hasDocumentCaptured(state)) { events.emit('documentCapture', data) } if (hasFaceCaptured(state)) { events.emit('faceCapture', data) } if (hasDocumentCaptured(state) && hasFaceCaptured(state)) { events.emit('complete', data) } } events.getCaptures = () => { const state = store.getState() const { documentCaptures, faceCaptures } = state const data = { documentCapture: documentCaptures[0] || null, faceCapture: faceCaptures[0] || null } return data } export default events
import EventEmitter from 'eventemitter2' import store from '../store/store' import { actions } from '../store/actions' const events = new EventEmitter() store.subscribe(handleEvent) const authenticated = (state) => state.globals.authenticated const hasDocumentCaptured = (state) => state.globals.hasDocumentCaptured const hasFaceCaptured = (state) => state.globals.hasFaceCaptured function handleEvent () { const state = store.getState() const { documentCaptures, faceCaptures } = state const data = { documentCaptures: documentCaptures[0] || null, faceCaptures: faceCaptures[0] || null } if (authenticated(state)) { events.emit('ready') } if (hasDocumentCaptured(state)) { events.emit('documentCapture', data) } if (hasFaceCaptured(state)) { events.emit('faceCapture', data) } if (hasDocumentCaptured(state) && hasFaceCaptured(state)) { events.emit('complete', data) } } events.getCaptures = () => { const state = store.getState() const { documentCaptures, faceCaptures } = state const filterValid = (capture) => capture.isValid const [ documentCapture ] = documentCaptures.filter(filterValid) const [ faceCapture ] = faceCaptures.filter(filterValid) const data = { documentCapture: (documentCapture || null), faceCapture: (faceCapture || null) } return data } export default events
Add filter on getCaptures to only return valid captures
Add filter on getCaptures to only return valid captures
JavaScript
mit
onfido/onfido-sdk-core
javascript
## Code Before: import EventEmitter from 'eventemitter2' import store from '../store/store' import { actions } from '../store/actions' const events = new EventEmitter() store.subscribe(handleEvent) const authenticated = (state) => state.globals.authenticated const hasDocumentCaptured = (state) => state.globals.hasDocumentCaptured const hasFaceCaptured = (state) => state.globals.hasFaceCaptured function handleEvent () { const state = store.getState() const { documentCaptures, faceCaptures } = state const data = { documentCaptures: documentCaptures[0] || null, faceCaptures: faceCaptures[0] || null } if (authenticated(state)) { events.emit('ready') } if (hasDocumentCaptured(state)) { events.emit('documentCapture', data) } if (hasFaceCaptured(state)) { events.emit('faceCapture', data) } if (hasDocumentCaptured(state) && hasFaceCaptured(state)) { events.emit('complete', data) } } events.getCaptures = () => { const state = store.getState() const { documentCaptures, faceCaptures } = state const data = { documentCapture: documentCaptures[0] || null, faceCapture: faceCaptures[0] || null } return data } export default events ## Instruction: Add filter on getCaptures to only return valid captures ## Code After: import EventEmitter from 'eventemitter2' import store from '../store/store' import { actions } from '../store/actions' const events = new EventEmitter() store.subscribe(handleEvent) const authenticated = (state) => state.globals.authenticated const hasDocumentCaptured = (state) => state.globals.hasDocumentCaptured const hasFaceCaptured = (state) => state.globals.hasFaceCaptured function handleEvent () { const state = store.getState() const { documentCaptures, faceCaptures } = state const data = { documentCaptures: documentCaptures[0] || null, faceCaptures: faceCaptures[0] || null } if (authenticated(state)) { events.emit('ready') } if (hasDocumentCaptured(state)) { events.emit('documentCapture', data) } if (hasFaceCaptured(state)) { events.emit('faceCapture', data) } if (hasDocumentCaptured(state) && hasFaceCaptured(state)) { events.emit('complete', data) } } events.getCaptures = () => { const state = store.getState() const { documentCaptures, faceCaptures } = state const filterValid = (capture) => capture.isValid const [ documentCapture ] = documentCaptures.filter(filterValid) const [ faceCapture ] = faceCaptures.filter(filterValid) const data = { documentCapture: (documentCapture || null), faceCapture: (faceCapture || null) } return data } export default events
import EventEmitter from 'eventemitter2' import store from '../store/store' import { actions } from '../store/actions' const events = new EventEmitter() store.subscribe(handleEvent) const authenticated = (state) => state.globals.authenticated const hasDocumentCaptured = (state) => state.globals.hasDocumentCaptured const hasFaceCaptured = (state) => state.globals.hasFaceCaptured function handleEvent () { const state = store.getState() const { documentCaptures, faceCaptures } = state const data = { documentCaptures: documentCaptures[0] || null, faceCaptures: faceCaptures[0] || null } if (authenticated(state)) { events.emit('ready') } if (hasDocumentCaptured(state)) { events.emit('documentCapture', data) } if (hasFaceCaptured(state)) { events.emit('faceCapture', data) } if (hasDocumentCaptured(state) && hasFaceCaptured(state)) { events.emit('complete', data) } } events.getCaptures = () => { const state = store.getState() const { documentCaptures, faceCaptures } = state + const filterValid = (capture) => capture.isValid + const [ documentCapture ] = documentCaptures.filter(filterValid) + const [ faceCapture ] = faceCaptures.filter(filterValid) const data = { - documentCapture: documentCaptures[0] || null, ? ---- + documentCapture: (documentCapture || null), ? + + - faceCapture: faceCaptures[0] || null ? ---- + faceCapture: (faceCapture || null) ? + + } return data } export default events
7
0.162791
5
2
e7e3580794c354e03ed410f4608b4182a36ba43d
.travis.yml
.travis.yml
language: node_js node_js: - "4" cache: directories: - node_modules services: - mysql before_script: - mysql -e 'create database sequelize_tokenify_test;' branches: only: - master
language: node_js node_js: - "5" - "5.1" - "4" - "4.2" - "4.1" - "4.0" - "0.12" cache: directories: - node_modules services: - mysql before_script: - mysql -e 'create database sequelize_tokenify_test;' branches: only: - master
Test module on different node versions
Test module on different node versions
YAML
mit
pipll/sequelize-tokenify
yaml
## Code Before: language: node_js node_js: - "4" cache: directories: - node_modules services: - mysql before_script: - mysql -e 'create database sequelize_tokenify_test;' branches: only: - master ## Instruction: Test module on different node versions ## Code After: language: node_js node_js: - "5" - "5.1" - "4" - "4.2" - "4.1" - "4.0" - "0.12" cache: directories: - node_modules services: - mysql before_script: - mysql -e 'create database sequelize_tokenify_test;' branches: only: - master
language: node_js node_js: + - "5" + - "5.1" - "4" + - "4.2" + - "4.1" + - "4.0" + - "0.12" cache: directories: - node_modules services: - mysql before_script: - mysql -e 'create database sequelize_tokenify_test;' branches: only: - master
6
0.461538
6
0
e8547caaf574ff5b7b31dcde9cc898a6304dbb22
_posts/2016-05-14-es2015-functional-code-snippets.md
_posts/2016-05-14-es2015-functional-code-snippets.md
--- layout: post title: "ES2015 code snippets using pure functions" subtitle: "Functional code snippets for commonly used utility methods using ES2015" date: 2016-05-14 11:00:00 author: "Aditya Pratap Singh" header-img: "img/dist/home-bg.jpg" --- 1. Pure `map()` function {% gist af83cc5037590bd4ca7ad3072342dd83 map.js %} 2. Pure `len()` function {% gist af83cc5037590bd4ca7ad3072342dd83 len.js %} 3. Pure `range()` function {% gist af83cc5037590bd4ca7ad3072342dd83 range.js %}
--- layout: post title: "ES2015 code snippets using pure functions" subtitle: "Functional code snippets for commonly used utility methods using ES2015" date: 2016-05-14 11:00:00 author: "Aditya Pratap Singh" header-img: "img/dist/home-bg.jpg" --- 1. Pure `map()` function {% gist af83cc5037590bd4ca7ad3072342dd83 map.js %} 2. Pure `len()` function {% gist af83cc5037590bd4ca7ad3072342dd83 len.js %} 3. Pure `range()` function {% gist af83cc5037590bd4ca7ad3072342dd83 range.js %}
Fix the indentation and ordered list numbers
Fix the indentation and ordered list numbers
Markdown
apache-2.0
addi90/personal-blog,addi90/personal-blog,addi90/personal-blog
markdown
## Code Before: --- layout: post title: "ES2015 code snippets using pure functions" subtitle: "Functional code snippets for commonly used utility methods using ES2015" date: 2016-05-14 11:00:00 author: "Aditya Pratap Singh" header-img: "img/dist/home-bg.jpg" --- 1. Pure `map()` function {% gist af83cc5037590bd4ca7ad3072342dd83 map.js %} 2. Pure `len()` function {% gist af83cc5037590bd4ca7ad3072342dd83 len.js %} 3. Pure `range()` function {% gist af83cc5037590bd4ca7ad3072342dd83 range.js %} ## Instruction: Fix the indentation and ordered list numbers ## Code After: --- layout: post title: "ES2015 code snippets using pure functions" subtitle: "Functional code snippets for commonly used utility methods using ES2015" date: 2016-05-14 11:00:00 author: "Aditya Pratap Singh" header-img: "img/dist/home-bg.jpg" --- 1. Pure `map()` function {% gist af83cc5037590bd4ca7ad3072342dd83 map.js %} 2. Pure `len()` function {% gist af83cc5037590bd4ca7ad3072342dd83 len.js %} 3. Pure `range()` function {% gist af83cc5037590bd4ca7ad3072342dd83 range.js %}
--- layout: post title: "ES2015 code snippets using pure functions" subtitle: "Functional code snippets for commonly used utility methods using ES2015" date: 2016-05-14 11:00:00 author: "Aditya Pratap Singh" header-img: "img/dist/home-bg.jpg" --- 1. Pure `map()` function - {% gist af83cc5037590bd4ca7ad3072342dd83 map.js %} + {% gist af83cc5037590bd4ca7ad3072342dd83 map.js %} ? ++++ + 2. Pure `len()` function - {% gist af83cc5037590bd4ca7ad3072342dd83 len.js %} + {% gist af83cc5037590bd4ca7ad3072342dd83 len.js %} ? ++++ + 3. Pure `range()` function - {% gist af83cc5037590bd4ca7ad3072342dd83 range.js %} + {% gist af83cc5037590bd4ca7ad3072342dd83 range.js %} ? ++++ + +
10
0.5
7
3
6db3d650400a1c2cdcf1262576a4e9790efa3137
Casks/myo-connect.rb
Casks/myo-connect.rb
cask :v1 => 'myo-connect' do version '0.9.0' sha256 '831d997d2ca0624d01da4bba39ba859da5dfd5f20d793a484b24c978ebd7dbe3' # amazonaws.com is the official download host per the vendor homepage url "https://s3.amazonaws.com/thalmicdownloads/mac/#{version}/MyoConnect.dmg" name 'Myo Connect' homepage 'https://developer.thalmic.com' license :gratis tags :vendor => 'Thalmic Labs' app 'Myo Connect.app' zap :delete => '~/Library/Preferences/com.thalmic.Myo Connect.plist' end
cask :v1 => 'myo-connect' do version '0.14.0' sha256 '8469972d3223154b0a938f811adef142aade2e0d426f79bc0bbdbb27ea17071a' # amazonaws.com is the official download host per the vendor homepage url "https://s3.amazonaws.com/thalmicdownloads/mac/#{version}/MyoConnect.dmg" name 'Myo Connect' homepage 'https://developer.thalmic.com' license :gratis tags :vendor => 'Thalmic Labs' app 'Myo Connect.app' zap :delete => '~/Library/Preferences/com.thalmic.Myo Connect.plist' end
Upgrade Myo Connect.app to v0.14.0
Upgrade Myo Connect.app to v0.14.0
Ruby
bsd-2-clause
napaxton/homebrew-cask,robertgzr/homebrew-cask,nicolas-brousse/homebrew-cask,mattrobenolt/homebrew-cask,Hywan/homebrew-cask,theoriginalgri/homebrew-cask,johndbritton/homebrew-cask,artdevjs/homebrew-cask,jalaziz/homebrew-cask,andrewdisley/homebrew-cask,malob/homebrew-cask,tranc99/homebrew-cask,gyugyu/homebrew-cask,dieterdemeyer/homebrew-cask,kevyau/homebrew-cask,mgryszko/homebrew-cask,helloIAmPau/homebrew-cask,puffdad/homebrew-cask,enriclluelles/homebrew-cask,antogg/homebrew-cask,lukeadams/homebrew-cask,SamiHiltunen/homebrew-cask,vigosan/homebrew-cask,crmne/homebrew-cask,wickedsp1d3r/homebrew-cask,Fedalto/homebrew-cask,githubutilities/homebrew-cask,jrwesolo/homebrew-cask,ctrevino/homebrew-cask,reelsense/homebrew-cask,bchatard/homebrew-cask,unasuke/homebrew-cask,ywfwj2008/homebrew-cask,aguynamedryan/homebrew-cask,pkq/homebrew-cask,josa42/homebrew-cask,jen20/homebrew-cask,leonmachadowilcox/homebrew-cask,inta/homebrew-cask,djakarta-trap/homebrew-myCask,lolgear/homebrew-cask,robertgzr/homebrew-cask,RickWong/homebrew-cask,colindean/homebrew-cask,adelinofaria/homebrew-cask,zerrot/homebrew-cask,yuhki50/homebrew-cask,n0ts/homebrew-cask,lolgear/homebrew-cask,illusionfield/homebrew-cask,norio-nomura/homebrew-cask,jacobdam/homebrew-cask,kassi/homebrew-cask,CameronGarrett/homebrew-cask,imgarylai/homebrew-cask,adrianchia/homebrew-cask,norio-nomura/homebrew-cask,xtian/homebrew-cask,sjackman/homebrew-cask,nathanielvarona/homebrew-cask,larseggert/homebrew-cask,ayohrling/homebrew-cask,Fedalto/homebrew-cask,mjgardner/homebrew-cask,Bombenleger/homebrew-cask,jmeridth/homebrew-cask,Keloran/homebrew-cask,Dremora/homebrew-cask,tsparber/homebrew-cask,neverfox/homebrew-cask,coneman/homebrew-cask,joschi/homebrew-cask,adrianchia/homebrew-cask,usami-k/homebrew-cask,syscrusher/homebrew-cask,gabrielizaias/homebrew-cask,jen20/homebrew-cask,sscotth/homebrew-cask,Amorymeltzer/homebrew-cask,sebcode/homebrew-cask,supriyantomaftuh/homebrew-cask,kostasdizas/homebrew-cask,epmatsw/homebrew-cask,Amorymeltzer/homebrew-cask,danielbayley/homebrew-cask,cliffcotino/homebrew-cask,lukasbestle/homebrew-cask,underyx/homebrew-cask,brianshumate/homebrew-cask,deiga/homebrew-cask,mkozjak/homebrew-cask,Saklad5/homebrew-cask,cprecioso/homebrew-cask,jasmas/homebrew-cask,imgarylai/homebrew-cask,scottsuch/homebrew-cask,Cottser/homebrew-cask,gyndav/homebrew-cask,jonathanwiesel/homebrew-cask,miguelfrde/homebrew-cask,markhuber/homebrew-cask,christer155/homebrew-cask,klane/homebrew-cask,stevenmaguire/homebrew-cask,fanquake/homebrew-cask,ksylvan/homebrew-cask,thomanq/homebrew-cask,bkono/homebrew-cask,reitermarkus/homebrew-cask,diogodamiani/homebrew-cask,jayshao/homebrew-cask,winkelsdorf/homebrew-cask,tmoreira2020/homebrew,mahori/homebrew-cask,tarwich/homebrew-cask,victorpopkov/homebrew-cask,farmerchris/homebrew-cask,wuman/homebrew-cask,nathanielvarona/homebrew-cask,moonboots/homebrew-cask,guerrero/homebrew-cask,decrement/homebrew-cask,FranklinChen/homebrew-cask,gerrypower/homebrew-cask,codeurge/homebrew-cask,bgandon/homebrew-cask,BahtiyarB/homebrew-cask,jgarber623/homebrew-cask,malford/homebrew-cask,arronmabrey/homebrew-cask,kTitan/homebrew-cask,blogabe/homebrew-cask,bkono/homebrew-cask,renaudguerin/homebrew-cask,moonboots/homebrew-cask,jgarber623/homebrew-cask,tan9/homebrew-cask,colindunn/homebrew-cask,stonehippo/homebrew-cask,kievechua/homebrew-cask,riyad/homebrew-cask,mjgardner/homebrew-cask,afh/homebrew-cask,lalyos/homebrew-cask,kassi/homebrew-cask,FinalDes/homebrew-cask,vitorgalvao/homebrew-cask,artdevjs/homebrew-cask,usami-k/homebrew-cask,mahori/homebrew-cask,rubenerd/homebrew-cask,chino/homebrew-cask,phpwutz/homebrew-cask,kamilboratynski/homebrew-cask,giannitm/homebrew-cask,barravi/homebrew-cask,6uclz1/homebrew-cask,jeroenj/homebrew-cask,howie/homebrew-cask,zeusdeux/homebrew-cask,m3nu/homebrew-cask,supriyantomaftuh/homebrew-cask,coeligena/homebrew-customized,julionc/homebrew-cask,cfillion/homebrew-cask,xyb/homebrew-cask,xakraz/homebrew-cask,cclauss/homebrew-cask,patresi/homebrew-cask,moimikey/homebrew-cask,scottsuch/homebrew-cask,johnjelinek/homebrew-cask,a-x-/homebrew-cask,inz/homebrew-cask,xakraz/homebrew-cask,dcondrey/homebrew-cask,englishm/homebrew-cask,tangestani/homebrew-cask,MircoT/homebrew-cask,ywfwj2008/homebrew-cask,aguynamedryan/homebrew-cask,djakarta-trap/homebrew-myCask,Ngrd/homebrew-cask,nathansgreen/homebrew-cask,renard/homebrew-cask,morganestes/homebrew-cask,guylabs/homebrew-cask,klane/homebrew-cask,bosr/homebrew-cask,RJHsiao/homebrew-cask,kongslund/homebrew-cask,napaxton/homebrew-cask,3van/homebrew-cask,y00rb/homebrew-cask,af/homebrew-cask,michelegera/homebrew-cask,mauricerkelly/homebrew-cask,gilesdring/homebrew-cask,daften/homebrew-cask,tjnycum/homebrew-cask,optikfluffel/homebrew-cask,hyuna917/homebrew-cask,larseggert/homebrew-cask,ksato9700/homebrew-cask,shanonvl/homebrew-cask,zhuzihhhh/homebrew-cask,bric3/homebrew-cask,JikkuJose/homebrew-cask,xyb/homebrew-cask,wKovacs64/homebrew-cask,albertico/homebrew-cask,coneman/homebrew-cask,schneidmaster/homebrew-cask,n8henrie/homebrew-cask,danielbayley/homebrew-cask,d/homebrew-cask,MisumiRize/homebrew-cask,Ephemera/homebrew-cask,toonetown/homebrew-cask,mathbunnyru/homebrew-cask,sgnh/homebrew-cask,kei-yamazaki/homebrew-cask,0rax/homebrew-cask,BenjaminHCCarr/homebrew-cask,gurghet/homebrew-cask,skatsuta/homebrew-cask,mariusbutuc/homebrew-cask,kamilboratynski/homebrew-cask,forevergenin/homebrew-cask,tangestani/homebrew-cask,Cottser/homebrew-cask,tedski/homebrew-cask,MichaelPei/homebrew-cask,atsuyim/homebrew-cask,yuhki50/homebrew-cask,kteru/homebrew-cask,pablote/homebrew-cask,troyxmccall/homebrew-cask,optikfluffel/homebrew-cask,fanquake/homebrew-cask,mchlrmrz/homebrew-cask,tedbundyjr/homebrew-cask,CameronGarrett/homebrew-cask,tedski/homebrew-cask,mwek/homebrew-cask,christophermanning/homebrew-cask,JosephViolago/homebrew-cask,feigaochn/homebrew-cask,greg5green/homebrew-cask,d/homebrew-cask,hanxue/caskroom,elyscape/homebrew-cask,stigkj/homebrew-caskroom-cask,lukeadams/homebrew-cask,shishi/homebrew-cask,dwkns/homebrew-cask,josa42/homebrew-cask,zchee/homebrew-cask,pkq/homebrew-cask,spruceb/homebrew-cask,xight/homebrew-cask,wickles/homebrew-cask,gerrymiller/homebrew-cask,goxberry/homebrew-cask,n0ts/homebrew-cask,feigaochn/homebrew-cask,mgryszko/homebrew-cask,boecko/homebrew-cask,y00rb/homebrew-cask,syscrusher/homebrew-cask,mariusbutuc/homebrew-cask,alexg0/homebrew-cask,stevehedrick/homebrew-cask,yumitsu/homebrew-cask,chuanxd/homebrew-cask,xight/homebrew-cask,ldong/homebrew-cask,hanxue/caskroom,sjackman/homebrew-cask,asins/homebrew-cask,nrlquaker/homebrew-cask,kronicd/homebrew-cask,askl56/homebrew-cask,lumaxis/homebrew-cask,victorpopkov/homebrew-cask,singingwolfboy/homebrew-cask,jppelteret/homebrew-cask,FredLackeyOfficial/homebrew-cask,kesara/homebrew-cask,johan/homebrew-cask,MicTech/homebrew-cask,esebastian/homebrew-cask,chrisfinazzo/homebrew-cask,jppelteret/homebrew-cask,axodys/homebrew-cask,otaran/homebrew-cask,kTitan/homebrew-cask,santoshsahoo/homebrew-cask,taherio/homebrew-cask,hovancik/homebrew-cask,mazehall/homebrew-cask,frapposelli/homebrew-cask,fly19890211/homebrew-cask,codeurge/homebrew-cask,MoOx/homebrew-cask,sparrc/homebrew-cask,adriweb/homebrew-cask,retbrown/homebrew-cask,MerelyAPseudonym/homebrew-cask,antogg/homebrew-cask,kesara/homebrew-cask,akiomik/homebrew-cask,guylabs/homebrew-cask,ebraminio/homebrew-cask,lalyos/homebrew-cask,chrisfinazzo/homebrew-cask,BenjaminHCCarr/homebrew-cask,athrunsun/homebrew-cask,hovancik/homebrew-cask,chrisfinazzo/homebrew-cask,FinalDes/homebrew-cask,onlynone/homebrew-cask,jpmat296/homebrew-cask,christophermanning/homebrew-cask,nivanchikov/homebrew-cask,jpodlech/homebrew-cask,paulombcosta/homebrew-cask,Ketouem/homebrew-cask,jiashuw/homebrew-cask,pacav69/homebrew-cask,thii/homebrew-cask,lantrix/homebrew-cask,scribblemaniac/homebrew-cask,phpwutz/homebrew-cask,RogerThiede/homebrew-cask,diguage/homebrew-cask,JacopKane/homebrew-cask,timsutton/homebrew-cask,blainesch/homebrew-cask,farmerchris/homebrew-cask,nysthee/homebrew-cask,MichaelPei/homebrew-cask,hellosky806/homebrew-cask,mazehall/homebrew-cask,ahvigil/homebrew-cask,hackhandslabs/homebrew-cask,FranklinChen/homebrew-cask,stephenwade/homebrew-cask,jasmas/homebrew-cask,williamboman/homebrew-cask,haha1903/homebrew-cask,mathbunnyru/homebrew-cask,BenjaminHCCarr/homebrew-cask,tedbundyjr/homebrew-cask,shorshe/homebrew-cask,nathancahill/homebrew-cask,yurikoles/homebrew-cask,LaurentFough/homebrew-cask,mwilmer/homebrew-cask,franklouwers/homebrew-cask,nickpellant/homebrew-cask,JosephViolago/homebrew-cask,tjnycum/homebrew-cask,jayshao/homebrew-cask,lantrix/homebrew-cask,BahtiyarB/homebrew-cask,iamso/homebrew-cask,ptb/homebrew-cask,mjgardner/homebrew-cask,colindunn/homebrew-cask,mahori/homebrew-cask,bcomnes/homebrew-cask,scribblemaniac/homebrew-cask,linc01n/homebrew-cask,SentinelWarren/homebrew-cask,tsparber/homebrew-cask,kingthorin/homebrew-cask,leipert/homebrew-cask,jmeridth/homebrew-cask,jeroenseegers/homebrew-cask,casidiablo/homebrew-cask,rcuza/homebrew-cask,JikkuJose/homebrew-cask,slnovak/homebrew-cask,hvisage/homebrew-cask,chrisRidgers/homebrew-cask,yurrriq/homebrew-cask,gwaldo/homebrew-cask,mkozjak/homebrew-cask,rajiv/homebrew-cask,andersonba/homebrew-cask,thehunmonkgroup/homebrew-cask,xyb/homebrew-cask,shonjir/homebrew-cask,kirikiriyamama/homebrew-cask,shoichiaizawa/homebrew-cask,asbachb/homebrew-cask,miccal/homebrew-cask,nysthee/homebrew-cask,jbeagley52/homebrew-cask,jeanregisser/homebrew-cask,faun/homebrew-cask,jamesmlees/homebrew-cask,malford/homebrew-cask,alexg0/homebrew-cask,claui/homebrew-cask,ianyh/homebrew-cask,albertico/homebrew-cask,koenrh/homebrew-cask,bendoerr/homebrew-cask,wickedsp1d3r/homebrew-cask,vuquoctuan/homebrew-cask,dspeckhard/homebrew-cask,sohtsuka/homebrew-cask,axodys/homebrew-cask,kryhear/homebrew-cask,dictcp/homebrew-cask,Labutin/homebrew-cask,yurrriq/homebrew-cask,wayou/homebrew-cask,optikfluffel/homebrew-cask,tjnycum/homebrew-cask,Hywan/homebrew-cask,epmatsw/homebrew-cask,mwek/homebrew-cask,kingthorin/homebrew-cask,m3nu/homebrew-cask,dustinblackman/homebrew-cask,mrmachine/homebrew-cask,onlynone/homebrew-cask,skyyuan/homebrew-cask,elnappo/homebrew-cask,crzrcn/homebrew-cask,skyyuan/homebrew-cask,samshadwell/homebrew-cask,seanorama/homebrew-cask,hristozov/homebrew-cask,tranc99/homebrew-cask,mjdescy/homebrew-cask,qnm/homebrew-cask,MatzFan/homebrew-cask,brianshumate/homebrew-cask,singingwolfboy/homebrew-cask,sanchezm/homebrew-cask,MisumiRize/homebrew-cask,spruceb/homebrew-cask,ajbw/homebrew-cask,jrwesolo/homebrew-cask,thehunmonkgroup/homebrew-cask,jacobdam/homebrew-cask,illusionfield/homebrew-cask,aki77/homebrew-cask,bsiddiqui/homebrew-cask,kostasdizas/homebrew-cask,MatzFan/homebrew-cask,devmynd/homebrew-cask,mindriot101/homebrew-cask,arranubels/homebrew-cask,sirodoht/homebrew-cask,elnappo/homebrew-cask,miku/homebrew-cask,kolomiichenko/homebrew-cask,johnste/homebrew-cask,n8henrie/homebrew-cask,fkrone/homebrew-cask,RickWong/homebrew-cask,mikem/homebrew-cask,bendoerr/homebrew-cask,bcaceiro/homebrew-cask,dvdoliveira/homebrew-cask,perfide/homebrew-cask,morganestes/homebrew-cask,stephenwade/homebrew-cask,sgnh/homebrew-cask,julionc/homebrew-cask,cclauss/homebrew-cask,tyage/homebrew-cask,mjdescy/homebrew-cask,troyxmccall/homebrew-cask,nrlquaker/homebrew-cask,blainesch/homebrew-cask,mwilmer/homebrew-cask,ohammersmith/homebrew-cask,a1russell/homebrew-cask,malob/homebrew-cask,wastrachan/homebrew-cask,xcezx/homebrew-cask,iAmGhost/homebrew-cask,ninjahoahong/homebrew-cask,jedahan/homebrew-cask,Ketouem/homebrew-cask,renard/homebrew-cask,yutarody/homebrew-cask,akiomik/homebrew-cask,maxnordlund/homebrew-cask,alebcay/homebrew-cask,zorosteven/homebrew-cask,deiga/homebrew-cask,Labutin/homebrew-cask,shanonvl/homebrew-cask,chadcatlett/caskroom-homebrew-cask,jonathanwiesel/homebrew-cask,cohei/homebrew-cask,esebastian/homebrew-cask,fwiesel/homebrew-cask,crmne/homebrew-cask,Keloran/homebrew-cask,jacobbednarz/homebrew-cask,anbotero/homebrew-cask,feniix/homebrew-cask,reitermarkus/homebrew-cask,RogerThiede/homebrew-cask,stevehedrick/homebrew-cask,yutarody/homebrew-cask,shonjir/homebrew-cask,Amorymeltzer/homebrew-cask,kei-yamazaki/homebrew-cask,cobyism/homebrew-cask,zeusdeux/homebrew-cask,kolomiichenko/homebrew-cask,kuno/homebrew-cask,Nitecon/homebrew-cask,sosedoff/homebrew-cask,psibre/homebrew-cask,huanzhang/homebrew-cask,coeligena/homebrew-customized,taherio/homebrew-cask,kiliankoe/homebrew-cask,rubenerd/homebrew-cask,JacopKane/homebrew-cask,miku/homebrew-cask,gguillotte/homebrew-cask,genewoo/homebrew-cask,Nitecon/homebrew-cask,tolbkni/homebrew-cask,danielbayley/homebrew-cask,LaurentFough/homebrew-cask,lvicentesanchez/homebrew-cask,aktau/homebrew-cask,royalwang/homebrew-cask,andyli/homebrew-cask,moimikey/homebrew-cask,ldong/homebrew-cask,hackhandslabs/homebrew-cask,nickpellant/homebrew-cask,malob/homebrew-cask,cliffcotino/homebrew-cask,sscotth/homebrew-cask,hanxue/caskroom,tolbkni/homebrew-cask,gerrymiller/homebrew-cask,ianyh/homebrew-cask,Dremora/homebrew-cask,mlocher/homebrew-cask,ericbn/homebrew-cask,wuman/homebrew-cask,christer155/homebrew-cask,dwkns/homebrew-cask,doits/homebrew-cask,andyli/homebrew-cask,slack4u/homebrew-cask,nathanielvarona/homebrew-cask,arranubels/homebrew-cask,mingzhi22/homebrew-cask,nshemonsky/homebrew-cask,zchee/homebrew-cask,sirodoht/homebrew-cask,mishari/homebrew-cask,rajiv/homebrew-cask,jeroenseegers/homebrew-cask,miccal/homebrew-cask,pablote/homebrew-cask,paulbreslin/homebrew-cask,atsuyim/homebrew-cask,wesen/homebrew-cask,ddm/homebrew-cask,sanyer/homebrew-cask,bdhess/homebrew-cask,mwean/homebrew-cask,nathansgreen/homebrew-cask,skatsuta/homebrew-cask,frapposelli/homebrew-cask,cedwardsmedia/homebrew-cask,jaredsampson/homebrew-cask,leonmachadowilcox/homebrew-cask,imgarylai/homebrew-cask,okket/homebrew-cask,cobyism/homebrew-cask,samnung/homebrew-cask,moogar0880/homebrew-cask,cblecker/homebrew-cask,joschi/homebrew-cask,squid314/homebrew-cask,huanzhang/homebrew-cask,gibsjose/homebrew-cask,jconley/homebrew-cask,ericbn/homebrew-cask,fazo96/homebrew-cask,samshadwell/homebrew-cask,mokagio/homebrew-cask,asbachb/homebrew-cask,bosr/homebrew-cask,0rax/homebrew-cask,KosherBacon/homebrew-cask,jacobbednarz/homebrew-cask,jedahan/homebrew-cask,wmorin/homebrew-cask,amatos/homebrew-cask,JoelLarson/homebrew-cask,theoriginalgri/homebrew-cask,drostron/homebrew-cask,gabrielizaias/homebrew-cask,Ibuprofen/homebrew-cask,fazo96/homebrew-cask,esebastian/homebrew-cask,neverfox/homebrew-cask,af/homebrew-cask,johnste/homebrew-cask,lcasey001/homebrew-cask,markthetech/homebrew-cask,rogeriopradoj/homebrew-cask,johntrandall/homebrew-cask,vigosan/homebrew-cask,fharbe/homebrew-cask,dspeckhard/homebrew-cask,KosherBacon/homebrew-cask,scottsuch/homebrew-cask,Saklad5/homebrew-cask,cedwardsmedia/homebrew-cask,jhowtan/homebrew-cask,sanchezm/homebrew-cask,underyx/homebrew-cask,MicTech/homebrew-cask,alebcay/homebrew-cask,rhendric/homebrew-cask,stevenmaguire/homebrew-cask,royalwang/homebrew-cask,rcuza/homebrew-cask,jgarber623/homebrew-cask,Whoaa512/homebrew-cask,lumaxis/homebrew-cask,bsiddiqui/homebrew-cask,a1russell/homebrew-cask,mfpierre/homebrew-cask,mauricerkelly/homebrew-cask,vin047/homebrew-cask,jangalinski/homebrew-cask,Gasol/homebrew-cask,wastrachan/homebrew-cask,buo/homebrew-cask,renaudguerin/homebrew-cask,blogabe/homebrew-cask,MoOx/homebrew-cask,claui/homebrew-cask,howie/homebrew-cask,paour/homebrew-cask,nightscape/homebrew-cask,deanmorin/homebrew-cask,tmoreira2020/homebrew,jconley/homebrew-cask,gmkey/homebrew-cask,corbt/homebrew-cask,kpearson/homebrew-cask,afdnlw/homebrew-cask,nrlquaker/homebrew-cask,zhuzihhhh/homebrew-cask,markthetech/homebrew-cask,vuquoctuan/homebrew-cask,SamiHiltunen/homebrew-cask,flaviocamilo/homebrew-cask,ebraminio/homebrew-cask,pacav69/homebrew-cask,kryhear/homebrew-cask,stigkj/homebrew-caskroom-cask,nivanchikov/homebrew-cask,stonehippo/homebrew-cask,nightscape/homebrew-cask,linc01n/homebrew-cask,hristozov/homebrew-cask,opsdev-ws/homebrew-cask,dwihn0r/homebrew-cask,fly19890211/homebrew-cask,mhubig/homebrew-cask,shoichiaizawa/homebrew-cask,riyad/homebrew-cask,deanmorin/homebrew-cask,joshka/homebrew-cask,mattrobenolt/homebrew-cask,forevergenin/homebrew-cask,johan/homebrew-cask,wizonesolutions/homebrew-cask,lcasey001/homebrew-cask,jangalinski/homebrew-cask,lvicentesanchez/homebrew-cask,ahundt/homebrew-cask,mrmachine/homebrew-cask,uetchy/homebrew-cask,adelinofaria/homebrew-cask,lucasmezencio/homebrew-cask,pkq/homebrew-cask,danielgomezrico/homebrew-cask,andrewdisley/homebrew-cask,mindriot101/homebrew-cask,wKovacs64/homebrew-cask,aki77/homebrew-cask,tjt263/homebrew-cask,astorije/homebrew-cask,joshka/homebrew-cask,afh/homebrew-cask,kesara/homebrew-cask,unasuke/homebrew-cask,inz/homebrew-cask,timsutton/homebrew-cask,kpearson/homebrew-cask,faun/homebrew-cask,ohammersmith/homebrew-cask,tjt263/homebrew-cask,mathbunnyru/homebrew-cask,pinut/homebrew-cask,seanorama/homebrew-cask,miguelfrde/homebrew-cask,Bombenleger/homebrew-cask,haha1903/homebrew-cask,dictcp/homebrew-cask,alebcay/homebrew-cask,paour/homebrew-cask,FredLackeyOfficial/homebrew-cask,exherb/homebrew-cask,gyndav/homebrew-cask,Gasol/homebrew-cask,bric3/homebrew-cask,jeanregisser/homebrew-cask,wesen/homebrew-cask,ftiff/homebrew-cask,JacopKane/homebrew-cask,dunn/homebrew-cask,lifepillar/homebrew-cask,gyndav/homebrew-cask,diogodamiani/homebrew-cask,MircoT/homebrew-cask,boydj/homebrew-cask,barravi/homebrew-cask,mlocher/homebrew-cask,koenrh/homebrew-cask,wickles/homebrew-cask,RJHsiao/homebrew-cask,jalaziz/homebrew-cask,englishm/homebrew-cask,ddm/homebrew-cask,moogar0880/homebrew-cask,markhuber/homebrew-cask,ptb/homebrew-cask,perfide/homebrew-cask,wmorin/homebrew-cask,exherb/homebrew-cask,blogabe/homebrew-cask,johnjelinek/homebrew-cask,nathancahill/homebrew-cask,elyscape/homebrew-cask,pinut/homebrew-cask,winkelsdorf/homebrew-cask,seanzxx/homebrew-cask,retrography/homebrew-cask,slnovak/homebrew-cask,reelsense/homebrew-cask,lucasmezencio/homebrew-cask,ksylvan/homebrew-cask,seanzxx/homebrew-cask,qbmiller/homebrew-cask,ksato9700/homebrew-cask,greg5green/homebrew-cask,antogg/homebrew-cask,gibsjose/homebrew-cask,dieterdemeyer/homebrew-cask,jawshooah/homebrew-cask,johndbritton/homebrew-cask,ahvigil/homebrew-cask,kongslund/homebrew-cask,jbeagley52/homebrew-cask,giannitm/homebrew-cask,asins/homebrew-cask,kuno/homebrew-cask,jiashuw/homebrew-cask,opsdev-ws/homebrew-cask,buo/homebrew-cask,iAmGhost/homebrew-cask,lukasbestle/homebrew-cask,retrography/homebrew-cask,uetchy/homebrew-cask,mfpierre/homebrew-cask,wizonesolutions/homebrew-cask,ftiff/homebrew-cask,kiliankoe/homebrew-cask,helloIAmPau/homebrew-cask,jalaziz/homebrew-cask,yumitsu/homebrew-cask,boecko/homebrew-cask,jellyfishcoder/homebrew-cask,leipert/homebrew-cask,mishari/homebrew-cask,adriweb/homebrew-cask,13k/homebrew-cask,uetchy/homebrew-cask,gurghet/homebrew-cask,AnastasiaSulyagina/homebrew-cask,drostron/homebrew-cask,mattfelsen/homebrew-cask,vitorgalvao/homebrew-cask,remko/homebrew-cask,nicolas-brousse/homebrew-cask,mchlrmrz/homebrew-cask,mattfelsen/homebrew-cask,samdoran/homebrew-cask,corbt/homebrew-cask,0xadada/homebrew-cask,dwihn0r/homebrew-cask,caskroom/homebrew-cask,enriclluelles/homebrew-cask,patresi/homebrew-cask,My2ndAngelic/homebrew-cask,jhowtan/homebrew-cask,zmwangx/homebrew-cask,scw/homebrew-cask,bric3/homebrew-cask,ahundt/homebrew-cask,xcezx/homebrew-cask,cblecker/homebrew-cask,JosephViolago/homebrew-cask,janlugt/homebrew-cask,inta/homebrew-cask,cfillion/homebrew-cask,tarwich/homebrew-cask,shonjir/homebrew-cask,arronmabrey/homebrew-cask,jellyfishcoder/homebrew-cask,rickychilcott/homebrew-cask,shishi/homebrew-cask,lauantai/homebrew-cask,reitermarkus/homebrew-cask,thii/homebrew-cask,stephenwade/homebrew-cask,andrewdisley/homebrew-cask,kkdd/homebrew-cask,ajbw/homebrew-cask,dunn/homebrew-cask,Whoaa512/homebrew-cask,sparrc/homebrew-cask,hakamadare/homebrew-cask,josa42/homebrew-cask,JoelLarson/homebrew-cask,vin047/homebrew-cask,diguage/homebrew-cask,coeligena/homebrew-customized,a-x-/homebrew-cask,epardee/homebrew-cask,michelegera/homebrew-cask,epardee/homebrew-cask,0xadada/homebrew-cask,casidiablo/homebrew-cask,dvdoliveira/homebrew-cask,flaviocamilo/homebrew-cask,katoquro/homebrew-cask,neil-ca-moore/homebrew-cask,samnung/homebrew-cask,scw/homebrew-cask,mchlrmrz/homebrew-cask,genewoo/homebrew-cask,paour/homebrew-cask,crzrcn/homebrew-cask,3van/homebrew-cask,Ibuprofen/homebrew-cask,bgandon/homebrew-cask,rajiv/homebrew-cask,githubutilities/homebrew-cask,mingzhi22/homebrew-cask,chadcatlett/caskroom-homebrew-cask,MerelyAPseudonym/homebrew-cask,afdnlw/homebrew-cask,johntrandall/homebrew-cask,neverfox/homebrew-cask,tangestani/homebrew-cask,caskroom/homebrew-cask,claui/homebrew-cask,kevyau/homebrew-cask,xtian/homebrew-cask,rogeriopradoj/homebrew-cask,singingwolfboy/homebrew-cask,thomanq/homebrew-cask,rogeriopradoj/homebrew-cask,katoquro/homebrew-cask,daften/homebrew-cask,zerrot/homebrew-cask,ericbn/homebrew-cask,hyuna917/homebrew-cask,stonehippo/homebrew-cask,maxnordlund/homebrew-cask,wayou/homebrew-cask,tan9/homebrew-cask,rhendric/homebrew-cask,scribblemaniac/homebrew-cask,yurikoles/homebrew-cask,ninjahoahong/homebrew-cask,joshka/homebrew-cask,mokagio/homebrew-cask,bcaceiro/homebrew-cask,dictcp/homebrew-cask,chuanxd/homebrew-cask,kingthorin/homebrew-cask,janlugt/homebrew-cask,a1russell/homebrew-cask,andersonba/homebrew-cask,schneidmaster/homebrew-cask,gilesdring/homebrew-cask,santoshsahoo/homebrew-cask,danielgomezrico/homebrew-cask,bcomnes/homebrew-cask,zorosteven/homebrew-cask,zmwangx/homebrew-cask,qnm/homebrew-cask,gguillotte/homebrew-cask,xight/homebrew-cask,wmorin/homebrew-cask,gerrypower/homebrew-cask,astorije/homebrew-cask,joschi/homebrew-cask,retbrown/homebrew-cask,kronicd/homebrew-cask,hvisage/homebrew-cask,chino/homebrew-cask,samdoran/homebrew-cask,ayohrling/homebrew-cask,robbiethegeek/homebrew-cask,Ephemera/homebrew-cask,yutarody/homebrew-cask,fwiesel/homebrew-cask,robbiethegeek/homebrew-cask,moimikey/homebrew-cask,otaran/homebrew-cask,kievechua/homebrew-cask,williamboman/homebrew-cask,tyage/homebrew-cask,bdhess/homebrew-cask,jamesmlees/homebrew-cask,chrisRidgers/homebrew-cask,psibre/homebrew-cask,decrement/homebrew-cask,iamso/homebrew-cask,sanyer/homebrew-cask,muan/homebrew-cask,slack4u/homebrew-cask,muan/homebrew-cask,SentinelWarren/homebrew-cask,Ngrd/homebrew-cask,remko/homebrew-cask,dcondrey/homebrew-cask,kirikiriyamama/homebrew-cask,amatos/homebrew-cask,puffdad/homebrew-cask,hellosky806/homebrew-cask,lauantai/homebrew-cask,m3nu/homebrew-cask,13k/homebrew-cask,colindean/homebrew-cask,squid314/homebrew-cask,shorshe/homebrew-cask,sebcode/homebrew-cask,bchatard/homebrew-cask,jpmat296/homebrew-cask,dustinblackman/homebrew-cask,fkrone/homebrew-cask,julionc/homebrew-cask,qbmiller/homebrew-cask,sscotth/homebrew-cask,anbotero/homebrew-cask,cohei/homebrew-cask,lifepillar/homebrew-cask,cprecioso/homebrew-cask,toonetown/homebrew-cask,devmynd/homebrew-cask,hakamadare/homebrew-cask,gwaldo/homebrew-cask,mwean/homebrew-cask,franklouwers/homebrew-cask,nshemonsky/homebrew-cask,cobyism/homebrew-cask,6uclz1/homebrew-cask,kkdd/homebrew-cask,AnastasiaSulyagina/homebrew-cask,Ephemera/homebrew-cask,jeroenj/homebrew-cask,gmkey/homebrew-cask,cblecker/homebrew-cask,guerrero/homebrew-cask,boydj/homebrew-cask,sosedoff/homebrew-cask,askl56/homebrew-cask,doits/homebrew-cask,jpodlech/homebrew-cask,neil-ca-moore/homebrew-cask,deiga/homebrew-cask,rickychilcott/homebrew-cask,alexg0/homebrew-cask,feniix/homebrew-cask,fharbe/homebrew-cask,jaredsampson/homebrew-cask,shoichiaizawa/homebrew-cask,mattrobenolt/homebrew-cask,paulombcosta/homebrew-cask,winkelsdorf/homebrew-cask,kteru/homebrew-cask,mikem/homebrew-cask,miccal/homebrew-cask,paulbreslin/homebrew-cask,My2ndAngelic/homebrew-cask,timsutton/homebrew-cask,sanyer/homebrew-cask,athrunsun/homebrew-cask,gyugyu/homebrew-cask,adrianchia/homebrew-cask,ctrevino/homebrew-cask,jawshooah/homebrew-cask,goxberry/homebrew-cask,mhubig/homebrew-cask,okket/homebrew-cask,aktau/homebrew-cask,sohtsuka/homebrew-cask,yurikoles/homebrew-cask
ruby
## Code Before: cask :v1 => 'myo-connect' do version '0.9.0' sha256 '831d997d2ca0624d01da4bba39ba859da5dfd5f20d793a484b24c978ebd7dbe3' # amazonaws.com is the official download host per the vendor homepage url "https://s3.amazonaws.com/thalmicdownloads/mac/#{version}/MyoConnect.dmg" name 'Myo Connect' homepage 'https://developer.thalmic.com' license :gratis tags :vendor => 'Thalmic Labs' app 'Myo Connect.app' zap :delete => '~/Library/Preferences/com.thalmic.Myo Connect.plist' end ## Instruction: Upgrade Myo Connect.app to v0.14.0 ## Code After: cask :v1 => 'myo-connect' do version '0.14.0' sha256 '8469972d3223154b0a938f811adef142aade2e0d426f79bc0bbdbb27ea17071a' # amazonaws.com is the official download host per the vendor homepage url "https://s3.amazonaws.com/thalmicdownloads/mac/#{version}/MyoConnect.dmg" name 'Myo Connect' homepage 'https://developer.thalmic.com' license :gratis tags :vendor => 'Thalmic Labs' app 'Myo Connect.app' zap :delete => '~/Library/Preferences/com.thalmic.Myo Connect.plist' end
cask :v1 => 'myo-connect' do - version '0.9.0' ? ^ + version '0.14.0' ? ^^ - sha256 '831d997d2ca0624d01da4bba39ba859da5dfd5f20d793a484b24c978ebd7dbe3' + sha256 '8469972d3223154b0a938f811adef142aade2e0d426f79bc0bbdbb27ea17071a' # amazonaws.com is the official download host per the vendor homepage url "https://s3.amazonaws.com/thalmicdownloads/mac/#{version}/MyoConnect.dmg" name 'Myo Connect' homepage 'https://developer.thalmic.com' license :gratis tags :vendor => 'Thalmic Labs' app 'Myo Connect.app' zap :delete => '~/Library/Preferences/com.thalmic.Myo Connect.plist' end
4
0.266667
2
2
d7a8d312dc53cd0325ae07ced1f426251f5bed8f
lib/chef/resource/support/sudoer.erb
lib/chef/resource/support/sudoer.erb
<% @command_aliases.each do |a| -%> Cmnd_Alias <%= a[:name].upcase %> = <%= a[:command_list].join(', ') %> <% end -%> <% @env_keep_add.each do |env_keep| -%> Defaults env_keep += "<%= env_keep %>" <% end -%> <% @env_keep_subtract.each do |env_keep| -%> Defaults env_keep -= "<%= env_keep %>" <% end -%> <% @commands.each do |command| -%> <% if @sudoer %><%= @sudoer %> <%= @host %>=(<%= @runas %>) <%= 'NOEXEC:' if @noexec %><%= 'NOPASSWD:' if @nopasswd.to_s == 'true' %><%= 'SETENV:' if @setenv.to_s == 'true' %><%= command %><% end -%> <% end -%> <% unless @defaults.empty? %> Defaults:<%= @sudoer %> <%= @defaults.join(',') %> <% end -%>
<% @command_aliases.each do |a| -%> Cmnd_Alias <%= a[:name].upcase %> = <%= a[:command_list].join(', ') %> <% end -%> <% @env_keep_add.each do |env_keep| -%> Defaults env_keep += "<%= env_keep %>" <% end -%> <% @env_keep_subtract.each do |env_keep| -%> Defaults env_keep -= "<%= env_keep %>" <% end -%> <% @commands.each do |command| -%> <% unless @sudoer.empty? %><%= @sudoer %> <%= @host %>=(<%= @runas %>) <%= 'NOEXEC:' if @noexec %><%= 'NOPASSWD:' if @nopasswd.to_s == 'true' %><%= 'SETENV:' if @setenv.to_s == 'true' %><%= command %><% end -%> <% end -%> <% unless @defaults.empty? %> Defaults:<%= @sudoer %> <%= @defaults.join(',') %> <% end -%>
Fix template to match the updated version in the cookbook
Fix template to match the updated version in the cookbook This fixes an issue when writing out env_keep only configs. Found this via a super test suite against 14.0.159 Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io>
HTML+ERB
apache-2.0
Tensibai/chef,chef/chef,juliandunn/chef,chef/chef,tas50/chef-1,jaymzh/chef,higanworks/chef,martinisoft/chef,MsysTechnologiesllc/chef,juliandunn/chef,tomdoherty/chef,tas50/chef-1,mwrock/chef,tas50/chef-1,Tensibai/chef,gene1wood/chef,MsysTechnologiesllc/chef,Ppjet6/chef,higanworks/chef,martinisoft/chef,tomdoherty/chef,jaymzh/chef,tas50/chef-1,nvwls/chef,mattray/chef,nvwls/chef,higanworks/chef,higanworks/chef,mattray/chef,tomdoherty/chef,gene1wood/chef,mattray/chef,juliandunn/chef,nvwls/chef,MsysTechnologiesllc/chef,mwrock/chef,Ppjet6/chef,Tensibai/chef,mattray/chef,mattray/chef,higanworks/chef,gene1wood/chef,jaymzh/chef,juliandunn/chef,MsysTechnologiesllc/chef,mwrock/chef,Tensibai/chef,tomdoherty/chef,Ppjet6/chef,Ppjet6/chef,Ppjet6/chef,martinisoft/chef,nvwls/chef,Ppjet6/chef,mwrock/chef,martinisoft/chef,juliandunn/chef,jaymzh/chef,tomdoherty/chef,nvwls/chef,gene1wood/chef,Tensibai/chef,nvwls/chef,martinisoft/chef,chef/chef,chef/chef
html+erb
## Code Before: <% @command_aliases.each do |a| -%> Cmnd_Alias <%= a[:name].upcase %> = <%= a[:command_list].join(', ') %> <% end -%> <% @env_keep_add.each do |env_keep| -%> Defaults env_keep += "<%= env_keep %>" <% end -%> <% @env_keep_subtract.each do |env_keep| -%> Defaults env_keep -= "<%= env_keep %>" <% end -%> <% @commands.each do |command| -%> <% if @sudoer %><%= @sudoer %> <%= @host %>=(<%= @runas %>) <%= 'NOEXEC:' if @noexec %><%= 'NOPASSWD:' if @nopasswd.to_s == 'true' %><%= 'SETENV:' if @setenv.to_s == 'true' %><%= command %><% end -%> <% end -%> <% unless @defaults.empty? %> Defaults:<%= @sudoer %> <%= @defaults.join(',') %> <% end -%> ## Instruction: Fix template to match the updated version in the cookbook This fixes an issue when writing out env_keep only configs. Found this via a super test suite against 14.0.159 Signed-off-by: Tim Smith <764ef62106582a09ed09dfa0b6bff7c05fd7d1e4@chef.io> ## Code After: <% @command_aliases.each do |a| -%> Cmnd_Alias <%= a[:name].upcase %> = <%= a[:command_list].join(', ') %> <% end -%> <% @env_keep_add.each do |env_keep| -%> Defaults env_keep += "<%= env_keep %>" <% end -%> <% @env_keep_subtract.each do |env_keep| -%> Defaults env_keep -= "<%= env_keep %>" <% end -%> <% @commands.each do |command| -%> <% unless @sudoer.empty? %><%= @sudoer %> <%= @host %>=(<%= @runas %>) <%= 'NOEXEC:' if @noexec %><%= 'NOPASSWD:' if @nopasswd.to_s == 'true' %><%= 'SETENV:' if @setenv.to_s == 'true' %><%= command %><% end -%> <% end -%> <% unless @defaults.empty? %> Defaults:<%= @sudoer %> <%= @defaults.join(',') %> <% end -%>
<% @command_aliases.each do |a| -%> Cmnd_Alias <%= a[:name].upcase %> = <%= a[:command_list].join(', ') %> <% end -%> <% @env_keep_add.each do |env_keep| -%> Defaults env_keep += "<%= env_keep %>" <% end -%> <% @env_keep_subtract.each do |env_keep| -%> Defaults env_keep -= "<%= env_keep %>" <% end -%> <% @commands.each do |command| -%> - <% if @sudoer %><%= @sudoer %> <%= @host %>=(<%= @runas %>) <%= 'NOEXEC:' if @noexec %><%= 'NOPASSWD:' if @nopasswd.to_s == 'true' %><%= 'SETENV:' if @setenv.to_s == 'true' %><%= command %><% end -%> ? ^^^^^^^^^^ + <% unless @sudoer.empty? %><%= @sudoer %> <%= @host %>=(<%= @runas %>) <%= 'NOEXEC:' if @noexec %><%= 'NOPASSWD:' if @nopasswd.to_s == 'true' %><%= 'SETENV:' if @setenv.to_s == 'true' %><%= command %><% end -%> ? ^^^^^^^^^^^^^^^^^^^^^ <% end -%> <% unless @defaults.empty? %> Defaults:<%= @sudoer %> <%= @defaults.join(',') %> <% end -%>
2
0.125
1
1
94f097e423769a94ea3b56608e1c824ffb348476
index.js
index.js
'use strict' const reshape = require('reshape') exports.name = 'reshape' exports.inputFormats = ['reshape', 'html'] exports.outputFormat = 'html' exports.renderAsync = function (str, options, locals) { return new Promise((resolve, reject) => { const plugins = [] options = options || {} options.plugins = options.plugins || {} if (Array.isArray(options.plugins)) { for (const plugin of options.plugins) { if (typeof plugin === 'string') { // eslint-disable-next-line import/no-dynamic-require plugins.push(require(plugin)()) } else { plugins.push(plugin) } } } else if (typeof options.plugins === 'object') { for (const key in options.plugins) { if ({}.hasOwnProperty.call(options.plugins, key)) { const settings = options.plugins[key] || {} // eslint-disable-next-line import/no-dynamic-require plugins.push(require(key)(settings)) } } } if (typeof options.parser === 'string') { // eslint-disable-next-line import/no-dynamic-require options.parser = require(options.parser) } const modifiedOptions = options modifiedOptions.plugins = plugins // Process with Reshape. reshape(modifiedOptions) .process(str) .then(result => { resolve(result.output(locals)) }, reject) }) }
'use strict' const reshape = require('reshape') exports.name = 'reshape' exports.outputFormat = 'html' exports.renderAsync = function (str, options, locals) { return new Promise((resolve, reject) => { const plugins = [] options = options || {} options.plugins = options.plugins || {} if (Array.isArray(options.plugins)) { for (const plugin of options.plugins) { if (typeof plugin === 'string') { // eslint-disable-next-line import/no-dynamic-require plugins.push(require(plugin)()) } else { plugins.push(plugin) } } } else if (typeof options.plugins === 'object') { for (const key in options.plugins) { if ({}.hasOwnProperty.call(options.plugins, key)) { const settings = options.plugins[key] || {} // eslint-disable-next-line import/no-dynamic-require plugins.push(require(key)(settings)) } } } if (typeof options.parser === 'string') { // eslint-disable-next-line import/no-dynamic-require options.parser = require(options.parser) } const modifiedOptions = options modifiedOptions.plugins = plugins // Process with Reshape. reshape(modifiedOptions) .process(str) .then(result => { resolve(result.output(locals)) }, reject) }) }
Remove "html" from the inputFormats list
Remove "html" from the inputFormats list All HTML is not reshape.
JavaScript
mit
jstransformers/jstransformer-reshape,jstransformers/jstransformer-reshape
javascript
## Code Before: 'use strict' const reshape = require('reshape') exports.name = 'reshape' exports.inputFormats = ['reshape', 'html'] exports.outputFormat = 'html' exports.renderAsync = function (str, options, locals) { return new Promise((resolve, reject) => { const plugins = [] options = options || {} options.plugins = options.plugins || {} if (Array.isArray(options.plugins)) { for (const plugin of options.plugins) { if (typeof plugin === 'string') { // eslint-disable-next-line import/no-dynamic-require plugins.push(require(plugin)()) } else { plugins.push(plugin) } } } else if (typeof options.plugins === 'object') { for (const key in options.plugins) { if ({}.hasOwnProperty.call(options.plugins, key)) { const settings = options.plugins[key] || {} // eslint-disable-next-line import/no-dynamic-require plugins.push(require(key)(settings)) } } } if (typeof options.parser === 'string') { // eslint-disable-next-line import/no-dynamic-require options.parser = require(options.parser) } const modifiedOptions = options modifiedOptions.plugins = plugins // Process with Reshape. reshape(modifiedOptions) .process(str) .then(result => { resolve(result.output(locals)) }, reject) }) } ## Instruction: Remove "html" from the inputFormats list All HTML is not reshape. ## Code After: 'use strict' const reshape = require('reshape') exports.name = 'reshape' exports.outputFormat = 'html' exports.renderAsync = function (str, options, locals) { return new Promise((resolve, reject) => { const plugins = [] options = options || {} options.plugins = options.plugins || {} if (Array.isArray(options.plugins)) { for (const plugin of options.plugins) { if (typeof plugin === 'string') { // eslint-disable-next-line import/no-dynamic-require plugins.push(require(plugin)()) } else { plugins.push(plugin) } } } else if (typeof options.plugins === 'object') { for (const key in options.plugins) { if ({}.hasOwnProperty.call(options.plugins, key)) { const settings = options.plugins[key] || {} // eslint-disable-next-line import/no-dynamic-require plugins.push(require(key)(settings)) } } } if (typeof options.parser === 'string') { // eslint-disable-next-line import/no-dynamic-require options.parser = require(options.parser) } const modifiedOptions = options modifiedOptions.plugins = plugins // Process with Reshape. reshape(modifiedOptions) .process(str) .then(result => { resolve(result.output(locals)) }, reject) }) }
'use strict' const reshape = require('reshape') exports.name = 'reshape' - exports.inputFormats = ['reshape', 'html'] exports.outputFormat = 'html' exports.renderAsync = function (str, options, locals) { return new Promise((resolve, reject) => { const plugins = [] options = options || {} options.plugins = options.plugins || {} if (Array.isArray(options.plugins)) { for (const plugin of options.plugins) { if (typeof plugin === 'string') { // eslint-disable-next-line import/no-dynamic-require plugins.push(require(plugin)()) } else { plugins.push(plugin) } } } else if (typeof options.plugins === 'object') { for (const key in options.plugins) { if ({}.hasOwnProperty.call(options.plugins, key)) { const settings = options.plugins[key] || {} // eslint-disable-next-line import/no-dynamic-require plugins.push(require(key)(settings)) } } } if (typeof options.parser === 'string') { // eslint-disable-next-line import/no-dynamic-require options.parser = require(options.parser) } const modifiedOptions = options modifiedOptions.plugins = plugins // Process with Reshape. reshape(modifiedOptions) .process(str) .then(result => { resolve(result.output(locals)) }, reject) }) }
1
0.020408
0
1
07c703813a4194b94f9cb8c69047e63f1ffeec17
app/Post.php
app/Post.php
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Post extends Model { protected $hidden = [ 'user_id', 'updated_at', 'deleted_at', ]; public function user() { return $this->belongsTo(User::class); } }
<?php namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Post extends Model { use SoftDeletes; protected $hidden = [ 'user_id', 'updated_at', 'deleted_at', ]; protected $dates = ['deleted_at']; public function user() { return $this->belongsTo(User::class); } }
Add SoftDelete trait to post model
Add SoftDelete trait to post model
PHP
mit
PrismPrince/SSG-Electronic-Dropbox,PrismPrince/SSG-Electronic-Dropbox-System,PrismPrince/SSG-Electronic-Dropbox-System,PrismPrince/SSG-Poll-System,PrismPrince/SSG-Electronic-Dropbox,PrismPrince/SSG-Electronic-Dropbox,PrismPrince/SSG-Poll-System,PrismPrince/SSG-Poll-System,PrismPrince/SSG-Electronic-Dropbox-System
php
## Code Before: <?php namespace App; use Illuminate\Database\Eloquent\Model; class Post extends Model { protected $hidden = [ 'user_id', 'updated_at', 'deleted_at', ]; public function user() { return $this->belongsTo(User::class); } } ## Instruction: Add SoftDelete trait to post model ## Code After: <?php namespace App; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Post extends Model { use SoftDeletes; protected $hidden = [ 'user_id', 'updated_at', 'deleted_at', ]; protected $dates = ['deleted_at']; public function user() { return $this->belongsTo(User::class); } }
<?php namespace App; use Illuminate\Database\Eloquent\Model; + use Illuminate\Database\Eloquent\SoftDeletes; class Post extends Model { + use SoftDeletes; + protected $hidden = [ 'user_id', 'updated_at', 'deleted_at', - ]; ? - + ]; + + protected $dates = ['deleted_at']; public function user() { return $this->belongsTo(User::class); } }
7
0.411765
6
1
243050586e55033f74debae5f2eac4ad17931161
myapp/public/javascripts/game-board.js
myapp/public/javascripts/game-board.js
/** * game-board.js * * Maintain game board object properties */ // Alias our game board var gameBoard = game.objs.board; /** * Main game board factory * * @returns {object} */ var getGameBoard = function() { var gameBoard = document.getElementById('game-board'); var width = gameBoard.width.baseVal.value; var height = gameBoard.height.baseVal.value; var border = 10; var area = (width - border) * (height - border); return { width: width, height: height, area: area } }; // Get game board gameBoard = getGameBoard();
/** * game-board.js * * Maintain game board object properties */ // Alias our game board var gameBoard = game.objs.board; /** * Main game board factory * * @returns {object} */ var getGameBoard = function() { var gameBoard = document.getElementById('game-board'); var width = gameBoard.width.baseVal.value; var height = gameBoard.height.baseVal.value; var border = 10; var area = (width - border) * (height - border); return { width: width, height: height, area: area, topBound: 0, rightBound: width - border, leftBound: 0, bottomBound: height - border } }; // Get game board gameBoard = getGameBoard();
Add boundaries to game board
Add boundaries to game board
JavaScript
mit
gabrielliwerant/SquareEatsSquare,gabrielliwerant/SquareEatsSquare
javascript
## Code Before: /** * game-board.js * * Maintain game board object properties */ // Alias our game board var gameBoard = game.objs.board; /** * Main game board factory * * @returns {object} */ var getGameBoard = function() { var gameBoard = document.getElementById('game-board'); var width = gameBoard.width.baseVal.value; var height = gameBoard.height.baseVal.value; var border = 10; var area = (width - border) * (height - border); return { width: width, height: height, area: area } }; // Get game board gameBoard = getGameBoard(); ## Instruction: Add boundaries to game board ## Code After: /** * game-board.js * * Maintain game board object properties */ // Alias our game board var gameBoard = game.objs.board; /** * Main game board factory * * @returns {object} */ var getGameBoard = function() { var gameBoard = document.getElementById('game-board'); var width = gameBoard.width.baseVal.value; var height = gameBoard.height.baseVal.value; var border = 10; var area = (width - border) * (height - border); return { width: width, height: height, area: area, topBound: 0, rightBound: width - border, leftBound: 0, bottomBound: height - border } }; // Get game board gameBoard = getGameBoard();
/** * game-board.js * * Maintain game board object properties */ // Alias our game board var gameBoard = game.objs.board; /** * Main game board factory * * @returns {object} */ var getGameBoard = function() { var gameBoard = document.getElementById('game-board'); var width = gameBoard.width.baseVal.value; var height = gameBoard.height.baseVal.value; var border = 10; var area = (width - border) * (height - border); return { width: width, height: height, - area: area + area: area, ? + + topBound: 0, + rightBound: width - border, + leftBound: 0, + bottomBound: height - border + } }; // Get game board gameBoard = getGameBoard();
7
0.233333
6
1
78e3943014130e5c53c7ec97fe5dd837c58d03b3
lib/camayoc.rb
lib/camayoc.rb
require 'rubygems' require 'camayoc/thread_safety' require 'camayoc/stat_event' require 'camayoc/handlers/timing' require 'camayoc/handlers/filter' require 'camayoc/handlers/io' require 'camayoc/handlers/memory' require 'camayoc/stats' module Camayoc DELIMITER = ":" @registry = {} @lock = Mutex.new class << self def [](name) @lock.synchronize { @registry[name] ||= _new(name) } end def new(name) @lock.synchronize { _new(name) } end def all @lock.synchronize { @registry.values.dup } end def thread_safe=(value) @thread_safe = value end def thread_safe? @thread_safe == true end private def _new(name) stats = Stats.new(name,ancestor(name)) @registry[name] = stats reassign_children(stats) stats end def reassign_children(node) @registry.values.each do |other_node| if other_node != node && other_node.name.index(node.name) == 0 other_node.parent = node end end end def ancestor(name) ancestor = nil path = name.split(DELIMITER) while path.pop && !ancestor ancestor = @registry[path.join(DELIMITER)] end ancestor end end end
require 'rubygems' require 'camayoc/thread_safety' require 'camayoc/stat_event' require 'camayoc/handlers/timing' require 'camayoc/handlers/filter' require 'camayoc/handlers/io' require 'camayoc/handlers/memory' require 'camayoc/handlers/statsd' require 'camayoc/stats' module Camayoc DELIMITER = ":" @registry = {} @lock = Mutex.new class << self def [](name) @lock.synchronize { @registry[name] ||= _new(name) } end def new(name) @lock.synchronize { _new(name) } end def all @lock.synchronize { @registry.values.dup } end def thread_safe=(value) @thread_safe = value end def thread_safe? @thread_safe == true end private def _new(name) stats = Stats.new(name,ancestor(name)) @registry[name] = stats reassign_children(stats) stats end def reassign_children(node) @registry.values.each do |other_node| if other_node != node && other_node.name.index(node.name) == 0 other_node.parent = node end end end def ancestor(name) ancestor = nil path = name.split(DELIMITER) while path.pop && !ancestor ancestor = @registry[path.join(DELIMITER)] end ancestor end end end
Load the statsd handler by default without another require
Load the statsd handler by default without another require
Ruby
mit
appozite/camayoc
ruby
## Code Before: require 'rubygems' require 'camayoc/thread_safety' require 'camayoc/stat_event' require 'camayoc/handlers/timing' require 'camayoc/handlers/filter' require 'camayoc/handlers/io' require 'camayoc/handlers/memory' require 'camayoc/stats' module Camayoc DELIMITER = ":" @registry = {} @lock = Mutex.new class << self def [](name) @lock.synchronize { @registry[name] ||= _new(name) } end def new(name) @lock.synchronize { _new(name) } end def all @lock.synchronize { @registry.values.dup } end def thread_safe=(value) @thread_safe = value end def thread_safe? @thread_safe == true end private def _new(name) stats = Stats.new(name,ancestor(name)) @registry[name] = stats reassign_children(stats) stats end def reassign_children(node) @registry.values.each do |other_node| if other_node != node && other_node.name.index(node.name) == 0 other_node.parent = node end end end def ancestor(name) ancestor = nil path = name.split(DELIMITER) while path.pop && !ancestor ancestor = @registry[path.join(DELIMITER)] end ancestor end end end ## Instruction: Load the statsd handler by default without another require ## Code After: require 'rubygems' require 'camayoc/thread_safety' require 'camayoc/stat_event' require 'camayoc/handlers/timing' require 'camayoc/handlers/filter' require 'camayoc/handlers/io' require 'camayoc/handlers/memory' require 'camayoc/handlers/statsd' require 'camayoc/stats' module Camayoc DELIMITER = ":" @registry = {} @lock = Mutex.new class << self def [](name) @lock.synchronize { @registry[name] ||= _new(name) } end def new(name) @lock.synchronize { _new(name) } end def all @lock.synchronize { @registry.values.dup } end def thread_safe=(value) @thread_safe = value end def thread_safe? @thread_safe == true end private def _new(name) stats = Stats.new(name,ancestor(name)) @registry[name] = stats reassign_children(stats) stats end def reassign_children(node) @registry.values.each do |other_node| if other_node != node && other_node.name.index(node.name) == 0 other_node.parent = node end end end def ancestor(name) ancestor = nil path = name.split(DELIMITER) while path.pop && !ancestor ancestor = @registry[path.join(DELIMITER)] end ancestor end end end
require 'rubygems' require 'camayoc/thread_safety' require 'camayoc/stat_event' require 'camayoc/handlers/timing' require 'camayoc/handlers/filter' require 'camayoc/handlers/io' require 'camayoc/handlers/memory' + require 'camayoc/handlers/statsd' require 'camayoc/stats' module Camayoc DELIMITER = ":" @registry = {} @lock = Mutex.new class << self def [](name) @lock.synchronize { @registry[name] ||= _new(name) } end def new(name) @lock.synchronize { _new(name) } end def all @lock.synchronize { @registry.values.dup } end def thread_safe=(value) @thread_safe = value end def thread_safe? @thread_safe == true end private def _new(name) stats = Stats.new(name,ancestor(name)) @registry[name] = stats reassign_children(stats) stats end def reassign_children(node) @registry.values.each do |other_node| if other_node != node && other_node.name.index(node.name) == 0 other_node.parent = node end end end def ancestor(name) ancestor = nil path = name.split(DELIMITER) while path.pop && !ancestor ancestor = @registry[path.join(DELIMITER)] end ancestor end end end
1
0.015625
1
0
6b935ad0732e7729e95fd8350fc665286d7bbb38
front/js/Widgets/Site/AddToCart.js
front/js/Widgets/Site/AddToCart.js
'use strict'; var Klass = require('Klass'), Flux = require("Flux"), Loading = require('Widgets/Loading'); var AddToCart = Klass.create({ name: 'AddToCart', button: null, quantity: null, construct: function(button, quantityInput) { this.button = $(button); this.quantity = $(quantityInput); this.initLoading(); this.bindEvents(); }, initLoading: function() { this.loading = new Loading(); this.loading.compile(); this.button.append(this.loading.compiled); }, bindEvents: function() { this.button.on('click', this.onClick.bind(this)); }, doCheckout: function() { var me = this; $.ajax({ url: '/rest/cart/add', complete: function(result) { var url = result.responseJSON.url; me.loading.setState(true); window.location = url; } }); }, onClick: function () { if (this.loading.isLoading) return false; this.loading.setState(true); Flux.actions.loadCartTotal(); //this.doCheckout(); return false; } }); module.exports = AddToCart;
'use strict'; var Klass = require('Klass'), Flux = require("Flux"), Loading = require('Widgets/Loading'); var AddToCart = Klass.create({ name: 'AddToCart', button: null, quantity: null, construct: function(button, quantityInput) { this.button = $(button); this.quantity = $(quantityInput); this.initLoading(); this.bindEvents(); }, initLoading: function() { this.loading = new Loading(); this.loading.compile(); this.button.append(this.loading.compiled); }, bindEvents: function() { this.button.on('click', this.onClick.bind(this)); }, add: function() { var me = this; $.ajax({ url: '/rest/cart/add', method: 'post', complete: function(result) { me.loading.setState(false); Flux.actions.loadCartTotal(); } }); }, onClick: function () { if (this.loading.isLoading) return false; this.loading.setState(true); this.add(); return false; } }); module.exports = AddToCart;
Call cart add rest method
Call cart add rest method
JavaScript
mit
gabrielalan/leaf,gabrielalan/leaf
javascript
## Code Before: 'use strict'; var Klass = require('Klass'), Flux = require("Flux"), Loading = require('Widgets/Loading'); var AddToCart = Klass.create({ name: 'AddToCart', button: null, quantity: null, construct: function(button, quantityInput) { this.button = $(button); this.quantity = $(quantityInput); this.initLoading(); this.bindEvents(); }, initLoading: function() { this.loading = new Loading(); this.loading.compile(); this.button.append(this.loading.compiled); }, bindEvents: function() { this.button.on('click', this.onClick.bind(this)); }, doCheckout: function() { var me = this; $.ajax({ url: '/rest/cart/add', complete: function(result) { var url = result.responseJSON.url; me.loading.setState(true); window.location = url; } }); }, onClick: function () { if (this.loading.isLoading) return false; this.loading.setState(true); Flux.actions.loadCartTotal(); //this.doCheckout(); return false; } }); module.exports = AddToCart; ## Instruction: Call cart add rest method ## Code After: 'use strict'; var Klass = require('Klass'), Flux = require("Flux"), Loading = require('Widgets/Loading'); var AddToCart = Klass.create({ name: 'AddToCart', button: null, quantity: null, construct: function(button, quantityInput) { this.button = $(button); this.quantity = $(quantityInput); this.initLoading(); this.bindEvents(); }, initLoading: function() { this.loading = new Loading(); this.loading.compile(); this.button.append(this.loading.compiled); }, bindEvents: function() { this.button.on('click', this.onClick.bind(this)); }, add: function() { var me = this; $.ajax({ url: '/rest/cart/add', method: 'post', complete: function(result) { me.loading.setState(false); Flux.actions.loadCartTotal(); } }); }, onClick: function () { if (this.loading.isLoading) return false; this.loading.setState(true); this.add(); return false; } }); module.exports = AddToCart;
'use strict'; var Klass = require('Klass'), Flux = require("Flux"), Loading = require('Widgets/Loading'); var AddToCart = Klass.create({ name: 'AddToCart', button: null, quantity: null, construct: function(button, quantityInput) { this.button = $(button); this.quantity = $(quantityInput); this.initLoading(); this.bindEvents(); }, initLoading: function() { this.loading = new Loading(); this.loading.compile(); this.button.append(this.loading.compiled); }, bindEvents: function() { this.button.on('click', this.onClick.bind(this)); }, - doCheckout: function() { + add: function() { var me = this; $.ajax({ url: '/rest/cart/add', + method: 'post', complete: function(result) { - var url = result.responseJSON.url; + me.loading.setState(false); + Flux.actions.loadCartTotal(); - me.loading.setState(true); - - window.location = url; } }); }, onClick: function () { if (this.loading.isLoading) return false; this.loading.setState(true); + this.add(); - Flux.actions.loadCartTotal(); - - //this.doCheckout(); return false; } }); module.exports = AddToCart;
13
0.203125
5
8
634daaeb99f3c6784422128d1f98d6f005779e16
web-client/fig_web_serve.sh
web-client/fig_web_serve.sh
ln -s /node/node_modules . ln -s /bower/bower_components app/ grunt serve
export LC_ALL="en_US.UTF-8" export LANG="en_US.UTF-8" ln -s /node/node_modules . ln -s /bower/bower_components app/ grunt serve
Enforce UTF-8 local for the web client service.
Enforce UTF-8 local for the web client service.
Shell
bsd-2-clause
manshar/manshar,mjalajel/manshar,RashaHussein/manshar,mjalajel/manshar,manshar/manshar,ahmgeek/manshar,mjalajel/manshar,manshar/manshar,RashaHussein/manshar,ahmgeek/manshar,mjalajel/manshar,manshar/manshar,RashaHussein/manshar,ahmgeek/manshar,RashaHussein/manshar,ahmgeek/manshar
shell
## Code Before: ln -s /node/node_modules . ln -s /bower/bower_components app/ grunt serve ## Instruction: Enforce UTF-8 local for the web client service. ## Code After: export LC_ALL="en_US.UTF-8" export LANG="en_US.UTF-8" ln -s /node/node_modules . ln -s /bower/bower_components app/ grunt serve
+ export LC_ALL="en_US.UTF-8" + export LANG="en_US.UTF-8" ln -s /node/node_modules . ln -s /bower/bower_components app/ grunt serve
2
0.666667
2
0
e82a0bc5ce5ba1174585fbddd5e60686f46f245e
SwiftyVK.podspec
SwiftyVK.podspec
Pod::Spec.new do |s| s.version = "3.4.1" s.name = "SwiftyVK" s.summary = "Easy and powerful way to interact with VK API for iOS and macOS" s.homepage = "https://github.com/SwiftyVK/SwiftyVK" s.authors = { "Alexey Kudryavtsev" => "westor@me.com" } s.license = { :type => 'MIT', :file => 'LICENSE.txt'} s.requires_arc = true s.osx.deployment_target = "10.10" s.ios.deployment_target = "8.0" s.source = { :git => "https://github.com/SwiftyVK/SwiftyVK.git" , :tag => s.version.to_s } s.source_files = "Library/Sources/**/*.*" s.ios.source_files = "Library/UI/iOS/**/*.*" s.osx.source_files = "Library/UI/macOS/**/*.*" s.ios.resources = "Library/Resources/Bundles/SwiftyVK_resources_iOS.bundle" s.osx.resources = "Library/Resources/Bundles/SwiftyVK_resources_macOS.bundle" s.static_framework = false end
Pod::Spec.new do |s| s.version = "3.4.1" s.name = "SwiftyVK" s.summary = "Easy and powerful way to interact with VK API for iOS and macOS" s.homepage = "https://github.com/SwiftyVK/SwiftyVK" s.authors = { "Alexey Kudryavtsev" => "westor@me.com" } s.license = { :type => 'MIT', :file => 'LICENSE.txt'} s.requires_arc = true s.osx.deployment_target = "10.10" s.ios.deployment_target = "8.0" s.swift_version = "5.0" s.source = { :git => "https://github.com/SwiftyVK/SwiftyVK.git" , :tag => s.version.to_s } s.source_files = "Library/Sources/**/*.*" s.ios.source_files = "Library/UI/iOS/**/*.*" s.osx.source_files = "Library/UI/macOS/**/*.*" s.ios.resources = "Library/Resources/Bundles/SwiftyVK_resources_iOS.bundle" s.osx.resources = "Library/Resources/Bundles/SwiftyVK_resources_macOS.bundle" s.static_framework = false end
Add swift_version arg into podfile
Add swift_version arg into podfile
Ruby
mit
WE-St0r/SwiftyVK,WE-St0r/SwiftyVK,SwiftyVK/SwiftyVK,WE-St0r/SwiftyVK,SwiftyVK/SwiftyVK
ruby
## Code Before: Pod::Spec.new do |s| s.version = "3.4.1" s.name = "SwiftyVK" s.summary = "Easy and powerful way to interact with VK API for iOS and macOS" s.homepage = "https://github.com/SwiftyVK/SwiftyVK" s.authors = { "Alexey Kudryavtsev" => "westor@me.com" } s.license = { :type => 'MIT', :file => 'LICENSE.txt'} s.requires_arc = true s.osx.deployment_target = "10.10" s.ios.deployment_target = "8.0" s.source = { :git => "https://github.com/SwiftyVK/SwiftyVK.git" , :tag => s.version.to_s } s.source_files = "Library/Sources/**/*.*" s.ios.source_files = "Library/UI/iOS/**/*.*" s.osx.source_files = "Library/UI/macOS/**/*.*" s.ios.resources = "Library/Resources/Bundles/SwiftyVK_resources_iOS.bundle" s.osx.resources = "Library/Resources/Bundles/SwiftyVK_resources_macOS.bundle" s.static_framework = false end ## Instruction: Add swift_version arg into podfile ## Code After: Pod::Spec.new do |s| s.version = "3.4.1" s.name = "SwiftyVK" s.summary = "Easy and powerful way to interact with VK API for iOS and macOS" s.homepage = "https://github.com/SwiftyVK/SwiftyVK" s.authors = { "Alexey Kudryavtsev" => "westor@me.com" } s.license = { :type => 'MIT', :file => 'LICENSE.txt'} s.requires_arc = true s.osx.deployment_target = "10.10" s.ios.deployment_target = "8.0" s.swift_version = "5.0" s.source = { :git => "https://github.com/SwiftyVK/SwiftyVK.git" , :tag => s.version.to_s } s.source_files = "Library/Sources/**/*.*" s.ios.source_files = "Library/UI/iOS/**/*.*" s.osx.source_files = "Library/UI/macOS/**/*.*" s.ios.resources = "Library/Resources/Bundles/SwiftyVK_resources_iOS.bundle" s.osx.resources = "Library/Resources/Bundles/SwiftyVK_resources_macOS.bundle" s.static_framework = false end
Pod::Spec.new do |s| s.version = "3.4.1" s.name = "SwiftyVK" s.summary = "Easy and powerful way to interact with VK API for iOS and macOS" s.homepage = "https://github.com/SwiftyVK/SwiftyVK" s.authors = { "Alexey Kudryavtsev" => "westor@me.com" } s.license = { :type => 'MIT', :file => 'LICENSE.txt'} s.requires_arc = true s.osx.deployment_target = "10.10" s.ios.deployment_target = "8.0" + s.swift_version = "5.0" s.source = { :git => "https://github.com/SwiftyVK/SwiftyVK.git" , :tag => s.version.to_s } s.source_files = "Library/Sources/**/*.*" s.ios.source_files = "Library/UI/iOS/**/*.*" s.osx.source_files = "Library/UI/macOS/**/*.*" s.ios.resources = "Library/Resources/Bundles/SwiftyVK_resources_iOS.bundle" s.osx.resources = "Library/Resources/Bundles/SwiftyVK_resources_macOS.bundle" s.static_framework = false end
1
0.05
1
0
452044e0cc7caaefcdee0dbdf2b79a1f173ff8a1
cluster/manifests/kubernetes-lifecycle-metrics/deployment.yaml
cluster/manifests/kubernetes-lifecycle-metrics/deployment.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: kubernetes-lifecycle-metrics namespace: kube-system labels: application: kubernetes-lifecycle-metrics version: master-1 spec: replicas: 1 selector: matchLabels: application: kubernetes-lifecycle-metrics template: metadata: labels: application: kubernetes-lifecycle-metrics version: master-1 annotations: kubernetes-log-watcher/scalyr-parser: '[{"container": "kubernetes-lifecycle-metrics", "parser": "json"}]' spec: priorityClassName: system-cluster-critical containers: - name: kubernetes-lifecycle-metrics image: "pierone.stups.zalan.do/teapot/kubernetes-lifecycle-metrics:master-1" ports: - containerPort: 9090 resources: limits: cpu: 5m memory: 150Mi requests: cpu: 5m memory: 150Mi readinessProbe: httpGet: path: /healthz port: 9090 scheme: HTTP
apiVersion: apps/v1 kind: Deployment metadata: name: kubernetes-lifecycle-metrics namespace: kube-system labels: application: kubernetes-lifecycle-metrics version: master-1 spec: replicas: 1 selector: matchLabels: application: kubernetes-lifecycle-metrics template: metadata: labels: application: kubernetes-lifecycle-metrics version: master-1 annotations: kubernetes-log-watcher/scalyr-parser: '[{"container": "kubernetes-lifecycle-metrics", "parser": "system-json-escaped-json"}]' spec: priorityClassName: system-cluster-critical containers: - name: kubernetes-lifecycle-metrics image: "pierone.stups.zalan.do/teapot/kubernetes-lifecycle-metrics:master-1" ports: - containerPort: 9090 resources: limits: cpu: 5m memory: 150Mi requests: cpu: 5m memory: 150Mi readinessProbe: httpGet: path: /healthz port: 9090 scheme: HTTP
Change custom parser for kubernetes-lifecycle-metrics logs
Change custom parser for kubernetes-lifecycle-metrics logs Signed-off-by: Mikkel Oscar Lyderik Larsen <81479e3d2d1e6902cb05f938ea9a734a092b1af3@zalando.de>
YAML
mit
zalando-incubator/kubernetes-on-aws,zalando-incubator/kubernetes-on-aws,zalando-incubator/kubernetes-on-aws
yaml
## Code Before: apiVersion: apps/v1 kind: Deployment metadata: name: kubernetes-lifecycle-metrics namespace: kube-system labels: application: kubernetes-lifecycle-metrics version: master-1 spec: replicas: 1 selector: matchLabels: application: kubernetes-lifecycle-metrics template: metadata: labels: application: kubernetes-lifecycle-metrics version: master-1 annotations: kubernetes-log-watcher/scalyr-parser: '[{"container": "kubernetes-lifecycle-metrics", "parser": "json"}]' spec: priorityClassName: system-cluster-critical containers: - name: kubernetes-lifecycle-metrics image: "pierone.stups.zalan.do/teapot/kubernetes-lifecycle-metrics:master-1" ports: - containerPort: 9090 resources: limits: cpu: 5m memory: 150Mi requests: cpu: 5m memory: 150Mi readinessProbe: httpGet: path: /healthz port: 9090 scheme: HTTP ## Instruction: Change custom parser for kubernetes-lifecycle-metrics logs Signed-off-by: Mikkel Oscar Lyderik Larsen <81479e3d2d1e6902cb05f938ea9a734a092b1af3@zalando.de> ## Code After: apiVersion: apps/v1 kind: Deployment metadata: name: kubernetes-lifecycle-metrics namespace: kube-system labels: application: kubernetes-lifecycle-metrics version: master-1 spec: replicas: 1 selector: matchLabels: application: kubernetes-lifecycle-metrics template: metadata: labels: application: kubernetes-lifecycle-metrics version: master-1 annotations: kubernetes-log-watcher/scalyr-parser: '[{"container": "kubernetes-lifecycle-metrics", "parser": "system-json-escaped-json"}]' spec: priorityClassName: system-cluster-critical containers: - name: kubernetes-lifecycle-metrics image: "pierone.stups.zalan.do/teapot/kubernetes-lifecycle-metrics:master-1" ports: - containerPort: 9090 resources: limits: cpu: 5m memory: 150Mi requests: cpu: 5m memory: 150Mi readinessProbe: httpGet: path: /healthz port: 9090 scheme: HTTP
apiVersion: apps/v1 kind: Deployment metadata: name: kubernetes-lifecycle-metrics namespace: kube-system labels: application: kubernetes-lifecycle-metrics version: master-1 spec: replicas: 1 selector: matchLabels: application: kubernetes-lifecycle-metrics template: metadata: labels: application: kubernetes-lifecycle-metrics version: master-1 annotations: - kubernetes-log-watcher/scalyr-parser: '[{"container": "kubernetes-lifecycle-metrics", "parser": "json"}]' + kubernetes-log-watcher/scalyr-parser: '[{"container": "kubernetes-lifecycle-metrics", "parser": "system-json-escaped-json"}]' ? ++++++++++++++++++++ spec: priorityClassName: system-cluster-critical containers: - name: kubernetes-lifecycle-metrics image: "pierone.stups.zalan.do/teapot/kubernetes-lifecycle-metrics:master-1" ports: - containerPort: 9090 resources: limits: cpu: 5m memory: 150Mi requests: cpu: 5m memory: 150Mi readinessProbe: httpGet: path: /healthz port: 9090 scheme: HTTP
2
0.051282
1
1
12ee5ba8efb9796c0bd5f259845e20718f40e41b
js/app/templates/template-category.html
js/app/templates/template-category.html
<%= header %> <div class="category-container"> <h2> <% if (category.image) { %> <img class="category-image" src="<%= LT.utils.imagePath(category.image) %>" /> <% } %> <%= category.title %> </h2> <p><%= category.description %></p> <% if (_.isArray(category.links) && category.links.length > 0) { %> <div class="e-links"> <h4>In the news</h4> <ul class="e-links-list"> <% _.each(category.links, function(l) { %> <li><a href="<%= l.url %>"><%= l.title %></a></li> <% }) %> </ul> </div> <% } %> <div class="clear-block bills-list"> <% category.bills.each(function(b) { %> <%= templates.ebill({ bill: b.toJSON(), expandable: true, templates: templates }) %> <% }); %> </div> <div class="clear-block total-bill"> Watching <strong><%= category.bills.length %></strong> <% if (typeof category.total_bill_count != 'undefined') { %> of <%= category.total_bill_count %> <% } %> bills in the <%= category.title %> category. </div> </div>
<%= header %> <div class="category-container"> <header> <% if (category.image) { %> <img class="category-image" src="<%= LT.utils.imagePath(category.image) %>" /> <% } %> <section class="category-meta"> <h2><%= category.title %></h2> <% if (category.description) { %> <p><%= category.description %></p> <% } %> </section> <p class="category-bill-total"> Watching <strong><%= category.bills.length %></strong> <% if (typeof category.total_bill_count != 'undefined') { %> of <%= category.total_bill_count %> <% } %> bills in the <%= category.title %> category. </p> </header> <% if (_.isArray(category.links) && category.links.length > 0) { %> <nav class="category-news"> <h4>In the news</h4> <% _.each(category.links, function(l) { %> <a href="<%= l.url %>"><%= l.title %></a> <% }) %> </nav> <% } %> <section class="bills-list"> <% category.bills.each(function(b) { %> <%= templates.ebill({ bill: b.toJSON(), expandable: true, templates: templates }) %> <% }); %> </section> </div>
Move category image, meta and watching total into header, change some class names for consistent naming conv
Move category image, meta and watching total into header, change some class names for consistent naming conv
HTML
mit
Code-for-Miami/legislature-tracker,Code-for-Miami/legislature-tracker,Code-for-Miami/legislature-tracker
html
## Code Before: <%= header %> <div class="category-container"> <h2> <% if (category.image) { %> <img class="category-image" src="<%= LT.utils.imagePath(category.image) %>" /> <% } %> <%= category.title %> </h2> <p><%= category.description %></p> <% if (_.isArray(category.links) && category.links.length > 0) { %> <div class="e-links"> <h4>In the news</h4> <ul class="e-links-list"> <% _.each(category.links, function(l) { %> <li><a href="<%= l.url %>"><%= l.title %></a></li> <% }) %> </ul> </div> <% } %> <div class="clear-block bills-list"> <% category.bills.each(function(b) { %> <%= templates.ebill({ bill: b.toJSON(), expandable: true, templates: templates }) %> <% }); %> </div> <div class="clear-block total-bill"> Watching <strong><%= category.bills.length %></strong> <% if (typeof category.total_bill_count != 'undefined') { %> of <%= category.total_bill_count %> <% } %> bills in the <%= category.title %> category. </div> </div> ## Instruction: Move category image, meta and watching total into header, change some class names for consistent naming conv ## Code After: <%= header %> <div class="category-container"> <header> <% if (category.image) { %> <img class="category-image" src="<%= LT.utils.imagePath(category.image) %>" /> <% } %> <section class="category-meta"> <h2><%= category.title %></h2> <% if (category.description) { %> <p><%= category.description %></p> <% } %> </section> <p class="category-bill-total"> Watching <strong><%= category.bills.length %></strong> <% if (typeof category.total_bill_count != 'undefined') { %> of <%= category.total_bill_count %> <% } %> bills in the <%= category.title %> category. </p> </header> <% if (_.isArray(category.links) && category.links.length > 0) { %> <nav class="category-news"> <h4>In the news</h4> <% _.each(category.links, function(l) { %> <a href="<%= l.url %>"><%= l.title %></a> <% }) %> </nav> <% } %> <section class="bills-list"> <% category.bills.each(function(b) { %> <%= templates.ebill({ bill: b.toJSON(), expandable: true, templates: templates }) %> <% }); %> </section> </div>
- <%= header %> <div class="category-container"> - <h2> + + <header> - <% if (category.image) { %> ? ^^^^ + <% if (category.image) { %> ? ^^ - <img class="category-image" src="<%= LT.utils.imagePath(category.image) %>" /> ? ^^^^^^ + <img class="category-image" src="<%= LT.utils.imagePath(category.image) %>" /> ? ^^ - <% } %> - - <%= category.title %> - </h2> - + <% } %> + + <section class="category-meta"> + <h2><%= category.title %></h2> + <% if (category.description) { %> - <p><%= category.description %></p> ? ^^ + <p><%= category.description %></p> ? ^^^ - + <% } %> + </section> + + <p class="category-bill-total"> + Watching + <strong><%= category.bills.length %></strong> + <% if (typeof category.total_bill_count != 'undefined') { %> + of <%= category.total_bill_count %> + <% } %> + bills in the <%= category.title %> category. + </p> + + </header> + - <% if (_.isArray(category.links) && category.links.length > 0) { %> ? ^^ + <% if (_.isArray(category.links) && category.links.length > 0) { %> ? ^ - <div class="e-links"> + <nav class="category-news"> - <h4>In the news</h4> ? ^^^^^^ + <h4>In the news</h4> ? ^^^ - - <ul class="e-links-list"> - <% _.each(category.links, function(l) { %> ? ^^^^^^^^ + <% _.each(category.links, function(l) { %> ? ^^^ - <li><a href="<%= l.url %>"><%= l.title %></a></li> ? ^^^^^^^^^^^^^^ ----- + <a href="<%= l.url %>"><%= l.title %></a> ? ^^^^ + <% }) %> + </nav> - <% }) %> - </ul> - </div> - <% } %> ? ^^ + <% } %> ? ^ - - <div class="clear-block bills-list"> + + <section class="bills-list"> - <% category.bills.each(function(b) { %> ? ^^^^ + <% category.bills.each(function(b) { %> ? ^^ - <%= templates.ebill({ ? ^^^^^^ + <%= templates.ebill({ ? ^^^ - bill: b.toJSON(), - expandable: true, + bill: b.toJSON(), + expandable: true, - templates: templates ? ^^^^^^^^ + templates: templates ? ^^^^ - }) %> + }) %> - <% }); %> ? ^^^^ + <% }); %> ? ^^ + </section> + - </div> - - <div class="clear-block total-bill"> - Watching - <strong><%= category.bills.length %></strong> - <% if (typeof category.total_bill_count != 'undefined') { %> - of <%= category.total_bill_count %> - <% } %> - bills in the <%= category.title %> category. - </div> </div>
84
1.866667
43
41
969c980a32b4d553f5a9946b8ba2157e7b422ce4
.travis.yml
.travis.yml
language: go go: - 1.7 go_import_path: github.com/coreos/kube-aws script: - make test after_success: - bash <(curl -s https://codecov.io/bash)
language: go go: - 1.7 go_import_path: github.com/coreos/kube-aws script: - make test-with-cover after_success: - bash <(curl -s https://codecov.io/bash)
Send recorded coverage profiles to Codecov
Send recorded coverage profiles to Codecov
YAML
apache-2.0
iflix-letsplay/kube-aws,danielfm/kube-aws,camilb/kube-aws,mumoshu/kube-aws,c-knowles/kube-aws,kubernetes-incubator/kube-aws,AlmogBaku/kube-aws,kubernetes-incubator/kube-aws,everpeace/kube-aws,c-knowles/kube-aws,danielfm/kube-aws,mumoshu/kube-aws,HotelsDotCom/kube-aws,camilb/kube-aws,HotelsDotCom/kube-aws,everpeace/kube-aws,AlmogBaku/kube-aws,iflix-letsplay/kube-aws
yaml
## Code Before: language: go go: - 1.7 go_import_path: github.com/coreos/kube-aws script: - make test after_success: - bash <(curl -s https://codecov.io/bash) ## Instruction: Send recorded coverage profiles to Codecov ## Code After: language: go go: - 1.7 go_import_path: github.com/coreos/kube-aws script: - make test-with-cover after_success: - bash <(curl -s https://codecov.io/bash)
language: go go: - 1.7 go_import_path: github.com/coreos/kube-aws script: - - make test + - make test-with-cover after_success: - bash <(curl -s https://codecov.io/bash)
2
0.25
1
1
dd008a50f85c55cfb78dd768ced1eff6f86c1032
templates/app.json.erb
templates/app.json.erb
{ "name":"<%= app_name.dasherize %>", "scripts":{}, "env":{ "APPLICATION_HOST":{ "required":true }, "EMAIL_RECIPIENTS":{ "required":true }, "HEROKU_APP_NAME": { "required":true }, "HEROKU_PARENT_APP_NAME": { "required":true }, "RACK_ENV":{ "required":true }, "SECRET_KEY_BASE":{ "generator":"secret" }, "SMTP_ADDRESS":{ "required":true }, "SMTP_DOMAIN":{ "required":true }, "SMTP_PASSWORD":{ "required":true }, "SMTP_USERNAME":{ "required":true } }, "addons":[ "heroku-postgresql" ] }
{ "name":"<%= app_name.dasherize %>", "scripts":{}, "env":{ "APPLICATION_HOST":{ "required":true }, "EMAIL_RECIPIENTS":{ "required":true }, "HEROKU_APP_NAME": { "required":true }, "HEROKU_PARENT_APP_NAME": { "required":true }, "RACK_ENV":{ "required":true }, "SECRET_KEY_BASE":{ "generator":"secret" }, "SMTP_ADDRESS":{ "required":true }, "SMTP_DOMAIN":{ "required":true }, "SMTP_PASSWORD":{ "required":true }, "SMTP_USERNAME":{ "required":true }, "ERRBIT_API_KEY":{ "required":true } }, "addons":[ "heroku-postgresql" ] }
Add errbit key as required on heroku
Add errbit key as required on heroku
HTML+ERB
mit
welaika/welaika-suspenders,welaika/welaika-suspenders,mukkoo/welaika-suspenders,mukkoo/welaika-suspenders,mukkoo/welaika-suspenders,welaika/welaika-suspenders
html+erb
## Code Before: { "name":"<%= app_name.dasherize %>", "scripts":{}, "env":{ "APPLICATION_HOST":{ "required":true }, "EMAIL_RECIPIENTS":{ "required":true }, "HEROKU_APP_NAME": { "required":true }, "HEROKU_PARENT_APP_NAME": { "required":true }, "RACK_ENV":{ "required":true }, "SECRET_KEY_BASE":{ "generator":"secret" }, "SMTP_ADDRESS":{ "required":true }, "SMTP_DOMAIN":{ "required":true }, "SMTP_PASSWORD":{ "required":true }, "SMTP_USERNAME":{ "required":true } }, "addons":[ "heroku-postgresql" ] } ## Instruction: Add errbit key as required on heroku ## Code After: { "name":"<%= app_name.dasherize %>", "scripts":{}, "env":{ "APPLICATION_HOST":{ "required":true }, "EMAIL_RECIPIENTS":{ "required":true }, "HEROKU_APP_NAME": { "required":true }, "HEROKU_PARENT_APP_NAME": { "required":true }, "RACK_ENV":{ "required":true }, "SECRET_KEY_BASE":{ "generator":"secret" }, "SMTP_ADDRESS":{ "required":true }, "SMTP_DOMAIN":{ "required":true }, "SMTP_PASSWORD":{ "required":true }, "SMTP_USERNAME":{ "required":true }, "ERRBIT_API_KEY":{ "required":true } }, "addons":[ "heroku-postgresql" ] }
{ "name":"<%= app_name.dasherize %>", "scripts":{}, "env":{ "APPLICATION_HOST":{ "required":true }, "EMAIL_RECIPIENTS":{ "required":true }, "HEROKU_APP_NAME": { "required":true }, "HEROKU_PARENT_APP_NAME": { "required":true }, "RACK_ENV":{ "required":true }, "SECRET_KEY_BASE":{ "generator":"secret" }, "SMTP_ADDRESS":{ "required":true }, "SMTP_DOMAIN":{ "required":true }, "SMTP_PASSWORD":{ "required":true }, "SMTP_USERNAME":{ "required":true + }, + "ERRBIT_API_KEY":{ + "required":true } }, "addons":[ "heroku-postgresql" ] }
3
0.076923
3
0
0c912f0df7b63c89883fb7bd4990bc1f00a99025
cli/Watch.js
cli/Watch.js
"use strict" let Main = require('../lib/main-with-plugins') let Minimist = require('minimist') let FSWatcher = require('node-fswatcher') let Options = Minimist(process.argv.slice(2)) let FS = require('fs') try { Options.blacklist = String(Options.blacklist || '').split(',').map(function(e) { return e.trim() }).filter(function(e) { return e && e !== 'true' }) if(!Options['_'].length) throw new Error("Please specify a file/directory to watch") let Watcher = new FSWatcher Watcher.watch(Options['_'][0]) Watcher.on('update', function(Info){ FS.access(Info.Path, FS.R_OK, function(err){ if(!err) Main.compileFile(Info.Path, Options).then(function(Output) { Output = Output.contents if(Options.Output){ FS.writeFileSync(Options.Output, Output) } }).catch(function(err){ console.log(err) }) }) }) } catch(err){ console.log(err) }
"use strict" let FSWatcher = require('../lib/watcher') let Minimist = require('minimist') let Options = Minimist(process.argv.slice(2)) let FS = require('fs') try { Options.blacklist = String(Options.blacklist || '').split(',').map(function(e) { return e.trim() }).filter(function(e) { return e && e !== 'true' }) if(!Options['_'].length) throw new Error("Please specify a file/directory to watch") let Watcher = new FSWatcher(Options['_'][0]) Watcher.on('error', function(e){ console.log(e.stack) }) } catch(err){ console.log(err) }
Use the new watcher API in uc-watch
:new: Use the new watcher API in uc-watch
JavaScript
mit
steelbrain/UCompiler
javascript
## Code Before: "use strict" let Main = require('../lib/main-with-plugins') let Minimist = require('minimist') let FSWatcher = require('node-fswatcher') let Options = Minimist(process.argv.slice(2)) let FS = require('fs') try { Options.blacklist = String(Options.blacklist || '').split(',').map(function(e) { return e.trim() }).filter(function(e) { return e && e !== 'true' }) if(!Options['_'].length) throw new Error("Please specify a file/directory to watch") let Watcher = new FSWatcher Watcher.watch(Options['_'][0]) Watcher.on('update', function(Info){ FS.access(Info.Path, FS.R_OK, function(err){ if(!err) Main.compileFile(Info.Path, Options).then(function(Output) { Output = Output.contents if(Options.Output){ FS.writeFileSync(Options.Output, Output) } }).catch(function(err){ console.log(err) }) }) }) } catch(err){ console.log(err) } ## Instruction: :new: Use the new watcher API in uc-watch ## Code After: "use strict" let FSWatcher = require('../lib/watcher') let Minimist = require('minimist') let Options = Minimist(process.argv.slice(2)) let FS = require('fs') try { Options.blacklist = String(Options.blacklist || '').split(',').map(function(e) { return e.trim() }).filter(function(e) { return e && e !== 'true' }) if(!Options['_'].length) throw new Error("Please specify a file/directory to watch") let Watcher = new FSWatcher(Options['_'][0]) Watcher.on('error', function(e){ console.log(e.stack) }) } catch(err){ console.log(err) }
"use strict" - let Main = require('../lib/main-with-plugins') + let FSWatcher = require('../lib/watcher') let Minimist = require('minimist') - let FSWatcher = require('node-fswatcher') let Options = Minimist(process.argv.slice(2)) let FS = require('fs') try { Options.blacklist = String(Options.blacklist || '').split(',').map(function(e) { return e.trim() }).filter(function(e) { return e && e !== 'true' }) if(!Options['_'].length) throw new Error("Please specify a file/directory to watch") - let Watcher = new FSWatcher - Watcher.watch(Options['_'][0]) ? ^ + let Watcher = new FSWatcher(Options['_'][0]) ? ++++ ^^^^^ ++++ ++ - Watcher.on('update', function(Info){ ? ----- ^^^^ + Watcher.on('error', function(e){ ? ++++ ^ + console.log(e.stack) - FS.access(Info.Path, FS.R_OK, function(err){ - if(!err) - Main.compileFile(Info.Path, Options).then(function(Output) { - Output = Output.contents - if(Options.Output){ - FS.writeFileSync(Options.Output, Output) - } - }).catch(function(err){ - console.log(err) - }) - }) }) } catch(err){ console.log(err) }
20
0.740741
4
16
ebce20c36007f5665d927b860a64f45de5f128c4
uptests/web/responding.py
uptests/web/responding.py
import urllib2 import argparse import portend parser = argparse.ArgumentParser() parser.add_argument('host') parser.add_argument('port', type=int) args = parser.parse_args() portend.occupied(args.host, args.port, timeout=3) root = 'http://{host}:{port}/'.format(**vars(args)) urllib2.urlopen(root)
import urllib.request import argparse import portend parser = argparse.ArgumentParser() parser.add_argument('host') parser.add_argument('port', type=int) args = parser.parse_args() portend.occupied(args.host, args.port, timeout=3) root = 'http://{host}:{port}/'.format(**vars(args)) urllib.request.urlopen(root)
Update uptest for Python 3
Update uptest for Python 3
Python
mit
yougov/librarypaste,yougov/librarypaste
python
## Code Before: import urllib2 import argparse import portend parser = argparse.ArgumentParser() parser.add_argument('host') parser.add_argument('port', type=int) args = parser.parse_args() portend.occupied(args.host, args.port, timeout=3) root = 'http://{host}:{port}/'.format(**vars(args)) urllib2.urlopen(root) ## Instruction: Update uptest for Python 3 ## Code After: import urllib.request import argparse import portend parser = argparse.ArgumentParser() parser.add_argument('host') parser.add_argument('port', type=int) args = parser.parse_args() portend.occupied(args.host, args.port, timeout=3) root = 'http://{host}:{port}/'.format(**vars(args)) urllib.request.urlopen(root)
- import urllib2 + import urllib.request import argparse import portend parser = argparse.ArgumentParser() parser.add_argument('host') parser.add_argument('port', type=int) args = parser.parse_args() portend.occupied(args.host, args.port, timeout=3) root = 'http://{host}:{port}/'.format(**vars(args)) - urllib2.urlopen(root) ? ^ + urllib.request.urlopen(root) ? ^^^^^^^^
4
0.285714
2
2
b1e8a197b78f2e3eecb310c2c9f7481ff89a385b
dotfiles/zsh/aliases.sh
dotfiles/zsh/aliases.sh
alias lock='/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend' alias rmdsstores='find ./ -type f | grep .DS_Store | xargs rm' alias sleep='pmset sleepnow' # Git alias gd='git diff' alias gap='git add -p' # Programming alias j='jasmine-headless-webkit --color' # Other alias lisa='ls -lisa'
alias lock='/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend' alias rmdsstores='find ./ -type f | grep .DS_Store | xargs rm' alias sleep='pmset sleepnow' # Git alias gd='git diff' alias gap='git add -p' # Programming alias j='jasmine-headless-webkit --color' # Other alias lisa='ls -lisa' # Change theme of Terminal.app tabc() { NAME="${1:-Default}" osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"$NAME\"" } # Change to Danger theme when executing ssh ssh() { tabc Danger /usr/bin/ssh "$*" tabc }
Change theme of Terminal.app when executing ssh.
Change theme of Terminal.app when executing ssh.
Shell
mit
ream88/dotfiles,ream88/dotfiles
shell
## Code Before: alias lock='/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend' alias rmdsstores='find ./ -type f | grep .DS_Store | xargs rm' alias sleep='pmset sleepnow' # Git alias gd='git diff' alias gap='git add -p' # Programming alias j='jasmine-headless-webkit --color' # Other alias lisa='ls -lisa' ## Instruction: Change theme of Terminal.app when executing ssh. ## Code After: alias lock='/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend' alias rmdsstores='find ./ -type f | grep .DS_Store | xargs rm' alias sleep='pmset sleepnow' # Git alias gd='git diff' alias gap='git add -p' # Programming alias j='jasmine-headless-webkit --color' # Other alias lisa='ls -lisa' # Change theme of Terminal.app tabc() { NAME="${1:-Default}" osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"$NAME\"" } # Change to Danger theme when executing ssh ssh() { tabc Danger /usr/bin/ssh "$*" tabc }
alias lock='/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend' alias rmdsstores='find ./ -type f | grep .DS_Store | xargs rm' alias sleep='pmset sleepnow' # Git alias gd='git diff' alias gap='git add -p' # Programming alias j='jasmine-headless-webkit --color' # Other alias lisa='ls -lisa' + + # Change theme of Terminal.app + tabc() { + NAME="${1:-Default}" + osascript -e "tell application \"Terminal\" to set current settings of front window to settings set \"$NAME\"" + } + + # Change to Danger theme when executing ssh + ssh() { + tabc Danger + /usr/bin/ssh "$*" + tabc + }
13
0.8125
13
0
ecbcbc0948a5227689e619e32362690a5363b904
lib/web/views/index.jade
lib/web/views/index.jade
extends layout block append css link(href='/static/css/index.less', rel='stylesheet/less', type='text/css') block append scripts script(src='/static/js/contacts.js') block content #timeline include includes/timeline_event .container-fluid .row-fluid .span3 #banner-block.ablock h1=project.name h3=project.description #links-block.ablock h1 Links ul each uri, name in project.links li a(href='#{uri}') #{name} .span3 #contacts-block.ablock h1 Contacts span#contacts-plus \u25B6 .contacts ul if pager_duty.error p.alert!=trace(pager_duty.error) else for team in project.contacts include includes/team_contacts .span3 if project.environments.length #environments-block.ablock include includes/environments if version_one #versionone-block.ablock.middleware-block include includes/version_one if new_relic #newrelic-block.ablock.middleware-block include includes/new_relic if dreadnot #dreadnot-block.ablock.middleware-block include includes/dreadnot script(src='/static/jquery/jquery-1.7.1.min.js') script(src='/static/bootstrap/js/bootstrap.min.js')
extends layout block append css link(href='/static/css/index.less', rel='stylesheet/less', type='text/css') block append scripts script(src='/static/js/contacts.js') block content #timeline include includes/timeline_event .container-fluid .row-fluid .span3 #banner-block.ablock h1=project.name h3=project.description #links-block.ablock h1 Links ul each uri, name in project.links li a(href='#{uri}') #{name} .span3 #contacts-block.ablock h1 Contacts span#contacts-plus \u25B6 .contacts ul if pager_duty.error p.alert!=trace(pager_duty.error) else if pager_duty.data for team in project.contacts include includes/team_contacts .span3 if project.environments.length #environments-block.ablock include includes/environments if version_one #versionone-block.ablock.middleware-block include includes/version_one if new_relic #newrelic-block.ablock.middleware-block include includes/new_relic if dreadnot #dreadnot-block.ablock.middleware-block include includes/dreadnot script(src='/static/jquery/jquery-1.7.1.min.js') script(src='/static/bootstrap/js/bootstrap.min.js')
Fix error if there are no contacts
Fix error if there are no contacts
Jade
apache-2.0
racker/gutsy,racker/gutsy
jade
## Code Before: extends layout block append css link(href='/static/css/index.less', rel='stylesheet/less', type='text/css') block append scripts script(src='/static/js/contacts.js') block content #timeline include includes/timeline_event .container-fluid .row-fluid .span3 #banner-block.ablock h1=project.name h3=project.description #links-block.ablock h1 Links ul each uri, name in project.links li a(href='#{uri}') #{name} .span3 #contacts-block.ablock h1 Contacts span#contacts-plus \u25B6 .contacts ul if pager_duty.error p.alert!=trace(pager_duty.error) else for team in project.contacts include includes/team_contacts .span3 if project.environments.length #environments-block.ablock include includes/environments if version_one #versionone-block.ablock.middleware-block include includes/version_one if new_relic #newrelic-block.ablock.middleware-block include includes/new_relic if dreadnot #dreadnot-block.ablock.middleware-block include includes/dreadnot script(src='/static/jquery/jquery-1.7.1.min.js') script(src='/static/bootstrap/js/bootstrap.min.js') ## Instruction: Fix error if there are no contacts ## Code After: extends layout block append css link(href='/static/css/index.less', rel='stylesheet/less', type='text/css') block append scripts script(src='/static/js/contacts.js') block content #timeline include includes/timeline_event .container-fluid .row-fluid .span3 #banner-block.ablock h1=project.name h3=project.description #links-block.ablock h1 Links ul each uri, name in project.links li a(href='#{uri}') #{name} .span3 #contacts-block.ablock h1 Contacts span#contacts-plus \u25B6 .contacts ul if pager_duty.error p.alert!=trace(pager_duty.error) else if pager_duty.data for team in project.contacts include includes/team_contacts .span3 if project.environments.length #environments-block.ablock include includes/environments if version_one #versionone-block.ablock.middleware-block include includes/version_one if new_relic #newrelic-block.ablock.middleware-block include includes/new_relic if dreadnot #dreadnot-block.ablock.middleware-block include includes/dreadnot script(src='/static/jquery/jquery-1.7.1.min.js') script(src='/static/bootstrap/js/bootstrap.min.js')
extends layout block append css link(href='/static/css/index.less', rel='stylesheet/less', type='text/css') block append scripts script(src='/static/js/contacts.js') block content #timeline include includes/timeline_event .container-fluid .row-fluid .span3 #banner-block.ablock h1=project.name h3=project.description #links-block.ablock h1 Links ul each uri, name in project.links li a(href='#{uri}') #{name} .span3 #contacts-block.ablock h1 Contacts span#contacts-plus \u25B6 .contacts ul if pager_duty.error p.alert!=trace(pager_duty.error) - else + else if pager_duty.data for team in project.contacts include includes/team_contacts .span3 if project.environments.length #environments-block.ablock include includes/environments if version_one #versionone-block.ablock.middleware-block include includes/version_one if new_relic #newrelic-block.ablock.middleware-block include includes/new_relic if dreadnot #dreadnot-block.ablock.middleware-block include includes/dreadnot script(src='/static/jquery/jquery-1.7.1.min.js') script(src='/static/bootstrap/js/bootstrap.min.js')
2
0.035088
1
1
a36082c53b6c4937116b4e2fd8dbce306f411f5b
core/src/main/java/org/fedoraproject/javadeptools/model/ManifestEntry.java
core/src/main/java/org/fedoraproject/javadeptools/model/ManifestEntry.java
package org.fedoraproject.javadeptools.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; @Entity @Table public class ManifestEntry { @Id @GeneratedValue(generator = "gen") @GenericGenerator(name = "gen", strategy = "increment") private Long id; @ManyToOne @JoinColumn(name = "fileArtifactId", nullable = false) private FileArtifact fileArtifact; public ManifestEntry() { } public ManifestEntry(String key, String value) { this.key = key; this.value = value; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public FileArtifact getFileArtifact() { return fileArtifact; } public void setFileArtifact(FileArtifact fileArtifact) { this.fileArtifact = fileArtifact; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } private String key; @Lob private String value; }
package org.fedoraproject.javadeptools.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; @Entity @Table public class ManifestEntry { @Id @GeneratedValue(generator = "gen") @GenericGenerator(name = "gen", strategy = "increment") private Long id; @ManyToOne @JoinColumn(name = "fileArtifactId", nullable = false) private FileArtifact fileArtifact; public ManifestEntry() { } public ManifestEntry(String key, String value) { this.key = key; this.value = value; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public FileArtifact getFileArtifact() { return fileArtifact; } public void setFileArtifact(FileArtifact fileArtifact) { this.fileArtifact = fileArtifact; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } private String key; @Column(columnDefinition = "VARCHAR") private String value; }
Use VARCHAR instead of LOB
Use VARCHAR instead of LOB
Java
apache-2.0
msimacek/java-deptools,msimacek/java-deptools,msimacek/java-deptools,msimacek/java-deptools
java
## Code Before: package org.fedoraproject.javadeptools.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; @Entity @Table public class ManifestEntry { @Id @GeneratedValue(generator = "gen") @GenericGenerator(name = "gen", strategy = "increment") private Long id; @ManyToOne @JoinColumn(name = "fileArtifactId", nullable = false) private FileArtifact fileArtifact; public ManifestEntry() { } public ManifestEntry(String key, String value) { this.key = key; this.value = value; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public FileArtifact getFileArtifact() { return fileArtifact; } public void setFileArtifact(FileArtifact fileArtifact) { this.fileArtifact = fileArtifact; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } private String key; @Lob private String value; } ## Instruction: Use VARCHAR instead of LOB ## Code After: package org.fedoraproject.javadeptools.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; @Entity @Table public class ManifestEntry { @Id @GeneratedValue(generator = "gen") @GenericGenerator(name = "gen", strategy = "increment") private Long id; @ManyToOne @JoinColumn(name = "fileArtifactId", nullable = false) private FileArtifact fileArtifact; public ManifestEntry() { } public ManifestEntry(String key, String value) { this.key = key; this.value = value; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public FileArtifact getFileArtifact() { return fileArtifact; } public void setFileArtifact(FileArtifact fileArtifact) { this.fileArtifact = fileArtifact; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } private String key; @Column(columnDefinition = "VARCHAR") private String value; }
package org.fedoraproject.javadeptools.model; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; - import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.Table; import org.hibernate.annotations.GenericGenerator; @Entity @Table public class ManifestEntry { @Id @GeneratedValue(generator = "gen") @GenericGenerator(name = "gen", strategy = "increment") private Long id; @ManyToOne @JoinColumn(name = "fileArtifactId", nullable = false) private FileArtifact fileArtifact; public ManifestEntry() { } public ManifestEntry(String key, String value) { this.key = key; this.value = value; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public FileArtifact getFileArtifact() { return fileArtifact; } public void setFileArtifact(FileArtifact fileArtifact) { this.fileArtifact = fileArtifact; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public String getValue() { return value; } public void setValue(String value) { this.value = value; } private String key; - @Lob + @Column(columnDefinition = "VARCHAR") private String value; }
4
0.057971
2
2
ebf9dd2e6c4ae0f5fc44cb3b2e8cd4b4e8dfaeb6
src/main/java/leetcode/Problem701.java
src/main/java/leetcode/Problem701.java
package leetcode; /** * https://leetcode.com/problems/insert-into-a-binary-search-tree/ */ public class Problem701 { public static class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public TreeNode insertIntoBST(TreeNode root, int val) { // TODO return null; } public static void main(String[] args) { Problem701 prob = new Problem701(); } }
package leetcode; /** * https://leetcode.com/problems/insert-into-a-binary-search-tree/ */ public class Problem701 { public static class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public TreeNode insertIntoBST(TreeNode root, int val) { if (root == null) { return new TreeNode(val); } if (root.val > val) { root.left = insertIntoBST(root.left, val); } else { root.right = insertIntoBST(root.right, val); } return root; } }
Solve problem 701 (my 600th problem :)
Solve problem 701 (my 600th problem :)
Java
mit
fredyw/leetcode,fredyw/leetcode,fredyw/leetcode,fredyw/leetcode
java
## Code Before: package leetcode; /** * https://leetcode.com/problems/insert-into-a-binary-search-tree/ */ public class Problem701 { public static class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public TreeNode insertIntoBST(TreeNode root, int val) { // TODO return null; } public static void main(String[] args) { Problem701 prob = new Problem701(); } } ## Instruction: Solve problem 701 (my 600th problem :) ## Code After: package leetcode; /** * https://leetcode.com/problems/insert-into-a-binary-search-tree/ */ public class Problem701 { public static class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public TreeNode insertIntoBST(TreeNode root, int val) { if (root == null) { return new TreeNode(val); } if (root.val > val) { root.left = insertIntoBST(root.left, val); } else { root.right = insertIntoBST(root.right, val); } return root; } }
package leetcode; /** * https://leetcode.com/problems/insert-into-a-binary-search-tree/ */ public class Problem701 { public static class TreeNode { int val; TreeNode left; TreeNode right; TreeNode(int x) { val = x; } } public TreeNode insertIntoBST(TreeNode root, int val) { - // TODO + if (root == null) { + return new TreeNode(val); + } + if (root.val > val) { + root.left = insertIntoBST(root.left, val); + } else { + root.right = insertIntoBST(root.right, val); + } - return null; ? ^^^^ + return root; ? ^^^^ - } - - public static void main(String[] args) { - Problem701 prob = new Problem701(); } }
15
0.6
9
6
dd8bd6b6e577d8539671ce85047a6b94afee8d20
.travis.yml
.travis.yml
language: php php: - 5.5 - 5.6 - 7.0 - hhvm matrix: allow_failures: - php: hhvm sudo: false env: - LARAVEL_VERSION="~5.1.0" TESTBENCH_VERSION="~3.1.0" - LARAVEL_VERSION="~5.2.0" TESTBENCH_VERSION="~3.2.0" - LARAVEL_VERSION="~5.3.0" TESTBENCH_VERSION="~3.3.0" before_install: - sed -i s/~5.1.0\|\|~5.2.0\|\|~5.3.0/${LARAVEL_VERSION}/ composer.json - sed -i s/~3.1.0\|\|~3.2.0\|\|~3.3.0/${TESTBENCH_VERSION}/ composer.json - composer update # Use update since we'll be changing the composer.json script: vendor/bin/phpunit tests
language: php php: - 5.5 - 5.6 - 7.0 - hhvm matrix: allow_failures: - php: hhvm - php: 5.5 # Laravel 5.3 doesn't support PHP 5.5 sudo: false env: - LARAVEL_VERSION="~5.1.0" TESTBENCH_VERSION="~3.1.0" - LARAVEL_VERSION="~5.2.0" TESTBENCH_VERSION="~3.2.0" - LARAVEL_VERSION="~5.3.0" TESTBENCH_VERSION="~3.3.0" before_install: - sed -i s/~5.1.0\|\|~5.2.0\|\|~5.3.0/${LARAVEL_VERSION}/ composer.json - sed -i s/~3.1.0\|\|~3.2.0\|\|~3.3.0/${TESTBENCH_VERSION}/ composer.json - composer update # Use update since we'll be changing the composer.json script: vendor/bin/phpunit tests
Tweak Travis CI config, because Laravel 5.3 doesn't support PHP 5.5
Tweak Travis CI config, because Laravel 5.3 doesn't support PHP 5.5
YAML
mit
efficiently/jquery-laravel,efficiently/jquery-laravel
yaml
## Code Before: language: php php: - 5.5 - 5.6 - 7.0 - hhvm matrix: allow_failures: - php: hhvm sudo: false env: - LARAVEL_VERSION="~5.1.0" TESTBENCH_VERSION="~3.1.0" - LARAVEL_VERSION="~5.2.0" TESTBENCH_VERSION="~3.2.0" - LARAVEL_VERSION="~5.3.0" TESTBENCH_VERSION="~3.3.0" before_install: - sed -i s/~5.1.0\|\|~5.2.0\|\|~5.3.0/${LARAVEL_VERSION}/ composer.json - sed -i s/~3.1.0\|\|~3.2.0\|\|~3.3.0/${TESTBENCH_VERSION}/ composer.json - composer update # Use update since we'll be changing the composer.json script: vendor/bin/phpunit tests ## Instruction: Tweak Travis CI config, because Laravel 5.3 doesn't support PHP 5.5 ## Code After: language: php php: - 5.5 - 5.6 - 7.0 - hhvm matrix: allow_failures: - php: hhvm - php: 5.5 # Laravel 5.3 doesn't support PHP 5.5 sudo: false env: - LARAVEL_VERSION="~5.1.0" TESTBENCH_VERSION="~3.1.0" - LARAVEL_VERSION="~5.2.0" TESTBENCH_VERSION="~3.2.0" - LARAVEL_VERSION="~5.3.0" TESTBENCH_VERSION="~3.3.0" before_install: - sed -i s/~5.1.0\|\|~5.2.0\|\|~5.3.0/${LARAVEL_VERSION}/ composer.json - sed -i s/~3.1.0\|\|~3.2.0\|\|~3.3.0/${TESTBENCH_VERSION}/ composer.json - composer update # Use update since we'll be changing the composer.json script: vendor/bin/phpunit tests
language: php php: - 5.5 - 5.6 - 7.0 - hhvm matrix: allow_failures: - php: hhvm + - php: 5.5 # Laravel 5.3 doesn't support PHP 5.5 sudo: false env: - LARAVEL_VERSION="~5.1.0" TESTBENCH_VERSION="~3.1.0" - LARAVEL_VERSION="~5.2.0" TESTBENCH_VERSION="~3.2.0" - LARAVEL_VERSION="~5.3.0" TESTBENCH_VERSION="~3.3.0" before_install: - sed -i s/~5.1.0\|\|~5.2.0\|\|~5.3.0/${LARAVEL_VERSION}/ composer.json - sed -i s/~3.1.0\|\|~3.2.0\|\|~3.3.0/${TESTBENCH_VERSION}/ composer.json - composer update # Use update since we'll be changing the composer.json script: vendor/bin/phpunit tests
1
0.04
1
0
c87a07de905e36a268e37541bdf254542e4f38e8
ChangeLog.d/issue4286.txt
ChangeLog.d/issue4286.txt
Removals * Remove the TLS 1.0, TLS 1.1 and DTLS 1.0 support by removing the following deprecated library constants: MBEDTLS_SSL_PROTO_TLS1, MBEDTLS_SSL_PROTO_TLS1_1, MBEDTLS_SSL_CBC_RECORD_SPLITTING, MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED, MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED, MBEDTLS_SSL_RECORD_CHECKING, MBEDTLS_SSL_FALLBACK_SCSV, MBEDTLS_SSL_FALLBACK_SCSV_VALUE, MBEDTLS_SSL_IS_FALLBACK, MBEDTLS_SSL_IS_NOT_FALLBACK, and functions: mbedtls_ssl_conf_cbc_record_splitting(), mbedtls_ssl_get_key_exchange_md_ssl_tls(), mbedtls_ssl_conf_fallback(). Fixes #4286.
Removals * Remove the TLS 1.0, TLS 1.1 and DTLS 1.0 support by removing the following library constants: MBEDTLS_SSL_PROTO_TLS1, MBEDTLS_SSL_PROTO_TLS1_1, MBEDTLS_SSL_CBC_RECORD_SPLITTING, MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED, MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED, MBEDTLS_SSL_FALLBACK_SCSV, MBEDTLS_SSL_FALLBACK_SCSV_VALUE, MBEDTLS_SSL_IS_FALLBACK, MBEDTLS_SSL_IS_NOT_FALLBACK, and functions: mbedtls_ssl_conf_cbc_record_splitting(), mbedtls_ssl_get_key_exchange_md_ssl_tls(), mbedtls_ssl_conf_fallback(). Fixes #4286.
Fix the "rm (D)TLS 1.0 1.1" ChangeLog entry
Fix the "rm (D)TLS 1.0 1.1" ChangeLog entry - Removing MBEDTLS_SSL_RECORD_CHECKING has nothing to do with TLS 1.0, TLS 1.1 and DTLS 1.0. It has been included here as a consequence of an unfortunate typo in the description of 4286. Actually, this macro was removed independently and we already have a ChangeLog entry about it: ChangeLog.d/issue4361.txt - While at it, remove the word "deprecated": these macros and functions had not been documented as deprecated in any version of the library before being removed. Signed-off-by: Manuel Pégourié-Gonnard <4ba0d615aeeda88e422ca8fba28fe2938485facf@arm.com>
Text
apache-2.0
NXPmicro/mbedtls,ARMmbed/mbedtls,ARMmbed/mbedtls,ARMmbed/mbedtls,NXPmicro/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls,NXPmicro/mbedtls,NXPmicro/mbedtls,Mbed-TLS/mbedtls,Mbed-TLS/mbedtls,Mbed-TLS/mbedtls
text
## Code Before: Removals * Remove the TLS 1.0, TLS 1.1 and DTLS 1.0 support by removing the following deprecated library constants: MBEDTLS_SSL_PROTO_TLS1, MBEDTLS_SSL_PROTO_TLS1_1, MBEDTLS_SSL_CBC_RECORD_SPLITTING, MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED, MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED, MBEDTLS_SSL_RECORD_CHECKING, MBEDTLS_SSL_FALLBACK_SCSV, MBEDTLS_SSL_FALLBACK_SCSV_VALUE, MBEDTLS_SSL_IS_FALLBACK, MBEDTLS_SSL_IS_NOT_FALLBACK, and functions: mbedtls_ssl_conf_cbc_record_splitting(), mbedtls_ssl_get_key_exchange_md_ssl_tls(), mbedtls_ssl_conf_fallback(). Fixes #4286. ## Instruction: Fix the "rm (D)TLS 1.0 1.1" ChangeLog entry - Removing MBEDTLS_SSL_RECORD_CHECKING has nothing to do with TLS 1.0, TLS 1.1 and DTLS 1.0. It has been included here as a consequence of an unfortunate typo in the description of 4286. Actually, this macro was removed independently and we already have a ChangeLog entry about it: ChangeLog.d/issue4361.txt - While at it, remove the word "deprecated": these macros and functions had not been documented as deprecated in any version of the library before being removed. Signed-off-by: Manuel Pégourié-Gonnard <4ba0d615aeeda88e422ca8fba28fe2938485facf@arm.com> ## Code After: Removals * Remove the TLS 1.0, TLS 1.1 and DTLS 1.0 support by removing the following library constants: MBEDTLS_SSL_PROTO_TLS1, MBEDTLS_SSL_PROTO_TLS1_1, MBEDTLS_SSL_CBC_RECORD_SPLITTING, MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED, MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED, MBEDTLS_SSL_FALLBACK_SCSV, MBEDTLS_SSL_FALLBACK_SCSV_VALUE, MBEDTLS_SSL_IS_FALLBACK, MBEDTLS_SSL_IS_NOT_FALLBACK, and functions: mbedtls_ssl_conf_cbc_record_splitting(), mbedtls_ssl_get_key_exchange_md_ssl_tls(), mbedtls_ssl_conf_fallback(). Fixes #4286.
Removals * Remove the TLS 1.0, TLS 1.1 and DTLS 1.0 support by removing the following - deprecated library constants: MBEDTLS_SSL_PROTO_TLS1, ? ----------- + library constants: MBEDTLS_SSL_PROTO_TLS1, MBEDTLS_SSL_PROTO_TLS1_1, MBEDTLS_SSL_CBC_RECORD_SPLITTING, MBEDTLS_SSL_CBC_RECORD_SPLITTING_ENABLED, - MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED, MBEDTLS_SSL_RECORD_CHECKING, ? ----------------------------- + MBEDTLS_SSL_CBC_RECORD_SPLITTING_DISABLED, MBEDTLS_SSL_FALLBACK_SCSV, MBEDTLS_SSL_FALLBACK_SCSV_VALUE, MBEDTLS_SSL_IS_FALLBACK, MBEDTLS_SSL_IS_NOT_FALLBACK, and functions: mbedtls_ssl_conf_cbc_record_splitting(), mbedtls_ssl_get_key_exchange_md_ssl_tls(), mbedtls_ssl_conf_fallback(). Fixes #4286.
4
0.363636
2
2
3443a8ec4a77c60af27db8bf62ff1cefaad641b1
codemodules-editor/public_html/partials/main.html
codemodules-editor/public_html/partials/main.html
<div class="row"> <div class="col-md-6"> <div class="output row" id="output" style="padding-left: 30px; margin-bottom: 5px;" ng-include src="template"></div> <div clas="row"> <div ui-ace="{ useWrapMode : true, showGutter: true, theme:'twilight', mode: 'javascript', onLoad: aceLoaded, onChange: aceChanged }"> </div> </div> </div> <div class="guide col-md-6" id="guide"> <table class="table table-hover table-condensed"> <thead> <tr> <th>Tehtävä</th> <th>Valmis</th> </tr> </thead> <tbody> <tr ng-repeat="element in guide"> <td>{{element.text}}</td> <td> <button class="btn btn-success" ng-click="assess(numLeft, varLeft, numRight, varRight, varX)" ng-show="! element.done" data-loading-text="Tarkistan" >Tarkista</button> <span class="glyphicon glyphicon-ok" ng-show="element.done"></span> </td> </tr> </tbody> </table> <div ng-include="'partials/javascript.html'"> </div> </div>
<div class="row"> <div class="col-md-6"> <div class="output row" id="output" style="padding-left: 30px; margin-bottom: 5px;" ng-include src="template" onLoad="loaded()" ></div> <div clas="row"> <div ui-ace="{ useWrapMode : true, showGutter: true, theme:'twilight', mode: 'javascript', onLoad: aceLoaded, onChange: aceChanged }"> </div> </div> </div> <div class="guide col-md-6" id="guide"> <table class="table table-hover table-condensed"> <thead> <tr> <th>Tehtävä</th> <th>Valmis</th> </tr> </thead> <tbody> <tr ng-repeat="element in guide"> <td>{{element.text}}</td> <td> <button class="btn btn-success" ng-click="assess(numLeft, varLeft, numRight, varRight, varX)" ng-show="! element.done" data-loading-text="Tarkistan" >Tarkista</button> <span class="glyphicon glyphicon-ok" ng-show="element.done"></span> </td> </tr> </tbody> </table> <div ng-include="'partials/javascript.html'"> </div> </div>
Call loaded when loading has been done.
Call loaded when loading has been done.
HTML
mit
HIIT/codemodules,HIIT/codemodules
html
## Code Before: <div class="row"> <div class="col-md-6"> <div class="output row" id="output" style="padding-left: 30px; margin-bottom: 5px;" ng-include src="template"></div> <div clas="row"> <div ui-ace="{ useWrapMode : true, showGutter: true, theme:'twilight', mode: 'javascript', onLoad: aceLoaded, onChange: aceChanged }"> </div> </div> </div> <div class="guide col-md-6" id="guide"> <table class="table table-hover table-condensed"> <thead> <tr> <th>Tehtävä</th> <th>Valmis</th> </tr> </thead> <tbody> <tr ng-repeat="element in guide"> <td>{{element.text}}</td> <td> <button class="btn btn-success" ng-click="assess(numLeft, varLeft, numRight, varRight, varX)" ng-show="! element.done" data-loading-text="Tarkistan" >Tarkista</button> <span class="glyphicon glyphicon-ok" ng-show="element.done"></span> </td> </tr> </tbody> </table> <div ng-include="'partials/javascript.html'"> </div> </div> ## Instruction: Call loaded when loading has been done. ## Code After: <div class="row"> <div class="col-md-6"> <div class="output row" id="output" style="padding-left: 30px; margin-bottom: 5px;" ng-include src="template" onLoad="loaded()" ></div> <div clas="row"> <div ui-ace="{ useWrapMode : true, showGutter: true, theme:'twilight', mode: 'javascript', onLoad: aceLoaded, onChange: aceChanged }"> </div> </div> </div> <div class="guide col-md-6" id="guide"> <table class="table table-hover table-condensed"> <thead> <tr> <th>Tehtävä</th> <th>Valmis</th> </tr> </thead> <tbody> <tr ng-repeat="element in guide"> <td>{{element.text}}</td> <td> <button class="btn btn-success" ng-click="assess(numLeft, varLeft, numRight, varRight, varX)" ng-show="! element.done" data-loading-text="Tarkistan" >Tarkista</button> <span class="glyphicon glyphicon-ok" ng-show="element.done"></span> </td> </tr> </tbody> </table> <div ng-include="'partials/javascript.html'"> </div> </div>
<div class="row"> <div class="col-md-6"> - <div class="output row" id="output" style="padding-left: 30px; margin-bottom: 5px;" ng-include src="template"></div> + <div class="output row" id="output" style="padding-left: 30px; margin-bottom: 5px;" ng-include src="template" onLoad="loaded()" ></div> ? +++++++++++++++++++ <div clas="row"> <div ui-ace="{ useWrapMode : true, showGutter: true, theme:'twilight', mode: 'javascript', onLoad: aceLoaded, onChange: aceChanged }"> </div> </div> </div> <div class="guide col-md-6" id="guide"> <table class="table table-hover table-condensed"> <thead> <tr> <th>Tehtävä</th> <th>Valmis</th> </tr> </thead> <tbody> <tr ng-repeat="element in guide"> <td>{{element.text}}</td> <td> <button class="btn btn-success" ng-click="assess(numLeft, varLeft, numRight, varRight, varX)" ng-show="! element.done" data-loading-text="Tarkistan" >Tarkista</button> <span class="glyphicon glyphicon-ok" ng-show="element.done"></span> </td> </tr> </tbody> </table> <div ng-include="'partials/javascript.html'"> </div> </div>
2
0.043478
1
1
6ffba2d8b873011d7ac2da8872bf2f0f40ecc41a
README.md
README.md
Job searching is bad. Government websites are bad. This makes searching for government jobs extra bad. Gainful makes government job postings simple and sane. Every day, it finds all the newest postings and present them in a table. You can filter and sort listings however you want, and save your results as a daily email newsletter. No signups, no ads. It could not be easier. ## What job sites does Gainful search? Glad you asked. Gainful searches the following sources: - City of Toronto - City of Victoria - City of Mississauga - Ontario Public Service in the GTA (TODO) - ...etc ## Can I help? [twitter]: http://www.twitter.com/rgscherf Yes! [Get in touch][twitter] or make a [pull request](http://www.github.com/rgscherf/gainful2). ## Who wrote Gainful? Gainful is written by Robert Scherf. He's looking for a job--[hire him][twitter]!
Job searches are tedious. Government websites are awful. It makes searching for government jobs uniquely painful. Gainful makes government job postings simple and sane. Every morning, we find the newest jobs and present them in a table. You can filter and sort the table however you want. No signups. No ads. Using Gainful could not be easier. ## What job sites does Gainful search? Glad you asked. Gainful searches the following sources: - City of Toronto - City of Brampton - City of Mississauga - Peel Region - York Region - City of Markham - Halton Region - City of Oakville - City of Burlington ## Can I help? [twitter]: http://www.twitter.com/rgscherf Yes! [Get in touch][twitter] or make a [pull request](http://www.github.com/rgscherf/gainful2). ## Who wrote Gainful? Gainful is written by Robert Scherf. He's looking for a job--[hire him](http://scherf.works)!
Update readme to reflect current project status
Update readme to reflect current project status
Markdown
mit
rgscherf/gainful2,rgscherf/gainful2,rgscherf/gainful2,rgscherf/gainful2
markdown
## Code Before: Job searching is bad. Government websites are bad. This makes searching for government jobs extra bad. Gainful makes government job postings simple and sane. Every day, it finds all the newest postings and present them in a table. You can filter and sort listings however you want, and save your results as a daily email newsletter. No signups, no ads. It could not be easier. ## What job sites does Gainful search? Glad you asked. Gainful searches the following sources: - City of Toronto - City of Victoria - City of Mississauga - Ontario Public Service in the GTA (TODO) - ...etc ## Can I help? [twitter]: http://www.twitter.com/rgscherf Yes! [Get in touch][twitter] or make a [pull request](http://www.github.com/rgscherf/gainful2). ## Who wrote Gainful? Gainful is written by Robert Scherf. He's looking for a job--[hire him][twitter]! ## Instruction: Update readme to reflect current project status ## Code After: Job searches are tedious. Government websites are awful. It makes searching for government jobs uniquely painful. Gainful makes government job postings simple and sane. Every morning, we find the newest jobs and present them in a table. You can filter and sort the table however you want. No signups. No ads. Using Gainful could not be easier. ## What job sites does Gainful search? Glad you asked. Gainful searches the following sources: - City of Toronto - City of Brampton - City of Mississauga - Peel Region - York Region - City of Markham - Halton Region - City of Oakville - City of Burlington ## Can I help? [twitter]: http://www.twitter.com/rgscherf Yes! [Get in touch][twitter] or make a [pull request](http://www.github.com/rgscherf/gainful2). ## Who wrote Gainful? Gainful is written by Robert Scherf. He's looking for a job--[hire him](http://scherf.works)!
- Job searching is bad. Government websites are bad. This makes searching for government jobs extra bad. ? ^^^^^ - - ^ ^^^^ ^^^ ^^^^ + Job searches are tedious. Government websites are awful. It makes searching for government jobs uniquely painful. ? ^ +++++ ++++ ^^^^ ^^ +++++ ^^^^ ^^^^^ - Gainful makes government job postings simple and sane. Every day, it finds all the newest postings and present them in a table. You can filter and sort listings however you want, and save your results as a daily email newsletter. ? ^^^ ^^ ----- ^ ^^^^^ ^^^^^^^ --------------------------------------------------- + Gainful makes government job postings simple and sane. Every morning, we find the newest jobs and present them in a table. You can filter and sort the table however you want. ? ^^^^^^^ ^^ ^ ^ +++++++ ^ - No signups, no ads. It could not be easier. ? ^ ^ ^^ + No signups. No ads. Using Gainful could not be easier. ? ^ ^ ^^^^^^^^^^^^^ ## What job sites does Gainful search? Glad you asked. Gainful searches the following sources: - City of Toronto - - City of Victoria + - City of Brampton - City of Mississauga - - Ontario Public Service in the GTA (TODO) - - ...etc + - Peel Region + - York Region + - City of Markham + - Halton Region + - City of Oakville + - City of Burlington ## Can I help? [twitter]: http://www.twitter.com/rgscherf Yes! [Get in touch][twitter] or make a [pull request](http://www.github.com/rgscherf/gainful2). ## Who wrote Gainful? - Gainful is written by Robert Scherf. He's looking for a job--[hire him][twitter]! ? ^^^^ ^ + Gainful is written by Robert Scherf. He's looking for a job--[hire him](http://scherf.works)! ? ^^ +++++++ ^^^^^^^^
18
0.692308
11
7
f9d9fcec85543492808df80b6c422d6d3561eb44
base/system_monitor_win.cc
base/system_monitor_win.cc
// Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/system_monitor.h" namespace base { void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) { PowerEvent power_event; switch (event_id) { case PBT_APMPOWERSTATUSCHANGE: power_event = POWER_STATE_EVENT; break; case PBT_APMRESUMEAUTOMATIC: power_event = RESUME_EVENT; break; case PBT_APMSUSPEND: power_event = SUSPEND_EVENT; break; default: DCHECK(false); } ProcessPowerMessage(power_event); } // Function to query the system to see if it is currently running on // battery power. Returns true if running on battery. bool SystemMonitor::IsBatteryPower() { SYSTEM_POWER_STATUS status; if (!GetSystemPowerStatus(&status)) { LOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError(); return false; } return (status.ACLineStatus == 0); } } // namespace base
// Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/system_monitor.h" namespace base { void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) { PowerEvent power_event; switch (event_id) { case PBT_APMPOWERSTATUSCHANGE: // The power status changed. power_event = POWER_STATE_EVENT; break; case PBT_APMRESUMEAUTOMATIC: // Non-user initiated resume from suspend. case PBT_APMRESUMESUSPEND: // User initiated resume from suspend. power_event = RESUME_EVENT; break; case PBT_APMSUSPEND: // System has been suspended. power_event = SUSPEND_EVENT; break; default: return; // Other Power Events: // PBT_APMBATTERYLOW - removed in Vista. // PBT_APMOEMEVENT - removed in Vista. // PBT_APMQUERYSUSPEND - removed in Vista. // PBT_APMQUERYSUSPENDFAILED - removed in Vista. // PBT_APMRESUMECRITICAL - removed in Vista. // PBT_POWERSETTINGCHANGE - user changed the power settings. } ProcessPowerMessage(power_event); } // Function to query the system to see if it is currently running on // battery power. Returns true if running on battery. bool SystemMonitor::IsBatteryPower() { SYSTEM_POWER_STATUS status; if (!GetSystemPowerStatus(&status)) { LOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError(); return false; } return (status.ACLineStatus == 0); } } // namespace base
Update comments and remove bogus DCHECK in windows-specific broadcasted power message status.
Update comments and remove bogus DCHECK in windows-specific broadcasted power message status. Review URL: http://codereview.chromium.org/16220 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@7398 0039d316-1c4b-4281-b951-d872f2087c98
C++
bsd-3-clause
bright-sparks/chromium-spacewalk,chuan9/chromium-crosswalk,ondra-novak/chromium.src,patrickm/chromium.src,ltilve/chromium,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,rogerwang/chromium,Just-D/chromium-1,Jonekee/chromium.src,anirudhSK/chromium,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,mogoweb/chromium-crosswalk,rogerwang/chromium,Jonekee/chromium.src,timopulkkinen/BubbleFish,Jonekee/chromium.src,Just-D/chromium-1,dednal/chromium.src,hgl888/chromium-crosswalk-efl,M4sse/chromium.src,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,M4sse/chromium.src,Jonekee/chromium.src,chuan9/chromium-crosswalk,robclark/chromium,crosswalk-project/chromium-crosswalk-efl,keishi/chromium,Jonekee/chromium.src,robclark/chromium,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,Just-D/chromium-1,jaruba/chromium.src,Just-D/chromium-1,ltilve/chromium,ChromiumWebApps/chromium,markYoungH/chromium.src,M4sse/chromium.src,junmin-zhu/chromium-rivertrail,hujiajie/pa-chromium,ChromiumWebApps/chromium,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,anirudhSK/chromium,crosswalk-project/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,pozdnyakov/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,robclark/chromium,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,hujiajie/pa-chromium,nacl-webkit/chrome_deps,Chilledheart/chromium,pozdnyakov/chromium-crosswalk,M4sse/chromium.src,axinging/chromium-crosswalk,hujiajie/pa-chromium,dednal/chromium.src,mogoweb/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,junmin-zhu/chromium-rivertrail,junmin-zhu/chromium-rivertrail,Chilledheart/chromium,axinging/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,timopulkkinen/BubbleFish,patrickm/chromium.src,M4sse/chromium.src,zcbenz/cefode-chromium,hujiajie/pa-chromium,Chilledheart/chromium,M4sse/chromium.src,Just-D/chromium-1,hujiajie/pa-chromium,zcbenz/cefode-chromium,timopulkkinen/BubbleFish,mogoweb/chromium-crosswalk,rogerwang/chromium,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,Chilledheart/chromium,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,hujiajie/pa-chromium,keishi/chromium,Just-D/chromium-1,nacl-webkit/chrome_deps,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,keishi/chromium,fujunwei/chromium-crosswalk,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,timopulkkinen/BubbleFish,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,jaruba/chromium.src,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,Fireblend/chromium-crosswalk,anirudhSK/chromium,Jonekee/chromium.src,zcbenz/cefode-chromium,zcbenz/cefode-chromium,hujiajie/pa-chromium,ltilve/chromium,timopulkkinen/BubbleFish,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,ondra-novak/chromium.src,dednal/chromium.src,ondra-novak/chromium.src,ChromiumWebApps/chromium,dednal/chromium.src,anirudhSK/chromium,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,keishi/chromium,zcbenz/cefode-chromium,mogoweb/chromium-crosswalk,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,dushu1203/chromium.src,robclark/chromium,axinging/chromium-crosswalk,keishi/chromium,dednal/chromium.src,ltilve/chromium,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,anirudhSK/chromium,robclark/chromium,chuan9/chromium-crosswalk,keishi/chromium,Chilledheart/chromium,patrickm/chromium.src,junmin-zhu/chromium-rivertrail,pozdnyakov/chromium-crosswalk,Fireblend/chromium-crosswalk,dushu1203/chromium.src,keishi/chromium,timopulkkinen/BubbleFish,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,ltilve/chromium,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,krieger-od/nwjs_chromium.src,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,patrickm/chromium.src,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,littlstar/chromium.src,TheTypoMaster/chromium-crosswalk,patrickm/chromium.src,TheTypoMaster/chromium-crosswalk,nacl-webkit/chrome_deps,Just-D/chromium-1,ltilve/chromium,rogerwang/chromium,ondra-novak/chromium.src,ChromiumWebApps/chromium,jaruba/chromium.src,hgl888/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,dushu1203/chromium.src,ltilve/chromium,dushu1203/chromium.src,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,markYoungH/chromium.src,fujunwei/chromium-crosswalk,markYoungH/chromium.src,dednal/chromium.src,Chilledheart/chromium,timopulkkinen/BubbleFish,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,pozdnyakov/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,rogerwang/chromium,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,Just-D/chromium-1,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,patrickm/chromium.src,mohamed--abdel-maksoud/chromium.src,keishi/chromium,zcbenz/cefode-chromium,crosswalk-project/chromium-crosswalk-efl,anirudhSK/chromium,hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,ChromiumWebApps/chromium,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,Pluto-tv/chromium-crosswalk,timopulkkinen/BubbleFish,Pluto-tv/chromium-crosswalk,keishi/chromium,crosswalk-project/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,zcbenz/cefode-chromium,littlstar/chromium.src,ChromiumWebApps/chromium,littlstar/chromium.src,zcbenz/cefode-chromium,rogerwang/chromium,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,littlstar/chromium.src,nacl-webkit/chrome_deps,crosswalk-project/chromium-crosswalk-efl,hgl888/chromium-crosswalk,Fireblend/chromium-crosswalk,Chilledheart/chromium,M4sse/chromium.src,fujunwei/chromium-crosswalk,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,Chilledheart/chromium,littlstar/chromium.src,mogoweb/chromium-crosswalk,hujiajie/pa-chromium,mohamed--abdel-maksoud/chromium.src,M4sse/chromium.src,ChromiumWebApps/chromium,pozdnyakov/chromium-crosswalk,zcbenz/cefode-chromium,keishi/chromium,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,robclark/chromium,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,krieger-od/nwjs_chromium.src,mogoweb/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,robclark/chromium,anirudhSK/chromium,littlstar/chromium.src,dushu1203/chromium.src,mogoweb/chromium-crosswalk,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,pozdnyakov/chromium-crosswalk,keishi/chromium,ondra-novak/chromium.src,anirudhSK/chromium,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,ChromiumWebApps/chromium,jaruba/chromium.src,littlstar/chromium.src,robclark/chromium,dednal/chromium.src,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,ltilve/chromium,rogerwang/chromium,dednal/chromium.src,axinging/chromium-crosswalk,Chilledheart/chromium,rogerwang/chromium,junmin-zhu/chromium-rivertrail,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,ondra-novak/chromium.src,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,Jonekee/chromium.src,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,dushu1203/chromium.src,rogerwang/chromium,Jonekee/chromium.src,littlstar/chromium.src,junmin-zhu/chromium-rivertrail,rogerwang/chromium,nacl-webkit/chrome_deps,dushu1203/chromium.src,timopulkkinen/BubbleFish,Just-D/chromium-1,dednal/chromium.src,anirudhSK/chromium,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,markYoungH/chromium.src,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,robclark/chromium,fujunwei/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,robclark/chromium,markYoungH/chromium.src,junmin-zhu/chromium-rivertrail,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,jaruba/chromium.src,axinging/chromium-crosswalk,ChromiumWebApps/chromium,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,anirudhSK/chromium,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk
c++
## Code Before: // Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/system_monitor.h" namespace base { void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) { PowerEvent power_event; switch (event_id) { case PBT_APMPOWERSTATUSCHANGE: power_event = POWER_STATE_EVENT; break; case PBT_APMRESUMEAUTOMATIC: power_event = RESUME_EVENT; break; case PBT_APMSUSPEND: power_event = SUSPEND_EVENT; break; default: DCHECK(false); } ProcessPowerMessage(power_event); } // Function to query the system to see if it is currently running on // battery power. Returns true if running on battery. bool SystemMonitor::IsBatteryPower() { SYSTEM_POWER_STATUS status; if (!GetSystemPowerStatus(&status)) { LOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError(); return false; } return (status.ACLineStatus == 0); } } // namespace base ## Instruction: Update comments and remove bogus DCHECK in windows-specific broadcasted power message status. Review URL: http://codereview.chromium.org/16220 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@7398 0039d316-1c4b-4281-b951-d872f2087c98 ## Code After: // Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/system_monitor.h" namespace base { void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) { PowerEvent power_event; switch (event_id) { case PBT_APMPOWERSTATUSCHANGE: // The power status changed. power_event = POWER_STATE_EVENT; break; case PBT_APMRESUMEAUTOMATIC: // Non-user initiated resume from suspend. case PBT_APMRESUMESUSPEND: // User initiated resume from suspend. power_event = RESUME_EVENT; break; case PBT_APMSUSPEND: // System has been suspended. power_event = SUSPEND_EVENT; break; default: return; // Other Power Events: // PBT_APMBATTERYLOW - removed in Vista. // PBT_APMOEMEVENT - removed in Vista. // PBT_APMQUERYSUSPEND - removed in Vista. // PBT_APMQUERYSUSPENDFAILED - removed in Vista. // PBT_APMRESUMECRITICAL - removed in Vista. // PBT_POWERSETTINGCHANGE - user changed the power settings. } ProcessPowerMessage(power_event); } // Function to query the system to see if it is currently running on // battery power. Returns true if running on battery. bool SystemMonitor::IsBatteryPower() { SYSTEM_POWER_STATUS status; if (!GetSystemPowerStatus(&status)) { LOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError(); return false; } return (status.ACLineStatus == 0); } } // namespace base
// Copyright (c) 2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/system_monitor.h" namespace base { void SystemMonitor::ProcessWmPowerBroadcastMessage(int event_id) { PowerEvent power_event; switch (event_id) { - case PBT_APMPOWERSTATUSCHANGE: + case PBT_APMPOWERSTATUSCHANGE: // The power status changed. power_event = POWER_STATE_EVENT; break; - case PBT_APMRESUMEAUTOMATIC: + case PBT_APMRESUMEAUTOMATIC: // Non-user initiated resume from suspend. + case PBT_APMRESUMESUSPEND: // User initiated resume from suspend. power_event = RESUME_EVENT; break; - case PBT_APMSUSPEND: + case PBT_APMSUSPEND: // System has been suspended. power_event = SUSPEND_EVENT; break; default: - DCHECK(false); + return; + + // Other Power Events: + // PBT_APMBATTERYLOW - removed in Vista. + // PBT_APMOEMEVENT - removed in Vista. + // PBT_APMQUERYSUSPEND - removed in Vista. + // PBT_APMQUERYSUSPENDFAILED - removed in Vista. + // PBT_APMRESUMECRITICAL - removed in Vista. + // PBT_POWERSETTINGCHANGE - user changed the power settings. } ProcessPowerMessage(power_event); } // Function to query the system to see if it is currently running on // battery power. Returns true if running on battery. bool SystemMonitor::IsBatteryPower() { SYSTEM_POWER_STATUS status; if (!GetSystemPowerStatus(&status)) { LOG(ERROR) << "GetSystemPowerStatus failed: " << GetLastError(); return false; } return (status.ACLineStatus == 0); } } // namespace base
17
0.425
13
4
d8e20990d0cdd067e82b0790fad658f085de12aa
wc-cyclone.php
wc-cyclone.php
<?php /** * Plugin Name: WC Cyclone * Plugin URI: https://metorik.com * Description: Generate fake data for a WooCommerce store. * Version: 0.1 * Author Name: Bryce Adams | Metorik * Author URI: https://bryce.se */ add_action( 'plugins_loaded', function() { // Check `composer install` has been ran if ( file_exists( 'vendor' ) ) { // Composer dependencies require_once( 'vendor/autoload.php' ); // Resources require_once( 'inc/helpers.php' ); require_once( 'inc/generate.php' ); // WP CLI commands if ( defined('WP_CLI') && WP_CLI ) { require_once( 'inc/commands.php'); } } } );
<?php /** * Plugin Name: WC Cyclone * Plugin URI: https://metorik.com * Description: Generate fake data for a WooCommerce store. * Version: 0.1 * Author Name: Bryce Adams | Metorik * Author URI: https://bryce.se */ add_action( 'plugins_loaded', function() { // Check `composer install` has been ran if ( file_exists( dirname( __FILE__ ) . '/vendor' ) ) { // Composer dependencies require_once( 'vendor/autoload.php' ); // Resources require_once( 'inc/helpers.php' ); require_once( 'inc/generate.php' ); // WP CLI commands if ( defined('WP_CLI') && WP_CLI ) { require_once( 'inc/commands.php'); } } } );
Fix check for composer files
Fix check for composer files
PHP
mit
metorikhq/wc-cyclone
php
## Code Before: <?php /** * Plugin Name: WC Cyclone * Plugin URI: https://metorik.com * Description: Generate fake data for a WooCommerce store. * Version: 0.1 * Author Name: Bryce Adams | Metorik * Author URI: https://bryce.se */ add_action( 'plugins_loaded', function() { // Check `composer install` has been ran if ( file_exists( 'vendor' ) ) { // Composer dependencies require_once( 'vendor/autoload.php' ); // Resources require_once( 'inc/helpers.php' ); require_once( 'inc/generate.php' ); // WP CLI commands if ( defined('WP_CLI') && WP_CLI ) { require_once( 'inc/commands.php'); } } } ); ## Instruction: Fix check for composer files ## Code After: <?php /** * Plugin Name: WC Cyclone * Plugin URI: https://metorik.com * Description: Generate fake data for a WooCommerce store. * Version: 0.1 * Author Name: Bryce Adams | Metorik * Author URI: https://bryce.se */ add_action( 'plugins_loaded', function() { // Check `composer install` has been ran if ( file_exists( dirname( __FILE__ ) . '/vendor' ) ) { // Composer dependencies require_once( 'vendor/autoload.php' ); // Resources require_once( 'inc/helpers.php' ); require_once( 'inc/generate.php' ); // WP CLI commands if ( defined('WP_CLI') && WP_CLI ) { require_once( 'inc/commands.php'); } } } );
<?php /** * Plugin Name: WC Cyclone * Plugin URI: https://metorik.com * Description: Generate fake data for a WooCommerce store. * Version: 0.1 * Author Name: Bryce Adams | Metorik * Author URI: https://bryce.se */ add_action( 'plugins_loaded', function() { // Check `composer install` has been ran - if ( file_exists( 'vendor' ) ) { + if ( file_exists( dirname( __FILE__ ) . '/vendor' ) ) { // Composer dependencies require_once( 'vendor/autoload.php' ); // Resources require_once( 'inc/helpers.php' ); require_once( 'inc/generate.php' ); // WP CLI commands if ( defined('WP_CLI') && WP_CLI ) { require_once( 'inc/commands.php'); } } } );
2
0.076923
1
1
0d4bb6f417b1c263c025f2a47b51a17e4c59611b
src/Resources/skeleton/module/form-routing.yml.twig
src/Resources/skeleton/module/form-routing.yml.twig
{% if class_name is defined %} {{ module_name }}.{{form_id}}: path: '/{{ module_name }}/settings/{{ class_name }}' defaults: _form: '\Drupal\{{ module_name }}\Form\{{ class_name }}' _title: '{{ module_name }} Form' requirements: _permission: 'access administration pages' {% endif %}
{% if class_name is defined %} {{ module_name }}.{{form_id}}: path: '/{{ module_name }}/settings/{{ class_name }}' defaults: _form: '\Drupal\{{ module_name }}\Form\{{ class_name }}' _title: '{{ module_name }} {{ class_name }} Form' requirements: _permission: 'access administration pages' {% endif %}
Update title add class_name value
Update title add class_name value
Twig
mit
reszli/DrupalConsole,dkgndec/DrupalConsole,karmazzin/DrupalConsole,longloop/DrupalConsole,alxvallejo/DrupalConsole,longloop/DrupalConsole,reszli/DrupalConsole,Cottser/DrupalConsole,Cottser/DrupalConsole,frega/DrupalConsole,karmazzin/DrupalConsole,reszli/DrupalConsole,dkgndec/DrupalConsole,revagomes/DrupalConsole,Cottser/DrupalConsole,frega/DrupalConsole,karmazzin/DrupalConsole,AniRai/DrupalConsole,dkgndec/DrupalConsole,alxvallejo/DrupalConsole,AniRai/DrupalConsole,revagomes/DrupalConsole,frega/DrupalConsole,AniRai/DrupalConsole,longloop/DrupalConsole,alxvallejo/DrupalConsole,revagomes/DrupalConsole
twig
## Code Before: {% if class_name is defined %} {{ module_name }}.{{form_id}}: path: '/{{ module_name }}/settings/{{ class_name }}' defaults: _form: '\Drupal\{{ module_name }}\Form\{{ class_name }}' _title: '{{ module_name }} Form' requirements: _permission: 'access administration pages' {% endif %} ## Instruction: Update title add class_name value ## Code After: {% if class_name is defined %} {{ module_name }}.{{form_id}}: path: '/{{ module_name }}/settings/{{ class_name }}' defaults: _form: '\Drupal\{{ module_name }}\Form\{{ class_name }}' _title: '{{ module_name }} {{ class_name }} Form' requirements: _permission: 'access administration pages' {% endif %}
{% if class_name is defined %} {{ module_name }}.{{form_id}}: path: '/{{ module_name }}/settings/{{ class_name }}' defaults: _form: '\Drupal\{{ module_name }}\Form\{{ class_name }}' - _title: '{{ module_name }} Form' + _title: '{{ module_name }} {{ class_name }} Form' ? +++++++++++++++++ requirements: _permission: 'access administration pages' {% endif %}
2
0.222222
1
1
cf673aff368adf27d7751313e798fc1d1058bd6d
Sources/Protocols/CellIdentifiable.swift
Sources/Protocols/CellIdentifiable.swift
// // CellIdentifiable.swift // ZamzamKit // // Created by Basem Emara on 4/28/17. // Copyright © 2017 Zamzam. All rights reserved. // import UIKit public protocol CellIdentifiable { associatedtype CellIdentifier: RawRepresentable } public extension CellIdentifiable where Self: UITableViewController, CellIdentifier.RawValue == String { /** Gets the visible cell with the specified identifier name. - parameter identifier: Enum value of the cell identifier. - returns: Returns the table view cell. */ func tableViewCell(at identifier: CellIdentifier) -> UITableViewCell? { return tableView.visibleCells.first { $0.reuseIdentifier == identifier.rawValue } } }
// // CellIdentifiable.swift // ZamzamKit // // Created by Basem Emara on 4/28/17. // Copyright © 2017 Zamzam. All rights reserved. // import UIKit public protocol CellIdentifiable { associatedtype CellIdentifier: RawRepresentable } public extension CellIdentifiable where Self: UITableViewController, CellIdentifier.RawValue == String { /** Gets the visible cell with the specified identifier name. - parameter identifier: Enum value of the cell identifier. - returns: Returns the table view cell. */ func tableViewCell(at identifier: CellIdentifier) -> UITableViewCell? { return tableView.visibleCells.first { $0.reuseIdentifier == identifier.rawValue } } } public extension RawRepresentable where Self.RawValue == String { init?(from cell: UITableViewCell) { guard let identifier = cell.reuseIdentifier else { return nil } self.init(rawValue: identifier) } }
Extend CellIdentifier to extract from table view cell
Extend CellIdentifier to extract from table view cell
Swift
mit
ZamzamInc/ZamzamKit
swift
## Code Before: // // CellIdentifiable.swift // ZamzamKit // // Created by Basem Emara on 4/28/17. // Copyright © 2017 Zamzam. All rights reserved. // import UIKit public protocol CellIdentifiable { associatedtype CellIdentifier: RawRepresentable } public extension CellIdentifiable where Self: UITableViewController, CellIdentifier.RawValue == String { /** Gets the visible cell with the specified identifier name. - parameter identifier: Enum value of the cell identifier. - returns: Returns the table view cell. */ func tableViewCell(at identifier: CellIdentifier) -> UITableViewCell? { return tableView.visibleCells.first { $0.reuseIdentifier == identifier.rawValue } } } ## Instruction: Extend CellIdentifier to extract from table view cell ## Code After: // // CellIdentifiable.swift // ZamzamKit // // Created by Basem Emara on 4/28/17. // Copyright © 2017 Zamzam. All rights reserved. // import UIKit public protocol CellIdentifiable { associatedtype CellIdentifier: RawRepresentable } public extension CellIdentifiable where Self: UITableViewController, CellIdentifier.RawValue == String { /** Gets the visible cell with the specified identifier name. - parameter identifier: Enum value of the cell identifier. - returns: Returns the table view cell. */ func tableViewCell(at identifier: CellIdentifier) -> UITableViewCell? { return tableView.visibleCells.first { $0.reuseIdentifier == identifier.rawValue } } } public extension RawRepresentable where Self.RawValue == String { init?(from cell: UITableViewCell) { guard let identifier = cell.reuseIdentifier else { return nil } self.init(rawValue: identifier) } }
// // CellIdentifiable.swift // ZamzamKit // // Created by Basem Emara on 4/28/17. // Copyright © 2017 Zamzam. All rights reserved. // import UIKit public protocol CellIdentifiable { associatedtype CellIdentifier: RawRepresentable } public extension CellIdentifiable where Self: UITableViewController, CellIdentifier.RawValue == String { /** Gets the visible cell with the specified identifier name. - parameter identifier: Enum value of the cell identifier. - returns: Returns the table view cell. */ func tableViewCell(at identifier: CellIdentifier) -> UITableViewCell? { return tableView.visibleCells.first { $0.reuseIdentifier == identifier.rawValue } } } + + public extension RawRepresentable where Self.RawValue == String { + + init?(from cell: UITableViewCell) { + guard let identifier = cell.reuseIdentifier else { return nil } + self.init(rawValue: identifier) + } + }
8
0.296296
8
0
a123f709e8a807fda0feb6bba18a7db5e282f12d
test/index.js
test/index.js
const koa = require("koa"), expect = require("expect"), uncapitalize = require("../"), app = koa(); app.use(uncapitalize); app.use(function* (next) { if (this.path.toLowerCase() != "/test") { return yield next; } this.body = "OK"; }); const request = require("supertest").agent(app.listen()); describe("koa uncapitalize", function () { describe("lowercase routes", function () { it("should not redirect", function (done) { request.get("/test").expect(200, done); }); }); describe("uppercase routes", function () { it("should redirect", function (done) { request.get("/TEST").expect(301, done); }); }); });
const agent = require("supertest-koa-agent"), expect = require("chai").expect, Koa = require("koa"), uncapitalize = require("../"); var app = null; var subject = null; beforeEach(() => { app = new Koa(); app.use(uncapitalize); app.use(function* (next) { if (this.path.toLowerCase() != "/test") { return yield next; } this.body = "OK"; }); subject = agent(app); }); describe("koa uncapitalize", () => { describe("lowercase routes", () => { it("should not redirect", (done) => { subject.get("/test").expect(200, done); }); }); describe("uppercase routes", () => { it("should redirect", (done) => { subject.get("/TEST").expect(301, done); }); }); });
Update tests for new versions
Update tests for new versions
JavaScript
mit
mfinelli/koa-uncapitalize
javascript
## Code Before: const koa = require("koa"), expect = require("expect"), uncapitalize = require("../"), app = koa(); app.use(uncapitalize); app.use(function* (next) { if (this.path.toLowerCase() != "/test") { return yield next; } this.body = "OK"; }); const request = require("supertest").agent(app.listen()); describe("koa uncapitalize", function () { describe("lowercase routes", function () { it("should not redirect", function (done) { request.get("/test").expect(200, done); }); }); describe("uppercase routes", function () { it("should redirect", function (done) { request.get("/TEST").expect(301, done); }); }); }); ## Instruction: Update tests for new versions ## Code After: const agent = require("supertest-koa-agent"), expect = require("chai").expect, Koa = require("koa"), uncapitalize = require("../"); var app = null; var subject = null; beforeEach(() => { app = new Koa(); app.use(uncapitalize); app.use(function* (next) { if (this.path.toLowerCase() != "/test") { return yield next; } this.body = "OK"; }); subject = agent(app); }); describe("koa uncapitalize", () => { describe("lowercase routes", () => { it("should not redirect", (done) => { subject.get("/test").expect(200, done); }); }); describe("uppercase routes", () => { it("should redirect", (done) => { subject.get("/TEST").expect(301, done); }); }); });
- const koa = require("koa"), + const agent = require("supertest-koa-agent"), - expect = require("expect"), ? -- + expect = require("chai").expect, ? +++++++ + Koa = require("koa"), - uncapitalize = require("../"), ? ^ + uncapitalize = require("../"); ? ^ - app = koa(); + var app = null; + var subject = null; - app.use(uncapitalize); - app.use(function* (next) { - if (this.path.toLowerCase() != "/test") { - return yield next; - } + beforeEach(() => { + app = new Koa(); + + app.use(uncapitalize); + app.use(function* (next) { + if (this.path.toLowerCase() != "/test") { + return yield next; + } + - this.body = "OK"; + this.body = "OK"; ? ++ + }); + + subject = agent(app); }); - const request = require("supertest").agent(app.listen()); - - describe("koa uncapitalize", function () { ? --------- + describe("koa uncapitalize", () => { ? +++ - describe("lowercase routes", function () { ? --------- + describe("lowercase routes", () => { ? +++ - it("should not redirect", function (done) { ? --------- + it("should not redirect", (done) => { ? +++ - request.get("/test").expect(200, done); ? ^ ^^^^ + subject.get("/test").expect(200, done); ? ^^^^ ^ }); }); - describe("uppercase routes", function () { ? --------- + describe("uppercase routes", () => { ? +++ - it("should redirect", function (done) { ? --------- + it("should redirect", (done) => { ? +++ - request.get("/TEST").expect(301, done); ? ^ ^^^^ + subject.get("/TEST").expect(301, done); ? ^^^^ ^ }); }); });
45
1.551724
26
19
a39fd577ba4b49885baa37f4b9a6ac078174f20d
lib/csv/defaults.ex
lib/csv/defaults.ex
defmodule CSV.Defaults do @moduledoc ~S""" The module defaults of CSV. """ defmacro __using__(_) do quote do @separator ?, @newline_character ?\n @newline <<@newline_character::utf8>> @carriage_return_character ?\r @carriage_return <<@carriage_return_character::utf8>> @escape_character ?" @escape <<@escape_character::utf8>> @escape_max_lines 10 @replacement nil @force_escaping false @strip_fields false @escape_formulas false @unescape_formulas false @escape_formula_start ["=", "-", "+", "@"] end end end
defmodule CSV.Defaults do @moduledoc ~S""" The module defaults of CSV. """ defmacro __using__(_) do quote do @separator ?, @newline_character ?\n @newline <<@newline_character::utf8>> @carriage_return_character ?\r @carriage_return <<@carriage_return_character::utf8>> @escape_character ?" @escape <<@escape_character::utf8>> @escape_max_lines 10 @replacement nil @force_escaping false @escape_formulas false @unescape_formulas false @escape_formula_start ["=", "-", "+", "@"] end end end
Remove leftover default for :`strip_fields`
Remove leftover default for :`strip_fields`
Elixir
mit
beatrichartz/csv,beatrichartz/csv
elixir
## Code Before: defmodule CSV.Defaults do @moduledoc ~S""" The module defaults of CSV. """ defmacro __using__(_) do quote do @separator ?, @newline_character ?\n @newline <<@newline_character::utf8>> @carriage_return_character ?\r @carriage_return <<@carriage_return_character::utf8>> @escape_character ?" @escape <<@escape_character::utf8>> @escape_max_lines 10 @replacement nil @force_escaping false @strip_fields false @escape_formulas false @unescape_formulas false @escape_formula_start ["=", "-", "+", "@"] end end end ## Instruction: Remove leftover default for :`strip_fields` ## Code After: defmodule CSV.Defaults do @moduledoc ~S""" The module defaults of CSV. """ defmacro __using__(_) do quote do @separator ?, @newline_character ?\n @newline <<@newline_character::utf8>> @carriage_return_character ?\r @carriage_return <<@carriage_return_character::utf8>> @escape_character ?" @escape <<@escape_character::utf8>> @escape_max_lines 10 @replacement nil @force_escaping false @escape_formulas false @unescape_formulas false @escape_formula_start ["=", "-", "+", "@"] end end end
defmodule CSV.Defaults do @moduledoc ~S""" The module defaults of CSV. """ defmacro __using__(_) do quote do @separator ?, @newline_character ?\n @newline <<@newline_character::utf8>> @carriage_return_character ?\r @carriage_return <<@carriage_return_character::utf8>> @escape_character ?" @escape <<@escape_character::utf8>> @escape_max_lines 10 @replacement nil @force_escaping false - @strip_fields false @escape_formulas false @unescape_formulas false @escape_formula_start ["=", "-", "+", "@"] end end end
1
0.041667
0
1
5394cca920c4d6cf8ef140f21992419081c37e6e
.travis.yml
.travis.yml
language: cpp compiler: - gcc - clang before_install: - sudo add-apt-repository -y ppa:kalakris/cmake - sudo apt-get update -qq install: # See issue travis-ci/travis-ci#1379 - 'if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; export CXX="g++-4.8" CC="gcc-4.8"; else export CC=clang CXX=clang++; fi' # CMake - sudo apt-get install -qq cmake # Google Protobuf - sudo apt-get install -qq protobuf-compiler libprotobuf-dev # GLFW - git clone https://github.com/glfw/glfw.git - sudo apt-get install -qq xorg-dev libgl1-mesa-dev libglu1-mesa-dev - cd glfw && git checkout 3.1 && cmake . && make && sudo make install && cd .. script: - mkdir build && cd build && cmake .. -G "Unix Makefiles" && make -j8
language: cpp compiler: - gcc - clang before_install: - sudo add-apt-repository -y ppa:kalakris/cmake - sudo apt-get update -qq install: # See issue travis-ci/travis-ci#1379 - 'if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; export CXX="g++-4.8" CC="gcc-4.8"; else export CC=clang CXX=clang++; fi' # CMake - sudo apt-get install -qq cmake # Google Protobuf - sudo apt-get install -qq protobuf-compiler libprotobuf-dev # GLFW - sudo apt-get install -qq xorg-dev libgl1-mesa-dev libglu1-mesa-dev - wget https://github.com/glfw/glfw/archive/3.1.tar.gz - tar xzf 3.1.tar.gz - cd glfw-3.1 && cmake . && make && sudo make install && cd .. # Bullet - wget https://bullet.googlecode.com/files/bullet-2.82-r2704.tgz - tar xzf bullet-2.82-r2704.tgz - cd bullet-2.82-r2704 && mkdir build && cd build && cmake .. && make -j8 && sudo make install script: - mkdir build && cd build && cmake .. -G "Unix Makefiles" && make -j8
Fix build script again 2.
Fix build script again 2.
YAML
mpl-2.0
roboime/ssl-sim,gustavokcouto/ssl-sim,roboime/ssl-sim,roboime/ssl-sim,gustavokcouto/ssl-sim,gustavokcouto/ssl-sim
yaml
## Code Before: language: cpp compiler: - gcc - clang before_install: - sudo add-apt-repository -y ppa:kalakris/cmake - sudo apt-get update -qq install: # See issue travis-ci/travis-ci#1379 - 'if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; export CXX="g++-4.8" CC="gcc-4.8"; else export CC=clang CXX=clang++; fi' # CMake - sudo apt-get install -qq cmake # Google Protobuf - sudo apt-get install -qq protobuf-compiler libprotobuf-dev # GLFW - git clone https://github.com/glfw/glfw.git - sudo apt-get install -qq xorg-dev libgl1-mesa-dev libglu1-mesa-dev - cd glfw && git checkout 3.1 && cmake . && make && sudo make install && cd .. script: - mkdir build && cd build && cmake .. -G "Unix Makefiles" && make -j8 ## Instruction: Fix build script again 2. ## Code After: language: cpp compiler: - gcc - clang before_install: - sudo add-apt-repository -y ppa:kalakris/cmake - sudo apt-get update -qq install: # See issue travis-ci/travis-ci#1379 - 'if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; export CXX="g++-4.8" CC="gcc-4.8"; else export CC=clang CXX=clang++; fi' # CMake - sudo apt-get install -qq cmake # Google Protobuf - sudo apt-get install -qq protobuf-compiler libprotobuf-dev # GLFW - sudo apt-get install -qq xorg-dev libgl1-mesa-dev libglu1-mesa-dev - wget https://github.com/glfw/glfw/archive/3.1.tar.gz - tar xzf 3.1.tar.gz - cd glfw-3.1 && cmake . && make && sudo make install && cd .. # Bullet - wget https://bullet.googlecode.com/files/bullet-2.82-r2704.tgz - tar xzf bullet-2.82-r2704.tgz - cd bullet-2.82-r2704 && mkdir build && cd build && cmake .. && make -j8 && sudo make install script: - mkdir build && cd build && cmake .. -G "Unix Makefiles" && make -j8
language: cpp compiler: - gcc - clang before_install: - sudo add-apt-repository -y ppa:kalakris/cmake - sudo apt-get update -qq install: # See issue travis-ci/travis-ci#1379 - 'if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; export CXX="g++-4.8" CC="gcc-4.8"; else export CC=clang CXX=clang++; fi' # CMake - sudo apt-get install -qq cmake # Google Protobuf - sudo apt-get install -qq protobuf-compiler libprotobuf-dev # GLFW - - git clone https://github.com/glfw/glfw.git - sudo apt-get install -qq xorg-dev libgl1-mesa-dev libglu1-mesa-dev + - wget https://github.com/glfw/glfw/archive/3.1.tar.gz + - tar xzf 3.1.tar.gz - - cd glfw && git checkout 3.1 && cmake . && make && sudo make install && cd .. ? ^^^^^^^^^^^^^^^^^ + - cd glfw-3.1 && cmake . && make && sudo make install && cd .. ? ^ + # Bullet + - wget https://bullet.googlecode.com/files/bullet-2.82-r2704.tgz + - tar xzf bullet-2.82-r2704.tgz + - cd bullet-2.82-r2704 && mkdir build && cd build && cmake .. && make -j8 && sudo make install script: - mkdir build && cd build && cmake .. -G "Unix Makefiles" && make -j8
9
0.45
7
2
e170f64f25a49834179da8f44938d24faf748156
app/models/user.rb
app/models/user.rb
class User < ActiveRecord::Base has_many :tweets has_many :users has_many :friends_as_followers, class_name: "Friend", foreign_key: :follower_id has_many :friends_as_followees, class_name: "Friend", foreign_key: :followee_id has_many :followers, through: :friends_as_followers has_many :followees, through: :friends_as_followees validates :name, presence: true validates :email, presence: true validates :password, presence: true include BCrypt def password @password ||= Password.new(password_hash) end def password=(new_password) @password = Password.create(new_password) self.password_hash = @password end end
class User < ActiveRecord::Base has_many :tweets has_many :users has_many :friends_as_followers, class_name: "Friend", foreign_key: :follower_id has_many :friends_as_followees, class_name: "Friend", foreign_key: :followee_id has_many :followers, through: :friends_as_followers has_many :followees, through: :friends_as_followees validates :name, presence: true validates :email, presence: true validates :password, presence: true include BCrypt def password @password ||= Password.new(password_hash) end def password=(new_password) @password = Password.create(new_password) self.password_hash = @password end def self.authenticate(username, password) user = User.find_by(name: username) if user && user.password == password user else nil end end end
Add authentication method to User model.
Add authentication method to User model.
Ruby
mit
ckwong93/tweetSqrd,ckwong93/tweetSqrd,ckwong93/tweetSqrd
ruby
## Code Before: class User < ActiveRecord::Base has_many :tweets has_many :users has_many :friends_as_followers, class_name: "Friend", foreign_key: :follower_id has_many :friends_as_followees, class_name: "Friend", foreign_key: :followee_id has_many :followers, through: :friends_as_followers has_many :followees, through: :friends_as_followees validates :name, presence: true validates :email, presence: true validates :password, presence: true include BCrypt def password @password ||= Password.new(password_hash) end def password=(new_password) @password = Password.create(new_password) self.password_hash = @password end end ## Instruction: Add authentication method to User model. ## Code After: class User < ActiveRecord::Base has_many :tweets has_many :users has_many :friends_as_followers, class_name: "Friend", foreign_key: :follower_id has_many :friends_as_followees, class_name: "Friend", foreign_key: :followee_id has_many :followers, through: :friends_as_followers has_many :followees, through: :friends_as_followees validates :name, presence: true validates :email, presence: true validates :password, presence: true include BCrypt def password @password ||= Password.new(password_hash) end def password=(new_password) @password = Password.create(new_password) self.password_hash = @password end def self.authenticate(username, password) user = User.find_by(name: username) if user && user.password == password user else nil end end end
class User < ActiveRecord::Base has_many :tweets has_many :users has_many :friends_as_followers, class_name: "Friend", foreign_key: :follower_id has_many :friends_as_followees, class_name: "Friend", foreign_key: :followee_id has_many :followers, through: :friends_as_followers has_many :followees, through: :friends_as_followees validates :name, presence: true validates :email, presence: true validates :password, presence: true - + include BCrypt def password @password ||= Password.new(password_hash) end def password=(new_password) @password = Password.create(new_password) self.password_hash = @password end + + def self.authenticate(username, password) + user = User.find_by(name: username) + if user && user.password == password + user + else + nil + end + end + end
12
0.5
11
1
813d363a5e095e356f7e94d76f2b665cbebff5a9
README.md
README.md
[Nextpeer](http://nextpeer.com) is the easiest way to play with your friends on mobile devices. Get the SDK and start challenging the world. Get started by going to our [guide](https://developers.nextpeer.com/docs/view/cocos2dx) Be sure to checkout our [sample code](https://github.com/Nextpeer/Nextpeer-Cocos2dx-Sample) Check the branch tree for Cocos2d-x 3.0 support.
[Nextpeer](http://nextpeer.com) is the easiest way to play with your friends on mobile devices. Get the SDK and start challenging the world. Get started by going to our [guide](https://nextpeer.atlassian.net/wiki/display/NS/Cocos2d-x) Be sure to checkout our [sample code](https://github.com/Nextpeer/Nextpeer-Cocos2dx-Sample) Check the branch tree for Cocos2d-x 3.0 support.
Update guide link in readme
Update guide link in readme
Markdown
mit
Nextpeer/Nextpeer-Cocos2dx,Nextpeer/Nextpeer-Cocos2dx,Nextpeer/Nextpeer-Cocos2dx,Nextpeer/Nextpeer-Cocos2dx
markdown
## Code Before: [Nextpeer](http://nextpeer.com) is the easiest way to play with your friends on mobile devices. Get the SDK and start challenging the world. Get started by going to our [guide](https://developers.nextpeer.com/docs/view/cocos2dx) Be sure to checkout our [sample code](https://github.com/Nextpeer/Nextpeer-Cocos2dx-Sample) Check the branch tree for Cocos2d-x 3.0 support. ## Instruction: Update guide link in readme ## Code After: [Nextpeer](http://nextpeer.com) is the easiest way to play with your friends on mobile devices. Get the SDK and start challenging the world. Get started by going to our [guide](https://nextpeer.atlassian.net/wiki/display/NS/Cocos2d-x) Be sure to checkout our [sample code](https://github.com/Nextpeer/Nextpeer-Cocos2dx-Sample) Check the branch tree for Cocos2d-x 3.0 support.
[Nextpeer](http://nextpeer.com) is the easiest way to play with your friends on mobile devices. Get the SDK and start challenging the world. - Get started by going to our [guide](https://developers.nextpeer.com/docs/view/cocos2dx) + Get started by going to our [guide](https://nextpeer.atlassian.net/wiki/display/NS/Cocos2d-x) Be sure to checkout our [sample code](https://github.com/Nextpeer/Nextpeer-Cocos2dx-Sample) Check the branch tree for Cocos2d-x 3.0 support.
2
0.25
1
1
a42bbcc6023d8b5822e0eeaf5f56f223a2a1bf45
moksha/templates/footer.mak
moksha/templates/footer.mak
<%def name="footer()"> <div id="footer"> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <center><img src="/images/moksha-logo.png"/></center> </div> </%def>
<%def name="footer()"> <div id="footer"> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <center><img src="/images/moksha-logo.png"/></center> </div> </%def>
Raise the moksha logo a little
Raise the moksha logo a little
Makefile
apache-2.0
pombredanne/moksha,lmacken/moksha,mokshaproject/moksha,ralphbean/moksha,lmacken/moksha,pombredanne/moksha,mokshaproject/moksha,pombredanne/moksha,mokshaproject/moksha,ralphbean/moksha,ralphbean/moksha,pombredanne/moksha,lmacken/moksha,mokshaproject/moksha
makefile
## Code Before: <%def name="footer()"> <div id="footer"> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <center><img src="/images/moksha-logo.png"/></center> </div> </%def> ## Instruction: Raise the moksha logo a little ## Code After: <%def name="footer()"> <div id="footer"> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <center><img src="/images/moksha-logo.png"/></center> </div> </%def>
<%def name="footer()"> <div id="footer"> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> - <br/> <br/> <br/> <br/> + <br/> <br/> <center><img src="/images/moksha-logo.png"/></center> </div> </%def>
2
0.25
1
1
cfa073fd9d3b6b385631b10ceb7d67677f385676
project/Versions.scala
project/Versions.scala
package org.scalameta package build object Versions { val LatestScala210 = "2.10.7" val LatestScala211 = "2.11.12" val LatestScala212 = "2.12.8" val LatestScala213 = "2.13.0-RC1" val LegacyScalaVersions = List( "2.12.7" ) }
package org.scalameta package build object Versions { val LatestScala210 = "2.10.7" val LatestScala211 = "2.11.12" val LatestScala212 = "2.12.8" val LatestScala213 = "2.13.0-RC1" val LegacyScalaVersions = List[String]() }
Remove 2.12.7 from the build.
Remove 2.12.7 from the build. Let's see if this reduces release times so we don't timeout on Travis.
Scala
bsd-3-clause
scalameta/scalameta,scalameta/scalameta,scalameta/scalameta,scalameta/scalameta,scalameta/scalameta
scala
## Code Before: package org.scalameta package build object Versions { val LatestScala210 = "2.10.7" val LatestScala211 = "2.11.12" val LatestScala212 = "2.12.8" val LatestScala213 = "2.13.0-RC1" val LegacyScalaVersions = List( "2.12.7" ) } ## Instruction: Remove 2.12.7 from the build. Let's see if this reduces release times so we don't timeout on Travis. ## Code After: package org.scalameta package build object Versions { val LatestScala210 = "2.10.7" val LatestScala211 = "2.11.12" val LatestScala212 = "2.12.8" val LatestScala213 = "2.13.0-RC1" val LegacyScalaVersions = List[String]() }
package org.scalameta package build object Versions { val LatestScala210 = "2.10.7" val LatestScala211 = "2.11.12" val LatestScala212 = "2.12.8" val LatestScala213 = "2.13.0-RC1" - val LegacyScalaVersions = List( + val LegacyScalaVersions = List[String]() ? ++++++++ + - "2.12.7" - ) }
4
0.333333
1
3
223b5c3f83f5bf39adc318de658f74190e292704
app/views/comment/_single_comment.html.erb
app/views/comment/_single_comment.html.erb
<div class="comment_in_request" id="comment-<%=comment.id.to_s%>"> <% if comment.user && comment.user.profile_photo && !@render_to_file %> <div class="user_photo_on_comment"> <img src="<%= get_profile_photo_url(:url_name => comment.user.url_name) %>" alt=""> </div> <% end %> <h2> <%# When not logged in, but mid-comment-leaving, there'll be no comment.user %> <%= comment.user ? user_link(comment.user) : _("You") %> <%= _("left an annotation") %> (<%= simple_date(comment.created_at || Time.now) %>) </h2> <div class="comment_in_request_text"> <p> <%= image_tag "quote-marks.png", :class => "comment_quote" %> <%= comment.get_body_for_html_display %> </p> </div> <p class="event_actions"> <% if !comment.id.nil? %> <% if !@user.nil? && @user.admin_page_links? %> <%= link_to "Admin", admin_request_edit_comment_path(comment) %> | <% end %> <%= link_to "Link to this", comment_path(comment), :class => "link_to_this" %> <!-- | <%= link_to _('Report abuse'), comment_path(comment) %> --> <% end %> </p> </div>
<div class="comment_in_request" id="comment-<%=comment.id.to_s%>"> <% if comment.user && comment.user.profile_photo && !@render_to_file %> <div class="user_photo_on_comment"> <img src="<%= get_profile_photo_url(:url_name => comment.user.url_name) %>" alt=""> </div> <% end %> <h2> <%# When not logged in, but mid-comment-leaving, there'll be no comment.user %> <%= comment.user ? user_link(comment.user) : _("You") %> <%= _("left an annotation") %> (<%= simple_date(comment.created_at || Time.now) %>) </h2> <div class="comment_in_request_text"> <p> <%= comment.get_body_for_html_display %> </p> </div> <p class="event_actions"> <% if !comment.id.nil? %> <% if !@user.nil? && @user.admin_page_links? %> <%= link_to "Admin", admin_request_edit_comment_path(comment) %> | <% end %> <%= link_to "Link to this", comment_path(comment), :class => "link_to_this" %> <!-- | <%= link_to _('Report abuse'), comment_path(comment) %> --> <% end %> </p> </div>
Remove the quote from a comment in request correspondence.
Remove the quote from a comment in request correspondence. It gets hidden by the current stylesheet, so easier and more efficient not to render it at all.
HTML+ERB
agpl-3.0
andreicristianpetcu/alaveteli_old,4bic/alaveteli,TEDICpy/QueremoSaber,TEDICpy/QueremoSaber,4bic/alaveteli,Br3nda/alaveteli,petterreinholdtsen/alaveteli,nzherald/alaveteli,4bic/alaveteli,TEDICpy/QueremoSaber,Br3nda/alaveteli,andreicristianpetcu/alaveteli_old,codeforcroatia/alaveteli,codeforcroatia/alaveteli,andreicristianpetcu/alaveteli,4bic/alaveteli,codeforcroatia/alaveteli,andreicristianpetcu/alaveteli,andreicristianpetcu/alaveteli,andreicristianpetcu/alaveteli,Br3nda/alaveteli,petterreinholdtsen/alaveteli,Br3nda/alaveteli,andreicristianpetcu/alaveteli,TEDICpy/QueremoSaber,nzherald/alaveteli,petterreinholdtsen/alaveteli,datauy/alaveteli,andreicristianpetcu/alaveteli_old,nzherald/alaveteli,TEDICpy/QueremoSaber,petterreinholdtsen/alaveteli,nzherald/alaveteli,nzherald/alaveteli,datauy/alaveteli,Br3nda/alaveteli,codeforcroatia/alaveteli,andreicristianpetcu/alaveteli_old,4bic/alaveteli,andreicristianpetcu/alaveteli_old,petterreinholdtsen/alaveteli,datauy/alaveteli
html+erb
## Code Before: <div class="comment_in_request" id="comment-<%=comment.id.to_s%>"> <% if comment.user && comment.user.profile_photo && !@render_to_file %> <div class="user_photo_on_comment"> <img src="<%= get_profile_photo_url(:url_name => comment.user.url_name) %>" alt=""> </div> <% end %> <h2> <%# When not logged in, but mid-comment-leaving, there'll be no comment.user %> <%= comment.user ? user_link(comment.user) : _("You") %> <%= _("left an annotation") %> (<%= simple_date(comment.created_at || Time.now) %>) </h2> <div class="comment_in_request_text"> <p> <%= image_tag "quote-marks.png", :class => "comment_quote" %> <%= comment.get_body_for_html_display %> </p> </div> <p class="event_actions"> <% if !comment.id.nil? %> <% if !@user.nil? && @user.admin_page_links? %> <%= link_to "Admin", admin_request_edit_comment_path(comment) %> | <% end %> <%= link_to "Link to this", comment_path(comment), :class => "link_to_this" %> <!-- | <%= link_to _('Report abuse'), comment_path(comment) %> --> <% end %> </p> </div> ## Instruction: Remove the quote from a comment in request correspondence. It gets hidden by the current stylesheet, so easier and more efficient not to render it at all. ## Code After: <div class="comment_in_request" id="comment-<%=comment.id.to_s%>"> <% if comment.user && comment.user.profile_photo && !@render_to_file %> <div class="user_photo_on_comment"> <img src="<%= get_profile_photo_url(:url_name => comment.user.url_name) %>" alt=""> </div> <% end %> <h2> <%# When not logged in, but mid-comment-leaving, there'll be no comment.user %> <%= comment.user ? user_link(comment.user) : _("You") %> <%= _("left an annotation") %> (<%= simple_date(comment.created_at || Time.now) %>) </h2> <div class="comment_in_request_text"> <p> <%= comment.get_body_for_html_display %> </p> </div> <p class="event_actions"> <% if !comment.id.nil? %> <% if !@user.nil? && @user.admin_page_links? %> <%= link_to "Admin", admin_request_edit_comment_path(comment) %> | <% end %> <%= link_to "Link to this", comment_path(comment), :class => "link_to_this" %> <!-- | <%= link_to _('Report abuse'), comment_path(comment) %> --> <% end %> </p> </div>
<div class="comment_in_request" id="comment-<%=comment.id.to_s%>"> <% if comment.user && comment.user.profile_photo && !@render_to_file %> <div class="user_photo_on_comment"> <img src="<%= get_profile_photo_url(:url_name => comment.user.url_name) %>" alt=""> </div> <% end %> <h2> <%# When not logged in, but mid-comment-leaving, there'll be no comment.user %> <%= comment.user ? user_link(comment.user) : _("You") %> <%= _("left an annotation") %> (<%= simple_date(comment.created_at || Time.now) %>) </h2> - <div class="comment_in_request_text"> ? - + <div class="comment_in_request_text"> <p> - <%= image_tag "quote-marks.png", :class => "comment_quote" %> <%= comment.get_body_for_html_display %> </p> </div> <p class="event_actions"> <% if !comment.id.nil? %> <% if !@user.nil? && @user.admin_page_links? %> <%= link_to "Admin", admin_request_edit_comment_path(comment) %> | <% end %> <%= link_to "Link to this", comment_path(comment), :class => "link_to_this" %> <!-- | <%= link_to _('Report abuse'), comment_path(comment) %> --> <% end %> </p> </div>
3
0.107143
1
2
f556f375693b9892f5c69132c213ab7e96943f4f
main.go
main.go
package main import ( "flag" "log" "net/http" "github.com/jvrplmlmn/nginx-requests-stats/handlers" "github.com/satyrius/gonx" ) const version = "0.1.0" var format string var logFile string func init() { flag.StringVar(&format, "format", `$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"`, "Log format") flag.StringVar(&logFile, "log", "/var/log/nginx/access.log", "Log file name to read.") } func main() { // Parse the command-line flags flag.Parse() // Always log when the application starts log.Println("Starting 'nginx-requests-stats' app...") // Create a parser based on a given format parser := gonx.NewParser(format) // This endpoint returns a JSON with the version of the application http.Handle("/version", handlers.VersionHandler(version)) // This endpoint returns a JSON with the number of requests in the last 24h http.Handle("/count", handlers.CountHandler(parser, logFile)) // Serve the endpoints log.Fatal(http.ListenAndServe("localhost:8080", nil)) }
package main import ( "flag" "log" "net/http" "github.com/jvrplmlmn/nginx-requests-stats/handlers" "github.com/satyrius/gonx" ) const version = "0.1.0" var format string var logFile string func init() { flag.StringVar(&format, "format", `$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_addr $upstream_cache_status`, "Log format") flag.StringVar(&logFile, "log", "/var/log/nginx/access.log", "Log file name to read.") } func main() { // Parse the command-line flags flag.Parse() // Always log when the application starts log.Println("Starting 'nginx-requests-stats' app...") // Create a parser based on a given format parser := gonx.NewParser(format) // This endpoint returns a JSON with the version of the application http.Handle("/version", handlers.VersionHandler(version)) // This endpoint returns a JSON with the number of requests in the last 24h http.Handle("/count", handlers.CountHandler(parser, logFile)) // Serve the endpoints log.Fatal(http.ListenAndServe("localhost:8080", nil)) }
Update log format to parse logs with upstream and cache fields by default
Update log format to parse logs with upstream and cache fields by default
Go
mit
jvrplmlmn/nginx-requests-stats
go
## Code Before: package main import ( "flag" "log" "net/http" "github.com/jvrplmlmn/nginx-requests-stats/handlers" "github.com/satyrius/gonx" ) const version = "0.1.0" var format string var logFile string func init() { flag.StringVar(&format, "format", `$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"`, "Log format") flag.StringVar(&logFile, "log", "/var/log/nginx/access.log", "Log file name to read.") } func main() { // Parse the command-line flags flag.Parse() // Always log when the application starts log.Println("Starting 'nginx-requests-stats' app...") // Create a parser based on a given format parser := gonx.NewParser(format) // This endpoint returns a JSON with the version of the application http.Handle("/version", handlers.VersionHandler(version)) // This endpoint returns a JSON with the number of requests in the last 24h http.Handle("/count", handlers.CountHandler(parser, logFile)) // Serve the endpoints log.Fatal(http.ListenAndServe("localhost:8080", nil)) } ## Instruction: Update log format to parse logs with upstream and cache fields by default ## Code After: package main import ( "flag" "log" "net/http" "github.com/jvrplmlmn/nginx-requests-stats/handlers" "github.com/satyrius/gonx" ) const version = "0.1.0" var format string var logFile string func init() { flag.StringVar(&format, "format", `$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_addr $upstream_cache_status`, "Log format") flag.StringVar(&logFile, "log", "/var/log/nginx/access.log", "Log file name to read.") } func main() { // Parse the command-line flags flag.Parse() // Always log when the application starts log.Println("Starting 'nginx-requests-stats' app...") // Create a parser based on a given format parser := gonx.NewParser(format) // This endpoint returns a JSON with the version of the application http.Handle("/version", handlers.VersionHandler(version)) // This endpoint returns a JSON with the number of requests in the last 24h http.Handle("/count", handlers.CountHandler(parser, logFile)) // Serve the endpoints log.Fatal(http.ListenAndServe("localhost:8080", nil)) }
package main import ( "flag" "log" "net/http" "github.com/jvrplmlmn/nginx-requests-stats/handlers" "github.com/satyrius/gonx" ) const version = "0.1.0" var format string var logFile string func init() { - flag.StringVar(&format, "format", `$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"`, "Log format") + flag.StringVar(&format, "format", `$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $upstream_addr $upstream_cache_status`, "Log format") ? ++++++++++++++++++++++++++++++++++++++ flag.StringVar(&logFile, "log", "/var/log/nginx/access.log", "Log file name to read.") } func main() { // Parse the command-line flags flag.Parse() // Always log when the application starts log.Println("Starting 'nginx-requests-stats' app...") // Create a parser based on a given format parser := gonx.NewParser(format) // This endpoint returns a JSON with the version of the application http.Handle("/version", handlers.VersionHandler(version)) // This endpoint returns a JSON with the number of requests in the last 24h http.Handle("/count", handlers.CountHandler(parser, logFile)) // Serve the endpoints log.Fatal(http.ListenAndServe("localhost:8080", nil)) }
2
0.051282
1
1
61b98cdc56321a256a98c107d696ec2205f7c0aa
lib/simctl/device_path.rb
lib/simctl/device_path.rb
module SimCtl class DevicePath def initialize(device) @device = device end def device_plist @device_plist ||= File.join(home, 'device.plist') end def global_preferences_plist @global_preferences_plist ||= File.join(home, 'data/Library/Preferences/.GlobalPreferences.plist') end def home @home ||= File.join(device_set_path, device.udid) end def launchctl @launchctl ||= File.join(runtime_root, 'bin/launchctl') end def preferences_plist @preferences_plist ||= File.join(home, 'data/Library/Preferences/com.apple.Preferences.plist') end private attr_reader :device def device_set_path return SimCtl.device_set_path unless SimCtl.device_set_path.nil? File.join(ENV['HOME'], 'Library/Developer/CoreSimulator/Devices') end def locate_runtime_root "/Library/Developer/CoreSimulator/Profiles/Runtimes/#{device.runtime.name}.simruntime/Contents/Resources/RuntimeRoot".tap do |path| return path if File.exists?(path) end Xcode::Path.sdk_root end def runtime_root @runtime_root ||= locate_runtime_root end end end
module SimCtl class DevicePath def initialize(device) @device = device end def device_plist @device_plist ||= File.join(home, 'device.plist') end def global_preferences_plist @global_preferences_plist ||= File.join(home, 'data/Library/Preferences/.GlobalPreferences.plist') end def home @home ||= File.join(device_set_path, device.udid) end def launchctl @launchctl ||= if Xcode::Version.gte? '9.0' "#{Xcode::Path.home}//Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl" else File.join(runtime_root, 'bin/launchctl') end end def preferences_plist @preferences_plist ||= File.join(home, 'data/Library/Preferences/com.apple.Preferences.plist') end private attr_reader :device def device_set_path return SimCtl.device_set_path unless SimCtl.device_set_path.nil? File.join(ENV['HOME'], 'Library/Developer/CoreSimulator/Devices') end def locate_runtime_root "/Library/Developer/CoreSimulator/Profiles/Runtimes/#{device.runtime.name}.simruntime/Contents/Resources/RuntimeRoot".tap do |path| return path if File.exists?(path) end Xcode::Path.sdk_root end def runtime_root @runtime_root ||= locate_runtime_root end end end
Update launchctl location for Xcode 9
Update launchctl location for Xcode 9
Ruby
mit
plu/simctl
ruby
## Code Before: module SimCtl class DevicePath def initialize(device) @device = device end def device_plist @device_plist ||= File.join(home, 'device.plist') end def global_preferences_plist @global_preferences_plist ||= File.join(home, 'data/Library/Preferences/.GlobalPreferences.plist') end def home @home ||= File.join(device_set_path, device.udid) end def launchctl @launchctl ||= File.join(runtime_root, 'bin/launchctl') end def preferences_plist @preferences_plist ||= File.join(home, 'data/Library/Preferences/com.apple.Preferences.plist') end private attr_reader :device def device_set_path return SimCtl.device_set_path unless SimCtl.device_set_path.nil? File.join(ENV['HOME'], 'Library/Developer/CoreSimulator/Devices') end def locate_runtime_root "/Library/Developer/CoreSimulator/Profiles/Runtimes/#{device.runtime.name}.simruntime/Contents/Resources/RuntimeRoot".tap do |path| return path if File.exists?(path) end Xcode::Path.sdk_root end def runtime_root @runtime_root ||= locate_runtime_root end end end ## Instruction: Update launchctl location for Xcode 9 ## Code After: module SimCtl class DevicePath def initialize(device) @device = device end def device_plist @device_plist ||= File.join(home, 'device.plist') end def global_preferences_plist @global_preferences_plist ||= File.join(home, 'data/Library/Preferences/.GlobalPreferences.plist') end def home @home ||= File.join(device_set_path, device.udid) end def launchctl @launchctl ||= if Xcode::Version.gte? '9.0' "#{Xcode::Path.home}//Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl" else File.join(runtime_root, 'bin/launchctl') end end def preferences_plist @preferences_plist ||= File.join(home, 'data/Library/Preferences/com.apple.Preferences.plist') end private attr_reader :device def device_set_path return SimCtl.device_set_path unless SimCtl.device_set_path.nil? File.join(ENV['HOME'], 'Library/Developer/CoreSimulator/Devices') end def locate_runtime_root "/Library/Developer/CoreSimulator/Profiles/Runtimes/#{device.runtime.name}.simruntime/Contents/Resources/RuntimeRoot".tap do |path| return path if File.exists?(path) end Xcode::Path.sdk_root end def runtime_root @runtime_root ||= locate_runtime_root end end end
module SimCtl class DevicePath def initialize(device) @device = device end def device_plist @device_plist ||= File.join(home, 'device.plist') end def global_preferences_plist @global_preferences_plist ||= File.join(home, 'data/Library/Preferences/.GlobalPreferences.plist') end def home @home ||= File.join(device_set_path, device.udid) end def launchctl + @launchctl ||= if Xcode::Version.gte? '9.0' + "#{Xcode::Path.home}//Platforms/iPhoneOS.platform/Developer/Library/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/bin/launchctl" + else - @launchctl ||= File.join(runtime_root, 'bin/launchctl') ? ---------- ^^^ + File.join(runtime_root, 'bin/launchctl') ? ^^^^^^^^^^^^^^^^ + end end def preferences_plist @preferences_plist ||= File.join(home, 'data/Library/Preferences/com.apple.Preferences.plist') end private attr_reader :device def device_set_path return SimCtl.device_set_path unless SimCtl.device_set_path.nil? File.join(ENV['HOME'], 'Library/Developer/CoreSimulator/Devices') end def locate_runtime_root "/Library/Developer/CoreSimulator/Profiles/Runtimes/#{device.runtime.name}.simruntime/Contents/Resources/RuntimeRoot".tap do |path| return path if File.exists?(path) end Xcode::Path.sdk_root end def runtime_root @runtime_root ||= locate_runtime_root end end end
6
0.12766
5
1
75e962a56fc8fa91cd6502a9f305bbde6caa44e6
lib/filecredentialmanager.js
lib/filecredentialmanager.js
var uri = require('url'); var decisions = require('decisions'); function FileCredentialManager(file) { var settings = decisions.createSettings(); settings.load(file); this._credentials = settings.toObject().credentials; console.log(this._credentials); } FileCredentialManager.prototype.get = function(options, cb) { if (options.url) { var url = uri.parse(options.url); options.scheme = url.protocol.slice(0, -1); // remove trailing colon options.authority = url.host; options.path = url.path; } var creds = this._credentials , cred, i, len; for (i = 0, len = creds.length; i < len; ++i) { cred = creds[i]; if (options.authority != cred.authority) { continue; } if (options.path != cred.path) { continue; } return cb(null, cred.password); } return cb(new Error('No creds for: ' + options.authority)); } module.exports = FileCredentialManager;
var uri = require('url'); var decisions = require('decisions'); function FileCredentialManager(file) { var settings = decisions.createSettings(); settings.load(file); this._credentials = settings.toObject().credentials; console.log(this._credentials); } FileCredentialManager.prototype.get = function(options, cb) { console.log('GET CREDENTIALS!!!'); console.log(options); //return; if (options.url) { var url = uri.parse(options.url); options.scheme = url.protocol.slice(0, -1); // remove trailing colon options.authority = url.host; options.path = url.path; } var creds = this._credentials , cred, i, len; for (i = 0, len = creds.length; i < len; ++i) { cred = creds[i]; if (options.id && options.id == cred.id) { console.log('RETURN THE PASSWORD!'); return cb(null, cred.password); } if (options.path) { if (options.authority != cred.authority) { continue; } if (options.path != cred.path) { continue; } return cb(null, cred.password); } } return cb(new Error('No creds for: ' + options.authority)); } module.exports = FileCredentialManager;
Add find by id support.
Add find by id support.
JavaScript
mit
bixbyjs/bixby-security
javascript
## Code Before: var uri = require('url'); var decisions = require('decisions'); function FileCredentialManager(file) { var settings = decisions.createSettings(); settings.load(file); this._credentials = settings.toObject().credentials; console.log(this._credentials); } FileCredentialManager.prototype.get = function(options, cb) { if (options.url) { var url = uri.parse(options.url); options.scheme = url.protocol.slice(0, -1); // remove trailing colon options.authority = url.host; options.path = url.path; } var creds = this._credentials , cred, i, len; for (i = 0, len = creds.length; i < len; ++i) { cred = creds[i]; if (options.authority != cred.authority) { continue; } if (options.path != cred.path) { continue; } return cb(null, cred.password); } return cb(new Error('No creds for: ' + options.authority)); } module.exports = FileCredentialManager; ## Instruction: Add find by id support. ## Code After: var uri = require('url'); var decisions = require('decisions'); function FileCredentialManager(file) { var settings = decisions.createSettings(); settings.load(file); this._credentials = settings.toObject().credentials; console.log(this._credentials); } FileCredentialManager.prototype.get = function(options, cb) { console.log('GET CREDENTIALS!!!'); console.log(options); //return; if (options.url) { var url = uri.parse(options.url); options.scheme = url.protocol.slice(0, -1); // remove trailing colon options.authority = url.host; options.path = url.path; } var creds = this._credentials , cred, i, len; for (i = 0, len = creds.length; i < len; ++i) { cred = creds[i]; if (options.id && options.id == cred.id) { console.log('RETURN THE PASSWORD!'); return cb(null, cred.password); } if (options.path) { if (options.authority != cred.authority) { continue; } if (options.path != cred.path) { continue; } return cb(null, cred.password); } } return cb(new Error('No creds for: ' + options.authority)); } module.exports = FileCredentialManager;
var uri = require('url'); var decisions = require('decisions'); function FileCredentialManager(file) { var settings = decisions.createSettings(); settings.load(file); this._credentials = settings.toObject().credentials; console.log(this._credentials); } FileCredentialManager.prototype.get = function(options, cb) { + console.log('GET CREDENTIALS!!!'); + console.log(options); + //return; + if (options.url) { var url = uri.parse(options.url); options.scheme = url.protocol.slice(0, -1); // remove trailing colon options.authority = url.host; options.path = url.path; } var creds = this._credentials , cred, i, len; for (i = 0, len = creds.length; i < len; ++i) { cred = creds[i]; + if (options.id && options.id == cred.id) { + console.log('RETURN THE PASSWORD!'); + return cb(null, cred.password); + } + + if (options.path) { - if (options.authority != cred.authority) { continue; } + if (options.authority != cred.authority) { continue; } ? ++ - if (options.path != cred.path) { continue; } + if (options.path != cred.path) { continue; } ? ++ - return cb(null, cred.password); + return cb(null, cred.password); ? ++ + } } return cb(new Error('No creds for: ' + options.authority)); } module.exports = FileCredentialManager;
17
0.472222
14
3
478c92671329d9acb912497d605799799a76174f
app/components/Error404.jsx
app/components/Error404.jsx
'use strict'; import React from 'react'; const Error404 = () => ( <div className="error-wrapper"> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQAQMAAADdiHD7AAAABlBMVEUAAABTU1OoaSf/AAAAAXRSTlMAQObYZgAAAFJJREFUeF7t0cENgDAMQ9FwYgxG6WjpaIzCCAxQxVggFuDiCvlLOeRdHR9yzjncHVoq3npu+wQUrUuJHylSTmBaespJyJQoObUeyxDQb3bEm5Au81c0pSCD8HYAAAAASUVORK5CYII=" alt="Error 404 Frowny Face Image Blob" /> <br /><hr /><br /> <h2>404... This page is not found!</h2> </div> ); export default Error404; // src2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIAQMAAABvIyEEAAAABlBMVEUAAABTU1OoaSf/AAAAAXRSTlMAQObYZgAAAENJREFUeF7tzbEJACEQRNGBLeAasBCza2lLEGx0CxFGG9hBMDDxRy/72O9FMnIFapGylsu1fgoBdkXfUHLrQgdfrlJN1BdYBjQQm3UAAAAASUVORK5CYII="
'use strict'; import React from 'react'; import { Link } from 'react-router'; import ErrorFace from '../../public/images/error_face.svg'; const Error404 = () => ( <div className="error-wrapper"> <img src={ ErrorFace } alt="Error 404 Frowny Face Image Blob (Gray)." /> <div> <h3>404 Error... Looks like this page can't be found right now!</h3> <hr /> <p>In the meantime, you can try <Link to="/">going back home</Link> to find what you need, or you can <a href="mailto:isenrich@yahoo.com">drop us a line</a> and we'll see if we can help resolve this issue.</p> </div> </div> ); export default Error404;
Build out helpful support content for 404 errors
feat: Build out helpful support content for 404 errors
JSX
mit
IsenrichO/DaviePoplarCapital,IsenrichO/DaviePoplarCapital
jsx
## Code Before: 'use strict'; import React from 'react'; const Error404 = () => ( <div className="error-wrapper"> <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQAQMAAADdiHD7AAAABlBMVEUAAABTU1OoaSf/AAAAAXRSTlMAQObYZgAAAFJJREFUeF7t0cENgDAMQ9FwYgxG6WjpaIzCCAxQxVggFuDiCvlLOeRdHR9yzjncHVoq3npu+wQUrUuJHylSTmBaespJyJQoObUeyxDQb3bEm5Au81c0pSCD8HYAAAAASUVORK5CYII=" alt="Error 404 Frowny Face Image Blob" /> <br /><hr /><br /> <h2>404... This page is not found!</h2> </div> ); export default Error404; // src2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIAQMAAABvIyEEAAAABlBMVEUAAABTU1OoaSf/AAAAAXRSTlMAQObYZgAAAENJREFUeF7tzbEJACEQRNGBLeAasBCza2lLEGx0CxFGG9hBMDDxRy/72O9FMnIFapGylsu1fgoBdkXfUHLrQgdfrlJN1BdYBjQQm3UAAAAASUVORK5CYII=" ## Instruction: feat: Build out helpful support content for 404 errors ## Code After: 'use strict'; import React from 'react'; import { Link } from 'react-router'; import ErrorFace from '../../public/images/error_face.svg'; const Error404 = () => ( <div className="error-wrapper"> <img src={ ErrorFace } alt="Error 404 Frowny Face Image Blob (Gray)." /> <div> <h3>404 Error... Looks like this page can't be found right now!</h3> <hr /> <p>In the meantime, you can try <Link to="/">going back home</Link> to find what you need, or you can <a href="mailto:isenrich@yahoo.com">drop us a line</a> and we'll see if we can help resolve this issue.</p> </div> </div> ); export default Error404;
'use strict'; import React from 'react'; + import { Link } from 'react-router'; + + import ErrorFace from '../../public/images/error_face.svg'; const Error404 = () => ( <div className="error-wrapper"> <img - src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQAQMAAADdiHD7AAAABlBMVEUAAABTU1OoaSf/AAAAAXRSTlMAQObYZgAAAFJJREFUeF7t0cENgDAMQ9FwYgxG6WjpaIzCCAxQxVggFuDiCvlLOeRdHR9yzjncHVoq3npu+wQUrUuJHylSTmBaespJyJQoObUeyxDQb3bEm5Au81c0pSCD8HYAAAAASUVORK5CYII=" + src={ ErrorFace } - alt="Error 404 Frowny Face Image Blob" /> + alt="Error 404 Frowny Face Image Blob (Gray)." /> ? ++++++++ - <br /><hr /><br /> - <h2>404... This page is not found!</h2> + <div> + <h3>404 Error... Looks like this page can't be found right now!</h3> + <hr /> + <p>In the meantime, you can try <Link to="/">going back home</Link> to find what you need, or you can <a href="mailto:isenrich@yahoo.com">drop us a line</a> and we'll see if we can help resolve this issue.</p> + </div> </div> ); export default Error404; - - - // src2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABIAQMAAABvIyEEAAAABlBMVEUAAABTU1OoaSf/AAAAAXRSTlMAQObYZgAAAENJREFUeF7tzbEJACEQRNGBLeAasBCza2lLEGx0CxFGG9hBMDDxRy/72O9FMnIFapGylsu1fgoBdkXfUHLrQgdfrlJN1BdYBjQQm3UAAAAASUVORK5CYII="
17
0.944444
10
7
5fdd571f4051926da730803042ceaacc889fc489
README.md
README.md
Django app intended to power reggae-cdmx.com. Eventually.
[![Build Status](https://travis-ci.org/FlowFX/reggae-cdmx.svg?branch=master)](https://travis-ci.org/FlowFX/reggae-cdmx) Django app intended to power reggae-cdmx.com. Eventually.
Add Travis CI build badge
Add Travis CI build badge
Markdown
mit
FlowFX/reggae-cdmx,FlowFX/reggae-cdmx
markdown
## Code Before: Django app intended to power reggae-cdmx.com. Eventually. ## Instruction: Add Travis CI build badge ## Code After: [![Build Status](https://travis-ci.org/FlowFX/reggae-cdmx.svg?branch=master)](https://travis-ci.org/FlowFX/reggae-cdmx) Django app intended to power reggae-cdmx.com. Eventually.
+ [![Build Status](https://travis-ci.org/FlowFX/reggae-cdmx.svg?branch=master)](https://travis-ci.org/FlowFX/reggae-cdmx) + Django app intended to power reggae-cdmx.com. Eventually. +
3
3
3
0
55a516213e46d1657809272eb9af3b6d1e9d7761
infrastructure/env-dev/main.tf
infrastructure/env-dev/main.tf
variable "domain" {} variable "region" {} variable "aws_access_key" {} variable "aws_secret_key" {} variable "env_vars" { type = "map" } variable "response_not_found" { type = "map" } variable "response_forbidden" { type = "map" } provider "aws" { region = "${var.region}" access_key = "${var.aws_access_key}" secret_key = "${var.aws_secret_key}" version = "~> 1.1" } module "app" { source = "../app" domain = "${var.domain}" app_package = "../../build/app-package.zip" env_vars = "${var.env_vars}" render_interval = "45 minutes" response_not_found = "${var.response_not_found}" response_forbidden = "${var.response_forbidden}" }
variable "domain" { description = "Domain name for the deployed site, eg 'lieu.io'" } variable "region" { description = "AWS region, eg 'us-east-1'" } variable "backend_bucket" { description = "AWS bucket name for S3 backend to store Terraform state" default = "terraform-state" } variable "backend_key" { description = "AWS S3 key name for Terraform state file" default = "terraform.tfstate" } variable "aws_access_key" {} variable "aws_secret_key" {} variable "env_vars" { type = "map" } variable "response_not_found" { description = "Return 200 for 404 paths to support SPA routing" type = "map" default = { error_code = "404" response_code = "200" response_page_path = "/" } } variable "response_forbidden" { description = "Return 200 for 404 paths to support SPA routing" type = "map" default = { error_code = "403" response_code = "200" response_page_path = "/" } } provider "aws" { region = "${var.region}" access_key = "${var.aws_access_key}" secret_key = "${var.aws_secret_key}" version = "~> 1.1" } module "app" { source = "../app" domain = "${var.domain}" app_package = "../../build/app-package.zip" env_vars = "${var.env_vars}" render_interval = "45 minutes" response_not_found = "${var.response_not_found}" response_forbidden = "${var.response_forbidden}" } terraform { backend "s3" {} }
Document root terraform file and specify S3 backend
Document root terraform file and specify S3 backend
HCL
mit
dereklieu/formation
hcl
## Code Before: variable "domain" {} variable "region" {} variable "aws_access_key" {} variable "aws_secret_key" {} variable "env_vars" { type = "map" } variable "response_not_found" { type = "map" } variable "response_forbidden" { type = "map" } provider "aws" { region = "${var.region}" access_key = "${var.aws_access_key}" secret_key = "${var.aws_secret_key}" version = "~> 1.1" } module "app" { source = "../app" domain = "${var.domain}" app_package = "../../build/app-package.zip" env_vars = "${var.env_vars}" render_interval = "45 minutes" response_not_found = "${var.response_not_found}" response_forbidden = "${var.response_forbidden}" } ## Instruction: Document root terraform file and specify S3 backend ## Code After: variable "domain" { description = "Domain name for the deployed site, eg 'lieu.io'" } variable "region" { description = "AWS region, eg 'us-east-1'" } variable "backend_bucket" { description = "AWS bucket name for S3 backend to store Terraform state" default = "terraform-state" } variable "backend_key" { description = "AWS S3 key name for Terraform state file" default = "terraform.tfstate" } variable "aws_access_key" {} variable "aws_secret_key" {} variable "env_vars" { type = "map" } variable "response_not_found" { description = "Return 200 for 404 paths to support SPA routing" type = "map" default = { error_code = "404" response_code = "200" response_page_path = "/" } } variable "response_forbidden" { description = "Return 200 for 404 paths to support SPA routing" type = "map" default = { error_code = "403" response_code = "200" response_page_path = "/" } } provider "aws" { region = "${var.region}" access_key = "${var.aws_access_key}" secret_key = "${var.aws_secret_key}" version = "~> 1.1" } module "app" { source = "../app" domain = "${var.domain}" app_package = "../../build/app-package.zip" env_vars = "${var.env_vars}" render_interval = "45 minutes" response_not_found = "${var.response_not_found}" response_forbidden = "${var.response_forbidden}" } terraform { backend "s3" {} }
- variable "domain" {} ? - + variable "domain" { + description = "Domain name for the deployed site, eg 'lieu.io'" + } + - variable "region" {} ? - + variable "region" { + description = "AWS region, eg 'us-east-1'" + } + + variable "backend_bucket" { + description = "AWS bucket name for S3 backend to store Terraform state" + default = "terraform-state" + } + + variable "backend_key" { + description = "AWS S3 key name for Terraform state file" + default = "terraform.tfstate" + } + variable "aws_access_key" {} + variable "aws_secret_key" {} + variable "env_vars" { type = "map" } + - variable "response_not_found" { type = "map" } ? --------------- + variable "response_not_found" { + description = "Return 200 for 404 paths to support SPA routing" + type = "map" + default = { + error_code = "404" + response_code = "200" + response_page_path = "/" + } + } + - variable "response_forbidden" { type = "map" } ? --------------- + variable "response_forbidden" { + description = "Return 200 for 404 paths to support SPA routing" + type = "map" + default = { + error_code = "403" + response_code = "200" + response_page_path = "/" + } + } provider "aws" { region = "${var.region}" access_key = "${var.aws_access_key}" secret_key = "${var.aws_secret_key}" version = "~> 1.1" } module "app" { source = "../app" domain = "${var.domain}" app_package = "../../build/app-package.zip" env_vars = "${var.env_vars}" render_interval = "45 minutes" response_not_found = "${var.response_not_found}" response_forbidden = "${var.response_forbidden}" } + + terraform { + backend "s3" {} + }
48
2
44
4
a875cbcd587237ef178cb7f0d4cefac8a9ddcb36
config/initializers/rack_attack.rb
config/initializers/rack_attack.rb
class Rack::Attack throttle('registrations', limit: 10, period: 1.day) do |req| if req.path == '/' && req.post? req.env['HTTP_X_FORWARDED_FOR'].split(/\s*,\s*/)[0] end end throttle('password reset', limit: 1, period: 1.day) do |req| if req.path == '/password' && req.params['user'] req.params['user']['email'].presence end end end
class Rack::Attack throttle('registrations', limit: 10, period: 1.day) do |req| if req.path == '/' && req.post? return req.ip || req.env['HTTP_X_FORWARDED_FOR'].ip.split(/\s*,\s*/)[0] end end throttle('password reset', limit: 1, period: 1.day) do |req| if req.path == '/password' && req.params['user'] req.params['user']['email'].presence end end end
Use req.ip for throttling if present
Use req.ip for throttling if present Mostly so things don't break when working locally.
Ruby
agpl-3.0
EFForg/action-center-platform,EFForg/action-center-platform,EFForg/action-center-platform,EFForg/action-center-platform
ruby
## Code Before: class Rack::Attack throttle('registrations', limit: 10, period: 1.day) do |req| if req.path == '/' && req.post? req.env['HTTP_X_FORWARDED_FOR'].split(/\s*,\s*/)[0] end end throttle('password reset', limit: 1, period: 1.day) do |req| if req.path == '/password' && req.params['user'] req.params['user']['email'].presence end end end ## Instruction: Use req.ip for throttling if present Mostly so things don't break when working locally. ## Code After: class Rack::Attack throttle('registrations', limit: 10, period: 1.day) do |req| if req.path == '/' && req.post? return req.ip || req.env['HTTP_X_FORWARDED_FOR'].ip.split(/\s*,\s*/)[0] end end throttle('password reset', limit: 1, period: 1.day) do |req| if req.path == '/password' && req.params['user'] req.params['user']['email'].presence end end end
class Rack::Attack throttle('registrations', limit: 10, period: 1.day) do |req| if req.path == '/' && req.post? - req.env['HTTP_X_FORWARDED_FOR'].split(/\s*,\s*/)[0] + return req.ip || req.env['HTTP_X_FORWARDED_FOR'].ip.split(/\s*,\s*/)[0] ? +++++++++++++++++ +++ end end throttle('password reset', limit: 1, period: 1.day) do |req| if req.path == '/password' && req.params['user'] req.params['user']['email'].presence end end end
2
0.153846
1
1
1ee41f5439f80af139e612591d48cdac5ecfda39
hiapi/hi.py
hiapi/hi.py
import argparse from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return 'Hi!\n' def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-b', '--bind-address', dest='bind', default='127.0.0.1') parser.add_argument('-p', '--port', dest='port', default=4000, type=int) return parser.parse_args() def main(): opts = parse_args() app.run(host=opts.bind, port=opts.port) # Support for uWSGI def application(env, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) return [b'Hi!\n'] if __name__ == "__main__": main()
import argparse import flask RESPONSE_CODE = 200 app = flask.Flask(__name__) @app.route('/') def hello(): global RESPONSE_CODE if RESPONSE_CODE == 200: return 'Hi!\n' else: flask.abort(RESPONSE_CODE) def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-b', '--bind-address', dest='bind', default='127.0.0.1') parser.add_argument('-p', '--port', dest='port', default=4000, type=int) parser.add_argument('-c', '--response_code', dest='code', default=200, type=int) return parser.parse_args() def main(): global RESPONSE_CODE opts = parse_args() RESPONSE_CODE = opts.code app.run(host=opts.bind, port=opts.port) if __name__ == "__main__": main()
Remove uwsgi support, add support for simple alternative responses
Remove uwsgi support, add support for simple alternative responses
Python
apache-2.0
GradysGhost/pyhiapi
python
## Code Before: import argparse from flask import Flask app = Flask(__name__) @app.route('/') def hello(): return 'Hi!\n' def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-b', '--bind-address', dest='bind', default='127.0.0.1') parser.add_argument('-p', '--port', dest='port', default=4000, type=int) return parser.parse_args() def main(): opts = parse_args() app.run(host=opts.bind, port=opts.port) # Support for uWSGI def application(env, start_response): start_response('200 OK', [('Content-Type', 'text/plain')]) return [b'Hi!\n'] if __name__ == "__main__": main() ## Instruction: Remove uwsgi support, add support for simple alternative responses ## Code After: import argparse import flask RESPONSE_CODE = 200 app = flask.Flask(__name__) @app.route('/') def hello(): global RESPONSE_CODE if RESPONSE_CODE == 200: return 'Hi!\n' else: flask.abort(RESPONSE_CODE) def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-b', '--bind-address', dest='bind', default='127.0.0.1') parser.add_argument('-p', '--port', dest='port', default=4000, type=int) parser.add_argument('-c', '--response_code', dest='code', default=200, type=int) return parser.parse_args() def main(): global RESPONSE_CODE opts = parse_args() RESPONSE_CODE = opts.code app.run(host=opts.bind, port=opts.port) if __name__ == "__main__": main()
import argparse - from flask import Flask + import flask + RESPONSE_CODE = 200 + - app = Flask(__name__) + app = flask.Flask(__name__) ? ++++++ @app.route('/') def hello(): + global RESPONSE_CODE + if RESPONSE_CODE == 200: - return 'Hi!\n' + return 'Hi!\n' ? ++++ + else: + flask.abort(RESPONSE_CODE) def parse_args(): parser = argparse.ArgumentParser() parser.add_argument('-b', '--bind-address', dest='bind', default='127.0.0.1') parser.add_argument('-p', '--port', dest='port', default=4000, type=int) + parser.add_argument('-c', '--response_code', dest='code', default=200, type=int) return parser.parse_args() def main(): + global RESPONSE_CODE opts = parse_args() + RESPONSE_CODE = opts.code app.run(host=opts.bind, port=opts.port) - - # Support for uWSGI - def application(env, start_response): - start_response('200 OK', [('Content-Type', 'text/plain')]) - return [b'Hi!\n'] if __name__ == "__main__": main()
20
0.714286
12
8
a174fbd637bf9ccc7b8a97a251c016495f92f6a9
eliot/__init__.py
eliot/__init__.py
from ._version import __version__ # Expose the public API: from ._message import Message from ._action import startAction, startTask, Action from ._output import ILogger, Logger, MemoryLogger from ._validation import Field, MessageType, ActionType from ._traceback import writeTraceback, writeFailure addDestination = Logger._destinations.add removeDestination = Logger._destinations.remove __all__ = ["Message", "writeTraceback", "writeFailure", "startAction", "startTask", "Action", "Field", "MessageType", "ActionType", "ILogger", "Logger", "MemoryLogger", "addDestination", "removeDestination", "__version__", ]
from ._version import __version__ # Expose the public API: from ._message import Message from ._action import startAction, startTask, Action from ._output import ILogger, Logger, MemoryLogger from ._validation import Field, fields, MessageType, ActionType from ._traceback import writeTraceback, writeFailure addDestination = Logger._destinations.add removeDestination = Logger._destinations.remove __all__ = ["Message", "writeTraceback", "writeFailure", "startAction", "startTask", "Action", "Field", "fields", "MessageType", "ActionType", "ILogger", "Logger", "MemoryLogger", "addDestination", "removeDestination", "__version__", ]
Add fields to the public API.
Add fields to the public API.
Python
apache-2.0
ClusterHQ/eliot,ScatterHQ/eliot,iffy/eliot,ScatterHQ/eliot,ScatterHQ/eliot
python
## Code Before: from ._version import __version__ # Expose the public API: from ._message import Message from ._action import startAction, startTask, Action from ._output import ILogger, Logger, MemoryLogger from ._validation import Field, MessageType, ActionType from ._traceback import writeTraceback, writeFailure addDestination = Logger._destinations.add removeDestination = Logger._destinations.remove __all__ = ["Message", "writeTraceback", "writeFailure", "startAction", "startTask", "Action", "Field", "MessageType", "ActionType", "ILogger", "Logger", "MemoryLogger", "addDestination", "removeDestination", "__version__", ] ## Instruction: Add fields to the public API. ## Code After: from ._version import __version__ # Expose the public API: from ._message import Message from ._action import startAction, startTask, Action from ._output import ILogger, Logger, MemoryLogger from ._validation import Field, fields, MessageType, ActionType from ._traceback import writeTraceback, writeFailure addDestination = Logger._destinations.add removeDestination = Logger._destinations.remove __all__ = ["Message", "writeTraceback", "writeFailure", "startAction", "startTask", "Action", "Field", "fields", "MessageType", "ActionType", "ILogger", "Logger", "MemoryLogger", "addDestination", "removeDestination", "__version__", ]
from ._version import __version__ # Expose the public API: from ._message import Message from ._action import startAction, startTask, Action from ._output import ILogger, Logger, MemoryLogger - from ._validation import Field, MessageType, ActionType + from ._validation import Field, fields, MessageType, ActionType ? ++++++++ from ._traceback import writeTraceback, writeFailure addDestination = Logger._destinations.add removeDestination = Logger._destinations.remove __all__ = ["Message", "writeTraceback", "writeFailure", "startAction", "startTask", "Action", - "Field", "MessageType", "ActionType", + "Field", "fields", "MessageType", "ActionType", ? ++++++++++ "ILogger", "Logger", "MemoryLogger", "addDestination", "removeDestination", "__version__", ]
4
0.190476
2
2
067e63845a69e3fc129aab1d443ae91e9f825254
src/main/web/florence/js/functions/_updateContent.js
src/main/web/florence/js/functions/_updateContent.js
function updateContent(collectionId, path, content, redirectToPath) { postContent(collectionId, path, content, success = function (response) { //console.log("Updating completed " + response); Florence.Editor.isDirty = false; if (redirectToPath) { createWorkspace(redirectToPath, collectionId, 'edit'); return true; } else { refreshPreview(path); loadPageDataIntoEditor(path, collectionId); } }, error = function (response) { if (response.status === 400) { alert("Cannot edit this file. It is already part of another collection."); } else if (response.status === 401) { alert("You are not authorised to update content."); } else { handleApiError(response); } } ); }
function updateContent(collectionId, path, content, redirectToPath) { var redirect = redirectToPath; postContent(collectionId, path, content, success = function (response) { Florence.Editor.isDirty = false; if (redirect) { createWorkspace(redirect, collectionId, 'edit'); return; } else { refreshPreview(path); loadPageDataIntoEditor(path, collectionId); } }, error = function (response) { if (response.status === 400) { alert("Cannot edit this file. It is already part of another collection."); } else if (response.status === 401) { alert("You are not authorised to update content."); } else { handleApiError(response); } } ); }
Save back to compendium bug
Save back to compendium bug
JavaScript
mit
ONSdigital/florence,ONSdigital/florence,ONSdigital/florence,ONSdigital/florence
javascript
## Code Before: function updateContent(collectionId, path, content, redirectToPath) { postContent(collectionId, path, content, success = function (response) { //console.log("Updating completed " + response); Florence.Editor.isDirty = false; if (redirectToPath) { createWorkspace(redirectToPath, collectionId, 'edit'); return true; } else { refreshPreview(path); loadPageDataIntoEditor(path, collectionId); } }, error = function (response) { if (response.status === 400) { alert("Cannot edit this file. It is already part of another collection."); } else if (response.status === 401) { alert("You are not authorised to update content."); } else { handleApiError(response); } } ); } ## Instruction: Save back to compendium bug ## Code After: function updateContent(collectionId, path, content, redirectToPath) { var redirect = redirectToPath; postContent(collectionId, path, content, success = function (response) { Florence.Editor.isDirty = false; if (redirect) { createWorkspace(redirect, collectionId, 'edit'); return; } else { refreshPreview(path); loadPageDataIntoEditor(path, collectionId); } }, error = function (response) { if (response.status === 400) { alert("Cannot edit this file. It is already part of another collection."); } else if (response.status === 401) { alert("You are not authorised to update content."); } else { handleApiError(response); } } ); }
function updateContent(collectionId, path, content, redirectToPath) { + var redirect = redirectToPath; postContent(collectionId, path, content, success = function (response) { - //console.log("Updating completed " + response); Florence.Editor.isDirty = false; - if (redirectToPath) { ? ------ + if (redirect) { - createWorkspace(redirectToPath, collectionId, 'edit'); ? ------ + createWorkspace(redirect, collectionId, 'edit'); - return true; ? ----- + return; } else { refreshPreview(path); loadPageDataIntoEditor(path, collectionId); } }, error = function (response) { if (response.status === 400) { alert("Cannot edit this file. It is already part of another collection."); } else if (response.status === 401) { alert("You are not authorised to update content."); } else { handleApiError(response); } } ); }
8
0.307692
4
4
685074456648ecea6c0f9f3a92948fc006e18f63
webpack/redux/__tests__/refresh_logs_tests.ts
webpack/redux/__tests__/refresh_logs_tests.ts
const mockGet = jest.fn(() => { return Promise.resolve({ data: [mockLog.body] }); }); jest.mock("axios", () => ({ default: { get: mockGet } })); import { refreshLogs } from "../refresh_logs"; import axios from "axios"; import { API } from "../../api"; import { resourceReady } from "../../sync/actions"; import { fakeLog } from "../../__test_support__/fake_state/resources"; const mockLog = fakeLog(); describe("refreshLogs", () => { it("dispatches the appropriate action", async () => { const dispatch = jest.fn(); API.setBaseUrl("localhost"); await refreshLogs(dispatch); expect(axios.get).toHaveBeenCalled(); const action = resourceReady("Log", mockLog); expect(dispatch).toHaveBeenCalledWith(action); }); });
const mockGet = jest.fn(() => { return Promise.resolve({ data: [mockLog.body] }); }); jest.mock("axios", () => ({ default: { get: mockGet } })); import { refreshLogs } from "../refresh_logs"; import axios from "axios"; import { API } from "../../api"; import { SyncResponse } from "../../sync/actions"; import { fakeLog } from "../../__test_support__/fake_state/resources"; import { TaggedLog } from "farmbot"; import { Actions } from "../../constants"; const mockLog = fakeLog(); describe("refreshLogs", () => { it("dispatches the appropriate action", async () => { const dispatch = jest.fn(); API.setBaseUrl("localhost"); await refreshLogs(dispatch); expect(axios.get).toHaveBeenCalled(); const lastCall: SyncResponse<TaggedLog> = dispatch.mock.calls[0][0]; expect(lastCall).toBeTruthy(); expect(lastCall.type).toBe(Actions.RESOURCE_READY); expect(lastCall.payload.body[0].body).toEqual(mockLog.body); }); });
Update log tests to account for reducer-assigned UUIDs
Update log tests to account for reducer-assigned UUIDs
TypeScript
mit
FarmBot/farmbot-web-app,RickCarlino/farmbot-web-app,RickCarlino/farmbot-web-app,FarmBot/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,gabrielburnworth/Farmbot-Web-App,gabrielburnworth/Farmbot-Web-App,FarmBot/Farmbot-Web-API,FarmBot/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,FarmBot/Farmbot-Web-API,FarmBot/Farmbot-Web-API,FarmBot/Farmbot-Web-API,FarmBot/Farmbot-Web-API,gabrielburnworth/Farmbot-Web-App,RickCarlino/farmbot-web-app,RickCarlino/farmbot-web-app,RickCarlino/farmbot-web-app
typescript
## Code Before: const mockGet = jest.fn(() => { return Promise.resolve({ data: [mockLog.body] }); }); jest.mock("axios", () => ({ default: { get: mockGet } })); import { refreshLogs } from "../refresh_logs"; import axios from "axios"; import { API } from "../../api"; import { resourceReady } from "../../sync/actions"; import { fakeLog } from "../../__test_support__/fake_state/resources"; const mockLog = fakeLog(); describe("refreshLogs", () => { it("dispatches the appropriate action", async () => { const dispatch = jest.fn(); API.setBaseUrl("localhost"); await refreshLogs(dispatch); expect(axios.get).toHaveBeenCalled(); const action = resourceReady("Log", mockLog); expect(dispatch).toHaveBeenCalledWith(action); }); }); ## Instruction: Update log tests to account for reducer-assigned UUIDs ## Code After: const mockGet = jest.fn(() => { return Promise.resolve({ data: [mockLog.body] }); }); jest.mock("axios", () => ({ default: { get: mockGet } })); import { refreshLogs } from "../refresh_logs"; import axios from "axios"; import { API } from "../../api"; import { SyncResponse } from "../../sync/actions"; import { fakeLog } from "../../__test_support__/fake_state/resources"; import { TaggedLog } from "farmbot"; import { Actions } from "../../constants"; const mockLog = fakeLog(); describe("refreshLogs", () => { it("dispatches the appropriate action", async () => { const dispatch = jest.fn(); API.setBaseUrl("localhost"); await refreshLogs(dispatch); expect(axios.get).toHaveBeenCalled(); const lastCall: SyncResponse<TaggedLog> = dispatch.mock.calls[0][0]; expect(lastCall).toBeTruthy(); expect(lastCall.type).toBe(Actions.RESOURCE_READY); expect(lastCall.payload.body[0].body).toEqual(mockLog.body); }); });
const mockGet = jest.fn(() => { return Promise.resolve({ data: [mockLog.body] }); }); jest.mock("axios", () => ({ default: { get: mockGet } })); import { refreshLogs } from "../refresh_logs"; import axios from "axios"; import { API } from "../../api"; - import { resourceReady } from "../../sync/actions"; ? ^ ^^^ ----- + import { SyncResponse } from "../../sync/actions"; ? ^^^^^ + ^^ import { fakeLog } from "../../__test_support__/fake_state/resources"; + import { TaggedLog } from "farmbot"; + import { Actions } from "../../constants"; const mockLog = fakeLog(); describe("refreshLogs", () => { it("dispatches the appropriate action", async () => { const dispatch = jest.fn(); API.setBaseUrl("localhost"); await refreshLogs(dispatch); expect(axios.get).toHaveBeenCalled(); - const action = resourceReady("Log", mockLog); - expect(dispatch).toHaveBeenCalledWith(action); + const lastCall: SyncResponse<TaggedLog> = dispatch.mock.calls[0][0]; + expect(lastCall).toBeTruthy(); + expect(lastCall.type).toBe(Actions.RESOURCE_READY); + expect(lastCall.payload.body[0].body).toEqual(mockLog.body); }); });
10
0.454545
7
3
af19890611a1ffa84da4eee131ac1f6d4cf8ab20
src/main/java/beaform/entities/Formula.java
src/main/java/beaform/entities/Formula.java
package beaform.entities; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Label; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; import beaform.Type; public class Formula { private final Type type; private final Label label; private final String name; private final String description; public Formula(String name, String description) { this.type = Type.FORMULA; this.label = this.type.getLabel(); this.name = name; this.description = description; } public Label getLabel() { return this.label; } public String getName() { return this.name; } public String getDescription() { return this.description; } /** * Store the Formula in the graph database. * * @param graphDb a handle to the graph database. * @return the newly created node */ public Node persist(GraphDatabaseService graphDb) { Node thisNode; try ( Transaction tx = graphDb.beginTx()) { thisNode = graphDb.createNode(this.label); thisNode.setProperty( "name", this.name ); thisNode.setProperty( "description", this.description ); tx.success(); } return thisNode; } }
package beaform.entities; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Label; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; import beaform.Type; public class Formula { private final Type type; private final Label label; private final String name; private final String description; public Formula(String name, String description) { this.type = Type.FORMULA; this.label = this.type.getLabel(); this.name = name; this.description = description; } public Label getLabel() { return this.label; } public String getName() { return this.name; } public String getDescription() { return this.description; } /** * Store the Formula in the graph database. * * @param graphDb a handle to the graph database. * @return the newly created node */ public Node persist(GraphDatabaseService graphDb) { Node thisNode; try ( Transaction tx = graphDb.beginTx()) { thisNode = graphDb.createNode(this.label); thisNode.setProperty( "name", this.name ); thisNode.setProperty( "description", this.description ); tx.success(); } return thisNode; } @Override public String toString() { return this.type + " name: " + this.name + " desc: " + this.description; } }
Add toString method for formulas
Add toString method for formulas
Java
mit
stevenpost/beaform
java
## Code Before: package beaform.entities; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Label; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; import beaform.Type; public class Formula { private final Type type; private final Label label; private final String name; private final String description; public Formula(String name, String description) { this.type = Type.FORMULA; this.label = this.type.getLabel(); this.name = name; this.description = description; } public Label getLabel() { return this.label; } public String getName() { return this.name; } public String getDescription() { return this.description; } /** * Store the Formula in the graph database. * * @param graphDb a handle to the graph database. * @return the newly created node */ public Node persist(GraphDatabaseService graphDb) { Node thisNode; try ( Transaction tx = graphDb.beginTx()) { thisNode = graphDb.createNode(this.label); thisNode.setProperty( "name", this.name ); thisNode.setProperty( "description", this.description ); tx.success(); } return thisNode; } } ## Instruction: Add toString method for formulas ## Code After: package beaform.entities; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Label; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; import beaform.Type; public class Formula { private final Type type; private final Label label; private final String name; private final String description; public Formula(String name, String description) { this.type = Type.FORMULA; this.label = this.type.getLabel(); this.name = name; this.description = description; } public Label getLabel() { return this.label; } public String getName() { return this.name; } public String getDescription() { return this.description; } /** * Store the Formula in the graph database. * * @param graphDb a handle to the graph database. * @return the newly created node */ public Node persist(GraphDatabaseService graphDb) { Node thisNode; try ( Transaction tx = graphDb.beginTx()) { thisNode = graphDb.createNode(this.label); thisNode.setProperty( "name", this.name ); thisNode.setProperty( "description", this.description ); tx.success(); } return thisNode; } @Override public String toString() { return this.type + " name: " + this.name + " desc: " + this.description; } }
package beaform.entities; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Label; import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Transaction; import beaform.Type; public class Formula { private final Type type; private final Label label; private final String name; private final String description; public Formula(String name, String description) { this.type = Type.FORMULA; this.label = this.type.getLabel(); this.name = name; this.description = description; } public Label getLabel() { return this.label; } public String getName() { return this.name; } public String getDescription() { return this.description; } /** * Store the Formula in the graph database. * * @param graphDb a handle to the graph database. * @return the newly created node */ public Node persist(GraphDatabaseService graphDb) { Node thisNode; try ( Transaction tx = graphDb.beginTx()) { thisNode = graphDb.createNode(this.label); thisNode.setProperty( "name", this.name ); thisNode.setProperty( "description", this.description ); tx.success(); } return thisNode; } + @Override + public String toString() { + return this.type + " name: " + this.name + " desc: " + this.description; + } + }
5
0.089286
5
0
8e656703194aea4dbb7722a3394ae81c0b7223d6
sideloader/templates/accounts_profile.html
sideloader/templates/accounts_profile.html
{% include "fragments/head.html" with nav_active="home" %} <div class="row-fluid"> <div class="span9"> <h4>Account settings: {{user.username}}</h4> <p> <form method="POST" class="form-horizontal"> {% csrf_token %} {{form}} <div class="control-group form-actions"> <div class="controls"> <input type="submit" class="btn btn-success" value="Save"> </div> </div> </form> </p> </div> </div> {% include "fragments/foot.html" %}
{% include "fragments/head.html" %} <div class="row-fluid"> <div class="span9"> <h4>Account settings: {{user.username}}</h4> <p> <form method="POST" class="form-horizontal"> {% csrf_token %} {{form}} <div class="control-group form-actions"> <div class="controls"> <input type="submit" class="btn btn-success" value="Save"> </div> </div> </form> </p> </div> </div> {% include "fragments/foot.html" %}
Fix nav on profile settings
Fix nav on profile settings
HTML
mit
praekelt/sideloader,praekelt/sideloader,praekelt/sideloader,praekelt/sideloader
html
## Code Before: {% include "fragments/head.html" with nav_active="home" %} <div class="row-fluid"> <div class="span9"> <h4>Account settings: {{user.username}}</h4> <p> <form method="POST" class="form-horizontal"> {% csrf_token %} {{form}} <div class="control-group form-actions"> <div class="controls"> <input type="submit" class="btn btn-success" value="Save"> </div> </div> </form> </p> </div> </div> {% include "fragments/foot.html" %} ## Instruction: Fix nav on profile settings ## Code After: {% include "fragments/head.html" %} <div class="row-fluid"> <div class="span9"> <h4>Account settings: {{user.username}}</h4> <p> <form method="POST" class="form-horizontal"> {% csrf_token %} {{form}} <div class="control-group form-actions"> <div class="controls"> <input type="submit" class="btn btn-success" value="Save"> </div> </div> </form> </p> </div> </div> {% include "fragments/foot.html" %}
- {% include "fragments/head.html" with nav_active="home" %} ? ----------------------- + {% include "fragments/head.html" %} <div class="row-fluid"> <div class="span9"> <h4>Account settings: {{user.username}}</h4> <p> <form method="POST" class="form-horizontal"> {% csrf_token %} {{form}} <div class="control-group form-actions"> <div class="controls"> <input type="submit" class="btn btn-success" value="Save"> </div> </div> </form> </p> </div> </div> {% include "fragments/foot.html" %}
2
0.1
1
1
4dfc023b7d6cd4ca0b4298e93b657c9a515f261d
app/Larapress/Providers/CaptchaServiceProvider.php
app/Larapress/Providers/CaptchaServiceProvider.php
<?php namespace Larapress\Providers; use Illuminate\Support\ServiceProvider; use Larapress\Services\Captcha; use Larapress\Services\Helpers; class CaptchaServiceProvider extends ServiceProvider { /** * Register the service provider. * * @return void */ public function register() { $this->app->bind('captcha', function() { return new Captcha( $this->app['view'], $this->app['config'], $this->app['session.store'], new Helpers ); }); } }
<?php namespace Larapress\Providers; use Illuminate\Support\ServiceProvider; use Larapress\Services\Captcha; use Larapress\Services\Helpers; class CaptchaServiceProvider extends ServiceProvider { /** * Register the service provider. * * @return void */ public function register() { $self = $this; $this->app->bind('captcha', function() use ($self) { return new Captcha( $self->app['view'], $self->app['config'], $self->app['session.store'], new Helpers ); }); } }
Fix PHP 5.3 closure bug in the captcha service provider
Fix PHP 5.3 closure bug in the captcha service provider
PHP
mit
larapress-cms/larapress,larapress-cms/larapress,larapress-cms/larapress
php
## Code Before: <?php namespace Larapress\Providers; use Illuminate\Support\ServiceProvider; use Larapress\Services\Captcha; use Larapress\Services\Helpers; class CaptchaServiceProvider extends ServiceProvider { /** * Register the service provider. * * @return void */ public function register() { $this->app->bind('captcha', function() { return new Captcha( $this->app['view'], $this->app['config'], $this->app['session.store'], new Helpers ); }); } } ## Instruction: Fix PHP 5.3 closure bug in the captcha service provider ## Code After: <?php namespace Larapress\Providers; use Illuminate\Support\ServiceProvider; use Larapress\Services\Captcha; use Larapress\Services\Helpers; class CaptchaServiceProvider extends ServiceProvider { /** * Register the service provider. * * @return void */ public function register() { $self = $this; $this->app->bind('captcha', function() use ($self) { return new Captcha( $self->app['view'], $self->app['config'], $self->app['session.store'], new Helpers ); }); } }
<?php namespace Larapress\Providers; use Illuminate\Support\ServiceProvider; use Larapress\Services\Captcha; use Larapress\Services\Helpers; class CaptchaServiceProvider extends ServiceProvider { /** * Register the service provider. * * @return void */ public function register() { + $self = $this; + - $this->app->bind('captcha', function() + $this->app->bind('captcha', function() use ($self) ? ++++++++++++ { return new Captcha( - $this->app['view'], ? --- + $self->app['view'], ? +++ - $this->app['config'], ? --- + $self->app['config'], ? +++ - $this->app['session.store'], ? --- + $self->app['session.store'], ? +++ new Helpers ); }); } }
10
0.37037
6
4
85190b166740863e96b65cca09e44e0dda801c46
app/controllers/metadata_values_controller.rb
app/controllers/metadata_values_controller.rb
class MetadataValuesController < ApplicationController def index raise "Corpus ID is missing!" unless received_id_for?(:corpus) render json: MetadataValue .joins(:metadata_category) .where('metadata_categories.corpus_id = ?', params[:corpus_id]) end end
class MetadataValuesController < ApplicationController def index raise "Corpus ID is missing!" unless received_id_for?(:corpus) render json: MetadataValue .joins(:metadata_category) .where(metadata_categories: {corpus_id: params[:corpus_id]}) end end
Use hash syntax for query conditions
Use hash syntax for query conditions
Ruby
mit
textlab/rglossa,textlab/glossa,textlab/glossa,textlab/glossa,textlab/rglossa,textlab/rglossa,textlab/rglossa,textlab/glossa,textlab/glossa,textlab/rglossa
ruby
## Code Before: class MetadataValuesController < ApplicationController def index raise "Corpus ID is missing!" unless received_id_for?(:corpus) render json: MetadataValue .joins(:metadata_category) .where('metadata_categories.corpus_id = ?', params[:corpus_id]) end end ## Instruction: Use hash syntax for query conditions ## Code After: class MetadataValuesController < ApplicationController def index raise "Corpus ID is missing!" unless received_id_for?(:corpus) render json: MetadataValue .joins(:metadata_category) .where(metadata_categories: {corpus_id: params[:corpus_id]}) end end
class MetadataValuesController < ApplicationController def index raise "Corpus ID is missing!" unless received_id_for?(:corpus) render json: MetadataValue .joins(:metadata_category) - .where('metadata_categories.corpus_id = ?', params[:corpus_id]) ? - ^ ^^^^^^ + .where(metadata_categories: {corpus_id: params[:corpus_id]}) ? ^^^ ^ + end end
2
0.181818
1
1
ffdfe96d4519193e32ca5ce07b3d97e7cf46eee0
.travis.yml
.travis.yml
language: ruby rvm: - 2.2.0 before_script: - cp config/database.travis.yml config/database.yml - cp config/initializers/devise.rb.template config/initializers/devise.rb - cp config/autogradeConfig.rb.template config/autogradeConfig.rb - mkdir attachments/ tmp/ - bundle install --quiet - RAILS_ENV=test bundle exec rails generate devise:install --skip --quiet - RAILS_ENV=test bundle exec rake db:create --trace - RAILS_ENV=test bundle exec rake db:setup --trace - RAILS_ENV=test bundle exec rake autolab:populate script: - RAILS_ENV=test CODECLIMATE_REPO_TOKEN=d37a8b9e09642cb73cfcf4ecfb4115fc3d6a55a7714110187ac59856ae4ab5ad bundle exec rspec notifications: slack: secure: GXcycaSBFaOYI6Ge0vhqCYK1xxixwjASOMkV2bkfE6PNIGkDEEQdTpOkohPGoKuz2W9KCGrXC38sbu4npMtonz0/sISydG+g7V33XkLqPaW8oUcdYhwJyBUEB/Ds17U/FJ4IhT9oOrhl17Sm0rm92Mhu6O2eeZYAclGqJgZNLvg=
language: ruby rvm: - 2.2.0 before_script: - cp config/database.travis.yml config/database.yml - cp config/initializers/devise.rb.template config/initializers/devise.rb - cp config/autogradeConfig.rb.template config/autogradeConfig.rb - mkdir attachments/ tmp/ - bundle install --quiet - RAILS_ENV=test bundle exec rails generate devise:install --skip --quiet - RAILS_ENV=test bundle exec rake db:create --trace - RAILS_ENV=test bundle exec rake db:setup --trace - RAILS_ENV=test bundle exec rake autolab:populate script: - RAILS_ENV=test CODECLIMATE_REPO_TOKEN=d37a8b9e09642cb73cfcf4ecfb4115fc3d6a55a7714110187ac59856ae4ab5ad bundle exec rspec ./spec/features/ notifications: slack: secure: GXcycaSBFaOYI6Ge0vhqCYK1xxixwjASOMkV2bkfE6PNIGkDEEQdTpOkohPGoKuz2W9KCGrXC38sbu4npMtonz0/sISydG+g7V33XkLqPaW8oUcdYhwJyBUEB/Ds17U/FJ4IhT9oOrhl17Sm0rm92Mhu6O2eeZYAclGqJgZNLvg=
Include minimal tests for demo.
Include minimal tests for demo.
YAML
apache-2.0
autolab/Autolab,cagdasbas/Autolab,yunfanye/Autolab,autolab/Autolab,yunfanye/Autolab,wcyz666/Autolab,autolab/Autolab,jez/Autolab,anusornc/Autolab,AEgan/Autolab,kk262777/Autolab,AEgan/Autolab,yunfanye/Autolab,yunfanye/Autolab,cagdasbas/Autolab,AEgan/Autolab,kk262777/Autolab,kk262777/Autolab,kk262777/Autolab,cg2v/Autolab,jez/Autolab,cagdasbas/Autolab,wcyz666/Autolab,kk262777/Autolab,AEgan/Autolab,AEgan/Autolab,anusornc/Autolab,autolab/Autolab,cagdasbas/Autolab,cg2v/Autolab,jez/Autolab,anusornc/Autolab,jez/Autolab,autolab/Autolab,cg2v/Autolab,cg2v/Autolab,yunfanye/Autolab,wcyz666/Autolab,wcyz666/Autolab,jez/Autolab,wcyz666/Autolab,cagdasbas/Autolab,anusornc/Autolab,cg2v/Autolab,AEgan/Autolab,cg2v/Autolab,anusornc/Autolab,kk262777/Autolab,yunfanye/Autolab,cagdasbas/Autolab,autolab/Autolab
yaml
## Code Before: language: ruby rvm: - 2.2.0 before_script: - cp config/database.travis.yml config/database.yml - cp config/initializers/devise.rb.template config/initializers/devise.rb - cp config/autogradeConfig.rb.template config/autogradeConfig.rb - mkdir attachments/ tmp/ - bundle install --quiet - RAILS_ENV=test bundle exec rails generate devise:install --skip --quiet - RAILS_ENV=test bundle exec rake db:create --trace - RAILS_ENV=test bundle exec rake db:setup --trace - RAILS_ENV=test bundle exec rake autolab:populate script: - RAILS_ENV=test CODECLIMATE_REPO_TOKEN=d37a8b9e09642cb73cfcf4ecfb4115fc3d6a55a7714110187ac59856ae4ab5ad bundle exec rspec notifications: slack: secure: GXcycaSBFaOYI6Ge0vhqCYK1xxixwjASOMkV2bkfE6PNIGkDEEQdTpOkohPGoKuz2W9KCGrXC38sbu4npMtonz0/sISydG+g7V33XkLqPaW8oUcdYhwJyBUEB/Ds17U/FJ4IhT9oOrhl17Sm0rm92Mhu6O2eeZYAclGqJgZNLvg= ## Instruction: Include minimal tests for demo. ## Code After: language: ruby rvm: - 2.2.0 before_script: - cp config/database.travis.yml config/database.yml - cp config/initializers/devise.rb.template config/initializers/devise.rb - cp config/autogradeConfig.rb.template config/autogradeConfig.rb - mkdir attachments/ tmp/ - bundle install --quiet - RAILS_ENV=test bundle exec rails generate devise:install --skip --quiet - RAILS_ENV=test bundle exec rake db:create --trace - RAILS_ENV=test bundle exec rake db:setup --trace - RAILS_ENV=test bundle exec rake autolab:populate script: - RAILS_ENV=test CODECLIMATE_REPO_TOKEN=d37a8b9e09642cb73cfcf4ecfb4115fc3d6a55a7714110187ac59856ae4ab5ad bundle exec rspec ./spec/features/ notifications: slack: secure: GXcycaSBFaOYI6Ge0vhqCYK1xxixwjASOMkV2bkfE6PNIGkDEEQdTpOkohPGoKuz2W9KCGrXC38sbu4npMtonz0/sISydG+g7V33XkLqPaW8oUcdYhwJyBUEB/Ds17U/FJ4IhT9oOrhl17Sm0rm92Mhu6O2eeZYAclGqJgZNLvg=
language: ruby rvm: - 2.2.0 before_script: - cp config/database.travis.yml config/database.yml - cp config/initializers/devise.rb.template config/initializers/devise.rb - cp config/autogradeConfig.rb.template config/autogradeConfig.rb - mkdir attachments/ tmp/ - bundle install --quiet - RAILS_ENV=test bundle exec rails generate devise:install --skip --quiet - RAILS_ENV=test bundle exec rake db:create --trace - RAILS_ENV=test bundle exec rake db:setup --trace - RAILS_ENV=test bundle exec rake autolab:populate script: - - RAILS_ENV=test CODECLIMATE_REPO_TOKEN=d37a8b9e09642cb73cfcf4ecfb4115fc3d6a55a7714110187ac59856ae4ab5ad + - RAILS_ENV=test CODECLIMATE_REPO_TOKEN=d37a8b9e09642cb73cfcf4ecfb4115fc3d6a55a7714110187ac59856ae4ab5ad bundle exec rspec ./spec/features/ ? ++++++++++++++++++++++++++++++++++++ - bundle exec rspec notifications: slack: secure: GXcycaSBFaOYI6Ge0vhqCYK1xxixwjASOMkV2bkfE6PNIGkDEEQdTpOkohPGoKuz2W9KCGrXC38sbu4npMtonz0/sISydG+g7V33XkLqPaW8oUcdYhwJyBUEB/Ds17U/FJ4IhT9oOrhl17Sm0rm92Mhu6O2eeZYAclGqJgZNLvg=
3
0.157895
1
2
61a308dfe15ecf189599f60603f50c3c0d33f019
src/main/java/com/kiselev/reflection/ui/impl/exception/ExceptionUtils.java
src/main/java/com/kiselev/reflection/ui/impl/exception/ExceptionUtils.java
package com.kiselev.reflection.ui.impl.exception; import java.lang.reflect.Executable; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; public class ExceptionUtils { public String getExceptions(Executable executable) { String exceptions = ""; List<String> exceptionTypes = new ArrayList<>(); for (Type type : executable.getGenericExceptionTypes()) { exceptionTypes.add(Class.class.cast(type).getSimpleName()); } if (!exceptionTypes.isEmpty()) { exceptions += " throws " + String.join(", ", exceptionTypes); } return exceptions; } }
package com.kiselev.reflection.ui.impl.exception; import com.kiselev.reflection.ui.impl.generic.GenericsUtils; import java.lang.reflect.Executable; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; public class ExceptionUtils { public String getExceptions(Executable executable) { String exceptions = ""; List<String> exceptionTypes = new ArrayList<>(); for (Type type : executable.getGenericExceptionTypes()) { exceptionTypes.add(new GenericsUtils().resolveType(type)); } if (!exceptionTypes.isEmpty()) { exceptions += " throws " + String.join(", ", exceptionTypes); } return exceptions; } }
Revert another one missed fix
Revert another one missed fix
Java
mit
vadim8kiselev/reflection-ui
java
## Code Before: package com.kiselev.reflection.ui.impl.exception; import java.lang.reflect.Executable; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; public class ExceptionUtils { public String getExceptions(Executable executable) { String exceptions = ""; List<String> exceptionTypes = new ArrayList<>(); for (Type type : executable.getGenericExceptionTypes()) { exceptionTypes.add(Class.class.cast(type).getSimpleName()); } if (!exceptionTypes.isEmpty()) { exceptions += " throws " + String.join(", ", exceptionTypes); } return exceptions; } } ## Instruction: Revert another one missed fix ## Code After: package com.kiselev.reflection.ui.impl.exception; import com.kiselev.reflection.ui.impl.generic.GenericsUtils; import java.lang.reflect.Executable; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; public class ExceptionUtils { public String getExceptions(Executable executable) { String exceptions = ""; List<String> exceptionTypes = new ArrayList<>(); for (Type type : executable.getGenericExceptionTypes()) { exceptionTypes.add(new GenericsUtils().resolveType(type)); } if (!exceptionTypes.isEmpty()) { exceptions += " throws " + String.join(", ", exceptionTypes); } return exceptions; } }
package com.kiselev.reflection.ui.impl.exception; + + import com.kiselev.reflection.ui.impl.generic.GenericsUtils; import java.lang.reflect.Executable; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.List; public class ExceptionUtils { public String getExceptions(Executable executable) { String exceptions = ""; List<String> exceptionTypes = new ArrayList<>(); for (Type type : executable.getGenericExceptionTypes()) { - exceptionTypes.add(Class.class.cast(type).getSimpleName()); + exceptionTypes.add(new GenericsUtils().resolveType(type)); } if (!exceptionTypes.isEmpty()) { exceptions += " throws " + String.join(", ", exceptionTypes); } return exceptions; } }
4
0.16
3
1
b9ec96ee77f585701d5f42fd095a659a0de35169
README.md
README.md
Personal Website Project for Deep Dive Coding Bootcamp ##PWP Milestone 1 Feedback Great job on Milestone 1. Your code looks good, your project is set up correctly, and your purpose, audience and goals are well defined. Your Milestone 1 passes at [Tier IV](https://bootcamp-coders.cnm.edu/projects/personal/rubric/) ###To Do Only one small thing: your final paragraph should be wrapped in with <p> tag. Your code looks great overall - nice work!
Personal Website Project for Deep Dive Coding Bootcamp ##PWP Milestone 1 Feedback Great job on Milestone 1. Your code looks good, your project is set up correctly, and your purpose, audience and goals are well defined. Your Milestone 1 passes at [Tier IV](https://bootcamp-coders.cnm.edu/projects/personal/rubric/) ###To Do Only one small thing: your final paragraph should be wrapped in with a &lt;p&gt; tag. Your code looks great overall - nice work!
Fix Typo - Milestone 1 feedback
Fix Typo - Milestone 1 feedback
Markdown
apache-2.0
jmsaul/saul-pwpsite
markdown
## Code Before: Personal Website Project for Deep Dive Coding Bootcamp ##PWP Milestone 1 Feedback Great job on Milestone 1. Your code looks good, your project is set up correctly, and your purpose, audience and goals are well defined. Your Milestone 1 passes at [Tier IV](https://bootcamp-coders.cnm.edu/projects/personal/rubric/) ###To Do Only one small thing: your final paragraph should be wrapped in with <p> tag. Your code looks great overall - nice work! ## Instruction: Fix Typo - Milestone 1 feedback ## Code After: Personal Website Project for Deep Dive Coding Bootcamp ##PWP Milestone 1 Feedback Great job on Milestone 1. Your code looks good, your project is set up correctly, and your purpose, audience and goals are well defined. Your Milestone 1 passes at [Tier IV](https://bootcamp-coders.cnm.edu/projects/personal/rubric/) ###To Do Only one small thing: your final paragraph should be wrapped in with a &lt;p&gt; tag. Your code looks great overall - nice work!
Personal Website Project for Deep Dive Coding Bootcamp ##PWP Milestone 1 Feedback Great job on Milestone 1. Your code looks good, your project is set up correctly, and your purpose, audience and goals are well defined. Your Milestone 1 passes at [Tier IV](https://bootcamp-coders.cnm.edu/projects/personal/rubric/) ###To Do - Only one small thing: your final paragraph should be wrapped in with <p> tag. Your code looks great overall - nice work! ? ^ ^ + Only one small thing: your final paragraph should be wrapped in with a &lt;p&gt; tag. Your code looks great overall - nice work! ? ^^^^^^ ^^^^
2
0.285714
1
1
ae19ea22af4c7dd62768c23e128ef5dbb2729c61
52-in-52.js
52-in-52.js
var app = require('express').createServer(); var sys = require('sys'); var client = require("./lib/redis-client").createClient(); var books = require("./books"); app.listen(8124); app.get('/', function(req, res){ res.send('hello world'); }); // List All Users app.get('/users', function(req, res){ var userlist = "<h1>User List</h1><br />" users.listUsers( client, function(name) {userlist+=String(name+"<br />")}, function() {res.send(userlist)} ); }); // List All Books app.get('/books', function(req, res){ var booklist = "<h1>Book List</h1><br />" books.listBooks(client, function(title) {booklist+=String(title+"<br />")}, function() {res.send(booklist)} ); });
var app = require('express').createServer(); var sys = require('sys'); var books = require("./books"); var users = require("./users"); var client = require("./lib/redis-client").createClient(); app.listen(8124); app.get('/', function(req, res){ res.send('hello world'); }); // List All Users app.get('/users', function(req, res){ var userlist = "<h1>User List</h1><br />" users.listUsers( client, function(name) {userlist+=String(name+"<br />")}, function() {res.send(userlist)} ); }); // List All Books app.get('/books', function(req, res){ var booklist = "<h1>Book List</h1><br />" books.listBooks(client, function(title) {booklist+=String(title+"<br />")}, function() {res.send(booklist)} ); });
Add Users library to main script.
Add Users library to main script.
JavaScript
bsd-3-clause
scsibug/read52,scsibug/read52
javascript
## Code Before: var app = require('express').createServer(); var sys = require('sys'); var client = require("./lib/redis-client").createClient(); var books = require("./books"); app.listen(8124); app.get('/', function(req, res){ res.send('hello world'); }); // List All Users app.get('/users', function(req, res){ var userlist = "<h1>User List</h1><br />" users.listUsers( client, function(name) {userlist+=String(name+"<br />")}, function() {res.send(userlist)} ); }); // List All Books app.get('/books', function(req, res){ var booklist = "<h1>Book List</h1><br />" books.listBooks(client, function(title) {booklist+=String(title+"<br />")}, function() {res.send(booklist)} ); }); ## Instruction: Add Users library to main script. ## Code After: var app = require('express').createServer(); var sys = require('sys'); var books = require("./books"); var users = require("./users"); var client = require("./lib/redis-client").createClient(); app.listen(8124); app.get('/', function(req, res){ res.send('hello world'); }); // List All Users app.get('/users', function(req, res){ var userlist = "<h1>User List</h1><br />" users.listUsers( client, function(name) {userlist+=String(name+"<br />")}, function() {res.send(userlist)} ); }); // List All Books app.get('/books', function(req, res){ var booklist = "<h1>Book List</h1><br />" books.listBooks(client, function(title) {booklist+=String(title+"<br />")}, function() {res.send(booklist)} ); });
var app = require('express').createServer(); var sys = require('sys'); + var books = require("./books"); + var users = require("./users"); var client = require("./lib/redis-client").createClient(); - var books = require("./books"); app.listen(8124); app.get('/', function(req, res){ res.send('hello world'); }); // List All Users app.get('/users', function(req, res){ var userlist = "<h1>User List</h1><br />" users.listUsers( client, function(name) {userlist+=String(name+"<br />")}, function() {res.send(userlist)} ); }); // List All Books app.get('/books', function(req, res){ var booklist = "<h1>Book List</h1><br />" books.listBooks(client, function(title) {booklist+=String(title+"<br />")}, function() {res.send(booklist)} ); }); -
4
0.129032
2
2
4242acdca44021074efb03f95f023895f4c23d7d
tools/rest_api.rb
tools/rest_api.rb
require 'bundler/setup' require 'pathname' gem_dir = Pathname.new(Bundler.locked_gems.specs.select { |g| g.name == "manageiq-api" }.first.gem_dir) load gem_dir.join('exe', 'manageiq-api')
Dir.chdir(File.join(__dir__, "..")) { require 'bundler/setup' } require 'pathname' gem_dir = Pathname.new(Bundler.locked_gems.specs.select { |g| g.name == "manageiq-api" }.first.gem_dir) load gem_dir.join('exe', 'manageiq-api')
Allow the wrapper script to be invoked outside the app directory.
Allow the wrapper script to be invoked outside the app directory.
Ruby
apache-2.0
tinaafitz/manageiq,josejulio/manageiq,jameswnl/manageiq,mresti/manageiq,aufi/manageiq,andyvesel/manageiq,skateman/manageiq,ailisp/manageiq,juliancheal/manageiq,jameswnl/manageiq,d-m-u/manageiq,pkomanek/manageiq,djberg96/manageiq,billfitzgerald0120/manageiq,jameswnl/manageiq,djberg96/manageiq,aufi/manageiq,syncrou/manageiq,agrare/manageiq,billfitzgerald0120/manageiq,jvlcek/manageiq,jvlcek/manageiq,andyvesel/manageiq,lpichler/manageiq,borod108/manageiq,andyvesel/manageiq,tzumainn/manageiq,NickLaMuro/manageiq,romanblanco/manageiq,chessbyte/manageiq,billfitzgerald0120/manageiq,josejulio/manageiq,hstastna/manageiq,ManageIQ/manageiq,juliancheal/manageiq,agrare/manageiq,lpichler/manageiq,yaacov/manageiq,tinaafitz/manageiq,ilackarms/manageiq,tinaafitz/manageiq,lpichler/manageiq,andyvesel/manageiq,jntullo/manageiq,aufi/manageiq,djberg96/manageiq,jvlcek/manageiq,ManageIQ/manageiq,branic/manageiq,skateman/manageiq,durandom/manageiq,mzazrivec/manageiq,gerikis/manageiq,juliancheal/manageiq,yaacov/manageiq,syncrou/manageiq,jrafanie/manageiq,jntullo/manageiq,mresti/manageiq,syncrou/manageiq,jntullo/manageiq,jntullo/manageiq,tinaafitz/manageiq,chessbyte/manageiq,kbrock/manageiq,josejulio/manageiq,NickLaMuro/manageiq,billfitzgerald0120/manageiq,josejulio/manageiq,skateman/manageiq,romanblanco/manageiq,mkanoor/manageiq,agrare/manageiq,pkomanek/manageiq,yaacov/manageiq,branic/manageiq,durandom/manageiq,mzazrivec/manageiq,jrafanie/manageiq,israel-hdez/manageiq,chessbyte/manageiq,jvlcek/manageiq,djberg96/manageiq,hstastna/manageiq,borod108/manageiq,mkanoor/manageiq,hstastna/manageiq,branic/manageiq,tzumainn/manageiq,kbrock/manageiq,israel-hdez/manageiq,mkanoor/manageiq,agrare/manageiq,ilackarms/manageiq,juliancheal/manageiq,jrafanie/manageiq,skateman/manageiq,kbrock/manageiq,gerikis/manageiq,kbrock/manageiq,ailisp/manageiq,gmcculloug/manageiq,lpichler/manageiq,israel-hdez/manageiq,jameswnl/manageiq,israel-hdez/manageiq,d-m-u/manageiq,ailisp/manageiq,gmcculloug/manageiq,d-m-u/manageiq,gmcculloug/manageiq,borod108/manageiq,pkomanek/manageiq,tzumainn/manageiq,NickLaMuro/manageiq,gerikis/manageiq,aufi/manageiq,durandom/manageiq,branic/manageiq,chessbyte/manageiq,ManageIQ/manageiq,yaacov/manageiq,durandom/manageiq,ailisp/manageiq,romanblanco/manageiq,mzazrivec/manageiq,borod108/manageiq,mresti/manageiq,gerikis/manageiq,syncrou/manageiq,jrafanie/manageiq,romanblanco/manageiq,pkomanek/manageiq,NickLaMuro/manageiq,tzumainn/manageiq,gmcculloug/manageiq,ilackarms/manageiq,d-m-u/manageiq,hstastna/manageiq,mzazrivec/manageiq,ManageIQ/manageiq,mresti/manageiq,mkanoor/manageiq,ilackarms/manageiq
ruby
## Code Before: require 'bundler/setup' require 'pathname' gem_dir = Pathname.new(Bundler.locked_gems.specs.select { |g| g.name == "manageiq-api" }.first.gem_dir) load gem_dir.join('exe', 'manageiq-api') ## Instruction: Allow the wrapper script to be invoked outside the app directory. ## Code After: Dir.chdir(File.join(__dir__, "..")) { require 'bundler/setup' } require 'pathname' gem_dir = Pathname.new(Bundler.locked_gems.specs.select { |g| g.name == "manageiq-api" }.first.gem_dir) load gem_dir.join('exe', 'manageiq-api')
- require 'bundler/setup' + Dir.chdir(File.join(__dir__, "..")) { require 'bundler/setup' } require 'pathname' gem_dir = Pathname.new(Bundler.locked_gems.specs.select { |g| g.name == "manageiq-api" }.first.gem_dir) load gem_dir.join('exe', 'manageiq-api')
2
0.4
1
1
fcb25f40c436f0ded34de4eedb58590c9a2ff152
test/build_mon/test/vso_api.clj
test/build_mon/test/vso_api.clj
(ns build-mon.test.vso-api (:require [midje.sweet :refer :all] [clojure.java.io :as io] [build-mon.vso-api :as api])) (fact "vso-api-get-fn wraps an api token and returns a function which can be called with just a URL" (let [result (api/vso-api-get-fn "SOME API TOKEN")] (fn? result) => truthy (result "NOT A REAL URL") => (throws java.net.MalformedURLException))) (fact "vso-api-fns returns a map of the exposed functions" (let [get-fn (fn [url] "API RESPONSE") result (api/vso-api-fns get-fn "ACCOUNT_NAME" "PROJECT_NAME")] (fn? (:retrieve-build-info result)) => truthy (fn? (:retrieve-build-definitions result)) => truthy))
(ns build-mon.test.vso-api (:require [midje.sweet :refer :all] [clojure.java.io :as io] [build-mon.vso-api :as api])) (def account "VSO_ACCOUNT_NAME") (def project "VSO_PROJECT_NAME") (def token "VSO_API_TOKEN") (fact "vso-api-get-fn wraps an api token and returns a function which makes a HTTP GET request on a url" (let [result (api/vso-api-get-fn token)] (fn? result) => truthy (result "NOT A REAL URL") => (throws java.net.MalformedURLException))) (fact "vso-api-fns returns a map of the exposed functions" (let [get-fn (fn [url] "API RESPONSE") result (api/vso-api-fns get-fn account project)] (fn? (:retrieve-build-info result)) => truthy (fn? (:retrieve-build-definitions result)) => truthy)) (defn get-fn-stub-request [stubbed-url response] (fn [url] (when (= stubbed-url url) response))) (fact "retrieve-build-definitions retrieves build definitions" (let [expected-url "https://VSO_ACCOUNT_NAME.visualstudio.com/defaultcollection/VSO_PROJECT_NAME/_apis/build/definitions?api-version=2.0" stub-json-body "{\"count\":2,\"value\":[{\"A_BUILD_DEFINITION_KEY\": \"A_VALUE\"}, {\"ANOTHER_BUILD_DEFINITION_KEY\": \"ANOTHER_VALUE\"}]}" stub-response {:status 200 :body stub-json-body} get-fn-stubbed (get-fn-stub-request expected-url stub-response) vso-api (api/vso-api-fns get-fn-stubbed account project)] ((:retrieve-build-definitions vso-api)) => [{:A_BUILD_DEFINITION_KEY "A_VALUE"} {:ANOTHER_BUILD_DEFINITION_KEY "ANOTHER_VALUE"}]))
Test retrieve-build-definitions function stubbing the api request
Test retrieve-build-definitions function stubbing the api request
Clojure
epl-1.0
elrob/build-mon
clojure
## Code Before: (ns build-mon.test.vso-api (:require [midje.sweet :refer :all] [clojure.java.io :as io] [build-mon.vso-api :as api])) (fact "vso-api-get-fn wraps an api token and returns a function which can be called with just a URL" (let [result (api/vso-api-get-fn "SOME API TOKEN")] (fn? result) => truthy (result "NOT A REAL URL") => (throws java.net.MalformedURLException))) (fact "vso-api-fns returns a map of the exposed functions" (let [get-fn (fn [url] "API RESPONSE") result (api/vso-api-fns get-fn "ACCOUNT_NAME" "PROJECT_NAME")] (fn? (:retrieve-build-info result)) => truthy (fn? (:retrieve-build-definitions result)) => truthy)) ## Instruction: Test retrieve-build-definitions function stubbing the api request ## Code After: (ns build-mon.test.vso-api (:require [midje.sweet :refer :all] [clojure.java.io :as io] [build-mon.vso-api :as api])) (def account "VSO_ACCOUNT_NAME") (def project "VSO_PROJECT_NAME") (def token "VSO_API_TOKEN") (fact "vso-api-get-fn wraps an api token and returns a function which makes a HTTP GET request on a url" (let [result (api/vso-api-get-fn token)] (fn? result) => truthy (result "NOT A REAL URL") => (throws java.net.MalformedURLException))) (fact "vso-api-fns returns a map of the exposed functions" (let [get-fn (fn [url] "API RESPONSE") result (api/vso-api-fns get-fn account project)] (fn? (:retrieve-build-info result)) => truthy (fn? (:retrieve-build-definitions result)) => truthy)) (defn get-fn-stub-request [stubbed-url response] (fn [url] (when (= stubbed-url url) response))) (fact "retrieve-build-definitions retrieves build definitions" (let [expected-url "https://VSO_ACCOUNT_NAME.visualstudio.com/defaultcollection/VSO_PROJECT_NAME/_apis/build/definitions?api-version=2.0" stub-json-body "{\"count\":2,\"value\":[{\"A_BUILD_DEFINITION_KEY\": \"A_VALUE\"}, {\"ANOTHER_BUILD_DEFINITION_KEY\": \"ANOTHER_VALUE\"}]}" stub-response {:status 200 :body stub-json-body} get-fn-stubbed (get-fn-stub-request expected-url stub-response) vso-api (api/vso-api-fns get-fn-stubbed account project)] ((:retrieve-build-definitions vso-api)) => [{:A_BUILD_DEFINITION_KEY "A_VALUE"} {:ANOTHER_BUILD_DEFINITION_KEY "ANOTHER_VALUE"}]))
(ns build-mon.test.vso-api (:require [midje.sweet :refer :all] [clojure.java.io :as io] [build-mon.vso-api :as api])) + (def account "VSO_ACCOUNT_NAME") + (def project "VSO_PROJECT_NAME") + (def token "VSO_API_TOKEN") + - (fact "vso-api-get-fn wraps an api token and returns a function which can be called with just a URL" ? ^ ^ ^ ^^^^^ --------- ^^^ + (fact "vso-api-get-fn wraps an api token and returns a function which makes a HTTP GET request on a url" ? ^ ^^^ ^^^^^^^^^^^^ ^^ +++ ^^^ - (let [result (api/vso-api-get-fn "SOME API TOKEN")] ? ^^^^^^^^^^^^^^^^ + (let [result (api/vso-api-get-fn token)] ? ^^^^^ (fn? result) => truthy (result "NOT A REAL URL") => (throws java.net.MalformedURLException))) (fact "vso-api-fns returns a map of the exposed functions" (let [get-fn (fn [url] "API RESPONSE") - result (api/vso-api-fns get-fn "ACCOUNT_NAME" "PROJECT_NAME")] + result (api/vso-api-fns get-fn account project)] (fn? (:retrieve-build-info result)) => truthy (fn? (:retrieve-build-definitions result)) => truthy)) + + (defn get-fn-stub-request [stubbed-url response] + (fn [url] + (when (= stubbed-url url) response))) + + (fact "retrieve-build-definitions retrieves build definitions" + (let [expected-url "https://VSO_ACCOUNT_NAME.visualstudio.com/defaultcollection/VSO_PROJECT_NAME/_apis/build/definitions?api-version=2.0" + stub-json-body "{\"count\":2,\"value\":[{\"A_BUILD_DEFINITION_KEY\": \"A_VALUE\"}, + {\"ANOTHER_BUILD_DEFINITION_KEY\": \"ANOTHER_VALUE\"}]}" + stub-response {:status 200 :body stub-json-body} + get-fn-stubbed (get-fn-stub-request expected-url stub-response) + vso-api (api/vso-api-fns get-fn-stubbed account project)] + ((:retrieve-build-definitions vso-api)) => [{:A_BUILD_DEFINITION_KEY "A_VALUE"} + {:ANOTHER_BUILD_DEFINITION_KEY "ANOTHER_VALUE"}]))
24
1.6
21
3
15e3b5dff85b437b33eec353826ea14d3708a8f5
app/assets/scss/_layout.scss
app/assets/scss/_layout.scss
@import "grid_layout"; @import "colours"; #global-header-bar .header-bar { background: $error-colour; } .page-container { @extend %site-width-container; padding-bottom: $gutter * 2; } .grid-row { @extend %grid-row; clear: both; } .third-column { @include grid-column(1/3); } .two-third-column { @include grid-column(2/3); } .page-section { margin-bottom: $gutter; }
@import "grid_layout"; @import "colours"; #global-header-bar { background: $red; } .page-container { @extend %site-width-container; padding-bottom: $gutter * 2; } .grid-row { @extend %grid-row; clear: both; } .third-column { @include grid-column(1/3); } .two-third-column { @include grid-column(2/3); } .page-section { margin-bottom: $gutter; }
Bring back the red bar
Bring back the red bar
SCSS
mit
alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend
scss
## Code Before: @import "grid_layout"; @import "colours"; #global-header-bar .header-bar { background: $error-colour; } .page-container { @extend %site-width-container; padding-bottom: $gutter * 2; } .grid-row { @extend %grid-row; clear: both; } .third-column { @include grid-column(1/3); } .two-third-column { @include grid-column(2/3); } .page-section { margin-bottom: $gutter; } ## Instruction: Bring back the red bar ## Code After: @import "grid_layout"; @import "colours"; #global-header-bar { background: $red; } .page-container { @extend %site-width-container; padding-bottom: $gutter * 2; } .grid-row { @extend %grid-row; clear: both; } .third-column { @include grid-column(1/3); } .two-third-column { @include grid-column(2/3); } .page-section { margin-bottom: $gutter; }
@import "grid_layout"; @import "colours"; - #global-header-bar .header-bar { ? ------------ + #global-header-bar { - background: $error-colour; + background: $red; } .page-container { @extend %site-width-container; padding-bottom: $gutter * 2; } .grid-row { @extend %grid-row; clear: both; } .third-column { @include grid-column(1/3); } .two-third-column { @include grid-column(2/3); } .page-section { margin-bottom: $gutter; }
4
0.142857
2
2
fbdd73f53b61f5309a41a5004a4ce08a37ce94ec
config/application.rb
config/application.rb
require File.expand_path("../boot", __FILE__) require File.expand_path("lib/redirect_to_configuration") require "rails/all" Bundler.require(:default, Rails.env) module Houndapp class Application < Rails::Application config.autoload_paths += %W(#{config.root}/lib) config.encoding = "utf-8" config.filter_parameters += [:password] config.active_support.escape_html_entities_in_json = true config.active_job.queue_adapter = :resque config.middleware.insert_before Rack::ETag, Rack::Deflater config.middleware.insert_before( Rack::ETag, RedirectToConfiguration, ) config.exceptions_app = routes config.react.jsx_transform_options = { optional: ["es7.classProperties"], } config.react.addons = true end end
require File.expand_path("../boot", __FILE__) require File.expand_path("lib/redirect_to_configuration") require "rails/all" Bundler.require(:default, Rails.env) module Houndapp class Application < Rails::Application config.autoload_paths += %W(#{config.root}/lib) config.eager_load_paths += %W(#{config.root}/lib) config.encoding = "utf-8" config.filter_parameters += [:password] config.active_support.escape_html_entities_in_json = true config.active_job.queue_adapter = :resque config.middleware.insert_before Rack::ETag, Rack::Deflater config.middleware.insert_before( Rack::ETag, RedirectToConfiguration, ) config.exceptions_app = routes config.react.jsx_transform_options = { optional: ["es7.classProperties"], } config.react.addons = true end end
Add lib to eagerload paths
Add lib to eagerload paths This fixes lib files not being available in Rails 5 production without explicitly requiring them. This comes with the caveat that everything in lib will be loaded when the application boots, but in our case that's just a few rake tasks so we aren't too concerned about it for the convenience this provides.
Ruby
mit
houndci/hound,thoughtbot/hound,thoughtbot/hound,houndci/hound,houndci/hound,thoughtbot/hound,houndci/hound,thoughtbot/hound
ruby
## Code Before: require File.expand_path("../boot", __FILE__) require File.expand_path("lib/redirect_to_configuration") require "rails/all" Bundler.require(:default, Rails.env) module Houndapp class Application < Rails::Application config.autoload_paths += %W(#{config.root}/lib) config.encoding = "utf-8" config.filter_parameters += [:password] config.active_support.escape_html_entities_in_json = true config.active_job.queue_adapter = :resque config.middleware.insert_before Rack::ETag, Rack::Deflater config.middleware.insert_before( Rack::ETag, RedirectToConfiguration, ) config.exceptions_app = routes config.react.jsx_transform_options = { optional: ["es7.classProperties"], } config.react.addons = true end end ## Instruction: Add lib to eagerload paths This fixes lib files not being available in Rails 5 production without explicitly requiring them. This comes with the caveat that everything in lib will be loaded when the application boots, but in our case that's just a few rake tasks so we aren't too concerned about it for the convenience this provides. ## Code After: require File.expand_path("../boot", __FILE__) require File.expand_path("lib/redirect_to_configuration") require "rails/all" Bundler.require(:default, Rails.env) module Houndapp class Application < Rails::Application config.autoload_paths += %W(#{config.root}/lib) config.eager_load_paths += %W(#{config.root}/lib) config.encoding = "utf-8" config.filter_parameters += [:password] config.active_support.escape_html_entities_in_json = true config.active_job.queue_adapter = :resque config.middleware.insert_before Rack::ETag, Rack::Deflater config.middleware.insert_before( Rack::ETag, RedirectToConfiguration, ) config.exceptions_app = routes config.react.jsx_transform_options = { optional: ["es7.classProperties"], } config.react.addons = true end end
require File.expand_path("../boot", __FILE__) require File.expand_path("lib/redirect_to_configuration") require "rails/all" Bundler.require(:default, Rails.env) module Houndapp class Application < Rails::Application config.autoload_paths += %W(#{config.root}/lib) + config.eager_load_paths += %W(#{config.root}/lib) config.encoding = "utf-8" config.filter_parameters += [:password] config.active_support.escape_html_entities_in_json = true config.active_job.queue_adapter = :resque config.middleware.insert_before Rack::ETag, Rack::Deflater config.middleware.insert_before( Rack::ETag, RedirectToConfiguration, ) config.exceptions_app = routes config.react.jsx_transform_options = { optional: ["es7.classProperties"], } config.react.addons = true end end
1
0.037037
1
0
bf7d7e48c51c2c081f41113d3f338f2012810c72
entries/templates/entries/entry_add.html
entries/templates/entries/entry_add.html
{% extends 'entries/competition_detail.html' %} {% block competition_content %} <form method="POST" action=""> {% csrf_token %} {{ form.as_p }} <input type="submit"> </form> {% endblock %}
{% extends 'entries/competition_detail.html' %} {% block competition_content %} <form method="POST" action=""> {% csrf_token %} {{ form.as_p }} <input type="submit"> </form> <hr> <form> <p><input type="search" placeholder="Search" autofocus="true"></input></p> <table> <thead> <tr> <th>Name</th> <th>Club</th> <th>Bowstyle</th> <th>Rounds</th> <th>Age</th> <th>Novice</th> </tr> </thead> <tbody> <tr> <td><a class="add">New archer</a></td> </tr> <tr> <td>Marc Tamlyn</td> <td><a class="edit">Oxford Archers</a></td> <td><a class="edit">Recurve</a></td> <td> <ul> <li>York</li> <li>Hereford</li> <li>Bristol I</li> <li>Bristol II</li> </ul> </td> <td><input type="submit"></td> </tr> </tbody> </table> </form> {% endblock %}
Add a possible layout for new entry add.
Add a possible layout for new entry add.
HTML
bsd-3-clause
mjtamlyn/archery-scoring,mjtamlyn/archery-scoring,mjtamlyn/archery-scoring,mjtamlyn/archery-scoring,mjtamlyn/archery-scoring
html
## Code Before: {% extends 'entries/competition_detail.html' %} {% block competition_content %} <form method="POST" action=""> {% csrf_token %} {{ form.as_p }} <input type="submit"> </form> {% endblock %} ## Instruction: Add a possible layout for new entry add. ## Code After: {% extends 'entries/competition_detail.html' %} {% block competition_content %} <form method="POST" action=""> {% csrf_token %} {{ form.as_p }} <input type="submit"> </form> <hr> <form> <p><input type="search" placeholder="Search" autofocus="true"></input></p> <table> <thead> <tr> <th>Name</th> <th>Club</th> <th>Bowstyle</th> <th>Rounds</th> <th>Age</th> <th>Novice</th> </tr> </thead> <tbody> <tr> <td><a class="add">New archer</a></td> </tr> <tr> <td>Marc Tamlyn</td> <td><a class="edit">Oxford Archers</a></td> <td><a class="edit">Recurve</a></td> <td> <ul> <li>York</li> <li>Hereford</li> <li>Bristol I</li> <li>Bristol II</li> </ul> </td> <td><input type="submit"></td> </tr> </tbody> </table> </form> {% endblock %}
{% extends 'entries/competition_detail.html' %} {% block competition_content %} <form method="POST" action=""> {% csrf_token %} {{ form.as_p }} <input type="submit"> </form> + + + + <hr> + + <form> + <p><input type="search" placeholder="Search" autofocus="true"></input></p> + <table> + <thead> + <tr> + <th>Name</th> + <th>Club</th> + <th>Bowstyle</th> + <th>Rounds</th> + <th>Age</th> + <th>Novice</th> + </tr> + </thead> + <tbody> + <tr> + <td><a class="add">New archer</a></td> + </tr> + <tr> + <td>Marc Tamlyn</td> + <td><a class="edit">Oxford Archers</a></td> + <td><a class="edit">Recurve</a></td> + <td> + <ul> + <li>York</li> + <li>Hereford</li> + <li>Bristol I</li> + <li>Bristol II</li> + </ul> + </td> + <td><input type="submit"></td> + </tr> + </tbody> + </table> + </form> {% endblock %}
39
4.333333
39
0
02867a78f72b81742e00ba91c2a7e12ac6642691
.travis.yml
.travis.yml
language: python sudo: false install: - pip install tox script: - tox matrix: include: - python: 3.4 env: TOXENV=py34-django111-sqlite - python: 3.4 env: TOXENV=py34-django20-sqlite - python: 3.5 env: TOXENV=py35-django111-sqlite - python: 3.5 env: TOXENV=py35-django20-sqlite - python: 3.5 env: TOXENV=py35-django21-sqlite - python: 3.6 env: TOXENV=py36-django111-sqlite - python: 3.6 env: TOXENV=py36-django20-sqlite - python: 3.6 env: TOXENV=py36-django21-sqlite - python: 3.6 env: TOXENV=coverage - python: 3.6 env: TOXENV=doctest - python: 3.6 env: TOXENV=style
language: python dist: xenial sudo: false install: - pip install tox script: - tox matrix: include: - python: 3.4 env: TOXENV=py34-django111-sqlite - python: 3.4 env: TOXENV=py34-django20-sqlite - python: 3.5 env: TOXENV=py35-django111-sqlite - python: 3.5 env: TOXENV=py35-django20-sqlite - python: 3.5 env: TOXENV=py35-django21-sqlite - python: 3.5 env: TOXENV=py35-django22-sqlite - python: 3.6 env: TOXENV=py36-django111-sqlite - python: 3.6 env: TOXENV=py36-django20-sqlite - python: 3.6 env: TOXENV=py36-django21-sqlite - python: 3.6 env: TOXENV=py36-django22-sqlite - python: 3.7 env: TOXENV=py37-django22-sqlite - python: 3.6 env: TOXENV=coverage - python: 3.6 env: TOXENV=doctest - python: 3.6 env: TOXENV=style
Test on py3.7 and django2.2
Test on py3.7 and django2.2
YAML
apache-2.0
raphaelm/django-i18nfield
yaml
## Code Before: language: python sudo: false install: - pip install tox script: - tox matrix: include: - python: 3.4 env: TOXENV=py34-django111-sqlite - python: 3.4 env: TOXENV=py34-django20-sqlite - python: 3.5 env: TOXENV=py35-django111-sqlite - python: 3.5 env: TOXENV=py35-django20-sqlite - python: 3.5 env: TOXENV=py35-django21-sqlite - python: 3.6 env: TOXENV=py36-django111-sqlite - python: 3.6 env: TOXENV=py36-django20-sqlite - python: 3.6 env: TOXENV=py36-django21-sqlite - python: 3.6 env: TOXENV=coverage - python: 3.6 env: TOXENV=doctest - python: 3.6 env: TOXENV=style ## Instruction: Test on py3.7 and django2.2 ## Code After: language: python dist: xenial sudo: false install: - pip install tox script: - tox matrix: include: - python: 3.4 env: TOXENV=py34-django111-sqlite - python: 3.4 env: TOXENV=py34-django20-sqlite - python: 3.5 env: TOXENV=py35-django111-sqlite - python: 3.5 env: TOXENV=py35-django20-sqlite - python: 3.5 env: TOXENV=py35-django21-sqlite - python: 3.5 env: TOXENV=py35-django22-sqlite - python: 3.6 env: TOXENV=py36-django111-sqlite - python: 3.6 env: TOXENV=py36-django20-sqlite - python: 3.6 env: TOXENV=py36-django21-sqlite - python: 3.6 env: TOXENV=py36-django22-sqlite - python: 3.7 env: TOXENV=py37-django22-sqlite - python: 3.6 env: TOXENV=coverage - python: 3.6 env: TOXENV=doctest - python: 3.6 env: TOXENV=style
language: python + dist: xenial sudo: false install: - pip install tox script: - tox matrix: include: - python: 3.4 env: TOXENV=py34-django111-sqlite - python: 3.4 env: TOXENV=py34-django20-sqlite - python: 3.5 env: TOXENV=py35-django111-sqlite - python: 3.5 env: TOXENV=py35-django20-sqlite - python: 3.5 env: TOXENV=py35-django21-sqlite + - python: 3.5 + env: TOXENV=py35-django22-sqlite - python: 3.6 env: TOXENV=py36-django111-sqlite - python: 3.6 env: TOXENV=py36-django20-sqlite - python: 3.6 env: TOXENV=py36-django21-sqlite - python: 3.6 + env: TOXENV=py36-django22-sqlite + - python: 3.7 + env: TOXENV=py37-django22-sqlite + - python: 3.6 env: TOXENV=coverage - python: 3.6 env: TOXENV=doctest - python: 3.6 env: TOXENV=style
7
0.233333
7
0
58adf61de75b551d72601eef7f2179897bf99732
src/game/GameScene.js
src/game/GameScene.js
var GameLayer = cc.Layer.extend({ ctor:function () { // this._super(); var gameLayer = ccs.load(res.GameScene_json); this.addChild(gameLayer.node) } }); var GameScene = cc.Scene.extend({ onEnter:function() { this._super(); var layer = new GameLayer(); this.addChild(layer); } });
var GameLayer = cc.Layer.extend({ ctor:function () { // this._super(); var bkg = new cc.LayerColor(cc.color.WHITE); this.addChild(bkg); var gameLayer = ccs.load(res.GameScene_json); this.addChild(gameLayer.node); } }); var GameScene = cc.Scene.extend({ onEnter:function() { this._super(); var layer = new GameLayer(); this.addChild(layer); } });
Add background for game scene
Add background for game scene
JavaScript
mit
darkdukey/PeriodicQuest,darkdukey/PeriodicQuest
javascript
## Code Before: var GameLayer = cc.Layer.extend({ ctor:function () { // this._super(); var gameLayer = ccs.load(res.GameScene_json); this.addChild(gameLayer.node) } }); var GameScene = cc.Scene.extend({ onEnter:function() { this._super(); var layer = new GameLayer(); this.addChild(layer); } }); ## Instruction: Add background for game scene ## Code After: var GameLayer = cc.Layer.extend({ ctor:function () { // this._super(); var bkg = new cc.LayerColor(cc.color.WHITE); this.addChild(bkg); var gameLayer = ccs.load(res.GameScene_json); this.addChild(gameLayer.node); } }); var GameScene = cc.Scene.extend({ onEnter:function() { this._super(); var layer = new GameLayer(); this.addChild(layer); } });
var GameLayer = cc.Layer.extend({ ctor:function () { // this._super(); - + + var bkg = new cc.LayerColor(cc.color.WHITE); + this.addChild(bkg); + var gameLayer = ccs.load(res.GameScene_json); - this.addChild(gameLayer.node) + this.addChild(gameLayer.node); ? + } }); var GameScene = cc.Scene.extend({ onEnter:function() { this._super(); var layer = new GameLayer(); this.addChild(layer); } });
7
0.388889
5
2
46724d3f2ce860bdc5fc04893a73fa6537c7866f
recipes/mysql_user.rb
recipes/mysql_user.rb
template node[:tungsten][:mysqlConfigFile] do mode 00644 source "tungsten_my_cnf.erb" owner "root" group "root" action :create end template "/tmp/tungsten_create_mysql_users" do mode 00700 source "tungsten_create_mysql_users.erb" owner "root" group "root" action :create only_if { File.exists?("#{node[:tungsten][:rootHome]}/.my.cnf") } end execute "tungsten_create_mysql_users" do command "/tmp/tungsten_create_mysql_users" only_if { File.exists?("/tmp/tungsten_create_mysql_users") } end execute "removeAnonUsers" do command "/usr/bin/mysql --defaults-file=#{node[:tungsten][:rootHome]}/.my.cnf -Be \"delete from mysql.user where user='';flush privileges;\"" only_if { File.exists?("#{node[:tungsten][:rootHome]}/.my.cnf") && "/usr/bin/test -f /usr/bin/mysql" && "/usr/bin/test `/usr/bin/mysql --defaults-file=#{node[:tungsten][:rootHome]}/.my.cnf -Be \"select * from mysql.user where user='';\"|wc -l` -gt 0" } end
template node[:tungsten][:mysqlConfigFile] do mode 00644 source "tungsten_my_cnf.erb" owner "root" group "root" action :create end template "#{node[:tungsten][:rootHome]}/.my.cnf" do mode 00600 source "tungsten_root_my_cnf.erb" owner "root" group "root" action :create end template "/tmp/tungsten_create_mysql_users" do mode 00700 source "tungsten_create_mysql_users.erb" owner "root" group "root" action :create only_if { File.exists?("#{node[:tungsten][:rootHome]}/.my.cnf") } end execute "tungsten_create_mysql_users" do command "/tmp/tungsten_create_mysql_users" only_if { File.exists?("/tmp/tungsten_create_mysql_users") } end execute "removeAnonUsers" do command "/usr/bin/mysql --defaults-file=#{node[:tungsten][:rootHome]}/.my.cnf -Be \"delete from mysql.user where user='';flush privileges;\"" only_if { File.exists?("#{node[:tungsten][:rootHome]}/.my.cnf") && "/usr/bin/test -f /usr/bin/mysql" && "/usr/bin/test `/usr/bin/mysql --defaults-file=#{node[:tungsten][:rootHome]}/.my.cnf -Be \"select * from mysql.user where user='';\"|wc -l` -gt 0" } end
Add root user credential file to user recipe
Add root user credential file to user recipe
Ruby
apache-2.0
continuent/continuent-chef-tungsten,continuent/continuent-chef-tungsten,continuent/continuent-chef-tungsten
ruby
## Code Before: template node[:tungsten][:mysqlConfigFile] do mode 00644 source "tungsten_my_cnf.erb" owner "root" group "root" action :create end template "/tmp/tungsten_create_mysql_users" do mode 00700 source "tungsten_create_mysql_users.erb" owner "root" group "root" action :create only_if { File.exists?("#{node[:tungsten][:rootHome]}/.my.cnf") } end execute "tungsten_create_mysql_users" do command "/tmp/tungsten_create_mysql_users" only_if { File.exists?("/tmp/tungsten_create_mysql_users") } end execute "removeAnonUsers" do command "/usr/bin/mysql --defaults-file=#{node[:tungsten][:rootHome]}/.my.cnf -Be \"delete from mysql.user where user='';flush privileges;\"" only_if { File.exists?("#{node[:tungsten][:rootHome]}/.my.cnf") && "/usr/bin/test -f /usr/bin/mysql" && "/usr/bin/test `/usr/bin/mysql --defaults-file=#{node[:tungsten][:rootHome]}/.my.cnf -Be \"select * from mysql.user where user='';\"|wc -l` -gt 0" } end ## Instruction: Add root user credential file to user recipe ## Code After: template node[:tungsten][:mysqlConfigFile] do mode 00644 source "tungsten_my_cnf.erb" owner "root" group "root" action :create end template "#{node[:tungsten][:rootHome]}/.my.cnf" do mode 00600 source "tungsten_root_my_cnf.erb" owner "root" group "root" action :create end template "/tmp/tungsten_create_mysql_users" do mode 00700 source "tungsten_create_mysql_users.erb" owner "root" group "root" action :create only_if { File.exists?("#{node[:tungsten][:rootHome]}/.my.cnf") } end execute "tungsten_create_mysql_users" do command "/tmp/tungsten_create_mysql_users" only_if { File.exists?("/tmp/tungsten_create_mysql_users") } end execute "removeAnonUsers" do command "/usr/bin/mysql --defaults-file=#{node[:tungsten][:rootHome]}/.my.cnf -Be \"delete from mysql.user where user='';flush privileges;\"" only_if { File.exists?("#{node[:tungsten][:rootHome]}/.my.cnf") && "/usr/bin/test -f /usr/bin/mysql" && "/usr/bin/test `/usr/bin/mysql --defaults-file=#{node[:tungsten][:rootHome]}/.my.cnf -Be \"select * from mysql.user where user='';\"|wc -l` -gt 0" } end
template node[:tungsten][:mysqlConfigFile] do mode 00644 source "tungsten_my_cnf.erb" + owner "root" + group "root" + action :create + end + + template "#{node[:tungsten][:rootHome]}/.my.cnf" do + mode 00600 + source "tungsten_root_my_cnf.erb" owner "root" group "root" action :create end template "/tmp/tungsten_create_mysql_users" do mode 00700 source "tungsten_create_mysql_users.erb" owner "root" group "root" action :create only_if { File.exists?("#{node[:tungsten][:rootHome]}/.my.cnf") } end execute "tungsten_create_mysql_users" do command "/tmp/tungsten_create_mysql_users" only_if { File.exists?("/tmp/tungsten_create_mysql_users") } end execute "removeAnonUsers" do command "/usr/bin/mysql --defaults-file=#{node[:tungsten][:rootHome]}/.my.cnf -Be \"delete from mysql.user where user='';flush privileges;\"" only_if { File.exists?("#{node[:tungsten][:rootHome]}/.my.cnf") && "/usr/bin/test -f /usr/bin/mysql" && "/usr/bin/test `/usr/bin/mysql --defaults-file=#{node[:tungsten][:rootHome]}/.my.cnf -Be \"select * from mysql.user where user='';\"|wc -l` -gt 0" } end
8
0.296296
8
0
36ff2d522a0273f156d1d28d14f1ede311c598e0
views/register.view.php
views/register.view.php
<h1>This is a registration site.</h1>
<h1>This is a registration site.</h1> <form action="" method="post"> <ul> <li> <label for="username">Username: </label> <input name="username" type="text"> </li> <li> <label for="name">Name: </label> <input name="name" type="text"> </li> <li> <label for="email">Email: </label> <input name="email" type="text"/> </li> <li> <label for="password">Password:</label> <input name="password" type="password"/> </li> <li> <input name="" type="submit" value="Register"/> <input name="" type="reset" value="Reset"/> </li </ul> </form>
Add a register form to register page
Add a register form to register page
PHP
mit
philiplarsson/Kwitter
php
## Code Before: <h1>This is a registration site.</h1> ## Instruction: Add a register form to register page ## Code After: <h1>This is a registration site.</h1> <form action="" method="post"> <ul> <li> <label for="username">Username: </label> <input name="username" type="text"> </li> <li> <label for="name">Name: </label> <input name="name" type="text"> </li> <li> <label for="email">Email: </label> <input name="email" type="text"/> </li> <li> <label for="password">Password:</label> <input name="password" type="password"/> </li> <li> <input name="" type="submit" value="Register"/> <input name="" type="reset" value="Reset"/> </li </ul> </form>
<h1>This is a registration site.</h1> + + <form action="" method="post"> + <ul> + + <li> + <label for="username">Username: </label> + <input name="username" type="text"> + </li> + <li> + <label for="name">Name: </label> + <input name="name" type="text"> + </li> + <li> + <label for="email">Email: </label> + <input name="email" type="text"/> + </li> + <li> + <label for="password">Password:</label> + <input name="password" type="password"/> + </li> + + <li> + <input name="" type="submit" value="Register"/> + <input name="" type="reset" value="Reset"/> + </li + </ul> + </form>
27
27
27
0
6949720d0487a6debdaee88e3e70d5ff2501f18c
cache-list/README.md
cache-list/README.md
Lists known AMP Caches, as available at `https://cdn.ampproject.org/caches.json`. By default, it uses a one-behind strategy to fetch the caches. This can be customised by passing a custom fetch strategy to the constructor. ## Usage ```javascript const caches = new Caches(); // Lists known AMP Caches const caches = await caches.list(); // Retrieves a specific AMP cache const googleAmpCache = await caches.get('google'); ```
Lists known AMP Caches, as available at `https://cdn.ampproject.org/caches.json`. By default, it uses a one-behind strategy to fetch the caches. This can be customised by passing a custom fetch strategy to the constructor. ## Usage ```javascript const Caches = require('amp-toolbox-cache-list'); const caches = new Caches(); // Lists known AMP Caches const caches = await caches.list(); // Retrieves a specific AMP cache const googleAmpCache = await caches.get('google'); ```
Add require to usage sample
Add require to usage sample
Markdown
apache-2.0
ampproject/amp-toolbox,ampproject/amp-toolbox,google/amp-toolbox,ampproject/amp-toolbox,google/amp-toolbox,ampproject/amp-toolbox,google/amp-toolbox
markdown
## Code Before: Lists known AMP Caches, as available at `https://cdn.ampproject.org/caches.json`. By default, it uses a one-behind strategy to fetch the caches. This can be customised by passing a custom fetch strategy to the constructor. ## Usage ```javascript const caches = new Caches(); // Lists known AMP Caches const caches = await caches.list(); // Retrieves a specific AMP cache const googleAmpCache = await caches.get('google'); ``` ## Instruction: Add require to usage sample ## Code After: Lists known AMP Caches, as available at `https://cdn.ampproject.org/caches.json`. By default, it uses a one-behind strategy to fetch the caches. This can be customised by passing a custom fetch strategy to the constructor. ## Usage ```javascript const Caches = require('amp-toolbox-cache-list'); const caches = new Caches(); // Lists known AMP Caches const caches = await caches.list(); // Retrieves a specific AMP cache const googleAmpCache = await caches.get('google'); ```
Lists known AMP Caches, as available at `https://cdn.ampproject.org/caches.json`. By default, it uses a one-behind strategy to fetch the caches. This can be customised by passing a custom fetch strategy to the constructor. ## Usage ```javascript + const Caches = require('amp-toolbox-cache-list'); + const caches = new Caches(); // Lists known AMP Caches const caches = await caches.list(); // Retrieves a specific AMP cache const googleAmpCache = await caches.get('google'); ```
2
0.125
2
0
7ea52e7ea9d648df337d0e93411f700038c833be
tools/install-deps.sh
tools/install-deps.sh
die() { if [ -n "${1}" ]; then echo $1 fi exit 1; } PREFIX=$1 # the directory to install into MAPCACHE_COMMIT=$2 # the commit number to checkout (optional) if [ -z "${PREFIX}" ]; then die "usage: install-deps.sh PREFIX [ MAPCACHE_COMMIT ]" fi # clone the mapcache repository git clone https://github.com/mapserver/mapcache.git $PREFIX/mapcache || die "Git clone failed" cd ${PREFIX}/mapcache || die "Cannot cd to ${PREFIX}/mapcache" if [ -n "${MAPCACHE_COMMIT}" ]; then git checkout $MAPCACHE_COMMIT || die "Cannot checkout ${MAPCACHE_COMMIT}" fi # build and install mapcache autoreconf --force --install || die "autoreconf failed" ./configure --prefix=${PREFIX}/mapcache-install --without-sqlite --without-bdb --disable-module || die "configure failed" make || die "make failed" make install || die "make install failed" # point NPM at the build npm config set mapcache:lib_dir ${PREFIX}/mapcache-install/lib npm config set mapcache:build_dir ${PREFIX}/mapcache
die() { if [ -n "${1}" ]; then echo $1 fi exit 1; } PREFIX=$1 # the directory to install into MAPCACHE_COMMIT=$2 # the commit number to checkout (optional) if [ -z "${PREFIX}" ]; then die "usage: install-deps.sh PREFIX [ MAPCACHE_COMMIT ]" fi # clone the mapcache repository git clone https://github.com/mapserver/mapcache.git $PREFIX/mapcache || die "Git clone failed" cd ${PREFIX}/mapcache || die "Cannot cd to ${PREFIX}/mapcache" if [ -n "${MAPCACHE_COMMIT}" ]; then git checkout $MAPCACHE_COMMIT || die "Cannot checkout ${MAPCACHE_COMMIT}" fi # build and install mapcache if [ -f ./CMakeLists.txt ]; then # it's a cmake build cmake CMakeLists.txt -DWITH_FCGI=0 -DWITH_SQLITE=0 -DWITH_APACHE=0 -DCMAKE_INSTALL_PREFIX=${PREFIX}/mapcache-install || die "cmake failed" else # it's an autotools build autoreconf --force --install || die "autoreconf failed" ./configure --prefix=${PREFIX}/mapcache-install --without-sqlite --without-bdb --disable-module || die "configure failed" fi make || die "make failed" make install || die "make install failed" # point NPM at the build npm config set mapcache:build_dir ${PREFIX}/mapcache
Fix Travis-CI tests to build mapcache with cmake
Fix Travis-CI tests to build mapcache with cmake
Shell
bsd-2-clause
geo-data/node-mapcache,geo-data/node-mapcache,geo-data/node-mapcache
shell
## Code Before: die() { if [ -n "${1}" ]; then echo $1 fi exit 1; } PREFIX=$1 # the directory to install into MAPCACHE_COMMIT=$2 # the commit number to checkout (optional) if [ -z "${PREFIX}" ]; then die "usage: install-deps.sh PREFIX [ MAPCACHE_COMMIT ]" fi # clone the mapcache repository git clone https://github.com/mapserver/mapcache.git $PREFIX/mapcache || die "Git clone failed" cd ${PREFIX}/mapcache || die "Cannot cd to ${PREFIX}/mapcache" if [ -n "${MAPCACHE_COMMIT}" ]; then git checkout $MAPCACHE_COMMIT || die "Cannot checkout ${MAPCACHE_COMMIT}" fi # build and install mapcache autoreconf --force --install || die "autoreconf failed" ./configure --prefix=${PREFIX}/mapcache-install --without-sqlite --without-bdb --disable-module || die "configure failed" make || die "make failed" make install || die "make install failed" # point NPM at the build npm config set mapcache:lib_dir ${PREFIX}/mapcache-install/lib npm config set mapcache:build_dir ${PREFIX}/mapcache ## Instruction: Fix Travis-CI tests to build mapcache with cmake ## Code After: die() { if [ -n "${1}" ]; then echo $1 fi exit 1; } PREFIX=$1 # the directory to install into MAPCACHE_COMMIT=$2 # the commit number to checkout (optional) if [ -z "${PREFIX}" ]; then die "usage: install-deps.sh PREFIX [ MAPCACHE_COMMIT ]" fi # clone the mapcache repository git clone https://github.com/mapserver/mapcache.git $PREFIX/mapcache || die "Git clone failed" cd ${PREFIX}/mapcache || die "Cannot cd to ${PREFIX}/mapcache" if [ -n "${MAPCACHE_COMMIT}" ]; then git checkout $MAPCACHE_COMMIT || die "Cannot checkout ${MAPCACHE_COMMIT}" fi # build and install mapcache if [ -f ./CMakeLists.txt ]; then # it's a cmake build cmake CMakeLists.txt -DWITH_FCGI=0 -DWITH_SQLITE=0 -DWITH_APACHE=0 -DCMAKE_INSTALL_PREFIX=${PREFIX}/mapcache-install || die "cmake failed" else # it's an autotools build autoreconf --force --install || die "autoreconf failed" ./configure --prefix=${PREFIX}/mapcache-install --without-sqlite --without-bdb --disable-module || die "configure failed" fi make || die "make failed" make install || die "make install failed" # point NPM at the build npm config set mapcache:build_dir ${PREFIX}/mapcache
die() { if [ -n "${1}" ]; then echo $1 fi exit 1; } PREFIX=$1 # the directory to install into MAPCACHE_COMMIT=$2 # the commit number to checkout (optional) if [ -z "${PREFIX}" ]; then die "usage: install-deps.sh PREFIX [ MAPCACHE_COMMIT ]" fi # clone the mapcache repository git clone https://github.com/mapserver/mapcache.git $PREFIX/mapcache || die "Git clone failed" cd ${PREFIX}/mapcache || die "Cannot cd to ${PREFIX}/mapcache" if [ -n "${MAPCACHE_COMMIT}" ]; then git checkout $MAPCACHE_COMMIT || die "Cannot checkout ${MAPCACHE_COMMIT}" fi # build and install mapcache + if [ -f ./CMakeLists.txt ]; then # it's a cmake build + cmake CMakeLists.txt -DWITH_FCGI=0 -DWITH_SQLITE=0 -DWITH_APACHE=0 -DCMAKE_INSTALL_PREFIX=${PREFIX}/mapcache-install || die "cmake failed" + else # it's an autotools build - autoreconf --force --install || die "autoreconf failed" + autoreconf --force --install || die "autoreconf failed" ? ++++ - ./configure --prefix=${PREFIX}/mapcache-install --without-sqlite --without-bdb --disable-module || die "configure failed" + ./configure --prefix=${PREFIX}/mapcache-install --without-sqlite --without-bdb --disable-module || die "configure failed" ? ++++ + fi + make || die "make failed" make install || die "make install failed" # point NPM at the build - npm config set mapcache:lib_dir ${PREFIX}/mapcache-install/lib npm config set mapcache:build_dir ${PREFIX}/mapcache
10
0.322581
7
3
3d040eac42be45afec26c3c62172b9f0b828a8ce
lib/tasks/brew.rake
lib/tasks/brew.rake
require 'rake' namespace :brew do task :refresh do puts "#{time}: Checking if any brew upgrades are required ..." if brew_outdated? `brew upgrade && brew cleanup` puts "#{time}: Finished upgrading and cleaning up." else puts "#{time}: Nothing for brew to upgrade." end end def brew_outdated? `brew update` output = `brew outdated` puts "#{time}: About to upgrade: #{output}" unless output == '' output != '' end def time Time.now.strftime('%F %I:%M%p') end end
require 'rake' namespace :brew do task :refresh do puts "#{time}: Checking if any brew upgrades are required ..." if brew_outdated? `brew upgrade && brew cleanup` puts "#{time}: Finished upgrading and cleaning up." else puts "#{time}: Nothing for brew to upgrade." end end def brew_outdated? `brew update` output = `brew outdated` puts "#{time}: *** Upgrading: #{output}" unless output == '' output != '' end def time Time.now.strftime('%F %I:%M%p') end end
Make upgrades easier to see in output.
Make upgrades easier to see in output.
Ruby
mit
keithpitty/freshbrew
ruby
## Code Before: require 'rake' namespace :brew do task :refresh do puts "#{time}: Checking if any brew upgrades are required ..." if brew_outdated? `brew upgrade && brew cleanup` puts "#{time}: Finished upgrading and cleaning up." else puts "#{time}: Nothing for brew to upgrade." end end def brew_outdated? `brew update` output = `brew outdated` puts "#{time}: About to upgrade: #{output}" unless output == '' output != '' end def time Time.now.strftime('%F %I:%M%p') end end ## Instruction: Make upgrades easier to see in output. ## Code After: require 'rake' namespace :brew do task :refresh do puts "#{time}: Checking if any brew upgrades are required ..." if brew_outdated? `brew upgrade && brew cleanup` puts "#{time}: Finished upgrading and cleaning up." else puts "#{time}: Nothing for brew to upgrade." end end def brew_outdated? `brew update` output = `brew outdated` puts "#{time}: *** Upgrading: #{output}" unless output == '' output != '' end def time Time.now.strftime('%F %I:%M%p') end end
require 'rake' namespace :brew do task :refresh do puts "#{time}: Checking if any brew upgrades are required ..." if brew_outdated? `brew upgrade && brew cleanup` puts "#{time}: Finished upgrading and cleaning up." else puts "#{time}: Nothing for brew to upgrade." end end def brew_outdated? `brew update` output = `brew outdated` - puts "#{time}: About to upgrade: #{output}" unless output == '' ? ^^^^^ ^^^^ ^ + puts "#{time}: *** Upgrading: #{output}" unless output == '' ? ^^^ ^ ^^^ output != '' end def time Time.now.strftime('%F %I:%M%p') end end
2
0.083333
1
1
603eeaef4a865714339f0d6b186aab3b17fdd350
.travis.yml
.travis.yml
language: php php: - 5.4 - 5.5 - 5.6 matrix: allow_failures: - php: 5.6 sudo: false services: - redis-server before_script: - composer self-update - composer install script: - phpunit after_script: - php vendor/bin/php-cs-fixer fix src/ --verbose --dry-run --diff
language: php php: - 7.4 - 8.0 sudo: false services: - redis-server before_script: - composer self-update - composer install script: - phpunit after_script: - php vendor/bin/php-cs-fixer fix src/ --verbose --dry-run --diff
Update PHP version on TravisCI
Update PHP version on TravisCI
YAML
mit
ada-u/chocoflake
yaml
## Code Before: language: php php: - 5.4 - 5.5 - 5.6 matrix: allow_failures: - php: 5.6 sudo: false services: - redis-server before_script: - composer self-update - composer install script: - phpunit after_script: - php vendor/bin/php-cs-fixer fix src/ --verbose --dry-run --diff ## Instruction: Update PHP version on TravisCI ## Code After: language: php php: - 7.4 - 8.0 sudo: false services: - redis-server before_script: - composer self-update - composer install script: - phpunit after_script: - php vendor/bin/php-cs-fixer fix src/ --verbose --dry-run --diff
language: php php: - - 5.4 ? ^ + - 7.4 ? ^ + - 8.0 - - 5.5 - - 5.6 - - matrix: - allow_failures: - - php: 5.6 sudo: false services: - redis-server before_script: - composer self-update - composer install script: - phpunit after_script: - php vendor/bin/php-cs-fixer fix src/ --verbose --dry-run --diff
9
0.36
2
7
df8bfa726c415924fcf0a3f40037f33734737909
lib/src/material/lambert_material.dart
lib/src/material/lambert_material.dart
part of material; class LambertMaterial implements Material { String name; Blending blending = const Blending( sourceColorFactor: BlendingFactor.sourceAlpha, destinationColorFactor: BlendingFactor.oneMinusSourceAlpha); DepthTest depthTest = const DepthTest(); StencilTest stencilTest; CullingMode faceCulling; Vector3 diffuseColor = new Vector3(0.5, 0.5, 0.5); Texture2D diffuseMap; Vector3 emissionColor = new Vector3.zero(); Texture2D emissionMap; double opacity = 1.0; Texture2D opacityMap; Texture2D bumpMap; Texture2D normalMap; }
part of material; class LambertMaterial implements Material { String name; Blending blending = const Blending( sourceColorFactor: BlendingFactor.sourceAlpha, destinationColorFactor: BlendingFactor.oneMinusSourceAlpha); DepthTest depthTest = const DepthTest(); StencilTest stencilTest; CullingMode faceCulling; Vector3 diffuseColor = new Vector3(0.5, 0.5, 0.5); Texture2D diffuseMap; Vector3 emissionColor = new Vector3.zero(); Texture2D emissionMap; double opacity = 1.0; Texture2D opacityMap; Texture2D normalMap; }
Drop ambition to add bump (height) mapping
Drop ambition to add bump (height) mapping
Dart
bsd-3-clause
RSSchermer/scene_3d.dart,RSSchermer/scene_3d.dart
dart
## Code Before: part of material; class LambertMaterial implements Material { String name; Blending blending = const Blending( sourceColorFactor: BlendingFactor.sourceAlpha, destinationColorFactor: BlendingFactor.oneMinusSourceAlpha); DepthTest depthTest = const DepthTest(); StencilTest stencilTest; CullingMode faceCulling; Vector3 diffuseColor = new Vector3(0.5, 0.5, 0.5); Texture2D diffuseMap; Vector3 emissionColor = new Vector3.zero(); Texture2D emissionMap; double opacity = 1.0; Texture2D opacityMap; Texture2D bumpMap; Texture2D normalMap; } ## Instruction: Drop ambition to add bump (height) mapping ## Code After: part of material; class LambertMaterial implements Material { String name; Blending blending = const Blending( sourceColorFactor: BlendingFactor.sourceAlpha, destinationColorFactor: BlendingFactor.oneMinusSourceAlpha); DepthTest depthTest = const DepthTest(); StencilTest stencilTest; CullingMode faceCulling; Vector3 diffuseColor = new Vector3(0.5, 0.5, 0.5); Texture2D diffuseMap; Vector3 emissionColor = new Vector3.zero(); Texture2D emissionMap; double opacity = 1.0; Texture2D opacityMap; Texture2D normalMap; }
part of material; class LambertMaterial implements Material { String name; Blending blending = const Blending( sourceColorFactor: BlendingFactor.sourceAlpha, destinationColorFactor: BlendingFactor.oneMinusSourceAlpha); DepthTest depthTest = const DepthTest(); StencilTest stencilTest; CullingMode faceCulling; Vector3 diffuseColor = new Vector3(0.5, 0.5, 0.5); Texture2D diffuseMap; Vector3 emissionColor = new Vector3.zero(); Texture2D emissionMap; double opacity = 1.0; Texture2D opacityMap; - Texture2D bumpMap; - Texture2D normalMap; }
2
0.064516
0
2
9f69f8a13fe931bfb699baa279d8ee84380c2ab0
vscode/settings.json
vscode/settings.json
{ "terminal.integrated.shell.linux": "/bin/zsh", "terminal.integrated.shell.osx": "/bin/zsh", "terminal.integrated.rendererType": "dom", "editor.minimap.enabled": false, "workbench.colorTheme": "Solarized Dark", "editor.renderWhitespace": "selection", "go.formatTool": "goimports", "go.testFlags": ["-v"], "editor.fontFamily": "JetBrains Mono", "editor.fontSize": 13, "editor.fontLigatures": true, "terminal.integrated.fontFamily": "JetBrains Mono", "terminal.integrated.fontSize": 13, "projectManager.groupList": true, "files.associations": { "Dockerfile_dev": "dockerfile" } }
{ "terminal.integrated.shell.linux": "/bin/zsh", "terminal.integrated.shell.osx": "/bin/zsh", "terminal.integrated.shell.windows": "C:\\Windows\\System32\\wsl.exe", "terminal.integrated.rendererType": "dom", "editor.minimap.enabled": false, "workbench.colorTheme": "Solarized Dark", "editor.renderWhitespace": "selection", "go.formatTool": "goimports", "go.testFlags": ["-v"], "editor.fontFamily": "JetBrains Mono", "editor.fontSize": 13, "editor.fontLigatures": true, "terminal.integrated.fontFamily": "JetBrains Mono", "terminal.integrated.fontSize": 13, "projectManager.groupList": true, "files.associations": { "Dockerfile_dev": "dockerfile" } }
Add default terminal for windows
Add default terminal for windows
JSON
apache-2.0
filipenos/dotfiles,filipenos/home,filipenos/dotfiles,filipenos/dotfiles
json
## Code Before: { "terminal.integrated.shell.linux": "/bin/zsh", "terminal.integrated.shell.osx": "/bin/zsh", "terminal.integrated.rendererType": "dom", "editor.minimap.enabled": false, "workbench.colorTheme": "Solarized Dark", "editor.renderWhitespace": "selection", "go.formatTool": "goimports", "go.testFlags": ["-v"], "editor.fontFamily": "JetBrains Mono", "editor.fontSize": 13, "editor.fontLigatures": true, "terminal.integrated.fontFamily": "JetBrains Mono", "terminal.integrated.fontSize": 13, "projectManager.groupList": true, "files.associations": { "Dockerfile_dev": "dockerfile" } } ## Instruction: Add default terminal for windows ## Code After: { "terminal.integrated.shell.linux": "/bin/zsh", "terminal.integrated.shell.osx": "/bin/zsh", "terminal.integrated.shell.windows": "C:\\Windows\\System32\\wsl.exe", "terminal.integrated.rendererType": "dom", "editor.minimap.enabled": false, "workbench.colorTheme": "Solarized Dark", "editor.renderWhitespace": "selection", "go.formatTool": "goimports", "go.testFlags": ["-v"], "editor.fontFamily": "JetBrains Mono", "editor.fontSize": 13, "editor.fontLigatures": true, "terminal.integrated.fontFamily": "JetBrains Mono", "terminal.integrated.fontSize": 13, "projectManager.groupList": true, "files.associations": { "Dockerfile_dev": "dockerfile" } }
{ "terminal.integrated.shell.linux": "/bin/zsh", "terminal.integrated.shell.osx": "/bin/zsh", + "terminal.integrated.shell.windows": "C:\\Windows\\System32\\wsl.exe", "terminal.integrated.rendererType": "dom", "editor.minimap.enabled": false, "workbench.colorTheme": "Solarized Dark", "editor.renderWhitespace": "selection", "go.formatTool": "goimports", "go.testFlags": ["-v"], "editor.fontFamily": "JetBrains Mono", "editor.fontSize": 13, "editor.fontLigatures": true, "terminal.integrated.fontFamily": "JetBrains Mono", "terminal.integrated.fontSize": 13, "projectManager.groupList": true, "files.associations": { "Dockerfile_dev": "dockerfile" } }
1
0.052632
1
0
20e824ffe66eca4028466ef3f00d80ece71d7abf
exercises/concept/elyses-transformative-enchantments/.meta/config.json
exercises/concept/elyses-transformative-enchantments/.meta/config.json
{ "contributors": [], "authors": [ { "github_username": "yyyc514", "exercism_username": "ajoshguy" } ], "editor": { "solution_files": [ "enchantments.js" ], "test_files": [ "enchantments.spec.js" ] } }
{ "contributors": [], "authors": [ { "github_username": "yyyc514", "exercism_username": "ajoshguy" } ], "editor": { "solution_files": [], "test_files": [] } }
Remove files that don't exist
Remove files that don't exist
JSON
mit
exercism/xecmascript,exercism/xecmascript
json
## Code Before: { "contributors": [], "authors": [ { "github_username": "yyyc514", "exercism_username": "ajoshguy" } ], "editor": { "solution_files": [ "enchantments.js" ], "test_files": [ "enchantments.spec.js" ] } } ## Instruction: Remove files that don't exist ## Code After: { "contributors": [], "authors": [ { "github_username": "yyyc514", "exercism_username": "ajoshguy" } ], "editor": { "solution_files": [], "test_files": [] } }
{ "contributors": [], "authors": [ { "github_username": "yyyc514", "exercism_username": "ajoshguy" } ], "editor": { - "solution_files": [ + "solution_files": [], ? ++ - "enchantments.js" - ], - "test_files": [ + "test_files": [] ? + - "enchantments.spec.js" - ] } }
8
0.470588
2
6
abe6a5d6d8038085181f5dc3d068be8feaf868a5
release/package/linux/rpm.rb
release/package/linux/rpm.rb
module Itch # RPM package def Itch.ci_package_rpm (arch, build_path) rpm_arch = to_rpm_arch arch gem_dep 'fpm', 'fpm' say "Preparing stage2" stage2_path = 'rpm-stage' prepare_stage2 build_path, stage2_path distro_files = ".=/" ✓ sh %Q{fpm --force \ -C #{stage2_path} -s dir -t rpm \ --rpm-compression xz \ --name "#{app_name}" \ --description "#{DESCRIPTION}" \ --url "https://itch.io/app" \ --version "#{build_version}" \ --maintainer "#{MAINTAINER}" \ --architecture "#{rpm_arch}" \ --license "MIT" \ --vendor "itch.io" \ --category "games" \ --after-install "release/debian-after-install.sh" \ -d "p7zip" \ -d "desktop-file-utils" \ #{distro_files} } FileUtils.cp Dir["*.rpm"], "packages/" end end
module Itch # RPM package def Itch.ci_package_rpm (arch, build_path) rpm_arch = to_rpm_arch arch gem_dep 'fpm', 'fpm' say "Preparing stage2" stage2_path = 'rpm-stage' prepare_stage2 build_path, stage2_path distro_files = ".=/" ✓ sh %Q{fpm --force \ -C #{stage2_path} -s dir -t rpm \ --rpm-compression xz \ --name "#{app_name}" \ --description "#{DESCRIPTION}" \ --url "https://itch.io/app" \ --version "#{build_version}" \ --maintainer "#{MAINTAINER}" \ --architecture "#{rpm_arch}" \ --license "MIT" \ --vendor "itch.io" \ --category "games" \ --after-install "release/debian-after-install.sh" \ -d "p7zip" \ -d "desktop-file-utils" \ -d "libXScrnSaver" \ #{distro_files} } FileUtils.cp Dir["*.rpm"], "packages/" end end
Add missing fedora dependency libXScrnSaver
:penguin: Add missing fedora dependency libXScrnSaver
Ruby
mit
itchio/itchio-app,itchio/itchio-app,itchio/itch,itchio/itchio-app,leafo/itchio-app,itchio/itch,itchio/itch,itchio/itch,itchio/itch,itchio/itch,leafo/itchio-app,leafo/itchio-app
ruby
## Code Before: module Itch # RPM package def Itch.ci_package_rpm (arch, build_path) rpm_arch = to_rpm_arch arch gem_dep 'fpm', 'fpm' say "Preparing stage2" stage2_path = 'rpm-stage' prepare_stage2 build_path, stage2_path distro_files = ".=/" ✓ sh %Q{fpm --force \ -C #{stage2_path} -s dir -t rpm \ --rpm-compression xz \ --name "#{app_name}" \ --description "#{DESCRIPTION}" \ --url "https://itch.io/app" \ --version "#{build_version}" \ --maintainer "#{MAINTAINER}" \ --architecture "#{rpm_arch}" \ --license "MIT" \ --vendor "itch.io" \ --category "games" \ --after-install "release/debian-after-install.sh" \ -d "p7zip" \ -d "desktop-file-utils" \ #{distro_files} } FileUtils.cp Dir["*.rpm"], "packages/" end end ## Instruction: :penguin: Add missing fedora dependency libXScrnSaver ## Code After: module Itch # RPM package def Itch.ci_package_rpm (arch, build_path) rpm_arch = to_rpm_arch arch gem_dep 'fpm', 'fpm' say "Preparing stage2" stage2_path = 'rpm-stage' prepare_stage2 build_path, stage2_path distro_files = ".=/" ✓ sh %Q{fpm --force \ -C #{stage2_path} -s dir -t rpm \ --rpm-compression xz \ --name "#{app_name}" \ --description "#{DESCRIPTION}" \ --url "https://itch.io/app" \ --version "#{build_version}" \ --maintainer "#{MAINTAINER}" \ --architecture "#{rpm_arch}" \ --license "MIT" \ --vendor "itch.io" \ --category "games" \ --after-install "release/debian-after-install.sh" \ -d "p7zip" \ -d "desktop-file-utils" \ -d "libXScrnSaver" \ #{distro_files} } FileUtils.cp Dir["*.rpm"], "packages/" end end
module Itch # RPM package def Itch.ci_package_rpm (arch, build_path) rpm_arch = to_rpm_arch arch gem_dep 'fpm', 'fpm' say "Preparing stage2" stage2_path = 'rpm-stage' prepare_stage2 build_path, stage2_path distro_files = ".=/" ✓ sh %Q{fpm --force \ -C #{stage2_path} -s dir -t rpm \ --rpm-compression xz \ --name "#{app_name}" \ --description "#{DESCRIPTION}" \ --url "https://itch.io/app" \ --version "#{build_version}" \ --maintainer "#{MAINTAINER}" \ --architecture "#{rpm_arch}" \ --license "MIT" \ --vendor "itch.io" \ --category "games" \ --after-install "release/debian-after-install.sh" \ -d "p7zip" \ -d "desktop-file-utils" \ + -d "libXScrnSaver" \ #{distro_files} } FileUtils.cp Dir["*.rpm"], "packages/" end end
1
0.028571
1
0
d30faa1e9f1e76715fec1f026d712ea11576af58
src/component.js
src/component.js
import { select, local } from "d3-selection"; var componentLocal = local(), noop = function (){}; export default function (tagName, className){ var create, render = noop, destroy = noop, selector = className ? "." + className : tagName; function component(selection, props){ var update = selection.selectAll(selector) .data(Array.isArray(props) ? props : [props]), exit = update.exit(), enter = update.enter().append(tagName).attr("class", className); enter.each(function (){ componentLocal.set(this, { selection: select(this) }); }); if(create){ enter.each(function (){ var local = componentLocal.get(this); local.state = {}; local.render = noop; create(function setState(state){ Object.assign(local.state, state); local.render(); }); }); enter.merge(update).each(function (props){ var local = componentLocal.get(this); if(local.render === noop){ local.render = function (){ render(local.selection, local.props, local.state); }; } local.props = props; local.render(); }); exit.each(function (){ destroy(componentLocal.get(this).state); }); } else { enter.merge(update).each(function (props){ render(componentLocal.get(this).selection, props); }); } exit.remove(); } component.render = function(_) { return (render = _, component); }; component.create = function(_) { return (create = _, component); }; component.destroy = function(_) { return (destroy = _, component); }; return component; };
import { select, local } from "d3-selection"; var componentLocal = local(), noop = function (){}; export default function (tagName, className){ var create, render = noop, destroy = noop, selector = className ? "." + className : tagName; function component(selection, props){ var update = selection.selectAll(selector) .data(Array.isArray(props) ? props : [props]), exit = update.exit(), enter = update.enter().append(tagName).attr("class", className); enter.each(function (){ var local = componentLocal.set(this, { selection: select(this), state: {}, render: noop }); if(create){ create(function setState(state){ Object.assign(local.state, state); local.render(); }); } }); enter.merge(update).each(function (props){ var local = componentLocal.get(this); if(local.render === noop){ local.render = function (){ render(local.selection, local.props, local.state); }; } local.props = props; local.render(); }); exit.each(function (){ destroy(componentLocal.get(this).state); }); exit.remove(); } component.render = function(_) { return (render = _, component); }; component.create = function(_) { return (create = _, component); }; component.destroy = function(_) { return (destroy = _, component); }; return component; };
Unify cases of create and no create
Unify cases of create and no create
JavaScript
bsd-3-clause
curran/d3-component
javascript
## Code Before: import { select, local } from "d3-selection"; var componentLocal = local(), noop = function (){}; export default function (tagName, className){ var create, render = noop, destroy = noop, selector = className ? "." + className : tagName; function component(selection, props){ var update = selection.selectAll(selector) .data(Array.isArray(props) ? props : [props]), exit = update.exit(), enter = update.enter().append(tagName).attr("class", className); enter.each(function (){ componentLocal.set(this, { selection: select(this) }); }); if(create){ enter.each(function (){ var local = componentLocal.get(this); local.state = {}; local.render = noop; create(function setState(state){ Object.assign(local.state, state); local.render(); }); }); enter.merge(update).each(function (props){ var local = componentLocal.get(this); if(local.render === noop){ local.render = function (){ render(local.selection, local.props, local.state); }; } local.props = props; local.render(); }); exit.each(function (){ destroy(componentLocal.get(this).state); }); } else { enter.merge(update).each(function (props){ render(componentLocal.get(this).selection, props); }); } exit.remove(); } component.render = function(_) { return (render = _, component); }; component.create = function(_) { return (create = _, component); }; component.destroy = function(_) { return (destroy = _, component); }; return component; }; ## Instruction: Unify cases of create and no create ## Code After: import { select, local } from "d3-selection"; var componentLocal = local(), noop = function (){}; export default function (tagName, className){ var create, render = noop, destroy = noop, selector = className ? "." + className : tagName; function component(selection, props){ var update = selection.selectAll(selector) .data(Array.isArray(props) ? props : [props]), exit = update.exit(), enter = update.enter().append(tagName).attr("class", className); enter.each(function (){ var local = componentLocal.set(this, { selection: select(this), state: {}, render: noop }); if(create){ create(function setState(state){ Object.assign(local.state, state); local.render(); }); } }); enter.merge(update).each(function (props){ var local = componentLocal.get(this); if(local.render === noop){ local.render = function (){ render(local.selection, local.props, local.state); }; } local.props = props; local.render(); }); exit.each(function (){ destroy(componentLocal.get(this).state); }); exit.remove(); } component.render = function(_) { return (render = _, component); }; component.create = function(_) { return (create = _, component); }; component.destroy = function(_) { return (destroy = _, component); }; return component; };
import { select, local } from "d3-selection"; var componentLocal = local(), noop = function (){}; export default function (tagName, className){ var create, render = noop, destroy = noop, selector = className ? "." + className : tagName; function component(selection, props){ var update = selection.selectAll(selector) .data(Array.isArray(props) ? props : [props]), exit = update.exit(), enter = update.enter().append(tagName).attr("class", className); enter.each(function (){ - componentLocal.set(this, { + var local = componentLocal.set(this, { ? ++++++++++++ - selection: select(this) + selection: select(this), ? + + state: {}, + render: noop }); - }); - - if(create){ + if(create){ ? ++ - enter.each(function (){ - var local = componentLocal.get(this); - local.state = {}; - local.render = noop; create(function setState(state){ Object.assign(local.state, state); local.render(); }); - }); ? -- + } + }); - enter.merge(update).each(function (props){ ? -- + enter.merge(update).each(function (props){ - var local = componentLocal.get(this); ? -- + var local = componentLocal.get(this); - if(local.render === noop){ ? -- + if(local.render === noop){ - local.render = function (){ ? -- + local.render = function (){ - render(local.selection, local.props, local.state); ? -- + render(local.selection, local.props, local.state); - }; - } + }; ? + + } - local.props = props; ? -- + local.props = props; - local.render(); ? -- + local.render(); - }); ? -- + }); - exit.each(function (){ ? -- + exit.each(function (){ - destroy(componentLocal.get(this).state); ? -- + destroy(componentLocal.get(this).state); - }); ? -- + }); - } else { - enter.merge(update).each(function (props){ - render(componentLocal.get(this).selection, props); - }); - } exit.remove(); } component.render = function(_) { return (render = _, component); }; component.create = function(_) { return (create = _, component); }; component.destroy = function(_) { return (destroy = _, component); }; return component; };
48
0.8
20
28
c0e8bff1a4f1920ee7a9cb2692125cf5b0fe5a89
src/main/kotlin/configuration/mitsumameconfiguration.kt
src/main/kotlin/configuration/mitsumameconfiguration.kt
package com.st8vrt.mitsumame.configuration import com.st8vrt.mitsumame.storage.providers.InMemoryStorageProvider import com.st8vrt.mitsumame.storage.interfaces.SessionStorageProvider import com.st8vrt.mitsumame.storage.interfaces.DeviceStorageProvider import com.st8vrt.mitsumame.storage.interfaces.UserStorageProvider /** * Created with IntelliJ IDEA. * User: swishy * Date: 10/5/13 * Time: 10:04 PM * To change this template use File | Settings | File Templates. */ // Static instance to reference. public var mitsumameConfiguration : MitsumameConfiguration = MitsumameConfiguration() public class MitsumameConfiguration { // Can be assigned to custom providers. public var sessionStorageProvider : SessionStorageProvider = InMemoryStorageProvider() public var deviceStorageProvider : DeviceStorageProvider = InMemoryStorageProvider() public var userStorageProvider : UserStorageProvider = InMemoryStorageProvider() // Default to 2 hours. public var sessionDuration : Long = 7200000 }
package com.st8vrt.mitsumame.configuration import com.st8vrt.mitsumame.storage.providers.InMemoryStorageProvider import com.st8vrt.mitsumame.storage.interfaces.SessionStorageProvider import com.st8vrt.mitsumame.storage.interfaces.DeviceStorageProvider import com.st8vrt.mitsumame.storage.interfaces.UserStorageProvider /** * Created with IntelliJ IDEA. * User: swishy * Date: 10/5/13 * Time: 10:04 PM * To change this template use File | Settings | File Templates. */ // Static instance to reference. public var mitsumameConfiguration : MitsumameConfiguration = MitsumameConfiguration() public class MitsumameConfiguration { // Can be assigned to custom providers. public var sessionStorageProvider : SessionStorageProvider = InMemoryStorageProvider() public var deviceStorageProvider : DeviceStorageProvider = InMemoryStorageProvider() public var userStorageProvider : UserStorageProvider = InMemoryStorageProvider() // Default to 2 hours. public var sessionDuration : Long = 7200000 // Default to 1024 iterations during key strengthening. public var keyIterations : Int = 1024 }
Add key iterations to the current config
Add key iterations to the current config
Kotlin
apache-2.0
swishy/Mitsumame
kotlin
## Code Before: package com.st8vrt.mitsumame.configuration import com.st8vrt.mitsumame.storage.providers.InMemoryStorageProvider import com.st8vrt.mitsumame.storage.interfaces.SessionStorageProvider import com.st8vrt.mitsumame.storage.interfaces.DeviceStorageProvider import com.st8vrt.mitsumame.storage.interfaces.UserStorageProvider /** * Created with IntelliJ IDEA. * User: swishy * Date: 10/5/13 * Time: 10:04 PM * To change this template use File | Settings | File Templates. */ // Static instance to reference. public var mitsumameConfiguration : MitsumameConfiguration = MitsumameConfiguration() public class MitsumameConfiguration { // Can be assigned to custom providers. public var sessionStorageProvider : SessionStorageProvider = InMemoryStorageProvider() public var deviceStorageProvider : DeviceStorageProvider = InMemoryStorageProvider() public var userStorageProvider : UserStorageProvider = InMemoryStorageProvider() // Default to 2 hours. public var sessionDuration : Long = 7200000 } ## Instruction: Add key iterations to the current config ## Code After: package com.st8vrt.mitsumame.configuration import com.st8vrt.mitsumame.storage.providers.InMemoryStorageProvider import com.st8vrt.mitsumame.storage.interfaces.SessionStorageProvider import com.st8vrt.mitsumame.storage.interfaces.DeviceStorageProvider import com.st8vrt.mitsumame.storage.interfaces.UserStorageProvider /** * Created with IntelliJ IDEA. * User: swishy * Date: 10/5/13 * Time: 10:04 PM * To change this template use File | Settings | File Templates. */ // Static instance to reference. public var mitsumameConfiguration : MitsumameConfiguration = MitsumameConfiguration() public class MitsumameConfiguration { // Can be assigned to custom providers. public var sessionStorageProvider : SessionStorageProvider = InMemoryStorageProvider() public var deviceStorageProvider : DeviceStorageProvider = InMemoryStorageProvider() public var userStorageProvider : UserStorageProvider = InMemoryStorageProvider() // Default to 2 hours. public var sessionDuration : Long = 7200000 // Default to 1024 iterations during key strengthening. public var keyIterations : Int = 1024 }
package com.st8vrt.mitsumame.configuration import com.st8vrt.mitsumame.storage.providers.InMemoryStorageProvider import com.st8vrt.mitsumame.storage.interfaces.SessionStorageProvider import com.st8vrt.mitsumame.storage.interfaces.DeviceStorageProvider import com.st8vrt.mitsumame.storage.interfaces.UserStorageProvider /** * Created with IntelliJ IDEA. * User: swishy * Date: 10/5/13 * Time: 10:04 PM * To change this template use File | Settings | File Templates. */ // Static instance to reference. public var mitsumameConfiguration : MitsumameConfiguration = MitsumameConfiguration() public class MitsumameConfiguration { // Can be assigned to custom providers. public var sessionStorageProvider : SessionStorageProvider = InMemoryStorageProvider() public var deviceStorageProvider : DeviceStorageProvider = InMemoryStorageProvider() public var userStorageProvider : UserStorageProvider = InMemoryStorageProvider() // Default to 2 hours. public var sessionDuration : Long = 7200000 + + // Default to 1024 iterations during key strengthening. + public var keyIterations : Int = 1024 }
3
0.1
3
0
efb92bbca8346b7fb660b94f1121d75725febfb5
provision-shell/bootstrap.sh
provision-shell/bootstrap.sh
sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile whoami
sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile # In order to avoid the message # "==> default: dpkg-preconfigure: unable to re-open stdin: No such file or directory" # use " > /dev/null 2>&1" in order to redirect stdout to /dev/null # For more info see http://stackoverflow.com/questions/10508843/what-is-dev-null-21 echo 'Provisioning virtual machine...' # Git echo 'Installing Git...' sudo apt-get -y install git > /dev/null 2>&1 echo 'Removing Git...' sudo apt-get -y purge git > /dev/null 2>&1
Fix 'default: dpkg-preconfigure: unable to re-open stdin: No such file or directory' Vagrant message
Fix 'default: dpkg-preconfigure: unable to re-open stdin: No such file or directory' Vagrant message Add a comment to bootstrap.sh with instructions to follow in order to avoid 'default: dpkg-preconfigure: unable to re-open stdin: No such file or directory' Vagrant message
Shell
mit
liviubalan/liviubalan.com-vagrant-ubuntu,liviubalan/liviubalan.com-vagrant-ubuntu,liviubalan/liviubalan.com-vagrant-ubuntu
shell
## Code Before: sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile whoami ## Instruction: Fix 'default: dpkg-preconfigure: unable to re-open stdin: No such file or directory' Vagrant message Add a comment to bootstrap.sh with instructions to follow in order to avoid 'default: dpkg-preconfigure: unable to re-open stdin: No such file or directory' Vagrant message ## Code After: sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile # In order to avoid the message # "==> default: dpkg-preconfigure: unable to re-open stdin: No such file or directory" # use " > /dev/null 2>&1" in order to redirect stdout to /dev/null # For more info see http://stackoverflow.com/questions/10508843/what-is-dev-null-21 echo 'Provisioning virtual machine...' # Git echo 'Installing Git...' sudo apt-get -y install git > /dev/null 2>&1 echo 'Removing Git...' sudo apt-get -y purge git > /dev/null 2>&1
sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile - whoami + # In order to avoid the message + # "==> default: dpkg-preconfigure: unable to re-open stdin: No such file or directory" + # use " > /dev/null 2>&1" in order to redirect stdout to /dev/null + # For more info see http://stackoverflow.com/questions/10508843/what-is-dev-null-21 + + echo 'Provisioning virtual machine...' + + # Git + echo 'Installing Git...' + sudo apt-get -y install git > /dev/null 2>&1 + + echo 'Removing Git...' + sudo apt-get -y purge git > /dev/null 2>&1
14
4.666667
13
1
581f124bcc78487f76814fe9eddbe59ff57ee1dd
fish/functions/fish_prompt.fish
fish/functions/fish_prompt.fish
function fish_prompt # Start ohmyfish-batman theme default prompt test $status -ne 0; and set --local colors 600 900 c00 or set --local colors 333 666 aaa set --local pwd (prompt_pwd) set --local base (basename "$pwd") set --local expr "s|~|"(fst)"^^"(off)"|g; \ s|/|"(snd)"/"(off)"|g; \ s|"$base"|"(fst)$base(off)" |g" echo -n (echo "$pwd" | sed --expression $expr)(off) for color in $colors echo -n (set_color $color)">" end echo -n " " # End ohmyfish-batman theme default prompt if set --query VIRTUAL_ENV echo -n -s (set_color --background blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " " end end end
function fish_prompt # Start ohmyfish-batman theme default prompt test $status -ne 0; and set --local colors 600 900 c00 or set --local colors 333 666 aaa set --local pwd (prompt_pwd) set --local base (basename "$pwd") function fst; set_color --bold fa0; end function snd; set_color --bold 36f; end function trd; set_color --bold f06; end function dim; set_color 666; end function off; set_color normal; end set --local expr "s|~|"(fst)"^^"(off)"|g; \ s|/|"(snd)"/"(off)"|g; \ s|"$base"|"(fst)$base(off)" |g" echo -n (echo "$pwd" | sed --expression $expr)(off) for color in $colors echo -n (set_color $color)">" end echo -n " " # End ohmyfish-batman theme default prompt if set --query VIRTUAL_ENV echo -n -s (set_color --background blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " " end end end
Move helper functions from fish_greeting
Move helper functions from fish_greeting
fish
mit
ammgws/dotfiles,ammgws/dotfiles,ammgws/dotfiles
fish
## Code Before: function fish_prompt # Start ohmyfish-batman theme default prompt test $status -ne 0; and set --local colors 600 900 c00 or set --local colors 333 666 aaa set --local pwd (prompt_pwd) set --local base (basename "$pwd") set --local expr "s|~|"(fst)"^^"(off)"|g; \ s|/|"(snd)"/"(off)"|g; \ s|"$base"|"(fst)$base(off)" |g" echo -n (echo "$pwd" | sed --expression $expr)(off) for color in $colors echo -n (set_color $color)">" end echo -n " " # End ohmyfish-batman theme default prompt if set --query VIRTUAL_ENV echo -n -s (set_color --background blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " " end end end ## Instruction: Move helper functions from fish_greeting ## Code After: function fish_prompt # Start ohmyfish-batman theme default prompt test $status -ne 0; and set --local colors 600 900 c00 or set --local colors 333 666 aaa set --local pwd (prompt_pwd) set --local base (basename "$pwd") function fst; set_color --bold fa0; end function snd; set_color --bold 36f; end function trd; set_color --bold f06; end function dim; set_color 666; end function off; set_color normal; end set --local expr "s|~|"(fst)"^^"(off)"|g; \ s|/|"(snd)"/"(off)"|g; \ s|"$base"|"(fst)$base(off)" |g" echo -n (echo "$pwd" | sed --expression $expr)(off) for color in $colors echo -n (set_color $color)">" end echo -n " " # End ohmyfish-batman theme default prompt if set --query VIRTUAL_ENV echo -n -s (set_color --background blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " " end end end
function fish_prompt # Start ohmyfish-batman theme default prompt test $status -ne 0; and set --local colors 600 900 c00 or set --local colors 333 666 aaa set --local pwd (prompt_pwd) set --local base (basename "$pwd") + function fst; set_color --bold fa0; end + function snd; set_color --bold 36f; end + function trd; set_color --bold f06; end + function dim; set_color 666; end + function off; set_color normal; end set --local expr "s|~|"(fst)"^^"(off)"|g; \ s|/|"(snd)"/"(off)"|g; \ s|"$base"|"(fst)$base(off)" |g" echo -n (echo "$pwd" | sed --expression $expr)(off) for color in $colors echo -n (set_color $color)">" end echo -n " " # End ohmyfish-batman theme default prompt if set --query VIRTUAL_ENV echo -n -s (set_color --background blue white) "(" (basename "$VIRTUAL_ENV") ")" (set_color normal) " " end end end
5
0.178571
5
0
a02d9115f26320ce23b88da9645a9f118b79556e
tests/AppBundle/Native/InsertTest.php
tests/AppBundle/Native/InsertTest.php
<?php namespace Tests\AppBundle\Native; class InsertTest extends ConnectionTestCase { public function testIgnore() { $connection = $this->getConnection(); try { $connection->exec(' CREATE TABLE `users` ( `id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255), UNIQUE KEY (`name`) ); '); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(1, $response); $this->assertSame('1', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Reen'); "); $this->assertSame(1, $response); $this->assertSame('2', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(0, $response); $this->assertSame('0', $connection->lastInsertId()); } finally { $this->clear(['users']); } } }
<?php namespace Tests\AppBundle\Native; class InsertTest extends ConnectionTestCase { public function testIgnore() { $connection = $this->getConnection(); try { $connection->exec(' CREATE TABLE `users` ( `id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255), UNIQUE KEY (`name`) ); '); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(1, $response); $this->assertSame('1', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Reen'); "); $this->assertSame(1, $response); $this->assertSame('2', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Sky'); "); $this->assertSame(1, $response); $this->assertSame('3', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(0, $response); $this->assertSame('0', $connection->lastInsertId()); } finally { $this->clear(['users']); } } }
INSERT IGONRE `last insert id` after success insert
INSERT IGONRE `last insert id` after success insert
PHP
mit
SkyStudy/MySQLStudy
php
## Code Before: <?php namespace Tests\AppBundle\Native; class InsertTest extends ConnectionTestCase { public function testIgnore() { $connection = $this->getConnection(); try { $connection->exec(' CREATE TABLE `users` ( `id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255), UNIQUE KEY (`name`) ); '); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(1, $response); $this->assertSame('1', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Reen'); "); $this->assertSame(1, $response); $this->assertSame('2', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(0, $response); $this->assertSame('0', $connection->lastInsertId()); } finally { $this->clear(['users']); } } } ## Instruction: INSERT IGONRE `last insert id` after success insert ## Code After: <?php namespace Tests\AppBundle\Native; class InsertTest extends ConnectionTestCase { public function testIgnore() { $connection = $this->getConnection(); try { $connection->exec(' CREATE TABLE `users` ( `id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255), UNIQUE KEY (`name`) ); '); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(1, $response); $this->assertSame('1', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Reen'); "); $this->assertSame(1, $response); $this->assertSame('2', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Sky'); "); $this->assertSame(1, $response); $this->assertSame('3', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(0, $response); $this->assertSame('0', $connection->lastInsertId()); } finally { $this->clear(['users']); } } }
<?php namespace Tests\AppBundle\Native; class InsertTest extends ConnectionTestCase { public function testIgnore() { $connection = $this->getConnection(); try { $connection->exec(' CREATE TABLE `users` ( `id` INT PRIMARY KEY AUTO_INCREMENT, `name` VARCHAR(255), UNIQUE KEY (`name`) ); '); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(1, $response); $this->assertSame('1', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT INTO `users` (`name`) VALUE ('Reen'); "); $this->assertSame(1, $response); $this->assertSame('2', $connection->lastInsertId()); $response = $connection->executeUpdate(" INSERT IGNORE INTO `users` (`name`) + VALUE ('Sky'); + "); + $this->assertSame(1, $response); + + $this->assertSame('3', $connection->lastInsertId()); + + $response = $connection->executeUpdate(" + INSERT IGNORE INTO `users` (`name`) VALUE ('Alex'); "); $this->assertSame(0, $response); $this->assertSame('0', $connection->lastInsertId()); } finally { $this->clear(['users']); } } }
8
0.166667
8
0
aee6aab1e248b927575be1e0f8a7c3397874d860
bower_update.sh
bower_update.sh
pushd public bower update pushd components/bootstrap.css/css curl http://bootswatch.com/cyborg/bootstrap.css -o bootstrap-cyborg.css curl http://bootswatch.com/cyborg/bootstrap.min.css -o bootstrap-cyborg.min.css curl http://bootswatch.com/slate/bootstrap.css -o bootstrap-slate.css curl http://bootswatch.com/slate/bootstrap.min.css -o bootstrap-slate.min.css curl http://bootswatch.com/cosmo/bootstrap.css -o bootstrap-cosmo.css curl http://bootswatch.com/cosmo/bootstrap.min.css -o bootstrap-cosmo.min.css popd popd
function bootswatch { pushd components/bootstrap.css/css > /dev/null for theme in $*; do echo "Downloading $theme theme" curl http://bootswatch.com/$theme/bootstrap.css -so bootstrap-$theme.css curl http://bootswatch.com/$theme/bootstrap.min.css -so bootstrap-$theme.min.css done popd > /dev/null } pushd public > /dev/null bower update bootswatch cyborg slate cosmo popd > /dev/null
Make the bower update script perfect
Make the bower update script perfect
Shell
mit
nicolasmccurdy/nicolasmccurdy.github.io,nicolasmccurdy/nicolasmccurdy.github.io
shell
## Code Before: pushd public bower update pushd components/bootstrap.css/css curl http://bootswatch.com/cyborg/bootstrap.css -o bootstrap-cyborg.css curl http://bootswatch.com/cyborg/bootstrap.min.css -o bootstrap-cyborg.min.css curl http://bootswatch.com/slate/bootstrap.css -o bootstrap-slate.css curl http://bootswatch.com/slate/bootstrap.min.css -o bootstrap-slate.min.css curl http://bootswatch.com/cosmo/bootstrap.css -o bootstrap-cosmo.css curl http://bootswatch.com/cosmo/bootstrap.min.css -o bootstrap-cosmo.min.css popd popd ## Instruction: Make the bower update script perfect ## Code After: function bootswatch { pushd components/bootstrap.css/css > /dev/null for theme in $*; do echo "Downloading $theme theme" curl http://bootswatch.com/$theme/bootstrap.css -so bootstrap-$theme.css curl http://bootswatch.com/$theme/bootstrap.min.css -so bootstrap-$theme.min.css done popd > /dev/null } pushd public > /dev/null bower update bootswatch cyborg slate cosmo popd > /dev/null
- pushd public + function bootswatch { + pushd components/bootstrap.css/css > /dev/null + for theme in $*; do + echo "Downloading $theme theme" + curl http://bootswatch.com/$theme/bootstrap.css -so bootstrap-$theme.css + curl http://bootswatch.com/$theme/bootstrap.min.css -so bootstrap-$theme.min.css + done + popd > /dev/null + } + + pushd public > /dev/null bower update + bootswatch cyborg slate cosmo + popd > /dev/null - pushd components/bootstrap.css/css - curl http://bootswatch.com/cyborg/bootstrap.css -o bootstrap-cyborg.css - curl http://bootswatch.com/cyborg/bootstrap.min.css -o bootstrap-cyborg.min.css - curl http://bootswatch.com/slate/bootstrap.css -o bootstrap-slate.css - curl http://bootswatch.com/slate/bootstrap.min.css -o bootstrap-slate.min.css - curl http://bootswatch.com/cosmo/bootstrap.css -o bootstrap-cosmo.css - curl http://bootswatch.com/cosmo/bootstrap.min.css -o bootstrap-cosmo.min.css - popd - popd
23
1.916667
13
10
c711d5e2dbca4b95bebc0eed4d48a35eb3c7a998
website/addons/dropbox/settings/local-dist.py
website/addons/dropbox/settings/local-dist.py
# Get an app key and secret at https://www.dropbox.com/developers/apps DROPBOX_KEY = 'changeme' DROPBOX_SECRET = 'changeme'
# Get an app key and secret at https://www.dropbox.com/developers/apps DROPBOX_KEY = 'jnpncg5s2fc7cj8' DROPBOX_SECRET = 'sjqv1hrk7sonhu1'
Add dropbox credentials for testing.
Add dropbox credentials for testing.
Python
apache-2.0
crcresearch/osf.io,acshi/osf.io,felliott/osf.io,TomHeatwole/osf.io,RomanZWang/osf.io,jnayak1/osf.io,baylee-d/osf.io,TomBaxter/osf.io,mluke93/osf.io,mluo613/osf.io,pattisdr/osf.io,samchrisinger/osf.io,wearpants/osf.io,mfraezz/osf.io,kch8qx/osf.io,Nesiehr/osf.io,adlius/osf.io,RomanZWang/osf.io,abought/osf.io,felliott/osf.io,jnayak1/osf.io,caseyrollins/osf.io,doublebits/osf.io,cslzchen/osf.io,kwierman/osf.io,monikagrabowska/osf.io,rdhyee/osf.io,laurenrevere/osf.io,Nesiehr/osf.io,HalcyonChimera/osf.io,icereval/osf.io,zamattiac/osf.io,CenterForOpenScience/osf.io,jnayak1/osf.io,cwisecarver/osf.io,SSJohns/osf.io,icereval/osf.io,monikagrabowska/osf.io,wearpants/osf.io,chrisseto/osf.io,binoculars/osf.io,monikagrabowska/osf.io,mluo613/osf.io,adlius/osf.io,aaxelb/osf.io,monikagrabowska/osf.io,asanfilippo7/osf.io,icereval/osf.io,brianjgeiger/osf.io,amyshi188/osf.io,cwisecarver/osf.io,DanielSBrown/osf.io,crcresearch/osf.io,kch8qx/osf.io,SSJohns/osf.io,abought/osf.io,crcresearch/osf.io,laurenrevere/osf.io,mluo613/osf.io,baylee-d/osf.io,alexschiller/osf.io,zachjanicki/osf.io,aaxelb/osf.io,rdhyee/osf.io,doublebits/osf.io,amyshi188/osf.io,Nesiehr/osf.io,sloria/osf.io,hmoco/osf.io,HalcyonChimera/osf.io,aaxelb/osf.io,RomanZWang/osf.io,TomHeatwole/osf.io,kch8qx/osf.io,chrisseto/osf.io,TomBaxter/osf.io,aaxelb/osf.io,DanielSBrown/osf.io,mattclark/osf.io,emetsger/osf.io,emetsger/osf.io,binoculars/osf.io,zachjanicki/osf.io,kwierman/osf.io,kwierman/osf.io,kwierman/osf.io,sloria/osf.io,mfraezz/osf.io,kch8qx/osf.io,acshi/osf.io,chennan47/osf.io,caneruguz/osf.io,doublebits/osf.io,mluke93/osf.io,erinspace/osf.io,alexschiller/osf.io,mluo613/osf.io,zamattiac/osf.io,alexschiller/osf.io,caseyrollins/osf.io,zachjanicki/osf.io,cwisecarver/osf.io,samchrisinger/osf.io,TomBaxter/osf.io,wearpants/osf.io,amyshi188/osf.io,Johnetordoff/osf.io,HalcyonChimera/osf.io,laurenrevere/osf.io,cslzchen/osf.io,SSJohns/osf.io,monikagrabowska/osf.io,Johnetordoff/osf.io,asanfilippo7/osf.io,zamattiac/osf.io,CenterForOpenScience/osf.io,abought/osf.io,jnayak1/osf.io,Johnetordoff/osf.io,mfraezz/osf.io,samchrisinger/osf.io,DanielSBrown/osf.io,rdhyee/osf.io,leb2dg/osf.io,acshi/osf.io,mattclark/osf.io,chrisseto/osf.io,leb2dg/osf.io,brianjgeiger/osf.io,zachjanicki/osf.io,mluke93/osf.io,binoculars/osf.io,asanfilippo7/osf.io,felliott/osf.io,DanielSBrown/osf.io,TomHeatwole/osf.io,hmoco/osf.io,kch8qx/osf.io,caneruguz/osf.io,saradbowman/osf.io,felliott/osf.io,adlius/osf.io,doublebits/osf.io,caneruguz/osf.io,samchrisinger/osf.io,HalcyonChimera/osf.io,RomanZWang/osf.io,emetsger/osf.io,mluo613/osf.io,hmoco/osf.io,hmoco/osf.io,RomanZWang/osf.io,emetsger/osf.io,rdhyee/osf.io,mluke93/osf.io,acshi/osf.io,leb2dg/osf.io,zamattiac/osf.io,saradbowman/osf.io,leb2dg/osf.io,pattisdr/osf.io,chennan47/osf.io,acshi/osf.io,cslzchen/osf.io,alexschiller/osf.io,SSJohns/osf.io,chennan47/osf.io,erinspace/osf.io,mattclark/osf.io,CenterForOpenScience/osf.io,chrisseto/osf.io,brianjgeiger/osf.io,caseyrollins/osf.io,brianjgeiger/osf.io,alexschiller/osf.io,Nesiehr/osf.io,amyshi188/osf.io,baylee-d/osf.io,CenterForOpenScience/osf.io,erinspace/osf.io,abought/osf.io,wearpants/osf.io,asanfilippo7/osf.io,cslzchen/osf.io,adlius/osf.io,TomHeatwole/osf.io,pattisdr/osf.io,cwisecarver/osf.io,mfraezz/osf.io,caneruguz/osf.io,Johnetordoff/osf.io,doublebits/osf.io,sloria/osf.io
python
## Code Before: # Get an app key and secret at https://www.dropbox.com/developers/apps DROPBOX_KEY = 'changeme' DROPBOX_SECRET = 'changeme' ## Instruction: Add dropbox credentials for testing. ## Code After: # Get an app key and secret at https://www.dropbox.com/developers/apps DROPBOX_KEY = 'jnpncg5s2fc7cj8' DROPBOX_SECRET = 'sjqv1hrk7sonhu1'
# Get an app key and secret at https://www.dropbox.com/developers/apps - DROPBOX_KEY = 'changeme' - DROPBOX_SECRET = 'changeme' + DROPBOX_KEY = 'jnpncg5s2fc7cj8' + DROPBOX_SECRET = 'sjqv1hrk7sonhu1'
4
1.333333
2
2
1e6e1eae154008a1dddf12a9c7225054ddcf3d15
corehq/apps/app_manager/xpath_validator/wrapper.py
corehq/apps/app_manager/xpath_validator/wrapper.py
from __future__ import absolute_import from __future__ import unicode_literals from collections import namedtuple from corehq.apps.app_manager.xpath_validator.config import get_xpath_validator_path from corehq.apps.app_manager.xpath_validator.exceptions import XpathValidationError from dimagi.utils.subprocess_manager import subprocess_context XpathValidationResponse = namedtuple('XpathValidationResponse', ['is_valid', 'message']) def validate_xpath(xpath, allow_case_hashtags=False): with subprocess_context() as subprocess: path = get_xpath_validator_path() if allow_case_hashtags: cmd = ['node', path, '--allow-case-hashtags'] else: cmd = ['node', path] p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # Collapse whitespace. '\r' mysteriously causes the process to hang in python 3. stdout, stderr = p.communicate(xpath.replace('\s+', ' ').encode('utf-8')) exit_code = p.wait() if exit_code == 0: return XpathValidationResponse(is_valid=True, message=None) elif exit_code == 1: return XpathValidationResponse(is_valid=False, message=stdout) else: raise XpathValidationError( "{path} failed with exit code {exit_code}:\n{stderr}" .format(path=path, exit_code=exit_code, stderr=stderr))
from __future__ import absolute_import from __future__ import unicode_literals from collections import namedtuple from corehq.apps.app_manager.xpath_validator.config import get_xpath_validator_path from corehq.apps.app_manager.xpath_validator.exceptions import XpathValidationError from dimagi.utils.subprocess_manager import subprocess_context XpathValidationResponse = namedtuple('XpathValidationResponse', ['is_valid', 'message']) def validate_xpath(xpath, allow_case_hashtags=False): with subprocess_context() as subprocess: path = get_xpath_validator_path() if allow_case_hashtags: cmd = ['node', path, '--allow-case-hashtags'] else: cmd = ['node', path] p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = p.communicate(xpath.replace('\r', ' ').encode('utf-8')) exit_code = p.wait() if exit_code == 0: return XpathValidationResponse(is_valid=True, message=None) elif exit_code == 1: return XpathValidationResponse(is_valid=False, message=stdout) else: raise XpathValidationError( "{path} failed with exit code {exit_code}:\n{stderr}" .format(path=path, exit_code=exit_code, stderr=stderr))
Revert "Added comment and used more generic code in xpath validator"
Revert "Added comment and used more generic code in xpath validator"
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
python
## Code Before: from __future__ import absolute_import from __future__ import unicode_literals from collections import namedtuple from corehq.apps.app_manager.xpath_validator.config import get_xpath_validator_path from corehq.apps.app_manager.xpath_validator.exceptions import XpathValidationError from dimagi.utils.subprocess_manager import subprocess_context XpathValidationResponse = namedtuple('XpathValidationResponse', ['is_valid', 'message']) def validate_xpath(xpath, allow_case_hashtags=False): with subprocess_context() as subprocess: path = get_xpath_validator_path() if allow_case_hashtags: cmd = ['node', path, '--allow-case-hashtags'] else: cmd = ['node', path] p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) # Collapse whitespace. '\r' mysteriously causes the process to hang in python 3. stdout, stderr = p.communicate(xpath.replace('\s+', ' ').encode('utf-8')) exit_code = p.wait() if exit_code == 0: return XpathValidationResponse(is_valid=True, message=None) elif exit_code == 1: return XpathValidationResponse(is_valid=False, message=stdout) else: raise XpathValidationError( "{path} failed with exit code {exit_code}:\n{stderr}" .format(path=path, exit_code=exit_code, stderr=stderr)) ## Instruction: Revert "Added comment and used more generic code in xpath validator" ## Code After: from __future__ import absolute_import from __future__ import unicode_literals from collections import namedtuple from corehq.apps.app_manager.xpath_validator.config import get_xpath_validator_path from corehq.apps.app_manager.xpath_validator.exceptions import XpathValidationError from dimagi.utils.subprocess_manager import subprocess_context XpathValidationResponse = namedtuple('XpathValidationResponse', ['is_valid', 'message']) def validate_xpath(xpath, allow_case_hashtags=False): with subprocess_context() as subprocess: path = get_xpath_validator_path() if allow_case_hashtags: cmd = ['node', path, '--allow-case-hashtags'] else: cmd = ['node', path] p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = p.communicate(xpath.replace('\r', ' ').encode('utf-8')) exit_code = p.wait() if exit_code == 0: return XpathValidationResponse(is_valid=True, message=None) elif exit_code == 1: return XpathValidationResponse(is_valid=False, message=stdout) else: raise XpathValidationError( "{path} failed with exit code {exit_code}:\n{stderr}" .format(path=path, exit_code=exit_code, stderr=stderr))
from __future__ import absolute_import from __future__ import unicode_literals from collections import namedtuple from corehq.apps.app_manager.xpath_validator.config import get_xpath_validator_path from corehq.apps.app_manager.xpath_validator.exceptions import XpathValidationError from dimagi.utils.subprocess_manager import subprocess_context XpathValidationResponse = namedtuple('XpathValidationResponse', ['is_valid', 'message']) def validate_xpath(xpath, allow_case_hashtags=False): with subprocess_context() as subprocess: path = get_xpath_validator_path() if allow_case_hashtags: cmd = ['node', path, '--allow-case-hashtags'] else: cmd = ['node', path] p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - # Collapse whitespace. '\r' mysteriously causes the process to hang in python 3. - stdout, stderr = p.communicate(xpath.replace('\s+', ' ').encode('utf-8')) ? ^^ + stdout, stderr = p.communicate(xpath.replace('\r', ' ').encode('utf-8')) ? ^ exit_code = p.wait() if exit_code == 0: return XpathValidationResponse(is_valid=True, message=None) elif exit_code == 1: return XpathValidationResponse(is_valid=False, message=stdout) else: raise XpathValidationError( "{path} failed with exit code {exit_code}:\n{stderr}" .format(path=path, exit_code=exit_code, stderr=stderr))
3
0.1
1
2
6fdbe9cb25ab6b4d75ac9f8a17272c98dfd6dbd9
README.md
README.md
_Test runes and masteries setups!_ > Runes and masteries playground inside your browser! ## Installation _[nodejs is requeired](http://nodejs.org/)_ 1. Clone this repository(git is required) or download zip, extract, open terminal and go to app's root directory. 2. `$ npm install` 3. `$ npm run build:server && npm run build:client` 4. `$ npm start` 5. Visit [http://localhost:3000/src](http://localhost:3000/src) in your browser. 6. Play as you will! ## Abandoned project If you are looking for older version of this project, [check out this repository](https://github.com/marcincichocki/SummonersConfigOld). Please note that the project is no longer maintained. ## License *Summoner's Config isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.* [MIT](/LICENSE.md) © Marcin Cichocki
_Test runes and masteries setups!_ > Runes and masteries playground inside your browser! ## Installation _[nodejs is requeired](http://nodejs.org/)_ 1. Clone this repository(git is required) or download zip, extract, open terminal and go to app's root directory. 2. `$ npm install` 3. `$ npm run build:server && npm run build:client` 4. `$ npm start` 5. Visit [http://localhost:3000/src](http://localhost:3000/src) in your browser. 6. Play as you will! ## Change log All changes are listed [here](/CHANGELOG.md). ## Former project Old version is available [here](https://github.com/marcincichocki/SummonersConfigOld). Please note that this project is no longer maintained. ## License *Summoner's Config isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.* [MIT](/LICENSE.md) © Marcin Cichocki
Change log link and spelling.
Change log link and spelling.
Markdown
mit
marcincichocki/SummonersConfig,marcincichocki/SummonersConfig,marcincichocki/SummonersConfig
markdown
## Code Before: _Test runes and masteries setups!_ > Runes and masteries playground inside your browser! ## Installation _[nodejs is requeired](http://nodejs.org/)_ 1. Clone this repository(git is required) or download zip, extract, open terminal and go to app's root directory. 2. `$ npm install` 3. `$ npm run build:server && npm run build:client` 4. `$ npm start` 5. Visit [http://localhost:3000/src](http://localhost:3000/src) in your browser. 6. Play as you will! ## Abandoned project If you are looking for older version of this project, [check out this repository](https://github.com/marcincichocki/SummonersConfigOld). Please note that the project is no longer maintained. ## License *Summoner's Config isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.* [MIT](/LICENSE.md) © Marcin Cichocki ## Instruction: Change log link and spelling. ## Code After: _Test runes and masteries setups!_ > Runes and masteries playground inside your browser! ## Installation _[nodejs is requeired](http://nodejs.org/)_ 1. Clone this repository(git is required) or download zip, extract, open terminal and go to app's root directory. 2. `$ npm install` 3. `$ npm run build:server && npm run build:client` 4. `$ npm start` 5. Visit [http://localhost:3000/src](http://localhost:3000/src) in your browser. 6. Play as you will! ## Change log All changes are listed [here](/CHANGELOG.md). ## Former project Old version is available [here](https://github.com/marcincichocki/SummonersConfigOld). Please note that this project is no longer maintained. ## License *Summoner's Config isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.* [MIT](/LICENSE.md) © Marcin Cichocki
_Test runes and masteries setups!_ > Runes and masteries playground inside your browser! ## Installation _[nodejs is requeired](http://nodejs.org/)_ 1. Clone this repository(git is required) or download zip, extract, open terminal and go to app's root directory. 2. `$ npm install` 3. `$ npm run build:server && npm run build:client` 4. `$ npm start` 5. Visit [http://localhost:3000/src](http://localhost:3000/src) in your browser. 6. Play as you will! + ## Change log - ## Abandoned project + All changes are listed [here](/CHANGELOG.md). + + ## Former project + - If you are looking for older version of this project, [check out this repository](https://github.com/marcincichocki/SummonersConfigOld). Please note that the project is no longer maintained. ? ^^^^^^^^^^^^^^^^^^^^^^^^ -- ----- ^^^^ --- - ------------ -------- ^ + Old version is available [here](https://github.com/marcincichocki/SummonersConfigOld). Please note that this project is no longer maintained. ? ^ ^^^^^^^^ ^^ ## License *Summoner's Config isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc.* - [MIT](/LICENSE.md) © Marcin Cichocki
9
0.310345
6
3
f97070130e8f6cd593084e9e1ad998dbec9d12a0
envs/qiime.yaml
envs/qiime.yaml
channels: - conda-forge - bioconda - anaconda dependencies: - python ==2.7.12 - qiime ==1.9.1 - pyqt ==4.11.4 - xorg-libsm
channels: - conda-forge - bioconda - https://repo.anaconda.com/pkgs/free/ dependencies: - python ==2.7.12 - qiime ==1.9.1 - pyqt ==4.11.4 - xorg-libsm
Change the anaconda channel for the free channel using a link
Change the anaconda channel for the free channel using a link
YAML
mit
nioo-knaw/hydra
yaml
## Code Before: channels: - conda-forge - bioconda - anaconda dependencies: - python ==2.7.12 - qiime ==1.9.1 - pyqt ==4.11.4 - xorg-libsm ## Instruction: Change the anaconda channel for the free channel using a link ## Code After: channels: - conda-forge - bioconda - https://repo.anaconda.com/pkgs/free/ dependencies: - python ==2.7.12 - qiime ==1.9.1 - pyqt ==4.11.4 - xorg-libsm
channels: - conda-forge - bioconda - - anaconda + - https://repo.anaconda.com/pkgs/free/ dependencies: - python ==2.7.12 - qiime ==1.9.1 - pyqt ==4.11.4 - xorg-libsm
2
0.222222
1
1