commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
5
4.84k
subject
stringlengths
15
778
message
stringlengths
16
6.86k
lang
stringlengths
1
30
license
stringclasses
13 values
repos
stringlengths
5
116k
config
stringlengths
1
30
content
stringlengths
105
8.72k
a243b48c80fe221238137f7921e2b961a40396fa
src/providers/File.ts
src/providers/File.ts
import i = require('../Interfaces'); import _ = require('lodash'); import Utils = require('../Utils'); import Path = require('path'); var filter: any = require('fuzzaldrin').filter; class File implements i.AutocompletionProvider { getSuggestions(currentDirectory: string, input: i.Parsable) { return new Promise((resolve) => { if (input.getLexemes().length < 2) { return resolve([]); } var enteredDirectoriesPath = Utils.normalizeDir(Path.dirname(input.getLastLexeme())); var searchDirectory = Utils.normalizeDir(Path.join(currentDirectory, enteredDirectoriesPath)); Utils.stats(searchDirectory).then((fileInfos) => { var all = _.map(fileInfos, (fileInfo: i.FileInfo) => { let name = fileInfo.name; if (fileInfo.stat.isDirectory()) { name = Utils.normalizeDir(name); } var suggestion: i.Suggestion = { value: name, score: 0, synopsis: '', description: '', type: 'file', partial: fileInfo.stat.isDirectory(), }; if (searchDirectory != currentDirectory) { suggestion.prefix = enteredDirectoriesPath; } return suggestion; }); resolve(filter(all, Path.basename(input.getLastLexeme()), {key: 'value', maxResults: 30})); }); }); } } export = File;
import i = require('../Interfaces'); import _ = require('lodash'); import Utils = require('../Utils'); import Path = require('path'); var filter: any = require('fuzzaldrin').filter; class File implements i.AutocompletionProvider { getSuggestions(currentDirectory: string, input: i.Parsable) { return new Promise((resolve) => { if (input.getLexemes().length < 2) { return resolve([]); } var enteredDirectoriesPath = Utils.normalizeDir(Path.dirname(input.getLastLexeme())); if (Path.isAbsolute(enteredDirectoriesPath)) { var searchDirectory = enteredDirectoriesPath; } else { searchDirectory = Utils.normalizeDir(Path.join(currentDirectory, enteredDirectoriesPath)); } Utils.stats(searchDirectory).then((fileInfos) => { var all = _.map(fileInfos, (fileInfo: i.FileInfo) => { let name = fileInfo.name; if (fileInfo.stat.isDirectory()) { name = Utils.normalizeDir(name); } var suggestion: i.Suggestion = { value: name, score: 0, synopsis: '', description: '', type: 'file', partial: fileInfo.stat.isDirectory(), }; if (searchDirectory != currentDirectory) { suggestion.prefix = enteredDirectoriesPath; } return suggestion; }); resolve(filter(all, Path.basename(input.getLastLexeme()), {key: 'value', maxResults: 30})); }); }); } } export = File;
Allow to glob absolute paths.
Allow to glob absolute paths.
TypeScript
mit
Cavitt/black-screen,Ribeiro/black-screen,Thundabrow/black-screen,Dangku/black-screen,smaty1/black-screen,Ribeiro/black-screen,Dangku/black-screen,w9jds/black-screen,Dangku/black-screen,geksilla/black-screen,drew-gross/black-screen,smaty1/black-screen,Young55555/black-screen,jacobmarshall/black-screen,noikiy/black-screen,black-screen/black-screen,JimLiu/black-screen,rakesh-mohanta/black-screen,vshatskyi/black-screen,smaty1/black-screen,Suninus/black-screen,over300laughs/black-screen,drew-gross/black-screen,gabrielbellamy/black-screen,black-screen/black-screen,N00D13/black-screen,kingland/black-screen,vshatskyi/black-screen,kustomzone/black-screen,alice-gh/black-screen-1,gabrielbellamy/black-screen,jbhannah/black-screen,stefohnee/black-screen,railsware/upterm,gabrielbellamy/black-screen,Thundabrow/black-screen,habibmasuro/black-screen,jassyboy/black-screen,Serg09/black-screen,geksilla/black-screen,bodiam/black-screen,black-screen/black-screen,j-allard/black-screen,stefohnee/black-screen,over300laughs/black-screen,rocky-jaiswal/black-screen,taraszerebecki/black-screen,shockone/black-screen,gastrodia/black-screen,JimLiu/black-screen,mzgnr/black-screen,alessandrostone/black-screen,stefohnee/black-screen,kingland/black-screen,toxic88/black-screen,mzgnr/black-screen,bestwpw/black-screen,adamliesko/black-screen,Cavitt/black-screen,alice-gh/black-screen-1,genecyber/black-screen,littlecodeshop/black-screen,jassyboy/black-screen,jonadev95/black-screen,jbhannah/black-screen,williara/black-screen,drew-gross/black-screen,AnalogRez/black-screen,w9jds/black-screen,genecyber/black-screen,habibmasuro/black-screen,jqk6/black-screen,skomski/black-screen,adamliesko/black-screen,ammaroff/black-screen,rocky-jaiswal/black-screen,rob3ns/black-screen,shockone/black-screen,kaze13/black-screen,habibmasuro/black-screen,geksilla/black-screen,taraszerebecki/black-screen,over300laughs/black-screen,kaze13/black-screen,Suninus/black-screen,JimLiu/black-screen,Thundabrow/black-screen,ammaroff/black-screen,kustomzone/black-screen,Cavitt/black-screen,toxic88/black-screen,gastrodia/black-screen,jassyboy/black-screen,rakesh-mohanta/black-screen,genecyber/black-screen,rakesh-mohanta/black-screen,adamliesko/black-screen,jqk6/black-screen,bodiam/black-screen,rob3ns/black-screen,RyanTech/black-screen,jacobmarshall/black-screen,Young55555/black-screen,Serg09/black-screen,gastrodia/black-screen,noikiy/black-screen,RyanTech/black-screen,littlecodeshop/black-screen,kaze13/black-screen,kingland/black-screen,jqk6/black-screen,jonadev95/black-screen,cyrixhero/black-screen,toxic88/black-screen,railsware/upterm,N00D13/black-screen,alessandrostone/black-screen,w9jds/black-screen,williara/black-screen,noikiy/black-screen,AnalogRez/black-screen,bestwpw/black-screen,mzgnr/black-screen,Serg09/black-screen,williara/black-screen,AnalogRez/black-screen,bodiam/black-screen,ammaroff/black-screen,bestwpw/black-screen,Young55555/black-screen,RyanTech/black-screen,rocky-jaiswal/black-screen,taraszerebecki/black-screen,j-allard/black-screen,vshatskyi/black-screen,littlecodeshop/black-screen,alessandrostone/black-screen,jbhannah/black-screen,Suninus/black-screen,jacobmarshall/black-screen,jonadev95/black-screen,cyrixhero/black-screen,Ribeiro/black-screen,cyrixhero/black-screen,kustomzone/black-screen,rob3ns/black-screen,N00D13/black-screen,skomski/black-screen,j-allard/black-screen,drew-gross/black-screen,alice-gh/black-screen-1,vshatskyi/black-screen,skomski/black-screen
typescript
## Code Before: import i = require('../Interfaces'); import _ = require('lodash'); import Utils = require('../Utils'); import Path = require('path'); var filter: any = require('fuzzaldrin').filter; class File implements i.AutocompletionProvider { getSuggestions(currentDirectory: string, input: i.Parsable) { return new Promise((resolve) => { if (input.getLexemes().length < 2) { return resolve([]); } var enteredDirectoriesPath = Utils.normalizeDir(Path.dirname(input.getLastLexeme())); var searchDirectory = Utils.normalizeDir(Path.join(currentDirectory, enteredDirectoriesPath)); Utils.stats(searchDirectory).then((fileInfos) => { var all = _.map(fileInfos, (fileInfo: i.FileInfo) => { let name = fileInfo.name; if (fileInfo.stat.isDirectory()) { name = Utils.normalizeDir(name); } var suggestion: i.Suggestion = { value: name, score: 0, synopsis: '', description: '', type: 'file', partial: fileInfo.stat.isDirectory(), }; if (searchDirectory != currentDirectory) { suggestion.prefix = enteredDirectoriesPath; } return suggestion; }); resolve(filter(all, Path.basename(input.getLastLexeme()), {key: 'value', maxResults: 30})); }); }); } } export = File; ## Instruction: Allow to glob absolute paths. ## Code After: import i = require('../Interfaces'); import _ = require('lodash'); import Utils = require('../Utils'); import Path = require('path'); var filter: any = require('fuzzaldrin').filter; class File implements i.AutocompletionProvider { getSuggestions(currentDirectory: string, input: i.Parsable) { return new Promise((resolve) => { if (input.getLexemes().length < 2) { return resolve([]); } var enteredDirectoriesPath = Utils.normalizeDir(Path.dirname(input.getLastLexeme())); if (Path.isAbsolute(enteredDirectoriesPath)) { var searchDirectory = enteredDirectoriesPath; } else { searchDirectory = Utils.normalizeDir(Path.join(currentDirectory, enteredDirectoriesPath)); } Utils.stats(searchDirectory).then((fileInfos) => { var all = _.map(fileInfos, (fileInfo: i.FileInfo) => { let name = fileInfo.name; if (fileInfo.stat.isDirectory()) { name = Utils.normalizeDir(name); } var suggestion: i.Suggestion = { value: name, score: 0, synopsis: '', description: '', type: 'file', partial: fileInfo.stat.isDirectory(), }; if (searchDirectory != currentDirectory) { suggestion.prefix = enteredDirectoriesPath; } return suggestion; }); resolve(filter(all, Path.basename(input.getLastLexeme()), {key: 'value', maxResults: 30})); }); }); } } export = File;
8ad3d57312dfc476b7ab137fb675ec0b6efa81a4
.travis.yml
.travis.yml
language: ruby rvm: - 2.0.0 addons: apt: packages: - lpass script: - echo ss | lpass login [email protected] - lpass ls
language: ruby rvm: - 2.0.0 env: global: LPASS=${HOME}/bin/bin/lpass script: - cd tests - ./build-lpass.sh - $(LPASS) ls - echo ss | $(LPASS) login [email protected]
Improve Travis now that we can build lpass.
Improve Travis now that we can build lpass.
YAML
bsd-2-clause
wkoszek/lastpass-ssh,wkoszek/lastpass-ssh
yaml
## Code Before: language: ruby rvm: - 2.0.0 addons: apt: packages: - lpass script: - echo ss | lpass login [email protected] - lpass ls ## Instruction: Improve Travis now that we can build lpass. ## Code After: language: ruby rvm: - 2.0.0 env: global: LPASS=${HOME}/bin/bin/lpass script: - cd tests - ./build-lpass.sh - $(LPASS) ls - echo ss | $(LPASS) login [email protected]
cd8bfc6241896d100eb6a5af53c217d0cdcfde08
packages/te/telega.yaml
packages/te/telega.yaml
homepage: https://github.com/iokasimov/telega changelog-type: markdown hash: 8a54cea881a13d89bf992366fc0fc8b568942507b3aad40089aa0d3e2bc2e53b test-bench-deps: {} maintainer: Murat Kasimov <[email protected]> synopsis: Telegram Bot API binding changelog: | # 0.1.1 * Define `chat` lens for `Update` datatype * Add string identificator to `Callback` datatype * Define `Notification` datatype * Define `Droppable` typeclass basic-deps: http-client: -any base: ==4.* text: -any wreq: -any lens: -any transformers: -any aeson: -any all-versions: - 0.1.0 - 0.1.1 author: Murat Kasimov latest: 0.1.1 description-type: haddock description: High-level bindings, typed entities, inline mode only license-name: MIT
homepage: https://github.com/iokasimov/telega changelog-type: markdown hash: 13c9cbb8529a6064d7b5344a4eb14b81b63c1b0695302b85d6b279f1e26b1818 test-bench-deps: {} maintainer: Murat Kasimov <[email protected]> synopsis: Telegram Bot API binding changelog: | # 0.1.1 * Define `chat` lens for `Update` datatype * Add string identificator to `Callback` datatype * Define `Notification` datatype * Define `Droppable` typeclass # 0.1.2 * Define `Member` datatype * Add new `Membership` constructor to `Update` datatype * Define `Has` typeclass to get access objects within other objects * Replace `chat` lens on `Has Update Chat` instance basic-deps: http-client: -any base: ==4.* text: -any wreq: -any lens: -any transformers: -any aeson: -any all-versions: - 0.1.0 - 0.1.1 - 0.1.2 author: Murat Kasimov latest: 0.1.2 description-type: haddock description: High-level bindings, typed entities, inline mode only license-name: MIT
Update from Hackage at 2019-04-05T12:56:40Z
Update from Hackage at 2019-04-05T12:56:40Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://github.com/iokasimov/telega changelog-type: markdown hash: 8a54cea881a13d89bf992366fc0fc8b568942507b3aad40089aa0d3e2bc2e53b test-bench-deps: {} maintainer: Murat Kasimov <[email protected]> synopsis: Telegram Bot API binding changelog: | # 0.1.1 * Define `chat` lens for `Update` datatype * Add string identificator to `Callback` datatype * Define `Notification` datatype * Define `Droppable` typeclass basic-deps: http-client: -any base: ==4.* text: -any wreq: -any lens: -any transformers: -any aeson: -any all-versions: - 0.1.0 - 0.1.1 author: Murat Kasimov latest: 0.1.1 description-type: haddock description: High-level bindings, typed entities, inline mode only license-name: MIT ## Instruction: Update from Hackage at 2019-04-05T12:56:40Z ## Code After: homepage: https://github.com/iokasimov/telega changelog-type: markdown hash: 13c9cbb8529a6064d7b5344a4eb14b81b63c1b0695302b85d6b279f1e26b1818 test-bench-deps: {} maintainer: Murat Kasimov <[email protected]> synopsis: Telegram Bot API binding changelog: | # 0.1.1 * Define `chat` lens for `Update` datatype * Add string identificator to `Callback` datatype * Define `Notification` datatype * Define `Droppable` typeclass # 0.1.2 * Define `Member` datatype * Add new `Membership` constructor to `Update` datatype * Define `Has` typeclass to get access objects within other objects * Replace `chat` lens on `Has Update Chat` instance basic-deps: http-client: -any base: ==4.* text: -any wreq: -any lens: -any transformers: -any aeson: -any all-versions: - 0.1.0 - 0.1.1 - 0.1.2 author: Murat Kasimov latest: 0.1.2 description-type: haddock description: High-level bindings, typed entities, inline mode only license-name: MIT
a76e769741fdbede78f11dd942ff6732e317fe3a
lib/assert.js
lib/assert.js
'use strict'; var Assert = require('test/assert').Assert , bindMethods = require('es5-ext/lib/Object/bind-methods') , never, neverBind; never = function (message) { this.fail({ message: message, operator: "never" }); }; neverBind = function (message) { return never.bind(this, message); }; module.exports = function (logger) { var assert = new Assert({ pass: logger.pass.bind(logger), fail: logger.fail.bind(logger), error: logger.error.bind(logger) }); assert = bindMethods(assert.strictEqual.bind(assert), assert, Assert.prototype); assert.not = assert.notStrictEqual; assert.deep = assert.deepEqual; assert.notDeep = assert.notDeepEqual; assert.never = never.bind(assert); assert.never.bind = neverBind.bind(assert); return assert; };
'use strict'; var extend = require('es5-ext/lib/Object/extend') , map = require('es5-ext/lib/Object/map') , Assert = require('test/assert').Assert , never, neverBind; never = function (message) { this.fail({ message: message, operator: "never" }); }; neverBind = function (message) { return never.bind(this, message); }; module.exports = function (logger) { var assert = new Assert({ pass: logger.pass.bind(logger), fail: logger.fail.bind(logger), error: logger.error.bind(logger) }); assert = extend(assert.strictEqual.bind(assert), map(Assert.prototype, function (method) { return method.bind(assert); })); assert.not = assert.notStrictEqual; assert.deep = assert.deepEqual; assert.notDeep = assert.notDeepEqual; assert.never = never.bind(assert); assert.never.bind = neverBind.bind(assert); return assert; };
Update up to changes in es5-ext package
Update up to changes in es5-ext package
JavaScript
isc
medikoo/tad
javascript
## Code Before: 'use strict'; var Assert = require('test/assert').Assert , bindMethods = require('es5-ext/lib/Object/bind-methods') , never, neverBind; never = function (message) { this.fail({ message: message, operator: "never" }); }; neverBind = function (message) { return never.bind(this, message); }; module.exports = function (logger) { var assert = new Assert({ pass: logger.pass.bind(logger), fail: logger.fail.bind(logger), error: logger.error.bind(logger) }); assert = bindMethods(assert.strictEqual.bind(assert), assert, Assert.prototype); assert.not = assert.notStrictEqual; assert.deep = assert.deepEqual; assert.notDeep = assert.notDeepEqual; assert.never = never.bind(assert); assert.never.bind = neverBind.bind(assert); return assert; }; ## Instruction: Update up to changes in es5-ext package ## Code After: 'use strict'; var extend = require('es5-ext/lib/Object/extend') , map = require('es5-ext/lib/Object/map') , Assert = require('test/assert').Assert , never, neverBind; never = function (message) { this.fail({ message: message, operator: "never" }); }; neverBind = function (message) { return never.bind(this, message); }; module.exports = function (logger) { var assert = new Assert({ pass: logger.pass.bind(logger), fail: logger.fail.bind(logger), error: logger.error.bind(logger) }); assert = extend(assert.strictEqual.bind(assert), map(Assert.prototype, function (method) { return method.bind(assert); })); assert.not = assert.notStrictEqual; assert.deep = assert.deepEqual; assert.notDeep = assert.notDeepEqual; assert.never = never.bind(assert); assert.never.bind = neverBind.bind(assert); return assert; };
9d0e9af5844772c18ca24d4012642d4518b66dfc
tests/test_judicious.py
tests/test_judicious.py
"""Tests for `judicious` package.""" import pytest import judicious @pytest.fixture def response(): """Sample pytest fixture. See more at: http://doc.pytest.org/en/latest/fixture.html """ # import requests # return requests.get('https://github.com/audreyr/cookiecutter-pypackage') def test_content(response): """Sample pytest test function with the pytest fixture as an argument.""" # from bs4 import BeautifulSoup # assert 'GitHub' in BeautifulSoup(response.content).title.string
"""Tests for `judicious` package.""" import random import pytest import judicious def test_seeding(): r1 = random.random() r2 = random.random() judicious.seed("70d911d5-6d93-3c42-f9a4-53e493a79bff") r3 = random.random() r4 = random.random() judicious.seed("70d911d5-6d93-3c42-f9a4-53e493a79bff") r5 = random.random() r6 = random.random() judicious.seed() r7 = random.random() r8 = random.random() assert(r1 != r3) assert(r2 != r4) assert(r3 == r5) assert(r4 == r6) assert(r5 != r7) assert(r6 != r8) @pytest.fixture def response(): """Sample pytest fixture. See more at: http://doc.pytest.org/en/latest/fixture.html """ # import requests # return requests.get('https://github.com/audreyr/cookiecutter-pypackage') def test_content(response): """Sample pytest test function with the pytest fixture as an argument.""" # from bs4 import BeautifulSoup # assert 'GitHub' in BeautifulSoup(response.content).title.string
Add test of seeding PRNG
Add test of seeding PRNG
Python
mit
suchow/judicious,suchow/judicious,suchow/judicious
python
## Code Before: """Tests for `judicious` package.""" import pytest import judicious @pytest.fixture def response(): """Sample pytest fixture. See more at: http://doc.pytest.org/en/latest/fixture.html """ # import requests # return requests.get('https://github.com/audreyr/cookiecutter-pypackage') def test_content(response): """Sample pytest test function with the pytest fixture as an argument.""" # from bs4 import BeautifulSoup # assert 'GitHub' in BeautifulSoup(response.content).title.string ## Instruction: Add test of seeding PRNG ## Code After: """Tests for `judicious` package.""" import random import pytest import judicious def test_seeding(): r1 = random.random() r2 = random.random() judicious.seed("70d911d5-6d93-3c42-f9a4-53e493a79bff") r3 = random.random() r4 = random.random() judicious.seed("70d911d5-6d93-3c42-f9a4-53e493a79bff") r5 = random.random() r6 = random.random() judicious.seed() r7 = random.random() r8 = random.random() assert(r1 != r3) assert(r2 != r4) assert(r3 == r5) assert(r4 == r6) assert(r5 != r7) assert(r6 != r8) @pytest.fixture def response(): """Sample pytest fixture. See more at: http://doc.pytest.org/en/latest/fixture.html """ # import requests # return requests.get('https://github.com/audreyr/cookiecutter-pypackage') def test_content(response): """Sample pytest test function with the pytest fixture as an argument.""" # from bs4 import BeautifulSoup # assert 'GitHub' in BeautifulSoup(response.content).title.string
442649b9ebd795c83dc643d0cc067f8ec35baff2
source/renderer/app/components/status/NetworkStatus.scss
source/renderer/app/components/status/NetworkStatus.scss
.component { align-items: center; background: var(--theme-connecting-background-color); color: var(--theme-connecting-text-color); height: 100%; display: flex; flex-direction: column; font-family: var(--font-medium); font-size: 14px; line-height: 1.5; justify-content: center; width: 100%; } .table { width: 50%; th { padding-top: 30px; text-align: left; } td { &.red { color: #cd3100; } &.green { color: #1cac63; } & + td { text-align: right; } } td + td { text-align: right; } button { color: var(--theme-connecting-text-color); cursor: pointer; font-size: 14px; line-height: 1.5; position: relative; &::after { border-top: 1px solid var(--theme-connecting-text-color); bottom: 1px; content: ''; left: 0; position: absolute; right: 1px; } &:disabled { cursor: default; &::after { display: none; } } } hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.25); } }
.component { align-items: center; background: #202225; color: #fff; height: 100%; display: flex; flex-direction: column; font-family: var(--font-medium); font-size: 14px; line-height: 1.5; justify-content: center; width: 100%; } .table { width: 50%; th { padding-top: 30px; text-align: left; } td { &.red { color: #cd3100; } &.green { color: #1cac63; } & + td { text-align: right; } } td + td { text-align: right; } button { color: #fff; cursor: pointer; font-size: 14px; line-height: 1.5; position: relative; &::after { border-top: 1px solid #fff; bottom: 1px; content: ''; left: 0; position: absolute; right: 1px; } &:disabled { cursor: default; &::after { display: none; } } } hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.25); } }
Use same styling for Network Status screen for all themes
[DDW-275] Use same styling for Network Status screen for all themes
SCSS
apache-2.0
input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus,input-output-hk/daedalus
scss
## Code Before: .component { align-items: center; background: var(--theme-connecting-background-color); color: var(--theme-connecting-text-color); height: 100%; display: flex; flex-direction: column; font-family: var(--font-medium); font-size: 14px; line-height: 1.5; justify-content: center; width: 100%; } .table { width: 50%; th { padding-top: 30px; text-align: left; } td { &.red { color: #cd3100; } &.green { color: #1cac63; } & + td { text-align: right; } } td + td { text-align: right; } button { color: var(--theme-connecting-text-color); cursor: pointer; font-size: 14px; line-height: 1.5; position: relative; &::after { border-top: 1px solid var(--theme-connecting-text-color); bottom: 1px; content: ''; left: 0; position: absolute; right: 1px; } &:disabled { cursor: default; &::after { display: none; } } } hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.25); } } ## Instruction: [DDW-275] Use same styling for Network Status screen for all themes ## Code After: .component { align-items: center; background: #202225; color: #fff; height: 100%; display: flex; flex-direction: column; font-family: var(--font-medium); font-size: 14px; line-height: 1.5; justify-content: center; width: 100%; } .table { width: 50%; th { padding-top: 30px; text-align: left; } td { &.red { color: #cd3100; } &.green { color: #1cac63; } & + td { text-align: right; } } td + td { text-align: right; } button { color: #fff; cursor: pointer; font-size: 14px; line-height: 1.5; position: relative; &::after { border-top: 1px solid #fff; bottom: 1px; content: ''; left: 0; position: absolute; right: 1px; } &:disabled { cursor: default; &::after { display: none; } } } hr { border: 0; border-top: 1px solid rgba(255, 255, 255, 0.25); } }
b55234e0c10b31268f4dccebf534e283dfba0701
installer/linux/launcher.sh
installer/linux/launcher.sh
export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH ./BlackPearlDS3BrowserApp
pwd=`pwd` export LD_LIBRARY_PATH=$pwd/lib:$LD_LIBRARY_PATH export QT_QPA_PLATFORM_PLUGIN_PATH=$pwd/lib/plugins ./app/BlackPearl\ DS3\ Browser
Set QT_QPA_PLATFORM_PLUGIN_PATH so Qt can find its platform-specific plugins
Set QT_QPA_PLATFORM_PLUGIN_PATH so Qt can find its platform-specific plugins
Shell
apache-2.0
SpectraLogic/ds3_browser,SpectraLogic/ds3_browser,Klopsch/ds3_browser,Klopsch/ds3_browser,Klopsch/ds3_browser,SpectraLogic/ds3_browser
shell
## Code Before: export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH ./BlackPearlDS3BrowserApp ## Instruction: Set QT_QPA_PLATFORM_PLUGIN_PATH so Qt can find its platform-specific plugins ## Code After: pwd=`pwd` export LD_LIBRARY_PATH=$pwd/lib:$LD_LIBRARY_PATH export QT_QPA_PLATFORM_PLUGIN_PATH=$pwd/lib/plugins ./app/BlackPearl\ DS3\ Browser
cba84223b4544b93f619113d96e749bd6b58368c
AngularBasic/webpack.config.ts
AngularBasic/webpack.config.ts
import { AngularCompilerPlugin } from "@ngtools/webpack"; import * as path from "path"; import { Configuration, DllReferencePlugin } from "webpack"; import * as webpackMerge from "webpack-merge"; import { isAOT, isProd, outputDir, WebpackCommonConfig } from "./webpack.config.common"; module.exports = (env: any) => { const prod = isProd(env); const aot = isAOT(env); const bundleConfig: Configuration = webpackMerge(WebpackCommonConfig(env, "main"), { entry: { app: [ "./ClientApp/main.ts", "./ClientApp/styles/main.scss", ], }, plugins: (prod ? [] : [ // AOT chunk splitting does not work while this is active https://github.com/angular/angular-cli/issues/4565 new DllReferencePlugin({ context: __dirname, manifest: require(path.join(__dirname, outputDir, "vendor-manifest.json")), }), ]).concat(aot ? [ new AngularCompilerPlugin({ mainPath: "./ClientApp/main.ts", tsConfigPath: "./tsconfig.json", skipCodeGeneration: false, compilerOptions: { noEmit: false, }, }), ] : []), }); return bundleConfig; };
import { AngularCompilerPlugin } from "@ngtools/webpack"; import * as path from "path"; import { Configuration, DllReferencePlugin } from "webpack"; import * as webpackMerge from "webpack-merge"; import { isAOT, isProd, outputDir, WebpackCommonConfig } from "./webpack.config.common"; module.exports = (env: any) => { const prod = isProd(env); const aot = isAOT(env); if (!prod && aot) { console.warn("Vendor dll bundle will not be used as AOT is enabled"); } const bundleConfig: Configuration = webpackMerge(WebpackCommonConfig(env, "main"), { entry: { app: [ "./ClientApp/main.ts", "./ClientApp/styles/main.scss", ], }, plugins: (prod || aot ? [] : [ // AOT chunk splitting does not work while this is active https://github.com/angular/angular-cli/issues/4565 new DllReferencePlugin({ context: __dirname, manifest: require(path.join(__dirname, outputDir, "vendor-manifest.json")), }), ]).concat(aot ? [ new AngularCompilerPlugin({ mainPath: "./ClientApp/main.ts", tsConfigPath: "./tsconfig.json", skipCodeGeneration: false, compilerOptions: { noEmit: false, }, }), ] : []), }); return bundleConfig; };
Add warning when trying to use dev + aot that vendor bundle will not be used
Add warning when trying to use dev + aot that vendor bundle will not be used
TypeScript
mit
MattJeanes/AngularBasic,MattJeanes/AngularBasic,MattJeanes/AngularBasic,MattJeanes/AngularBasic
typescript
## Code Before: import { AngularCompilerPlugin } from "@ngtools/webpack"; import * as path from "path"; import { Configuration, DllReferencePlugin } from "webpack"; import * as webpackMerge from "webpack-merge"; import { isAOT, isProd, outputDir, WebpackCommonConfig } from "./webpack.config.common"; module.exports = (env: any) => { const prod = isProd(env); const aot = isAOT(env); const bundleConfig: Configuration = webpackMerge(WebpackCommonConfig(env, "main"), { entry: { app: [ "./ClientApp/main.ts", "./ClientApp/styles/main.scss", ], }, plugins: (prod ? [] : [ // AOT chunk splitting does not work while this is active https://github.com/angular/angular-cli/issues/4565 new DllReferencePlugin({ context: __dirname, manifest: require(path.join(__dirname, outputDir, "vendor-manifest.json")), }), ]).concat(aot ? [ new AngularCompilerPlugin({ mainPath: "./ClientApp/main.ts", tsConfigPath: "./tsconfig.json", skipCodeGeneration: false, compilerOptions: { noEmit: false, }, }), ] : []), }); return bundleConfig; }; ## Instruction: Add warning when trying to use dev + aot that vendor bundle will not be used ## Code After: import { AngularCompilerPlugin } from "@ngtools/webpack"; import * as path from "path"; import { Configuration, DllReferencePlugin } from "webpack"; import * as webpackMerge from "webpack-merge"; import { isAOT, isProd, outputDir, WebpackCommonConfig } from "./webpack.config.common"; module.exports = (env: any) => { const prod = isProd(env); const aot = isAOT(env); if (!prod && aot) { console.warn("Vendor dll bundle will not be used as AOT is enabled"); } const bundleConfig: Configuration = webpackMerge(WebpackCommonConfig(env, "main"), { entry: { app: [ "./ClientApp/main.ts", "./ClientApp/styles/main.scss", ], }, plugins: (prod || aot ? [] : [ // AOT chunk splitting does not work while this is active https://github.com/angular/angular-cli/issues/4565 new DllReferencePlugin({ context: __dirname, manifest: require(path.join(__dirname, outputDir, "vendor-manifest.json")), }), ]).concat(aot ? [ new AngularCompilerPlugin({ mainPath: "./ClientApp/main.ts", tsConfigPath: "./tsconfig.json", skipCodeGeneration: false, compilerOptions: { noEmit: false, }, }), ] : []), }); return bundleConfig; };
d078ec00d5553b0985d9c724a223c74b80b2c5ab
grains/grains.py
grains/grains.py
square = [x for x in range(1, 65)] grains = [2 ** x for x in range(0, 65)] board = zip(square, grains) print (board)
square = [x for x in range(1, 65)] grains = [2 ** x for x in range(0, 65)] board = dict(zip(square, grains)) print type(board) for k, v in board.iteritems(): print k, v
Convert zipped list to dictionary
Convert zipped list to dictionary
Python
mit
amalshehu/exercism-python
python
## Code Before: square = [x for x in range(1, 65)] grains = [2 ** x for x in range(0, 65)] board = zip(square, grains) print (board) ## Instruction: Convert zipped list to dictionary ## Code After: square = [x for x in range(1, 65)] grains = [2 ** x for x in range(0, 65)] board = dict(zip(square, grains)) print type(board) for k, v in board.iteritems(): print k, v
07dd4e5045c94fd23071539e9ba4817085523ed9
spec/tasks/reparty_task_spec.rb
spec/tasks/reparty_task_spec.rb
require_relative '../spec_helper' require 'action_mailer' require_relative '../../app/mailers/report_mailer' describe "reparty:email" do include_context "rake" its(:prerequisites) { should include("environment") } it "requires an address" do STDOUT.should_receive(:puts) subject.invoke end it "should generate an email" do expect{ subject.invoke("[email protected]") }.to_not raise_exception end it "should send out via letter_opener", letteropener: true do require 'letter_opener' ActionMailer::Base.add_delivery_method :letter_opener, LetterOpener::DeliveryMethod, :location => File.expand_path('../tmp/letter_opener', __FILE__) ActionMailer::Base.delivery_method = :letter_opener subject.invoke("[email protected]") end end
require_relative '../spec_helper' require 'action_mailer' require_relative '../../app/mailers/report_mailer' describe "reparty:email" do include_context "rake" its(:prerequisites) { should include("environment") } it "requires an address" do STDOUT.should_receive(:puts) subject.invoke end it "should generate an email" do expect{ subject.invoke("[email protected]") }.to_not raise_exception end it "should send out via letter_opener", letteropener: true do require 'letter_opener' ActionMailer::Base.add_delivery_method :letter_opener, LetterOpener::DeliveryMethod, :location => File.expand_path('../../../tmp/letter_opener', __FILE__) ActionMailer::Base.delivery_method = :letter_opener Reparty.config do |config| config.add_report Reparty::Report::ActiveRecord end subject.invoke("[email protected]") end end
Move those tmp files to the root.
Move those tmp files to the root.
Ruby
mit
timdorr/reparty
ruby
## Code Before: require_relative '../spec_helper' require 'action_mailer' require_relative '../../app/mailers/report_mailer' describe "reparty:email" do include_context "rake" its(:prerequisites) { should include("environment") } it "requires an address" do STDOUT.should_receive(:puts) subject.invoke end it "should generate an email" do expect{ subject.invoke("[email protected]") }.to_not raise_exception end it "should send out via letter_opener", letteropener: true do require 'letter_opener' ActionMailer::Base.add_delivery_method :letter_opener, LetterOpener::DeliveryMethod, :location => File.expand_path('../tmp/letter_opener', __FILE__) ActionMailer::Base.delivery_method = :letter_opener subject.invoke("[email protected]") end end ## Instruction: Move those tmp files to the root. ## Code After: require_relative '../spec_helper' require 'action_mailer' require_relative '../../app/mailers/report_mailer' describe "reparty:email" do include_context "rake" its(:prerequisites) { should include("environment") } it "requires an address" do STDOUT.should_receive(:puts) subject.invoke end it "should generate an email" do expect{ subject.invoke("[email protected]") }.to_not raise_exception end it "should send out via letter_opener", letteropener: true do require 'letter_opener' ActionMailer::Base.add_delivery_method :letter_opener, LetterOpener::DeliveryMethod, :location => File.expand_path('../../../tmp/letter_opener', __FILE__) ActionMailer::Base.delivery_method = :letter_opener Reparty.config do |config| config.add_report Reparty::Report::ActiveRecord end subject.invoke("[email protected]") end end
d618f430c143874011b70afe0a4fa62c06f5e28c
md5bot.py
md5bot.py
import time import hashlib import tweepy CONSUMER_KEY = 'xxxxxxxxxxxx' CONSUMER_SECRET = 'xxxxxxxxxxxx' ACCESS_KEY = 'xxxxxxxxxxxx' ACCESS_SECRET = 'xxxxxxxxxxxx' auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) api = tweepy.API(auth) def checkTime(): ts = time.time() m = hashlib.md5() m.update(str(ts)) return m.hexdigest() def postStatus(): currentTime = checkTime() api.update_status(currentTime) int = 0 while int == 0: postStatus() time.sleep(3600) #Sleep for one hour
__author__ = "Patrick Guelcher" __copyright__ = "(C) 2016 Patrick Guelcher" __license__ = "MIT" __version__ = "1.0" """ A bot for Twitter that checks the time and then posts it as an md5 hash value. """ import time import hashlib import tweepy # Configuration (Twitter API Settings) CONSUMER_KEY = 'npfl47weJ6vSn3MRXUq342dMB' CONSUMER_SECRET = 'dKv6zrr7ExIWAtVE3gWG4xZFs3LziZaeHvmycTHkttGC3etP4d' ACCESS_TOKEN = '2489159084-t6A6zXVZSJFdZYP8jb78Mat8Lg3TfnIdffBgUTs' ACCESS_SECRET = '0C83TOgZ4WE00zWuDxVT2TS6E5sVo0Bp0P1IpRn2ipNhD' sleep_time = 3600 # Time is in seconds (Default 3600) # Do not edit beyond this comment def main(): index = 0 while index == 0: post_status() time.sleep(sleep_time) # Sleep for one hour def check_time(): time_stamp = str(time.time()) encode_time = time_stamp.encode('utf-8') md = hashlib.md5() md.update(encode_time) return md.hexdigest() def post_status(): auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET) api = tweepy.API(auth) current_time = check_time() api.update_status(current_time) print(current_time) if __name__ == '__main__': main()
Clean code and conform to python conventions
Clean code and conform to python conventions Some things are still a bit weird, mostly due to my limited knowledge of Python. Also fixed code to conform to Python naming conventions for variables/functions.
Python
mit
aerovolts/python-scripts
python
## Code Before: import time import hashlib import tweepy CONSUMER_KEY = 'xxxxxxxxxxxx' CONSUMER_SECRET = 'xxxxxxxxxxxx' ACCESS_KEY = 'xxxxxxxxxxxx' ACCESS_SECRET = 'xxxxxxxxxxxx' auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_KEY, ACCESS_SECRET) api = tweepy.API(auth) def checkTime(): ts = time.time() m = hashlib.md5() m.update(str(ts)) return m.hexdigest() def postStatus(): currentTime = checkTime() api.update_status(currentTime) int = 0 while int == 0: postStatus() time.sleep(3600) #Sleep for one hour ## Instruction: Clean code and conform to python conventions Some things are still a bit weird, mostly due to my limited knowledge of Python. Also fixed code to conform to Python naming conventions for variables/functions. ## Code After: __author__ = "Patrick Guelcher" __copyright__ = "(C) 2016 Patrick Guelcher" __license__ = "MIT" __version__ = "1.0" """ A bot for Twitter that checks the time and then posts it as an md5 hash value. """ import time import hashlib import tweepy # Configuration (Twitter API Settings) CONSUMER_KEY = 'npfl47weJ6vSn3MRXUq342dMB' CONSUMER_SECRET = 'dKv6zrr7ExIWAtVE3gWG4xZFs3LziZaeHvmycTHkttGC3etP4d' ACCESS_TOKEN = '2489159084-t6A6zXVZSJFdZYP8jb78Mat8Lg3TfnIdffBgUTs' ACCESS_SECRET = '0C83TOgZ4WE00zWuDxVT2TS6E5sVo0Bp0P1IpRn2ipNhD' sleep_time = 3600 # Time is in seconds (Default 3600) # Do not edit beyond this comment def main(): index = 0 while index == 0: post_status() time.sleep(sleep_time) # Sleep for one hour def check_time(): time_stamp = str(time.time()) encode_time = time_stamp.encode('utf-8') md = hashlib.md5() md.update(encode_time) return md.hexdigest() def post_status(): auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) auth.set_access_token(ACCESS_TOKEN, ACCESS_SECRET) api = tweepy.API(auth) current_time = check_time() api.update_status(current_time) print(current_time) if __name__ == '__main__': main()
9e148028300a46f9074b9f188dc04d87884c8905
rsr/headerbar.py
rsr/headerbar.py
from gi.repository import Gio, Gtk from rsr.commands import commands class HeaderBar(Gtk.HeaderBar): def __init__(self, win): super(HeaderBar, self).__init__() self.win = win self.set_show_close_button(True) self.set_title('RunSQLRun') self.set_subtitle('Database query tool') self.pack_start(self._btn_from_command('app', 'neweditor')) self.pack_start(self._btn_from_command('editor', 'run')) btn = Gtk.Button() icon = Gio.ThemedIcon(name="preferences-system-symbolic") image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON) btn.add(image) self.pack_end(btn) def _btn_from_command(self, group, name): btn = Gtk.Button() btn.set_action_name('app.{}_{}'.format(group, name)) data = commands[group]['actions'][name] icon = Gio.ThemedIcon(name=data['icon']) image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON) btn.add(image) btn.set_tooltip_text('{} [{}]'.format( data['description'], data['shortcut'])) return btn def on_button_add_clicked(self, *args): self.win.docview.add_worksheet()
from gi.repository import Gio, Gtk from rsr.commands import commands class HeaderBar(Gtk.HeaderBar): def __init__(self, win): super(HeaderBar, self).__init__() self.win = win self.set_show_close_button(True) self.set_title('RunSQLRun') self.set_subtitle('Database query tool') self.pack_start(self._btn_from_command('app', 'neweditor')) self.pack_start(self._btn_from_command('editor', 'run')) # btn = Gtk.Button() # icon = Gio.ThemedIcon(name="preferences-system-symbolic") # image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON) # btn.add(image) # self.pack_end(btn) def _btn_from_command(self, group, name): btn = Gtk.Button() btn.set_action_name('app.{}_{}'.format(group, name)) data = commands[group]['actions'][name] icon = Gio.ThemedIcon(name=data['icon']) image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON) btn.add(image) btn.set_tooltip_text('{} [{}]'.format( data['description'], data['shortcut'])) return btn def on_button_add_clicked(self, *args): self.win.docview.add_worksheet()
Hide preferences button for now.
Hide preferences button for now.
Python
mit
andialbrecht/runsqlrun
python
## Code Before: from gi.repository import Gio, Gtk from rsr.commands import commands class HeaderBar(Gtk.HeaderBar): def __init__(self, win): super(HeaderBar, self).__init__() self.win = win self.set_show_close_button(True) self.set_title('RunSQLRun') self.set_subtitle('Database query tool') self.pack_start(self._btn_from_command('app', 'neweditor')) self.pack_start(self._btn_from_command('editor', 'run')) btn = Gtk.Button() icon = Gio.ThemedIcon(name="preferences-system-symbolic") image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON) btn.add(image) self.pack_end(btn) def _btn_from_command(self, group, name): btn = Gtk.Button() btn.set_action_name('app.{}_{}'.format(group, name)) data = commands[group]['actions'][name] icon = Gio.ThemedIcon(name=data['icon']) image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON) btn.add(image) btn.set_tooltip_text('{} [{}]'.format( data['description'], data['shortcut'])) return btn def on_button_add_clicked(self, *args): self.win.docview.add_worksheet() ## Instruction: Hide preferences button for now. ## Code After: from gi.repository import Gio, Gtk from rsr.commands import commands class HeaderBar(Gtk.HeaderBar): def __init__(self, win): super(HeaderBar, self).__init__() self.win = win self.set_show_close_button(True) self.set_title('RunSQLRun') self.set_subtitle('Database query tool') self.pack_start(self._btn_from_command('app', 'neweditor')) self.pack_start(self._btn_from_command('editor', 'run')) # btn = Gtk.Button() # icon = Gio.ThemedIcon(name="preferences-system-symbolic") # image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON) # btn.add(image) # self.pack_end(btn) def _btn_from_command(self, group, name): btn = Gtk.Button() btn.set_action_name('app.{}_{}'.format(group, name)) data = commands[group]['actions'][name] icon = Gio.ThemedIcon(name=data['icon']) image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.BUTTON) btn.add(image) btn.set_tooltip_text('{} [{}]'.format( data['description'], data['shortcut'])) return btn def on_button_add_clicked(self, *args): self.win.docview.add_worksheet()
146912ae9c43da6eea390fc58e6777757fd9746b
collector/http_util.go
collector/http_util.go
package collector import ( "errors" "fmt" "io/ioutil" "net/http" ) func HttpGet(endpoint string) (body []byte, err error) { response, err := http.Get(endpoint) if err != nil { return nil, err } if response.StatusCode < 200 || response.StatusCode >= 300 { return nil, errors.New(fmt.Sprintf( "Got response code when querying %s: %d", endpoint, response.StatusCode)) } return ioutil.ReadAll(response.Body) }
package collector import ( "errors" "fmt" "io/ioutil" "net/http" ) const ( userAgent = "metrics-collector/1.0" ) func HttpGet(endpoint string) (body []byte, err error) { // Configure custom UA header for tracing in mesos logs request, err := http.NewRequest("GET", endpoint, nil) if err != nil { return nil, err } request.Header.Set("User-Agent", userAgent) client := http.Client{} response, err := client.Do(request) if err != nil { return nil, err } if response.StatusCode < 200 || response.StatusCode >= 300 { return nil, errors.New(fmt.Sprintf( "Got response code when querying %s: %d", endpoint, response.StatusCode)) } return ioutil.ReadAll(response.Body) }
Include User-Agent header in outgoing HTTP requests
Include User-Agent header in outgoing HTTP requests Mesos includes the agent string in logs, so this should make collector requests more traceable
Go
apache-2.0
dcos/dcos-metrics,dcos/dcos-metrics,dcos/dcos-metrics,dcos/dcos-metrics,dcos/dcos-metrics
go
## Code Before: package collector import ( "errors" "fmt" "io/ioutil" "net/http" ) func HttpGet(endpoint string) (body []byte, err error) { response, err := http.Get(endpoint) if err != nil { return nil, err } if response.StatusCode < 200 || response.StatusCode >= 300 { return nil, errors.New(fmt.Sprintf( "Got response code when querying %s: %d", endpoint, response.StatusCode)) } return ioutil.ReadAll(response.Body) } ## Instruction: Include User-Agent header in outgoing HTTP requests Mesos includes the agent string in logs, so this should make collector requests more traceable ## Code After: package collector import ( "errors" "fmt" "io/ioutil" "net/http" ) const ( userAgent = "metrics-collector/1.0" ) func HttpGet(endpoint string) (body []byte, err error) { // Configure custom UA header for tracing in mesos logs request, err := http.NewRequest("GET", endpoint, nil) if err != nil { return nil, err } request.Header.Set("User-Agent", userAgent) client := http.Client{} response, err := client.Do(request) if err != nil { return nil, err } if response.StatusCode < 200 || response.StatusCode >= 300 { return nil, errors.New(fmt.Sprintf( "Got response code when querying %s: %d", endpoint, response.StatusCode)) } return ioutil.ReadAll(response.Body) }
be3b32777b32774c288b604f0d95eacb32a4d1a2
tox.ini
tox.ini
[tox] minversion = 3.14.0 envlist = py36, py37, py38, py39, lint skip_missing_interpreters = true [testenv] extras = testing commands = coverage run -m pytest {posargs} [testenv:lint] skip_install = true basepython = python3.9 extras = tests deps = flake8 black commands = make lint [testenv:coverage-report] deps = coverage skip_install = true commands = coverage combine coverage report [gh-actions] python = 3.6: py36 3.7: py37 3.8: py38 3.9: py39, lint pypy3: pypy3
[tox] minversion = 3.14.0 envlist = py36, py37, py38, py39, py310, lint skip_missing_interpreters = true [testenv] extras = testing commands = coverage run -m pytest {posargs} [testenv:lint] skip_install = true basepython = python3.9 extras = tests deps = flake8 black commands = make lint [testenv:coverage-report] deps = coverage skip_install = true commands = coverage combine coverage report [gh-actions] python = 3.6: py36 3.7: py37 3.8: py38 3.9: py39, lint 3.10: py310 pypy3: pypy3
Include Python 3.10 in Tox test runs.
build: Include Python 3.10 in Tox test runs. Signed-off-by: Michael Seifert <[email protected]>
INI
apache-2.0
pytest-dev/pytest-asyncio
ini
## Code Before: [tox] minversion = 3.14.0 envlist = py36, py37, py38, py39, lint skip_missing_interpreters = true [testenv] extras = testing commands = coverage run -m pytest {posargs} [testenv:lint] skip_install = true basepython = python3.9 extras = tests deps = flake8 black commands = make lint [testenv:coverage-report] deps = coverage skip_install = true commands = coverage combine coverage report [gh-actions] python = 3.6: py36 3.7: py37 3.8: py38 3.9: py39, lint pypy3: pypy3 ## Instruction: build: Include Python 3.10 in Tox test runs. Signed-off-by: Michael Seifert <[email protected]> ## Code After: [tox] minversion = 3.14.0 envlist = py36, py37, py38, py39, py310, lint skip_missing_interpreters = true [testenv] extras = testing commands = coverage run -m pytest {posargs} [testenv:lint] skip_install = true basepython = python3.9 extras = tests deps = flake8 black commands = make lint [testenv:coverage-report] deps = coverage skip_install = true commands = coverage combine coverage report [gh-actions] python = 3.6: py36 3.7: py37 3.8: py38 3.9: py39, lint 3.10: py310 pypy3: pypy3
0899ae61157b5e81c0d284db94f0df3e62bc797c
src/app/code/community/Linus/CanadaPost/controllers/ApiController.php
src/app/code/community/Linus/CanadaPost/controllers/ApiController.php
<?php use LinusShops\CanadaPost\Services\GetNearestPostOffice; /** * Index Controller * */ class Linus_CanadaPost_OfficeController extends Mage_Core_Controller_Front_Action { /** * Get the list of nearest post offices */ public function nearestAction() { $common = Mage::helper('linus_common/request'); //Require: Postal code $postalCode = $this->getRequest()->get('postal_code'); $city = $this->getRequest()->get('city'); $province = $this->getRequest()->get('province'); if (in_array(null, array($postalCode, $city, $province))) { $msg = ''; if ($postalCode == null) { $msg .= 'postal code '; } if ($city == null) { $msg .= 'city '; } if ($province == null) { $msg .= 'province '; } $common->sendResponseJson(array(), 'Missing required fields: '.$msg); return; } $offices = Mage::helper('linus_canadapost')->getNearbyPostOffices( $postalCode, $city, $province ); } }
<?php use LinusShops\CanadaPost\Services\GetNearestPostOffice; /** * Index Controller * */ class Linus_CanadaPost_OfficeController extends Mage_Core_Controller_Front_Action { /** * Get the list of nearest post offices */ public function nearestAction() { $common = Mage::helper('linus_common/request'); //Require: Postal code $postalCode = $this->getRequest()->get('postal_code'); $city = $this->getRequest()->get('city'); $province = $this->getRequest()->get('province'); if (in_array(null, array($postalCode, $city, $province))) { $msg = ''; if ($postalCode == null) { $msg .= 'postal code '; } if ($city == null) { $msg .= 'city '; } if ($province == null) { $msg .= 'province '; } $common->sendResponseJson(array(), 'Missing required fields: '.$msg); return; } $offices = Mage::helper('linus_canadapost')->getNearbyPostOffices( $postalCode, $city, $province ); $common->sendResponseJson($offices); } }
Return office data in json form.
Return office data in json form.
PHP
mit
linusshops/canadapost-magento,linusshops/canadapost-magento,linusshops/canadapost-magento
php
## Code Before: <?php use LinusShops\CanadaPost\Services\GetNearestPostOffice; /** * Index Controller * */ class Linus_CanadaPost_OfficeController extends Mage_Core_Controller_Front_Action { /** * Get the list of nearest post offices */ public function nearestAction() { $common = Mage::helper('linus_common/request'); //Require: Postal code $postalCode = $this->getRequest()->get('postal_code'); $city = $this->getRequest()->get('city'); $province = $this->getRequest()->get('province'); if (in_array(null, array($postalCode, $city, $province))) { $msg = ''; if ($postalCode == null) { $msg .= 'postal code '; } if ($city == null) { $msg .= 'city '; } if ($province == null) { $msg .= 'province '; } $common->sendResponseJson(array(), 'Missing required fields: '.$msg); return; } $offices = Mage::helper('linus_canadapost')->getNearbyPostOffices( $postalCode, $city, $province ); } } ## Instruction: Return office data in json form. ## Code After: <?php use LinusShops\CanadaPost\Services\GetNearestPostOffice; /** * Index Controller * */ class Linus_CanadaPost_OfficeController extends Mage_Core_Controller_Front_Action { /** * Get the list of nearest post offices */ public function nearestAction() { $common = Mage::helper('linus_common/request'); //Require: Postal code $postalCode = $this->getRequest()->get('postal_code'); $city = $this->getRequest()->get('city'); $province = $this->getRequest()->get('province'); if (in_array(null, array($postalCode, $city, $province))) { $msg = ''; if ($postalCode == null) { $msg .= 'postal code '; } if ($city == null) { $msg .= 'city '; } if ($province == null) { $msg .= 'province '; } $common->sendResponseJson(array(), 'Missing required fields: '.$msg); return; } $offices = Mage::helper('linus_canadapost')->getNearbyPostOffices( $postalCode, $city, $province ); $common->sendResponseJson($offices); } }
33d59b7f640d646dfda9efa66659a058b8aa053a
src/main/groovy/com/github/aesteve/vertx/groovy/HttpClientResponseExtension.groovy
src/main/groovy/com/github/aesteve/vertx/groovy/HttpClientResponseExtension.groovy
package com.github.aesteve.vertx.groovy import groovy.transform.TypeChecked import io.vertx.core.Handler import io.vertx.groovy.core.MultiMap import io.vertx.groovy.core.http.HttpClientResponse @TypeChecked class HttpClientResponseExtension { static void rightShiftUnsigned(HttpClientResponse self, Handler handler) { self.bodyHandler handler } static MultiMap getHeaders(HttpClientResponse self) { self.headers() } static int getStatusCode(HttpClientResponse self) { self.statusCode() } static String getStatusMessage(HttpClientResponse self) { self.statusMessage() } }
package com.github.aesteve.vertx.groovy import groovy.transform.TypeChecked import io.vertx.core.Handler import io.vertx.groovy.core.MultiMap import io.vertx.groovy.core.buffer.Buffer import io.vertx.groovy.core.http.HttpClientResponse @TypeChecked class HttpClientResponseExtension { static void rightShiftUnsigned(HttpClientResponse self, Handler<Buffer> handler) { self.bodyHandler handler } static void rightShiftUnsigned(HttpClientResponse self, Closure<?> handler) { self.bodyHandler { buff -> handler.delegate = buff handler buff } } static MultiMap getHeaders(HttpClientResponse self) { self.headers() } static int getStatusCode(HttpClientResponse self) { self.statusCode() } static String getStatusMessage(HttpClientResponse self) { self.statusMessage() } }
Add Closure support w/ delegate
Add Closure support w/ delegate
Groovy
apache-2.0
aesteve/vertx-groovy-sugar,aesteve/grooveex
groovy
## Code Before: package com.github.aesteve.vertx.groovy import groovy.transform.TypeChecked import io.vertx.core.Handler import io.vertx.groovy.core.MultiMap import io.vertx.groovy.core.http.HttpClientResponse @TypeChecked class HttpClientResponseExtension { static void rightShiftUnsigned(HttpClientResponse self, Handler handler) { self.bodyHandler handler } static MultiMap getHeaders(HttpClientResponse self) { self.headers() } static int getStatusCode(HttpClientResponse self) { self.statusCode() } static String getStatusMessage(HttpClientResponse self) { self.statusMessage() } } ## Instruction: Add Closure support w/ delegate ## Code After: package com.github.aesteve.vertx.groovy import groovy.transform.TypeChecked import io.vertx.core.Handler import io.vertx.groovy.core.MultiMap import io.vertx.groovy.core.buffer.Buffer import io.vertx.groovy.core.http.HttpClientResponse @TypeChecked class HttpClientResponseExtension { static void rightShiftUnsigned(HttpClientResponse self, Handler<Buffer> handler) { self.bodyHandler handler } static void rightShiftUnsigned(HttpClientResponse self, Closure<?> handler) { self.bodyHandler { buff -> handler.delegate = buff handler buff } } static MultiMap getHeaders(HttpClientResponse self) { self.headers() } static int getStatusCode(HttpClientResponse self) { self.statusCode() } static String getStatusMessage(HttpClientResponse self) { self.statusMessage() } }
f52963f99cb4c32b2db2a06f8c1fd254b33ac3c2
rules/ExcludePodcastAnnouncements.js
rules/ExcludePodcastAnnouncements.js
module.exports = function ExcludePodcastAnnouncements(item) { if (item.title.indexOf('#') >= 0) { if (item.content.indexOf('This week on') >= 0 && item.content.indexOf('relay.fm') >= 0) { return true; } } if (/^Appearance: /.test(item.title)) { if (item.content.indexOf('I joined') >= 0) { return true; } } if (item.title.indexOf('(Podcast)') === 0) return true; if (item.title.indexOf('Podcast: ') === 0) return true; return false; }
module.exports = function ExcludePodcastAnnouncements(item) { if (item.title.indexOf('#') >= 0) { if (item.content.indexOf('relay.fm') >= 0) { return true; } } if (/^Appearance: /.test(item.title)) { if (item.content.indexOf('I joined') >= 0) { return true; } } if (item.title.indexOf('(Podcast)') === 0) return true; if (item.title.indexOf('Podcast: ') === 0) return true; return false; }
Make the relay.fm announcement rule more general
Make the relay.fm announcement rule more general
JavaScript
mit
shinypb/feedfilterer
javascript
## Code Before: module.exports = function ExcludePodcastAnnouncements(item) { if (item.title.indexOf('#') >= 0) { if (item.content.indexOf('This week on') >= 0 && item.content.indexOf('relay.fm') >= 0) { return true; } } if (/^Appearance: /.test(item.title)) { if (item.content.indexOf('I joined') >= 0) { return true; } } if (item.title.indexOf('(Podcast)') === 0) return true; if (item.title.indexOf('Podcast: ') === 0) return true; return false; } ## Instruction: Make the relay.fm announcement rule more general ## Code After: module.exports = function ExcludePodcastAnnouncements(item) { if (item.title.indexOf('#') >= 0) { if (item.content.indexOf('relay.fm') >= 0) { return true; } } if (/^Appearance: /.test(item.title)) { if (item.content.indexOf('I joined') >= 0) { return true; } } if (item.title.indexOf('(Podcast)') === 0) return true; if (item.title.indexOf('Podcast: ') === 0) return true; return false; }
d392c6cdbdd207b9c22c2942825b5f6d403834e4
lib/credo/execution/task/validate_config.ex
lib/credo/execution/task/validate_config.ex
defmodule Credo.Execution.Task.ValidateConfig do use Credo.Execution.Task def call(exec, _opts) do exec end end
defmodule Credo.Execution.Task.ValidateConfig do use Credo.Execution.Task alias Credo.CLI.Output.UI def call(exec, _opts) do exec |> validate_checks() |> remove_missing_checks() end defp validate_checks(%Execution{checks: checks} = exec) do Enum.each(checks, &warn_if_check_missing/1) exec end defp remove_missing_checks(%Execution{checks: checks} = exec) do checks = Enum.filter(checks, &check_defined?/1) %Execution{exec | checks: checks} end defp check_defined?({atom, _}), do: check_defined?({atom}) defp check_defined?({atom}) do Code.ensure_compiled?(atom) end defp warn_if_check_missing({atom, _}), do: warn_if_check_missing({atom}) defp warn_if_check_missing({atom}) do unless check_defined?({atom}) do check_name = atom |> to_string() |> String.replace(~r/^Elixir\./, "") UI.warn("Ignoring an undefined check: #{check_name}") end end end
Remove non-existing checks from Execution
Remove non-existing checks from Execution
Elixir
mit
rrrene/credo,rrrene/credo
elixir
## Code Before: defmodule Credo.Execution.Task.ValidateConfig do use Credo.Execution.Task def call(exec, _opts) do exec end end ## Instruction: Remove non-existing checks from Execution ## Code After: defmodule Credo.Execution.Task.ValidateConfig do use Credo.Execution.Task alias Credo.CLI.Output.UI def call(exec, _opts) do exec |> validate_checks() |> remove_missing_checks() end defp validate_checks(%Execution{checks: checks} = exec) do Enum.each(checks, &warn_if_check_missing/1) exec end defp remove_missing_checks(%Execution{checks: checks} = exec) do checks = Enum.filter(checks, &check_defined?/1) %Execution{exec | checks: checks} end defp check_defined?({atom, _}), do: check_defined?({atom}) defp check_defined?({atom}) do Code.ensure_compiled?(atom) end defp warn_if_check_missing({atom, _}), do: warn_if_check_missing({atom}) defp warn_if_check_missing({atom}) do unless check_defined?({atom}) do check_name = atom |> to_string() |> String.replace(~r/^Elixir\./, "") UI.warn("Ignoring an undefined check: #{check_name}") end end end
9df5dfed6a2a0e8125213785ed418e9515e0c0db
.travis.yml
.travis.yml
language: python python: - "2.7" # command to install dependencies before_install: - sudo rm /etc/apt/sources.list - echo 'deb http://http.debian.net/debian/ jessie main' | sudo dd of=/etc/apt/sources.list - sudo apt-get update - sudo apt-get --force-yes -y install debian-archive-keyring - sudo apt-get update - sudo dpkg -r --force-depends locales libc6-dev - sudo apt-get -f install - make install: - "pip install requests" script: - cd sandcats ; python trivial_tests.py
language: python python: - "2.7" # command to install dependencies before_install: - sudo rm /etc/apt/sources.list - echo 'deb http://http.debian.net/debian/ jessie main' | sudo dd of=/etc/apt/sources.list - sudo apt-get update - sudo apt-get --force-yes -y install debian-archive-keyring - sudo apt-get update - sudo rm -f /etc/dpkg/dpkg.cfg.d/multiarch # Remove historic multi-arch config. - sudo dpkg -r --force-depends locales libc6-dev - sudo apt-get -f install - make install: - "pip install requests" script: - cd sandcats ; python trivial_tests.py
Remove Ubuntu-specific multiarch config files for dpkg
Remove Ubuntu-specific multiarch config files for dpkg
YAML
apache-2.0
sandstorm-io/sandcats,sandstorm-io/sandcats,sandstorm-io/sandcats,sandstorm-io/sandcats
yaml
## Code Before: language: python python: - "2.7" # command to install dependencies before_install: - sudo rm /etc/apt/sources.list - echo 'deb http://http.debian.net/debian/ jessie main' | sudo dd of=/etc/apt/sources.list - sudo apt-get update - sudo apt-get --force-yes -y install debian-archive-keyring - sudo apt-get update - sudo dpkg -r --force-depends locales libc6-dev - sudo apt-get -f install - make install: - "pip install requests" script: - cd sandcats ; python trivial_tests.py ## Instruction: Remove Ubuntu-specific multiarch config files for dpkg ## Code After: language: python python: - "2.7" # command to install dependencies before_install: - sudo rm /etc/apt/sources.list - echo 'deb http://http.debian.net/debian/ jessie main' | sudo dd of=/etc/apt/sources.list - sudo apt-get update - sudo apt-get --force-yes -y install debian-archive-keyring - sudo apt-get update - sudo rm -f /etc/dpkg/dpkg.cfg.d/multiarch # Remove historic multi-arch config. - sudo dpkg -r --force-depends locales libc6-dev - sudo apt-get -f install - make install: - "pip install requests" script: - cd sandcats ; python trivial_tests.py
e338cf7652eda31cdb568e63c3489520039b0078
README.md
README.md
varnish3to4 =========== A script to assist migrating a VCL file from Varnish 3 to 4. Currently understands: V3 | V4 :-- | :-- vcl_fetch | vcl_backend_response vcl_error | vcl_synth error code response | return (vcl_synth(code, response)) remove | unset {bereq,req}.request | {bereq,req}.method {beresp,obj,resp}.response | {beresp,obj,resp}.reason req.backend | req.backend_hint req.backend.healthy | std.healthy(backend) req.grace | - req.* in vcl_backend_response | bereq.* {client,server}.port | std.port({client,server}.ip) return (hit_for_pass) | set beresp.uncacheable = true;<br/>return (deliver); return (lookup) in vcl_recv | return (hash) return (hash) in vcl_hash | return (lookup) synthetic .. | synthetic(..) Might be implemented: V3 | V4 :-- | :-- | import directors<br/>new xx = directors.yy();<br/>xx.add_backend(ss);<br/>set req.backend_hint = xx.backend() obj.last_use | obj.hits - writing to | Won't be implemented: V3 | V4 :-- | :-- - | vcl 4.0
varnish3to4 =========== A script to assist migrating a VCL file from Varnish 3 to 4. Currently understands: V3 | V4 :-- | :-- vcl_fetch | vcl_backend_response vcl_error | vcl_synth error code response | return (vcl_synth(code, response)) remove | unset {bereq,req}.request | {bereq,req}.method {beresp,obj,resp}.response | {beresp,obj,resp}.reason req.backend | req.backend_hint req.backend.healthy | std.healthy(backend) req.grace | - req.* in vcl_backend_response | bereq.* {client,server}.port | std.port({client,server}.ip) return (hit_for_pass) | set beresp.uncacheable = true;<br/>return (deliver); return (lookup) in vcl_recv | return (hash) return (hash) in vcl_hash | return (lookup) synthetic .. | synthetic(..) Might be implemented: V3 | V4 :-- | :-- | import directors<br/>new xx = directors.yy();<br/>xx.add_backend(ss);<br/>set req.backend_hint = xx.backend() obj.last_use | obj.hits - writing to | purge | return (purge) Won't be implemented: V3 | V4 :-- | :-- - | vcl 4.0
Add purge -> return (purge)
Add purge -> return (purge)
Markdown
bsd-2-clause
fgsch/varnish3to4,fgsch/varnish3to4
markdown
## Code Before: varnish3to4 =========== A script to assist migrating a VCL file from Varnish 3 to 4. Currently understands: V3 | V4 :-- | :-- vcl_fetch | vcl_backend_response vcl_error | vcl_synth error code response | return (vcl_synth(code, response)) remove | unset {bereq,req}.request | {bereq,req}.method {beresp,obj,resp}.response | {beresp,obj,resp}.reason req.backend | req.backend_hint req.backend.healthy | std.healthy(backend) req.grace | - req.* in vcl_backend_response | bereq.* {client,server}.port | std.port({client,server}.ip) return (hit_for_pass) | set beresp.uncacheable = true;<br/>return (deliver); return (lookup) in vcl_recv | return (hash) return (hash) in vcl_hash | return (lookup) synthetic .. | synthetic(..) Might be implemented: V3 | V4 :-- | :-- | import directors<br/>new xx = directors.yy();<br/>xx.add_backend(ss);<br/>set req.backend_hint = xx.backend() obj.last_use | obj.hits - writing to | Won't be implemented: V3 | V4 :-- | :-- - | vcl 4.0 ## Instruction: Add purge -> return (purge) ## Code After: varnish3to4 =========== A script to assist migrating a VCL file from Varnish 3 to 4. Currently understands: V3 | V4 :-- | :-- vcl_fetch | vcl_backend_response vcl_error | vcl_synth error code response | return (vcl_synth(code, response)) remove | unset {bereq,req}.request | {bereq,req}.method {beresp,obj,resp}.response | {beresp,obj,resp}.reason req.backend | req.backend_hint req.backend.healthy | std.healthy(backend) req.grace | - req.* in vcl_backend_response | bereq.* {client,server}.port | std.port({client,server}.ip) return (hit_for_pass) | set beresp.uncacheable = true;<br/>return (deliver); return (lookup) in vcl_recv | return (hash) return (hash) in vcl_hash | return (lookup) synthetic .. | synthetic(..) Might be implemented: V3 | V4 :-- | :-- | import directors<br/>new xx = directors.yy();<br/>xx.add_backend(ss);<br/>set req.backend_hint = xx.backend() obj.last_use | obj.hits - writing to | purge | return (purge) Won't be implemented: V3 | V4 :-- | :-- - | vcl 4.0
90ddaaf32fea22932fb35574d7d3b82f12d7f3a3
pages/es/_data/nav.yml
pages/es/_data/nav.yml
- title: Apps & Juegos desc: Descubra recursos para comenzar a crear sus aplicaciones de Android, aplicaciones web y juegos para Chrome OS. icon: game-controller sections: - title: Adaptar Android url: android - title: Adaptar Web url: web - title: Juegos url: games - title: Publicar desc: Obtén información sobre cómo publicar tus aplicaciones en Google Play Store e involucra a millones de usuarios en Chromebooks. url: publish icon: game-controller alt: publish - title: Desarrollo desc: Utilice Chrome OS para desarrollar aplicaciones en un entorno rápido, seguro y sin complicaciones. icon: wrench sections: - title: Linux (Beta) url: linux - title: Entorno para Android url: android-environment - title: Entorno para Web url: web-environment - title: Productividad url: productivity - title: Historias & Noticias url: news alt: stories
- title: Apps & Juegos desc: Descubra recursos para comenzar a crear sus aplicaciones de Android, aplicaciones web y juegos para Chrome OS. icon: game-controller sections: - title: Adaptar Android url: android - title: Adaptar Web url: web - title: Juegos url: games - title: Publicar desc: Obtén información sobre cómo publicar tus aplicaciones en Google Play Store e involucra a millones de usuarios en Chromebooks. url: publish icon: publish alt: publish - title: Desarrollo desc: Utilice Chrome OS para desarrollar aplicaciones en un entorno rápido, seguro y sin complicaciones. icon: wrench sections: - title: Linux (Beta) url: linux - title: Entorno para Android url: android-environment - title: Entorno para Web url: web-environment - title: Productividad url: productivity - title: Historias & Noticias url: news alt: stories
Use correct icon for Spanish's Publish section
Use correct icon for Spanish's Publish section
YAML
apache-2.0
chromeos/chromeos.dev,chromeos/chromeos.dev
yaml
## Code Before: - title: Apps & Juegos desc: Descubra recursos para comenzar a crear sus aplicaciones de Android, aplicaciones web y juegos para Chrome OS. icon: game-controller sections: - title: Adaptar Android url: android - title: Adaptar Web url: web - title: Juegos url: games - title: Publicar desc: Obtén información sobre cómo publicar tus aplicaciones en Google Play Store e involucra a millones de usuarios en Chromebooks. url: publish icon: game-controller alt: publish - title: Desarrollo desc: Utilice Chrome OS para desarrollar aplicaciones en un entorno rápido, seguro y sin complicaciones. icon: wrench sections: - title: Linux (Beta) url: linux - title: Entorno para Android url: android-environment - title: Entorno para Web url: web-environment - title: Productividad url: productivity - title: Historias & Noticias url: news alt: stories ## Instruction: Use correct icon for Spanish's Publish section ## Code After: - title: Apps & Juegos desc: Descubra recursos para comenzar a crear sus aplicaciones de Android, aplicaciones web y juegos para Chrome OS. icon: game-controller sections: - title: Adaptar Android url: android - title: Adaptar Web url: web - title: Juegos url: games - title: Publicar desc: Obtén información sobre cómo publicar tus aplicaciones en Google Play Store e involucra a millones de usuarios en Chromebooks. url: publish icon: publish alt: publish - title: Desarrollo desc: Utilice Chrome OS para desarrollar aplicaciones en un entorno rápido, seguro y sin complicaciones. icon: wrench sections: - title: Linux (Beta) url: linux - title: Entorno para Android url: android-environment - title: Entorno para Web url: web-environment - title: Productividad url: productivity - title: Historias & Noticias url: news alt: stories
5871a4d6a54b03c83d3117ce72009368158d3c57
doc/update_tutorial.sh
doc/update_tutorial.sh
set -e set -u if [ "$(basename $(pwd))" != "doc" ] then echo "Execute this script within the doc folder!" exit 1 fi PWD=$(pwd) function cleanup { cd $PWD rm -rf signac-examples } trap cleanup EXIT git clone --reference ~/local/gitcaches/signac-examples.reference [email protected]:glotzer/signac-examples.git cd signac-examples/ PYTHONPATH=.. scons signac cd ../ find signac-examples/notebooks/static -regex '.*/signac\_[a-z0-9_]*\.ipynb' -exec cp {} ./ \;
set -e set -u if [ "$(basename $(pwd))" != "doc" ] then echo "Execute this script within the doc folder!" exit 1 fi PWD=$(pwd) export PYTHONPATH=$PWD/.. function cleanup { cd $PWD #rm -rf signac-examples } trap cleanup EXIT git clone [email protected]:csadorf/signac-examples.git cd signac-examples/ scons signac cd ../ find signac-examples/notebooks/static -regex '.*/signac\_[a-z0-9_]*\.ipynb' -exec cp {} ./ \;
Use signac-examples github repository instead of bitbucket.
Use signac-examples github repository instead of bitbucket.
Shell
bsd-3-clause
csadorf/signac,csadorf/signac
shell
## Code Before: set -e set -u if [ "$(basename $(pwd))" != "doc" ] then echo "Execute this script within the doc folder!" exit 1 fi PWD=$(pwd) function cleanup { cd $PWD rm -rf signac-examples } trap cleanup EXIT git clone --reference ~/local/gitcaches/signac-examples.reference [email protected]:glotzer/signac-examples.git cd signac-examples/ PYTHONPATH=.. scons signac cd ../ find signac-examples/notebooks/static -regex '.*/signac\_[a-z0-9_]*\.ipynb' -exec cp {} ./ \; ## Instruction: Use signac-examples github repository instead of bitbucket. ## Code After: set -e set -u if [ "$(basename $(pwd))" != "doc" ] then echo "Execute this script within the doc folder!" exit 1 fi PWD=$(pwd) export PYTHONPATH=$PWD/.. function cleanup { cd $PWD #rm -rf signac-examples } trap cleanup EXIT git clone [email protected]:csadorf/signac-examples.git cd signac-examples/ scons signac cd ../ find signac-examples/notebooks/static -regex '.*/signac\_[a-z0-9_]*\.ipynb' -exec cp {} ./ \;
1ae868c781c4bafd2da912ad8c16ac9435346d43
conda.recipe/meta.yaml
conda.recipe/meta.yaml
package: name: radarmodel source: git_url: https://github.com/ryanvolz/radarmodel.git requirements: build: - python - setuptools - cython - numpy run: - python - setuptools - numba - numpy - pyfftw - scipy test: imports: - radarmodel about: home: http://github.com/ryanvolz/radarmodel license: BSD 3-Clause ("BSD New") summary: Mathematical radar models useful for inverting radar measurements
package: name: radarmodel source: path: ../ #git_url: https://github.com/ryanvolz/radarmodel.git requirements: build: - python - setuptools - cython - numpy run: - python - setuptools - numba - numpy - pyfftw - scipy test: imports: - radarmodel about: home: http://github.com/ryanvolz/radarmodel license: BSD 3-Clause ("BSD New") summary: Mathematical radar models useful for inverting radar measurements
Change conda recipe to build from local source instead of github.
Change conda recipe to build from local source instead of github.
YAML
mit
ryanvolz/radarmodel,ryanvolz/radarmodel
yaml
## Code Before: package: name: radarmodel source: git_url: https://github.com/ryanvolz/radarmodel.git requirements: build: - python - setuptools - cython - numpy run: - python - setuptools - numba - numpy - pyfftw - scipy test: imports: - radarmodel about: home: http://github.com/ryanvolz/radarmodel license: BSD 3-Clause ("BSD New") summary: Mathematical radar models useful for inverting radar measurements ## Instruction: Change conda recipe to build from local source instead of github. ## Code After: package: name: radarmodel source: path: ../ #git_url: https://github.com/ryanvolz/radarmodel.git requirements: build: - python - setuptools - cython - numpy run: - python - setuptools - numba - numpy - pyfftw - scipy test: imports: - radarmodel about: home: http://github.com/ryanvolz/radarmodel license: BSD 3-Clause ("BSD New") summary: Mathematical radar models useful for inverting radar measurements
de045fc626d0137f088c0187903b707c24739a1e
README.md
README.md
A simple wrapper for the [Nexmo](http://nexmo.com/) API ======================================================= Installation ------------ Run `gem install nexmo` and `require 'nexmo'`, or do the gemfile/bundle thing if you're using Rails. Usage ----- Construct a client object with your Nexmo API credentials: ```ruby nexmo = Nexmo::Client.new('...KEY...', '...SECRET...') ``` The underlying HTTP object is easily accessible. For example, you may want to adjust the SSL verification when testing locally: ```ruby nexmo.http.verify_mode = OpenSSL::SSL::VERIFY_NONE ``` Use the `send_message` method to send an SMS, passing the API parameters as a hash: ```ruby response = nexmo.send_message({ from: 'RUBY', to: '...NUMBER...', text: 'Hello world' }) ``` If the response is successful you can access the message id, and if it's a failure you can retrieve the error message and/or the underlying HTTP response returned from the server: ```ruby if response.success? # store response.message_id elsif response.failure? # check response.error.message and/or response.http # raise response.error end ``` That's all folks. Chunky bacon.
A simple wrapper for the [Nexmo](http://nexmo.com/) API ======================================================= Installation ------------ Run `gem install nexmo` and `require 'nexmo'`, or do the gemfile/bundle thing if you're using Rails. Usage ----- Construct a client object with your Nexmo API credentials: ```ruby nexmo = Nexmo::Client.new('...KEY...', '...SECRET...') ``` The underlying HTTP object is easily accessible. For example, you may want to adjust the SSL verification when testing locally: ```ruby nexmo.http.verify_mode = OpenSSL::SSL::VERIFY_NONE ``` Use the `send_message` method to send an SMS, passing the API parameters as a hash: ```ruby response = nexmo.send_message({ from: 'RUBY', to: '...NUMBER...', text: 'Hello world' }) ``` Phone numbers should be specified in international format. If the response is successful you can access the message id, and if it's a failure you can retrieve the error message and/or the underlying HTTP response returned from the server: ```ruby if response.success? # store response.message_id elsif response.failure? # check response.error.message and/or response.http # raise response.error end ``` The Nexmo documentation contains a [list of error codes](http://nexmo.com/documentation/index.html#dlr_error) which may be useful if you have problems sending a message. That's all folks. Chunky bacon.
Add note about international formatting of phone numbers and link to nexmo error codes
Add note about international formatting of phone numbers and link to nexmo error codes
Markdown
mit
Nexmo/ruby-nexmo
markdown
## Code Before: A simple wrapper for the [Nexmo](http://nexmo.com/) API ======================================================= Installation ------------ Run `gem install nexmo` and `require 'nexmo'`, or do the gemfile/bundle thing if you're using Rails. Usage ----- Construct a client object with your Nexmo API credentials: ```ruby nexmo = Nexmo::Client.new('...KEY...', '...SECRET...') ``` The underlying HTTP object is easily accessible. For example, you may want to adjust the SSL verification when testing locally: ```ruby nexmo.http.verify_mode = OpenSSL::SSL::VERIFY_NONE ``` Use the `send_message` method to send an SMS, passing the API parameters as a hash: ```ruby response = nexmo.send_message({ from: 'RUBY', to: '...NUMBER...', text: 'Hello world' }) ``` If the response is successful you can access the message id, and if it's a failure you can retrieve the error message and/or the underlying HTTP response returned from the server: ```ruby if response.success? # store response.message_id elsif response.failure? # check response.error.message and/or response.http # raise response.error end ``` That's all folks. Chunky bacon. ## Instruction: Add note about international formatting of phone numbers and link to nexmo error codes ## Code After: A simple wrapper for the [Nexmo](http://nexmo.com/) API ======================================================= Installation ------------ Run `gem install nexmo` and `require 'nexmo'`, or do the gemfile/bundle thing if you're using Rails. Usage ----- Construct a client object with your Nexmo API credentials: ```ruby nexmo = Nexmo::Client.new('...KEY...', '...SECRET...') ``` The underlying HTTP object is easily accessible. For example, you may want to adjust the SSL verification when testing locally: ```ruby nexmo.http.verify_mode = OpenSSL::SSL::VERIFY_NONE ``` Use the `send_message` method to send an SMS, passing the API parameters as a hash: ```ruby response = nexmo.send_message({ from: 'RUBY', to: '...NUMBER...', text: 'Hello world' }) ``` Phone numbers should be specified in international format. If the response is successful you can access the message id, and if it's a failure you can retrieve the error message and/or the underlying HTTP response returned from the server: ```ruby if response.success? # store response.message_id elsif response.failure? # check response.error.message and/or response.http # raise response.error end ``` The Nexmo documentation contains a [list of error codes](http://nexmo.com/documentation/index.html#dlr_error) which may be useful if you have problems sending a message. That's all folks. Chunky bacon.
b6bf15de7fa51a79f55f3f34f0398685c8765a00
app/views/logs/show.html.erb
app/views/logs/show.html.erb
<h1><%= @log.entry_name %></h1> <div class="links"> <p> <%= link_to "Edit", edit_log_path(@log) %> | <%= link_to "Destroy", log_path(@log), method: :delete %> </p> </div> <h3>Countries</h3> <ul> <% @log.countries.each do |country| %> <li><%= country.name %></li> <% end %> </ul> <h3>Custom Locations</h3> <ul> <% @log.custom_locations.each do |custom_location| %> <li><%= custom_location.name %></li> <% end %> </ul>
<h1><%= @log.entry_name %></h1> <div class="links"> <p> <%= link_to "Edit", edit_log_path(@log) %> | <%= link_to "Destroy", log_path(@log), method: :delete %> | <%= link_to "All Logs", logs_path %> </p> </div> <h3>Countries</h3> <ul> <% @log.countries.each do |country| %> <li><%= country.name %></li> <% end %> </ul> <h3>Custom Locations</h3> <ul> <% @log.custom_locations.each do |custom_location| %> <li><%= custom_location.name %></li> <% end %> </ul>
Add link to index on show
Add link to index on show
HTML+ERB
mit
kyletolle/has-many-through-polymorphic,kyletolle/has-many-through-polymorphic
html+erb
## Code Before: <h1><%= @log.entry_name %></h1> <div class="links"> <p> <%= link_to "Edit", edit_log_path(@log) %> | <%= link_to "Destroy", log_path(@log), method: :delete %> </p> </div> <h3>Countries</h3> <ul> <% @log.countries.each do |country| %> <li><%= country.name %></li> <% end %> </ul> <h3>Custom Locations</h3> <ul> <% @log.custom_locations.each do |custom_location| %> <li><%= custom_location.name %></li> <% end %> </ul> ## Instruction: Add link to index on show ## Code After: <h1><%= @log.entry_name %></h1> <div class="links"> <p> <%= link_to "Edit", edit_log_path(@log) %> | <%= link_to "Destroy", log_path(@log), method: :delete %> | <%= link_to "All Logs", logs_path %> </p> </div> <h3>Countries</h3> <ul> <% @log.countries.each do |country| %> <li><%= country.name %></li> <% end %> </ul> <h3>Custom Locations</h3> <ul> <% @log.custom_locations.each do |custom_location| %> <li><%= custom_location.name %></li> <% end %> </ul>
a60dc6d648f5343690e0a6578ac1638f9e07a856
code/manifest.json
code/manifest.json
{ "manifest_version": 2, "name": "Google Calendar Scroll Disabler", "version": "0.1", "icons": { "16": "icon16.png", "48": "icon48.png" }, "content_scripts": [ { "matches": [ "https://www.google.com/calendar/*" ], "js": ["jquery-2.1.4.min.js", "content.js"] } ] }
{ "manifest_version": 2, "name": "Google Calendar Scroll Disabler", "version": "0.2", "icons": { "16": "icon16.png", "48": "icon48.png" }, "content_scripts": [ { "matches": [ "https://calendar.google.com/calendar/*" ], "js": ["jquery-2.1.4.min.js", "content.js"] } ] }
Migrate to new Google Calendar domain
Migrate to new Google Calendar domain
JSON
apache-2.0
alter-ego/google-calendar-scroll-disabler
json
## Code Before: { "manifest_version": 2, "name": "Google Calendar Scroll Disabler", "version": "0.1", "icons": { "16": "icon16.png", "48": "icon48.png" }, "content_scripts": [ { "matches": [ "https://www.google.com/calendar/*" ], "js": ["jquery-2.1.4.min.js", "content.js"] } ] } ## Instruction: Migrate to new Google Calendar domain ## Code After: { "manifest_version": 2, "name": "Google Calendar Scroll Disabler", "version": "0.2", "icons": { "16": "icon16.png", "48": "icon48.png" }, "content_scripts": [ { "matches": [ "https://calendar.google.com/calendar/*" ], "js": ["jquery-2.1.4.min.js", "content.js"] } ] }
d076080ea0b8bbb24fa4287361203c3ea4d0fa2c
scalameta/io/jvm/src/main/scala/scala/meta/internal/io/PlatformFileIO.scala
scalameta/io/jvm/src/main/scala/scala/meta/internal/io/PlatformFileIO.scala
package scala.meta.internal.io import java.net.URI import java.nio.charset.Charset import java.nio.file.FileVisitOption import scala.meta.io._ import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths import java.nio.file.SimpleFileVisitor object PlatformFileIO { def readAllBytes(uri: URI): Array[Byte] = InputStreamIO.readBytes(uri.toURL.openStream()) def readAllBytes(path: AbsolutePath): Array[Byte] = Files.readAllBytes(path.toNIO) def slurp(path: AbsolutePath, charset: Charset): String = scala.io.Source.fromFile(path.toFile)(scala.io.Codec(charset)).mkString def listFiles(path: AbsolutePath): ListFiles = new ListFiles(path, Option(path.toFile.list()).toList.flatten.map(RelativePath.apply)) def isFile(path: AbsolutePath): Boolean = Files.isRegularFile(path.path) def isDirectory(path: AbsolutePath): Boolean = Files.isDirectory(path.path) def listAllFilesRecursively(root: AbsolutePath): ListFiles = { import scala.collection.JavaConverters._ val relativeFiles = Files .walk(root.toNIO) .iterator() .asScala .collect { case path if Files.isRegularFile(path) => RelativePath(root.path.relativize(path)) } .toSeq new ListFiles(root, relativeFiles) } }
package scala.meta.internal.io import java.net.URI import java.nio.charset.Charset import java.nio.file.FileVisitOption import scala.meta.io._ import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths import java.nio.file.SimpleFileVisitor import java.util.stream.Collectors object PlatformFileIO { def readAllBytes(uri: URI): Array[Byte] = InputStreamIO.readBytes(uri.toURL.openStream()) def readAllBytes(path: AbsolutePath): Array[Byte] = Files.readAllBytes(path.toNIO) def slurp(path: AbsolutePath, charset: Charset): String = scala.io.Source.fromFile(path.toFile)(scala.io.Codec(charset)).mkString def listFiles(path: AbsolutePath): ListFiles = new ListFiles(path, Option(path.toFile.list()).toList.flatten.map(RelativePath.apply)) def isFile(path: AbsolutePath): Boolean = Files.isRegularFile(path.path) def isDirectory(path: AbsolutePath): Boolean = Files.isDirectory(path.path) def listAllFilesRecursively(root: AbsolutePath): ListFiles = { import scala.collection.JavaConverters._ val relativeFiles = Files .walk(root.toNIO) .collect(Collectors.toList[Path]) .asScala .collect { case path if Files.isRegularFile(path) => RelativePath(root.path.relativize(path)) } new ListFiles(root, relativeFiles) } }
Use nio collectors to safely close stream.
Use nio collectors to safely close stream.
Scala
bsd-3-clause
DavidDudson/scalameta,MasseGuillaume/scalameta,olafurpg/scalameta,xeno-by/scalameta,xeno-by/scalameta,scalameta/scalameta,MasseGuillaume/scalameta,olafurpg/scalameta,xeno-by/scalameta,DavidDudson/scalameta,scalameta/scalameta,scalameta/scalameta,scalameta/scalameta,MasseGuillaume/scalameta,olafurpg/scalameta,scalameta/scalameta
scala
## Code Before: package scala.meta.internal.io import java.net.URI import java.nio.charset.Charset import java.nio.file.FileVisitOption import scala.meta.io._ import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths import java.nio.file.SimpleFileVisitor object PlatformFileIO { def readAllBytes(uri: URI): Array[Byte] = InputStreamIO.readBytes(uri.toURL.openStream()) def readAllBytes(path: AbsolutePath): Array[Byte] = Files.readAllBytes(path.toNIO) def slurp(path: AbsolutePath, charset: Charset): String = scala.io.Source.fromFile(path.toFile)(scala.io.Codec(charset)).mkString def listFiles(path: AbsolutePath): ListFiles = new ListFiles(path, Option(path.toFile.list()).toList.flatten.map(RelativePath.apply)) def isFile(path: AbsolutePath): Boolean = Files.isRegularFile(path.path) def isDirectory(path: AbsolutePath): Boolean = Files.isDirectory(path.path) def listAllFilesRecursively(root: AbsolutePath): ListFiles = { import scala.collection.JavaConverters._ val relativeFiles = Files .walk(root.toNIO) .iterator() .asScala .collect { case path if Files.isRegularFile(path) => RelativePath(root.path.relativize(path)) } .toSeq new ListFiles(root, relativeFiles) } } ## Instruction: Use nio collectors to safely close stream. ## Code After: package scala.meta.internal.io import java.net.URI import java.nio.charset.Charset import java.nio.file.FileVisitOption import scala.meta.io._ import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths import java.nio.file.SimpleFileVisitor import java.util.stream.Collectors object PlatformFileIO { def readAllBytes(uri: URI): Array[Byte] = InputStreamIO.readBytes(uri.toURL.openStream()) def readAllBytes(path: AbsolutePath): Array[Byte] = Files.readAllBytes(path.toNIO) def slurp(path: AbsolutePath, charset: Charset): String = scala.io.Source.fromFile(path.toFile)(scala.io.Codec(charset)).mkString def listFiles(path: AbsolutePath): ListFiles = new ListFiles(path, Option(path.toFile.list()).toList.flatten.map(RelativePath.apply)) def isFile(path: AbsolutePath): Boolean = Files.isRegularFile(path.path) def isDirectory(path: AbsolutePath): Boolean = Files.isDirectory(path.path) def listAllFilesRecursively(root: AbsolutePath): ListFiles = { import scala.collection.JavaConverters._ val relativeFiles = Files .walk(root.toNIO) .collect(Collectors.toList[Path]) .asScala .collect { case path if Files.isRegularFile(path) => RelativePath(root.path.relativize(path)) } new ListFiles(root, relativeFiles) } }
134fb48961a03bc17b34154b54875b543f1f27b8
legcoscraper/scripts/report-summary.py
legcoscraper/scripts/report-summary.py
import argparse import json from collections import Counter from pprint import pprint parser = argparse.ArgumentParser() parser.add_argument("json_file", type=str, help="JSON data file from scraper") args = parser.parse_args() type_count = Counter() infile = open(args.json_file, 'r') for line in infile.readlines(): try: data_obj = json.loads(line) except: pass type_count[data_obj['type']] += 1 pprint(dict(type_count))
import argparse import json from collections import Counter from pprint import pprint import re parser = argparse.ArgumentParser() parser.add_argument("json_file", type=str, help="JSON data file from scraper") args = parser.parse_args() type_count = Counter() year_count = Counter() year_regex = re.compile('(?P<year>\d\d\d\d)') infile = open(args.json_file, 'r') for line in infile.readlines(): try: data_obj = json.loads(line) except: pass type_count[data_obj['type']] += 1 if data_obj['type'] == 'HansardRecord': if data_obj.has_key('date'): print data_obj['date'].encode('utf-8') match = year_regex.search(data_obj['date']) year = int(match.groupdict()['year']) year_count[year] += 1 else: print "NO DATE" pprint(data_obj) pprint(dict(type_count)) pprint(dict(year_count))
Print count summaries for Hansard by year
Print count summaries for Hansard by year
Python
mit
comsaint/legco-watch,legco-watch/legco-watch,comsaint/legco-watch,legco-watch/legco-watch,legco-watch/legco-watch,comsaint/legco-watch,comsaint/legco-watch,legco-watch/legco-watch
python
## Code Before: import argparse import json from collections import Counter from pprint import pprint parser = argparse.ArgumentParser() parser.add_argument("json_file", type=str, help="JSON data file from scraper") args = parser.parse_args() type_count = Counter() infile = open(args.json_file, 'r') for line in infile.readlines(): try: data_obj = json.loads(line) except: pass type_count[data_obj['type']] += 1 pprint(dict(type_count)) ## Instruction: Print count summaries for Hansard by year ## Code After: import argparse import json from collections import Counter from pprint import pprint import re parser = argparse.ArgumentParser() parser.add_argument("json_file", type=str, help="JSON data file from scraper") args = parser.parse_args() type_count = Counter() year_count = Counter() year_regex = re.compile('(?P<year>\d\d\d\d)') infile = open(args.json_file, 'r') for line in infile.readlines(): try: data_obj = json.loads(line) except: pass type_count[data_obj['type']] += 1 if data_obj['type'] == 'HansardRecord': if data_obj.has_key('date'): print data_obj['date'].encode('utf-8') match = year_regex.search(data_obj['date']) year = int(match.groupdict()['year']) year_count[year] += 1 else: print "NO DATE" pprint(data_obj) pprint(dict(type_count)) pprint(dict(year_count))
7eb5fed22b0a84342452309f283c15e9f0931787
.travis.yml
.travis.yml
language: objective-c before_script: - export LANG=en_US.UTF-8 - cd Demo ; pod install ; cd .. xcode_workspace: Demo/RPBorderlessSegmentedControlDemo.xcworkspace xcode_scheme: RPBorderlessSegmentedControlDemo
language: objective-c before_install: - gem install cocoapods before_script: - export LANG=en_US.UTF-8 - cd Demo ; pod install ; cd .. xcode_workspace: Demo/RPBorderlessSegmentedControlDemo.xcworkspace xcode_scheme: RPBorderlessSegmentedControlDemo
Install cocoapods on Travis before build
Install cocoapods on Travis before build
YAML
mit
RobotsAndPencils/RPBorderlessSegmentedControl,RobotsAndPencils/RPBorderlessSegmentedControl,alldritt/RPBorderlessSegmentedControl,RobotsAndPencils/RPBorderlessSegmentedControl
yaml
## Code Before: language: objective-c before_script: - export LANG=en_US.UTF-8 - cd Demo ; pod install ; cd .. xcode_workspace: Demo/RPBorderlessSegmentedControlDemo.xcworkspace xcode_scheme: RPBorderlessSegmentedControlDemo ## Instruction: Install cocoapods on Travis before build ## Code After: language: objective-c before_install: - gem install cocoapods before_script: - export LANG=en_US.UTF-8 - cd Demo ; pod install ; cd .. xcode_workspace: Demo/RPBorderlessSegmentedControlDemo.xcworkspace xcode_scheme: RPBorderlessSegmentedControlDemo
2229367a3e1d6dca3b8007ae4923442fbbc76f74
.travis.yml
.travis.yml
language: node_js node_js: - "0.10" before_script: npm test
language: node_js node_js: - "0.10" before_script: node build.js build after: npm test
Update Travis.yml with before_script and script configuration.
Update Travis.yml with before_script and script configuration.
YAML
mit
CoNarrative/glujs,CoNarrative/glujs,codekoala/glujs,codekoala/glujs,CoNarrative/glujs,codekoala/glujs
yaml
## Code Before: language: node_js node_js: - "0.10" before_script: npm test ## Instruction: Update Travis.yml with before_script and script configuration. ## Code After: language: node_js node_js: - "0.10" before_script: node build.js build after: npm test
b360acfc0c250fe786044eaa44e9c9b93cd99aaf
waypoints_navigation/package.xml
waypoints_navigation/package.xml
<?xml version="1.0"?> <package> <name>waypoints_navigation</name> <version>0.1.1</version> <description>The waypoints_navigation package</description> <maintainer email="[email protected]">Daiki Maekawa</maintainer> <author>Daiki Maekawa</author> <license>BSD</license> <buildtool_depend>catkin</buildtool_depend> <build_depend>move_base</build_depend> <build_depend>yaml-cpp</build_depend> <run_depend>move_base</run_depend> <run_depend>yaml-cpp</run_depend> <export> </export> </package>
<?xml version="1.0"?> <package> <name>waypoints_navigation</name> <version>0.1.1</version> <description>The waypoints_navigation package</description> <maintainer email="[email protected]">Daiki Maekawa</maintainer> <author>Daiki Maekawa</author> <url type="website">http://wiki.ros.org/waypoints_navigation</url> <license>BSD</license> <buildtool_depend>catkin</buildtool_depend> <build_depend>move_base</build_depend> <build_depend>yaml-cpp</build_depend> <run_depend>move_base</run_depend> <run_depend>yaml-cpp</run_depend> <export> </export> </package>
Add link to wiki page
Add link to wiki page
XML
bsd-2-clause
open-rdc/icart_mini,open-rdc/icart,open-rdc/icart_mini,open-rdc/icart
xml
## Code Before: <?xml version="1.0"?> <package> <name>waypoints_navigation</name> <version>0.1.1</version> <description>The waypoints_navigation package</description> <maintainer email="[email protected]">Daiki Maekawa</maintainer> <author>Daiki Maekawa</author> <license>BSD</license> <buildtool_depend>catkin</buildtool_depend> <build_depend>move_base</build_depend> <build_depend>yaml-cpp</build_depend> <run_depend>move_base</run_depend> <run_depend>yaml-cpp</run_depend> <export> </export> </package> ## Instruction: Add link to wiki page ## Code After: <?xml version="1.0"?> <package> <name>waypoints_navigation</name> <version>0.1.1</version> <description>The waypoints_navigation package</description> <maintainer email="[email protected]">Daiki Maekawa</maintainer> <author>Daiki Maekawa</author> <url type="website">http://wiki.ros.org/waypoints_navigation</url> <license>BSD</license> <buildtool_depend>catkin</buildtool_depend> <build_depend>move_base</build_depend> <build_depend>yaml-cpp</build_depend> <run_depend>move_base</run_depend> <run_depend>yaml-cpp</run_depend> <export> </export> </package>
cdc0a84bdae039b871744f7e7fad4eee9ffacda9
api/scheduling/index.js
api/scheduling/index.js
var app = require('express'); const router = app.Router({ mergeParams: true }); var retrieval = require('../retrieval/retrieval'); var schedule = require('./algorithms-courseformat/courseMatrixUsage') router.get('/', function(req, res){ if (!req.query.hasOwnProperty('courses')){ res.status(400).json({message:"Make sure to include an courses GET parameter as JSON array"}); } var courseSelection = JSON.parse(req.query.courses); var coursesLen = courseSelection.length; var courses = []; courseSelection.forEach(function(element) { retrieval.getSingleCourseByCode(element, function(course){ if (course){ courses.push(course); } else { --coursesLen; } if (courses.length == coursesLen){ var sched = schedule.genScheds(courses); res.status(200).json({data:sched}); } }); }, this); }) module.exports = router;
var app = require('express'); const router = app.Router({ mergeParams: true }); var retrieval = require('../retrieval/retrieval'); var schedule = require('./algorithms-courseformat/courseMatrixUsage') // .../api/scheduling?courses=['course1','course2',...,'courseN'] router.get('/', function(req, res){ if (!req.query.hasOwnProperty('courses')){ res.status(400).json({message:"Make sure to include an courses GET parameter as JSON array"}); } var courseSelection = JSON.parse(req.query.courses); var coursesLen = courseSelection.length; var courses = []; courseSelection.forEach(function(element) { retrieval.getSingleCourseByCode(element, function(course){ if (course){ courses.push(course); } else { --coursesLen; } if (courses.length == coursesLen){ var sched = schedule.genScheds(courses); res.status(200).json({data:sched}); } }); }, this); }) module.exports = router;
Comment added; Scheduling still in question
Comment added; Scheduling still in question
JavaScript
bsd-3-clause
alexram1313/course-scheduler-node,alexram1313/course-scheduler-node,alexram1313/course-scheduler-node
javascript
## Code Before: var app = require('express'); const router = app.Router({ mergeParams: true }); var retrieval = require('../retrieval/retrieval'); var schedule = require('./algorithms-courseformat/courseMatrixUsage') router.get('/', function(req, res){ if (!req.query.hasOwnProperty('courses')){ res.status(400).json({message:"Make sure to include an courses GET parameter as JSON array"}); } var courseSelection = JSON.parse(req.query.courses); var coursesLen = courseSelection.length; var courses = []; courseSelection.forEach(function(element) { retrieval.getSingleCourseByCode(element, function(course){ if (course){ courses.push(course); } else { --coursesLen; } if (courses.length == coursesLen){ var sched = schedule.genScheds(courses); res.status(200).json({data:sched}); } }); }, this); }) module.exports = router; ## Instruction: Comment added; Scheduling still in question ## Code After: var app = require('express'); const router = app.Router({ mergeParams: true }); var retrieval = require('../retrieval/retrieval'); var schedule = require('./algorithms-courseformat/courseMatrixUsage') // .../api/scheduling?courses=['course1','course2',...,'courseN'] router.get('/', function(req, res){ if (!req.query.hasOwnProperty('courses')){ res.status(400).json({message:"Make sure to include an courses GET parameter as JSON array"}); } var courseSelection = JSON.parse(req.query.courses); var coursesLen = courseSelection.length; var courses = []; courseSelection.forEach(function(element) { retrieval.getSingleCourseByCode(element, function(course){ if (course){ courses.push(course); } else { --coursesLen; } if (courses.length == coursesLen){ var sched = schedule.genScheds(courses); res.status(200).json({data:sched}); } }); }, this); }) module.exports = router;
81dd29b63f88d166294dbacf33cad6e07fc1e9cd
lib/bourgeois/presenter.rb
lib/bourgeois/presenter.rb
module Bourgeois class Presenter < ::SimpleDelegator def initialize(object, view = nil) @view = view super(@object = object) end def inspect "#<#{self.class} object=#{@object.inspect}>" end def kind_of?(mod) @object.kind_of?(mod) end def self.model_name klass.model_name end def self.human_attribute_name(*args) klass.human_attribute_name(*args) end private def view @view end def self.klass @klass ||= self.name.split(/Presenter$/).first.constantize end end end
module Bourgeois class Presenter < ::SimpleDelegator def initialize(object, view = nil) @view = view super(@object = object) end # Return a String representation of the presenter + the original object def inspect "#<#{self.class} object=#{@object.inspect}>" end # We need to explicitely define this method because it's not # catched by the delegator def kind_of?(mod) @object.kind_of?(mod) end # ActionView::Helpers::FormBuilder needs this def self.model_name klass.model_name end # ActionView::Helpers::FormBuilder needs this too def self.human_attribute_name(*args) klass.human_attribute_name(*args) end private # Return the view from where the presenter was created def view @view end # Return the original object class based on the presenter class name # We would be able to use `@object.class` but we need this in class methods def self.klass @klass ||= self.name.split(/Presenter$/).first.constantize end end end
Add a few code comments
Add a few code comments
Ruby
bsd-3-clause
mirego/bourgeois
ruby
## Code Before: module Bourgeois class Presenter < ::SimpleDelegator def initialize(object, view = nil) @view = view super(@object = object) end def inspect "#<#{self.class} object=#{@object.inspect}>" end def kind_of?(mod) @object.kind_of?(mod) end def self.model_name klass.model_name end def self.human_attribute_name(*args) klass.human_attribute_name(*args) end private def view @view end def self.klass @klass ||= self.name.split(/Presenter$/).first.constantize end end end ## Instruction: Add a few code comments ## Code After: module Bourgeois class Presenter < ::SimpleDelegator def initialize(object, view = nil) @view = view super(@object = object) end # Return a String representation of the presenter + the original object def inspect "#<#{self.class} object=#{@object.inspect}>" end # We need to explicitely define this method because it's not # catched by the delegator def kind_of?(mod) @object.kind_of?(mod) end # ActionView::Helpers::FormBuilder needs this def self.model_name klass.model_name end # ActionView::Helpers::FormBuilder needs this too def self.human_attribute_name(*args) klass.human_attribute_name(*args) end private # Return the view from where the presenter was created def view @view end # Return the original object class based on the presenter class name # We would be able to use `@object.class` but we need this in class methods def self.klass @klass ||= self.name.split(/Presenter$/).first.constantize end end end
36322116993aed56a40bcc1bfd6cca1ac5138699
source/layouts/layout.html.haml
source/layouts/layout.html.haml
!!! %html %head %meta{charset: "utf-8"} %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"} %meta{content: "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"} %title= current_page.data.title || "OpenFW" = stylesheet_link_tag "all" = javascript_include_tag "modernizr" %body{class: page_classes} %nav.top-bar{"data-topbar" => ""} %ul.title-area %li.name %h1 %a{:href => "#"} OpenFW %li.toggle-topbar.menu-icon %a{:href => "#"} %span Menu %section.top-bar-section %ul.right %li.active= link_to "Get the Code", "https://github.com/OpenFW" %ul.left %li= link_to "About", "#about" %li= link_to "Projects", "#projects" = yield %section#footer .row .small-12.columns %p &copy; 2013 OpenFW = javascript_include_tag "all"
!!! %html %head %meta{charset: "utf-8"} %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"} %meta{content: "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"} %title= current_page.data.title || "OpenFW" = stylesheet_link_tag "all" = javascript_include_tag "modernizr" %body{class: page_classes} %nav.top-bar{"data-topbar" => ""} %ul.title-area %li.name %h1 %a{:href => "#"} OpenFW %li.toggle-topbar.menu-icon %a{:href => "#"} %span Menu %section.top-bar-section %ul.right %li.active= link_to "Get the Code", "https://github.com/OpenFW" %ul.left %li= link_to "About", "#about" %li= link_to "Projects", "#projects" %li= link_to "Data", "http://data.openfw.in" = yield %section#footer .row .small-12.columns %p &copy; 2013 OpenFW = javascript_include_tag "all"
Add link to data portal
Add link to data portal
Haml
mit
OpenFW/openfw-website,OpenFW/openfw-website
haml
## Code Before: !!! %html %head %meta{charset: "utf-8"} %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"} %meta{content: "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"} %title= current_page.data.title || "OpenFW" = stylesheet_link_tag "all" = javascript_include_tag "modernizr" %body{class: page_classes} %nav.top-bar{"data-topbar" => ""} %ul.title-area %li.name %h1 %a{:href => "#"} OpenFW %li.toggle-topbar.menu-icon %a{:href => "#"} %span Menu %section.top-bar-section %ul.right %li.active= link_to "Get the Code", "https://github.com/OpenFW" %ul.left %li= link_to "About", "#about" %li= link_to "Projects", "#projects" = yield %section#footer .row .small-12.columns %p &copy; 2013 OpenFW = javascript_include_tag "all" ## Instruction: Add link to data portal ## Code After: !!! %html %head %meta{charset: "utf-8"} %meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"} %meta{content: "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"} %title= current_page.data.title || "OpenFW" = stylesheet_link_tag "all" = javascript_include_tag "modernizr" %body{class: page_classes} %nav.top-bar{"data-topbar" => ""} %ul.title-area %li.name %h1 %a{:href => "#"} OpenFW %li.toggle-topbar.menu-icon %a{:href => "#"} %span Menu %section.top-bar-section %ul.right %li.active= link_to "Get the Code", "https://github.com/OpenFW" %ul.left %li= link_to "About", "#about" %li= link_to "Projects", "#projects" %li= link_to "Data", "http://data.openfw.in" = yield %section#footer .row .small-12.columns %p &copy; 2013 OpenFW = javascript_include_tag "all"
9db1229f8ac16a1d12b1df9a3b467b347dcd48c9
lib/panoramio-rb.rb
lib/panoramio-rb.rb
require 'rubygems' require 'json' require 'hashie' require 'rest_client' module PanoramioRb URL = 'http://www.panoramio.com/map/get_panoramas.php' DEFAULT_OPTIONS = { :set => :public, # Cant be :public, :full, or a USER ID number :size => :medium, # Cant be :original, :medium (default value), :small, :thumbnail, :square, :mini_square :from => 0, :to => 20, :mapfilter => true } def self.request_data(options = {}) panoramio_options = DEFAULT_OPTIONS panoramio_options.merge!(options) response = RestClient.get URL, :params => panoramio_options if response.code == 200 parse_data = JSON.parse(response.to_str) Hashie::Mash.new(parse_data) else raise "Panoramio API error: #{response.code}. Response #{response.to_str}" end end end
require 'rubygems' require 'json' require 'hashie' require 'rest_client' module PanoramioRb URL = 'http://www.panoramio.com/map/get_panoramas.php' DEFAULT_OPTIONS = { :set => :public, # Cant be :public, :full, or a USER ID number :size => :medium, # Cant be :original, :medium (default value), :small, :thumbnail, :square, :mini_square :from => 0, :to => 20, :mapfilter => true } def self.get_panoramas(options = {}) panoramio_options = DEFAULT_OPTIONS panoramio_options.merge!(options) response = RestClient.get URL, :params => panoramio_options if response.code == 200 parse_data = JSON.parse(response.to_str) Hashie::Mash.new(parse_data) else raise "Panoramio API error: #{response.code}. Response #{response.to_str}" end end end
Rename funcion to get panoramas
Rename funcion to get panoramas
Ruby
mit
willywg/panoramio-rb,willywg/panoramio-rb,kesha-antonov/panoramio-rb,kesha-antonov/panoramio-rb,kesha-antonov/panoramio-rb
ruby
## Code Before: require 'rubygems' require 'json' require 'hashie' require 'rest_client' module PanoramioRb URL = 'http://www.panoramio.com/map/get_panoramas.php' DEFAULT_OPTIONS = { :set => :public, # Cant be :public, :full, or a USER ID number :size => :medium, # Cant be :original, :medium (default value), :small, :thumbnail, :square, :mini_square :from => 0, :to => 20, :mapfilter => true } def self.request_data(options = {}) panoramio_options = DEFAULT_OPTIONS panoramio_options.merge!(options) response = RestClient.get URL, :params => panoramio_options if response.code == 200 parse_data = JSON.parse(response.to_str) Hashie::Mash.new(parse_data) else raise "Panoramio API error: #{response.code}. Response #{response.to_str}" end end end ## Instruction: Rename funcion to get panoramas ## Code After: require 'rubygems' require 'json' require 'hashie' require 'rest_client' module PanoramioRb URL = 'http://www.panoramio.com/map/get_panoramas.php' DEFAULT_OPTIONS = { :set => :public, # Cant be :public, :full, or a USER ID number :size => :medium, # Cant be :original, :medium (default value), :small, :thumbnail, :square, :mini_square :from => 0, :to => 20, :mapfilter => true } def self.get_panoramas(options = {}) panoramio_options = DEFAULT_OPTIONS panoramio_options.merge!(options) response = RestClient.get URL, :params => panoramio_options if response.code == 200 parse_data = JSON.parse(response.to_str) Hashie::Mash.new(parse_data) else raise "Panoramio API error: #{response.code}. Response #{response.to_str}" end end end
8190a09ab77fc0407e2e1b41764f6a1f0d9fd3bb
Cargo.toml
Cargo.toml
[package] name = "grust" version = "0.4.0-dev" authors = ["Mikhail Zabaluev <[email protected]>"] license = "LGPL-2.1+" readme = "README.md" keywords = ["GObjectIntrospection", "GLib", "GObject", "GNOME"] description = """GObjectIntrospection bindings for Rust. This is the core library providing basic functionality to all generated crates. """ repository = "https://github.com/gi-rust/grust.git" [dependencies] gtypes = "0.1" glib-2-0-sys = "0.*" gobject-2-0-sys = "0.*" libc = "0.1"
[package] name = "grust" version = "0.4.0-dev" authors = ["Mikhail Zabaluev <[email protected]>"] license = "LGPL-2.1+" readme = "README.md" keywords = ["GObjectIntrospection", "GLib", "GObject", "GNOME"] description = """GObjectIntrospection bindings for Rust. This is the core library providing basic functionality to all generated crates. """ repository = "https://github.com/gi-rust/grust.git" [dependencies] gtypes = "0.1" libc = "0.1" [dependencies.glib-2-0-sys] git = "https://github.com/gi-rust/glib-sys.git" [dependencies.gobject-2-0-sys] git = "https://github.com/gi-rust/gobject-sys.git"
Switch to git-based dependencies for -sys crates
Switch to git-based dependencies for -sys crates The master branch should never be pushed to crates.io. Meanwhile, dependency management of locally installed 0.x versions is going to be tedious.
TOML
lgpl-2.1
gi-rust/grust
toml
## Code Before: [package] name = "grust" version = "0.4.0-dev" authors = ["Mikhail Zabaluev <[email protected]>"] license = "LGPL-2.1+" readme = "README.md" keywords = ["GObjectIntrospection", "GLib", "GObject", "GNOME"] description = """GObjectIntrospection bindings for Rust. This is the core library providing basic functionality to all generated crates. """ repository = "https://github.com/gi-rust/grust.git" [dependencies] gtypes = "0.1" glib-2-0-sys = "0.*" gobject-2-0-sys = "0.*" libc = "0.1" ## Instruction: Switch to git-based dependencies for -sys crates The master branch should never be pushed to crates.io. Meanwhile, dependency management of locally installed 0.x versions is going to be tedious. ## Code After: [package] name = "grust" version = "0.4.0-dev" authors = ["Mikhail Zabaluev <[email protected]>"] license = "LGPL-2.1+" readme = "README.md" keywords = ["GObjectIntrospection", "GLib", "GObject", "GNOME"] description = """GObjectIntrospection bindings for Rust. This is the core library providing basic functionality to all generated crates. """ repository = "https://github.com/gi-rust/grust.git" [dependencies] gtypes = "0.1" libc = "0.1" [dependencies.glib-2-0-sys] git = "https://github.com/gi-rust/glib-sys.git" [dependencies.gobject-2-0-sys] git = "https://github.com/gi-rust/gobject-sys.git"
1f8b11a30b499e92157126c77e1c212e5593d818
Cargo.toml
Cargo.toml
[package] name = "dot_vox" version = "0.1.0" authors = ["David Edmonds <[email protected]>"] description = "A Rust library for loading MagicaVoxel .vox files." license = "MIT" keywords = ['voxel', 'MagicaVoxel', 'game', 'game-dev'] repository = "https://github.com/davidedmonds/dot_vox" readme = "README.md" [dependencies] nom = "^1.2.4" byteorder = "^0.5.3"
[package] name = "dot_vox" version = "0.1.1" authors = ["David Edmonds <[email protected]>"] description = "A Rust library for loading MagicaVoxel .vox files." license = "MIT" keywords = ['voxel', 'MagicaVoxel', 'game', 'game-dev'] documentation = "https://docs.rs/dot_vox" homepage = "https://docs.rs/dot_vox" repository = "https://github.com/davidedmonds/dot_vox" readme = "README.md" [dependencies] nom = "^1.2.4" byteorder = "^0.5.3"
Add links to docs.rs documentation and bump version.
Add links to docs.rs documentation and bump version.
TOML
mit
davidedmonds/dot_vox
toml
## Code Before: [package] name = "dot_vox" version = "0.1.0" authors = ["David Edmonds <[email protected]>"] description = "A Rust library for loading MagicaVoxel .vox files." license = "MIT" keywords = ['voxel', 'MagicaVoxel', 'game', 'game-dev'] repository = "https://github.com/davidedmonds/dot_vox" readme = "README.md" [dependencies] nom = "^1.2.4" byteorder = "^0.5.3" ## Instruction: Add links to docs.rs documentation and bump version. ## Code After: [package] name = "dot_vox" version = "0.1.1" authors = ["David Edmonds <[email protected]>"] description = "A Rust library for loading MagicaVoxel .vox files." license = "MIT" keywords = ['voxel', 'MagicaVoxel', 'game', 'game-dev'] documentation = "https://docs.rs/dot_vox" homepage = "https://docs.rs/dot_vox" repository = "https://github.com/davidedmonds/dot_vox" readme = "README.md" [dependencies] nom = "^1.2.4" byteorder = "^0.5.3"
e1795c6888e4a26bb563623da18217b5c6096e0d
website/src/app/project/experiments/experiment/components/tasks/mc-experiment-task-details.component.js
website/src/app/project/experiments/experiment/components/tasks/mc-experiment-task-details.component.js
angular.module('materialscommons').component('mcExperimentTaskDetails', { templateUrl: 'app/project/experiments/experiment/components/tasks/mc-experiment-task-details.html', controller: MCExperimentTaskDetailsComponentController, bindings: { task: '=' } }); /*@ngInject*/ function MCExperimentTaskDetailsComponentController($scope, editorOpts, currentTask, templates, template, experimentsService, $stateParams, toast) { let ctrl = this; ctrl.currentTask = currentTask.get(); var t = templates.getTemplate('As Received'); template.set(t); $scope.editorOptions = editorOpts({height: 25, width: 20}); ctrl.selectedTemplate = (templateId, processId) => { console.log('selectedTemplate', templateId, processId); }; ctrl.updateTaskNote = () => { console.log('updateTaskNote'); if (ctrl.task.note === null) { ctrl.task.note = ""; } experimentsService.updateTask($stateParams.project_id, $stateParams.experiment_id, ctrl.task.id, {note: ctrl.task.note}) .then( () => null, () => toast.error('Unable to update task note.') ); }; }
angular.module('materialscommons').component('mcExperimentTaskDetails', { templateUrl: 'app/project/experiments/experiment/components/tasks/mc-experiment-task-details.html', controller: MCExperimentTaskDetailsComponentController, bindings: { task: '=' } }); /*@ngInject*/ function MCExperimentTaskDetailsComponentController($scope, editorOpts, currentTask, templates, template, experimentsService, $stateParams, toast) { let ctrl = this; ctrl.currentTask = currentTask.get(); var t = templates.getTemplate('As Received'); template.set(t); $scope.editorOptions = editorOpts({height: 25, width: 20}); ctrl.selectedTemplate = (templateId, processId) => { console.log('selectedTemplate', templateId, processId); }; ctrl.updateTaskNote = () => { if (ctrl.task.note === null) { return; } experimentsService.updateTask($stateParams.project_id, $stateParams.experiment_id, ctrl.task.id, {note: ctrl.task.note}) .then( () => null, () => toast.error('Unable to update task note.') ); }; }
Return if note is null.
Return if note is null.
JavaScript
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
javascript
## Code Before: angular.module('materialscommons').component('mcExperimentTaskDetails', { templateUrl: 'app/project/experiments/experiment/components/tasks/mc-experiment-task-details.html', controller: MCExperimentTaskDetailsComponentController, bindings: { task: '=' } }); /*@ngInject*/ function MCExperimentTaskDetailsComponentController($scope, editorOpts, currentTask, templates, template, experimentsService, $stateParams, toast) { let ctrl = this; ctrl.currentTask = currentTask.get(); var t = templates.getTemplate('As Received'); template.set(t); $scope.editorOptions = editorOpts({height: 25, width: 20}); ctrl.selectedTemplate = (templateId, processId) => { console.log('selectedTemplate', templateId, processId); }; ctrl.updateTaskNote = () => { console.log('updateTaskNote'); if (ctrl.task.note === null) { ctrl.task.note = ""; } experimentsService.updateTask($stateParams.project_id, $stateParams.experiment_id, ctrl.task.id, {note: ctrl.task.note}) .then( () => null, () => toast.error('Unable to update task note.') ); }; } ## Instruction: Return if note is null. ## Code After: angular.module('materialscommons').component('mcExperimentTaskDetails', { templateUrl: 'app/project/experiments/experiment/components/tasks/mc-experiment-task-details.html', controller: MCExperimentTaskDetailsComponentController, bindings: { task: '=' } }); /*@ngInject*/ function MCExperimentTaskDetailsComponentController($scope, editorOpts, currentTask, templates, template, experimentsService, $stateParams, toast) { let ctrl = this; ctrl.currentTask = currentTask.get(); var t = templates.getTemplate('As Received'); template.set(t); $scope.editorOptions = editorOpts({height: 25, width: 20}); ctrl.selectedTemplate = (templateId, processId) => { console.log('selectedTemplate', templateId, processId); }; ctrl.updateTaskNote = () => { if (ctrl.task.note === null) { return; } experimentsService.updateTask($stateParams.project_id, $stateParams.experiment_id, ctrl.task.id, {note: ctrl.task.note}) .then( () => null, () => toast.error('Unable to update task note.') ); }; }
3b146038ca6aebfdc11920cc688903124ccc2b3a
src/ggrc/converters/handlers/document.py
src/ggrc/converters/handlers/document.py
"""Handlers for special object mappings.""" from flask import current_app from ggrc import models from ggrc.login import get_current_user_id from ggrc.converters import errors from ggrc.converters import get_importables from ggrc.converters.handlers import handlers class RequestLinkHandler(handlers.ColumnHandler): def parse_item(self): pass def set_obj_attr(self): pass class RequestEvidenceHandler(RequestLinkHandler): def get_value(self): pass def insert_object(self): pass def set_value(self): """This should be ignored with second class attributes.""" class RequestUrlHandler(RequestLinkHandler): def get_value(self): pass def insert_object(self): pass def set_value(self): """This should be ignored with second class attributes."""
"""Handlers for special object mappings.""" from flask import current_app from ggrc import models from ggrc.login import get_current_user_id from ggrc.converters import errors from ggrc.converters import get_importables from ggrc.converters.handlers import handlers class RequestLinkHandler(handlers.ColumnHandler): def parse_item(self): documents = [] for line in self.raw_value.splitlines(): link, title = line.split(None, 1) if " " in line else (line, line) documents.append(models.Document( link=link, title=title, modified_by_id=get_current_user_id(), context=self.row_converter.obj.context, )) return documents def set_obj_attr(self): self.value = self.parse_item() class RequestEvidenceHandler(RequestLinkHandler): def get_value(self): pass def insert_object(self): pass def set_value(self): """This should be ignored with second class attributes.""" class RequestUrlHandler(RequestLinkHandler): def get_value(self): pass def insert_object(self): pass def set_value(self): """This should be ignored with second class attributes."""
Add import parser for url and evidence
Add import parser for url and evidence
Python
apache-2.0
selahssea/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,edofic/ggrc-core,j0gurt/ggrc-core,plamut/ggrc-core,kr41/ggrc-core,selahssea/ggrc-core,josthkko/ggrc-core,AleksNeStu/ggrc-core,kr41/ggrc-core,kr41/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,josthkko/ggrc-core,VinnieJohns/ggrc-core,kr41/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,josthkko/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,j0gurt/ggrc-core
python
## Code Before: """Handlers for special object mappings.""" from flask import current_app from ggrc import models from ggrc.login import get_current_user_id from ggrc.converters import errors from ggrc.converters import get_importables from ggrc.converters.handlers import handlers class RequestLinkHandler(handlers.ColumnHandler): def parse_item(self): pass def set_obj_attr(self): pass class RequestEvidenceHandler(RequestLinkHandler): def get_value(self): pass def insert_object(self): pass def set_value(self): """This should be ignored with second class attributes.""" class RequestUrlHandler(RequestLinkHandler): def get_value(self): pass def insert_object(self): pass def set_value(self): """This should be ignored with second class attributes.""" ## Instruction: Add import parser for url and evidence ## Code After: """Handlers for special object mappings.""" from flask import current_app from ggrc import models from ggrc.login import get_current_user_id from ggrc.converters import errors from ggrc.converters import get_importables from ggrc.converters.handlers import handlers class RequestLinkHandler(handlers.ColumnHandler): def parse_item(self): documents = [] for line in self.raw_value.splitlines(): link, title = line.split(None, 1) if " " in line else (line, line) documents.append(models.Document( link=link, title=title, modified_by_id=get_current_user_id(), context=self.row_converter.obj.context, )) return documents def set_obj_attr(self): self.value = self.parse_item() class RequestEvidenceHandler(RequestLinkHandler): def get_value(self): pass def insert_object(self): pass def set_value(self): """This should be ignored with second class attributes.""" class RequestUrlHandler(RequestLinkHandler): def get_value(self): pass def insert_object(self): pass def set_value(self): """This should be ignored with second class attributes."""
225e052366ac182cc4c053d23714223c897bfd79
lib/applyDependencies.coffee
lib/applyDependencies.coffee
applyDependencies = (services, resolver) -> wrappedServices = {} for serviceName, serviceDef of services dependencies = {} # we will create keys for any declared dependency types # and have them map to resolved dependencies for dependencyType of serviceDef.dependencies # initialize sub-object for this dependencyType dependencies[dependencyType] = {} # populate it with resolved service references for dependencyName in serviceDef.dependencies[dependencyType] dependencies[dependencyType][dependencyName] = resolver[dependencyType] dependencyName makeWrapper = (serviceName, serviceDef, dependencies) -> wrapper = (args, done) -> serviceDef args, done, dependencies for key in Object.keys serviceDef wrapper[key] = serviceDef[key] wrapper.dependencies = dependencies f = wrapper.callStack[wrapper.callStack.length-1] wrapper.callStack[wrapper.callStack.length-1] = (args, done) -> f args, done, wrapper.dependencies return wrapper wrapper = makeWrapper serviceName, serviceDef, dependencies wrappedServices[serviceName] = wrapper return wrappedServices module.exports = applyDependencies
applyDependencies = (services, resolver) -> wrappedServices = {} for serviceName, serviceDef of services dependencies = {} # we will create keys for any declared dependency types # and have them map to resolved dependencies for dependencyType of serviceDef.dependencies # initialize sub-object for this dependencyType dependencies[dependencyType] = {} # populate it with resolved service references for dependencyName in serviceDef.dependencies[dependencyType] dependencies[dependencyType][dependencyName] = resolver[dependencyType] dependencyName makeWrapper = (serviceName, serviceDef, dependencies) -> # start with a copy of the service up until now wrapper = serviceDef # add a handle to our newly-resolved dependencies wrapper.dependencies = dependencies # grab a reference to the raw service as-defined f = wrapper.callStack[wrapper.callStack.length-1] # pseudo-right curry to inject the `dependencies` reference and # ensure the signature is chain-friendly throughout `callStack` wrapper.callStack[wrapper.callStack.length-1] = (args, done) -> f args, done, wrapper.dependencies return wrapper wrapper = makeWrapper serviceName, serviceDef, dependencies wrappedServices[serviceName] = wrapper return wrappedServices module.exports = applyDependencies
Remove unnecessary manual copying, add comments
Remove unnecessary manual copying, add comments
CoffeeScript
mit
TorchlightSoftware/law
coffeescript
## Code Before: applyDependencies = (services, resolver) -> wrappedServices = {} for serviceName, serviceDef of services dependencies = {} # we will create keys for any declared dependency types # and have them map to resolved dependencies for dependencyType of serviceDef.dependencies # initialize sub-object for this dependencyType dependencies[dependencyType] = {} # populate it with resolved service references for dependencyName in serviceDef.dependencies[dependencyType] dependencies[dependencyType][dependencyName] = resolver[dependencyType] dependencyName makeWrapper = (serviceName, serviceDef, dependencies) -> wrapper = (args, done) -> serviceDef args, done, dependencies for key in Object.keys serviceDef wrapper[key] = serviceDef[key] wrapper.dependencies = dependencies f = wrapper.callStack[wrapper.callStack.length-1] wrapper.callStack[wrapper.callStack.length-1] = (args, done) -> f args, done, wrapper.dependencies return wrapper wrapper = makeWrapper serviceName, serviceDef, dependencies wrappedServices[serviceName] = wrapper return wrappedServices module.exports = applyDependencies ## Instruction: Remove unnecessary manual copying, add comments ## Code After: applyDependencies = (services, resolver) -> wrappedServices = {} for serviceName, serviceDef of services dependencies = {} # we will create keys for any declared dependency types # and have them map to resolved dependencies for dependencyType of serviceDef.dependencies # initialize sub-object for this dependencyType dependencies[dependencyType] = {} # populate it with resolved service references for dependencyName in serviceDef.dependencies[dependencyType] dependencies[dependencyType][dependencyName] = resolver[dependencyType] dependencyName makeWrapper = (serviceName, serviceDef, dependencies) -> # start with a copy of the service up until now wrapper = serviceDef # add a handle to our newly-resolved dependencies wrapper.dependencies = dependencies # grab a reference to the raw service as-defined f = wrapper.callStack[wrapper.callStack.length-1] # pseudo-right curry to inject the `dependencies` reference and # ensure the signature is chain-friendly throughout `callStack` wrapper.callStack[wrapper.callStack.length-1] = (args, done) -> f args, done, wrapper.dependencies return wrapper wrapper = makeWrapper serviceName, serviceDef, dependencies wrappedServices[serviceName] = wrapper return wrappedServices module.exports = applyDependencies
36dd94919a78b96cc2583b30da7ba762d181ba4c
app/views/events/index.html.erb
app/views/events/index.html.erb
<h1>Listing events</h1> <h2>Category: <%= @category.to_s %></h2> <div style="float:left"> <table> <tr> <th>Name</th> <th>Description</th> <th>Position</th> <th></th> <th></th> <th></th> </tr> <% @events.each do |event| %> <tr> <td><%= event.name %></td> <td><%= event.description %></td> <td><%= event.position %></td> <td><%= link_to 'Event Choices', event_event_choices_path(event) %></td> <td><%= link_to 'Edit', edit_event_path(event) %></td> <td><%= link_to 'Destroy', event, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% event.event_choices.each do |event_choice| %> <tr> <th>Event Choice</th> <td><%= event_choice.label %></td> <td><%= event_choice.cell_type %></td> <td><%= event_choice.position %></td> </tr> <% end %> <% end %> </table> <br /> <h3>New Event</h3> <%= render :partial => "form" %> </div> <div style="float: right"> <%= render :partial => "/attending/preview" %> </div>
<h1>Listing events</h1> <h2>Category: <%= @category.to_s %></h2> <div style="float:left"> <table> <tr> <th>Name</th> <th>Description</th> <th>Position</th> <th></th> <th></th> <th></th> </tr> <% @events.each do |event| %> <tr> <td><%= event.name %></td> <td><%= event.description %></td> <td><%= event.position %></td> <td><%= link_to 'Event Choices', event_event_choices_path(event) %></td> <td><%= link_to 'Edit', edit_event_path(event) %></td> <td><%= link_to 'Destroy', event, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% event.event_choices.each do |event_choice| %> <tr> <th>Event Choice</th> <td><%= event_choice.label %></td> <td><%= event_choice.cell_type %></td> <td><%= event_choice.position %></td> </tr> <% end %> <% end %> </table> <br /> <h3>New Event</h3> <%= render :partial => "form" %> <%= link_to 'Back', categories_path %> </div> <div style="float: right"> <%= render :partial => "/attending/preview" %> </div>
Add link from Events page to Categories page
Add link from Events page to Categories page
HTML+ERB
mit
rdunlop/unicycling-registration,scotthue/unicycling-registration,scotthue/unicycling-registration,rdunlop/unicycling-registration,scotthue/unicycling-registration,rdunlop/unicycling-registration,rdunlop/unicycling-registration
html+erb
## Code Before: <h1>Listing events</h1> <h2>Category: <%= @category.to_s %></h2> <div style="float:left"> <table> <tr> <th>Name</th> <th>Description</th> <th>Position</th> <th></th> <th></th> <th></th> </tr> <% @events.each do |event| %> <tr> <td><%= event.name %></td> <td><%= event.description %></td> <td><%= event.position %></td> <td><%= link_to 'Event Choices', event_event_choices_path(event) %></td> <td><%= link_to 'Edit', edit_event_path(event) %></td> <td><%= link_to 'Destroy', event, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% event.event_choices.each do |event_choice| %> <tr> <th>Event Choice</th> <td><%= event_choice.label %></td> <td><%= event_choice.cell_type %></td> <td><%= event_choice.position %></td> </tr> <% end %> <% end %> </table> <br /> <h3>New Event</h3> <%= render :partial => "form" %> </div> <div style="float: right"> <%= render :partial => "/attending/preview" %> </div> ## Instruction: Add link from Events page to Categories page ## Code After: <h1>Listing events</h1> <h2>Category: <%= @category.to_s %></h2> <div style="float:left"> <table> <tr> <th>Name</th> <th>Description</th> <th>Position</th> <th></th> <th></th> <th></th> </tr> <% @events.each do |event| %> <tr> <td><%= event.name %></td> <td><%= event.description %></td> <td><%= event.position %></td> <td><%= link_to 'Event Choices', event_event_choices_path(event) %></td> <td><%= link_to 'Edit', edit_event_path(event) %></td> <td><%= link_to 'Destroy', event, method: :delete, data: { confirm: 'Are you sure?' } %></td> </tr> <% event.event_choices.each do |event_choice| %> <tr> <th>Event Choice</th> <td><%= event_choice.label %></td> <td><%= event_choice.cell_type %></td> <td><%= event_choice.position %></td> </tr> <% end %> <% end %> </table> <br /> <h3>New Event</h3> <%= render :partial => "form" %> <%= link_to 'Back', categories_path %> </div> <div style="float: right"> <%= render :partial => "/attending/preview" %> </div>
c4987264ace27b59cd0c8eeb893b267e6c32e3b8
spec/controllers/admin/sidebar_controller_spec.rb
spec/controllers/admin/sidebar_controller_spec.rb
require 'rails_helper' describe Admin::SidebarController, type: :controller do let!(:blog) { create(:blog) } before do henri = create(:user, :as_admin) sign_in henri end describe 'rendering' do render_views it 'test_index' do get :index assert_template 'index' assert_select 'div[id="sidebar-config"]' end end describe '#update' do it 'updates content' do sidebar = FactoryGirl.create(:sidebar) post :update, id: sidebar.to_param, configure: { sidebar.id.to_s => { 'title' => 'Links', 'body' => 'another html' } } sidebar.reload expect(sidebar.config['body']).to eq('another html') end end describe '#sortable' do it 'creates new sidebars in the current blog' do post :sortable, sidebar: ['9001'] expect(blog.sidebars.count).to eq 1 end end end
require 'rails_helper' describe Admin::SidebarController, type: :controller do let!(:blog) { create(:blog) } before do henri = create(:user, :as_admin) sign_in henri end describe '#index' do context 'when rendering' do render_views it 'renders the sidebar configuration' do get :index assert_template 'index' assert_select 'div#sidebar-config' end end end describe '#update' do it 'updates content' do sidebar = FactoryGirl.create(:sidebar) post :update, id: sidebar.to_param, configure: { sidebar.id.to_s => { 'title' => 'Links', 'body' => 'another html' } } sidebar.reload expect(sidebar.config['body']).to eq('another html') end end describe '#sortable' do it 'creates new sidebars in the current blog' do post :sortable, sidebar: ['9001'] expect(blog.sidebars.count).to eq 1 end end end
Improve spec nesting and description
Improve spec nesting and description
Ruby
mit
drakontia/publify,publify/publify,drakontia/publify,SF-WDI-LABS/publify_debugging_lab,whithajess/publify,whithajess/publify,whithajess/publify,SF-WDI-LABS/publify_debugging_lab,publify/publify,Juuro/publify,publify/publify,Juuro/publify,SF-WDI-LABS/publify_debugging_lab,Juuro/publify
ruby
## Code Before: require 'rails_helper' describe Admin::SidebarController, type: :controller do let!(:blog) { create(:blog) } before do henri = create(:user, :as_admin) sign_in henri end describe 'rendering' do render_views it 'test_index' do get :index assert_template 'index' assert_select 'div[id="sidebar-config"]' end end describe '#update' do it 'updates content' do sidebar = FactoryGirl.create(:sidebar) post :update, id: sidebar.to_param, configure: { sidebar.id.to_s => { 'title' => 'Links', 'body' => 'another html' } } sidebar.reload expect(sidebar.config['body']).to eq('another html') end end describe '#sortable' do it 'creates new sidebars in the current blog' do post :sortable, sidebar: ['9001'] expect(blog.sidebars.count).to eq 1 end end end ## Instruction: Improve spec nesting and description ## Code After: require 'rails_helper' describe Admin::SidebarController, type: :controller do let!(:blog) { create(:blog) } before do henri = create(:user, :as_admin) sign_in henri end describe '#index' do context 'when rendering' do render_views it 'renders the sidebar configuration' do get :index assert_template 'index' assert_select 'div#sidebar-config' end end end describe '#update' do it 'updates content' do sidebar = FactoryGirl.create(:sidebar) post :update, id: sidebar.to_param, configure: { sidebar.id.to_s => { 'title' => 'Links', 'body' => 'another html' } } sidebar.reload expect(sidebar.config['body']).to eq('another html') end end describe '#sortable' do it 'creates new sidebars in the current blog' do post :sortable, sidebar: ['9001'] expect(blog.sidebars.count).to eq 1 end end end
c89b5627036c1da024e9d8a4858f4ef05ac38b69
templates/modular.html.twig
templates/modular.html.twig
{% extends 'partials/base.html.twig' %} {% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %} {% block javascripts %} {% do assets.add('theme://js/singlePageNav.min.js') %} {{ parent() }} {% endblock %} {% block bottom %} {{ parent() }} <script> // singlePageNav initialization & configuration $('#navbar').singlePageNav({ offset: $('#header').outerHeight(), filter: ':not(.external)', updateHash: true, currentClass: 'active' }); </script> {% endblock %} {% block header_navigation %} <ul class="navigation"> {% for module in page.collection() %} {% set current_module = (module.active or module.activeChild) ? 'active' : '' %} <li class="{{ current_module }}"><a href="#{{ _self.pageLinkName(module.menu) }}">{{ module.menu }}</a></li> {% endfor %} </ul> {% endblock %} {% block content %} {{ page.content }} {% for module in page.collection() %} <div id="{{ _self.pageLinkName(module.menu) }}"></div> {{ module.content }} {% endfor %} {% endblock %}
{% extends 'partials/base.html.twig' %} {% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %} {% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %} {% block javascripts %} {% if show_onpage_menu %} {% do assets.add('theme://js/singlePageNav.min.js') %} {% endif %} {{ parent() }} {% endblock %} {% block bottom %} {{ parent() }} {% if show_onpage_menu %} <script> // singlePageNav initialization & configuration $('#navbar').singlePageNav({ offset: $('#header').outerHeight(), filter: ':not(.external)', updateHash: true, currentClass: 'active' }); </script> {% endif %} {% endblock %} {% block header_navigation %} {% if show_onpage_menu %} <ul class="navigation"> {% for module in page.collection() %} {% set current_module = (module.active or module.activeChild) ? 'active' : '' %} <li class="{{ current_module }}"><a href="#{{ _self.pageLinkName(module.menu) }}">{{ module.menu }}</a></li> {% endfor %} </ul> {% else %} {{ parent() }} {% endif %} {% endblock %} {% block content %} {{ page.content }} {% for module in page.collection() %} <div id="{{ _self.pageLinkName(module.menu) }}"></div> {{ module.content }} {% endfor %} {% endblock %}
Make toggle option to enable/disable on-page menu
Make toggle option to enable/disable on-page menu
Twig
mit
dedude/grav-theme-antimatter,getgrav/grav-theme-antimatter,franzyke/senhri-website-theme,franzyke/senhri-website-theme,dedude/grav-theme-antimatter,dimayakovlev/grav-theme-antimatter,dimayakovlev/grav-theme-antimatter,dimayakovlev/grav-theme-antimatter,franzyke/senhri-website-theme,franzyke/senhri-website-theme,getgrav/grav-theme-antimatter,dedude/grav-theme-antimatter,dedude/grav-theme-antimatter,getgrav/grav-theme-antimatter,getgrav/grav-theme-antimatter,dimayakovlev/grav-theme-antimatter
twig
## Code Before: {% extends 'partials/base.html.twig' %} {% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %} {% block javascripts %} {% do assets.add('theme://js/singlePageNav.min.js') %} {{ parent() }} {% endblock %} {% block bottom %} {{ parent() }} <script> // singlePageNav initialization & configuration $('#navbar').singlePageNav({ offset: $('#header').outerHeight(), filter: ':not(.external)', updateHash: true, currentClass: 'active' }); </script> {% endblock %} {% block header_navigation %} <ul class="navigation"> {% for module in page.collection() %} {% set current_module = (module.active or module.activeChild) ? 'active' : '' %} <li class="{{ current_module }}"><a href="#{{ _self.pageLinkName(module.menu) }}">{{ module.menu }}</a></li> {% endfor %} </ul> {% endblock %} {% block content %} {{ page.content }} {% for module in page.collection() %} <div id="{{ _self.pageLinkName(module.menu) }}"></div> {{ module.content }} {% endfor %} {% endblock %} ## Instruction: Make toggle option to enable/disable on-page menu ## Code After: {% extends 'partials/base.html.twig' %} {% set show_onpage_menu = header.onpage_menu == true or header.onpage_menu is null %} {% macro pageLinkName(text) %}{{ text|lower|replace({' ':'_'}) }}{% endmacro %} {% block javascripts %} {% if show_onpage_menu %} {% do assets.add('theme://js/singlePageNav.min.js') %} {% endif %} {{ parent() }} {% endblock %} {% block bottom %} {{ parent() }} {% if show_onpage_menu %} <script> // singlePageNav initialization & configuration $('#navbar').singlePageNav({ offset: $('#header').outerHeight(), filter: ':not(.external)', updateHash: true, currentClass: 'active' }); </script> {% endif %} {% endblock %} {% block header_navigation %} {% if show_onpage_menu %} <ul class="navigation"> {% for module in page.collection() %} {% set current_module = (module.active or module.activeChild) ? 'active' : '' %} <li class="{{ current_module }}"><a href="#{{ _self.pageLinkName(module.menu) }}">{{ module.menu }}</a></li> {% endfor %} </ul> {% else %} {{ parent() }} {% endif %} {% endblock %} {% block content %} {{ page.content }} {% for module in page.collection() %} <div id="{{ _self.pageLinkName(module.menu) }}"></div> {{ module.content }} {% endfor %} {% endblock %}
48eb93339ab5ba759d1926431f69f86dd55fbb3b
tests/integration/components/animate-on-change-test.js
tests/integration/components/animate-on-change-test.js
import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('animate-on-change', 'Integration | Component | animate on property change', { integration: true }); test('it renders', function(assert) { // Set any properties with this.set('myProperty', 'value'); // Handle any actions with this.on('myAction', function(val) { ... }); this.render(hbs`{{animate-on-change}}`); assert.equal(this.$().text().trim(), ''); // Template block usage: this.render(hbs` {{#animate-on-change}} template block text {{/animate-on-change}} `); assert.equal(this.$().text().trim(), 'template block text'); });
import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('animate-on-change', 'Integration | Component | animate on property change', { integration: true }); test('it renders', function (assert) { assert.expect(2); this.render(hbs`{{animate-on-change}}`); assert.equal(this.$().text().trim(), ''); this.render(hbs` {{#animate-on-change}} template block text {{/animate-on-change}} `); assert.equal(this.$().text().trim(), 'template block text'); }); test('it adds an animation class on value change', function (assert) { assert.expect(2); this.set('val', 0); this.render(hbs`{{animate-on-change animationClass="foo" observedValue=val}}`); // `val` hasn't changed yet assert.notOk(this.$('> span').hasClass('foo')); this.set('val', 1); // `val` has changed now; the class should've been added assert.ok(this.$('> span').hasClass('foo')); }); test("it doesn't add an animation class when disabled", function (assert) { assert.expect(1); this.set('val', 0); this.render(hbs`{{animate-on-change animationClass="foo" enabled=false observedValue=val}}`); this.set('val', 1); assert.notOk(this.$('> span').hasClass('foo')); });
Add integration tests for `animate-on-change`
Add integration tests for `animate-on-change` Summary: Add integration tests for the `animate-on-change` component. Depends on D3916. Reviewers: fdanielsen, asteinlein Reviewed By: asteinlein Differential Revision: http://dev.e5r.no/D3918
JavaScript
mit
eliksir/ember-css-animation-triggers,eliksir/ember-css-animation-triggers
javascript
## Code Before: import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('animate-on-change', 'Integration | Component | animate on property change', { integration: true }); test('it renders', function(assert) { // Set any properties with this.set('myProperty', 'value'); // Handle any actions with this.on('myAction', function(val) { ... }); this.render(hbs`{{animate-on-change}}`); assert.equal(this.$().text().trim(), ''); // Template block usage: this.render(hbs` {{#animate-on-change}} template block text {{/animate-on-change}} `); assert.equal(this.$().text().trim(), 'template block text'); }); ## Instruction: Add integration tests for `animate-on-change` Summary: Add integration tests for the `animate-on-change` component. Depends on D3916. Reviewers: fdanielsen, asteinlein Reviewed By: asteinlein Differential Revision: http://dev.e5r.no/D3918 ## Code After: import { moduleForComponent, test } from 'ember-qunit'; import hbs from 'htmlbars-inline-precompile'; moduleForComponent('animate-on-change', 'Integration | Component | animate on property change', { integration: true }); test('it renders', function (assert) { assert.expect(2); this.render(hbs`{{animate-on-change}}`); assert.equal(this.$().text().trim(), ''); this.render(hbs` {{#animate-on-change}} template block text {{/animate-on-change}} `); assert.equal(this.$().text().trim(), 'template block text'); }); test('it adds an animation class on value change', function (assert) { assert.expect(2); this.set('val', 0); this.render(hbs`{{animate-on-change animationClass="foo" observedValue=val}}`); // `val` hasn't changed yet assert.notOk(this.$('> span').hasClass('foo')); this.set('val', 1); // `val` has changed now; the class should've been added assert.ok(this.$('> span').hasClass('foo')); }); test("it doesn't add an animation class when disabled", function (assert) { assert.expect(1); this.set('val', 0); this.render(hbs`{{animate-on-change animationClass="foo" enabled=false observedValue=val}}`); this.set('val', 1); assert.notOk(this.$('> span').hasClass('foo')); });
dfb1294674fd1a576cea292ee92034e6907a1c29
test/i_object_info_test.rb
test/i_object_info_test.rb
require File.expand_path('test_helper.rb', File.dirname(__FILE__)) module GirFFI class IObjectInfoTest < Test::Unit::TestCase context "An IObjectInfo object" do setup do gir = IRepository.default gir.require 'Everything', nil @info = gir.find_by_name 'Everything', 'TestObj' end should "find a vfunc by name" do assert_not_nil @info.find_vfunc("matrix") end end end end
require File.expand_path('test_helper.rb', File.dirname(__FILE__)) module GirFFI class IObjectInfoTest < Test::Unit::TestCase context "An IObjectInfo object" do setup do gir = IRepository.default gir.require 'Regress', nil @info = gir.find_by_name 'Regress', 'TestObj' end should "find a vfunc by name" do assert_not_nil @info.find_vfunc("matrix") end end end end
Make tests in IObjectInfoTest pass by changing Everything to Regress.
Make tests in IObjectInfoTest pass by changing Everything to Regress.
Ruby
lgpl-2.1
mvz/gir_ffi,mvz/gir_ffi,jcupitt/gir_ffi,mvz/gir_ffi,jcupitt/gir_ffi
ruby
## Code Before: require File.expand_path('test_helper.rb', File.dirname(__FILE__)) module GirFFI class IObjectInfoTest < Test::Unit::TestCase context "An IObjectInfo object" do setup do gir = IRepository.default gir.require 'Everything', nil @info = gir.find_by_name 'Everything', 'TestObj' end should "find a vfunc by name" do assert_not_nil @info.find_vfunc("matrix") end end end end ## Instruction: Make tests in IObjectInfoTest pass by changing Everything to Regress. ## Code After: require File.expand_path('test_helper.rb', File.dirname(__FILE__)) module GirFFI class IObjectInfoTest < Test::Unit::TestCase context "An IObjectInfo object" do setup do gir = IRepository.default gir.require 'Regress', nil @info = gir.find_by_name 'Regress', 'TestObj' end should "find a vfunc by name" do assert_not_nil @info.find_vfunc("matrix") end end end end
bce7c9a49645363320a43bb44df91a9be360a738
.travis.yml
.travis.yml
language: ruby script: bundle exec rake cache: bundler sudo: false after_success: - bundle exec rake test:accuracy - bundle exec rake benchmark:memory rvm: - ruby-head
language: ruby script: bundle exec rake cache: bundler sudo: false before_install: - gem install bundler after_success: - bundle exec rake test:accuracy - bundle exec rake benchmark:memory rvm: - ruby-head
Make sure to always use the latest bundler
Make sure to always use the latest bundler
YAML
mit
yuki24/did_you_mean
yaml
## Code Before: language: ruby script: bundle exec rake cache: bundler sudo: false after_success: - bundle exec rake test:accuracy - bundle exec rake benchmark:memory rvm: - ruby-head ## Instruction: Make sure to always use the latest bundler ## Code After: language: ruby script: bundle exec rake cache: bundler sudo: false before_install: - gem install bundler after_success: - bundle exec rake test:accuracy - bundle exec rake benchmark:memory rvm: - ruby-head
03c0ef6be422bb814dab160b984110827a71cc3f
view/carrier_form.xml
view/carrier_form.xml
<data> <xpath expr="/form/field[@name='carrier_cost_method']" position="after"> <label name="currency"/> <field name="currency"/> <newline/> <field name="tracking_numbers" colspan="4"/> </xpath> </data>
<data> <xpath expr="/form/field[@name='carrier_cost_method']" position="after"> <label name="currency"/> <field name="currency"/> <newline/> <notebook colspan="4"> <page id="tracking_numbers" string="Tracking Numbers"> <field name="tracking_numbers" colspan="4"/> </page> </notebook> </xpath> </data>
Add tracking numbers to notebook in carrier
Add tracking numbers to notebook in carrier
XML
bsd-3-clause
trytonus/trytond-shipping,riteshshrv/trytond-shipping,fulfilio/trytond-shipping,prakashpp/trytond-shipping,tarunbhardwaj/trytond-shipping,joeirimpan/trytond-shipping
xml
## Code Before: <data> <xpath expr="/form/field[@name='carrier_cost_method']" position="after"> <label name="currency"/> <field name="currency"/> <newline/> <field name="tracking_numbers" colspan="4"/> </xpath> </data> ## Instruction: Add tracking numbers to notebook in carrier ## Code After: <data> <xpath expr="/form/field[@name='carrier_cost_method']" position="after"> <label name="currency"/> <field name="currency"/> <newline/> <notebook colspan="4"> <page id="tracking_numbers" string="Tracking Numbers"> <field name="tracking_numbers" colspan="4"/> </page> </notebook> </xpath> </data>
4cd5ac564c5117685bd8dcf2d60b61351790d301
raspberrypi/camera/dropbox-driect-url.js
raspberrypi/camera/dropbox-driect-url.js
var request = require('request'); function dropboxImageDirectUrlParser(url, cb) { request({ method: 'GET', uri: url, followRedirect: false }, function (error, response, body) { if (error) { return cb && cb(error); } var redirectUrl = response.headers.location; var imageUrl = redirectUrl.replace('www.dropbox.com', 'dl.dropboxusercontent.com'); return cb && cb(null, imageUrl); }); } module.exports = dropboxImageDirectUrlParser; if (require.main === module) { var url = 'https://db.tt/cmDO24Ju'; dropboxImageDirectUrlParser(url, function (err, url) {console.log(url);}); }
'use strict'; var request = require('request'); function dropboxImageDirectUrlParser(url, cb) { request({ method: 'GET', uri: url, followRedirect: false }, function (error, response, body) { if (error) { return cb && cb(error); } var imageUrl = url.replace('www.dropbox.com', 'dl.dropboxusercontent.com'); return cb && cb(null, imageUrl); }); } module.exports = dropboxImageDirectUrlParser; if (require.main === module) { var url = 'https://db.tt/cmDO24Ju'; dropboxImageDirectUrlParser(url, function (err, url) {console.log(url);}); }
Fix the bug caused by Dropbox API v2
Fix the bug caused by Dropbox API v2
JavaScript
apache-2.0
daliworks/openhardware,daliworks/openhardware
javascript
## Code Before: var request = require('request'); function dropboxImageDirectUrlParser(url, cb) { request({ method: 'GET', uri: url, followRedirect: false }, function (error, response, body) { if (error) { return cb && cb(error); } var redirectUrl = response.headers.location; var imageUrl = redirectUrl.replace('www.dropbox.com', 'dl.dropboxusercontent.com'); return cb && cb(null, imageUrl); }); } module.exports = dropboxImageDirectUrlParser; if (require.main === module) { var url = 'https://db.tt/cmDO24Ju'; dropboxImageDirectUrlParser(url, function (err, url) {console.log(url);}); } ## Instruction: Fix the bug caused by Dropbox API v2 ## Code After: 'use strict'; var request = require('request'); function dropboxImageDirectUrlParser(url, cb) { request({ method: 'GET', uri: url, followRedirect: false }, function (error, response, body) { if (error) { return cb && cb(error); } var imageUrl = url.replace('www.dropbox.com', 'dl.dropboxusercontent.com'); return cb && cb(null, imageUrl); }); } module.exports = dropboxImageDirectUrlParser; if (require.main === module) { var url = 'https://db.tt/cmDO24Ju'; dropboxImageDirectUrlParser(url, function (err, url) {console.log(url);}); }
4a0744dd94e87cbb10a399b9c0b4052b7201f0b3
app/views/shared/_register_call.html.haml
app/views/shared/_register_call.html.haml
.alert-cta %h6 %a{href: "/register", target: "_blank"} = t '.selling_on_ofn' &nbsp; %strong = t '.register' %i.ofn-i_054-point-right
.alert-cta %h6 -# Please forgive the hard-coded link: The more elegant 'registration_path' resolves to /signup due to spree_auth_device > config > routes.rb This is one of several possible fixes. Long-term, we'd like to bring the accounts page into OFN. View the discussion here: https://github.com/openfoodfoundation/openfoodnetwork/pull/3174 %a{href: "/register", target: "_blank"} = t '.selling_on_ofn' &nbsp; %strong = t '.register' %i.ofn-i_054-point-right
Add comment to explain hard-coded link
Add comment to explain hard-coded link
Haml
agpl-3.0
Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,openfoodfoundation/openfoodnetwork,mkllnk/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,mkllnk/openfoodnetwork,Matt-Yorkley/openfoodnetwork,openfoodfoundation/openfoodnetwork,lin-d-hop/openfoodnetwork,Matt-Yorkley/openfoodnetwork,mkllnk/openfoodnetwork,lin-d-hop/openfoodnetwork
haml
## Code Before: .alert-cta %h6 %a{href: "/register", target: "_blank"} = t '.selling_on_ofn' &nbsp; %strong = t '.register' %i.ofn-i_054-point-right ## Instruction: Add comment to explain hard-coded link ## Code After: .alert-cta %h6 -# Please forgive the hard-coded link: The more elegant 'registration_path' resolves to /signup due to spree_auth_device > config > routes.rb This is one of several possible fixes. Long-term, we'd like to bring the accounts page into OFN. View the discussion here: https://github.com/openfoodfoundation/openfoodnetwork/pull/3174 %a{href: "/register", target: "_blank"} = t '.selling_on_ofn' &nbsp; %strong = t '.register' %i.ofn-i_054-point-right
ffcebd5acaae528c9267bce3a296f0ea2065a361
build/_vods.haml
build/_vods.haml
- if vod_urls.length == 1 %a.data.vod.revealed{href: vod_urls.first, target: '_blank'} vod - else - vod_urls.each_with_index do |url, i| %a.data.vod{href: surprise_link(url), target: '_blank', class: "#{'revealed' if i == 0}"} vod #{i + 1} %a.data.reveal{href: '#'} …
- if vod_urls.length == 1 %a.data.vod.revealed{href: surprise_link(vod_urls.first), target: '_blank'} vod - else - vod_urls.each_with_index do |url, i| %a.data.vod{href: surprise_link(url), target: '_blank', class: "#{'revealed' if i == 0}"} vod #{i + 1} %a.data.reveal{href: '#'} …
Fix missing surprise_link for single vods
Fix missing surprise_link for single vods
Haml
mit
bloopletech/lolschedule,bloopletech/lolschedule,bloopletech/lolschedule
haml
## Code Before: - if vod_urls.length == 1 %a.data.vod.revealed{href: vod_urls.first, target: '_blank'} vod - else - vod_urls.each_with_index do |url, i| %a.data.vod{href: surprise_link(url), target: '_blank', class: "#{'revealed' if i == 0}"} vod #{i + 1} %a.data.reveal{href: '#'} … ## Instruction: Fix missing surprise_link for single vods ## Code After: - if vod_urls.length == 1 %a.data.vod.revealed{href: surprise_link(vod_urls.first), target: '_blank'} vod - else - vod_urls.each_with_index do |url, i| %a.data.vod{href: surprise_link(url), target: '_blank', class: "#{'revealed' if i == 0}"} vod #{i + 1} %a.data.reveal{href: '#'} …
417831ea9232687c7f73c3324431509e7ddc1401
aliases/aliases.zsh
aliases/aliases.zsh
alias e="$EDITOR" alias v="$VISUAL" alias l='ls -lah' alias ll='ls -lh' alias la='ls -lAh' alias md='mkdir -p' # Other alias doc='cd ~/Documents' alias dow='cd ~/Downloads' alias drop='cd ~/Dropbox' alias src='source ~/.zshrc' alias ev='vim ~/dotfiles-local/vimrc' alias ea='vim ~/dotfiles-local/aliases' alias ez='vim ~/dotfiles-local/zshrc' alias eg='vim ~/dotfiles-local/gitconfig' # git alias ghm='[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`' # Bundler alias b="bundle" alias be='bundle exec' # Tests and Specs # Rails alias migrate="bundle exec rake db:migrate && bundle exec rake db:migrate RAILS_ENV=test" alias rollback="bundle exec rake db:rollback && bundle exec rake db:rollback RAILS_ENV=test" alias rk="rake" alias s="bundle exec rspec" alias rs='bundle exec rails server' alias rc='bundle exec rails console'
alias e="$EDITOR" alias v="$VISUAL" alias l='ls -lah' alias ll='ls -lh' alias la='ls -lAh' alias md='mkdir -p' # Other alias doc='cd ~/Documents' alias dow='cd ~/Downloads' alias drop='cd ~/Dropbox' alias src='source ~/.zshrc' alias ev='vim ~/dotfiles-local/vimrc' alias ea='vim ~/dotfiles-local/aliases' alias ez='vim ~/dotfiles-local/zshrc' alias eg='vim ~/dotfiles-local/gitconfig' # git alias ghm='[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`' alias vm='vim `git diff --name-only`' # Bundler alias b="bundle" alias be='bundle exec' # Tests and Specs # Rails alias migrate="bundle exec rake db:migrate && bundle exec rake db:migrate RAILS_ENV=test" alias rollback="bundle exec rake db:rollback && bundle exec rake db:rollback RAILS_ENV=test" alias rk="rake" alias s="bundle exec rspec" alias rs='bundle exec rails server' alias rc='bundle exec rails console'
Add alias for opening modified files with vim
Add alias for opening modified files with vim
Shell
mit
azevedo-252/zsh-files
shell
## Code Before: alias e="$EDITOR" alias v="$VISUAL" alias l='ls -lah' alias ll='ls -lh' alias la='ls -lAh' alias md='mkdir -p' # Other alias doc='cd ~/Documents' alias dow='cd ~/Downloads' alias drop='cd ~/Dropbox' alias src='source ~/.zshrc' alias ev='vim ~/dotfiles-local/vimrc' alias ea='vim ~/dotfiles-local/aliases' alias ez='vim ~/dotfiles-local/zshrc' alias eg='vim ~/dotfiles-local/gitconfig' # git alias ghm='[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`' # Bundler alias b="bundle" alias be='bundle exec' # Tests and Specs # Rails alias migrate="bundle exec rake db:migrate && bundle exec rake db:migrate RAILS_ENV=test" alias rollback="bundle exec rake db:rollback && bundle exec rake db:rollback RAILS_ENV=test" alias rk="rake" alias s="bundle exec rspec" alias rs='bundle exec rails server' alias rc='bundle exec rails console' ## Instruction: Add alias for opening modified files with vim ## Code After: alias e="$EDITOR" alias v="$VISUAL" alias l='ls -lah' alias ll='ls -lh' alias la='ls -lAh' alias md='mkdir -p' # Other alias doc='cd ~/Documents' alias dow='cd ~/Downloads' alias drop='cd ~/Dropbox' alias src='source ~/.zshrc' alias ev='vim ~/dotfiles-local/vimrc' alias ea='vim ~/dotfiles-local/aliases' alias ez='vim ~/dotfiles-local/zshrc' alias eg='vim ~/dotfiles-local/gitconfig' # git alias ghm='[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`' alias vm='vim `git diff --name-only`' # Bundler alias b="bundle" alias be='bundle exec' # Tests and Specs # Rails alias migrate="bundle exec rake db:migrate && bundle exec rake db:migrate RAILS_ENV=test" alias rollback="bundle exec rake db:rollback && bundle exec rake db:rollback RAILS_ENV=test" alias rk="rake" alias s="bundle exec rspec" alias rs='bundle exec rails server' alias rc='bundle exec rails console'
72b162a4e8dcc4c0316eac397935cabb048cdbbd
src/Mapbender/CoreBundle/Component/SecurityContext.php
src/Mapbender/CoreBundle/Component/SecurityContext.php
<?php /** * * @author Andriy Oblivantsev <[email protected]> * @copyright 19.02.2015 by WhereGroup GmbH & Co. KG */ namespace Mapbender\CoreBundle\Component; use FOM\UserBundle\Component\User\UserEntityInterface; use FOM\UserBundle\Entity\User; /** * Class SecurityContext * * @package FOM\UserBundle\Component * @author Andriy Oblivantsev <[email protected]> * @copyright 2015 by WhereGroup GmbH & Co. KG */ class SecurityContext extends \Symfony\Component\Security\Core\SecurityContext { /** * Get current logged user by the token * * @return UserEntityInterface */ public function getUser() { /** @var User $user */ $user = $this->getToken()->getUser(); if (!is_object($user) && is_string($user) && $user == 'anon.') { $user = new User(); $user->setUsername("anon."); } return $user; } /** * Get current user role list * * @return array Role name list */ public function getRolesAsArray() { $userRoles = $this->getToken()->getRoles(); $temp = array(); foreach ($userRoles as $role) { $temp[] = $role->getRole(); } return $temp; } }
<?php /** * * @author Andriy Oblivantsev <[email protected]> * @copyright 19.02.2015 by WhereGroup GmbH & Co. KG */ namespace Mapbender\CoreBundle\Component; use FOM\UserBundle\Entity\User; /** * Class SecurityContext * * @package FOM\UserBundle\Component * @author Andriy Oblivantsev <[email protected]> * @copyright 2015 by WhereGroup GmbH & Co. KG */ class SecurityContext extends \Symfony\Component\Security\Core\SecurityContext { /** * Get current logged user by the token * * @return User */ public function getUser() { /** @var User $user */ $user = $this->getToken()->getUser(); if (!is_object($user) && is_string($user) && $user == 'anon.') { $user = new User(); $user->setUsername("anon."); } return $user; } /** * Get current user role list * * @return array Role name list */ public function getRolesAsArray() { $userRoles = $this->getToken()->getRoles(); $temp = array(); foreach ($userRoles as $role) { $temp[] = $role->getRole(); } return $temp; } }
Fix security context annotation return type
Fix security context annotation return type
PHP
mit
mapbender/mapbender-printclient,mapbender/mapbender-printclient,mapbender/mapbender-printclient
php
## Code Before: <?php /** * * @author Andriy Oblivantsev <[email protected]> * @copyright 19.02.2015 by WhereGroup GmbH & Co. KG */ namespace Mapbender\CoreBundle\Component; use FOM\UserBundle\Component\User\UserEntityInterface; use FOM\UserBundle\Entity\User; /** * Class SecurityContext * * @package FOM\UserBundle\Component * @author Andriy Oblivantsev <[email protected]> * @copyright 2015 by WhereGroup GmbH & Co. KG */ class SecurityContext extends \Symfony\Component\Security\Core\SecurityContext { /** * Get current logged user by the token * * @return UserEntityInterface */ public function getUser() { /** @var User $user */ $user = $this->getToken()->getUser(); if (!is_object($user) && is_string($user) && $user == 'anon.') { $user = new User(); $user->setUsername("anon."); } return $user; } /** * Get current user role list * * @return array Role name list */ public function getRolesAsArray() { $userRoles = $this->getToken()->getRoles(); $temp = array(); foreach ($userRoles as $role) { $temp[] = $role->getRole(); } return $temp; } } ## Instruction: Fix security context annotation return type ## Code After: <?php /** * * @author Andriy Oblivantsev <[email protected]> * @copyright 19.02.2015 by WhereGroup GmbH & Co. KG */ namespace Mapbender\CoreBundle\Component; use FOM\UserBundle\Entity\User; /** * Class SecurityContext * * @package FOM\UserBundle\Component * @author Andriy Oblivantsev <[email protected]> * @copyright 2015 by WhereGroup GmbH & Co. KG */ class SecurityContext extends \Symfony\Component\Security\Core\SecurityContext { /** * Get current logged user by the token * * @return User */ public function getUser() { /** @var User $user */ $user = $this->getToken()->getUser(); if (!is_object($user) && is_string($user) && $user == 'anon.') { $user = new User(); $user->setUsername("anon."); } return $user; } /** * Get current user role list * * @return array Role name list */ public function getRolesAsArray() { $userRoles = $this->getToken()->getRoles(); $temp = array(); foreach ($userRoles as $role) { $temp[] = $role->getRole(); } return $temp; } }
ca7a8e414dae0ea8351eb6ac7ae8f039d0d4b296
static/src/stylesheets/App.scss
static/src/stylesheets/App.scss
@import "./variables.json"; * { margin:0; padding:0; font-family: Helvetica; font-size: 14px; font-weight: 300; color: white; } html, body, #app { height: 100%; } body { background: $blackBackground; overflow: hidden; } .app-container { height: 100%; }
@import "./variables.json"; * { margin:0; padding:0; font-family: Helvetica; font-size: 14px; font-weight: 300; color: white; } html, body, #app { height: 100%; } body { background: $blackBackground; overflow: hidden; } .app-container { height: 100%; } input:focus { outline: 0; } select:focus { outline: 0; }
Add :focus outline:0 in input and select elements
Add :focus outline:0 in input and select elements
SCSS
mit
ffont/freesound-explorer,ffont/freesound-explorer,ffont/freesound-explorer
scss
## Code Before: @import "./variables.json"; * { margin:0; padding:0; font-family: Helvetica; font-size: 14px; font-weight: 300; color: white; } html, body, #app { height: 100%; } body { background: $blackBackground; overflow: hidden; } .app-container { height: 100%; } ## Instruction: Add :focus outline:0 in input and select elements ## Code After: @import "./variables.json"; * { margin:0; padding:0; font-family: Helvetica; font-size: 14px; font-weight: 300; color: white; } html, body, #app { height: 100%; } body { background: $blackBackground; overflow: hidden; } .app-container { height: 100%; } input:focus { outline: 0; } select:focus { outline: 0; }
f572a7461226139baa13bb4b94c985dd8356a79d
src/private/indoor_watermark_controller.js
src/private/indoor_watermark_controller.js
var IndoorWatermarkController = function() { var _indoorWatermarkElement = null; var _elementId = "eegeo-indoor-map-watermark"; var _urlRoot = "https://cdn-webgl.eegeo.com/eegeojs/resources/indoor-vendors/"; var _buildUrlForVendor = function(vendorKey) { return _urlRoot + vendorKey + "_logo.png"; }; var _precacheKnownVendors = function() { var knownVendors = ["eegeo", "micello"]; knownVendors.forEach(function(vendor) { var vendorImageUrl = _buildUrlForVendor(vendor); var tempImage = new Image(); tempImage.src = vendorImageUrl; }); }; _precacheKnownVendors(); this.showWatermarkForVendor = function(vendorKey) { var imageUrl = _buildUrlForVendor(vendorKey); if (_indoorWatermarkElement === null) { _indoorWatermarkElement = document.getElementById(_elementId); } _indoorWatermarkElement.src = imageUrl; _indoorWatermarkElement.style.bottom = 0; }; this.hideWatermark = function() { _indoorWatermarkElement.style.bottom = "-50px"; }; }; module.exports = IndoorWatermarkController;
var IndoorWatermarkController = function() { var _indoorWatermarkElement = null; var _elementId = "eegeo-indoor-map-watermark"; var _urlRoot = "https://cdn-webgl.eegeo.com/eegeojs/resources/indoor-vendors/"; var _buildUrlForVendor = function(vendorKey) { var vendorKeyLower = vendorKey.toLowerCase(); if (vendorKeyLower === "eegeo") { vendorKeyLower = "wrld"; } return _urlRoot + vendorKeyLower + "_logo.png"; }; var _precacheKnownVendors = function() { var knownVendors = ["eegeo", "micello"]; knownVendors.forEach(function(vendor) { var vendorImageUrl = _buildUrlForVendor(vendor); var tempImage = new Image(); tempImage.src = vendorImageUrl; }); }; _precacheKnownVendors(); this.showWatermarkForVendor = function(vendorKey) { var imageUrl = _buildUrlForVendor(vendorKey); if (_indoorWatermarkElement === null) { _indoorWatermarkElement = document.getElementById(_elementId); } _indoorWatermarkElement.src = imageUrl; _indoorWatermarkElement.style.bottom = 0; }; this.hideWatermark = function() { _indoorWatermarkElement.style.bottom = "-50px"; }; }; module.exports = IndoorWatermarkController;
Watermark for WRLD branding. Also fixes a bug where the micello logo is not displayed due to case sensitivity. Pair: Malc
Watermark for WRLD branding. Also fixes a bug where the micello logo is not displayed due to case sensitivity. Pair: Malc
JavaScript
bsd-2-clause
eegeo/eegeo.js,eegeo/eegeo.js
javascript
## Code Before: var IndoorWatermarkController = function() { var _indoorWatermarkElement = null; var _elementId = "eegeo-indoor-map-watermark"; var _urlRoot = "https://cdn-webgl.eegeo.com/eegeojs/resources/indoor-vendors/"; var _buildUrlForVendor = function(vendorKey) { return _urlRoot + vendorKey + "_logo.png"; }; var _precacheKnownVendors = function() { var knownVendors = ["eegeo", "micello"]; knownVendors.forEach(function(vendor) { var vendorImageUrl = _buildUrlForVendor(vendor); var tempImage = new Image(); tempImage.src = vendorImageUrl; }); }; _precacheKnownVendors(); this.showWatermarkForVendor = function(vendorKey) { var imageUrl = _buildUrlForVendor(vendorKey); if (_indoorWatermarkElement === null) { _indoorWatermarkElement = document.getElementById(_elementId); } _indoorWatermarkElement.src = imageUrl; _indoorWatermarkElement.style.bottom = 0; }; this.hideWatermark = function() { _indoorWatermarkElement.style.bottom = "-50px"; }; }; module.exports = IndoorWatermarkController; ## Instruction: Watermark for WRLD branding. Also fixes a bug where the micello logo is not displayed due to case sensitivity. Pair: Malc ## Code After: var IndoorWatermarkController = function() { var _indoorWatermarkElement = null; var _elementId = "eegeo-indoor-map-watermark"; var _urlRoot = "https://cdn-webgl.eegeo.com/eegeojs/resources/indoor-vendors/"; var _buildUrlForVendor = function(vendorKey) { var vendorKeyLower = vendorKey.toLowerCase(); if (vendorKeyLower === "eegeo") { vendorKeyLower = "wrld"; } return _urlRoot + vendorKeyLower + "_logo.png"; }; var _precacheKnownVendors = function() { var knownVendors = ["eegeo", "micello"]; knownVendors.forEach(function(vendor) { var vendorImageUrl = _buildUrlForVendor(vendor); var tempImage = new Image(); tempImage.src = vendorImageUrl; }); }; _precacheKnownVendors(); this.showWatermarkForVendor = function(vendorKey) { var imageUrl = _buildUrlForVendor(vendorKey); if (_indoorWatermarkElement === null) { _indoorWatermarkElement = document.getElementById(_elementId); } _indoorWatermarkElement.src = imageUrl; _indoorWatermarkElement.style.bottom = 0; }; this.hideWatermark = function() { _indoorWatermarkElement.style.bottom = "-50px"; }; }; module.exports = IndoorWatermarkController;
b130b1d396c98ca0ab15493e796fb1101ad8d8a4
test/Modules/preprocess-unavailable.cpp
test/Modules/preprocess-unavailable.cpp
// RUN: %clang_cc1 -x c++-module-map %s -fmodule-name=a -verify module a { module b { requires cplusplus11 } } #pragma clang module contents // expected-error@3 {{module 'a.b' requires feature 'cplusplus11'}} #pragma clang module begin a.b // expected-note {{entering module 'a' due to this pragma}} int f(); int g() { f(); } #pragma clang module end // expected-error {{no matching '#pragma clang module begin'}}
// RUN: %clang_cc1 -x c++-module-map %s -fmodule-name=a -verify -std=c++98 module a { module b { requires cplusplus11 } } #pragma clang module contents // expected-error@3 {{module 'a.b' requires feature 'cplusplus11'}} #pragma clang module begin a.b // expected-note {{entering module 'a' due to this pragma}} int f(); int g() { f(); } #pragma clang module end // expected-error {{no matching '#pragma clang module begin'}}
Add an explicit -std= to test to unbreak on PS4 targets.
Add an explicit -std= to test to unbreak on PS4 targets. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@304237 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang
c++
## Code Before: // RUN: %clang_cc1 -x c++-module-map %s -fmodule-name=a -verify module a { module b { requires cplusplus11 } } #pragma clang module contents // expected-error@3 {{module 'a.b' requires feature 'cplusplus11'}} #pragma clang module begin a.b // expected-note {{entering module 'a' due to this pragma}} int f(); int g() { f(); } #pragma clang module end // expected-error {{no matching '#pragma clang module begin'}} ## Instruction: Add an explicit -std= to test to unbreak on PS4 targets. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@304237 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: // RUN: %clang_cc1 -x c++-module-map %s -fmodule-name=a -verify -std=c++98 module a { module b { requires cplusplus11 } } #pragma clang module contents // expected-error@3 {{module 'a.b' requires feature 'cplusplus11'}} #pragma clang module begin a.b // expected-note {{entering module 'a' due to this pragma}} int f(); int g() { f(); } #pragma clang module end // expected-error {{no matching '#pragma clang module begin'}}
ba34c802d9bb4990f71ebe7bebb59736f340031f
pypi_packager.sh
pypi_packager.sh
PROGRAM_NAME="pypi_packager" # Parse arguments TEMP=$(getopt -n $PROGRAM_NAME -o s --long submit -- "$@") eval set -- "$TEMP" while true; do case $1 in -s|--submit) SUBMIT=1; shift; continue ;; --) # no more arguments to parse break ;; *) printf "Unknown option %s\n" "$1" exit 1 ;; esac done eval set -- "$@" # Clear previous compilations to prevent potential issues and limit disk space usage rm -f README.rst rm -rf dist/ build/ django_publications_bootstrap.egg-info/ # Generate doc as restructured text for nice PyPI rendering pandoc --from=markdown --to=rst --output=README.rst README.md # Source distribution python setup.py sdist # Wheel python setup.py bdist_wheel # Upload to PyPI, if asked to if [ -n "$SUBMIT" ]; then twine upload dist/* fi # Remove generated files # rm README.rst # rm -r dist/ build/ django_publications_bootstrap.egg-info/
PROGRAM_NAME="pypi_packager" # Parse arguments TEMP=$(getopt -n $PROGRAM_NAME -o s --long submit -- "$@") eval set -- "$TEMP" while true; do case $1 in -s|--submit) SUBMIT=1; shift; continue ;; --) # no more arguments to parse break ;; *) printf "Unknown option %s\n" "$1" exit 1 ;; esac done eval set -- "$@" # Clear previous compilations to prevent potential issues and limit disk space usage rm -f README.rst rm -rf dist/ build/ django_publications_bootstrap.egg-info/ # Generate doc as restructured text for nice PyPI rendering pandoc --from=markdown --to=rst --output=README.rst README.md # Source distribution python setup.py sdist # Wheel python setup.py bdist_wheel # Upload to PyPI, if asked to if [ -n "$SUBMIT" ]; then twine register dist/django_publications_bootstrap-*.whl twine upload dist/* fi # Remove generated files # rm README.rst # rm -r dist/ build/ django_publications_bootstrap.egg-info/
Add mandatory PyPI package registration
Add mandatory PyPI package registration
Shell
mit
mbourqui/django-publications-bootstrap,mbourqui/django-publications-bootstrap,mbourqui/django-publications-bootstrap
shell
## Code Before: PROGRAM_NAME="pypi_packager" # Parse arguments TEMP=$(getopt -n $PROGRAM_NAME -o s --long submit -- "$@") eval set -- "$TEMP" while true; do case $1 in -s|--submit) SUBMIT=1; shift; continue ;; --) # no more arguments to parse break ;; *) printf "Unknown option %s\n" "$1" exit 1 ;; esac done eval set -- "$@" # Clear previous compilations to prevent potential issues and limit disk space usage rm -f README.rst rm -rf dist/ build/ django_publications_bootstrap.egg-info/ # Generate doc as restructured text for nice PyPI rendering pandoc --from=markdown --to=rst --output=README.rst README.md # Source distribution python setup.py sdist # Wheel python setup.py bdist_wheel # Upload to PyPI, if asked to if [ -n "$SUBMIT" ]; then twine upload dist/* fi # Remove generated files # rm README.rst # rm -r dist/ build/ django_publications_bootstrap.egg-info/ ## Instruction: Add mandatory PyPI package registration ## Code After: PROGRAM_NAME="pypi_packager" # Parse arguments TEMP=$(getopt -n $PROGRAM_NAME -o s --long submit -- "$@") eval set -- "$TEMP" while true; do case $1 in -s|--submit) SUBMIT=1; shift; continue ;; --) # no more arguments to parse break ;; *) printf "Unknown option %s\n" "$1" exit 1 ;; esac done eval set -- "$@" # Clear previous compilations to prevent potential issues and limit disk space usage rm -f README.rst rm -rf dist/ build/ django_publications_bootstrap.egg-info/ # Generate doc as restructured text for nice PyPI rendering pandoc --from=markdown --to=rst --output=README.rst README.md # Source distribution python setup.py sdist # Wheel python setup.py bdist_wheel # Upload to PyPI, if asked to if [ -n "$SUBMIT" ]; then twine register dist/django_publications_bootstrap-*.whl twine upload dist/* fi # Remove generated files # rm README.rst # rm -r dist/ build/ django_publications_bootstrap.egg-info/
94c766597c3c40ab08128d6944736e32edaf8d61
superstatic.json
superstatic.json
{ "clean_urls": [ "/**", "/!bower_components/**", "/!elements/**", "/!images/**", "/!node_modules/**", "/!scripts/**", "/!sounds/**", "/!styles/**", "/!translations/**", "/!videos/**" ], "headers": [ { "source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)", "headers" : [ { "key" : "Access-Control-Allow-Origin", "value" : "*" } ] }, { "source" : "**/*.@(jpg|jpeg|gif|png)", "headers" : [ { "key" : "Cache-Control", "value" : "max-age=7200" } ] }, { "source" : "404.html", "headers" : [ { "key" : "Cache-Control", "value" : "max-age=300" } ] } ], "redirects": [ { "source": "/firebase/*", "destination":"https://www.firebase.com", "type": 302 } ], "root": "dist", "trailing_slash": true }
{ "clean_urls": [ "/**", "/!bower_components/**", "/!elements/**", "/!images/**", "/!node_modules/**", "/!scripts/**", "/!sounds/**", "/!styles/**", "/!translations/**", "/!videos/**" ], "headers": [ { "source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)", "headers" : [ { "key" : "Access-Control-Allow-Origin", "value" : "*" } ] }, { "source" : "**/*.@(jpg|jpeg|gif|png)", "headers" : [ { "key" : "Cache-Control", "value" : "max-age=7200" } ] }, { "source" : "404.html", "headers" : [ { "key" : "Cache-Control", "value" : "max-age=300" } ] } ], "redirects": [ { "source": "/firebase/*", "destination":"https://www.firebase.com", "type": 302 } ], "root": "dist", "routes": { "**:" "index.html" }, "trailing_slash": true }
Set default catch-all route in Superstatic manifest
Set default catch-all route in Superstatic manifest
JSON
bsd-3-clause
cookadlib/www.cookadlib.com,cookadlib/www.cookadlib.com,cookadlib/www.cookadlib.com
json
## Code Before: { "clean_urls": [ "/**", "/!bower_components/**", "/!elements/**", "/!images/**", "/!node_modules/**", "/!scripts/**", "/!sounds/**", "/!styles/**", "/!translations/**", "/!videos/**" ], "headers": [ { "source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)", "headers" : [ { "key" : "Access-Control-Allow-Origin", "value" : "*" } ] }, { "source" : "**/*.@(jpg|jpeg|gif|png)", "headers" : [ { "key" : "Cache-Control", "value" : "max-age=7200" } ] }, { "source" : "404.html", "headers" : [ { "key" : "Cache-Control", "value" : "max-age=300" } ] } ], "redirects": [ { "source": "/firebase/*", "destination":"https://www.firebase.com", "type": 302 } ], "root": "dist", "trailing_slash": true } ## Instruction: Set default catch-all route in Superstatic manifest ## Code After: { "clean_urls": [ "/**", "/!bower_components/**", "/!elements/**", "/!images/**", "/!node_modules/**", "/!scripts/**", "/!sounds/**", "/!styles/**", "/!translations/**", "/!videos/**" ], "headers": [ { "source" : "**/*.@(eot|otf|ttf|ttc|woff|font.css)", "headers" : [ { "key" : "Access-Control-Allow-Origin", "value" : "*" } ] }, { "source" : "**/*.@(jpg|jpeg|gif|png)", "headers" : [ { "key" : "Cache-Control", "value" : "max-age=7200" } ] }, { "source" : "404.html", "headers" : [ { "key" : "Cache-Control", "value" : "max-age=300" } ] } ], "redirects": [ { "source": "/firebase/*", "destination":"https://www.firebase.com", "type": 302 } ], "root": "dist", "routes": { "**:" "index.html" }, "trailing_slash": true }
a67349e1f812d483b99f4ec16ede89cfa86b195b
.travis.yml
.travis.yml
language: node_js node_js: - 8.10.0 cache: directories: - node_modules before_install: - npm -g install yarn@^1.7.0 - yarn add --dev codecov.io script: - yarn test after_success: - cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js - yarn build deploy: - provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN local_dir: demo/dist on: branch: master condition: $TRAVIS_PULL_REQUEST = false - provider: npm skip_cleanup: true email: $NPM_EMAIL api_key: $NPM_TOKEN on: branch: master condition: $TRAVIS_PULL_REQUEST = false branches: only: - master notifications: email: - [email protected] - [email protected] - [email protected]
language: node_js node_js: lts cache: yarn before_install: - yarn add --dev codecov.io install: yarn script: - yarn test after_success: - cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js - yarn build deploy: # Github Releases: deploys the tagged version - provider: releases api_key: $GITHUB_TOKEN skip_cleanup: true on: tags: true # Github pages: deploys the demos site - provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN local_dir: demo/dist on: branch: master condition: $TRAVIS_PULL_REQUEST = false # Deploys to https://www.npmjs.com/package/material-ui-superselectfield - provider: npm skip_cleanup: true email: $NPM_EMAIL api_key: $NPM_TOKEN on: branch: master condition: $TRAVIS_PULL_REQUEST = false branches: only: - master notifications: email: - [email protected] - [email protected] - [email protected]
Raise NodeJS version to LTS, Add deploy stage for Github Releases
[Travis] Raise NodeJS version to LTS, Add deploy stage for Github Releases
YAML
mit
Sharlaan/material-ui-superselectfield
yaml
## Code Before: language: node_js node_js: - 8.10.0 cache: directories: - node_modules before_install: - npm -g install yarn@^1.7.0 - yarn add --dev codecov.io script: - yarn test after_success: - cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js - yarn build deploy: - provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN local_dir: demo/dist on: branch: master condition: $TRAVIS_PULL_REQUEST = false - provider: npm skip_cleanup: true email: $NPM_EMAIL api_key: $NPM_TOKEN on: branch: master condition: $TRAVIS_PULL_REQUEST = false branches: only: - master notifications: email: - [email protected] - [email protected] - [email protected] ## Instruction: [Travis] Raise NodeJS version to LTS, Add deploy stage for Github Releases ## Code After: language: node_js node_js: lts cache: yarn before_install: - yarn add --dev codecov.io install: yarn script: - yarn test after_success: - cat ./coverage/lcov.info | ./node_modules/codecov.io/bin/codecov.io.js - yarn build deploy: # Github Releases: deploys the tagged version - provider: releases api_key: $GITHUB_TOKEN skip_cleanup: true on: tags: true # Github pages: deploys the demos site - provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN local_dir: demo/dist on: branch: master condition: $TRAVIS_PULL_REQUEST = false # Deploys to https://www.npmjs.com/package/material-ui-superselectfield - provider: npm skip_cleanup: true email: $NPM_EMAIL api_key: $NPM_TOKEN on: branch: master condition: $TRAVIS_PULL_REQUEST = false branches: only: - master notifications: email: - [email protected] - [email protected] - [email protected]
95ccab69cfff30c24932c4cd156983a29639435d
nginxauthdaemon/crowdauth.py
nginxauthdaemon/crowdauth.py
import crowd from auth import Authenticator class CrowdAuthenticator(Authenticator): """Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD""" def __init__(self, config): super(CrowdAuthenticator, self).__init__(config) app_url = config['CROWD_URL'] app_user = config['CROWD_APP_NAME'] app_pass = config['CROWD_APP_PASSWORD'] self._cs = crowd.CrowdServer(app_url, app_user, app_pass) def authenticate(self, username, password): result = self._cs.auth_user(username, password) return result.get('name') == username
import crowd from auth import Authenticator class CrowdAuthenticator(Authenticator): """Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD""" def __init__(self, config): super(CrowdAuthenticator, self).__init__(config) app_url = config['CROWD_URL'] app_user = config['CROWD_APP_NAME'] app_pass = config['CROWD_APP_PASSWORD'] self._cs = crowd.CrowdServer(app_url, app_user, app_pass) def authenticate(self, username, password): result = self._cs.auth_user(username, password) if result == None: # auth failed return False # auth succeeded return result.get('name') == username
Fix 500 error when Crowd auth is failed
Fix 500 error when Crowd auth is failed
Python
mit
akurdyukov/nginxauthdaemon,akurdyukov/nginxauthdaemon
python
## Code Before: import crowd from auth import Authenticator class CrowdAuthenticator(Authenticator): """Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD""" def __init__(self, config): super(CrowdAuthenticator, self).__init__(config) app_url = config['CROWD_URL'] app_user = config['CROWD_APP_NAME'] app_pass = config['CROWD_APP_PASSWORD'] self._cs = crowd.CrowdServer(app_url, app_user, app_pass) def authenticate(self, username, password): result = self._cs.auth_user(username, password) return result.get('name') == username ## Instruction: Fix 500 error when Crowd auth is failed ## Code After: import crowd from auth import Authenticator class CrowdAuthenticator(Authenticator): """Atlassian Crowd authenticator. Requires configuration options CROWD_URL, CROWD_APP_NAME, CROWD_APP_PASSWORD""" def __init__(self, config): super(CrowdAuthenticator, self).__init__(config) app_url = config['CROWD_URL'] app_user = config['CROWD_APP_NAME'] app_pass = config['CROWD_APP_PASSWORD'] self._cs = crowd.CrowdServer(app_url, app_user, app_pass) def authenticate(self, username, password): result = self._cs.auth_user(username, password) if result == None: # auth failed return False # auth succeeded return result.get('name') == username
b712ba1e04c7425edad0bdfb27be8049cf9ac631
test/640_proxy_restart_reattaches_test.sh
test/640_proxy_restart_reattaches_test.sh
. ./config.sh C1=10.2.0.78 C2=10.2.0.34 NAME=seetwo.weave.local start_suite "Proxy restart reattaches networking to containers" weave_on $HOST1 launch proxy_start_container $HOST1 -e WEAVE_CIDR=$C2/24 -dt --name=c2 -h $NAME proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C1/24 -dt --name=c1 proxy docker_on $HOST1 restart c2 assert_raises "proxy exec_on $HOST1 c2 $CHECK_ETHWE_UP" assert_dns_record $HOST1 c1 $NAME $C2 end_suite
. ./config.sh C1=10.2.0.78 C2=10.2.0.34 NAME=seetwo.weave.local check_attached() { assert_raises "proxy exec_on $HOST1 c2 $CHECK_ETHWE_UP" assert_dns_record $HOST1 c1 $NAME $C2 } start_suite "Proxy restart reattaches networking to containers" weave_on $HOST1 launch proxy_start_container $HOST1 -e WEAVE_CIDR=$C2/24 -di --name=c2 --restart=always -h $NAME proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C1/24 -di --name=c1 --restart=always proxy docker_on $HOST1 restart -t=1 c2 check_attached # Kill outside of Docker so Docker will restart it run_on $HOST1 sudo kill -KILL $(docker_on $HOST1 inspect --format='{{.State.Pid}}' c2) sleep 1 check_attached # Restart docker itself, using different commands for systemd- and upstart-managed. run_on $HOST1 sh -c "command -v systemctl >/dev/null && sudo systemctl restart docker || sudo service docker restart" sleep 1 weave_on $HOST1 launch check_attached end_suite
Extend test to cover containers restarting automatically
Extend test to cover containers restarting automatically
Shell
apache-2.0
awanke/weave,n054/weave,tomwilkie/weave,bboreham/weave,weaveworks/weave,rade/weave,tomwilkie/weave,dpw/weave,dpw/weave,squaremo/weave,awh/weave,tomwilkie/weave,rade/weave,bboreham/weave,awh/weave,paulbellamy/weave,squaremo/weave,aaam/weave,squaremo/weave,bboreham/weave,beni55/weave,beni55/weave,bboreham/weave,paulbellamy/weave,beni55/weave,awh/weave,dpw/weave,aaam/weave,rade/weave,tomwilkie/weave,squaremo/weave,awh/weave,weaveworks/weave,n054/weave,aaam/weave,tomwilkie/weave,squaremo/weave,n054/weave,awanke/weave,aaam/weave,awh/weave,dpw/weave,rade/weave,rade/weave,beni55/weave,n054/weave,bboreham/weave,awanke/weave,dpw/weave,paulbellamy/weave,aaam/weave,beni55/weave,paulbellamy/weave,awanke/weave,n054/weave,awanke/weave,weaveworks/weave,weaveworks/weave
shell
## Code Before: . ./config.sh C1=10.2.0.78 C2=10.2.0.34 NAME=seetwo.weave.local start_suite "Proxy restart reattaches networking to containers" weave_on $HOST1 launch proxy_start_container $HOST1 -e WEAVE_CIDR=$C2/24 -dt --name=c2 -h $NAME proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C1/24 -dt --name=c1 proxy docker_on $HOST1 restart c2 assert_raises "proxy exec_on $HOST1 c2 $CHECK_ETHWE_UP" assert_dns_record $HOST1 c1 $NAME $C2 end_suite ## Instruction: Extend test to cover containers restarting automatically ## Code After: . ./config.sh C1=10.2.0.78 C2=10.2.0.34 NAME=seetwo.weave.local check_attached() { assert_raises "proxy exec_on $HOST1 c2 $CHECK_ETHWE_UP" assert_dns_record $HOST1 c1 $NAME $C2 } start_suite "Proxy restart reattaches networking to containers" weave_on $HOST1 launch proxy_start_container $HOST1 -e WEAVE_CIDR=$C2/24 -di --name=c2 --restart=always -h $NAME proxy_start_container_with_dns $HOST1 -e WEAVE_CIDR=$C1/24 -di --name=c1 --restart=always proxy docker_on $HOST1 restart -t=1 c2 check_attached # Kill outside of Docker so Docker will restart it run_on $HOST1 sudo kill -KILL $(docker_on $HOST1 inspect --format='{{.State.Pid}}' c2) sleep 1 check_attached # Restart docker itself, using different commands for systemd- and upstart-managed. run_on $HOST1 sh -c "command -v systemctl >/dev/null && sudo systemctl restart docker || sudo service docker restart" sleep 1 weave_on $HOST1 launch check_attached end_suite
70e7f88492d1d3dd6062e84cc58e0c8b88b4a2db
server/config/environment/development.js
server/config/environment/development.js
'use strict'; // Development specific configuration // ================================== module.exports = { // MongoDB connection options mongo: { uri: process.env.MONGOLAB_URI || 'mongodb://localhost:27017/easydownload-dev' }, itemCron: '*/5 * * * * *', thingCron: '*/10 * * * * *', esCron: '*/20 * * * * *', elasticSearch: { host: 'localhost:9200', index: 'mongoindex', type: 'thing', loglevel: 'warning', scanLimit : 30, "ikAugAnalyzer": { "analysis": { "analyzer": { "ik_aug": { "type": "custom" , "tokenizer" : "ik" , "use_smart" : true } } } }, mapping: { "thing": { "_all": { "indexAnalyzer": "ik_aug", "searchAnalyzer": "ik_aug", "term_vector": "no", "store": "false" }, "properties": { "title": { "type": "string", "store": "no", "term_vector": "with_positions_offsets", "indexAnalyzer": "ik_aug", "searchAnalyzer": "ik_aug", "include_in_all": "true", "boost": 8 } } } } }, seedDB: true };
'use strict'; // Development specific configuration // ================================== module.exports = { // MongoDB connection options mongo: { uri: process.env.MONGOLAB_URI || 'mongodb://localhost:27017/easydownload-dev' }, itemCron: '*/5 * * * * *', thingCron: '*/10 * * * * *', esCron: '*/20 * * * * *', elasticSearch: { host: 'misscatandzuozuo.info:19200', index: 'mongoindex', type: 'thing', loglevel: 'warning', scanLimit : 30, "ikAugAnalyzer": { "analysis": { "analyzer": { "ik_aug": { "type": "custom" , "tokenizer" : "ik" , "use_smart" : true } } } }, mapping: { "thing": { "_all": { "indexAnalyzer": "ik_aug", "searchAnalyzer": "ik_aug", "term_vector": "no", "store": "false" }, "properties": { "title": { "type": "string", "store": "no", "term_vector": "with_positions_offsets", "indexAnalyzer": "ik_aug", "searchAnalyzer": "ik_aug", "include_in_all": "true", "boost": 8 } } } } }, seedDB: true };
Add some comments in dockerfile
Add some comments in dockerfile
JavaScript
mit
zycbobby/easy_download,zycbobby/easy_download,zycbobby/easy_download
javascript
## Code Before: 'use strict'; // Development specific configuration // ================================== module.exports = { // MongoDB connection options mongo: { uri: process.env.MONGOLAB_URI || 'mongodb://localhost:27017/easydownload-dev' }, itemCron: '*/5 * * * * *', thingCron: '*/10 * * * * *', esCron: '*/20 * * * * *', elasticSearch: { host: 'localhost:9200', index: 'mongoindex', type: 'thing', loglevel: 'warning', scanLimit : 30, "ikAugAnalyzer": { "analysis": { "analyzer": { "ik_aug": { "type": "custom" , "tokenizer" : "ik" , "use_smart" : true } } } }, mapping: { "thing": { "_all": { "indexAnalyzer": "ik_aug", "searchAnalyzer": "ik_aug", "term_vector": "no", "store": "false" }, "properties": { "title": { "type": "string", "store": "no", "term_vector": "with_positions_offsets", "indexAnalyzer": "ik_aug", "searchAnalyzer": "ik_aug", "include_in_all": "true", "boost": 8 } } } } }, seedDB: true }; ## Instruction: Add some comments in dockerfile ## Code After: 'use strict'; // Development specific configuration // ================================== module.exports = { // MongoDB connection options mongo: { uri: process.env.MONGOLAB_URI || 'mongodb://localhost:27017/easydownload-dev' }, itemCron: '*/5 * * * * *', thingCron: '*/10 * * * * *', esCron: '*/20 * * * * *', elasticSearch: { host: 'misscatandzuozuo.info:19200', index: 'mongoindex', type: 'thing', loglevel: 'warning', scanLimit : 30, "ikAugAnalyzer": { "analysis": { "analyzer": { "ik_aug": { "type": "custom" , "tokenizer" : "ik" , "use_smart" : true } } } }, mapping: { "thing": { "_all": { "indexAnalyzer": "ik_aug", "searchAnalyzer": "ik_aug", "term_vector": "no", "store": "false" }, "properties": { "title": { "type": "string", "store": "no", "term_vector": "with_positions_offsets", "indexAnalyzer": "ik_aug", "searchAnalyzer": "ik_aug", "include_in_all": "true", "boost": 8 } } } } }, seedDB: true };
31e82ace194d1d43e0c7f1ac05f839a323e53957
config/application.rb
config/application.rb
require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) Dotenv::Railtie.load module TwitterGreatRss class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.1 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. config.paths.add 'lib', eager_load: true config.active_record.sqlite3.represent_boolean_as_integer = true end end
require File.expand_path('../boot', __FILE__) #require 'rails/all' # Include each railties manually, excluding `active_storage/engine` %w( active_record/railtie action_controller/railtie action_view/railtie action_mailer/railtie active_job/railtie action_cable/engine rails/test_unit/railtie sprockets/railtie ).each do |railtie| begin require railtie rescue LoadError end end # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) Dotenv::Railtie.load module TwitterGreatRss class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.1 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. config.paths.add 'lib', eager_load: true config.active_record.sqlite3.represent_boolean_as_integer = true end end
Disable ActiveStorage to avoid heroku warn when deploy
Disable ActiveStorage to avoid heroku warn when deploy
Ruby
mit
yayugu/twitter-great-rss,yayugu/twitter-great-rss,yayugu/twitter-great-rss
ruby
## Code Before: require File.expand_path('../boot', __FILE__) require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) Dotenv::Railtie.load module TwitterGreatRss class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.1 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. config.paths.add 'lib', eager_load: true config.active_record.sqlite3.represent_boolean_as_integer = true end end ## Instruction: Disable ActiveStorage to avoid heroku warn when deploy ## Code After: require File.expand_path('../boot', __FILE__) #require 'rails/all' # Include each railties manually, excluding `active_storage/engine` %w( active_record/railtie action_controller/railtie action_view/railtie action_mailer/railtie active_job/railtie action_cable/engine rails/test_unit/railtie sprockets/railtie ).each do |railtie| begin require railtie rescue LoadError end end # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) Dotenv::Railtie.load module TwitterGreatRss class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 5.1 # Settings in config/environments/* take precedence over those specified here. # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. config.paths.add 'lib', eager_load: true config.active_record.sqlite3.represent_boolean_as_integer = true end end
43b1f8c2f4d2f46817e81a3ba57e64ad2e602197
setup.py
setup.py
from setuptools import setup from setuptools import find_packages setup( name="threat_intel", version='0.0.7', provides=['threat_intel'], author="Yelp Security", url='https://github.com/Yelp/threat_intel', setup_requires='setuptools', license='Copyright 2015 Yelp', author_email="[email protected]", description="Collection of the API calls for various threat intel feeds.", packages=find_packages(), install_requires=[ "grequests==0.2.0", "simplejson==3.6.5", ], )
from setuptools import find_packages from setuptools import setup setup( name="threat_intel", version='0.0.8', provides=['threat_intel'], author="Yelp Security", url='https://github.com/Yelp/threat_intel', setup_requires='setuptools', license='Copyright 2015 Yelp', author_email="[email protected]", description="Collection of the API calls for various threat intel feeds.", packages=find_packages(), install_requires=[ "grequests==0.2.0", "simplejson==3.6.5", ], )
Reorder imports and bump version
Reorder imports and bump version
Python
mit
megancarney/threat_intel,Yelp/threat_intel,SYNchroACK/threat_intel
python
## Code Before: from setuptools import setup from setuptools import find_packages setup( name="threat_intel", version='0.0.7', provides=['threat_intel'], author="Yelp Security", url='https://github.com/Yelp/threat_intel', setup_requires='setuptools', license='Copyright 2015 Yelp', author_email="[email protected]", description="Collection of the API calls for various threat intel feeds.", packages=find_packages(), install_requires=[ "grequests==0.2.0", "simplejson==3.6.5", ], ) ## Instruction: Reorder imports and bump version ## Code After: from setuptools import find_packages from setuptools import setup setup( name="threat_intel", version='0.0.8', provides=['threat_intel'], author="Yelp Security", url='https://github.com/Yelp/threat_intel', setup_requires='setuptools', license='Copyright 2015 Yelp', author_email="[email protected]", description="Collection of the API calls for various threat intel feeds.", packages=find_packages(), install_requires=[ "grequests==0.2.0", "simplejson==3.6.5", ], )
ffdfe8c984c502dbb146370258ac7918adcb8c78
timeAsyncMethod.coffee
timeAsyncMethod.coffee
module.exports = (obj, methodName, key, logger) -> metrics = require('./metrics') if typeof obj[methodName] != 'function' throw new Error("[Metrics] expected object property '#{methodName}' to be a function") realMethod = obj[methodName] key = "methods.#{key}" obj[methodName] = (originalArgs...) -> [firstArgs..., callback] = originalArgs if !callback? || typeof callback != 'function' throw new Error( "[Metrics] expected wrapped method '#{methodName}' to be invoked with a callback" ) timer = new metrics.Timer(key) start = new Date() realMethod.call this, firstArgs..., (callbackArgs...) -> timer.done() elapsedTime = new Date() - start if logger? logger.log {key, elapsedTime}, "[Metrics] timed async method call" callback.apply this, callbackArgs
module.exports = (obj, methodName, key, logger) -> metrics = require('./metrics') if typeof obj[methodName] != 'function' throw new Error("[Metrics] expected object property '#{methodName}' to be a function") realMethod = obj[methodName] key = "methods.#{key}" obj[methodName] = (originalArgs...) -> [firstArgs..., callback] = originalArgs if !callback? || typeof callback != 'function' throw new Error( "[Metrics] expected wrapped method '#{methodName}' to be invoked with a callback" ) timer = new metrics.Timer(key) realMethod.call this, firstArgs..., (callbackArgs...) -> elapsedTime = timer.done() if logger? logger.log {key, elapsedTime}, "[Metrics] timed async method call" callback.apply this, callbackArgs
Clean up, don't allocate an extra date
Clean up, don't allocate an extra date
CoffeeScript
mit
sharelatex/metrics-sharelatex
coffeescript
## Code Before: module.exports = (obj, methodName, key, logger) -> metrics = require('./metrics') if typeof obj[methodName] != 'function' throw new Error("[Metrics] expected object property '#{methodName}' to be a function") realMethod = obj[methodName] key = "methods.#{key}" obj[methodName] = (originalArgs...) -> [firstArgs..., callback] = originalArgs if !callback? || typeof callback != 'function' throw new Error( "[Metrics] expected wrapped method '#{methodName}' to be invoked with a callback" ) timer = new metrics.Timer(key) start = new Date() realMethod.call this, firstArgs..., (callbackArgs...) -> timer.done() elapsedTime = new Date() - start if logger? logger.log {key, elapsedTime}, "[Metrics] timed async method call" callback.apply this, callbackArgs ## Instruction: Clean up, don't allocate an extra date ## Code After: module.exports = (obj, methodName, key, logger) -> metrics = require('./metrics') if typeof obj[methodName] != 'function' throw new Error("[Metrics] expected object property '#{methodName}' to be a function") realMethod = obj[methodName] key = "methods.#{key}" obj[methodName] = (originalArgs...) -> [firstArgs..., callback] = originalArgs if !callback? || typeof callback != 'function' throw new Error( "[Metrics] expected wrapped method '#{methodName}' to be invoked with a callback" ) timer = new metrics.Timer(key) realMethod.call this, firstArgs..., (callbackArgs...) -> elapsedTime = timer.done() if logger? logger.log {key, elapsedTime}, "[Metrics] timed async method call" callback.apply this, callbackArgs
e55078f5fdd0b4e2af89acf4632a942586935150
_includes/profile.html
_includes/profile.html
<div class="profile"> <section id="wrapper"> <header id="header"> <!-- <a href='{{ site.baseurl }}about'> --> <img id="avatar" class="2x" src="/assets/images/avatar.png"/> <!-- </a> --> <h1>{{ site.author }}</h1> <h2>{{ site.description }}</h2> </header> </section> </div>
<div class="profile"> <section id="wrapper"> <header id="header"> <a href="https://twitter.com/{{ site.authorTwitter }}" target="_blank"> <img id="avatar" class="2x" src="https://www.gravatar.com/avatar/4a0fecf18d3f617771b45194659da7e4.jpg?s=200" alt="My face"/> </a> <h1>{{ site.author }}</h1> <h2>{{ site.description }}</h2> </header> </section> </div>
Add twitter link to avatar
Add twitter link to avatar * Use gravatar for avatar
HTML
mit
mixxorz/mixxorz.github.io,mixxorz/mixxorz.github.io,mixxorz/mixxorz.github.io
html
## Code Before: <div class="profile"> <section id="wrapper"> <header id="header"> <!-- <a href='{{ site.baseurl }}about'> --> <img id="avatar" class="2x" src="/assets/images/avatar.png"/> <!-- </a> --> <h1>{{ site.author }}</h1> <h2>{{ site.description }}</h2> </header> </section> </div> ## Instruction: Add twitter link to avatar * Use gravatar for avatar ## Code After: <div class="profile"> <section id="wrapper"> <header id="header"> <a href="https://twitter.com/{{ site.authorTwitter }}" target="_blank"> <img id="avatar" class="2x" src="https://www.gravatar.com/avatar/4a0fecf18d3f617771b45194659da7e4.jpg?s=200" alt="My face"/> </a> <h1>{{ site.author }}</h1> <h2>{{ site.description }}</h2> </header> </section> </div>
bdbafc18317070530573bd28a2ec5241c793340b
ghost/admin/routes/posts.js
ghost/admin/routes/posts.js
import styleBody from 'ghost/mixins/style-body'; import AuthenticatedRoute from 'ghost/routes/authenticated'; var paginationSettings = { status: 'all', staticPages: 'all', page: 1, limit: 15 }; var PostsRoute = AuthenticatedRoute.extend(styleBody, { classNames: ['manage'], model: function () { // using `.filter` allows the template to auto-update when new models are pulled in from the server. // we just need to 'return true' to allow all models by default. return this.store.filter('post', paginationSettings, function () { return true; }); }, setupController: function (controller, model) { this._super(controller, model); controller.set('paginationSettings', paginationSettings); }, actions: { openEditor: function (post) { this.transitionTo('editor', post); } } }); export default PostsRoute;
import styleBody from 'ghost/mixins/style-body'; import AuthenticatedRoute from 'ghost/routes/authenticated'; var paginationSettings = { status: 'all', staticPages: 'all', page: 1 }; var PostsRoute = AuthenticatedRoute.extend(styleBody, { classNames: ['manage'], model: function () { // using `.filter` allows the template to auto-update when new models are pulled in from the server. // we just need to 'return true' to allow all models by default. return this.store.filter('post', paginationSettings, function () { return true; }); }, setupController: function (controller, model) { this._super(controller, model); controller.set('paginationSettings', paginationSettings); }, actions: { openEditor: function (post) { this.transitionTo('editor', post); } } }); export default PostsRoute;
Remove limit from ember post API calls
Remove limit from ember post API calls ref #3004 - this is unnecessary and causing bugs
JavaScript
mit
TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost
javascript
## Code Before: import styleBody from 'ghost/mixins/style-body'; import AuthenticatedRoute from 'ghost/routes/authenticated'; var paginationSettings = { status: 'all', staticPages: 'all', page: 1, limit: 15 }; var PostsRoute = AuthenticatedRoute.extend(styleBody, { classNames: ['manage'], model: function () { // using `.filter` allows the template to auto-update when new models are pulled in from the server. // we just need to 'return true' to allow all models by default. return this.store.filter('post', paginationSettings, function () { return true; }); }, setupController: function (controller, model) { this._super(controller, model); controller.set('paginationSettings', paginationSettings); }, actions: { openEditor: function (post) { this.transitionTo('editor', post); } } }); export default PostsRoute; ## Instruction: Remove limit from ember post API calls ref #3004 - this is unnecessary and causing bugs ## Code After: import styleBody from 'ghost/mixins/style-body'; import AuthenticatedRoute from 'ghost/routes/authenticated'; var paginationSettings = { status: 'all', staticPages: 'all', page: 1 }; var PostsRoute = AuthenticatedRoute.extend(styleBody, { classNames: ['manage'], model: function () { // using `.filter` allows the template to auto-update when new models are pulled in from the server. // we just need to 'return true' to allow all models by default. return this.store.filter('post', paginationSettings, function () { return true; }); }, setupController: function (controller, model) { this._super(controller, model); controller.set('paginationSettings', paginationSettings); }, actions: { openEditor: function (post) { this.transitionTo('editor', post); } } }); export default PostsRoute;
cc8d83fda2b19864a16bcb1e7191222cee03f95b
test/integration/character_stories_test.rb
test/integration/character_stories_test.rb
require 'test_helper' # Tests scenarios related to interacting with Characters class CharacterStoriesTest < ActionDispatch::IntegrationTest setup do @user = log_in_as_user end test 'a user can create a new character' do character = build(:character) visit new_character_path fill_in 'character_name', with: character.name fill_in 'character_universe_id', with: character.universe click_on 'Create Character' assert_equal character_path(Character.where(name: character.name).first), current_path end end
require 'test_helper' # Tests scenarios related to interacting with Characters class CharacterStoriesTest < ActionDispatch::IntegrationTest setup do @user = log_in_as_user end test 'a user can create a new character' do character = build(:character) visit new_character_path fill_in 'character_name', with: character.name click_on 'Create Character' assert_equal character_path(Character.where(name: character.name).first), current_path end end
Remove failing line from story
Remove failing line from story
Ruby
mit
indentlabs/notebook,indentlabs/notebook,indentlabs/notebook
ruby
## Code Before: require 'test_helper' # Tests scenarios related to interacting with Characters class CharacterStoriesTest < ActionDispatch::IntegrationTest setup do @user = log_in_as_user end test 'a user can create a new character' do character = build(:character) visit new_character_path fill_in 'character_name', with: character.name fill_in 'character_universe_id', with: character.universe click_on 'Create Character' assert_equal character_path(Character.where(name: character.name).first), current_path end end ## Instruction: Remove failing line from story ## Code After: require 'test_helper' # Tests scenarios related to interacting with Characters class CharacterStoriesTest < ActionDispatch::IntegrationTest setup do @user = log_in_as_user end test 'a user can create a new character' do character = build(:character) visit new_character_path fill_in 'character_name', with: character.name click_on 'Create Character' assert_equal character_path(Character.where(name: character.name).first), current_path end end
595345aec59d6024ece4a4481b431ccce32590bf
README.md
README.md
Camera Name Normalization
Camera Name Normalization ===== Before normalization: Canon 5D mark II Canon 5d MKII Canon 5dMKII Canon 5D Mk III After normalization: Canon 5D Mark II Canon 5D Mk III Using the normalizer =================== **from within Python**: from .camera_name_normalizer import CameraNameNormalizer (normalized_data, change_map) = CameraNameNormalizer.normalize("camera_list.txt") new_unique_values = normalized_data.values() Testing the normalizer =================== In TDD fashion a test will be included with this excersize. To run the test, use py.test in the project directory. Thought Process =================== The thought process behind this implemntation is as follows: If we can given a camera name, simplify (normalize it) into it's simplist possible form - that is consistent independant of it's casing, spacing, and set of words used - we can then creating a mapping of the simplified form to the longest best defined form within a given list. This allows the logic to be done in a quick single pass of the file, and allows the resulting label to "Learn" with the data supplied (as a better defined label becomes available it is automatically applied). Additionally, while two data structures are used in this example, strictly speaking only one small data structure would be required using this approach (the mapping of the simplified form -> the best defined label available so far). The extra data data set only exists because of the written requirement that there be a mapping of the original form to its expanded form for all values. In practical applications the normalization method would allow you to always see what the expanded form of any string would be on an on-demand basis. In fact, in the given code you can see what any value in the list was mapped to by running normalized_data[original_value]. _________________________________________- Thanks! ~Timothy Crosley
Add readme to define intended approach and usage
Add readme to define intended approach and usage
Markdown
mit
timothycrosley/camera_name_normalizer
markdown
## Code Before: Camera Name Normalization ## Instruction: Add readme to define intended approach and usage ## Code After: Camera Name Normalization ===== Before normalization: Canon 5D mark II Canon 5d MKII Canon 5dMKII Canon 5D Mk III After normalization: Canon 5D Mark II Canon 5D Mk III Using the normalizer =================== **from within Python**: from .camera_name_normalizer import CameraNameNormalizer (normalized_data, change_map) = CameraNameNormalizer.normalize("camera_list.txt") new_unique_values = normalized_data.values() Testing the normalizer =================== In TDD fashion a test will be included with this excersize. To run the test, use py.test in the project directory. Thought Process =================== The thought process behind this implemntation is as follows: If we can given a camera name, simplify (normalize it) into it's simplist possible form - that is consistent independant of it's casing, spacing, and set of words used - we can then creating a mapping of the simplified form to the longest best defined form within a given list. This allows the logic to be done in a quick single pass of the file, and allows the resulting label to "Learn" with the data supplied (as a better defined label becomes available it is automatically applied). Additionally, while two data structures are used in this example, strictly speaking only one small data structure would be required using this approach (the mapping of the simplified form -> the best defined label available so far). The extra data data set only exists because of the written requirement that there be a mapping of the original form to its expanded form for all values. In practical applications the normalization method would allow you to always see what the expanded form of any string would be on an on-demand basis. In fact, in the given code you can see what any value in the list was mapped to by running normalized_data[original_value]. _________________________________________- Thanks! ~Timothy Crosley
365d6e1c306549c07c1449d7d5e7cea5a8bc2634
src/main/java/com/alexrnl/subtitlecorrector/correctionstrategy/AbstractStrategy.java
src/main/java/com/alexrnl/subtitlecorrector/correctionstrategy/AbstractStrategy.java
package com.alexrnl.subtitlecorrector.correctionstrategy; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.logging.Logger; import com.alexrnl.subtitlecorrector.service.SessionParameters; /** * Abstract strategy implementation.<br /> * Provide a basic body for the actual strategies. There is no logic in this class. * @author Alex */ public abstract class AbstractStrategy implements Strategy { /** Logger */ private static final Logger LG = Logger.getLogger(AbstractStrategy.class.getName()); @Override public void startSession (final SessionParameters parameters) { // Nothing to do here, override if strategy depends on session state } @Override public void stopSession () { // Nothing to do here, override if strategy depends on session state } @Override public List<Parameter<?>> getParameters () { return new ArrayList<>(0); } @Override public Parameter<?> getParameterByName (final String name) { Objects.requireNonNull(name); for (final Parameter<?> parameter : getParameters()) { if (parameter.getDescription().equals(name)) { return parameter; } } LG.info("No parameter with name " + name + " found"); return null; } }
package com.alexrnl.subtitlecorrector.correctionstrategy; import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.logging.Logger; import com.alexrnl.subtitlecorrector.service.SessionParameters; /** * Abstract strategy implementation.<br /> * Provide a basic body for the actual strategies. There is no logic in this class. * @author Alex */ public abstract class AbstractStrategy implements Strategy { /** Logger */ private static final Logger LG = Logger.getLogger(AbstractStrategy.class.getName()); @Override public void startSession (final SessionParameters parameters) { // Nothing to do here, override if strategy depends on session state } @Override public void stopSession () { // Nothing to do here, override if strategy depends on session state } @Override public List<Parameter<?>> getParameters () { return Collections.emptyList(); } @Override public Parameter<?> getParameterByName (final String name) { Objects.requireNonNull(name); for (final Parameter<?> parameter : getParameters()) { if (parameter.getDescription().equals(name)) { return parameter; } } LG.info("No parameter with name " + name + " found"); return null; } }
Replace empty list creation with Collections.emptyList()
Replace empty list creation with Collections.emptyList()
Java
bsd-3-clause
AlexRNL/SubtitleCorrector
java
## Code Before: package com.alexrnl.subtitlecorrector.correctionstrategy; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.logging.Logger; import com.alexrnl.subtitlecorrector.service.SessionParameters; /** * Abstract strategy implementation.<br /> * Provide a basic body for the actual strategies. There is no logic in this class. * @author Alex */ public abstract class AbstractStrategy implements Strategy { /** Logger */ private static final Logger LG = Logger.getLogger(AbstractStrategy.class.getName()); @Override public void startSession (final SessionParameters parameters) { // Nothing to do here, override if strategy depends on session state } @Override public void stopSession () { // Nothing to do here, override if strategy depends on session state } @Override public List<Parameter<?>> getParameters () { return new ArrayList<>(0); } @Override public Parameter<?> getParameterByName (final String name) { Objects.requireNonNull(name); for (final Parameter<?> parameter : getParameters()) { if (parameter.getDescription().equals(name)) { return parameter; } } LG.info("No parameter with name " + name + " found"); return null; } } ## Instruction: Replace empty list creation with Collections.emptyList() ## Code After: package com.alexrnl.subtitlecorrector.correctionstrategy; import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.logging.Logger; import com.alexrnl.subtitlecorrector.service.SessionParameters; /** * Abstract strategy implementation.<br /> * Provide a basic body for the actual strategies. There is no logic in this class. * @author Alex */ public abstract class AbstractStrategy implements Strategy { /** Logger */ private static final Logger LG = Logger.getLogger(AbstractStrategy.class.getName()); @Override public void startSession (final SessionParameters parameters) { // Nothing to do here, override if strategy depends on session state } @Override public void stopSession () { // Nothing to do here, override if strategy depends on session state } @Override public List<Parameter<?>> getParameters () { return Collections.emptyList(); } @Override public Parameter<?> getParameterByName (final String name) { Objects.requireNonNull(name); for (final Parameter<?> parameter : getParameters()) { if (parameter.getDescription().equals(name)) { return parameter; } } LG.info("No parameter with name " + name + " found"); return null; } }
266ff7e4b2cf8c51410a39d56b233649c32536c3
jenkins/jobs/scripts/promote-get-hash.sh
jenkins/jobs/scripts/promote-get-hash.sh
export NEW_HASH=`curl $DELOREAN_URL | grep baseurl | awk -F '/' '{ print $5"/"$6"/"$7 }'` export OLD_HASH=`curl $LAST_PROMOTED_URL | grep baseurl | awk -F '/' '{ print $5"/"$6"/"$7 }'` # No need to run the whole promote pipeline if there is nothing new to promote if [ $OLD_HASH == $NEW_HASH ]; then exit 23 fi echo "delorean_current_hash = $NEW_HASH" > $HASH_FILE # Set the $LOCATION where quickstart will expect the images while testing in the pipeline # This is used by the ansible-role-tripleo-image build (atrib) role and oooq/ci-scripts/image.sh echo "LOCATION = $LOCATION" >> $HASH_FILE
export NEW_HASH=`curl $DELOREAN_URL | grep baseurl | awk -F '/' '{ print $5"/"$6"/"$7 }'` export OLD_HASH=`curl $LAST_PROMOTED_URL | grep baseurl | awk -F '/' '{ print $5"/"$6"/"$7 }'` # No need to run the whole promote pipeline if there is nothing new to promote if [ $OLD_HASH == $NEW_HASH ]; then exit 23 fi echo "delorean_current_hash = $NEW_HASH" > $HASH_FILE # These variables are used for the tripleo-quickstart-publish-testing-images # script to put images in the correct location. echo "LOCATION = $LOCATION" >> $HASH_FILE echo "BUILD_SYS = $BUILD_SYS" >> $HASH_FILE echo "RDO_VERSION_DIR = $RDO_VERSION_DIR" >> $HASH_FILE
Put variables for image promotion in the hash file
Put variables for image promotion in the hash file Change-Id: Idf95014926a7274527db3e3075afec7acb8bd7f1
Shell
apache-2.0
rdo-infra/ci-config,redhat-openstack/rdo-infra,rdo-infra/ci-config,rdo-infra/ci-config,redhat-openstack/rdo-infra,redhat-openstack/rdo-infra,redhat-openstack/rdo-infra,rdo-infra/ci-config
shell
## Code Before: export NEW_HASH=`curl $DELOREAN_URL | grep baseurl | awk -F '/' '{ print $5"/"$6"/"$7 }'` export OLD_HASH=`curl $LAST_PROMOTED_URL | grep baseurl | awk -F '/' '{ print $5"/"$6"/"$7 }'` # No need to run the whole promote pipeline if there is nothing new to promote if [ $OLD_HASH == $NEW_HASH ]; then exit 23 fi echo "delorean_current_hash = $NEW_HASH" > $HASH_FILE # Set the $LOCATION where quickstart will expect the images while testing in the pipeline # This is used by the ansible-role-tripleo-image build (atrib) role and oooq/ci-scripts/image.sh echo "LOCATION = $LOCATION" >> $HASH_FILE ## Instruction: Put variables for image promotion in the hash file Change-Id: Idf95014926a7274527db3e3075afec7acb8bd7f1 ## Code After: export NEW_HASH=`curl $DELOREAN_URL | grep baseurl | awk -F '/' '{ print $5"/"$6"/"$7 }'` export OLD_HASH=`curl $LAST_PROMOTED_URL | grep baseurl | awk -F '/' '{ print $5"/"$6"/"$7 }'` # No need to run the whole promote pipeline if there is nothing new to promote if [ $OLD_HASH == $NEW_HASH ]; then exit 23 fi echo "delorean_current_hash = $NEW_HASH" > $HASH_FILE # These variables are used for the tripleo-quickstart-publish-testing-images # script to put images in the correct location. echo "LOCATION = $LOCATION" >> $HASH_FILE echo "BUILD_SYS = $BUILD_SYS" >> $HASH_FILE echo "RDO_VERSION_DIR = $RDO_VERSION_DIR" >> $HASH_FILE
36769ee8d5ff62f95006483e6598b67a8e80330f
scripts/sbin/setup_zram.sh
scripts/sbin/setup_zram.sh
if [[ -f /.dockerenv ]]; then exit 0 fi modprobe zram num_devices=4 totalmem=$(free -m | awk '/Mem:/{print $2}') mem=$(( ($totalmem / 4 / 2)* 1024 * 1024)) for i in `seq 0 3`; do if [[ ! -e /dev/zram${i} ]]; then echo $mem > /sys/block/zram${i}/disksize mkswap /dev/zram${i} swapon -p 5 /dev/zram${i} fi done
if [[ -f /.dockerenv ]]; then exit 0 fi modprobe zram num_devices=4 totalmem=$(free -m | awk '/Mem:/{print $2}') mem=$(( ($totalmem / 4 / 2)* 1024 * 1024)) for i in `seq 0 3`; do echo $mem > /sys/block/zram${i}/disksize mkswap /dev/zram${i} swapon -p 5 /dev/zram${i} done
Revert "only create zram if not exists"
Revert "only create zram if not exists" This reverts commit 61a11498655132cb924abaa5a5cd3f5b1274b529.
Shell
agpl-3.0
firewalla/firewalla,MelvinTo/firewalla,firewalla/firewalla,firewalla/firewalla,MelvinTo/firewalla,MelvinTo/firewalla,MelvinTo/firewalla,firewalla/firewalla,firewalla/firewalla,MelvinTo/firewalla
shell
## Code Before: if [[ -f /.dockerenv ]]; then exit 0 fi modprobe zram num_devices=4 totalmem=$(free -m | awk '/Mem:/{print $2}') mem=$(( ($totalmem / 4 / 2)* 1024 * 1024)) for i in `seq 0 3`; do if [[ ! -e /dev/zram${i} ]]; then echo $mem > /sys/block/zram${i}/disksize mkswap /dev/zram${i} swapon -p 5 /dev/zram${i} fi done ## Instruction: Revert "only create zram if not exists" This reverts commit 61a11498655132cb924abaa5a5cd3f5b1274b529. ## Code After: if [[ -f /.dockerenv ]]; then exit 0 fi modprobe zram num_devices=4 totalmem=$(free -m | awk '/Mem:/{print $2}') mem=$(( ($totalmem / 4 / 2)* 1024 * 1024)) for i in `seq 0 3`; do echo $mem > /sys/block/zram${i}/disksize mkswap /dev/zram${i} swapon -p 5 /dev/zram${i} done
7f652c4e4441ef9e0c148948232075aed410db80
README.md
README.md
Web Extension for handling groups of tabs persisted as bookmarks. [![Build Status](https://travis-ci.org/hupf/tabmarks.svg?branch=master)](https://travis-ci.org/hupf/tabmarks) ## Known issues * Only tested with Firefox. * No i18n support (currently english only) * Changes to the persisted bookmarks will not yet be synchronized with the open tabs. ## Development (for Firefox) Install dependencies: yarn install Open Firefox and load the extension temporarily in the browser: yarn start Linting: yarn lint Testing: yarn test Creating a ZIP file (will be put in `web-ext-artifacts/`): yarn build ## Author Mathis Hofer (thanks to [Puzzle ITC](https://puzzle.ch) for letting me starting this project) ## License Distributed under the [MIT License](LICENSE).
Web Extension for handling groups of tabs persisted as bookmarks. [![Build Status](https://travis-ci.org/hupf/tabmarks.svg?branch=master)](https://travis-ci.org/hupf/tabmarks) ## Known issues * Switching to a group loads all tabs (which is slow and clutters browser history), see #9 * No ability to rename, move or delete groups without browser restart, see #6 * No i18n support (currently english only) * Only tested with Firefox ## Development (for Firefox) Install dependencies: yarn install Open Firefox and load the extension temporarily in the browser: yarn start Linting: yarn lint Testing: yarn test Creating a ZIP file (will be put in `web-ext-artifacts/`): yarn build ## Author Mathis Hofer (thanks to [Puzzle ITC](https://puzzle.ch) for letting me starting this project) ## License Distributed under the [MIT License](LICENSE).
Update know issues in readme
Update know issues in readme
Markdown
mit
hupf/tabmarks,hupf/tabmarks
markdown
## Code Before: Web Extension for handling groups of tabs persisted as bookmarks. [![Build Status](https://travis-ci.org/hupf/tabmarks.svg?branch=master)](https://travis-ci.org/hupf/tabmarks) ## Known issues * Only tested with Firefox. * No i18n support (currently english only) * Changes to the persisted bookmarks will not yet be synchronized with the open tabs. ## Development (for Firefox) Install dependencies: yarn install Open Firefox and load the extension temporarily in the browser: yarn start Linting: yarn lint Testing: yarn test Creating a ZIP file (will be put in `web-ext-artifacts/`): yarn build ## Author Mathis Hofer (thanks to [Puzzle ITC](https://puzzle.ch) for letting me starting this project) ## License Distributed under the [MIT License](LICENSE). ## Instruction: Update know issues in readme ## Code After: Web Extension for handling groups of tabs persisted as bookmarks. [![Build Status](https://travis-ci.org/hupf/tabmarks.svg?branch=master)](https://travis-ci.org/hupf/tabmarks) ## Known issues * Switching to a group loads all tabs (which is slow and clutters browser history), see #9 * No ability to rename, move or delete groups without browser restart, see #6 * No i18n support (currently english only) * Only tested with Firefox ## Development (for Firefox) Install dependencies: yarn install Open Firefox and load the extension temporarily in the browser: yarn start Linting: yarn lint Testing: yarn test Creating a ZIP file (will be put in `web-ext-artifacts/`): yarn build ## Author Mathis Hofer (thanks to [Puzzle ITC](https://puzzle.ch) for letting me starting this project) ## License Distributed under the [MIT License](LICENSE).
30f33de6fea95287064f35bb916bdeaf6db7d949
resources/sparql/get_exercise.mustache
resources/sparql/get_exercise.mustache
{{! @param IRI exercise }} {{> sparql/prefixes.mustache }} SELECT (REPLACE(STR(<{{exercise}}>), "^.*\\/([^/]+)$", "$1") AS ?id) ?name (REPLACE(?_description, "^\\s+|\\s+$", "") AS ?description) ?query WHERE { <{{exercise}}> a sp:Query ; rdfs:label ?name ; rdfs:comment ?_description ; sp:text ?query . }
{{! @param IRI exercise }} {{> sparql/prefixes.mustache }} SELECT (REPLACE(STR(<{{exercise}}>), "^.*\\/([^/]+)$", "$1") AS ?id) ?name (REPLACE(?_description, "^\\s+|\\s+$", "") AS ?description) (REPLACE(?_query, "^\\s+|\\s+$", "") AS ?query) WHERE { <{{exercise}}> a sp:Query ; rdfs:label ?name ; rdfs:comment ?_description ; sp:text ?_query . }
Trim trailing whitespace from canonical queries
Trim trailing whitespace from canonical queries
HTML+Django
epl-1.0
jindrichmynarz/sparqlab,jindrichmynarz/sparqlab,jindrichmynarz/sparqlab
html+django
## Code Before: {{! @param IRI exercise }} {{> sparql/prefixes.mustache }} SELECT (REPLACE(STR(<{{exercise}}>), "^.*\\/([^/]+)$", "$1") AS ?id) ?name (REPLACE(?_description, "^\\s+|\\s+$", "") AS ?description) ?query WHERE { <{{exercise}}> a sp:Query ; rdfs:label ?name ; rdfs:comment ?_description ; sp:text ?query . } ## Instruction: Trim trailing whitespace from canonical queries ## Code After: {{! @param IRI exercise }} {{> sparql/prefixes.mustache }} SELECT (REPLACE(STR(<{{exercise}}>), "^.*\\/([^/]+)$", "$1") AS ?id) ?name (REPLACE(?_description, "^\\s+|\\s+$", "") AS ?description) (REPLACE(?_query, "^\\s+|\\s+$", "") AS ?query) WHERE { <{{exercise}}> a sp:Query ; rdfs:label ?name ; rdfs:comment ?_description ; sp:text ?_query . }
1d098bd297e00ba3196f67e2d222898e67750f81
playbooks/tester/rally/run.yml
playbooks/tester/rally/run.yml
--- - name: Copy to Task Files Rally hosts: tester tasks: - name: Copy Task file from settings copy: dest: "{{ tester.rally.dir }}/{{ tester.rally.taskfile }}" src: "{{ tester.tests.rally.task }}" force: yes - name: Run Rally Task hosts: tester tasks: - name: Check Rally deployment command: "{{ tester.rally.path }}/bin/rally deployment check" - name: Start Rally task command: "{{ tester.rally.path }}/bin/rally -v task start --task {{ tester.rally.dir }}/{{ tester.rally.taskfile }}"
--- - name: Copy to Task Files Rally hosts: tester tasks: - name: Copy Task file from settings copy: dest: "{{ tester.rally.dir }}/{{ tester.rally.taskfile }}" content: "{{ tester.tests.rally.task | to_nice_json }}" force: yes - name: Run Rally Task hosts: tester tasks: - name: Check Rally deployment command: "{{ tester.rally.path }}/bin/rally deployment check" - name: Start Rally task command: "{{ tester.rally.path }}/bin/rally -v task start --task {{ tester.rally.dir }}/{{ tester.rally.taskfile }}"
Revert "Running Rally task from a file"
Revert "Running Rally task from a file" This reverts commit c22a8037bfb813cd4b58b201755e274bbaf47097. Based on comment, please submit a new patch that aligns the ODL to the rest of the rally tests Change-Id: I08712dab14216a2fd1f268e830c490567d70ba25
YAML
apache-2.0
okolisny/InfraRed,redhat-openstack/infrared,redhat-openstack/infrared,redhat-openstack/infrared,okolisny/InfraRed,okolisny/InfraRed
yaml
## Code Before: --- - name: Copy to Task Files Rally hosts: tester tasks: - name: Copy Task file from settings copy: dest: "{{ tester.rally.dir }}/{{ tester.rally.taskfile }}" src: "{{ tester.tests.rally.task }}" force: yes - name: Run Rally Task hosts: tester tasks: - name: Check Rally deployment command: "{{ tester.rally.path }}/bin/rally deployment check" - name: Start Rally task command: "{{ tester.rally.path }}/bin/rally -v task start --task {{ tester.rally.dir }}/{{ tester.rally.taskfile }}" ## Instruction: Revert "Running Rally task from a file" This reverts commit c22a8037bfb813cd4b58b201755e274bbaf47097. Based on comment, please submit a new patch that aligns the ODL to the rest of the rally tests Change-Id: I08712dab14216a2fd1f268e830c490567d70ba25 ## Code After: --- - name: Copy to Task Files Rally hosts: tester tasks: - name: Copy Task file from settings copy: dest: "{{ tester.rally.dir }}/{{ tester.rally.taskfile }}" content: "{{ tester.tests.rally.task | to_nice_json }}" force: yes - name: Run Rally Task hosts: tester tasks: - name: Check Rally deployment command: "{{ tester.rally.path }}/bin/rally deployment check" - name: Start Rally task command: "{{ tester.rally.path }}/bin/rally -v task start --task {{ tester.rally.dir }}/{{ tester.rally.taskfile }}"
bbdd6ab38e003e94147a35a6c9c29c85d0e365b5
README.md
README.md
Kubo is a [BOSH](https://bosh.io/) release for Kubernetes. It provides a solution for deploying and managing Kubernetes with BOSH This repository contains the documentation and manifests for deploying [kubo-release](https://github.com/cloudfoundry-incubator/kubo-release) with BOSH. **Slack**: #cfcr on https://slack.cloudfoundry.org **Pivotal Tracker**: https://www.pivotaltracker.com/n/projects/2093412 ## Documentation To deploy CFCR go [here](https://github.com/cloudfoundry-incubator/kubo-release/#deploying-cfcr). ## Contributing For instructions on contributing to this project, please see [CONTRIBUTING.md](CONTRIBUTING.md). ## Troubleshooting Please refer to the [troubleshooting guide](https://docs-cfcr.cfapps.io/managing/troubleshooting/) to look for solutions to the most common issues/
Kubo is a [BOSH](https://bosh.io/) release for Kubernetes. It provides a solution for deploying and managing Kubernetes with BOSH This repository contains the documentation and manifests for deploying [kubo-release](https://github.com/cloudfoundry-incubator/kubo-release) with BOSH. **Slack**: #cfcr on https://slack.cloudfoundry.org **Pivotal Tracker**: https://www.pivotaltracker.com/n/projects/2093412 ## Documentation To deploy CFCR go [here](https://github.com/cloudfoundry-incubator/kubo-release/#deploying-cfcr). ## Contributing For instructions on contributing to this project, please see [CONTRIBUTING.md](CONTRIBUTING.md).
Drop troubleshooting sections from readme
Drop troubleshooting sections from readme The link is dead
Markdown
apache-2.0
pivotal-cf-experimental/kubo-deployment,jaimegag/kubo-deployment,pivotal-cf-experimental/kubo-deployment,jaimegag/kubo-deployment
markdown
## Code Before: Kubo is a [BOSH](https://bosh.io/) release for Kubernetes. It provides a solution for deploying and managing Kubernetes with BOSH This repository contains the documentation and manifests for deploying [kubo-release](https://github.com/cloudfoundry-incubator/kubo-release) with BOSH. **Slack**: #cfcr on https://slack.cloudfoundry.org **Pivotal Tracker**: https://www.pivotaltracker.com/n/projects/2093412 ## Documentation To deploy CFCR go [here](https://github.com/cloudfoundry-incubator/kubo-release/#deploying-cfcr). ## Contributing For instructions on contributing to this project, please see [CONTRIBUTING.md](CONTRIBUTING.md). ## Troubleshooting Please refer to the [troubleshooting guide](https://docs-cfcr.cfapps.io/managing/troubleshooting/) to look for solutions to the most common issues/ ## Instruction: Drop troubleshooting sections from readme The link is dead ## Code After: Kubo is a [BOSH](https://bosh.io/) release for Kubernetes. It provides a solution for deploying and managing Kubernetes with BOSH This repository contains the documentation and manifests for deploying [kubo-release](https://github.com/cloudfoundry-incubator/kubo-release) with BOSH. **Slack**: #cfcr on https://slack.cloudfoundry.org **Pivotal Tracker**: https://www.pivotaltracker.com/n/projects/2093412 ## Documentation To deploy CFCR go [here](https://github.com/cloudfoundry-incubator/kubo-release/#deploying-cfcr). ## Contributing For instructions on contributing to this project, please see [CONTRIBUTING.md](CONTRIBUTING.md).
ad402ed6db5d68fd804830ae00a2e0efa95d41f8
xsl/preprocess.xsl
xsl/preprocess.xsl
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:arc="http://www.opengroup.org/xsd/archimate"> <xsl:param name="customxsl"/> <xsl:template match="@*|node()" name="identity"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="xsl:include"> <xsl:element name="xsl:include"> <xsl:choose> <xsl:when test="$customxsl != ''"> <xsl:attribute name="href"><xsl:value-of select="$customxsl"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="href">default.xsl</xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:element> </xsl:template> </xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:arc="http://www.opengroup.org/xsd/archimate"> <xsl:param name="customxsl"/> <xsl:template match="@*|node()" name="identity"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="xsl:include"> <xsl:element name="xsl:include"> <xsl:choose> <xsl:when test="$customxsl != ''"> <xsl:attribute name="href">file:///<xsl:value-of select="replace($customxsl,'\\','/')"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="href">default.xsl</xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:element> </xsl:template> </xsl:stylesheet>
Fix for windows custom xsl
Fix for windows custom xsl
XSLT
mit
guidohajanssen/archimateviewer,guidohajanssen/archimateviewer,guidohajanssen/archimateviewer
xslt
## Code Before: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:arc="http://www.opengroup.org/xsd/archimate"> <xsl:param name="customxsl"/> <xsl:template match="@*|node()" name="identity"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="xsl:include"> <xsl:element name="xsl:include"> <xsl:choose> <xsl:when test="$customxsl != ''"> <xsl:attribute name="href"><xsl:value-of select="$customxsl"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="href">default.xsl</xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:element> </xsl:template> </xsl:stylesheet> ## Instruction: Fix for windows custom xsl ## Code After: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:arc="http://www.opengroup.org/xsd/archimate"> <xsl:param name="customxsl"/> <xsl:template match="@*|node()" name="identity"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> <xsl:template match="xsl:include"> <xsl:element name="xsl:include"> <xsl:choose> <xsl:when test="$customxsl != ''"> <xsl:attribute name="href">file:///<xsl:value-of select="replace($customxsl,'\\','/')"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="href">default.xsl</xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:element> </xsl:template> </xsl:stylesheet>
ef075dcf518b9b290342a1d13fe3c4c64e3d9e8a
.travis.yml
.travis.yml
language: go go: - 1.9 - tip env: - DEP_VERSION="0.3.2" notifications: email: false before_install: - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep - chmod +x $GOPATH/bin/dep install: - dep ensure script: - go vet ./... - go test -v -cover -race ./...
language: go go: - 1.9 - tip env: - DEP_VERSION="0.3.2" matrix: allow_failures: - go: tip fast_finish: true notifications: email: false before_install: - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep - chmod +x $GOPATH/bin/dep install: - dep ensure script: - go vet ./... - go test -v -cover -race ./...
Enable fast_finish and allow failures for tip in TravisCI
Enable fast_finish and allow failures for tip in TravisCI
YAML
mit
venyii/instabot
yaml
## Code Before: language: go go: - 1.9 - tip env: - DEP_VERSION="0.3.2" notifications: email: false before_install: - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep - chmod +x $GOPATH/bin/dep install: - dep ensure script: - go vet ./... - go test -v -cover -race ./... ## Instruction: Enable fast_finish and allow failures for tip in TravisCI ## Code After: language: go go: - 1.9 - tip env: - DEP_VERSION="0.3.2" matrix: allow_failures: - go: tip fast_finish: true notifications: email: false before_install: - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep - chmod +x $GOPATH/bin/dep install: - dep ensure script: - go vet ./... - go test -v -cover -race ./...
e64116d69cb82268fdf7161a7b157db04ffd32ff
lib/nylas/current_account.rb
lib/nylas/current_account.rb
module Nylas # Ruby representation of the Nylas /account API # @see https://docs.nylas.com/reference#account class CurrentAccount include Model self.showable = true self.resources_path = "/account" attribute :id, :string attribute :object, :string, default: "account" attribute :account_id, :string attribute :email_address, :string attribute :name, :string attribute :organization_unit, :string attribute :provider, :string attribute :sync_state, :string end end
module Nylas # Ruby representation of the Nylas /account API # @see https://docs.nylas.com/reference#account class CurrentAccount include Model self.showable = true self.resources_path = "/account" attribute :id, :string attribute :object, :string, default: "account" attribute :account_id, :string attribute :email_address, :string attribute :name, :string attribute :organization_unit, :string attribute :provider, :string attribute :sync_state, :string attribute :linked_at, :unix_timestamp end end
Add new `linked_at` field to CurrentAccount
Add new `linked_at` field to CurrentAccount
Ruby
mit
nylas/nylas-ruby,nylas/nylas-ruby
ruby
## Code Before: module Nylas # Ruby representation of the Nylas /account API # @see https://docs.nylas.com/reference#account class CurrentAccount include Model self.showable = true self.resources_path = "/account" attribute :id, :string attribute :object, :string, default: "account" attribute :account_id, :string attribute :email_address, :string attribute :name, :string attribute :organization_unit, :string attribute :provider, :string attribute :sync_state, :string end end ## Instruction: Add new `linked_at` field to CurrentAccount ## Code After: module Nylas # Ruby representation of the Nylas /account API # @see https://docs.nylas.com/reference#account class CurrentAccount include Model self.showable = true self.resources_path = "/account" attribute :id, :string attribute :object, :string, default: "account" attribute :account_id, :string attribute :email_address, :string attribute :name, :string attribute :organization_unit, :string attribute :provider, :string attribute :sync_state, :string attribute :linked_at, :unix_timestamp end end
76971ba45745f1205393a89d79e27bab179cc557
lib/locations_ng/state.rb
lib/locations_ng/state.rb
module LocationsNg class State @@all_states class << self def all load_states.map{ |s| {name: s['name'], capital: s['capital']} } end def details(state) load_states state_index = @@all_states.index{ |s| s['alias'] == format_query(state) } if state_index.nil? {message: "No state found for '#{state}'", status: 404} else res = @@all_states[state_index].with_indifferent_access res['cities'] = LocationsNg::City.cities(state) res['lgas'] = LocationsNg::Lga.lgas(state) res end end def capital(state) load_states state_index = @@all_states.index{ |s| s['alias'] == format_query(state) } unless state_index.nil? return @@all_states[state_index]['capital'] end {message: "No state found for '#{state}'", status: 404} end private def load_states @@all_states ||= YAML.load(File.read(files_location 'states')) end def files_location(file) File.expand_path("../locations/#{file}.yml", __FILE__) end def format_query(query) query ? query.downcase.gsub(' ', '_') : query end end end end
module LocationsNg class State @all_states = LocationsNg::LoadFile.read('states') class << self def all @all_states.map{ |s| {name: s['name'], capital: s['capital']} } end def details(state) state_index = @all_states.index{ |s| s['alias'] == format_query(state) } if state_index.nil? {message: "No state found for '#{state}'", status: 404} else res = @all_states[state_index].with_indifferent_access res['cities'] = LocationsNg::City.cities(state) res['lgas'] = LocationsNg::Lga.lgas(state) res end end def capital(state) state_index = @all_states.index{ |s| s['alias'] == format_query(state) } unless state_index.nil? return @all_states[state_index]['capital'] end {message: "No state found for '#{state}'", status: 404} end private def format_query(query) query ? query.downcase.gsub(' ', '_') : query end end end end
Refactor State class to use new LoadFile class, and instance var instead of class var.
Refactor State class to use new LoadFile class, and instance var instead of class var.
Ruby
mit
ceemion/locations_ng
ruby
## Code Before: module LocationsNg class State @@all_states class << self def all load_states.map{ |s| {name: s['name'], capital: s['capital']} } end def details(state) load_states state_index = @@all_states.index{ |s| s['alias'] == format_query(state) } if state_index.nil? {message: "No state found for '#{state}'", status: 404} else res = @@all_states[state_index].with_indifferent_access res['cities'] = LocationsNg::City.cities(state) res['lgas'] = LocationsNg::Lga.lgas(state) res end end def capital(state) load_states state_index = @@all_states.index{ |s| s['alias'] == format_query(state) } unless state_index.nil? return @@all_states[state_index]['capital'] end {message: "No state found for '#{state}'", status: 404} end private def load_states @@all_states ||= YAML.load(File.read(files_location 'states')) end def files_location(file) File.expand_path("../locations/#{file}.yml", __FILE__) end def format_query(query) query ? query.downcase.gsub(' ', '_') : query end end end end ## Instruction: Refactor State class to use new LoadFile class, and instance var instead of class var. ## Code After: module LocationsNg class State @all_states = LocationsNg::LoadFile.read('states') class << self def all @all_states.map{ |s| {name: s['name'], capital: s['capital']} } end def details(state) state_index = @all_states.index{ |s| s['alias'] == format_query(state) } if state_index.nil? {message: "No state found for '#{state}'", status: 404} else res = @all_states[state_index].with_indifferent_access res['cities'] = LocationsNg::City.cities(state) res['lgas'] = LocationsNg::Lga.lgas(state) res end end def capital(state) state_index = @all_states.index{ |s| s['alias'] == format_query(state) } unless state_index.nil? return @all_states[state_index]['capital'] end {message: "No state found for '#{state}'", status: 404} end private def format_query(query) query ? query.downcase.gsub(' ', '_') : query end end end end
56de005c8a20f028a386a0a72f8a8e48985d86f5
terraform/shared/scripts/ip_tables.sh
terraform/shared/scripts/ip_tables.sh
set -e sudo iptables -I INPUT -s 0/0 -p tcp --dport 8300 -j ACCEPT sudo iptables -I INPUT -s 0/0 -p tcp --dport 8301 -j ACCEPT sudo iptables -I INPUT -s 0/0 -p tcp --dport 8302 -j ACCEPT if [ -d /etc/sysconfig ]; then sudo iptables-save | sudo tee /etc/sysconfig/iptables else sudo iptables-save | sudo tee /etc/iptables.rules fi
set -e sudo iptables -I INPUT -s 0/0 -p tcp --dport 8300 -j ACCEPT sudo iptables -I INPUT -s 0/0 -p tcp --dport 8301 -j ACCEPT sudo iptables -I INPUT -s 0/0 -p tcp --dport 8302 -j ACCEPT sudo iptables -I INPUT -s 0/0 -p tcp --dport 8400 -j ACCEPT if [ -d /etc/sysconfig ]; then sudo iptables-save | sudo tee /etc/sysconfig/iptables else sudo iptables-save | sudo tee /etc/iptables.rules fi
Add RPC port to iptables config
Add RPC port to iptables config From https://www.consul.io/docs/agent/options.html#ports
Shell
mpl-2.0
zeroae/consul,rhyas/consul,zeroae/consul,sunadm/consul,sweeneyb/consul,scalp42/consul,i0rek/consul,kylemcc/consul,sean-/consul,Thib17/consul,scalp42/consul,Pivotal-Pierre-Delagrave/consul,42wim/consul,mckennajones/consul,calgaryscientific/consul,tshak/consul,Pivotal-Pierre-Delagrave/consul,kingland/consul,pmalmgren/consul,Thib17/consul,sequenceiq/consul,andygoalkeeper/consul,Pivotal-Pierre-Delagrave/consul,youhong316/consul,sequenceiq/consul,sean-/consul,youhong316/consul,jovandeginste/consul,calgaryscientific/consul,tugbabodrumlu/consul,kylemcc/consul,calgaryscientific/consul,rhyas/consul,scalp42/consul,sweeneyb/consul,42wim/consul,andygoalkeeper/consul,hashicorp/consul,sunadm/consul,jovandeginste/consul,dankraw/consul,kylemcc/consul,sweeneyb/consul,Pivotal-Pierre-Delagrave/consul,zeroae/consul,sunadm/consul,sunadm/consul,hashicorp/consul,leowmjw/consul,mckennajones/consul,zeroae/consul,kingland/consul,i0rek/consul,jovandeginste/consul,andygoalkeeper/consul,sequenceiq/consul,42wim/consul,rhyas/consul,rhyas/consul,dankraw/consul,youhong316/consul,tugbabodrumlu/consul,Thib17/consul,i0rek/consul,youhong316/consul,tshak/consul,rhyas/consul,tugbabodrumlu/consul,i0rek/consul,zeroae/consul,tshak/consul,andygoalkeeper/consul,vamage/consul,hashicorp/consul,mckennajones/consul,hashicorp/consul,42wim/consul,tugbabodrumlu/consul,Thib17/consul,sweeneyb/consul,leowmjw/consul,kingland/consul,calgaryscientific/consul,leowmjw/consul,tshak/consul,pmalmgren/consul,mckennajones/consul,tugbabodrumlu/consul,mckennajones/consul,calgaryscientific/consul,pmalmgren/consul,sean-/consul,sean-/consul,pmalmgren/consul,pmalmgren/consul,vamage/consul,jovandeginste/consul,tshak/consul,i0rek/consul,Pivotal-Pierre-Delagrave/consul,sean-/consul,sequenceiq/consul,kylemcc/consul,kingland/consul,kylemcc/consul,andygoalkeeper/consul,Thib17/consul,dankraw/consul,vamage/consul,scalp42/consul,dankraw/consul,leowmjw/consul,jovandeginste/consul,kingland/consul,youhong316/consul,42wim/consul,leowmjw/consul,vamage/consul,dankraw/consul,sweeneyb/consul,sunadm/consul,scalp42/consul,vamage/consul,sequenceiq/consul
shell
## Code Before: set -e sudo iptables -I INPUT -s 0/0 -p tcp --dport 8300 -j ACCEPT sudo iptables -I INPUT -s 0/0 -p tcp --dport 8301 -j ACCEPT sudo iptables -I INPUT -s 0/0 -p tcp --dport 8302 -j ACCEPT if [ -d /etc/sysconfig ]; then sudo iptables-save | sudo tee /etc/sysconfig/iptables else sudo iptables-save | sudo tee /etc/iptables.rules fi ## Instruction: Add RPC port to iptables config From https://www.consul.io/docs/agent/options.html#ports ## Code After: set -e sudo iptables -I INPUT -s 0/0 -p tcp --dport 8300 -j ACCEPT sudo iptables -I INPUT -s 0/0 -p tcp --dport 8301 -j ACCEPT sudo iptables -I INPUT -s 0/0 -p tcp --dport 8302 -j ACCEPT sudo iptables -I INPUT -s 0/0 -p tcp --dport 8400 -j ACCEPT if [ -d /etc/sysconfig ]; then sudo iptables-save | sudo tee /etc/sysconfig/iptables else sudo iptables-save | sudo tee /etc/iptables.rules fi
830f8f5d262c69ae2f7a9ba511c0ad202dc80012
lib/easy_breadcrumbs.rb
lib/easy_breadcrumbs.rb
require 'sinatra/base' require 'easy_breadcrumbs/version' require 'easy_breadcrumbs/breadcrumb' module Sinatra include ::EasyBreadcrumbs module EasyBreadcrumbs Breadcrumb = ::EasyBreadcrumbs::Breadcrumb def easy_breadcrumbs # Path from current Rack::Request object request_path = request.path # All GET request routes route_matchers = Sinatra::Application.routes['GET'].map { |route| route[0] } # The rest is handled by Breadcrumb class breadcrumb = Breadcrumb.new(request_path, route_matchers) breadcrumb.to_html end end # Register helper with Sinatra::Application helpers EasyBreadcrumbs end
require 'sinatra/base' require 'easy_breadcrumbs/version' require 'easy_breadcrumbs/breadcrumb' module Sinatra include ::EasyBreadcrumbs module EasyBreadcrumbs Breadcrumb = ::EasyBreadcrumbs::Breadcrumb def easy_breadcrumbs # Path from current Rack::Request object request_path = request.path # All GET request routes route_matchers = self.class.routes['GET'].map { |route| route[0] } # The rest is handled by Breadcrumb class breadcrumb = Breadcrumb.new(request_path, route_matchers) breadcrumb.to_html end end # Register helper with Sinatra::Application helpers EasyBreadcrumbs end
Fix issue for modular style applications by accessing sinatra routes through self.class rather than Sinatra::Application.
Fix issue for modular style applications by accessing sinatra routes through self.class rather than Sinatra::Application.
Ruby
mit
nerboda/easy_breadcrumbs,nerboda/easy_breadcrumbs
ruby
## Code Before: require 'sinatra/base' require 'easy_breadcrumbs/version' require 'easy_breadcrumbs/breadcrumb' module Sinatra include ::EasyBreadcrumbs module EasyBreadcrumbs Breadcrumb = ::EasyBreadcrumbs::Breadcrumb def easy_breadcrumbs # Path from current Rack::Request object request_path = request.path # All GET request routes route_matchers = Sinatra::Application.routes['GET'].map { |route| route[0] } # The rest is handled by Breadcrumb class breadcrumb = Breadcrumb.new(request_path, route_matchers) breadcrumb.to_html end end # Register helper with Sinatra::Application helpers EasyBreadcrumbs end ## Instruction: Fix issue for modular style applications by accessing sinatra routes through self.class rather than Sinatra::Application. ## Code After: require 'sinatra/base' require 'easy_breadcrumbs/version' require 'easy_breadcrumbs/breadcrumb' module Sinatra include ::EasyBreadcrumbs module EasyBreadcrumbs Breadcrumb = ::EasyBreadcrumbs::Breadcrumb def easy_breadcrumbs # Path from current Rack::Request object request_path = request.path # All GET request routes route_matchers = self.class.routes['GET'].map { |route| route[0] } # The rest is handled by Breadcrumb class breadcrumb = Breadcrumb.new(request_path, route_matchers) breadcrumb.to_html end end # Register helper with Sinatra::Application helpers EasyBreadcrumbs end
e32919d6c53a5ed59f354b80e6e4d8528a2fa040
test/test_parser.rb
test/test_parser.rb
require 'rubygems' require 'bundler/setup' require 'toml' require 'minitest/autorun' class TestParser < MiniTest::Unit::TestCase def setup filepath = File.join(File.dirname(__FILE__), 'spec.toml') @doc = TOML::Parser.new(File.read(filepath)).parsed end def test_string assert_equal @doc["string"], "string\n\t\"string" end def test_integer assert_equal @doc["integer"], 42 end def test_float assert_equal @doc["pi"], 3.14159 end def test_datetime assert_equal @doc["datetime"], DateTime.iso8601("1979-05-27T07:32:00Z") end def test_booleans assert_equal @doc["true"], true assert_equal @doc["false"], false end def test_simple_array assert_equal @doc["arrays"]["simple"], [1, 2, 3] end def test_nested_array assert_equal @doc["arrays"]["nested"], [[[1], 2], 3] end def test_simple_keygroup assert_equal @doc["e"]["f"], "test" end def test_nested_keygroup assert_equal @doc["a"]["b"]["c"]["d"], "test" end def test_multiline_arrays assert_equal ["lines", "are", "super", "cool", "lol", "amirite"], @doc["arrays"]["multi"] end end
require 'rubygems' require 'bundler/setup' require 'toml' require 'minitest/autorun' class TestParser < MiniTest::Unit::TestCase def setup filepath = File.join(File.dirname(__FILE__), 'spec.toml') @doc = TOML::Parser.new(File.read(filepath)).parsed end def test_string assert_equal "string\n\t\"string", @doc["string"] end def test_integer assert_equal 42, @doc["integer"] end def test_float assert_equal 3.14159, @doc["pi"] end def test_datetime assert_equal DateTime.iso8601("1979-05-27T07:32:00Z"), @doc["datetime"] end def test_booleans assert_equal true, @doc["true"] assert_equal false, @doc["false"] end def test_simple_array assert_equal [1, 2, 3], @doc["arrays"]["simple"] end def test_nested_array assert_equal [[[1], 2], 3], @doc["arrays"]["nested"] end def test_simple_keygroup assert_equal "test", @doc["e"]["f"] end def test_nested_keygroup assert_equal "test", @doc["a"]["b"]["c"]["d"] end def test_multiline_arrays assert_equal ["lines", "are", "super", "cool", "lol", "amirite"], @doc["arrays"]["multi"] end end
Fix testing syntax (expected, actual rather than the reverse)
Fix testing syntax (expected, actual rather than the reverse)
Ruby
mit
jm/toml,jm/toml
ruby
## Code Before: require 'rubygems' require 'bundler/setup' require 'toml' require 'minitest/autorun' class TestParser < MiniTest::Unit::TestCase def setup filepath = File.join(File.dirname(__FILE__), 'spec.toml') @doc = TOML::Parser.new(File.read(filepath)).parsed end def test_string assert_equal @doc["string"], "string\n\t\"string" end def test_integer assert_equal @doc["integer"], 42 end def test_float assert_equal @doc["pi"], 3.14159 end def test_datetime assert_equal @doc["datetime"], DateTime.iso8601("1979-05-27T07:32:00Z") end def test_booleans assert_equal @doc["true"], true assert_equal @doc["false"], false end def test_simple_array assert_equal @doc["arrays"]["simple"], [1, 2, 3] end def test_nested_array assert_equal @doc["arrays"]["nested"], [[[1], 2], 3] end def test_simple_keygroup assert_equal @doc["e"]["f"], "test" end def test_nested_keygroup assert_equal @doc["a"]["b"]["c"]["d"], "test" end def test_multiline_arrays assert_equal ["lines", "are", "super", "cool", "lol", "amirite"], @doc["arrays"]["multi"] end end ## Instruction: Fix testing syntax (expected, actual rather than the reverse) ## Code After: require 'rubygems' require 'bundler/setup' require 'toml' require 'minitest/autorun' class TestParser < MiniTest::Unit::TestCase def setup filepath = File.join(File.dirname(__FILE__), 'spec.toml') @doc = TOML::Parser.new(File.read(filepath)).parsed end def test_string assert_equal "string\n\t\"string", @doc["string"] end def test_integer assert_equal 42, @doc["integer"] end def test_float assert_equal 3.14159, @doc["pi"] end def test_datetime assert_equal DateTime.iso8601("1979-05-27T07:32:00Z"), @doc["datetime"] end def test_booleans assert_equal true, @doc["true"] assert_equal false, @doc["false"] end def test_simple_array assert_equal [1, 2, 3], @doc["arrays"]["simple"] end def test_nested_array assert_equal [[[1], 2], 3], @doc["arrays"]["nested"] end def test_simple_keygroup assert_equal "test", @doc["e"]["f"] end def test_nested_keygroup assert_equal "test", @doc["a"]["b"]["c"]["d"] end def test_multiline_arrays assert_equal ["lines", "are", "super", "cool", "lol", "amirite"], @doc["arrays"]["multi"] end end
d7b51d8a67d5e3fec5430ff05b1c9b09d8e367d1
doc/README.md
doc/README.md
- Typescript - Angular2 ### Backend - Java - Spring boot (use as rest server only) - H2 (may use pg for production) - Elasticsearch (for search) - Mongodb or redis (for NoSQL or cache)
- Typescript - Angular2 ### Backend - Nginx (Openresty) - Java - Spring boot (use as rest server only) - H2 (may use pg for production) - Elasticsearch (for search) - Mongodb or redis (for NoSQL or cache) ## Setup on Windows - [Install Nginx](https://moonbingbing.gitbooks.io/openresty-best-practices/content/openresty/install_on_windows.html) - Install Java - Install Maven - Install Node - Install PostgreSQL e.... so many to install, I think I need to use linux now....
Add doc for setup on windows
Add doc for setup on windows
Markdown
apache-2.0
at15/bform,at15/bform
markdown
## Code Before: - Typescript - Angular2 ### Backend - Java - Spring boot (use as rest server only) - H2 (may use pg for production) - Elasticsearch (for search) - Mongodb or redis (for NoSQL or cache) ## Instruction: Add doc for setup on windows ## Code After: - Typescript - Angular2 ### Backend - Nginx (Openresty) - Java - Spring boot (use as rest server only) - H2 (may use pg for production) - Elasticsearch (for search) - Mongodb or redis (for NoSQL or cache) ## Setup on Windows - [Install Nginx](https://moonbingbing.gitbooks.io/openresty-best-practices/content/openresty/install_on_windows.html) - Install Java - Install Maven - Install Node - Install PostgreSQL e.... so many to install, I think I need to use linux now....
466f8afb30a85c84a90464b9bae2ed372091a14d
src/main/java/com/github/solairerove/woodstock/repository/GenericRepository.java
src/main/java/com/github/solairerove/woodstock/repository/GenericRepository.java
package com.github.solairerove.woodstock.repository; import com.github.solairerove.woodstock.domain.base.BaseEntity; import org.springframework.data.neo4j.repository.GraphRepository; public interface GenericRepository<T extends BaseEntity> extends GraphRepository<T> { }
package com.github.solairerove.woodstock.repository; import com.github.solairerove.woodstock.domain.base.BaseEntity; import org.springframework.data.neo4j.annotation.Query; import org.springframework.data.neo4j.repository.GraphRepository; import org.springframework.data.repository.query.Param; public interface GenericRepository<T extends BaseEntity> extends GraphRepository<T> { @Query("MATCH (task:Task)<-[:HAS_IN]-(tickets) WHERE id(task)={id1} RETURN tickets") Iterable<T> getTicketsThatHasInTaskFromId(@Param("id") Long id1); @Query("MATCH (task:Task)<-[:HAS_IN]-(ticket) WHERE id(task)={id1} AND id(ticket)={id2} RETURN ticket") T getTicketThatHasInTaskFromId(@Param("id1") Long id1, @Param("id2") Long id2); }
Create generic repository stub: - how solve problem with entity
Create generic repository stub: - how solve problem with entity
Java
apache-2.0
solairerove/woodstock,solairerove/woodstock,solairerove/woodstock
java
## Code Before: package com.github.solairerove.woodstock.repository; import com.github.solairerove.woodstock.domain.base.BaseEntity; import org.springframework.data.neo4j.repository.GraphRepository; public interface GenericRepository<T extends BaseEntity> extends GraphRepository<T> { } ## Instruction: Create generic repository stub: - how solve problem with entity ## Code After: package com.github.solairerove.woodstock.repository; import com.github.solairerove.woodstock.domain.base.BaseEntity; import org.springframework.data.neo4j.annotation.Query; import org.springframework.data.neo4j.repository.GraphRepository; import org.springframework.data.repository.query.Param; public interface GenericRepository<T extends BaseEntity> extends GraphRepository<T> { @Query("MATCH (task:Task)<-[:HAS_IN]-(tickets) WHERE id(task)={id1} RETURN tickets") Iterable<T> getTicketsThatHasInTaskFromId(@Param("id") Long id1); @Query("MATCH (task:Task)<-[:HAS_IN]-(ticket) WHERE id(task)={id1} AND id(ticket)={id2} RETURN ticket") T getTicketThatHasInTaskFromId(@Param("id1") Long id1, @Param("id2") Long id2); }
0a3eb4b966dff69cbe582c60bf4444facb4b683d
tcconfig/_tc_command_helper.py
tcconfig/_tc_command_helper.py
from __future__ import absolute_import, unicode_literals import subprocrunner as spr from ._common import find_bin_path from ._const import TcSubCommand from ._error import NetworkInterfaceNotFoundError def get_tc_base_command(tc_subcommand): if tc_subcommand not in TcSubCommand: raise ValueError("the argument must be a TcSubCommand value") return "{:s} {:s}".format(find_bin_path("tc"), tc_subcommand.value) def run_tc_show(subcommand, device, tc_command_output): from ._network import verify_network_interface verify_network_interface(device, tc_command_output) runner = spr.SubprocessRunner( "{:s} show dev {:s}".format(get_tc_base_command(subcommand), device) ) if runner.run() != 0 and runner.stderr.find("Cannot find device") != -1: # reach here if the device does not exist at the system and netiface # not installed. raise NetworkInterfaceNotFoundError(target=device) return runner.stdout
from __future__ import absolute_import, unicode_literals import subprocrunner as spr from ._common import find_bin_path from ._const import TcSubCommand from ._error import NetworkInterfaceNotFoundError def get_tc_base_command(tc_subcommand): if not isinstance(tc_subcommand, TcSubCommand): raise ValueError("the argument must be a TcSubCommand value") return "{:s} {:s}".format(find_bin_path("tc"), tc_subcommand.value) def run_tc_show(subcommand, device, tc_command_output): from ._network import verify_network_interface verify_network_interface(device, tc_command_output) runner = spr.SubprocessRunner( "{:s} show dev {:s}".format(get_tc_base_command(subcommand), device) ) if runner.run() != 0 and runner.stderr.find("Cannot find device") != -1: # reach here if the device does not exist at the system and netiface # not installed. raise NetworkInterfaceNotFoundError(target=device) return runner.stdout
Change to avoid a DeprecationWarning
Change to avoid a DeprecationWarning
Python
mit
thombashi/tcconfig,thombashi/tcconfig
python
## Code Before: from __future__ import absolute_import, unicode_literals import subprocrunner as spr from ._common import find_bin_path from ._const import TcSubCommand from ._error import NetworkInterfaceNotFoundError def get_tc_base_command(tc_subcommand): if tc_subcommand not in TcSubCommand: raise ValueError("the argument must be a TcSubCommand value") return "{:s} {:s}".format(find_bin_path("tc"), tc_subcommand.value) def run_tc_show(subcommand, device, tc_command_output): from ._network import verify_network_interface verify_network_interface(device, tc_command_output) runner = spr.SubprocessRunner( "{:s} show dev {:s}".format(get_tc_base_command(subcommand), device) ) if runner.run() != 0 and runner.stderr.find("Cannot find device") != -1: # reach here if the device does not exist at the system and netiface # not installed. raise NetworkInterfaceNotFoundError(target=device) return runner.stdout ## Instruction: Change to avoid a DeprecationWarning ## Code After: from __future__ import absolute_import, unicode_literals import subprocrunner as spr from ._common import find_bin_path from ._const import TcSubCommand from ._error import NetworkInterfaceNotFoundError def get_tc_base_command(tc_subcommand): if not isinstance(tc_subcommand, TcSubCommand): raise ValueError("the argument must be a TcSubCommand value") return "{:s} {:s}".format(find_bin_path("tc"), tc_subcommand.value) def run_tc_show(subcommand, device, tc_command_output): from ._network import verify_network_interface verify_network_interface(device, tc_command_output) runner = spr.SubprocessRunner( "{:s} show dev {:s}".format(get_tc_base_command(subcommand), device) ) if runner.run() != 0 and runner.stderr.find("Cannot find device") != -1: # reach here if the device does not exist at the system and netiface # not installed. raise NetworkInterfaceNotFoundError(target=device) return runner.stdout
b79c30ea93bca3111cba435aa380c11200946a8b
.travis.yml
.travis.yml
language: rust rust: - stable - beta - nightly matrix: allow_failures: - rust: nightly before_install: - sudo apt-get update -qq - sudo apt-get install -y libx11-xcb-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-keysyms1-dev
dist: trusty sudo: required language: rust rust: - stable - beta - nightly matrix: allow_failures: - rust: nightly before_install: - sudo apt-get update -qq - sudo apt-get install -y libx11-xcb-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-keysyms1-dev
Use Ubuntu Trusty (for XCB packages).
Travis: Use Ubuntu Trusty (for XCB packages).
YAML
mit
mjkillough/lanta
yaml
## Code Before: language: rust rust: - stable - beta - nightly matrix: allow_failures: - rust: nightly before_install: - sudo apt-get update -qq - sudo apt-get install -y libx11-xcb-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-keysyms1-dev ## Instruction: Travis: Use Ubuntu Trusty (for XCB packages). ## Code After: dist: trusty sudo: required language: rust rust: - stable - beta - nightly matrix: allow_failures: - rust: nightly before_install: - sudo apt-get update -qq - sudo apt-get install -y libx11-xcb-dev libxcb-ewmh-dev libxcb-icccm4-dev libxcb-keysyms1-dev
308ee10ee4d516fd4542e750e788b6fdc2f0cd2b
app/models/item.rb
app/models/item.rb
class Item < ActiveRecord::Base serialize :sections, Hash belongs_to :item_type belongs_to :origin, polymorphic: true has_many :user_votes, dependent: :destroy has_many :motion, dependent: :destroy has_and_belongs_to_many :wards accepts_nested_attributes_for :user_votes def next Item.where("id > ?", id).first end def count_votes(vote) user_votes.where(vote: vote).count end def count_yes count_votes "Yes" end def count_no count_votes "No" end def count_skip count_votes "Skip" end def result if count_yes > count_no && count_yes > count_skip :carried elsif count_no > count_yes && count_no > count_skip :lost else :pending end end end
class Item < ActiveRecord::Base serialize :sections, Hash belongs_to :item_type belongs_to :origin, polymorphic: true has_many :user_votes, dependent: :destroy has_many :motion, dependent: :destroy has_and_belongs_to_many :wards accepts_nested_attributes_for :user_votes def next Item.where("id > ?", id).first end def get_user_votes_for(vote_type) votes = Array.new(0) user_votes.each { |user_vote| votes << user_vote if user_vote.vote == vote_type } votes end def count_yes get_user_votes_for("Yes").count end def count_no get_user_votes_for("No").count end def count_skip get_user_votes_for("Skip").count end def result if count_yes > count_no && count_yes > count_skip :carried elsif count_no > count_yes && count_no > count_skip :lost else :pending end end end
Change Method Name, Count Votes To Get User Votes
Change Method Name, Count Votes To Get User Votes Change the name and function of Count Votes from to Get User Votes because the count votes is doing too many select statements to the database. Get User Votes will find a participially vote type and return an array of objects for the vote.
Ruby
mit
CivicHaxx/ok_councillr,CivicHaxx/ok_councillr,CivicHaxx/ok_councillr
ruby
## Code Before: class Item < ActiveRecord::Base serialize :sections, Hash belongs_to :item_type belongs_to :origin, polymorphic: true has_many :user_votes, dependent: :destroy has_many :motion, dependent: :destroy has_and_belongs_to_many :wards accepts_nested_attributes_for :user_votes def next Item.where("id > ?", id).first end def count_votes(vote) user_votes.where(vote: vote).count end def count_yes count_votes "Yes" end def count_no count_votes "No" end def count_skip count_votes "Skip" end def result if count_yes > count_no && count_yes > count_skip :carried elsif count_no > count_yes && count_no > count_skip :lost else :pending end end end ## Instruction: Change Method Name, Count Votes To Get User Votes Change the name and function of Count Votes from to Get User Votes because the count votes is doing too many select statements to the database. Get User Votes will find a participially vote type and return an array of objects for the vote. ## Code After: class Item < ActiveRecord::Base serialize :sections, Hash belongs_to :item_type belongs_to :origin, polymorphic: true has_many :user_votes, dependent: :destroy has_many :motion, dependent: :destroy has_and_belongs_to_many :wards accepts_nested_attributes_for :user_votes def next Item.where("id > ?", id).first end def get_user_votes_for(vote_type) votes = Array.new(0) user_votes.each { |user_vote| votes << user_vote if user_vote.vote == vote_type } votes end def count_yes get_user_votes_for("Yes").count end def count_no get_user_votes_for("No").count end def count_skip get_user_votes_for("Skip").count end def result if count_yes > count_no && count_yes > count_skip :carried elsif count_no > count_yes && count_no > count_skip :lost else :pending end end end
bdcf90a0fdf782b1c6cfd261e0dbb208e013eb1b
python/day12.py
python/day12.py
import json import pathlib input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt') def sum_data(d): total = 0 if isinstance(d, dict): d = d.values() for item in d: if isinstance(item, int): total += item elif isinstance(item, (list, dict)): total += sum_data(item) else: continue # Some other type we’re not interested in return total def sum_json(raw_json): parsed = json.loads(raw_json) return sum_data(parsed) def test_simple(): assert sum_json('[1,2,3]') == 6 assert sum_json('{"a":2,"b":4}') == 6 def test_nested(): assert sum_json('[[[3]]]') == 3 assert sum_json('{"a":{"b":4},"c":-1}') == 3 def test_mixed(): assert sum_json('{"a":[-1,1]}') == 0 assert sum_json('[-1,{"a":1}]') == 0 def test_empty(): assert sum_json('[]') == 0 assert sum_json('{}') == 0 if __name__ == '__main__': with open(input_file) as json_file: json_data = json_file.read() print(sum_json(json_data))
import json import pathlib input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt') def sum_data(d): total = 0 if isinstance(d, dict): d = d.values() if 'red' in d: return 0 for item in d: if isinstance(item, int): total += item elif isinstance(item, (list, dict)): total += sum_data(item) else: continue # Some other type we’re not interested in return total def sum_json(raw_json): parsed = json.loads(raw_json) return sum_data(parsed) def test_simple(): assert sum_json('[1,2,3]') == 6 assert sum_json('{"a":2,"b":4}') == 6 def test_nested(): assert sum_json('[[[3]]]') == 3 assert sum_json('{"a":{"b":4},"c":-1}') == 3 def test_mixed(): assert sum_json('{"a":[-1,1]}') == 0 assert sum_json('[-1,{"a":1}]') == 0 def test_empty(): assert sum_json('[]') == 0 assert sum_json('{}') == 0 if __name__ == '__main__': with open(input_file) as json_file: json_data = json_file.read() print(sum_json(json_data))
Add day 12 part two solution in python
Add day 12 part two solution in python
Python
mit
robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions,robjwells/adventofcode-solutions
python
## Code Before: import json import pathlib input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt') def sum_data(d): total = 0 if isinstance(d, dict): d = d.values() for item in d: if isinstance(item, int): total += item elif isinstance(item, (list, dict)): total += sum_data(item) else: continue # Some other type we’re not interested in return total def sum_json(raw_json): parsed = json.loads(raw_json) return sum_data(parsed) def test_simple(): assert sum_json('[1,2,3]') == 6 assert sum_json('{"a":2,"b":4}') == 6 def test_nested(): assert sum_json('[[[3]]]') == 3 assert sum_json('{"a":{"b":4},"c":-1}') == 3 def test_mixed(): assert sum_json('{"a":[-1,1]}') == 0 assert sum_json('[-1,{"a":1}]') == 0 def test_empty(): assert sum_json('[]') == 0 assert sum_json('{}') == 0 if __name__ == '__main__': with open(input_file) as json_file: json_data = json_file.read() print(sum_json(json_data)) ## Instruction: Add day 12 part two solution in python ## Code After: import json import pathlib input_file = pathlib.Path(__file__).parent.parent.joinpath('day12_input.txt') def sum_data(d): total = 0 if isinstance(d, dict): d = d.values() if 'red' in d: return 0 for item in d: if isinstance(item, int): total += item elif isinstance(item, (list, dict)): total += sum_data(item) else: continue # Some other type we’re not interested in return total def sum_json(raw_json): parsed = json.loads(raw_json) return sum_data(parsed) def test_simple(): assert sum_json('[1,2,3]') == 6 assert sum_json('{"a":2,"b":4}') == 6 def test_nested(): assert sum_json('[[[3]]]') == 3 assert sum_json('{"a":{"b":4},"c":-1}') == 3 def test_mixed(): assert sum_json('{"a":[-1,1]}') == 0 assert sum_json('[-1,{"a":1}]') == 0 def test_empty(): assert sum_json('[]') == 0 assert sum_json('{}') == 0 if __name__ == '__main__': with open(input_file) as json_file: json_data = json_file.read() print(sum_json(json_data))
e43c1335bb48e8ba3321ddd9471ac04fd75a4250
broker/ivorn_db.py
broker/ivorn_db.py
import os import anydbm import datetime from contextlib import closing from threading import Lock class IVORN_DB(object): # Using one big lock for all the databases is a little clunky. def __init__(self, root): self.root = root self.lock = Lock() def check_ivorn(self, ivorn): db_path, key = ivorn.split('//')[1].split('#') db_path = db_path.replace(os.path.sep, "_") try: self.lock.acquire() db = anydbm.open(os.path.join(self.root, db_path), 'c') if db.has_key(key): return False # Should not forward else: db[key] = str(datetime.datetime.utcnow()) return True # Ok to forward finally: self.lock.release()
import os import anydbm import datetime from threading import Lock from collections import defaultdict class IVORN_DB(object): def __init__(self, root): self.root = root self.locks = defaultdict(Lock) def check_ivorn(self, ivorn): db_path, key = ivorn.split('//')[1].split('#') db_path = db_path.replace(os.path.sep, "_") try: self.locks[db_path].acquire() db = anydbm.open(os.path.join(self.root, db_path), 'c') if db.has_key(key): return False # Should not forward else: db[key] = str(datetime.datetime.utcnow()) return True # Ok to forward finally: self.locks[db_path].release()
Use a separate lock per ivorn database
Use a separate lock per ivorn database
Python
bsd-2-clause
jdswinbank/Comet,jdswinbank/Comet
python
## Code Before: import os import anydbm import datetime from contextlib import closing from threading import Lock class IVORN_DB(object): # Using one big lock for all the databases is a little clunky. def __init__(self, root): self.root = root self.lock = Lock() def check_ivorn(self, ivorn): db_path, key = ivorn.split('//')[1].split('#') db_path = db_path.replace(os.path.sep, "_") try: self.lock.acquire() db = anydbm.open(os.path.join(self.root, db_path), 'c') if db.has_key(key): return False # Should not forward else: db[key] = str(datetime.datetime.utcnow()) return True # Ok to forward finally: self.lock.release() ## Instruction: Use a separate lock per ivorn database ## Code After: import os import anydbm import datetime from threading import Lock from collections import defaultdict class IVORN_DB(object): def __init__(self, root): self.root = root self.locks = defaultdict(Lock) def check_ivorn(self, ivorn): db_path, key = ivorn.split('//')[1].split('#') db_path = db_path.replace(os.path.sep, "_") try: self.locks[db_path].acquire() db = anydbm.open(os.path.join(self.root, db_path), 'c') if db.has_key(key): return False # Should not forward else: db[key] = str(datetime.datetime.utcnow()) return True # Ok to forward finally: self.locks[db_path].release()
bc50d364149115cf5ab898cdf409bac274aea319
lib/pipenv.js
lib/pipenv.js
const fse = require('fs-extra'); const path = require('path'); const { spawnSync } = require('child_process'); /** * pipenv install */ function pipfileToRequirements() { if ( !this.options.usePipenv || !fse.existsSync(path.join(this.servicePath, 'Pipfile')) ) { return; } this.serverless.cli.log('Generating requirements.txt from Pipfile...'); const res = spawnSync( 'pipenv', ['lock', '--requirements', '--keep-outdated'], { cwd: this.servicePath } ); if (res.error) { if (res.error.code === 'ENOENT') { throw new Error( `pipenv not found! Install it with 'pip install pipenv'.` ); } throw new Error(res.error); } if (res.status !== 0) { throw new Error(res.stderr); } fse.ensureDirSync(path.join(this.servicePath, '.serverless')); fse.writeFileSync( path.join(this.servicePath, '.serverless/requirements.txt'), res.stdout ); } module.exports = { pipfileToRequirements };
const fse = require('fs-extra'); const path = require('path'); const { spawnSync } = require('child_process'); const { EOL } = require('os'); /** * pipenv install */ function pipfileToRequirements() { if ( !this.options.usePipenv || !fse.existsSync(path.join(this.servicePath, 'Pipfile')) ) { return; } this.serverless.cli.log('Generating requirements.txt from Pipfile...'); const res = spawnSync( 'pipenv', ['lock', '--requirements', '--keep-outdated'], { cwd: this.servicePath } ); if (res.error) { if (res.error.code === 'ENOENT') { throw new Error( `pipenv not found! Install it with 'pip install pipenv'.` ); } throw new Error(res.error); } if (res.status !== 0) { throw new Error(res.stderr); } fse.ensureDirSync(path.join(this.servicePath, '.serverless')); fse.writeFileSync( path.join(this.servicePath, '.serverless/requirements.txt'), removeEditableFlagFromRequirementsString(res.stdout) ); } /** * * @param requirementBuffer * @returns Buffer with editable flags remove */ function removeEditableFlagFromRequirementsString(requirementBuffer) { const flagStr = '-e '; const lines = requirementBuffer.toString('utf8').split(EOL); for (let i = 0; i < lines.length; i++) { if (lines[i].startsWith(flagStr)) { lines[i] = lines[i].substring(flagStr.length); } } return Buffer.from(lines.join(EOL)); } module.exports = { pipfileToRequirements };
Support editable packages with Pipfile. Remove editableFlag from .serverless/requirements.txt when using Pipfile.
Support editable packages with Pipfile. Remove editableFlag from .serverless/requirements.txt when using Pipfile.
JavaScript
mit
UnitedIncome/serverless-python-requirements,UnitedIncome/serverless-python-requirements
javascript
## Code Before: const fse = require('fs-extra'); const path = require('path'); const { spawnSync } = require('child_process'); /** * pipenv install */ function pipfileToRequirements() { if ( !this.options.usePipenv || !fse.existsSync(path.join(this.servicePath, 'Pipfile')) ) { return; } this.serverless.cli.log('Generating requirements.txt from Pipfile...'); const res = spawnSync( 'pipenv', ['lock', '--requirements', '--keep-outdated'], { cwd: this.servicePath } ); if (res.error) { if (res.error.code === 'ENOENT') { throw new Error( `pipenv not found! Install it with 'pip install pipenv'.` ); } throw new Error(res.error); } if (res.status !== 0) { throw new Error(res.stderr); } fse.ensureDirSync(path.join(this.servicePath, '.serverless')); fse.writeFileSync( path.join(this.servicePath, '.serverless/requirements.txt'), res.stdout ); } module.exports = { pipfileToRequirements }; ## Instruction: Support editable packages with Pipfile. Remove editableFlag from .serverless/requirements.txt when using Pipfile. ## Code After: const fse = require('fs-extra'); const path = require('path'); const { spawnSync } = require('child_process'); const { EOL } = require('os'); /** * pipenv install */ function pipfileToRequirements() { if ( !this.options.usePipenv || !fse.existsSync(path.join(this.servicePath, 'Pipfile')) ) { return; } this.serverless.cli.log('Generating requirements.txt from Pipfile...'); const res = spawnSync( 'pipenv', ['lock', '--requirements', '--keep-outdated'], { cwd: this.servicePath } ); if (res.error) { if (res.error.code === 'ENOENT') { throw new Error( `pipenv not found! Install it with 'pip install pipenv'.` ); } throw new Error(res.error); } if (res.status !== 0) { throw new Error(res.stderr); } fse.ensureDirSync(path.join(this.servicePath, '.serverless')); fse.writeFileSync( path.join(this.servicePath, '.serverless/requirements.txt'), removeEditableFlagFromRequirementsString(res.stdout) ); } /** * * @param requirementBuffer * @returns Buffer with editable flags remove */ function removeEditableFlagFromRequirementsString(requirementBuffer) { const flagStr = '-e '; const lines = requirementBuffer.toString('utf8').split(EOL); for (let i = 0; i < lines.length; i++) { if (lines[i].startsWith(flagStr)) { lines[i] = lines[i].substring(flagStr.length); } } return Buffer.from(lines.join(EOL)); } module.exports = { pipfileToRequirements };
e29ee7860946a2f3c8b8fc4c1bd38dea2c006550
.travis.yml
.travis.yml
language: node_js node_js: - "node" before_install: - npm -g install node-gyp node-pre-gyp before_deploy: - npm run-script predeploy - LAST_COMMIT=$(git log -1 --pretty=format:'%h <%an> - %s') - echo "Deploying changes from $LAST_COMMIT" - node_modules/gh-pages/bin/gh-pages -d dist/ -m "Updates from $LAST_COMMIT" deploy: provider: pages github_token: $GITHUB_TOKEN skip_cleanup: true local_dir: dist on: branch: master
language: node_js node_js: - "node" before_install: - npm -g install [email protected] [email protected] before_deploy: - npm run-script predeploy - LAST_COMMIT=$(git log -1 --pretty=format:'%h <%an> - %s') - echo "Deploying changes from $LAST_COMMIT" - node_modules/gh-pages/bin/gh-pages -d dist/ -m "Updates from $LAST_COMMIT" deploy: provider: pages github_token: $GITHUB_TOKEN skip_cleanup: true local_dir: dist on: branch: master
Use node-gyp and node-pre-gyp versions that phantom wants
Use node-gyp and node-pre-gyp versions that phantom wants
YAML
unlicense
mauriciovieira/mauriciovieira.net,mauriciovieira/mauriciovieira.net
yaml
## Code Before: language: node_js node_js: - "node" before_install: - npm -g install node-gyp node-pre-gyp before_deploy: - npm run-script predeploy - LAST_COMMIT=$(git log -1 --pretty=format:'%h <%an> - %s') - echo "Deploying changes from $LAST_COMMIT" - node_modules/gh-pages/bin/gh-pages -d dist/ -m "Updates from $LAST_COMMIT" deploy: provider: pages github_token: $GITHUB_TOKEN skip_cleanup: true local_dir: dist on: branch: master ## Instruction: Use node-gyp and node-pre-gyp versions that phantom wants ## Code After: language: node_js node_js: - "node" before_install: - npm -g install [email protected] [email protected] before_deploy: - npm run-script predeploy - LAST_COMMIT=$(git log -1 --pretty=format:'%h <%an> - %s') - echo "Deploying changes from $LAST_COMMIT" - node_modules/gh-pages/bin/gh-pages -d dist/ -m "Updates from $LAST_COMMIT" deploy: provider: pages github_token: $GITHUB_TOKEN skip_cleanup: true local_dir: dist on: branch: master
77bfe540a86e1ca09b340726c809f569b641f07d
README.md
README.md
A tiny generic colorscript strongly inspired by @roberoonska's dotfiles ## How to use it Get repository: git clone https://github.com/aloisdg/Ascolorii.git Run the script with a path to a 11x6 ascii art file: ./ascolorii ascii/hello.txt Enjoy ! ## Create Ascii Art I draw hello.txt by hand. I used [Block Elements](https://en.wikipedia.org/wiki/Block_Elements) for a better result. later, I will look to use a [generator](http://www.richard-h-clark.com/projects/block-art.html) made by @richard-clark. If you made or found a good one I would love to add it to the repository. Feel free to open a Pull request for it! ## Caveas I made this for fun after seeing this @roberoonska's [post](https://redd.it/42pgv7) on [/r/unixporn](https://www.reddit.com/r/unixporn/). I am an early bash user. This script mays contain a lot of mistake/error/whatever. If you find one, you can open an issue.
A tiny generic colorscript strongly inspired by @roberoonska's [dotfiles](https://github.com/roberoonska/dotfiles). ## How to use it Get repository: git clone https://github.com/aloisdg/Ascolorii.git Run the script with a path to a 11x6 ascii art file: ./ascolorii ascii/hello.txt Enjoy ! ## Create Ascii Art I draw hello.txt by hand. I used [Block Elements](https://en.wikipedia.org/wiki/Block_Elements) for a better result. later, I will look to use a [generator](http://www.richard-h-clark.com/projects/block-art.html) made by @richard-clark. If you made or found a good one I would love to add it to the repository. Feel free to open a Pull request for it! ## Caveas I made this for fun after seeing this @roberoonska's [post](https://redd.it/42pgv7) on [/r/unixporn](https://www.reddit.com/r/unixporn/). I am an early bash user. This script mays contain a lot of mistake/error/whatever. If you find one, you can open an issue.
Add missing links to Summary
Add missing links to Summary
Markdown
mpl-2.0
aloisdg/ascolorii
markdown
## Code Before: A tiny generic colorscript strongly inspired by @roberoonska's dotfiles ## How to use it Get repository: git clone https://github.com/aloisdg/Ascolorii.git Run the script with a path to a 11x6 ascii art file: ./ascolorii ascii/hello.txt Enjoy ! ## Create Ascii Art I draw hello.txt by hand. I used [Block Elements](https://en.wikipedia.org/wiki/Block_Elements) for a better result. later, I will look to use a [generator](http://www.richard-h-clark.com/projects/block-art.html) made by @richard-clark. If you made or found a good one I would love to add it to the repository. Feel free to open a Pull request for it! ## Caveas I made this for fun after seeing this @roberoonska's [post](https://redd.it/42pgv7) on [/r/unixporn](https://www.reddit.com/r/unixporn/). I am an early bash user. This script mays contain a lot of mistake/error/whatever. If you find one, you can open an issue. ## Instruction: Add missing links to Summary ## Code After: A tiny generic colorscript strongly inspired by @roberoonska's [dotfiles](https://github.com/roberoonska/dotfiles). ## How to use it Get repository: git clone https://github.com/aloisdg/Ascolorii.git Run the script with a path to a 11x6 ascii art file: ./ascolorii ascii/hello.txt Enjoy ! ## Create Ascii Art I draw hello.txt by hand. I used [Block Elements](https://en.wikipedia.org/wiki/Block_Elements) for a better result. later, I will look to use a [generator](http://www.richard-h-clark.com/projects/block-art.html) made by @richard-clark. If you made or found a good one I would love to add it to the repository. Feel free to open a Pull request for it! ## Caveas I made this for fun after seeing this @roberoonska's [post](https://redd.it/42pgv7) on [/r/unixporn](https://www.reddit.com/r/unixporn/). I am an early bash user. This script mays contain a lot of mistake/error/whatever. If you find one, you can open an issue.
0c67cff030592cd44023444a5f10eef6570bfdf0
odinweb/testing.py
odinweb/testing.py
from odin.codecs import json_codec from odinweb.constants import Method class MockRequest(object): """ Mocked Request object """ def __init__(self, query=None, post=None, headers=None, method=Method.GET, body='', host='127.0.0.1', request_codec=None, response_codec=None): self.GET = query or {} self.POST = post or {} self.headers = headers or {} self.method = method self.body = body self.host = host self.request_codec = request_codec or json_codec self.response_codec = response_codec or json_codec
from typing import Dict, Any from odin.codecs import json_codec try: from urllib.parse import urlparse, parse_qs except ImportError: from urlparse import urlparse, parse_qs from odinweb.constants import Method class MockRequest(object): """ Mocked Request object. This can be treated as a template of a request """ @classmethod def from_uri(cls, uri, post=None, headers=None, method=Method.GET, body='', request_codec=None, response_codec=None): # type: (str, Dict[str, str], Dict[str, str], Method, str, Any, Any) -> MockRequest scheme, netloc, path, params, query, fragment = urlparse(uri) return cls(scheme, netloc, path, parse_qs(query), post, headers, method, body, request_codec, response_codec) def __init__(self, scheme='http', host='127.0.0.1', path=None, query=None, headers=None, method=Method.GET, post=None, body='', request_codec=None, response_codec=None): # type: (str, str, str, Dict[str, str], Dict[str, str], Dict[str, str], Method, str, Any, Any) -> MockRequest self.scheme = scheme self.host = host self.path = path self.GET = query or {} self.headers = headers or {} self.method = method self.POST = post or {} self.body = body self.request_codec = request_codec or json_codec self.response_codec = response_codec or json_codec
Expand Mock Request to include path and built in URL parsing.
Expand Mock Request to include path and built in URL parsing.
Python
bsd-3-clause
python-odin/odinweb,python-odin/odinweb
python
## Code Before: from odin.codecs import json_codec from odinweb.constants import Method class MockRequest(object): """ Mocked Request object """ def __init__(self, query=None, post=None, headers=None, method=Method.GET, body='', host='127.0.0.1', request_codec=None, response_codec=None): self.GET = query or {} self.POST = post or {} self.headers = headers or {} self.method = method self.body = body self.host = host self.request_codec = request_codec or json_codec self.response_codec = response_codec or json_codec ## Instruction: Expand Mock Request to include path and built in URL parsing. ## Code After: from typing import Dict, Any from odin.codecs import json_codec try: from urllib.parse import urlparse, parse_qs except ImportError: from urlparse import urlparse, parse_qs from odinweb.constants import Method class MockRequest(object): """ Mocked Request object. This can be treated as a template of a request """ @classmethod def from_uri(cls, uri, post=None, headers=None, method=Method.GET, body='', request_codec=None, response_codec=None): # type: (str, Dict[str, str], Dict[str, str], Method, str, Any, Any) -> MockRequest scheme, netloc, path, params, query, fragment = urlparse(uri) return cls(scheme, netloc, path, parse_qs(query), post, headers, method, body, request_codec, response_codec) def __init__(self, scheme='http', host='127.0.0.1', path=None, query=None, headers=None, method=Method.GET, post=None, body='', request_codec=None, response_codec=None): # type: (str, str, str, Dict[str, str], Dict[str, str], Dict[str, str], Method, str, Any, Any) -> MockRequest self.scheme = scheme self.host = host self.path = path self.GET = query or {} self.headers = headers or {} self.method = method self.POST = post or {} self.body = body self.request_codec = request_codec or json_codec self.response_codec = response_codec or json_codec
3c5bf7e5ddb3b197e1fa55c168a162ea23bf94a0
plugins/tripleo-overcloud/tasks/upgrade/undercloud_validation.yml
plugins/tripleo-overcloud/tasks/upgrade/undercloud_validation.yml
--- - fail: msg: "Upgrade is supported only for versions 7, 8, 9 and 10" when: - undercloud_version|openstack_release not in [8, 9, 10, 11] - name: Checking overcloud_deploy_file stat: path: "~/overcloud_deploy.sh" register: overcloud_deploy_file - fail: msg: "Overcloud deployment script not found. Expected path: ~/overcloud_deploy.sh " when: overcloud_deploy_file.stat.exists == False
--- - fail: msg: "Upgrade is supported only for versions 7, 8, 9 and 10" when: - undercloud_version|openstack_release not in [8, 9, 10, 11] - name: Checking overcloud_deploy_file stat: path: "{{ overcloud_deploy_script }}" register: overcloud_deploy_file - fail: msg: "Overcloud deployment script not found. Expected path: {{ overcloud_deploy_script }} " when: overcloud_deploy_file.stat.exists == False
Use the setting for overcloud deploy path
Use the setting for overcloud deploy path When the provided script is different than the standard one, this step is failing. It should be using the right var, and this path should not be hardcoded. Change-Id: Ibbf4671040227faa8f2a53a21fb8880c1ea04a28
YAML
apache-2.0
redhat-openstack/infrared,redhat-openstack/infrared,redhat-openstack/infrared
yaml
## Code Before: --- - fail: msg: "Upgrade is supported only for versions 7, 8, 9 and 10" when: - undercloud_version|openstack_release not in [8, 9, 10, 11] - name: Checking overcloud_deploy_file stat: path: "~/overcloud_deploy.sh" register: overcloud_deploy_file - fail: msg: "Overcloud deployment script not found. Expected path: ~/overcloud_deploy.sh " when: overcloud_deploy_file.stat.exists == False ## Instruction: Use the setting for overcloud deploy path When the provided script is different than the standard one, this step is failing. It should be using the right var, and this path should not be hardcoded. Change-Id: Ibbf4671040227faa8f2a53a21fb8880c1ea04a28 ## Code After: --- - fail: msg: "Upgrade is supported only for versions 7, 8, 9 and 10" when: - undercloud_version|openstack_release not in [8, 9, 10, 11] - name: Checking overcloud_deploy_file stat: path: "{{ overcloud_deploy_script }}" register: overcloud_deploy_file - fail: msg: "Overcloud deployment script not found. Expected path: {{ overcloud_deploy_script }} " when: overcloud_deploy_file.stat.exists == False
83c8e10f04bc68c072b1f5133a59ad3b949d89bc
docker-compose.yml
docker-compose.yml
version: '3' services: gargbot_server: container_name: gargbot_server build: . env_file: - .env command: "venv/bin/python -m gargbot_3000 --mode server" expose: - 5000 ports: - "5000:5000" depends_on: - postgres_db networks: - gargbot_network - nginx_network gargbot_worker: container_name: gargbot_worker build: . env_file: - .env command: "venv/bin/python -m gargbot_3000 --mode task" depends_on: - postgres_db networks: - gargbot_network postgres_db: container_name: postgres_db image: "postgres" env_file: .env expose: - 5432 volumes: - ./postgres-data:/var/lib/postgresql/data networks: - gargbot_network networks: nginx_network: external: name: nginx_default gargbot_network: ~
version: '3' services: gargbot_server: container_name: gargbot_server build: . env_file: - .env command: "venv/bin/python -m gargbot_3000 --mode server" expose: - 5000 ports: - "5000:5000" depends_on: - postgres_db networks: - gargbot_network - nginx_network gargbot_worker: container_name: gargbot_worker build: . env_file: - .env command: "venv/bin/python -m gargbot_3000 --mode task" restart: always depends_on: - postgres_db networks: - gargbot_network postgres_db: container_name: postgres_db image: "postgres" env_file: .env expose: - 5432 volumes: - ./postgres-data:/var/lib/postgresql/data networks: - gargbot_network networks: nginx_network: external: name: nginx_default gargbot_network: ~
Add restart policy to worker
Add restart policy to worker
YAML
mit
eirki/gargbot_3000,eirki/gargbot_3000,eirki/gargbot_3000,eirki/gargbot_3000
yaml
## Code Before: version: '3' services: gargbot_server: container_name: gargbot_server build: . env_file: - .env command: "venv/bin/python -m gargbot_3000 --mode server" expose: - 5000 ports: - "5000:5000" depends_on: - postgres_db networks: - gargbot_network - nginx_network gargbot_worker: container_name: gargbot_worker build: . env_file: - .env command: "venv/bin/python -m gargbot_3000 --mode task" depends_on: - postgres_db networks: - gargbot_network postgres_db: container_name: postgres_db image: "postgres" env_file: .env expose: - 5432 volumes: - ./postgres-data:/var/lib/postgresql/data networks: - gargbot_network networks: nginx_network: external: name: nginx_default gargbot_network: ~ ## Instruction: Add restart policy to worker ## Code After: version: '3' services: gargbot_server: container_name: gargbot_server build: . env_file: - .env command: "venv/bin/python -m gargbot_3000 --mode server" expose: - 5000 ports: - "5000:5000" depends_on: - postgres_db networks: - gargbot_network - nginx_network gargbot_worker: container_name: gargbot_worker build: . env_file: - .env command: "venv/bin/python -m gargbot_3000 --mode task" restart: always depends_on: - postgres_db networks: - gargbot_network postgres_db: container_name: postgres_db image: "postgres" env_file: .env expose: - 5432 volumes: - ./postgres-data:/var/lib/postgresql/data networks: - gargbot_network networks: nginx_network: external: name: nginx_default gargbot_network: ~
8970ad3e9a02b5995c024e51f405d1078bce6619
jirabot.rb
jirabot.rb
require 'slack-ruby-bot' class JiraBot < SlackRubyBot::Bot match(/([a-z]+-[0-9]+)/i) do |client, data, issues| results = [] tomatch = data.text # Remove links from text, since they're already links, by grabbing everything between < and > tomatch = tomatch.sub /(<.+>)/i, '' # Also remove emoji, because skin-tone-2 and similar were showing up tomatch = tomatch.sub /:\b\S*\b:/, '' # Now grab everything that looks like a JIRA ticket, dump it into an array, grab uniques. tomatch.scan(/([a-z]+-[0-9]+)/i) do |i,j| results << 'https://ticketfly.jira.com/browse/'+i.upcase end client.say(channel: data.channel, text: results.uniq.join("\n")) end end JiraBot.run
require 'slack-ruby-bot' require "net/https" require "uri" require "JSON" class JiraBot < SlackRubyBot::Bot match(/([a-z]+-[0-9]+)/i) do |client, data, issues| results = [] tomatch = data.text # Remove links from text, since they're already links, by grabbing everything between < and > tomatch = tomatch.sub /(<.+>)/i, '' # Also remove emoji, because skin-tone-2 and similar were showing up tomatch = tomatch.sub /:\b\S*\b:/, '' # Now grab everything that looks like a JIRA ticket, dump it into an array, grab uniques. tomatch.scan(/([a-z]+-[0-9]+)/i) do |i,j| results << i.upcase end results.uniq.each do |ticket| url = ENV["JIRA_PREFIX"]+"rest/api/latest/issue/"+ticket direct = ENV["JIRA_PREFIX"]+"browse/"+ticket uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(uri.request_uri) request.basic_auth(ENV["JIRA_USER"],ENV["JIRA_PASS"]) response = http.request(request) body = JSON.parse(response.body) if response.code == "200" message = "#{direct}\n\n#{body['fields']['summary']}\n#{body['fields']['issuetype']['name']} (#{body['fields']['status']['name']})" else message = direct end client.say(channel: data.channel, text: message) end end end JiraBot.run
Call JIRA and fetch issue details
Call JIRA and fetch issue details
Ruby
mit
calciphus/jirabot
ruby
## Code Before: require 'slack-ruby-bot' class JiraBot < SlackRubyBot::Bot match(/([a-z]+-[0-9]+)/i) do |client, data, issues| results = [] tomatch = data.text # Remove links from text, since they're already links, by grabbing everything between < and > tomatch = tomatch.sub /(<.+>)/i, '' # Also remove emoji, because skin-tone-2 and similar were showing up tomatch = tomatch.sub /:\b\S*\b:/, '' # Now grab everything that looks like a JIRA ticket, dump it into an array, grab uniques. tomatch.scan(/([a-z]+-[0-9]+)/i) do |i,j| results << 'https://ticketfly.jira.com/browse/'+i.upcase end client.say(channel: data.channel, text: results.uniq.join("\n")) end end JiraBot.run ## Instruction: Call JIRA and fetch issue details ## Code After: require 'slack-ruby-bot' require "net/https" require "uri" require "JSON" class JiraBot < SlackRubyBot::Bot match(/([a-z]+-[0-9]+)/i) do |client, data, issues| results = [] tomatch = data.text # Remove links from text, since they're already links, by grabbing everything between < and > tomatch = tomatch.sub /(<.+>)/i, '' # Also remove emoji, because skin-tone-2 and similar were showing up tomatch = tomatch.sub /:\b\S*\b:/, '' # Now grab everything that looks like a JIRA ticket, dump it into an array, grab uniques. tomatch.scan(/([a-z]+-[0-9]+)/i) do |i,j| results << i.upcase end results.uniq.each do |ticket| url = ENV["JIRA_PREFIX"]+"rest/api/latest/issue/"+ticket direct = ENV["JIRA_PREFIX"]+"browse/"+ticket uri = URI.parse(url) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(uri.request_uri) request.basic_auth(ENV["JIRA_USER"],ENV["JIRA_PASS"]) response = http.request(request) body = JSON.parse(response.body) if response.code == "200" message = "#{direct}\n\n#{body['fields']['summary']}\n#{body['fields']['issuetype']['name']} (#{body['fields']['status']['name']})" else message = direct end client.say(channel: data.channel, text: message) end end end JiraBot.run
09a11a9059eeedc722120720d66730b40e4b6c8d
lib/unisms/router/random.rb
lib/unisms/router/random.rb
require_relative 'base' module Unisms::Router class Random < Base attr_accessor :available_adapters def initialize(available_adapters = nil) @available_adapters = available_adapters.is_a?(Array) ? available_adapters : [available_adapters].compact end def route @available_adapters.sample end end end module Unisms::Router class Random < Base def load_internal_adapters adaptor_module = Unisms::Adapter klasses = adaptor_module.constants.reject{ |c| c == :Base }.select { |c| adaptor_module.const_get(c).is_a? Class }.map {|c| adaptor_module.const_get c } @available_adapters = klasses.map { |klass| klass.new rescue nil }.compact end end end
require_relative 'base' module Unisms::Router class Random < Base attr_accessor :adapters def initialize(adapters = nil) @adapters = adapters.is_a?(Array) ? adapters : [adapters].compact end def route @adapters.sample end end end module Unisms::Router class Random < Base def load_internal_adapters adapter_module = Unisms::Adapter klasses = adapter_module.constants.reject{ |c| c == :Base }.select { |c| adapter_module.const_get(c).is_a? Class }.map {|c| adapter_module.const_get c } @adapters = klasses.map { |klass| klass.new rescue nil }.compact end end end
Rename "available_adapter" in Adapter::Random to "adapter" for better readability
Rename "available_adapter" in Adapter::Random to "adapter" for better readability
Ruby
mit
CrBoy/unisms,CrBoy/unisms
ruby
## Code Before: require_relative 'base' module Unisms::Router class Random < Base attr_accessor :available_adapters def initialize(available_adapters = nil) @available_adapters = available_adapters.is_a?(Array) ? available_adapters : [available_adapters].compact end def route @available_adapters.sample end end end module Unisms::Router class Random < Base def load_internal_adapters adaptor_module = Unisms::Adapter klasses = adaptor_module.constants.reject{ |c| c == :Base }.select { |c| adaptor_module.const_get(c).is_a? Class }.map {|c| adaptor_module.const_get c } @available_adapters = klasses.map { |klass| klass.new rescue nil }.compact end end end ## Instruction: Rename "available_adapter" in Adapter::Random to "adapter" for better readability ## Code After: require_relative 'base' module Unisms::Router class Random < Base attr_accessor :adapters def initialize(adapters = nil) @adapters = adapters.is_a?(Array) ? adapters : [adapters].compact end def route @adapters.sample end end end module Unisms::Router class Random < Base def load_internal_adapters adapter_module = Unisms::Adapter klasses = adapter_module.constants.reject{ |c| c == :Base }.select { |c| adapter_module.const_get(c).is_a? Class }.map {|c| adapter_module.const_get c } @adapters = klasses.map { |klass| klass.new rescue nil }.compact end end end
6296e0b198bd5430967cb3c3013aa2feb6c746fa
.github/workflows/ci.yml
.github/workflows/ci.yml
name: Node CI on: push jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: '10.x' - run: npm ci - run: npm test env: CI: true - run: npm run build - name: Run E2E uses: mujo-code/puppeteer-headful@master env: CI: true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true with: args: npm run e2e - run: npm run package if: startsWith(github.ref, 'refs/tags/') - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: "out/*.zip" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: Node CI on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: '10.x' - run: npm ci - run: npm test env: CI: true - run: npm run build - name: Run E2E uses: mujo-code/puppeteer-headful@master env: CI: true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true with: args: npm run e2e - run: npm run package if: startsWith(github.ref, 'refs/tags/') - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: "out/*.zip" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Revert "Trigger CI on push"
Revert "Trigger CI on push" This reverts commit 8592ae655e9dba4b1e7929590775b75ae5f79e71.
YAML
mit
OctoLinker/browser-extension,OctoLinker/browser-extension,OctoLinker/browser-extension
yaml
## Code Before: name: Node CI on: push jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: '10.x' - run: npm ci - run: npm test env: CI: true - run: npm run build - name: Run E2E uses: mujo-code/puppeteer-headful@master env: CI: true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true with: args: npm run e2e - run: npm run package if: startsWith(github.ref, 'refs/tags/') - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: "out/*.zip" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ## Instruction: Revert "Trigger CI on push" This reverts commit 8592ae655e9dba4b1e7929590775b75ae5f79e71. ## Code After: name: Node CI on: [push, pull_request] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: actions/setup-node@v1 with: node-version: '10.x' - run: npm ci - run: npm test env: CI: true - run: npm run build - name: Run E2E uses: mujo-code/puppeteer-headful@master env: CI: true PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true with: args: npm run e2e - run: npm run package if: startsWith(github.ref, 'refs/tags/') - name: Release uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: files: "out/*.zip" env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2795b1cf5bf1bc3dc5cb4e97596fb28aa5c92099
src/components/atoms/ToolbarButtonGroup.tsx
src/components/atoms/ToolbarButtonGroup.tsx
import styled from '../../lib/styled' export default styled.div` border-radius: 2px; border: solid 1px ${({ theme }) => theme.colors.border}; & > button { margin: 0; border: 0; border-right: 1px solid ${({ theme }) => theme.colors.border}; border-radius: 0; &:last-child { border-right: 0; } } `
import styled from '../../lib/styled' export default styled.div` border-radius: 2px; border: solid 1px ${({ theme }) => theme.colors.border}; & > button { margin: 0; border: 0; border-right: 1px solid ${({ theme }) => theme.colors.border}; border-radius: 0; &:first-child { border-top-left-radius: 2px; border-bottom-left-radius: 2px; } &:last-child { border-right: 0; border-top-right-radius: 2px; border-bottom-right-radius: 2px; } } `
Fix toolbar button group border radius style
Fix toolbar button group border radius style
TypeScript
mit
Sarah-Seo/Inpad,Sarah-Seo/Inpad
typescript
## Code Before: import styled from '../../lib/styled' export default styled.div` border-radius: 2px; border: solid 1px ${({ theme }) => theme.colors.border}; & > button { margin: 0; border: 0; border-right: 1px solid ${({ theme }) => theme.colors.border}; border-radius: 0; &:last-child { border-right: 0; } } ` ## Instruction: Fix toolbar button group border radius style ## Code After: import styled from '../../lib/styled' export default styled.div` border-radius: 2px; border: solid 1px ${({ theme }) => theme.colors.border}; & > button { margin: 0; border: 0; border-right: 1px solid ${({ theme }) => theme.colors.border}; border-radius: 0; &:first-child { border-top-left-radius: 2px; border-bottom-left-radius: 2px; } &:last-child { border-right: 0; border-top-right-radius: 2px; border-bottom-right-radius: 2px; } } `
25cec2a87fe3e41875a3fcf1c8cfd71ec6495402
spec/spec_helper.rb
spec/spec_helper.rb
require 'tmpdir' require 'fileutils' require 'vimrunner' VIM = Vimrunner::Runner.start_gvim VIM.add_plugin(File.expand_path('../..', __FILE__), 'plugin/runspec.vim') RSpec.configure do |config| # cd into a temporary directory for every example. config.around do |example| original_dir = FileUtils.getwd Dir.mktmpdir do |tmp_dir| FileUtils.cd(tmp_dir) example.call end FileUtils.cd(original_dir) end config.before do VIM.command("cd #{FileUtils.getwd}") end config.after(:suite) do VIM.kill end end
require 'tmpdir' require 'fileutils' require 'vimrunner' VIM = Vimrunner::Runner.start_gvim VIM.add_plugin(File.expand_path('../..', __FILE__), 'plugin/runspec.vim') RSpec.configure do |config| # cd into a temporary directory for every example. config.around do |example| Dir.mktmpdir do |dir| Dir.chdir(dir) do example.call end end end config.before do VIM.command("cd #{FileUtils.getwd}") end config.after(:suite) do VIM.kill end end
Use Dir.chdir to switch directories.
Use Dir.chdir to switch directories.
Ruby
mit
mudge/runspec.vim
ruby
## Code Before: require 'tmpdir' require 'fileutils' require 'vimrunner' VIM = Vimrunner::Runner.start_gvim VIM.add_plugin(File.expand_path('../..', __FILE__), 'plugin/runspec.vim') RSpec.configure do |config| # cd into a temporary directory for every example. config.around do |example| original_dir = FileUtils.getwd Dir.mktmpdir do |tmp_dir| FileUtils.cd(tmp_dir) example.call end FileUtils.cd(original_dir) end config.before do VIM.command("cd #{FileUtils.getwd}") end config.after(:suite) do VIM.kill end end ## Instruction: Use Dir.chdir to switch directories. ## Code After: require 'tmpdir' require 'fileutils' require 'vimrunner' VIM = Vimrunner::Runner.start_gvim VIM.add_plugin(File.expand_path('../..', __FILE__), 'plugin/runspec.vim') RSpec.configure do |config| # cd into a temporary directory for every example. config.around do |example| Dir.mktmpdir do |dir| Dir.chdir(dir) do example.call end end end config.before do VIM.command("cd #{FileUtils.getwd}") end config.after(:suite) do VIM.kill end end