commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e49fd31bebde60832ed764ed087c4bb3149d5c6f | src/runtime/web/index.js | src/runtime/web/index.js | 'use strict';
import { fetch } from './io';
import { Service } from '../../bindings/html/service';
import { setAttributes, getAttributes } from '../../bindings/html/dom';
const readyStates = {
loading: 0,
interactive: 1,
complete: 2
};
function whenInteractive(callback) {
if (readyStates[document.readyState] >= readyStates.interactive) {
return callback();
}
document.addEventListener('readystatechange', function onrsc() {
if (readyStates[document.readyState] >= readyStates.interactive) {
document.removeEventListener('readystatechange', onrsc);
callback();
}
});
}
function init() {
const service = new Service(fetch);
window.addEventListener('languagechange', service);
document.addEventListener('additionallanguageschange', service);
document.l10n.languages = navigator.languages;
}
whenInteractive(init);
// XXX for easier testing with existing Gaia apps; remove later on
const once = callback => whenInteractive(
() => document.l10n.ready.then(callback));
navigator.mozL10n = {
get: id => id,
once: once,
ready: once,
setAttributes: setAttributes,
getAttributes: getAttributes
};
| 'use strict';
import { fetch } from './io';
import { Service } from '../../bindings/html/service';
const readyStates = {
loading: 0,
interactive: 1,
complete: 2
};
function whenInteractive(callback) {
if (readyStates[document.readyState] >= readyStates.interactive) {
return callback();
}
document.addEventListener('readystatechange', function onrsc() {
if (readyStates[document.readyState] >= readyStates.interactive) {
document.removeEventListener('readystatechange', onrsc);
callback();
}
});
}
function init() {
const service = new Service(fetch);
window.addEventListener('languagechange', service);
document.addEventListener('additionallanguageschange', service);
document.l10n.languages = navigator.languages;
}
whenInteractive(init);
| Remove compatibility layer with navigator.mozL10n | Remove compatibility layer with navigator.mozL10n
| JavaScript | apache-2.0 | mail-apps/l20n.js,zbraniecki/fluent.js,projectfluent/fluent.js,stasm/l20n.js,mail-apps/l20n.js,zbraniecki/l20n.js,l20n/l20n.js,Swaven/l20n.js,Pike/l20n.js,Pike/l20n.js,projectfluent/fluent.js,projectfluent/fluent.js,zbraniecki/fluent.js | javascript | ## Code Before:
'use strict';
import { fetch } from './io';
import { Service } from '../../bindings/html/service';
import { setAttributes, getAttributes } from '../../bindings/html/dom';
const readyStates = {
loading: 0,
interactive: 1,
complete: 2
};
function whenInteractive(callback) {
if (readyStates[document.readyState] >= readyStates.interactive) {
return callback();
}
document.addEventListener('readystatechange', function onrsc() {
if (readyStates[document.readyState] >= readyStates.interactive) {
document.removeEventListener('readystatechange', onrsc);
callback();
}
});
}
function init() {
const service = new Service(fetch);
window.addEventListener('languagechange', service);
document.addEventListener('additionallanguageschange', service);
document.l10n.languages = navigator.languages;
}
whenInteractive(init);
// XXX for easier testing with existing Gaia apps; remove later on
const once = callback => whenInteractive(
() => document.l10n.ready.then(callback));
navigator.mozL10n = {
get: id => id,
once: once,
ready: once,
setAttributes: setAttributes,
getAttributes: getAttributes
};
## Instruction:
Remove compatibility layer with navigator.mozL10n
## Code After:
'use strict';
import { fetch } from './io';
import { Service } from '../../bindings/html/service';
const readyStates = {
loading: 0,
interactive: 1,
complete: 2
};
function whenInteractive(callback) {
if (readyStates[document.readyState] >= readyStates.interactive) {
return callback();
}
document.addEventListener('readystatechange', function onrsc() {
if (readyStates[document.readyState] >= readyStates.interactive) {
document.removeEventListener('readystatechange', onrsc);
callback();
}
});
}
function init() {
const service = new Service(fetch);
window.addEventListener('languagechange', service);
document.addEventListener('additionallanguageschange', service);
document.l10n.languages = navigator.languages;
}
whenInteractive(init);
| 'use strict';
import { fetch } from './io';
import { Service } from '../../bindings/html/service';
- import { setAttributes, getAttributes } from '../../bindings/html/dom';
const readyStates = {
loading: 0,
interactive: 1,
complete: 2
};
function whenInteractive(callback) {
if (readyStates[document.readyState] >= readyStates.interactive) {
return callback();
}
document.addEventListener('readystatechange', function onrsc() {
if (readyStates[document.readyState] >= readyStates.interactive) {
document.removeEventListener('readystatechange', onrsc);
callback();
}
});
}
function init() {
const service = new Service(fetch);
window.addEventListener('languagechange', service);
document.addEventListener('additionallanguageschange', service);
document.l10n.languages = navigator.languages;
}
whenInteractive(init);
-
- // XXX for easier testing with existing Gaia apps; remove later on
- const once = callback => whenInteractive(
- () => document.l10n.ready.then(callback));
-
- navigator.mozL10n = {
- get: id => id,
- once: once,
- ready: once,
- setAttributes: setAttributes,
- getAttributes: getAttributes
- }; | 13 | 0.288889 | 0 | 13 |
c85686f80e1506e0f3bcedcd17a9411c23ffb4b4 | spec/helpers/security_group_helper/textual_summary_spec.rb | spec/helpers/security_group_helper/textual_summary_spec.rb | describe SecurityGroupHelper::TextualSummary do
describe ".textual_group_firewall" do
before do
login_as FactoryGirl.create(:user)
end
subject { textuclal_group_firewall }
it 'returns TextualTable struct with list of of firewall rules' do
firewall_rules = [
FactoryGirl.create(:firewall_rule, :name => "Foo", :display_name => "Foo", :port => 1234),
FactoryGirl.create(:firewall_rule, :name => "Foo", :display_name => "Foo")
]
@record = FactoryGirl.create(:security_group_with_firewall_rules, :firewall_rules => firewall_rules)
expect(textual_group_firewall).to be_kind_of(Struct)
end
end
end
| describe SecurityGroupHelper::TextualSummary do
describe ".textual_group_firewall" do
before do
login_as FactoryGirl.create(:user)
end
subject { textual_group_firewall }
it 'returns TextualTable struct with list of of firewall rules' do
firewall_rules = [
FactoryGirl.create(:firewall_rule, :name => "Foo", :display_name => "Foo", :port => 1234),
FactoryGirl.create(:firewall_rule, :name => "Foo", :display_name => "Foo")
]
@record = FactoryGirl.create(:security_group_with_firewall_rules, :firewall_rules => firewall_rules)
expect(subject).to be_kind_of(Struct)
end
end
end
| Fix a typo in textual summary test for SecurityGroup. | Fix a typo in textual summary test for SecurityGroup.
| Ruby | apache-2.0 | ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic,ManageIQ/manageiq-ui-classic | ruby | ## Code Before:
describe SecurityGroupHelper::TextualSummary do
describe ".textual_group_firewall" do
before do
login_as FactoryGirl.create(:user)
end
subject { textuclal_group_firewall }
it 'returns TextualTable struct with list of of firewall rules' do
firewall_rules = [
FactoryGirl.create(:firewall_rule, :name => "Foo", :display_name => "Foo", :port => 1234),
FactoryGirl.create(:firewall_rule, :name => "Foo", :display_name => "Foo")
]
@record = FactoryGirl.create(:security_group_with_firewall_rules, :firewall_rules => firewall_rules)
expect(textual_group_firewall).to be_kind_of(Struct)
end
end
end
## Instruction:
Fix a typo in textual summary test for SecurityGroup.
## Code After:
describe SecurityGroupHelper::TextualSummary do
describe ".textual_group_firewall" do
before do
login_as FactoryGirl.create(:user)
end
subject { textual_group_firewall }
it 'returns TextualTable struct with list of of firewall rules' do
firewall_rules = [
FactoryGirl.create(:firewall_rule, :name => "Foo", :display_name => "Foo", :port => 1234),
FactoryGirl.create(:firewall_rule, :name => "Foo", :display_name => "Foo")
]
@record = FactoryGirl.create(:security_group_with_firewall_rules, :firewall_rules => firewall_rules)
expect(subject).to be_kind_of(Struct)
end
end
end
| describe SecurityGroupHelper::TextualSummary do
describe ".textual_group_firewall" do
before do
login_as FactoryGirl.create(:user)
end
- subject { textuclal_group_firewall }
? --
+ subject { textual_group_firewall }
it 'returns TextualTable struct with list of of firewall rules' do
firewall_rules = [
FactoryGirl.create(:firewall_rule, :name => "Foo", :display_name => "Foo", :port => 1234),
FactoryGirl.create(:firewall_rule, :name => "Foo", :display_name => "Foo")
]
@record = FactoryGirl.create(:security_group_with_firewall_rules, :firewall_rules => firewall_rules)
- expect(textual_group_firewall).to be_kind_of(Struct)
+ expect(subject).to be_kind_of(Struct)
end
end
end | 4 | 0.235294 | 2 | 2 |
92538b650ec1da071fe6be0697234c6236b118a1 | build-dev-bundle.js | build-dev-bundle.js | var path = require("path");
var stealTools = require("steal-tools");
var promise = stealTools.bundle({
config: path.join(__dirname, "package.json!npm")
}, {
filter: [ "**/*", "package.json" ],
minify: true
});
| var path = require("path");
var stealTools = require("steal-tools");
stealTools.bundle({
config: path.join(__dirname, "package.json!npm")
}, {
filter: [ "**/*", "package.json" ],
minify: true
}).catch(function(error) {
console.error(error);
process.exit(1);
});
| Exit with an error when the deps-bundle script fails | Exit with an error when the deps-bundle script fails
Previously, if you ran the deps-bundle script and steal-tools reported an error, the script would still exit successfully and the next script would run (e.g. when building the site/docs). This would leave you with an out-of-date (or non-existent) dev-bundle.
This fixes the issue by catching any errors reported by steal-tools and exiting the script in a way that will make Node report the error and stop.
| JavaScript | mit | bitovi/canjs,bitovi/canjs,bitovi/canjs,bitovi/canjs | javascript | ## Code Before:
var path = require("path");
var stealTools = require("steal-tools");
var promise = stealTools.bundle({
config: path.join(__dirname, "package.json!npm")
}, {
filter: [ "**/*", "package.json" ],
minify: true
});
## Instruction:
Exit with an error when the deps-bundle script fails
Previously, if you ran the deps-bundle script and steal-tools reported an error, the script would still exit successfully and the next script would run (e.g. when building the site/docs). This would leave you with an out-of-date (or non-existent) dev-bundle.
This fixes the issue by catching any errors reported by steal-tools and exiting the script in a way that will make Node report the error and stop.
## Code After:
var path = require("path");
var stealTools = require("steal-tools");
stealTools.bundle({
config: path.join(__dirname, "package.json!npm")
}, {
filter: [ "**/*", "package.json" ],
minify: true
}).catch(function(error) {
console.error(error);
process.exit(1);
});
| var path = require("path");
var stealTools = require("steal-tools");
- var promise = stealTools.bundle({
+ stealTools.bundle({
config: path.join(__dirname, "package.json!npm")
}, {
filter: [ "**/*", "package.json" ],
minify: true
+ }).catch(function(error) {
+ console.error(error);
+ process.exit(1);
}); | 5 | 0.555556 | 4 | 1 |
704ad760747a94faac9048db70689f591e1aeba4 | README.md | README.md |
> The simplest example demonstrating server-side [Hot Module Replacement][hmr]
> with [Webpack][webpack] & [Express][express].
>
> 
This project originated from an internal work project that **worked flawlessly**.
Unfortunately, it's been impossible to replicate up to this point.
### Help Wanted
- [ ] Webpack requires restarting several times before changes are picked up.
- [ ] HMR only works _once_, not with subsequent saves.
[express]: http://expressjs.com/
[hmr]: https://webpack.github.io/docs/hot-module-replacement.html
[webpack]: http://webpack.github.io/
|
> The simplest example demonstrating server-side [Hot Module Replacement][hmr]
> with [Webpack][webpack] & [Express][express].
>
> 
This project originated from an internal work project that **worked flawlessly**.
Unfortunately, it's been impossible to replicate up to this point.
### Help Wanted
> See: <https://github.com/webpack/webpack/issues/2485>
- [ ] Webpack requires restarting several times before changes are picked up.
- [ ] HMR only works _once_, not with subsequent saves.
[express]: http://expressjs.com/
[hmr]: https://webpack.github.io/docs/hot-module-replacement.html
[webpack]: http://webpack.github.io/
| Add link to open issue | Add link to open issue
| Markdown | mit | ericclemmons/webpack-hot-server-example | markdown | ## Code Before:
> The simplest example demonstrating server-side [Hot Module Replacement][hmr]
> with [Webpack][webpack] & [Express][express].
>
> 
This project originated from an internal work project that **worked flawlessly**.
Unfortunately, it's been impossible to replicate up to this point.
### Help Wanted
- [ ] Webpack requires restarting several times before changes are picked up.
- [ ] HMR only works _once_, not with subsequent saves.
[express]: http://expressjs.com/
[hmr]: https://webpack.github.io/docs/hot-module-replacement.html
[webpack]: http://webpack.github.io/
## Instruction:
Add link to open issue
## Code After:
> The simplest example demonstrating server-side [Hot Module Replacement][hmr]
> with [Webpack][webpack] & [Express][express].
>
> 
This project originated from an internal work project that **worked flawlessly**.
Unfortunately, it's been impossible to replicate up to this point.
### Help Wanted
> See: <https://github.com/webpack/webpack/issues/2485>
- [ ] Webpack requires restarting several times before changes are picked up.
- [ ] HMR only works _once_, not with subsequent saves.
[express]: http://expressjs.com/
[hmr]: https://webpack.github.io/docs/hot-module-replacement.html
[webpack]: http://webpack.github.io/
|
> The simplest example demonstrating server-side [Hot Module Replacement][hmr]
> with [Webpack][webpack] & [Express][express].
>
> 
This project originated from an internal work project that **worked flawlessly**.
Unfortunately, it's been impossible to replicate up to this point.
### Help Wanted
+ > See: <https://github.com/webpack/webpack/issues/2485>
+
- [ ] Webpack requires restarting several times before changes are picked up.
- [ ] HMR only works _once_, not with subsequent saves.
[express]: http://expressjs.com/
[hmr]: https://webpack.github.io/docs/hot-module-replacement.html
[webpack]: http://webpack.github.io/ | 2 | 0.105263 | 2 | 0 |
0a8a2ee3712700f23114b589041fc1253b57ad7d | README.md | README.md |
The server code is currently only tested on Ubuntu 16.04 (Xenial).
To setup and start running:
* make env
* source activate
* python manage.py init_db
* python manage.py runserver
To run the website so that it will be externally visible, do this:
* python manage.py runserver --host 0.0.0.0
[Flask-User-starter-app](https://github.com/lingthio/Flask-User-starter-app) was used as a starting point for this code repository.
|
The server code is currently only tested on Ubuntu 16.04 (Xenial).
To setup and start running:
* make env
* source activate
* python manage.py init_db
* python manage.py runserver
To run tests:
* ./runtests.sh
To run the website so that it will be externally visible, do this:
* python manage.py runserver --host 0.0.0.0
[Flask-User-starter-app](https://github.com/lingthio/Flask-User-starter-app) was used as a starting point for this code repository.
| Test PR to trigger Travis | Test PR to trigger Travis
| Markdown | bsd-2-clause | ignotus-peverell/nash,xke/nash,piyushhari/nash,ignotus-peverell/nash,piyushhari/nash,ignotus-peverell/nash,xke/nash,xke/nash,xke/nash,piyushhari/nash,piyushhari/nash,ignotus-peverell/nash | markdown | ## Code Before:
The server code is currently only tested on Ubuntu 16.04 (Xenial).
To setup and start running:
* make env
* source activate
* python manage.py init_db
* python manage.py runserver
To run the website so that it will be externally visible, do this:
* python manage.py runserver --host 0.0.0.0
[Flask-User-starter-app](https://github.com/lingthio/Flask-User-starter-app) was used as a starting point for this code repository.
## Instruction:
Test PR to trigger Travis
## Code After:
The server code is currently only tested on Ubuntu 16.04 (Xenial).
To setup and start running:
* make env
* source activate
* python manage.py init_db
* python manage.py runserver
To run tests:
* ./runtests.sh
To run the website so that it will be externally visible, do this:
* python manage.py runserver --host 0.0.0.0
[Flask-User-starter-app](https://github.com/lingthio/Flask-User-starter-app) was used as a starting point for this code repository.
|
The server code is currently only tested on Ubuntu 16.04 (Xenial).
To setup and start running:
* make env
* source activate
* python manage.py init_db
* python manage.py runserver
+ To run tests:
+ * ./runtests.sh
+
To run the website so that it will be externally visible, do this:
* python manage.py runserver --host 0.0.0.0
[Flask-User-starter-app](https://github.com/lingthio/Flask-User-starter-app) was used as a starting point for this code repository.
| 3 | 0.1875 | 3 | 0 |
b269f5e3b4f1f48b4bb0ba247a61a85ace39e4cf | app/models/cve.rb | app/models/cve.rb | class CVE < ActiveRecord::Base
has_many :references, :class_name => "CVEReference"
has_many :comments, :class_name => "CVEComment"
end
|
class CVE < ActiveRecord::Base
has_many :references, :class_name => "CVEReference"
has_many :comments, :class_name => "CVEComment"
has_and_belongs_to_many :cpes, :class_name => "CPE"
end
| Add license to CVE model | Add license to CVE model
| Ruby | agpl-3.0 | ackle/glsamaker-dev,ackle/glsamaker-dev | ruby | ## Code Before:
class CVE < ActiveRecord::Base
has_many :references, :class_name => "CVEReference"
has_many :comments, :class_name => "CVEComment"
end
## Instruction:
Add license to CVE model
## Code After:
class CVE < ActiveRecord::Base
has_many :references, :class_name => "CVEReference"
has_many :comments, :class_name => "CVEComment"
has_and_belongs_to_many :cpes, :class_name => "CPE"
end
| +
class CVE < ActiveRecord::Base
has_many :references, :class_name => "CVEReference"
has_many :comments, :class_name => "CVEComment"
+ has_and_belongs_to_many :cpes, :class_name => "CPE"
end | 2 | 0.5 | 2 | 0 |
2b0bcbb7ce82171965b22cf657439d6263fa9d91 | geojson_scraper.py | geojson_scraper.py | import json
import os
import urllib.request
from retry import retry
from urllib.error import HTTPError
from common import store_history, truncate, summarise
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
@retry(HTTPError, tries=2, delay=30)
def scrape(url, council_id, encoding, table):
with urllib.request.urlopen(url) as response:
# clear any existing data
truncate(table)
# load json
data_str = response.read()
data = json.loads(data_str.decode(encoding))
print("found %i %s" % (len(data['features']), table))
for feature in data['features']:
# assemble record
record = {
'pk': feature['id'],
'council_id': council_id,
'geometry': json.dumps(feature),
}
for field in feature['properties']:
if field != 'bbox':
record[field] = feature['properties'][field]
# save to db
scraperwiki.sqlite.save(
unique_keys=['pk'],
data=record,
table_name=table)
scraperwiki.sqlite.commit_transactions()
# print summary
summarise(table)
store_history(data_str, table)
| import json
import os
import urllib.request
from retry import retry
from urllib.error import HTTPError
from common import store_history, truncate, summarise
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
@retry(HTTPError, tries=2, delay=30)
def scrape(url, council_id, encoding, table, key=None):
with urllib.request.urlopen(url) as response:
# clear any existing data
truncate(table)
# load json
data_str = response.read()
data = json.loads(data_str.decode(encoding))
print("found %i %s" % (len(data['features']), table))
for feature in data['features']:
# assemble record
record = {
'council_id': council_id,
'geometry': json.dumps(feature),
}
if key is None:
record['pk'] = feature['id']
else:
record['pk'] = feature['properties'][key]
for field in feature['properties']:
if field != 'bbox':
record[field] = feature['properties'][field]
# save to db
scraperwiki.sqlite.save(
unique_keys=['pk'],
data=record,
table_name=table)
scraperwiki.sqlite.commit_transactions()
# print summary
summarise(table)
store_history(data_str, table)
| Add key param to geojson scraper | Add key param to geojson scraper
Sometimes we encounter a geojson file with no 'id' attribute
This allows us to specify a property to use as a key instead
| Python | mit | wdiv-scrapers/dc-base-scrapers | python | ## Code Before:
import json
import os
import urllib.request
from retry import retry
from urllib.error import HTTPError
from common import store_history, truncate, summarise
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
@retry(HTTPError, tries=2, delay=30)
def scrape(url, council_id, encoding, table):
with urllib.request.urlopen(url) as response:
# clear any existing data
truncate(table)
# load json
data_str = response.read()
data = json.loads(data_str.decode(encoding))
print("found %i %s" % (len(data['features']), table))
for feature in data['features']:
# assemble record
record = {
'pk': feature['id'],
'council_id': council_id,
'geometry': json.dumps(feature),
}
for field in feature['properties']:
if field != 'bbox':
record[field] = feature['properties'][field]
# save to db
scraperwiki.sqlite.save(
unique_keys=['pk'],
data=record,
table_name=table)
scraperwiki.sqlite.commit_transactions()
# print summary
summarise(table)
store_history(data_str, table)
## Instruction:
Add key param to geojson scraper
Sometimes we encounter a geojson file with no 'id' attribute
This allows us to specify a property to use as a key instead
## Code After:
import json
import os
import urllib.request
from retry import retry
from urllib.error import HTTPError
from common import store_history, truncate, summarise
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
@retry(HTTPError, tries=2, delay=30)
def scrape(url, council_id, encoding, table, key=None):
with urllib.request.urlopen(url) as response:
# clear any existing data
truncate(table)
# load json
data_str = response.read()
data = json.loads(data_str.decode(encoding))
print("found %i %s" % (len(data['features']), table))
for feature in data['features']:
# assemble record
record = {
'council_id': council_id,
'geometry': json.dumps(feature),
}
if key is None:
record['pk'] = feature['id']
else:
record['pk'] = feature['properties'][key]
for field in feature['properties']:
if field != 'bbox':
record[field] = feature['properties'][field]
# save to db
scraperwiki.sqlite.save(
unique_keys=['pk'],
data=record,
table_name=table)
scraperwiki.sqlite.commit_transactions()
# print summary
summarise(table)
store_history(data_str, table)
| import json
import os
import urllib.request
from retry import retry
from urllib.error import HTTPError
from common import store_history, truncate, summarise
# hack to override sqlite database filename
# see: https://help.morph.io/t/using-python-3-with-morph-scraperwiki-fork/148
os.environ['SCRAPERWIKI_DATABASE_NAME'] = 'sqlite:///data.sqlite'
import scraperwiki
@retry(HTTPError, tries=2, delay=30)
- def scrape(url, council_id, encoding, table):
+ def scrape(url, council_id, encoding, table, key=None):
? ++++++++++
with urllib.request.urlopen(url) as response:
# clear any existing data
truncate(table)
# load json
data_str = response.read()
data = json.loads(data_str.decode(encoding))
print("found %i %s" % (len(data['features']), table))
for feature in data['features']:
# assemble record
record = {
- 'pk': feature['id'],
'council_id': council_id,
'geometry': json.dumps(feature),
}
+ if key is None:
+ record['pk'] = feature['id']
+ else:
+ record['pk'] = feature['properties'][key]
for field in feature['properties']:
if field != 'bbox':
record[field] = feature['properties'][field]
# save to db
scraperwiki.sqlite.save(
unique_keys=['pk'],
data=record,
table_name=table)
scraperwiki.sqlite.commit_transactions()
# print summary
summarise(table)
store_history(data_str, table) | 7 | 0.142857 | 5 | 2 |
68be6970dbeff96d1566e3fa1d267da1b78f1c65 | doc/upstream-training/source/website/upstream-training-summit.rst | doc/upstream-training/source/website/upstream-training-summit.rst | ==========================
OpenStack Summit Vancouver
==========================
The upcoming `OpenStack Summit
<https://www.openstack.org/summit/vancouver-2018/>`_ will be in Vancouver in
May with a full training running prior to the event.
`Etherpad for Vancouver Upstream Collaboration Training
<https://etherpad.openstack.org/p/upstream-institute-vancouver-2018>`_
**Saturday, May 19th (2 to 6pm), 2018 - Sunday, May 20th (9am to 6pm),
2018**
RSVP details to come.
| ==========================
OpenStack Summit Vancouver
==========================
The upcoming `OpenStack Summit
<https://www.openstack.org/summit/vancouver-2018/>`_ will be in Vancouver in
May with a full training running prior to the event.
`Etherpad for Vancouver Upstream Collaboration Training
<https://etherpad.openstack.org/p/upstream-institute-vancouver-2018>`_
**Saturday, May 19th (2 to 6pm), 2018 - Sunday, May 20th (9am to 6pm),
2018**
The training will take place in `Vancouver Convention Centre West - Level Two
- Room 215-216
<https://www.openstack.org/summit/vancouver-2018/venues/#venue=338>`_.
Please `RSVP
<https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21580/openstack-upstream-institute-day-1-rsvp-required>`_
if you plan on attending the training in Vancouver. If you decide after
registration closes to attend, please drop by and check for available seats.
| Add Vancouver RSVP details to the web page | [upstream] Add Vancouver RSVP details to the web page
Change-Id: Ic4a4580a5ec3d346c76ff96eb419383bba56a110
| reStructuredText | apache-2.0 | openstack/training-guides,openstack/training-guides | restructuredtext | ## Code Before:
==========================
OpenStack Summit Vancouver
==========================
The upcoming `OpenStack Summit
<https://www.openstack.org/summit/vancouver-2018/>`_ will be in Vancouver in
May with a full training running prior to the event.
`Etherpad for Vancouver Upstream Collaboration Training
<https://etherpad.openstack.org/p/upstream-institute-vancouver-2018>`_
**Saturday, May 19th (2 to 6pm), 2018 - Sunday, May 20th (9am to 6pm),
2018**
RSVP details to come.
## Instruction:
[upstream] Add Vancouver RSVP details to the web page
Change-Id: Ic4a4580a5ec3d346c76ff96eb419383bba56a110
## Code After:
==========================
OpenStack Summit Vancouver
==========================
The upcoming `OpenStack Summit
<https://www.openstack.org/summit/vancouver-2018/>`_ will be in Vancouver in
May with a full training running prior to the event.
`Etherpad for Vancouver Upstream Collaboration Training
<https://etherpad.openstack.org/p/upstream-institute-vancouver-2018>`_
**Saturday, May 19th (2 to 6pm), 2018 - Sunday, May 20th (9am to 6pm),
2018**
The training will take place in `Vancouver Convention Centre West - Level Two
- Room 215-216
<https://www.openstack.org/summit/vancouver-2018/venues/#venue=338>`_.
Please `RSVP
<https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21580/openstack-upstream-institute-day-1-rsvp-required>`_
if you plan on attending the training in Vancouver. If you decide after
registration closes to attend, please drop by and check for available seats.
| ==========================
OpenStack Summit Vancouver
==========================
The upcoming `OpenStack Summit
<https://www.openstack.org/summit/vancouver-2018/>`_ will be in Vancouver in
May with a full training running prior to the event.
`Etherpad for Vancouver Upstream Collaboration Training
<https://etherpad.openstack.org/p/upstream-institute-vancouver-2018>`_
**Saturday, May 19th (2 to 6pm), 2018 - Sunday, May 20th (9am to 6pm),
2018**
- RSVP details to come.
+ The training will take place in `Vancouver Convention Centre West - Level Two
+ - Room 215-216
+ <https://www.openstack.org/summit/vancouver-2018/venues/#venue=338>`_.
+
+ Please `RSVP
+ <https://www.openstack.org/summit/vancouver-2018/summit-schedule/events/21580/openstack-upstream-institute-day-1-rsvp-required>`_
+ if you plan on attending the training in Vancouver. If you decide after
+ registration closes to attend, please drop by and check for available seats. | 9 | 0.6 | 8 | 1 |
4284c016aad53d57db7a75d9f6f53c4363962f6d | _src/compare.jade | _src/compare.jade | .container
block title
h1 Budget Comparison Tool
p
|Open Budget: Grand Rapids is still awaiting 2018 budget data from the City of Grand Rapids. In 2016, the City partnered with Citizen Labs to create and promote this website to increase understanding and provide transparency in our city government. Once we have 2018 budget data we will be able to provide the comparison tool.
<div data-type="countup" data-id="25539" class="tickcounter" style="width: 100%; position: relative; padding-bottom: 25%"><a href="//www.tickcounter.com/countup/25539/since-2017-grand-rapids-budget-approved" title="Since 2017 Grand Rapids Budget Approved">Since 2017 Grand Rapids Budget Approved</a><a href="//www.tickcounter.com/countup" title="Countup">Countup</a></div><script>(function(d, s, id) { var js, pjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//www.tickcounter.com/static/js/loader.js"; pjs.parentNode.insertBefore(js, pjs); }(document, "script", "tickcounter-sdk"));</script>
#root
script(src="js/dist/compare.bundle.js")
| .container
#root
script(src="js/dist/compare.bundle.js") | Revert "add counter to page" | Revert "add counter to page"
This reverts commit 5f711397398508c3065ccbe6418d6e11d17c2c94.
| Jade | mit | citizenlabsgr/openbudgetgr,citizenlabsgr/openbudgetgr,citizenlabsgr/openbudgetgr,citizenlabsgr/openbudgetgr | jade | ## Code Before:
.container
block title
h1 Budget Comparison Tool
p
|Open Budget: Grand Rapids is still awaiting 2018 budget data from the City of Grand Rapids. In 2016, the City partnered with Citizen Labs to create and promote this website to increase understanding and provide transparency in our city government. Once we have 2018 budget data we will be able to provide the comparison tool.
<div data-type="countup" data-id="25539" class="tickcounter" style="width: 100%; position: relative; padding-bottom: 25%"><a href="//www.tickcounter.com/countup/25539/since-2017-grand-rapids-budget-approved" title="Since 2017 Grand Rapids Budget Approved">Since 2017 Grand Rapids Budget Approved</a><a href="//www.tickcounter.com/countup" title="Countup">Countup</a></div><script>(function(d, s, id) { var js, pjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//www.tickcounter.com/static/js/loader.js"; pjs.parentNode.insertBefore(js, pjs); }(document, "script", "tickcounter-sdk"));</script>
#root
script(src="js/dist/compare.bundle.js")
## Instruction:
Revert "add counter to page"
This reverts commit 5f711397398508c3065ccbe6418d6e11d17c2c94.
## Code After:
.container
#root
script(src="js/dist/compare.bundle.js") | .container
-
- block title
- h1 Budget Comparison Tool
-
- p
- |Open Budget: Grand Rapids is still awaiting 2018 budget data from the City of Grand Rapids. In 2016, the City partnered with Citizen Labs to create and promote this website to increase understanding and provide transparency in our city government. Once we have 2018 budget data we will be able to provide the comparison tool.
-
- <div data-type="countup" data-id="25539" class="tickcounter" style="width: 100%; position: relative; padding-bottom: 25%"><a href="//www.tickcounter.com/countup/25539/since-2017-grand-rapids-budget-approved" title="Since 2017 Grand Rapids Budget Approved">Since 2017 Grand Rapids Budget Approved</a><a href="//www.tickcounter.com/countup" title="Countup">Countup</a></div><script>(function(d, s, id) { var js, pjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//www.tickcounter.com/static/js/loader.js"; pjs.parentNode.insertBefore(js, pjs); }(document, "script", "tickcounter-sdk"));</script>
-
#root
script(src="js/dist/compare.bundle.js") | 9 | 0.692308 | 0 | 9 |
5a58b7986fc9805b515bbe5b068f83be09e72181 | .travis.yml | .travis.yml | language: ruby
dist: xenial
cache:
bundler: true
bundler_args: --jobs 1 --retry 5 --without development --path vendor/bundle
rvm:
- '2.3'
- '2.4'
- '2.5'
- '2.6'
env:
- COMPILER=gcc
- COMPILER=clang
matrix:
fast_finish: true
branches:
only:
- master
notifications:
email:
on_success: never
on_failure: always
before_install:
- gem install bundler
- export CC=$(which $COMPILER)
before_script:
- bundle exec rake clean
- bundle exec rake clobber
script:
- bundle exec rake test
after_success:
- bundle exec rake benchmark
| language: ruby
dist: xenial
cache:
bundler: true
bundler_args: --jobs 1 --retry 5 --without development --path vendor/bundle
rvm:
- '2.3'
- '2.4'
- '2.5'
- '2.6'
- '2.7'
env:
- COMPILER=gcc
- COMPILER=clang
matrix:
fast_finish: true
branches:
only:
- master
notifications:
email:
on_success: never
on_failure: always
before_install:
- gem install bundler
- export CC=$(which $COMPILER)
before_script:
- bundle exec rake clean
script:
- bundle exec rake test
after_success:
- bundle exec rake benchmark
| Update Travis CI to use Ruby version 2.7.0 | Update Travis CI to use Ruby version 2.7.0
Signed-off-by: Krzysztof Wilczyński <5f1c0be89013f8fde969a8dcb2fa1d522e94ee00@linux.com>
| YAML | apache-2.0 | kwilczynski/ruby-fizzbuzz,kwilczynski/ruby-fizzbuzz,kwilczynski/ruby-fizzbuzz | yaml | ## Code Before:
language: ruby
dist: xenial
cache:
bundler: true
bundler_args: --jobs 1 --retry 5 --without development --path vendor/bundle
rvm:
- '2.3'
- '2.4'
- '2.5'
- '2.6'
env:
- COMPILER=gcc
- COMPILER=clang
matrix:
fast_finish: true
branches:
only:
- master
notifications:
email:
on_success: never
on_failure: always
before_install:
- gem install bundler
- export CC=$(which $COMPILER)
before_script:
- bundle exec rake clean
- bundle exec rake clobber
script:
- bundle exec rake test
after_success:
- bundle exec rake benchmark
## Instruction:
Update Travis CI to use Ruby version 2.7.0
Signed-off-by: Krzysztof Wilczyński <5f1c0be89013f8fde969a8dcb2fa1d522e94ee00@linux.com>
## Code After:
language: ruby
dist: xenial
cache:
bundler: true
bundler_args: --jobs 1 --retry 5 --without development --path vendor/bundle
rvm:
- '2.3'
- '2.4'
- '2.5'
- '2.6'
- '2.7'
env:
- COMPILER=gcc
- COMPILER=clang
matrix:
fast_finish: true
branches:
only:
- master
notifications:
email:
on_success: never
on_failure: always
before_install:
- gem install bundler
- export CC=$(which $COMPILER)
before_script:
- bundle exec rake clean
script:
- bundle exec rake test
after_success:
- bundle exec rake benchmark
| language: ruby
dist: xenial
cache:
bundler: true
bundler_args: --jobs 1 --retry 5 --without development --path vendor/bundle
rvm:
- '2.3'
- '2.4'
- '2.5'
- '2.6'
+ - '2.7'
env:
- COMPILER=gcc
- COMPILER=clang
matrix:
fast_finish: true
branches:
only:
- master
notifications:
email:
on_success: never
on_failure: always
before_install:
- gem install bundler
- export CC=$(which $COMPILER)
before_script:
- bundle exec rake clean
- - bundle exec rake clobber
script:
- bundle exec rake test
after_success:
- bundle exec rake benchmark | 2 | 0.046512 | 1 | 1 |
b0512f028d40c86c34fc01def14ee3d15431d2e9 | l10n_br_sale/security/l10n_br_sale_security.xml | l10n_br_sale/security/l10n_br_sale_security.xml | <?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="0">
<record id="group_discount_per_value" model="res.groups">
<field name="name">Discount in Sales Orders per Value</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_total_discount" model="res.groups">
<field name="name">Allow Amount Discount on Sales Orders</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
</odoo>
| <?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="0">
<record id="group_discount_per_value" model="res.groups">
<field name="name">Discount in Sales Orders per Value</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_total_discount" model="res.groups">
<field name="name">Allow Amount Discount on Sales Orders</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.user_admin" model="res.users">
<field name="groups_id" eval="[(4, ref('l10n_br_sale.group_discount_per_value'))]"/>
</record>
</odoo>
| Make the user join in the correct group for discount | [IMP] Make the user join in the correct group for discount
| XML | agpl-3.0 | OCA/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil | xml | ## Code Before:
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="0">
<record id="group_discount_per_value" model="res.groups">
<field name="name">Discount in Sales Orders per Value</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_total_discount" model="res.groups">
<field name="name">Allow Amount Discount on Sales Orders</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
</odoo>
## Instruction:
[IMP] Make the user join in the correct group for discount
## Code After:
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="0">
<record id="group_discount_per_value" model="res.groups">
<field name="name">Discount in Sales Orders per Value</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_total_discount" model="res.groups">
<field name="name">Allow Amount Discount on Sales Orders</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="base.user_admin" model="res.users">
<field name="groups_id" eval="[(4, ref('l10n_br_sale.group_discount_per_value'))]"/>
</record>
</odoo>
| <?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="0">
<record id="group_discount_per_value" model="res.groups">
<field name="name">Discount in Sales Orders per Value</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
<record id="group_total_discount" model="res.groups">
<field name="name">Allow Amount Discount on Sales Orders</field>
<field name="category_id" ref="base.module_category_hidden"/>
</record>
+ <record id="base.user_admin" model="res.users">
+ <field name="groups_id" eval="[(4, ref('l10n_br_sale.group_discount_per_value'))]"/>
+ </record>
+
</odoo> | 4 | 0.285714 | 4 | 0 |
4d49ec34b072c0c212a03c00429d1ca67437741d | build/deploy.sh | build/deploy.sh | set -ev
if [ "${TRAVIS_PULL_REQUEST}" = "false" -a "${TRAVIS_BRANCH}" = "master" ]; then
# setup ssh key
echo -e "Host github.com\n\tStrictHostKeyChecking no\nIdentityFile ~/.ssh/deploy.key\n" >> ~/.ssh/config
echo -e "$GITHUB_DEPLOY_KEY" | base64 -d > ~/.ssh/deploy.key
chmod 600 ~/.ssh/deploy.key
# fetch gh-pages branch
cd ../..
git clone --depth=1 --branch=gh-pages git@github.com:vivliostyle/vivliostyle.js.git gh-pages
cd gh-pages
# git configuration
git config user.email "kwkbtr@vivliostyle.com"
git config user.name "kwkbtr (Travis CI)"
# update gh-pages branch
cp ../vivliostyle/vivliostyle.js/build/vivliostyle-viewer.min.js ../vivliostyle/vivliostyle.js/src/{adapt,vivliostyle}/*.{css,txt,xml} viewer/
git add viewer
git commit -m "Update built vivliostyle-viewer.min.js (original commit: $TRAVIS_COMMIT)"
git push origin gh-pages
fi
| set -ev
if [ "${TRAVIS_PULL_REQUEST}" = "false" -a "${TRAVIS_BRANCH}" = "master" ]; then
# setup ssh key
echo -e "Host github.com\n\tStrictHostKeyChecking no\nIdentityFile ~/.ssh/deploy.key\n" >> ~/.ssh/config
echo -e "$GITHUB_DEPLOY_KEY" | base64 -d > ~/.ssh/deploy.key
chmod 600 ~/.ssh/deploy.key
# fetch gh-pages branch
cd ../..
git clone --depth=1 --branch=gh-pages git@github.com:vivliostyle/vivliostyle.js.git gh-pages
cd gh-pages
# git configuration
git config user.email "kwkbtr@vivliostyle.com"
git config user.name "kwkbtr (Travis CI)"
# update gh-pages branch
master=../vivliostyle/vivliostyle.js
cp ${master}/build/vivliostyle-viewer.min.js ${master}/src/adapt/*.{css,txt,xml} ${master}/src/vivliostyle/*.css viewer/
git add viewer
git commit -m "Update built vivliostyle-viewer.min.js (original commit: $TRAVIS_COMMIT)"
git push origin gh-pages
fi
| Change vivliostyle-viewer module name to vivliostyle.viewerapp | Change vivliostyle-viewer module name to vivliostyle.viewerapp
| Shell | agpl-3.0 | vivliostyle/vivliostyle.js,zopyx/vivliostyle.js,nulltask/vivliostyle.js,nulltask/vivliostyle.js,vivliostyle/vivliostyle.js,vivliostyle/vivliostyle.js,zopyx/vivliostyle.js,nulltask/vivliostyle.js,zopyx/vivliostyle.js,vivliostyle/vivliostyle.js,kuad9/vivliostyle.js_study,kuad9/vivliostyle.js_study,kuad9/vivliostyle.js_study,kuad9/vivliostyle.js_study,zopyx/vivliostyle.js,nulltask/vivliostyle.js | shell | ## Code Before:
set -ev
if [ "${TRAVIS_PULL_REQUEST}" = "false" -a "${TRAVIS_BRANCH}" = "master" ]; then
# setup ssh key
echo -e "Host github.com\n\tStrictHostKeyChecking no\nIdentityFile ~/.ssh/deploy.key\n" >> ~/.ssh/config
echo -e "$GITHUB_DEPLOY_KEY" | base64 -d > ~/.ssh/deploy.key
chmod 600 ~/.ssh/deploy.key
# fetch gh-pages branch
cd ../..
git clone --depth=1 --branch=gh-pages git@github.com:vivliostyle/vivliostyle.js.git gh-pages
cd gh-pages
# git configuration
git config user.email "kwkbtr@vivliostyle.com"
git config user.name "kwkbtr (Travis CI)"
# update gh-pages branch
cp ../vivliostyle/vivliostyle.js/build/vivliostyle-viewer.min.js ../vivliostyle/vivliostyle.js/src/{adapt,vivliostyle}/*.{css,txt,xml} viewer/
git add viewer
git commit -m "Update built vivliostyle-viewer.min.js (original commit: $TRAVIS_COMMIT)"
git push origin gh-pages
fi
## Instruction:
Change vivliostyle-viewer module name to vivliostyle.viewerapp
## Code After:
set -ev
if [ "${TRAVIS_PULL_REQUEST}" = "false" -a "${TRAVIS_BRANCH}" = "master" ]; then
# setup ssh key
echo -e "Host github.com\n\tStrictHostKeyChecking no\nIdentityFile ~/.ssh/deploy.key\n" >> ~/.ssh/config
echo -e "$GITHUB_DEPLOY_KEY" | base64 -d > ~/.ssh/deploy.key
chmod 600 ~/.ssh/deploy.key
# fetch gh-pages branch
cd ../..
git clone --depth=1 --branch=gh-pages git@github.com:vivliostyle/vivliostyle.js.git gh-pages
cd gh-pages
# git configuration
git config user.email "kwkbtr@vivliostyle.com"
git config user.name "kwkbtr (Travis CI)"
# update gh-pages branch
master=../vivliostyle/vivliostyle.js
cp ${master}/build/vivliostyle-viewer.min.js ${master}/src/adapt/*.{css,txt,xml} ${master}/src/vivliostyle/*.css viewer/
git add viewer
git commit -m "Update built vivliostyle-viewer.min.js (original commit: $TRAVIS_COMMIT)"
git push origin gh-pages
fi
| set -ev
if [ "${TRAVIS_PULL_REQUEST}" = "false" -a "${TRAVIS_BRANCH}" = "master" ]; then
# setup ssh key
echo -e "Host github.com\n\tStrictHostKeyChecking no\nIdentityFile ~/.ssh/deploy.key\n" >> ~/.ssh/config
echo -e "$GITHUB_DEPLOY_KEY" | base64 -d > ~/.ssh/deploy.key
chmod 600 ~/.ssh/deploy.key
# fetch gh-pages branch
cd ../..
git clone --depth=1 --branch=gh-pages git@github.com:vivliostyle/vivliostyle.js.git gh-pages
cd gh-pages
# git configuration
git config user.email "kwkbtr@vivliostyle.com"
git config user.name "kwkbtr (Travis CI)"
# update gh-pages branch
- cp ../vivliostyle/vivliostyle.js/build/vivliostyle-viewer.min.js ../vivliostyle/vivliostyle.js/src/{adapt,vivliostyle}/*.{css,txt,xml} viewer/
+ master=../vivliostyle/vivliostyle.js
+ cp ${master}/build/vivliostyle-viewer.min.js ${master}/src/adapt/*.{css,txt,xml} ${master}/src/vivliostyle/*.css viewer/
git add viewer
git commit -m "Update built vivliostyle-viewer.min.js (original commit: $TRAVIS_COMMIT)"
git push origin gh-pages
fi | 3 | 0.130435 | 2 | 1 |
47ccce2e14786e1d692271b4dee6bfab80bad253 | modules/event-logging/src/main/java/org/motechproject/eventlogging/service/EventLogService.java | modules/event-logging/src/main/java/org/motechproject/eventlogging/service/EventLogService.java | package org.motechproject.eventlogging.service;
import org.motechproject.eventlogging.domain.EventLog;
import org.motechproject.mds.annotations.Lookup;
import org.motechproject.mds.service.MotechDataService;
import java.util.List;
/**
* Motech Data Service interface for {@link EventLog}s. The implementation is generated
* and injected by the MDS module.
*/
public interface EventLogService extends MotechDataService<EventLog> {
/**
* Finds all recorded events with the given subject
* @param name A subject to filter by
* @return A collection of all recorded events with the given subject.
*/
@Lookup
List<EventLog> findBySubject(String name);
}
| package org.motechproject.eventlogging.service;
import org.motechproject.eventlogging.domain.EventLog;
import org.motechproject.mds.annotations.Lookup;
import org.motechproject.mds.annotations.LookupField;
import org.motechproject.mds.service.MotechDataService;
import java.util.List;
/**
* Motech Data Service interface for {@link EventLog}s. The implementation is generated
* and injected by the MDS module.
*/
public interface EventLogService extends MotechDataService<EventLog> {
/**
* Finds all recorded events with the given subject
* @param name A subject to filter by
* @return A collection of all recorded events with the given subject.
*/
@Lookup
List<EventLog> findBySubject(@LookupField(name = "subject") String name);
}
| Support for collection fields in lookups | MOTECH-1040: Support for collection fields in lookups
This commit adds support for collection fields in lookups. For now there
will be possible to create a lookup that will find instances for which
passed value will be inside collection field.
For example assume that there is a User class with roles field that have
java.util.List type. Before these changes a developer could not create a
lookup that will find a users that have the given role. Currently, there
is a possibility.
Change-Id: Ibf7c18c142f7794a304732eb9c52aaef8abd5e6f
| Java | bsd-3-clause | justin-hayes/modules,ScottKimball/modules,frankhuster/modules,smalecki/modules,ngraczewski/modules,tstalka/modules,pmuchowski/modules,atish160384/modules,1stmateusz/modules,frankhuster/modules,atish160384/modules,koshalt/modules,LukSkarDev/modules,ScottKimball/modules,shubhambeehyv/modules,martokarski/modules,frankhuster/modules,justin-hayes/modules,atish160384/modules,LukSkarDev/modules,sebbrudzinski/modules,ngraczewski/modules,pmuchowski/modules,LukSkarDev/modules,wstrzelczyk/modules,mkwiatkowskisoldevelo/modules,mkwiatkowskisoldevelo/modules,justin-hayes/modules,smalecki/modules,tstalka/modules,koshalt/modules,martokarski/modules,koshalt/modules,sebbrudzinski/modules,sebbrudzinski/modules,pgesek/modules,pgesek/modules,1stmateusz/modules,mkwiatkowskisoldevelo/modules,justin-hayes/modules,pgesek/modules,ngraczewski/modules,LukSkarDev/modules,ngraczewski/modules,1stmateusz/modules,frankhuster/modules,sebbrudzinski/modules,wstrzelczyk/modules,ScottKimball/modules,pmuchowski/modules,1stmateusz/modules,koshalt/modules,wstrzelczyk/modules,pmuchowski/modules,ScottKimball/modules,shubhambeehyv/modules,shubhambeehyv/modules,shubhambeehyv/modules,martokarski/modules,pgesek/modules,atish160384/modules,tstalka/modules,smalecki/modules,mkwiatkowskisoldevelo/modules,martokarski/modules,smalecki/modules,tstalka/modules,wstrzelczyk/modules | java | ## Code Before:
package org.motechproject.eventlogging.service;
import org.motechproject.eventlogging.domain.EventLog;
import org.motechproject.mds.annotations.Lookup;
import org.motechproject.mds.service.MotechDataService;
import java.util.List;
/**
* Motech Data Service interface for {@link EventLog}s. The implementation is generated
* and injected by the MDS module.
*/
public interface EventLogService extends MotechDataService<EventLog> {
/**
* Finds all recorded events with the given subject
* @param name A subject to filter by
* @return A collection of all recorded events with the given subject.
*/
@Lookup
List<EventLog> findBySubject(String name);
}
## Instruction:
MOTECH-1040: Support for collection fields in lookups
This commit adds support for collection fields in lookups. For now there
will be possible to create a lookup that will find instances for which
passed value will be inside collection field.
For example assume that there is a User class with roles field that have
java.util.List type. Before these changes a developer could not create a
lookup that will find a users that have the given role. Currently, there
is a possibility.
Change-Id: Ibf7c18c142f7794a304732eb9c52aaef8abd5e6f
## Code After:
package org.motechproject.eventlogging.service;
import org.motechproject.eventlogging.domain.EventLog;
import org.motechproject.mds.annotations.Lookup;
import org.motechproject.mds.annotations.LookupField;
import org.motechproject.mds.service.MotechDataService;
import java.util.List;
/**
* Motech Data Service interface for {@link EventLog}s. The implementation is generated
* and injected by the MDS module.
*/
public interface EventLogService extends MotechDataService<EventLog> {
/**
* Finds all recorded events with the given subject
* @param name A subject to filter by
* @return A collection of all recorded events with the given subject.
*/
@Lookup
List<EventLog> findBySubject(@LookupField(name = "subject") String name);
}
| package org.motechproject.eventlogging.service;
import org.motechproject.eventlogging.domain.EventLog;
import org.motechproject.mds.annotations.Lookup;
+ import org.motechproject.mds.annotations.LookupField;
import org.motechproject.mds.service.MotechDataService;
import java.util.List;
/**
* Motech Data Service interface for {@link EventLog}s. The implementation is generated
* and injected by the MDS module.
*/
public interface EventLogService extends MotechDataService<EventLog> {
/**
* Finds all recorded events with the given subject
* @param name A subject to filter by
* @return A collection of all recorded events with the given subject.
*/
@Lookup
- List<EventLog> findBySubject(String name);
+ List<EventLog> findBySubject(@LookupField(name = "subject") String name);
} | 3 | 0.130435 | 2 | 1 |
1df9e5482dab15f9d86ca67692c6436c4f3672cf | appveyor.yml | appveyor.yml | version: 1.0.{build}
image: Visual Studio 2015
before_build:
- nuget restore CSharpMonad.sln
build:
project: CSharpMonad.sln
verbosity: minimal
test: off
artifacts:
- path: CSharpMonad\lib
name: DLL
type: zip
| version: 1.0.{build}
image: Visual Studio 2015
before_build:
- nuget restore CSharpMonad.sln
build:
project: CSharpMonad.sln
verbosity: minimal
configuration:
- Release
test: off
artifacts:
- path: CSharpMonad\bin\Release
name: DLL
type: zip
| Update artifact config and build in Release | Update artifact config and build in Release
| YAML | mit | dambrisco/csharp-monad | yaml | ## Code Before:
version: 1.0.{build}
image: Visual Studio 2015
before_build:
- nuget restore CSharpMonad.sln
build:
project: CSharpMonad.sln
verbosity: minimal
test: off
artifacts:
- path: CSharpMonad\lib
name: DLL
type: zip
## Instruction:
Update artifact config and build in Release
## Code After:
version: 1.0.{build}
image: Visual Studio 2015
before_build:
- nuget restore CSharpMonad.sln
build:
project: CSharpMonad.sln
verbosity: minimal
configuration:
- Release
test: off
artifacts:
- path: CSharpMonad\bin\Release
name: DLL
type: zip
| version: 1.0.{build}
image: Visual Studio 2015
before_build:
- nuget restore CSharpMonad.sln
build:
project: CSharpMonad.sln
verbosity: minimal
+ configuration:
+ - Release
test: off
artifacts:
- - path: CSharpMonad\lib
? ^^
+ - path: CSharpMonad\bin\Release
? ++++++ ^^^^
name: DLL
type: zip | 4 | 0.333333 | 3 | 1 |
cd24a2051ad5e7fdf51cbf519d4bbde687a0bed4 | allure-e2e/src/test/java/ru/yandex/qatools/allure/e2e/AllureCommonPageTest.java | allure-e2e/src/test/java/ru/yandex/qatools/allure/e2e/AllureCommonPageTest.java | package ru.yandex.qatools.allure.e2e;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
/**
* @author Artem Eroshenko eroshenkoam@yandex-team.ru
* Date: 1/24/14
*/
public class AllureCommonPageTest {
@Test
public void sampleTitleTest() {
WebDriver driver = new PhantomJSDriver(DesiredCapabilities.firefox());
driver.get("http://0.0.0.0:8080/e2e");
assertThat(driver.getTitle(), equalTo("Allure Dashboard"));
}
}
| package ru.yandex.qatools.allure.e2e;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
/**
* @author Artem Eroshenko eroshenkoam@yandex-team.ru
* Date: 1/24/14
*/
public class AllureCommonPageTest {
@Test
public void sampleTitleTest() {
WebDriver driver = new PhantomJSDriver(DesiredCapabilities.firefox());
driver.get("http://0.0.0.0:8080/e2e/index.html");
assertThat(driver.getTitle(), equalTo("Allure Dashboard"));
}
}
| Fix allure report path in test | Fix allure report path in test
| Java | apache-2.0 | wuhuizuo/allure-core,allure-framework/allure1,allure-framework/allure-core,allure-framework/allure-core,wuhuizuo/allure-core,allure-framework/allure1,allure-framework/allure-core,allure-framework/allure-core,wuhuizuo/allure-core,allure-framework/allure1,wuhuizuo/allure-core,allure-framework/allure1 | java | ## Code Before:
package ru.yandex.qatools.allure.e2e;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
/**
* @author Artem Eroshenko eroshenkoam@yandex-team.ru
* Date: 1/24/14
*/
public class AllureCommonPageTest {
@Test
public void sampleTitleTest() {
WebDriver driver = new PhantomJSDriver(DesiredCapabilities.firefox());
driver.get("http://0.0.0.0:8080/e2e");
assertThat(driver.getTitle(), equalTo("Allure Dashboard"));
}
}
## Instruction:
Fix allure report path in test
## Code After:
package ru.yandex.qatools.allure.e2e;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
/**
* @author Artem Eroshenko eroshenkoam@yandex-team.ru
* Date: 1/24/14
*/
public class AllureCommonPageTest {
@Test
public void sampleTitleTest() {
WebDriver driver = new PhantomJSDriver(DesiredCapabilities.firefox());
driver.get("http://0.0.0.0:8080/e2e/index.html");
assertThat(driver.getTitle(), equalTo("Allure Dashboard"));
}
}
| package ru.yandex.qatools.allure.e2e;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.phantomjs.PhantomJSDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
/**
* @author Artem Eroshenko eroshenkoam@yandex-team.ru
* Date: 1/24/14
*/
public class AllureCommonPageTest {
@Test
public void sampleTitleTest() {
WebDriver driver = new PhantomJSDriver(DesiredCapabilities.firefox());
- driver.get("http://0.0.0.0:8080/e2e");
+ driver.get("http://0.0.0.0:8080/e2e/index.html");
? +++++++++++
assertThat(driver.getTitle(), equalTo("Allure Dashboard"));
}
} | 2 | 0.086957 | 1 | 1 |
99ac2d15090c1c3c64e5fadd09735457301145ad | index.md | index.md | ---
layout: home
excerpt: "A minimal Jekyll theme for your blog by designer Michael Rose."
tags: [Jekyll, theme, responsive, blog, template]
image:
feature: sample-image-1.jpg
---
| ---
layout: home
excerpt: "Blog by James Riley on Web Development (Ruby, Javascript and friends) and Language Learning"
tags: [ruby, javascript, programming, web dev, languages, malayalam]
---
| Update of description for homepage | Update of description for homepage
| Markdown | mit | mrjamesriley/mrjamesriley.github.io,mrjamesriley/mrjamesriley.github.io,mrjamesriley/mrjamesriley.github.io | markdown | ## Code Before:
---
layout: home
excerpt: "A minimal Jekyll theme for your blog by designer Michael Rose."
tags: [Jekyll, theme, responsive, blog, template]
image:
feature: sample-image-1.jpg
---
## Instruction:
Update of description for homepage
## Code After:
---
layout: home
excerpt: "Blog by James Riley on Web Development (Ruby, Javascript and friends) and Language Learning"
tags: [ruby, javascript, programming, web dev, languages, malayalam]
---
| ---
layout: home
+ excerpt: "Blog by James Riley on Web Development (Ruby, Javascript and friends) and Language Learning"
+ tags: [ruby, javascript, programming, web dev, languages, malayalam]
- excerpt: "A minimal Jekyll theme for your blog by designer Michael Rose."
- tags: [Jekyll, theme, responsive, blog, template]
- image:
- feature: sample-image-1.jpg
--- | 6 | 0.857143 | 2 | 4 |
868f494f4990918bae6920023d523504272eb08f | README.md | README.md |
FAKE targets for getting projects off the ground ASAP
### Installation
```
Install-Package FSharp.FakeTargets
```
|
FAKE targets for getting projects off the ground ASAP
### Installation
```
Install-Package FSharp.FakeTargets
```
### Usage
Your `build.fsx` file might look like the following if you are using `NuGet` as your package manager.
```fsx
#r @"packages/FAKE/tools/FakeLib.dll"
#r @"packages/FSharp.FakeTargets/tools/FSharpFakeTargets.dll"
open Fake
let private _overrideConfig (parameters : datNET.Targets.ConfigParams) =
{ parameters with
Project = "PigsCanFly"
Authors = [ "Tom"; "Jerry" ]
Description = "A library to let your pigs fly."
WorkingDir = "bin"
OutputPath = "bin"
Publish = true
AccessKey = "Your secret nuget api key here"
}
datNET.Targets.initialize _overrideConfig
Target "RestorePackages" (fun _ ->
"PigCanFly.sln"
|> Seq.head
|> RestoreMSSolutionPackages (fun p ->
{ p with
Sources = ["https://nuget.org/api/v2"]
OutputPath = "packages"
Retries = 4
}
)
)
"MSBuild" <== ["Clean"; "RestorePackages"]
"Test" <== ["MSBuild"]
"Package" <== ["MSBuild"]
"Publish" <== ["Package"]
RunTargetOrDefault "MSBuild"
```
| Add example build.fsx to readme | Add example build.fsx to readme
| Markdown | mit | datNET/fs-fake-targets | markdown | ## Code Before:
FAKE targets for getting projects off the ground ASAP
### Installation
```
Install-Package FSharp.FakeTargets
```
## Instruction:
Add example build.fsx to readme
## Code After:
FAKE targets for getting projects off the ground ASAP
### Installation
```
Install-Package FSharp.FakeTargets
```
### Usage
Your `build.fsx` file might look like the following if you are using `NuGet` as your package manager.
```fsx
#r @"packages/FAKE/tools/FakeLib.dll"
#r @"packages/FSharp.FakeTargets/tools/FSharpFakeTargets.dll"
open Fake
let private _overrideConfig (parameters : datNET.Targets.ConfigParams) =
{ parameters with
Project = "PigsCanFly"
Authors = [ "Tom"; "Jerry" ]
Description = "A library to let your pigs fly."
WorkingDir = "bin"
OutputPath = "bin"
Publish = true
AccessKey = "Your secret nuget api key here"
}
datNET.Targets.initialize _overrideConfig
Target "RestorePackages" (fun _ ->
"PigCanFly.sln"
|> Seq.head
|> RestoreMSSolutionPackages (fun p ->
{ p with
Sources = ["https://nuget.org/api/v2"]
OutputPath = "packages"
Retries = 4
}
)
)
"MSBuild" <== ["Clean"; "RestorePackages"]
"Test" <== ["MSBuild"]
"Package" <== ["MSBuild"]
"Publish" <== ["Package"]
RunTargetOrDefault "MSBuild"
```
|
FAKE targets for getting projects off the ground ASAP
### Installation
```
Install-Package FSharp.FakeTargets
```
+
+ ### Usage
+
+ Your `build.fsx` file might look like the following if you are using `NuGet` as your package manager.
+
+ ```fsx
+ #r @"packages/FAKE/tools/FakeLib.dll"
+ #r @"packages/FSharp.FakeTargets/tools/FSharpFakeTargets.dll"
+
+ open Fake
+
+ let private _overrideConfig (parameters : datNET.Targets.ConfigParams) =
+ { parameters with
+ Project = "PigsCanFly"
+ Authors = [ "Tom"; "Jerry" ]
+ Description = "A library to let your pigs fly."
+ WorkingDir = "bin"
+ OutputPath = "bin"
+ Publish = true
+ AccessKey = "Your secret nuget api key here"
+ }
+
+ datNET.Targets.initialize _overrideConfig
+
+ Target "RestorePackages" (fun _ ->
+ "PigCanFly.sln"
+ |> Seq.head
+ |> RestoreMSSolutionPackages (fun p ->
+ { p with
+ Sources = ["https://nuget.org/api/v2"]
+ OutputPath = "packages"
+ Retries = 4
+ }
+ )
+ )
+
+ "MSBuild" <== ["Clean"; "RestorePackages"]
+ "Test" <== ["MSBuild"]
+ "Package" <== ["MSBuild"]
+ "Publish" <== ["Package"]
+
+ RunTargetOrDefault "MSBuild"
+ ``` | 43 | 5.375 | 43 | 0 |
1f08f7dba88babf865f2674fdcfba915ba23e11d | website/docs/language/functions/trim.html.md | website/docs/language/functions/trim.html.md | ---
layout: "language"
page_title: "trim - Functions - Configuration Language"
sidebar_current: "docs-funcs-string-trim"
description: |-
The trim function removes the specified characters from the start and end of
a given string.
---
# `trim` Function
`trim` removes the specified characters from the start and end of the given
string.
## Examples
```
> trim("?!hello?!", "!?")
hello
```
## Related Functions
* [`trimprefix`](./trimprefix.html) removes a word from the start of a string.
* [`trimsuffix`](./trimsuffix.html) removes a word from the end of a string.
* [`trimspace`](./trimspace.html) removes all types of whitespace from
both the start and the end of a string.
| ---
layout: "language"
page_title: "trim - Functions - Configuration Language"
sidebar_current: "docs-funcs-string-trim"
description: |-
The trim function removes the specified set of characters from the start and end of
a given string.
---
# `trim` Function
`trim` removes the specified set of characters from the start and end of the given
string.
```hcl
trim(string, str_character_set)
```
Every occurrence of a character in the second argument is removed from the start
and end of the string specified in the first argument.
## Examples
```
> trim("?!hello?!", "!?")
"hello"
> trim("foobar", "far")
"oob"
> trim(" hello! world.! ", "! ")
"hello! world."
```
## Related Functions
* [`trimprefix`](./trimprefix.html) removes a word from the start of a string.
* [`trimsuffix`](./trimsuffix.html) removes a word from the end of a string.
* [`trimspace`](./trimspace.html) removes all types of whitespace from
both the start and the end of a string.
| Clarify the way the trim() function works and add some more examples | Clarify the way the trim() function works and add some more examples
| Markdown | mpl-2.0 | rnaveiras/terraform,rnaveiras/terraform,tommynsong/terraform,hashicorp/terraform,hashicorp/terraform,tommynsong/terraform,hashicorp/terraform,tommynsong/terraform,rnaveiras/terraform | markdown | ## Code Before:
---
layout: "language"
page_title: "trim - Functions - Configuration Language"
sidebar_current: "docs-funcs-string-trim"
description: |-
The trim function removes the specified characters from the start and end of
a given string.
---
# `trim` Function
`trim` removes the specified characters from the start and end of the given
string.
## Examples
```
> trim("?!hello?!", "!?")
hello
```
## Related Functions
* [`trimprefix`](./trimprefix.html) removes a word from the start of a string.
* [`trimsuffix`](./trimsuffix.html) removes a word from the end of a string.
* [`trimspace`](./trimspace.html) removes all types of whitespace from
both the start and the end of a string.
## Instruction:
Clarify the way the trim() function works and add some more examples
## Code After:
---
layout: "language"
page_title: "trim - Functions - Configuration Language"
sidebar_current: "docs-funcs-string-trim"
description: |-
The trim function removes the specified set of characters from the start and end of
a given string.
---
# `trim` Function
`trim` removes the specified set of characters from the start and end of the given
string.
```hcl
trim(string, str_character_set)
```
Every occurrence of a character in the second argument is removed from the start
and end of the string specified in the first argument.
## Examples
```
> trim("?!hello?!", "!?")
"hello"
> trim("foobar", "far")
"oob"
> trim(" hello! world.! ", "! ")
"hello! world."
```
## Related Functions
* [`trimprefix`](./trimprefix.html) removes a word from the start of a string.
* [`trimsuffix`](./trimsuffix.html) removes a word from the end of a string.
* [`trimspace`](./trimspace.html) removes all types of whitespace from
both the start and the end of a string.
| ---
layout: "language"
page_title: "trim - Functions - Configuration Language"
sidebar_current: "docs-funcs-string-trim"
description: |-
- The trim function removes the specified characters from the start and end of
+ The trim function removes the specified set of characters from the start and end of
? +++++++
a given string.
---
# `trim` Function
- `trim` removes the specified characters from the start and end of the given
+ `trim` removes the specified set of characters from the start and end of the given
? +++++++
string.
+
+ ```hcl
+ trim(string, str_character_set)
+ ```
+
+ Every occurrence of a character in the second argument is removed from the start
+ and end of the string specified in the first argument.
## Examples
```
> trim("?!hello?!", "!?")
- hello
+ "hello"
? + +
+
+ > trim("foobar", "far")
+ "oob"
+
+ > trim(" hello! world.! ", "! ")
+ "hello! world."
```
## Related Functions
* [`trimprefix`](./trimprefix.html) removes a word from the start of a string.
* [`trimsuffix`](./trimsuffix.html) removes a word from the end of a string.
* [`trimspace`](./trimspace.html) removes all types of whitespace from
both the start and the end of a string. | 19 | 0.703704 | 16 | 3 |
67ba39eb790d8c7baaf51025dd101bcc9cf2190c | server/Queue/getQueue.js | server/Queue/getQueue.js | const db = require('sqlite')
const squel = require('squel')
async function getQueue (roomId) {
const result = []
const entities = {}
try {
const q = squel.select()
.field('queueId, mediaId, userId')
.field('media.title, media.duration, media.provider, users.name AS username, artists.name AS artist')
.from('queue')
.join('users USING(userId)')
.join('media USING(mediaId)')
.join('artists USING (artistId)')
.where('roomId = ?', roomId)
.order('queueId')
const { text, values } = q.toParam()
const rows = await db.all(text, values)
for (const row of rows) {
result.push(row.queueId)
entities[row.queueId] = row
}
} catch (err) {
return Promise.reject(err)
}
return { result, entities }
}
module.exports = getQueue
| const db = require('sqlite')
const squel = require('squel')
async function getQueue (roomId) {
const result = []
const entities = {}
try {
const q = squel.select()
.field('queueId, mediaId, userId')
.field('media.title, media.duration, media.provider, media.providerData')
.field('users.name AS username, artists.name AS artist')
.from('queue')
.join('users USING(userId)')
.join('media USING(mediaId)')
.join('artists USING (artistId)')
.where('roomId = ?', roomId)
.order('queueId')
const { text, values } = q.toParam()
const rows = await db.all(text, values)
for (const row of rows) {
result.push(row.queueId)
row.providerData = JSON.parse(row.providerData)
entities[row.queueId] = row
}
} catch (err) {
return Promise.reject(err)
}
return { result, entities }
}
module.exports = getQueue
| Include providerData for queue items | Include providerData for queue items
| JavaScript | isc | bhj/karaoke-forever,bhj/karaoke-forever | javascript | ## Code Before:
const db = require('sqlite')
const squel = require('squel')
async function getQueue (roomId) {
const result = []
const entities = {}
try {
const q = squel.select()
.field('queueId, mediaId, userId')
.field('media.title, media.duration, media.provider, users.name AS username, artists.name AS artist')
.from('queue')
.join('users USING(userId)')
.join('media USING(mediaId)')
.join('artists USING (artistId)')
.where('roomId = ?', roomId)
.order('queueId')
const { text, values } = q.toParam()
const rows = await db.all(text, values)
for (const row of rows) {
result.push(row.queueId)
entities[row.queueId] = row
}
} catch (err) {
return Promise.reject(err)
}
return { result, entities }
}
module.exports = getQueue
## Instruction:
Include providerData for queue items
## Code After:
const db = require('sqlite')
const squel = require('squel')
async function getQueue (roomId) {
const result = []
const entities = {}
try {
const q = squel.select()
.field('queueId, mediaId, userId')
.field('media.title, media.duration, media.provider, media.providerData')
.field('users.name AS username, artists.name AS artist')
.from('queue')
.join('users USING(userId)')
.join('media USING(mediaId)')
.join('artists USING (artistId)')
.where('roomId = ?', roomId)
.order('queueId')
const { text, values } = q.toParam()
const rows = await db.all(text, values)
for (const row of rows) {
result.push(row.queueId)
row.providerData = JSON.parse(row.providerData)
entities[row.queueId] = row
}
} catch (err) {
return Promise.reject(err)
}
return { result, entities }
}
module.exports = getQueue
| const db = require('sqlite')
const squel = require('squel')
async function getQueue (roomId) {
const result = []
const entities = {}
try {
const q = squel.select()
.field('queueId, mediaId, userId')
- .field('media.title, media.duration, media.provider, users.name AS username, artists.name AS artist')
+ .field('media.title, media.duration, media.provider, media.providerData')
+ .field('users.name AS username, artists.name AS artist')
.from('queue')
.join('users USING(userId)')
.join('media USING(mediaId)')
.join('artists USING (artistId)')
.where('roomId = ?', roomId)
.order('queueId')
const { text, values } = q.toParam()
const rows = await db.all(text, values)
for (const row of rows) {
result.push(row.queueId)
+ row.providerData = JSON.parse(row.providerData)
entities[row.queueId] = row
}
} catch (err) {
return Promise.reject(err)
}
return { result, entities }
}
module.exports = getQueue | 4 | 0.121212 | 3 | 1 |
190fa574fc1f50d96ad3c83a73722524bc7ab0db | install_intellij_idea.sh | install_intellij_idea.sh |
apt-get -y install build-essential
apt-get -y install devscripts
apt-get -y install debhelper
git clone -b "2017.2" git://github.com/stefanbirkner/intellij-idea-dpkg.git
cd intellij-idea-dpkg
./build-package -f IU -p debian -u
dpkg -i repository/debian/intellij-idea-iu-*.deb
echo "JDK_HOME=/usr/lib/jvm/java-8-oracle" > /etc/default/idea
echo "M2_HOME=/usr/share/maven" >> /etc/default/idea
cd ..
rm -r intellij-idea-dpkg
|
apt-get -y install build-essential
apt-get -y install devscripts
apt-get -y install debhelper
git clone git://github.com/stefanbirkner/jetbrains-dpkg.git
cd jetbrains-dpkg
./build-package -p idea-iu
dpkg -i repository/debian/pool/idea-iu-*.deb
echo "JDK_HOME=/usr/lib/jvm/java-8-oracle" > /etc/default/idea
echo "M2_HOME=/usr/share/maven" >> /etc/default/idea
cd ..
rm -r jetbrains-dpkg
| Use jetbrains-dpkg for installing IntelliJ IDEA | Use jetbrains-dpkg for installing IntelliJ IDEA
According to its author this is the successor of intellij-idea-dpkg.
| Shell | mit | stefanbirkner/sfb-machine | shell | ## Code Before:
apt-get -y install build-essential
apt-get -y install devscripts
apt-get -y install debhelper
git clone -b "2017.2" git://github.com/stefanbirkner/intellij-idea-dpkg.git
cd intellij-idea-dpkg
./build-package -f IU -p debian -u
dpkg -i repository/debian/intellij-idea-iu-*.deb
echo "JDK_HOME=/usr/lib/jvm/java-8-oracle" > /etc/default/idea
echo "M2_HOME=/usr/share/maven" >> /etc/default/idea
cd ..
rm -r intellij-idea-dpkg
## Instruction:
Use jetbrains-dpkg for installing IntelliJ IDEA
According to its author this is the successor of intellij-idea-dpkg.
## Code After:
apt-get -y install build-essential
apt-get -y install devscripts
apt-get -y install debhelper
git clone git://github.com/stefanbirkner/jetbrains-dpkg.git
cd jetbrains-dpkg
./build-package -p idea-iu
dpkg -i repository/debian/pool/idea-iu-*.deb
echo "JDK_HOME=/usr/lib/jvm/java-8-oracle" > /etc/default/idea
echo "M2_HOME=/usr/share/maven" >> /etc/default/idea
cd ..
rm -r jetbrains-dpkg
|
apt-get -y install build-essential
apt-get -y install devscripts
apt-get -y install debhelper
- git clone -b "2017.2" git://github.com/stefanbirkner/intellij-idea-dpkg.git
? ------------ ^^^^^^^^^^^
+ git clone git://github.com/stefanbirkner/jetbrains-dpkg.git
? ++++++ ^
- cd intellij-idea-dpkg
+ cd jetbrains-dpkg
- ./build-package -f IU -p debian -u
? ------ ^ ----
+ ./build-package -p idea-iu
? + ^^
- dpkg -i repository/debian/intellij-idea-iu-*.deb
? ^^^^ ^^^^
+ dpkg -i repository/debian/pool/idea-iu-*.deb
? ^^^ ^
echo "JDK_HOME=/usr/lib/jvm/java-8-oracle" > /etc/default/idea
echo "M2_HOME=/usr/share/maven" >> /etc/default/idea
cd ..
- rm -r intellij-idea-dpkg
+ rm -r jetbrains-dpkg | 10 | 0.833333 | 5 | 5 |
9253cc8dfa22f23921378afeaa3b7dfb1cd6c9e4 | spec/spec_helper.rb | spec/spec_helper.rb | require 'octoshark'
# Load support files
ROOT = File.expand_path('../', File.dirname(__FILE__))
Dir["#{ROOT}/spec/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
config.include Helpers
config.before :each do
ActiveRecord::Base.establish_connection({adapter: 'sqlite3', database: 'tmp/default.sqlite'})
Octoshark.reset!
end
end
| require 'octoshark'
require 'fileutils'
ROOT = File.expand_path('../', File.dirname(__FILE__))
TMP = 'tmp'
# Load support files
Dir["#{ROOT}/spec/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
config.include Helpers
config.before :suite do
FileUtils.mkdir_p(TMP)
end
config.before :each do
ActiveRecord::Base.establish_connection({adapter: 'sqlite3', database: 'tmp/default.sqlite'})
Octoshark.reset!
end
config.after :suite do
FileUtils.rm_rf(TMP)
end
end
| Create 'tmp' folder before suite | Create 'tmp' folder before suite
| Ruby | mit | dalibor/octoshark | ruby | ## Code Before:
require 'octoshark'
# Load support files
ROOT = File.expand_path('../', File.dirname(__FILE__))
Dir["#{ROOT}/spec/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
config.include Helpers
config.before :each do
ActiveRecord::Base.establish_connection({adapter: 'sqlite3', database: 'tmp/default.sqlite'})
Octoshark.reset!
end
end
## Instruction:
Create 'tmp' folder before suite
## Code After:
require 'octoshark'
require 'fileutils'
ROOT = File.expand_path('../', File.dirname(__FILE__))
TMP = 'tmp'
# Load support files
Dir["#{ROOT}/spec/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
config.include Helpers
config.before :suite do
FileUtils.mkdir_p(TMP)
end
config.before :each do
ActiveRecord::Base.establish_connection({adapter: 'sqlite3', database: 'tmp/default.sqlite'})
Octoshark.reset!
end
config.after :suite do
FileUtils.rm_rf(TMP)
end
end
| require 'octoshark'
+ require 'fileutils'
+ ROOT = File.expand_path('../', File.dirname(__FILE__))
+ TMP = 'tmp'
# Load support files
- ROOT = File.expand_path('../', File.dirname(__FILE__))
Dir["#{ROOT}/spec/support/**/*.rb"].each { |f| require f }
RSpec.configure do |config|
config.include Helpers
+ config.before :suite do
+ FileUtils.mkdir_p(TMP)
+ end
+
config.before :each do
ActiveRecord::Base.establish_connection({adapter: 'sqlite3', database: 'tmp/default.sqlite'})
Octoshark.reset!
end
+
+ config.after :suite do
+ FileUtils.rm_rf(TMP)
+ end
end | 12 | 0.75 | 11 | 1 |
0418a4a2e2cf2dc6e156c880600491691a57c525 | setup.py | setup.py | from setuptools import setup, find_packages
import versioneer
with open('requirements.txt') as f:
requirements = f.read().splitlines()
requirements = ['setuptools'] + requirements
setup(
name='pyxrf',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author='Brookhaven National Laboratory',
url='https://github.com/NSLS-II/PyXRF',
packages=find_packages(),
entry_points={'console_scripts': ['pyxrf = pyxrf.gui:run']},
package_data={'pyxrf.view': ['*.enaml'], 'configs': ['*.json']},
include_package_data=True,
install_requires=requirements,
python_requires='>=3.6',
license='BSD',
classifiers=['Development Status :: 3 - Alpha',
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries",
"Intended Audience :: Science/Research"]
)
| from setuptools import setup, find_packages
import versioneer
with open('requirements.txt') as f:
requirements = f.read().splitlines()
requirements = ['setuptools'] + requirements
setup(
name='pyxrf',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author='Brookhaven National Laboratory',
url='https://github.com/NSLS-II/PyXRF',
packages=find_packages(),
entry_points={'console_scripts': ['pyxrf = pyxrf.gui:run']},
package_data={'pyxrf.view': ['*.enaml'], 'configs': ['*.json'], 'pyxrf.core': ['*.yaml']},
include_package_data=True,
install_requires=requirements,
python_requires='>=3.6',
license='BSD',
classifiers=['Development Status :: 3 - Alpha',
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries",
"Intended Audience :: Science/Research"]
)
| Include YAML data file in the package | Include YAML data file in the package
| Python | bsd-3-clause | NSLS-II-HXN/PyXRF,NSLS-II-HXN/PyXRF,NSLS-II/PyXRF | python | ## Code Before:
from setuptools import setup, find_packages
import versioneer
with open('requirements.txt') as f:
requirements = f.read().splitlines()
requirements = ['setuptools'] + requirements
setup(
name='pyxrf',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author='Brookhaven National Laboratory',
url='https://github.com/NSLS-II/PyXRF',
packages=find_packages(),
entry_points={'console_scripts': ['pyxrf = pyxrf.gui:run']},
package_data={'pyxrf.view': ['*.enaml'], 'configs': ['*.json']},
include_package_data=True,
install_requires=requirements,
python_requires='>=3.6',
license='BSD',
classifiers=['Development Status :: 3 - Alpha',
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries",
"Intended Audience :: Science/Research"]
)
## Instruction:
Include YAML data file in the package
## Code After:
from setuptools import setup, find_packages
import versioneer
with open('requirements.txt') as f:
requirements = f.read().splitlines()
requirements = ['setuptools'] + requirements
setup(
name='pyxrf',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author='Brookhaven National Laboratory',
url='https://github.com/NSLS-II/PyXRF',
packages=find_packages(),
entry_points={'console_scripts': ['pyxrf = pyxrf.gui:run']},
package_data={'pyxrf.view': ['*.enaml'], 'configs': ['*.json'], 'pyxrf.core': ['*.yaml']},
include_package_data=True,
install_requires=requirements,
python_requires='>=3.6',
license='BSD',
classifiers=['Development Status :: 3 - Alpha',
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries",
"Intended Audience :: Science/Research"]
)
| from setuptools import setup, find_packages
import versioneer
with open('requirements.txt') as f:
requirements = f.read().splitlines()
requirements = ['setuptools'] + requirements
setup(
name='pyxrf',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author='Brookhaven National Laboratory',
url='https://github.com/NSLS-II/PyXRF',
packages=find_packages(),
entry_points={'console_scripts': ['pyxrf = pyxrf.gui:run']},
- package_data={'pyxrf.view': ['*.enaml'], 'configs': ['*.json']},
+ package_data={'pyxrf.view': ['*.enaml'], 'configs': ['*.json'], 'pyxrf.core': ['*.yaml']},
? ++++++++++++++++++++++++++
include_package_data=True,
install_requires=requirements,
python_requires='>=3.6',
license='BSD',
classifiers=['Development Status :: 3 - Alpha',
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries",
"Intended Audience :: Science/Research"]
) | 2 | 0.068966 | 1 | 1 |
876de49a9c5d6e2d75714a606238e9041ed49baf | sample/views/booking_day.html | sample/views/booking_day.html | <table class="table">
<thead>
<tr>
<th>Id</th>
<th>Room</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="reservation in between(reservationDate)">
<td>{{reservation.reservationId}}</td>
<td><a ui-sref="room.detail({roomId: reservation.roomId, from: 'booking.day({year:\'2014\', month: \'10\', day: \'14\'})|{{reservationDate.getTime()}}'})">{{getRoom(reservation.roomId).roomNumber}}</a></td>
<td><a ui-sref=".detail({reservationId: reservation.reservationId})" class="btn">View</a></td>
</tr>
</tbody>
</table>
| <table class="table">
<thead>
<tr>
<th>Id</th>
<th>Room</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="reservation in between(reservationDate)">
<td>{{reservation.reservationId}}</td>
<td><a ui-sref="room.detail({roomId: reservation.roomId, from: 'booking.day({year:\'{{reservationDate.getFullYear()}}\', month: \'{{reservationDate.getMonth() + 1}}\', day: \'{{reservationDate.getDate()}}\'})|{{reservationDate.getTime()}}'})">{{getRoom(reservation.roomId).roomNumber}}</a></td>
<td><a ui-sref=".detail({reservationId: reservation.reservationId})" class="btn">View</a></td>
</tr>
</tbody>
</table>
| Send correct url params for the room link in booking view | fix(sample): Send correct url params for the room link in booking view
| HTML | mit | thebigredgeek/angular-breadcrumb,cuiliang/angular-breadcrumb,allwebsites/angular-breadcrumb,allwebsites/angular-breadcrumb,ansgarkroger/angular-breadcrumb,ansgarkroger/angular-breadcrumb,ncuillery/angular-breadcrumb,cuiliang/angular-breadcrumb,zpzgone/angular-breadcrumb,zpzgone/angular-breadcrumb,kazinov/angular-breadcrumb,kazinov/angular-breadcrumb,ncuillery/angular-breadcrumb,thebigredgeek/angular-breadcrumb | html | ## Code Before:
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Room</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="reservation in between(reservationDate)">
<td>{{reservation.reservationId}}</td>
<td><a ui-sref="room.detail({roomId: reservation.roomId, from: 'booking.day({year:\'2014\', month: \'10\', day: \'14\'})|{{reservationDate.getTime()}}'})">{{getRoom(reservation.roomId).roomNumber}}</a></td>
<td><a ui-sref=".detail({reservationId: reservation.reservationId})" class="btn">View</a></td>
</tr>
</tbody>
</table>
## Instruction:
fix(sample): Send correct url params for the room link in booking view
## Code After:
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Room</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="reservation in between(reservationDate)">
<td>{{reservation.reservationId}}</td>
<td><a ui-sref="room.detail({roomId: reservation.roomId, from: 'booking.day({year:\'{{reservationDate.getFullYear()}}\', month: \'{{reservationDate.getMonth() + 1}}\', day: \'{{reservationDate.getDate()}}\'})|{{reservationDate.getTime()}}'})">{{getRoom(reservation.roomId).roomNumber}}</a></td>
<td><a ui-sref=".detail({reservationId: reservation.reservationId})" class="btn">View</a></td>
</tr>
</tbody>
</table>
| <table class="table">
<thead>
<tr>
<th>Id</th>
<th>Room</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="reservation in between(reservationDate)">
<td>{{reservation.reservationId}}</td>
- <td><a ui-sref="room.detail({roomId: reservation.roomId, from: 'booking.day({year:\'2014\', month: \'10\', day: \'14\'})|{{reservationDate.getTime()}}'})">{{getRoom(reservation.roomId).roomNumber}}</a></td>
? ^^ ^ --------------- ^^
+ <td><a ui-sref="room.detail({roomId: reservation.roomId, from: 'booking.day({year:\'{{reservationDate.getFullYear()}}\', month: \'{{reservationDate.getMonth() + 1}}\', day: \'{{reservationDate.getDate()}}\'})|{{reservationDate.getTime()}}'})">{{getRoom(reservation.roomId).roomNumber}}</a></td>
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<td><a ui-sref=".detail({reservationId: reservation.reservationId})" class="btn">View</a></td>
</tr>
</tbody>
</table> | 2 | 0.125 | 1 | 1 |
578747fcae7cd1037d87584b84b68a6b5c0bdd79 | PageCode/_Common.php | PageCode/_Common.php | <?php class _Common_PageCode extends PageCode {
public function go($api, $dom, $template, $tool) {
$main = $dom["body > main"];
if($main->hasAttribute("data-title")) {
$dom["body > header > h1"]->textContent =
$main->getAttribute("data-title");
}
if(PATH === "MainMenu") {
$dom["body > header > nav"]->remove();
}
if(PATH === "Index") {
$dom["body > header"]->remove();
}
}
}# | <?php class _Common_PageCode extends PageCode {
public function go($api, $dom, $template, $tool) {
$main = $dom["body > main"];
if($main->hasAttribute("data-title")) {
$dom["body > header > h1"]->textContent =
$main->getAttribute("data-title");
}
if(PATH === "MainMenu") {
$dom["body > header > nav"]->remove();
}
if(PATH === "Index") {
$dom["body > header"]->remove();
$dom["body"]->removeAttribute("data-pjax");
}
}
}# | Remove pjax from index page | Remove pjax from index page
| PHP | mit | g105b/sass-app,g105b/sass-app | php | ## Code Before:
<?php class _Common_PageCode extends PageCode {
public function go($api, $dom, $template, $tool) {
$main = $dom["body > main"];
if($main->hasAttribute("data-title")) {
$dom["body > header > h1"]->textContent =
$main->getAttribute("data-title");
}
if(PATH === "MainMenu") {
$dom["body > header > nav"]->remove();
}
if(PATH === "Index") {
$dom["body > header"]->remove();
}
}
}#
## Instruction:
Remove pjax from index page
## Code After:
<?php class _Common_PageCode extends PageCode {
public function go($api, $dom, $template, $tool) {
$main = $dom["body > main"];
if($main->hasAttribute("data-title")) {
$dom["body > header > h1"]->textContent =
$main->getAttribute("data-title");
}
if(PATH === "MainMenu") {
$dom["body > header > nav"]->remove();
}
if(PATH === "Index") {
$dom["body > header"]->remove();
$dom["body"]->removeAttribute("data-pjax");
}
}
}# | <?php class _Common_PageCode extends PageCode {
public function go($api, $dom, $template, $tool) {
$main = $dom["body > main"];
if($main->hasAttribute("data-title")) {
$dom["body > header > h1"]->textContent =
$main->getAttribute("data-title");
}
if(PATH === "MainMenu") {
$dom["body > header > nav"]->remove();
}
if(PATH === "Index") {
$dom["body > header"]->remove();
+ $dom["body"]->removeAttribute("data-pjax");
}
}
}# | 1 | 0.058824 | 1 | 0 |
0aad3d2fc9217afa6d0416d1b0e7f3948cd3f145 | appveyor.yml | appveyor.yml | version: 0.7.1-{build}
configuration:
- Release
- Win7 Release
- Win8 Release
- Win 8.1 Release
platform:
- Win32
- x64
os: Windows Server 2012 R2
build:
project: dokan.sln
verbosity: minimal | version: 0.7.1-{build}
configuration:
- Release
- Win7 Release
- Win8 Release
- Win 8.1 Release
platform:
- Win32
- x64
os: Windows Server 2012 R2
build:
project: dokan.sln
verbosity: minimal
notifications:
- provider: Email
to:
- reports@islog.com
on_build_success: false
on_build_failure: false
on_build_status_changed: true | Add email notifications to AppVeyor build | Add email notifications to AppVeyor build
| YAML | mit | superhq/dokany,telum/dokany,DaveWeath/dokany,telum/dokany,superhq/dokany,DaveWeath/dokany | yaml | ## Code Before:
version: 0.7.1-{build}
configuration:
- Release
- Win7 Release
- Win8 Release
- Win 8.1 Release
platform:
- Win32
- x64
os: Windows Server 2012 R2
build:
project: dokan.sln
verbosity: minimal
## Instruction:
Add email notifications to AppVeyor build
## Code After:
version: 0.7.1-{build}
configuration:
- Release
- Win7 Release
- Win8 Release
- Win 8.1 Release
platform:
- Win32
- x64
os: Windows Server 2012 R2
build:
project: dokan.sln
verbosity: minimal
notifications:
- provider: Email
to:
- reports@islog.com
on_build_success: false
on_build_failure: false
on_build_status_changed: true | version: 0.7.1-{build}
configuration:
- Release
- Win7 Release
- Win8 Release
- Win 8.1 Release
platform:
- Win32
- x64
os: Windows Server 2012 R2
build:
project: dokan.sln
verbosity: minimal
+ notifications:
+ - provider: Email
+ to:
+ - reports@islog.com
+ on_build_success: false
+ on_build_failure: false
+ on_build_status_changed: true | 7 | 0.538462 | 7 | 0 |
5f40096f509a3051c788a8a1b3d5c6a3049070fc | app/importers/rows/student_section_grade_row.rb | app/importers/rows/student_section_grade_row.rb | class StudentSectionGradeRow < Struct.new(:row, :school_ids_dictionary)
# Represents a row in a CSV export from Somerville's Aspen X2 student information system.
# This structure represents student section grades.
#
# Expects the following headers:
#
# :section_number, :student_local_id, :school_local_id, :course_number,
# :term_local_id, :grade
#
# Eventually this will also include the letter grade for graded courses
def self.build(row)
new(row).build
end
def build
if student and section
student_section_assignment = StudentSectionAssignment.find_or_initialize_by(student: student,
section: section)
student_section_assignment.assign_attributes(
grade: row[:grade]
)
student_section_assignment
end
end
def student
return Student.find_by_local_id(row[:student_local_id]) if row[:student_local_id]
end
def section
return Section.find_by_section_number(row[:section_number]) if row[:section_number]
end
end
| class StudentSectionGradeRow < Struct.new(:row, :school_ids_dictionary)
# Represents a row in a CSV export from Somerville's Aspen X2 student information system.
# This structure represents student section grades.
#
# Expects the following headers:
#
# :section_number, :student_local_id, :school_local_id, :course_number,
# :term_local_id, :grade
#
# Eventually this will also include the letter grade for graded courses
def self.build(row)
new(row).build
end
def build
if student and section
student_section_assignment = StudentSectionAssignment.find_or_initialize_by(student: student,
section: section)
student_section_assignment.assign_attributes(
grade: grade
)
student_section_assignment
end
end
def student
return Student.find_by_local_id(row[:student_local_id]) if row[:student_local_id]
end
def section
return Section.find_by_section_number(row[:section_number]) if row[:section_number]
end
def grade
return row[:grade] if row[:grade].is_a? Integer
end
end | Add check for grade being an integer | Add check for grade being an integer
| Ruby | mit | studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights | ruby | ## Code Before:
class StudentSectionGradeRow < Struct.new(:row, :school_ids_dictionary)
# Represents a row in a CSV export from Somerville's Aspen X2 student information system.
# This structure represents student section grades.
#
# Expects the following headers:
#
# :section_number, :student_local_id, :school_local_id, :course_number,
# :term_local_id, :grade
#
# Eventually this will also include the letter grade for graded courses
def self.build(row)
new(row).build
end
def build
if student and section
student_section_assignment = StudentSectionAssignment.find_or_initialize_by(student: student,
section: section)
student_section_assignment.assign_attributes(
grade: row[:grade]
)
student_section_assignment
end
end
def student
return Student.find_by_local_id(row[:student_local_id]) if row[:student_local_id]
end
def section
return Section.find_by_section_number(row[:section_number]) if row[:section_number]
end
end
## Instruction:
Add check for grade being an integer
## Code After:
class StudentSectionGradeRow < Struct.new(:row, :school_ids_dictionary)
# Represents a row in a CSV export from Somerville's Aspen X2 student information system.
# This structure represents student section grades.
#
# Expects the following headers:
#
# :section_number, :student_local_id, :school_local_id, :course_number,
# :term_local_id, :grade
#
# Eventually this will also include the letter grade for graded courses
def self.build(row)
new(row).build
end
def build
if student and section
student_section_assignment = StudentSectionAssignment.find_or_initialize_by(student: student,
section: section)
student_section_assignment.assign_attributes(
grade: grade
)
student_section_assignment
end
end
def student
return Student.find_by_local_id(row[:student_local_id]) if row[:student_local_id]
end
def section
return Section.find_by_section_number(row[:section_number]) if row[:section_number]
end
def grade
return row[:grade] if row[:grade].is_a? Integer
end
end | class StudentSectionGradeRow < Struct.new(:row, :school_ids_dictionary)
# Represents a row in a CSV export from Somerville's Aspen X2 student information system.
# This structure represents student section grades.
#
# Expects the following headers:
#
# :section_number, :student_local_id, :school_local_id, :course_number,
# :term_local_id, :grade
#
# Eventually this will also include the letter grade for graded courses
def self.build(row)
new(row).build
end
def build
if student and section
student_section_assignment = StudentSectionAssignment.find_or_initialize_by(student: student,
section: section)
student_section_assignment.assign_attributes(
- grade: row[:grade]
? ----- -
+ grade: grade
)
student_section_assignment
end
end
def student
return Student.find_by_local_id(row[:student_local_id]) if row[:student_local_id]
end
def section
return Section.find_by_section_number(row[:section_number]) if row[:section_number]
end
+ def grade
+ return row[:grade] if row[:grade].is_a? Integer
+ end
end | 5 | 0.142857 | 4 | 1 |
ef86ea4a78c6a617c9872762e86198cad7d0a50e | setup.py | setup.py |
from setuptools import setup
# lets prepare our initial setup
setup_dict = {'name': 'PYSCSI',
'version': '1.0',
'license': 'LGPLv2.1',
'author': 'Ronnie Sahlberg',
'author_email': 'ronniesahlberg@gmail.com',
'description': 'Module for calling SCSI devices from Python',
'packages': ['pyscsi', 'pyscsi.pyscsi', 'pyscsi.pyiscsi', 'pyscsi.utils'],
'python_requires': '~=3.7',
'extras_require': {'sgio': ['cython-sgio'],
'iscsi': ['cython-iscsi'],
},
}
setup(**setup_dict)
|
from setuptools import find_packages, setup
# lets prepare our initial setup
setup_dict = {'name': 'PYSCSI',
'version': '1.0',
'license': 'LGPLv2.1',
'author': 'Ronnie Sahlberg',
'author_email': 'ronniesahlberg@gmail.com',
'description': 'Module for calling SCSI devices from Python',
'packages': find_packages(),
'python_requires': '~=3.7',
'extras_require': {'sgio': ['cython-sgio'],
'iscsi': ['cython-iscsi'],
},
}
setup(**setup_dict)
| Use find_packages instead of listing them manually. | Use find_packages instead of listing them manually.
| Python | lgpl-2.1 | rosjat/python-scsi | python | ## Code Before:
from setuptools import setup
# lets prepare our initial setup
setup_dict = {'name': 'PYSCSI',
'version': '1.0',
'license': 'LGPLv2.1',
'author': 'Ronnie Sahlberg',
'author_email': 'ronniesahlberg@gmail.com',
'description': 'Module for calling SCSI devices from Python',
'packages': ['pyscsi', 'pyscsi.pyscsi', 'pyscsi.pyiscsi', 'pyscsi.utils'],
'python_requires': '~=3.7',
'extras_require': {'sgio': ['cython-sgio'],
'iscsi': ['cython-iscsi'],
},
}
setup(**setup_dict)
## Instruction:
Use find_packages instead of listing them manually.
## Code After:
from setuptools import find_packages, setup
# lets prepare our initial setup
setup_dict = {'name': 'PYSCSI',
'version': '1.0',
'license': 'LGPLv2.1',
'author': 'Ronnie Sahlberg',
'author_email': 'ronniesahlberg@gmail.com',
'description': 'Module for calling SCSI devices from Python',
'packages': find_packages(),
'python_requires': '~=3.7',
'extras_require': {'sgio': ['cython-sgio'],
'iscsi': ['cython-iscsi'],
},
}
setup(**setup_dict)
|
- from setuptools import setup
+ from setuptools import find_packages, setup
? +++++++++++++++
# lets prepare our initial setup
setup_dict = {'name': 'PYSCSI',
'version': '1.0',
'license': 'LGPLv2.1',
'author': 'Ronnie Sahlberg',
'author_email': 'ronniesahlberg@gmail.com',
'description': 'Module for calling SCSI devices from Python',
- 'packages': ['pyscsi', 'pyscsi.pyscsi', 'pyscsi.pyiscsi', 'pyscsi.utils'],
+ 'packages': find_packages(),
'python_requires': '~=3.7',
'extras_require': {'sgio': ['cython-sgio'],
'iscsi': ['cython-iscsi'],
},
}
setup(**setup_dict) | 4 | 0.222222 | 2 | 2 |
668b6b2560d2ca7110b22087316f820d31524ff9 | whelktool/scripts/cleanups/2019/02/move-holding-Jox-to-Jo/move-jox-holdings.groovy | whelktool/scripts/cleanups/2019/02/move-holding-Jox-to-Jo/move-jox-holdings.groovy | /*
* This moves all holdings for Jox to Jo.
*
* See LXL-2248 for more info.
*
*/
String CURRENT_SIGEL = 'https://libris.kb.se/library/Jox'
String NEW_SIGEL = 'https://libris.kb.se/library/Jo'
PrintWriter scheduledForMove = getReportWriter("scheduled-for-move")
PrintWriter notMoved = getReportWriter("refused-to-move")
selectBySqlWhere("""
collection = 'hold' AND
data#>>'{@graph,1,heldBy,@id}' = '${CURRENT_SIGEL}'
""", silent: false) { hold ->
def (record, thing) = hold.graph
boolean wouldCreateDupe = false
selectBySqlWhere("""
collection = 'hold' AND
data#>>'{@graph,1,itemOf,@id}' = '${thing["itemOf"][ID]}' AND
data#>>'{@graph,1,heldBy,@id}' = '$NEW_SIGEL'
""", silent: true) { other_hold ->
wouldCreateDupe = true
}
if (wouldCreateDupe) {
notMoved.println("Not moving ${hold.doc.getURI()}, since it would create a duplicate.")
} else {
thing['heldBy']['@id'] = NEW_SIGEL
scheduledForMove.println("${hold.doc.getURI()}")
hold.scheduleSave()
}
}
| /*
* This moves all holdings for Jox to Jo.
*
* See LXL-2248 for more info.
*
*/
String CURRENT_SIGEL = 'https://libris.kb.se/library/Jox'
String NEW_SIGEL = 'https://libris.kb.se/library/Jo'
PrintWriter scheduledForMove = getReportWriter("scheduled-for-move")
PrintWriter notMoved = getReportWriter("refused-to-move")
selectBySqlWhere("""
collection = 'hold' AND
data#>>'{@graph,1,heldBy,@id}' = '${CURRENT_SIGEL}'
""", silent: false) { hold ->
def (record, thing) = hold.graph
boolean wouldCreateDupe = false
selectBySqlWhere("""
collection = 'hold' AND
data#>>'{@graph,1,itemOf,@id}' = '${thing["itemOf"][ID]}' AND
data#>>'{@graph,1,heldBy,@id}' = '$NEW_SIGEL'
""", silent: true) { other_hold ->
wouldCreateDupe = true
}
if (wouldCreateDupe) {
notMoved.println("Not moving ${hold.doc.getURI()}, since it would create a duplicate.")
} else {
thing['heldBy']['@id'] = NEW_SIGEL
scheduledForMove.println("${hold.doc.getURI()}")
hold.scheduleSave(loud: true)
}
}
| Make Jox->Jo holding move loud | Make Jox->Jo holding move loud
| Groovy | apache-2.0 | libris/librisxl,libris/librisxl,libris/librisxl | groovy | ## Code Before:
/*
* This moves all holdings for Jox to Jo.
*
* See LXL-2248 for more info.
*
*/
String CURRENT_SIGEL = 'https://libris.kb.se/library/Jox'
String NEW_SIGEL = 'https://libris.kb.se/library/Jo'
PrintWriter scheduledForMove = getReportWriter("scheduled-for-move")
PrintWriter notMoved = getReportWriter("refused-to-move")
selectBySqlWhere("""
collection = 'hold' AND
data#>>'{@graph,1,heldBy,@id}' = '${CURRENT_SIGEL}'
""", silent: false) { hold ->
def (record, thing) = hold.graph
boolean wouldCreateDupe = false
selectBySqlWhere("""
collection = 'hold' AND
data#>>'{@graph,1,itemOf,@id}' = '${thing["itemOf"][ID]}' AND
data#>>'{@graph,1,heldBy,@id}' = '$NEW_SIGEL'
""", silent: true) { other_hold ->
wouldCreateDupe = true
}
if (wouldCreateDupe) {
notMoved.println("Not moving ${hold.doc.getURI()}, since it would create a duplicate.")
} else {
thing['heldBy']['@id'] = NEW_SIGEL
scheduledForMove.println("${hold.doc.getURI()}")
hold.scheduleSave()
}
}
## Instruction:
Make Jox->Jo holding move loud
## Code After:
/*
* This moves all holdings for Jox to Jo.
*
* See LXL-2248 for more info.
*
*/
String CURRENT_SIGEL = 'https://libris.kb.se/library/Jox'
String NEW_SIGEL = 'https://libris.kb.se/library/Jo'
PrintWriter scheduledForMove = getReportWriter("scheduled-for-move")
PrintWriter notMoved = getReportWriter("refused-to-move")
selectBySqlWhere("""
collection = 'hold' AND
data#>>'{@graph,1,heldBy,@id}' = '${CURRENT_SIGEL}'
""", silent: false) { hold ->
def (record, thing) = hold.graph
boolean wouldCreateDupe = false
selectBySqlWhere("""
collection = 'hold' AND
data#>>'{@graph,1,itemOf,@id}' = '${thing["itemOf"][ID]}' AND
data#>>'{@graph,1,heldBy,@id}' = '$NEW_SIGEL'
""", silent: true) { other_hold ->
wouldCreateDupe = true
}
if (wouldCreateDupe) {
notMoved.println("Not moving ${hold.doc.getURI()}, since it would create a duplicate.")
} else {
thing['heldBy']['@id'] = NEW_SIGEL
scheduledForMove.println("${hold.doc.getURI()}")
hold.scheduleSave(loud: true)
}
}
| /*
* This moves all holdings for Jox to Jo.
*
* See LXL-2248 for more info.
*
*/
String CURRENT_SIGEL = 'https://libris.kb.se/library/Jox'
String NEW_SIGEL = 'https://libris.kb.se/library/Jo'
PrintWriter scheduledForMove = getReportWriter("scheduled-for-move")
PrintWriter notMoved = getReportWriter("refused-to-move")
selectBySqlWhere("""
collection = 'hold' AND
data#>>'{@graph,1,heldBy,@id}' = '${CURRENT_SIGEL}'
""", silent: false) { hold ->
def (record, thing) = hold.graph
boolean wouldCreateDupe = false
selectBySqlWhere("""
collection = 'hold' AND
data#>>'{@graph,1,itemOf,@id}' = '${thing["itemOf"][ID]}' AND
data#>>'{@graph,1,heldBy,@id}' = '$NEW_SIGEL'
""", silent: true) { other_hold ->
wouldCreateDupe = true
}
if (wouldCreateDupe) {
notMoved.println("Not moving ${hold.doc.getURI()}, since it would create a duplicate.")
} else {
thing['heldBy']['@id'] = NEW_SIGEL
scheduledForMove.println("${hold.doc.getURI()}")
- hold.scheduleSave()
+ hold.scheduleSave(loud: true)
? ++++++++++
}
} | 2 | 0.057143 | 1 | 1 |
458979b58df7852cc8a99475e535e4c8d13ee1fa | composer.json | composer.json | {
"name": "mk-j/php_xlsxwriter",
"description": "PHP Library to write XLSX files",
"keywords": ["php", "library","xls", "xlsx", "excel"],
"type": "project",
"homepage": "https://github.com/mk-j/PHP_XLSXWriter",
"license": "MIT",
"autoload": {
"classmap": ["xlsxwriter.class.php"]
},
"require-dev": {
"phpunit/phpunit": "4.3.*"
}
}
| {
"name": "mk-j/php_xlsxwriter",
"description": "PHP Library to write XLSX files",
"keywords": ["php", "library","xls", "xlsx", "excel"],
"type": "project",
"homepage": "https://github.com/mk-j/PHP_XLSXWriter",
"license": "MIT",
"autoload": {
"classmap": ["xlsxwriter.class.php"]
},
"require-dev": {
"phpunit/phpunit": "4.3.*"
}
"require": {
"xrstf/composer-php52": "1.*" //PHP 5.2 Autoloading for Composer
"php": ">=5.2.*" // Min version PHP
},
"scripts": {
"post-install-cmd": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
"post-update-cmd": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
"post-autoload-dump": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
]
}
}
| Add require min version PHP 5.2 and compatibility Composer for PHP 5.2 | Add require min version PHP 5.2 and compatibility Composer for PHP 5.2
Add require min version PHP 5.2 and compatibility Composer for PHP 5.2 | JSON | mit | mk-j/PHP_XLSXWriter,mk-j/PHP_XLSXWriter | json | ## Code Before:
{
"name": "mk-j/php_xlsxwriter",
"description": "PHP Library to write XLSX files",
"keywords": ["php", "library","xls", "xlsx", "excel"],
"type": "project",
"homepage": "https://github.com/mk-j/PHP_XLSXWriter",
"license": "MIT",
"autoload": {
"classmap": ["xlsxwriter.class.php"]
},
"require-dev": {
"phpunit/phpunit": "4.3.*"
}
}
## Instruction:
Add require min version PHP 5.2 and compatibility Composer for PHP 5.2
Add require min version PHP 5.2 and compatibility Composer for PHP 5.2
## Code After:
{
"name": "mk-j/php_xlsxwriter",
"description": "PHP Library to write XLSX files",
"keywords": ["php", "library","xls", "xlsx", "excel"],
"type": "project",
"homepage": "https://github.com/mk-j/PHP_XLSXWriter",
"license": "MIT",
"autoload": {
"classmap": ["xlsxwriter.class.php"]
},
"require-dev": {
"phpunit/phpunit": "4.3.*"
}
"require": {
"xrstf/composer-php52": "1.*" //PHP 5.2 Autoloading for Composer
"php": ">=5.2.*" // Min version PHP
},
"scripts": {
"post-install-cmd": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
"post-update-cmd": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
"post-autoload-dump": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
]
}
}
| {
"name": "mk-j/php_xlsxwriter",
"description": "PHP Library to write XLSX files",
"keywords": ["php", "library","xls", "xlsx", "excel"],
"type": "project",
"homepage": "https://github.com/mk-j/PHP_XLSXWriter",
"license": "MIT",
"autoload": {
"classmap": ["xlsxwriter.class.php"]
},
"require-dev": {
"phpunit/phpunit": "4.3.*"
}
+ "require": {
+ "xrstf/composer-php52": "1.*" //PHP 5.2 Autoloading for Composer
+ "php": ">=5.2.*" // Min version PHP
+ },
+ "scripts": {
+ "post-install-cmd": [
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
+ ],
+ "post-update-cmd": [
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
+ ],
+ "post-autoload-dump": [
+ "xrstf\\Composer52\\Generator::onPostInstallCmd"
+ ]
+ }
} | 15 | 1 | 15 | 0 |
f0e4b1734446a26c44e5431f523e58337767b9a2 | lib/primix/analyzer/tokenizer.rb | lib/primix/analyzer/tokenizer.rb | module Primix
module Analyzer
class Tokenizer
attr_reader :content
def initialize(content)
@content = content
end
def tokenize!
chars = @content.split ""
tokens = []
current_token = ""
chars.each_with_index do |char, index|
case char
when "(", ")", "{", "}", "[", "]", ":", "=", "\"", "-", ">", "." then
tokens << current_token if current_token != ""
tokens << char
current_token = ""
when " ", "\n", "\t" then
tokens << current_token if current_token != ""
current_token = ""
else
current_token << char
end
end
brace_level = 0
tokens.select do |token|
case token
when "{" then brace_level += 1
when "}" then brace_level -= 1
end
brace_level <= 1 && token != "}"
end + ["}"]
end
end
end
end
| module Primix
module Analyzer
class Tokenizer
attr_reader :content
def initialize(content)
@content = content
end
def tokenize!
filter_tokens(split_contents)
end
def split_contents
chars = @content.split ""
tokens = []
current_token = ""
chars.each_with_index do |char, index|
case char
when "(", ")", "{", "}", "[", "]", ":", "=", "\"", "-", ">", "." then
tokens << current_token if current_token != ""
tokens << char
current_token = ""
when " ", "\n", "\t" then
tokens << current_token if current_token != ""
current_token = ""
else
current_token << char
end
end
tokens
end
def filter_tokens(tokens)
brace_level = 0
tokens.select do |token|
case token
when "{" then brace_level += 1
when "}" then brace_level -= 1
end
brace_level <= 1 && token != "}"
end + ["}"]
end
end
end
end
| Split tokenize method into two methods | Split tokenize method into two methods
| Ruby | apache-2.0 | Primix/Primix,Primix/Primix | ruby | ## Code Before:
module Primix
module Analyzer
class Tokenizer
attr_reader :content
def initialize(content)
@content = content
end
def tokenize!
chars = @content.split ""
tokens = []
current_token = ""
chars.each_with_index do |char, index|
case char
when "(", ")", "{", "}", "[", "]", ":", "=", "\"", "-", ">", "." then
tokens << current_token if current_token != ""
tokens << char
current_token = ""
when " ", "\n", "\t" then
tokens << current_token if current_token != ""
current_token = ""
else
current_token << char
end
end
brace_level = 0
tokens.select do |token|
case token
when "{" then brace_level += 1
when "}" then brace_level -= 1
end
brace_level <= 1 && token != "}"
end + ["}"]
end
end
end
end
## Instruction:
Split tokenize method into two methods
## Code After:
module Primix
module Analyzer
class Tokenizer
attr_reader :content
def initialize(content)
@content = content
end
def tokenize!
filter_tokens(split_contents)
end
def split_contents
chars = @content.split ""
tokens = []
current_token = ""
chars.each_with_index do |char, index|
case char
when "(", ")", "{", "}", "[", "]", ":", "=", "\"", "-", ">", "." then
tokens << current_token if current_token != ""
tokens << char
current_token = ""
when " ", "\n", "\t" then
tokens << current_token if current_token != ""
current_token = ""
else
current_token << char
end
end
tokens
end
def filter_tokens(tokens)
brace_level = 0
tokens.select do |token|
case token
when "{" then brace_level += 1
when "}" then brace_level -= 1
end
brace_level <= 1 && token != "}"
end + ["}"]
end
end
end
end
| module Primix
module Analyzer
class Tokenizer
attr_reader :content
def initialize(content)
@content = content
end
def tokenize!
+ filter_tokens(split_contents)
+ end
+
+ def split_contents
chars = @content.split ""
tokens = []
current_token = ""
chars.each_with_index do |char, index|
case char
when "(", ")", "{", "}", "[", "]", ":", "=", "\"", "-", ">", "." then
tokens << current_token if current_token != ""
tokens << char
current_token = ""
when " ", "\n", "\t" then
tokens << current_token if current_token != ""
current_token = ""
else
current_token << char
end
end
+ tokens
+ end
+
+ def filter_tokens(tokens)
brace_level = 0
tokens.select do |token|
case token
when "{" then brace_level += 1
when "}" then brace_level -= 1
end
brace_level <= 1 && token != "}"
end + ["}"]
end
end
end
end | 8 | 0.2 | 8 | 0 |
b64e7a6e3796150b8270382e8d85c9b131743745 | static/web.html | static/web.html | <!doctype html>
<html lang="en">
<head>
<title>Scribble</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Code+Pro:400,700"/>
<link rel="stylesheet" href="web.css"/>
<script src="//cdn.jsdelivr.net/ace/1.1.6/min/ace.js" charset="utf-8"></script>
<script src="web.js"></script>
</head>
<body>
<p id="control">
<button id="scribble">Check</button>
Protocol:<input type="text" id="proto" />
Role:<input type="text" id="role" />
<button id="project">Project</button>
<button id="graph">Generate Graph</button>
<select id="sample">
<option>hello world</option>
<option>for loop</option>
</select>
</p>
<div id="editor"></div>
<pre id="result" class="highlight"></pre>
</body>
</html>
| <!doctype html>
<html lang="en">
<head>
<title>Scribble</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Code+Pro:400,700"/>
<link rel="stylesheet" href="web.css"/>
<script src="//cdn.jsdelivr.net/ace/1.1.6/min/ace.js" charset="utf-8"></script>
<script src="web.js"></script>
</head>
<body>
<div id="editor"></div>
<p id="control">
<button id="scribble">Check</button>
Protocol:<input type="text" id="proto" />
Role:<input type="text" id="role" />
<button id="project">Project</button>
<button id="graph">Generate Graph</button>
<select id="sample">
<option>hello world</option>
<option>for loop</option>
</select>
</p>
<pre id="result" class="highlight"></pre>
</body>
</html>
| Improve the layout of the controls. | Improve the layout of the controls.
| HTML | mit | drlagos/unify-playpen,cogumbreiro/scribble-playpen,cogumbreiro/scribble-playpen,cogumbreiro/scribble-playpen,cogumbreiro/sepi-playpen,drlagos/unify-playpen,drlagos/mpisessions-playpen,drlagos/mpisessions-playpen,cogumbreiro/sepi-playpen | html | ## Code Before:
<!doctype html>
<html lang="en">
<head>
<title>Scribble</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Code+Pro:400,700"/>
<link rel="stylesheet" href="web.css"/>
<script src="//cdn.jsdelivr.net/ace/1.1.6/min/ace.js" charset="utf-8"></script>
<script src="web.js"></script>
</head>
<body>
<p id="control">
<button id="scribble">Check</button>
Protocol:<input type="text" id="proto" />
Role:<input type="text" id="role" />
<button id="project">Project</button>
<button id="graph">Generate Graph</button>
<select id="sample">
<option>hello world</option>
<option>for loop</option>
</select>
</p>
<div id="editor"></div>
<pre id="result" class="highlight"></pre>
</body>
</html>
## Instruction:
Improve the layout of the controls.
## Code After:
<!doctype html>
<html lang="en">
<head>
<title>Scribble</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Code+Pro:400,700"/>
<link rel="stylesheet" href="web.css"/>
<script src="//cdn.jsdelivr.net/ace/1.1.6/min/ace.js" charset="utf-8"></script>
<script src="web.js"></script>
</head>
<body>
<div id="editor"></div>
<p id="control">
<button id="scribble">Check</button>
Protocol:<input type="text" id="proto" />
Role:<input type="text" id="role" />
<button id="project">Project</button>
<button id="graph">Generate Graph</button>
<select id="sample">
<option>hello world</option>
<option>for loop</option>
</select>
</p>
<pre id="result" class="highlight"></pre>
</body>
</html>
| <!doctype html>
<html lang="en">
<head>
<title>Scribble</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Code+Pro:400,700"/>
<link rel="stylesheet" href="web.css"/>
<script src="//cdn.jsdelivr.net/ace/1.1.6/min/ace.js" charset="utf-8"></script>
<script src="web.js"></script>
</head>
<body>
+ <div id="editor"></div>
<p id="control">
<button id="scribble">Check</button>
Protocol:<input type="text" id="proto" />
Role:<input type="text" id="role" />
<button id="project">Project</button>
<button id="graph">Generate Graph</button>
<select id="sample">
<option>hello world</option>
<option>for loop</option>
</select>
</p>
- <div id="editor"></div>
<pre id="result" class="highlight"></pre>
</body>
</html> | 2 | 0.076923 | 1 | 1 |
b08cd10a832dd23ac0dfa549c27622da3596f016 | README.md | README.md | Cilex, a simple Command Line Interface framework
================================================
Cilex is a simple command line application framework to develop simple tools
based on [Symfony2][1] components:
```php
<?php
require_once __DIR__.'/cilex.phar';
$app = new \Cilex\Application('Cilex');
$app->command(new \Cilex\Command\GreetCommand());
$app->run();
```
Cilex works with PHP 5.3.2 or later and is heavily inspired on the [Silex][2]
web micro-framework by Fabien Potencier.
## Installation
Installing Cilex is as easy as it can get. Download the [`cilex.phar`][3] file
and you're done!
<!--
## More Information
Read the [documentation][4] for more information.
-->
## License
Cilex is licensed under the MIT license.
[1]: http://symfony.com
[2]: http://silex.sensiolabs.org
[3]: http://cilex.github.com/get/cilex.phar
[4]: http://cilex.github.com/documentation
| Cilex, a simple Command Line Interface framework
================================================
Cilex is a simple command line application framework to develop simple tools
based on [Symfony2][1] components:
```php
<?php
require_once __DIR__.'/cilex.phar';
$app = new \Cilex\Application('Cilex');
$app->command(new \Cilex\Command\GreetCommand());
$app->run();
```
Cilex works with PHP 5.3.2 or later and is heavily inspired on the [Silex][2]
web micro-framework by Fabien Potencier.
## Installation
Installing Cilex is as easy as it can get. Download the [`cilex.phar`][3] file
and you're done!
<!--
## More Information
Read the [documentation][4] for more information.
-->
## License
Cilex is licensed under the MIT license.
[1]: http://symfony.com
[2]: http://silex.sensiolabs.org
[3]: http://cilex.github.com/get/cilex.phar
[4]: http://cilex.github.com/documentation
## FAQ
Q: How do I pass configuration into the application?
A: You can do this by adding the following line, where $configPath is the path to the configuration file you want to use:
```php
$app->register(new \Cilex\Provider\ConfigServiceProvider(), array('config.path' => $configPath));
```
The formats currently supported are: YAML, XML and JSON | Add an FAQ secton starting with configuration for your application | Add an FAQ secton starting with configuration for your application
| Markdown | mit | Seldaek/Cilex,Sgoettschkes/Cilex,Cilex/Cilex | markdown | ## Code Before:
Cilex, a simple Command Line Interface framework
================================================
Cilex is a simple command line application framework to develop simple tools
based on [Symfony2][1] components:
```php
<?php
require_once __DIR__.'/cilex.phar';
$app = new \Cilex\Application('Cilex');
$app->command(new \Cilex\Command\GreetCommand());
$app->run();
```
Cilex works with PHP 5.3.2 or later and is heavily inspired on the [Silex][2]
web micro-framework by Fabien Potencier.
## Installation
Installing Cilex is as easy as it can get. Download the [`cilex.phar`][3] file
and you're done!
<!--
## More Information
Read the [documentation][4] for more information.
-->
## License
Cilex is licensed under the MIT license.
[1]: http://symfony.com
[2]: http://silex.sensiolabs.org
[3]: http://cilex.github.com/get/cilex.phar
[4]: http://cilex.github.com/documentation
## Instruction:
Add an FAQ secton starting with configuration for your application
## Code After:
Cilex, a simple Command Line Interface framework
================================================
Cilex is a simple command line application framework to develop simple tools
based on [Symfony2][1] components:
```php
<?php
require_once __DIR__.'/cilex.phar';
$app = new \Cilex\Application('Cilex');
$app->command(new \Cilex\Command\GreetCommand());
$app->run();
```
Cilex works with PHP 5.3.2 or later and is heavily inspired on the [Silex][2]
web micro-framework by Fabien Potencier.
## Installation
Installing Cilex is as easy as it can get. Download the [`cilex.phar`][3] file
and you're done!
<!--
## More Information
Read the [documentation][4] for more information.
-->
## License
Cilex is licensed under the MIT license.
[1]: http://symfony.com
[2]: http://silex.sensiolabs.org
[3]: http://cilex.github.com/get/cilex.phar
[4]: http://cilex.github.com/documentation
## FAQ
Q: How do I pass configuration into the application?
A: You can do this by adding the following line, where $configPath is the path to the configuration file you want to use:
```php
$app->register(new \Cilex\Provider\ConfigServiceProvider(), array('config.path' => $configPath));
```
The formats currently supported are: YAML, XML and JSON | Cilex, a simple Command Line Interface framework
================================================
Cilex is a simple command line application framework to develop simple tools
based on [Symfony2][1] components:
```php
<?php
require_once __DIR__.'/cilex.phar';
$app = new \Cilex\Application('Cilex');
$app->command(new \Cilex\Command\GreetCommand());
$app->run();
```
Cilex works with PHP 5.3.2 or later and is heavily inspired on the [Silex][2]
web micro-framework by Fabien Potencier.
## Installation
Installing Cilex is as easy as it can get. Download the [`cilex.phar`][3] file
and you're done!
<!--
## More Information
Read the [documentation][4] for more information.
-->
## License
Cilex is licensed under the MIT license.
[1]: http://symfony.com
[2]: http://silex.sensiolabs.org
[3]: http://cilex.github.com/get/cilex.phar
[4]: http://cilex.github.com/documentation
+
+ ## FAQ
+
+ Q: How do I pass configuration into the application?
+
+ A: You can do this by adding the following line, where $configPath is the path to the configuration file you want to use:
+
+ ```php
+ $app->register(new \Cilex\Provider\ConfigServiceProvider(), array('config.path' => $configPath));
+ ```
+
+ The formats currently supported are: YAML, XML and JSON | 12 | 0.324324 | 12 | 0 |
226de463c35cc6a4a928e7711deeec8a5f0e3616 | client/app/views/sessionView.js | client/app/views/sessionView.js | define(['jquery', 'controllers/analystController', 'Ladda'], function ($, analystController, Ladda) {
function sessionView() {
$(function () {
$('#generate').on('click', function (e) {
e.preventDefault();
var la = Ladda.create(document.getElementById('generate'));
la.start();
analystController.generateSession('infoDiv', 'sessionID', 'passwordID', 'pubkeyID', 'privkeyID', 'link-id', 'session-title', 'session-description')
.then(function () {
la.stop();
$('#session-details').removeClass('hidden');
});
});
});
}
return sessionView;
});
| define(['jquery', 'controllers/analystController', 'Ladda'], function ($, analystController, Ladda) {
function sessionView() {
$(function () {
$('#generate').on('click', function (e) {
e.preventDefault();
var la = Ladda.create(document.getElementById('generate'));
la.start();
var result = analystController.generateSession('infoDiv', 'sessionID', 'passwordID', 'pubkeyID', 'privkeyID', 'link-id', 'session-title', 'session-description');
if (result == null) {
la.stop();
} else {
result.then(function () {
la.stop();
$('#session-details').removeClass('hidden');
});
}
});
});
}
return sessionView;
});
| Fix in creating session error message | Fix in creating session error message
| JavaScript | mit | multiparty/web-mpc,multiparty/web-mpc,multiparty/web-mpc | javascript | ## Code Before:
define(['jquery', 'controllers/analystController', 'Ladda'], function ($, analystController, Ladda) {
function sessionView() {
$(function () {
$('#generate').on('click', function (e) {
e.preventDefault();
var la = Ladda.create(document.getElementById('generate'));
la.start();
analystController.generateSession('infoDiv', 'sessionID', 'passwordID', 'pubkeyID', 'privkeyID', 'link-id', 'session-title', 'session-description')
.then(function () {
la.stop();
$('#session-details').removeClass('hidden');
});
});
});
}
return sessionView;
});
## Instruction:
Fix in creating session error message
## Code After:
define(['jquery', 'controllers/analystController', 'Ladda'], function ($, analystController, Ladda) {
function sessionView() {
$(function () {
$('#generate').on('click', function (e) {
e.preventDefault();
var la = Ladda.create(document.getElementById('generate'));
la.start();
var result = analystController.generateSession('infoDiv', 'sessionID', 'passwordID', 'pubkeyID', 'privkeyID', 'link-id', 'session-title', 'session-description');
if (result == null) {
la.stop();
} else {
result.then(function () {
la.stop();
$('#session-details').removeClass('hidden');
});
}
});
});
}
return sessionView;
});
| define(['jquery', 'controllers/analystController', 'Ladda'], function ($, analystController, Ladda) {
function sessionView() {
$(function () {
$('#generate').on('click', function (e) {
e.preventDefault();
var la = Ladda.create(document.getElementById('generate'));
la.start();
- analystController.generateSession('infoDiv', 'sessionID', 'passwordID', 'pubkeyID', 'privkeyID', 'link-id', 'session-title', 'session-description')
+ var result = analystController.generateSession('infoDiv', 'sessionID', 'passwordID', 'pubkeyID', 'privkeyID', 'link-id', 'session-title', 'session-description');
? +++++++++++++ +
+ if (result == null) {
+ la.stop();
+ } else {
- .then(function () {
+ result.then(function () {
? ++++++
la.stop();
$('#session-details').removeClass('hidden');
});
+ }
});
});
}
return sessionView;
}); | 8 | 0.347826 | 6 | 2 |
75225516f9f7aed2f0e38794b3316747efc5b557 | src/test/kotlin/RemoteToLocalFileTranslatorTest.kt | src/test/kotlin/RemoteToLocalFileTranslatorTest.kt | import com.elpassion.intelijidea.configuration.RemoteToLocalFileTranslator
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase
import org.junit.Assert
class RemoteToLocalFileTranslatorTest : LightPlatformCodeInsightFixtureTestCase() {
fun testShouldTranslateRemoteFileNameToLocal() {
val remotePathName = "/home/kasper/mainframer/light_temp/src/test/java/BB.java"
val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
Assert.assertEquals("${project.basePath}/src/test/java/BB.java", result)
}
fun testReallyShouldTranslateRemoteFileNameToLocal() {
val remotePathName = "/home/kasper/mainframer/light_temp/src/test/java/CC.java"
val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
Assert.assertEquals("${project.basePath}/src/test/java/CC.java", result)
}
} | import com.elpassion.intelijidea.configuration.RemoteToLocalFileTranslator
import com.intellij.openapi.project.Project
import com.nhaarman.mockito_kotlin.doReturn
import com.nhaarman.mockito_kotlin.mock
import org.junit.Assert.assertEquals
import org.junit.Test
class RemoteToLocalFileTranslatorTest {
private val project = mock<Project> {
on { basePath } doReturn "/local/path/to/$PROJECT_NAME"
on { name } doReturn PROJECT_NAME
}
@Test
fun testShouldTranslateRemoteFileNameToLocal() {
val remotePathName = "/home/kasper/mainframer/$PROJECT_NAME/src/test/java/BB.java"
val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
assertEquals("${project.basePath}/src/test/java/BB.java", result)
}
@Test
fun testReallyShouldTranslateRemoteFileNameToLocal() {
val remotePathName = "/home/kasper/mainframer/$PROJECT_NAME/src/test/java/CC.java"
val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
assertEquals("${project.basePath}/src/test/java/CC.java", result)
}
companion object {
private val PROJECT_NAME = "testProject"
}
} | Rewrite test to pure junit | Rewrite test to pure junit
| Kotlin | apache-2.0 | elpassion/mainframer-intellij-plugin,elpassion/mainframer-intellij-plugin,elpassion/mainframer-intellij-plugin | kotlin | ## Code Before:
import com.elpassion.intelijidea.configuration.RemoteToLocalFileTranslator
import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase
import org.junit.Assert
class RemoteToLocalFileTranslatorTest : LightPlatformCodeInsightFixtureTestCase() {
fun testShouldTranslateRemoteFileNameToLocal() {
val remotePathName = "/home/kasper/mainframer/light_temp/src/test/java/BB.java"
val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
Assert.assertEquals("${project.basePath}/src/test/java/BB.java", result)
}
fun testReallyShouldTranslateRemoteFileNameToLocal() {
val remotePathName = "/home/kasper/mainframer/light_temp/src/test/java/CC.java"
val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
Assert.assertEquals("${project.basePath}/src/test/java/CC.java", result)
}
}
## Instruction:
Rewrite test to pure junit
## Code After:
import com.elpassion.intelijidea.configuration.RemoteToLocalFileTranslator
import com.intellij.openapi.project.Project
import com.nhaarman.mockito_kotlin.doReturn
import com.nhaarman.mockito_kotlin.mock
import org.junit.Assert.assertEquals
import org.junit.Test
class RemoteToLocalFileTranslatorTest {
private val project = mock<Project> {
on { basePath } doReturn "/local/path/to/$PROJECT_NAME"
on { name } doReturn PROJECT_NAME
}
@Test
fun testShouldTranslateRemoteFileNameToLocal() {
val remotePathName = "/home/kasper/mainframer/$PROJECT_NAME/src/test/java/BB.java"
val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
assertEquals("${project.basePath}/src/test/java/BB.java", result)
}
@Test
fun testReallyShouldTranslateRemoteFileNameToLocal() {
val remotePathName = "/home/kasper/mainframer/$PROJECT_NAME/src/test/java/CC.java"
val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
assertEquals("${project.basePath}/src/test/java/CC.java", result)
}
companion object {
private val PROJECT_NAME = "testProject"
}
} | import com.elpassion.intelijidea.configuration.RemoteToLocalFileTranslator
- import com.intellij.testFramework.fixtures.LightPlatformCodeInsightFixtureTestCase
+ import com.intellij.openapi.project.Project
+ import com.nhaarman.mockito_kotlin.doReturn
+ import com.nhaarman.mockito_kotlin.mock
+ import org.junit.Assert.assertEquals
- import org.junit.Assert
? ^ ---
+ import org.junit.Test
? ^^
- class RemoteToLocalFileTranslatorTest : LightPlatformCodeInsightFixtureTestCase() {
+ class RemoteToLocalFileTranslatorTest {
+ private val project = mock<Project> {
+ on { basePath } doReturn "/local/path/to/$PROJECT_NAME"
+ on { name } doReturn PROJECT_NAME
- fun testShouldTranslateRemoteFileNameToLocal() {
- val remotePathName = "/home/kasper/mainframer/light_temp/src/test/java/BB.java"
- val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
- Assert.assertEquals("${project.basePath}/src/test/java/BB.java", result)
}
+ @Test
+ fun testShouldTranslateRemoteFileNameToLocal() {
+ val remotePathName = "/home/kasper/mainframer/$PROJECT_NAME/src/test/java/BB.java"
+ val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
+ assertEquals("${project.basePath}/src/test/java/BB.java", result)
+ }
+
+ @Test
fun testReallyShouldTranslateRemoteFileNameToLocal() {
- val remotePathName = "/home/kasper/mainframer/light_temp/src/test/java/CC.java"
? ^^^^^ ^^^^
+ val remotePathName = "/home/kasper/mainframer/$PROJECT_NAME/src/test/java/CC.java"
? ^^^^^^^^ ^^^^
val result = RemoteToLocalFileTranslator.translate(project, remotePathName)
- Assert.assertEquals("${project.basePath}/src/test/java/CC.java", result)
? -------
+ assertEquals("${project.basePath}/src/test/java/CC.java", result)
+ }
+
+ companion object {
+ private val PROJECT_NAME = "testProject"
}
} | 32 | 1.777778 | 23 | 9 |
7de3cc8ce201f8b1abfd9abffd79756e09a762ef | app/models/order_detail.rb | app/models/order_detail.rb | class OrderDetail < ActiveRecord::Base
belongs_to :order
belongs_to :item
after_commit :update_item
def update_item
# Whenever an OrderDetail is created/modified we want to update that item's
# requested_quantity value.
item.requested_quantity = item.pending_requested_quantity
item.save
end
def to_json
{
id: id,
category_id: item.category_id,
item_id: item_id,
quantity: quantity
}
end
end
| class OrderDetail < ActiveRecord::Base
belongs_to :order
belongs_to :item
after_commit :update_item
def update_item
# Whenever an OrderDetail is created/modified we want to update that item's
# requested_quantity value.
item.requested_quantity = item.pending_requested_quantity
item.save
end
def to_json
{
id: id,
category_id: item.category_id,
item_id: item_id,
quantity: quantity
}
end
def value
quantity * price
end
end
| Add value method to order details | Add value method to order details
| Ruby | mit | icodeclean/StockAid,icodeclean/StockAid,on-site/StockAid,icodeclean/StockAid,on-site/StockAid,on-site/StockAid | ruby | ## Code Before:
class OrderDetail < ActiveRecord::Base
belongs_to :order
belongs_to :item
after_commit :update_item
def update_item
# Whenever an OrderDetail is created/modified we want to update that item's
# requested_quantity value.
item.requested_quantity = item.pending_requested_quantity
item.save
end
def to_json
{
id: id,
category_id: item.category_id,
item_id: item_id,
quantity: quantity
}
end
end
## Instruction:
Add value method to order details
## Code After:
class OrderDetail < ActiveRecord::Base
belongs_to :order
belongs_to :item
after_commit :update_item
def update_item
# Whenever an OrderDetail is created/modified we want to update that item's
# requested_quantity value.
item.requested_quantity = item.pending_requested_quantity
item.save
end
def to_json
{
id: id,
category_id: item.category_id,
item_id: item_id,
quantity: quantity
}
end
def value
quantity * price
end
end
| class OrderDetail < ActiveRecord::Base
belongs_to :order
belongs_to :item
after_commit :update_item
def update_item
# Whenever an OrderDetail is created/modified we want to update that item's
# requested_quantity value.
item.requested_quantity = item.pending_requested_quantity
item.save
end
def to_json
{
id: id,
category_id: item.category_id,
item_id: item_id,
quantity: quantity
}
end
+
+ def value
+ quantity * price
+ end
end | 4 | 0.181818 | 4 | 0 |
6e9bef4fef9f766ff1a46956497466b9f37b9c3b | masl/parser/lib/README.md | masl/parser/lib/README.md | antlr library jar file
======================
To build this parser, antlr-3.5.2-complete.jar (or newer) must be present
in this folder. Download from the antlr3.org.
| antlr library jar file
======================
To build this parser, antlr-3.5.2-complete.jar (or newer) must be present
in this folder. [Download from the antlr3.org](http://www.antlr3.org/download/antlr-3.5.2-complete.jar).
On linux machines you can open a terminal, "cd" to this ```lib``` folder, then run
```
wget http://www.antlr3.org/download/antlr-3.5.2-complete.jar
```
| Add instructions for downloading the jar file | Add instructions for downloading the jar file | Markdown | apache-2.0 | cortlandstarrett/mc,leviathan747/mc,rmulvey/mc,leviathan747/mc,lwriemen/mc,xtuml/mc,lwriemen/mc,cortlandstarrett/mc,lwriemen/mc,xtuml/mc,keithbrown/mc,keithbrown/mc,cortlandstarrett/mc,cortlandstarrett/mc,keithbrown/mc,leviathan747/mc,keithbrown/mc,keithbrown/mc,cortlandstarrett/mc,rmulvey/mc,leviathan747/mc,lwriemen/mc,rmulvey/mc,xtuml/mc,leviathan747/mc,leviathan747/mc,xtuml/mc,lwriemen/mc,xtuml/mc,xtuml/mc,lwriemen/mc,rmulvey/mc,keithbrown/mc,rmulvey/mc,cortlandstarrett/mc,rmulvey/mc | markdown | ## Code Before:
antlr library jar file
======================
To build this parser, antlr-3.5.2-complete.jar (or newer) must be present
in this folder. Download from the antlr3.org.
## Instruction:
Add instructions for downloading the jar file
## Code After:
antlr library jar file
======================
To build this parser, antlr-3.5.2-complete.jar (or newer) must be present
in this folder. [Download from the antlr3.org](http://www.antlr3.org/download/antlr-3.5.2-complete.jar).
On linux machines you can open a terminal, "cd" to this ```lib``` folder, then run
```
wget http://www.antlr3.org/download/antlr-3.5.2-complete.jar
```
| antlr library jar file
======================
To build this parser, antlr-3.5.2-complete.jar (or newer) must be present
- in this folder. Download from the antlr3.org.
+ in this folder. [Download from the antlr3.org](http://www.antlr3.org/download/antlr-3.5.2-complete.jar).
+
+ On linux machines you can open a terminal, "cd" to this ```lib``` folder, then run
+ ```
+ wget http://www.antlr3.org/download/antlr-3.5.2-complete.jar
+ ```
+ | 8 | 1.6 | 7 | 1 |
8083b3c1fa979a64ef0e6722a9bb5674c7ed07d1 | index.html | index.html | <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Tic Tac Toe</title>
<script src="https://code.createjs.com/createjs-2015.05.21.min.js"></script>
<script>
function init() {
var stage = new createjs.Stage("demoCanvas");
var circle = new createjs.Shape();
circle.graphics.beginFill("DeepSkyBlue").drawCircle(0, 0, 50);
circle.x = 100;
circle.y = 100;
stage.addChild(circle);
stage.update();
}
</script>
</head>
<body onload="init();">
<canvas id="demoCanvas" width="500" height="200"></canvas>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Tic Tac Toe</title>
<script src="https://code.createjs.com/createjs-2015.05.21.min.js"></script>
<script>
function init() {
var stage = new createjs.Stage("demoCanvas");
var circle = new createjs.Shape();
circle.graphics.beginFill("Purple").drawCircle(0, 0, 50);
circle.x = 100;
circle.y = 100;
stage.addChild(circle);
// stage.update();
createjs.Tween.get(circle, { loop: false })
.to({ x: 400 }, 1000, createjs.Ease.getPowInOut(4))
.to({ alpha: 0, y: 75 }, 500, createjs.Ease.getPowInOut(2))
.to({ alpha: 0, y: 125 }, 100)
.to({ alpha: 1, y: 100 }, 500, createjs.Ease.getPowInOut(2))
.to({ x: 100 }, 800, createjs.Ease.getPowInOut(2));
createjs.Ticker.setFPS(60);
createjs.Ticker.addEventListener("tick", stage);
}
</script>
</head>
<body onload="init();">
<canvas id="demoCanvas" width="500" height="200"></canvas>
</body>
</html>
| Change color of circle to Purple and add animation | Change color of circle to Purple and add animation
| HTML | mit | picolll/tic-tac-toe | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Tic Tac Toe</title>
<script src="https://code.createjs.com/createjs-2015.05.21.min.js"></script>
<script>
function init() {
var stage = new createjs.Stage("demoCanvas");
var circle = new createjs.Shape();
circle.graphics.beginFill("DeepSkyBlue").drawCircle(0, 0, 50);
circle.x = 100;
circle.y = 100;
stage.addChild(circle);
stage.update();
}
</script>
</head>
<body onload="init();">
<canvas id="demoCanvas" width="500" height="200"></canvas>
</body>
</html>
## Instruction:
Change color of circle to Purple and add animation
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Tic Tac Toe</title>
<script src="https://code.createjs.com/createjs-2015.05.21.min.js"></script>
<script>
function init() {
var stage = new createjs.Stage("demoCanvas");
var circle = new createjs.Shape();
circle.graphics.beginFill("Purple").drawCircle(0, 0, 50);
circle.x = 100;
circle.y = 100;
stage.addChild(circle);
// stage.update();
createjs.Tween.get(circle, { loop: false })
.to({ x: 400 }, 1000, createjs.Ease.getPowInOut(4))
.to({ alpha: 0, y: 75 }, 500, createjs.Ease.getPowInOut(2))
.to({ alpha: 0, y: 125 }, 100)
.to({ alpha: 1, y: 100 }, 500, createjs.Ease.getPowInOut(2))
.to({ x: 100 }, 800, createjs.Ease.getPowInOut(2));
createjs.Ticker.setFPS(60);
createjs.Ticker.addEventListener("tick", stage);
}
</script>
</head>
<body onload="init();">
<canvas id="demoCanvas" width="500" height="200"></canvas>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Tic Tac Toe</title>
<script src="https://code.createjs.com/createjs-2015.05.21.min.js"></script>
<script>
function init() {
var stage = new createjs.Stage("demoCanvas");
var circle = new createjs.Shape();
- circle.graphics.beginFill("DeepSkyBlue").drawCircle(0, 0, 50);
? ^^^ ---- -
+ circle.graphics.beginFill("Purple").drawCircle(0, 0, 50);
? ^^^
circle.x = 100;
circle.y = 100;
stage.addChild(circle);
- stage.update();
+ // stage.update();
? ++
+
+ createjs.Tween.get(circle, { loop: false })
+ .to({ x: 400 }, 1000, createjs.Ease.getPowInOut(4))
+ .to({ alpha: 0, y: 75 }, 500, createjs.Ease.getPowInOut(2))
+ .to({ alpha: 0, y: 125 }, 100)
+ .to({ alpha: 1, y: 100 }, 500, createjs.Ease.getPowInOut(2))
+ .to({ x: 100 }, 800, createjs.Ease.getPowInOut(2));
+
+ createjs.Ticker.setFPS(60);
+ createjs.Ticker.addEventListener("tick", stage);
+
+
+
}
</script>
</head>
<body onload="init();">
<canvas id="demoCanvas" width="500" height="200"></canvas>
</body>
</html>
+ | 18 | 0.818182 | 16 | 2 |
c562346192bbf0790338adf94f9590a2396c5d41 | src/bin/table_test.rs | src/bin/table_test.rs | extern crate uosql;
use uosql::storage::*;
fn main() {
//let db = Database::create("storage_team").unwrap();
let db = Database::load("storage_team").unwrap();
let mut cols = Vec::new();
cols.push(Column { name: "Heiner".into(), data_type: DataType::Integer });
cols.push(Column { name: "Mathias".into(), data_type: DataType::Float });
cols.push(Column { name: "Dennis".into(), data_type: DataType::Float });
cols.push(Column { name: "Jana".into(), data_type: DataType::Integer });
let _storage_team = db.create_table("storage_team", cols, 1).unwrap();
let t = db.load_table("storage_team").unwrap();
let mut engine = t.create_engine();
let _e = engine.create_table();
let t = engine.get_table();
}
| extern crate uosql;
use uosql::storage::*;
fn main() {
//let db = Database::create("storage_team").unwrap();
let db = Database::load("storage_team").unwrap();
let mut cols = Vec::new();
cols.push(Column { name: "Heiner".into(), data_type: DataType::Integer });
cols.push(Column { name: "Mathias".into(), data_type: DataType::Float });
cols.push(Column { name: "Dennis".into(), data_type: DataType::Float });
cols.push(Column { name: "Jana".into(), data_type: DataType::Integer });
let _storage_team = db.create_table("storage_team", cols, 1).unwrap();
let t = db.load_table("storage_team").unwrap();
let mut engine = t.create_engine();
let _e = engine.create_table();
}
| Remove line with unimplemented function | Remove line with unimplemented function
| Rust | mit | tempbottle/uosql-server,tempbottle/uosql-server,OsnaCS/uosql-server,tempbottle/uosql-server,OsnaCS/uosql-server,OsnaCS/uosql-server | rust | ## Code Before:
extern crate uosql;
use uosql::storage::*;
fn main() {
//let db = Database::create("storage_team").unwrap();
let db = Database::load("storage_team").unwrap();
let mut cols = Vec::new();
cols.push(Column { name: "Heiner".into(), data_type: DataType::Integer });
cols.push(Column { name: "Mathias".into(), data_type: DataType::Float });
cols.push(Column { name: "Dennis".into(), data_type: DataType::Float });
cols.push(Column { name: "Jana".into(), data_type: DataType::Integer });
let _storage_team = db.create_table("storage_team", cols, 1).unwrap();
let t = db.load_table("storage_team").unwrap();
let mut engine = t.create_engine();
let _e = engine.create_table();
let t = engine.get_table();
}
## Instruction:
Remove line with unimplemented function
## Code After:
extern crate uosql;
use uosql::storage::*;
fn main() {
//let db = Database::create("storage_team").unwrap();
let db = Database::load("storage_team").unwrap();
let mut cols = Vec::new();
cols.push(Column { name: "Heiner".into(), data_type: DataType::Integer });
cols.push(Column { name: "Mathias".into(), data_type: DataType::Float });
cols.push(Column { name: "Dennis".into(), data_type: DataType::Float });
cols.push(Column { name: "Jana".into(), data_type: DataType::Integer });
let _storage_team = db.create_table("storage_team", cols, 1).unwrap();
let t = db.load_table("storage_team").unwrap();
let mut engine = t.create_engine();
let _e = engine.create_table();
}
| extern crate uosql;
use uosql::storage::*;
fn main() {
//let db = Database::create("storage_team").unwrap();
let db = Database::load("storage_team").unwrap();
let mut cols = Vec::new();
cols.push(Column { name: "Heiner".into(), data_type: DataType::Integer });
cols.push(Column { name: "Mathias".into(), data_type: DataType::Float });
cols.push(Column { name: "Dennis".into(), data_type: DataType::Float });
cols.push(Column { name: "Jana".into(), data_type: DataType::Integer });
let _storage_team = db.create_table("storage_team", cols, 1).unwrap();
let t = db.load_table("storage_team").unwrap();
let mut engine = t.create_engine();
let _e = engine.create_table();
- let t = engine.get_table();
} | 1 | 0.041667 | 0 | 1 |
5d4e70e15f6b6407071a93ed46a7da66381dacb4 | content/nav_main.php | content/nav_main.php | <nav class="main">
<ul>
<li><a href="<?=$relRoot;?>">Home</a></li>
<li><a href="<?=$relRoot;?>?p=resume">Resume</a></li>
<li><a href="<?=$relRoot;?>?p=projects">Projects</a></li>
<li><a href="https://twitter.com/StrangePan" class="external">@StrangePan<i class="fa fa-external-link" aria-hidden="true"></i></a></li>
</ul>
</nav>
| <nav class="main">
<ul>
<li><a href="<?=$relRoot;?>">Home</a></li>
<li><a href="<?=$relRoot;?>?p=resume">Resume</a></li>
<li><a href="<?=$relRoot;?>?p=projects">Projects</a></li>
<li><a href="https://twitter.com/StrangePan" class="external">Twitter<i class="fa fa-external-link" aria-hidden="true"></i></a></li>
</ul>
</nav>
| Rename '@StrangePan' in header to 'Twitter'. Simplifies header menu. | Rename '@StrangePan' in header to 'Twitter'. Simplifies header menu.
| PHP | mit | StrangePan/Website,StrangePan/Website,StrangePan/Website | php | ## Code Before:
<nav class="main">
<ul>
<li><a href="<?=$relRoot;?>">Home</a></li>
<li><a href="<?=$relRoot;?>?p=resume">Resume</a></li>
<li><a href="<?=$relRoot;?>?p=projects">Projects</a></li>
<li><a href="https://twitter.com/StrangePan" class="external">@StrangePan<i class="fa fa-external-link" aria-hidden="true"></i></a></li>
</ul>
</nav>
## Instruction:
Rename '@StrangePan' in header to 'Twitter'. Simplifies header menu.
## Code After:
<nav class="main">
<ul>
<li><a href="<?=$relRoot;?>">Home</a></li>
<li><a href="<?=$relRoot;?>?p=resume">Resume</a></li>
<li><a href="<?=$relRoot;?>?p=projects">Projects</a></li>
<li><a href="https://twitter.com/StrangePan" class="external">Twitter<i class="fa fa-external-link" aria-hidden="true"></i></a></li>
</ul>
</nav>
| <nav class="main">
<ul>
<li><a href="<?=$relRoot;?>">Home</a></li>
<li><a href="<?=$relRoot;?>?p=resume">Resume</a></li>
<li><a href="<?=$relRoot;?>?p=projects">Projects</a></li>
- <li><a href="https://twitter.com/StrangePan" class="external">@StrangePan<i class="fa fa-external-link" aria-hidden="true"></i></a></li>
? ^^ -------
+ <li><a href="https://twitter.com/StrangePan" class="external">Twitter<i class="fa fa-external-link" aria-hidden="true"></i></a></li>
? ^^^ ++
</ul>
</nav> | 2 | 0.25 | 1 | 1 |
35b10a3e19d6d67c88d156091a4c17a4b0a1ec46 | src/CMakeLists.txt | src/CMakeLists.txt | add_library (leplib
ConfigFile.cpp
CsvFile.cpp
HttpClient.cpp
JsonArray.cpp
JsonBool.cpp
JsonNull.cpp
JsonNumber.cpp
JsonObject.cpp
JsonString.cpp
JsonValue.cpp
Logger.cpp
Socket.cpp
SocketAddress.cpp
String.cpp
StringBuilder.cpp
TestCase.cpp
TestModule.cpp
TestSet.cpp
Thread.cpp
)
if(CMAKE_HOST_WIN32)
target_link_libraries(leplib ${target_link_libraries} ws2_32)
endif(CMAKE_HOST_WIN32)
if(CMAKE_HOST_UNIX)
target_link_libraries(leplib ${target_link_libraries} pthread)
endif(CMAKE_HOST_UNIX)
| add_library (leplib
CgiHelper.cpp
ConfigFile.cpp
CsvFile.cpp
HttpClient.cpp
JsonArray.cpp
JsonBool.cpp
JsonNull.cpp
JsonNumber.cpp
JsonObject.cpp
JsonString.cpp
JsonValue.cpp
Logger.cpp
Socket.cpp
SocketAddress.cpp
String.cpp
StringBuilder.cpp
TestCase.cpp
TestModule.cpp
TestSet.cpp
Thread.cpp
)
if(CMAKE_HOST_WIN32)
target_link_libraries(leplib ${target_link_libraries} ws2_32)
endif(CMAKE_HOST_WIN32)
if(CMAKE_HOST_UNIX)
target_link_libraries(leplib ${target_link_libraries} pthread)
endif(CMAKE_HOST_UNIX)
| Update cmake to include new CGI helper class. | Update cmake to include new CGI helper class.
| Text | mit | praveenster/leplib,praveenster/leplib | text | ## Code Before:
add_library (leplib
ConfigFile.cpp
CsvFile.cpp
HttpClient.cpp
JsonArray.cpp
JsonBool.cpp
JsonNull.cpp
JsonNumber.cpp
JsonObject.cpp
JsonString.cpp
JsonValue.cpp
Logger.cpp
Socket.cpp
SocketAddress.cpp
String.cpp
StringBuilder.cpp
TestCase.cpp
TestModule.cpp
TestSet.cpp
Thread.cpp
)
if(CMAKE_HOST_WIN32)
target_link_libraries(leplib ${target_link_libraries} ws2_32)
endif(CMAKE_HOST_WIN32)
if(CMAKE_HOST_UNIX)
target_link_libraries(leplib ${target_link_libraries} pthread)
endif(CMAKE_HOST_UNIX)
## Instruction:
Update cmake to include new CGI helper class.
## Code After:
add_library (leplib
CgiHelper.cpp
ConfigFile.cpp
CsvFile.cpp
HttpClient.cpp
JsonArray.cpp
JsonBool.cpp
JsonNull.cpp
JsonNumber.cpp
JsonObject.cpp
JsonString.cpp
JsonValue.cpp
Logger.cpp
Socket.cpp
SocketAddress.cpp
String.cpp
StringBuilder.cpp
TestCase.cpp
TestModule.cpp
TestSet.cpp
Thread.cpp
)
if(CMAKE_HOST_WIN32)
target_link_libraries(leplib ${target_link_libraries} ws2_32)
endif(CMAKE_HOST_WIN32)
if(CMAKE_HOST_UNIX)
target_link_libraries(leplib ${target_link_libraries} pthread)
endif(CMAKE_HOST_UNIX)
| add_library (leplib
+ CgiHelper.cpp
ConfigFile.cpp
CsvFile.cpp
HttpClient.cpp
JsonArray.cpp
JsonBool.cpp
JsonNull.cpp
JsonNumber.cpp
JsonObject.cpp
JsonString.cpp
JsonValue.cpp
Logger.cpp
Socket.cpp
SocketAddress.cpp
String.cpp
StringBuilder.cpp
TestCase.cpp
TestModule.cpp
TestSet.cpp
Thread.cpp
)
if(CMAKE_HOST_WIN32)
target_link_libraries(leplib ${target_link_libraries} ws2_32)
endif(CMAKE_HOST_WIN32)
if(CMAKE_HOST_UNIX)
target_link_libraries(leplib ${target_link_libraries} pthread)
endif(CMAKE_HOST_UNIX) | 1 | 0.034483 | 1 | 0 |
5cbb66115a6a6ca91330176f0cba8f865098d8e3 | packages/matchbox-panel/matchbox-panel_0.9.2.bb | packages/matchbox-panel/matchbox-panel_0.9.2.bb | include matchbox-panel.inc
PR="r5"
SRC_URI = "http://projects.o-hand.com/matchbox/sources/${PN}/0.9/${PN}-${PV}.tar.gz \
file://add_hostap.patch;patch=1 \
file://kernel2.6.patch;patch=1"
| include matchbox-panel.inc
PR="r6"
SRC_URI = "http://projects.o-hand.com/matchbox/sources/${PN}/0.9/${PN}-${PV}.tar.gz \
file://add_hostap.patch;patch=1 \
http://handhelds.org/~pb/mb-panel-0.9.2-polling.patch;patch=1 \
http://handhelds.org/~pb/mb-panel-0.9.2-msgcancel.patch;patch=1 \
file://kernel2.6.patch;patch=1"
| Include patches to fix polling and cancellation of panel messages. | matchbox-panel: Include patches to fix polling and cancellation of panel messages.
| BitBake | mit | dave-billin/overo-ui-moos-auv,buglabs/oe-buglabs,dellysunnymtech/sakoman-oe,YtvwlD/od-oe,mrchapp/arago-oe-dev,nlebedenco/mini2440,popazerty/openembedded-cuberevo,John-NY/overo-oe,dellysunnymtech/sakoman-oe,popazerty/openembedded-cuberevo,bticino/openembedded,sutajiokousagi/openembedded,demsey/openembedded,buglabs/oe-buglabs,troth/oe-ts7xxx,trini/openembedded,nlebedenco/mini2440,openembedded/openembedded,KDAB/OpenEmbedded-Archos,KDAB/OpenEmbedded-Archos,buglabs/oe-buglabs,sentient-energy/emsw-oe-mirror,scottellis/overo-oe,openpli-arm/openembedded,bticino/openembedded,nx111/openembeded_openpli2.1_nx111,John-NY/overo-oe,JrCs/opendreambox,crystalfontz/openembedded,giobauermeister/openembedded,troth/oe-ts7xxx,BlackPole/bp-openembedded,openembedded/openembedded,JamesAng/goe,mrchapp/arago-oe-dev,giobauermeister/openembedded,YtvwlD/od-oe,sentient-energy/emsw-oe-mirror,sledz/oe,JrCs/opendreambox,thebohemian/openembedded,SIFTeam/openembedded,philb/pbcl-oe-2010,sampov2/audio-openembedded,yyli/overo-oe,openpli-arm/openembedded,KDAB/OpenEmbedded-Archos,bticino/openembedded,trini/openembedded,JamesAng/oe,anguslees/openembedded-android,popazerty/openembedded-cuberevo,sentient-energy/emsw-oe-mirror,sampov2/audio-openembedded,hulifox008/openembedded,xifengchuo/openembedded,thebohemian/openembedded,libo/openembedded,nlebedenco/mini2440,demsey/openembedded,dave-billin/overo-ui-moos-auv,thebohemian/openembedded,nzjrs/overo-openembedded,nx111/openembeded_openpli2.1_nx111,John-NY/overo-oe,crystalfontz/openembedded,yyli/overo-oe,YtvwlD/od-oe,KDAB/OpenEmbedded-Archos,thebohemian/openembedded,demsey/openenigma2,Martix/Eonos,sampov2/audio-openembedded,nx111/openembeded_openpli2.1_nx111,Martix/Eonos,xifengchuo/openembedded,libo/openembedded,troth/oe-ts7xxx,nzjrs/overo-openembedded,mrchapp/arago-oe-dev,sentient-energy/emsw-oe-mirror,libo/openembedded,mrchapp/arago-oe-dev,dellysunnymtech/sakoman-oe,rascalmicro/openembedded-rascal,JamesAng/oe,anguslees/openembedded-android,crystalfontz/openembedded,scottellis/overo-oe,openembedded/openembedded,John-NY/overo-oe,openembedded/openembedded,openembedded/openembedded,BlackPole/bp-openembedded,mrchapp/arago-oe-dev,JamesAng/goe,demsey/openenigma2,nlebedenco/mini2440,nzjrs/overo-openembedded,libo/openembedded,sledz/oe,thebohemian/openembedded,sentient-energy/emsw-oe-mirror,nzjrs/overo-openembedded,nvl1109/openembeded,demsey/openenigma2,John-NY/overo-oe,thebohemian/openembedded,buglabs/oe-buglabs,BlackPole/bp-openembedded,philb/pbcl-oe-2010,libo/openembedded,popazerty/openembedded-cuberevo,YtvwlD/od-oe,sampov2/audio-openembedded,mrchapp/arago-oe-dev,openembedded/openembedded,nzjrs/overo-openembedded,KDAB/OpenEmbedded-Archos,BlackPole/bp-openembedded,anguslees/openembedded-android,troth/oe-ts7xxx,buglabs/oe-buglabs,openembedded/openembedded,sledz/oe,nvl1109/openembeded,Martix/Eonos,trini/openembedded,xifengchuo/openembedded,crystalfontz/openembedded,dave-billin/overo-ui-moos-auv,dellysunnymtech/sakoman-oe,demsey/openenigma2,sutajiokousagi/openembedded,JamesAng/oe,hulifox008/openembedded,sentient-energy/emsw-oe-mirror,YtvwlD/od-oe,xifengchuo/openembedded,rascalmicro/openembedded-rascal,philb/pbcl-oe-2010,xifengchuo/openembedded,troth/oe-ts7xxx,yyli/overo-oe,troth/oe-ts7xxx,openpli-arm/openembedded,SIFTeam/openembedded,popazerty/openembedded-cuberevo,BlackPole/bp-openembedded,libo/openembedded,xifengchuo/openembedded,dellysunnymtech/sakoman-oe,bticino/openembedded,popazerty/openembedded-cuberevo,SIFTeam/openembedded,openembedded/openembedded,openembedded/openembedded,rascalmicro/openembedded-rascal,anguslees/openembedded-android,yyli/overo-oe,mrchapp/arago-oe-dev,openpli-arm/openembedded,yyli/overo-oe,nvl1109/openembeded,giobauermeister/openembedded,Martix/Eonos,anguslees/openembedded-android,xifengchuo/openembedded,nvl1109/openembeded,JamesAng/goe,nx111/openembeded_openpli2.1_nx111,nx111/openembeded_openpli2.1_nx111,philb/pbcl-oe-2010,dellysunnymtech/sakoman-oe,rascalmicro/openembedded-rascal,crystalfontz/openembedded,nlebedenco/mini2440,sampov2/audio-openembedded,libo/openembedded,yyli/overo-oe,demsey/openembedded,YtvwlD/od-oe,Martix/Eonos,hulifox008/openembedded,dave-billin/overo-ui-moos-auv,Martix/Eonos,JrCs/opendreambox,sledz/oe,nvl1109/openembeded,demsey/openenigma2,scottellis/overo-oe,openembedded/openembedded,xifengchuo/openembedded,trini/openembedded,sledz/oe,dellysunnymtech/sakoman-oe,rascalmicro/openembedded-rascal,openpli-arm/openembedded,giobauermeister/openembedded,SIFTeam/openembedded,BlackPole/bp-openembedded,nzjrs/overo-openembedded,demsey/openembedded,nx111/openembeded_openpli2.1_nx111,JamesAng/oe,sampov2/audio-openembedded,troth/oe-ts7xxx,dellysunnymtech/sakoman-oe,yyli/overo-oe,nvl1109/openembeded,giobauermeister/openembedded,nlebedenco/mini2440,giobauermeister/openembedded,rascalmicro/openembedded-rascal,demsey/openembedded,buglabs/oe-buglabs,dave-billin/overo-ui-moos-auv,xifengchuo/openembedded,sutajiokousagi/openembedded,sampov2/audio-openembedded,popazerty/openembedded-cuberevo,YtvwlD/od-oe,JrCs/opendreambox,nx111/openembeded_openpli2.1_nx111,JamesAng/goe,yyli/overo-oe,John-NY/overo-oe,crystalfontz/openembedded,JamesAng/oe,SIFTeam/openembedded,sutajiokousagi/openembedded,JrCs/opendreambox,scottellis/overo-oe,sutajiokousagi/openembedded,sledz/oe,SIFTeam/openembedded,nvl1109/openembeded,nlebedenco/mini2440,openpli-arm/openembedded,JrCs/opendreambox,demsey/openembedded,giobauermeister/openembedded,dellysunnymtech/sakoman-oe,hulifox008/openembedded,trini/openembedded,JamesAng/goe,demsey/openembedded,trini/openembedded,giobauermeister/openembedded,dave-billin/overo-ui-moos-auv,JrCs/opendreambox,JrCs/opendreambox,philb/pbcl-oe-2010,scottellis/overo-oe,sledz/oe,KDAB/OpenEmbedded-Archos,buglabs/oe-buglabs,rascalmicro/openembedded-rascal,nzjrs/overo-openembedded,hulifox008/openembedded,bticino/openembedded,openpli-arm/openembedded,sutajiokousagi/openembedded,crystalfontz/openembedded,hulifox008/openembedded,bticino/openembedded,dave-billin/overo-ui-moos-auv,KDAB/OpenEmbedded-Archos,BlackPole/bp-openembedded,nx111/openembeded_openpli2.1_nx111,JamesAng/oe,popazerty/openembedded-cuberevo,JamesAng/goe,anguslees/openembedded-android,sentient-energy/emsw-oe-mirror,buglabs/oe-buglabs,demsey/openenigma2,thebohemian/openembedded,philb/pbcl-oe-2010,anguslees/openembedded-android,giobauermeister/openembedded,JamesAng/oe,openembedded/openembedded,scottellis/overo-oe,sutajiokousagi/openembedded,John-NY/overo-oe,SIFTeam/openembedded,bticino/openembedded,hulifox008/openembedded,Martix/Eonos,demsey/openenigma2,rascalmicro/openembedded-rascal,YtvwlD/od-oe,scottellis/overo-oe,JamesAng/goe,philb/pbcl-oe-2010,JrCs/opendreambox,trini/openembedded | bitbake | ## Code Before:
include matchbox-panel.inc
PR="r5"
SRC_URI = "http://projects.o-hand.com/matchbox/sources/${PN}/0.9/${PN}-${PV}.tar.gz \
file://add_hostap.patch;patch=1 \
file://kernel2.6.patch;patch=1"
## Instruction:
matchbox-panel: Include patches to fix polling and cancellation of panel messages.
## Code After:
include matchbox-panel.inc
PR="r6"
SRC_URI = "http://projects.o-hand.com/matchbox/sources/${PN}/0.9/${PN}-${PV}.tar.gz \
file://add_hostap.patch;patch=1 \
http://handhelds.org/~pb/mb-panel-0.9.2-polling.patch;patch=1 \
http://handhelds.org/~pb/mb-panel-0.9.2-msgcancel.patch;patch=1 \
file://kernel2.6.patch;patch=1"
| include matchbox-panel.inc
- PR="r5"
? ^
+ PR="r6"
? ^
SRC_URI = "http://projects.o-hand.com/matchbox/sources/${PN}/0.9/${PN}-${PV}.tar.gz \
file://add_hostap.patch;patch=1 \
+ http://handhelds.org/~pb/mb-panel-0.9.2-polling.patch;patch=1 \
+ http://handhelds.org/~pb/mb-panel-0.9.2-msgcancel.patch;patch=1 \
file://kernel2.6.patch;patch=1"
| 4 | 0.5 | 3 | 1 |
42d206a5364616aa6b32f4cc217fcc57fa223d2a | src/components/markdown-render/inlineCode.js | src/components/markdown-render/inlineCode.js | import React from 'react';
import Highlight, { defaultProps } from 'prism-react-renderer';
import darkTheme from 'prism-react-renderer/themes/duotoneDark';
const InlineCode = ({ children, className, additionalPreClasses, theme }) => {
className = className ? '' : className;
const language = className.replace(/language-/, '');
return (
<Highlight
{...defaultProps}
code={children}
language={language}
theme={theme || darkTheme}
>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
<pre
className={`docs-code sprk-u-Measure ${className} ${additionalPreClasses}`}
style={{ ...style }}
>
{tokens.map((line, i) => (
<div key={i} {...getLineProps({ line, key: i })}>
{line.map((token, key) => (
<span key={key} {...getTokenProps({ token, key })} />
))}
</div>
))}
</pre>
)}
</Highlight>
);
};
export default InlineCode;
| import React from 'react';
import Highlight, { defaultProps } from 'prism-react-renderer';
import darkTheme from 'prism-react-renderer/themes/duotoneDark';
const InlineCode = ({ children, className, additionalPreClasses, theme }) => {
className = className ? className : '';
const language = className.replace(/language-/, '');
return (
<Highlight
{...defaultProps}
code={children}
language={language}
theme={theme || darkTheme}
>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
<pre
className={`docs-code sprk-u-Measure ${className} ${additionalPreClasses}`}
style={{ ...style }}
>
{tokens.map((line, i) => (
<div key={i} {...getLineProps({ line, key: i })}>
{line.map((token, key) => (
<span key={key} {...getTokenProps({ token, key })} />
))}
</div>
))}
</pre>
)}
</Highlight>
);
};
export default InlineCode;
| Fix code snippet codetype so it passes in correctly | Fix code snippet codetype so it passes in correctly
| JavaScript | mit | sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system,sparkdesignsystem/spark-design-system | javascript | ## Code Before:
import React from 'react';
import Highlight, { defaultProps } from 'prism-react-renderer';
import darkTheme from 'prism-react-renderer/themes/duotoneDark';
const InlineCode = ({ children, className, additionalPreClasses, theme }) => {
className = className ? '' : className;
const language = className.replace(/language-/, '');
return (
<Highlight
{...defaultProps}
code={children}
language={language}
theme={theme || darkTheme}
>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
<pre
className={`docs-code sprk-u-Measure ${className} ${additionalPreClasses}`}
style={{ ...style }}
>
{tokens.map((line, i) => (
<div key={i} {...getLineProps({ line, key: i })}>
{line.map((token, key) => (
<span key={key} {...getTokenProps({ token, key })} />
))}
</div>
))}
</pre>
)}
</Highlight>
);
};
export default InlineCode;
## Instruction:
Fix code snippet codetype so it passes in correctly
## Code After:
import React from 'react';
import Highlight, { defaultProps } from 'prism-react-renderer';
import darkTheme from 'prism-react-renderer/themes/duotoneDark';
const InlineCode = ({ children, className, additionalPreClasses, theme }) => {
className = className ? className : '';
const language = className.replace(/language-/, '');
return (
<Highlight
{...defaultProps}
code={children}
language={language}
theme={theme || darkTheme}
>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
<pre
className={`docs-code sprk-u-Measure ${className} ${additionalPreClasses}`}
style={{ ...style }}
>
{tokens.map((line, i) => (
<div key={i} {...getLineProps({ line, key: i })}>
{line.map((token, key) => (
<span key={key} {...getTokenProps({ token, key })} />
))}
</div>
))}
</pre>
)}
</Highlight>
);
};
export default InlineCode;
| import React from 'react';
import Highlight, { defaultProps } from 'prism-react-renderer';
import darkTheme from 'prism-react-renderer/themes/duotoneDark';
const InlineCode = ({ children, className, additionalPreClasses, theme }) => {
- className = className ? '' : className;
? -----
+ className = className ? className : '';
? +++++
const language = className.replace(/language-/, '');
return (
<Highlight
{...defaultProps}
code={children}
language={language}
theme={theme || darkTheme}
>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
<pre
className={`docs-code sprk-u-Measure ${className} ${additionalPreClasses}`}
style={{ ...style }}
>
{tokens.map((line, i) => (
<div key={i} {...getLineProps({ line, key: i })}>
{line.map((token, key) => (
<span key={key} {...getTokenProps({ token, key })} />
))}
</div>
))}
</pre>
)}
</Highlight>
);
};
export default InlineCode; | 2 | 0.060606 | 1 | 1 |
acf3f1d7836cacf0238c758508d7371ca9e4fb64 | test/ventilation_test.rb | test/ventilation_test.rb | require 'test_helper'
require 'ventilation/deep_stack'
class TestVentilation < Test::Unit::TestCase
context "a test consumer"do
setup do
FakeWeb.allow_net_connect = false
@consumer = TestConsumer.new
end
should "render external resource" do
expected = "response_from_example.com"
FakeWeb.register_uri(:get, "http://example.com/", :body => expected)
actual = @consumer.esi 'http://example.com/'
assert_equal expected, actual, "Expected response was not rendered by esi method"
end
should "use DeepStack to render internal resource" do
expected = 'rendered string'
response = mock()
response.expects(:body).returns(expected)
deep_stack = mock()
deep_stack.expects(:get).with(:index).returns(response)
Ventilation::DeepStack.expects(:new).with(WelcomeController).returns(deep_stack)
actual = @consumer.esi :index, :controller => :welcome
assert_equal expected, actual
end
end
end
# A consumer of the ApplicationHelper for testing purposes.
class TestConsumer
include ApplicationHelper
end
class WelcomeController
end
| require 'test_helper'
require 'ventilation/deep_stack'
class TestVentilation < Test::Unit::TestCase
context "a test consumer"do
setup do
FakeWeb.allow_net_connect = false
@consumer = TestConsumer.new
end
should "render external resource" do
expected = "response_from_example.com"
FakeWeb.register_uri(:get, "http://example.com/", :body => expected)
actual = @consumer.esi 'http://example.com/'
assert_equal expected, actual, "Expected response was not rendered by esi method"
end
should "render external resource with port number" do
expected = "response_from_example.com_port_4000"
FakeWeb.register_uri(:get, "http://example.com:4000/", :body => expected)
actual = @consumer.esi 'http://example.com:4000/'
assert_equal expected, actual, "Expected response was not rendered by esi method"
end
should "use DeepStack to render internal resource" do
expected = 'rendered string'
response = mock()
response.expects(:body).returns(expected)
deep_stack = mock()
deep_stack.expects(:get).with(:index).returns(response)
Ventilation::DeepStack.expects(:new).with(WelcomeController).returns(deep_stack)
actual = @consumer.esi :index, :controller => :welcome
assert_equal expected, actual
end
end
end
# A consumer of the ApplicationHelper for testing purposes.
class TestConsumer
include ApplicationHelper
end
class WelcomeController
end
| Add test to ensure port numbers are supported in external resources. | Add test to ensure port numbers are supported in external resources.
| Ruby | mit | agoragames/ventilation | ruby | ## Code Before:
require 'test_helper'
require 'ventilation/deep_stack'
class TestVentilation < Test::Unit::TestCase
context "a test consumer"do
setup do
FakeWeb.allow_net_connect = false
@consumer = TestConsumer.new
end
should "render external resource" do
expected = "response_from_example.com"
FakeWeb.register_uri(:get, "http://example.com/", :body => expected)
actual = @consumer.esi 'http://example.com/'
assert_equal expected, actual, "Expected response was not rendered by esi method"
end
should "use DeepStack to render internal resource" do
expected = 'rendered string'
response = mock()
response.expects(:body).returns(expected)
deep_stack = mock()
deep_stack.expects(:get).with(:index).returns(response)
Ventilation::DeepStack.expects(:new).with(WelcomeController).returns(deep_stack)
actual = @consumer.esi :index, :controller => :welcome
assert_equal expected, actual
end
end
end
# A consumer of the ApplicationHelper for testing purposes.
class TestConsumer
include ApplicationHelper
end
class WelcomeController
end
## Instruction:
Add test to ensure port numbers are supported in external resources.
## Code After:
require 'test_helper'
require 'ventilation/deep_stack'
class TestVentilation < Test::Unit::TestCase
context "a test consumer"do
setup do
FakeWeb.allow_net_connect = false
@consumer = TestConsumer.new
end
should "render external resource" do
expected = "response_from_example.com"
FakeWeb.register_uri(:get, "http://example.com/", :body => expected)
actual = @consumer.esi 'http://example.com/'
assert_equal expected, actual, "Expected response was not rendered by esi method"
end
should "render external resource with port number" do
expected = "response_from_example.com_port_4000"
FakeWeb.register_uri(:get, "http://example.com:4000/", :body => expected)
actual = @consumer.esi 'http://example.com:4000/'
assert_equal expected, actual, "Expected response was not rendered by esi method"
end
should "use DeepStack to render internal resource" do
expected = 'rendered string'
response = mock()
response.expects(:body).returns(expected)
deep_stack = mock()
deep_stack.expects(:get).with(:index).returns(response)
Ventilation::DeepStack.expects(:new).with(WelcomeController).returns(deep_stack)
actual = @consumer.esi :index, :controller => :welcome
assert_equal expected, actual
end
end
end
# A consumer of the ApplicationHelper for testing purposes.
class TestConsumer
include ApplicationHelper
end
class WelcomeController
end
| require 'test_helper'
require 'ventilation/deep_stack'
class TestVentilation < Test::Unit::TestCase
context "a test consumer"do
setup do
FakeWeb.allow_net_connect = false
@consumer = TestConsumer.new
end
should "render external resource" do
expected = "response_from_example.com"
FakeWeb.register_uri(:get, "http://example.com/", :body => expected)
+ actual = @consumer.esi 'http://example.com/'
+ assert_equal expected, actual, "Expected response was not rendered by esi method"
+ end
+ should "render external resource with port number" do
+ expected = "response_from_example.com_port_4000"
+ FakeWeb.register_uri(:get, "http://example.com:4000/", :body => expected)
- actual = @consumer.esi 'http://example.com/'
+ actual = @consumer.esi 'http://example.com:4000/'
? +++++
-
assert_equal expected, actual, "Expected response was not rendered by esi method"
end
should "use DeepStack to render internal resource" do
expected = 'rendered string'
response = mock()
response.expects(:body).returns(expected)
deep_stack = mock()
deep_stack.expects(:get).with(:index).returns(response)
Ventilation::DeepStack.expects(:new).with(WelcomeController).returns(deep_stack)
-
actual = @consumer.esi :index, :controller => :welcome
-
assert_equal expected, actual
end
end
end
# A consumer of the ApplicationHelper for testing purposes.
class TestConsumer
include ApplicationHelper
end
class WelcomeController
end | 11 | 0.255814 | 7 | 4 |
f26bd7920ebdcf7397d10a360091bf630e0969b5 | README.md | README.md | This is the repo for the reapp CLI. The CLI is used mainly for getting started
on projects and is really lightweight.
If you're looking for information on reapp, visit [reapp.io](http://reapp.io), or
view the code in [one of our repositories](https://github.com/reapp).
### Usage
### Todo
- adding platforms and building for them
### MIT Licensed | *reapp is just launching in alpha. These docs are far from complete and subject to change!*
### Installation
Installation is done through npm, though you can pick and choose any pieces you'd like
and roll your own stack. To get the reapp CLI:
```
npm install -g reapp
```
Once that's done you can generate a new base reapp stack with:
```
reapp new [name]
```
Where [name] is the name you'd like to give your new stack.
#### What does this give you?
reapp new is actually a simple wrapper that clones a bare repository that we've set up
to use the various reapp pieces optimally. We are working on having a few different
setups, from simple to advanced, that you can choose from when generating your app.
### CLI
The CLI has two main functions that it helps you with. The first is creating new apps.
For now, it simple makes a bare clone of a repo we keep updated with the current best-practice.
The goal is eventually to have a variety of baseline repo's to choose from.
It also lets you run your app, using [reapp-server](https://github.com/reapp/reapp-server).
reapp-server is a simple express server and webpack server that are designed to give you a modern JS stack.
### App Structure
You can see the exact app that's generated through the [reapp-starter repo](https://github.com/reapp/reapp-starter).
It's very simple for now:
```
/app
/components
/theme
app.js
routes.js
/config (optional)
```
If you place a build.webpack.js or run.webpack.js in your config folder, the reapp CLI
will use these configs instead of the pre-made ones. To see more on the default configs,
check out the files in `./config` the [reapp-pack repo](https://github.com/reapp/reapp-pack).
### Roadmap
Our initial goals are simple: focus on completeness and performance.
Followed by a complete theme for Android.
Down the road we'd like to achieve the following:
-
**Isomorphic** - Render first on server, pass data over
to client to continue from there (easily achievable).
-
**Responsive** - Support for tablet style interfaces
and JS-powered responsive styling.
-
**Physics** - A spring based physics library
into the animation library with an easy syntax.
-
**Interaction** - A simple, declarative interaction
library that can be composed well with reapp
### Platform
### Routes
### UI
### Development Environment
Sublime users, some helpful plugins for you to install:
- SublimeLinter
- eshint
- JavaScript Next - ES6 Syntax
#### MIT License
| Move getting started docs here | Move getting started docs here
| Markdown | mit | mzbac/reapp,jhopper28/reapp,beni55/reapp,loki315zx/reapp,cgvarela/reapp,dieface/reapp,hmmmmike/reapp,halilertekin/reapp,timuric/reapp,reapp/reapp,pandoraui/reapp,DisruptiveMind/reapp,kannans/reapp | markdown | ## Code Before:
This is the repo for the reapp CLI. The CLI is used mainly for getting started
on projects and is really lightweight.
If you're looking for information on reapp, visit [reapp.io](http://reapp.io), or
view the code in [one of our repositories](https://github.com/reapp).
### Usage
### Todo
- adding platforms and building for them
### MIT Licensed
## Instruction:
Move getting started docs here
## Code After:
*reapp is just launching in alpha. These docs are far from complete and subject to change!*
### Installation
Installation is done through npm, though you can pick and choose any pieces you'd like
and roll your own stack. To get the reapp CLI:
```
npm install -g reapp
```
Once that's done you can generate a new base reapp stack with:
```
reapp new [name]
```
Where [name] is the name you'd like to give your new stack.
#### What does this give you?
reapp new is actually a simple wrapper that clones a bare repository that we've set up
to use the various reapp pieces optimally. We are working on having a few different
setups, from simple to advanced, that you can choose from when generating your app.
### CLI
The CLI has two main functions that it helps you with. The first is creating new apps.
For now, it simple makes a bare clone of a repo we keep updated with the current best-practice.
The goal is eventually to have a variety of baseline repo's to choose from.
It also lets you run your app, using [reapp-server](https://github.com/reapp/reapp-server).
reapp-server is a simple express server and webpack server that are designed to give you a modern JS stack.
### App Structure
You can see the exact app that's generated through the [reapp-starter repo](https://github.com/reapp/reapp-starter).
It's very simple for now:
```
/app
/components
/theme
app.js
routes.js
/config (optional)
```
If you place a build.webpack.js or run.webpack.js in your config folder, the reapp CLI
will use these configs instead of the pre-made ones. To see more on the default configs,
check out the files in `./config` the [reapp-pack repo](https://github.com/reapp/reapp-pack).
### Roadmap
Our initial goals are simple: focus on completeness and performance.
Followed by a complete theme for Android.
Down the road we'd like to achieve the following:
-
**Isomorphic** - Render first on server, pass data over
to client to continue from there (easily achievable).
-
**Responsive** - Support for tablet style interfaces
and JS-powered responsive styling.
-
**Physics** - A spring based physics library
into the animation library with an easy syntax.
-
**Interaction** - A simple, declarative interaction
library that can be composed well with reapp
### Platform
### Routes
### UI
### Development Environment
Sublime users, some helpful plugins for you to install:
- SublimeLinter
- eshint
- JavaScript Next - ES6 Syntax
#### MIT License
| + *reapp is just launching in alpha. These docs are far from complete and subject to change!*
- This is the repo for the reapp CLI. The CLI is used mainly for getting started
- on projects and is really lightweight.
+ ### Installation
- If you're looking for information on reapp, visit [reapp.io](http://reapp.io), or
- view the code in [one of our repositories](https://github.com/reapp).
- ### Usage
+ Installation is done through npm, though you can pick and choose any pieces you'd like
+ and roll your own stack. To get the reapp CLI:
+
+ ```
+ npm install -g reapp
+ ```
+
+ Once that's done you can generate a new base reapp stack with:
+
+ ```
+ reapp new [name]
+ ```
+
+ Where [name] is the name you'd like to give your new stack.
+
+ #### What does this give you?
+
+ reapp new is actually a simple wrapper that clones a bare repository that we've set up
+ to use the various reapp pieces optimally. We are working on having a few different
+ setups, from simple to advanced, that you can choose from when generating your app.
+
+ ### CLI
+
+ The CLI has two main functions that it helps you with. The first is creating new apps.
+ For now, it simple makes a bare clone of a repo we keep updated with the current best-practice.
+ The goal is eventually to have a variety of baseline repo's to choose from.
+
+ It also lets you run your app, using [reapp-server](https://github.com/reapp/reapp-server).
+ reapp-server is a simple express server and webpack server that are designed to give you a modern JS stack.
+
+ ### App Structure
+
+ You can see the exact app that's generated through the [reapp-starter repo](https://github.com/reapp/reapp-starter).
+ It's very simple for now:
+
+ ```
+ /app
+ /components
+ /theme
+ app.js
+ routes.js
+ /config (optional)
+ ```
+
+ If you place a build.webpack.js or run.webpack.js in your config folder, the reapp CLI
+ will use these configs instead of the pre-made ones. To see more on the default configs,
+ check out the files in `./config` the [reapp-pack repo](https://github.com/reapp/reapp-pack).
+
+ ### Roadmap
+
+ Our initial goals are simple: focus on completeness and performance.
+ Followed by a complete theme for Android.
+
+ Down the road we'd like to achieve the following:
+
+ -
+ **Isomorphic** - Render first on server, pass data over
+ to client to continue from there (easily achievable).
+
+ -
+ **Responsive** - Support for tablet style interfaces
+ and JS-powered responsive styling.
+
+ -
+ **Physics** - A spring based physics library
+ into the animation library with an easy syntax.
+
+ -
+ **Interaction** - A simple, declarative interaction
+ library that can be composed well with reapp
+
+ ### Platform
+ ### Routes
- ### Todo
- - adding platforms and building for them
+
+ ### UI
+
+
+ ### Development Environment
+
+ Sublime users, some helpful plugins for you to install:
+
+ - SublimeLinter
+ - eshint
+ - JavaScript Next - ES6 Syntax
+
- ### MIT Licensed
? -
+ #### MIT License
? +
| 96 | 7.384615 | 88 | 8 |
9c06c927cb6840de0c1e04dc1cddf811f17b6c39 | source/components/SearchBox.js | source/components/SearchBox.js | import React from 'react'
import debounce from 'lodash/debounce'
const searchFor = debounce(term => window.routerHistory.push(`/search/${term}`), 500)
export default class SearchBox extends React.Component {
static defaultProps = {
className: '',
placeholder: 'Search...',
term: '',
}
constructor(props) {
super(props)
this.state = { term: props.term }
}
componentDidMount() { window.addEventListener('keyup', this.onKeyUp) }
componentWillReceiveProps(props) {
if (props.term !== this.state.term) this.setState({ term: props.term })
}
componentWillUnmount() { window.removeEventListener('keyup', this.onKeyUp) }
onKeyUp = (e) => {
if (e.ctrlKey && e.shiftKey && e.code === 'KeyF') {
e.preventDefault()
e.stopPropagation()
this.input.focus()
}
}
createRef = (input) => { this.input = input }
render() {
const { className, placeholder } = this.props
return (
<div className={`search-box ${className}`}>
<input type="text"
placeholder={placeholder}
value={this.state.term}
onChange={(event) => {
this.setState({ term: event.target.value })
searchFor(event.target.value)
}}
ref={this.createRef}
/>
<i className="icon icon-search fa" />
</div>
)
}
}
| import React from 'react'
import debounce from 'lodash/debounce'
const searchFor = debounce(term => window.routerHistory.push(`/search/${term}`), 500)
export default class SearchBox extends React.Component {
static defaultProps = {
className: '',
placeholder: 'Search... (Ctrl+Shift+F)',
term: '',
}
constructor(props) {
super(props)
this.state = { term: props.term }
}
componentDidMount() { window.addEventListener('keyup', this.onKeyUp) }
componentWillReceiveProps(props) {
if (props.term !== this.state.term) this.setState({ term: props.term })
}
componentWillUnmount() { window.removeEventListener('keyup', this.onKeyUp) }
onKeyUp = (e) => {
if (e.ctrlKey && e.shiftKey && e.code === 'KeyF') {
e.preventDefault()
e.stopPropagation()
this.input.focus()
}
}
createRef = (input) => { this.input = input }
render() {
const { className, placeholder } = this.props
return (
<div className={`search-box ${className}`}>
<input type="text"
placeholder={placeholder}
value={this.state.term}
onChange={(event) => {
this.setState({ term: event.target.value })
searchFor(event.target.value)
}}
ref={this.createRef}
/>
<i className="icon icon-search fa" />
</div>
)
}
}
| Add hotkey info to placeholder text | Add hotkey info to placeholder text
| JavaScript | mit | TroyAlford/axis-wiki,TroyAlford/axis-wiki | javascript | ## Code Before:
import React from 'react'
import debounce from 'lodash/debounce'
const searchFor = debounce(term => window.routerHistory.push(`/search/${term}`), 500)
export default class SearchBox extends React.Component {
static defaultProps = {
className: '',
placeholder: 'Search...',
term: '',
}
constructor(props) {
super(props)
this.state = { term: props.term }
}
componentDidMount() { window.addEventListener('keyup', this.onKeyUp) }
componentWillReceiveProps(props) {
if (props.term !== this.state.term) this.setState({ term: props.term })
}
componentWillUnmount() { window.removeEventListener('keyup', this.onKeyUp) }
onKeyUp = (e) => {
if (e.ctrlKey && e.shiftKey && e.code === 'KeyF') {
e.preventDefault()
e.stopPropagation()
this.input.focus()
}
}
createRef = (input) => { this.input = input }
render() {
const { className, placeholder } = this.props
return (
<div className={`search-box ${className}`}>
<input type="text"
placeholder={placeholder}
value={this.state.term}
onChange={(event) => {
this.setState({ term: event.target.value })
searchFor(event.target.value)
}}
ref={this.createRef}
/>
<i className="icon icon-search fa" />
</div>
)
}
}
## Instruction:
Add hotkey info to placeholder text
## Code After:
import React from 'react'
import debounce from 'lodash/debounce'
const searchFor = debounce(term => window.routerHistory.push(`/search/${term}`), 500)
export default class SearchBox extends React.Component {
static defaultProps = {
className: '',
placeholder: 'Search... (Ctrl+Shift+F)',
term: '',
}
constructor(props) {
super(props)
this.state = { term: props.term }
}
componentDidMount() { window.addEventListener('keyup', this.onKeyUp) }
componentWillReceiveProps(props) {
if (props.term !== this.state.term) this.setState({ term: props.term })
}
componentWillUnmount() { window.removeEventListener('keyup', this.onKeyUp) }
onKeyUp = (e) => {
if (e.ctrlKey && e.shiftKey && e.code === 'KeyF') {
e.preventDefault()
e.stopPropagation()
this.input.focus()
}
}
createRef = (input) => { this.input = input }
render() {
const { className, placeholder } = this.props
return (
<div className={`search-box ${className}`}>
<input type="text"
placeholder={placeholder}
value={this.state.term}
onChange={(event) => {
this.setState({ term: event.target.value })
searchFor(event.target.value)
}}
ref={this.createRef}
/>
<i className="icon icon-search fa" />
</div>
)
}
}
| import React from 'react'
import debounce from 'lodash/debounce'
const searchFor = debounce(term => window.routerHistory.push(`/search/${term}`), 500)
export default class SearchBox extends React.Component {
static defaultProps = {
className: '',
- placeholder: 'Search...',
+ placeholder: 'Search... (Ctrl+Shift+F)',
? +++++++++++++++
term: '',
}
constructor(props) {
super(props)
this.state = { term: props.term }
}
componentDidMount() { window.addEventListener('keyup', this.onKeyUp) }
componentWillReceiveProps(props) {
if (props.term !== this.state.term) this.setState({ term: props.term })
}
componentWillUnmount() { window.removeEventListener('keyup', this.onKeyUp) }
onKeyUp = (e) => {
if (e.ctrlKey && e.shiftKey && e.code === 'KeyF') {
e.preventDefault()
e.stopPropagation()
this.input.focus()
}
}
createRef = (input) => { this.input = input }
render() {
const { className, placeholder } = this.props
return (
<div className={`search-box ${className}`}>
<input type="text"
placeholder={placeholder}
value={this.state.term}
onChange={(event) => {
this.setState({ term: event.target.value })
searchFor(event.target.value)
}}
ref={this.createRef}
/>
<i className="icon icon-search fa" />
</div>
)
}
} | 2 | 0.040816 | 1 | 1 |
fe91bf90878dab94ef30ebeffdd8a8c386c25e22 | app/assets/stylesheets/spree/frontend/spree_static_content.css | app/assets/stylesheets/spree/frontend/spree_static_content.css | /*
*= require spree/frontend
*/
/* Sidebar */
nav#pages .pages-root {
text-transform: uppercase;
border-bottom: 1px solid rgb(217, 217, 219);
margin-bottom: 5px;
font-size: 14px;
} | /* Sidebar */
nav#pages .pages-root {
text-transform: uppercase;
border-bottom: 1px solid rgb(217, 217, 219);
margin-bottom: 5px;
font-size: 14px;
}
| Remove the "require spree/frontend" directive from the main css. This will allow Spree applications that use different front end stylesheet to install the extension | Remove the "require spree/frontend" directive from the main css.
This will allow Spree applications that use different front end stylesheet to install the extension
| CSS | bsd-3-clause | Dkendal/solidus_static_content,Dkendal/solidus_static_content,Dkendal/solidus_static_content | css | ## Code Before:
/*
*= require spree/frontend
*/
/* Sidebar */
nav#pages .pages-root {
text-transform: uppercase;
border-bottom: 1px solid rgb(217, 217, 219);
margin-bottom: 5px;
font-size: 14px;
}
## Instruction:
Remove the "require spree/frontend" directive from the main css.
This will allow Spree applications that use different front end stylesheet to install the extension
## Code After:
/* Sidebar */
nav#pages .pages-root {
text-transform: uppercase;
border-bottom: 1px solid rgb(217, 217, 219);
margin-bottom: 5px;
font-size: 14px;
}
| - /*
- *= require spree/frontend
- */
-
/* Sidebar */
nav#pages .pages-root {
text-transform: uppercase;
border-bottom: 1px solid rgb(217, 217, 219);
margin-bottom: 5px;
font-size: 14px;
} | 4 | 0.363636 | 0 | 4 |
7b50a9f84bd5669e2ef98a3a1bde62322571000f | css/legend.css | css/legend.css | .legend {
background-color: white;
z-index: 10;
background-color: #F0F0F0;
overflow: hidden;
}
.tile-legend {
padding: 0.5em;
}
.legend-label {
padding: 0.5em;
font-size: small;
font-weight: bold;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.legend-chart {
padding-left: 0.4em;
}
.legend-chart rect.highlight {
stroke: black;
}
.legend-chart text {
font-size: xx-small;
} | .legend {
top: calc(100% - 10em);
background-color: white;
z-index: 10;
background-color: #F0F0F0;
overflow: hidden;
}
.tile-legend {
padding: 0.5em;
}
.legend-label {
padding: 0.5em;
font-size: small;
font-weight: bold;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.legend-chart {
padding-left: 0.4em;
}
.legend-chart rect.highlight {
stroke: black;
}
.legend-chart text {
font-size: xx-small;
} | Revert "Made key not disappear off the screen." | Revert "Made key not disappear off the screen."
This reverts commit 3b3e187d9fc078d2a522fbf383aa8892fd53b48e.
| CSS | mit | cse-bristol/energy-efficiency-planner,cse-bristol/energy-efficiency-planner,cse-bristol/energy-efficiency-planner | css | ## Code Before:
.legend {
background-color: white;
z-index: 10;
background-color: #F0F0F0;
overflow: hidden;
}
.tile-legend {
padding: 0.5em;
}
.legend-label {
padding: 0.5em;
font-size: small;
font-weight: bold;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.legend-chart {
padding-left: 0.4em;
}
.legend-chart rect.highlight {
stroke: black;
}
.legend-chart text {
font-size: xx-small;
}
## Instruction:
Revert "Made key not disappear off the screen."
This reverts commit 3b3e187d9fc078d2a522fbf383aa8892fd53b48e.
## Code After:
.legend {
top: calc(100% - 10em);
background-color: white;
z-index: 10;
background-color: #F0F0F0;
overflow: hidden;
}
.tile-legend {
padding: 0.5em;
}
.legend-label {
padding: 0.5em;
font-size: small;
font-weight: bold;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.legend-chart {
padding-left: 0.4em;
}
.legend-chart rect.highlight {
stroke: black;
}
.legend-chart text {
font-size: xx-small;
} | .legend {
+ top: calc(100% - 10em);
background-color: white;
z-index: 10;
background-color: #F0F0F0;
overflow: hidden;
}
.tile-legend {
padding: 0.5em;
}
.legend-label {
padding: 0.5em;
font-size: small;
font-weight: bold;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.legend-chart {
padding-left: 0.4em;
}
.legend-chart rect.highlight {
stroke: black;
}
.legend-chart text {
font-size: xx-small;
} | 1 | 0.032258 | 1 | 0 |
e68a10031d7dcd9286f8c0fc32648d2f5ff93754 | public/js/module/application/partial/subject-list.html | public/js/module/application/partial/subject-list.html | <div data-ng-controller="application.controller.list">
<div class="row-fluid">
<div class="span12">
<div class="row-fluid">
<div class="span6">
<h3>Subjects</h3>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<div subject-list data-limit="{{listParams.limit}}" data-order-string="{{listParams.orderString}}" data-offset="{{listParams.offset}}" data-where-string="{{listParams.whereString}}">Loading subjects...</div>
</div>
</div>
</div>
</div>
</div> | <div data-ng-controller="application.controller.list">
<div class="row-fluid">
<div class="span12">
<div class="row-fluid">
<div class="span6">
<h3>Subjects</h3>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<div subject-list data-limit="{{listParams.limit}}" data-order-string="{{listParams.orderString}}" data-offset="{{listParams.offset}}" data-where-string="{{listParams.whereString}}" data-sort-filter="true">Loading subjects...</div>
</div>
</div>
</div>
</div>
</div> | Fix for the home panels. | Fix for the home panels.
| HTML | bsd-3-clause | Gergling/opinionator,Gergling/opinionator | html | ## Code Before:
<div data-ng-controller="application.controller.list">
<div class="row-fluid">
<div class="span12">
<div class="row-fluid">
<div class="span6">
<h3>Subjects</h3>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<div subject-list data-limit="{{listParams.limit}}" data-order-string="{{listParams.orderString}}" data-offset="{{listParams.offset}}" data-where-string="{{listParams.whereString}}">Loading subjects...</div>
</div>
</div>
</div>
</div>
</div>
## Instruction:
Fix for the home panels.
## Code After:
<div data-ng-controller="application.controller.list">
<div class="row-fluid">
<div class="span12">
<div class="row-fluid">
<div class="span6">
<h3>Subjects</h3>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<div subject-list data-limit="{{listParams.limit}}" data-order-string="{{listParams.orderString}}" data-offset="{{listParams.offset}}" data-where-string="{{listParams.whereString}}" data-sort-filter="true">Loading subjects...</div>
</div>
</div>
</div>
</div>
</div> | <div data-ng-controller="application.controller.list">
<div class="row-fluid">
<div class="span12">
<div class="row-fluid">
<div class="span6">
<h3>Subjects</h3>
</div>
</div>
<div class="row-fluid">
<div class="span6">
- <div subject-list data-limit="{{listParams.limit}}" data-order-string="{{listParams.orderString}}" data-offset="{{listParams.offset}}" data-where-string="{{listParams.whereString}}">Loading subjects...</div>
+ <div subject-list data-limit="{{listParams.limit}}" data-order-string="{{listParams.orderString}}" data-offset="{{listParams.offset}}" data-where-string="{{listParams.whereString}}" data-sort-filter="true">Loading subjects...</div>
? ++++++++++++++++++++++++
</div>
</div>
</div>
</div>
</div> | 2 | 0.125 | 1 | 1 |
1a4a2795b920286bf71b46f021fa80f43ce27723 | README.md | README.md |
To run the Fishy game, you need to add the Slick2D library to your project path.
The following steps were taken to include Slick2D into Eclipse:
[Download steps]
- Download Slick2D from http://slick.ninjacave.com/slick.zip
- Unpack the zip file to a preferred location, for example at /lib/slick
- Navigate to the 'lib' folder inside the unpacked folder
- Unpack the native-{platform}.jar file for your platform OS
[Eclipse steps]
- Open the project properties in Eclipse and navigate to "Java build Path"
- Click on "Add new library", followed by "User Library"
- Create a new user library named Slick2D and click "Next"
- Select the added "Slick2D" entry and click on "Add external JARs"
- Navigate to the location of the unpacked zip-file and open the folder 'lib'
- Select the following files: lwjgl.jar, slick.jar, jinput.jar and lwjgl_util.jar
- Select the "Native library location" in the "Slick2D" entry and click on 'edit'
- Navigate to the unpacked 'native' folder and select it
- Click on 'Apply' to update the Project Path and you should be able to use Slick2D
| To run the Fishy game, you need to add the Slick2D library to your project path.
The following steps were taken to include Slick2D into Eclipse:
[Download steps]
- Download Slick2D from http://slick.ninjacave.com/slick.zip
- Unpack the zip file to a preferred location, for example at /lib/slick
- Navigate to the 'lib' folder inside the unpacked folder
- Unpack the native-{platform}.jar file for your platform OS
[Eclipse steps]
- Open the project properties in Eclipse and navigate to "Java build Path"
- Click on "Add new library", followed by "User Library"
- Create a new user library named Slick2D and click "Next"
- Select the added "Slick2D" entry and click on "Add external JARs"
- Navigate to the location of the unpacked zip-file and open the folder 'lib'
- Select the following files: lwjgl.jar, slick.jar, jinput.jar and lwjgl_util.jar
- Select the "Native library location" in the "Slick2D" entry and click on 'edit'
- Navigate to the unpacked 'native' folder and select it
- Click on 'Apply' to update the Project Path and you should be able to use Slick2D
[](https://travis-ci.org/martijn9612/fishy)
[](https://coveralls.io/github/martijn9612/fishy?branch=development)
| Add build and code coverage badges to Readme.md | Add build and code coverage badges to Readme.md | Markdown | mit | martijn9612/fishy | markdown | ## Code Before:
To run the Fishy game, you need to add the Slick2D library to your project path.
The following steps were taken to include Slick2D into Eclipse:
[Download steps]
- Download Slick2D from http://slick.ninjacave.com/slick.zip
- Unpack the zip file to a preferred location, for example at /lib/slick
- Navigate to the 'lib' folder inside the unpacked folder
- Unpack the native-{platform}.jar file for your platform OS
[Eclipse steps]
- Open the project properties in Eclipse and navigate to "Java build Path"
- Click on "Add new library", followed by "User Library"
- Create a new user library named Slick2D and click "Next"
- Select the added "Slick2D" entry and click on "Add external JARs"
- Navigate to the location of the unpacked zip-file and open the folder 'lib'
- Select the following files: lwjgl.jar, slick.jar, jinput.jar and lwjgl_util.jar
- Select the "Native library location" in the "Slick2D" entry and click on 'edit'
- Navigate to the unpacked 'native' folder and select it
- Click on 'Apply' to update the Project Path and you should be able to use Slick2D
## Instruction:
Add build and code coverage badges to Readme.md
## Code After:
To run the Fishy game, you need to add the Slick2D library to your project path.
The following steps were taken to include Slick2D into Eclipse:
[Download steps]
- Download Slick2D from http://slick.ninjacave.com/slick.zip
- Unpack the zip file to a preferred location, for example at /lib/slick
- Navigate to the 'lib' folder inside the unpacked folder
- Unpack the native-{platform}.jar file for your platform OS
[Eclipse steps]
- Open the project properties in Eclipse and navigate to "Java build Path"
- Click on "Add new library", followed by "User Library"
- Create a new user library named Slick2D and click "Next"
- Select the added "Slick2D" entry and click on "Add external JARs"
- Navigate to the location of the unpacked zip-file and open the folder 'lib'
- Select the following files: lwjgl.jar, slick.jar, jinput.jar and lwjgl_util.jar
- Select the "Native library location" in the "Slick2D" entry and click on 'edit'
- Navigate to the unpacked 'native' folder and select it
- Click on 'Apply' to update the Project Path and you should be able to use Slick2D
[](https://travis-ci.org/martijn9612/fishy)
[](https://coveralls.io/github/martijn9612/fishy?branch=development)
| -
To run the Fishy game, you need to add the Slick2D library to your project path.
The following steps were taken to include Slick2D into Eclipse:
[Download steps]
- Download Slick2D from http://slick.ninjacave.com/slick.zip
- Unpack the zip file to a preferred location, for example at /lib/slick
- Navigate to the 'lib' folder inside the unpacked folder
- Unpack the native-{platform}.jar file for your platform OS
[Eclipse steps]
- Open the project properties in Eclipse and navigate to "Java build Path"
- Click on "Add new library", followed by "User Library"
- Create a new user library named Slick2D and click "Next"
- Select the added "Slick2D" entry and click on "Add external JARs"
- Navigate to the location of the unpacked zip-file and open the folder 'lib'
- Select the following files: lwjgl.jar, slick.jar, jinput.jar and lwjgl_util.jar
- Select the "Native library location" in the "Slick2D" entry and click on 'edit'
- Navigate to the unpacked 'native' folder and select it
- Click on 'Apply' to update the Project Path and you should be able to use Slick2D
+
+ [](https://travis-ci.org/martijn9612/fishy)
+ [](https://coveralls.io/github/martijn9612/fishy?branch=development) | 4 | 0.190476 | 3 | 1 |
36d283d028b580b992ddf5e700782bb80b58c356 | app/routes/dashboard.php | app/routes/dashboard.php | <?php
Route::group(['before' => 'auth', 'prefix' => 'dashboard'], function() {
Route::get('/', ['as' => 'dashboard', 'uses' => 'DashboardController@showDashboard']);
// TODO: Switch for Route::controller?
Route::get('components', ['as' => 'dashboard.components', 'uses' => 'DashComponentController@showComponents']);
Route::get('components/add', ['as' => 'dashboard.components.add', 'uses' => 'DashComponentController@showAddComponent']);
Route::post('components/add', 'DashComponentController@createComponentAction');
Route::get('components/{component}/delete', 'DashComponentController@deleteComponentAction');
Route::get('incidents', ['as' => 'dashboard.incidents', 'uses' => 'DashIncidentController@showIncidents']);
Route::get('incidents/add', ['as' => 'dashboard.incidents.add', 'uses' => 'DashIncidentController@showAddIncident']);
Route::post('incidents/add', 'DashIncidentController@createIncidentAction');
Route::get('metrics', ['as' => 'dashboard.metrics', 'uses' => 'DashboardController@showMetrics']);
Route::get('notifications', ['as' => 'dashboard.notifications', 'uses' => 'DashboardController@showNotifications']);
Route::get('status-page', ['as' => 'dashboard.status-page', 'uses' => 'DashboardController@showStatusPage']);
Route::get('settings', ['as' => 'dashboard.settings', 'uses' => 'DashSettingsController@showSettings']);
Route::post('settings', 'DashSettingsController@postSettings');
});
| <?php
Route::group(['before' => 'auth', 'prefix' => 'dashboard'], function() {
Route::get('/', ['as' => 'dashboard', 'uses' => 'DashboardController@showDashboard']);
Route::get('components', ['as' => 'dashboard.components', 'uses' => 'DashComponentController@showComponents']);
Route::get('components/add', ['as' => 'dashboard.components.add', 'uses' => 'DashComponentController@showAddComponent']);
Route::post('components/add', 'DashComponentController@createComponentAction');
Route::get('components/{component}/delete', 'DashComponentController@deleteComponentAction');
Route::get('incidents', ['as' => 'dashboard.incidents', 'uses' => 'DashIncidentController@showIncidents']);
Route::get('incidents/add', ['as' => 'dashboard.incidents.add', 'uses' => 'DashIncidentController@showAddIncident']);
Route::post('incidents/add', 'DashIncidentController@createIncidentAction');
Route::get('metrics', ['as' => 'dashboard.metrics', 'uses' => 'DashboardController@showMetrics']);
Route::get('notifications', ['as' => 'dashboard.notifications', 'uses' => 'DashboardController@showNotifications']);
Route::get('status-page', ['as' => 'dashboard.status-page', 'uses' => 'DashboardController@showStatusPage']);
Route::get('settings', ['as' => 'dashboard.settings', 'uses' => 'DashSettingsController@showSettings']);
Route::post('settings', 'DashSettingsController@postSettings');
});
| Remove TODO, will probably not need to do this now | Remove TODO, will probably not need to do this now
| PHP | bsd-3-clause | ephillipe/Cachet,CloudA/Cachet,displayn/Cachet,Mebus/Cachet,n0mer/Cachet,ZengineChris/Cachet,pellaeon/Cachet,alobintechnologies/Cachet,bthiago/Cachet,ephillipe/Cachet,karaktaka/Cachet,anujaprasad/Hihat,elektropay/Cachet,wngravette/Cachet,Mebus/Cachet,SamuelMoraesF/Cachet,everpay/Cachet,murendie/Cachet,eduardocruz/Cachet,n0mer/Cachet,MatheusRV/Cachet-Sandstorm,nxtreaming/Cachet,SamuelMoraesF/Cachet,Surventrix/Cachet,clbn/Cachet,0x73/Cachet,ematthews/Cachet,g-forks/Cachet,brianjking/openshift-cachet,g-forks/Cachet,everpay/Cachet,MatheusRV/Cachet-Sandstorm,NossaJureg/Cachet,ZengineChris/Cachet,coupej/Cachet,withings-sas/Cachet,robglas/Cachet,gm-ah/Cachet,clbn/Cachet,brianjking/openshift-cachet,gm-ah/Cachet,Surventrix/Cachet,karaktaka/Cachet,g-forks/Cachet,pellaeon/Cachet,billmn/Cachet,murendie/Cachet,anujaprasad/Hihat,bthiago/Cachet,MatheusRV/Cachet-Sandstorm,billmn/Cachet,NossaJureg/Cachet,pellaeon/Cachet,ZengineChris/Cachet,wakermahmud/Cachet,h3zjp/Cachet,wngravette/Cachet,CloudA/Cachet,rogerapras/Cachet,sapk/Cachet,leegeng/Cachet,billmn/Cachet,NossaJureg/Cachet,robglas/Cachet,coupej/Cachet,wakermahmud/Cachet,SamuelMoraesF/Cachet,anujaprasad/Hihat,MicroWorldwide/Cachet,withings-sas/Cachet,cachethq/Cachet,cachethq/Cachet,rogerapras/Cachet,h3zjp/Cachet,0x73/Cachet,withings-sas/Cachet,displayn/Cachet,alobintechnologies/Cachet,whealmedia/Cachet,brianjking/openshift-cachet,nxtreaming/Cachet,sapk/Cachet,ematthews/Cachet,MicroWorldwide/Cachet,eduardocruz/Cachet,n0mer/Cachet,ephillipe/Cachet,elektropay/Cachet,ematthews/Cachet,chaseconey/Cachet,elektropay/Cachet,murendie/Cachet,h3zjp/Cachet,rogerapras/Cachet,whealmedia/Cachet,Mebus/Cachet,wakermahmud/Cachet,katzien/Cachet,MatheusRV/Cachet-Sandstorm,bthiago/Cachet,coupej/Cachet,chaseconey/Cachet,eduardocruz/Cachet,leegeng/Cachet,chaseconey/Cachet,MatheusRV/Cachet-Sandstorm,katzien/Cachet,coreation/Cachet,sapk/Cachet,coreation/Cachet,karaktaka/Cachet | php | ## Code Before:
<?php
Route::group(['before' => 'auth', 'prefix' => 'dashboard'], function() {
Route::get('/', ['as' => 'dashboard', 'uses' => 'DashboardController@showDashboard']);
// TODO: Switch for Route::controller?
Route::get('components', ['as' => 'dashboard.components', 'uses' => 'DashComponentController@showComponents']);
Route::get('components/add', ['as' => 'dashboard.components.add', 'uses' => 'DashComponentController@showAddComponent']);
Route::post('components/add', 'DashComponentController@createComponentAction');
Route::get('components/{component}/delete', 'DashComponentController@deleteComponentAction');
Route::get('incidents', ['as' => 'dashboard.incidents', 'uses' => 'DashIncidentController@showIncidents']);
Route::get('incidents/add', ['as' => 'dashboard.incidents.add', 'uses' => 'DashIncidentController@showAddIncident']);
Route::post('incidents/add', 'DashIncidentController@createIncidentAction');
Route::get('metrics', ['as' => 'dashboard.metrics', 'uses' => 'DashboardController@showMetrics']);
Route::get('notifications', ['as' => 'dashboard.notifications', 'uses' => 'DashboardController@showNotifications']);
Route::get('status-page', ['as' => 'dashboard.status-page', 'uses' => 'DashboardController@showStatusPage']);
Route::get('settings', ['as' => 'dashboard.settings', 'uses' => 'DashSettingsController@showSettings']);
Route::post('settings', 'DashSettingsController@postSettings');
});
## Instruction:
Remove TODO, will probably not need to do this now
## Code After:
<?php
Route::group(['before' => 'auth', 'prefix' => 'dashboard'], function() {
Route::get('/', ['as' => 'dashboard', 'uses' => 'DashboardController@showDashboard']);
Route::get('components', ['as' => 'dashboard.components', 'uses' => 'DashComponentController@showComponents']);
Route::get('components/add', ['as' => 'dashboard.components.add', 'uses' => 'DashComponentController@showAddComponent']);
Route::post('components/add', 'DashComponentController@createComponentAction');
Route::get('components/{component}/delete', 'DashComponentController@deleteComponentAction');
Route::get('incidents', ['as' => 'dashboard.incidents', 'uses' => 'DashIncidentController@showIncidents']);
Route::get('incidents/add', ['as' => 'dashboard.incidents.add', 'uses' => 'DashIncidentController@showAddIncident']);
Route::post('incidents/add', 'DashIncidentController@createIncidentAction');
Route::get('metrics', ['as' => 'dashboard.metrics', 'uses' => 'DashboardController@showMetrics']);
Route::get('notifications', ['as' => 'dashboard.notifications', 'uses' => 'DashboardController@showNotifications']);
Route::get('status-page', ['as' => 'dashboard.status-page', 'uses' => 'DashboardController@showStatusPage']);
Route::get('settings', ['as' => 'dashboard.settings', 'uses' => 'DashSettingsController@showSettings']);
Route::post('settings', 'DashSettingsController@postSettings');
});
| <?php
Route::group(['before' => 'auth', 'prefix' => 'dashboard'], function() {
Route::get('/', ['as' => 'dashboard', 'uses' => 'DashboardController@showDashboard']);
- // TODO: Switch for Route::controller?
Route::get('components', ['as' => 'dashboard.components', 'uses' => 'DashComponentController@showComponents']);
Route::get('components/add', ['as' => 'dashboard.components.add', 'uses' => 'DashComponentController@showAddComponent']);
Route::post('components/add', 'DashComponentController@createComponentAction');
Route::get('components/{component}/delete', 'DashComponentController@deleteComponentAction');
Route::get('incidents', ['as' => 'dashboard.incidents', 'uses' => 'DashIncidentController@showIncidents']);
Route::get('incidents/add', ['as' => 'dashboard.incidents.add', 'uses' => 'DashIncidentController@showAddIncident']);
Route::post('incidents/add', 'DashIncidentController@createIncidentAction');
Route::get('metrics', ['as' => 'dashboard.metrics', 'uses' => 'DashboardController@showMetrics']);
Route::get('notifications', ['as' => 'dashboard.notifications', 'uses' => 'DashboardController@showNotifications']);
Route::get('status-page', ['as' => 'dashboard.status-page', 'uses' => 'DashboardController@showStatusPage']);
Route::get('settings', ['as' => 'dashboard.settings', 'uses' => 'DashSettingsController@showSettings']);
Route::post('settings', 'DashSettingsController@postSettings');
}); | 1 | 0.047619 | 0 | 1 |
910d22714fbb0fd2a259ca66350ba0634b5f1ea1 | app/mutations/points/update.rb | app/mutations/points/update.rb | module Points
class Update < Mutations::Command
required do
model :device, class: Device
model :point, class: Point
end
optional do
integer :tool_id, nils: true, empty_is_nil: true
float :x
float :y
float :z
float :radius
string :name
string :openfarm_slug
hstore :meta
end
def validate
throw "BRB" if (tool_id &&
!device
.tools
.pluck(:id)
.include?(tool_id))
end
def execute
point.update_attributes!(update_params) && point
end
private
def update_params
point
.pointer
.assign_attributes(inputs.slice(:tool_id, :openfarm_slug))
inputs
.slice(*Point::SHARED_FIELDS)
.merge(pointer: point.pointer)
end
end
end
| module Points
class Update < Mutations::Command
required do
model :device, class: Device
model :point, class: Point
end
optional do
integer :tool_id, nils: true, empty_is_nil: true
float :x
float :y
float :z
float :radius
string :name
string :openfarm_slug
hstore :meta
end
def validate
throw "BRB" if (tool_id &&
!device
.tools
.pluck(:id)
.include?(tool_id))
end
def execute
point.update_attributes!(update_params) && point
end
private
def update_params
maybe_update_pointer
inputs
.slice(*Point::SHARED_FIELDS)
.merge(pointer: point.pointer)
end
def maybe_update_pointer
p = point.pointer
p && p.assign_attributes(inputs.slice(:tool_id, :openfarm_slug))
end
end
end
| Bring back drop down back. Next: Fix label name | Bring back drop down back. Next: Fix label name
| Ruby | mit | RickCarlino/farmbot-web-app,MrChristofferson/Farmbot-Web-API,FarmBot/Farmbot-Web-API,RickCarlino/farmbot-web-app,FarmBot/Farmbot-Web-API,FarmBot/farmbot-web-app,RickCarlino/farmbot-web-app,FarmBot/farmbot-web-app,MrChristofferson/Farmbot-Web-API,gabrielburnworth/Farmbot-Web-App,gabrielburnworth/Farmbot-Web-App,FarmBot/Farmbot-Web-API,RickCarlino/farmbot-web-app,FarmBot/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,MrChristofferson/Farmbot-Web-API,FarmBot/farmbot-web-app,RickCarlino/farmbot-web-app,gabrielburnworth/Farmbot-Web-App,gabrielburnworth/Farmbot-Web-App,gabrielburnworth/Farmbot-Web-App,FarmBot/Farmbot-Web-API | ruby | ## Code Before:
module Points
class Update < Mutations::Command
required do
model :device, class: Device
model :point, class: Point
end
optional do
integer :tool_id, nils: true, empty_is_nil: true
float :x
float :y
float :z
float :radius
string :name
string :openfarm_slug
hstore :meta
end
def validate
throw "BRB" if (tool_id &&
!device
.tools
.pluck(:id)
.include?(tool_id))
end
def execute
point.update_attributes!(update_params) && point
end
private
def update_params
point
.pointer
.assign_attributes(inputs.slice(:tool_id, :openfarm_slug))
inputs
.slice(*Point::SHARED_FIELDS)
.merge(pointer: point.pointer)
end
end
end
## Instruction:
Bring back drop down back. Next: Fix label name
## Code After:
module Points
class Update < Mutations::Command
required do
model :device, class: Device
model :point, class: Point
end
optional do
integer :tool_id, nils: true, empty_is_nil: true
float :x
float :y
float :z
float :radius
string :name
string :openfarm_slug
hstore :meta
end
def validate
throw "BRB" if (tool_id &&
!device
.tools
.pluck(:id)
.include?(tool_id))
end
def execute
point.update_attributes!(update_params) && point
end
private
def update_params
maybe_update_pointer
inputs
.slice(*Point::SHARED_FIELDS)
.merge(pointer: point.pointer)
end
def maybe_update_pointer
p = point.pointer
p && p.assign_attributes(inputs.slice(:tool_id, :openfarm_slug))
end
end
end
| module Points
class Update < Mutations::Command
required do
model :device, class: Device
model :point, class: Point
end
optional do
integer :tool_id, nils: true, empty_is_nil: true
float :x
float :y
float :z
float :radius
string :name
string :openfarm_slug
hstore :meta
end
def validate
throw "BRB" if (tool_id &&
!device
.tools
.pluck(:id)
.include?(tool_id))
end
def execute
point.update_attributes!(update_params) && point
end
private
def update_params
+ maybe_update_pointer
- point
- .pointer
- .assign_attributes(inputs.slice(:tool_id, :openfarm_slug))
inputs
.slice(*Point::SHARED_FIELDS)
.merge(pointer: point.pointer)
end
+
+ def maybe_update_pointer
+ p = point.pointer
+ p && p.assign_attributes(inputs.slice(:tool_id, :openfarm_slug))
+ end
end
end | 9 | 0.214286 | 6 | 3 |
93f16ac5e83b679f9894975dd13638b6a9edde42 | src/Uvweb/UvBundle/Controller/BaseController.php | src/Uvweb/UvBundle/Controller/BaseController.php | <?php
/**
* Created by JetBrains PhpStorm.
* User: Alexandre
* Date: 26/05/13
* Time: 12:15
* To change this template use File | Settings | File Templates.
*/
namespace Uvweb\UvBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class BaseController extends Controller{
protected $searchBarForm;
/**
* that method allows us to generate search bar form from anywhere
*/
protected function initSearchBar() {
// $search = new SearchStatement;
$formBuilder = $this->createFormBuilder();
$formBuilder->add('statement', 'text');
$this->searchBarForm = $formBuilder->getForm();
$request = $this->get('request');
if ($request->getMethod() == 'POST') {
$this->searchBarForm->bind($request);
if ($this->searchBarForm->isValid()) {
return $this->redirect($this->generateUrl('uvweb_uv_detail', array('uvname' => $this->searchBarForm->getData()['statement'])));
}
}
}
} | <?php
/**
* Created by JetBrains PhpStorm.
* User: Alexandre
* Date: 26/05/13
* Time: 12:15
* To change this template use File | Settings | File Templates.
*/
namespace Uvweb\UvBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class BaseController extends Controller{
protected $searchBarForm;
/**
* that method allows us to generate search bar form from anywhere
*/
protected function initSearchBar() {
// $search = new SearchStatement;
$formBuilder = $this->createFormBuilder();
$formBuilder->add('statement', 'text', array('required' => false));
$this->searchBarForm = $formBuilder->getForm();
$request = $this->get('request');
if ($request->getMethod() == 'POST') {
$this->searchBarForm->bind($request);
if ($this->searchBarForm->isValid()) {
return $this->redirect($this->generateUrl('uvweb_uv_detail', array('uvname' => $this->searchBarForm->getData()['statement'])));
}
}
}
} | Remove "required" on search field | Remove "required" on search field
| PHP | mit | uvweb/UVweb,uvweb/UVweb,uvweb/UVweb | php | ## Code Before:
<?php
/**
* Created by JetBrains PhpStorm.
* User: Alexandre
* Date: 26/05/13
* Time: 12:15
* To change this template use File | Settings | File Templates.
*/
namespace Uvweb\UvBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class BaseController extends Controller{
protected $searchBarForm;
/**
* that method allows us to generate search bar form from anywhere
*/
protected function initSearchBar() {
// $search = new SearchStatement;
$formBuilder = $this->createFormBuilder();
$formBuilder->add('statement', 'text');
$this->searchBarForm = $formBuilder->getForm();
$request = $this->get('request');
if ($request->getMethod() == 'POST') {
$this->searchBarForm->bind($request);
if ($this->searchBarForm->isValid()) {
return $this->redirect($this->generateUrl('uvweb_uv_detail', array('uvname' => $this->searchBarForm->getData()['statement'])));
}
}
}
}
## Instruction:
Remove "required" on search field
## Code After:
<?php
/**
* Created by JetBrains PhpStorm.
* User: Alexandre
* Date: 26/05/13
* Time: 12:15
* To change this template use File | Settings | File Templates.
*/
namespace Uvweb\UvBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class BaseController extends Controller{
protected $searchBarForm;
/**
* that method allows us to generate search bar form from anywhere
*/
protected function initSearchBar() {
// $search = new SearchStatement;
$formBuilder = $this->createFormBuilder();
$formBuilder->add('statement', 'text', array('required' => false));
$this->searchBarForm = $formBuilder->getForm();
$request = $this->get('request');
if ($request->getMethod() == 'POST') {
$this->searchBarForm->bind($request);
if ($this->searchBarForm->isValid()) {
return $this->redirect($this->generateUrl('uvweb_uv_detail', array('uvname' => $this->searchBarForm->getData()['statement'])));
}
}
}
} | <?php
/**
* Created by JetBrains PhpStorm.
* User: Alexandre
* Date: 26/05/13
* Time: 12:15
* To change this template use File | Settings | File Templates.
*/
namespace Uvweb\UvBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class BaseController extends Controller{
protected $searchBarForm;
/**
* that method allows us to generate search bar form from anywhere
*/
protected function initSearchBar() {
// $search = new SearchStatement;
$formBuilder = $this->createFormBuilder();
- $formBuilder->add('statement', 'text');
+ $formBuilder->add('statement', 'text', array('required' => false));
? ++++++++++++++++++++++++++++
$this->searchBarForm = $formBuilder->getForm();
$request = $this->get('request');
if ($request->getMethod() == 'POST') {
$this->searchBarForm->bind($request);
if ($this->searchBarForm->isValid()) {
return $this->redirect($this->generateUrl('uvweb_uv_detail', array('uvname' => $this->searchBarForm->getData()['statement'])));
}
}
}
} | 2 | 0.054054 | 1 | 1 |
24485a1c7dc077436685c483cf510aa3314c169c | myhronet/templates/base.html | myhronet/templates/base.html | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Myhro.info URL Shortener</title>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}style.css" />
</head>
<body>
<p><a href="{% url 'home' %}"><img src="{{ STATIC_URL }}logo.jpg" alt="Myhro.info URL Shortener" /></a></p>
{% block 'content' %}
{% endblock %}
</body>
</html>
| {% load staticfiles %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Myhro.info URL Shortener</title>
<link rel="stylesheet" type="text/css" href="{% static "style.css" %}"/>
</head>
<body>
<p><a href="{% url 'home' %}"><img src="{% static "logo.jpg" %}" alt="Myhro.info URL Shortener" /></a></p>
{% block 'content' %}
{% endblock %}
</body>
</html>
| Use staticfiles app instead of STATIC_URL | Use staticfiles app instead of STATIC_URL
| HTML | mit | myhro/myhronet,myhro/myhronet | html | ## Code Before:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Myhro.info URL Shortener</title>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}style.css" />
</head>
<body>
<p><a href="{% url 'home' %}"><img src="{{ STATIC_URL }}logo.jpg" alt="Myhro.info URL Shortener" /></a></p>
{% block 'content' %}
{% endblock %}
</body>
</html>
## Instruction:
Use staticfiles app instead of STATIC_URL
## Code After:
{% load staticfiles %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Myhro.info URL Shortener</title>
<link rel="stylesheet" type="text/css" href="{% static "style.css" %}"/>
</head>
<body>
<p><a href="{% url 'home' %}"><img src="{% static "logo.jpg" %}" alt="Myhro.info URL Shortener" /></a></p>
{% block 'content' %}
{% endblock %}
</body>
</html>
| + {% load staticfiles %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>Myhro.info URL Shortener</title>
- <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}style.css" />
? ^ ^^^^^^^^^^ ^^
+ <link rel="stylesheet" type="text/css" href="{% static "style.css" %}"/>
? ^ ^^^^^^ ^ +++
</head>
<body>
- <p><a href="{% url 'home' %}"><img src="{{ STATIC_URL }}logo.jpg" alt="Myhro.info URL Shortener" /></a></p>
? ^ ^^^^^^^^^^ ^^
+ <p><a href="{% url 'home' %}"><img src="{% static "logo.jpg" %}" alt="Myhro.info URL Shortener" /></a></p>
? ^ ^^^^^^ ^ ++++
{% block 'content' %}
{% endblock %}
</body>
</html> | 5 | 0.384615 | 3 | 2 |
b1b49f0ed25b0d56ebb3b765c50102613a88a05b | .travis.yml | .travis.yml | language: objective-c
osx_image: xcode7.1
script:
- xcodebuild -project MarvelApiClient.xcodeproj -scheme MarvelApiClient build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6s Plus' | language: objective-c
osx_image: xcode7.1
script:
- xcodebuild -workspace MarvelApiClient.xcworkspace -scheme MarvelApiClient build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6s Plus' | Update Travis-CI configuration to use the project workspace instead of the project to execute the build and the tests | Update Travis-CI configuration to use the project workspace instead of the project to execute the build and the tests
| YAML | apache-2.0 | Karumi/MarvelApiClient,Karumi/MarvelApiClient | yaml | ## Code Before:
language: objective-c
osx_image: xcode7.1
script:
- xcodebuild -project MarvelApiClient.xcodeproj -scheme MarvelApiClient build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6s Plus'
## Instruction:
Update Travis-CI configuration to use the project workspace instead of the project to execute the build and the tests
## Code After:
language: objective-c
osx_image: xcode7.1
script:
- xcodebuild -workspace MarvelApiClient.xcworkspace -scheme MarvelApiClient build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6s Plus' | language: objective-c
osx_image: xcode7.1
script:
- - xcodebuild -project MarvelApiClient.xcodeproj -scheme MarvelApiClient build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6s Plus'
? ^^^ -- ^ ----
+ - xcodebuild -workspace MarvelApiClient.xcworkspace -scheme MarvelApiClient build test CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -destination 'platform=iOS Simulator,name=iPhone 6s Plus'
? +++++ ^^ + ^^^^^^
| 2 | 0.4 | 1 | 1 |
abe0d2ba106e204f12a3610b2cefdd6f9c97eb0d | recipes/default.rb | recipes/default.rb | package node[:bfd][:package][:short_name] do
source node[:bfd][:package][:source] if node[:bfd][:package][:source]
end
template "bfdd-beacon upstart config" do
path "/etc/init/bfdd-beacon.conf"
source "bfdd-beacon.conf.erb"
owner "root"
group "root"
end
service "bfdd-beacon" do
provider Chef::Provider::Service::Upstart
supports :status => true
action [:start]
end
|
if node[:bfd][:package][:source]
source_uri = URI.parse(node[:bfd][:package][:source])
#
# If the parsed source URI has a scheme, and that scheme is not
# file:///, then this is a remote file and we should instantiate a
# remote_file resource.
#
# If there's no scheme, assume the source is already a local file.
#
if source_uri.scheme && source_uri.scheme != 'file'
output_directory =
::File.join(Chef::Config[:file_cache_path], 'bfd')
local_file_path =
::File.join(output_directory, ::File.basename(source_uri.path))
directory output_directory do
mode 0755
end
remote_file local_file_path do
source source_uri.to_s
mode 0644
end
else
local_file_path = source_uri.path
end
dpkg_package node[:bfd][:package][:short_name] do
source local_file_path
end
else
package node[:bfd][:package][:short_name] do
action :upgrade
end
end
template "bfdd-beacon upstart config" do
path "/etc/init/bfdd-beacon.conf"
source "bfdd-beacon.conf.erb"
owner "root"
group "root"
end
service "bfdd-beacon" do
provider Chef::Provider::Service::Upstart
supports :status => true
action [:start]
end
| Use a dpkg_package resource when a package source attribute is provided. | Use a dpkg_package resource when a package source attribute is
provided.
The package source attribute can be a local or remote path.
| Ruby | apache-2.0 | cbaenziger/OpenBFDD-cookbook,bloomberg/openbfdd-cookbook,bloomberg/openbfdd-cookbook,cbaenziger/OpenBFDD-cookbook | ruby | ## Code Before:
package node[:bfd][:package][:short_name] do
source node[:bfd][:package][:source] if node[:bfd][:package][:source]
end
template "bfdd-beacon upstart config" do
path "/etc/init/bfdd-beacon.conf"
source "bfdd-beacon.conf.erb"
owner "root"
group "root"
end
service "bfdd-beacon" do
provider Chef::Provider::Service::Upstart
supports :status => true
action [:start]
end
## Instruction:
Use a dpkg_package resource when a package source attribute is
provided.
The package source attribute can be a local or remote path.
## Code After:
if node[:bfd][:package][:source]
source_uri = URI.parse(node[:bfd][:package][:source])
#
# If the parsed source URI has a scheme, and that scheme is not
# file:///, then this is a remote file and we should instantiate a
# remote_file resource.
#
# If there's no scheme, assume the source is already a local file.
#
if source_uri.scheme && source_uri.scheme != 'file'
output_directory =
::File.join(Chef::Config[:file_cache_path], 'bfd')
local_file_path =
::File.join(output_directory, ::File.basename(source_uri.path))
directory output_directory do
mode 0755
end
remote_file local_file_path do
source source_uri.to_s
mode 0644
end
else
local_file_path = source_uri.path
end
dpkg_package node[:bfd][:package][:short_name] do
source local_file_path
end
else
package node[:bfd][:package][:short_name] do
action :upgrade
end
end
template "bfdd-beacon upstart config" do
path "/etc/init/bfdd-beacon.conf"
source "bfdd-beacon.conf.erb"
owner "root"
group "root"
end
service "bfdd-beacon" do
provider Chef::Provider::Service::Upstart
supports :status => true
action [:start]
end
| +
+ if node[:bfd][:package][:source]
+ source_uri = URI.parse(node[:bfd][:package][:source])
+
+ #
+ # If the parsed source URI has a scheme, and that scheme is not
+ # file:///, then this is a remote file and we should instantiate a
+ # remote_file resource.
+ #
+ # If there's no scheme, assume the source is already a local file.
+ #
+ if source_uri.scheme && source_uri.scheme != 'file'
+ output_directory =
+ ::File.join(Chef::Config[:file_cache_path], 'bfd')
+
+ local_file_path =
+ ::File.join(output_directory, ::File.basename(source_uri.path))
+
+ directory output_directory do
+ mode 0755
+ end
+
+ remote_file local_file_path do
+ source source_uri.to_s
+ mode 0644
+ end
+ else
+ local_file_path = source_uri.path
+ end
+
+ dpkg_package node[:bfd][:package][:short_name] do
+ source local_file_path
+ end
+ else
- package node[:bfd][:package][:short_name] do
+ package node[:bfd][:package][:short_name] do
? ++
- source node[:bfd][:package][:source] if node[:bfd][:package][:source]
+ action :upgrade
+ end
end
template "bfdd-beacon upstart config" do
path "/etc/init/bfdd-beacon.conf"
source "bfdd-beacon.conf.erb"
owner "root"
group "root"
end
service "bfdd-beacon" do
provider Chef::Provider::Service::Upstart
supports :status => true
action [:start]
end | 39 | 2.4375 | 37 | 2 |
88da9957f15bda7922c579bcd1962d276df1075d | src/js/routers/app-router.js | src/js/routers/app-router.js | import * as Backbone from 'backbone';
import SearchBoxView from '../views/searchBox-view.js';
import SearchResultsView from '../views/searchResults-view.js';
import dispatcher from '../helpers/dispatcher.js';
class AppRouter extends Backbone.Router {
get routes() {
return {
'': 'loadDefault',
'search/results': 'showSearchResults'
};
}
initialize() {
window.console.log('Router initialized');
this.listenTo(dispatcher, 'router:go', this.go);
}
loadDefault() {
new SearchBoxView();
}
showSearchResults() {
new SearchResultsView();
}
}
export default AppRouter;
| import * as Backbone from 'backbone';
import SearchBoxView from '../views/searchBox-view.js';
import SearchResultsView from '../views/searchResults-view.js';
import dispatcher from '../helpers/dispatcher.js';
class AppRouter extends Backbone.Router {
get routes() {
return {
'': 'loadDefault',
'search/results': 'showSearchResults'
};
}
initialize() {
window.console.log('Router initialized');
this.listenTo(dispatcher, 'router:go', this.go);
}
go(route) {
this.navigate(route, {trigger: true});
}
loadDefault() {
new SearchBoxView();
}
showSearchResults() {
new SearchResultsView();
}
}
export default AppRouter;
| Add shortcut function to navigate to URL fragment | Add shortcut function to navigate to URL fragment
Called by event listener
| JavaScript | mit | trevormunoz/katherine-anne,trevormunoz/katherine-anne,trevormunoz/katherine-anne | javascript | ## Code Before:
import * as Backbone from 'backbone';
import SearchBoxView from '../views/searchBox-view.js';
import SearchResultsView from '../views/searchResults-view.js';
import dispatcher from '../helpers/dispatcher.js';
class AppRouter extends Backbone.Router {
get routes() {
return {
'': 'loadDefault',
'search/results': 'showSearchResults'
};
}
initialize() {
window.console.log('Router initialized');
this.listenTo(dispatcher, 'router:go', this.go);
}
loadDefault() {
new SearchBoxView();
}
showSearchResults() {
new SearchResultsView();
}
}
export default AppRouter;
## Instruction:
Add shortcut function to navigate to URL fragment
Called by event listener
## Code After:
import * as Backbone from 'backbone';
import SearchBoxView from '../views/searchBox-view.js';
import SearchResultsView from '../views/searchResults-view.js';
import dispatcher from '../helpers/dispatcher.js';
class AppRouter extends Backbone.Router {
get routes() {
return {
'': 'loadDefault',
'search/results': 'showSearchResults'
};
}
initialize() {
window.console.log('Router initialized');
this.listenTo(dispatcher, 'router:go', this.go);
}
go(route) {
this.navigate(route, {trigger: true});
}
loadDefault() {
new SearchBoxView();
}
showSearchResults() {
new SearchResultsView();
}
}
export default AppRouter;
| import * as Backbone from 'backbone';
import SearchBoxView from '../views/searchBox-view.js';
import SearchResultsView from '../views/searchResults-view.js';
import dispatcher from '../helpers/dispatcher.js';
class AppRouter extends Backbone.Router {
get routes() {
return {
'': 'loadDefault',
'search/results': 'showSearchResults'
};
}
initialize() {
window.console.log('Router initialized');
this.listenTo(dispatcher, 'router:go', this.go);
}
+ go(route) {
+ this.navigate(route, {trigger: true});
+ }
+
loadDefault() {
new SearchBoxView();
}
showSearchResults() {
new SearchResultsView();
}
}
export default AppRouter; | 4 | 0.133333 | 4 | 0 |
10f5324fbcfc1f6376e82afb1774db6708c5b59b | tests/browser/engagement_plans/edit_engagement_plan.robot | tests/browser/engagement_plans/edit_engagement_plan.robot | *** Settings ***
Resource tests/NPSP.robot
Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
*** Variables ***
${task3_1} Follow-Up Phone Call3
*** Test Cases ***
Create Engagement Plan and Edit to Add New Task
${plan_name} ${task1_1} ${sub_task1_1} ${task2_1} Create Engagement Plan
Unselect Frame
Select App Launcher Tab Engagement Plan Templates
Click Link link=${plan_name}
Click Link link=Show more actions
Click Link link=Edit
#Sleep 2
Select Frame With Title Manage Engagement Plan Template
Page Scroll To Locator button Add Task
Click Button With Value Add Task
Enter Task Id and Subject Task 3 ${task3_1}
Page Scroll To Locator button Save
Click Button With Value Save
Unselect Frame
Verify Engagement Plan ${plan_name} ${task1_1} ${sub_task1_1} ${task2_1} ${task3_1}
| *** Settings ***
Resource tests/NPSP.robot
Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
*** Variables ***
${task3_1} Follow-Up Phone Call3
*** Test Cases ***
Create Engagement Plan and Edit to Add New Task
[tags] unstable
${plan_name} ${task1_1} ${sub_task1_1} ${task2_1} Create Engagement Plan
Unselect Frame
Select App Launcher Tab Engagement Plan Templates
Click Link link=${plan_name}
Click Link link=Show more actions
Click Link link=Edit
#Sleep 2
Select Frame With Title Manage Engagement Plan Template
Page Scroll To Locator button Add Task
Click Button With Value Add Task
Enter Task Id and Subject Task 3 ${task3_1}
Page Scroll To Locator button Save
Click Button With Value Save
Unselect Frame
Verify Engagement Plan ${plan_name} ${task1_1} ${sub_task1_1} ${task2_1} ${task3_1}
| Tag unstable robot test | Tag unstable robot test [ci skip] | RobotFramework | bsd-3-clause | Zosoled/Cumulus,Zosoled/Cumulus,Zosoled/Cumulus,SalesforceFoundation/Cumulus,Zosoled/Cumulus,SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus | robotframework | ## Code Before:
*** Settings ***
Resource tests/NPSP.robot
Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
*** Variables ***
${task3_1} Follow-Up Phone Call3
*** Test Cases ***
Create Engagement Plan and Edit to Add New Task
${plan_name} ${task1_1} ${sub_task1_1} ${task2_1} Create Engagement Plan
Unselect Frame
Select App Launcher Tab Engagement Plan Templates
Click Link link=${plan_name}
Click Link link=Show more actions
Click Link link=Edit
#Sleep 2
Select Frame With Title Manage Engagement Plan Template
Page Scroll To Locator button Add Task
Click Button With Value Add Task
Enter Task Id and Subject Task 3 ${task3_1}
Page Scroll To Locator button Save
Click Button With Value Save
Unselect Frame
Verify Engagement Plan ${plan_name} ${task1_1} ${sub_task1_1} ${task2_1} ${task3_1}
## Instruction:
Tag unstable robot test [ci skip]
## Code After:
*** Settings ***
Resource tests/NPSP.robot
Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
*** Variables ***
${task3_1} Follow-Up Phone Call3
*** Test Cases ***
Create Engagement Plan and Edit to Add New Task
[tags] unstable
${plan_name} ${task1_1} ${sub_task1_1} ${task2_1} Create Engagement Plan
Unselect Frame
Select App Launcher Tab Engagement Plan Templates
Click Link link=${plan_name}
Click Link link=Show more actions
Click Link link=Edit
#Sleep 2
Select Frame With Title Manage Engagement Plan Template
Page Scroll To Locator button Add Task
Click Button With Value Add Task
Enter Task Id and Subject Task 3 ${task3_1}
Page Scroll To Locator button Save
Click Button With Value Save
Unselect Frame
Verify Engagement Plan ${plan_name} ${task1_1} ${sub_task1_1} ${task2_1} ${task3_1}
| *** Settings ***
Resource tests/NPSP.robot
Suite Setup Open Test Browser
Suite Teardown Delete Records and Close Browser
*** Variables ***
${task3_1} Follow-Up Phone Call3
*** Test Cases ***
Create Engagement Plan and Edit to Add New Task
+ [tags] unstable
${plan_name} ${task1_1} ${sub_task1_1} ${task2_1} Create Engagement Plan
Unselect Frame
Select App Launcher Tab Engagement Plan Templates
Click Link link=${plan_name}
Click Link link=Show more actions
Click Link link=Edit
#Sleep 2
Select Frame With Title Manage Engagement Plan Template
Page Scroll To Locator button Add Task
Click Button With Value Add Task
Enter Task Id and Subject Task 3 ${task3_1}
Page Scroll To Locator button Save
Click Button With Value Save
Unselect Frame
Verify Engagement Plan ${plan_name} ${task1_1} ${sub_task1_1} ${task2_1} ${task3_1}
| 1 | 0.034483 | 1 | 0 |
aac366c306347597f7090a0d611744e9be18a5c0 | circle.yml | circle.yml | general:
branches:
ignore:
- azure
deployment:
dev:
branch: master
commands:
- git push git@heroku.com:hoa-ui-dev.git $CIRCLE_SHA1:master
- heroku ps:scale web=1 --app hoa-ui-dev
# Push the Dev Branch to Azure
- git checkout azure
- git pull
- git merge master
- git push origin azure
| general:
branches:
ignore:
- azure
deployment:
dev:
branch: master
commands:
- git push git@heroku.com:hoa-ui-dev.git $CIRCLE_SHA1:master
- heroku ps:scale web=1 --app hoa-ui-dev
# Push the Dev Branch to Azure
- git config user.email $EMAIL
- git config user.name $USERNAME
- git checkout azure
- git pull
- git merge master
- git push origin azure
| Add in username and email. | Other: Add in username and email.
| YAML | mit | NOMS-DIGITAL-STUDIO-IIS/hoa-ui,noms-digital-studio/iis,NOMS-DIGITAL-STUDIO-IIS/hoa-ui,noms-digital-studio/iis | yaml | ## Code Before:
general:
branches:
ignore:
- azure
deployment:
dev:
branch: master
commands:
- git push git@heroku.com:hoa-ui-dev.git $CIRCLE_SHA1:master
- heroku ps:scale web=1 --app hoa-ui-dev
# Push the Dev Branch to Azure
- git checkout azure
- git pull
- git merge master
- git push origin azure
## Instruction:
Other: Add in username and email.
## Code After:
general:
branches:
ignore:
- azure
deployment:
dev:
branch: master
commands:
- git push git@heroku.com:hoa-ui-dev.git $CIRCLE_SHA1:master
- heroku ps:scale web=1 --app hoa-ui-dev
# Push the Dev Branch to Azure
- git config user.email $EMAIL
- git config user.name $USERNAME
- git checkout azure
- git pull
- git merge master
- git push origin azure
| general:
branches:
ignore:
- azure
deployment:
dev:
branch: master
commands:
- git push git@heroku.com:hoa-ui-dev.git $CIRCLE_SHA1:master
- heroku ps:scale web=1 --app hoa-ui-dev
# Push the Dev Branch to Azure
+ - git config user.email $EMAIL
+ - git config user.name $USERNAME
- git checkout azure
- git pull
- git merge master
- git push origin azure
| 2 | 0.111111 | 2 | 0 |
2699f05590f189d925f7051385e06bd5f5767098 | metadata/ru.ikkui.achie.yml | metadata/ru.ikkui.achie.yml | Categories:
- Time
License: GPL-2.0-only
AuthorName: Igor Kruchinin
SourceCode: https://github.com/IgorKruchinin/AchieApp
IssueTracker: https://github.com/IgorKruchinin/AchieApp/issues
AutoName: Achie
RepoType: git
Repo: https://github.com/IgorKruchinin/AchieApp
Binaries: https://github.com/IgorKruchinin/AchieApp/releases/latest/download/app-release.apk
Builds:
- versionName: '1.1'
versionCode: 2
commit: b84628fa07181e123fd1dc9ae404a1ca03fcdb52
subdir: app
gradle:
- yes
- versionName: 1.1.1
versionCode: 3
commit: c69153e3fafe650b632584db182feac17be33c0b
subdir: app
gradle:
- yes
AutoUpdateMode: Version
UpdateCheckMode: Tags
CurrentVersion: 1.1.1
CurrentVersionCode: 3
| Categories:
- Time
License: GPL-2.0-only
AuthorName: Igor Kruchinin
SourceCode: https://github.com/IgorKruchinin/AchieApp
IssueTracker: https://github.com/IgorKruchinin/AchieApp/issues
AutoName: Achie
RepoType: git
Repo: https://github.com/IgorKruchinin/AchieApp
Binaries: https://github.com/IgorKruchinin/AchieApp/releases/latest/download/app-release.apk
Builds:
- versionName: '1.1'
versionCode: 2
commit: b84628fa07181e123fd1dc9ae404a1ca03fcdb52
subdir: app
gradle:
- yes
- versionName: 1.1.1
versionCode: 3
commit: c69153e3fafe650b632584db182feac17be33c0b
subdir: app
gradle:
- yes
- versionName: 1.1.1a
versionCode: 4
commit: 4aa3582d8ba9f133921c57784d0e3c2a838eda62
subdir: app
gradle:
- yes
AutoUpdateMode: Version
UpdateCheckMode: Tags
CurrentVersion: 1.1.1a
CurrentVersionCode: 4
| Update Achie to 1.1.1a (4) | Update Achie to 1.1.1a (4)
| YAML | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata | yaml | ## Code Before:
Categories:
- Time
License: GPL-2.0-only
AuthorName: Igor Kruchinin
SourceCode: https://github.com/IgorKruchinin/AchieApp
IssueTracker: https://github.com/IgorKruchinin/AchieApp/issues
AutoName: Achie
RepoType: git
Repo: https://github.com/IgorKruchinin/AchieApp
Binaries: https://github.com/IgorKruchinin/AchieApp/releases/latest/download/app-release.apk
Builds:
- versionName: '1.1'
versionCode: 2
commit: b84628fa07181e123fd1dc9ae404a1ca03fcdb52
subdir: app
gradle:
- yes
- versionName: 1.1.1
versionCode: 3
commit: c69153e3fafe650b632584db182feac17be33c0b
subdir: app
gradle:
- yes
AutoUpdateMode: Version
UpdateCheckMode: Tags
CurrentVersion: 1.1.1
CurrentVersionCode: 3
## Instruction:
Update Achie to 1.1.1a (4)
## Code After:
Categories:
- Time
License: GPL-2.0-only
AuthorName: Igor Kruchinin
SourceCode: https://github.com/IgorKruchinin/AchieApp
IssueTracker: https://github.com/IgorKruchinin/AchieApp/issues
AutoName: Achie
RepoType: git
Repo: https://github.com/IgorKruchinin/AchieApp
Binaries: https://github.com/IgorKruchinin/AchieApp/releases/latest/download/app-release.apk
Builds:
- versionName: '1.1'
versionCode: 2
commit: b84628fa07181e123fd1dc9ae404a1ca03fcdb52
subdir: app
gradle:
- yes
- versionName: 1.1.1
versionCode: 3
commit: c69153e3fafe650b632584db182feac17be33c0b
subdir: app
gradle:
- yes
- versionName: 1.1.1a
versionCode: 4
commit: 4aa3582d8ba9f133921c57784d0e3c2a838eda62
subdir: app
gradle:
- yes
AutoUpdateMode: Version
UpdateCheckMode: Tags
CurrentVersion: 1.1.1a
CurrentVersionCode: 4
| Categories:
- Time
License: GPL-2.0-only
AuthorName: Igor Kruchinin
SourceCode: https://github.com/IgorKruchinin/AchieApp
IssueTracker: https://github.com/IgorKruchinin/AchieApp/issues
AutoName: Achie
RepoType: git
Repo: https://github.com/IgorKruchinin/AchieApp
Binaries: https://github.com/IgorKruchinin/AchieApp/releases/latest/download/app-release.apk
Builds:
- versionName: '1.1'
versionCode: 2
commit: b84628fa07181e123fd1dc9ae404a1ca03fcdb52
subdir: app
gradle:
- yes
- versionName: 1.1.1
versionCode: 3
commit: c69153e3fafe650b632584db182feac17be33c0b
subdir: app
gradle:
- yes
+ - versionName: 1.1.1a
+ versionCode: 4
+ commit: 4aa3582d8ba9f133921c57784d0e3c2a838eda62
+ subdir: app
+ gradle:
+ - yes
+
AutoUpdateMode: Version
UpdateCheckMode: Tags
- CurrentVersion: 1.1.1
+ CurrentVersion: 1.1.1a
? +
- CurrentVersionCode: 3
? ^
+ CurrentVersionCode: 4
? ^
| 11 | 0.34375 | 9 | 2 |
f457607e76503215291bbf3b9e4b23885aea7383 | Strategies/cache_wo_download.rb | Strategies/cache_wo_download.rb | class CacheWoDownloadStrategy < CurlDownloadStrategy
def homepage
raise ArgumentError,
"You need to override the `homepage` method to return the homepage!"
end
def fetch
unless cached_location.exist?
odie <<~EOS
The package file can not be downloaded automatically. Please sign in
and accept the licence agreement on the Instant Client downloads page:
#{homepage}
Then manually download this file:
#{@url}
To this location (a specific filename in homebrew cache directory):
#{cached_location}
An example command to rename and move the file into the homebrew cache:
$ cd /path/to/downloads && mv #{filename} #{cached_location}
Instead of renaming and moving you can create a symlink:
$ cd /path/to/downloads && ln -sf $(PWD)/#{filename} #{cached_location}
Then re-run the installation:
$ brew install #{name}
EOS
end
super
end
def filename
@filename ||= File.basename(@url)
end
end
| class CacheWoDownloadStrategy < AbstractFileDownloadStrategy
def homepage
raise ArgumentError,
"You need to override the `homepage` method to return the homepage!"
end
def fetch
unless cached_location.exist?
odie <<~EOS
The package file can not be downloaded automatically. Please sign in
and accept the licence agreement on the Instant Client downloads page:
#{homepage}
Then manually download this file:
#{@url}
To this location (a specific filename in homebrew cache directory):
#{cached_location}
An example command to rename and move the file into the homebrew cache:
$ cd /path/to/downloads && mv #{filename} #{cached_location}
Instead of renaming and moving you can create a symlink:
$ cd /path/to/downloads && ln -sf $(PWD)/#{filename} #{cached_location}
Then re-run the installation:
$ brew install #{name}
EOS
end
super
end
def filename
@filename ||= File.basename(@url)
end
end
| Use the abstract download strategy directly | Use the abstract download strategy directly
The CURL download strategy started doing too much. And it was pointless
anyway.
| Ruby | mit | InstantClientTap/homebrew-instantclient | ruby | ## Code Before:
class CacheWoDownloadStrategy < CurlDownloadStrategy
def homepage
raise ArgumentError,
"You need to override the `homepage` method to return the homepage!"
end
def fetch
unless cached_location.exist?
odie <<~EOS
The package file can not be downloaded automatically. Please sign in
and accept the licence agreement on the Instant Client downloads page:
#{homepage}
Then manually download this file:
#{@url}
To this location (a specific filename in homebrew cache directory):
#{cached_location}
An example command to rename and move the file into the homebrew cache:
$ cd /path/to/downloads && mv #{filename} #{cached_location}
Instead of renaming and moving you can create a symlink:
$ cd /path/to/downloads && ln -sf $(PWD)/#{filename} #{cached_location}
Then re-run the installation:
$ brew install #{name}
EOS
end
super
end
def filename
@filename ||= File.basename(@url)
end
end
## Instruction:
Use the abstract download strategy directly
The CURL download strategy started doing too much. And it was pointless
anyway.
## Code After:
class CacheWoDownloadStrategy < AbstractFileDownloadStrategy
def homepage
raise ArgumentError,
"You need to override the `homepage` method to return the homepage!"
end
def fetch
unless cached_location.exist?
odie <<~EOS
The package file can not be downloaded automatically. Please sign in
and accept the licence agreement on the Instant Client downloads page:
#{homepage}
Then manually download this file:
#{@url}
To this location (a specific filename in homebrew cache directory):
#{cached_location}
An example command to rename and move the file into the homebrew cache:
$ cd /path/to/downloads && mv #{filename} #{cached_location}
Instead of renaming and moving you can create a symlink:
$ cd /path/to/downloads && ln -sf $(PWD)/#{filename} #{cached_location}
Then re-run the installation:
$ brew install #{name}
EOS
end
super
end
def filename
@filename ||= File.basename(@url)
end
end
| - class CacheWoDownloadStrategy < CurlDownloadStrategy
? ^^
+ class CacheWoDownloadStrategy < AbstractFileDownloadStrategy
? ^^^^ +++++ +
def homepage
raise ArgumentError,
"You need to override the `homepage` method to return the homepage!"
end
def fetch
unless cached_location.exist?
odie <<~EOS
The package file can not be downloaded automatically. Please sign in
and accept the licence agreement on the Instant Client downloads page:
#{homepage}
Then manually download this file:
#{@url}
To this location (a specific filename in homebrew cache directory):
#{cached_location}
An example command to rename and move the file into the homebrew cache:
$ cd /path/to/downloads && mv #{filename} #{cached_location}
Instead of renaming and moving you can create a symlink:
$ cd /path/to/downloads && ln -sf $(PWD)/#{filename} #{cached_location}
Then re-run the installation:
$ brew install #{name}
EOS
end
super
end
def filename
@filename ||= File.basename(@url)
end
end | 2 | 0.047619 | 1 | 1 |
652497ec0365893a0fcbc39191cb60032bf88c23 | setup.py | setup.py | from setuptools import setup
setup(
name='pyticketswitch',
version='1.6.4',
author='Ingresso',
author_email='systems@ingresso.co.uk',
packages=[
'pyticketswitch',
'pyticketswitch.interface_objects'
],
license='MIT',
description='A Python interface for the Ingresso XML Core API',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 2.7',
'Intended Audience :: Developers',
'Natural Language :: English',
],
)
| from setuptools import setup
setup(
name='pyticketswitch',
version='1.6.4',
author='Ingresso',
author_email='systems@ingresso.co.uk',
url='https://github.com/ingresso-group/pyticketswitch/',
packages=[
'pyticketswitch',
'pyticketswitch.interface_objects'
],
license='MIT',
description='A Python interface for the Ingresso XML Core API',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 2.7',
'Intended Audience :: Developers',
'Natural Language :: English',
],
)
| Add URL to make it easier to find this GitHub page | Add URL to make it easier to find this GitHub page | Python | mit | ingresso-group/pyticketswitch | python | ## Code Before:
from setuptools import setup
setup(
name='pyticketswitch',
version='1.6.4',
author='Ingresso',
author_email='systems@ingresso.co.uk',
packages=[
'pyticketswitch',
'pyticketswitch.interface_objects'
],
license='MIT',
description='A Python interface for the Ingresso XML Core API',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 2.7',
'Intended Audience :: Developers',
'Natural Language :: English',
],
)
## Instruction:
Add URL to make it easier to find this GitHub page
## Code After:
from setuptools import setup
setup(
name='pyticketswitch',
version='1.6.4',
author='Ingresso',
author_email='systems@ingresso.co.uk',
url='https://github.com/ingresso-group/pyticketswitch/',
packages=[
'pyticketswitch',
'pyticketswitch.interface_objects'
],
license='MIT',
description='A Python interface for the Ingresso XML Core API',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 2.7',
'Intended Audience :: Developers',
'Natural Language :: English',
],
)
| from setuptools import setup
setup(
name='pyticketswitch',
version='1.6.4',
author='Ingresso',
author_email='systems@ingresso.co.uk',
+ url='https://github.com/ingresso-group/pyticketswitch/',
packages=[
'pyticketswitch',
'pyticketswitch.interface_objects'
],
license='MIT',
description='A Python interface for the Ingresso XML Core API',
long_description=open('README.rst').read(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Programming Language :: Python :: 2.7',
'Intended Audience :: Developers',
'Natural Language :: English',
],
) | 1 | 0.047619 | 1 | 0 |
20679984ae6dd9e467e4a29125d62621023f9aaa | lib/node_modules/@stdlib/string/starts-with/docs/repl.txt | lib/node_modules/@stdlib/string/starts-with/docs/repl.txt |
{{alias}}( str, search[, position] )
Tests if a string starts with the characters of another string.
If provided an empty search string, the function always returns `true`.
Parameters
----------
str: string
Input string.
search: string
Search string.
position: integer (optional)
Position at which to start searching for `search`. If less than `0`, the
start position is determined relative to the end of the input string.
Returns
-------
bool: boolean
Boolean indicating whether a `string` starts with the characters of
another `string`.
Examples
--------
> var bool = {{alias}}( 'Beep', 'Be' )
true
> bool = {{alias}}( 'Beep', 'ep' )
false
> bool = {{alias}}( 'Beep', 'ee', 1 )
true
> bool = {{alias}}( 'Beep', 'ee', -3 )
true
> bool = {{alias}}( 'Beep', '' )
true
See Also
--------
|
{{alias}}( str, search[, position] )
Tests if a string starts with the characters of another string.
If provided an empty search string, the function always returns `true`.
Parameters
----------
str: string
Input string.
search: string
Search string.
position: integer (optional)
Position at which to start searching for `search`. If less than `0`, the
start position is determined relative to the end of the input string.
Default: 0.
Returns
-------
bool: boolean
Boolean indicating whether a string starts with the characters of
another string.
Examples
--------
> var bool = {{alias}}( 'Beep', 'Be' )
true
> bool = {{alias}}( 'Beep', 'ep' )
false
> bool = {{alias}}( 'Beep', 'ee', 1 )
true
> bool = {{alias}}( 'Beep', 'ee', -3 )
true
> bool = {{alias}}( 'Beep', '' )
true
See Also
--------
| Fix description and document default | Fix description and document default
| Text | apache-2.0 | stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib,stdlib-js/stdlib | text | ## Code Before:
{{alias}}( str, search[, position] )
Tests if a string starts with the characters of another string.
If provided an empty search string, the function always returns `true`.
Parameters
----------
str: string
Input string.
search: string
Search string.
position: integer (optional)
Position at which to start searching for `search`. If less than `0`, the
start position is determined relative to the end of the input string.
Returns
-------
bool: boolean
Boolean indicating whether a `string` starts with the characters of
another `string`.
Examples
--------
> var bool = {{alias}}( 'Beep', 'Be' )
true
> bool = {{alias}}( 'Beep', 'ep' )
false
> bool = {{alias}}( 'Beep', 'ee', 1 )
true
> bool = {{alias}}( 'Beep', 'ee', -3 )
true
> bool = {{alias}}( 'Beep', '' )
true
See Also
--------
## Instruction:
Fix description and document default
## Code After:
{{alias}}( str, search[, position] )
Tests if a string starts with the characters of another string.
If provided an empty search string, the function always returns `true`.
Parameters
----------
str: string
Input string.
search: string
Search string.
position: integer (optional)
Position at which to start searching for `search`. If less than `0`, the
start position is determined relative to the end of the input string.
Default: 0.
Returns
-------
bool: boolean
Boolean indicating whether a string starts with the characters of
another string.
Examples
--------
> var bool = {{alias}}( 'Beep', 'Be' )
true
> bool = {{alias}}( 'Beep', 'ep' )
false
> bool = {{alias}}( 'Beep', 'ee', 1 )
true
> bool = {{alias}}( 'Beep', 'ee', -3 )
true
> bool = {{alias}}( 'Beep', '' )
true
See Also
--------
|
{{alias}}( str, search[, position] )
Tests if a string starts with the characters of another string.
If provided an empty search string, the function always returns `true`.
Parameters
----------
str: string
Input string.
search: string
Search string.
position: integer (optional)
Position at which to start searching for `search`. If less than `0`, the
start position is determined relative to the end of the input string.
+ Default: 0.
Returns
-------
bool: boolean
- Boolean indicating whether a `string` starts with the characters of
? - -
+ Boolean indicating whether a string starts with the characters of
- another `string`.
? - -
+ another string.
Examples
--------
> var bool = {{alias}}( 'Beep', 'Be' )
true
> bool = {{alias}}( 'Beep', 'ep' )
false
> bool = {{alias}}( 'Beep', 'ee', 1 )
true
> bool = {{alias}}( 'Beep', 'ee', -3 )
true
> bool = {{alias}}( 'Beep', '' )
true
See Also
--------
| 5 | 0.125 | 3 | 2 |
0cc38a8e48e9273052e0c8b30abde686486067a9 | src/User/Form/UserFormBuilder.php | src/User/Form/UserFormBuilder.php | <?php namespace Anomaly\UsersModule\User\Form;
use Anomaly\Streams\Platform\Ui\Form\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
use Illuminate\Http\Request;
/**
* Class UserFormBuilder
*
* @link http://anomaly.is/streams-platform
* @author AnomalyLabs, Inc. <hello@anomaly.is>
* @author Ryan Thompson <ryan@anomaly.is>
* @package Anomaly\UsersModule\User\Form
*/
class UserFormBuilder extends FormBuilder
{
/**
* The form actions.
*
* @var array
*/
protected $actions = [
'save'
];
/**
* The form buttons.
*
* @var array
*/
protected $buttons = [
'cancel'
];
/**
* Create a new UserFormBuilder instance.
*
* @param Form $form
*/
public function __construct(Form $form)
{
parent::__construct($form);
/**
* On post, if the password is not set
* then skip it entirely.
*/
$this->on(
'posting',
function (Request $request) {
if (!$request->get('password') && $this->form->getMode() == 'edit') {
$this->form->skipField('password');
};
}
);
}
}
| <?php namespace Anomaly\UsersModule\User\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
use Illuminate\Http\Request;
/**
* Class UserFormBuilder
*
* @link http://anomaly.is/streams-platform
* @author AnomalyLabs, Inc. <hello@anomaly.is>
* @author Ryan Thompson <ryan@anomaly.is>
* @package Anomaly\UsersModule\User\Form
*/
class UserFormBuilder extends FormBuilder
{
/**
* The form actions.
*
* @var array
*/
protected $actions = [
'save'
];
/**
* The form buttons.
*
* @var array
*/
protected $buttons = [
'cancel'
];
/**
* Fired just before posting.
*
* @param Request $request
*/
public function onPosting(Request $request)
{
if (!$request->get('password') && $this->form->getMode() == 'edit') {
$this->skipField('password');
};
}
}
| Fix issue when password is not present in post | Fix issue when password is not present in post
| PHP | mit | anomalylabs/users-module,JoelESvensson/users-module,JoelESvensson/users-module | php | ## Code Before:
<?php namespace Anomaly\UsersModule\User\Form;
use Anomaly\Streams\Platform\Ui\Form\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
use Illuminate\Http\Request;
/**
* Class UserFormBuilder
*
* @link http://anomaly.is/streams-platform
* @author AnomalyLabs, Inc. <hello@anomaly.is>
* @author Ryan Thompson <ryan@anomaly.is>
* @package Anomaly\UsersModule\User\Form
*/
class UserFormBuilder extends FormBuilder
{
/**
* The form actions.
*
* @var array
*/
protected $actions = [
'save'
];
/**
* The form buttons.
*
* @var array
*/
protected $buttons = [
'cancel'
];
/**
* Create a new UserFormBuilder instance.
*
* @param Form $form
*/
public function __construct(Form $form)
{
parent::__construct($form);
/**
* On post, if the password is not set
* then skip it entirely.
*/
$this->on(
'posting',
function (Request $request) {
if (!$request->get('password') && $this->form->getMode() == 'edit') {
$this->form->skipField('password');
};
}
);
}
}
## Instruction:
Fix issue when password is not present in post
## Code After:
<?php namespace Anomaly\UsersModule\User\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
use Illuminate\Http\Request;
/**
* Class UserFormBuilder
*
* @link http://anomaly.is/streams-platform
* @author AnomalyLabs, Inc. <hello@anomaly.is>
* @author Ryan Thompson <ryan@anomaly.is>
* @package Anomaly\UsersModule\User\Form
*/
class UserFormBuilder extends FormBuilder
{
/**
* The form actions.
*
* @var array
*/
protected $actions = [
'save'
];
/**
* The form buttons.
*
* @var array
*/
protected $buttons = [
'cancel'
];
/**
* Fired just before posting.
*
* @param Request $request
*/
public function onPosting(Request $request)
{
if (!$request->get('password') && $this->form->getMode() == 'edit') {
$this->skipField('password');
};
}
}
| <?php namespace Anomaly\UsersModule\User\Form;
- use Anomaly\Streams\Platform\Ui\Form\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
use Illuminate\Http\Request;
/**
* Class UserFormBuilder
*
* @link http://anomaly.is/streams-platform
* @author AnomalyLabs, Inc. <hello@anomaly.is>
* @author Ryan Thompson <ryan@anomaly.is>
* @package Anomaly\UsersModule\User\Form
*/
class UserFormBuilder extends FormBuilder
{
/**
* The form actions.
*
* @var array
*/
protected $actions = [
'save'
];
/**
* The form buttons.
*
* @var array
*/
protected $buttons = [
'cancel'
];
/**
- * Create a new UserFormBuilder instance.
+ * Fired just before posting.
*
- * @param Form $form
+ * @param Request $request
*/
- public function __construct(Form $form)
+ public function onPosting(Request $request)
{
- parent::__construct($form);
-
- /**
- * On post, if the password is not set
- * then skip it entirely.
- */
- $this->on(
- 'posting',
- function (Request $request) {
- if (!$request->get('password') && $this->form->getMode() == 'edit') {
? --------
+ if (!$request->get('password') && $this->form->getMode() == 'edit') {
- $this->form->skipField('password');
? -------- ------
+ $this->skipField('password');
- };
- }
- );
? ^
+ };
? ^
}
} | 24 | 0.413793 | 6 | 18 |
9260f274d5f565e4932ddd258a4e6203557df4ed | README.md | README.md | ⚓️ Smoothly scroll to `#anchors`
## Usage
1) Include the library
2) Initialize the AnchorScroll class and you're pretty much done!
```javascript
new AnchorScroller({
checkParent: true // checks if the parent element is an anchor
});
```
You can pass it an optional option object to tweak it's behavior. See all available options [here](#insert_later).
| ⚓️ Smoothly scroll to `#anchors`
## Features
* ... Scrolls to anchors
* Stops scrolling if the user scrolls
* Doesn't try to scroll past the end
It doesn't sound like much but it's actually really nice 😁
## Usage
1) **Include the library**
Can be done [with NPM](https://github.com/semlette/anchor-scroller/wiki/Using-Anchor-Scroller#as-global-variable) or [from a CDN](https://github.com/semlette/anchor-scroller/wiki/Using-Anchor-Scroller#as-global-variable)
2) **Initialize the AnchorScroll class and you're done!**
```javascript
new AnchorScroller();
```
*[You should check out the more in-depth usage guide](https://github.com/semlette/anchor-scroller/wiki/Using-Anchor-Scroller#options).*
| Add Features and adjust Usage | Add Features and adjust Usage | Markdown | mit | semlette/anchor-scroller,semlette/anchor-scroller,semlette/anchor-scroller | markdown | ## Code Before:
⚓️ Smoothly scroll to `#anchors`
## Usage
1) Include the library
2) Initialize the AnchorScroll class and you're pretty much done!
```javascript
new AnchorScroller({
checkParent: true // checks if the parent element is an anchor
});
```
You can pass it an optional option object to tweak it's behavior. See all available options [here](#insert_later).
## Instruction:
Add Features and adjust Usage
## Code After:
⚓️ Smoothly scroll to `#anchors`
## Features
* ... Scrolls to anchors
* Stops scrolling if the user scrolls
* Doesn't try to scroll past the end
It doesn't sound like much but it's actually really nice 😁
## Usage
1) **Include the library**
Can be done [with NPM](https://github.com/semlette/anchor-scroller/wiki/Using-Anchor-Scroller#as-global-variable) or [from a CDN](https://github.com/semlette/anchor-scroller/wiki/Using-Anchor-Scroller#as-global-variable)
2) **Initialize the AnchorScroll class and you're done!**
```javascript
new AnchorScroller();
```
*[You should check out the more in-depth usage guide](https://github.com/semlette/anchor-scroller/wiki/Using-Anchor-Scroller#options).*
| ⚓️ Smoothly scroll to `#anchors`
+ ## Features
+ * ... Scrolls to anchors
+ * Stops scrolling if the user scrolls
+ * Doesn't try to scroll past the end
+
+ It doesn't sound like much but it's actually really nice 😁
## Usage
- 1) Include the library
+ 1) **Include the library**
? ++ ++
+ Can be done [with NPM](https://github.com/semlette/anchor-scroller/wiki/Using-Anchor-Scroller#as-global-variable) or [from a CDN](https://github.com/semlette/anchor-scroller/wiki/Using-Anchor-Scroller#as-global-variable)
+
- 2) Initialize the AnchorScroll class and you're pretty much done!
? ------------
+ 2) **Initialize the AnchorScroll class and you're done!**
? ++ ++
```javascript
- new AnchorScroller({
? ^
+ new AnchorScroller();
? ^^
- checkParent: true // checks if the parent element is an anchor
- });
```
- You can pass it an optional option object to tweak it's behavior. See all available options [here](#insert_later).
+
+ *[You should check out the more in-depth usage guide](https://github.com/semlette/anchor-scroller/wiki/Using-Anchor-Scroller#options).* | 19 | 1.583333 | 13 | 6 |
c47048b0f97bd4ad493ea0c891a09606c44c39fa | app/src/ui/remove-repository/confirm-remove-repository.tsx | app/src/ui/remove-repository/confirm-remove-repository.tsx | import * as React from 'react'
import { ButtonGroup } from '../../ui/lib/button-group'
import { Button } from '../../ui/lib/button'
import { Dialog, DialogContent, DialogFooter } from '../../ui/dialog'
import { Repository } from '../../models/repository'
interface IConfirmRemoveRepositoryProps {
/** The repository to be removed */
readonly repository: Repository
/** The action to execute when the user confirms */
readonly onConfirmation: (repo: Repository) => void
/** The action to execute when the user cancels */
readonly onDismissed: () => void
}
export class ConfirmRemoveRepository extends React.Component<IConfirmRemoveRepositoryProps, void> {
private cancel = () => {
this.props.onDismissed()
}
private onConfirmed = () => {
this.props.onConfirmation(this.props.repository)
this.props.onDismissed()
}
public render() {
return (
<Dialog
id='confirm-remove-repository'
key='remove-repository-confirmation'
type='warning'
title={ __DARWIN__ ? 'Remove Repository' : 'Remove repository' }
onDismissed={this.cancel}
onSubmit={this.onConfirmed}
>
<DialogContent>
<p>Are you sure you want to remove this repository?</p>
</DialogContent>
<DialogFooter>
<ButtonGroup>
<Button type='submit'>Yes</Button>
<Button onClick={this.cancel}>No</Button>
</ButtonGroup>
</DialogFooter>
</Dialog>
)
}
}
| import * as React from 'react'
import { ButtonGroup } from '../../ui/lib/button-group'
import { Button } from '../../ui/lib/button'
import { Dialog, DialogContent, DialogFooter } from '../../ui/dialog'
import { Repository } from '../../models/repository'
interface IConfirmRemoveRepositoryProps {
/** The repository to be removed */
readonly repository: Repository
/** The action to execute when the user confirms */
readonly onConfirmation: (repo: Repository) => void
/** The action to execute when the user cancels */
readonly onDismissed: () => void
}
export class ConfirmRemoveRepository extends React.Component<IConfirmRemoveRepositoryProps, void> {
private cancel = () => {
this.props.onDismissed()
}
private onConfirmed = () => {
this.props.onConfirmation(this.props.repository)
this.props.onDismissed()
}
public render() {
return (
<Dialog
id='confirm-remove-repository'
key='remove-repository-confirmation'
type='warning'
title={ __DARWIN__ ? 'Remove Repository' : 'Remove repository' }
onDismissed={this.cancel}
onSubmit={this.onConfirmed}
>
<DialogContent>
<p>Are you sure you want to remove the repository "{this.props.repository.name}"?</p>
</DialogContent>
<DialogFooter>
<ButtonGroup>
<Button type='submit'>Yes</Button>
<Button onClick={this.cancel}>No</Button>
</ButtonGroup>
</DialogFooter>
</Dialog>
)
}
}
| Include repository name in dialog | Include repository name in dialog
| TypeScript | mit | j-f1/forked-desktop,gengjiawen/desktop,hjobrien/desktop,shiftkey/desktop,j-f1/forked-desktop,hjobrien/desktop,desktop/desktop,BugTesterTest/desktops,kactus-io/kactus,BugTesterTest/desktops,hjobrien/desktop,kactus-io/kactus,desktop/desktop,kactus-io/kactus,desktop/desktop,shiftkey/desktop,artivilla/desktop,BugTesterTest/desktops,shiftkey/desktop,kactus-io/kactus,say25/desktop,hjobrien/desktop,artivilla/desktop,say25/desktop,gengjiawen/desktop,j-f1/forked-desktop,desktop/desktop,artivilla/desktop,gengjiawen/desktop,artivilla/desktop,say25/desktop,gengjiawen/desktop,shiftkey/desktop,BugTesterTest/desktops,j-f1/forked-desktop,say25/desktop | typescript | ## Code Before:
import * as React from 'react'
import { ButtonGroup } from '../../ui/lib/button-group'
import { Button } from '../../ui/lib/button'
import { Dialog, DialogContent, DialogFooter } from '../../ui/dialog'
import { Repository } from '../../models/repository'
interface IConfirmRemoveRepositoryProps {
/** The repository to be removed */
readonly repository: Repository
/** The action to execute when the user confirms */
readonly onConfirmation: (repo: Repository) => void
/** The action to execute when the user cancels */
readonly onDismissed: () => void
}
export class ConfirmRemoveRepository extends React.Component<IConfirmRemoveRepositoryProps, void> {
private cancel = () => {
this.props.onDismissed()
}
private onConfirmed = () => {
this.props.onConfirmation(this.props.repository)
this.props.onDismissed()
}
public render() {
return (
<Dialog
id='confirm-remove-repository'
key='remove-repository-confirmation'
type='warning'
title={ __DARWIN__ ? 'Remove Repository' : 'Remove repository' }
onDismissed={this.cancel}
onSubmit={this.onConfirmed}
>
<DialogContent>
<p>Are you sure you want to remove this repository?</p>
</DialogContent>
<DialogFooter>
<ButtonGroup>
<Button type='submit'>Yes</Button>
<Button onClick={this.cancel}>No</Button>
</ButtonGroup>
</DialogFooter>
</Dialog>
)
}
}
## Instruction:
Include repository name in dialog
## Code After:
import * as React from 'react'
import { ButtonGroup } from '../../ui/lib/button-group'
import { Button } from '../../ui/lib/button'
import { Dialog, DialogContent, DialogFooter } from '../../ui/dialog'
import { Repository } from '../../models/repository'
interface IConfirmRemoveRepositoryProps {
/** The repository to be removed */
readonly repository: Repository
/** The action to execute when the user confirms */
readonly onConfirmation: (repo: Repository) => void
/** The action to execute when the user cancels */
readonly onDismissed: () => void
}
export class ConfirmRemoveRepository extends React.Component<IConfirmRemoveRepositoryProps, void> {
private cancel = () => {
this.props.onDismissed()
}
private onConfirmed = () => {
this.props.onConfirmation(this.props.repository)
this.props.onDismissed()
}
public render() {
return (
<Dialog
id='confirm-remove-repository'
key='remove-repository-confirmation'
type='warning'
title={ __DARWIN__ ? 'Remove Repository' : 'Remove repository' }
onDismissed={this.cancel}
onSubmit={this.onConfirmed}
>
<DialogContent>
<p>Are you sure you want to remove the repository "{this.props.repository.name}"?</p>
</DialogContent>
<DialogFooter>
<ButtonGroup>
<Button type='submit'>Yes</Button>
<Button onClick={this.cancel}>No</Button>
</ButtonGroup>
</DialogFooter>
</Dialog>
)
}
}
| import * as React from 'react'
import { ButtonGroup } from '../../ui/lib/button-group'
import { Button } from '../../ui/lib/button'
import { Dialog, DialogContent, DialogFooter } from '../../ui/dialog'
import { Repository } from '../../models/repository'
interface IConfirmRemoveRepositoryProps {
/** The repository to be removed */
readonly repository: Repository
/** The action to execute when the user confirms */
readonly onConfirmation: (repo: Repository) => void
/** The action to execute when the user cancels */
readonly onDismissed: () => void
}
export class ConfirmRemoveRepository extends React.Component<IConfirmRemoveRepositoryProps, void> {
private cancel = () => {
this.props.onDismissed()
}
private onConfirmed = () => {
this.props.onConfirmation(this.props.repository)
this.props.onDismissed()
}
public render() {
return (
<Dialog
id='confirm-remove-repository'
key='remove-repository-confirmation'
type='warning'
title={ __DARWIN__ ? 'Remove Repository' : 'Remove repository' }
onDismissed={this.cancel}
onSubmit={this.onConfirmed}
>
<DialogContent>
- <p>Are you sure you want to remove this repository?</p>
? ^^
+ <p>Are you sure you want to remove the repository "{this.props.repository.name}"?</p>
? ^ +++++++++++++++++++++++++++++++
</DialogContent>
<DialogFooter>
<ButtonGroup>
<Button type='submit'>Yes</Button>
<Button onClick={this.cancel}>No</Button>
</ButtonGroup>
</DialogFooter>
</Dialog>
)
}
} | 2 | 0.04 | 1 | 1 |
280c81a3990116f66de9af8e6fd6e71d0215a386 | client.py | client.py |
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clientConfig.txt")
path = sys.argv[1]
timeHash = hashlib.md5(str(time())).hexdigest()[0:6]
adjective = random.choice(adjectives)
keys=configReader.getKeys()
endpoint=keys['endpoint']
username=keys['username']
password=keys['password']
finalLocation=keys['finalLocation']
urlPath = adjective+timeHash+".png"
print "Uploading",path,"as",urlPath,"to",endpoint
r = requests.post(endpoint,params={'name':urlPath},files={'file':open(path,'rb')})
print r.status_code
if r.status_code==200:
print os.path.join(finalLocation,urlPath)
os.system("echo '"+os.path.join(finalLocation,urlPath)+"'|pbcopy")
|
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clientConfig.txt")
path = sys.argv[1]
timeHash = hashlib.md5(str(time())).hexdigest()[0:6]
adjective = random.choice(adjectives)
keys=configReader.getKeys()
endpoint=keys['endpoint']
username=keys['username']
password=keys['password']
finalLocation=keys['finalLocation']
urlPath = adjective+timeHash+".png"
print "Uploading",path,"as",urlPath,"to",endpoint
r = requests.post(endpoint,auth=(username,password),params={'name':urlPath},files={'file':open(path,'rb')})
print r.status_code
if r.status_code==200:
print os.path.join(finalLocation,urlPath)
os.system("echo '"+os.path.join(finalLocation,urlPath)+"'|pbcopy")
| Add authentication to the serverside | Add authentication to the serverside
| Python | mit | ollien/Screenshot-Uploader,ollien/Screenshot-Uploader | python | ## Code Before:
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clientConfig.txt")
path = sys.argv[1]
timeHash = hashlib.md5(str(time())).hexdigest()[0:6]
adjective = random.choice(adjectives)
keys=configReader.getKeys()
endpoint=keys['endpoint']
username=keys['username']
password=keys['password']
finalLocation=keys['finalLocation']
urlPath = adjective+timeHash+".png"
print "Uploading",path,"as",urlPath,"to",endpoint
r = requests.post(endpoint,params={'name':urlPath},files={'file':open(path,'rb')})
print r.status_code
if r.status_code==200:
print os.path.join(finalLocation,urlPath)
os.system("echo '"+os.path.join(finalLocation,urlPath)+"'|pbcopy")
## Instruction:
Add authentication to the serverside
## Code After:
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clientConfig.txt")
path = sys.argv[1]
timeHash = hashlib.md5(str(time())).hexdigest()[0:6]
adjective = random.choice(adjectives)
keys=configReader.getKeys()
endpoint=keys['endpoint']
username=keys['username']
password=keys['password']
finalLocation=keys['finalLocation']
urlPath = adjective+timeHash+".png"
print "Uploading",path,"as",urlPath,"to",endpoint
r = requests.post(endpoint,auth=(username,password),params={'name':urlPath},files={'file':open(path,'rb')})
print r.status_code
if r.status_code==200:
print os.path.join(finalLocation,urlPath)
os.system("echo '"+os.path.join(finalLocation,urlPath)+"'|pbcopy")
|
from configReader import ConfigReader
import sys
import os, os.path
import os.path
from time import time
from math import floor
import hashlib
import random
import requests
f = open('adjectives.txt','r')
adjectives = [line.rstrip() for line in f]
f.close()
configReader = ConfigReader(name="clientConfig.txt")
path = sys.argv[1]
timeHash = hashlib.md5(str(time())).hexdigest()[0:6]
adjective = random.choice(adjectives)
keys=configReader.getKeys()
endpoint=keys['endpoint']
username=keys['username']
password=keys['password']
finalLocation=keys['finalLocation']
urlPath = adjective+timeHash+".png"
print "Uploading",path,"as",urlPath,"to",endpoint
- r = requests.post(endpoint,params={'name':urlPath},files={'file':open(path,'rb')})
+ r = requests.post(endpoint,auth=(username,password),params={'name':urlPath},files={'file':open(path,'rb')})
? +++++++++++++++++++++++++
print r.status_code
if r.status_code==200:
print os.path.join(finalLocation,urlPath)
os.system("echo '"+os.path.join(finalLocation,urlPath)+"'|pbcopy") | 2 | 0.066667 | 1 | 1 |
861b4bcbcdf256c44b0681876c300443d214c23a | src/Acme/TestBundle/Controller/TestController.php | src/Acme/TestBundle/Controller/TestController.php | <?php
// src/Acme/TestBundle/Controller/TestController.php
namespace Acme\TestBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class TestController extends Controller
{
public function indexAction()
{
// return new Response('le jeuj a encore frappé');
// $response = $this->forward('AcmeHelloBundle:Hello:index', array('foo' => 'get', 'bar' => 'rekt'));
$response = $this->forward('AcmeTestBundle:Test:update');
return $response;
}
public function updateAction()
{
die('here');
}
}
| <?php
// src/Acme/TestBundle/Controller/TestController.php
namespace Acme\TestBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
class TestController extends Controller
{
public function indexAction()
{
throw new HttpException(418,
"This message is displayed only in dev mod.");
}
public function updateAction()
{
die('here');
}
}
| Test sur les exceptions réussi | Test sur les exceptions réussi
| PHP | mit | Peshmelba/sf2test | php | ## Code Before:
<?php
// src/Acme/TestBundle/Controller/TestController.php
namespace Acme\TestBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
class TestController extends Controller
{
public function indexAction()
{
// return new Response('le jeuj a encore frappé');
// $response = $this->forward('AcmeHelloBundle:Hello:index', array('foo' => 'get', 'bar' => 'rekt'));
$response = $this->forward('AcmeTestBundle:Test:update');
return $response;
}
public function updateAction()
{
die('here');
}
}
## Instruction:
Test sur les exceptions réussi
## Code After:
<?php
// src/Acme/TestBundle/Controller/TestController.php
namespace Acme\TestBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
class TestController extends Controller
{
public function indexAction()
{
throw new HttpException(418,
"This message is displayed only in dev mod.");
}
public function updateAction()
{
die('here');
}
}
| <?php
// src/Acme/TestBundle/Controller/TestController.php
namespace Acme\TestBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;
+ use Symfony\Component\HttpKernel\Exception\HttpException;
class TestController extends Controller
{
public function indexAction()
{
+ throw new HttpException(418,
+ "This message is displayed only in dev mod.");
- // return new Response('le jeuj a encore frappé');
- // $response = $this->forward('AcmeHelloBundle:Hello:index', array('foo' => 'get', 'bar' => 'rekt'));
- $response = $this->forward('AcmeTestBundle:Test:update');
-
- return $response;
-
}
public function updateAction()
{
die('here');
}
}
| 9 | 0.333333 | 3 | 6 |
979fd4ce0ed2d78c6be29307a28170be8c37cc70 | scripts/postinstall.sh | scripts/postinstall.sh | date > /etc/vagrant_box_build_time
# update the apt cache and packages
case $(lsb_release -cs) in
'precise')
apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get clean
;;
*)
;;
esac
apt-get -qy update
apt-get -qy upgrade
# install some oft used packages
apt-get -qy install linux-headers-$(uname -r) build-essential
apt-get -qy install zlib1g-dev libssl-dev
apt-get -qy install python-software-properties python-setuptools python-dev
apt-get -qy install ruby1.9.3
# configure password-less sudo
usermod -a -G sudo vagrant
echo "%vagrant ALL=NOPASSWD:ALL" > /tmp/vagrant
mv /tmp/vagrant /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant
# install the vagrant-provided ssh keys
mkdir -pm 700 /home/vagrant/.ssh
curl -Lo /home/vagrant/.ssh/authorized_keys \
'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub'
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh
# clean up any artifacts
rm -f /home/vagrant/shutdown.sh
exit
| date > /etc/vagrant_box_build_time
# update the apt cache and packages
case $(lsb_release -cs) in
'precise')
apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get clean
;;
*)
;;
esac
apt-get -qy update
apt-get -qy upgrade
# install some oft used packages
apt-get -qy install linux-headers-$(uname -r) build-essential
apt-get -qy install zlib1g-dev libssl-dev
apt-get -qy install python-software-properties python-setuptools python-dev
# configure password-less sudo
usermod -a -G sudo vagrant
echo "%vagrant ALL=NOPASSWD:ALL" > /tmp/vagrant
mv /tmp/vagrant /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant
# install the vagrant-provided ssh keys
mkdir -pm 700 /home/vagrant/.ssh
curl -Lo /home/vagrant/.ssh/authorized_keys \
'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub'
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh
# clean up any artifacts
rm -f /home/vagrant/shutdown.sh
exit
| Remove ruby from the default packages. | Remove ruby from the default packages.
Boxes shouldn't install packages which are not directly needed. This originally
came to support the install of Chef, but this is now done through a package.
| Shell | mit | nickcharlton/boxes,nickcharlton/boxes,nickcharlton/boxes | shell | ## Code Before:
date > /etc/vagrant_box_build_time
# update the apt cache and packages
case $(lsb_release -cs) in
'precise')
apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get clean
;;
*)
;;
esac
apt-get -qy update
apt-get -qy upgrade
# install some oft used packages
apt-get -qy install linux-headers-$(uname -r) build-essential
apt-get -qy install zlib1g-dev libssl-dev
apt-get -qy install python-software-properties python-setuptools python-dev
apt-get -qy install ruby1.9.3
# configure password-less sudo
usermod -a -G sudo vagrant
echo "%vagrant ALL=NOPASSWD:ALL" > /tmp/vagrant
mv /tmp/vagrant /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant
# install the vagrant-provided ssh keys
mkdir -pm 700 /home/vagrant/.ssh
curl -Lo /home/vagrant/.ssh/authorized_keys \
'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub'
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh
# clean up any artifacts
rm -f /home/vagrant/shutdown.sh
exit
## Instruction:
Remove ruby from the default packages.
Boxes shouldn't install packages which are not directly needed. This originally
came to support the install of Chef, but this is now done through a package.
## Code After:
date > /etc/vagrant_box_build_time
# update the apt cache and packages
case $(lsb_release -cs) in
'precise')
apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get clean
;;
*)
;;
esac
apt-get -qy update
apt-get -qy upgrade
# install some oft used packages
apt-get -qy install linux-headers-$(uname -r) build-essential
apt-get -qy install zlib1g-dev libssl-dev
apt-get -qy install python-software-properties python-setuptools python-dev
# configure password-less sudo
usermod -a -G sudo vagrant
echo "%vagrant ALL=NOPASSWD:ALL" > /tmp/vagrant
mv /tmp/vagrant /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant
# install the vagrant-provided ssh keys
mkdir -pm 700 /home/vagrant/.ssh
curl -Lo /home/vagrant/.ssh/authorized_keys \
'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub'
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh
# clean up any artifacts
rm -f /home/vagrant/shutdown.sh
exit
| date > /etc/vagrant_box_build_time
# update the apt cache and packages
case $(lsb_release -cs) in
'precise')
apt-get clean
rm -rf /var/lib/apt/lists/*
apt-get clean
;;
*)
;;
esac
apt-get -qy update
apt-get -qy upgrade
# install some oft used packages
apt-get -qy install linux-headers-$(uname -r) build-essential
apt-get -qy install zlib1g-dev libssl-dev
apt-get -qy install python-software-properties python-setuptools python-dev
- apt-get -qy install ruby1.9.3
# configure password-less sudo
usermod -a -G sudo vagrant
echo "%vagrant ALL=NOPASSWD:ALL" > /tmp/vagrant
mv /tmp/vagrant /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant
# install the vagrant-provided ssh keys
mkdir -pm 700 /home/vagrant/.ssh
curl -Lo /home/vagrant/.ssh/authorized_keys \
'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub'
chmod 0600 /home/vagrant/.ssh/authorized_keys
chown -R vagrant:vagrant /home/vagrant/.ssh
# clean up any artifacts
rm -f /home/vagrant/shutdown.sh
exit | 1 | 0.025641 | 0 | 1 |
4c328973e9e7203e63dc573aa555e4bf35e438e3 | src/DubyBootstrap.aj | src/DubyBootstrap.aj | import java.util.ArrayList;
import java.util.List;
import mirah.lang.ast.Node;
import mirah.lang.ast.NodeScanner;
import mirah.lang.ast.NodeImpl;
class ChildCollector extends NodeScanner {
private ArrayList<Node> children = new ArrayList<Node>();
@Override
public boolean enterDefault(Node node, Object arg) {
if (node == arg) {
return true;
} else {
children.add(node);
return false;
}
}
@Override
public Object enterNullChild(Object arg){
children.add(null);
return null;
}
public ArrayList<Node> children() {
return children;
}
}
aspect DubyBootsrap {
declare parents: Node extends duby.lang.compiler.Node;
public List<Node> NodeImpl.child_nodes() {
ChildCollector c = new ChildCollector();
c.scan(this, this);
return c.children();
}
} | import java.util.ArrayList;
import java.util.List;
import mirah.lang.ast.Node;
import mirah.lang.ast.NodeScanner;
import mirah.lang.ast.NodeImpl;
/* To compile the new AST with duby extensions:
* ajc -1.5 -inpath dist/mirah-parser.jar \
* -outjar dist/mirah-parser_with_duby.jar \
* -classpath ../mirah/javalib/mirah-bootstrap.jar:/Developer/aspectj1.6/lib/aspectjrt.jar \
* src/DubyBootstrap.aj
*/
class ChildCollector extends NodeScanner {
private ArrayList<Node> children = new ArrayList<Node>();
@Override
public boolean enterDefault(Node node, Object arg) {
if (node == arg) {
return true;
} else {
children.add(node);
return false;
}
}
@Override
public Object enterNullChild(Object arg){
children.add(null);
return null;
}
public ArrayList<Node> children() {
return children;
}
}
aspect DubyBootsrap {
declare parents: Node extends duby.lang.compiler.Node;
public List<Node> NodeImpl.child_nodes() {
ChildCollector c = new ChildCollector();
c.scan(this, this);
return c.children();
}
} | Add compilation instructions for mirah-parser_with_duby.jar | Add compilation instructions for mirah-parser_with_duby.jar
| AspectJ | apache-2.0 | mirah/mirah,mirah/mirah-parser,uujava/mirah-parser,felixvf/mirah,mirah/mirah,mirah/mirah-parser,felixvf/mirah-parser,uujava/mirah-parser,uujava/mirah-parser,felixvf/mirah,mirah/mirah,felixvf/mirah,mirah/mirah,mirah/mirah-parser,felixvf/mirah,felixvf/mirah-parser,felixvf/mirah-parser | aspectj | ## Code Before:
import java.util.ArrayList;
import java.util.List;
import mirah.lang.ast.Node;
import mirah.lang.ast.NodeScanner;
import mirah.lang.ast.NodeImpl;
class ChildCollector extends NodeScanner {
private ArrayList<Node> children = new ArrayList<Node>();
@Override
public boolean enterDefault(Node node, Object arg) {
if (node == arg) {
return true;
} else {
children.add(node);
return false;
}
}
@Override
public Object enterNullChild(Object arg){
children.add(null);
return null;
}
public ArrayList<Node> children() {
return children;
}
}
aspect DubyBootsrap {
declare parents: Node extends duby.lang.compiler.Node;
public List<Node> NodeImpl.child_nodes() {
ChildCollector c = new ChildCollector();
c.scan(this, this);
return c.children();
}
}
## Instruction:
Add compilation instructions for mirah-parser_with_duby.jar
## Code After:
import java.util.ArrayList;
import java.util.List;
import mirah.lang.ast.Node;
import mirah.lang.ast.NodeScanner;
import mirah.lang.ast.NodeImpl;
/* To compile the new AST with duby extensions:
* ajc -1.5 -inpath dist/mirah-parser.jar \
* -outjar dist/mirah-parser_with_duby.jar \
* -classpath ../mirah/javalib/mirah-bootstrap.jar:/Developer/aspectj1.6/lib/aspectjrt.jar \
* src/DubyBootstrap.aj
*/
class ChildCollector extends NodeScanner {
private ArrayList<Node> children = new ArrayList<Node>();
@Override
public boolean enterDefault(Node node, Object arg) {
if (node == arg) {
return true;
} else {
children.add(node);
return false;
}
}
@Override
public Object enterNullChild(Object arg){
children.add(null);
return null;
}
public ArrayList<Node> children() {
return children;
}
}
aspect DubyBootsrap {
declare parents: Node extends duby.lang.compiler.Node;
public List<Node> NodeImpl.child_nodes() {
ChildCollector c = new ChildCollector();
c.scan(this, this);
return c.children();
}
} | import java.util.ArrayList;
import java.util.List;
import mirah.lang.ast.Node;
import mirah.lang.ast.NodeScanner;
import mirah.lang.ast.NodeImpl;
+ /* To compile the new AST with duby extensions:
+ * ajc -1.5 -inpath dist/mirah-parser.jar \
+ * -outjar dist/mirah-parser_with_duby.jar \
+ * -classpath ../mirah/javalib/mirah-bootstrap.jar:/Developer/aspectj1.6/lib/aspectjrt.jar \
+ * src/DubyBootstrap.aj
+ */
class ChildCollector extends NodeScanner {
private ArrayList<Node> children = new ArrayList<Node>();
@Override
public boolean enterDefault(Node node, Object arg) {
if (node == arg) {
return true;
} else {
children.add(node);
return false;
}
}
@Override
public Object enterNullChild(Object arg){
children.add(null);
return null;
}
public ArrayList<Node> children() {
return children;
}
}
aspect DubyBootsrap {
declare parents: Node extends duby.lang.compiler.Node;
public List<Node> NodeImpl.child_nodes() {
ChildCollector c = new ChildCollector();
c.scan(this, this);
return c.children();
}
} | 6 | 0.15 | 6 | 0 |
25a0d9ab63ffb9abaacaabdcef437fd68c059443 | dev/socket-io/README.md | dev/socket-io/README.md | * [websocket与socket.io比较与分析](https://www.jianshu.com/p/2ec3d20341ab)
| * [websocket与socket.io比较与分析](https://www.jianshu.com/p/2ec3d20341ab)
* [在 Go 中使用 Websockets 和 Socket.IO](https://studygolang.com/articles/19813)
| Add 在 Go 中使用 Websockets 和 Socket.IO | Add 在 Go 中使用 Websockets 和 Socket.IO
| Markdown | mit | northbright/bookmarks,northbright/bookmarks,northbright/bookmarks | markdown | ## Code Before:
* [websocket与socket.io比较与分析](https://www.jianshu.com/p/2ec3d20341ab)
## Instruction:
Add 在 Go 中使用 Websockets 和 Socket.IO
## Code After:
* [websocket与socket.io比较与分析](https://www.jianshu.com/p/2ec3d20341ab)
* [在 Go 中使用 Websockets 和 Socket.IO](https://studygolang.com/articles/19813)
| * [websocket与socket.io比较与分析](https://www.jianshu.com/p/2ec3d20341ab)
+ * [在 Go 中使用 Websockets 和 Socket.IO](https://studygolang.com/articles/19813) | 1 | 1 | 1 | 0 |
265a9f725f4497cab87f75a2415cd6ce33aa49f3 | src/test/java/com/cognitect/transit/TestRoundtrip.java | src/test/java/com/cognitect/transit/TestRoundtrip.java | // Copyright (c) Cognitect, Inc.
// All rights reserved.
package com.cognitect.transit;
public class TestRoundtrip {
public static void main(String [] args) throws Exception {
// TODO: use argument to set up json or msgpack
Reader reader = Reader.getJsonInstance(System.in, Reader.defaultDecoders());
Writer writer = Writer.getJsonInstance(System.out, Writer.defaultHandlers());
try {
while(true) {
Object o = reader.read();
writer.write(o);
}
}
catch(Exception e) {
// exit
}
}
}
| // Copyright (c) Cognitect, Inc.
// All rights reserved.
package com.cognitect.transit;
public class TestRoundtrip {
public static void main(String [] args) throws Exception {
String encoding = args[0];
Reader reader;
Writer writer;
if(encoding.equals("msgpack")) {
reader = Reader.getMsgpackInstance(System.in, Reader.defaultDecoders());
writer = Writer.getMsgpackInstance(System.out, Writer.defaultHandlers());
}
else {
reader = Reader.getJsonInstance(System.in, Reader.defaultDecoders());
writer = Writer.getJsonInstance(System.out, Writer.defaultHandlers());
}
try {
while(true) {
Object o = reader.read();
writer.write(o);
}
}
catch(Exception e) {
// exit
}
}
}
| Use args to create the desired instance of transit | Use args to create the desired instance of transit
| Java | apache-2.0 | alexanderkiel/transit-java,cognitect/transit-java,freakynit/transit-java,cognitect/transit-java,LonoCloud/transit-java,freakynit/transit-java,LonoCloud/transit-java,alexanderkiel/transit-java | java | ## Code Before:
// Copyright (c) Cognitect, Inc.
// All rights reserved.
package com.cognitect.transit;
public class TestRoundtrip {
public static void main(String [] args) throws Exception {
// TODO: use argument to set up json or msgpack
Reader reader = Reader.getJsonInstance(System.in, Reader.defaultDecoders());
Writer writer = Writer.getJsonInstance(System.out, Writer.defaultHandlers());
try {
while(true) {
Object o = reader.read();
writer.write(o);
}
}
catch(Exception e) {
// exit
}
}
}
## Instruction:
Use args to create the desired instance of transit
## Code After:
// Copyright (c) Cognitect, Inc.
// All rights reserved.
package com.cognitect.transit;
public class TestRoundtrip {
public static void main(String [] args) throws Exception {
String encoding = args[0];
Reader reader;
Writer writer;
if(encoding.equals("msgpack")) {
reader = Reader.getMsgpackInstance(System.in, Reader.defaultDecoders());
writer = Writer.getMsgpackInstance(System.out, Writer.defaultHandlers());
}
else {
reader = Reader.getJsonInstance(System.in, Reader.defaultDecoders());
writer = Writer.getJsonInstance(System.out, Writer.defaultHandlers());
}
try {
while(true) {
Object o = reader.read();
writer.write(o);
}
}
catch(Exception e) {
// exit
}
}
}
| // Copyright (c) Cognitect, Inc.
// All rights reserved.
package com.cognitect.transit;
public class TestRoundtrip {
public static void main(String [] args) throws Exception {
- // TODO: use argument to set up json or msgpack
+ String encoding = args[0];
+
+ Reader reader;
+ Writer writer;
+
+ if(encoding.equals("msgpack")) {
+ reader = Reader.getMsgpackInstance(System.in, Reader.defaultDecoders());
+ writer = Writer.getMsgpackInstance(System.out, Writer.defaultHandlers());
+ }
+ else {
- Reader reader = Reader.getJsonInstance(System.in, Reader.defaultDecoders());
? ^^^^^^
+ reader = Reader.getJsonInstance(System.in, Reader.defaultDecoders());
? ^^^
- Writer writer = Writer.getJsonInstance(System.out, Writer.defaultHandlers());
? ^^^^^^
+ writer = Writer.getJsonInstance(System.out, Writer.defaultHandlers());
? ^^^
+ }
try {
while(true) {
Object o = reader.read();
writer.write(o);
}
}
catch(Exception e) {
// exit
}
}
} | 16 | 0.666667 | 13 | 3 |
f3fc11945cf5263902c9bebcde49979dd80bc9b3 | components/VideoLivestream.vue | components/VideoLivestream.vue | <style lang="scss" scoped>
.video-wrapper {
margin-top: 2rem;
}
.video-wrapper iframe {
min-height: 360px;
width: 100%;
@include mobile {
min-height: 230px;
}
}
</style>
<template>
<div class="video-wrapper">
<iframe src="https://player.vimeo.com/video/323205772" frameborder="0"
webkitallowfullscreen mozallowfullscreen allowfullscreen>
</iframe>
</div>
</template>
| <style lang="scss" scoped>
.video-wrapper {
margin-top: 2rem;
}
.video-wrapper iframe {
min-height: 360px;
width: 100%;
@include mobile {
min-height: 230px;
}
}
</style>
<template>
<div class="video-wrapper">
<iframe src="https://www.youtube-nocookie.com/embed/Z94bOTBGLzM" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
webkitallowfullscreen mozallowfullscreen allowfullscreen>
</iframe>
</div>
</template>
| Switch to official youtube stream | Switch to official youtube stream
| Vue | isc | fightforthefuture/battleforthenet,fightforthefuture/battleforthenet,fightforthefuture/battleforthenet | vue | ## Code Before:
<style lang="scss" scoped>
.video-wrapper {
margin-top: 2rem;
}
.video-wrapper iframe {
min-height: 360px;
width: 100%;
@include mobile {
min-height: 230px;
}
}
</style>
<template>
<div class="video-wrapper">
<iframe src="https://player.vimeo.com/video/323205772" frameborder="0"
webkitallowfullscreen mozallowfullscreen allowfullscreen>
</iframe>
</div>
</template>
## Instruction:
Switch to official youtube stream
## Code After:
<style lang="scss" scoped>
.video-wrapper {
margin-top: 2rem;
}
.video-wrapper iframe {
min-height: 360px;
width: 100%;
@include mobile {
min-height: 230px;
}
}
</style>
<template>
<div class="video-wrapper">
<iframe src="https://www.youtube-nocookie.com/embed/Z94bOTBGLzM" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
webkitallowfullscreen mozallowfullscreen allowfullscreen>
</iframe>
</div>
</template>
| <style lang="scss" scoped>
.video-wrapper {
margin-top: 2rem;
}
.video-wrapper iframe {
min-height: 360px;
width: 100%;
@include mobile {
min-height: 230px;
}
}
</style>
<template>
<div class="video-wrapper">
- <iframe src="https://player.vimeo.com/video/323205772" frameborder="0"
+ <iframe src="https://www.youtube-nocookie.com/embed/Z94bOTBGLzM" frameborder="0"
+ allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
webkitallowfullscreen mozallowfullscreen allowfullscreen>
</iframe>
</div>
</template> | 3 | 0.142857 | 2 | 1 |
2668c41557a9ebe9c5dc545fc7275ede2e6c3a07 | src/Impetus/AppBundle/Resources/views/Macros/table.html.twig | src/Impetus/AppBundle/Resources/views/Macros/table.html.twig | {% macro info_row(name, value) %}
<tr>
<th class="label">{{ name }}</th>
<td class="data">{{ value|default('<i>Not entered</i>')|raw }}</td>
</tr>
{% endmacro %}
{% macro divider() %}
<tr>
<td colspan="2" class="divider"><hr /></td>
</tr>
{% endmacro %} | {% macro info_row(name, value) %}
<tr>
<th class="label">{{ name }}</th>
{% if value != null %}
<td class="data">{{ value }}</td>
{% else %}
<td class="data"><i>Not entered</i></td>
{% endif %}
</tr>
{% endmacro %}
{% macro divider() %}
<tr>
<td colspan="2" class="divider"><hr /></td>
</tr>
{% endmacro %} | Fix raw text output that would lead to wild JS execution | Fix raw text output that would lead to wild JS execution
| Twig | mit | cosmotron/Impetus,cosmotron/Impetus | twig | ## Code Before:
{% macro info_row(name, value) %}
<tr>
<th class="label">{{ name }}</th>
<td class="data">{{ value|default('<i>Not entered</i>')|raw }}</td>
</tr>
{% endmacro %}
{% macro divider() %}
<tr>
<td colspan="2" class="divider"><hr /></td>
</tr>
{% endmacro %}
## Instruction:
Fix raw text output that would lead to wild JS execution
## Code After:
{% macro info_row(name, value) %}
<tr>
<th class="label">{{ name }}</th>
{% if value != null %}
<td class="data">{{ value }}</td>
{% else %}
<td class="data"><i>Not entered</i></td>
{% endif %}
</tr>
{% endmacro %}
{% macro divider() %}
<tr>
<td colspan="2" class="divider"><hr /></td>
</tr>
{% endmacro %} | {% macro info_row(name, value) %}
<tr>
<th class="label">{{ name }}</th>
+ {% if value != null %}
+ <td class="data">{{ value }}</td>
+ {% else %}
- <td class="data">{{ value|default('<i>Not entered</i>')|raw }}</td>
? ------------------ ---------
+ <td class="data"><i>Not entered</i></td>
? ++++
+ {% endif %}
</tr>
{% endmacro %}
{% macro divider() %}
<tr>
<td colspan="2" class="divider"><hr /></td>
</tr>
{% endmacro %} | 6 | 0.5 | 5 | 1 |
3f17f951d05df849ccf87cae92d7318587857050 | 001-create-citus-extension.sql | 001-create-citus-extension.sql | CREATE EXTENSION citus;
| -- wrap in transaction to ensure Docker flag always visible
BEGIN;
CREATE EXTENSION citus;
-- add Docker flag to node metadata
UPDATE pg_dist_node_metadata SET metadata=jsonb_insert(metadata, '{docker}', 'true');
COMMIT;
| Add Docker flag to node metadata | Add Docker flag to node metadata
| SQL | apache-2.0 | citusdata/docker | sql | ## Code Before:
CREATE EXTENSION citus;
## Instruction:
Add Docker flag to node metadata
## Code After:
-- wrap in transaction to ensure Docker flag always visible
BEGIN;
CREATE EXTENSION citus;
-- add Docker flag to node metadata
UPDATE pg_dist_node_metadata SET metadata=jsonb_insert(metadata, '{docker}', 'true');
COMMIT;
| + -- wrap in transaction to ensure Docker flag always visible
+ BEGIN;
CREATE EXTENSION citus;
+
+ -- add Docker flag to node metadata
+ UPDATE pg_dist_node_metadata SET metadata=jsonb_insert(metadata, '{docker}', 'true');
+ COMMIT; | 6 | 6 | 6 | 0 |
d2fc123454bdf0089043ef3926798f3f79904c60 | Lib/test/test_openpty.py | Lib/test/test_openpty.py |
import os, unittest
from test.test_support import run_unittest, TestSkipped
class OpenptyTest(unittest.TestCase):
def test(self):
try:
master, slave = os.openpty()
except AttributeError:
raise TestSkipped, "No openpty() available."
if not os.isatty(slave):
self.fail("Slave-end of pty is not a terminal.")
os.write(slave, 'Ping!')
self.assertEqual(os.read(master, 1024), 'Ping!')
def test_main():
run_unittest(OpenptyTest)
if __name__ == '__main__':
test_main()
|
import os, unittest
from test.test_support import run_unittest, TestSkipped
if not hasattr(os, "openpty"):
raise TestSkipped, "No openpty() available."
class OpenptyTest(unittest.TestCase):
def test(self):
master, slave = os.openpty()
if not os.isatty(slave):
self.fail("Slave-end of pty is not a terminal.")
os.write(slave, 'Ping!')
self.assertEqual(os.read(master, 1024), 'Ping!')
def test_main():
run_unittest(OpenptyTest)
if __name__ == '__main__':
test_main()
| Move the check for openpty to the beginning. | Move the check for openpty to the beginning.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | python | ## Code Before:
import os, unittest
from test.test_support import run_unittest, TestSkipped
class OpenptyTest(unittest.TestCase):
def test(self):
try:
master, slave = os.openpty()
except AttributeError:
raise TestSkipped, "No openpty() available."
if not os.isatty(slave):
self.fail("Slave-end of pty is not a terminal.")
os.write(slave, 'Ping!')
self.assertEqual(os.read(master, 1024), 'Ping!')
def test_main():
run_unittest(OpenptyTest)
if __name__ == '__main__':
test_main()
## Instruction:
Move the check for openpty to the beginning.
## Code After:
import os, unittest
from test.test_support import run_unittest, TestSkipped
if not hasattr(os, "openpty"):
raise TestSkipped, "No openpty() available."
class OpenptyTest(unittest.TestCase):
def test(self):
master, slave = os.openpty()
if not os.isatty(slave):
self.fail("Slave-end of pty is not a terminal.")
os.write(slave, 'Ping!')
self.assertEqual(os.read(master, 1024), 'Ping!')
def test_main():
run_unittest(OpenptyTest)
if __name__ == '__main__':
test_main()
|
import os, unittest
from test.test_support import run_unittest, TestSkipped
+ if not hasattr(os, "openpty"):
+ raise TestSkipped, "No openpty() available."
+
+
class OpenptyTest(unittest.TestCase):
def test(self):
- try:
- master, slave = os.openpty()
? ----
+ master, slave = os.openpty()
- except AttributeError:
- raise TestSkipped, "No openpty() available."
-
if not os.isatty(slave):
self.fail("Slave-end of pty is not a terminal.")
os.write(slave, 'Ping!')
self.assertEqual(os.read(master, 1024), 'Ping!')
def test_main():
run_unittest(OpenptyTest)
if __name__ == '__main__':
test_main() | 10 | 0.454545 | 5 | 5 |
34120e47268354d025e45cfdb1cb798d0d1385ac | packages/facebook-oauth/package.js | packages/facebook-oauth/package.js | Package.describe({
summary: "Facebook OAuth flow",
version: "1.7.1"
});
Package.onUse(api => {
api.versionsFrom('1.11.1');
api.use('ecmascript', ['client', 'server']);
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('random', 'client');
api.use('service-configuration', ['client', 'server']);
api.addFiles('facebook_client.js', 'client');
api.addFiles('facebook_server.js', 'server');
api.export('Facebook');
});
| Package.describe({
summary: "Facebook OAuth flow",
version: "1.7.1"
});
Package.onUse(api => {
api.use('ecmascript', ['client', 'server']);
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('random', 'client');
api.use('service-configuration', ['client', 'server']);
api.addFiles('facebook_client.js', 'client');
api.addFiles('facebook_server.js', 'server');
api.export('Facebook');
});
| Support all arguments of OAuth._redirectUri | Support all arguments of OAuth._redirectUri
| JavaScript | mit | Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor,Hansoft/meteor | javascript | ## Code Before:
Package.describe({
summary: "Facebook OAuth flow",
version: "1.7.1"
});
Package.onUse(api => {
api.versionsFrom('1.11.1');
api.use('ecmascript', ['client', 'server']);
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('random', 'client');
api.use('service-configuration', ['client', 'server']);
api.addFiles('facebook_client.js', 'client');
api.addFiles('facebook_server.js', 'server');
api.export('Facebook');
});
## Instruction:
Support all arguments of OAuth._redirectUri
## Code After:
Package.describe({
summary: "Facebook OAuth flow",
version: "1.7.1"
});
Package.onUse(api => {
api.use('ecmascript', ['client', 'server']);
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('random', 'client');
api.use('service-configuration', ['client', 'server']);
api.addFiles('facebook_client.js', 'client');
api.addFiles('facebook_server.js', 'server');
api.export('Facebook');
});
| Package.describe({
summary: "Facebook OAuth flow",
version: "1.7.1"
});
Package.onUse(api => {
- api.versionsFrom('1.11.1');
-
api.use('ecmascript', ['client', 'server']);
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('random', 'client');
api.use('service-configuration', ['client', 'server']);
api.addFiles('facebook_client.js', 'client');
api.addFiles('facebook_server.js', 'server');
api.export('Facebook');
}); | 2 | 0.1 | 0 | 2 |
4fa0bdacf59a1a9fcdf01b2fd6160bbd6ee59260 | areweblic/templates/licenses.html | areweblic/templates/licenses.html | {% extends "layout.html" %}
{% from "bootstrap/utils.html" import form_button, icon %}
{% block content %}
<h1>{{ title|default('Licenses') }}</h1>
<p>Total license count: {{ pagination.query.count() }}</p>
{% if pagination.items %}
<table class="table">
<thead>
<tr>
<th>ID</th>
{% if users %}
<th>User</th>
{% endif %}
<th>Product</th>
<th>Request date</th>
</tr>
</thead>
<tbody>
{% for item in pagination.items %}
<tr>
<td>{{ item.id }} {{ form_button(url_for(target, lic_id=item.id), icon('eye-open'), method='get') }}</td>
{% if users %}
<td>{{ users.get(item.user_id).email|default(item.user_id) }}</th>
{% endif %}
<td>{{ products.get(item.product_id).name }}</td>
<td>{{ item.request_date }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% from "bootstrap/pagination.html" import render_pagination %}
{{ render_pagination(pagination) }}
{% else %}
<p>No license found.</p>
{% endif %}
<p>{{ form_button(url_for('new'), icon('upload') + ' New license request') }}</p>
{% endblock %}
| {% extends "layout.html" %}
{% from "bootstrap/utils.html" import form_button, icon %}
{% block content %}
<h1>{{ title|default('Licenses') }}</h1>
<p>Total license count: {{ pagination.query.count() }}</p>
{% if pagination.items %}
<table class="table">
<thead>
<tr>
<th>ID</th>
{% if users %}
<th>User</th>
{% endif %}
<th>Product</th>
<th>Request date</th>
</tr>
</thead>
<tbody>
{% for item in pagination.items %}
<tr>
<td>{{ item.id }} {{ form_button(url_for(target, lic_id=item.id), icon('eye-open'), method='get') }}</td>
{% if users %}
<td>{{ users.get(item.user_id).email|default(item.user_id) }}</th>
{% endif %}
<td>{{ products.get(item.product_id).name }}</td>
<td>{{ item.request_date }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% from "bootstrap/pagination.html" import render_pagination %}
{{ render_pagination(pagination) }}
{% else %}
<p>No license found.</p>
{% endif %}
<p>{{ form_button(url_for('new'), icon('upload') + ' New license request', method='get') }}</p>
{% endblock %}
| Use get method for the form button | Use get method for the form button
| HTML | mit | avalentino/slim,avalentino/slim | html | ## Code Before:
{% extends "layout.html" %}
{% from "bootstrap/utils.html" import form_button, icon %}
{% block content %}
<h1>{{ title|default('Licenses') }}</h1>
<p>Total license count: {{ pagination.query.count() }}</p>
{% if pagination.items %}
<table class="table">
<thead>
<tr>
<th>ID</th>
{% if users %}
<th>User</th>
{% endif %}
<th>Product</th>
<th>Request date</th>
</tr>
</thead>
<tbody>
{% for item in pagination.items %}
<tr>
<td>{{ item.id }} {{ form_button(url_for(target, lic_id=item.id), icon('eye-open'), method='get') }}</td>
{% if users %}
<td>{{ users.get(item.user_id).email|default(item.user_id) }}</th>
{% endif %}
<td>{{ products.get(item.product_id).name }}</td>
<td>{{ item.request_date }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% from "bootstrap/pagination.html" import render_pagination %}
{{ render_pagination(pagination) }}
{% else %}
<p>No license found.</p>
{% endif %}
<p>{{ form_button(url_for('new'), icon('upload') + ' New license request') }}</p>
{% endblock %}
## Instruction:
Use get method for the form button
## Code After:
{% extends "layout.html" %}
{% from "bootstrap/utils.html" import form_button, icon %}
{% block content %}
<h1>{{ title|default('Licenses') }}</h1>
<p>Total license count: {{ pagination.query.count() }}</p>
{% if pagination.items %}
<table class="table">
<thead>
<tr>
<th>ID</th>
{% if users %}
<th>User</th>
{% endif %}
<th>Product</th>
<th>Request date</th>
</tr>
</thead>
<tbody>
{% for item in pagination.items %}
<tr>
<td>{{ item.id }} {{ form_button(url_for(target, lic_id=item.id), icon('eye-open'), method='get') }}</td>
{% if users %}
<td>{{ users.get(item.user_id).email|default(item.user_id) }}</th>
{% endif %}
<td>{{ products.get(item.product_id).name }}</td>
<td>{{ item.request_date }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% from "bootstrap/pagination.html" import render_pagination %}
{{ render_pagination(pagination) }}
{% else %}
<p>No license found.</p>
{% endif %}
<p>{{ form_button(url_for('new'), icon('upload') + ' New license request', method='get') }}</p>
{% endblock %}
| {% extends "layout.html" %}
{% from "bootstrap/utils.html" import form_button, icon %}
{% block content %}
<h1>{{ title|default('Licenses') }}</h1>
<p>Total license count: {{ pagination.query.count() }}</p>
{% if pagination.items %}
<table class="table">
<thead>
<tr>
<th>ID</th>
{% if users %}
<th>User</th>
{% endif %}
<th>Product</th>
<th>Request date</th>
</tr>
</thead>
<tbody>
{% for item in pagination.items %}
<tr>
<td>{{ item.id }} {{ form_button(url_for(target, lic_id=item.id), icon('eye-open'), method='get') }}</td>
{% if users %}
<td>{{ users.get(item.user_id).email|default(item.user_id) }}</th>
{% endif %}
<td>{{ products.get(item.product_id).name }}</td>
<td>{{ item.request_date }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% from "bootstrap/pagination.html" import render_pagination %}
{{ render_pagination(pagination) }}
{% else %}
<p>No license found.</p>
{% endif %}
- <p>{{ form_button(url_for('new'), icon('upload') + ' New license request') }}</p>
+ <p>{{ form_button(url_for('new'), icon('upload') + ' New license request', method='get') }}</p>
? ++++++++++++++
{% endblock %} | 2 | 0.05 | 1 | 1 |
d5027732a4eb7ce1e623c2c44bcf8cc61af0d81d | src/components/Settings/index.js | src/components/Settings/index.js | import * as togglActions from '../../actions/toggl';
import React, { Component } from 'react';
import Toggl from './Toggl';
import { connect } from 'react-redux';
import { logout } from '../../actions/auth'
class Settings extends Component {
constructor() {
super();
this.saveToggl = this.saveToggl.bind(this);
}
saveToggl(apiKey) {
this.props.dispatch(togglActions.saveKey(apiKey));
}
startTimer() {
this.props.dispatch(togglActions.startTimer({
description: 'Test by UnwiseConnect',
}));
}
render() {
return (
<div>
<h1>Settings</h1>
<Toggl
apiKey={this.props.toggl ? this.props.toggl.apiKey : undefined}
onSubmit={this.saveToggl}
/>
<p style={{ marginTop: '2em' }}>Use the button below to test the toggl integration. It will start a time entry called "Test by UnwiseConnect".</p>
<button
type="button"
className="btn btn-primary"
onClick={e => this.startTimer()}
>
Start timer
</button>
</div>
);
}
};
const mapStateToProps = state => state.user;
export default connect(mapStateToProps)(Settings);
| import * as togglActions from '../../actions/toggl';
import React, { Component } from 'react';
import Toggl from './Toggl';
import { connect } from 'react-redux';
import { logout } from '../../actions/auth'
class Settings extends Component {
constructor() {
super();
this.saveToggl = this.saveToggl.bind(this);
}
saveToggl(apiKey) {
this.props.dispatch(togglActions.saveKey(apiKey));
}
startTimer() {
this.props.dispatch(togglActions.startTimer({
description: 'Test by UnwiseConnect',
}));
}
render() {
return (
<div>
<h1>Settings</h1>
<div className="row">
<div className="col-md-8">
<Toggl
apiKey={this.props.toggl ? this.props.toggl.apiKey : undefined}
onSubmit={this.saveToggl}
/>
</div>
<div className="col-md-4">
<p style={{ marginTop: '2em' }}>Use the button below to test the toggl integration. It will start a time entry called "Test by UnwiseConnect".</p>
<button
type="button"
className="btn btn-primary"
onClick={e => this.startTimer()}
>
Start timer
</button>
</div>
</div>
<hr/>
<button
onClick={() => this.props.dispatch(logout())}
className="btn btn-danger"
>
Logout
</button>
</div>
);
}
};
const mapStateToProps = state => state.user;
export default connect(mapStateToProps)(Settings);
| Move logout button to Settings page and add slight layout adjustment | Move logout button to Settings page and add slight layout adjustment
| JavaScript | mit | nadavspi/UnwiseConnect,nadavspi/UnwiseConnect,nadavspi/UnwiseConnect | javascript | ## Code Before:
import * as togglActions from '../../actions/toggl';
import React, { Component } from 'react';
import Toggl from './Toggl';
import { connect } from 'react-redux';
import { logout } from '../../actions/auth'
class Settings extends Component {
constructor() {
super();
this.saveToggl = this.saveToggl.bind(this);
}
saveToggl(apiKey) {
this.props.dispatch(togglActions.saveKey(apiKey));
}
startTimer() {
this.props.dispatch(togglActions.startTimer({
description: 'Test by UnwiseConnect',
}));
}
render() {
return (
<div>
<h1>Settings</h1>
<Toggl
apiKey={this.props.toggl ? this.props.toggl.apiKey : undefined}
onSubmit={this.saveToggl}
/>
<p style={{ marginTop: '2em' }}>Use the button below to test the toggl integration. It will start a time entry called "Test by UnwiseConnect".</p>
<button
type="button"
className="btn btn-primary"
onClick={e => this.startTimer()}
>
Start timer
</button>
</div>
);
}
};
const mapStateToProps = state => state.user;
export default connect(mapStateToProps)(Settings);
## Instruction:
Move logout button to Settings page and add slight layout adjustment
## Code After:
import * as togglActions from '../../actions/toggl';
import React, { Component } from 'react';
import Toggl from './Toggl';
import { connect } from 'react-redux';
import { logout } from '../../actions/auth'
class Settings extends Component {
constructor() {
super();
this.saveToggl = this.saveToggl.bind(this);
}
saveToggl(apiKey) {
this.props.dispatch(togglActions.saveKey(apiKey));
}
startTimer() {
this.props.dispatch(togglActions.startTimer({
description: 'Test by UnwiseConnect',
}));
}
render() {
return (
<div>
<h1>Settings</h1>
<div className="row">
<div className="col-md-8">
<Toggl
apiKey={this.props.toggl ? this.props.toggl.apiKey : undefined}
onSubmit={this.saveToggl}
/>
</div>
<div className="col-md-4">
<p style={{ marginTop: '2em' }}>Use the button below to test the toggl integration. It will start a time entry called "Test by UnwiseConnect".</p>
<button
type="button"
className="btn btn-primary"
onClick={e => this.startTimer()}
>
Start timer
</button>
</div>
</div>
<hr/>
<button
onClick={() => this.props.dispatch(logout())}
className="btn btn-danger"
>
Logout
</button>
</div>
);
}
};
const mapStateToProps = state => state.user;
export default connect(mapStateToProps)(Settings);
| import * as togglActions from '../../actions/toggl';
import React, { Component } from 'react';
import Toggl from './Toggl';
import { connect } from 'react-redux';
import { logout } from '../../actions/auth'
class Settings extends Component {
constructor() {
super();
this.saveToggl = this.saveToggl.bind(this);
}
saveToggl(apiKey) {
this.props.dispatch(togglActions.saveKey(apiKey));
}
startTimer() {
this.props.dispatch(togglActions.startTimer({
description: 'Test by UnwiseConnect',
}));
}
render() {
return (
<div>
<h1>Settings</h1>
+ <div className="row">
+ <div className="col-md-8">
- <Toggl
? -
+ <Toggl
? ++++
- apiKey={this.props.toggl ? this.props.toggl.apiKey : undefined}
+ apiKey={this.props.toggl ? this.props.toggl.apiKey : undefined}
? ++++
- onSubmit={this.saveToggl}
+ onSubmit={this.saveToggl}
? ++++
- />
+ />
? ++++
-
+ </div>
+ <div className="col-md-4">
- <p style={{ marginTop: '2em' }}>Use the button below to test the toggl integration. It will start a time entry called "Test by UnwiseConnect".</p>
+ <p style={{ marginTop: '2em' }}>Use the button below to test the toggl integration. It will start a time entry called "Test by UnwiseConnect".</p>
? ++++
+ <button
+ type="button"
+ className="btn btn-primary"
+ onClick={e => this.startTimer()}
+ >
+ Start timer
+ </button>
+ </div>
+ </div>
+ <hr/>
- <button
? -
+ <button
- type="button"
+ onClick={() => this.props.dispatch(logout())}
- className="btn btn-primary"
? ^ -----
+ className="btn btn-danger"
? ^^^^^
- onClick={e => this.startTimer()}
>
- Start timer
+ Logout
</button>
</div>
);
}
};
const mapStateToProps = state => state.user;
export default connect(mapStateToProps)(Settings); | 34 | 0.723404 | 23 | 11 |
8c1abfb854c384912cc3d30c51b1d8f26c94d344 | app/views/literatures/index.html.slim | app/views/literatures/index.html.slim | h1 Homepage
table border="1"
thead
tr
th Title
th Type
th Content
th Author
th Published At
th Tags
tbody
- @literature.each do |literature|
tr
td = link_to literature.title, literature
td = literature.type
td = truncate literature.content
td = literature.author_name
td = literature.published_at
td = render literature.tags
| h1 Homepage
table border="1"
thead
tr
th Title
th Type
th Content
th Author
th Published At
th Tags
tbody
- @literature.each do |literature|
tr
td = link_to literature.title, literature
td = literature.type
td = truncate literature.content
td = link_to literature.author_name, literature.author
td = literature.published_at
td = render literature.tags
| Add link to author in literature index. | Add link to author in literature index.
| Slim | mit | brianvanburken/publisher-rails,brianvanburken/publisher,brianvanburken/publisher,robinkanters/publisher,robinkanters/publisher,brianvanburken/publisher,robinkanters/publisher,brianvanburken/publisher-rails,brianvanburken/publisher-rails | slim | ## Code Before:
h1 Homepage
table border="1"
thead
tr
th Title
th Type
th Content
th Author
th Published At
th Tags
tbody
- @literature.each do |literature|
tr
td = link_to literature.title, literature
td = literature.type
td = truncate literature.content
td = literature.author_name
td = literature.published_at
td = render literature.tags
## Instruction:
Add link to author in literature index.
## Code After:
h1 Homepage
table border="1"
thead
tr
th Title
th Type
th Content
th Author
th Published At
th Tags
tbody
- @literature.each do |literature|
tr
td = link_to literature.title, literature
td = literature.type
td = truncate literature.content
td = link_to literature.author_name, literature.author
td = literature.published_at
td = render literature.tags
| h1 Homepage
table border="1"
thead
tr
th Title
th Type
th Content
th Author
th Published At
th Tags
tbody
- @literature.each do |literature|
tr
td = link_to literature.title, literature
td = literature.type
td = truncate literature.content
- td = literature.author_name
+ td = link_to literature.author_name, literature.author
td = literature.published_at
td = render literature.tags | 2 | 0.105263 | 1 | 1 |
c3fa815d73f253cb35f1b6c047755e23af1a1dee | src/operator/application.jsx | src/operator/application.jsx | import React from 'react';
import Visitors from './visitors';
import * as actions from './actions';
export default React.createClass({
propTypes: {
visitors: React.PropTypes.array.isRequired,
dispatch: React.PropTypes.func.isRequired
},
handleInvite(visitorId) {
this.props.dispatch(actions.inviteVisitor(visitorId));
},
render() {
return (
<div>
<h1>Operator's home</h1>
<p>This is an operator's application!</p>
<hr />
<Visitors
visitors={this.props.visitors}
onInvite={this.handleInvite}
/>
</div>
);
}
});
| import React from 'react';
import Visitors from './visitors';
import * as actions from './actions';
export default class Application extends React.Component {
handleInvite(visitorId) {
this.props.dispatch(actions.inviteVisitor(visitorId));
}
render() {
return (
<div>
<h1>Operator's home</h1>
<p>This is an operator's application!</p>
<hr />
<Visitors
visitors={this.props.visitors}
onInvite={this.handleInvite.bind(this)}
/>
</div>
);
}
};
Application.propTypes = {
visitors: React.PropTypes.array.isRequired,
dispatch: React.PropTypes.func.isRequired
};
| Rewrite <Application /> to be an ES6 class | Rewrite <Application /> to be an ES6 class | JSX | apache-2.0 | JustBlackBird/mibew-ui,JustBlackBird/mibew-ui | jsx | ## Code Before:
import React from 'react';
import Visitors from './visitors';
import * as actions from './actions';
export default React.createClass({
propTypes: {
visitors: React.PropTypes.array.isRequired,
dispatch: React.PropTypes.func.isRequired
},
handleInvite(visitorId) {
this.props.dispatch(actions.inviteVisitor(visitorId));
},
render() {
return (
<div>
<h1>Operator's home</h1>
<p>This is an operator's application!</p>
<hr />
<Visitors
visitors={this.props.visitors}
onInvite={this.handleInvite}
/>
</div>
);
}
});
## Instruction:
Rewrite <Application /> to be an ES6 class
## Code After:
import React from 'react';
import Visitors from './visitors';
import * as actions from './actions';
export default class Application extends React.Component {
handleInvite(visitorId) {
this.props.dispatch(actions.inviteVisitor(visitorId));
}
render() {
return (
<div>
<h1>Operator's home</h1>
<p>This is an operator's application!</p>
<hr />
<Visitors
visitors={this.props.visitors}
onInvite={this.handleInvite.bind(this)}
/>
</div>
);
}
};
Application.propTypes = {
visitors: React.PropTypes.array.isRequired,
dispatch: React.PropTypes.func.isRequired
};
| import React from 'react';
import Visitors from './visitors';
import * as actions from './actions';
+ export default class Application extends React.Component {
- export default React.createClass({
- propTypes: {
- visitors: React.PropTypes.array.isRequired,
- dispatch: React.PropTypes.func.isRequired
- },
-
handleInvite(visitorId) {
this.props.dispatch(actions.inviteVisitor(visitorId));
- },
? -
+ }
render() {
return (
<div>
<h1>Operator's home</h1>
<p>This is an operator's application!</p>
<hr />
<Visitors
visitors={this.props.visitors}
- onInvite={this.handleInvite}
+ onInvite={this.handleInvite.bind(this)}
? +++++++++++
/>
</div>
);
}
- });
? -
+ };
+
+ Application.propTypes = {
+ visitors: React.PropTypes.array.isRequired,
+ dispatch: React.PropTypes.func.isRequired
+ }; | 18 | 0.642857 | 9 | 9 |
44a8c9cda972404e59b3c321667913b5068a746a | client/lib/components/Stats/style.scss | client/lib/components/Stats/style.scss | @import 'main/style/defaults';
.Stats {
.card-body {
padding: 0.75rem;
text-align: center;
}
}
.Stats__value {
font-size: 1.4rem;
}
| @import 'main/style/defaults';
.Stats {
.card-body {
padding: 0.75rem;
text-align: center;
}
}
.Stats__title {
color: color: $text-muted;
}
.Stats__value {
font-size: 1.25rem;
}
| Reduce font size for stats values | Reduce font size for stats values
| SCSS | mit | dreikanter/feeder,dreikanter/feeder,dreikanter/feeder | scss | ## Code Before:
@import 'main/style/defaults';
.Stats {
.card-body {
padding: 0.75rem;
text-align: center;
}
}
.Stats__value {
font-size: 1.4rem;
}
## Instruction:
Reduce font size for stats values
## Code After:
@import 'main/style/defaults';
.Stats {
.card-body {
padding: 0.75rem;
text-align: center;
}
}
.Stats__title {
color: color: $text-muted;
}
.Stats__value {
font-size: 1.25rem;
}
| @import 'main/style/defaults';
.Stats {
.card-body {
padding: 0.75rem;
text-align: center;
}
}
+ .Stats__title {
+ color: color: $text-muted;
+ }
+
.Stats__value {
- font-size: 1.4rem;
? ^
+ font-size: 1.25rem;
? ^^
} | 6 | 0.5 | 5 | 1 |
b0c38ed6d379d7cfea3c292a6a8f1d94e856f36c | src/Oro/Bundle/LocaleBundle/Resources/doc/reference/current-localization.md | src/Oro/Bundle/LocaleBundle/Resources/doc/reference/current-localization.md | Current Localization
====================
Table of Contents
-----------------
- [Receive Current Localization](#receive-current-localization)
- [Provide Current Localization](#provide-current-localization)
Receive Current Localization
============================
For receive current localization use `Oro\Bundle\LocaleBundle\Helper\LocalizationHelper::getCurrentLocalization()` or `oro_locale.helper.localization->getCurrentLocalization()`
Provide Current Localization
============================
For provider current localization need create custom provider, implement `Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface`, and register by tag `oro_locale.extension.current_localization`.
```yml
acme_demo.extension.current_localization:
class: 'Acme\Bundle\DemoBundle\Extension\CurrentLocalizationExtension'
arguments:
...
tags:
- { name: oro_locale.extension.current_localization }
```
```php
<?php
namespace Oro\Bundle\FrontendLocalizationBundle\Extension;
use Oro\Bundle\LocaleBundle\Entity\Localization;
use Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface;
class CurrentLocalizationExtension implements CurrentLocalizationExtensionInterface
{
/**
* @return Localization|null
*/
public function getCurrentLocalization()
{
// your custom logic to receive current localization
}
}
``` | Current Localization
====================
Table of Contents
-----------------
- [Receive Current Localization](#receive-current-localization)
- [Provide Current Localization](#provide-current-localization)
Receive Current Localization
============================
For receive current localization use `Oro\Bundle\LocaleBundle\Helper\LocalizationHelper::getCurrentLocalization()` or `oro_locale.helper.localization->getCurrentLocalization()`
Provide Current Localization
============================
For provide current localization, need create custom extension, implement `Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface`, and register it by tag `oro_locale.extension.current_localization`.
```yml
acme_demo.extension.current_localization:
class: 'Acme\Bundle\DemoBundle\Extension\CurrentLocalizationExtension'
arguments:
...
tags:
- { name: oro_locale.extension.current_localization }
```
```php
<?php
namespace Acme\Bundle\DemoBundle\Extension;
use Oro\Bundle\LocaleBundle\Entity\Localization;
use Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface;
class CurrentLocalizationExtension implements CurrentLocalizationExtensionInterface
{
/**
* @return Localization|null
*/
public function getCurrentLocalization()
{
// your custom logic to receive current localization
}
}
``` | Update documentation, UPGRADE.md - udpated docs | BB-3756: Update documentation, UPGRADE.md
- udpated docs | Markdown | mit | Djamy/platform,trustify/oroplatform,orocrm/platform,geoffroycochard/platform,orocrm/platform,Djamy/platform,orocrm/platform,geoffroycochard/platform,trustify/oroplatform,geoffroycochard/platform,trustify/oroplatform,Djamy/platform | markdown | ## Code Before:
Current Localization
====================
Table of Contents
-----------------
- [Receive Current Localization](#receive-current-localization)
- [Provide Current Localization](#provide-current-localization)
Receive Current Localization
============================
For receive current localization use `Oro\Bundle\LocaleBundle\Helper\LocalizationHelper::getCurrentLocalization()` or `oro_locale.helper.localization->getCurrentLocalization()`
Provide Current Localization
============================
For provider current localization need create custom provider, implement `Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface`, and register by tag `oro_locale.extension.current_localization`.
```yml
acme_demo.extension.current_localization:
class: 'Acme\Bundle\DemoBundle\Extension\CurrentLocalizationExtension'
arguments:
...
tags:
- { name: oro_locale.extension.current_localization }
```
```php
<?php
namespace Oro\Bundle\FrontendLocalizationBundle\Extension;
use Oro\Bundle\LocaleBundle\Entity\Localization;
use Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface;
class CurrentLocalizationExtension implements CurrentLocalizationExtensionInterface
{
/**
* @return Localization|null
*/
public function getCurrentLocalization()
{
// your custom logic to receive current localization
}
}
```
## Instruction:
BB-3756: Update documentation, UPGRADE.md
- udpated docs
## Code After:
Current Localization
====================
Table of Contents
-----------------
- [Receive Current Localization](#receive-current-localization)
- [Provide Current Localization](#provide-current-localization)
Receive Current Localization
============================
For receive current localization use `Oro\Bundle\LocaleBundle\Helper\LocalizationHelper::getCurrentLocalization()` or `oro_locale.helper.localization->getCurrentLocalization()`
Provide Current Localization
============================
For provide current localization, need create custom extension, implement `Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface`, and register it by tag `oro_locale.extension.current_localization`.
```yml
acme_demo.extension.current_localization:
class: 'Acme\Bundle\DemoBundle\Extension\CurrentLocalizationExtension'
arguments:
...
tags:
- { name: oro_locale.extension.current_localization }
```
```php
<?php
namespace Acme\Bundle\DemoBundle\Extension;
use Oro\Bundle\LocaleBundle\Entity\Localization;
use Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface;
class CurrentLocalizationExtension implements CurrentLocalizationExtensionInterface
{
/**
* @return Localization|null
*/
public function getCurrentLocalization()
{
// your custom logic to receive current localization
}
}
``` | Current Localization
====================
Table of Contents
-----------------
- [Receive Current Localization](#receive-current-localization)
- [Provide Current Localization](#provide-current-localization)
Receive Current Localization
============================
For receive current localization use `Oro\Bundle\LocaleBundle\Helper\LocalizationHelper::getCurrentLocalization()` or `oro_locale.helper.localization->getCurrentLocalization()`
Provide Current Localization
============================
- For provider current localization need create custom provider, implement `Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface`, and register by tag `oro_locale.extension.current_localization`.
? - ^^^^^^^^
+ For provide current localization, need create custom extension, implement `Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface`, and register it by tag `oro_locale.extension.current_localization`.
? + ^^^^^^^^^ +++
```yml
acme_demo.extension.current_localization:
class: 'Acme\Bundle\DemoBundle\Extension\CurrentLocalizationExtension'
arguments:
...
tags:
- { name: oro_locale.extension.current_localization }
```
```php
<?php
- namespace Oro\Bundle\FrontendLocalizationBundle\Extension;
+ namespace Acme\Bundle\DemoBundle\Extension;
use Oro\Bundle\LocaleBundle\Entity\Localization;
use Oro\Bundle\LocaleBundle\Extension\CurrentLocalizationExtensionInterface;
class CurrentLocalizationExtension implements CurrentLocalizationExtensionInterface
{
/**
* @return Localization|null
*/
public function getCurrentLocalization()
{
// your custom logic to receive current localization
}
}
``` | 4 | 0.086957 | 2 | 2 |
494091954e9a0d2ebf2c06944dfb424b93b7cd77 | less/sticky.less | less/sticky.less | .badge-sticky {
background: #d13e32;
}
.post-discussion-stickied {
& .post-icon, & .post-activity-info, & .post-activity-info a {
color: #d13e32;
}
}
.discussion-excerpt {
display: block !important;
margin-bottom: 10px;
white-space: normal;
font-size: 12px;
line-height: 1.5em;
color: #aaa;
}
| .badge-sticky {
background: #d13e32;
}
.post-discussion-stickied {
& .post-icon, & .post-activity-info, & .post-activity-info a {
color: #d13e32;
}
}
.discussion-excerpt {
margin-bottom: 10px;
white-space: normal;
font-size: 12px;
line-height: 1.5em;
color: @fl-body-muted-more-color;
.discussion-summary .info > li& {
display: block;
.paned & {
display: none;
}
@media @phone {
display: none;
}
}
}
| Hide excerpt in discussion list pane + on mobile | Hide excerpt in discussion list pane + on mobile
| Less | mit | flarum/flarum-ext-sticky,flarum/sticky,flarum/flarum-ext-sticky,flarum/sticky | less | ## Code Before:
.badge-sticky {
background: #d13e32;
}
.post-discussion-stickied {
& .post-icon, & .post-activity-info, & .post-activity-info a {
color: #d13e32;
}
}
.discussion-excerpt {
display: block !important;
margin-bottom: 10px;
white-space: normal;
font-size: 12px;
line-height: 1.5em;
color: #aaa;
}
## Instruction:
Hide excerpt in discussion list pane + on mobile
## Code After:
.badge-sticky {
background: #d13e32;
}
.post-discussion-stickied {
& .post-icon, & .post-activity-info, & .post-activity-info a {
color: #d13e32;
}
}
.discussion-excerpt {
margin-bottom: 10px;
white-space: normal;
font-size: 12px;
line-height: 1.5em;
color: @fl-body-muted-more-color;
.discussion-summary .info > li& {
display: block;
.paned & {
display: none;
}
@media @phone {
display: none;
}
}
}
| .badge-sticky {
background: #d13e32;
}
.post-discussion-stickied {
& .post-icon, & .post-activity-info, & .post-activity-info a {
color: #d13e32;
}
}
.discussion-excerpt {
- display: block !important;
margin-bottom: 10px;
white-space: normal;
font-size: 12px;
line-height: 1.5em;
- color: #aaa;
+ color: @fl-body-muted-more-color;
+
+ .discussion-summary .info > li& {
+ display: block;
+
+ .paned & {
+ display: none;
+ }
+ @media @phone {
+ display: none;
+ }
+ }
} | 14 | 0.875 | 12 | 2 |
f8143186c753a9dbad384e682caba4ac3a52f6ac | config/initializers/delayed_job.rb | config/initializers/delayed_job.rb | if Rails.env.production?
log_file = \
File.join Rails.root, 'log', 'delayed_job.log'
Delayed::Worker.logger = \
Logger.new log_file
if caller.last =~ /script\/delayed_job/ or (File.basename($0) == "rake" and ARGV[0] =~ /jobs\:work/)
ActiveRecord::Base.logger = Delayed::Worker.logger
end
ActionMailer::Base.logger = Delayed::Worker.logger
end
| if Rails.env.production?
log_file = \
File.join Rails.root, 'log', 'delayed_job.log'
Delayed::Worker.logger = \
Logger.new log_file
if caller.last =~ /script\/delayed_job/ or (File.basename($0) == "rake" and ARGV[0] =~ /jobs\:work/)
ActiveRecord::Base.logger = Delayed::Worker.logger
end
ActionMailer::Base.logger = Delayed::Worker.logger
module Delayed
module Backend
module ActiveRecord
class Job
class << self
alias_method :reserve_original, :reserve
def reserve(worker, max_run_time = Worker.max_run_time)
previous_level = ::ActiveRecord::Base.logger.level
::ActiveRecord::Base.logger.level = Logger::WARN if previous_level < Logger::WARN
value = reserve_original(worker, max_run_time)
::ActiveRecord::Base.logger.level = previous_level
value
end
end
end
end
end
end
end
| Hide delayed job sql messages in production.log | Hide delayed job sql messages in production.log | Ruby | mit | djsegal/julia_observer,djsegal/julia_observer,djsegal/julia_observer | ruby | ## Code Before:
if Rails.env.production?
log_file = \
File.join Rails.root, 'log', 'delayed_job.log'
Delayed::Worker.logger = \
Logger.new log_file
if caller.last =~ /script\/delayed_job/ or (File.basename($0) == "rake" and ARGV[0] =~ /jobs\:work/)
ActiveRecord::Base.logger = Delayed::Worker.logger
end
ActionMailer::Base.logger = Delayed::Worker.logger
end
## Instruction:
Hide delayed job sql messages in production.log
## Code After:
if Rails.env.production?
log_file = \
File.join Rails.root, 'log', 'delayed_job.log'
Delayed::Worker.logger = \
Logger.new log_file
if caller.last =~ /script\/delayed_job/ or (File.basename($0) == "rake" and ARGV[0] =~ /jobs\:work/)
ActiveRecord::Base.logger = Delayed::Worker.logger
end
ActionMailer::Base.logger = Delayed::Worker.logger
module Delayed
module Backend
module ActiveRecord
class Job
class << self
alias_method :reserve_original, :reserve
def reserve(worker, max_run_time = Worker.max_run_time)
previous_level = ::ActiveRecord::Base.logger.level
::ActiveRecord::Base.logger.level = Logger::WARN if previous_level < Logger::WARN
value = reserve_original(worker, max_run_time)
::ActiveRecord::Base.logger.level = previous_level
value
end
end
end
end
end
end
end
| if Rails.env.production?
log_file = \
File.join Rails.root, 'log', 'delayed_job.log'
Delayed::Worker.logger = \
Logger.new log_file
if caller.last =~ /script\/delayed_job/ or (File.basename($0) == "rake" and ARGV[0] =~ /jobs\:work/)
ActiveRecord::Base.logger = Delayed::Worker.logger
end
ActionMailer::Base.logger = Delayed::Worker.logger
+ module Delayed
+ module Backend
+ module ActiveRecord
+ class Job
+ class << self
+
+ alias_method :reserve_original, :reserve
+
+ def reserve(worker, max_run_time = Worker.max_run_time)
+ previous_level = ::ActiveRecord::Base.logger.level
+ ::ActiveRecord::Base.logger.level = Logger::WARN if previous_level < Logger::WARN
+
+ value = reserve_original(worker, max_run_time)
+ ::ActiveRecord::Base.logger.level = previous_level
+
+ value
+ end
+
+ end
+ end
+ end
+ end
+ end
+
end | 24 | 1.6 | 24 | 0 |
8e5b9afa8ff62d6e72d9117c81b7680fa09c439e | CHANGES.rst | CHANGES.rst | 0.1.0 - Development
-------------------
The first release.
| 0.1.1 (2016-06-29)
------------------
- Fixed GH-3: The depended six must later than 1.9.0 because we used its
"python_2_unicode_compatible" decorator.
0.1.0 (2015-06-19)
------------------
The first release.
| Update the changelog for 0.1.1 | Update the changelog for 0.1.1
| reStructuredText | mit | tonyseek/openvpn-status | restructuredtext | ## Code Before:
0.1.0 - Development
-------------------
The first release.
## Instruction:
Update the changelog for 0.1.1
## Code After:
0.1.1 (2016-06-29)
------------------
- Fixed GH-3: The depended six must later than 1.9.0 because we used its
"python_2_unicode_compatible" decorator.
0.1.0 (2015-06-19)
------------------
The first release.
| - 0.1.0 - Development
+ 0.1.1 (2016-06-29)
- -------------------
? -
+ ------------------
+
+ - Fixed GH-3: The depended six must later than 1.9.0 because we used its
+ "python_2_unicode_compatible" decorator.
+
+ 0.1.0 (2015-06-19)
+ ------------------
The first release. | 10 | 2.5 | 8 | 2 |
6510581e2dd5165fa07cd69c9fc95c23d61dca4f | src/index.js | src/index.js | import GitHubApi from "github";
import _ from "lodash";
const github = new GitHubApi({
protocol: "https",
Promise,
timeout: 5000,
});
function pager(pulls) {
_.forEach(pulls, (pull) => {
if (!pull.body) {
return;
}
// eslint-disable-next-line max-len
const regex = /Fixed tickets[\s]*\|[\s]*(?:https:\/\/github\.com\/babel\/babel\/issues\/(\d+)|(#\d+(?:\s*,\s*#\d+)*))/;
const issues = pull.body.match(regex);
if (issues <= 1) {
return;
}
console.log(`Processing PR${pull.number}`);
console.log(` Match: ${issues[0]}`);
// single issue
if (issues[1]) {
console.log(` ${issues[1]}`);
return;
}
// multiple issues
issues[2].replace(/\s|#/g, "")
.split(",")
.forEach((issue) => console.log(` ${issue}`));
});
if (github.hasNextPage(pulls)) {
return github.getNextPage(pulls)
.then(pager);
}
return Promise.resolve();
}
github.pullRequests
.getAll({
owner: "babel",
repo: "babel",
state: "closed",
per_page: 99,
})
.then(pager)
.catch((err) => console.log("Error: ", err));
| import GitHubApi from "github";
import _ from "lodash";
const github = new GitHubApi({
protocol: "https",
Promise,
timeout: 5000,
});
function processPulls(pulls) {
_.forEach(pulls, (pull) => {
if (!pull.body) {
return;
}
// eslint-disable-next-line max-len
const regex = /Fixed tickets[\s]*\|[\s]*(?:https:\/\/github\.com\/babel\/babel\/issues\/(\d+)|(#\d+(?:\s*,\s*#\d+)*))/;
const issues = pull.body.match(regex);
if (issues <= 1) {
return;
}
console.log(`Processing PR${pull.number}`);
console.log(` Match: ${issues[0]}`);
// single issue
if (issues[1]) {
console.log(` ${issues[1]}`);
return;
}
// multiple issues
issues[2].replace(/\s|#/g, "")
.split(",")
.forEach((issue) => console.log(` ${issue}`));
});
}
async function pager(res) {
let pulls = res;
processPulls(pulls);
while (github.hasNextPage(pulls)) {
pulls = await github.getNextPage(pulls);
processPulls(pulls);
}
}
github.pullRequests
.getAll({
owner: "babel",
repo: "babel",
state: "closed",
per_page: 99,
})
.then(pager)
.catch((err) => console.log("Error: ", err));
| Use iteration rather than recursion to read through the pull requests | Use iteration rather than recursion to read through the pull requests
| JavaScript | mit | nhajidin/close-babel-issues | javascript | ## Code Before:
import GitHubApi from "github";
import _ from "lodash";
const github = new GitHubApi({
protocol: "https",
Promise,
timeout: 5000,
});
function pager(pulls) {
_.forEach(pulls, (pull) => {
if (!pull.body) {
return;
}
// eslint-disable-next-line max-len
const regex = /Fixed tickets[\s]*\|[\s]*(?:https:\/\/github\.com\/babel\/babel\/issues\/(\d+)|(#\d+(?:\s*,\s*#\d+)*))/;
const issues = pull.body.match(regex);
if (issues <= 1) {
return;
}
console.log(`Processing PR${pull.number}`);
console.log(` Match: ${issues[0]}`);
// single issue
if (issues[1]) {
console.log(` ${issues[1]}`);
return;
}
// multiple issues
issues[2].replace(/\s|#/g, "")
.split(",")
.forEach((issue) => console.log(` ${issue}`));
});
if (github.hasNextPage(pulls)) {
return github.getNextPage(pulls)
.then(pager);
}
return Promise.resolve();
}
github.pullRequests
.getAll({
owner: "babel",
repo: "babel",
state: "closed",
per_page: 99,
})
.then(pager)
.catch((err) => console.log("Error: ", err));
## Instruction:
Use iteration rather than recursion to read through the pull requests
## Code After:
import GitHubApi from "github";
import _ from "lodash";
const github = new GitHubApi({
protocol: "https",
Promise,
timeout: 5000,
});
function processPulls(pulls) {
_.forEach(pulls, (pull) => {
if (!pull.body) {
return;
}
// eslint-disable-next-line max-len
const regex = /Fixed tickets[\s]*\|[\s]*(?:https:\/\/github\.com\/babel\/babel\/issues\/(\d+)|(#\d+(?:\s*,\s*#\d+)*))/;
const issues = pull.body.match(regex);
if (issues <= 1) {
return;
}
console.log(`Processing PR${pull.number}`);
console.log(` Match: ${issues[0]}`);
// single issue
if (issues[1]) {
console.log(` ${issues[1]}`);
return;
}
// multiple issues
issues[2].replace(/\s|#/g, "")
.split(",")
.forEach((issue) => console.log(` ${issue}`));
});
}
async function pager(res) {
let pulls = res;
processPulls(pulls);
while (github.hasNextPage(pulls)) {
pulls = await github.getNextPage(pulls);
processPulls(pulls);
}
}
github.pullRequests
.getAll({
owner: "babel",
repo: "babel",
state: "closed",
per_page: 99,
})
.then(pager)
.catch((err) => console.log("Error: ", err));
| import GitHubApi from "github";
import _ from "lodash";
const github = new GitHubApi({
protocol: "https",
Promise,
timeout: 5000,
});
- function pager(pulls) {
? ^^ ^
+ function processPulls(pulls) {
? ^^^ ^^^^^^^
_.forEach(pulls, (pull) => {
if (!pull.body) {
return;
}
// eslint-disable-next-line max-len
const regex = /Fixed tickets[\s]*\|[\s]*(?:https:\/\/github\.com\/babel\/babel\/issues\/(\d+)|(#\d+(?:\s*,\s*#\d+)*))/;
const issues = pull.body.match(regex);
if (issues <= 1) {
return;
}
console.log(`Processing PR${pull.number}`);
console.log(` Match: ${issues[0]}`);
// single issue
if (issues[1]) {
console.log(` ${issues[1]}`);
return;
}
// multiple issues
issues[2].replace(/\s|#/g, "")
.split(",")
.forEach((issue) => console.log(` ${issue}`));
});
+ }
+ async function pager(res) {
+ let pulls = res;
+
+ processPulls(pulls);
+
- if (github.hasNextPage(pulls)) {
? ^
+ while (github.hasNextPage(pulls)) {
? ++ ^^
- return github.getNextPage(pulls)
? ^^ ---
+ pulls = await github.getNextPage(pulls);
? ^^^^^^^^^^^^ +
- .then(pager);
+ processPulls(pulls);
}
-
- return Promise.resolve();
}
github.pullRequests
.getAll({
owner: "babel",
repo: "babel",
state: "closed",
per_page: 99,
})
.then(pager)
.catch((err) => console.log("Error: ", err)); | 16 | 0.290909 | 10 | 6 |
7bbfeed7d10121be2d3080ed24a364eefb2dac4c | res/layout/textpopup.xml | res/layout/textpopup.xml | <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:padding="10dp">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/scrollView" android:background="@android:drawable/dialog_holo_dark_frame">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/aboutTextView"
android:padding="10dp"/>
</ScrollView>
</LinearLayout> | <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:padding="4dip">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scrollView" android:background="@android:drawable/dialog_holo_dark_frame">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/aboutTextView"
android:paddingLeft="10dip" android:paddingRight="10dip" android:paddingEnd="3dip"
android:paddingStart="3dip"/>
</ScrollView>
</FrameLayout> | Change top element of popup layout to FrameLayout | Change top element of popup layout to FrameLayout
| XML | apache-2.0 | Unhelpful/TicTacToe_Android | xml | ## Code Before:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:padding="10dp">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/scrollView" android:background="@android:drawable/dialog_holo_dark_frame">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/aboutTextView"
android:padding="10dp"/>
</ScrollView>
</LinearLayout>
## Instruction:
Change top element of popup layout to FrameLayout
## Code After:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:padding="4dip">
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/scrollView" android:background="@android:drawable/dialog_holo_dark_frame">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/aboutTextView"
android:paddingLeft="10dip" android:paddingRight="10dip" android:paddingEnd="3dip"
android:paddingStart="3dip"/>
</ScrollView>
</FrameLayout> | <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
? ^^^ --
+ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
? ^^^^
android:orientation="vertical"
android:layout_width="fill_parent"
- android:layout_height="fill_parent" android:padding="10dp">
? ^^
+ android:layout_height="fill_parent" android:padding="4dip">
? ^ +
-
<ScrollView
android:layout_width="fill_parent"
- android:layout_height="wrap_content"
? ^ -------
+ android:layout_height="fill_parent"
? ^^^^^^^
android:id="@+id/scrollView" android:background="@android:drawable/dialog_holo_dark_frame">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/aboutTextView"
+ android:paddingLeft="10dip" android:paddingRight="10dip" android:paddingEnd="3dip"
- android:padding="10dp"/>
? ^^
+ android:paddingStart="3dip"/>
? +++++ ^ +
</ScrollView>
- </LinearLayout>
+ </FrameLayout> | 12 | 0.666667 | 6 | 6 |
369a3c43055a70b37391905a6a160e1272f48a76 | src/syntax/template-element.js | src/syntax/template-element.js | import BaseSyntax from './base.js';
/**
* The class to define the TemplateElement syntax
*
* @class TemplateElement
*/
export default
class TemplateElement extends BaseSyntax {
/**
* Create a template literal
*
* @constructor
*/
constructor() {
super('TemplateElement');
this.value = {raw: '', cooked: ''};
this.tail = false;
}
setValue(value) {
this.value.raw = value;
this.value.cooked = value;
}
setRaw(raw) {
this.value.raw = raw;
}
setCooked(cooked) {
this.value.cooked = cooked;
}
} | import BaseSyntax from './base.js';
/**
* The class to define the TemplateElement syntax
*
* @class TemplateElement
*/
export default
class TemplateElement extends BaseSyntax {
/**
* Create a template literal
*
* @constructor
*/
constructor() {
super('TemplateElement');
this.value = {raw: '', cooked: ''};
this.tail = false;
}
setValue(value) {
this.setRaw(value);
this.setCooked(value);
}
setRaw(raw) {
this.value.raw = raw;
}
setCooked(cooked) {
this.value.cooked = cooked;
}
} | Use methods rather than properties | fixed: Use methods rather than properties
| JavaScript | mit | bigsan/xto6,listepo/xto6,mohebifar/lebab,lebab/lebab,mohebifar/xto6 | javascript | ## Code Before:
import BaseSyntax from './base.js';
/**
* The class to define the TemplateElement syntax
*
* @class TemplateElement
*/
export default
class TemplateElement extends BaseSyntax {
/**
* Create a template literal
*
* @constructor
*/
constructor() {
super('TemplateElement');
this.value = {raw: '', cooked: ''};
this.tail = false;
}
setValue(value) {
this.value.raw = value;
this.value.cooked = value;
}
setRaw(raw) {
this.value.raw = raw;
}
setCooked(cooked) {
this.value.cooked = cooked;
}
}
## Instruction:
fixed: Use methods rather than properties
## Code After:
import BaseSyntax from './base.js';
/**
* The class to define the TemplateElement syntax
*
* @class TemplateElement
*/
export default
class TemplateElement extends BaseSyntax {
/**
* Create a template literal
*
* @constructor
*/
constructor() {
super('TemplateElement');
this.value = {raw: '', cooked: ''};
this.tail = false;
}
setValue(value) {
this.setRaw(value);
this.setCooked(value);
}
setRaw(raw) {
this.value.raw = raw;
}
setCooked(cooked) {
this.value.cooked = cooked;
}
} | import BaseSyntax from './base.js';
/**
* The class to define the TemplateElement syntax
*
* @class TemplateElement
*/
export default
class TemplateElement extends BaseSyntax {
/**
* Create a template literal
*
* @constructor
*/
constructor() {
super('TemplateElement');
this.value = {raw: '', cooked: ''};
this.tail = false;
}
setValue(value) {
- this.value.raw = value;
- this.value.cooked = value;
+ this.setRaw(value);
+ this.setCooked(value);
}
setRaw(raw) {
this.value.raw = raw;
}
setCooked(cooked) {
this.value.cooked = cooked;
}
} | 4 | 0.105263 | 2 | 2 |
f2bf7807754d13c92bd2901072dd804dda61805f | cla_public/apps/contact/constants.py | cla_public/apps/contact/constants.py | "Contact constants"
from flask.ext.babel import lazy_gettext as _
DAY_TODAY = 'today'
DAY_SPECIFIC = 'specific_day'
DAY_CHOICES = (
(DAY_TODAY, _('Call me today at')),
(DAY_SPECIFIC, _('Call me in the next week on'))
)
| "Contact constants"
from flask.ext.babel import lazy_gettext as _
DAY_TODAY = 'today'
DAY_SPECIFIC = 'specific_day'
DAY_CHOICES = (
(DAY_TODAY, _('Call me today at')),
(DAY_SPECIFIC, _('Call me in on'))
)
| Update button label (call back time picker) | FE: Update button label (call back time picker)
| Python | mit | ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public,ministryofjustice/cla_public | python | ## Code Before:
"Contact constants"
from flask.ext.babel import lazy_gettext as _
DAY_TODAY = 'today'
DAY_SPECIFIC = 'specific_day'
DAY_CHOICES = (
(DAY_TODAY, _('Call me today at')),
(DAY_SPECIFIC, _('Call me in the next week on'))
)
## Instruction:
FE: Update button label (call back time picker)
## Code After:
"Contact constants"
from flask.ext.babel import lazy_gettext as _
DAY_TODAY = 'today'
DAY_SPECIFIC = 'specific_day'
DAY_CHOICES = (
(DAY_TODAY, _('Call me today at')),
(DAY_SPECIFIC, _('Call me in on'))
)
| "Contact constants"
from flask.ext.babel import lazy_gettext as _
DAY_TODAY = 'today'
DAY_SPECIFIC = 'specific_day'
DAY_CHOICES = (
(DAY_TODAY, _('Call me today at')),
- (DAY_SPECIFIC, _('Call me in the next week on'))
? --------------
+ (DAY_SPECIFIC, _('Call me in on'))
) | 2 | 0.181818 | 1 | 1 |
496af05201408614fdecabde5905b24eaf0948a7 | e2e/cypress/support/commands.ts | e2e/cypress/support/commands.ts | Cypress.Commands.add('login', (username = 'admin') => {
window.localStorage.setItem('USER', JSON.stringify({ username }));
});
| Cypress.Commands.add('login', (username = 'admin') => {
window.localStorage.setItem('USER', JSON.stringify({ username }));
});
export {};
| Fix issue with missing export | Fix issue with missing export
| TypeScript | mit | sheldarr/Votenger,sheldarr/Votenger | typescript | ## Code Before:
Cypress.Commands.add('login', (username = 'admin') => {
window.localStorage.setItem('USER', JSON.stringify({ username }));
});
## Instruction:
Fix issue with missing export
## Code After:
Cypress.Commands.add('login', (username = 'admin') => {
window.localStorage.setItem('USER', JSON.stringify({ username }));
});
export {};
| Cypress.Commands.add('login', (username = 'admin') => {
window.localStorage.setItem('USER', JSON.stringify({ username }));
});
+
+ export {}; | 2 | 0.666667 | 2 | 0 |
a9105dfc0c1fa62d0446d790ced40cda41556432 | app/styles/main.css | app/styles/main.css | .app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.modal-content {
font-size: 140%;
}
main {
flex: 1;
}
footer {
padding: 1em;
}
.center {
margin-left: auto;
margin-right: auto;
}
.light {
color: #ddd;
}
.dark {
color: #666;
}
/* from http://www.mademyday.de/css-height-equals-width-with-pure-css.html */
.ratio-1by1 {
position: relative;
}
.ratio-1by1:before {
content: '';
display: block;
padding-top: 100%;
}
.ratio-1by1>* {
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
}
| .app {
display: flex;
flex-direction: column;
height: 100vh;
}
.modal-content {
font-size: 140%;
}
main {
flex: 1 0 auto;
}
footer {
padding: 1em;
}
.center {
margin-left: auto;
margin-right: auto;
}
.light {
color: #ddd;
}
.dark {
color: #666;
}
/* from http://www.mademyday.de/css-height-equals-width-with-pure-css.html */
.ratio-1by1 {
position: relative;
}
.ratio-1by1:before {
content: '';
display: block;
padding-top: 100%;
}
.ratio-1by1>* {
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
}
| Fix an IE related bug | Fix an IE related bug
Now the footer is always on the bottom of the page
| CSS | mit | loonkwil/reversi,loonkwil/reversi | css | ## Code Before:
.app {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.modal-content {
font-size: 140%;
}
main {
flex: 1;
}
footer {
padding: 1em;
}
.center {
margin-left: auto;
margin-right: auto;
}
.light {
color: #ddd;
}
.dark {
color: #666;
}
/* from http://www.mademyday.de/css-height-equals-width-with-pure-css.html */
.ratio-1by1 {
position: relative;
}
.ratio-1by1:before {
content: '';
display: block;
padding-top: 100%;
}
.ratio-1by1>* {
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
}
## Instruction:
Fix an IE related bug
Now the footer is always on the bottom of the page
## Code After:
.app {
display: flex;
flex-direction: column;
height: 100vh;
}
.modal-content {
font-size: 140%;
}
main {
flex: 1 0 auto;
}
footer {
padding: 1em;
}
.center {
margin-left: auto;
margin-right: auto;
}
.light {
color: #ddd;
}
.dark {
color: #666;
}
/* from http://www.mademyday.de/css-height-equals-width-with-pure-css.html */
.ratio-1by1 {
position: relative;
}
.ratio-1by1:before {
content: '';
display: block;
padding-top: 100%;
}
.ratio-1by1>* {
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
}
| .app {
display: flex;
flex-direction: column;
- min-height: 100vh;
? ----
+ height: 100vh;
}
.modal-content {
font-size: 140%;
}
main {
- flex: 1;
+ flex: 1 0 auto;
}
footer {
padding: 1em;
}
.center {
margin-left: auto;
margin-right: auto;
}
.light {
color: #ddd;
}
.dark {
color: #666;
}
/* from http://www.mademyday.de/css-height-equals-width-with-pure-css.html */
.ratio-1by1 {
position: relative;
}
.ratio-1by1:before {
content: '';
display: block;
padding-top: 100%;
}
.ratio-1by1>* {
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
} | 4 | 0.093023 | 2 | 2 |
2394de5f46d264e2a585b6cd4b87e4a45c99cfeb | cast_convert/__init__.py | cast_convert/__init__.py | from . import *
from .convert import *
from .media_info import *
from .watch import *
| __version__ = '0.1.5.18'
from .cmd import cmd as command
from .watch import *
from . import *
from .convert import *
from .media_info import *
@click.command(help="Print version")
def version():
print(__version__)
command.add_command(version)
| Add version and version command | Add version and version command
| Python | agpl-3.0 | thismachinechills/cast_convert | python | ## Code Before:
from . import *
from .convert import *
from .media_info import *
from .watch import *
## Instruction:
Add version and version command
## Code After:
__version__ = '0.1.5.18'
from .cmd import cmd as command
from .watch import *
from . import *
from .convert import *
from .media_info import *
@click.command(help="Print version")
def version():
print(__version__)
command.add_command(version)
| + __version__ = '0.1.5.18'
+
+
+ from .cmd import cmd as command
+ from .watch import *
from . import *
from .convert import *
from .media_info import *
- from .watch import *
+
+
+ @click.command(help="Print version")
+ def version():
+ print(__version__)
+
+
+ command.add_command(version) | 14 | 3.5 | 13 | 1 |
3d139d5a93b83dc69e13d6fcc7ae0c8ef9d39be5 | backend/app/assets/stylesheets/spree/backend/shared/_layout.scss | backend/app/assets/stylesheets/spree/backend/shared/_layout.scss | html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
&.new-layout {
padding-left: $width-sidebar;
}
}
.admin-nav {
@include position(absolute, 0 null 0 0);
width: $width-sidebar;
}
.content-wrapper {
body:not(.new-layout) & {
margin-left: $width-sidebar;
}
body.new-layout & {
@include padding(1rem $grid-gutter-width null);
}
&.centered {
@include margin(null auto);
max-width: map-get($container-max-widths, "xl");
}
}
.content {
@include make-row();
}
.content-main {
@include make-col();
@include make-col-span(12);
.has-sidebar & {
@include make-col-span(9);
}
}
.content-sidebar {
@include make-col();
@include make-col-span(3);
}
#content {
background-color: $color-1;
position: relative;
z-index: 0;
padding: 0;
margin-top: 15px;
}
| html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
&.new-layout {
padding-left: $width-sidebar;
}
}
.admin-nav {
@include position(absolute, 0 null 0 0);
width: $width-sidebar;
}
.content-wrapper {
body:not(.new-layout) & {
margin-left: $width-sidebar;
}
body.new-layout & {
@include padding(1rem $grid-gutter-width null);
}
&.centered {
@include margin(null auto);
max-width: map-get($container-max-widths, "xl");
}
}
.content {
@include make-row();
}
.content-main {
@include make-col();
@include make-col-span(12);
overflow-x: hidden; // makes sure that the tabs are able to resize
.has-sidebar & {
@include make-col-span(9);
}
}
.content-sidebar {
@include make-col();
@include make-col-span(3);
}
#content {
background-color: $color-1;
position: relative;
z-index: 0;
padding: 0;
margin-top: 15px;
}
| Make sure tabs condense in the new layout | Make sure tabs condense in the new layout
Without this the tabs would never collapse into the dropdown. Because
the tabs are checking for `offsetWidth`, if you let it overflow it would
always think that there was enough space.
| SCSS | bsd-3-clause | jordan-brough/solidus,pervino/solidus,pervino/solidus,Arpsara/solidus,pervino/solidus,jordan-brough/solidus,Arpsara/solidus,pervino/solidus,Arpsara/solidus,Arpsara/solidus,jordan-brough/solidus,jordan-brough/solidus | scss | ## Code Before:
html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
&.new-layout {
padding-left: $width-sidebar;
}
}
.admin-nav {
@include position(absolute, 0 null 0 0);
width: $width-sidebar;
}
.content-wrapper {
body:not(.new-layout) & {
margin-left: $width-sidebar;
}
body.new-layout & {
@include padding(1rem $grid-gutter-width null);
}
&.centered {
@include margin(null auto);
max-width: map-get($container-max-widths, "xl");
}
}
.content {
@include make-row();
}
.content-main {
@include make-col();
@include make-col-span(12);
.has-sidebar & {
@include make-col-span(9);
}
}
.content-sidebar {
@include make-col();
@include make-col-span(3);
}
#content {
background-color: $color-1;
position: relative;
z-index: 0;
padding: 0;
margin-top: 15px;
}
## Instruction:
Make sure tabs condense in the new layout
Without this the tabs would never collapse into the dropdown. Because
the tabs are checking for `offsetWidth`, if you let it overflow it would
always think that there was enough space.
## Code After:
html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
&.new-layout {
padding-left: $width-sidebar;
}
}
.admin-nav {
@include position(absolute, 0 null 0 0);
width: $width-sidebar;
}
.content-wrapper {
body:not(.new-layout) & {
margin-left: $width-sidebar;
}
body.new-layout & {
@include padding(1rem $grid-gutter-width null);
}
&.centered {
@include margin(null auto);
max-width: map-get($container-max-widths, "xl");
}
}
.content {
@include make-row();
}
.content-main {
@include make-col();
@include make-col-span(12);
overflow-x: hidden; // makes sure that the tabs are able to resize
.has-sidebar & {
@include make-col-span(9);
}
}
.content-sidebar {
@include make-col();
@include make-col-span(3);
}
#content {
background-color: $color-1;
position: relative;
z-index: 0;
padding: 0;
margin-top: 15px;
}
| html {
height: 100%;
}
body {
position: relative;
min-height: 100%;
&.new-layout {
padding-left: $width-sidebar;
}
}
.admin-nav {
@include position(absolute, 0 null 0 0);
width: $width-sidebar;
}
.content-wrapper {
body:not(.new-layout) & {
margin-left: $width-sidebar;
}
body.new-layout & {
@include padding(1rem $grid-gutter-width null);
}
&.centered {
@include margin(null auto);
max-width: map-get($container-max-widths, "xl");
}
}
.content {
@include make-row();
}
.content-main {
@include make-col();
@include make-col-span(12);
+ overflow-x: hidden; // makes sure that the tabs are able to resize
.has-sidebar & {
@include make-col-span(9);
}
}
.content-sidebar {
@include make-col();
@include make-col-span(3);
}
#content {
background-color: $color-1;
position: relative;
z-index: 0;
padding: 0;
margin-top: 15px;
} | 1 | 0.017241 | 1 | 0 |
f253c18c46aa6f9e87111760f96bfec336e7fde7 | .travis.yml | .travis.yml | language: java
dist: trusty
jdk:
- oraclejdk8
before_install:
- if [ ! -z "$GPG_SECRET_KEYS" ]; then echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --no-tty --no-use-agent --import; fi
- if [ ! -z "$GPG_OWNERTRUST" ]; then echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust; fi
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
install: true
script:
- mvn clean verify --settings .travis/settings.xml
after_success:
- mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=hevelian-olastic -Dsonar.login=${SONAR_TOKEN}
- bash <(curl -s https://codecov.io/bash)
deploy:
-
provider: script
script: bash .travis/deploy.sh
skip_cleanup: true
on:
repo: Hevelian/hevelian-olastic
jdk: oraclejdk8
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache' | language: java
dist: trusty
jdk:
- oraclejdk8
before_install:
- if [ ! -z "$GPG_SECRET_KEYS" ]; then echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --no-tty --no-use-agent --import; fi
- if [ ! -z "$GPG_OWNERTRUST" ]; then echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust; fi
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
install: true
script:
- mvn clean verify --settings .travis/settings.xml
after_success:
- mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=hevelian-olastic -Dsonar.login=${SONAR_TOKEN}
- bash <(curl -s https://codecov.io/bash)
deploy:
-
provider: script
script: bash .travis/deploy.sh
skip_cleanup: true
on:
repo: Hevelian/hevelian-olastic
all_branches: true
jdk: oraclejdk8
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache' | Use all branches for deploy | Use all branches for deploy
| YAML | apache-2.0 | Hevelian/hevelian-olastic,Hevelian/hevelian-olastic | yaml | ## Code Before:
language: java
dist: trusty
jdk:
- oraclejdk8
before_install:
- if [ ! -z "$GPG_SECRET_KEYS" ]; then echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --no-tty --no-use-agent --import; fi
- if [ ! -z "$GPG_OWNERTRUST" ]; then echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust; fi
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
install: true
script:
- mvn clean verify --settings .travis/settings.xml
after_success:
- mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=hevelian-olastic -Dsonar.login=${SONAR_TOKEN}
- bash <(curl -s https://codecov.io/bash)
deploy:
-
provider: script
script: bash .travis/deploy.sh
skip_cleanup: true
on:
repo: Hevelian/hevelian-olastic
jdk: oraclejdk8
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache'
## Instruction:
Use all branches for deploy
## Code After:
language: java
dist: trusty
jdk:
- oraclejdk8
before_install:
- if [ ! -z "$GPG_SECRET_KEYS" ]; then echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --no-tty --no-use-agent --import; fi
- if [ ! -z "$GPG_OWNERTRUST" ]; then echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust; fi
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
install: true
script:
- mvn clean verify --settings .travis/settings.xml
after_success:
- mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=hevelian-olastic -Dsonar.login=${SONAR_TOKEN}
- bash <(curl -s https://codecov.io/bash)
deploy:
-
provider: script
script: bash .travis/deploy.sh
skip_cleanup: true
on:
repo: Hevelian/hevelian-olastic
all_branches: true
jdk: oraclejdk8
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache' | language: java
dist: trusty
jdk:
- oraclejdk8
before_install:
- if [ ! -z "$GPG_SECRET_KEYS" ]; then echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --no-tty --no-use-agent --import; fi
- if [ ! -z "$GPG_OWNERTRUST" ]; then echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust; fi
- echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-
install: true
script:
- mvn clean verify --settings .travis/settings.xml
after_success:
- mvn sonar:sonar -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=hevelian-olastic -Dsonar.login=${SONAR_TOKEN}
- bash <(curl -s https://codecov.io/bash)
deploy:
-
provider: script
script: bash .travis/deploy.sh
skip_cleanup: true
on:
repo: Hevelian/hevelian-olastic
+ all_branches: true
jdk: oraclejdk8
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.sonar/cache' | 1 | 0.032258 | 1 | 0 |
e13a24e40089bef7c96d9868a8b8514f21f3a9cc | app/assets/javascripts/.eslintrc.json | app/assets/javascripts/.eslintrc.json | {
"parser": "babel-eslint",
"env": {
"browser": true
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
"rules": {
"curly": ["error", "all"],
"max-len": ["error", {"code": 100, "ignoreUrls": true}],
"prettier/prettier": ["error", {"printWidth": 100, "singleQuote": true}],
"space-before-function-paren": ["error", "never"]
}
}
| {
"parser": "babel-eslint",
"env": {
"browser": true
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
"rules": {
"curly": ["error", "all"],
"max-len": ["error", {"code": 100, "ignoreUrls": true}],
"prettier/prettier": ["error", {"printWidth": 100, "singleQuote": true}]
}
}
| Remove outdated ESLint rule for old JS files | Remove outdated ESLint rule for old JS files
| JSON | mit | quintel/etmodel,quintel/etmodel,quintel/etmodel,quintel/etmodel | json | ## Code Before:
{
"parser": "babel-eslint",
"env": {
"browser": true
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
"rules": {
"curly": ["error", "all"],
"max-len": ["error", {"code": 100, "ignoreUrls": true}],
"prettier/prettier": ["error", {"printWidth": 100, "singleQuote": true}],
"space-before-function-paren": ["error", "never"]
}
}
## Instruction:
Remove outdated ESLint rule for old JS files
## Code After:
{
"parser": "babel-eslint",
"env": {
"browser": true
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
"rules": {
"curly": ["error", "all"],
"max-len": ["error", {"code": 100, "ignoreUrls": true}],
"prettier/prettier": ["error", {"printWidth": 100, "singleQuote": true}]
}
}
| {
"parser": "babel-eslint",
"env": {
"browser": true
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended"
],
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
},
"rules": {
"curly": ["error", "all"],
"max-len": ["error", {"code": 100, "ignoreUrls": true}],
- "prettier/prettier": ["error", {"printWidth": 100, "singleQuote": true}],
? -
+ "prettier/prettier": ["error", {"printWidth": 100, "singleQuote": true}]
- "space-before-function-paren": ["error", "never"]
}
} | 3 | 0.15 | 1 | 2 |
498363351afa8edf8e2cca2a235e023efccae11d | app/react/src/client/preview/types-6-0.ts | app/react/src/client/preview/types-6-0.ts | import { ComponentClass, FunctionComponent } from 'react';
import { Args as DefaultArgs, Annotations, BaseMeta, BaseStory } from '@storybook/addons';
import { StoryFnReactReturnType } from './types';
export { Args, ArgTypes, Parameters, StoryContext } from '@storybook/addons';
type ReactComponent = ComponentClass<any> | FunctionComponent<any>;
type ReactReturnType = StoryFnReactReturnType;
/**
* Metadata to configure the stories for a component.
*
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
*/
export type Meta<Args = DefaultArgs> = BaseMeta<ReactComponent> &
Annotations<Args, ReactReturnType>;
/**
* Story function that represents a component example.
*
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
*/
export type Story<Args = DefaultArgs> = BaseStory<Args, ReactReturnType> &
Annotations<Args, ReactReturnType>;
| import { ComponentType } from 'react';
import { Args as DefaultArgs, Annotations, BaseMeta, BaseStory } from '@storybook/addons';
import { StoryFnReactReturnType } from './types';
export { Args, ArgTypes, Parameters, StoryContext } from '@storybook/addons';
type ReactComponent = ComponentType<any>;
type ReactReturnType = StoryFnReactReturnType;
/**
* Metadata to configure the stories for a component.
*
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
*/
export type Meta<Args = DefaultArgs> = BaseMeta<ReactComponent> &
Annotations<Args, ReactReturnType>;
/**
* Story function that represents a component example.
*
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
*/
export type Story<Args = DefaultArgs> = BaseStory<Args, ReactReturnType> &
Annotations<Args, ReactReturnType>;
| Simplify component type for CSF typing | React: Simplify component type for CSF typing
| TypeScript | mit | storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/react-storybook | typescript | ## Code Before:
import { ComponentClass, FunctionComponent } from 'react';
import { Args as DefaultArgs, Annotations, BaseMeta, BaseStory } from '@storybook/addons';
import { StoryFnReactReturnType } from './types';
export { Args, ArgTypes, Parameters, StoryContext } from '@storybook/addons';
type ReactComponent = ComponentClass<any> | FunctionComponent<any>;
type ReactReturnType = StoryFnReactReturnType;
/**
* Metadata to configure the stories for a component.
*
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
*/
export type Meta<Args = DefaultArgs> = BaseMeta<ReactComponent> &
Annotations<Args, ReactReturnType>;
/**
* Story function that represents a component example.
*
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
*/
export type Story<Args = DefaultArgs> = BaseStory<Args, ReactReturnType> &
Annotations<Args, ReactReturnType>;
## Instruction:
React: Simplify component type for CSF typing
## Code After:
import { ComponentType } from 'react';
import { Args as DefaultArgs, Annotations, BaseMeta, BaseStory } from '@storybook/addons';
import { StoryFnReactReturnType } from './types';
export { Args, ArgTypes, Parameters, StoryContext } from '@storybook/addons';
type ReactComponent = ComponentType<any>;
type ReactReturnType = StoryFnReactReturnType;
/**
* Metadata to configure the stories for a component.
*
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
*/
export type Meta<Args = DefaultArgs> = BaseMeta<ReactComponent> &
Annotations<Args, ReactReturnType>;
/**
* Story function that represents a component example.
*
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
*/
export type Story<Args = DefaultArgs> = BaseStory<Args, ReactReturnType> &
Annotations<Args, ReactReturnType>;
| - import { ComponentClass, FunctionComponent } from 'react';
? ^^^^^^^^^^^^^^^^^^ -- --
+ import { ComponentType } from 'react';
? ^^
import { Args as DefaultArgs, Annotations, BaseMeta, BaseStory } from '@storybook/addons';
import { StoryFnReactReturnType } from './types';
export { Args, ArgTypes, Parameters, StoryContext } from '@storybook/addons';
- type ReactComponent = ComponentClass<any> | FunctionComponent<any>;
+ type ReactComponent = ComponentType<any>;
type ReactReturnType = StoryFnReactReturnType;
/**
* Metadata to configure the stories for a component.
*
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
*/
export type Meta<Args = DefaultArgs> = BaseMeta<ReactComponent> &
Annotations<Args, ReactReturnType>;
/**
* Story function that represents a component example.
*
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
*/
export type Story<Args = DefaultArgs> = BaseStory<Args, ReactReturnType> &
Annotations<Args, ReactReturnType>; | 4 | 0.166667 | 2 | 2 |
a6cbaac2d9337a1b896082d25ee304f2579a2377 | package.json | package.json | {
"name": "prosemirror-gapcursor",
"version": "1.0.3",
"description": "ProseMirror plugin for cursors at normally impossible-to-reach positions",
"license": "MIT",
"main": "dist/index.js",
"style": "style/gapcursor.css",
"dependencies": {
"prosemirror-keymap": "^1.0.0",
"prosemirror-model": "^1.0.0",
"prosemirror-state": "^1.0.0",
"prosemirror-view": "^1.0.0"
},
"devDependencies": {
"prosemirror-commands": "^1.0.0",
"prosemirror-example-setup": "^1.0.0",
"prosemirror-menu": "^1.0.0",
"prosemirror-schema-basic": "^1.0.0",
"prosemirror-tables": "^0.1.0",
"prosemirror-test-builder": "^1.0.0",
"prosemirror-transform": "^1.0.0",
"rollup": "^0.49.0",
"rollup-plugin-buble": "^0.15.0"
},
"scripts": {
"build": "rollup -c",
"watch": "rollup -w -c",
"prepare": "npm run build"
}
}
| {
"name": "prosemirror-gapcursor",
"version": "1.0.3",
"description": "ProseMirror plugin for cursors at normally impossible-to-reach positions",
"license": "MIT",
"main": "dist/index.js",
"style": "style/gapcursor.css",
"dependencies": {
"prosemirror-keymap": "^1.0.0",
"prosemirror-model": "^1.0.0",
"prosemirror-state": "^1.0.0",
"prosemirror-view": "^1.0.0"
},
"devDependencies": {
"rollup": "^0.49.0",
"rollup-plugin-buble": "^0.15.0"
},
"scripts": {
"build": "rollup -c",
"watch": "rollup -w -c",
"prepare": "npm run build"
}
}
| Remove a bunch of spurious dependencies | Remove a bunch of spurious dependencies
See https://discuss.prosemirror.net/t/versioning-for-core-modules/1638
| JSON | mit | ProseMirror/prosemirror-gapcursor | json | ## Code Before:
{
"name": "prosemirror-gapcursor",
"version": "1.0.3",
"description": "ProseMirror plugin for cursors at normally impossible-to-reach positions",
"license": "MIT",
"main": "dist/index.js",
"style": "style/gapcursor.css",
"dependencies": {
"prosemirror-keymap": "^1.0.0",
"prosemirror-model": "^1.0.0",
"prosemirror-state": "^1.0.0",
"prosemirror-view": "^1.0.0"
},
"devDependencies": {
"prosemirror-commands": "^1.0.0",
"prosemirror-example-setup": "^1.0.0",
"prosemirror-menu": "^1.0.0",
"prosemirror-schema-basic": "^1.0.0",
"prosemirror-tables": "^0.1.0",
"prosemirror-test-builder": "^1.0.0",
"prosemirror-transform": "^1.0.0",
"rollup": "^0.49.0",
"rollup-plugin-buble": "^0.15.0"
},
"scripts": {
"build": "rollup -c",
"watch": "rollup -w -c",
"prepare": "npm run build"
}
}
## Instruction:
Remove a bunch of spurious dependencies
See https://discuss.prosemirror.net/t/versioning-for-core-modules/1638
## Code After:
{
"name": "prosemirror-gapcursor",
"version": "1.0.3",
"description": "ProseMirror plugin for cursors at normally impossible-to-reach positions",
"license": "MIT",
"main": "dist/index.js",
"style": "style/gapcursor.css",
"dependencies": {
"prosemirror-keymap": "^1.0.0",
"prosemirror-model": "^1.0.0",
"prosemirror-state": "^1.0.0",
"prosemirror-view": "^1.0.0"
},
"devDependencies": {
"rollup": "^0.49.0",
"rollup-plugin-buble": "^0.15.0"
},
"scripts": {
"build": "rollup -c",
"watch": "rollup -w -c",
"prepare": "npm run build"
}
}
| {
"name": "prosemirror-gapcursor",
"version": "1.0.3",
"description": "ProseMirror plugin for cursors at normally impossible-to-reach positions",
"license": "MIT",
"main": "dist/index.js",
"style": "style/gapcursor.css",
"dependencies": {
"prosemirror-keymap": "^1.0.0",
"prosemirror-model": "^1.0.0",
"prosemirror-state": "^1.0.0",
"prosemirror-view": "^1.0.0"
},
"devDependencies": {
- "prosemirror-commands": "^1.0.0",
- "prosemirror-example-setup": "^1.0.0",
- "prosemirror-menu": "^1.0.0",
- "prosemirror-schema-basic": "^1.0.0",
- "prosemirror-tables": "^0.1.0",
- "prosemirror-test-builder": "^1.0.0",
- "prosemirror-transform": "^1.0.0",
"rollup": "^0.49.0",
"rollup-plugin-buble": "^0.15.0"
},
"scripts": {
"build": "rollup -c",
"watch": "rollup -w -c",
"prepare": "npm run build"
}
} | 7 | 0.233333 | 0 | 7 |
c0b578be80ad27fd67235b7b79fcaf4e69d49c72 | tests/haskell/libExecutionOutputTest/buildTest.sh | tests/haskell/libExecutionOutputTest/buildTest.sh | BIN_DIR=$1
SOURCE_DIR=$2
libname=$(stack query | awk 'NR==2' | sed 's/://g'| sed 's/ //g')
libver=$(stack query | awk 'NR==4' | sed 's/version: //g' | sed "s/'//g" | sed "s/ //g")
if [ "$(id -u)" -ne 0 ]
then
# Build haskell bindings package.
stack build --no-run-tests --extra-lib-dirs=${BIN_DIR}
LIB=$(find . -name "*$libname*.so" | awk 'NR==1')
rm "$SOURCE_DIR/lib$libname-$libver.so"
cp $LIB "$SOURCE_DIR/lib$libname-$libver.so"
else
echo "Can't run Haskell-Tests as root"
fi
| BIN_DIR=$1
SOURCE_DIR=$2
libname="opencoglib"
libver="0.1.0.0"
if [ "$(id -u)" -ne 0 ]
then
# Build haskell bindings package.
stack build --no-run-tests --extra-lib-dirs=${BIN_DIR}
LIB=$(find . -name "*$libname*.so" | awk 'NR==1')
rm "$SOURCE_DIR/lib$libname-$libver.so"
cp $LIB "$SOURCE_DIR/lib$libname-$libver.so"
else
echo "Can't run Haskell-Tests as root"
fi
| Fix for HaskellExecutionTest sometimes failing | Fix for HaskellExecutionTest sometimes failing
for some reason the code to get the library name doesn't work all the time. For this test it should be no problem to hardcode it. | Shell | agpl-3.0 | AmeBel/atomspace,AmeBel/atomspace,AmeBel/atomspace,ArvinPan/atomspace,rTreutlein/atomspace,inflector/atomspace,rTreutlein/atomspace,ceefour/atomspace,misgeatgit/atomspace,inflector/atomspace,AmeBel/atomspace,yantrabuddhi/atomspace,inflector/atomspace,rTreutlein/atomspace,yantrabuddhi/atomspace,ArvinPan/atomspace,ceefour/atomspace,ceefour/atomspace,misgeatgit/atomspace,inflector/atomspace,rTreutlein/atomspace,inflector/atomspace,ceefour/atomspace,ArvinPan/atomspace,ArvinPan/atomspace,rTreutlein/atomspace,yantrabuddhi/atomspace,misgeatgit/atomspace,AmeBel/atomspace,misgeatgit/atomspace,yantrabuddhi/atomspace,yantrabuddhi/atomspace,misgeatgit/atomspace | shell | ## Code Before:
BIN_DIR=$1
SOURCE_DIR=$2
libname=$(stack query | awk 'NR==2' | sed 's/://g'| sed 's/ //g')
libver=$(stack query | awk 'NR==4' | sed 's/version: //g' | sed "s/'//g" | sed "s/ //g")
if [ "$(id -u)" -ne 0 ]
then
# Build haskell bindings package.
stack build --no-run-tests --extra-lib-dirs=${BIN_DIR}
LIB=$(find . -name "*$libname*.so" | awk 'NR==1')
rm "$SOURCE_DIR/lib$libname-$libver.so"
cp $LIB "$SOURCE_DIR/lib$libname-$libver.so"
else
echo "Can't run Haskell-Tests as root"
fi
## Instruction:
Fix for HaskellExecutionTest sometimes failing
for some reason the code to get the library name doesn't work all the time. For this test it should be no problem to hardcode it.
## Code After:
BIN_DIR=$1
SOURCE_DIR=$2
libname="opencoglib"
libver="0.1.0.0"
if [ "$(id -u)" -ne 0 ]
then
# Build haskell bindings package.
stack build --no-run-tests --extra-lib-dirs=${BIN_DIR}
LIB=$(find . -name "*$libname*.so" | awk 'NR==1')
rm "$SOURCE_DIR/lib$libname-$libver.so"
cp $LIB "$SOURCE_DIR/lib$libname-$libver.so"
else
echo "Can't run Haskell-Tests as root"
fi
| BIN_DIR=$1
SOURCE_DIR=$2
- libname=$(stack query | awk 'NR==2' | sed 's/://g'| sed 's/ //g')
- libver=$(stack query | awk 'NR==4' | sed 's/version: //g' | sed "s/'//g" | sed "s/ //g")
+ libname="opencoglib"
+ libver="0.1.0.0"
if [ "$(id -u)" -ne 0 ]
then
# Build haskell bindings package.
stack build --no-run-tests --extra-lib-dirs=${BIN_DIR}
-
LIB=$(find . -name "*$libname*.so" | awk 'NR==1')
rm "$SOURCE_DIR/lib$libname-$libver.so"
cp $LIB "$SOURCE_DIR/lib$libname-$libver.so"
else
echo "Can't run Haskell-Tests as root"
fi | 5 | 0.263158 | 2 | 3 |
2626b5575a2a0f4f7661142923d454bb0f3a9b51 | .github/workflows/ci.yml | .github/workflows/ci.yml | on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
name: Continuous integration
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
tests:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- rust: 1.51.0 # MSRV
features: serde
- rust: stable
features:
- rust: beta
features: serde
- rust: nightly
features: serde unstable-const-fn
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Tests
run: |
cargo build --verbose --features "${{ matrix.features }}"
cargo doc --verbose --features "${{ matrix.features }}" --no-deps
cargo test --verbose --features "${{ matrix.features }}"
cargo test --release --verbose --features "${{ matrix.features }}"
- name: Test run benchmarks
if: matrix.bench != ''
run: cargo test -v --benches
miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Miri
run: ci/miri.sh
| on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
name: Continuous integration
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
tests:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- rust: 1.51.0 # MSRV
features: serde
experimental: false
- rust: stable
features:
experimental: false
- rust: beta
features: serde
experimental: false
- rust: nightly
features: serde
experimental: false
- rust: nightly
features: serde unstable-const-fn
experimental: true
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Tests
run: |
cargo build --verbose --features "${{ matrix.features }}"
cargo doc --verbose --features "${{ matrix.features }}" --no-deps
cargo test --verbose --features "${{ matrix.features }}"
cargo test --release --verbose --features "${{ matrix.features }}"
- name: Test run benchmarks
if: matrix.bench != ''
run: cargo test -v --benches
miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Miri
run: ci/miri.sh
| Update CI to use experimental/continue on error only for nigthly features | TEST: Update CI to use experimental/continue on error only for nigthly features
| YAML | apache-2.0 | bluss/arrayvec | yaml | ## Code Before:
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
name: Continuous integration
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
tests:
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
include:
- rust: 1.51.0 # MSRV
features: serde
- rust: stable
features:
- rust: beta
features: serde
- rust: nightly
features: serde unstable-const-fn
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Tests
run: |
cargo build --verbose --features "${{ matrix.features }}"
cargo doc --verbose --features "${{ matrix.features }}" --no-deps
cargo test --verbose --features "${{ matrix.features }}"
cargo test --release --verbose --features "${{ matrix.features }}"
- name: Test run benchmarks
if: matrix.bench != ''
run: cargo test -v --benches
miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Miri
run: ci/miri.sh
## Instruction:
TEST: Update CI to use experimental/continue on error only for nigthly features
## Code After:
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
name: Continuous integration
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
tests:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- rust: 1.51.0 # MSRV
features: serde
experimental: false
- rust: stable
features:
experimental: false
- rust: beta
features: serde
experimental: false
- rust: nightly
features: serde
experimental: false
- rust: nightly
features: serde unstable-const-fn
experimental: true
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Tests
run: |
cargo build --verbose --features "${{ matrix.features }}"
cargo doc --verbose --features "${{ matrix.features }}" --no-deps
cargo test --verbose --features "${{ matrix.features }}"
cargo test --release --verbose --features "${{ matrix.features }}"
- name: Test run benchmarks
if: matrix.bench != ''
run: cargo test -v --benches
miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Miri
run: ci/miri.sh
| on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
name: Continuous integration
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
tests:
runs-on: ubuntu-latest
- continue-on-error: true
+ continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
include:
- rust: 1.51.0 # MSRV
features: serde
+ experimental: false
- rust: stable
features:
+ experimental: false
- rust: beta
features: serde
+ experimental: false
+ - rust: nightly
+ features: serde
+ experimental: false
- rust: nightly
features: serde unstable-const-fn
+ experimental: true
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
- name: Tests
run: |
cargo build --verbose --features "${{ matrix.features }}"
cargo doc --verbose --features "${{ matrix.features }}" --no-deps
cargo test --verbose --features "${{ matrix.features }}"
cargo test --release --verbose --features "${{ matrix.features }}"
- name: Test run benchmarks
if: matrix.bench != ''
run: cargo test -v --benches
miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Miri
run: ci/miri.sh
| 9 | 0.173077 | 8 | 1 |
f2faad239b0a0d969436807436378cbfbaa34327 | lib/js/core/bootstrap.js | lib/js/core/bootstrap.js | (function() {
'use strict';
// Inject SVG icons into the DOM
var element = document.createElement('div');
element.id = 'darkroom-icons';
element.style = 'height: 0; width: 0; position: absolute; visibility: hidden';
element.innerHTML = '<!-- inject:svg --><!-- endinject -->';
document.body.appendChild(element);
})();
| (function() {
'use strict';
// Inject SVG icons into the DOM
var element = document.createElement('div');
element.id = 'darkroom-icons';
element.style.height = 0;
element.style.width = 0;
element.style.position = 'absolute';
element.style.visibility = 'hidden';
element.innerHTML = '<!-- inject:svg --><!-- endinject -->';
document.body.appendChild(element);
})();
| Fix write on a read-only property | Fix write on a read-only property
| JavaScript | mit | mstevens/darkroomjs,Drooids/darkroomjs,marcelgruber/darkroomjs,Drooids/darkroomjs,shelsonjava/darkroomjs,mstevens/darkroomjs,marcelgruber/darkroomjs,shelsonjava/darkroomjs,MattKetmo/darkroomjs,shelsonjava/darkroomjs,marcelgruber/darkroomjs,MattKetmo/darkroomjs,Drooids/darkroomjs,mstevens/darkroomjs | javascript | ## Code Before:
(function() {
'use strict';
// Inject SVG icons into the DOM
var element = document.createElement('div');
element.id = 'darkroom-icons';
element.style = 'height: 0; width: 0; position: absolute; visibility: hidden';
element.innerHTML = '<!-- inject:svg --><!-- endinject -->';
document.body.appendChild(element);
})();
## Instruction:
Fix write on a read-only property
## Code After:
(function() {
'use strict';
// Inject SVG icons into the DOM
var element = document.createElement('div');
element.id = 'darkroom-icons';
element.style.height = 0;
element.style.width = 0;
element.style.position = 'absolute';
element.style.visibility = 'hidden';
element.innerHTML = '<!-- inject:svg --><!-- endinject -->';
document.body.appendChild(element);
})();
| (function() {
'use strict';
// Inject SVG icons into the DOM
var element = document.createElement('div');
element.id = 'darkroom-icons';
- element.style = 'height: 0; width: 0; position: absolute; visibility: hidden';
+ element.style.height = 0;
+ element.style.width = 0;
+ element.style.position = 'absolute';
+ element.style.visibility = 'hidden';
element.innerHTML = '<!-- inject:svg --><!-- endinject -->';
document.body.appendChild(element);
-
})(); | 6 | 0.5 | 4 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.