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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4d390bb6af4e961357e9fe95b42b82febff65223 | .travis.yml | .travis.yml | language: python
python:
- "3.3"
- "3.2"
install: "" # no dependencies, nothing to do
script: nosetests
| language: python
python:
- "3.3"
install: "" # no dependencies, nothing to do
script: nosetests
| Remove test support for 3.2 | Remove test support for 3.2
| YAML | bsd-3-clause | bwhmather/json-config-parser | yaml | ## Code Before:
language: python
python:
- "3.3"
- "3.2"
install: "" # no dependencies, nothing to do
script: nosetests
## Instruction:
Remove test support for 3.2
## Code After:
language: python
python:
- "3.3"
install: "" # no dependencies, nothing to do
script: nosetests
| language: python
python:
- "3.3"
- - "3.2"
install: "" # no dependencies, nothing to do
script: nosetests | 1 | 0.166667 | 0 | 1 |
e637ddb4f8053a585b9e62df44b6fe612880d13c | gobbler/client.js | gobbler/client.js | if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
giblets: [
{ text: "This is task 1" },
{ text: "This is task 2" },
{ text: "This is task 3" }
]
});
// This code only runs on the client
Template.body.helpers({
giblets: function () {
return Giblets.find({});
}
});
Template.addGiblet.events({
"submit .addGiblet": function (event) {
event.preventDefault();
// // Get values from form
var taskname = event.target.taskname.value;
var url = event.target.url.value;
var keywords = event.target.keywords.value.split(', ');
var SMS = event.target.SMS.checked;
var email = event.target.email.checked;
var frequency = event.target.frequency.value;
var giblet = {
taskname: taskname,
url: url,
keywords: keywords,
SMS: SMS,
email: email,
frequency: frequency
};
Meteor.call('addGiblet', giblet);
}
});
Accounts.ui.config({
passwordSignupFields: 'USERNAME_ONLY',
});
}
| if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
giblets: [
{ text: "This is task 1" },
{ text: "This is task 2" },
{ text: "This is task 3" }
]
});
// This code only runs on the client
Template.body.helpers({
giblets: function () {
return Giblets.find({});
}
});
Template.addGiblet.events({
"submit .addGiblet": function (event) {
event.preventDefault();
// // Get values from form
var taskname = event.target.taskname.value;
var url = event.target.url.value.trim();
var keywords = event.target.keywords.value.split(', ');
var SMS = event.target.SMS.checked;
var email = event.target.email.checked;
var frequency = event.target.frequency.value;
var giblet = {
taskname: taskname,
url: url,
keywords: keywords,
SMS: SMS,
email: email,
frequency: frequency
};
Meteor.call('addGiblet', giblet);
}
});
Accounts.ui.config({
passwordSignupFields: 'USERNAME_ONLY',
});
}
| Trim whitespace from url input | Trim whitespace from url input
| JavaScript | mit | UnfetteredCheddar/UnfetteredCheddar,UnfetteredCheddar/UnfetteredCheddar | javascript | ## Code Before:
if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
giblets: [
{ text: "This is task 1" },
{ text: "This is task 2" },
{ text: "This is task 3" }
]
});
// This code only runs on the client
Template.body.helpers({
giblets: function () {
return Giblets.find({});
}
});
Template.addGiblet.events({
"submit .addGiblet": function (event) {
event.preventDefault();
// // Get values from form
var taskname = event.target.taskname.value;
var url = event.target.url.value;
var keywords = event.target.keywords.value.split(', ');
var SMS = event.target.SMS.checked;
var email = event.target.email.checked;
var frequency = event.target.frequency.value;
var giblet = {
taskname: taskname,
url: url,
keywords: keywords,
SMS: SMS,
email: email,
frequency: frequency
};
Meteor.call('addGiblet', giblet);
}
});
Accounts.ui.config({
passwordSignupFields: 'USERNAME_ONLY',
});
}
## Instruction:
Trim whitespace from url input
## Code After:
if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
giblets: [
{ text: "This is task 1" },
{ text: "This is task 2" },
{ text: "This is task 3" }
]
});
// This code only runs on the client
Template.body.helpers({
giblets: function () {
return Giblets.find({});
}
});
Template.addGiblet.events({
"submit .addGiblet": function (event) {
event.preventDefault();
// // Get values from form
var taskname = event.target.taskname.value;
var url = event.target.url.value.trim();
var keywords = event.target.keywords.value.split(', ');
var SMS = event.target.SMS.checked;
var email = event.target.email.checked;
var frequency = event.target.frequency.value;
var giblet = {
taskname: taskname,
url: url,
keywords: keywords,
SMS: SMS,
email: email,
frequency: frequency
};
Meteor.call('addGiblet', giblet);
}
});
Accounts.ui.config({
passwordSignupFields: 'USERNAME_ONLY',
});
}
| if (Meteor.isClient) {
// This code only runs on the client
Template.body.helpers({
giblets: [
{ text: "This is task 1" },
{ text: "This is task 2" },
{ text: "This is task 3" }
]
});
// This code only runs on the client
Template.body.helpers({
giblets: function () {
return Giblets.find({});
}
});
Template.addGiblet.events({
"submit .addGiblet": function (event) {
event.preventDefault();
// // Get values from form
var taskname = event.target.taskname.value;
- var url = event.target.url.value;
+ var url = event.target.url.value.trim();
? +++++++
var keywords = event.target.keywords.value.split(', ');
var SMS = event.target.SMS.checked;
var email = event.target.email.checked;
var frequency = event.target.frequency.value;
var giblet = {
taskname: taskname,
url: url,
keywords: keywords,
SMS: SMS,
email: email,
frequency: frequency
};
Meteor.call('addGiblet', giblet);
-
+
}
});
Accounts.ui.config({
passwordSignupFields: 'USERNAME_ONLY',
});
} | 4 | 0.078431 | 2 | 2 |
2d31e5504aa5e1b73f5852c5d86f5a01ad48d50b | README.md | README.md |
Warning: This is very experimental. The level of testing has consisted of "Start server, run some sql, shutdown server, restart server, run some sql". What it does manage to do is get a vertica process up and running in a docker container. For the purposes of testing applications with fig and such, this might be sufficient, but don't let it anywhere near production.
The image creates a database called docker, with a blank dbadmin password.
## Usage:
Download the Vertica RPM from https://my.vertica.com and put it in this folder.
Then run:
```bash
docker build -t bluelabs/vertica .
```
### To run without a persistent datastore
```bash
docker run -P bluelabs/vertica
```
### To run with a persistent datastore
```bash
docker run -P -v /path/to/vertica_data:/home/dbadmin/docker bluelabs/vertica
```
|
Warning: This is very experimental. The level of testing has consisted of "Start server, run some sql, shutdown server, restart server, run some sql". What it does manage to do is get a vertica process up and running in a docker container. For the purposes of testing applications with fig and such, this might be sufficient, but don't let it anywhere near production.
The image creates a database called docker, with a blank dbadmin password.
## Usage:
Download the Vertica RPM from https://my.vertica.com and put it in this folder.
Then run:
```bash
docker build -t bluelabs/vertica .
```
### To run without a persistent datastore
```bash
docker run -P bluelabs/vertica
```
### To run with a persistent datastore
```bash
docker run -P -v /path/to/vertica_data:/home/dbadmin/docker bluelabs/vertica
```
### Common problems
## ```/docker-entrypoint.sh: line 15: ulimit: open files: cannot modify limit: Operation not permitted```
Databases open and keep open a number of files simultaneously, and often require higher configured limits than most Linux distributions come with by default.
To resolve this, increase your maximum file handle ulimit size (`ulimit -n`). You might find this in `/etc/security/limits.conf`. Depending on your distribution, you may also need to change your Docker configuration for limits it sets on top of this, which you might find in `/etc/sysconfig/docker`.
| Add note on ulimit problem | Add note on ulimit problem
| Markdown | mit | bluelabsio/docker-vertica | markdown | ## Code Before:
Warning: This is very experimental. The level of testing has consisted of "Start server, run some sql, shutdown server, restart server, run some sql". What it does manage to do is get a vertica process up and running in a docker container. For the purposes of testing applications with fig and such, this might be sufficient, but don't let it anywhere near production.
The image creates a database called docker, with a blank dbadmin password.
## Usage:
Download the Vertica RPM from https://my.vertica.com and put it in this folder.
Then run:
```bash
docker build -t bluelabs/vertica .
```
### To run without a persistent datastore
```bash
docker run -P bluelabs/vertica
```
### To run with a persistent datastore
```bash
docker run -P -v /path/to/vertica_data:/home/dbadmin/docker bluelabs/vertica
```
## Instruction:
Add note on ulimit problem
## Code After:
Warning: This is very experimental. The level of testing has consisted of "Start server, run some sql, shutdown server, restart server, run some sql". What it does manage to do is get a vertica process up and running in a docker container. For the purposes of testing applications with fig and such, this might be sufficient, but don't let it anywhere near production.
The image creates a database called docker, with a blank dbadmin password.
## Usage:
Download the Vertica RPM from https://my.vertica.com and put it in this folder.
Then run:
```bash
docker build -t bluelabs/vertica .
```
### To run without a persistent datastore
```bash
docker run -P bluelabs/vertica
```
### To run with a persistent datastore
```bash
docker run -P -v /path/to/vertica_data:/home/dbadmin/docker bluelabs/vertica
```
### Common problems
## ```/docker-entrypoint.sh: line 15: ulimit: open files: cannot modify limit: Operation not permitted```
Databases open and keep open a number of files simultaneously, and often require higher configured limits than most Linux distributions come with by default.
To resolve this, increase your maximum file handle ulimit size (`ulimit -n`). You might find this in `/etc/security/limits.conf`. Depending on your distribution, you may also need to change your Docker configuration for limits it sets on top of this, which you might find in `/etc/sysconfig/docker`.
|
Warning: This is very experimental. The level of testing has consisted of "Start server, run some sql, shutdown server, restart server, run some sql". What it does manage to do is get a vertica process up and running in a docker container. For the purposes of testing applications with fig and such, this might be sufficient, but don't let it anywhere near production.
The image creates a database called docker, with a blank dbadmin password.
## Usage:
Download the Vertica RPM from https://my.vertica.com and put it in this folder.
Then run:
```bash
docker build -t bluelabs/vertica .
```
### To run without a persistent datastore
```bash
docker run -P bluelabs/vertica
```
### To run with a persistent datastore
```bash
docker run -P -v /path/to/vertica_data:/home/dbadmin/docker bluelabs/vertica
```
+
+ ### Common problems
+
+ ## ```/docker-entrypoint.sh: line 15: ulimit: open files: cannot modify limit: Operation not permitted```
+
+ Databases open and keep open a number of files simultaneously, and often require higher configured limits than most Linux distributions come with by default.
+
+ To resolve this, increase your maximum file handle ulimit size (`ulimit -n`). You might find this in `/etc/security/limits.conf`. Depending on your distribution, you may also need to change your Docker configuration for limits it sets on top of this, which you might find in `/etc/sysconfig/docker`. | 8 | 0.363636 | 8 | 0 |
62162b935898d5016d8e1a7dd3c00714898466c2 | lib/package-list-view.js | lib/package-list-view.js | var _atom = require('atom');
var SelectListView = _atom.SelectListView;
var helpers = require('atom-helpers');
function PackageListView() {
SelectListView.__super__.constructor.apply(this, arguments);
}
helpers.extends(PackageListView, SelectListView);
PackageListView.prototype.currentInstall;
PackageListView.prototype.initialize = function() {
PackageListView.__super__.initialize.apply(this, arguments);
return this;
};
PackageListView.prototype.destroy = function() {
this.currentCommand = null;
return PackageListView.__super__.detach.apply(this, arguments);
};
PackageListView.prototype.viewForItem = function(item) {
return '<li class="two-lines">' + item + '</li>';
};
PackageListView.prototype.confirmed = function(packageListName) {
var utils = require('./Utils.js');
utils.loadPackageList(packageListName);
};
PackageListView.prototype.showPackageList = function(item) {
var items = ['PHP', 'Javascript'];
this.addClass('overlay from-top');
this.setItems(items);
atom.workspaceView.append(this);
this.focusFilterEditor();
};
module.exports = PackageListView;
| var _atom = require('atom');
var SelectListView = _atom.SelectListView;
var helpers = require('atom-helpers');
function PackageListView() {
SelectListView.__super__.constructor.apply(this, arguments);
}
helpers.extends(PackageListView, SelectListView);
PackageListView.prototype.currentInstall;
PackageListView.prototype.initialize = function() {
PackageListView.__super__.initialize.apply(this, arguments);
return this;
};
PackageListView.prototype.destroy = function() {
this.currentCommand = null;
return PackageListView.__super__.detach.apply(this, arguments);
};
PackageListView.prototype.viewForItem = function(item) {
return '<li class="two-lines">' + item + '</li>';
};
PackageListView.prototype.confirmed = function(packageListName) {
var utils = require('./Utils.js');
utils.loadPackageList(packageListName);
this.remove();
};
PackageListView.prototype.showPackageList = function(item) {
var items = ['PHP', 'Javascript'];
this.addClass('overlay from-top');
this.setItems(items);
atom.workspaceView.append(this);
this.focusFilterEditor();
};
module.exports = PackageListView;
| Remove package list on confirmation | Remove package list on confirmation
| JavaScript | mit | Trudko/package-list-downloader | javascript | ## Code Before:
var _atom = require('atom');
var SelectListView = _atom.SelectListView;
var helpers = require('atom-helpers');
function PackageListView() {
SelectListView.__super__.constructor.apply(this, arguments);
}
helpers.extends(PackageListView, SelectListView);
PackageListView.prototype.currentInstall;
PackageListView.prototype.initialize = function() {
PackageListView.__super__.initialize.apply(this, arguments);
return this;
};
PackageListView.prototype.destroy = function() {
this.currentCommand = null;
return PackageListView.__super__.detach.apply(this, arguments);
};
PackageListView.prototype.viewForItem = function(item) {
return '<li class="two-lines">' + item + '</li>';
};
PackageListView.prototype.confirmed = function(packageListName) {
var utils = require('./Utils.js');
utils.loadPackageList(packageListName);
};
PackageListView.prototype.showPackageList = function(item) {
var items = ['PHP', 'Javascript'];
this.addClass('overlay from-top');
this.setItems(items);
atom.workspaceView.append(this);
this.focusFilterEditor();
};
module.exports = PackageListView;
## Instruction:
Remove package list on confirmation
## Code After:
var _atom = require('atom');
var SelectListView = _atom.SelectListView;
var helpers = require('atom-helpers');
function PackageListView() {
SelectListView.__super__.constructor.apply(this, arguments);
}
helpers.extends(PackageListView, SelectListView);
PackageListView.prototype.currentInstall;
PackageListView.prototype.initialize = function() {
PackageListView.__super__.initialize.apply(this, arguments);
return this;
};
PackageListView.prototype.destroy = function() {
this.currentCommand = null;
return PackageListView.__super__.detach.apply(this, arguments);
};
PackageListView.prototype.viewForItem = function(item) {
return '<li class="two-lines">' + item + '</li>';
};
PackageListView.prototype.confirmed = function(packageListName) {
var utils = require('./Utils.js');
utils.loadPackageList(packageListName);
this.remove();
};
PackageListView.prototype.showPackageList = function(item) {
var items = ['PHP', 'Javascript'];
this.addClass('overlay from-top');
this.setItems(items);
atom.workspaceView.append(this);
this.focusFilterEditor();
};
module.exports = PackageListView;
| var _atom = require('atom');
var SelectListView = _atom.SelectListView;
var helpers = require('atom-helpers');
function PackageListView() {
SelectListView.__super__.constructor.apply(this, arguments);
}
helpers.extends(PackageListView, SelectListView);
PackageListView.prototype.currentInstall;
PackageListView.prototype.initialize = function() {
PackageListView.__super__.initialize.apply(this, arguments);
return this;
};
PackageListView.prototype.destroy = function() {
this.currentCommand = null;
return PackageListView.__super__.detach.apply(this, arguments);
};
PackageListView.prototype.viewForItem = function(item) {
return '<li class="two-lines">' + item + '</li>';
};
PackageListView.prototype.confirmed = function(packageListName) {
- var utils = require('./Utils.js');
? --
+ var utils = require('./Utils.js');
utils.loadPackageList(packageListName);
+ this.remove();
};
PackageListView.prototype.showPackageList = function(item) {
var items = ['PHP', 'Javascript'];
this.addClass('overlay from-top');
this.setItems(items);
atom.workspaceView.append(this);
this.focusFilterEditor();
};
module.exports = PackageListView; | 3 | 0.076923 | 2 | 1 |
bee814c6f8964d7305d7d99b2a82bd9a6c4d70bc | .travis.yml | .travis.yml | language: android
android:
components:
- tools
- build-tools-23.0.3
- android-23
- platform-tools
- extra-android-support
- extra-android-m2repository
branches:
except:
- gh-pages
sudo: false
| language: android
android:
components:
- tools
- build-tools-23.0.3
- android-23
- platform-tools
- extra-android-support
- extra-android-m2repository
branches:
except:
- gh-pages
# Disable Travis container-based infrastructure to correct
# resource consumption in gradle presumably due to dexing.
sudo: true
| Correct Travis CI jobs being killed | Correct Travis CI jobs being killed
This switches off the container based infrastructure in order to allow
for greater memory consumption during the build, presumably needed by
the dexing step in our Android build.
| YAML | bsd-3-clause | potyl/stetho,rickbrew/stetho,felipecsl/stetho,blavalla/stetho,rickbrew/stetho,potyl/stetho,blavalla/stetho,potyl/stetho,facebook/stetho,facebook/stetho,facebook/stetho,potyl/stetho,felipecsl/stetho,rickbrew/stetho,felipecsl/stetho,rickbrew/stetho,facebook/stetho,felipecsl/stetho,blavalla/stetho,blavalla/stetho | yaml | ## Code Before:
language: android
android:
components:
- tools
- build-tools-23.0.3
- android-23
- platform-tools
- extra-android-support
- extra-android-m2repository
branches:
except:
- gh-pages
sudo: false
## Instruction:
Correct Travis CI jobs being killed
This switches off the container based infrastructure in order to allow
for greater memory consumption during the build, presumably needed by
the dexing step in our Android build.
## Code After:
language: android
android:
components:
- tools
- build-tools-23.0.3
- android-23
- platform-tools
- extra-android-support
- extra-android-m2repository
branches:
except:
- gh-pages
# Disable Travis container-based infrastructure to correct
# resource consumption in gradle presumably due to dexing.
sudo: true
| language: android
android:
components:
- tools
- build-tools-23.0.3
- android-23
- platform-tools
- extra-android-support
- extra-android-m2repository
branches:
except:
- gh-pages
- sudo: false
+ # Disable Travis container-based infrastructure to correct
+ # resource consumption in gradle presumably due to dexing.
+ sudo: true | 4 | 0.25 | 3 | 1 |
b62a23db97286e4318152ef08791ccca4b52e5aa | lib/jeckle/exceptions.rb | lib/jeckle/exceptions.rb |
%w(no_such_api_error no_username_or_password_error).each do |file|
require "jeckle/exceptions/#{file}"
end
|
%w(no_such_api_error no_username_or_password_error).each do |file_name|
require "jeckle/exceptions/#{file_name}"
end
| Change variable to become more readable. File to file name | Change variable to become more readable. File to file name
| Ruby | mit | cairesr/jeckle,tomas-stefano/jeckle | ruby | ## Code Before:
%w(no_such_api_error no_username_or_password_error).each do |file|
require "jeckle/exceptions/#{file}"
end
## Instruction:
Change variable to become more readable. File to file name
## Code After:
%w(no_such_api_error no_username_or_password_error).each do |file_name|
require "jeckle/exceptions/#{file_name}"
end
|
- %w(no_such_api_error no_username_or_password_error).each do |file|
+ %w(no_such_api_error no_username_or_password_error).each do |file_name|
? +++++
- require "jeckle/exceptions/#{file}"
+ require "jeckle/exceptions/#{file_name}"
? +++++
end | 4 | 1 | 2 | 2 |
5842c111e49b84f064accdba374d3d6188b1dae2 | composer.json | composer.json | {
"name": "fg/essence",
"type": "library",
"description": "Extracts informations about medias on the web, like youtube videos, twitter statuses or blog articles.",
"version": "2.0.0",
"authors": [{
"name": "Félix Girault",
"email": "felix.girault@gmail.com",
"homepage": "http://www.felix-girault.fr",
"role": "Developer"
}],
"keywords": [
"embed",
"oembed",
"opengraph",
"media"
],
"licence": "BSD-2-Clause",
"homepage": "http://github.com/felixgirault/essence",
"require": {
"php": ">=5.4.0",
"ext-curl": "*"
},
"autoload": {
"psr-0": {
"Essence": "lib/"
}
}
}
| {
"name": "fg/essence",
"type": "library",
"description": "Extracts informations about medias on the web, like youtube videos, twitter statuses or blog articles.",
"version": "2.0.0",
"authors": [{
"name": "Félix Girault",
"email": "felix.girault@gmail.com",
"homepage": "http://www.felix-girault.fr",
"role": "Developer"
}],
"keywords": [
"embed",
"oembed",
"opengraph",
"media"
],
"licence": "BSD-2-Clause",
"homepage": "http://github.com/felixgirault/essence",
"require": {
"php": ">=5.4.0",
"ext-curl": "*"
},
"autoload": {
"files": [
"lib/bootstrap.php"
]
}
}
| Replace Composer autoloader with bootstrapper | Replace Composer autoloader with bootstrapper | JSON | bsd-2-clause | jaffog/essence,jaffog/essence,tjbp/essence,tjbp/essence | json | ## Code Before:
{
"name": "fg/essence",
"type": "library",
"description": "Extracts informations about medias on the web, like youtube videos, twitter statuses or blog articles.",
"version": "2.0.0",
"authors": [{
"name": "Félix Girault",
"email": "felix.girault@gmail.com",
"homepage": "http://www.felix-girault.fr",
"role": "Developer"
}],
"keywords": [
"embed",
"oembed",
"opengraph",
"media"
],
"licence": "BSD-2-Clause",
"homepage": "http://github.com/felixgirault/essence",
"require": {
"php": ">=5.4.0",
"ext-curl": "*"
},
"autoload": {
"psr-0": {
"Essence": "lib/"
}
}
}
## Instruction:
Replace Composer autoloader with bootstrapper
## Code After:
{
"name": "fg/essence",
"type": "library",
"description": "Extracts informations about medias on the web, like youtube videos, twitter statuses or blog articles.",
"version": "2.0.0",
"authors": [{
"name": "Félix Girault",
"email": "felix.girault@gmail.com",
"homepage": "http://www.felix-girault.fr",
"role": "Developer"
}],
"keywords": [
"embed",
"oembed",
"opengraph",
"media"
],
"licence": "BSD-2-Clause",
"homepage": "http://github.com/felixgirault/essence",
"require": {
"php": ">=5.4.0",
"ext-curl": "*"
},
"autoload": {
"files": [
"lib/bootstrap.php"
]
}
}
| {
"name": "fg/essence",
"type": "library",
"description": "Extracts informations about medias on the web, like youtube videos, twitter statuses or blog articles.",
"version": "2.0.0",
"authors": [{
"name": "Félix Girault",
"email": "felix.girault@gmail.com",
"homepage": "http://www.felix-girault.fr",
"role": "Developer"
}],
"keywords": [
"embed",
"oembed",
"opengraph",
"media"
],
"licence": "BSD-2-Clause",
"homepage": "http://github.com/felixgirault/essence",
"require": {
"php": ">=5.4.0",
"ext-curl": "*"
},
"autoload": {
- "psr-0": {
- "Essence": "lib/"
- }
+ "files": [
+ "lib/bootstrap.php"
+ ]
}
} | 6 | 0.206897 | 3 | 3 |
5ac0ab07947256facc18a315e366d32445a9cf55 | app/views/home/welcome.html.slim | app/views/home/welcome.html.slim | .well.text-center
i.fa.fa-hand-peace-o.fa-4x
h1 Welcome to Ruby Taiwan Reboot
.well.text-center#chat-with-us
.heading
h2 Chat With Us
.row.text-center
.col-sm-8.col-sm-offset-2
.col-sm-6
= link_to "https://rubytaiwan.slack.com", class: 'icon' do
= icon :slack
p Slack
.col-sm-6
strong Invite yourself to our Slack group!
hr
= form_for Invitation.new, html: {class: 'form-horizontal'} do |f|
.form-group
.col-sm-8.col-sm-offset-2
= f.text_field :email, class: 'form-control', placeholder: 'Enter Email'
.form-group
.col-sm-8.col-sm-offset-2
= f.submit 'Send Invite', class: 'btn btn-success btn-block', data: { disable_with: 'processing...' }
| .text-center
i.fa.fa-hand-peace-o.fa-4x
h1 Welcome to Ruby Taiwan Reboot
.text-center#chat-with-us
.heading
h2 Chat With Us
.row.text-center
.col-sm-8.col-sm-offset-2
.col-sm-6
= link_to "https://rubytaiwan.slack.com", class: "icon" do
= icon :slack
p Slack
.col-sm-6
strong Invite yourself to our Slack group!
hr
= form_for Invitation.new, html: {class: "form-horizontal"} do |f|
.form-group
.col-sm-8.col-sm-offset-2
= f.text_field :email, class: "form-control", placeholder: "Enter Email"
.form-group
.col-sm-8.col-sm-offset-2
= f.submit "Send Invite", class: "btn btn-success btn-block", data: { disable_with: "processing..." }
| Remove well and use double quotes in welcome page | Remove well and use double quotes in welcome page
| Slim | unlicense | rubytaiwan/rubytw-reboot,rubytaiwan/rubytw-reboot,rubytaiwan/rubytw-reboot | slim | ## Code Before:
.well.text-center
i.fa.fa-hand-peace-o.fa-4x
h1 Welcome to Ruby Taiwan Reboot
.well.text-center#chat-with-us
.heading
h2 Chat With Us
.row.text-center
.col-sm-8.col-sm-offset-2
.col-sm-6
= link_to "https://rubytaiwan.slack.com", class: 'icon' do
= icon :slack
p Slack
.col-sm-6
strong Invite yourself to our Slack group!
hr
= form_for Invitation.new, html: {class: 'form-horizontal'} do |f|
.form-group
.col-sm-8.col-sm-offset-2
= f.text_field :email, class: 'form-control', placeholder: 'Enter Email'
.form-group
.col-sm-8.col-sm-offset-2
= f.submit 'Send Invite', class: 'btn btn-success btn-block', data: { disable_with: 'processing...' }
## Instruction:
Remove well and use double quotes in welcome page
## Code After:
.text-center
i.fa.fa-hand-peace-o.fa-4x
h1 Welcome to Ruby Taiwan Reboot
.text-center#chat-with-us
.heading
h2 Chat With Us
.row.text-center
.col-sm-8.col-sm-offset-2
.col-sm-6
= link_to "https://rubytaiwan.slack.com", class: "icon" do
= icon :slack
p Slack
.col-sm-6
strong Invite yourself to our Slack group!
hr
= form_for Invitation.new, html: {class: "form-horizontal"} do |f|
.form-group
.col-sm-8.col-sm-offset-2
= f.text_field :email, class: "form-control", placeholder: "Enter Email"
.form-group
.col-sm-8.col-sm-offset-2
= f.submit "Send Invite", class: "btn btn-success btn-block", data: { disable_with: "processing..." }
| - .well.text-center
? -----
+ .text-center
i.fa.fa-hand-peace-o.fa-4x
h1 Welcome to Ruby Taiwan Reboot
- .well.text-center#chat-with-us
? -----
+ .text-center#chat-with-us
.heading
h2 Chat With Us
.row.text-center
.col-sm-8.col-sm-offset-2
.col-sm-6
- = link_to "https://rubytaiwan.slack.com", class: 'icon' do
? ^ ^
+ = link_to "https://rubytaiwan.slack.com", class: "icon" do
? ^ ^
= icon :slack
p Slack
.col-sm-6
strong Invite yourself to our Slack group!
hr
- = form_for Invitation.new, html: {class: 'form-horizontal'} do |f|
? ^ ^
+ = form_for Invitation.new, html: {class: "form-horizontal"} do |f|
? ^ ^
.form-group
.col-sm-8.col-sm-offset-2
- = f.text_field :email, class: 'form-control', placeholder: 'Enter Email'
? ^ ^ ^ ^
+ = f.text_field :email, class: "form-control", placeholder: "Enter Email"
? ^ ^ ^ ^
.form-group
.col-sm-8.col-sm-offset-2
- = f.submit 'Send Invite', class: 'btn btn-success btn-block', data: { disable_with: 'processing...' }
? ^ ^ ^ ^ ^ ^
+ = f.submit "Send Invite", class: "btn btn-success btn-block", data: { disable_with: "processing..." }
? ^ ^ ^ ^ ^ ^
| 12 | 0.545455 | 6 | 6 |
5328c703c7b65ccadcf5e41ef995db3fd6619c8f | playground/plot-charts.html | playground/plot-charts.html | <!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>???</title>
<link rel="stylesheet" href="narrative.css" />
</head>
<body>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="narrative.js"></script>
<script src="plot-charts.js"></script>
<script>
draw_plot_chart("Toy Story 3", "toy-story-3", "toy-story-3.xml", true, false, false);
</script>
<p id="chart">
</p>
</body>
</html>
| <!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>???</title>
<link rel="stylesheet" href="narrative.css" />
<style>
#chart svg {
width: 2000px;
height: 1000px;
}
</style>
</head>
<body>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="narrative.js"></script>
<script src="plot-charts.js"></script>
<script>
draw_plot_chart("Toy Story 3", "toy-story-3", "toy-story-3.xml", true, false, false);
</script>
<p id="chart">
</p>
</body>
</html>
| Make plot chart very big by default | Make plot chart very big by default
| HTML | agpl-3.0 | heyLu/fis,heyLu/fis,heyLu/fis,heyLu/fis,heyLu/fis,heyLu/fis | html | ## Code Before:
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>???</title>
<link rel="stylesheet" href="narrative.css" />
</head>
<body>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="narrative.js"></script>
<script src="plot-charts.js"></script>
<script>
draw_plot_chart("Toy Story 3", "toy-story-3", "toy-story-3.xml", true, false, false);
</script>
<p id="chart">
</p>
</body>
</html>
## Instruction:
Make plot chart very big by default
## Code After:
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>???</title>
<link rel="stylesheet" href="narrative.css" />
<style>
#chart svg {
width: 2000px;
height: 1000px;
}
</style>
</head>
<body>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="narrative.js"></script>
<script src="plot-charts.js"></script>
<script>
draw_plot_chart("Toy Story 3", "toy-story-3", "toy-story-3.xml", true, false, false);
</script>
<p id="chart">
</p>
</body>
</html>
| <!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>???</title>
<link rel="stylesheet" href="narrative.css" />
+ <style>
+ #chart svg {
+ width: 2000px;
+ height: 1000px;
+ }
+ </style>
</head>
<body>
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src="narrative.js"></script>
<script src="plot-charts.js"></script>
<script>
draw_plot_chart("Toy Story 3", "toy-story-3", "toy-story-3.xml", true, false, false);
</script>
<p id="chart">
</p>
</body>
</html> | 6 | 0.285714 | 6 | 0 |
396447fec386379b8ae7b7b0dc2763c83486eb3c | test/fixtures/lines.yml | test/fixtures/lines.yml |
one:
person_id: 1
quote_id: 1
body: MyText
two:
person_id: 1
quote_id: 1
body: MyText
|
one:
person: one
quote: one
body: MyText1
two:
person: two
quote: two
body: MyText2
| Fix associations for Line fixtures | Fix associations for Line fixtures
| YAML | mit | skyshaper/satq,skyshaper/satq,skyshaper/satq,skyshaper/satq | yaml | ## Code Before:
one:
person_id: 1
quote_id: 1
body: MyText
two:
person_id: 1
quote_id: 1
body: MyText
## Instruction:
Fix associations for Line fixtures
## Code After:
one:
person: one
quote: one
body: MyText1
two:
person: two
quote: two
body: MyText2
|
one:
- person_id: 1
- quote_id: 1
+ person: one
+ quote: one
- body: MyText
+ body: MyText1
? +
two:
- person_id: 1
- quote_id: 1
+ person: two
+ quote: two
- body: MyText
+ body: MyText2
? +
| 12 | 1.2 | 6 | 6 |
6b6bd10d3025b978b8c345926db4b84cd916dee3 | test/CodeGenCXX/debug-info-method.cpp | test/CodeGenCXX/debug-info-method.cpp | // RUN: %clang_cc1 -emit-llvm -std=c++11 -g %s -o - | FileCheck %s
// CHECK: metadata !"_ZN1A3fooEiS_3$_0", {{.*}}, i32 258
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
union {
int a;
float b;
} u;
class A {
protected:
void foo(int, A, decltype(u));
};
void A::foo(int, A, decltype(u)) {
}
A a;
| // RUN: %clang_cc1 -emit-llvm -std=c++11 -g %s -o - | FileCheck %s
// CHECK: metadata !"_ZN1A3fooEiS_3$_0", {{.*}} [protected]
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
union {
int a;
float b;
} u;
class A {
protected:
void foo(int, A, decltype(u));
};
void A::foo(int, A, decltype(u)) {
}
A a;
| Make checking for 'protected' access in debug info more legible. | Make checking for 'protected' access in debug info more legible.
Based on code review feedback for r171604 from Chandler Carruth &
Eric Christopher. Enabled by improvements to LLVM made in r171636.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@171637 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang | c++ | ## Code Before:
// RUN: %clang_cc1 -emit-llvm -std=c++11 -g %s -o - | FileCheck %s
// CHECK: metadata !"_ZN1A3fooEiS_3$_0", {{.*}}, i32 258
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
union {
int a;
float b;
} u;
class A {
protected:
void foo(int, A, decltype(u));
};
void A::foo(int, A, decltype(u)) {
}
A a;
## Instruction:
Make checking for 'protected' access in debug info more legible.
Based on code review feedback for r171604 from Chandler Carruth &
Eric Christopher. Enabled by improvements to LLVM made in r171636.
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@171637 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
// RUN: %clang_cc1 -emit-llvm -std=c++11 -g %s -o - | FileCheck %s
// CHECK: metadata !"_ZN1A3fooEiS_3$_0", {{.*}} [protected]
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
union {
int a;
float b;
} u;
class A {
protected:
void foo(int, A, decltype(u));
};
void A::foo(int, A, decltype(u)) {
}
A a;
| // RUN: %clang_cc1 -emit-llvm -std=c++11 -g %s -o - | FileCheck %s
- // CHECK: metadata !"_ZN1A3fooEiS_3$_0", {{.*}}, i32 258
? - ^^^^^^^
+ // CHECK: metadata !"_ZN1A3fooEiS_3$_0", {{.*}} [protected]
? ^^^^^^^^^^^
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
// CHECK: ""{{.*}}DW_TAG_arg_variable
union {
int a;
float b;
} u;
class A {
protected:
void foo(int, A, decltype(u));
};
void A::foo(int, A, decltype(u)) {
}
A a; | 2 | 0.105263 | 1 | 1 |
364208c0608f6b88a200c55dae5837a017391673 | .travis.yml | .travis.yml | sudo: false
language: python
python:
- "2.6"
- "2.7"
install:
- "pip install ."
- "pip install coveralls"
script:
- coverage run --source=vipaccess setup.py test
after_success:
- coveralls
deploy:
provider: pypi
user: cyrozap
password:
secure: ksuSgb20onjR65wMxYbkQ2gK/P7xwShPMPXQ27an6j22L9d518HVE53/Vn/SvlKbYTd2fOVJHIFaKMfY562nIQAxYVvu9lKQUa4ziSBoLwOuVN9rmEkKrfn9A+jo3t84kRpSNSXgbkoQusu7yT76OvD6t29FT/dKrauVd/UBAsw=
on:
tags: true
repo: cyrozap/python-vipaccess
| sudo: false
language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
install:
- "pip install ."
- "pip install coveralls"
script:
- coverage run --source=vipaccess setup.py test
after_success:
- coveralls
deploy:
provider: pypi
user: cyrozap
password:
secure: ksuSgb20onjR65wMxYbkQ2gK/P7xwShPMPXQ27an6j22L9d518HVE53/Vn/SvlKbYTd2fOVJHIFaKMfY562nIQAxYVvu9lKQUa4ziSBoLwOuVN9rmEkKrfn9A+jo3t84kRpSNSXgbkoQusu7yT76OvD6t29FT/dKrauVd/UBAsw=
on:
tags: true
repo: cyrozap/python-vipaccess
| Add Python 3 to Travis config | Add Python 3 to Travis config
| YAML | apache-2.0 | ksylvan/python-vipaccess,dlenski/python-vipaccess,cyrozap/python-vipaccess | yaml | ## Code Before:
sudo: false
language: python
python:
- "2.6"
- "2.7"
install:
- "pip install ."
- "pip install coveralls"
script:
- coverage run --source=vipaccess setup.py test
after_success:
- coveralls
deploy:
provider: pypi
user: cyrozap
password:
secure: ksuSgb20onjR65wMxYbkQ2gK/P7xwShPMPXQ27an6j22L9d518HVE53/Vn/SvlKbYTd2fOVJHIFaKMfY562nIQAxYVvu9lKQUa4ziSBoLwOuVN9rmEkKrfn9A+jo3t84kRpSNSXgbkoQusu7yT76OvD6t29FT/dKrauVd/UBAsw=
on:
tags: true
repo: cyrozap/python-vipaccess
## Instruction:
Add Python 3 to Travis config
## Code After:
sudo: false
language: python
python:
- "2.6"
- "2.7"
- "3.2"
- "3.3"
- "3.4"
install:
- "pip install ."
- "pip install coveralls"
script:
- coverage run --source=vipaccess setup.py test
after_success:
- coveralls
deploy:
provider: pypi
user: cyrozap
password:
secure: ksuSgb20onjR65wMxYbkQ2gK/P7xwShPMPXQ27an6j22L9d518HVE53/Vn/SvlKbYTd2fOVJHIFaKMfY562nIQAxYVvu9lKQUa4ziSBoLwOuVN9rmEkKrfn9A+jo3t84kRpSNSXgbkoQusu7yT76OvD6t29FT/dKrauVd/UBAsw=
on:
tags: true
repo: cyrozap/python-vipaccess
| sudo: false
language: python
python:
- "2.6"
- "2.7"
+ - "3.2"
+ - "3.3"
+ - "3.4"
install:
- "pip install ."
- "pip install coveralls"
script:
- coverage run --source=vipaccess setup.py test
after_success:
- coveralls
deploy:
provider: pypi
user: cyrozap
password:
secure: ksuSgb20onjR65wMxYbkQ2gK/P7xwShPMPXQ27an6j22L9d518HVE53/Vn/SvlKbYTd2fOVJHIFaKMfY562nIQAxYVvu9lKQUa4ziSBoLwOuVN9rmEkKrfn9A+jo3t84kRpSNSXgbkoQusu7yT76OvD6t29FT/dKrauVd/UBAsw=
on:
tags: true
repo: cyrozap/python-vipaccess | 3 | 0.115385 | 3 | 0 |
e8db81b563688d977a3090f6f2d4fc7efaa42323 | tests/document_download/test_document_download.py | tests/document_download/test_document_download.py | import pytest
import requests
from retry.api import retry_call
from config import config
from tests.pages import DocumentDownloadLandingPage, DocumentDownloadPage
def upload_document(service_id, file_contents):
response = requests.post(
"{}/services/{}/documents".format(config['document_download']['api_host'], service_id),
headers={
'Authorization': "Bearer {}".format(config['document_download']['api_key']),
},
files={
'document': file_contents
}
)
json = response.json()
assert 'error' not in json, 'Status code {}'.format(response.status_code)
return json['document']
@pytest.mark.antivirus
def test_document_upload_and_download(driver):
document = retry_call(
upload_document,
# add PDF header to trick doc download into thinking its a real pdf
fargs=[config['service']['id'], '%PDF-1.4 functional tests file'],
tries=3,
delay=10
)
driver.get(document['url'])
landing_page = DocumentDownloadLandingPage(driver)
assert 'Functional Tests' in landing_page.get_service_name()
landing_page.go_to_download_page()
download_page = DocumentDownloadPage(driver)
document_url = download_page.get_download_link()
downloaded_document = requests.get(document_url)
assert downloaded_document.text == '%PDF-1.4 functional tests file'
| import base64
import pytest
import requests
from retry.api import retry_call
from config import config
from tests.pages import DocumentDownloadLandingPage, DocumentDownloadPage
def upload_document(service_id, file_contents):
response = requests.post(
f"{config['document_download']['api_host']}/services/{service_id}/documents",
headers={
'Authorization': f"Bearer {config['document_download']['api_key']}",
},
json={
'document': base64.b64encode(file_contents).decode('ascii')
}
)
json = response.json()
assert 'error' not in json, 'Status code {}'.format(response.status_code)
return json['document']
@pytest.mark.antivirus
def test_document_upload_and_download(driver):
document = retry_call(
upload_document,
# add PDF header to trick doc download into thinking its a real pdf
fargs=[config['service']['id'], b'%PDF-1.4 functional tests file'],
tries=3,
delay=10
)
driver.get(document['url'])
landing_page = DocumentDownloadLandingPage(driver)
assert 'Functional Tests' in landing_page.get_service_name()
landing_page.go_to_download_page()
download_page = DocumentDownloadPage(driver)
document_url = download_page.get_download_link()
downloaded_document = requests.get(document_url)
assert downloaded_document.text == '%PDF-1.4 functional tests file'
| Update how the document download test calls document-download-api | Update how the document download test calls document-download-api
document-download-api now accepts json content - it was still possible
to send files while we switched over, but we now want to only support
json. This is the only place where we weren't already sending json to
document-download-api.
| Python | mit | alphagov/notifications-functional-tests,alphagov/notifications-functional-tests | python | ## Code Before:
import pytest
import requests
from retry.api import retry_call
from config import config
from tests.pages import DocumentDownloadLandingPage, DocumentDownloadPage
def upload_document(service_id, file_contents):
response = requests.post(
"{}/services/{}/documents".format(config['document_download']['api_host'], service_id),
headers={
'Authorization': "Bearer {}".format(config['document_download']['api_key']),
},
files={
'document': file_contents
}
)
json = response.json()
assert 'error' not in json, 'Status code {}'.format(response.status_code)
return json['document']
@pytest.mark.antivirus
def test_document_upload_and_download(driver):
document = retry_call(
upload_document,
# add PDF header to trick doc download into thinking its a real pdf
fargs=[config['service']['id'], '%PDF-1.4 functional tests file'],
tries=3,
delay=10
)
driver.get(document['url'])
landing_page = DocumentDownloadLandingPage(driver)
assert 'Functional Tests' in landing_page.get_service_name()
landing_page.go_to_download_page()
download_page = DocumentDownloadPage(driver)
document_url = download_page.get_download_link()
downloaded_document = requests.get(document_url)
assert downloaded_document.text == '%PDF-1.4 functional tests file'
## Instruction:
Update how the document download test calls document-download-api
document-download-api now accepts json content - it was still possible
to send files while we switched over, but we now want to only support
json. This is the only place where we weren't already sending json to
document-download-api.
## Code After:
import base64
import pytest
import requests
from retry.api import retry_call
from config import config
from tests.pages import DocumentDownloadLandingPage, DocumentDownloadPage
def upload_document(service_id, file_contents):
response = requests.post(
f"{config['document_download']['api_host']}/services/{service_id}/documents",
headers={
'Authorization': f"Bearer {config['document_download']['api_key']}",
},
json={
'document': base64.b64encode(file_contents).decode('ascii')
}
)
json = response.json()
assert 'error' not in json, 'Status code {}'.format(response.status_code)
return json['document']
@pytest.mark.antivirus
def test_document_upload_and_download(driver):
document = retry_call(
upload_document,
# add PDF header to trick doc download into thinking its a real pdf
fargs=[config['service']['id'], b'%PDF-1.4 functional tests file'],
tries=3,
delay=10
)
driver.get(document['url'])
landing_page = DocumentDownloadLandingPage(driver)
assert 'Functional Tests' in landing_page.get_service_name()
landing_page.go_to_download_page()
download_page = DocumentDownloadPage(driver)
document_url = download_page.get_download_link()
downloaded_document = requests.get(document_url)
assert downloaded_document.text == '%PDF-1.4 functional tests file'
| + import base64
+
import pytest
import requests
from retry.api import retry_call
from config import config
from tests.pages import DocumentDownloadLandingPage, DocumentDownloadPage
def upload_document(service_id, file_contents):
response = requests.post(
- "{}/services/{}/documents".format(config['document_download']['api_host'], service_id),
+ f"{config['document_download']['api_host']}/services/{service_id}/documents",
headers={
- 'Authorization': "Bearer {}".format(config['document_download']['api_key']),
? ---------- ^
+ 'Authorization': f"Bearer {config['document_download']['api_key']}",
? + ^^
},
- files={
? ^^^^
+ json={
? ^ ++
- 'document': file_contents
+ 'document': base64.b64encode(file_contents).decode('ascii')
}
)
json = response.json()
assert 'error' not in json, 'Status code {}'.format(response.status_code)
return json['document']
@pytest.mark.antivirus
def test_document_upload_and_download(driver):
document = retry_call(
upload_document,
# add PDF header to trick doc download into thinking its a real pdf
- fargs=[config['service']['id'], '%PDF-1.4 functional tests file'],
+ fargs=[config['service']['id'], b'%PDF-1.4 functional tests file'],
? +
tries=3,
delay=10
)
driver.get(document['url'])
landing_page = DocumentDownloadLandingPage(driver)
assert 'Functional Tests' in landing_page.get_service_name()
landing_page.go_to_download_page()
download_page = DocumentDownloadPage(driver)
document_url = download_page.get_download_link()
downloaded_document = requests.get(document_url)
assert downloaded_document.text == '%PDF-1.4 functional tests file' | 12 | 0.25 | 7 | 5 |
e3ae701be163ccff7e2f64721752b0374dffdfc1 | rosie/chamber_of_deputies/tests/test_dataset.py | rosie/chamber_of_deputies/tests/test_dataset.py | import os.path
from tempfile import mkdtemp
from unittest import TestCase
from unittest.mock import patch
from shutil import copy2
from rosie.chamber_of_deputies import settings
from rosie.chamber_of_deputies.adapter import Adapter
class TestDataset(TestCase):
def setUp(self):
temp_path = mkdtemp()
copy2('rosie/chamber_of_deputies/tests/fixtures/companies.xz',
os.path.join(temp_path, settings.COMPANIES_DATASET))
copy2('rosie/chamber_of_deputies/tests/fixtures/reimbursements.xz', temp_path)
self.subject = Adapter(temp_path)
@patch('rosie.chamber_of_deputies.adapter.CEAPDataset')
@patch('rosie.chamber_of_deputies.adapter.fetch')
def test_get_performs_a_left_merge_between_reimbursements_and_companies(self, _ceap_dataset, _fetch):
dataset = self.subject.dataset()
self.assertEqual(5, len(dataset))
self.assertEqual(1, dataset['legal_entity'].isnull().sum())
| import shutil
import os
from tempfile import mkdtemp
from unittest import TestCase
from unittest.mock import patch
from shutil import copy2
from rosie.chamber_of_deputies.adapter import Adapter
class TestDataset(TestCase):
def setUp(self):
self.temp_path = mkdtemp()
fixtures = os.path.join('rosie', 'chamber_of_deputies', 'tests', 'fixtures')
copies = (
('companies.xz', Adapter.COMPANIES_DATASET),
('reimbursements.xz', 'reimbursements.xz')
)
for source, target in copies:
copy2(os.path.join(fixtures, source), os.path.join(self.temp_path, target))
self.subject = Adapter(self.temp_path)
def tearDown(self):
shutil.rmtree(self.temp_path)
@patch('rosie.chamber_of_deputies.adapter.CEAPDataset')
@patch('rosie.chamber_of_deputies.adapter.fetch')
def test_get_performs_a_left_merge_between_reimbursements_and_companies(self, fetch, ceap):
self.assertEqual(5, len(self.subject.dataset))
self.assertEqual(1, self.subject.dataset['legal_entity'].isnull().sum())
| Fix companies path in Chamber of Deputies dataset test | Fix companies path in Chamber of Deputies dataset test
| Python | mit | marcusrehm/serenata-de-amor,datasciencebr/rosie,marcusrehm/serenata-de-amor,datasciencebr/serenata-de-amor,datasciencebr/serenata-de-amor,marcusrehm/serenata-de-amor,marcusrehm/serenata-de-amor | python | ## Code Before:
import os.path
from tempfile import mkdtemp
from unittest import TestCase
from unittest.mock import patch
from shutil import copy2
from rosie.chamber_of_deputies import settings
from rosie.chamber_of_deputies.adapter import Adapter
class TestDataset(TestCase):
def setUp(self):
temp_path = mkdtemp()
copy2('rosie/chamber_of_deputies/tests/fixtures/companies.xz',
os.path.join(temp_path, settings.COMPANIES_DATASET))
copy2('rosie/chamber_of_deputies/tests/fixtures/reimbursements.xz', temp_path)
self.subject = Adapter(temp_path)
@patch('rosie.chamber_of_deputies.adapter.CEAPDataset')
@patch('rosie.chamber_of_deputies.adapter.fetch')
def test_get_performs_a_left_merge_between_reimbursements_and_companies(self, _ceap_dataset, _fetch):
dataset = self.subject.dataset()
self.assertEqual(5, len(dataset))
self.assertEqual(1, dataset['legal_entity'].isnull().sum())
## Instruction:
Fix companies path in Chamber of Deputies dataset test
## Code After:
import shutil
import os
from tempfile import mkdtemp
from unittest import TestCase
from unittest.mock import patch
from shutil import copy2
from rosie.chamber_of_deputies.adapter import Adapter
class TestDataset(TestCase):
def setUp(self):
self.temp_path = mkdtemp()
fixtures = os.path.join('rosie', 'chamber_of_deputies', 'tests', 'fixtures')
copies = (
('companies.xz', Adapter.COMPANIES_DATASET),
('reimbursements.xz', 'reimbursements.xz')
)
for source, target in copies:
copy2(os.path.join(fixtures, source), os.path.join(self.temp_path, target))
self.subject = Adapter(self.temp_path)
def tearDown(self):
shutil.rmtree(self.temp_path)
@patch('rosie.chamber_of_deputies.adapter.CEAPDataset')
@patch('rosie.chamber_of_deputies.adapter.fetch')
def test_get_performs_a_left_merge_between_reimbursements_and_companies(self, fetch, ceap):
self.assertEqual(5, len(self.subject.dataset))
self.assertEqual(1, self.subject.dataset['legal_entity'].isnull().sum())
| + import shutil
- import os.path
? -----
+ import os
from tempfile import mkdtemp
from unittest import TestCase
from unittest.mock import patch
from shutil import copy2
- from rosie.chamber_of_deputies import settings
from rosie.chamber_of_deputies.adapter import Adapter
class TestDataset(TestCase):
def setUp(self):
- temp_path = mkdtemp()
+ self.temp_path = mkdtemp()
? +++++
- copy2('rosie/chamber_of_deputies/tests/fixtures/companies.xz',
- os.path.join(temp_path, settings.COMPANIES_DATASET))
- copy2('rosie/chamber_of_deputies/tests/fixtures/reimbursements.xz', temp_path)
+ fixtures = os.path.join('rosie', 'chamber_of_deputies', 'tests', 'fixtures')
+ copies = (
+ ('companies.xz', Adapter.COMPANIES_DATASET),
+ ('reimbursements.xz', 'reimbursements.xz')
+ )
+ for source, target in copies:
+ copy2(os.path.join(fixtures, source), os.path.join(self.temp_path, target))
- self.subject = Adapter(temp_path)
+ self.subject = Adapter(self.temp_path)
? +++++
+
+ def tearDown(self):
+ shutil.rmtree(self.temp_path)
@patch('rosie.chamber_of_deputies.adapter.CEAPDataset')
@patch('rosie.chamber_of_deputies.adapter.fetch')
- def test_get_performs_a_left_merge_between_reimbursements_and_companies(self, _ceap_dataset, _fetch):
? ----------------
+ def test_get_performs_a_left_merge_between_reimbursements_and_companies(self, fetch, ceap):
? ++++++
- dataset = self.subject.dataset()
- self.assertEqual(5, len(dataset))
+ self.assertEqual(5, len(self.subject.dataset))
? +++++++++++++
- self.assertEqual(1, dataset['legal_entity'].isnull().sum())
+ self.assertEqual(1, self.subject.dataset['legal_entity'].isnull().sum())
? +++++++++++++
| 28 | 1.12 | 17 | 11 |
a008141868527e8533fc7aefe225348e39afa5cb | src/drive/web/modules/services/components/Picker/AddFolderButton.jsx | src/drive/web/modules/services/components/Picker/AddFolderButton.jsx | import React from 'react'
import { connect } from 'react-redux'
import { Button } from 'cozy-ui/react'
const AddFolderButton = ({ addFolder }) => (
<Button onClick={addFolder}>Nouveau dossier</Button>
)
const mapDispatchToPropsButton = (dispatch, ownProps) => ({
addFolder: () => dispatch(showNewFolderInput())
})
export default connect(null, mapDispatchToPropsButton)(AddFolderButton)
| import React from 'react'
import { connect } from 'react-redux'
import { Button, ButtonAction, withBreakpoints, Icon } from 'cozy-ui/react'
import IconFolderAdd from 'drive/assets/icons/icon-folder-add.svg'
import { showNewFolderInput } from 'drive/web/modules/filelist/duck'
const AddFolderButton = ({ addFolder, breakpoints: { isMobile } }) => {
if (isMobile)
return (
<ButtonAction
compact
rightIcon={<Icon icon={IconFolderAdd} color="coolGrey" />}
onClick={addFolder}
label={'Nouveau dossier'}
/>
)
else
return (
<Button icon={IconFolderAdd} onClick={addFolder}>
Nouveau dossier
</Button>
)
}
const mapDispatchToPropsButton = (dispatch, ownProps) => ({
addFolder: () => dispatch(showNewFolderInput())
})
export default connect(null, mapDispatchToPropsButton)(
withBreakpoints()(AddFolderButton)
)
| Add folder buton on mobile | fix: Add folder buton on mobile
| JSX | agpl-3.0 | y-lohse/cozy-drive,nono/cozy-files-v3,cozy/cozy-files-v3,y-lohse/cozy-drive,cozy/cozy-files-v3,nono/cozy-files-v3,cozy/cozy-files-v3,y-lohse/cozy-files-v3,y-lohse/cozy-files-v3,y-lohse/cozy-drive,y-lohse/cozy-drive,y-lohse/cozy-files-v3,nono/cozy-files-v3,nono/cozy-files-v3,cozy/cozy-files-v3 | jsx | ## Code Before:
import React from 'react'
import { connect } from 'react-redux'
import { Button } from 'cozy-ui/react'
const AddFolderButton = ({ addFolder }) => (
<Button onClick={addFolder}>Nouveau dossier</Button>
)
const mapDispatchToPropsButton = (dispatch, ownProps) => ({
addFolder: () => dispatch(showNewFolderInput())
})
export default connect(null, mapDispatchToPropsButton)(AddFolderButton)
## Instruction:
fix: Add folder buton on mobile
## Code After:
import React from 'react'
import { connect } from 'react-redux'
import { Button, ButtonAction, withBreakpoints, Icon } from 'cozy-ui/react'
import IconFolderAdd from 'drive/assets/icons/icon-folder-add.svg'
import { showNewFolderInput } from 'drive/web/modules/filelist/duck'
const AddFolderButton = ({ addFolder, breakpoints: { isMobile } }) => {
if (isMobile)
return (
<ButtonAction
compact
rightIcon={<Icon icon={IconFolderAdd} color="coolGrey" />}
onClick={addFolder}
label={'Nouveau dossier'}
/>
)
else
return (
<Button icon={IconFolderAdd} onClick={addFolder}>
Nouveau dossier
</Button>
)
}
const mapDispatchToPropsButton = (dispatch, ownProps) => ({
addFolder: () => dispatch(showNewFolderInput())
})
export default connect(null, mapDispatchToPropsButton)(
withBreakpoints()(AddFolderButton)
)
| import React from 'react'
import { connect } from 'react-redux'
- import { Button } from 'cozy-ui/react'
+ import { Button, ButtonAction, withBreakpoints, Icon } from 'cozy-ui/react'
+ import IconFolderAdd from 'drive/assets/icons/icon-folder-add.svg'
+ import { showNewFolderInput } from 'drive/web/modules/filelist/duck'
- const AddFolderButton = ({ addFolder }) => (
- <Button onClick={addFolder}>Nouveau dossier</Button>
- )
+ const AddFolderButton = ({ addFolder, breakpoints: { isMobile } }) => {
+ if (isMobile)
+ return (
+ <ButtonAction
+ compact
+ rightIcon={<Icon icon={IconFolderAdd} color="coolGrey" />}
+ onClick={addFolder}
+ label={'Nouveau dossier'}
+ />
+ )
+ else
+ return (
+ <Button icon={IconFolderAdd} onClick={addFolder}>
+ Nouveau dossier
+ </Button>
+ )
+ }
const mapDispatchToPropsButton = (dispatch, ownProps) => ({
addFolder: () => dispatch(showNewFolderInput())
})
- export default connect(null, mapDispatchToPropsButton)(AddFolderButton)
? ----------------
+ export default connect(null, mapDispatchToPropsButton)(
+ withBreakpoints()(AddFolderButton)
+ ) | 28 | 2.153846 | 23 | 5 |
cf2b79b9c2dba93f5318017f62bd2c785d90aaee | src/views/bootstrap-3/flash.blade.php | src/views/bootstrap-3/flash.blade.php | @if (Session::has('flash_notification') && !empty(Session::get('flash_notification')))
@if (Session::has('flash_notification.overlay'))
@include('laravel-notifications::bootstrap-3/modal', ['modalClass' => 'flash-modal', 'title' => Lang::get('laravel-notifications::notifications.modal.title'), 'body' => Session::get('flash_notification.message')])
@else
<div class="alert alert-dismissable alert-{{ Session::get('flash_notification.level') }}">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4>{{ Session::get('flash_notification.message') }}</h4>
</div>
@endif
@endif
| <?php
/** control the error summary */
$showErrorSummary = false;
$sources = array('success', 'errors', 'error', 'warning', 'info', 'notice');
foreach ($sources as $source)
$messageSources[$source] = Session::get($source, []);
$mapSourceToClass = array(
'success' => 'success',
'errors' => 'danger',
'error' => 'danger',
'warning' => 'warning',
'info' => 'info',
'notice' => 'notice',
);
?>
@if (isset($errors) && $errors->any() && $showErrorSummary)
@include('laravel-notifications::bootstrap-3/message', ['message' => 'Error occured', 'level' => 'danger', 'body' => 'Your last request got an error.'])
@endif
@foreach ($messageSources as $source => $messages)
@if (is_array($messages))
@foreach ($messages as $message)
@include('laravel-notifications::bootstrap-3/message', ['message' => $message, 'level' => $mapSourceToClass[$source]])
@endforeach
@else
@include('laravel-notifications::bootstrap-3/message', ['message' => $messages, 'level' => $mapSourceToClass[$source]])
@endif
@endforeach
@if (Session::has('flash_notification') && !empty(Session::get('flash_notification')))
@if (Session::has('flash_notification.overlay'))
@include('laravel-notifications::bootstrap-3/modal', ['modalClass' => 'flash-modal', 'title' => Lang::get('laravel-notifications::notifications.modal.title'), 'body' => Session::get('flash_notification.message')])
@else
@include('laravel-notifications::bootstrap-3/message', ['message' => Session::get('flash_notification.message'), 'level' => Session::get('flash_notification.level')])
@endif
@endif
| Support all message sources known at laravel docs | Support all message sources known at laravel docs | PHP | mit | ipunkt/laravel-notifications | php | ## Code Before:
@if (Session::has('flash_notification') && !empty(Session::get('flash_notification')))
@if (Session::has('flash_notification.overlay'))
@include('laravel-notifications::bootstrap-3/modal', ['modalClass' => 'flash-modal', 'title' => Lang::get('laravel-notifications::notifications.modal.title'), 'body' => Session::get('flash_notification.message')])
@else
<div class="alert alert-dismissable alert-{{ Session::get('flash_notification.level') }}">
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
<h4>{{ Session::get('flash_notification.message') }}</h4>
</div>
@endif
@endif
## Instruction:
Support all message sources known at laravel docs
## Code After:
<?php
/** control the error summary */
$showErrorSummary = false;
$sources = array('success', 'errors', 'error', 'warning', 'info', 'notice');
foreach ($sources as $source)
$messageSources[$source] = Session::get($source, []);
$mapSourceToClass = array(
'success' => 'success',
'errors' => 'danger',
'error' => 'danger',
'warning' => 'warning',
'info' => 'info',
'notice' => 'notice',
);
?>
@if (isset($errors) && $errors->any() && $showErrorSummary)
@include('laravel-notifications::bootstrap-3/message', ['message' => 'Error occured', 'level' => 'danger', 'body' => 'Your last request got an error.'])
@endif
@foreach ($messageSources as $source => $messages)
@if (is_array($messages))
@foreach ($messages as $message)
@include('laravel-notifications::bootstrap-3/message', ['message' => $message, 'level' => $mapSourceToClass[$source]])
@endforeach
@else
@include('laravel-notifications::bootstrap-3/message', ['message' => $messages, 'level' => $mapSourceToClass[$source]])
@endif
@endforeach
@if (Session::has('flash_notification') && !empty(Session::get('flash_notification')))
@if (Session::has('flash_notification.overlay'))
@include('laravel-notifications::bootstrap-3/modal', ['modalClass' => 'flash-modal', 'title' => Lang::get('laravel-notifications::notifications.modal.title'), 'body' => Session::get('flash_notification.message')])
@else
@include('laravel-notifications::bootstrap-3/message', ['message' => Session::get('flash_notification.message'), 'level' => Session::get('flash_notification.level')])
@endif
@endif
| + <?php
+ /** control the error summary */
+ $showErrorSummary = false;
+
+
+ $sources = array('success', 'errors', 'error', 'warning', 'info', 'notice');
+ foreach ($sources as $source)
+ $messageSources[$source] = Session::get($source, []);
+
+ $mapSourceToClass = array(
+ 'success' => 'success',
+ 'errors' => 'danger',
+ 'error' => 'danger',
+ 'warning' => 'warning',
+ 'info' => 'info',
+ 'notice' => 'notice',
+ );
+
+ ?>
+ @if (isset($errors) && $errors->any() && $showErrorSummary)
+ @include('laravel-notifications::bootstrap-3/message', ['message' => 'Error occured', 'level' => 'danger', 'body' => 'Your last request got an error.'])
+ @endif
+
+ @foreach ($messageSources as $source => $messages)
+ @if (is_array($messages))
+ @foreach ($messages as $message)
+ @include('laravel-notifications::bootstrap-3/message', ['message' => $message, 'level' => $mapSourceToClass[$source]])
+ @endforeach
+ @else
+ @include('laravel-notifications::bootstrap-3/message', ['message' => $messages, 'level' => $mapSourceToClass[$source]])
+ @endif
+ @endforeach
+
@if (Session::has('flash_notification') && !empty(Session::get('flash_notification')))
@if (Session::has('flash_notification.overlay'))
@include('laravel-notifications::bootstrap-3/modal', ['modalClass' => 'flash-modal', 'title' => Lang::get('laravel-notifications::notifications.modal.title'), 'body' => Session::get('flash_notification.message')])
@else
+ @include('laravel-notifications::bootstrap-3/message', ['message' => Session::get('flash_notification.message'), 'level' => Session::get('flash_notification.level')])
- <div class="alert alert-dismissable alert-{{ Session::get('flash_notification.level') }}">
- <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
- <h4>{{ Session::get('flash_notification.message') }}</h4>
- </div>
@endif
@endif | 38 | 3.8 | 34 | 4 |
30bcbd8b58e4879ce236c874c8b1c97e0fe811aa | admin/spark-standalone.sh | admin/spark-standalone.sh |
set -e
PACKAGES_DIR=`dirname $0`/../packages
echo 'Meteor = {};'
cat $PACKAGES_DIR/uuid/uuid.js
cat $PACKAGES_DIR/deps/deps.js
cat $PACKAGES_DIR/deps/deps-utils.js
cat $PACKAGES_DIR/liverange/liverange.js
cat $PACKAGES_DIR/universal-events/listener.js
cat $PACKAGES_DIR/universal-events/events-ie.js
cat $PACKAGES_DIR/universal-events/events-w3c.js
cat $PACKAGES_DIR/domutils/domutils.js
cat $PACKAGES_DIR/spark/spark.js
cat $PACKAGES_DIR/spark/patch.js
|
set -e
PACKAGES_DIR=`dirname $0`/../packages
echo 'Meteor = {};'
cat $PACKAGES_DIR/underscore/underscore.js
cat $PACKAGES_DIR/uuid/uuid.js
cat $PACKAGES_DIR/deps/deps.js
cat $PACKAGES_DIR/deps/deps-utils.js
cat $PACKAGES_DIR/liverange/liverange.js
cat $PACKAGES_DIR/universal-events/listener.js
cat $PACKAGES_DIR/universal-events/events-ie.js
cat $PACKAGES_DIR/universal-events/events-w3c.js
cat $PACKAGES_DIR/domutils/domutils.js
cat $PACKAGES_DIR/spark/spark.js
cat $PACKAGES_DIR/spark/patch.js
| Add underscore as dependency for Spark | Add underscore as dependency for Spark
Fixes #587
| Shell | mit | rozzzly/meteor,pjump/meteor,aleclarson/meteor,TribeMedia/meteor,codingang/meteor,chmac/meteor,somallg/meteor,Ken-Liu/meteor,udhayam/meteor,pandeysoni/meteor,whip112/meteor,namho102/meteor,DCKT/meteor,imanmafi/meteor,jirengu/meteor,ashwathgovind/meteor,baysao/meteor,servel333/meteor,EduShareOntario/meteor,joannekoong/meteor,chasertech/meteor,h200863057/meteor,steedos/meteor,pjump/meteor,jirengu/meteor,skarekrow/meteor,lassombra/meteor,ndarilek/meteor,allanalexandre/meteor,yyx990803/meteor,dandv/meteor,Quicksteve/meteor,DAB0mB/meteor,yiliaofan/meteor,SeanOceanHu/meteor,evilemon/meteor,yonglehou/meteor,yinhe007/meteor,neotim/meteor,vacjaliu/meteor,jeblister/meteor,Jonekee/meteor,sunny-g/meteor,youprofit/meteor,somallg/meteor,lorensr/meteor,benstoltz/meteor,shmiko/meteor,iman-mafi/meteor,steedos/meteor,Paulyoufu/meteor-1,katopz/meteor,Profab/meteor,SeanOceanHu/meteor,lpinto93/meteor,yyx990803/meteor,ndarilek/meteor,dandv/meteor,yinhe007/meteor,D1no/meteor,TechplexEngineer/meteor,johnthepink/meteor,iman-mafi/meteor,AnjirHossain/meteor,mubassirhayat/meteor,Profab/meteor,jg3526/meteor,somallg/meteor,alexbeletsky/meteor,colinligertwood/meteor,guazipi/meteor,hristaki/meteor,Hansoft/meteor,katopz/meteor,planet-training/meteor,yiliaofan/meteor,alexbeletsky/meteor,aldeed/meteor,Prithvi-A/meteor,kidaa/meteor,mirstan/meteor,mirstan/meteor,kencheung/meteor,evilemon/meteor,esteedqueen/meteor,Hansoft/meteor,Paulyoufu/meteor-1,DCKT/meteor,juansgaitan/meteor,jg3526/meteor,kencheung/meteor,jagi/meteor,AnthonyAstige/meteor,yonglehou/meteor,qscripter/meteor,shmiko/meteor,meonkeys/meteor,baiyunping333/meteor,whip112/meteor,Ken-Liu/meteor,msavin/meteor,judsonbsilva/meteor,IveWong/meteor,lorensr/meteor,mubassirhayat/meteor,steedos/meteor,saisai/meteor,pandeysoni/meteor,msavin/meteor,qscripter/meteor,dev-bobsong/meteor,jirengu/meteor,chengxiaole/meteor,chengxiaole/meteor,papimomi/meteor,framewr/meteor,nuvipannu/meteor,judsonbsilva/meteor,4commerce-technologies-AG/meteor,jrudio/meteor,IveWong/meteor,paul-barry-kenzan/meteor,judsonbsilva/meteor,cog-64/meteor,skarekrow/meteor,HugoRLopes/meteor,chengxiaole/meteor,benstoltz/meteor,framewr/meteor,Eynaliyev/meteor,joannekoong/meteor,mjmasn/meteor,brdtrpp/meteor,guazipi/meteor,shmiko/meteor,vacjaliu/meteor,newswim/meteor,benjamn/meteor,ljack/meteor,calvintychan/meteor,planet-training/meteor,shrop/meteor,meonkeys/meteor,devgrok/meteor,ljack/meteor,allanalexandre/meteor,sitexa/meteor,colinligertwood/meteor,elkingtonmcb/meteor,skarekrow/meteor,framewr/meteor,l0rd0fwar/meteor,cherbst/meteor,PatrickMcGuinness/meteor,Prithvi-A/meteor,sclausen/meteor,nuvipannu/meteor,JesseQin/meteor,whip112/meteor,jeblister/meteor,HugoRLopes/meteor,namho102/meteor,IveWong/meteor,mauricionr/meteor,mubassirhayat/meteor,kengchau/meteor,modulexcite/meteor,yonas/meteor-freebsd,mirstan/meteor,chinasb/meteor,yinhe007/meteor,h200863057/meteor,iman-mafi/meteor,wmkcc/meteor,codingang/meteor,jeblister/meteor,namho102/meteor,Prithvi-A/meteor,sunny-g/meteor,AnjirHossain/meteor,lawrenceAIO/meteor,lawrenceAIO/meteor,johnthepink/meteor,dboyliao/meteor,SeanOceanHu/meteor,Profab/meteor,juansgaitan/meteor,colinligertwood/meteor,papimomi/meteor,dfischer/meteor,udhayam/meteor,juansgaitan/meteor,D1no/meteor,dfischer/meteor,planet-training/meteor,johnthepink/meteor,jenalgit/meteor,mubassirhayat/meteor,codedogfish/meteor,codingang/meteor,servel333/meteor,zdd910/meteor,karlito40/meteor,PatrickMcGuinness/meteor,eluck/meteor,papimomi/meteor,arunoda/meteor,meteor-velocity/meteor,jg3526/meteor,vjau/meteor,AlexR1712/meteor,michielvanoeffelen/meteor,jenalgit/meteor,dboyliao/meteor,benjamn/meteor,Urigo/meteor,whip112/meteor,h200863057/meteor,AnjirHossain/meteor,somallg/meteor,wmkcc/meteor,sunny-g/meteor,4commerce-technologies-AG/meteor,daslicht/meteor,dboyliao/meteor,namho102/meteor,jg3526/meteor,yonas/meteor-freebsd,rabbyalone/meteor,mjmasn/meteor,lieuwex/meteor,jrudio/meteor,kencheung/meteor,whip112/meteor,sdeveloper/meteor,kencheung/meteor,codedogfish/meteor,meonkeys/meteor,chiefninew/meteor,mubassirhayat/meteor,benstoltz/meteor,hristaki/meteor,Paulyoufu/meteor-1,allanalexandre/meteor,lawrenceAIO/meteor,lassombra/meteor,alphanso/meteor,HugoRLopes/meteor,brettle/meteor,yalexx/meteor,williambr/meteor,eluck/meteor,meteor-velocity/meteor,dfischer/meteor,h200863057/meteor,AnthonyAstige/meteor,benjamn/meteor,4commerce-technologies-AG/meteor,JesseQin/meteor,lassombra/meteor,evilemon/meteor,dandv/meteor,pandeysoni/meteor,DAB0mB/meteor,luohuazju/meteor,imanmafi/meteor,juansgaitan/meteor,dev-bobsong/meteor,queso/meteor,aramk/meteor,Urigo/meteor,D1no/meteor,elkingtonmcb/meteor,yanisIk/meteor,dev-bobsong/meteor,PatrickMcGuinness/meteor,sitexa/meteor,TechplexEngineer/meteor,nuvipannu/meteor,chinasb/meteor,jdivy/meteor,juansgaitan/meteor,cbonami/meteor,sclausen/meteor,devgrok/meteor,planet-training/meteor,jenalgit/meteor,jrudio/meteor,brettle/meteor,codingang/meteor,jeblister/meteor,baiyunping333/meteor,modulexcite/meteor,dfischer/meteor,emmerge/meteor,benstoltz/meteor,fashionsun/meteor,lawrenceAIO/meteor,pjump/meteor,D1no/meteor,Profab/meteor,zdd910/meteor,katopz/meteor,shrop/meteor,yanisIk/meteor,LWHTarena/meteor,SeanOceanHu/meteor,williambr/meteor,chinasb/meteor,JesseQin/meteor,sdeveloper/meteor,baiyunping333/meteor,henrypan/meteor,shadedprofit/meteor,iman-mafi/meteor,brettle/meteor,Eynaliyev/meteor,pandeysoni/meteor,jirengu/meteor,jdivy/meteor,jagi/meteor,brettle/meteor,oceanzou123/meteor,sitexa/meteor,chinasb/meteor,devgrok/meteor,justintung/meteor,sdeveloper/meteor,AnthonyAstige/meteor,mjmasn/meteor,sitexa/meteor,daslicht/meteor,stevenliuit/meteor,jirengu/meteor,EduShareOntario/meteor,neotim/meteor,nuvipannu/meteor,HugoRLopes/meteor,Puena/meteor,bhargav175/meteor,saisai/meteor,Puena/meteor,daltonrenaldo/meteor,chengxiaole/meteor,michielvanoeffelen/meteor,vacjaliu/meteor,ericterpstra/meteor,brdtrpp/meteor,oceanzou123/meteor,mjmasn/meteor,chiefninew/meteor,TechplexEngineer/meteor,Jeremy017/meteor,chiefninew/meteor,jirengu/meteor,mirstan/meteor,SeanOceanHu/meteor,paul-barry-kenzan/meteor,stevenliuit/meteor,codedogfish/meteor,ndarilek/meteor,eluck/meteor,Paulyoufu/meteor-1,Theviajerock/meteor,EduShareOntario/meteor,imanmafi/meteor,ericterpstra/meteor,luohuazju/meteor,shmiko/meteor,henrypan/meteor,mubassirhayat/meteor,papimomi/meteor,aramk/meteor,Eynaliyev/meteor,katopz/meteor,sunny-g/meteor,baysao/meteor,alphanso/meteor,baiyunping333/meteor,esteedqueen/meteor,modulexcite/meteor,judsonbsilva/meteor,hristaki/meteor,henrypan/meteor,juansgaitan/meteor,l0rd0fwar/meteor,lieuwex/meteor,fashionsun/meteor,tdamsma/meteor,elkingtonmcb/meteor,udhayam/meteor,Jonekee/meteor,brettle/meteor,sitexa/meteor,aldeed/meteor,Theviajerock/meteor,arunoda/meteor,LWHTarena/meteor,newswim/meteor,evilemon/meteor,cbonami/meteor,benstoltz/meteor,youprofit/meteor,codedogfish/meteor,saisai/meteor,shrop/meteor,karlito40/meteor,joannekoong/meteor,akintoey/meteor,4commerce-technologies-AG/meteor,DCKT/meteor,tdamsma/meteor,somallg/meteor,ndarilek/meteor,AlexR1712/meteor,henrypan/meteor,jdivy/meteor,h200863057/meteor,ljack/meteor,steedos/meteor,shadedprofit/meteor,rozzzly/meteor,luohuazju/meteor,karlito40/meteor,aramk/meteor,rozzzly/meteor,whip112/meteor,PatrickMcGuinness/meteor,meteor-velocity/meteor,chengxiaole/meteor,newswim/meteor,tdamsma/meteor,Quicksteve/meteor,meteor-velocity/meteor,williambr/meteor,chinasb/meteor,rabbyalone/meteor,lorensr/meteor,michielvanoeffelen/meteor,wmkcc/meteor,kengchau/meteor,deanius/meteor,LWHTarena/meteor,skarekrow/meteor,saisai/meteor,Jonekee/meteor,dboyliao/meteor,hristaki/meteor,Ken-Liu/meteor,henrypan/meteor,papimomi/meteor,LWHTarena/meteor,shrop/meteor,rabbyalone/meteor,codedogfish/meteor,sdeveloper/meteor,daltonrenaldo/meteor,lorensr/meteor,dev-bobsong/meteor,AlexR1712/meteor,calvintychan/meteor,lassombra/meteor,esteedqueen/meteor,arunoda/meteor,GrimDerp/meteor,bhargav175/meteor,oceanzou123/meteor,chmac/meteor,AnthonyAstige/meteor,hristaki/meteor,AlexR1712/meteor,nuvipannu/meteor,daslicht/meteor,zdd910/meteor,Theviajerock/meteor,TechplexEngineer/meteor,jg3526/meteor,GrimDerp/meteor,saisai/meteor,cog-64/meteor,sdeveloper/meteor,benjamn/meteor,TechplexEngineer/meteor,D1no/meteor,daltonrenaldo/meteor,arunoda/meteor,allanalexandre/meteor,yinhe007/meteor,jagi/meteor,Hansoft/meteor,bhargav175/meteor,stevenliuit/meteor,DAB0mB/meteor,Hansoft/meteor,TribeMedia/meteor,Jeremy017/meteor,cog-64/meteor,papimomi/meteor,Prithvi-A/meteor,TechplexEngineer/meteor,aleclarson/meteor,ericterpstra/meteor,fashionsun/meteor,lpinto93/meteor,brettle/meteor,skarekrow/meteor,chasertech/meteor,michielvanoeffelen/meteor,ashwathgovind/meteor,meteor-velocity/meteor,alexbeletsky/meteor,bhargav175/meteor,sclausen/meteor,Profab/meteor,fashionsun/meteor,Urigo/meteor,kencheung/meteor,aldeed/meteor,chiefninew/meteor,deanius/meteor,jagi/meteor,Paulyoufu/meteor-1,evilemon/meteor,queso/meteor,skarekrow/meteor,chengxiaole/meteor,whip112/meteor,shadedprofit/meteor,Hansoft/meteor,planet-training/meteor,meteor-velocity/meteor,bhargav175/meteor,katopz/meteor,dboyliao/meteor,sunny-g/meteor,alphanso/meteor,DAB0mB/meteor,karlito40/meteor,yyx990803/meteor,Ken-Liu/meteor,shmiko/meteor,rabbyalone/meteor,alexbeletsky/meteor,imanmafi/meteor,vjau/meteor,udhayam/meteor,emmerge/meteor,Eynaliyev/meteor,jenalgit/meteor,LWHTarena/meteor,joannekoong/meteor,colinligertwood/meteor,luohuazju/meteor,baysao/meteor,shrop/meteor,chiefninew/meteor,aramk/meteor,tdamsma/meteor,imanmafi/meteor,LWHTarena/meteor,Prithvi-A/meteor,colinligertwood/meteor,baysao/meteor,yalexx/meteor,vjau/meteor,iman-mafi/meteor,yiliaofan/meteor,akintoey/meteor,justintung/meteor,luohuazju/meteor,nuvipannu/meteor,GrimDerp/meteor,vjau/meteor,yonglehou/meteor,jg3526/meteor,yalexx/meteor,elkingtonmcb/meteor,cog-64/meteor,Quicksteve/meteor,jeblister/meteor,esteedqueen/meteor,pjump/meteor,yonglehou/meteor,queso/meteor,allanalexandre/meteor,lpinto93/meteor,Theviajerock/meteor,JesseQin/meteor,somallg/meteor,rabbyalone/meteor,sunny-g/meteor,youprofit/meteor,yalexx/meteor,mauricionr/meteor,Quicksteve/meteor,youprofit/meteor,framewr/meteor,AnjirHossain/meteor,aldeed/meteor,stevenliuit/meteor,ndarilek/meteor,aldeed/meteor,deanius/meteor,DCKT/meteor,zdd910/meteor,PatrickMcGuinness/meteor,emmerge/meteor,planet-training/meteor,eluck/meteor,Eynaliyev/meteor,brdtrpp/meteor,johnthepink/meteor,lieuwex/meteor,lpinto93/meteor,meteor-velocity/meteor,henrypan/meteor,mjmasn/meteor,paul-barry-kenzan/meteor,AlexR1712/meteor,servel333/meteor,yiliaofan/meteor,AnjirHossain/meteor,mauricionr/meteor,namho102/meteor,servel333/meteor,yiliaofan/meteor,lieuwex/meteor,arunoda/meteor,jg3526/meteor,sclausen/meteor,queso/meteor,Urigo/meteor,ndarilek/meteor,shrop/meteor,EduShareOntario/meteor,4commerce-technologies-AG/meteor,Profab/meteor,ljack/meteor,sdeveloper/meteor,emmerge/meteor,brdtrpp/meteor,calvintychan/meteor,servel333/meteor,kidaa/meteor,Jeremy017/meteor,Jeremy017/meteor,Eynaliyev/meteor,yonglehou/meteor,servel333/meteor,deanius/meteor,yalexx/meteor,udhayam/meteor,baiyunping333/meteor,D1no/meteor,tdamsma/meteor,Jeremy017/meteor,yonas/meteor-freebsd,vacjaliu/meteor,karlito40/meteor,michielvanoeffelen/meteor,kengchau/meteor,mauricionr/meteor,cherbst/meteor,lassombra/meteor,lawrenceAIO/meteor,cog-64/meteor,yonas/meteor-freebsd,IveWong/meteor,chasertech/meteor,cbonami/meteor,lassombra/meteor,dfischer/meteor,fashionsun/meteor,chmac/meteor,johnthepink/meteor,steedos/meteor,chmac/meteor,ndarilek/meteor,alphanso/meteor,AnjirHossain/meteor,joannekoong/meteor,aldeed/meteor,neotim/meteor,kengchau/meteor,evilemon/meteor,emmerge/meteor,AnthonyAstige/meteor,ndarilek/meteor,luohuazju/meteor,cog-64/meteor,wmkcc/meteor,steedos/meteor,emmerge/meteor,judsonbsilva/meteor,alphanso/meteor,zdd910/meteor,yonas/meteor-freebsd,alexbeletsky/meteor,ashwathgovind/meteor,somallg/meteor,youprofit/meteor,justintung/meteor,DCKT/meteor,ericterpstra/meteor,jdivy/meteor,chiefninew/meteor,justintung/meteor,chasertech/meteor,lpinto93/meteor,brdtrpp/meteor,saisai/meteor,yonglehou/meteor,dandv/meteor,elkingtonmcb/meteor,pjump/meteor,allanalexandre/meteor,daslicht/meteor,qscripter/meteor,aramk/meteor,TribeMedia/meteor,Urigo/meteor,queso/meteor,chmac/meteor,Puena/meteor,4commerce-technologies-AG/meteor,shmiko/meteor,planet-training/meteor,justintung/meteor,daltonrenaldo/meteor,jirengu/meteor,chasertech/meteor,D1no/meteor,Jonekee/meteor,yanisIk/meteor,nuvipannu/meteor,wmkcc/meteor,yalexx/meteor,newswim/meteor,meonkeys/meteor,rozzzly/meteor,benstoltz/meteor,sclausen/meteor,rozzzly/meteor,jrudio/meteor,yiliaofan/meteor,shrop/meteor,mauricionr/meteor,paul-barry-kenzan/meteor,pandeysoni/meteor,lorensr/meteor,Theviajerock/meteor,devgrok/meteor,calvintychan/meteor,sitexa/meteor,akintoey/meteor,dboyliao/meteor,allanalexandre/meteor,karlito40/meteor,judsonbsilva/meteor,devgrok/meteor,paul-barry-kenzan/meteor,fashionsun/meteor,dev-bobsong/meteor,iman-mafi/meteor,daltonrenaldo/meteor,chinasb/meteor,oceanzou123/meteor,chmac/meteor,williambr/meteor,mjmasn/meteor,chmac/meteor,alexbeletsky/meteor,stevenliuit/meteor,cherbst/meteor,devgrok/meteor,yyx990803/meteor,kencheung/meteor,jeblister/meteor,papimomi/meteor,namho102/meteor,Theviajerock/meteor,shmiko/meteor,joannekoong/meteor,cherbst/meteor,AnthonyAstige/meteor,meonkeys/meteor,ashwathgovind/meteor,jenalgit/meteor,eluck/meteor,williambr/meteor,queso/meteor,DAB0mB/meteor,jenalgit/meteor,l0rd0fwar/meteor,stevenliuit/meteor,deanius/meteor,TribeMedia/meteor,kidaa/meteor,SeanOceanHu/meteor,neotim/meteor,AlexR1712/meteor,Eynaliyev/meteor,DCKT/meteor,GrimDerp/meteor,GrimDerp/meteor,lieuwex/meteor,daslicht/meteor,Ken-Liu/meteor,yanisIk/meteor,somallg/meteor,IveWong/meteor,modulexcite/meteor,evilemon/meteor,Puena/meteor,vjau/meteor,akintoey/meteor,sclausen/meteor,chinasb/meteor,msavin/meteor,allanalexandre/meteor,williambr/meteor,DAB0mB/meteor,lorensr/meteor,mjmasn/meteor,kidaa/meteor,juansgaitan/meteor,lieuwex/meteor,stevenliuit/meteor,michielvanoeffelen/meteor,baiyunping333/meteor,HugoRLopes/meteor,chiefninew/meteor,williambr/meteor,emmerge/meteor,Paulyoufu/meteor-1,henrypan/meteor,daltonrenaldo/meteor,chengxiaole/meteor,Quicksteve/meteor,johnthepink/meteor,Quicksteve/meteor,meonkeys/meteor,msavin/meteor,yanisIk/meteor,qscripter/meteor,lieuwex/meteor,neotim/meteor,guazipi/meteor,cbonami/meteor,sdeveloper/meteor,codedogfish/meteor,oceanzou123/meteor,yyx990803/meteor,daslicht/meteor,DCKT/meteor,zdd910/meteor,guazipi/meteor,ljack/meteor,imanmafi/meteor,elkingtonmcb/meteor,4commerce-technologies-AG/meteor,rabbyalone/meteor,queso/meteor,steedos/meteor,newswim/meteor,Prithvi-A/meteor,planet-training/meteor,Eynaliyev/meteor,sunny-g/meteor,Quicksteve/meteor,servel333/meteor,mubassirhayat/meteor,guazipi/meteor,lorensr/meteor,daslicht/meteor,dboyliao/meteor,Urigo/meteor,brdtrpp/meteor,AnjirHossain/meteor,JesseQin/meteor,modulexcite/meteor,vjau/meteor,l0rd0fwar/meteor,ljack/meteor,yanisIk/meteor,ashwathgovind/meteor,judsonbsilva/meteor,shadedprofit/meteor,zdd910/meteor,IveWong/meteor,lassombra/meteor,DAB0mB/meteor,modulexcite/meteor,l0rd0fwar/meteor,ericterpstra/meteor,cherbst/meteor,aramk/meteor,mirstan/meteor,lpinto93/meteor,shadedprofit/meteor,codingang/meteor,EduShareOntario/meteor,daltonrenaldo/meteor,kencheung/meteor,esteedqueen/meteor,akintoey/meteor,jdivy/meteor,katopz/meteor,eluck/meteor,johnthepink/meteor,paul-barry-kenzan/meteor,codedogfish/meteor,daltonrenaldo/meteor,yonglehou/meteor,vjau/meteor,skarekrow/meteor,Jeremy017/meteor,msavin/meteor,vacjaliu/meteor,yonas/meteor-freebsd,chasertech/meteor,vacjaliu/meteor,Ken-Liu/meteor,wmkcc/meteor,yonas/meteor-freebsd,h200863057/meteor,h200863057/meteor,l0rd0fwar/meteor,pandeysoni/meteor,chiefninew/meteor,akintoey/meteor,lawrenceAIO/meteor,JesseQin/meteor,arunoda/meteor,cbonami/meteor,codingang/meteor,cherbst/meteor,EduShareOntario/meteor,baysao/meteor,qscripter/meteor,Puena/meteor,PatrickMcGuinness/meteor,dev-bobsong/meteor,qscripter/meteor,yanisIk/meteor,brdtrpp/meteor,yinhe007/meteor,l0rd0fwar/meteor,framewr/meteor,calvintychan/meteor,arunoda/meteor,Profab/meteor,HugoRLopes/meteor,modulexcite/meteor,karlito40/meteor,sitexa/meteor,jagi/meteor,oceanzou123/meteor,sclausen/meteor,rozzzly/meteor,msavin/meteor,Jonekee/meteor,shadedprofit/meteor,luohuazju/meteor,rozzzly/meteor,GrimDerp/meteor,kidaa/meteor,brettle/meteor,fashionsun/meteor,framewr/meteor,dev-bobsong/meteor,jdivy/meteor,AnthonyAstige/meteor,Paulyoufu/meteor-1,D1no/meteor,paul-barry-kenzan/meteor,yalexx/meteor,dboyliao/meteor,benstoltz/meteor,AnthonyAstige/meteor,elkingtonmcb/meteor,Hansoft/meteor,baiyunping333/meteor,benjamn/meteor,devgrok/meteor,aleclarson/meteor,kengchau/meteor,bhargav175/meteor,Jonekee/meteor,benjamn/meteor,yinhe007/meteor,michielvanoeffelen/meteor,Jeremy017/meteor,SeanOceanHu/meteor,sunny-g/meteor,colinligertwood/meteor,justintung/meteor,calvintychan/meteor,udhayam/meteor,jeblister/meteor,AlexR1712/meteor,tdamsma/meteor,chasertech/meteor,Hansoft/meteor,alexbeletsky/meteor,alphanso/meteor,IveWong/meteor,newswim/meteor,kengchau/meteor,Puena/meteor,pjump/meteor,akintoey/meteor,LWHTarena/meteor,dfischer/meteor,PatrickMcGuinness/meteor,codingang/meteor,deanius/meteor,bhargav175/meteor,pandeysoni/meteor,udhayam/meteor,mauricionr/meteor,tdamsma/meteor,yiliaofan/meteor,guazipi/meteor,meonkeys/meteor,TribeMedia/meteor,youprofit/meteor,jagi/meteor,SeanOceanHu/meteor,jagi/meteor,qscripter/meteor,GrimDerp/meteor,esteedqueen/meteor,msavin/meteor,cherbst/meteor,baysao/meteor,Ken-Liu/meteor,kidaa/meteor,pjump/meteor,jdivy/meteor,brdtrpp/meteor,Puena/meteor,ljack/meteor,alexbeletsky/meteor,Prithvi-A/meteor,TribeMedia/meteor,vacjaliu/meteor,justintung/meteor,guazipi/meteor,youprofit/meteor,saisai/meteor,rabbyalone/meteor,Theviajerock/meteor,Urigo/meteor,ericterpstra/meteor,dandv/meteor,jrudio/meteor,aramk/meteor,oceanzou123/meteor,hristaki/meteor,calvintychan/meteor,kidaa/meteor,dandv/meteor,neotim/meteor,imanmafi/meteor,lpinto93/meteor,cog-64/meteor,yyx990803/meteor,ashwathgovind/meteor,newswim/meteor,deanius/meteor,iman-mafi/meteor,TechplexEngineer/meteor,yinhe007/meteor,esteedqueen/meteor,karlito40/meteor,benjamn/meteor,jrudio/meteor,EduShareOntario/meteor,HugoRLopes/meteor,lawrenceAIO/meteor,yanisIk/meteor,neotim/meteor,ljack/meteor,joannekoong/meteor,kengchau/meteor,dfischer/meteor,shadedprofit/meteor,mirstan/meteor,yyx990803/meteor,aldeed/meteor,mauricionr/meteor,eluck/meteor,Jonekee/meteor,cbonami/meteor,katopz/meteor,servel333/meteor,mirstan/meteor,ashwathgovind/meteor,dandv/meteor,cbonami/meteor,namho102/meteor,jenalgit/meteor,eluck/meteor,baysao/meteor,colinligertwood/meteor,TribeMedia/meteor,ericterpstra/meteor,mubassirhayat/meteor,hristaki/meteor,wmkcc/meteor,HugoRLopes/meteor,tdamsma/meteor,JesseQin/meteor,framewr/meteor,alphanso/meteor | shell | ## Code Before:
set -e
PACKAGES_DIR=`dirname $0`/../packages
echo 'Meteor = {};'
cat $PACKAGES_DIR/uuid/uuid.js
cat $PACKAGES_DIR/deps/deps.js
cat $PACKAGES_DIR/deps/deps-utils.js
cat $PACKAGES_DIR/liverange/liverange.js
cat $PACKAGES_DIR/universal-events/listener.js
cat $PACKAGES_DIR/universal-events/events-ie.js
cat $PACKAGES_DIR/universal-events/events-w3c.js
cat $PACKAGES_DIR/domutils/domutils.js
cat $PACKAGES_DIR/spark/spark.js
cat $PACKAGES_DIR/spark/patch.js
## Instruction:
Add underscore as dependency for Spark
Fixes #587
## Code After:
set -e
PACKAGES_DIR=`dirname $0`/../packages
echo 'Meteor = {};'
cat $PACKAGES_DIR/underscore/underscore.js
cat $PACKAGES_DIR/uuid/uuid.js
cat $PACKAGES_DIR/deps/deps.js
cat $PACKAGES_DIR/deps/deps-utils.js
cat $PACKAGES_DIR/liverange/liverange.js
cat $PACKAGES_DIR/universal-events/listener.js
cat $PACKAGES_DIR/universal-events/events-ie.js
cat $PACKAGES_DIR/universal-events/events-w3c.js
cat $PACKAGES_DIR/domutils/domutils.js
cat $PACKAGES_DIR/spark/spark.js
cat $PACKAGES_DIR/spark/patch.js
|
set -e
PACKAGES_DIR=`dirname $0`/../packages
echo 'Meteor = {};'
+ cat $PACKAGES_DIR/underscore/underscore.js
cat $PACKAGES_DIR/uuid/uuid.js
cat $PACKAGES_DIR/deps/deps.js
cat $PACKAGES_DIR/deps/deps-utils.js
cat $PACKAGES_DIR/liverange/liverange.js
cat $PACKAGES_DIR/universal-events/listener.js
cat $PACKAGES_DIR/universal-events/events-ie.js
cat $PACKAGES_DIR/universal-events/events-w3c.js
cat $PACKAGES_DIR/domutils/domutils.js
cat $PACKAGES_DIR/spark/spark.js
cat $PACKAGES_DIR/spark/patch.js
-
- | 3 | 0.166667 | 1 | 2 |
67f44b178bf117a252594535468ed1f42ab434c1 | test/Parser/cxx-using-declaration.cpp | test/Parser/cxx-using-declaration.cpp | // FIXME: Disabled, appears to have undefined behavior, and needs to be updated to match new warnings.
// RUN: clang-cc -fsyntax-only -verify %s
// XFAIL: *
namespace A {
int VA;
void FA() {}
struct SA { int V; };
}
using A::VA;
using A::FA;
using typename A::SA;
void main()
{
VA = 1;
FA();
SA x; //Still needs handling.
}
struct B {
void f(char){};
void g(char){};
};
struct D : B {
using B::f;
void f(int);
void g(int);
};
void D::f(int) { f('c'); } // calls B::f(char)
void D::g(int) { g('c'); } // recursively calls D::g(int)
namespace E {
template <typename TYPE> int funcE(TYPE arg) { return(arg); }
}
using E::funcE<int>; // expected-error{{use of template specialization in using directive not allowed}}
namespace F {
struct X;
}
using F::X;
// Should have some errors here. Waiting for implementation.
void X(int);
struct X *x;
| // RUN: clang-cc -fsyntax-only -verify %s
// XFAIL: *
namespace A {
int VA;
void FA() {}
struct SA { int V; };
}
using A::VA;
using A::FA;
using typename A::SA;
int main()
{
VA = 1;
FA();
SA x; //Still needs handling.
}
struct B {
void f(char){};
void g(char){};
};
struct D : B {
using B::f;
void f(int);
void g(int);
};
void D::f(int) { f('c'); } // calls B::f(char)
void D::g(int) { g('c'); } // recursively calls D::g(int)
namespace E {
template <typename TYPE> int funcE(TYPE arg) { return(arg); }
}
using E::funcE<int>; // expected-error{{using declaration can not refer to a template specialization}}
namespace F {
struct X;
}
using F::X;
// Should have some errors here. Waiting for implementation.
void X(int);
struct X *x;
| Tweak expected error to match what should happen, once using declarations work | Tweak expected error to match what should happen, once using declarations work
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@89876 91177308-0d34-0410-b5e6-96231b3b80d8
| C++ | apache-2.0 | apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang | c++ | ## Code Before:
// FIXME: Disabled, appears to have undefined behavior, and needs to be updated to match new warnings.
// RUN: clang-cc -fsyntax-only -verify %s
// XFAIL: *
namespace A {
int VA;
void FA() {}
struct SA { int V; };
}
using A::VA;
using A::FA;
using typename A::SA;
void main()
{
VA = 1;
FA();
SA x; //Still needs handling.
}
struct B {
void f(char){};
void g(char){};
};
struct D : B {
using B::f;
void f(int);
void g(int);
};
void D::f(int) { f('c'); } // calls B::f(char)
void D::g(int) { g('c'); } // recursively calls D::g(int)
namespace E {
template <typename TYPE> int funcE(TYPE arg) { return(arg); }
}
using E::funcE<int>; // expected-error{{use of template specialization in using directive not allowed}}
namespace F {
struct X;
}
using F::X;
// Should have some errors here. Waiting for implementation.
void X(int);
struct X *x;
## Instruction:
Tweak expected error to match what should happen, once using declarations work
git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@89876 91177308-0d34-0410-b5e6-96231b3b80d8
## Code After:
// RUN: clang-cc -fsyntax-only -verify %s
// XFAIL: *
namespace A {
int VA;
void FA() {}
struct SA { int V; };
}
using A::VA;
using A::FA;
using typename A::SA;
int main()
{
VA = 1;
FA();
SA x; //Still needs handling.
}
struct B {
void f(char){};
void g(char){};
};
struct D : B {
using B::f;
void f(int);
void g(int);
};
void D::f(int) { f('c'); } // calls B::f(char)
void D::g(int) { g('c'); } // recursively calls D::g(int)
namespace E {
template <typename TYPE> int funcE(TYPE arg) { return(arg); }
}
using E::funcE<int>; // expected-error{{using declaration can not refer to a template specialization}}
namespace F {
struct X;
}
using F::X;
// Should have some errors here. Waiting for implementation.
void X(int);
struct X *x;
| - // FIXME: Disabled, appears to have undefined behavior, and needs to be updated to match new warnings.
// RUN: clang-cc -fsyntax-only -verify %s
// XFAIL: *
namespace A {
int VA;
void FA() {}
struct SA { int V; };
}
using A::VA;
using A::FA;
using typename A::SA;
- void main()
? -- ^
+ int main()
? ^^
{
VA = 1;
FA();
SA x; //Still needs handling.
}
struct B {
void f(char){};
void g(char){};
};
struct D : B {
using B::f;
void f(int);
void g(int);
};
void D::f(int) { f('c'); } // calls B::f(char)
void D::g(int) { g('c'); } // recursively calls D::g(int)
namespace E {
template <typename TYPE> int funcE(TYPE arg) { return(arg); }
}
- using E::funcE<int>; // expected-error{{use of template specialization in using directive not allowed}}
+ using E::funcE<int>; // expected-error{{using declaration can not refer to a template specialization}}
namespace F {
struct X;
}
using F::X;
// Should have some errors here. Waiting for implementation.
void X(int);
struct X *x; | 5 | 0.106383 | 2 | 3 |
3607309193c5d8b2b5ce0fd98d976b6e6aa49644 | test/test_client.py | test/test_client.py | import pytest
from numpy import random, ceil
from lightning import Lightning, Visualization
class TestLightningAPIClient(object):
@pytest.fixture(scope="module")
def lgn(self, host):
lgn = Lightning(host)
lgn.create_session("test-session")
return lgn
def test_create_generic(self, lgn):
series = random.randn(5, 100)
viz = lgn.plot(data={"series": series}, type='line')
assert isinstance(viz, Visualization)
assert hasattr(viz, 'id')
def test_ipython_support(self, lgn):
lgn.ipython = True
x = random.randn(100)
viz = lgn.line(x)
assert isinstance(viz, Visualization)
assert hasattr(viz, 'id')
| import pytest
from numpy import random, ceil
from lightning import Lightning, Visualization, VisualizationLocal
class TestLightningAPIClient(object):
@pytest.fixture(scope="module")
def lgn(self, host):
lgn = Lightning(host)
lgn.create_session("test-session")
return lgn
def test_create_generic(self, lgn):
series = random.randn(5, 100)
viz = lgn.plot(data={"series": series}, type='line')
assert isinstance(viz, Visualization)
assert hasattr(viz, 'id')
def test_ipython_support(self, lgn):
lgn.ipython = True
x = random.randn(100)
viz = lgn.line(x)
assert isinstance(viz, Visualization)
assert hasattr(viz, 'id')
def test_local_mode(self, lgn):
lgn.local = True
x = random.randn(100)
viz = lgn.line(x)
assert isinstance(viz, VisualizationLocal)
assert hasattr(viz, 'id')
| Add test for local visualization | Add test for local visualization
| Python | mit | garretstuber/lightning-python,garretstuber/lightning-python,peterkshultz/lightning-python,lightning-viz/lightning-python,garretstuber/lightning-python,lightning-viz/lightning-python,peterkshultz/lightning-python,peterkshultz/lightning-python | python | ## Code Before:
import pytest
from numpy import random, ceil
from lightning import Lightning, Visualization
class TestLightningAPIClient(object):
@pytest.fixture(scope="module")
def lgn(self, host):
lgn = Lightning(host)
lgn.create_session("test-session")
return lgn
def test_create_generic(self, lgn):
series = random.randn(5, 100)
viz = lgn.plot(data={"series": series}, type='line')
assert isinstance(viz, Visualization)
assert hasattr(viz, 'id')
def test_ipython_support(self, lgn):
lgn.ipython = True
x = random.randn(100)
viz = lgn.line(x)
assert isinstance(viz, Visualization)
assert hasattr(viz, 'id')
## Instruction:
Add test for local visualization
## Code After:
import pytest
from numpy import random, ceil
from lightning import Lightning, Visualization, VisualizationLocal
class TestLightningAPIClient(object):
@pytest.fixture(scope="module")
def lgn(self, host):
lgn = Lightning(host)
lgn.create_session("test-session")
return lgn
def test_create_generic(self, lgn):
series = random.randn(5, 100)
viz = lgn.plot(data={"series": series}, type='line')
assert isinstance(viz, Visualization)
assert hasattr(viz, 'id')
def test_ipython_support(self, lgn):
lgn.ipython = True
x = random.randn(100)
viz = lgn.line(x)
assert isinstance(viz, Visualization)
assert hasattr(viz, 'id')
def test_local_mode(self, lgn):
lgn.local = True
x = random.randn(100)
viz = lgn.line(x)
assert isinstance(viz, VisualizationLocal)
assert hasattr(viz, 'id')
| import pytest
from numpy import random, ceil
- from lightning import Lightning, Visualization
+ from lightning import Lightning, Visualization, VisualizationLocal
? ++++++++++++++++++++
class TestLightningAPIClient(object):
@pytest.fixture(scope="module")
def lgn(self, host):
lgn = Lightning(host)
lgn.create_session("test-session")
return lgn
def test_create_generic(self, lgn):
series = random.randn(5, 100)
viz = lgn.plot(data={"series": series}, type='line')
assert isinstance(viz, Visualization)
assert hasattr(viz, 'id')
-
def test_ipython_support(self, lgn):
lgn.ipython = True
x = random.randn(100)
viz = lgn.line(x)
assert isinstance(viz, Visualization)
assert hasattr(viz, 'id')
+ def test_local_mode(self, lgn):
+
+ lgn.local = True
+ x = random.randn(100)
+ viz = lgn.line(x)
+
+ assert isinstance(viz, VisualizationLocal)
+ assert hasattr(viz, 'id')
+ | 12 | 0.387097 | 10 | 2 |
b26bf17154e478ee02e0e2936d7623d71698e1f2 | subprocrunner/_which.py | subprocrunner/_which.py |
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
raise CommandError(
"invalid command {}: ".format(command), cmd=command, errno=errno.EINVAL
)
self.__command = command
self.__abspath = None # type: Optional[str]
def __repr__(self) -> str:
item_list = ["command={}".format(self.command), "is_exist={}".format(self.is_exist())]
if self.is_exist():
item_list.append("abspath={}".format(self.abspath()))
return ", ".join(item_list)
def is_exist(self) -> bool:
return self.abspath() is not None
def verify(self) -> None:
if not self.is_exist():
raise CommandError(
"command not found: '{}'".format(self.command), cmd=self.command, errno=errno.ENOENT
)
def abspath(self) -> Optional[str]:
if self.__abspath:
return self.__abspath
self.__abspath = shutil.which(self.command)
return self.__abspath
|
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
raise ValueError("require a command")
self.__command = command
self.__abspath = None # type: Optional[str]
def __repr__(self) -> str:
item_list = ["command={}".format(self.command), "is_exist={}".format(self.is_exist())]
if self.is_exist():
item_list.append("abspath={}".format(self.abspath()))
return ", ".join(item_list)
def is_exist(self) -> bool:
return self.abspath() is not None
def verify(self) -> None:
if not self.is_exist():
raise CommandError(
"command not found: '{}'".format(self.command), cmd=self.command, errno=errno.ENOENT
)
def abspath(self) -> Optional[str]:
if self.__abspath:
return self.__abspath
self.__abspath = shutil.which(self.command)
return self.__abspath
| Modify an error handling when a command not specified for Which | Modify an error handling when a command not specified for Which
| Python | mit | thombashi/subprocrunner,thombashi/subprocrunner | python | ## Code Before:
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
raise CommandError(
"invalid command {}: ".format(command), cmd=command, errno=errno.EINVAL
)
self.__command = command
self.__abspath = None # type: Optional[str]
def __repr__(self) -> str:
item_list = ["command={}".format(self.command), "is_exist={}".format(self.is_exist())]
if self.is_exist():
item_list.append("abspath={}".format(self.abspath()))
return ", ".join(item_list)
def is_exist(self) -> bool:
return self.abspath() is not None
def verify(self) -> None:
if not self.is_exist():
raise CommandError(
"command not found: '{}'".format(self.command), cmd=self.command, errno=errno.ENOENT
)
def abspath(self) -> Optional[str]:
if self.__abspath:
return self.__abspath
self.__abspath = shutil.which(self.command)
return self.__abspath
## Instruction:
Modify an error handling when a command not specified for Which
## Code After:
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
raise ValueError("require a command")
self.__command = command
self.__abspath = None # type: Optional[str]
def __repr__(self) -> str:
item_list = ["command={}".format(self.command), "is_exist={}".format(self.is_exist())]
if self.is_exist():
item_list.append("abspath={}".format(self.abspath()))
return ", ".join(item_list)
def is_exist(self) -> bool:
return self.abspath() is not None
def verify(self) -> None:
if not self.is_exist():
raise CommandError(
"command not found: '{}'".format(self.command), cmd=self.command, errno=errno.ENOENT
)
def abspath(self) -> Optional[str]:
if self.__abspath:
return self.__abspath
self.__abspath = shutil.which(self.command)
return self.__abspath
|
import errno
import shutil
from typing import Optional
from .error import CommandError
class Which:
@property
def command(self):
return self.__command
def __init__(self, command: str) -> None:
if not command:
+ raise ValueError("require a command")
- raise CommandError(
- "invalid command {}: ".format(command), cmd=command, errno=errno.EINVAL
- )
self.__command = command
self.__abspath = None # type: Optional[str]
def __repr__(self) -> str:
item_list = ["command={}".format(self.command), "is_exist={}".format(self.is_exist())]
if self.is_exist():
item_list.append("abspath={}".format(self.abspath()))
return ", ".join(item_list)
def is_exist(self) -> bool:
return self.abspath() is not None
def verify(self) -> None:
if not self.is_exist():
raise CommandError(
"command not found: '{}'".format(self.command), cmd=self.command, errno=errno.ENOENT
)
def abspath(self) -> Optional[str]:
if self.__abspath:
return self.__abspath
self.__abspath = shutil.which(self.command)
return self.__abspath | 4 | 0.085106 | 1 | 3 |
fc6cb30f7323e35be709e3ad591bbb136f0ef5df | webpack.config.babel.js | webpack.config.babel.js | import path from 'path';
import HtmlWebpackPlugin from 'webpack-html-plugin';
import webpack from 'webpack';
const array = (target) => target.filter((item) => item);
export default ({dev, prod}) => ({
entry: array([
dev && 'react-hot-loader/patch',
'babel-polyfill',
'./src/',
]),
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: 'bundle.js',
},
plugins: array([
new HtmlWebpackPlugin({
template: 'src/index.html',
inject: true,
}),
dev && new webpack.NoErrorsPlugin(),
]),
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: '/node_modules/',
options: {
presets: ['es2015', 'react'],
modules: false,
},
},
{
test: /\.less$/,
use: [
{loader: 'style-loader'},
{loader: 'css-loader'},
{loader: 'less-loader'},
],
},
],
},
});
| import path from 'path';
import HtmlWebpackPlugin from 'webpack-html-plugin';
import webpack from 'webpack';
/** removes empty items from array */
const array = (target) => target.filter((item) => item);
/** removes empty properties from object */
const object = (target) => Object.keys(target).filter((key) => target[key]).reduce((result, key) => Object.assign({[key]: target[key]}, result), {});
export default ({dev, prod}) => ({
entry: array([
dev && 'react-hot-loader/patch',
'babel-polyfill',
'./src/',
]),
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: 'bundle.js',
},
plugins: array([
new HtmlWebpackPlugin({
template: 'src/index.html',
inject: true,
}),
dev && new webpack.NoErrorsPlugin(),
]),
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: '/node_modules/',
options: {
presets: ['es2015', 'react'],
modules: false,
},
},
{
test: /\.less$/,
use: [
{loader: 'style-loader'},
{loader: 'css-loader'},
{loader: 'less-loader'},
],
},
],
},
});
| Remove empty properties from object | Remove empty properties from object
| JavaScript | mit | tomvej/redux-starter,tomvej/redux-starter | javascript | ## Code Before:
import path from 'path';
import HtmlWebpackPlugin from 'webpack-html-plugin';
import webpack from 'webpack';
const array = (target) => target.filter((item) => item);
export default ({dev, prod}) => ({
entry: array([
dev && 'react-hot-loader/patch',
'babel-polyfill',
'./src/',
]),
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: 'bundle.js',
},
plugins: array([
new HtmlWebpackPlugin({
template: 'src/index.html',
inject: true,
}),
dev && new webpack.NoErrorsPlugin(),
]),
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: '/node_modules/',
options: {
presets: ['es2015', 'react'],
modules: false,
},
},
{
test: /\.less$/,
use: [
{loader: 'style-loader'},
{loader: 'css-loader'},
{loader: 'less-loader'},
],
},
],
},
});
## Instruction:
Remove empty properties from object
## Code After:
import path from 'path';
import HtmlWebpackPlugin from 'webpack-html-plugin';
import webpack from 'webpack';
/** removes empty items from array */
const array = (target) => target.filter((item) => item);
/** removes empty properties from object */
const object = (target) => Object.keys(target).filter((key) => target[key]).reduce((result, key) => Object.assign({[key]: target[key]}, result), {});
export default ({dev, prod}) => ({
entry: array([
dev && 'react-hot-loader/patch',
'babel-polyfill',
'./src/',
]),
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: 'bundle.js',
},
plugins: array([
new HtmlWebpackPlugin({
template: 'src/index.html',
inject: true,
}),
dev && new webpack.NoErrorsPlugin(),
]),
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: '/node_modules/',
options: {
presets: ['es2015', 'react'],
modules: false,
},
},
{
test: /\.less$/,
use: [
{loader: 'style-loader'},
{loader: 'css-loader'},
{loader: 'less-loader'},
],
},
],
},
});
| import path from 'path';
import HtmlWebpackPlugin from 'webpack-html-plugin';
import webpack from 'webpack';
+ /** removes empty items from array */
const array = (target) => target.filter((item) => item);
+
+ /** removes empty properties from object */
+ const object = (target) => Object.keys(target).filter((key) => target[key]).reduce((result, key) => Object.assign({[key]: target[key]}, result), {});
export default ({dev, prod}) => ({
entry: array([
dev && 'react-hot-loader/patch',
'babel-polyfill',
'./src/',
]),
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
filename: 'bundle.js',
},
plugins: array([
new HtmlWebpackPlugin({
template: 'src/index.html',
inject: true,
}),
dev && new webpack.NoErrorsPlugin(),
]),
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: '/node_modules/',
options: {
presets: ['es2015', 'react'],
modules: false,
},
},
{
test: /\.less$/,
use: [
{loader: 'style-loader'},
{loader: 'css-loader'},
{loader: 'less-loader'},
],
},
],
},
}); | 4 | 0.086957 | 4 | 0 |
9c0b0d40977c2dd6e72188c6880993524d2e736f | test-coverage.sh | test-coverage.sh |
echo "mode: set" > acc.out
for dir in $(find . -maxdepth 10 -not -path './.git*' -type d);
do
if ls $dir/*.go &> /dev/null;
then
returnval=`go test -coverprofile=profile.out $dir`
echo ${returnval}
if [[ ${returnval} != *FAIL* ]]
then
if [ -f profile.out ]
then
cat profile.out | grep -v "mode: set" >> acc.out
fi
else
exit 1
fi
fi
done
if [ -n "$COVERALLS" ]
then
goveralls -v -coverprofile=acc.out $COVERALLS
fi
rm -rf ./profile.out
rm -rf ./acc.out
|
echo "mode: set" > acc.out
fail=0
for dir in $(find . -maxdepth 10 -not -path './.git*' -type d);
do
if ls $dir/*.go &> /dev/null; then
go test -coverprofile=profile.out $dir || fail=1
if [ -f profile.out ]
then
cat profile.out | grep -v "mode: set" >> acc.out
rm profile.out
fi
fi
done
# Failures have incomplete results, so don't send
if [ -n "$COVERALLS" ] && [ "$fail" -eq 0 ]
then
goveralls -v -coverprofile=acc.out $COVERALLS
fi
rm -f acc.out
exit $fail
| Make the coverage/test running script a little better | Make the coverage/test running script a little better
| Shell | mit | sdboyer/gogl,sdboyer/gogl | shell | ## Code Before:
echo "mode: set" > acc.out
for dir in $(find . -maxdepth 10 -not -path './.git*' -type d);
do
if ls $dir/*.go &> /dev/null;
then
returnval=`go test -coverprofile=profile.out $dir`
echo ${returnval}
if [[ ${returnval} != *FAIL* ]]
then
if [ -f profile.out ]
then
cat profile.out | grep -v "mode: set" >> acc.out
fi
else
exit 1
fi
fi
done
if [ -n "$COVERALLS" ]
then
goveralls -v -coverprofile=acc.out $COVERALLS
fi
rm -rf ./profile.out
rm -rf ./acc.out
## Instruction:
Make the coverage/test running script a little better
## Code After:
echo "mode: set" > acc.out
fail=0
for dir in $(find . -maxdepth 10 -not -path './.git*' -type d);
do
if ls $dir/*.go &> /dev/null; then
go test -coverprofile=profile.out $dir || fail=1
if [ -f profile.out ]
then
cat profile.out | grep -v "mode: set" >> acc.out
rm profile.out
fi
fi
done
# Failures have incomplete results, so don't send
if [ -n "$COVERALLS" ] && [ "$fail" -eq 0 ]
then
goveralls -v -coverprofile=acc.out $COVERALLS
fi
rm -f acc.out
exit $fail
|
echo "mode: set" > acc.out
+ fail=0
for dir in $(find . -maxdepth 10 -not -path './.git*' -type d);
do
- if ls $dir/*.go &> /dev/null;
+ if ls $dir/*.go &> /dev/null; then
? +++++
- then
- returnval=`go test -coverprofile=profile.out $dir`
? ----------- ^
+ go test -coverprofile=profile.out $dir || fail=1
? ^^^^^^^^^^
- echo ${returnval}
- if [[ ${returnval} != *FAIL* ]]
- then
- if [ -f profile.out ]
? --
+ if [ -f profile.out ]
- then
? --
+ then
- cat profile.out | grep -v "mode: set" >> acc.out
? ----
+ cat profile.out | grep -v "mode: set" >> acc.out
+ rm profile.out
- fi
- else
- exit 1
- fi
fi
+ fi
done
- if [ -n "$COVERALLS" ]
+
+ # Failures have incomplete results, so don't send
+ if [ -n "$COVERALLS" ] && [ "$fail" -eq 0 ]
then
goveralls -v -coverprofile=acc.out $COVERALLS
fi
- rm -rf ./profile.out
- rm -rf ./acc.out
? - --
+ rm -f acc.out
+
+ exit $fail | 30 | 1.111111 | 14 | 16 |
0d8ee391ce9e0d46f721efa06ac0302bcbee9442 | assets/js/utils/changesets.js | assets/js/utils/changesets.js | import { defaults, isArray, map, mapValues } from 'lodash'
export function flattenChangesetValues(changeset) {
const result = defaults({}, changeset.changes, changeset.data)
return mapValues(result, value => {
if (isChangeset(value)) {
return flattenChangesetValues(value)
}
if (isArray(value)) {
return map(value, item => {
return isChangeset(item) ? flattenChangesetValues(item) : item
})
}
return value
})
}
function isChangeset(object) {
return !!object && !!object.data && !!object.changes
}
| import { defaults, isArray, map, mapValues } from 'lodash'
/**
* Merges an Ecto changeset's `changes` and `data` values into a
* single values object, preferring `changes` (changed values) over
* `data` (original values) if present. This is done recursively
* for nested changesets as well.
*
* @param {Object} changeset
*/
export function flattenChangesetValues(changeset) {
const result = defaults({}, changeset.changes, changeset.data)
return mapValues(result, value => {
if (isChangeset(value)) {
return flattenChangesetValues(value)
}
if (isArray(value)) {
return map(value, item => {
return isChangeset(item) ? flattenChangesetValues(item) : item
})
}
return value
})
}
function isChangeset(object) {
return !!object && !!object.data && !!object.changes
}
| Add docs for JS changeset utilitities | Add docs for JS changeset utilitities
| JavaScript | mit | richeterre/jumubase-phoenix,richeterre/jumubase-phoenix | javascript | ## Code Before:
import { defaults, isArray, map, mapValues } from 'lodash'
export function flattenChangesetValues(changeset) {
const result = defaults({}, changeset.changes, changeset.data)
return mapValues(result, value => {
if (isChangeset(value)) {
return flattenChangesetValues(value)
}
if (isArray(value)) {
return map(value, item => {
return isChangeset(item) ? flattenChangesetValues(item) : item
})
}
return value
})
}
function isChangeset(object) {
return !!object && !!object.data && !!object.changes
}
## Instruction:
Add docs for JS changeset utilitities
## Code After:
import { defaults, isArray, map, mapValues } from 'lodash'
/**
* Merges an Ecto changeset's `changes` and `data` values into a
* single values object, preferring `changes` (changed values) over
* `data` (original values) if present. This is done recursively
* for nested changesets as well.
*
* @param {Object} changeset
*/
export function flattenChangesetValues(changeset) {
const result = defaults({}, changeset.changes, changeset.data)
return mapValues(result, value => {
if (isChangeset(value)) {
return flattenChangesetValues(value)
}
if (isArray(value)) {
return map(value, item => {
return isChangeset(item) ? flattenChangesetValues(item) : item
})
}
return value
})
}
function isChangeset(object) {
return !!object && !!object.data && !!object.changes
}
| import { defaults, isArray, map, mapValues } from 'lodash'
+ /**
+ * Merges an Ecto changeset's `changes` and `data` values into a
+ * single values object, preferring `changes` (changed values) over
+ * `data` (original values) if present. This is done recursively
+ * for nested changesets as well.
+ *
+ * @param {Object} changeset
+ */
export function flattenChangesetValues(changeset) {
const result = defaults({}, changeset.changes, changeset.data)
return mapValues(result, value => {
if (isChangeset(value)) {
return flattenChangesetValues(value)
}
if (isArray(value)) {
return map(value, item => {
return isChangeset(item) ? flattenChangesetValues(item) : item
})
}
return value
})
}
function isChangeset(object) {
return !!object && !!object.data && !!object.changes
} | 8 | 0.347826 | 8 | 0 |
79d02616ab6d70b029876b8a2de425026e6268c4 | pycalc.py | pycalc.py | import sys
import lexer
import execute
while True:
instr = input("» ")
toks = lexer.to_toks(instr)
rpn = lexer.to_rpn(toks)
result = execute.eval_rpn(rpn)
if result is not None:
print(result)
if len(sys.argv) >= 2:
break
|
import sys
if sys.version_info.major < 3:
print("This program is for python version 3 only.")
sys.exit(3)
import lexer
import execute
while True:
instr = input("» ")
toks = lexer.to_toks(instr)
rpn = lexer.to_rpn(toks)
result = execute.eval_rpn(rpn)
if result is not None:
print(result)
if len(sys.argv) >= 2:
break
| Make main program throw warning on python2. | Make main program throw warning on python2.
| Python | mit | 5225225/pycalc,5225225/pycalc | python | ## Code Before:
import sys
import lexer
import execute
while True:
instr = input("» ")
toks = lexer.to_toks(instr)
rpn = lexer.to_rpn(toks)
result = execute.eval_rpn(rpn)
if result is not None:
print(result)
if len(sys.argv) >= 2:
break
## Instruction:
Make main program throw warning on python2.
## Code After:
import sys
if sys.version_info.major < 3:
print("This program is for python version 3 only.")
sys.exit(3)
import lexer
import execute
while True:
instr = input("» ")
toks = lexer.to_toks(instr)
rpn = lexer.to_rpn(toks)
result = execute.eval_rpn(rpn)
if result is not None:
print(result)
if len(sys.argv) >= 2:
break
| +
import sys
+
+ if sys.version_info.major < 3:
+ print("This program is for python version 3 only.")
+ sys.exit(3)
import lexer
import execute
while True:
instr = input("» ")
toks = lexer.to_toks(instr)
rpn = lexer.to_rpn(toks)
result = execute.eval_rpn(rpn)
if result is not None:
print(result)
if len(sys.argv) >= 2:
break | 5 | 0.294118 | 5 | 0 |
4a584f1ece162d0e918fc9f307d18b070043221c | client/app/lib/util/tracker.coffee | client/app/lib/util/tracker.coffee | _ = require 'lodash'
kd = require 'kd'
remote = require('app/remote').getInstance()
globals = require 'globals'
defaults = require './tracking/defaults'
module.exports = class Tracker
_.assign this, require('./tracking/trackingtypes')
@track = (action, properties = {}) ->
return unless globals.config.logToExternal
@assignDefaultProperties action, properties
remote.api.Tracker.track action, properties, kd.noop
@assignDefaultProperties: (action, properties) ->
_.defaults properties, defaults.properties[action]
| _ = require 'lodash'
kd = require 'kd'
remote = require('app/remote').getInstance()
globals = require 'globals'
defaults = require './tracking/defaults'
module.exports = class Tracker
_.assign this, require('./tracking/trackingtypes')
@track = (action, properties = {}) ->
return unless globals.config.sendEventsToSegment
@assignDefaultProperties action, properties
remote.api.Tracker.track action, properties, kd.noop
@assignDefaultProperties: (action, properties) ->
_.defaults properties, defaults.properties[action]
| Fix condition clause of Tracker.track function | Fix condition clause of Tracker.track function
| CoffeeScript | agpl-3.0 | andrewjcasal/koding,drewsetski/koding,cihangir/koding,koding/koding,usirin/koding,usirin/koding,gokmen/koding,alex-ionochkin/koding,acbodine/koding,koding/koding,mertaytore/koding,sinan/koding,sinan/koding,kwagdy/koding-1,mertaytore/koding,drewsetski/koding,kwagdy/koding-1,jack89129/koding,mertaytore/koding,kwagdy/koding-1,alex-ionochkin/koding,gokmen/koding,rjeczalik/koding,rjeczalik/koding,sinan/koding,acbodine/koding,usirin/koding,koding/koding,kwagdy/koding-1,drewsetski/koding,szkl/koding,kwagdy/koding-1,jack89129/koding,szkl/koding,jack89129/koding,cihangir/koding,szkl/koding,alex-ionochkin/koding,andrewjcasal/koding,mertaytore/koding,drewsetski/koding,mertaytore/koding,koding/koding,szkl/koding,koding/koding,usirin/koding,drewsetski/koding,szkl/koding,koding/koding,rjeczalik/koding,gokmen/koding,drewsetski/koding,cihangir/koding,drewsetski/koding,koding/koding,acbodine/koding,andrewjcasal/koding,cihangir/koding,acbodine/koding,cihangir/koding,alex-ionochkin/koding,jack89129/koding,cihangir/koding,sinan/koding,andrewjcasal/koding,jack89129/koding,kwagdy/koding-1,usirin/koding,gokmen/koding,acbodine/koding,mertaytore/koding,rjeczalik/koding,rjeczalik/koding,acbodine/koding,andrewjcasal/koding,alex-ionochkin/koding,szkl/koding,gokmen/koding,cihangir/koding,alex-ionochkin/koding,alex-ionochkin/koding,andrewjcasal/koding,jack89129/koding,rjeczalik/koding,usirin/koding,gokmen/koding,sinan/koding,kwagdy/koding-1,koding/koding,rjeczalik/koding,jack89129/koding,gokmen/koding,acbodine/koding,kwagdy/koding-1,rjeczalik/koding,sinan/koding,andrewjcasal/koding,andrewjcasal/koding,cihangir/koding,alex-ionochkin/koding,acbodine/koding,gokmen/koding,sinan/koding,mertaytore/koding,jack89129/koding,usirin/koding,usirin/koding,sinan/koding,drewsetski/koding,szkl/koding,szkl/koding,mertaytore/koding | coffeescript | ## Code Before:
_ = require 'lodash'
kd = require 'kd'
remote = require('app/remote').getInstance()
globals = require 'globals'
defaults = require './tracking/defaults'
module.exports = class Tracker
_.assign this, require('./tracking/trackingtypes')
@track = (action, properties = {}) ->
return unless globals.config.logToExternal
@assignDefaultProperties action, properties
remote.api.Tracker.track action, properties, kd.noop
@assignDefaultProperties: (action, properties) ->
_.defaults properties, defaults.properties[action]
## Instruction:
Fix condition clause of Tracker.track function
## Code After:
_ = require 'lodash'
kd = require 'kd'
remote = require('app/remote').getInstance()
globals = require 'globals'
defaults = require './tracking/defaults'
module.exports = class Tracker
_.assign this, require('./tracking/trackingtypes')
@track = (action, properties = {}) ->
return unless globals.config.sendEventsToSegment
@assignDefaultProperties action, properties
remote.api.Tracker.track action, properties, kd.noop
@assignDefaultProperties: (action, properties) ->
_.defaults properties, defaults.properties[action]
| _ = require 'lodash'
kd = require 'kd'
remote = require('app/remote').getInstance()
globals = require 'globals'
defaults = require './tracking/defaults'
module.exports = class Tracker
_.assign this, require('./tracking/trackingtypes')
@track = (action, properties = {}) ->
- return unless globals.config.logToExternal
+ return unless globals.config.sendEventsToSegment
@assignDefaultProperties action, properties
remote.api.Tracker.track action, properties, kd.noop
@assignDefaultProperties: (action, properties) ->
_.defaults properties, defaults.properties[action] | 2 | 0.086957 | 1 | 1 |
707bae2475a5ee7e6322eb355cec47f1e54737cf | app/views/authentications/index.html.haml | app/views/authentications/index.html.haml | %h1 Linked accounts on other sites
- if @authentications
- unless @authentications.empty?
.authentications
- @authentications.each do |authentication|
.authentication
= image_tag "#{authentication.provider}_64.png", :size => "64x64"
.provider
= authentication.provider.titleize
.uid
= authentication.uid
= link_to "X", authentication, :confirm => "Are you sure you want to remove this authentication?", :method => :delete, :class => "remove"
.clear
%p
%strong Link another external account:
- else
%p
%strong Link to an external account:
= link_to image_tag("twitter_64.png", :size => "64x64"), "/auth/twitter", :class => "auth_provider"
| %h1 Linked accounts on other sites
- if @authentications
- unless @authentications.empty?
.authentications
- @authentications.each do |authentication|
%a{ :href => "http://twitter.com/#{authentication.name}" }
.authentication
= image_tag "#{authentication.provider}_64.png", :size => "64x64"
.provider
= authentication.provider.titleize
.name
= authentication.name
= link_to "X", authentication, :confirm => "Are you sure you want to remove this authentication?", :method => :delete, :class => "remove"
.clear
%p
%strong Link another external account:
- else
%p
%strong Link to an external account:
= link_to image_tag("twitter_64.png", :size => "64x64"), "/auth/twitter", :class => "auth_provider"
| Make the authentication into a link to your Twitter page. | Make the authentication into a link to your Twitter page.
When we support other authentication providers, we'll need to make this
into a callback or something.
| Haml | agpl-3.0 | CarsonBills/GrowStuffCMB,CarsonBills/GrowStuffCMB,josefdaly/growstuff,dv2/growstuff,CloCkWeRX/growstuff,borracciaBlu/growstuff,yez/growstuff,sksavant/growstuff,korabh/growstuff,Br3nda/growstuff,Growstuff/growstuff,dv2/growstuff,GabrielSandoval/growstuff,gustavor-souza/growstuff,maco/growstuff,Growstuff/growstuff,josefdaly/growstuff,maco/growstuff,Growstuff/growstuff,CarsonBills/GrowStuffCMB,iressgrad15/growstuff,iressgrad15/growstuff,GabrielSandoval/growstuff,CjayBillones/growstuff,oshiho3/growstuff,dv2/growstuff,Br3nda/growstuff,korabh/growstuff,pozorvlak/growstuff,CarsonBills/GrowStuffCMB,CjayBillones/growstuff,oshiho3/growstuff,jdanielnd/growstuff,jdanielnd/growstuff,oshiho3/growstuff,dv2/growstuff,andrba/growstuff,pozorvlak/growstuff,andrba/growstuff,CjayBillones/growstuff,gustavor-souza/growstuff,CjayBillones/growstuff,korabh/growstuff,pozorvlak/growstuff,cesy/growstuff,yez/growstuff,borracciaBlu/growstuff,sksavant/growstuff,yez/growstuff,andrba/growstuff,oshiho3/growstuff,maco/growstuff,CloCkWeRX/growstuff,Growstuff/growstuff,borracciaBlu/growstuff,iressgrad15/growstuff,gustavor-souza/growstuff,pozorvlak/growstuff,jdanielnd/growstuff,andrba/growstuff,korabh/growstuff,yez/growstuff,Br3nda/growstuff,josefdaly/growstuff,borracciaBlu/growstuff,jdanielnd/growstuff,josefdaly/growstuff,GabrielSandoval/growstuff,GabrielSandoval/growstuff,cesy/growstuff,sksavant/growstuff,sksavant/growstuff,cesy/growstuff,Br3nda/growstuff,CloCkWeRX/growstuff,maco/growstuff,gustavor-souza/growstuff,CloCkWeRX/growstuff,cesy/growstuff | haml | ## Code Before:
%h1 Linked accounts on other sites
- if @authentications
- unless @authentications.empty?
.authentications
- @authentications.each do |authentication|
.authentication
= image_tag "#{authentication.provider}_64.png", :size => "64x64"
.provider
= authentication.provider.titleize
.uid
= authentication.uid
= link_to "X", authentication, :confirm => "Are you sure you want to remove this authentication?", :method => :delete, :class => "remove"
.clear
%p
%strong Link another external account:
- else
%p
%strong Link to an external account:
= link_to image_tag("twitter_64.png", :size => "64x64"), "/auth/twitter", :class => "auth_provider"
## Instruction:
Make the authentication into a link to your Twitter page.
When we support other authentication providers, we'll need to make this
into a callback or something.
## Code After:
%h1 Linked accounts on other sites
- if @authentications
- unless @authentications.empty?
.authentications
- @authentications.each do |authentication|
%a{ :href => "http://twitter.com/#{authentication.name}" }
.authentication
= image_tag "#{authentication.provider}_64.png", :size => "64x64"
.provider
= authentication.provider.titleize
.name
= authentication.name
= link_to "X", authentication, :confirm => "Are you sure you want to remove this authentication?", :method => :delete, :class => "remove"
.clear
%p
%strong Link another external account:
- else
%p
%strong Link to an external account:
= link_to image_tag("twitter_64.png", :size => "64x64"), "/auth/twitter", :class => "auth_provider"
| %h1 Linked accounts on other sites
- if @authentications
- unless @authentications.empty?
.authentications
- @authentications.each do |authentication|
+ %a{ :href => "http://twitter.com/#{authentication.name}" }
- .authentication
+ .authentication
? ++
- = image_tag "#{authentication.provider}_64.png", :size => "64x64"
+ = image_tag "#{authentication.provider}_64.png", :size => "64x64"
? ++
- .provider
+ .provider
? ++
- = authentication.provider.titleize
+ = authentication.provider.titleize
? ++
- .uid
+ .name
- = authentication.uid
? ^^^
+ = authentication.name
? ++ ^^^^
= link_to "X", authentication, :confirm => "Are you sure you want to remove this authentication?", :method => :delete, :class => "remove"
.clear
%p
%strong Link another external account:
- else
%p
%strong Link to an external account:
= link_to image_tag("twitter_64.png", :size => "64x64"), "/auth/twitter", :class => "auth_provider" | 13 | 0.619048 | 7 | 6 |
6e0fbe80f5504add97a5889294cec07a5902edf3 | index.html | index.html | ---
layout: default
title: The Setup
---
<ul id='interviews'>
{% for post in site.posts limit:1 %}
<li id="latest">
<a href='http://{{post.slug}}.usesthis.com/' title='View an interview with {{post.person}}.'>
<img src='/images/portraits/{{post.slug}}.jpg' alt='{{post.person}}' width='500' height='335' class='portrait'>
<h2 class='person'>{{post.person}}</h2>
</a>
<p class='summary'>{{post.summary}}</p>
{% include categories.html %}
<time datetime='{{post.date | date: "%Y-%m-%d"}}'>{{post.date | date: "%B %d, %Y"}}</time>
</li>
{% endfor %}
{% for post in site.posts limit:9 offset:1 %}
<li>
<a href='http://{{post.slug}}.usesthis.com/' title='View an interview with {{post.person}}.'>
<img src='/images/thumbnails/{{post.slug}}.jpg' alt='{{post.person}}' width='500' height='100' class='portrait'>
<h2 class='person'>{{post.person}}</h2>
</a>
<p class='summary'>{{post.summary}}</p>
{% include categories.html %}
<time datetime='{{post.date | date: "%Y-%m-%d"}}'>{{post.date | date: "%B %d, %Y"}}</time>
</li>
{% endfor %}
</ul>
<p>Don't panic - there's plenty <a href="http://usesthis.com/interviews/" title="View all the interviews.">more to read!</a></p> | ---
layout: default
title: The Setup
---
<ul id='interviews'>
{% for post in site.posts limit:10 %}
<li>
<a href='http://{{post.slug}}.usesthis.com/' title='View an interview with {{post.person}}.'>
<img src='/images/portraits/{{post.slug}}.jpg' alt='{{post.person}}' width='500' height='335' class='portrait'>
<h2 class='person'>{{post.person}}</h2>
</a>
<p class='summary'>{{post.summary}}</p>
{% include categories.html %}
<time datetime='{{post.date | date: "%Y-%m-%d"}}'>{{post.date | date: "%B %d, %Y"}}</time>
</li>
{% endfor %}
</ul>
<p>Don't panic - there's plenty <a href="http://usesthis.com/interviews/" title="View all the interviews.">more to read!</a></p> | Switch back to all large images. People seemed to prefer that. | Switch back to all large images. People seemed to prefer that.
| HTML | mit | orta/usesthis,MjAbuz/usesthis,MjAbuz/usesthis,MjAbuz/usesthis,holman/usesthis,waferbaby/usesthis,ivuk/usesthis,orta/usesthis,ivuk/usesthis,holman/usesthis,waferbaby/usesthis | html | ## Code Before:
---
layout: default
title: The Setup
---
<ul id='interviews'>
{% for post in site.posts limit:1 %}
<li id="latest">
<a href='http://{{post.slug}}.usesthis.com/' title='View an interview with {{post.person}}.'>
<img src='/images/portraits/{{post.slug}}.jpg' alt='{{post.person}}' width='500' height='335' class='portrait'>
<h2 class='person'>{{post.person}}</h2>
</a>
<p class='summary'>{{post.summary}}</p>
{% include categories.html %}
<time datetime='{{post.date | date: "%Y-%m-%d"}}'>{{post.date | date: "%B %d, %Y"}}</time>
</li>
{% endfor %}
{% for post in site.posts limit:9 offset:1 %}
<li>
<a href='http://{{post.slug}}.usesthis.com/' title='View an interview with {{post.person}}.'>
<img src='/images/thumbnails/{{post.slug}}.jpg' alt='{{post.person}}' width='500' height='100' class='portrait'>
<h2 class='person'>{{post.person}}</h2>
</a>
<p class='summary'>{{post.summary}}</p>
{% include categories.html %}
<time datetime='{{post.date | date: "%Y-%m-%d"}}'>{{post.date | date: "%B %d, %Y"}}</time>
</li>
{% endfor %}
</ul>
<p>Don't panic - there's plenty <a href="http://usesthis.com/interviews/" title="View all the interviews.">more to read!</a></p>
## Instruction:
Switch back to all large images. People seemed to prefer that.
## Code After:
---
layout: default
title: The Setup
---
<ul id='interviews'>
{% for post in site.posts limit:10 %}
<li>
<a href='http://{{post.slug}}.usesthis.com/' title='View an interview with {{post.person}}.'>
<img src='/images/portraits/{{post.slug}}.jpg' alt='{{post.person}}' width='500' height='335' class='portrait'>
<h2 class='person'>{{post.person}}</h2>
</a>
<p class='summary'>{{post.summary}}</p>
{% include categories.html %}
<time datetime='{{post.date | date: "%Y-%m-%d"}}'>{{post.date | date: "%B %d, %Y"}}</time>
</li>
{% endfor %}
</ul>
<p>Don't panic - there's plenty <a href="http://usesthis.com/interviews/" title="View all the interviews.">more to read!</a></p> | ---
layout: default
title: The Setup
---
<ul id='interviews'>
- {% for post in site.posts limit:1 %}
+ {% for post in site.posts limit:10 %}
? +
- <li id="latest">
+ <li>
<a href='http://{{post.slug}}.usesthis.com/' title='View an interview with {{post.person}}.'>
<img src='/images/portraits/{{post.slug}}.jpg' alt='{{post.person}}' width='500' height='335' class='portrait'>
<h2 class='person'>{{post.person}}</h2>
</a>
<p class='summary'>{{post.summary}}</p>
{% include categories.html %}
<time datetime='{{post.date | date: "%Y-%m-%d"}}'>{{post.date | date: "%B %d, %Y"}}</time>
</li>
{% endfor %}
- {% for post in site.posts limit:9 offset:1 %}
- <li>
- <a href='http://{{post.slug}}.usesthis.com/' title='View an interview with {{post.person}}.'>
- <img src='/images/thumbnails/{{post.slug}}.jpg' alt='{{post.person}}' width='500' height='100' class='portrait'>
- <h2 class='person'>{{post.person}}</h2>
- </a>
- <p class='summary'>{{post.summary}}</p>
- {% include categories.html %}
- <time datetime='{{post.date | date: "%Y-%m-%d"}}'>{{post.date | date: "%B %d, %Y"}}</time>
- </li>
- {% endfor %}
</ul>
<p>Don't panic - there's plenty <a href="http://usesthis.com/interviews/" title="View all the interviews.">more to read!</a></p> | 15 | 0.517241 | 2 | 13 |
e7fad2316fe4325cfa80db9d2dfc816f3c525e90 | tests/shared/src/test/scala/coursier/util/TreeTests.scala | tests/shared/src/test/scala/coursier/util/TreeTests.scala | package coursier.util
import utest._
object TreeTests extends TestSuite {
case class Node(label: String, children: Node*)
val roots = Array(
Node("p1",
Node("c1"),
Node("c2")),
Node("p2",
Node("c3"),
Node("c4"))
)
val tests = TestSuite {
'apply {
val str = Tree[Node](roots)(_.children, _.label)
assert(str == """├─ p1
││ ├─ c1
││ └─ c2
│└─ p2
│ ├─ c3
│ └─ c4""".stripMargin)
}
}
}
| package coursier.util
import utest._
object TreeTests extends TestSuite {
case class Node(label: String, children: Node*)
val roots = Array(
Node("p1",
Node("c1"),
Node("c2")),
Node("p2",
Node("c3"),
Node("c4"))
)
val tests = TestSuite {
'apply {
val str = Tree[Node](roots)(_.children, _.label)
assert(str == """├─ p1
#│ ├─ c1
#│ └─ c2
#└─ p2
# ├─ c3
# └─ c4""".stripMargin('#'))
}
}
}
| Tweak margin character in test | Tweak margin character in test
| Scala | apache-2.0 | alexarchambault/coursier,coursier/coursier,coursier/coursier,alexarchambault/coursier,coursier/coursier,coursier/coursier,alexarchambault/coursier,alexarchambault/coursier | scala | ## Code Before:
package coursier.util
import utest._
object TreeTests extends TestSuite {
case class Node(label: String, children: Node*)
val roots = Array(
Node("p1",
Node("c1"),
Node("c2")),
Node("p2",
Node("c3"),
Node("c4"))
)
val tests = TestSuite {
'apply {
val str = Tree[Node](roots)(_.children, _.label)
assert(str == """├─ p1
││ ├─ c1
││ └─ c2
│└─ p2
│ ├─ c3
│ └─ c4""".stripMargin)
}
}
}
## Instruction:
Tweak margin character in test
## Code After:
package coursier.util
import utest._
object TreeTests extends TestSuite {
case class Node(label: String, children: Node*)
val roots = Array(
Node("p1",
Node("c1"),
Node("c2")),
Node("p2",
Node("c3"),
Node("c4"))
)
val tests = TestSuite {
'apply {
val str = Tree[Node](roots)(_.children, _.label)
assert(str == """├─ p1
#│ ├─ c1
#│ └─ c2
#└─ p2
# ├─ c3
# └─ c4""".stripMargin('#'))
}
}
}
| package coursier.util
import utest._
object TreeTests extends TestSuite {
case class Node(label: String, children: Node*)
val roots = Array(
Node("p1",
Node("c1"),
Node("c2")),
Node("p2",
Node("c3"),
Node("c4"))
)
val tests = TestSuite {
'apply {
val str = Tree[Node](roots)(_.children, _.label)
assert(str == """├─ p1
- ││ ├─ c1
? ^
+ #│ ├─ c1
? ^
- ││ └─ c2
? ^
+ #│ └─ c2
? ^
- │└─ p2
? ^
+ #└─ p2
? ^
- │ ├─ c3
? ^
+ # ├─ c3
? ^
- │ └─ c4""".stripMargin)
? ^
+ # └─ c4""".stripMargin('#'))
? ^ ++++ +
}
}
} | 10 | 0.357143 | 5 | 5 |
a8e56fd66bee382f795b5ce3c3719b7fed314b5d | build.sh | build.sh |
if [ $# -ne 1 ]; then
echo "./build.sh [stage|prod]"
exit 1
fi
ENV=$1
set -x
rm -rf build
mkdir -p build
cat index.${ENV}.html | sed "s/GIT_HASH/`git rev-parse --short HEAD`/g" > build/index.html
./node_modules/webpack/bin/webpack.js -p --config webpack.stage-prod.config.js
|
if [ $# -ne 1 ]; then
echo "./build.sh [stage|prod]"
exit 1
fi
ENV=$1
set -x
if [ -d ".git" ]; then
VER=`git rev-parse --short HEAD`
else
VER=`date +%s`
fi
rm -rf build
mkdir -p build
cat index.${ENV}.html | sed "s/GIT_HASH/$VER/g" > build/index.html
./node_modules/webpack/bin/webpack.js -p --config webpack.stage-prod.config.js
| Add timestamp to the app.js version if there is no git enviroment | Add timestamp to the app.js version if there is no git enviroment
| Shell | mit | palcu/infoeducatie-ui,palcu/infoeducatie-ui,palcu/infoeducatie-ui,infoeducatie/infoeducatie-ui,infoeducatie/infoeducatie-ui,infoeducatie/infoeducatie-ui | shell | ## Code Before:
if [ $# -ne 1 ]; then
echo "./build.sh [stage|prod]"
exit 1
fi
ENV=$1
set -x
rm -rf build
mkdir -p build
cat index.${ENV}.html | sed "s/GIT_HASH/`git rev-parse --short HEAD`/g" > build/index.html
./node_modules/webpack/bin/webpack.js -p --config webpack.stage-prod.config.js
## Instruction:
Add timestamp to the app.js version if there is no git enviroment
## Code After:
if [ $# -ne 1 ]; then
echo "./build.sh [stage|prod]"
exit 1
fi
ENV=$1
set -x
if [ -d ".git" ]; then
VER=`git rev-parse --short HEAD`
else
VER=`date +%s`
fi
rm -rf build
mkdir -p build
cat index.${ENV}.html | sed "s/GIT_HASH/$VER/g" > build/index.html
./node_modules/webpack/bin/webpack.js -p --config webpack.stage-prod.config.js
|
if [ $# -ne 1 ]; then
echo "./build.sh [stage|prod]"
exit 1
fi
ENV=$1
set -x
+
+ if [ -d ".git" ]; then
+ VER=`git rev-parse --short HEAD`
+ else
+ VER=`date +%s`
+ fi
+
rm -rf build
mkdir -p build
- cat index.${ENV}.html | sed "s/GIT_HASH/`git rev-parse --short HEAD`/g" > build/index.html
? ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
+ cat index.${ENV}.html | sed "s/GIT_HASH/$VER/g" > build/index.html
? ^^ ^
./node_modules/webpack/bin/webpack.js -p --config webpack.stage-prod.config.js | 9 | 0.692308 | 8 | 1 |
ecb3643ce3c0fcfb1fb3a0369f81066f65e11172 | tests/auto/api/testdata/export-item-with-group/project.qbs | tests/auto/api/testdata/export-item-with-group/project.qbs | import qbs
Project {
Product {
name: "dep"
Export {
Depends { name: "cpp" }
Group { files: ["main.cpp"] }
}
}
Application {
name: "app"
Depends { name: "dep" }
}
}
| import qbs
Project {
Product {
name: "dep"
Export {
Depends { name: "cpp" }
Group { files: ["main.cpp"] }
}
}
Application {
name: "app"
bundle.isBundle: false
Depends { name: "dep" }
}
}
| Fix autotest for OS X. | Fix autotest for OS X.
Change-Id: I4a7b804e03516d4c69ba77ba45b2884cc4364790
Reviewed-by: Joerg Bornemann <47777b9406dbddd02a3fdca8341789a013805a11@theqtcompany.com>
| QML | lgpl-2.1 | qt-labs/qbs,qt-labs/qbs,gatzka/qt-labs-qbs,gatzka/qt-labs-qbs,qtproject/qt-labs-qbs,qt-labs/qbs,qtproject/qt-labs-qbs,qt-labs/qbs,qtproject/qt-labs-qbs,gatzka/qt-labs-qbs,qt-labs/qbs,qtproject/qt-labs-qbs,gatzka/qt-labs-qbs,gatzka/qt-labs-qbs,qtproject/qt-labs-qbs,qtproject/qt-labs-qbs,qtproject/qt-labs-qbs,qt-labs/qbs,qt-labs/qbs,gatzka/qt-labs-qbs,gatzka/qt-labs-qbs | qml | ## Code Before:
import qbs
Project {
Product {
name: "dep"
Export {
Depends { name: "cpp" }
Group { files: ["main.cpp"] }
}
}
Application {
name: "app"
Depends { name: "dep" }
}
}
## Instruction:
Fix autotest for OS X.
Change-Id: I4a7b804e03516d4c69ba77ba45b2884cc4364790
Reviewed-by: Joerg Bornemann <47777b9406dbddd02a3fdca8341789a013805a11@theqtcompany.com>
## Code After:
import qbs
Project {
Product {
name: "dep"
Export {
Depends { name: "cpp" }
Group { files: ["main.cpp"] }
}
}
Application {
name: "app"
bundle.isBundle: false
Depends { name: "dep" }
}
}
| import qbs
Project {
Product {
name: "dep"
Export {
Depends { name: "cpp" }
Group { files: ["main.cpp"] }
}
}
Application {
name: "app"
+ bundle.isBundle: false
Depends { name: "dep" }
}
} | 1 | 0.0625 | 1 | 0 |
3c8514ba103d5d987d2269c421a3cc09e6784904 | .travis.yml | .travis.yml | language: rust
sudo: false
cache: cargo
os:
- linux
- osx
rust:
- 1.15.0
- stable
script:
- cargo test --no-default-features
| language: rust
sudo: false
cache: cargo
os:
- linux
- osx
rust:
- 1.15.0
- stable
- nightly
matrix:
fast_finish: true
allow_failures:
- rust: nightly
script:
- cargo test --no-default-features
| Make Travis test alacritty on nightly Rust, but allow failures | Make Travis test alacritty on nightly Rust, but allow failures
This allows us to notice and report any regressions that have occured on
nightly, without requiring tests to pass on nightly for the entire build
to succeed.
The `fast_finish` flag will cause Travis to mark the build as successful
if the only builds still running are allowed to fail (e.g. `nightly`).
This allows us to manually inspect builds (or implement some form of
notifications) to see if any nightly regressions have occured, without
slowing down the overall build time.
| YAML | apache-2.0 | alacritty/alacritty,jwilm/alacritty,jwilm/alacritty,alacritty/alacritty,jwilm/alacritty,jwilm/alacritty | yaml | ## Code Before:
language: rust
sudo: false
cache: cargo
os:
- linux
- osx
rust:
- 1.15.0
- stable
script:
- cargo test --no-default-features
## Instruction:
Make Travis test alacritty on nightly Rust, but allow failures
This allows us to notice and report any regressions that have occured on
nightly, without requiring tests to pass on nightly for the entire build
to succeed.
The `fast_finish` flag will cause Travis to mark the build as successful
if the only builds still running are allowed to fail (e.g. `nightly`).
This allows us to manually inspect builds (or implement some form of
notifications) to see if any nightly regressions have occured, without
slowing down the overall build time.
## Code After:
language: rust
sudo: false
cache: cargo
os:
- linux
- osx
rust:
- 1.15.0
- stable
- nightly
matrix:
fast_finish: true
allow_failures:
- rust: nightly
script:
- cargo test --no-default-features
| language: rust
sudo: false
cache: cargo
os:
- linux
- osx
rust:
- 1.15.0
- stable
+ - nightly
+
+ matrix:
+ fast_finish: true
+ allow_failures:
+ - rust: nightly
script:
- cargo test --no-default-features | 6 | 0.4 | 6 | 0 |
369adf5a3a303612edf9f0169c7b37b7c711a852 | frappe/website/page_renderers/web_page.py | frappe/website/page_renderers/web_page.py | import frappe
class WebPage(object):
def __init__(self, path=None, http_status_code=None):
self.headers = None
self.http_status_code = http_status_code or 200
if not path:
path = frappe.local.request.path
self.path = path.strip('/ ')
self.basepath = None
self.basename = None
self.name = None
self.route = None
self.file_dir = None
def can_render(self):
pass
def render(self):
pass
| import frappe
class WebPage(object):
def __init__(self, path=None, http_status_code=None):
self.headers = None
self.http_status_code = http_status_code or 200
if not path:
path = frappe.local.request.path
self.path = path.strip('/ ')
self.basepath = ''
self.basename = ''
self.name = ''
self.route = ''
self.file_dir = None
def can_render(self):
pass
def render(self):
pass
| Set default value as empty string | fix: Set default value as empty string
| Python | mit | frappe/frappe,mhbu50/frappe,frappe/frappe,StrellaGroup/frappe,frappe/frappe,almeidapaulopt/frappe,yashodhank/frappe,almeidapaulopt/frappe,mhbu50/frappe,yashodhank/frappe,StrellaGroup/frappe,mhbu50/frappe,almeidapaulopt/frappe,yashodhank/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,mhbu50/frappe,yashodhank/frappe | python | ## Code Before:
import frappe
class WebPage(object):
def __init__(self, path=None, http_status_code=None):
self.headers = None
self.http_status_code = http_status_code or 200
if not path:
path = frappe.local.request.path
self.path = path.strip('/ ')
self.basepath = None
self.basename = None
self.name = None
self.route = None
self.file_dir = None
def can_render(self):
pass
def render(self):
pass
## Instruction:
fix: Set default value as empty string
## Code After:
import frappe
class WebPage(object):
def __init__(self, path=None, http_status_code=None):
self.headers = None
self.http_status_code = http_status_code or 200
if not path:
path = frappe.local.request.path
self.path = path.strip('/ ')
self.basepath = ''
self.basename = ''
self.name = ''
self.route = ''
self.file_dir = None
def can_render(self):
pass
def render(self):
pass
| import frappe
class WebPage(object):
def __init__(self, path=None, http_status_code=None):
self.headers = None
self.http_status_code = http_status_code or 200
if not path:
path = frappe.local.request.path
self.path = path.strip('/ ')
- self.basepath = None
? ^^^^
+ self.basepath = ''
? ^^
- self.basename = None
? ^^^^
+ self.basename = ''
? ^^
- self.name = None
? ^^^^
+ self.name = ''
? ^^
- self.route = None
? ^^^^
+ self.route = ''
? ^^
self.file_dir = None
def can_render(self):
pass
def render(self):
pass
| 8 | 0.380952 | 4 | 4 |
5ce4eeef423d77b80f6f8af8938b7885ecdabaaa | scripts/node4ords.sh | scripts/node4ords.sh | mkdir /var/www
cd /var/www
#Get project
git clone https://github.com/OraOpenSource/node4ords.git
cd ./node4ords
sed -i "s/http\:\/\/localhost:8080/http\:\/\/localhost:${OOS_TOMCAT_PORT}/" config.js
npm install --unsafe-perm
#Start on boot
cd $OOS_SOURCE_DIR
cp init.d/node4ords /etc/systemd/system/node4ords.service
mkdir -p /ords/conf/node4ords
cp init.d/node4ords.conf /ords/conf/node4ords/
systemctl enable node4ords.service
systemctl start node4ords.service
| mkdir /var/www
cd /var/www
#Get project
git clone https://github.com/OraOpenSource/node4ords.git
cd ./node4ords
sed -i "s/http\:\/\/localhost:8080/http\:\/\/localhost:${OOS_TOMCAT_PORT}/" config.js
npm install --unsafe-perm
#Start on boot
cd $OOS_SOURCE_DIR
cp init.d/node4ords.service /etc/systemd/system/
mkdir -p /ords/conf/node4ords
cp init.d/node4ords.conf /ords/conf/node4ords/
systemctl enable node4ords.service
systemctl start node4ords.service
| Update copy to reference service file | Update copy to reference service file
| Shell | mit | OraOpenSource/oraclexe-apex,okusnadi/oraclexe-apex,OraOpenSource/OXAR | shell | ## Code Before:
mkdir /var/www
cd /var/www
#Get project
git clone https://github.com/OraOpenSource/node4ords.git
cd ./node4ords
sed -i "s/http\:\/\/localhost:8080/http\:\/\/localhost:${OOS_TOMCAT_PORT}/" config.js
npm install --unsafe-perm
#Start on boot
cd $OOS_SOURCE_DIR
cp init.d/node4ords /etc/systemd/system/node4ords.service
mkdir -p /ords/conf/node4ords
cp init.d/node4ords.conf /ords/conf/node4ords/
systemctl enable node4ords.service
systemctl start node4ords.service
## Instruction:
Update copy to reference service file
## Code After:
mkdir /var/www
cd /var/www
#Get project
git clone https://github.com/OraOpenSource/node4ords.git
cd ./node4ords
sed -i "s/http\:\/\/localhost:8080/http\:\/\/localhost:${OOS_TOMCAT_PORT}/" config.js
npm install --unsafe-perm
#Start on boot
cd $OOS_SOURCE_DIR
cp init.d/node4ords.service /etc/systemd/system/
mkdir -p /ords/conf/node4ords
cp init.d/node4ords.conf /ords/conf/node4ords/
systemctl enable node4ords.service
systemctl start node4ords.service
| mkdir /var/www
cd /var/www
#Get project
git clone https://github.com/OraOpenSource/node4ords.git
cd ./node4ords
sed -i "s/http\:\/\/localhost:8080/http\:\/\/localhost:${OOS_TOMCAT_PORT}/" config.js
npm install --unsafe-perm
#Start on boot
cd $OOS_SOURCE_DIR
- cp init.d/node4ords /etc/systemd/system/node4ords.service
? -----------------
+ cp init.d/node4ords.service /etc/systemd/system/
? ++++++++
mkdir -p /ords/conf/node4ords
cp init.d/node4ords.conf /ords/conf/node4ords/
systemctl enable node4ords.service
systemctl start node4ords.service | 2 | 0.111111 | 1 | 1 |
73007bf3b2764c464dd475fa62d8c2651efe20eb | setup.py | setup.py | import os
from setuptools import setup
readme_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'README.rst',
)
long_description = open(readme_path).read()
version_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'VERSION',
)
version = open(version_path).read()
setup(
name='flask-ldap3-login',
version=version,
packages=['flask_ldap3_login'],
author="Nick Whyte",
author_email='nick@nickwhyte.com',
description="LDAP Support for Flask in Python3/2",
long_description=long_description,
url='https://github.com/nickw444/flask-ldap3-login',
zip_safe=False,
install_requires=[
"ldap3",
"Flask",
"Flask-wtf",
"enum34"
],
classifiers=[
'Intended Audience :: Developers',
'Programming Language :: Python',
'Environment :: Web Environment',
'Framework :: Flask',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 2.6',
],
test_suite="flask_ldap3_login_tests",
)
| import os
from setuptools import setup
readme_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'README.rst',
)
long_description = open(readme_path).read()
version_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'VERSION',
)
version = open(version_path).read()
requires = ['ldap3' ,'Flask', 'Flask-wtf']
try:
import enum
except Exception as e:
requires.append('enum34')
setup(
name='flask-ldap3-login',
version=version,
packages=['flask_ldap3_login'],
author="Nick Whyte",
author_email='nick@nickwhyte.com',
description="LDAP Support for Flask in Python3/2",
long_description=long_description,
url='https://github.com/nickw444/flask-ldap3-login',
zip_safe=False,
install_requires=requires,
classifiers=[
'Intended Audience :: Developers',
'Programming Language :: Python',
'Environment :: Web Environment',
'Framework :: Flask',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 2.6',
],
test_suite="flask_ldap3_login_tests",
)
| Fix for when using python3.5. Don't install enum34 if enum already exists (python35) | Fix for when using python3.5. Don't install enum34 if enum already exists (python35)
| Python | mit | mwielgoszewski/flask-ldap3-login,nickw444/flask-ldap3-login | python | ## Code Before:
import os
from setuptools import setup
readme_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'README.rst',
)
long_description = open(readme_path).read()
version_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'VERSION',
)
version = open(version_path).read()
setup(
name='flask-ldap3-login',
version=version,
packages=['flask_ldap3_login'],
author="Nick Whyte",
author_email='nick@nickwhyte.com',
description="LDAP Support for Flask in Python3/2",
long_description=long_description,
url='https://github.com/nickw444/flask-ldap3-login',
zip_safe=False,
install_requires=[
"ldap3",
"Flask",
"Flask-wtf",
"enum34"
],
classifiers=[
'Intended Audience :: Developers',
'Programming Language :: Python',
'Environment :: Web Environment',
'Framework :: Flask',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 2.6',
],
test_suite="flask_ldap3_login_tests",
)
## Instruction:
Fix for when using python3.5. Don't install enum34 if enum already exists (python35)
## Code After:
import os
from setuptools import setup
readme_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'README.rst',
)
long_description = open(readme_path).read()
version_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'VERSION',
)
version = open(version_path).read()
requires = ['ldap3' ,'Flask', 'Flask-wtf']
try:
import enum
except Exception as e:
requires.append('enum34')
setup(
name='flask-ldap3-login',
version=version,
packages=['flask_ldap3_login'],
author="Nick Whyte",
author_email='nick@nickwhyte.com',
description="LDAP Support for Flask in Python3/2",
long_description=long_description,
url='https://github.com/nickw444/flask-ldap3-login',
zip_safe=False,
install_requires=requires,
classifiers=[
'Intended Audience :: Developers',
'Programming Language :: Python',
'Environment :: Web Environment',
'Framework :: Flask',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 2.6',
],
test_suite="flask_ldap3_login_tests",
)
| import os
from setuptools import setup
readme_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'README.rst',
)
long_description = open(readme_path).read()
version_path = os.path.join(os.path.dirname(
os.path.abspath(__file__)),
'VERSION',
)
version = open(version_path).read()
+
+
+ requires = ['ldap3' ,'Flask', 'Flask-wtf']
+ try:
+ import enum
+ except Exception as e:
+ requires.append('enum34')
+
setup(
name='flask-ldap3-login',
version=version,
packages=['flask_ldap3_login'],
author="Nick Whyte",
author_email='nick@nickwhyte.com',
description="LDAP Support for Flask in Python3/2",
long_description=long_description,
url='https://github.com/nickw444/flask-ldap3-login',
zip_safe=False,
- install_requires=[
? ^
+ install_requires=requires,
? ^^^^^^^^^
- "ldap3",
- "Flask",
- "Flask-wtf",
- "enum34"
- ],
classifiers=[
'Intended Audience :: Developers',
'Programming Language :: Python',
'Environment :: Web Environment',
'Framework :: Flask',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 2.6',
],
test_suite="flask_ldap3_login_tests",
) | 15 | 0.357143 | 9 | 6 |
4b516c3c5a41476be8b4ede752eea260879a0602 | includes/StackAllocator.h | includes/StackAllocator.h |
class StackAllocator : public Allocator {
protected:
void* m_start_ptr;
std::size_t m_offset;
public:
StackAllocator(const std::size_t totalSize);
virtual ~StackAllocator();
virtual void* Allocate(const std::size_t size, const short alignment = 0);
virtual void Free(const std::size_t size);
virtual void Init() override;
private:
StackAllocator(StackAllocator &stackAllocator);
struct AllocationHeader {
char padding;
};
};
#endif /* STACKALLOCATOR_H */ |
class StackAllocator : public Allocator {
protected:
void* m_start_ptr;
std::size_t m_offset;
public:
StackAllocator(const std::size_t totalSize);
virtual ~StackAllocator();
virtual void* Allocate(const std::size_t size, const short alignment = 0);
virtual void Free(void* ptr);
virtual void Init() override;
private:
StackAllocator(StackAllocator &stackAllocator);
struct AllocationHeader {
unsigned short padding;
};
};
#endif /* STACKALLOCATOR_H */ | Change allocation header member padding type from char to unsigned short | Change allocation header member padding type from char to unsigned short
| C | mit | mtrebi/memory-allocators | c | ## Code Before:
class StackAllocator : public Allocator {
protected:
void* m_start_ptr;
std::size_t m_offset;
public:
StackAllocator(const std::size_t totalSize);
virtual ~StackAllocator();
virtual void* Allocate(const std::size_t size, const short alignment = 0);
virtual void Free(const std::size_t size);
virtual void Init() override;
private:
StackAllocator(StackAllocator &stackAllocator);
struct AllocationHeader {
char padding;
};
};
#endif /* STACKALLOCATOR_H */
## Instruction:
Change allocation header member padding type from char to unsigned short
## Code After:
class StackAllocator : public Allocator {
protected:
void* m_start_ptr;
std::size_t m_offset;
public:
StackAllocator(const std::size_t totalSize);
virtual ~StackAllocator();
virtual void* Allocate(const std::size_t size, const short alignment = 0);
virtual void Free(void* ptr);
virtual void Init() override;
private:
StackAllocator(StackAllocator &stackAllocator);
struct AllocationHeader {
unsigned short padding;
};
};
#endif /* STACKALLOCATOR_H */ |
class StackAllocator : public Allocator {
protected:
void* m_start_ptr;
std::size_t m_offset;
public:
StackAllocator(const std::size_t totalSize);
virtual ~StackAllocator();
virtual void* Allocate(const std::size_t size, const short alignment = 0);
- virtual void Free(const std::size_t size);
+ virtual void Free(void* ptr);
virtual void Init() override;
private:
StackAllocator(StackAllocator &stackAllocator);
struct AllocationHeader {
- char padding;
+ unsigned short padding;
};
};
#endif /* STACKALLOCATOR_H */ | 4 | 0.153846 | 2 | 2 |
ffa2527715bc929f8bad2ab3d1ea744f81723e91 | .circle/deploy.sh | .circle/deploy.sh | ssh -t glowstone@185.116.156.30 "sudo systemctl stop glowstone" -o ConnectTimeout=15
ssh -t glowstone@185.116.156.30 "rm -rf glowstone.jar worlds/*" -o ConnectTimeout=15
sftp -b .circle/upload glowstone@185.116.156.30 -o ConnectTimeout=15
ssh -t glowstone@185.116.156.30 "sudo systemctl start glowstone" -o ConnectTimeout=15
| ssh -o ConnectTimeout=15 -t glowstone@185.116.156.30 "sudo systemctl stop glowstone"
ssh -o ConnectTimeout=15 -t glowstone@185.116.156.30 "rm -rf glowstone.jar worlds/*"
sftp -o ConnectTimeout=15 -b .circle/upload glowstone@185.116.156.30
ssh -o ConnectTimeout=15 -t glowstone@185.116.156.30 "sudo systemctl start glowstone"
| Move options before target host/commands | [CircleCI] Move options before target host/commands
| Shell | mit | GlowstonePlusPlus/GlowstonePlusPlus,GlowstonePlusPlus/GlowstonePlusPlus,GlowstoneMC/GlowstonePlusPlus,GlowstoneMC/GlowstonePlusPlus,GlowstonePlusPlus/GlowstonePlusPlus,GlowstoneMC/GlowstonePlusPlus,GlowstonePlusPlus/GlowstonePlusPlus,GlowstoneMC/GlowstonePlusPlus | shell | ## Code Before:
ssh -t glowstone@185.116.156.30 "sudo systemctl stop glowstone" -o ConnectTimeout=15
ssh -t glowstone@185.116.156.30 "rm -rf glowstone.jar worlds/*" -o ConnectTimeout=15
sftp -b .circle/upload glowstone@185.116.156.30 -o ConnectTimeout=15
ssh -t glowstone@185.116.156.30 "sudo systemctl start glowstone" -o ConnectTimeout=15
## Instruction:
[CircleCI] Move options before target host/commands
## Code After:
ssh -o ConnectTimeout=15 -t glowstone@185.116.156.30 "sudo systemctl stop glowstone"
ssh -o ConnectTimeout=15 -t glowstone@185.116.156.30 "rm -rf glowstone.jar worlds/*"
sftp -o ConnectTimeout=15 -b .circle/upload glowstone@185.116.156.30
ssh -o ConnectTimeout=15 -t glowstone@185.116.156.30 "sudo systemctl start glowstone"
| - ssh -t glowstone@185.116.156.30 "sudo systemctl stop glowstone" -o ConnectTimeout=15
? ---------------------
+ ssh -o ConnectTimeout=15 -t glowstone@185.116.156.30 "sudo systemctl stop glowstone"
? +++++++++++++++++++++
- ssh -t glowstone@185.116.156.30 "rm -rf glowstone.jar worlds/*" -o ConnectTimeout=15
? ---------------------
+ ssh -o ConnectTimeout=15 -t glowstone@185.116.156.30 "rm -rf glowstone.jar worlds/*"
? +++++++++++++++++++++
- sftp -b .circle/upload glowstone@185.116.156.30 -o ConnectTimeout=15
+ sftp -o ConnectTimeout=15 -b .circle/upload glowstone@185.116.156.30
- ssh -t glowstone@185.116.156.30 "sudo systemctl start glowstone" -o ConnectTimeout=15
? ---------------------
+ ssh -o ConnectTimeout=15 -t glowstone@185.116.156.30 "sudo systemctl start glowstone"
? +++++++++++++++++++++
| 8 | 2 | 4 | 4 |
12ccfab25a885a6c69685bb48dc783ecc358c86b | demo/router-components/echo.tsx | demo/router-components/echo.tsx | import app, { Component } from '../../index-jsx';
var model = 'world';
const Hello = ({name}) => <div>Hello: {name}</div>;
const view = (val) => {
return <div>
<Hello name={val}/>
<input value={val} oninput={function() { app.run('render', this.value)}}/>
</div>
};
const update = {
'#echo': (model, pushState) => pushState || model,
'render': (_, val) => {
history.pushState(null, null, '#echo/' + val);
return val;
}
}
export default (element) => app.start(element, model, view, update);
| import app from '../../index-jsx';
var model = 'world';
const Hello = ({name}) => <div>Hello: {name}</div>;
const view = (val) => {
return <div>
<Hello name={val}/>
<input value={val} oninput={function() { app.run('render', this.value)}}/>
</div>
};
const update = {
'#echo': (model, pushState) => pushState || model,
'render': (_, val) => {
history.pushState(null, null, '#echo/' + val);
return val;
}
}
export default (element) => app.start(element, model, view, update);
| Fix demo to use app.start instead of new Component | Fix demo to use app.start instead of new Component
| TypeScript | mit | yysun/apprun,yysun/apprun,yysun/apprun | typescript | ## Code Before:
import app, { Component } from '../../index-jsx';
var model = 'world';
const Hello = ({name}) => <div>Hello: {name}</div>;
const view = (val) => {
return <div>
<Hello name={val}/>
<input value={val} oninput={function() { app.run('render', this.value)}}/>
</div>
};
const update = {
'#echo': (model, pushState) => pushState || model,
'render': (_, val) => {
history.pushState(null, null, '#echo/' + val);
return val;
}
}
export default (element) => app.start(element, model, view, update);
## Instruction:
Fix demo to use app.start instead of new Component
## Code After:
import app from '../../index-jsx';
var model = 'world';
const Hello = ({name}) => <div>Hello: {name}</div>;
const view = (val) => {
return <div>
<Hello name={val}/>
<input value={val} oninput={function() { app.run('render', this.value)}}/>
</div>
};
const update = {
'#echo': (model, pushState) => pushState || model,
'render': (_, val) => {
history.pushState(null, null, '#echo/' + val);
return val;
}
}
export default (element) => app.start(element, model, view, update);
| - import app, { Component } from '../../index-jsx';
? ---------------
+ import app from '../../index-jsx';
var model = 'world';
const Hello = ({name}) => <div>Hello: {name}</div>;
const view = (val) => {
return <div>
<Hello name={val}/>
<input value={val} oninput={function() { app.run('render', this.value)}}/>
</div>
};
const update = {
'#echo': (model, pushState) => pushState || model,
'render': (_, val) => {
history.pushState(null, null, '#echo/' + val);
return val;
}
}
export default (element) => app.start(element, model, view, update); | 2 | 0.090909 | 1 | 1 |
f0e0e7f792181a87e50e749952c2ebb844bad3a8 | release-notes.yml | release-notes.yml | title: Release Notes of the Hub
description: >
Release-notes-hub is a hosting service for "Release Notes" -
an easy to use, human readable and machine processable schema for release notes.
releases:
- version: Next
added:
- Add `/mit-license` page for displaying the applying oss license. (#14)
- Redirect the user to the previously requested url after successfull login. (#16)
- Setup status page (https://status.release-notes.com)
- Add support for subscriptions (subscribe/unsubscribe). (#4)
- New origami pigeon logo and introduction of `/credits` page.
- version: 0.2.0
date: 2017-09-12
title: MVP - Second Release
description: This release improves form validation and adds support for updating release notes.
added:
- Add support for publishing a new revision of existing release-notes. (#5)
improved:
- Added help info on form fields.
changed:
- Introduce backend form validation. Restrict user and release note names to numbers, letters and dashes.
- version: 0.1.0
date: 2017-09-01
title: MVP - First Release
description: MVP implementation
added:
- MIT license.
- Display most recently updated release notes on home screen.
- Introduce accounts & session based auth.
- Upload & rendering of release notes.
- Styles based on bulma css framework.
- Basic express/kermit setup.
- Introduce these release notes.
| title: Release Notes of the Hub
description: >
Release-notes-hub is a hosting service for "Release Notes" -
an easy to use, human readable and machine processable schema for release notes.
releases:
- version: Next
added:
- Add `/mit-license` page for displaying the applying oss license. (#14)
- Redirect the user to the previously requested url after successfull login. (#16)
- Setup status page (https://status.release-notes.com)
- Add support for subscriptions (subscribe/unsubscribe). (#4)
- New origami pigeon logo and introduction of `/credits` page.
- Add support for broadcasting release notes update notifications to email subscribers. (#9)
- version: 0.2.0
date: 2017-09-12
title: MVP - Second Release
description: This release improves form validation and adds support for updating release notes.
added:
- Add support for publishing a new revision of existing release-notes. (#5)
improved:
- Added help info on form fields.
changed:
- Introduce backend form validation. Restrict user and release note names to numbers, letters and dashes.
- version: 0.1.0
date: 2017-09-01
title: MVP - First Release
description: MVP implementation
added:
- MIT license.
- Display most recently updated release notes on home screen.
- Introduce accounts & session based auth.
- Upload & rendering of release notes.
- Styles based on bulma css framework.
- Basic express/kermit setup.
- Introduce these release notes.
| Add release notes entry for update notifications. | Add release notes entry for update notifications.
| YAML | mit | release-notes/release-notes-hub,release-notes/release-notes-hub | yaml | ## Code Before:
title: Release Notes of the Hub
description: >
Release-notes-hub is a hosting service for "Release Notes" -
an easy to use, human readable and machine processable schema for release notes.
releases:
- version: Next
added:
- Add `/mit-license` page for displaying the applying oss license. (#14)
- Redirect the user to the previously requested url after successfull login. (#16)
- Setup status page (https://status.release-notes.com)
- Add support for subscriptions (subscribe/unsubscribe). (#4)
- New origami pigeon logo and introduction of `/credits` page.
- version: 0.2.0
date: 2017-09-12
title: MVP - Second Release
description: This release improves form validation and adds support for updating release notes.
added:
- Add support for publishing a new revision of existing release-notes. (#5)
improved:
- Added help info on form fields.
changed:
- Introduce backend form validation. Restrict user and release note names to numbers, letters and dashes.
- version: 0.1.0
date: 2017-09-01
title: MVP - First Release
description: MVP implementation
added:
- MIT license.
- Display most recently updated release notes on home screen.
- Introduce accounts & session based auth.
- Upload & rendering of release notes.
- Styles based on bulma css framework.
- Basic express/kermit setup.
- Introduce these release notes.
## Instruction:
Add release notes entry for update notifications.
## Code After:
title: Release Notes of the Hub
description: >
Release-notes-hub is a hosting service for "Release Notes" -
an easy to use, human readable and machine processable schema for release notes.
releases:
- version: Next
added:
- Add `/mit-license` page for displaying the applying oss license. (#14)
- Redirect the user to the previously requested url after successfull login. (#16)
- Setup status page (https://status.release-notes.com)
- Add support for subscriptions (subscribe/unsubscribe). (#4)
- New origami pigeon logo and introduction of `/credits` page.
- Add support for broadcasting release notes update notifications to email subscribers. (#9)
- version: 0.2.0
date: 2017-09-12
title: MVP - Second Release
description: This release improves form validation and adds support for updating release notes.
added:
- Add support for publishing a new revision of existing release-notes. (#5)
improved:
- Added help info on form fields.
changed:
- Introduce backend form validation. Restrict user and release note names to numbers, letters and dashes.
- version: 0.1.0
date: 2017-09-01
title: MVP - First Release
description: MVP implementation
added:
- MIT license.
- Display most recently updated release notes on home screen.
- Introduce accounts & session based auth.
- Upload & rendering of release notes.
- Styles based on bulma css framework.
- Basic express/kermit setup.
- Introduce these release notes.
| title: Release Notes of the Hub
description: >
Release-notes-hub is a hosting service for "Release Notes" -
an easy to use, human readable and machine processable schema for release notes.
releases:
- version: Next
added:
- Add `/mit-license` page for displaying the applying oss license. (#14)
- Redirect the user to the previously requested url after successfull login. (#16)
- Setup status page (https://status.release-notes.com)
- Add support for subscriptions (subscribe/unsubscribe). (#4)
- New origami pigeon logo and introduction of `/credits` page.
+ - Add support for broadcasting release notes update notifications to email subscribers. (#9)
- version: 0.2.0
date: 2017-09-12
title: MVP - Second Release
description: This release improves form validation and adds support for updating release notes.
added:
- Add support for publishing a new revision of existing release-notes. (#5)
improved:
- Added help info on form fields.
changed:
- Introduce backend form validation. Restrict user and release note names to numbers, letters and dashes.
- version: 0.1.0
date: 2017-09-01
title: MVP - First Release
description: MVP implementation
added:
- MIT license.
- Display most recently updated release notes on home screen.
- Introduce accounts & session based auth.
- Upload & rendering of release notes.
- Styles based on bulma css framework.
- Basic express/kermit setup.
- Introduce these release notes. | 1 | 0.028571 | 1 | 0 |
fb19192f80d283f23da32403e73a129238031bc9 | circle.yml | circle.yml | deployment:
production:
branch: master
commands:
- ssh -l openfisca legislation.openfisca.fr "cd legislation-explorer; ./deploy_prod.sh"
| dependencies:
cache_directories:
- "~/cache"
pre:
# Only create directory if not already present (--parents option).
- mkdir --parents ~/cache
post:
# Only downloads if not already present (--no-clobber option)
- cd ~/cache && wget --no-clobber http://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.0.jar
- java -jar ~/cache/selenium-server-standalone-3.3.0.jar:
background: true
deployment:
production:
branch: master
commands:
- ssh -l openfisca legislation.openfisca.fr "cd legislation-explorer; ./deploy_prod.sh"
| Install selenium standalone server in CI | Install selenium standalone server in CI
| YAML | agpl-3.0 | openfisca/legislation-explorer | yaml | ## Code Before:
deployment:
production:
branch: master
commands:
- ssh -l openfisca legislation.openfisca.fr "cd legislation-explorer; ./deploy_prod.sh"
## Instruction:
Install selenium standalone server in CI
## Code After:
dependencies:
cache_directories:
- "~/cache"
pre:
# Only create directory if not already present (--parents option).
- mkdir --parents ~/cache
post:
# Only downloads if not already present (--no-clobber option)
- cd ~/cache && wget --no-clobber http://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.0.jar
- java -jar ~/cache/selenium-server-standalone-3.3.0.jar:
background: true
deployment:
production:
branch: master
commands:
- ssh -l openfisca legislation.openfisca.fr "cd legislation-explorer; ./deploy_prod.sh"
| + dependencies:
+ cache_directories:
+ - "~/cache"
+ pre:
+ # Only create directory if not already present (--parents option).
+ - mkdir --parents ~/cache
+ post:
+ # Only downloads if not already present (--no-clobber option)
+ - cd ~/cache && wget --no-clobber http://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.0.jar
+ - java -jar ~/cache/selenium-server-standalone-3.3.0.jar:
+ background: true
deployment:
production:
branch: master
commands:
- ssh -l openfisca legislation.openfisca.fr "cd legislation-explorer; ./deploy_prod.sh" | 11 | 2.2 | 11 | 0 |
b5354a5ec9d615691c40c885417f8a4086ca6eed | app/views/koi/settings/_field_tags.html.erb | app/views/koi/settings/_field_tags.html.erb | <%- id = "koi-#{ new_uuid }" -%>
<% if object.respond_to?("#{object.key.singularize}_list".to_sym) %>
<%= f.input "#{object.key.singularize}_list".to_sym, as: :string, input_html: { id: id, style: 'width:500px' }, label: label %>
<%= render "koi/admin_crud/form_field_collection_errors", f: f, attr: attr %>
<script type='text/javascript'>
$("#<%= id %>").select2({
tags: <%= raw Setting.tag_counts_on(object.key.to_s.chomp('_list')).collect { |t| t.name } %>,
tokenSeparators: [","]
});
</script>
<% else %>
<%= f.input attr, as: :string, label: label %>
<% end %>
| <%- id = "koi-#{ new_uuid }" -%>
<% if object.respond_to?("#{object.key.singularize}_list".to_sym) %>
<%= f.input "#{object.key.singularize}_list".to_sym, as: :string, input_html: { id: id, style: 'width:500px' }, label: label %>
<%= render "koi/admin_crud/form_field_collection_errors", f: f, attr: attr %>
<%
tag_list = Setting.tag_counts_on(object.key.to_s.chomp('_list')).collect { |t| t.name }
tag_list = tag_list | object.data_source.call if object.data_source
%>
<script type='text/javascript'>
$("#<%= id %>").select2({
tags: <%= raw tag_list %>,
tokenSeparators: [","]
});
</script>
<% else %>
<%= f.input attr, as: :string, label: label %>
<% end %>
| Append any data_source tags to the existing tag list for extensibility. | Append any data_source tags to the existing tag list for extensibility.
| HTML+ERB | mit | katalyst/koi,katalyst/koi,katalyst/koi | html+erb | ## Code Before:
<%- id = "koi-#{ new_uuid }" -%>
<% if object.respond_to?("#{object.key.singularize}_list".to_sym) %>
<%= f.input "#{object.key.singularize}_list".to_sym, as: :string, input_html: { id: id, style: 'width:500px' }, label: label %>
<%= render "koi/admin_crud/form_field_collection_errors", f: f, attr: attr %>
<script type='text/javascript'>
$("#<%= id %>").select2({
tags: <%= raw Setting.tag_counts_on(object.key.to_s.chomp('_list')).collect { |t| t.name } %>,
tokenSeparators: [","]
});
</script>
<% else %>
<%= f.input attr, as: :string, label: label %>
<% end %>
## Instruction:
Append any data_source tags to the existing tag list for extensibility.
## Code After:
<%- id = "koi-#{ new_uuid }" -%>
<% if object.respond_to?("#{object.key.singularize}_list".to_sym) %>
<%= f.input "#{object.key.singularize}_list".to_sym, as: :string, input_html: { id: id, style: 'width:500px' }, label: label %>
<%= render "koi/admin_crud/form_field_collection_errors", f: f, attr: attr %>
<%
tag_list = Setting.tag_counts_on(object.key.to_s.chomp('_list')).collect { |t| t.name }
tag_list = tag_list | object.data_source.call if object.data_source
%>
<script type='text/javascript'>
$("#<%= id %>").select2({
tags: <%= raw tag_list %>,
tokenSeparators: [","]
});
</script>
<% else %>
<%= f.input attr, as: :string, label: label %>
<% end %>
| <%- id = "koi-#{ new_uuid }" -%>
<% if object.respond_to?("#{object.key.singularize}_list".to_sym) %>
<%= f.input "#{object.key.singularize}_list".to_sym, as: :string, input_html: { id: id, style: 'width:500px' }, label: label %>
<%= render "koi/admin_crud/form_field_collection_errors", f: f, attr: attr %>
+ <%
+ tag_list = Setting.tag_counts_on(object.key.to_s.chomp('_list')).collect { |t| t.name }
+ tag_list = tag_list | object.data_source.call if object.data_source
+ %>
+
<script type='text/javascript'>
$("#<%= id %>").select2({
- tags: <%= raw Setting.tag_counts_on(object.key.to_s.chomp('_list')).collect { |t| t.name } %>,
+ tags: <%= raw tag_list %>,
tokenSeparators: [","]
});
</script>
<% else %>
<%= f.input attr, as: :string, label: label %>
<% end %> | 7 | 0.4375 | 6 | 1 |
39c5b3d83fb77c430ea03f89197e9b6d16b29010 | gradle.properties | gradle.properties |
VERSION_NAME=0.11.0
GROUP=com.facebook.testing.screenshot
POM_DESCRIPTION=Screenshot Testing framework for Android.
POM_URL=https://github.com/facebook/screenshot-tests-for-android
POM_SCM_URL=https://github.com/facebook/screenshot-tests-for-android.git
POM_SCM_CONNECTION=scm:git@github.com:facebook/screenshot-tests-for-android.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:facebook/screenshot-tests-for-android.git
POM_LICENCE_NAME=Apache-2
POM_LICENCE_URL=https://github.com/facebook/screenshot-tests-for-android/blob/master/LICENSE
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=facebook
POM_DEVELOPER_NAME=Facebook
org.gradle.configureondemand=true
android.useAndroidX = true
android.enableJetifier = false
|
VERSION_NAME=0.11.1-SNAPSHOT
GROUP=com.facebook.testing.screenshot
POM_DESCRIPTION=Screenshot Testing framework for Android.
POM_URL=https://github.com/facebook/screenshot-tests-for-android
POM_SCM_URL=https://github.com/facebook/screenshot-tests-for-android.git
POM_SCM_CONNECTION=scm:git@github.com:facebook/screenshot-tests-for-android.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:facebook/screenshot-tests-for-android.git
POM_LICENCE_NAME=Apache-2
POM_LICENCE_URL=https://github.com/facebook/screenshot-tests-for-android/blob/master/LICENSE
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=facebook
POM_DEVELOPER_NAME=Facebook
org.gradle.configureondemand=true
android.useAndroidX = true
android.enableJetifier = false
| Prepare for next development version | Prepare for next development version
Summary: Using a minor version bump which seems more consistent to me /shrug
Reviewed By: sjkirby
Differential Revision: D17989007
fbshipit-source-id: 5889b332de9c563650df134bfe1e00684baafb8b
| INI | apache-2.0 | facebook/screenshot-tests-for-android,facebook/screenshot-tests-for-android,facebook/screenshot-tests-for-android,facebook/screenshot-tests-for-android | ini | ## Code Before:
VERSION_NAME=0.11.0
GROUP=com.facebook.testing.screenshot
POM_DESCRIPTION=Screenshot Testing framework for Android.
POM_URL=https://github.com/facebook/screenshot-tests-for-android
POM_SCM_URL=https://github.com/facebook/screenshot-tests-for-android.git
POM_SCM_CONNECTION=scm:git@github.com:facebook/screenshot-tests-for-android.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:facebook/screenshot-tests-for-android.git
POM_LICENCE_NAME=Apache-2
POM_LICENCE_URL=https://github.com/facebook/screenshot-tests-for-android/blob/master/LICENSE
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=facebook
POM_DEVELOPER_NAME=Facebook
org.gradle.configureondemand=true
android.useAndroidX = true
android.enableJetifier = false
## Instruction:
Prepare for next development version
Summary: Using a minor version bump which seems more consistent to me /shrug
Reviewed By: sjkirby
Differential Revision: D17989007
fbshipit-source-id: 5889b332de9c563650df134bfe1e00684baafb8b
## Code After:
VERSION_NAME=0.11.1-SNAPSHOT
GROUP=com.facebook.testing.screenshot
POM_DESCRIPTION=Screenshot Testing framework for Android.
POM_URL=https://github.com/facebook/screenshot-tests-for-android
POM_SCM_URL=https://github.com/facebook/screenshot-tests-for-android.git
POM_SCM_CONNECTION=scm:git@github.com:facebook/screenshot-tests-for-android.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:facebook/screenshot-tests-for-android.git
POM_LICENCE_NAME=Apache-2
POM_LICENCE_URL=https://github.com/facebook/screenshot-tests-for-android/blob/master/LICENSE
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=facebook
POM_DEVELOPER_NAME=Facebook
org.gradle.configureondemand=true
android.useAndroidX = true
android.enableJetifier = false
|
- VERSION_NAME=0.11.0
? ^
+ VERSION_NAME=0.11.1-SNAPSHOT
? ^^^^^^^^^^
GROUP=com.facebook.testing.screenshot
POM_DESCRIPTION=Screenshot Testing framework for Android.
POM_URL=https://github.com/facebook/screenshot-tests-for-android
POM_SCM_URL=https://github.com/facebook/screenshot-tests-for-android.git
POM_SCM_CONNECTION=scm:git@github.com:facebook/screenshot-tests-for-android.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:facebook/screenshot-tests-for-android.git
POM_LICENCE_NAME=Apache-2
POM_LICENCE_URL=https://github.com/facebook/screenshot-tests-for-android/blob/master/LICENSE
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=facebook
POM_DEVELOPER_NAME=Facebook
org.gradle.configureondemand=true
android.useAndroidX = true
android.enableJetifier = false | 2 | 0.095238 | 1 | 1 |
e17668e397c257e4a141ca5603fcf083277c012b | playbooks/vagrant-devstack.yml | playbooks/vagrant-devstack.yml | - name: Configure instance(s)
hosts: all
sudo: True
gather_facts: True
vars:
migrate_db: 'yes'
openid_workaround: true
devstack: true
disable_edx_services: true
mongo_enable_journal: false
EDXAPP_NO_PREREQ_INSTALL: 0
COMMON_MOTD_TEMPLATE: 'devstack_motd.tail.j2'
COMMON_SSH_PASSWORD_AUTH: "yes"
ENABLE_LEGACY_ORA: !!null
EDXAPP_LMS_BASE: 127.0.0.1:8000
EDXAPP_OAUTH_ENFORCE_SECURE: false
EDXAPP_LMS_BASE_SCHEME: http
roles:
- edx_ansible
- mysql
- edxlocal
- mongo
- edxapp
- oraclejdk
- elasticsearch
- forum
- ecommerce
- ecomworker
- { role: 'rabbitmq', rabbitmq_ip: '127.0.0.1' }
- programs
- role: notifier
NOTIFIER_DIGEST_TASK_INTERVAL: "5"
- role: ora
when: ENABLE_LEGACY_ORA
- browsers
- browsermob-proxy
- local_dev
- demo
- oauth_client_setup
| - name: Configure instance(s)
hosts: all
sudo: True
gather_facts: True
vars:
migrate_db: 'yes'
openid_workaround: true
devstack: true
disable_edx_services: true
mongo_enable_journal: false
EDXAPP_NO_PREREQ_INSTALL: 0
COMMON_MOTD_TEMPLATE: 'devstack_motd.tail.j2'
COMMON_SSH_PASSWORD_AUTH: "yes"
ENABLE_LEGACY_ORA: !!null
EDXAPP_LMS_BASE: 127.0.0.1:8000
EDXAPP_OAUTH_ENFORCE_SECURE: false
EDXAPP_LMS_BASE_SCHEME: http
ECOMMERCE_DJANGO_SETTINGS_MODULE: "ecommerce.settings.devstack"
roles:
- edx_ansible
- mysql
- edxlocal
- mongo
- edxapp
- oraclejdk
- elasticsearch
- forum
- ecommerce
- ecomworker
- { role: 'rabbitmq', rabbitmq_ip: '127.0.0.1' }
- programs
- role: notifier
NOTIFIER_DIGEST_TASK_INTERVAL: "5"
- role: ora
when: ENABLE_LEGACY_ORA
- browsers
- browsermob-proxy
- local_dev
- demo
- oauth_client_setup
| Change ECOMMERCE_DJANGO_SETTINGS_MODULE to use devstack settings. | Change ECOMMERCE_DJANGO_SETTINGS_MODULE to use devstack settings.
| YAML | agpl-3.0 | open-craft/configuration,kursitet/configuration,gsehub/configuration,Stanford-Online/configuration,fghaas/edx-configuration,armaan/edx-configuration,edx/configuration,mitodl/configuration,hks-epod/configuration,openfun/configuration,jorgeomarmh/configuration,Stanford-Online/configuration,edx/configuration,EDUlib/configuration,gsehub/configuration,EDUlib/configuration,lgfa29/configuration,fghaas/edx-configuration,marcore/configuration,michaelsteiner19/open-edx-configuration,Livit/Livit.Learn.EdX.configuration,proversity-org/configuration,mitodl/configuration,arbrandes/edx-configuration,stvstnfrd/configuration,EDUlib/configuration,Livit/Livit.Learn.EdX.configuration,antoviaque/configuration,nunpa/configuration,rue89-tech/configuration,appsembler/configuration,hks-epod/configuration,CredoReference/configuration,nunpa/configuration,pobrejuanito/configuration,michaelsteiner19/open-edx-configuration,arbrandes/edx-configuration,armaan/edx-configuration,lgfa29/configuration,usernamenumber/configuration,rue89-tech/configuration,openfun/configuration,eduStack/configuration,alu042/configuration,kursitet/configuration,armaan/edx-configuration,Stanford-Online/configuration,hks-epod/configuration,arbrandes/edx-configuration,lgfa29/configuration,alu042/configuration,CredoReference/configuration,stvstnfrd/configuration,jorgeomarmh/configuration,rue89-tech/configuration,rue89-tech/configuration,openfun/configuration,stvstnfrd/configuration,mitodl/configuration,michaelsteiner19/open-edx-configuration,gsehub/configuration,gsehub/configuration,marcore/configuration,pobrejuanito/configuration,lgfa29/configuration,hastexo/edx-configuration,appsembler/configuration,kursitet/configuration,alu042/configuration,usernamenumber/configuration,michaelsteiner19/open-edx-configuration,hastexo/edx-configuration,fghaas/edx-configuration,rue89-tech/configuration,stvstnfrd/configuration,kursitet/configuration,eduStack/configuration,Livit/Livit.Learn.EdX.configuration,nunpa/configuration,hastexo/edx-configuration,edx/configuration,arbrandes/edx-configuration,usernamenumber/configuration,CredoReference/configuration,mitodl/configuration,armaan/edx-configuration,EDUlib/configuration,openfun/configuration,open-craft/configuration,Stanford-Online/configuration,edx/configuration,nunpa/configuration,usernamenumber/configuration,proversity-org/configuration,CredoReference/configuration,hks-epod/configuration,EDUlib/configuration,antoviaque/configuration,Livit/Livit.Learn.EdX.configuration,Stanford-Online/configuration,fghaas/edx-configuration,jorgeomarmh/configuration,proversity-org/configuration,appsembler/configuration,open-craft/configuration,hastexo/edx-configuration,appsembler/configuration,pobrejuanito/configuration,pobrejuanito/configuration,alu042/configuration,marcore/configuration,proversity-org/configuration,eduStack/configuration,hks-epod/configuration,hastexo/edx-configuration,open-craft/configuration,antoviaque/configuration,gsehub/configuration,marcore/configuration,jorgeomarmh/configuration,arbrandes/edx-configuration,antoviaque/configuration,stvstnfrd/configuration,proversity-org/configuration | yaml | ## Code Before:
- name: Configure instance(s)
hosts: all
sudo: True
gather_facts: True
vars:
migrate_db: 'yes'
openid_workaround: true
devstack: true
disable_edx_services: true
mongo_enable_journal: false
EDXAPP_NO_PREREQ_INSTALL: 0
COMMON_MOTD_TEMPLATE: 'devstack_motd.tail.j2'
COMMON_SSH_PASSWORD_AUTH: "yes"
ENABLE_LEGACY_ORA: !!null
EDXAPP_LMS_BASE: 127.0.0.1:8000
EDXAPP_OAUTH_ENFORCE_SECURE: false
EDXAPP_LMS_BASE_SCHEME: http
roles:
- edx_ansible
- mysql
- edxlocal
- mongo
- edxapp
- oraclejdk
- elasticsearch
- forum
- ecommerce
- ecomworker
- { role: 'rabbitmq', rabbitmq_ip: '127.0.0.1' }
- programs
- role: notifier
NOTIFIER_DIGEST_TASK_INTERVAL: "5"
- role: ora
when: ENABLE_LEGACY_ORA
- browsers
- browsermob-proxy
- local_dev
- demo
- oauth_client_setup
## Instruction:
Change ECOMMERCE_DJANGO_SETTINGS_MODULE to use devstack settings.
## Code After:
- name: Configure instance(s)
hosts: all
sudo: True
gather_facts: True
vars:
migrate_db: 'yes'
openid_workaround: true
devstack: true
disable_edx_services: true
mongo_enable_journal: false
EDXAPP_NO_PREREQ_INSTALL: 0
COMMON_MOTD_TEMPLATE: 'devstack_motd.tail.j2'
COMMON_SSH_PASSWORD_AUTH: "yes"
ENABLE_LEGACY_ORA: !!null
EDXAPP_LMS_BASE: 127.0.0.1:8000
EDXAPP_OAUTH_ENFORCE_SECURE: false
EDXAPP_LMS_BASE_SCHEME: http
ECOMMERCE_DJANGO_SETTINGS_MODULE: "ecommerce.settings.devstack"
roles:
- edx_ansible
- mysql
- edxlocal
- mongo
- edxapp
- oraclejdk
- elasticsearch
- forum
- ecommerce
- ecomworker
- { role: 'rabbitmq', rabbitmq_ip: '127.0.0.1' }
- programs
- role: notifier
NOTIFIER_DIGEST_TASK_INTERVAL: "5"
- role: ora
when: ENABLE_LEGACY_ORA
- browsers
- browsermob-proxy
- local_dev
- demo
- oauth_client_setup
| - name: Configure instance(s)
hosts: all
sudo: True
gather_facts: True
vars:
migrate_db: 'yes'
openid_workaround: true
devstack: true
disable_edx_services: true
mongo_enable_journal: false
EDXAPP_NO_PREREQ_INSTALL: 0
COMMON_MOTD_TEMPLATE: 'devstack_motd.tail.j2'
COMMON_SSH_PASSWORD_AUTH: "yes"
ENABLE_LEGACY_ORA: !!null
EDXAPP_LMS_BASE: 127.0.0.1:8000
EDXAPP_OAUTH_ENFORCE_SECURE: false
EDXAPP_LMS_BASE_SCHEME: http
+ ECOMMERCE_DJANGO_SETTINGS_MODULE: "ecommerce.settings.devstack"
roles:
- edx_ansible
- mysql
- edxlocal
- mongo
- edxapp
- oraclejdk
- elasticsearch
- forum
- ecommerce
- ecomworker
- { role: 'rabbitmq', rabbitmq_ip: '127.0.0.1' }
- programs
- role: notifier
NOTIFIER_DIGEST_TASK_INTERVAL: "5"
- role: ora
when: ENABLE_LEGACY_ORA
- browsers
- browsermob-proxy
- local_dev
- demo
- oauth_client_setup | 1 | 0.025641 | 1 | 0 |
14e6af87071c45a603302fac67deabe8d51c2dc8 | Resources/ui/common/questions/DateQuestionView.js | Resources/ui/common/questions/DateQuestionView.js | //DateQuestionView Component Constructor
function DateQuestionView(question, content) {
var self = Ti.UI.createPicker({
type : Ti.UI.PICKER_TYPE_DATE,
value : new Date(),
color : '#336699',
right : 5,
left : 5,
});
self.addEventListener('change', function(e) {
this.value = e.value;
});
self.getValue = function() {
var val = this.value.toISOString();
return val.substr(0, val.indexOf('T')).replace(/-/g, '/');
};
if (content) self.setValue(new Date(content));
return self;
}
module.exports = DateQuestionView;
| //DateQuestionView Component Constructor
function DateQuestionView(question, content) {
var self = Ti.UI.createPicker({
type : Ti.UI.PICKER_TYPE_DATE,
value : content ? new Date(content) : new Date(),
color : '#336699',
right : 5,
left : 5,
});
self.addEventListener('change', function(e) {
this.value = e.value;
});
self.getValue = function() {
var val = self.value;
return val.getFullYear() + '/' + (val.getMonth() + 1) + '/' + val.getDate()
};
return self;
}
module.exports = DateQuestionView;
| Fix the date-picker edit flow in Android. | Fix the date-picker edit flow in Android.
Months/days were randomly getting incremented/decremented. Manually
create the date instead of using `toISOString`
| JavaScript | mit | nilenso/ashoka-survey-mobile,nilenso/ashoka-survey-mobile | javascript | ## Code Before:
//DateQuestionView Component Constructor
function DateQuestionView(question, content) {
var self = Ti.UI.createPicker({
type : Ti.UI.PICKER_TYPE_DATE,
value : new Date(),
color : '#336699',
right : 5,
left : 5,
});
self.addEventListener('change', function(e) {
this.value = e.value;
});
self.getValue = function() {
var val = this.value.toISOString();
return val.substr(0, val.indexOf('T')).replace(/-/g, '/');
};
if (content) self.setValue(new Date(content));
return self;
}
module.exports = DateQuestionView;
## Instruction:
Fix the date-picker edit flow in Android.
Months/days were randomly getting incremented/decremented. Manually
create the date instead of using `toISOString`
## Code After:
//DateQuestionView Component Constructor
function DateQuestionView(question, content) {
var self = Ti.UI.createPicker({
type : Ti.UI.PICKER_TYPE_DATE,
value : content ? new Date(content) : new Date(),
color : '#336699',
right : 5,
left : 5,
});
self.addEventListener('change', function(e) {
this.value = e.value;
});
self.getValue = function() {
var val = self.value;
return val.getFullYear() + '/' + (val.getMonth() + 1) + '/' + val.getDate()
};
return self;
}
module.exports = DateQuestionView;
| //DateQuestionView Component Constructor
function DateQuestionView(question, content) {
var self = Ti.UI.createPicker({
type : Ti.UI.PICKER_TYPE_DATE,
- value : new Date(),
+ value : content ? new Date(content) : new Date(),
color : '#336699',
right : 5,
left : 5,
});
self.addEventListener('change', function(e) {
this.value = e.value;
});
self.getValue = function() {
- var val = this.value.toISOString();
- return val.substr(0, val.indexOf('T')).replace(/-/g, '/');
+ var val = self.value;
+ return val.getFullYear() + '/' + (val.getMonth() + 1) + '/' + val.getDate()
};
- if (content) self.setValue(new Date(content));
return self;
}
module.exports = DateQuestionView; | 7 | 0.304348 | 3 | 4 |
4911ac664fa63ac284ebd42dff248b02947a5bc0 | README.md | README.md | Demonstration of DAO pattern in Java
## DAO
DAO is a pattern used interchangeably with Repository. The purpose of DAO is to abstract database code from the rest of the application. In comparison to Repository DAO provides access to single entity and defines standard operations to be performed on a model class (entity).
## DAO vs Repository
From my point of view Repository is a pattern which resides close to the domain layer and it should be considered as part of Domain Driven Design. For more information about Domain Driven Design see [this article](http://culttt.com/2014/11/12/domain-model-domain-driven-design/).
In contrast to DAO, Repository provides access to Aggregate Roots not single entities and hides internal object state from the client. According to Martin Fowler, [Repositories acts as collection of in-memory domain objects](http://martinfowler.com/eaaCatalog/repository.html). Operations performed by Repositories expresses domain specific concepts. See [Ubiquitous Language](http://martinfowler.com/bliki/UbiquitousLanguage.html).
| Demonstration of DAO pattern in Java.
## DAO
DAO is a pattern used interchangeably with Repository. The purpose of DAO is to abstract database code from the rest of the application. In comparison to Repository DAO provides access to single entity and defines standard operations to be performed on a model class (entity).
To implement DAO we need 3 objects:
* DAO interface - defines the operations to be performed on a model object or objects [EmployeeDAO](https://github.com/marekzet/dao-example-java/blob/master/src/mz/dao/core/EmployeeDAO.java)
* DAO implementation - implements DAO interface. Contains logic and code required to access data [EmployeeDAOImpl](https://github.com/marekzet/dao-example-java/blob/master/src/mz/dao/core/EmployeeDAOImpl.java)
* Model object - POJO class with accessors representing database table [Employee](https://github.com/marekzet/dao-example-java/blob/master/src/mz/dao/core/Employee.java)
## DAO vs Repository
From my point of view Repository is a pattern which resides close to the domain layer and it should be considered as part of Domain Driven Design. For more information about Domain Driven Design see [this article](http://culttt.com/2014/11/12/domain-model-domain-driven-design/).
In contrast to DAO, Repository provides access to Aggregate Roots not single entities and hides internal object state from the client. According to Martin Fowler, [Repositories acts as collection of in-memory domain objects](http://martinfowler.com/eaaCatalog/repository.html). Operations performed by Repositories expresses domain specific concepts. See [Ubiquitous Language](http://martinfowler.com/bliki/UbiquitousLanguage.html).
| Add description of DAO objects | Add description of DAO objects | Markdown | mit | marekzet/dao-example-java,marekzet/dao-example-java | markdown | ## Code Before:
Demonstration of DAO pattern in Java
## DAO
DAO is a pattern used interchangeably with Repository. The purpose of DAO is to abstract database code from the rest of the application. In comparison to Repository DAO provides access to single entity and defines standard operations to be performed on a model class (entity).
## DAO vs Repository
From my point of view Repository is a pattern which resides close to the domain layer and it should be considered as part of Domain Driven Design. For more information about Domain Driven Design see [this article](http://culttt.com/2014/11/12/domain-model-domain-driven-design/).
In contrast to DAO, Repository provides access to Aggregate Roots not single entities and hides internal object state from the client. According to Martin Fowler, [Repositories acts as collection of in-memory domain objects](http://martinfowler.com/eaaCatalog/repository.html). Operations performed by Repositories expresses domain specific concepts. See [Ubiquitous Language](http://martinfowler.com/bliki/UbiquitousLanguage.html).
## Instruction:
Add description of DAO objects
## Code After:
Demonstration of DAO pattern in Java.
## DAO
DAO is a pattern used interchangeably with Repository. The purpose of DAO is to abstract database code from the rest of the application. In comparison to Repository DAO provides access to single entity and defines standard operations to be performed on a model class (entity).
To implement DAO we need 3 objects:
* DAO interface - defines the operations to be performed on a model object or objects [EmployeeDAO](https://github.com/marekzet/dao-example-java/blob/master/src/mz/dao/core/EmployeeDAO.java)
* DAO implementation - implements DAO interface. Contains logic and code required to access data [EmployeeDAOImpl](https://github.com/marekzet/dao-example-java/blob/master/src/mz/dao/core/EmployeeDAOImpl.java)
* Model object - POJO class with accessors representing database table [Employee](https://github.com/marekzet/dao-example-java/blob/master/src/mz/dao/core/Employee.java)
## DAO vs Repository
From my point of view Repository is a pattern which resides close to the domain layer and it should be considered as part of Domain Driven Design. For more information about Domain Driven Design see [this article](http://culttt.com/2014/11/12/domain-model-domain-driven-design/).
In contrast to DAO, Repository provides access to Aggregate Roots not single entities and hides internal object state from the client. According to Martin Fowler, [Repositories acts as collection of in-memory domain objects](http://martinfowler.com/eaaCatalog/repository.html). Operations performed by Repositories expresses domain specific concepts. See [Ubiquitous Language](http://martinfowler.com/bliki/UbiquitousLanguage.html).
| - Demonstration of DAO pattern in Java
+ Demonstration of DAO pattern in Java.
? +
## DAO
DAO is a pattern used interchangeably with Repository. The purpose of DAO is to abstract database code from the rest of the application. In comparison to Repository DAO provides access to single entity and defines standard operations to be performed on a model class (entity).
+
+ To implement DAO we need 3 objects:
+ * DAO interface - defines the operations to be performed on a model object or objects [EmployeeDAO](https://github.com/marekzet/dao-example-java/blob/master/src/mz/dao/core/EmployeeDAO.java)
+ * DAO implementation - implements DAO interface. Contains logic and code required to access data [EmployeeDAOImpl](https://github.com/marekzet/dao-example-java/blob/master/src/mz/dao/core/EmployeeDAOImpl.java)
+ * Model object - POJO class with accessors representing database table [Employee](https://github.com/marekzet/dao-example-java/blob/master/src/mz/dao/core/Employee.java)
## DAO vs Repository
From my point of view Repository is a pattern which resides close to the domain layer and it should be considered as part of Domain Driven Design. For more information about Domain Driven Design see [this article](http://culttt.com/2014/11/12/domain-model-domain-driven-design/).
In contrast to DAO, Repository provides access to Aggregate Roots not single entities and hides internal object state from the client. According to Martin Fowler, [Repositories acts as collection of in-memory domain objects](http://martinfowler.com/eaaCatalog/repository.html). Operations performed by Repositories expresses domain specific concepts. See [Ubiquitous Language](http://martinfowler.com/bliki/UbiquitousLanguage.html). | 7 | 0.777778 | 6 | 1 |
0ea111568a159653f13e159e2d0449a03e089771 | dotfiles/config/fish/functions/fish_prompt.fish | dotfiles/config/fish/functions/fish_prompt.fish | function fish_prompt --description 'Write out the prompt'
# Save our status
set -l last_status $status
set -l last_status_string ""
if [ $last_status -ne 0 ]
printf "%s(%d)%s " (set_color red --bold) $last_status (set_color normal)
end
set -l color_cwd
set -l suffix
switch $USER
case root toor
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
else
set color_cwd $fish_color_cwd
end
set suffix '#'
case '*'
set color_cwd $fish_color_cwd
set suffix '>'
end
# Show $HOME as ~
set -l cwd (pwd | sed "s_$HOME\>_~_")
echo -n -s (set_color $color_cwd) $cwd (set_color normal) (__fish_git_prompt) (set_color normal) "$suffix "
end
| function fish_prompt --description 'Write out the prompt'
# Save our status
set -l last_status $status
set -l last_status_string ""
if [ $last_status -ne 0 ]
printf "%s(%d)%s " (set_color red --bold) $last_status (set_color normal)
end
set -l color_cwd
set -l suffix
switch $USER
case root toor
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
else
set color_cwd $fish_color_cwd
end
set suffix '#'
case '*'
set color_cwd $fish_color_cwd
set suffix '>'
end
# Show $HOME as ~
set -l cwd (pwd | sed -E "s_^$HOME(/|\$)_~\1_")
echo -n -s (set_color $color_cwd) $cwd (set_color normal) (__fish_git_prompt) (set_color normal) "$suffix "
end
| Fix display of home directory as ~ in fish prompt CWD. | Fix display of home directory as ~ in fish prompt CWD.
* Fix subdirectories with the same name as the home directory (e.g.
/mnt/backup/home/username) being displayed as ~ (e.g. /mnt/backup~) by
only replacing the string when it's found at the start of the current
path.
* Check for slash or end of path instead of any word boundary.
| fish | mit | razzolini/dotfiles,razzolini/dotfiles,razzolini/dotfiles | fish | ## Code Before:
function fish_prompt --description 'Write out the prompt'
# Save our status
set -l last_status $status
set -l last_status_string ""
if [ $last_status -ne 0 ]
printf "%s(%d)%s " (set_color red --bold) $last_status (set_color normal)
end
set -l color_cwd
set -l suffix
switch $USER
case root toor
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
else
set color_cwd $fish_color_cwd
end
set suffix '#'
case '*'
set color_cwd $fish_color_cwd
set suffix '>'
end
# Show $HOME as ~
set -l cwd (pwd | sed "s_$HOME\>_~_")
echo -n -s (set_color $color_cwd) $cwd (set_color normal) (__fish_git_prompt) (set_color normal) "$suffix "
end
## Instruction:
Fix display of home directory as ~ in fish prompt CWD.
* Fix subdirectories with the same name as the home directory (e.g.
/mnt/backup/home/username) being displayed as ~ (e.g. /mnt/backup~) by
only replacing the string when it's found at the start of the current
path.
* Check for slash or end of path instead of any word boundary.
## Code After:
function fish_prompt --description 'Write out the prompt'
# Save our status
set -l last_status $status
set -l last_status_string ""
if [ $last_status -ne 0 ]
printf "%s(%d)%s " (set_color red --bold) $last_status (set_color normal)
end
set -l color_cwd
set -l suffix
switch $USER
case root toor
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
else
set color_cwd $fish_color_cwd
end
set suffix '#'
case '*'
set color_cwd $fish_color_cwd
set suffix '>'
end
# Show $HOME as ~
set -l cwd (pwd | sed -E "s_^$HOME(/|\$)_~\1_")
echo -n -s (set_color $color_cwd) $cwd (set_color normal) (__fish_git_prompt) (set_color normal) "$suffix "
end
| function fish_prompt --description 'Write out the prompt'
# Save our status
set -l last_status $status
set -l last_status_string ""
if [ $last_status -ne 0 ]
printf "%s(%d)%s " (set_color red --bold) $last_status (set_color normal)
end
set -l color_cwd
set -l suffix
switch $USER
case root toor
if set -q fish_color_cwd_root
set color_cwd $fish_color_cwd_root
else
set color_cwd $fish_color_cwd
end
set suffix '#'
case '*'
set color_cwd $fish_color_cwd
set suffix '>'
end
# Show $HOME as ~
- set -l cwd (pwd | sed "s_$HOME\>_~_")
? ^
+ set -l cwd (pwd | sed -E "s_^$HOME(/|\$)_~\1_")
? +++ + +++ ^^ ++
echo -n -s (set_color $color_cwd) $cwd (set_color normal) (__fish_git_prompt) (set_color normal) "$suffix "
end | 2 | 0.068966 | 1 | 1 |
7ad3346759f53f57f233319e63361a0ed792535f | incrowd/notify/utils.py | incrowd/notify/utils.py | import logging
from notify.models import Notification
logger = logging.getLogger(__name__)
def ping_filter(message, users, sending_user, notify_text, notify_type,
notify_url=None):
for user in users:
if username_in_message(message, user.username):
# Create notification
if user == sending_user:
continue
note = Notification(
text='{} {}: {}'.format(
sending_user.username, notify_text, message),
user=user,
from_user=sending_user,
type=notify_type,
link=notify_url)
note.save()
logger.info("Created notification for user {} from {}"
.format(note))
return message
def username_in_message(message, username):
message = message.lower()
username = username.lower()
# Check if @username in message. Edge case for username at the end of
# the message.
if '@' + username + ' ' in message.lower():
return True
try:
return (message.index('@' + username) ==
len(message.lower()) - len('@' + username))
except ValueError:
return False | import logging
from notify.models import Notification
logger = logging.getLogger(__name__)
def ping_filter(message, users, sending_user, notify_text, notify_type,
notify_url=None):
for user in users:
if username_in_message(message, user.username):
# Create notification
if user == sending_user:
continue
note = Notification(
text='{} {}: {}'.format(
sending_user.username, notify_text, message),
user=user,
from_user=sending_user,
type=notify_type,
link=notify_url)
note.save()
logger.info("Created notification for user {} from {}"
.format(note.user, note.from_user))
return message
def username_in_message(message, username):
message = message.lower()
username = username.lower()
# Check if @username in message. Edge case for username at the end of
# the message.
if '@' + username + ' ' in message.lower():
return True
try:
return (message.index('@' + username) ==
len(message.lower()) - len('@' + username))
except ValueError:
return False
| Fix pinging in chat throwing errors | Fix pinging in chat throwing errors
| Python | apache-2.0 | pcsforeducation/incrowd,pcsforeducation/incrowd,incrowdio/incrowd,incrowdio/incrowd,incrowdio/incrowd,pcsforeducation/incrowd,pcsforeducation/incrowd,incrowdio/incrowd | python | ## Code Before:
import logging
from notify.models import Notification
logger = logging.getLogger(__name__)
def ping_filter(message, users, sending_user, notify_text, notify_type,
notify_url=None):
for user in users:
if username_in_message(message, user.username):
# Create notification
if user == sending_user:
continue
note = Notification(
text='{} {}: {}'.format(
sending_user.username, notify_text, message),
user=user,
from_user=sending_user,
type=notify_type,
link=notify_url)
note.save()
logger.info("Created notification for user {} from {}"
.format(note))
return message
def username_in_message(message, username):
message = message.lower()
username = username.lower()
# Check if @username in message. Edge case for username at the end of
# the message.
if '@' + username + ' ' in message.lower():
return True
try:
return (message.index('@' + username) ==
len(message.lower()) - len('@' + username))
except ValueError:
return False
## Instruction:
Fix pinging in chat throwing errors
## Code After:
import logging
from notify.models import Notification
logger = logging.getLogger(__name__)
def ping_filter(message, users, sending_user, notify_text, notify_type,
notify_url=None):
for user in users:
if username_in_message(message, user.username):
# Create notification
if user == sending_user:
continue
note = Notification(
text='{} {}: {}'.format(
sending_user.username, notify_text, message),
user=user,
from_user=sending_user,
type=notify_type,
link=notify_url)
note.save()
logger.info("Created notification for user {} from {}"
.format(note.user, note.from_user))
return message
def username_in_message(message, username):
message = message.lower()
username = username.lower()
# Check if @username in message. Edge case for username at the end of
# the message.
if '@' + username + ' ' in message.lower():
return True
try:
return (message.index('@' + username) ==
len(message.lower()) - len('@' + username))
except ValueError:
return False
| import logging
from notify.models import Notification
logger = logging.getLogger(__name__)
def ping_filter(message, users, sending_user, notify_text, notify_type,
notify_url=None):
for user in users:
if username_in_message(message, user.username):
# Create notification
if user == sending_user:
continue
note = Notification(
text='{} {}: {}'.format(
sending_user.username, notify_text, message),
user=user,
from_user=sending_user,
type=notify_type,
link=notify_url)
note.save()
logger.info("Created notification for user {} from {}"
- .format(note))
+ .format(note.user, note.from_user))
? +++++++++++++++++++++
return message
def username_in_message(message, username):
message = message.lower()
username = username.lower()
# Check if @username in message. Edge case for username at the end of
# the message.
if '@' + username + ' ' in message.lower():
return True
try:
return (message.index('@' + username) ==
len(message.lower()) - len('@' + username))
except ValueError:
return False | 2 | 0.05 | 1 | 1 |
4b02d8cf3b34fe80035732b886975c101b4c8199 | .travis.yml | .travis.yml | language: android
sudo: false
jdk: oraclejdk7
android:
components:
- build-tools-21.1.2
- android-21
- platform-tools
- tools
# Additional components
- extra-google-m2repository
- extra-android-m2repository
- extra-android-support
notifications:
email: false
slack:
secure: ZikJQt/R40LMj27fu2ub9Zq87FF6kZXx3fXy9lz/nWFuc7EWcQC8SzVOCizSp+cq/wrsyBPfitkQwVsFpxx/6aJC0r+t4/zIwK21aLIkkHYLzS5qJpifYeTp7kAiQ0eFWLNLxRSwDVEMlfcvgHl7kGmvJQkzHm9mkQaWBJAJayc= | language: android
sudo: false
jdk: oraclejdk7
android:
components:
- build-tools-21.1.2
- android-21
- platform-tools
- tools
- extra-google-m2repository
- extra-android-m2repository
- extra-android-support
notifications:
slack:
rooms:
secure: NVkh+VYIPnEfR7oPbjuWlh+bSJvOUUL6WjKdY5MZ5ejyYjuF8/e2NBSSvdOv+uA7/ah4BP8IHhrppZi14O9X0WzhtVaraKX9WXmTrBmyqNZsCtxx/xtEi+Fho8ZWy7c1YxbdiLD9m7IvDQ+CFs8OyDbQTK2SH2b4Ut5FjY9jELZJRnuJ6KrPLdmw4fRcyiT6WdbySZCyt1TUWSgMPzFYDD+JDhr7VHtu4rb5+gl9hgk3Uory1r2blxzAybrrd8fTtbM3+W94FRhdIhhuJ1AQ9fApQrW2cJqmEnwoOOOMKlfmXKMRC92HxoFStLSiOCkAMxlNIAZmoHtvl+b1kA4U+oQ6pK/BrTKlrUA4cMTsAuoxPJba5Sn6QRi+wJpwxwUr6AuDDkdvxuqFD0LP0RdJGN0KaNoSo6naBNAsKbwgdzwr64T3FjShp38Z2zqObp79iDaE9liIkQcsSUHs8c7qCUfMd0NQOk5mq5q4j/3SkBBf1Vlbe0l7VsULdgPxl6wVXlnL53popdrDZHGKv2k7y46o5JmPjxxIqHGTT3+M6GmGqBgTQf5tj9754uJeMkACaZnYBaefOBdGyUng7al5o6Xjuril2xxmHm8yjwzauztc81HDG71YQwudAU3cK6JhHAYDs8sMqPDsKhQKj0h+ZsRyBgHB++c3ci2V3edMit4=
| Add correct key for CI reports in Slack | Add correct key for CI reports in Slack
| YAML | mit | elpoisterio/ello-android,ello/ello-android | yaml | ## Code Before:
language: android
sudo: false
jdk: oraclejdk7
android:
components:
- build-tools-21.1.2
- android-21
- platform-tools
- tools
# Additional components
- extra-google-m2repository
- extra-android-m2repository
- extra-android-support
notifications:
email: false
slack:
secure: ZikJQt/R40LMj27fu2ub9Zq87FF6kZXx3fXy9lz/nWFuc7EWcQC8SzVOCizSp+cq/wrsyBPfitkQwVsFpxx/6aJC0r+t4/zIwK21aLIkkHYLzS5qJpifYeTp7kAiQ0eFWLNLxRSwDVEMlfcvgHl7kGmvJQkzHm9mkQaWBJAJayc=
## Instruction:
Add correct key for CI reports in Slack
## Code After:
language: android
sudo: false
jdk: oraclejdk7
android:
components:
- build-tools-21.1.2
- android-21
- platform-tools
- tools
- extra-google-m2repository
- extra-android-m2repository
- extra-android-support
notifications:
slack:
rooms:
secure: NVkh+VYIPnEfR7oPbjuWlh+bSJvOUUL6WjKdY5MZ5ejyYjuF8/e2NBSSvdOv+uA7/ah4BP8IHhrppZi14O9X0WzhtVaraKX9WXmTrBmyqNZsCtxx/xtEi+Fho8ZWy7c1YxbdiLD9m7IvDQ+CFs8OyDbQTK2SH2b4Ut5FjY9jELZJRnuJ6KrPLdmw4fRcyiT6WdbySZCyt1TUWSgMPzFYDD+JDhr7VHtu4rb5+gl9hgk3Uory1r2blxzAybrrd8fTtbM3+W94FRhdIhhuJ1AQ9fApQrW2cJqmEnwoOOOMKlfmXKMRC92HxoFStLSiOCkAMxlNIAZmoHtvl+b1kA4U+oQ6pK/BrTKlrUA4cMTsAuoxPJba5Sn6QRi+wJpwxwUr6AuDDkdvxuqFD0LP0RdJGN0KaNoSo6naBNAsKbwgdzwr64T3FjShp38Z2zqObp79iDaE9liIkQcsSUHs8c7qCUfMd0NQOk5mq5q4j/3SkBBf1Vlbe0l7VsULdgPxl6wVXlnL53popdrDZHGKv2k7y46o5JmPjxxIqHGTT3+M6GmGqBgTQf5tj9754uJeMkACaZnYBaefOBdGyUng7al5o6Xjuril2xxmHm8yjwzauztc81HDG71YQwudAU3cK6JhHAYDs8sMqPDsKhQKj0h+ZsRyBgHB++c3ci2V3edMit4=
| language: android
sudo: false
jdk: oraclejdk7
-
android:
components:
- - build-tools-21.1.2
? --
+ - build-tools-21.1.2
- - android-21
? --
+ - android-21
- - platform-tools
? --
+ - platform-tools
- - tools
? --
+ - tools
- # Additional components
- - extra-google-m2repository
? --
+ - extra-google-m2repository
- - extra-android-m2repository
? --
+ - extra-android-m2repository
- - extra-android-support
? --
+ - extra-android-support
-
notifications:
- email: false
slack:
- secure: ZikJQt/R40LMj27fu2ub9Zq87FF6kZXx3fXy9lz/nWFuc7EWcQC8SzVOCizSp+cq/wrsyBPfitkQwVsFpxx/6aJC0r+t4/zIwK21aLIkkHYLzS5qJpifYeTp7kAiQ0eFWLNLxRSwDVEMlfcvgHl7kGmvJQkzHm9mkQaWBJAJayc=
+ rooms:
+ secure: NVkh+VYIPnEfR7oPbjuWlh+bSJvOUUL6WjKdY5MZ5ejyYjuF8/e2NBSSvdOv+uA7/ah4BP8IHhrppZi14O9X0WzhtVaraKX9WXmTrBmyqNZsCtxx/xtEi+Fho8ZWy7c1YxbdiLD9m7IvDQ+CFs8OyDbQTK2SH2b4Ut5FjY9jELZJRnuJ6KrPLdmw4fRcyiT6WdbySZCyt1TUWSgMPzFYDD+JDhr7VHtu4rb5+gl9hgk3Uory1r2blxzAybrrd8fTtbM3+W94FRhdIhhuJ1AQ9fApQrW2cJqmEnwoOOOMKlfmXKMRC92HxoFStLSiOCkAMxlNIAZmoHtvl+b1kA4U+oQ6pK/BrTKlrUA4cMTsAuoxPJba5Sn6QRi+wJpwxwUr6AuDDkdvxuqFD0LP0RdJGN0KaNoSo6naBNAsKbwgdzwr64T3FjShp38Z2zqObp79iDaE9liIkQcsSUHs8c7qCUfMd0NQOk5mq5q4j/3SkBBf1Vlbe0l7VsULdgPxl6wVXlnL53popdrDZHGKv2k7y46o5JmPjxxIqHGTT3+M6GmGqBgTQf5tj9754uJeMkACaZnYBaefOBdGyUng7al5o6Xjuril2xxmHm8yjwzauztc81HDG71YQwudAU3cK6JhHAYDs8sMqPDsKhQKj0h+ZsRyBgHB++c3ci2V3edMit4= | 21 | 1.105263 | 9 | 12 |
edaa8ed6dae900917607addae558383112f643e2 | locales/zh-TW/server-client-shared.properties | locales/zh-TW/server-client-shared.properties |
remixGalleryTitle=混搭專案開始創作…
############
## Editor ##
############
fileSavingIndicator=儲存中…
renameProjectSaveBtn=儲存
publishBtn=發布
publishDeleteBtn=刪除已發布的版本
publishChangesBtn=更新發布的版本
|
remixGalleryTitle=混搭專案開始創作…
############
## Editor ##
############
fileSavingIndicator=儲存中…
renameProjectSaveBtn=儲存
publishBtn=發布
publishDeleteBtn=刪除已發布的版本
publishChangesBtn=更新發布的版本
publishHeader=發布您的專案
publishHeaderOnline=您的專案上線了!
| Update Chinese (Taiwan) (zh-TW) localization of Thimble | Pontoon: Update Chinese (Taiwan) (zh-TW) localization of Thimble
Localization authors:
- Pin-guang Chen <petercpg@mail.moztw.org>
| INI | mpl-2.0 | mozilla/thimble.mozilla.org,mozilla/thimble.mozilla.org,mozilla/thimble.mozilla.org,mozilla/thimble.mozilla.org | ini | ## Code Before:
remixGalleryTitle=混搭專案開始創作…
############
## Editor ##
############
fileSavingIndicator=儲存中…
renameProjectSaveBtn=儲存
publishBtn=發布
publishDeleteBtn=刪除已發布的版本
publishChangesBtn=更新發布的版本
## Instruction:
Pontoon: Update Chinese (Taiwan) (zh-TW) localization of Thimble
Localization authors:
- Pin-guang Chen <petercpg@mail.moztw.org>
## Code After:
remixGalleryTitle=混搭專案開始創作…
############
## Editor ##
############
fileSavingIndicator=儲存中…
renameProjectSaveBtn=儲存
publishBtn=發布
publishDeleteBtn=刪除已發布的版本
publishChangesBtn=更新發布的版本
publishHeader=發布您的專案
publishHeaderOnline=您的專案上線了!
|
remixGalleryTitle=混搭專案開始創作…
############
## Editor ##
############
fileSavingIndicator=儲存中…
renameProjectSaveBtn=儲存
publishBtn=發布
publishDeleteBtn=刪除已發布的版本
publishChangesBtn=更新發布的版本
+ publishHeader=發布您的專案
+ publishHeaderOnline=您的專案上線了! | 2 | 0.166667 | 2 | 0 |
ca9269725620f46147bf0054dfbe8469f24081f3 | src/Listabierta/Bundle/MunicipalesBundle/Resources/views/Default/index.html.twig | src/Listabierta/Bundle/MunicipalesBundle/Resources/views/Default/index.html.twig | {% extends 'MunicipalesBundle:theme:layout.html.twig' %}
{% block title %}{{ 'home.html_title'|trans }}{% endblock %}
{% block head %}
{{ parent() }}
<style type="text/css">
</style>
{% endblock %}
{% block content %}
<h1>{{ 'home.h1_title'|trans }}</h1>
<p class="important">
{{ 'home.steps'|trans }}:
</p>
<p class="important">
<ol>
<li>{{ 'home.step_1'|trans }}</li>
<li>{{ 'home.step_2'|trans }}</li>
<li>{{ 'home.step_3'|trans }}</li>
<li>{{ 'home.step_4'|trans }}</li>
<li>{{ 'home.step_5'|trans }}</li>
<li>{{ 'home.step_6'|trans }}</li>
<li>{{ 'home.step_7'|trans }}</li>
<li>{{ 'home.step_8'|trans }}</li>
<li>{{ 'home.step_9'|trans }}</li>
</ol>
</p>
<div><a href="{{ path('municipales_register_admin') }}" title="{{ 'home.start_here'|trans }}">{{ 'home.start_here'|trans }}</a></div>
{% endblock %} | {% extends 'MunicipalesBundle:theme:layout.html.twig' %}
{% block title %}{{ 'home.html_title'|trans }}{% endblock %}
{% block head %}
{{ parent() }}
<style type="text/css">
</style>
{% endblock %}
{% block content %}
<h1>{{ 'home.h1_title'|trans }}</h1>
<p class="important">
{{ 'home.steps'|trans }}:
</p>
<p class="important">
<ol>
<li>{{ 'home.step_1'|trans }}</li>
<li>{{ 'home.step_2'|trans }}</li>
<li>{{ 'home.step_3'|trans }}</li>
<li>{{ 'home.step_4'|trans }}</li>
<li>{{ 'home.step_5'|trans }}</li>
<li>{{ 'home.step_6'|trans }}</li>
<li>{{ 'home.step_7'|trans }}</li>
<li>{{ 'home.step_8'|trans }}</li>
<li>{{ 'home.step_9'|trans }}</li>
</ol>
</p>
<div><a href="{{ path('municipales_candidacy_step1') }}" title="{{ 'home.start_here'|trans }}">{{ 'home.start_here'|trans }}</a></div>
{% endblock %} | Update link for candidacy step 1 | Update link for candidacy step 1
| Twig | agpl-3.0 | listabierta/census-ahoraencomun,listabierta/census-ahoraencomun,listabierta/census-ahoraencomun,listabierta/census-ahoraencomun | twig | ## Code Before:
{% extends 'MunicipalesBundle:theme:layout.html.twig' %}
{% block title %}{{ 'home.html_title'|trans }}{% endblock %}
{% block head %}
{{ parent() }}
<style type="text/css">
</style>
{% endblock %}
{% block content %}
<h1>{{ 'home.h1_title'|trans }}</h1>
<p class="important">
{{ 'home.steps'|trans }}:
</p>
<p class="important">
<ol>
<li>{{ 'home.step_1'|trans }}</li>
<li>{{ 'home.step_2'|trans }}</li>
<li>{{ 'home.step_3'|trans }}</li>
<li>{{ 'home.step_4'|trans }}</li>
<li>{{ 'home.step_5'|trans }}</li>
<li>{{ 'home.step_6'|trans }}</li>
<li>{{ 'home.step_7'|trans }}</li>
<li>{{ 'home.step_8'|trans }}</li>
<li>{{ 'home.step_9'|trans }}</li>
</ol>
</p>
<div><a href="{{ path('municipales_register_admin') }}" title="{{ 'home.start_here'|trans }}">{{ 'home.start_here'|trans }}</a></div>
{% endblock %}
## Instruction:
Update link for candidacy step 1
## Code After:
{% extends 'MunicipalesBundle:theme:layout.html.twig' %}
{% block title %}{{ 'home.html_title'|trans }}{% endblock %}
{% block head %}
{{ parent() }}
<style type="text/css">
</style>
{% endblock %}
{% block content %}
<h1>{{ 'home.h1_title'|trans }}</h1>
<p class="important">
{{ 'home.steps'|trans }}:
</p>
<p class="important">
<ol>
<li>{{ 'home.step_1'|trans }}</li>
<li>{{ 'home.step_2'|trans }}</li>
<li>{{ 'home.step_3'|trans }}</li>
<li>{{ 'home.step_4'|trans }}</li>
<li>{{ 'home.step_5'|trans }}</li>
<li>{{ 'home.step_6'|trans }}</li>
<li>{{ 'home.step_7'|trans }}</li>
<li>{{ 'home.step_8'|trans }}</li>
<li>{{ 'home.step_9'|trans }}</li>
</ol>
</p>
<div><a href="{{ path('municipales_candidacy_step1') }}" title="{{ 'home.start_here'|trans }}">{{ 'home.start_here'|trans }}</a></div>
{% endblock %} | {% extends 'MunicipalesBundle:theme:layout.html.twig' %}
{% block title %}{{ 'home.html_title'|trans }}{% endblock %}
{% block head %}
{{ parent() }}
<style type="text/css">
</style>
{% endblock %}
{% block content %}
<h1>{{ 'home.h1_title'|trans }}</h1>
<p class="important">
{{ 'home.steps'|trans }}:
</p>
<p class="important">
<ol>
<li>{{ 'home.step_1'|trans }}</li>
<li>{{ 'home.step_2'|trans }}</li>
<li>{{ 'home.step_3'|trans }}</li>
<li>{{ 'home.step_4'|trans }}</li>
<li>{{ 'home.step_5'|trans }}</li>
<li>{{ 'home.step_6'|trans }}</li>
<li>{{ 'home.step_7'|trans }}</li>
<li>{{ 'home.step_8'|trans }}</li>
<li>{{ 'home.step_9'|trans }}</li>
</ol>
</p>
- <div><a href="{{ path('municipales_register_admin') }}" title="{{ 'home.start_here'|trans }}">{{ 'home.start_here'|trans }}</a></div>
? ^^^ ^^^^^^^
+ <div><a href="{{ path('municipales_candidacy_step1') }}" title="{{ 'home.start_here'|trans }}">{{ 'home.start_here'|trans }}</a></div>
? ^^^^ +++++ ^^
{% endblock %} | 2 | 0.0625 | 1 | 1 |
f0723ce126dd00f97957ed48d6c98b5579d66a28 | grunt/tasks/browsers.js | grunt/tasks/browsers.js | "use strict";
module.exports = function (grunt) {
configuration.selenium.forEach(function (browser) {
grunt.registerTask(browser, "exec:test" + browser.charAt(0).toUpperCase() + browser.substr(1) + "Verbose");
});
};
| "use strict";
module.exports = function (grunt) {
configuration.selenium.forEach(function (browser) {
grunt.registerTask(browser, [
"connect:server",
"exec:test" + browser.charAt(0).toUpperCase() + browser.substr(1) + "Verbose"
]);
});
};
| Connect is required for selenium tests | Connect is required for selenium tests
| JavaScript | mit | ArnaudBuchholz/gpf-js,ArnaudBuchholz/gpf-js | javascript | ## Code Before:
"use strict";
module.exports = function (grunt) {
configuration.selenium.forEach(function (browser) {
grunt.registerTask(browser, "exec:test" + browser.charAt(0).toUpperCase() + browser.substr(1) + "Verbose");
});
};
## Instruction:
Connect is required for selenium tests
## Code After:
"use strict";
module.exports = function (grunt) {
configuration.selenium.forEach(function (browser) {
grunt.registerTask(browser, [
"connect:server",
"exec:test" + browser.charAt(0).toUpperCase() + browser.substr(1) + "Verbose"
]);
});
};
| "use strict";
module.exports = function (grunt) {
configuration.selenium.forEach(function (browser) {
+ grunt.registerTask(browser, [
+ "connect:server",
- grunt.registerTask(browser, "exec:test" + browser.charAt(0).toUpperCase() + browser.substr(1) + "Verbose");
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^ --
+ "exec:test" + browser.charAt(0).toUpperCase() + browser.substr(1) + "Verbose"
? ^^^
+ ]);
});
}; | 5 | 0.714286 | 4 | 1 |
46d306a217e6101a2c37f4eeaf6760e96537bd60 | src/ScalarAuthClient.js | src/ScalarAuthClient.js | /*
Copyright 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var q = require("q");
var request = require('browser-request');
var SdkConfig = require('./SdkConfig');
class ScalarAuthClient {
getScalarToken(openid_token_object) {
var defer = q.defer();
var scalar_rest_url = SdkConfig.get().integrations_rest_url;
request({
method: 'POST',
uri: scalar_rest_url+'/register',
body: openid_token_object,
json: true,
}, (err, response, body) => {
if (err) {
defer.reject(err);
} else if (response.statusCode / 100 !== 2) {
defer.reject({statusCode: response.statusCode});
} else {
defer.resolve(body.access_token);
}
});
return defer.promise;
}
}
module.exports = ScalarAuthClient;
| /*
Copyright 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var q = require("q");
var request = require('browser-request');
var SdkConfig = require('./SdkConfig');
class ScalarAuthClient {
getScalarToken(openid_token_object) {
var defer = q.defer();
var scalar_rest_url = SdkConfig.get().integrations_rest_url;
request({
method: 'POST',
uri: scalar_rest_url+'/register',
body: openid_token_object,
json: true,
}, (err, response, body) => {
if (err) {
defer.reject(err);
} else if (response.statusCode / 100 !== 2) {
defer.reject({statusCode: response.statusCode});
} else if (!body || !body.scalar_token) {
defer.reject(new Error("Missing scalar_token in response"));
} else {
defer.resolve(body.scalar_token);
}
});
return defer.promise;
}
}
module.exports = ScalarAuthClient;
| Change register response access_token to scalar_token | Change register response access_token to scalar_token
| JavaScript | apache-2.0 | aperezdc/matrix-react-sdk,aperezdc/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,aperezdc/matrix-react-sdk,matrix-org/matrix-react-sdk,matrix-org/matrix-react-sdk,aperezdc/matrix-react-sdk,matrix-org/matrix-react-sdk | javascript | ## Code Before:
/*
Copyright 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var q = require("q");
var request = require('browser-request');
var SdkConfig = require('./SdkConfig');
class ScalarAuthClient {
getScalarToken(openid_token_object) {
var defer = q.defer();
var scalar_rest_url = SdkConfig.get().integrations_rest_url;
request({
method: 'POST',
uri: scalar_rest_url+'/register',
body: openid_token_object,
json: true,
}, (err, response, body) => {
if (err) {
defer.reject(err);
} else if (response.statusCode / 100 !== 2) {
defer.reject({statusCode: response.statusCode});
} else {
defer.resolve(body.access_token);
}
});
return defer.promise;
}
}
module.exports = ScalarAuthClient;
## Instruction:
Change register response access_token to scalar_token
## Code After:
/*
Copyright 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var q = require("q");
var request = require('browser-request');
var SdkConfig = require('./SdkConfig');
class ScalarAuthClient {
getScalarToken(openid_token_object) {
var defer = q.defer();
var scalar_rest_url = SdkConfig.get().integrations_rest_url;
request({
method: 'POST',
uri: scalar_rest_url+'/register',
body: openid_token_object,
json: true,
}, (err, response, body) => {
if (err) {
defer.reject(err);
} else if (response.statusCode / 100 !== 2) {
defer.reject({statusCode: response.statusCode});
} else if (!body || !body.scalar_token) {
defer.reject(new Error("Missing scalar_token in response"));
} else {
defer.resolve(body.scalar_token);
}
});
return defer.promise;
}
}
module.exports = ScalarAuthClient;
| /*
Copyright 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
var q = require("q");
var request = require('browser-request');
var SdkConfig = require('./SdkConfig');
class ScalarAuthClient {
getScalarToken(openid_token_object) {
var defer = q.defer();
var scalar_rest_url = SdkConfig.get().integrations_rest_url;
request({
method: 'POST',
uri: scalar_rest_url+'/register',
body: openid_token_object,
json: true,
}, (err, response, body) => {
if (err) {
defer.reject(err);
} else if (response.statusCode / 100 !== 2) {
defer.reject({statusCode: response.statusCode});
+ } else if (!body || !body.scalar_token) {
+ defer.reject(new Error("Missing scalar_token in response"));
} else {
- defer.resolve(body.access_token);
? ^^^^^
+ defer.resolve(body.scalar_token);
? ++ ^^^
}
});
return defer.promise;
}
}
module.exports = ScalarAuthClient;
| 4 | 0.085106 | 3 | 1 |
c3ee0ce096bd0b1614c0434c1c6408f99a5e3d8d | src/external/IntelRDFPMathLib20U2/CMakeLists.txt | src/external/IntelRDFPMathLib20U2/CMakeLists.txt | set(BID_SOURCES
LIBRARY/src/bid128.c
LIBRARY/src/bid128_compare.c
LIBRARY/src/bid128_mul.c
LIBRARY/src/bid128_div.c
LIBRARY/src/bid128_add.c
LIBRARY/src/bid128_fma.c
LIBRARY/src/bid128_string.c
LIBRARY/src/bid128_2_str_tables.c
LIBRARY/src/bid64_to_bid128.c
LIBRARY/src/bid128_to_int64.c
LIBRARY/src/bid_convert_data.c
LIBRARY/src/bid_decimal_data.c
LIBRARY/src/bid_decimal_globals.c
LIBRARY/src/bid_from_int.c
LIBRARY/src/bid_round.c
)
add_library(Bid OBJECT ${BID_SOURCES})
| set(BID_SOURCES
LIBRARY/src/bid128.c
LIBRARY/src/bid128_compare.c
LIBRARY/src/bid128_mul.c
LIBRARY/src/bid128_div.c
LIBRARY/src/bid128_add.c
LIBRARY/src/bid128_fma.c
LIBRARY/src/bid128_string.c
LIBRARY/src/bid128_2_str_tables.c
LIBRARY/src/bid64_to_bid128.c
LIBRARY/src/bid128_to_int64.c
LIBRARY/src/bid_convert_data.c
LIBRARY/src/bid_decimal_data.c
LIBRARY/src/bid_decimal_globals.c
LIBRARY/src/bid_from_int.c
LIBRARY/src/bid_round.c
)
add_library(Bid OBJECT ${BID_SOURCES})
if(MSVC)
target_compile_options(Bid PUBLIC /W1 /sdl-)
endif() | Remove MSVC SDL compile checks from Intel FP library | Remove MSVC SDL compile checks from Intel FP library
| Text | apache-2.0 | realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core,realm/realm-core | text | ## Code Before:
set(BID_SOURCES
LIBRARY/src/bid128.c
LIBRARY/src/bid128_compare.c
LIBRARY/src/bid128_mul.c
LIBRARY/src/bid128_div.c
LIBRARY/src/bid128_add.c
LIBRARY/src/bid128_fma.c
LIBRARY/src/bid128_string.c
LIBRARY/src/bid128_2_str_tables.c
LIBRARY/src/bid64_to_bid128.c
LIBRARY/src/bid128_to_int64.c
LIBRARY/src/bid_convert_data.c
LIBRARY/src/bid_decimal_data.c
LIBRARY/src/bid_decimal_globals.c
LIBRARY/src/bid_from_int.c
LIBRARY/src/bid_round.c
)
add_library(Bid OBJECT ${BID_SOURCES})
## Instruction:
Remove MSVC SDL compile checks from Intel FP library
## Code After:
set(BID_SOURCES
LIBRARY/src/bid128.c
LIBRARY/src/bid128_compare.c
LIBRARY/src/bid128_mul.c
LIBRARY/src/bid128_div.c
LIBRARY/src/bid128_add.c
LIBRARY/src/bid128_fma.c
LIBRARY/src/bid128_string.c
LIBRARY/src/bid128_2_str_tables.c
LIBRARY/src/bid64_to_bid128.c
LIBRARY/src/bid128_to_int64.c
LIBRARY/src/bid_convert_data.c
LIBRARY/src/bid_decimal_data.c
LIBRARY/src/bid_decimal_globals.c
LIBRARY/src/bid_from_int.c
LIBRARY/src/bid_round.c
)
add_library(Bid OBJECT ${BID_SOURCES})
if(MSVC)
target_compile_options(Bid PUBLIC /W1 /sdl-)
endif() | set(BID_SOURCES
LIBRARY/src/bid128.c
LIBRARY/src/bid128_compare.c
LIBRARY/src/bid128_mul.c
LIBRARY/src/bid128_div.c
LIBRARY/src/bid128_add.c
LIBRARY/src/bid128_fma.c
LIBRARY/src/bid128_string.c
LIBRARY/src/bid128_2_str_tables.c
LIBRARY/src/bid64_to_bid128.c
LIBRARY/src/bid128_to_int64.c
LIBRARY/src/bid_convert_data.c
LIBRARY/src/bid_decimal_data.c
LIBRARY/src/bid_decimal_globals.c
LIBRARY/src/bid_from_int.c
LIBRARY/src/bid_round.c
)
add_library(Bid OBJECT ${BID_SOURCES})
+ if(MSVC)
+ target_compile_options(Bid PUBLIC /W1 /sdl-)
+ endif() | 3 | 0.157895 | 3 | 0 |
55a6b663997390c58675f5f7e02ebeeb62601128 | src/main/java/cloud/cluster/sim/requestsimulator/dao/SimulationStatisticsOperations.java | src/main/java/cloud/cluster/sim/requestsimulator/dao/SimulationStatisticsOperations.java | package cloud.cluster.sim.requestsimulator.dao;
import cloud.cluster.sim.requestsimulator.dto.SimulationStatistics;
import org.springframework.data.mongodb.repository.MongoRepository;
/**
* Define operations on SimulationStatistics
*/
public interface SimulationStatisticsOperations extends MongoRepository<SimulationStatistics, String> {
}
| package cloud.cluster.sim.requestsimulator.dao;
import cloud.cluster.sim.requestsimulator.dto.SimulationStatistics;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Component;
/**
* Define operations on SimulationStatistics
*/
@Component
public interface SimulationStatisticsOperations extends MongoRepository<SimulationStatistics, String> {
}
| Add component annotation in order to be able to auto wire component. | Add component annotation in order to be able to auto wire component.
| Java | apache-2.0 | IrimieBogdan/cloud-simulator,IrimieBogdan/cloud-simulator | java | ## Code Before:
package cloud.cluster.sim.requestsimulator.dao;
import cloud.cluster.sim.requestsimulator.dto.SimulationStatistics;
import org.springframework.data.mongodb.repository.MongoRepository;
/**
* Define operations on SimulationStatistics
*/
public interface SimulationStatisticsOperations extends MongoRepository<SimulationStatistics, String> {
}
## Instruction:
Add component annotation in order to be able to auto wire component.
## Code After:
package cloud.cluster.sim.requestsimulator.dao;
import cloud.cluster.sim.requestsimulator.dto.SimulationStatistics;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Component;
/**
* Define operations on SimulationStatistics
*/
@Component
public interface SimulationStatisticsOperations extends MongoRepository<SimulationStatistics, String> {
}
| package cloud.cluster.sim.requestsimulator.dao;
import cloud.cluster.sim.requestsimulator.dto.SimulationStatistics;
import org.springframework.data.mongodb.repository.MongoRepository;
+ import org.springframework.stereotype.Component;
/**
* Define operations on SimulationStatistics
*/
+ @Component
public interface SimulationStatisticsOperations extends MongoRepository<SimulationStatistics, String> {
} | 2 | 0.2 | 2 | 0 |
0360681720c19c951972c8344eec0b76a697b5ce | backend/src/circle/init.clj | backend/src/circle/init.clj | (ns circle.init
(:require circle.env) ;; env needs to be loaded before any circle source files containing tests
(:require circle.swank)
(:require circle.db)
(:require circle.repl)
(:require circle.logging)
(:require circle.util.chdir)
(:require fs))
(defn maybe-change-dir
"Change the current working directory to backend/. Although changing it to the project root makes
more conceptual sense, there are lots of entrypoints to the clojure code (for example, tests,
swank, etc) which are hard to get a hook on, but making sure there is a hook into the Rails code
is easy. It makes more code to write this in JRuby, but it's written now, so why change it.cl" []
(when (= (-> (fs/cwd) fs/normpath fs/split last) "CircleCI")
(circle.util.chdir/chdir "backend")
(println "Changing current working directory to" (fs/abspath (fs/cwd)))))
(defonce init*
(delay
(try
(println "circle.init/init")
(circle.logging/init)
(when (System/getenv "CIRCLE_SWANK")
(circle.swank/init))
(circle.db/init)
(circle.repl/init)
(println (java.util.Date.))
true
(catch Exception e
(println "caught exception on startup:")
(.printStackTrace e)
(println "exiting")
(System/exit 1)))))
(defn init
"Start everything up. idempotent."
[]
@init*)
(defn -main []
(init)) | (ns circle.init
(:require circle.env) ;; env needs to be loaded before any circle source files containing tests
(:require circle.swank)
(:require circle.db)
(:require circle.repl)
(:require circle.logging)
(:require circle.util.chdir)
(:require fs))
(defn maybe-change-dir
"Change the current working directory to backend/. Although changing it to the project root makes
more conceptual sense, there are lots of entrypoints to the clojure code (for example, tests,
swank, etc) which are hard to get a hook on, but making sure there is a hook into the Rails code
is easy. It makes more code to write this in JRuby, but it's written now, so why change it.cl" []
(when (= (fs/exists? "Gemfile"))
(circle.util.chdir/chdir "backend")
(println "Changing current working directory to" (fs/abspath (fs/cwd)))))
(defonce init*
(delay
(try
(println "circle.init/init")
(circle.logging/init)
(when (System/getenv "CIRCLE_SWANK")
(circle.swank/init))
(circle.db/init)
(circle.repl/init)
(println (java.util.Date.))
true
(catch Exception e
(println "caught exception on startup:")
(.printStackTrace e)
(println "exiting")
(System/exit 1)))))
(defn init
"Start everything up. idempotent."
[]
@init*)
(defn -main []
(init)) | Make chdir directory agnostic. Now keys off the presence of the Gemfile | Make chdir directory agnostic. Now keys off the presence of the Gemfile
| Clojure | epl-1.0 | prathamesh-sonpatki/frontend,circleci/frontend,circleci/frontend,RayRutjes/frontend,RayRutjes/frontend,prathamesh-sonpatki/frontend,circleci/frontend | clojure | ## Code Before:
(ns circle.init
(:require circle.env) ;; env needs to be loaded before any circle source files containing tests
(:require circle.swank)
(:require circle.db)
(:require circle.repl)
(:require circle.logging)
(:require circle.util.chdir)
(:require fs))
(defn maybe-change-dir
"Change the current working directory to backend/. Although changing it to the project root makes
more conceptual sense, there are lots of entrypoints to the clojure code (for example, tests,
swank, etc) which are hard to get a hook on, but making sure there is a hook into the Rails code
is easy. It makes more code to write this in JRuby, but it's written now, so why change it.cl" []
(when (= (-> (fs/cwd) fs/normpath fs/split last) "CircleCI")
(circle.util.chdir/chdir "backend")
(println "Changing current working directory to" (fs/abspath (fs/cwd)))))
(defonce init*
(delay
(try
(println "circle.init/init")
(circle.logging/init)
(when (System/getenv "CIRCLE_SWANK")
(circle.swank/init))
(circle.db/init)
(circle.repl/init)
(println (java.util.Date.))
true
(catch Exception e
(println "caught exception on startup:")
(.printStackTrace e)
(println "exiting")
(System/exit 1)))))
(defn init
"Start everything up. idempotent."
[]
@init*)
(defn -main []
(init))
## Instruction:
Make chdir directory agnostic. Now keys off the presence of the Gemfile
## Code After:
(ns circle.init
(:require circle.env) ;; env needs to be loaded before any circle source files containing tests
(:require circle.swank)
(:require circle.db)
(:require circle.repl)
(:require circle.logging)
(:require circle.util.chdir)
(:require fs))
(defn maybe-change-dir
"Change the current working directory to backend/. Although changing it to the project root makes
more conceptual sense, there are lots of entrypoints to the clojure code (for example, tests,
swank, etc) which are hard to get a hook on, but making sure there is a hook into the Rails code
is easy. It makes more code to write this in JRuby, but it's written now, so why change it.cl" []
(when (= (fs/exists? "Gemfile"))
(circle.util.chdir/chdir "backend")
(println "Changing current working directory to" (fs/abspath (fs/cwd)))))
(defonce init*
(delay
(try
(println "circle.init/init")
(circle.logging/init)
(when (System/getenv "CIRCLE_SWANK")
(circle.swank/init))
(circle.db/init)
(circle.repl/init)
(println (java.util.Date.))
true
(catch Exception e
(println "caught exception on startup:")
(.printStackTrace e)
(println "exiting")
(System/exit 1)))))
(defn init
"Start everything up. idempotent."
[]
@init*)
(defn -main []
(init)) | (ns circle.init
(:require circle.env) ;; env needs to be loaded before any circle source files containing tests
(:require circle.swank)
(:require circle.db)
(:require circle.repl)
(:require circle.logging)
(:require circle.util.chdir)
(:require fs))
(defn maybe-change-dir
"Change the current working directory to backend/. Although changing it to the project root makes
more conceptual sense, there are lots of entrypoints to the clojure code (for example, tests,
swank, etc) which are hard to get a hook on, but making sure there is a hook into the Rails code
is easy. It makes more code to write this in JRuby, but it's written now, so why change it.cl" []
- (when (= (-> (fs/cwd) fs/normpath fs/split last) "CircleCI")
+ (when (= (fs/exists? "Gemfile"))
(circle.util.chdir/chdir "backend")
(println "Changing current working directory to" (fs/abspath (fs/cwd)))))
(defonce init*
(delay
(try
(println "circle.init/init")
(circle.logging/init)
(when (System/getenv "CIRCLE_SWANK")
(circle.swank/init))
(circle.db/init)
(circle.repl/init)
(println (java.util.Date.))
true
(catch Exception e
(println "caught exception on startup:")
(.printStackTrace e)
(println "exiting")
(System/exit 1)))))
(defn init
"Start everything up. idempotent."
[]
@init*)
(defn -main []
(init)) | 2 | 0.047619 | 1 | 1 |
adacbd2f35d25b82ace8c0c1c007b3c2a981c9a3 | src/threads/part4/AtomicCounter.cpp | src/threads/part4/AtomicCounter.cpp |
struct AtomicCounter {
std::atomic<int> value;
void increment(){
++value;
}
void decrement(){
--value;
}
int get(){
return value.load();
}
};
int main(){
AtomicCounter counter;
std::vector<std::thread> threads;
for(int i = 0; i < 10; ++i){
threads.push_back(std::thread([&counter](){
for(int i = 0; i < 500; ++i){
counter.increment();
}
}));
}
for(auto& thread : threads){
thread.join();
}
std::cout << counter.get() << std::endl;
return 0;
}
|
struct AtomicCounter {
std::atomic<int> value;
AtomicCounter() : value(0) {}
void increment(){
++value;
}
void decrement(){
--value;
}
int get(){
return value.load();
}
};
int main(){
AtomicCounter counter;
std::vector<std::thread> threads;
for(int i = 0; i < 10; ++i){
threads.push_back(std::thread([&counter](){
for(int i = 0; i < 500; ++i){
counter.increment();
}
}));
}
for(auto& thread : threads){
thread.join();
}
std::cout << counter.get() << std::endl;
return 0;
}
| Make sure std::atomic is initialized correctly | Make sure std::atomic is initialized correctly
G++ seems to have some issues with default initialization of
std::atomic
| C++ | mit | wichtounet/articles,HankFaan/articles | c++ | ## Code Before:
struct AtomicCounter {
std::atomic<int> value;
void increment(){
++value;
}
void decrement(){
--value;
}
int get(){
return value.load();
}
};
int main(){
AtomicCounter counter;
std::vector<std::thread> threads;
for(int i = 0; i < 10; ++i){
threads.push_back(std::thread([&counter](){
for(int i = 0; i < 500; ++i){
counter.increment();
}
}));
}
for(auto& thread : threads){
thread.join();
}
std::cout << counter.get() << std::endl;
return 0;
}
## Instruction:
Make sure std::atomic is initialized correctly
G++ seems to have some issues with default initialization of
std::atomic
## Code After:
struct AtomicCounter {
std::atomic<int> value;
AtomicCounter() : value(0) {}
void increment(){
++value;
}
void decrement(){
--value;
}
int get(){
return value.load();
}
};
int main(){
AtomicCounter counter;
std::vector<std::thread> threads;
for(int i = 0; i < 10; ++i){
threads.push_back(std::thread([&counter](){
for(int i = 0; i < 500; ++i){
counter.increment();
}
}));
}
for(auto& thread : threads){
thread.join();
}
std::cout << counter.get() << std::endl;
return 0;
}
|
struct AtomicCounter {
std::atomic<int> value;
+
+ AtomicCounter() : value(0) {}
void increment(){
++value;
}
void decrement(){
--value;
}
int get(){
return value.load();
}
};
int main(){
AtomicCounter counter;
std::vector<std::thread> threads;
for(int i = 0; i < 10; ++i){
threads.push_back(std::thread([&counter](){
for(int i = 0; i < 500; ++i){
counter.increment();
}
}));
}
for(auto& thread : threads){
thread.join();
}
std::cout << counter.get() << std::endl;
return 0;
} | 2 | 0.054054 | 2 | 0 |
395bed9879520cb67f8fe52329de481f1dd2db17 | install.bat | install.bat | call npm install
@echo off
@echo if "%%~1"=="-FIXED_CTRL_C" ( > s.bat
@echo shift >> s.bat
@echo ) else ( >> s.bat
@echo call ^<NUL %%0 -FIXED_CTRL_C %%* >> s.bat
@echo goto :EOF >> s.bat
@echo ) >> s.bat
@echo cd database >> s.bat
@echo i.vbs "start /WAIT restart.bat" >> s.bat
@echo cd .. >> s.bat
@echo start "Drathybot" node ../DrathybotAlpha >> s.bat
@echo CreateObject("Wscript.Shell").Run "s.bat", 0, True > Drathybot.vbs
mkdir database
cd database
@echo CreateObject("Wscript.Shell").Run "" ^& WScript.Arguments(0) ^& "", 0, False > i.vbs
@echo del db.log > start.bat
@echo "C:/Program Files/MongoDB/Server/3.0/bin/mongod.exe" --dbpath %%~dp0 --logpath db.log >> start.bat
@echo "C:/Program Files/MongoDB/Server/3.0/bin/mongo.exe" localhost:27017 --eval "db.adminCommand({shutdown : 1})" > stop.bat
@echo call stop.bat > restart.bat
@echo timeout 1 >> restart.bat
@echo wscript.exe i.vbs "start.bat" >> restart.bat
@echo exit >> restart.bat
cd ..
timeout 5 | call npm install
@echo off
@echo if "%%~1"=="-FIXED_CTRL_C" ( > s.bat
@echo shift >> s.bat
@echo ) else ( >> s.bat
@echo call ^<NUL %%0 -FIXED_CTRL_C %%* >> s.bat
@echo goto :EOF >> s.bat
@echo ) >> s.bat
@echo cd database >> s.bat
@echo i.vbs "start /WAIT restart.bat" >> s.bat
@echo cd .. >> s.bat
@echo start "Drathybot" node %~dp0 >> s.bat
@echo CreateObject("Wscript.Shell").Run "s.bat", 0, True > Drathybot.vbs
mkdir database
cd database
@echo CreateObject("Wscript.Shell").Run "" ^& WScript.Arguments(0) ^& "", 0, False > i.vbs
@echo del db.log > start.bat
@echo "C:/Program Files/MongoDB/Server/3.0/bin/mongod.exe" --dbpath %%~dp0 --logpath db.log >> start.bat
@echo "C:/Program Files/MongoDB/Server/3.0/bin/mongo.exe" localhost:27017 --eval "db.adminCommand({shutdown : 1})" > stop.bat
@echo call stop.bat > restart.bat
@echo timeout 1 >> restart.bat
@echo wscript.exe i.vbs "start.bat" >> restart.bat
@echo exit >> restart.bat
cd ..
timeout 5 | Call node on the folder rather than on DrathybotAlpha | Call node on the folder rather than on DrathybotAlpha
| Batchfile | mit | vaughnroyko/DrathybotAlpha,vaughnroyko/Omnibot | batchfile | ## Code Before:
call npm install
@echo off
@echo if "%%~1"=="-FIXED_CTRL_C" ( > s.bat
@echo shift >> s.bat
@echo ) else ( >> s.bat
@echo call ^<NUL %%0 -FIXED_CTRL_C %%* >> s.bat
@echo goto :EOF >> s.bat
@echo ) >> s.bat
@echo cd database >> s.bat
@echo i.vbs "start /WAIT restart.bat" >> s.bat
@echo cd .. >> s.bat
@echo start "Drathybot" node ../DrathybotAlpha >> s.bat
@echo CreateObject("Wscript.Shell").Run "s.bat", 0, True > Drathybot.vbs
mkdir database
cd database
@echo CreateObject("Wscript.Shell").Run "" ^& WScript.Arguments(0) ^& "", 0, False > i.vbs
@echo del db.log > start.bat
@echo "C:/Program Files/MongoDB/Server/3.0/bin/mongod.exe" --dbpath %%~dp0 --logpath db.log >> start.bat
@echo "C:/Program Files/MongoDB/Server/3.0/bin/mongo.exe" localhost:27017 --eval "db.adminCommand({shutdown : 1})" > stop.bat
@echo call stop.bat > restart.bat
@echo timeout 1 >> restart.bat
@echo wscript.exe i.vbs "start.bat" >> restart.bat
@echo exit >> restart.bat
cd ..
timeout 5
## Instruction:
Call node on the folder rather than on DrathybotAlpha
## Code After:
call npm install
@echo off
@echo if "%%~1"=="-FIXED_CTRL_C" ( > s.bat
@echo shift >> s.bat
@echo ) else ( >> s.bat
@echo call ^<NUL %%0 -FIXED_CTRL_C %%* >> s.bat
@echo goto :EOF >> s.bat
@echo ) >> s.bat
@echo cd database >> s.bat
@echo i.vbs "start /WAIT restart.bat" >> s.bat
@echo cd .. >> s.bat
@echo start "Drathybot" node %~dp0 >> s.bat
@echo CreateObject("Wscript.Shell").Run "s.bat", 0, True > Drathybot.vbs
mkdir database
cd database
@echo CreateObject("Wscript.Shell").Run "" ^& WScript.Arguments(0) ^& "", 0, False > i.vbs
@echo del db.log > start.bat
@echo "C:/Program Files/MongoDB/Server/3.0/bin/mongod.exe" --dbpath %%~dp0 --logpath db.log >> start.bat
@echo "C:/Program Files/MongoDB/Server/3.0/bin/mongo.exe" localhost:27017 --eval "db.adminCommand({shutdown : 1})" > stop.bat
@echo call stop.bat > restart.bat
@echo timeout 1 >> restart.bat
@echo wscript.exe i.vbs "start.bat" >> restart.bat
@echo exit >> restart.bat
cd ..
timeout 5 | call npm install
@echo off
@echo if "%%~1"=="-FIXED_CTRL_C" ( > s.bat
@echo shift >> s.bat
@echo ) else ( >> s.bat
@echo call ^<NUL %%0 -FIXED_CTRL_C %%* >> s.bat
@echo goto :EOF >> s.bat
@echo ) >> s.bat
@echo cd database >> s.bat
@echo i.vbs "start /WAIT restart.bat" >> s.bat
@echo cd .. >> s.bat
- @echo start "Drathybot" node ../DrathybotAlpha >> s.bat
? ^^^^^^^^^^^^^^ ^^
+ @echo start "Drathybot" node %~dp0 >> s.bat
? ^^^ ^
@echo CreateObject("Wscript.Shell").Run "s.bat", 0, True > Drathybot.vbs
mkdir database
cd database
@echo CreateObject("Wscript.Shell").Run "" ^& WScript.Arguments(0) ^& "", 0, False > i.vbs
@echo del db.log > start.bat
@echo "C:/Program Files/MongoDB/Server/3.0/bin/mongod.exe" --dbpath %%~dp0 --logpath db.log >> start.bat
@echo "C:/Program Files/MongoDB/Server/3.0/bin/mongo.exe" localhost:27017 --eval "db.adminCommand({shutdown : 1})" > stop.bat
@echo call stop.bat > restart.bat
@echo timeout 1 >> restart.bat
@echo wscript.exe i.vbs "start.bat" >> restart.bat
@echo exit >> restart.bat
cd ..
timeout 5 | 2 | 0.058824 | 1 | 1 |
c6cc812fbfc50f2cdee30846607a19eb09e76071 | autogen.sh | autogen.sh |
if [ -d /usr/local/gnu-autotools/bin ] ; then
PATH=/usr/local/gnu-autotools/bin:${PATH}
export PATH
fi
automake_version=$(automake --version | tr ' ' '\n' | egrep '^[0-9]\.[0-9a-z.-]+')
if [ -z "$automake_version" ] ; then
echo "unable to determine automake version"
exit 1
else
case $automake_version in
1.9*|[23456789].*)
;;
*)
echo "your version of automake ($automake_version) is too old;" \
"you need 1.9 or newer."
exit 1
;;
esac
fi
set -ex
aclocal
libtoolize --copy --force
autoheader
automake --add-missing --copy --foreign
autoconf
|
if [ -d /usr/local/gnu-autotools/bin ] ; then
PATH=/usr/local/gnu-autotools/bin:${PATH}
export PATH
fi
automake_version=$(automake --version | tr ' ' '\n' | egrep '^[0-9]\.[0-9a-z.-]+')
if [ -z "$automake_version" ] ; then
echo "unable to determine automake version"
exit 1
else
case $automake_version in
1.9*|[23456789].*)
;;
*)
echo "your version of automake ($automake_version) is too old;" \
"you need 1.9 or newer."
exit 1
;;
esac
fi
set -ex
if [ "x`uname -s`" = "xFreeBSD" ] ; then
# Ask DES
aclocal -I /usr/local/share/aclocal
else
aclocal
fi
libtoolize --copy --force
autoheader
automake --add-missing --copy --foreign
autoconf
| Add a FreeBSD workaround while des@ tries to get autocrap to DTRT under FreeBSD also. | Add a FreeBSD workaround while des@ tries to get autocrap to DTRT under
FreeBSD also.
git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@1227 d4fa192b-c00b-0410-8231-f00ffab90ce4
| Shell | bsd-2-clause | gquintard/Varnish-Cache,ssm/pkg-varnish,wikimedia/operations-debs-varnish,varnish/Varnish-Cache,zhoualbeart/Varnish-Cache,varnish/Varnish-Cache,varnish/Varnish-Cache,mrhmouse/Varnish-Cache,gauthier-delacroix/Varnish-Cache,mrhmouse/Varnish-Cache,zhoualbeart/Varnish-Cache,ssm/pkg-varnish,ajasty-cavium/Varnish-Cache,ambernetas/varnish-cache,ajasty-cavium/Varnish-Cache,feld/Varnish-Cache,wikimedia/operations-debs-varnish,wikimedia/operations-debs-varnish,ajasty-cavium/Varnish-Cache,ssm/pkg-varnish,drwilco/varnish-cache-old,chrismoulton/Varnish-Cache,gauthier-delacroix/Varnish-Cache,chrismoulton/Varnish-Cache,alarky/varnish-cache-doc-ja,mrhmouse/Varnish-Cache,1HLtd/Varnish-Cache,chrismoulton/Varnish-Cache,1HLtd/Varnish-Cache,gauthier-delacroix/Varnish-Cache,1HLtd/Varnish-Cache,franciscovg/Varnish-Cache,franciscovg/Varnish-Cache,franciscovg/Varnish-Cache,franciscovg/Varnish-Cache,alarky/varnish-cache-doc-ja,feld/Varnish-Cache,gquintard/Varnish-Cache,varnish/Varnish-Cache,gquintard/Varnish-Cache,gquintard/Varnish-Cache,alarky/varnish-cache-doc-ja,drwilco/varnish-cache-drwilco,mrhmouse/Varnish-Cache,ssm/pkg-varnish,drwilco/varnish-cache-old,ajasty-cavium/Varnish-Cache,zhoualbeart/Varnish-Cache,alarky/varnish-cache-doc-ja,zhoualbeart/Varnish-Cache,drwilco/varnish-cache-drwilco,mrhmouse/Varnish-Cache,1HLtd/Varnish-Cache,gauthier-delacroix/Varnish-Cache,varnish/Varnish-Cache,wikimedia/operations-debs-varnish,feld/Varnish-Cache,gauthier-delacroix/Varnish-Cache,ambernetas/varnish-cache,chrismoulton/Varnish-Cache,wikimedia/operations-debs-varnish,alarky/varnish-cache-doc-ja,franciscovg/Varnish-Cache,feld/Varnish-Cache,feld/Varnish-Cache,zhoualbeart/Varnish-Cache,drwilco/varnish-cache-drwilco,chrismoulton/Varnish-Cache,ajasty-cavium/Varnish-Cache,ambernetas/varnish-cache,ssm/pkg-varnish,drwilco/varnish-cache-old | shell | ## Code Before:
if [ -d /usr/local/gnu-autotools/bin ] ; then
PATH=/usr/local/gnu-autotools/bin:${PATH}
export PATH
fi
automake_version=$(automake --version | tr ' ' '\n' | egrep '^[0-9]\.[0-9a-z.-]+')
if [ -z "$automake_version" ] ; then
echo "unable to determine automake version"
exit 1
else
case $automake_version in
1.9*|[23456789].*)
;;
*)
echo "your version of automake ($automake_version) is too old;" \
"you need 1.9 or newer."
exit 1
;;
esac
fi
set -ex
aclocal
libtoolize --copy --force
autoheader
automake --add-missing --copy --foreign
autoconf
## Instruction:
Add a FreeBSD workaround while des@ tries to get autocrap to DTRT under
FreeBSD also.
git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@1227 d4fa192b-c00b-0410-8231-f00ffab90ce4
## Code After:
if [ -d /usr/local/gnu-autotools/bin ] ; then
PATH=/usr/local/gnu-autotools/bin:${PATH}
export PATH
fi
automake_version=$(automake --version | tr ' ' '\n' | egrep '^[0-9]\.[0-9a-z.-]+')
if [ -z "$automake_version" ] ; then
echo "unable to determine automake version"
exit 1
else
case $automake_version in
1.9*|[23456789].*)
;;
*)
echo "your version of automake ($automake_version) is too old;" \
"you need 1.9 or newer."
exit 1
;;
esac
fi
set -ex
if [ "x`uname -s`" = "xFreeBSD" ] ; then
# Ask DES
aclocal -I /usr/local/share/aclocal
else
aclocal
fi
libtoolize --copy --force
autoheader
automake --add-missing --copy --foreign
autoconf
|
if [ -d /usr/local/gnu-autotools/bin ] ; then
PATH=/usr/local/gnu-autotools/bin:${PATH}
export PATH
fi
automake_version=$(automake --version | tr ' ' '\n' | egrep '^[0-9]\.[0-9a-z.-]+')
if [ -z "$automake_version" ] ; then
echo "unable to determine automake version"
exit 1
else
case $automake_version in
1.9*|[23456789].*)
;;
*)
echo "your version of automake ($automake_version) is too old;" \
"you need 1.9 or newer."
exit 1
;;
esac
fi
set -ex
+ if [ "x`uname -s`" = "xFreeBSD" ] ; then
+ # Ask DES
+ aclocal -I /usr/local/share/aclocal
+ else
- aclocal
+ aclocal
? + +
+ fi
libtoolize --copy --force
autoheader
automake --add-missing --copy --foreign
autoconf | 7 | 0.241379 | 6 | 1 |
ab452f7626d8ee836eaf11d121cb3b58a593becc | Cargo.toml | Cargo.toml | [package]
name = "capnpc"
version = "0.1.20"
authors = [ "David Renshaw <david@sandstorm.io>" ]
license = "MIT"
description = "Cap'n Proto schema compiler plugin"
repository = "https://github.com/dwrensha/capnpc-rust"
readme = "README.md"
[lib]
name = "capnpc"
path = "src/lib.rs"
[[bin]]
name = "capnpc-rust"
path = "src/main.rs"
[dependencies]
capnp = "0.1.20"
| [package]
name = "capnpc"
version = "0.1.20"
authors = [ "David Renshaw <david@sandstorm.io>" ]
license = "MIT"
description = "Cap'n Proto schema compiler plugin"
repository = "https://github.com/dwrensha/capnpc-rust"
documentation = "http://docs.capnproto-rust.org"
readme = "README.md"
[lib]
name = "capnpc"
path = "src/lib.rs"
[[bin]]
name = "capnpc-rust"
path = "src/main.rs"
[dependencies]
capnp = "0.1.20"
| Add link to hosted docs. | Add link to hosted docs.
| TOML | mit | tempbottle/capnpc-rust,tempbottle/capnpc-rust,kali/capnpc-rust,kali/capnpc-rust,tempbottle/capnproto-rust,placrosse/capnpc-rust,dwrensha/capnproto-rust,maurer/capnpc-rust,dwrensha/capnpc-rust,placrosse/capnpc-rust,maurer/capnpc-rust,placrosse/capnproto-rust | toml | ## Code Before:
[package]
name = "capnpc"
version = "0.1.20"
authors = [ "David Renshaw <david@sandstorm.io>" ]
license = "MIT"
description = "Cap'n Proto schema compiler plugin"
repository = "https://github.com/dwrensha/capnpc-rust"
readme = "README.md"
[lib]
name = "capnpc"
path = "src/lib.rs"
[[bin]]
name = "capnpc-rust"
path = "src/main.rs"
[dependencies]
capnp = "0.1.20"
## Instruction:
Add link to hosted docs.
## Code After:
[package]
name = "capnpc"
version = "0.1.20"
authors = [ "David Renshaw <david@sandstorm.io>" ]
license = "MIT"
description = "Cap'n Proto schema compiler plugin"
repository = "https://github.com/dwrensha/capnpc-rust"
documentation = "http://docs.capnproto-rust.org"
readme = "README.md"
[lib]
name = "capnpc"
path = "src/lib.rs"
[[bin]]
name = "capnpc-rust"
path = "src/main.rs"
[dependencies]
capnp = "0.1.20"
| [package]
name = "capnpc"
version = "0.1.20"
authors = [ "David Renshaw <david@sandstorm.io>" ]
license = "MIT"
description = "Cap'n Proto schema compiler plugin"
repository = "https://github.com/dwrensha/capnpc-rust"
+ documentation = "http://docs.capnproto-rust.org"
readme = "README.md"
[lib]
name = "capnpc"
path = "src/lib.rs"
[[bin]]
name = "capnpc-rust"
path = "src/main.rs"
[dependencies]
capnp = "0.1.20" | 1 | 0.038462 | 1 | 0 |
3fa729e7fb11f05173ea14b0fed3294aff715c71 | README.md | README.md | Automated Python wheel building and deployment for https://pypi.p16n.org
This repository contains a list of Python packages that we build into wheels and upload to our PyPi mirror. These wheels are used in our Debian-based Docker images: [`praekeltfoundation/dockerfiles`](https://github.com/praekeltfoundation/dockerfiles).
These packages are dependencies of software that we use or maintain. They have native extensions and so would typically require build tools to be installed before they could be used. We build the packages into binary wheels so that build tools are not required. Generally, other dependencies that don't require build tools should be fetched from the standard PyPi repository (https://pypi.python.org).
The packages are built inside Debian Jessie-based Docker containers. As such, the wheels that are produced are only guaranteed to be compatible with Debian Jessie. For some of these wheels, it may still be necessary to install runtime dependencies using `apt`.
|
[](https://travis-ci.org/praekeltfoundation/debian-wheel-mirror)
[](https://requires.io/github/praekeltfoundation/debian-wheel-mirror/requirements/?branch=develop)
Automated Python wheel building and deployment for https://pypi.p16n.org
This repository contains a list of Python packages that we build into wheels and upload to our PyPi mirror. These wheels are used in our Debian-based Docker images: [`praekeltfoundation/dockerfiles`](https://github.com/praekeltfoundation/dockerfiles).
The packages are kept up-to-date by automated pull requests made by [Requires.io](https://requires.io/github/praekeltfoundation/debian-wheel-mirror/requirements/?branch=develop). Packages are built inside Docker containers (currently using the [`python:2`](https://hub.docker.com/_/python/) image) and uploaded to our PyPi mirror by [Travis CI](https://travis-ci.org/praekeltfoundation/debian-wheel-mirror).
These packages are dependencies of software that we use or maintain. They have native extensions and so would typically require build tools to be installed before they could be used. We build the packages into binary wheels so that build tools are not required. Generally, other dependencies that don't require build tools should be fetched from the standard PyPi repository (https://pypi.python.org).
The packages are built inside Debian Jessie-based Docker containers. As such, the wheels that are produced are only guaranteed to be compatible with Debian Jessie. For some of these wheels, it may still be necessary to install runtime dependencies using `apt`.
| Add badges and links to readme | Add badges and links to readme
| Markdown | bsd-3-clause | praekeltfoundation/debian-wheel-mirror | markdown | ## Code Before:
Automated Python wheel building and deployment for https://pypi.p16n.org
This repository contains a list of Python packages that we build into wheels and upload to our PyPi mirror. These wheels are used in our Debian-based Docker images: [`praekeltfoundation/dockerfiles`](https://github.com/praekeltfoundation/dockerfiles).
These packages are dependencies of software that we use or maintain. They have native extensions and so would typically require build tools to be installed before they could be used. We build the packages into binary wheels so that build tools are not required. Generally, other dependencies that don't require build tools should be fetched from the standard PyPi repository (https://pypi.python.org).
The packages are built inside Debian Jessie-based Docker containers. As such, the wheels that are produced are only guaranteed to be compatible with Debian Jessie. For some of these wheels, it may still be necessary to install runtime dependencies using `apt`.
## Instruction:
Add badges and links to readme
## Code After:
[](https://travis-ci.org/praekeltfoundation/debian-wheel-mirror)
[](https://requires.io/github/praekeltfoundation/debian-wheel-mirror/requirements/?branch=develop)
Automated Python wheel building and deployment for https://pypi.p16n.org
This repository contains a list of Python packages that we build into wheels and upload to our PyPi mirror. These wheels are used in our Debian-based Docker images: [`praekeltfoundation/dockerfiles`](https://github.com/praekeltfoundation/dockerfiles).
The packages are kept up-to-date by automated pull requests made by [Requires.io](https://requires.io/github/praekeltfoundation/debian-wheel-mirror/requirements/?branch=develop). Packages are built inside Docker containers (currently using the [`python:2`](https://hub.docker.com/_/python/) image) and uploaded to our PyPi mirror by [Travis CI](https://travis-ci.org/praekeltfoundation/debian-wheel-mirror).
These packages are dependencies of software that we use or maintain. They have native extensions and so would typically require build tools to be installed before they could be used. We build the packages into binary wheels so that build tools are not required. Generally, other dependencies that don't require build tools should be fetched from the standard PyPi repository (https://pypi.python.org).
The packages are built inside Debian Jessie-based Docker containers. As such, the wheels that are produced are only guaranteed to be compatible with Debian Jessie. For some of these wheels, it may still be necessary to install runtime dependencies using `apt`.
| +
+ [](https://travis-ci.org/praekeltfoundation/debian-wheel-mirror)
+ [](https://requires.io/github/praekeltfoundation/debian-wheel-mirror/requirements/?branch=develop)
+
Automated Python wheel building and deployment for https://pypi.p16n.org
This repository contains a list of Python packages that we build into wheels and upload to our PyPi mirror. These wheels are used in our Debian-based Docker images: [`praekeltfoundation/dockerfiles`](https://github.com/praekeltfoundation/dockerfiles).
+ The packages are kept up-to-date by automated pull requests made by [Requires.io](https://requires.io/github/praekeltfoundation/debian-wheel-mirror/requirements/?branch=develop). Packages are built inside Docker containers (currently using the [`python:2`](https://hub.docker.com/_/python/) image) and uploaded to our PyPi mirror by [Travis CI](https://travis-ci.org/praekeltfoundation/debian-wheel-mirror).
+
These packages are dependencies of software that we use or maintain. They have native extensions and so would typically require build tools to be installed before they could be used. We build the packages into binary wheels so that build tools are not required. Generally, other dependencies that don't require build tools should be fetched from the standard PyPi repository (https://pypi.python.org).
The packages are built inside Debian Jessie-based Docker containers. As such, the wheels that are produced are only guaranteed to be compatible with Debian Jessie. For some of these wheels, it may still be necessary to install runtime dependencies using `apt`. | 6 | 0.857143 | 6 | 0 |
5cf860bdc6982131bec9d31cfc9d33c94af6f528 | test/unit/score_updater_job_test.rb | test/unit/score_updater_job_test.rb | require 'test_helper'
class ScoreUpdaterJobTest < ActiveSupport::TestCase
setup do
@user = User.create!
end
teardown do
User.destroy_all
DailyScore.destroy_all
WeeklyScore.destroy_all
MonthlyScore.destroy_all
OverallScore.destroy_all
end
test 'creates a new daily score' do
assert_equal @user.daily_score, nil
ScoreUpdaterJob.new.perform(@user._id)
@user.reload
assert_equal @user.daily_score, DailyScore.last
end
test 'updates a new daily score' do
score = DailyScore.create(user: @user, s: 10)
@user.reload
assert_equal @user.daily_score, score
ScoreUpdaterJob.new.perform(@user._id, 2)
@user.reload
score.reload
assert_equal score.score, 12
assert_equal @user.daily_score, score
end
end
| require 'test_helper'
class ScoreUpdaterJobTest < ActiveSupport::TestCase
setup do
@user = User.create!
end
teardown do
User.destroy_all
DailyScore.destroy_all
WeeklyScore.destroy_all
MonthlyScore.destroy_all
OverallScore.destroy_all
end
test 'creates a new daily score' do
assert_equal @user.daily_score, nil
ScoreUpdaterJob.new.perform(@user._id)
@user.reload
assert_equal @user.daily_score, DailyScore.last
end
test 'updates a daily score' do
score = DailyScore.create(user: @user, s: 10)
@user.reload
assert_equal @user.daily_score, score
ScoreUpdaterJob.new.perform(@user._id, 2)
@user.reload
score.reload
assert_equal score.score, 12
assert_equal @user.daily_score, score
assert_equal DailyScore.count, 1
end
end
| Check that updates do not create a new document | Check that updates do not create a new document
| Ruby | mit | potomak/tomatoes,tomatoes-app/tomatoes,tomatoes-app/tomatoes,tomatoes-app/tomatoes,tomatoes-app/tomatoes,potomak/tomatoes,potomak/tomatoes | ruby | ## Code Before:
require 'test_helper'
class ScoreUpdaterJobTest < ActiveSupport::TestCase
setup do
@user = User.create!
end
teardown do
User.destroy_all
DailyScore.destroy_all
WeeklyScore.destroy_all
MonthlyScore.destroy_all
OverallScore.destroy_all
end
test 'creates a new daily score' do
assert_equal @user.daily_score, nil
ScoreUpdaterJob.new.perform(@user._id)
@user.reload
assert_equal @user.daily_score, DailyScore.last
end
test 'updates a new daily score' do
score = DailyScore.create(user: @user, s: 10)
@user.reload
assert_equal @user.daily_score, score
ScoreUpdaterJob.new.perform(@user._id, 2)
@user.reload
score.reload
assert_equal score.score, 12
assert_equal @user.daily_score, score
end
end
## Instruction:
Check that updates do not create a new document
## Code After:
require 'test_helper'
class ScoreUpdaterJobTest < ActiveSupport::TestCase
setup do
@user = User.create!
end
teardown do
User.destroy_all
DailyScore.destroy_all
WeeklyScore.destroy_all
MonthlyScore.destroy_all
OverallScore.destroy_all
end
test 'creates a new daily score' do
assert_equal @user.daily_score, nil
ScoreUpdaterJob.new.perform(@user._id)
@user.reload
assert_equal @user.daily_score, DailyScore.last
end
test 'updates a daily score' do
score = DailyScore.create(user: @user, s: 10)
@user.reload
assert_equal @user.daily_score, score
ScoreUpdaterJob.new.perform(@user._id, 2)
@user.reload
score.reload
assert_equal score.score, 12
assert_equal @user.daily_score, score
assert_equal DailyScore.count, 1
end
end
| require 'test_helper'
class ScoreUpdaterJobTest < ActiveSupport::TestCase
setup do
@user = User.create!
end
teardown do
User.destroy_all
DailyScore.destroy_all
WeeklyScore.destroy_all
MonthlyScore.destroy_all
OverallScore.destroy_all
end
test 'creates a new daily score' do
assert_equal @user.daily_score, nil
ScoreUpdaterJob.new.perform(@user._id)
@user.reload
assert_equal @user.daily_score, DailyScore.last
end
- test 'updates a new daily score' do
? ----
+ test 'updates a daily score' do
score = DailyScore.create(user: @user, s: 10)
@user.reload
assert_equal @user.daily_score, score
ScoreUpdaterJob.new.perform(@user._id, 2)
@user.reload
score.reload
assert_equal score.score, 12
assert_equal @user.daily_score, score
+ assert_equal DailyScore.count, 1
end
end | 3 | 0.090909 | 2 | 1 |
d1aae6ce7c12dda1fc2189411403e7a409aa81c1 | lib/controllers/acceptanceTestExecutions.js | lib/controllers/acceptanceTestExecutions.js | var mongoose = require('mongoose');
var _ = require('lodash');
var AcceptanceTestExecution = mongoose.model('AcceptanceTestExecution');
exports.list = function(req, res, next) {
AcceptanceTestExecution
.find()
.where('acceptanceTest').equals(req.acceptanceTest._id)
.select('-acceptanceTest')
.exec(function(err, acceptanceTestExecutions) {
if (err) return next(err);
res.send(acceptanceTestExecutions);
});
};
exports.create = function(req, res, next) {
req.acceptanceTest.execute(req.user, function(err, execution) {
if (err) return next(err);
res.send(_.omit(execution.toObject(), 'acceptanceTest'));
});
};
| var mongoose = require('mongoose');
var _ = require('lodash');
var AcceptanceTestExecution = mongoose.model('AcceptanceTestExecution');
exports.list = function(req, res, next) {
AcceptanceTestExecution
.find()
.where('acceptanceTest').equals(req.acceptanceTest._id)
.select('-acceptanceTest')
.exec(function(err, acceptanceTestExecutions) {
if (err) return next(err);
res.send(acceptanceTestExecutions);
});
};
exports.create = function(req, res, next) {
req.acceptanceTest.execute(function(err, execution) {
if (err) return next(err);
res.send(_.omit(execution.toObject(), 'acceptanceTest'));
});
};
| Fix ancien appel de fonction | Fix ancien appel de fonction
| JavaScript | agpl-3.0 | sgmap/mes-aides-api | javascript | ## Code Before:
var mongoose = require('mongoose');
var _ = require('lodash');
var AcceptanceTestExecution = mongoose.model('AcceptanceTestExecution');
exports.list = function(req, res, next) {
AcceptanceTestExecution
.find()
.where('acceptanceTest').equals(req.acceptanceTest._id)
.select('-acceptanceTest')
.exec(function(err, acceptanceTestExecutions) {
if (err) return next(err);
res.send(acceptanceTestExecutions);
});
};
exports.create = function(req, res, next) {
req.acceptanceTest.execute(req.user, function(err, execution) {
if (err) return next(err);
res.send(_.omit(execution.toObject(), 'acceptanceTest'));
});
};
## Instruction:
Fix ancien appel de fonction
## Code After:
var mongoose = require('mongoose');
var _ = require('lodash');
var AcceptanceTestExecution = mongoose.model('AcceptanceTestExecution');
exports.list = function(req, res, next) {
AcceptanceTestExecution
.find()
.where('acceptanceTest').equals(req.acceptanceTest._id)
.select('-acceptanceTest')
.exec(function(err, acceptanceTestExecutions) {
if (err) return next(err);
res.send(acceptanceTestExecutions);
});
};
exports.create = function(req, res, next) {
req.acceptanceTest.execute(function(err, execution) {
if (err) return next(err);
res.send(_.omit(execution.toObject(), 'acceptanceTest'));
});
};
| var mongoose = require('mongoose');
var _ = require('lodash');
var AcceptanceTestExecution = mongoose.model('AcceptanceTestExecution');
exports.list = function(req, res, next) {
AcceptanceTestExecution
.find()
.where('acceptanceTest').equals(req.acceptanceTest._id)
.select('-acceptanceTest')
.exec(function(err, acceptanceTestExecutions) {
if (err) return next(err);
res.send(acceptanceTestExecutions);
});
};
exports.create = function(req, res, next) {
- req.acceptanceTest.execute(req.user, function(err, execution) {
? ----------
+ req.acceptanceTest.execute(function(err, execution) {
if (err) return next(err);
res.send(_.omit(execution.toObject(), 'acceptanceTest'));
});
}; | 2 | 0.090909 | 1 | 1 |
963acd04b33fbc0db4af124618f1a3b5ab107737 | kolibri/plugins/learn/assets/src/views/PageHeader.vue | kolibri/plugins/learn/assets/src/views/PageHeader.vue | <template>
<div dir="auto">
<h1 class="title">
<KLabeledIcon>
<KIcon v-if="contentType" slot="icon" :[iconType]="true" />
{{ title }}
</KLabeledIcon>
<ProgressIcon class="progress-icon" :progress="progress" />
</h1>
</div>
</template>
<script>
import ProgressIcon from 'kolibri.coreVue.components.ProgressIcon';
import KIcon from 'kolibri.coreVue.components.KIcon';
import KLabeledIcon from 'kolibri.coreVue.components.KLabeledIcon';
export default {
name: 'PageHeader',
components: {
KIcon,
KLabeledIcon,
ProgressIcon,
},
props: {
title: {
type: String,
},
progress: {
type: Number,
required: false,
},
contentType: {
type: String,
},
},
computed: {
iconType() {
if (this.contentType === 'document') {
return 'doc';
}
return this.contentType;
},
},
};
</script>
<style lang="scss" scoped>
.title {
display: inline-block;
}
.progress-icon {
position: relative;
top: -2px;
display: inline-block;
margin-left: 16px;
}
</style>
| <template>
<div dir="auto">
<h1 class="title">
<KLabeledIcon>
<KIcon v-if="contentType" slot="icon" :[iconType]="true" />
{{ title }}
</KLabeledIcon>
<ProgressIcon class="progress-icon" :progress="progress" />
</h1>
</div>
</template>
<script>
import ProgressIcon from 'kolibri.coreVue.components.ProgressIcon';
import KIcon from 'kolibri.coreVue.components.KIcon';
import KLabeledIcon from 'kolibri.coreVue.components.KLabeledIcon';
export default {
name: 'PageHeader',
components: {
KIcon,
KLabeledIcon,
ProgressIcon,
},
props: {
title: {
type: String,
},
progress: {
type: Number,
required: false,
},
contentType: {
type: String,
},
},
computed: {
iconType() {
if (this.contentType === 'document') {
return 'doc';
}
return this.contentType;
},
},
};
</script>
<style lang="scss" scoped>
.title {
display: inline-block;
}
.progress-icon {
display: inline-block;
float: right;
margin-top: -2px;
margin-left: 16px;
}
</style>
| Fix RTL behavior of ContentPage ProgressIcon | Fix RTL behavior of ContentPage ProgressIcon
| Vue | mit | mrpau/kolibri,mrpau/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,learningequality/kolibri,indirectlylit/kolibri,learningequality/kolibri,mrpau/kolibri,learningequality/kolibri,mrpau/kolibri,learningequality/kolibri,indirectlylit/kolibri | vue | ## Code Before:
<template>
<div dir="auto">
<h1 class="title">
<KLabeledIcon>
<KIcon v-if="contentType" slot="icon" :[iconType]="true" />
{{ title }}
</KLabeledIcon>
<ProgressIcon class="progress-icon" :progress="progress" />
</h1>
</div>
</template>
<script>
import ProgressIcon from 'kolibri.coreVue.components.ProgressIcon';
import KIcon from 'kolibri.coreVue.components.KIcon';
import KLabeledIcon from 'kolibri.coreVue.components.KLabeledIcon';
export default {
name: 'PageHeader',
components: {
KIcon,
KLabeledIcon,
ProgressIcon,
},
props: {
title: {
type: String,
},
progress: {
type: Number,
required: false,
},
contentType: {
type: String,
},
},
computed: {
iconType() {
if (this.contentType === 'document') {
return 'doc';
}
return this.contentType;
},
},
};
</script>
<style lang="scss" scoped>
.title {
display: inline-block;
}
.progress-icon {
position: relative;
top: -2px;
display: inline-block;
margin-left: 16px;
}
</style>
## Instruction:
Fix RTL behavior of ContentPage ProgressIcon
## Code After:
<template>
<div dir="auto">
<h1 class="title">
<KLabeledIcon>
<KIcon v-if="contentType" slot="icon" :[iconType]="true" />
{{ title }}
</KLabeledIcon>
<ProgressIcon class="progress-icon" :progress="progress" />
</h1>
</div>
</template>
<script>
import ProgressIcon from 'kolibri.coreVue.components.ProgressIcon';
import KIcon from 'kolibri.coreVue.components.KIcon';
import KLabeledIcon from 'kolibri.coreVue.components.KLabeledIcon';
export default {
name: 'PageHeader',
components: {
KIcon,
KLabeledIcon,
ProgressIcon,
},
props: {
title: {
type: String,
},
progress: {
type: Number,
required: false,
},
contentType: {
type: String,
},
},
computed: {
iconType() {
if (this.contentType === 'document') {
return 'doc';
}
return this.contentType;
},
},
};
</script>
<style lang="scss" scoped>
.title {
display: inline-block;
}
.progress-icon {
display: inline-block;
float: right;
margin-top: -2px;
margin-left: 16px;
}
</style>
| <template>
<div dir="auto">
<h1 class="title">
<KLabeledIcon>
<KIcon v-if="contentType" slot="icon" :[iconType]="true" />
{{ title }}
</KLabeledIcon>
<ProgressIcon class="progress-icon" :progress="progress" />
</h1>
</div>
</template>
<script>
import ProgressIcon from 'kolibri.coreVue.components.ProgressIcon';
import KIcon from 'kolibri.coreVue.components.KIcon';
import KLabeledIcon from 'kolibri.coreVue.components.KLabeledIcon';
export default {
name: 'PageHeader',
components: {
KIcon,
KLabeledIcon,
ProgressIcon,
},
props: {
title: {
type: String,
},
progress: {
type: Number,
required: false,
},
contentType: {
type: String,
},
},
computed: {
iconType() {
if (this.contentType === 'document') {
return 'doc';
}
return this.contentType;
},
},
};
</script>
<style lang="scss" scoped>
.title {
display: inline-block;
}
.progress-icon {
- position: relative;
- top: -2px;
display: inline-block;
+ float: right;
+ margin-top: -2px;
margin-left: 16px;
}
</style> | 4 | 0.059701 | 2 | 2 |
1250d66e60b3b429a1f5f39ecd5beda6e4074ff9 | setup.py | setup.py | from distutils.util import convert_path
import re
from setuptools import setup
import sys
def get_version():
with open(convert_path('cinspect/__init__.py')) as f:
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", f.read()))
return metadata.get('version', '0.1')
def get_long_description():
with open('README.md') as f:
return f.read()
packages = [
'cinspect',
'cinspect.index',
'cinspect.tests',
]
package_data = {'cinspect.tests': ['data/*.py']}
if sys.version_info.major == 2:
packages.extend([
'cinspect.vendor.clang',
])
package_data['cinspect.tests'] += ['data/*.md', 'data/*.c']
setup(
name="cinspect",
author="Puneeth Chaganti",
author_email="punchagan@muse-amuse.in",
version=get_version(),
long_description=get_long_description(),
url = "https://github.com/punchagan/cinspect",
license="BSD",
description = "C-source introspection for packages.",
packages = packages,
package_data=package_data,
entry_points = {
"console_scripts": [
"cinspect-index = cinspect.index.writer:main",
],
},
)
| from distutils.util import convert_path
import re
from setuptools import setup
import sys
def get_version():
with open(convert_path('cinspect/__init__.py')) as f:
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", f.read()))
return metadata.get('version', '0.1')
def get_long_description():
with open('README.md') as f:
return f.read()
packages = [
'cinspect',
'cinspect.index',
'cinspect.tests',
]
package_data = {'cinspect.tests': ['data/*.py']}
entry_points = {}
if sys.version_info.major == 2:
packages.extend([
'cinspect.vendor.clang',
])
package_data['cinspect.tests'] += ['data/*.md', 'data/*.c']
entry_points = {
"console_scripts": [
"cinspect-index = cinspect.index.writer:main",
],
}
setup(
name="cinspect",
author="Puneeth Chaganti",
author_email="punchagan@muse-amuse.in",
version=get_version(),
long_description=get_long_description(),
url = "https://github.com/punchagan/cinspect",
license="BSD",
description = "C-source introspection for packages.",
packages = packages,
package_data=package_data,
entry_points=entry_points,
)
| Install console script only in Py2.x. | Install console script only in Py2.x.
| Python | bsd-3-clause | punchagan/cinspect,punchagan/cinspect | python | ## Code Before:
from distutils.util import convert_path
import re
from setuptools import setup
import sys
def get_version():
with open(convert_path('cinspect/__init__.py')) as f:
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", f.read()))
return metadata.get('version', '0.1')
def get_long_description():
with open('README.md') as f:
return f.read()
packages = [
'cinspect',
'cinspect.index',
'cinspect.tests',
]
package_data = {'cinspect.tests': ['data/*.py']}
if sys.version_info.major == 2:
packages.extend([
'cinspect.vendor.clang',
])
package_data['cinspect.tests'] += ['data/*.md', 'data/*.c']
setup(
name="cinspect",
author="Puneeth Chaganti",
author_email="punchagan@muse-amuse.in",
version=get_version(),
long_description=get_long_description(),
url = "https://github.com/punchagan/cinspect",
license="BSD",
description = "C-source introspection for packages.",
packages = packages,
package_data=package_data,
entry_points = {
"console_scripts": [
"cinspect-index = cinspect.index.writer:main",
],
},
)
## Instruction:
Install console script only in Py2.x.
## Code After:
from distutils.util import convert_path
import re
from setuptools import setup
import sys
def get_version():
with open(convert_path('cinspect/__init__.py')) as f:
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", f.read()))
return metadata.get('version', '0.1')
def get_long_description():
with open('README.md') as f:
return f.read()
packages = [
'cinspect',
'cinspect.index',
'cinspect.tests',
]
package_data = {'cinspect.tests': ['data/*.py']}
entry_points = {}
if sys.version_info.major == 2:
packages.extend([
'cinspect.vendor.clang',
])
package_data['cinspect.tests'] += ['data/*.md', 'data/*.c']
entry_points = {
"console_scripts": [
"cinspect-index = cinspect.index.writer:main",
],
}
setup(
name="cinspect",
author="Puneeth Chaganti",
author_email="punchagan@muse-amuse.in",
version=get_version(),
long_description=get_long_description(),
url = "https://github.com/punchagan/cinspect",
license="BSD",
description = "C-source introspection for packages.",
packages = packages,
package_data=package_data,
entry_points=entry_points,
)
| from distutils.util import convert_path
import re
from setuptools import setup
import sys
def get_version():
with open(convert_path('cinspect/__init__.py')) as f:
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", f.read()))
return metadata.get('version', '0.1')
def get_long_description():
with open('README.md') as f:
return f.read()
packages = [
'cinspect',
'cinspect.index',
'cinspect.tests',
]
-
package_data = {'cinspect.tests': ['data/*.py']}
+ entry_points = {}
if sys.version_info.major == 2:
packages.extend([
'cinspect.vendor.clang',
])
-
package_data['cinspect.tests'] += ['data/*.md', 'data/*.c']
-
+ entry_points = {
+ "console_scripts": [
+ "cinspect-index = cinspect.index.writer:main",
+ ],
+ }
setup(
name="cinspect",
author="Puneeth Chaganti",
author_email="punchagan@muse-amuse.in",
version=get_version(),
long_description=get_long_description(),
url = "https://github.com/punchagan/cinspect",
license="BSD",
description = "C-source introspection for packages.",
packages = packages,
package_data=package_data,
+ entry_points=entry_points,
- entry_points = {
- "console_scripts": [
- "cinspect-index = cinspect.index.writer:main",
- ],
- },
) | 15 | 0.3 | 7 | 8 |
a05e1df4871dd8aa6c8e27e4649de68cd84308de | static/course/remote/start.html | static/course/remote/start.html | <html>
<head>
<title>Spidr :: Web-Spider Obstacle Course :: Remote Links</title>
</head>
<body>
<p>Remote links.</p>
<ul>
<li class="nofollow">
<a href="http://spidr.rubyforge.org/course/remote/start.html">should not follow remote links to the same page</a>
</li>
<li class="nofollow">
<a href="http://spidr.rubyforge.org/course/loop/../remote/start.html">should not follow remote links with a relative path to the same page</a>
</li>
<li class="follow">
<a href="http://spidr.rubyforge.org/course/remote/next.html">should follow remote links to unvisited pages</a>
</li>
<li class="fail">
<a href="http://127.0.0.1/path/">should ignore links that fail</a>
</li>
</ul>
</body>
</html>
| <html>
<head>
<title>Spidr :: Web-Spider Obstacle Course :: Remote Links</title>
</head>
<body>
<p>Remote links.</p>
<ul>
<li class="nofollow">
<a href="http://spidr.rubyforge.org/course/remote/start.html">should not follow remote links to the same page</a>
</li>
<li class="nofollow">
<a href="http://spidr.rubyforge.org/course/loop/../remote/start.html">should not follow remote links with a relative path to the same page</a>
</li>
<li class="follow">
<a href="http://spidr.rubyforge.org/course/remote/next.html">should follow remote links to unvisited pages</a>
</li>
<li class="fail">
<a href="http://spidr.rubyforge.org:1337/path/">should ignore links that fail</a>
</li>
</ul>
</body>
</html>
| Make sure to use the spidr.rubyforge.org host-name in the links. | Make sure to use the spidr.rubyforge.org host-name in the links.
* Use an incorrect port to cause a failure when visiting the link.
| HTML | mit | buren/spidr,postmodern/spidr,laplaceliu/spidr | html | ## Code Before:
<html>
<head>
<title>Spidr :: Web-Spider Obstacle Course :: Remote Links</title>
</head>
<body>
<p>Remote links.</p>
<ul>
<li class="nofollow">
<a href="http://spidr.rubyforge.org/course/remote/start.html">should not follow remote links to the same page</a>
</li>
<li class="nofollow">
<a href="http://spidr.rubyforge.org/course/loop/../remote/start.html">should not follow remote links with a relative path to the same page</a>
</li>
<li class="follow">
<a href="http://spidr.rubyforge.org/course/remote/next.html">should follow remote links to unvisited pages</a>
</li>
<li class="fail">
<a href="http://127.0.0.1/path/">should ignore links that fail</a>
</li>
</ul>
</body>
</html>
## Instruction:
Make sure to use the spidr.rubyforge.org host-name in the links.
* Use an incorrect port to cause a failure when visiting the link.
## Code After:
<html>
<head>
<title>Spidr :: Web-Spider Obstacle Course :: Remote Links</title>
</head>
<body>
<p>Remote links.</p>
<ul>
<li class="nofollow">
<a href="http://spidr.rubyforge.org/course/remote/start.html">should not follow remote links to the same page</a>
</li>
<li class="nofollow">
<a href="http://spidr.rubyforge.org/course/loop/../remote/start.html">should not follow remote links with a relative path to the same page</a>
</li>
<li class="follow">
<a href="http://spidr.rubyforge.org/course/remote/next.html">should follow remote links to unvisited pages</a>
</li>
<li class="fail">
<a href="http://spidr.rubyforge.org:1337/path/">should ignore links that fail</a>
</li>
</ul>
</body>
</html>
| <html>
<head>
<title>Spidr :: Web-Spider Obstacle Course :: Remote Links</title>
</head>
<body>
<p>Remote links.</p>
<ul>
<li class="nofollow">
<a href="http://spidr.rubyforge.org/course/remote/start.html">should not follow remote links to the same page</a>
</li>
<li class="nofollow">
<a href="http://spidr.rubyforge.org/course/loop/../remote/start.html">should not follow remote links with a relative path to the same page</a>
</li>
<li class="follow">
<a href="http://spidr.rubyforge.org/course/remote/next.html">should follow remote links to unvisited pages</a>
</li>
<li class="fail">
- <a href="http://127.0.0.1/path/">should ignore links that fail</a>
? ^ ------
+ <a href="http://spidr.rubyforge.org:1337/path/">should ignore links that fail</a>
? ++++++++++++++++++++ ^^
</li>
</ul>
</body>
</html> | 2 | 0.074074 | 1 | 1 |
6d144c0056a3847087a828ea482d72ed74e29c9a | advances/slave_labor.js | advances/slave_labor.js | module.exports = {
name: "slave_labor",
title: "Slave Labor",
description: "During Upkeep, you can increase one City AV by 1. \
The maximum AV of a City is 2, unless otherwise noted.",
points: 1,
cost: { },
resources: [ 'food' ],
requires: [ ],
required_by: [ 'government' ],
events: {
'anarchy': {
'steps': {
'2': "- If you have {{ adv:slave_labor }}, Draw the next card {%; draw_card() %}. \
Reduce Tribes throughout your Empire an \
additional amount as shown in the RED CIRCLE. \
{%; reduce('tribes', card_value('c')) %}"
}
},
'uprising': {
'steps': {
'3': "- If you have {{ adv:slave_labor }}, Decimate farms in areas that have no cities.\
{% reduceFarms() %}"
},
reduceFarms: function() {
}
},
'bandits': {
}
},
phases: {
'city_advance.pre': function(ctx) {
console.log('Slave labor max city 2')
this.max_city = !this.max_city || this.max_city < 2 ? 2 : this.max_city;
if (this.round.city_advance_limit === undefined)
this.round.city_advance_limit = 1;
else
this.round.city_advance_limit++;
ctx.done && ctx.done();
}
},
actions: { },
} | module.exports = {
name: "slave_labor",
title: "Slave Labor",
description: "During Upkeep, you can increase one City AV by 1. \
The maximum AV of a City is 2, unless otherwise noted.",
points: 1,
cost: { },
resources: [ 'food' ],
requires: [ ],
required_by: [ ],
events: {
'anarchy': {
'steps': {
'2': "- If you have {{ adv:slave_labor }}, Draw the next card {%; draw_card() %}. \
Reduce Tribes throughout your Empire an \
additional amount as shown in the RED CIRCLE. \
{%; reduce('tribes', card_value('c')) %}"
}
},
'uprising': {
'steps': {
'3': "- If you have {{ adv:slave_labor }}, Decimate farms in areas that have no cities.\
{% reduceFarms() %}"
},
reduceFarms: function() {
}
},
'bandits': {
}
},
phases: {
'city_advance.pre': function(ctx) {
console.log('Slave labor max city 2')
this.max_city = !this.max_city || this.max_city < 2 ? 2 : this.max_city;
if (this.round.city_advance_limit === undefined)
this.round.city_advance_limit = 1;
else
this.round.city_advance_limit++;
ctx.done && ctx.done();
}
},
actions: { },
} | Fix slave labor required by | Fix slave labor required by
| JavaScript | agpl-3.0 | jrutila/pocketciv-js,jrutila/pocketciv-js,jrutila/pocketciv-js | javascript | ## Code Before:
module.exports = {
name: "slave_labor",
title: "Slave Labor",
description: "During Upkeep, you can increase one City AV by 1. \
The maximum AV of a City is 2, unless otherwise noted.",
points: 1,
cost: { },
resources: [ 'food' ],
requires: [ ],
required_by: [ 'government' ],
events: {
'anarchy': {
'steps': {
'2': "- If you have {{ adv:slave_labor }}, Draw the next card {%; draw_card() %}. \
Reduce Tribes throughout your Empire an \
additional amount as shown in the RED CIRCLE. \
{%; reduce('tribes', card_value('c')) %}"
}
},
'uprising': {
'steps': {
'3': "- If you have {{ adv:slave_labor }}, Decimate farms in areas that have no cities.\
{% reduceFarms() %}"
},
reduceFarms: function() {
}
},
'bandits': {
}
},
phases: {
'city_advance.pre': function(ctx) {
console.log('Slave labor max city 2')
this.max_city = !this.max_city || this.max_city < 2 ? 2 : this.max_city;
if (this.round.city_advance_limit === undefined)
this.round.city_advance_limit = 1;
else
this.round.city_advance_limit++;
ctx.done && ctx.done();
}
},
actions: { },
}
## Instruction:
Fix slave labor required by
## Code After:
module.exports = {
name: "slave_labor",
title: "Slave Labor",
description: "During Upkeep, you can increase one City AV by 1. \
The maximum AV of a City is 2, unless otherwise noted.",
points: 1,
cost: { },
resources: [ 'food' ],
requires: [ ],
required_by: [ ],
events: {
'anarchy': {
'steps': {
'2': "- If you have {{ adv:slave_labor }}, Draw the next card {%; draw_card() %}. \
Reduce Tribes throughout your Empire an \
additional amount as shown in the RED CIRCLE. \
{%; reduce('tribes', card_value('c')) %}"
}
},
'uprising': {
'steps': {
'3': "- If you have {{ adv:slave_labor }}, Decimate farms in areas that have no cities.\
{% reduceFarms() %}"
},
reduceFarms: function() {
}
},
'bandits': {
}
},
phases: {
'city_advance.pre': function(ctx) {
console.log('Slave labor max city 2')
this.max_city = !this.max_city || this.max_city < 2 ? 2 : this.max_city;
if (this.round.city_advance_limit === undefined)
this.round.city_advance_limit = 1;
else
this.round.city_advance_limit++;
ctx.done && ctx.done();
}
},
actions: { },
} | module.exports = {
name: "slave_labor",
title: "Slave Labor",
description: "During Upkeep, you can increase one City AV by 1. \
The maximum AV of a City is 2, unless otherwise noted.",
points: 1,
cost: { },
resources: [ 'food' ],
requires: [ ],
- required_by: [ 'government' ],
? -------------
+ required_by: [ ],
events: {
'anarchy': {
'steps': {
'2': "- If you have {{ adv:slave_labor }}, Draw the next card {%; draw_card() %}. \
Reduce Tribes throughout your Empire an \
additional amount as shown in the RED CIRCLE. \
{%; reduce('tribes', card_value('c')) %}"
}
},
'uprising': {
'steps': {
'3': "- If you have {{ adv:slave_labor }}, Decimate farms in areas that have no cities.\
{% reduceFarms() %}"
},
reduceFarms: function() {
}
},
'bandits': {
}
},
phases: {
'city_advance.pre': function(ctx) {
console.log('Slave labor max city 2')
this.max_city = !this.max_city || this.max_city < 2 ? 2 : this.max_city;
if (this.round.city_advance_limit === undefined)
this.round.city_advance_limit = 1;
else
this.round.city_advance_limit++;
ctx.done && ctx.done();
}
},
actions: { },
} | 2 | 0.044444 | 1 | 1 |
ebd2b0344f70c761059b601d98bfaff03d49f3f7 | docs/source/events.rst | docs/source/events.rst | .. _events:
Events
======
You can register one or several functions to receive events
emited during the load test. You just need to decorate the function
with the :func:`molotov.events` fixture described below:
.. autofunction:: molotov.events
Current supported events and their keyword arguments:
- **sending_request**: session, request
- **response_received**: session, response, request
- **current_workers**: workers
- **scenario_success**: scenario
- **scenario_failure**: scenario, exception
The framework will gradually get more events triggered from
every step in the load test cycle.
In the example below, all events are printed out:
.. literalinclude:: ../../molotov/tests/example5.py
| .. _events:
Events
======
You can register one or several functions to receive events
emited during the load test. You just need to decorate the function
with the :func:`molotov.events` fixture described below:
.. autofunction:: molotov.events
Current supported events and their keyword arguments:
- **sending_request**: session, request
- **response_received**: session, response, request
- **current_workers**: workers
- **scenario_start**: scenario, wid
- **scenario_success**: scenario, wid
- **scenario_failure**: scenario, exception, wid
The framework will gradually get more events triggered from
every step in the load test cycle.
In the example below, all events are printed out:
.. literalinclude:: ../../molotov/tests/example5.py
| Add docs for new event | Add docs for new event
| reStructuredText | apache-2.0 | loads/molotov,loads/ailoads | restructuredtext | ## Code Before:
.. _events:
Events
======
You can register one or several functions to receive events
emited during the load test. You just need to decorate the function
with the :func:`molotov.events` fixture described below:
.. autofunction:: molotov.events
Current supported events and their keyword arguments:
- **sending_request**: session, request
- **response_received**: session, response, request
- **current_workers**: workers
- **scenario_success**: scenario
- **scenario_failure**: scenario, exception
The framework will gradually get more events triggered from
every step in the load test cycle.
In the example below, all events are printed out:
.. literalinclude:: ../../molotov/tests/example5.py
## Instruction:
Add docs for new event
## Code After:
.. _events:
Events
======
You can register one or several functions to receive events
emited during the load test. You just need to decorate the function
with the :func:`molotov.events` fixture described below:
.. autofunction:: molotov.events
Current supported events and their keyword arguments:
- **sending_request**: session, request
- **response_received**: session, response, request
- **current_workers**: workers
- **scenario_start**: scenario, wid
- **scenario_success**: scenario, wid
- **scenario_failure**: scenario, exception, wid
The framework will gradually get more events triggered from
every step in the load test cycle.
In the example below, all events are printed out:
.. literalinclude:: ../../molotov/tests/example5.py
| .. _events:
Events
======
You can register one or several functions to receive events
emited during the load test. You just need to decorate the function
with the :func:`molotov.events` fixture described below:
.. autofunction:: molotov.events
Current supported events and their keyword arguments:
- **sending_request**: session, request
- **response_received**: session, response, request
- **current_workers**: workers
+ - **scenario_start**: scenario, wid
- - **scenario_success**: scenario
+ - **scenario_success**: scenario, wid
? +++++
- - **scenario_failure**: scenario, exception
+ - **scenario_failure**: scenario, exception, wid
? +++++
The framework will gradually get more events triggered from
every step in the load test cycle.
In the example below, all events are printed out:
.. literalinclude:: ../../molotov/tests/example5.py
| 5 | 0.192308 | 3 | 2 |
84b3ceec01cf8bdb8f1e7c3ffa102ffde79dc007 | package.json | package.json | {
"name": "codius-engine",
"version": "1.2.0",
"description": "Codius smart oracle runtime engine for Node.js",
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/codius/engine.git"
},
"scripts": {
"test": "./node_modules/.bin/istanbul test --preload-sources ./node_modules/.bin/_mocha -- --reporter spec test/*.js"
},
"dependencies": {
"bigi": "^1.3.0",
"bitcoinjs-lib": "^1.1.3",
"bluebird": "^2.3.5",
"codius-node-sandbox": "^1.2.0",
"ecurve": "^1.0.0",
"extend": "^2.0.0",
"ignore": "^2.2.15",
"lodash": "^2.4.1"
},
"devDependencies": {
"chai": "^1.9.1",
"istanbul": "^0.2.13",
"mocha": "^1.20.1",
"sinon": "^1.10.2",
"sinon-chai": "^2.5.0"
},
"license": "ISC"
}
| {
"name": "codius-engine",
"version": "1.2.0",
"description": "Codius smart oracle runtime engine for Node.js",
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/codius/engine.git"
},
"scripts": {
"test": "./node_modules/.bin/istanbul test --preload-sources ./node_modules/.bin/_mocha -- --reporter spec test/*.js"
},
"dependencies": {
"bigi": "^1.3.0",
"bitcoinjs-lib": "^1.1.3",
"bluebird": "^2.3.5",
"codius-node-sandbox": "git://github.com/codius/codius-node-sandbox#v1.2.0",
"ecurve": "^1.0.0",
"extend": "^2.0.0",
"ignore": "^2.2.15",
"lodash": "^2.4.1"
},
"devDependencies": {
"chai": "^1.9.1",
"istanbul": "^0.2.13",
"mocha": "^1.20.1",
"sinon": "^1.10.2",
"sinon-chai": "^2.5.0"
},
"license": "ISC"
}
| Bump version and sandbox tag version | [TASK] Bump version and sandbox tag version
| JSON | isc | codius/codius-engine | json | ## Code Before:
{
"name": "codius-engine",
"version": "1.2.0",
"description": "Codius smart oracle runtime engine for Node.js",
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/codius/engine.git"
},
"scripts": {
"test": "./node_modules/.bin/istanbul test --preload-sources ./node_modules/.bin/_mocha -- --reporter spec test/*.js"
},
"dependencies": {
"bigi": "^1.3.0",
"bitcoinjs-lib": "^1.1.3",
"bluebird": "^2.3.5",
"codius-node-sandbox": "^1.2.0",
"ecurve": "^1.0.0",
"extend": "^2.0.0",
"ignore": "^2.2.15",
"lodash": "^2.4.1"
},
"devDependencies": {
"chai": "^1.9.1",
"istanbul": "^0.2.13",
"mocha": "^1.20.1",
"sinon": "^1.10.2",
"sinon-chai": "^2.5.0"
},
"license": "ISC"
}
## Instruction:
[TASK] Bump version and sandbox tag version
## Code After:
{
"name": "codius-engine",
"version": "1.2.0",
"description": "Codius smart oracle runtime engine for Node.js",
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/codius/engine.git"
},
"scripts": {
"test": "./node_modules/.bin/istanbul test --preload-sources ./node_modules/.bin/_mocha -- --reporter spec test/*.js"
},
"dependencies": {
"bigi": "^1.3.0",
"bitcoinjs-lib": "^1.1.3",
"bluebird": "^2.3.5",
"codius-node-sandbox": "git://github.com/codius/codius-node-sandbox#v1.2.0",
"ecurve": "^1.0.0",
"extend": "^2.0.0",
"ignore": "^2.2.15",
"lodash": "^2.4.1"
},
"devDependencies": {
"chai": "^1.9.1",
"istanbul": "^0.2.13",
"mocha": "^1.20.1",
"sinon": "^1.10.2",
"sinon-chai": "^2.5.0"
},
"license": "ISC"
}
| {
"name": "codius-engine",
"version": "1.2.0",
"description": "Codius smart oracle runtime engine for Node.js",
"main": "index.js",
"repository": {
"type": "git",
"url": "git://github.com/codius/engine.git"
},
"scripts": {
"test": "./node_modules/.bin/istanbul test --preload-sources ./node_modules/.bin/_mocha -- --reporter spec test/*.js"
},
"dependencies": {
"bigi": "^1.3.0",
"bitcoinjs-lib": "^1.1.3",
"bluebird": "^2.3.5",
- "codius-node-sandbox": "^1.2.0",
+ "codius-node-sandbox": "git://github.com/codius/codius-node-sandbox#v1.2.0",
"ecurve": "^1.0.0",
"extend": "^2.0.0",
"ignore": "^2.2.15",
"lodash": "^2.4.1"
},
"devDependencies": {
"chai": "^1.9.1",
"istanbul": "^0.2.13",
"mocha": "^1.20.1",
"sinon": "^1.10.2",
"sinon-chai": "^2.5.0"
},
"license": "ISC"
} | 2 | 0.064516 | 1 | 1 |
f9f7a9ea1f95de8c2deafbb36ce4c5c50ee71de1 | README.md | README.md | An amateur attempt at breeding a chess-playing AI.
## Genes currently active in Genetic AI instances
### Board Evaluation Genes
#### Freedom To Move Gene
Counts the number of legal moves available in the current position.
#### King Confinement Gene
Counts the king's legal moves.
#### Opponent Pieces Targeted Gene
Totals the total strength (as determined by the Piece Strength Gene below) of
the opponent's pieces currently under attack.
#### Pawn Advancement Gene
Measures the progress of all pawns towards the opposite side of the board.
#### Sphere of Influence Gene
Counts the number of squares attacked by all pieces, weighted by the square's
proximity to the opponent's king.
#### Total Force Gene
Sums the strength of all the player's pieces on the board.
### Regulatory Genes
#### Branch Pruning Gene
Specifies when to cut off analyzing a line of moves based on whether the
current board evaluation is too low compared to the current board state.
#### Last Minute Panic Gene
If the time left in the game is less than the amount specified here, then
look-ahead on all lines is cut off.
#### Look Ahead Gene
Determines how many moves to look ahead based on the time left and how many move choices are available.
#### Piece Strength Gene
Specifies the importance or strength of each differet type of chess piece.
| An amateur attempt at breeding a chess-playing AI.
## To compile:
`make`
This will create executables in a newly created `bin/` directory.
## Genes currently active in Genetic AI instances
### Board Evaluation Genes
#### Freedom To Move Gene
Counts the number of legal moves available in the current position.
#### King Confinement Gene
Counts the king's legal moves.
#### Opponent Pieces Targeted Gene
Totals the total strength (as determined by the Piece Strength Gene below) of
the opponent's pieces currently under attack.
#### Pawn Advancement Gene
Measures the progress of all pawns towards the opposite side of the board.
#### Sphere of Influence Gene
Counts the number of squares attacked by all pieces, weighted by the square's
proximity to the opponent's king.
#### Total Force Gene
Sums the strength of all the player's pieces on the board.
### Regulatory Genes
#### Branch Pruning Gene
Specifies when to cut off analyzing a line of moves based on whether the
current board evaluation is too low compared to the current board state.
#### Last Minute Panic Gene
If the time left in the game is less than the amount specified here, then
look-ahead on all lines is cut off.
#### Look Ahead Gene
Determines how many moves to look ahead based on the time left and how many move choices are available.
#### Piece Strength Gene
Specifies the importance or strength of each differet type of chess piece.
## Other details
A barely functional implementation of CECP allows for play through xboard and similar programs (PyChess, etc.).
| Update Read Me with build instructions | Update Read Me with build instructions
Also mention xboard integration
| Markdown | mit | MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess,MarkZH/Genetic_Chess | markdown | ## Code Before:
An amateur attempt at breeding a chess-playing AI.
## Genes currently active in Genetic AI instances
### Board Evaluation Genes
#### Freedom To Move Gene
Counts the number of legal moves available in the current position.
#### King Confinement Gene
Counts the king's legal moves.
#### Opponent Pieces Targeted Gene
Totals the total strength (as determined by the Piece Strength Gene below) of
the opponent's pieces currently under attack.
#### Pawn Advancement Gene
Measures the progress of all pawns towards the opposite side of the board.
#### Sphere of Influence Gene
Counts the number of squares attacked by all pieces, weighted by the square's
proximity to the opponent's king.
#### Total Force Gene
Sums the strength of all the player's pieces on the board.
### Regulatory Genes
#### Branch Pruning Gene
Specifies when to cut off analyzing a line of moves based on whether the
current board evaluation is too low compared to the current board state.
#### Last Minute Panic Gene
If the time left in the game is less than the amount specified here, then
look-ahead on all lines is cut off.
#### Look Ahead Gene
Determines how many moves to look ahead based on the time left and how many move choices are available.
#### Piece Strength Gene
Specifies the importance or strength of each differet type of chess piece.
## Instruction:
Update Read Me with build instructions
Also mention xboard integration
## Code After:
An amateur attempt at breeding a chess-playing AI.
## To compile:
`make`
This will create executables in a newly created `bin/` directory.
## Genes currently active in Genetic AI instances
### Board Evaluation Genes
#### Freedom To Move Gene
Counts the number of legal moves available in the current position.
#### King Confinement Gene
Counts the king's legal moves.
#### Opponent Pieces Targeted Gene
Totals the total strength (as determined by the Piece Strength Gene below) of
the opponent's pieces currently under attack.
#### Pawn Advancement Gene
Measures the progress of all pawns towards the opposite side of the board.
#### Sphere of Influence Gene
Counts the number of squares attacked by all pieces, weighted by the square's
proximity to the opponent's king.
#### Total Force Gene
Sums the strength of all the player's pieces on the board.
### Regulatory Genes
#### Branch Pruning Gene
Specifies when to cut off analyzing a line of moves based on whether the
current board evaluation is too low compared to the current board state.
#### Last Minute Panic Gene
If the time left in the game is less than the amount specified here, then
look-ahead on all lines is cut off.
#### Look Ahead Gene
Determines how many moves to look ahead based on the time left and how many move choices are available.
#### Piece Strength Gene
Specifies the importance or strength of each differet type of chess piece.
## Other details
A barely functional implementation of CECP allows for play through xboard and similar programs (PyChess, etc.).
| An amateur attempt at breeding a chess-playing AI.
+ ## To compile:
+ `make`
+
+ This will create executables in a newly created `bin/` directory.
## Genes currently active in Genetic AI instances
### Board Evaluation Genes
#### Freedom To Move Gene
Counts the number of legal moves available in the current position.
#### King Confinement Gene
Counts the king's legal moves.
#### Opponent Pieces Targeted Gene
Totals the total strength (as determined by the Piece Strength Gene below) of
the opponent's pieces currently under attack.
#### Pawn Advancement Gene
Measures the progress of all pawns towards the opposite side of the board.
#### Sphere of Influence Gene
Counts the number of squares attacked by all pieces, weighted by the square's
proximity to the opponent's king.
#### Total Force Gene
Sums the strength of all the player's pieces on the board.
### Regulatory Genes
#### Branch Pruning Gene
Specifies when to cut off analyzing a line of moves based on whether the
current board evaluation is too low compared to the current board state.
#### Last Minute Panic Gene
If the time left in the game is less than the amount specified here, then
look-ahead on all lines is cut off.
#### Look Ahead Gene
Determines how many moves to look ahead based on the time left and how many move choices are available.
#### Piece Strength Gene
Specifies the importance or strength of each differet type of chess piece.
+
+ ## Other details
+ A barely functional implementation of CECP allows for play through xboard and similar programs (PyChess, etc.). | 7 | 0.152174 | 7 | 0 |
c2af78a53515f7ad8ac4f460c93e5bb0f83e96e5 | app/Http/Controllers/MailingController.php | app/Http/Controllers/MailingController.php | <?php
namespace App\Http\Controllers;
use App\mailingUsers;
use Illuminate\Http\Request;
use App\Http\Requests;
class MailingController extends Controller
{
/**
* MailingController constructor.
*
* Here the following middleware will be set.
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Get the index page for the mailing module.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
{
$data['title'] = 'Mailing';
$data['query'] = mailingUsers::with('tag')->paginate(15);
return view('backend.mailing.index', $data);
}
public function mail()
{
}
public function mailGroup()
{
}
public function send()
{
}
public function insert()
{
}
public function store()
{
}
public function update($id)
{
}
/**
* Delete a user out off the mailing module.
*
* @param int, $id, the user his id in the data table.
* @return \Illuminate\Http\RedirectResponse
*/
public function deleteUser($id)
{
mailingUsers::find($id)->tag()->sync([]);
mailingUsers::destroy($id);
session()->flash('message', '');
return redirect()->back(302);
}
}
| <?php
namespace App\Http\Controllers;
use App\mailingUsers;
use Illuminate\Http\Request;
use App\Http\Requests;
class MailingController extends Controller
{
/**
* MailingController constructor.
*
* Here the following middleware will be set.
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Get the index page for the mailing module.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
{
$data['title'] = 'Mailing';
$data['query'] = mailingUsers::with('tag')->paginate(15);
return view('backend.mailing.index', $data);
}
public function mail()
{
}
public function mailGroup()
{
}
public function send()
{
}
public function insert()
{
}
public function store()
{
}
/**
* Show the update form off the mailing module.
*
* @param int, $id, the user his id in the data table.
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function update($id)
{
$data['title'] = 'mailing';
$data['query'] = mailingUsers::find($id);
return view('backend.mailing.update', $data);
}
/**
* Delete a user out off the mailing module.
*
* @param int, $id, the user his id in the data table.
* @return \Illuminate\Http\RedirectResponse
*/
public function deleteUser($id)
{
mailingUsers::find($id)->tag()->sync([]);
mailingUsers::destroy($id);
session()->flash('message', '');
return redirect()->back(302);
}
}
| Implement the ypdate form controller | Implement the ypdate form controller
| PHP | mit | SIJOT/SIJOT-L5.2,SIJOT/SIJOT-L5.2 | php | ## Code Before:
<?php
namespace App\Http\Controllers;
use App\mailingUsers;
use Illuminate\Http\Request;
use App\Http\Requests;
class MailingController extends Controller
{
/**
* MailingController constructor.
*
* Here the following middleware will be set.
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Get the index page for the mailing module.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
{
$data['title'] = 'Mailing';
$data['query'] = mailingUsers::with('tag')->paginate(15);
return view('backend.mailing.index', $data);
}
public function mail()
{
}
public function mailGroup()
{
}
public function send()
{
}
public function insert()
{
}
public function store()
{
}
public function update($id)
{
}
/**
* Delete a user out off the mailing module.
*
* @param int, $id, the user his id in the data table.
* @return \Illuminate\Http\RedirectResponse
*/
public function deleteUser($id)
{
mailingUsers::find($id)->tag()->sync([]);
mailingUsers::destroy($id);
session()->flash('message', '');
return redirect()->back(302);
}
}
## Instruction:
Implement the ypdate form controller
## Code After:
<?php
namespace App\Http\Controllers;
use App\mailingUsers;
use Illuminate\Http\Request;
use App\Http\Requests;
class MailingController extends Controller
{
/**
* MailingController constructor.
*
* Here the following middleware will be set.
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Get the index page for the mailing module.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
{
$data['title'] = 'Mailing';
$data['query'] = mailingUsers::with('tag')->paginate(15);
return view('backend.mailing.index', $data);
}
public function mail()
{
}
public function mailGroup()
{
}
public function send()
{
}
public function insert()
{
}
public function store()
{
}
/**
* Show the update form off the mailing module.
*
* @param int, $id, the user his id in the data table.
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function update($id)
{
$data['title'] = 'mailing';
$data['query'] = mailingUsers::find($id);
return view('backend.mailing.update', $data);
}
/**
* Delete a user out off the mailing module.
*
* @param int, $id, the user his id in the data table.
* @return \Illuminate\Http\RedirectResponse
*/
public function deleteUser($id)
{
mailingUsers::find($id)->tag()->sync([]);
mailingUsers::destroy($id);
session()->flash('message', '');
return redirect()->back(302);
}
}
| <?php
namespace App\Http\Controllers;
use App\mailingUsers;
use Illuminate\Http\Request;
use App\Http\Requests;
class MailingController extends Controller
{
/**
* MailingController constructor.
*
* Here the following middleware will be set.
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Get the index page for the mailing module.
*
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
{
$data['title'] = 'Mailing';
$data['query'] = mailingUsers::with('tag')->paginate(15);
return view('backend.mailing.index', $data);
}
public function mail()
{
}
public function mailGroup()
{
-
+
}
public function send()
{
}
public function insert()
{
}
public function store()
{
}
+
+ /**
+ * Show the update form off the mailing module.
+ *
+ * @param int, $id, the user his id in the data table.
+ * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+ */
public function update($id)
{
+ $data['title'] = 'mailing';
+ $data['query'] = mailingUsers::find($id);
+ return view('backend.mailing.update', $data);
}
/**
* Delete a user out off the mailing module.
*
* @param int, $id, the user his id in the data table.
* @return \Illuminate\Http\RedirectResponse
*/
public function deleteUser($id)
{
mailingUsers::find($id)->tag()->sync([]);
mailingUsers::destroy($id);
session()->flash('message', '');
return redirect()->back(302);
}
} | 12 | 0.15 | 11 | 1 |
68704fbe696dd3956609584feee4056bad0bc8d8 | plugin.json | plugin.json | {
"id": "nodebb-plugin-soundcloud",
"name": "NodeBB SoundCloud Plugin",
"description": "NodeBB Plugin that allows users to embed SoundCloud tracks inline in their posts.",
"url": "https://github.com/tedr56/nodebb-plugin-soundcloud",
"library": "./library.js",
"hooks": [
{ "hook": "filter:post.parse", "method": "parse", "callbacked": true }
],
"staticDir": "./static",
"css": [
"style.css"
]
}
| {
"id": "nodebb-plugin-soundcloud",
"name": "NodeBB SoundCloud Plugin",
"description": "NodeBB Plugin that allows users to embed SoundCloud tracks inline in their posts.",
"url": "https://github.com/a5mith/nodebb-plugin-soundcloud",
"library": "./library.js",
"hooks": [
{ "hook": "filter:parse.post", "method": "parse", "callbacked": true }
],
"staticDirs": {
"css": "./static"
}
}
| Update to support 0.6.x and 0.7.x | Update to support 0.6.x and 0.7.x | JSON | bsd-2-clause | clonn/nodebb-plugin-soundcloud,a5mith/nodebb-plugin-soundcloud | json | ## Code Before:
{
"id": "nodebb-plugin-soundcloud",
"name": "NodeBB SoundCloud Plugin",
"description": "NodeBB Plugin that allows users to embed SoundCloud tracks inline in their posts.",
"url": "https://github.com/tedr56/nodebb-plugin-soundcloud",
"library": "./library.js",
"hooks": [
{ "hook": "filter:post.parse", "method": "parse", "callbacked": true }
],
"staticDir": "./static",
"css": [
"style.css"
]
}
## Instruction:
Update to support 0.6.x and 0.7.x
## Code After:
{
"id": "nodebb-plugin-soundcloud",
"name": "NodeBB SoundCloud Plugin",
"description": "NodeBB Plugin that allows users to embed SoundCloud tracks inline in their posts.",
"url": "https://github.com/a5mith/nodebb-plugin-soundcloud",
"library": "./library.js",
"hooks": [
{ "hook": "filter:parse.post", "method": "parse", "callbacked": true }
],
"staticDirs": {
"css": "./static"
}
}
| {
"id": "nodebb-plugin-soundcloud",
"name": "NodeBB SoundCloud Plugin",
"description": "NodeBB Plugin that allows users to embed SoundCloud tracks inline in their posts.",
- "url": "https://github.com/tedr56/nodebb-plugin-soundcloud",
? ^^^^^
+ "url": "https://github.com/a5mith/nodebb-plugin-soundcloud",
? ++++ ^
"library": "./library.js",
"hooks": [
- { "hook": "filter:post.parse", "method": "parse", "callbacked": true }
? -----
+ { "hook": "filter:parse.post", "method": "parse", "callbacked": true }
? +++++
],
+ "staticDirs": {
+ "css": "./static"
+ }
- "staticDir": "./static",
- "css": [
- "style.css"
- ]
} | 11 | 0.785714 | 5 | 6 |
bc493241806076ec0fef3f322c5ef61874512e71 | .travis.yml | .travis.yml | language: ruby
bundler_args: --without development
script: bundle exec rspec
gemfile:
- gemfiles/Gemfile.travis
# before_install: some_command
# env:
# - "rack=1.3.4"
rvm:
- 2.0.0
- 1.9.3
- 1.9.2
- jruby-19mode # JRuby in 1.9 mode
- rbx-19mode
| language: ruby
bundler_args: --without development
script: bundle exec rspec
gemfile:
- gemfiles/Gemfile.travis
# before_install: some_command
# env:
# - "rack=1.3.4"
rvm:
- 2.0.0
- 1.9.3
- 1.9.2
- jruby-19mode # JRuby in 1.9 mode
- rbx-19mode
matrix:
allow_failures:
- rvm: rbx-19mode
| Add rbx to allowed build failures; don't let failures block succesful builds | Add rbx to allowed build failures; don't let failures block succesful builds
| YAML | mit | metricfu/metric_fu,metricfu/metric_fu,metricfu/metric_fu | yaml | ## Code Before:
language: ruby
bundler_args: --without development
script: bundle exec rspec
gemfile:
- gemfiles/Gemfile.travis
# before_install: some_command
# env:
# - "rack=1.3.4"
rvm:
- 2.0.0
- 1.9.3
- 1.9.2
- jruby-19mode # JRuby in 1.9 mode
- rbx-19mode
## Instruction:
Add rbx to allowed build failures; don't let failures block succesful builds
## Code After:
language: ruby
bundler_args: --without development
script: bundle exec rspec
gemfile:
- gemfiles/Gemfile.travis
# before_install: some_command
# env:
# - "rack=1.3.4"
rvm:
- 2.0.0
- 1.9.3
- 1.9.2
- jruby-19mode # JRuby in 1.9 mode
- rbx-19mode
matrix:
allow_failures:
- rvm: rbx-19mode
| language: ruby
bundler_args: --without development
script: bundle exec rspec
gemfile:
- gemfiles/Gemfile.travis
# before_install: some_command
# env:
# - "rack=1.3.4"
rvm:
- 2.0.0
- 1.9.3
- 1.9.2
- jruby-19mode # JRuby in 1.9 mode
- rbx-19mode
+ matrix:
+ allow_failures:
+ - rvm: rbx-19mode | 3 | 0.214286 | 3 | 0 |
d1b7f2fca53655c7ec262d6501449b9367beb172 | cmd/tchaik/ui/static/js/src/components/Top.js | cmd/tchaik/ui/static/js/src/components/Top.js | 'use strict';
import React from 'react/addons';
import Icon from './Icon.js';
import LeftColumnActions from '../actions/LeftColumnActions.js';
import SearchActions from '../actions/SearchActions.js';
class MenuButton extends React.Component {
constructor(props) {
super(props);
this._onClick = this._onClick.bind(this);
}
render() {
return (
<div className="menu-button" onClick={this._onClick}>
<Icon icon="menu-hamburger"/>
</div>
);
}
_onClick() {
LeftColumnActions.toggleVisibility();
}
}
export default class Top extends React.Component {
constructor(props) {
super(props);
this._onChange = this._onChange.bind(this);
}
render() {
return (
<div>
<MenuButton />
<div className="search">
<Icon icon="search" />
<input type="text" name="search" placeholder="Search Music" onChange={this._onChange} />
</div>
</div>
);
}
_onChange(e) {
SearchActions.search(e.currentTarget.value);
}
}
| 'use strict';
import React from 'react/addons';
import Icon from './Icon.js';
import LeftColumnActions from '../actions/LeftColumnActions.js';
import SearchActions from '../actions/SearchActions.js';
class MenuButton extends React.Component {
constructor(props) {
super(props);
this._onClick = this._onClick.bind(this);
}
render() {
return (
<div className="menu-button" onClick={this._onClick}>
<Icon icon="menu-hamburger"/>
</div>
);
}
_onClick() {
LeftColumnActions.toggleVisibility();
}
}
export default class Top extends React.Component {
constructor(props) {
super(props);
this._onChange = this._onChange.bind(this);
this._onClick = this._onClick.bind(this);
}
render() {
return (
<div>
<MenuButton />
<div className="search">
<Icon icon="search" />
<input type="text" name="search" placeholder="Search Music" onChange={this._onChange} onClick={this._onClick} />
</div>
</div>
);
}
_onChange(e) {
SearchActions.search(e.currentTarget.value);
}
_onClick(e) {
e.currentTarget.select();
}
}
| Select search text on click | Select search text on click | JavaScript | bsd-2-clause | GrahamGoudeau21/tchaik,GrahamGoudeau21/tchaik,tchaik/tchaik,tchaik/tchaik,GrahamGoudeau21/tchaik,GrahamGoudeau21/tchaik,tchaik/tchaik,tchaik/tchaik | javascript | ## Code Before:
'use strict';
import React from 'react/addons';
import Icon from './Icon.js';
import LeftColumnActions from '../actions/LeftColumnActions.js';
import SearchActions from '../actions/SearchActions.js';
class MenuButton extends React.Component {
constructor(props) {
super(props);
this._onClick = this._onClick.bind(this);
}
render() {
return (
<div className="menu-button" onClick={this._onClick}>
<Icon icon="menu-hamburger"/>
</div>
);
}
_onClick() {
LeftColumnActions.toggleVisibility();
}
}
export default class Top extends React.Component {
constructor(props) {
super(props);
this._onChange = this._onChange.bind(this);
}
render() {
return (
<div>
<MenuButton />
<div className="search">
<Icon icon="search" />
<input type="text" name="search" placeholder="Search Music" onChange={this._onChange} />
</div>
</div>
);
}
_onChange(e) {
SearchActions.search(e.currentTarget.value);
}
}
## Instruction:
Select search text on click
## Code After:
'use strict';
import React from 'react/addons';
import Icon from './Icon.js';
import LeftColumnActions from '../actions/LeftColumnActions.js';
import SearchActions from '../actions/SearchActions.js';
class MenuButton extends React.Component {
constructor(props) {
super(props);
this._onClick = this._onClick.bind(this);
}
render() {
return (
<div className="menu-button" onClick={this._onClick}>
<Icon icon="menu-hamburger"/>
</div>
);
}
_onClick() {
LeftColumnActions.toggleVisibility();
}
}
export default class Top extends React.Component {
constructor(props) {
super(props);
this._onChange = this._onChange.bind(this);
this._onClick = this._onClick.bind(this);
}
render() {
return (
<div>
<MenuButton />
<div className="search">
<Icon icon="search" />
<input type="text" name="search" placeholder="Search Music" onChange={this._onChange} onClick={this._onClick} />
</div>
</div>
);
}
_onChange(e) {
SearchActions.search(e.currentTarget.value);
}
_onClick(e) {
e.currentTarget.select();
}
}
| 'use strict';
import React from 'react/addons';
import Icon from './Icon.js';
import LeftColumnActions from '../actions/LeftColumnActions.js';
import SearchActions from '../actions/SearchActions.js';
class MenuButton extends React.Component {
constructor(props) {
super(props);
this._onClick = this._onClick.bind(this);
}
render() {
return (
<div className="menu-button" onClick={this._onClick}>
<Icon icon="menu-hamburger"/>
</div>
);
}
_onClick() {
LeftColumnActions.toggleVisibility();
}
}
export default class Top extends React.Component {
constructor(props) {
super(props);
this._onChange = this._onChange.bind(this);
+ this._onClick = this._onClick.bind(this);
}
render() {
return (
<div>
<MenuButton />
<div className="search">
<Icon icon="search" />
- <input type="text" name="search" placeholder="Search Music" onChange={this._onChange} />
+ <input type="text" name="search" placeholder="Search Music" onChange={this._onChange} onClick={this._onClick} />
? ++++++++++++++++++++++++
</div>
</div>
);
}
_onChange(e) {
SearchActions.search(e.currentTarget.value);
}
+
+ _onClick(e) {
+ e.currentTarget.select();
+ }
} | 7 | 0.132075 | 6 | 1 |
cd1a86cdcd1192357d56920305aaf27663419039 | .travis.yml | .travis.yml | language: node_js
node_js:
- "node"
cache:
yarn: true
| language: node_js
node_js:
- "node"
cache:
yarn: true
script:
- yarn run lint
- yarn run flow
- yarn run test
| Add linting to CI script | fix(chore): Add linting to CI script
| YAML | mit | glennreyes/react-countup,glennreyes/react-countup | yaml | ## Code Before:
language: node_js
node_js:
- "node"
cache:
yarn: true
## Instruction:
fix(chore): Add linting to CI script
## Code After:
language: node_js
node_js:
- "node"
cache:
yarn: true
script:
- yarn run lint
- yarn run flow
- yarn run test
| language: node_js
node_js:
- "node"
cache:
yarn: true
+ script:
+ - yarn run lint
+ - yarn run flow
+ - yarn run test | 4 | 0.8 | 4 | 0 |
91b9e5d71c323be2e5e0d1aa16e47cc49d45acc4 | likes/middleware.py | likes/middleware.py | try:
from hashlib import md5
except ImportError:
from md5 import md5
from django.http import HttpResponseBadRequest
from secretballot.middleware import SecretBallotIpUseragentMiddleware
class SecretBallotUserIpUseragentMiddleware(SecretBallotIpUseragentMiddleware):
def generate_token(self, request):
if request.user.is_authenticated():
return request.user.username
else:
try:
s = u''.join((request.META['REMOTE_ADDR'], request.META['HTTP_USER_AGENT']))
return md5(s).hexdigest()
except KeyError:
return None
| try:
from hashlib import md5
except ImportError:
from md5 import md5
from django.http import HttpResponseBadRequest
from secretballot.middleware import SecretBallotIpUseragentMiddleware
class SecretBallotUserIpUseragentMiddleware(SecretBallotIpUseragentMiddleware):
def generate_token(self, request):
if request.user.is_authenticated():
return request.user.username
else:
try:
s = ''.join((request.META['REMOTE_ADDR'], request.META['HTTP_USER_AGENT']))
return md5(s.encode('utf-8')).hexdigest()
except KeyError:
return None
| Fix hashing for Python 3 | Fix hashing for Python 3
| Python | bsd-3-clause | Afnarel/django-likes,Afnarel/django-likes,Afnarel/django-likes | python | ## Code Before:
try:
from hashlib import md5
except ImportError:
from md5 import md5
from django.http import HttpResponseBadRequest
from secretballot.middleware import SecretBallotIpUseragentMiddleware
class SecretBallotUserIpUseragentMiddleware(SecretBallotIpUseragentMiddleware):
def generate_token(self, request):
if request.user.is_authenticated():
return request.user.username
else:
try:
s = u''.join((request.META['REMOTE_ADDR'], request.META['HTTP_USER_AGENT']))
return md5(s).hexdigest()
except KeyError:
return None
## Instruction:
Fix hashing for Python 3
## Code After:
try:
from hashlib import md5
except ImportError:
from md5 import md5
from django.http import HttpResponseBadRequest
from secretballot.middleware import SecretBallotIpUseragentMiddleware
class SecretBallotUserIpUseragentMiddleware(SecretBallotIpUseragentMiddleware):
def generate_token(self, request):
if request.user.is_authenticated():
return request.user.username
else:
try:
s = ''.join((request.META['REMOTE_ADDR'], request.META['HTTP_USER_AGENT']))
return md5(s.encode('utf-8')).hexdigest()
except KeyError:
return None
| try:
from hashlib import md5
except ImportError:
from md5 import md5
from django.http import HttpResponseBadRequest
from secretballot.middleware import SecretBallotIpUseragentMiddleware
class SecretBallotUserIpUseragentMiddleware(SecretBallotIpUseragentMiddleware):
def generate_token(self, request):
if request.user.is_authenticated():
return request.user.username
else:
try:
- s = u''.join((request.META['REMOTE_ADDR'], request.META['HTTP_USER_AGENT']))
? -
+ s = ''.join((request.META['REMOTE_ADDR'], request.META['HTTP_USER_AGENT']))
- return md5(s).hexdigest()
+ return md5(s.encode('utf-8')).hexdigest()
? ++++++++++++++++
except KeyError:
return None | 4 | 0.190476 | 2 | 2 |
cf5650f7f18ca3bb36a6c8c2c3802532b1bc882f | horizon/templates/horizon/client_side/_confirm.html | horizon/templates/horizon/client_side/_confirm.html | {% extends "horizon/client_side/template.html" %}
{% load i18n horizon %}
{% block id %}confirm_modal{% endblock %}
{% block template %}{% spaceless %}{% jstemplate %}
<div class="confirm-wrapper">
<span class="confirm-list">{% trans 'You have selected:' %} [[selection]]. </span>
<span class="confirm-text">{% trans 'Please confirm your selection.'%} </span>
<span class="confirm-help">[[help]]</span>
</div>
{% endjstemplate %}{% endspaceless %}{% endblock %}
| {% extends "horizon/client_side/template.html" %}
{% load i18n horizon %}
{% block id %}confirm_modal{% endblock %}
{% block template %}{% spaceless %}{% jstemplate %}
<div class="confirm-wrapper">
<span class="confirm-list">
{% blocktrans %}You have selected: [[selection]]. {% endblocktrans %}
</span>
<span class="confirm-text">{% trans 'Please confirm your selection.'%} </span>
<span class="confirm-help">[[help]]</span>
</div>
{% endjstemplate %}{% endspaceless %}{% endblock %}
| Allow translator to control word order in delete confirm dialog | Allow translator to control word order in delete confirm dialog
Change-Id: I82c27d21cb000602e1cf76313c2cdec680c45394
Closes-Bug: #1624197
| HTML | apache-2.0 | NeCTAR-RC/horizon,NeCTAR-RC/horizon,yeming233/horizon,openstack/horizon,bac/horizon,openstack/horizon,yeming233/horizon,yeming233/horizon,BiznetGIO/horizon,openstack/horizon,NeCTAR-RC/horizon,sandvine/horizon,sandvine/horizon,bac/horizon,NeCTAR-RC/horizon,ChameleonCloud/horizon,bac/horizon,ChameleonCloud/horizon,BiznetGIO/horizon,openstack/horizon,noironetworks/horizon,ChameleonCloud/horizon,BiznetGIO/horizon,sandvine/horizon,yeming233/horizon,noironetworks/horizon,noironetworks/horizon,sandvine/horizon,bac/horizon,ChameleonCloud/horizon,BiznetGIO/horizon,noironetworks/horizon | html | ## Code Before:
{% extends "horizon/client_side/template.html" %}
{% load i18n horizon %}
{% block id %}confirm_modal{% endblock %}
{% block template %}{% spaceless %}{% jstemplate %}
<div class="confirm-wrapper">
<span class="confirm-list">{% trans 'You have selected:' %} [[selection]]. </span>
<span class="confirm-text">{% trans 'Please confirm your selection.'%} </span>
<span class="confirm-help">[[help]]</span>
</div>
{% endjstemplate %}{% endspaceless %}{% endblock %}
## Instruction:
Allow translator to control word order in delete confirm dialog
Change-Id: I82c27d21cb000602e1cf76313c2cdec680c45394
Closes-Bug: #1624197
## Code After:
{% extends "horizon/client_side/template.html" %}
{% load i18n horizon %}
{% block id %}confirm_modal{% endblock %}
{% block template %}{% spaceless %}{% jstemplate %}
<div class="confirm-wrapper">
<span class="confirm-list">
{% blocktrans %}You have selected: [[selection]]. {% endblocktrans %}
</span>
<span class="confirm-text">{% trans 'Please confirm your selection.'%} </span>
<span class="confirm-help">[[help]]</span>
</div>
{% endjstemplate %}{% endspaceless %}{% endblock %}
| {% extends "horizon/client_side/template.html" %}
{% load i18n horizon %}
{% block id %}confirm_modal{% endblock %}
{% block template %}{% spaceless %}{% jstemplate %}
<div class="confirm-wrapper">
- <span class="confirm-list">{% trans 'You have selected:' %} [[selection]]. </span>
+ <span class="confirm-list">
+ {% blocktrans %}You have selected: [[selection]]. {% endblocktrans %}
+ </span>
<span class="confirm-text">{% trans 'Please confirm your selection.'%} </span>
<span class="confirm-help">[[help]]</span>
</div>
{% endjstemplate %}{% endspaceless %}{% endblock %} | 4 | 0.333333 | 3 | 1 |
1fd482d386e8bddc9431c177085ec7cbc8ae9075 | .github/workflows/ci.yml | .github/workflows/ci.yml | name: ci
on:
push:
branches:
- master
pull_request:
jobs:
cabal:
runs-on: ${{ matrix.os }}
strategy:
matrix:
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2"]
cabal: ["3.6.2.0"]
os: [ubuntu-latest, macOS-latest]
name: build and test (cabal)
steps:
- uses: actions/checkout@v2
- name: Run Haskell
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: |
cabal build --enable-tests && cabal test
stack:
name: build and test (stack)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
ghc-version: "9.0.2"
enable-stack: true
stack-version: "latest"
- run: |
stack build && stack test
| name: ci
on:
push:
branches:
- master
pull_request:
jobs:
cabal:
runs-on: ${{ matrix.os }}
strategy:
matrix:
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2", "9.2.3"]
cabal: ["3.6.2.0"]
os: [ubuntu-latest, macOS-latest]
name: build and test (cabal)
steps:
- uses: actions/checkout@v2
- name: Run Haskell
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: |
cabal build --enable-tests && cabal test
stack:
name: build and test (stack)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
ghc-version: "9.2.3"
enable-stack: true
stack-version: "latest"
- run: |
stack build && stack test
| Enable GHC 9.2.3 on CI | Enable GHC 9.2.3 on CI
| YAML | bsd-3-clause | GetShopTV/swagger2 | yaml | ## Code Before:
name: ci
on:
push:
branches:
- master
pull_request:
jobs:
cabal:
runs-on: ${{ matrix.os }}
strategy:
matrix:
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2"]
cabal: ["3.6.2.0"]
os: [ubuntu-latest, macOS-latest]
name: build and test (cabal)
steps:
- uses: actions/checkout@v2
- name: Run Haskell
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: |
cabal build --enable-tests && cabal test
stack:
name: build and test (stack)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
ghc-version: "9.0.2"
enable-stack: true
stack-version: "latest"
- run: |
stack build && stack test
## Instruction:
Enable GHC 9.2.3 on CI
## Code After:
name: ci
on:
push:
branches:
- master
pull_request:
jobs:
cabal:
runs-on: ${{ matrix.os }}
strategy:
matrix:
ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2", "9.2.3"]
cabal: ["3.6.2.0"]
os: [ubuntu-latest, macOS-latest]
name: build and test (cabal)
steps:
- uses: actions/checkout@v2
- name: Run Haskell
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: |
cabal build --enable-tests && cabal test
stack:
name: build and test (stack)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
ghc-version: "9.2.3"
enable-stack: true
stack-version: "latest"
- run: |
stack build && stack test
| name: ci
on:
push:
branches:
- master
pull_request:
jobs:
cabal:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2"]
+ ghc: ["8.6.5", "8.8.4", "8.10.7", "9.0.2", "9.2.3"]
? +++++++++
cabal: ["3.6.2.0"]
os: [ubuntu-latest, macOS-latest]
name: build and test (cabal)
steps:
- uses: actions/checkout@v2
- name: Run Haskell
uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- run: |
cabal build --enable-tests && cabal test
stack:
name: build and test (stack)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
with:
- ghc-version: "9.0.2"
? ^ ^
+ ghc-version: "9.2.3"
? ^ ^
enable-stack: true
stack-version: "latest"
- run: |
stack build && stack test | 4 | 0.097561 | 2 | 2 |
aa2b4ececd863ae326e12ed9c59d7e127a8339ef | cookbooks/travis_ci_minimal/spec/vim_spec.rb | cookbooks/travis_ci_minimal/spec/vim_spec.rb | describe 'vim installation' do
describe command('vim --version') do
its(:stdout) { should_not be_empty }
its(:stderr) { should be_empty }
its(:exit_status) { should eq 0 }
end
describe 'vim commands' do
describe 'add a file and replace text with vim' do
before do
File.write('./spec/files/flower.txt', "blume\n")
end
describe command('vim flower.txt -c s/blume/flower -c wq') do
its(:stderr) { should be_empty }
its(:stdout) { should match 'flower' }
end
end
end
end
| describe 'vim installation' do
describe command('vim --version') do
its(:stdout) { should_not be_empty }
its(:stderr) { should be_empty }
its(:exit_status) { should eq 0 }
end
describe 'vim commands' do
describe 'batch editing' do
before do
File.write('./spec/files/flower.txt', "blume\n")
system('vim ./spec/files/flower.txt -c s/blume/flower -c wq')
end
describe file('./spec/files/flower.txt') do
its(:content) { should match(/flower/) }
end
end
end
end
| Rework vim batch editing spec further | Rework vim batch editing spec further
| Ruby | mit | travis-ci/packer-templates,travis-ci/packer-templates,travis-ci/packer-templates | ruby | ## Code Before:
describe 'vim installation' do
describe command('vim --version') do
its(:stdout) { should_not be_empty }
its(:stderr) { should be_empty }
its(:exit_status) { should eq 0 }
end
describe 'vim commands' do
describe 'add a file and replace text with vim' do
before do
File.write('./spec/files/flower.txt', "blume\n")
end
describe command('vim flower.txt -c s/blume/flower -c wq') do
its(:stderr) { should be_empty }
its(:stdout) { should match 'flower' }
end
end
end
end
## Instruction:
Rework vim batch editing spec further
## Code After:
describe 'vim installation' do
describe command('vim --version') do
its(:stdout) { should_not be_empty }
its(:stderr) { should be_empty }
its(:exit_status) { should eq 0 }
end
describe 'vim commands' do
describe 'batch editing' do
before do
File.write('./spec/files/flower.txt', "blume\n")
system('vim ./spec/files/flower.txt -c s/blume/flower -c wq')
end
describe file('./spec/files/flower.txt') do
its(:content) { should match(/flower/) }
end
end
end
end
| describe 'vim installation' do
describe command('vim --version') do
its(:stdout) { should_not be_empty }
its(:stderr) { should be_empty }
its(:exit_status) { should eq 0 }
end
describe 'vim commands' do
- describe 'add a file and replace text with vim' do
+ describe 'batch editing' do
before do
File.write('./spec/files/flower.txt', "blume\n")
+ system('vim ./spec/files/flower.txt -c s/blume/flower -c wq')
end
+ describe file('./spec/files/flower.txt') do
- describe command('vim flower.txt -c s/blume/flower -c wq') do
- its(:stderr) { should be_empty }
- its(:stdout) { should match 'flower' }
? ^ ^^^ ^^ ^
+ its(:content) { should match(/flower/) }
? ^^^ ^^ ^^ ^^
end
end
end
end | 8 | 0.4 | 4 | 4 |
d0fc4f84ac2a3d667fabbfdca2d77ccb93946c1a | MAINTAINERS.md | MAINTAINERS.md |
* Nick Guerette ([@nguerette](https://github.com/nguerette))
* Reid Mitchell ([@reid47](https://github.com/reid47))
* Kenny Wang ([@kennyw12](https://github.com/kennyw12))
* Sarah Weinstein ([@sweinstein22](https://github.com/sweinstein22))
## Past maintainers
* Jonathan Berney ([@jberney](https://github.com/jberney))
* Ryan Dy ([@rdy](https://github.com/rdy))
* Charles Hansen ([@charleshansen](https://github.com/charleshansen))
* Stephane Jolicoeur ([@sjolicoeur](https://github.com/sjolicoeur))
* Elana Koren ([@elanakoren](https://github.com/elanakoren))
* Steven Locke ([@StevenLocke](https://github.com/StevenLocke))
* Anushka Makhija ([@amakhija](https://github.com/amakhija))
* Elena Sharma ([@elenasharma](https://github.com/elenasharma))
* August Toman-Yih ([@atomanyih](https://github.com/atomanyih))
* Ming Xiao ([@mingxiao](https://github.com/mingxiao))
|
* Nick Guerette ([@nguerette](https://github.com/nguerette))
* Kenny Wang ([@kennyw12](https://github.com/kennyw12))
* Sarah Weinstein ([@sweinstein22](https://github.com/sweinstein22))
* Spencer Hawley ([@sphawley](https://github.com/sphawley))
* Ana Nelson ([@anaclair](https://github.com/anaclair))
## Past maintainers
* Jonathan Berney ([@jberney](https://github.com/jberney))
* Ryan Dy ([@rdy](https://github.com/rdy))
* Charles Hansen ([@charleshansen](https://github.com/charleshansen))
* Stephane Jolicoeur ([@sjolicoeur](https://github.com/sjolicoeur))
* Elana Koren ([@elanakoren](https://github.com/elanakoren))
* Steven Locke ([@StevenLocke](https://github.com/StevenLocke))
* Anushka Makhija ([@amakhija](https://github.com/amakhija))
* Elena Sharma ([@elenasharma](https://github.com/elenasharma))
* August Toman-Yih ([@atomanyih](https://github.com/atomanyih))
* Ming Xiao ([@mingxiao](https://github.com/mingxiao))
* Reid Mitchell ([@reid47](https://github.com/reid47))
| Update Maintainers to include Spencer and Ana | Update Maintainers to include Spencer and Ana
| Markdown | mit | pivotal-cf/pivotal-ui,pivotal-cf/pivotal-ui,pivotal-cf/pivotal-ui | markdown | ## Code Before:
* Nick Guerette ([@nguerette](https://github.com/nguerette))
* Reid Mitchell ([@reid47](https://github.com/reid47))
* Kenny Wang ([@kennyw12](https://github.com/kennyw12))
* Sarah Weinstein ([@sweinstein22](https://github.com/sweinstein22))
## Past maintainers
* Jonathan Berney ([@jberney](https://github.com/jberney))
* Ryan Dy ([@rdy](https://github.com/rdy))
* Charles Hansen ([@charleshansen](https://github.com/charleshansen))
* Stephane Jolicoeur ([@sjolicoeur](https://github.com/sjolicoeur))
* Elana Koren ([@elanakoren](https://github.com/elanakoren))
* Steven Locke ([@StevenLocke](https://github.com/StevenLocke))
* Anushka Makhija ([@amakhija](https://github.com/amakhija))
* Elena Sharma ([@elenasharma](https://github.com/elenasharma))
* August Toman-Yih ([@atomanyih](https://github.com/atomanyih))
* Ming Xiao ([@mingxiao](https://github.com/mingxiao))
## Instruction:
Update Maintainers to include Spencer and Ana
## Code After:
* Nick Guerette ([@nguerette](https://github.com/nguerette))
* Kenny Wang ([@kennyw12](https://github.com/kennyw12))
* Sarah Weinstein ([@sweinstein22](https://github.com/sweinstein22))
* Spencer Hawley ([@sphawley](https://github.com/sphawley))
* Ana Nelson ([@anaclair](https://github.com/anaclair))
## Past maintainers
* Jonathan Berney ([@jberney](https://github.com/jberney))
* Ryan Dy ([@rdy](https://github.com/rdy))
* Charles Hansen ([@charleshansen](https://github.com/charleshansen))
* Stephane Jolicoeur ([@sjolicoeur](https://github.com/sjolicoeur))
* Elana Koren ([@elanakoren](https://github.com/elanakoren))
* Steven Locke ([@StevenLocke](https://github.com/StevenLocke))
* Anushka Makhija ([@amakhija](https://github.com/amakhija))
* Elena Sharma ([@elenasharma](https://github.com/elenasharma))
* August Toman-Yih ([@atomanyih](https://github.com/atomanyih))
* Ming Xiao ([@mingxiao](https://github.com/mingxiao))
* Reid Mitchell ([@reid47](https://github.com/reid47))
|
* Nick Guerette ([@nguerette](https://github.com/nguerette))
- * Reid Mitchell ([@reid47](https://github.com/reid47))
* Kenny Wang ([@kennyw12](https://github.com/kennyw12))
* Sarah Weinstein ([@sweinstein22](https://github.com/sweinstein22))
+ * Spencer Hawley ([@sphawley](https://github.com/sphawley))
+ * Ana Nelson ([@anaclair](https://github.com/anaclair))
## Past maintainers
* Jonathan Berney ([@jberney](https://github.com/jberney))
* Ryan Dy ([@rdy](https://github.com/rdy))
* Charles Hansen ([@charleshansen](https://github.com/charleshansen))
* Stephane Jolicoeur ([@sjolicoeur](https://github.com/sjolicoeur))
* Elana Koren ([@elanakoren](https://github.com/elanakoren))
* Steven Locke ([@StevenLocke](https://github.com/StevenLocke))
* Anushka Makhija ([@amakhija](https://github.com/amakhija))
* Elena Sharma ([@elenasharma](https://github.com/elenasharma))
* August Toman-Yih ([@atomanyih](https://github.com/atomanyih))
* Ming Xiao ([@mingxiao](https://github.com/mingxiao))
+ * Reid Mitchell ([@reid47](https://github.com/reid47)) | 4 | 0.222222 | 3 | 1 |
d5e1f7d690d9f663e12cd4ee85979d10e2df04ea | test/test_get_rest.py | test/test_get_rest.py | import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong arguments to get_rest"""
for args in ([], [''] * 2):
out = check_output(['allosmod', 'get_rest'] + args,
stderr=subprocess.STDOUT, retcode=2)
out = check_output(['python', '-m',
'allosmod.get_rest'] + args,
stderr=subprocess.STDOUT, retcode=2)
def test_simple(self):
"""Simple complete run of get_rest"""
with open('get_rest.in', 'w') as fh:
pass
out = check_output(['allosmod', 'get_rest',
os.path.join(test_dir, 'input',
'asite_pdb1.pdb')])
os.unlink('get_rest.in')
# PDB file contains no sugars, so no restraints should be output
self.assertEqual(out, '')
if __name__ == '__main__':
unittest.main()
| import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong arguments to get_rest"""
for args in ([], [''] * 2):
out = check_output(['allosmod', 'get_rest'] + args,
stderr=subprocess.STDOUT, retcode=2)
out = check_output(['python', '-m',
'allosmod.get_rest'] + args,
stderr=subprocess.STDOUT, retcode=2)
def test_simple(self):
"""Simple complete run of get_rest"""
with open('get_rest.in', 'w') as fh:
pass
out = check_output(['allosmod', 'get_rest',
os.path.join(test_dir, 'input',
'asite_pdb1.pdb')],
universal_newlines=True)
os.unlink('get_rest.in')
# PDB file contains no sugars, so no restraints should be output
self.assertEqual(out, '')
if __name__ == '__main__':
unittest.main()
| Make sure that output is text in Python 2 & 3. | Make sure that output is text in Python 2 & 3.
| Python | lgpl-2.1 | salilab/allosmod-lib,salilab/allosmod-lib,salilab/allosmod-lib,salilab/allosmod-lib,salilab/allosmod-lib | python | ## Code Before:
import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong arguments to get_rest"""
for args in ([], [''] * 2):
out = check_output(['allosmod', 'get_rest'] + args,
stderr=subprocess.STDOUT, retcode=2)
out = check_output(['python', '-m',
'allosmod.get_rest'] + args,
stderr=subprocess.STDOUT, retcode=2)
def test_simple(self):
"""Simple complete run of get_rest"""
with open('get_rest.in', 'w') as fh:
pass
out = check_output(['allosmod', 'get_rest',
os.path.join(test_dir, 'input',
'asite_pdb1.pdb')])
os.unlink('get_rest.in')
# PDB file contains no sugars, so no restraints should be output
self.assertEqual(out, '')
if __name__ == '__main__':
unittest.main()
## Instruction:
Make sure that output is text in Python 2 & 3.
## Code After:
import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong arguments to get_rest"""
for args in ([], [''] * 2):
out = check_output(['allosmod', 'get_rest'] + args,
stderr=subprocess.STDOUT, retcode=2)
out = check_output(['python', '-m',
'allosmod.get_rest'] + args,
stderr=subprocess.STDOUT, retcode=2)
def test_simple(self):
"""Simple complete run of get_rest"""
with open('get_rest.in', 'w') as fh:
pass
out = check_output(['allosmod', 'get_rest',
os.path.join(test_dir, 'input',
'asite_pdb1.pdb')],
universal_newlines=True)
os.unlink('get_rest.in')
# PDB file contains no sugars, so no restraints should be output
self.assertEqual(out, '')
if __name__ == '__main__':
unittest.main()
| import os
import unittest
import subprocess
import utils
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
test_dir = utils.set_search_paths(TOPDIR)
utils.set_search_paths(TOPDIR)
from allosmod.util import check_output
class Tests(unittest.TestCase):
def test_bad(self):
"""Test wrong arguments to get_rest"""
for args in ([], [''] * 2):
out = check_output(['allosmod', 'get_rest'] + args,
stderr=subprocess.STDOUT, retcode=2)
out = check_output(['python', '-m',
'allosmod.get_rest'] + args,
stderr=subprocess.STDOUT, retcode=2)
def test_simple(self):
"""Simple complete run of get_rest"""
with open('get_rest.in', 'w') as fh:
pass
out = check_output(['allosmod', 'get_rest',
os.path.join(test_dir, 'input',
- 'asite_pdb1.pdb')])
? ^
+ 'asite_pdb1.pdb')],
? ^
+ universal_newlines=True)
os.unlink('get_rest.in')
# PDB file contains no sugars, so no restraints should be output
self.assertEqual(out, '')
if __name__ == '__main__':
unittest.main() | 3 | 0.088235 | 2 | 1 |
5aea7d86867097fcf9a9d7cafc1e9d1428fcdf56 | src/apps/CMakeLists.txt | src/apps/CMakeLists.txt | ADD_SUBDIRECTORY(exampleUI)
ADD_SUBDIRECTORY(loadModel)
ADD_SUBDIRECTORY(viewer)
ADD_SUBDIRECTORY(exampleOpt)
ADD_SUBDIRECTORY(exampleIK)
ADD_SUBDIRECTORY(exampleDynamics)
ADD_SUBDIRECTORY(mayaExporter)
ADD_SUBDIRECTORY(exampleSim)
#ADD_SUBDIRECTORY(exampleCollision)
ADD_SUBDIRECTORY(exampleCollisionWithSkelton)
ADD_SUBDIRECTORY(handTracker)
ADD_SUBDIRECTORY(exampleLCP)
ADD_SUBDIRECTORY(exampleJointLimit)
ADD_SUBDIRECTORY(grab)
ADD_SUBDIRECTORY(cubes)
ADD_SUBDIRECTORY(biped)
|
SET_PROPERTY( DIRECTORY PROPERTY FOLDER Apps )
SET_PROPERTY( DIRECTORY PROPERTY EXCLUDE_FROM_DEFAULT_BUILD ON )
# List of all the subdirectories to include
# disabled: exampleCollision
foreach( APPDIR
loadModel viewer mayaExporter handTracker grab cubes biped
exampleUI exampleDynamics exampleSim ${SNOPT_APPS}
exampleCollisionWithSkelton exampleLCP exampleJointLimit )
ADD_SUBDIRECTORY( ${APPDIR} )
endforeach(APPDIR)
# List of all the targets added by the subdirectories
foreach( APPTARGET
loadModel viewer mayaExportMotion mayaExportSkeleton handTracker
grab cubes biped
exampleUI exampleDynamics exampleSim exampleOpt exampleIK
exampleCollisionWithSkelton exampleLCP exampleJointLimit )
IF(TARGET ${APPTARGET})
SET_TARGET_PROPERTIES( ${APPTARGET} PROPERTIES
FOLDER Apps
#EXCLUDE_FROM_DEFAULT_BUILD ON
)
ENDIF(TARGET ${APPTARGET})
endforeach(APPTARGET)
| Move all apps to solution folder | Move all apps to solution folder
| Text | bsd-2-clause | dartsim/dart,dartsim/dart,axeisghost/DART6motionBlur,dartsim/dart,axeisghost/DART6motionBlur,dartsim/dart,dartsim/dart,axeisghost/DART6motionBlur | text | ## Code Before:
ADD_SUBDIRECTORY(exampleUI)
ADD_SUBDIRECTORY(loadModel)
ADD_SUBDIRECTORY(viewer)
ADD_SUBDIRECTORY(exampleOpt)
ADD_SUBDIRECTORY(exampleIK)
ADD_SUBDIRECTORY(exampleDynamics)
ADD_SUBDIRECTORY(mayaExporter)
ADD_SUBDIRECTORY(exampleSim)
#ADD_SUBDIRECTORY(exampleCollision)
ADD_SUBDIRECTORY(exampleCollisionWithSkelton)
ADD_SUBDIRECTORY(handTracker)
ADD_SUBDIRECTORY(exampleLCP)
ADD_SUBDIRECTORY(exampleJointLimit)
ADD_SUBDIRECTORY(grab)
ADD_SUBDIRECTORY(cubes)
ADD_SUBDIRECTORY(biped)
## Instruction:
Move all apps to solution folder
## Code After:
SET_PROPERTY( DIRECTORY PROPERTY FOLDER Apps )
SET_PROPERTY( DIRECTORY PROPERTY EXCLUDE_FROM_DEFAULT_BUILD ON )
# List of all the subdirectories to include
# disabled: exampleCollision
foreach( APPDIR
loadModel viewer mayaExporter handTracker grab cubes biped
exampleUI exampleDynamics exampleSim ${SNOPT_APPS}
exampleCollisionWithSkelton exampleLCP exampleJointLimit )
ADD_SUBDIRECTORY( ${APPDIR} )
endforeach(APPDIR)
# List of all the targets added by the subdirectories
foreach( APPTARGET
loadModel viewer mayaExportMotion mayaExportSkeleton handTracker
grab cubes biped
exampleUI exampleDynamics exampleSim exampleOpt exampleIK
exampleCollisionWithSkelton exampleLCP exampleJointLimit )
IF(TARGET ${APPTARGET})
SET_TARGET_PROPERTIES( ${APPTARGET} PROPERTIES
FOLDER Apps
#EXCLUDE_FROM_DEFAULT_BUILD ON
)
ENDIF(TARGET ${APPTARGET})
endforeach(APPTARGET)
| - ADD_SUBDIRECTORY(exampleUI)
- ADD_SUBDIRECTORY(loadModel)
- ADD_SUBDIRECTORY(viewer)
- ADD_SUBDIRECTORY(exampleOpt)
- ADD_SUBDIRECTORY(exampleIK)
- ADD_SUBDIRECTORY(exampleDynamics)
- ADD_SUBDIRECTORY(mayaExporter)
- ADD_SUBDIRECTORY(exampleSim)
- #ADD_SUBDIRECTORY(exampleCollision)
- ADD_SUBDIRECTORY(exampleCollisionWithSkelton)
- ADD_SUBDIRECTORY(handTracker)
- ADD_SUBDIRECTORY(exampleLCP)
- ADD_SUBDIRECTORY(exampleJointLimit)
- ADD_SUBDIRECTORY(grab)
- ADD_SUBDIRECTORY(cubes)
- ADD_SUBDIRECTORY(biped)
+
+ SET_PROPERTY( DIRECTORY PROPERTY FOLDER Apps )
+ SET_PROPERTY( DIRECTORY PROPERTY EXCLUDE_FROM_DEFAULT_BUILD ON )
+
+ # List of all the subdirectories to include
+ # disabled: exampleCollision
+ foreach( APPDIR
+ loadModel viewer mayaExporter handTracker grab cubes biped
+ exampleUI exampleDynamics exampleSim ${SNOPT_APPS}
+ exampleCollisionWithSkelton exampleLCP exampleJointLimit )
+ ADD_SUBDIRECTORY( ${APPDIR} )
+ endforeach(APPDIR)
+
+ # List of all the targets added by the subdirectories
+ foreach( APPTARGET
+ loadModel viewer mayaExportMotion mayaExportSkeleton handTracker
+ grab cubes biped
+ exampleUI exampleDynamics exampleSim exampleOpt exampleIK
+ exampleCollisionWithSkelton exampleLCP exampleJointLimit )
+ IF(TARGET ${APPTARGET})
+ SET_TARGET_PROPERTIES( ${APPTARGET} PROPERTIES
+ FOLDER Apps
+ #EXCLUDE_FROM_DEFAULT_BUILD ON
+ )
+ ENDIF(TARGET ${APPTARGET})
+ endforeach(APPTARGET) | 42 | 2.625 | 26 | 16 |
69494f65327a3568cf071bdb95cb731029d13a63 | lib/index.js | lib/index.js | /**
server
The backbone of the server module. In development, this runs proxied through
BrowserSync server.
@param {Object} options Options passed on to "globals"
@param {Function} next Called when server successfully initialized
**/
var reorg = require("reorg");
module.exports = reorg(function(options, next) {
// Globals
require("./globals")(options);
var server = global.shipp.framework({ strict: true }),
middleware = require("./middleware"),
Utils = require("./utils");
[
// User-defined middleware
middleware("beforeAll"),
// Common middleware: logging, favicons, cookie parsing, sessions and body parsing
require("./common")(),
// User-defined middleware
middleware("beforeRoutes"),
// Static and compiled routes
require("./routes")(),
// Data-server
require("./data-server")(),
// User-defined middleware
middleware("afterRoutes")
].forEach(function(library) {
Utils.useMiddleware(server, library);
});
// Error handling: please see errors middleware for explanation of structure
require("./errors")(server, middleware("errorHandler"));
// Find open port and set up graceful shutdown
require("./lifecycle")(server, next);
}, "object", ["function", function() {}]);
| /**
server
The backbone of the server module. In development, this runs proxied through
BrowserSync server.
@param {Object} options Options passed on to "globals"
@param {Function} next Called when server successfully initialized
**/
var reorg = require("reorg");
module.exports = reorg(function(options, next) {
// Globals
require("./globals")(options);
var server = global.shipp.framework({ strict: true }),
middleware = require("./middleware"),
Utils = require("./utils");
// Remove powered-by header for security
server.disable("x-powered-by");
[
// User-defined middleware
middleware("beforeAll"),
// Common middleware: logging, favicons, cookie parsing, sessions and body parsing
require("./common")(),
// User-defined middleware
middleware("beforeRoutes"),
// Static and compiled routes
require("./routes")(),
// Data-server
require("./data-server")(),
// User-defined middleware
middleware("afterRoutes")
].forEach(function(library) {
Utils.useMiddleware(server, library);
});
// Error handling: please see errors middleware for explanation of structure
require("./errors")(server, middleware("errorHandler"));
// Find open port and set up graceful shutdown
require("./lifecycle")(server, next);
}, "object", ["function", function() {}]);
| Remove "x-powered-by" header (for security) | Remove "x-powered-by" header (for security)
| JavaScript | apache-2.0 | shippjs/shipp-server,shippjs/shipp-server | javascript | ## Code Before:
/**
server
The backbone of the server module. In development, this runs proxied through
BrowserSync server.
@param {Object} options Options passed on to "globals"
@param {Function} next Called when server successfully initialized
**/
var reorg = require("reorg");
module.exports = reorg(function(options, next) {
// Globals
require("./globals")(options);
var server = global.shipp.framework({ strict: true }),
middleware = require("./middleware"),
Utils = require("./utils");
[
// User-defined middleware
middleware("beforeAll"),
// Common middleware: logging, favicons, cookie parsing, sessions and body parsing
require("./common")(),
// User-defined middleware
middleware("beforeRoutes"),
// Static and compiled routes
require("./routes")(),
// Data-server
require("./data-server")(),
// User-defined middleware
middleware("afterRoutes")
].forEach(function(library) {
Utils.useMiddleware(server, library);
});
// Error handling: please see errors middleware for explanation of structure
require("./errors")(server, middleware("errorHandler"));
// Find open port and set up graceful shutdown
require("./lifecycle")(server, next);
}, "object", ["function", function() {}]);
## Instruction:
Remove "x-powered-by" header (for security)
## Code After:
/**
server
The backbone of the server module. In development, this runs proxied through
BrowserSync server.
@param {Object} options Options passed on to "globals"
@param {Function} next Called when server successfully initialized
**/
var reorg = require("reorg");
module.exports = reorg(function(options, next) {
// Globals
require("./globals")(options);
var server = global.shipp.framework({ strict: true }),
middleware = require("./middleware"),
Utils = require("./utils");
// Remove powered-by header for security
server.disable("x-powered-by");
[
// User-defined middleware
middleware("beforeAll"),
// Common middleware: logging, favicons, cookie parsing, sessions and body parsing
require("./common")(),
// User-defined middleware
middleware("beforeRoutes"),
// Static and compiled routes
require("./routes")(),
// Data-server
require("./data-server")(),
// User-defined middleware
middleware("afterRoutes")
].forEach(function(library) {
Utils.useMiddleware(server, library);
});
// Error handling: please see errors middleware for explanation of structure
require("./errors")(server, middleware("errorHandler"));
// Find open port and set up graceful shutdown
require("./lifecycle")(server, next);
}, "object", ["function", function() {}]);
| /**
server
The backbone of the server module. In development, this runs proxied through
BrowserSync server.
@param {Object} options Options passed on to "globals"
@param {Function} next Called when server successfully initialized
**/
var reorg = require("reorg");
module.exports = reorg(function(options, next) {
// Globals
require("./globals")(options);
var server = global.shipp.framework({ strict: true }),
middleware = require("./middleware"),
Utils = require("./utils");
+
+ // Remove powered-by header for security
+ server.disable("x-powered-by");
[
// User-defined middleware
middleware("beforeAll"),
// Common middleware: logging, favicons, cookie parsing, sessions and body parsing
require("./common")(),
// User-defined middleware
middleware("beforeRoutes"),
// Static and compiled routes
require("./routes")(),
// Data-server
require("./data-server")(),
// User-defined middleware
middleware("afterRoutes")
].forEach(function(library) {
Utils.useMiddleware(server, library);
});
// Error handling: please see errors middleware for explanation of structure
require("./errors")(server, middleware("errorHandler"));
// Find open port and set up graceful shutdown
require("./lifecycle")(server, next);
}, "object", ["function", function() {}]); | 3 | 0.056604 | 3 | 0 |
75d66dfa4ddbb8bdd7903194feff1b69805f8d0d | index.html | index.html | ---
layout: default
---
<div class="jumbotron">
<h1>{{ site.data.config.title | escape }}</h1>
<p>Ride Dallas.</p>
<a class="btn btn-primary btn-lg" href="https://www.facebook.com/fixed.touring" role="button">
<i class="fa fa-facebook"></i> Fixed Touring
</a>
<a class="btn btn-info btn-lg" href="https://twitter.com/fixedtouring" role="button">
<i class="fa fa-twitter"></i> Fixed Touring
</a>
</div>
<div class="list-group">
{% for post in site.posts %}
<a href="{{ post.url | escape }}" class="list-group-item">
<h2>
{% if post.categories contains 'bikes' %}
<i class="fa fa-bicycle"></i>
{% elsif post.categories contains 'rides' %}
<i class="fa fa-map-marker"></i>
{% endif %}
{{ post.title | escape }}
</h2>
<p>
<mark>
{{ post.date | date: '%Y-%m-%d' }}
</mark>
{{ post.content | split: '<!---->' | last | strip_html | strip_newlines | split: ' ' | join: ' ' | truncate: 200 }}
</p>
</a>
{% endfor %}
</div>
| ---
layout: default
---
<div class="jumbotron">
<h1>{{ site.data.config.title | escape }}</h1>
<p>Ride Dallas.</p>
<a class="btn btn-primary btn-lg" href="https://www.facebook.com/fixed.touring" role="button">
<i class="fa fa-facebook"></i> Fixed Touring
</a>
<a class="btn btn-info btn-lg" href="https://twitter.com/fixedtouring" role="button">
<i class="fa fa-twitter"></i> Fixed Touring
</a>
</div>
<div class="list-group">
{% for post in site.posts %}
<a href="{{ post.url | escape }}" class="list-group-item">
<h2>
{{ post.title | escape }}
<small>
{% if post.categories contains 'bikes' %}
<i class="fa fa-bicycle"></i>
{% elsif post.categories contains 'rides' %}
<i class="fa fa-map-marker"></i>
{% endif %}
</small>
</h2>
<p>
<mark>
{{ post.date | date: '%Y-%m-%d' }}
</mark>
{{ post.content | split: '<!---->' | last | strip_html | strip_newlines | split: ' ' | join: ' ' | truncate: 200 }}
</p>
</a>
{% endfor %}
</div>
| Move icons to other side | Move icons to other side
| HTML | mit | fixedtouring/fixedtouring.github.io,fixedtouring/fixedtouring.github.io | html | ## Code Before:
---
layout: default
---
<div class="jumbotron">
<h1>{{ site.data.config.title | escape }}</h1>
<p>Ride Dallas.</p>
<a class="btn btn-primary btn-lg" href="https://www.facebook.com/fixed.touring" role="button">
<i class="fa fa-facebook"></i> Fixed Touring
</a>
<a class="btn btn-info btn-lg" href="https://twitter.com/fixedtouring" role="button">
<i class="fa fa-twitter"></i> Fixed Touring
</a>
</div>
<div class="list-group">
{% for post in site.posts %}
<a href="{{ post.url | escape }}" class="list-group-item">
<h2>
{% if post.categories contains 'bikes' %}
<i class="fa fa-bicycle"></i>
{% elsif post.categories contains 'rides' %}
<i class="fa fa-map-marker"></i>
{% endif %}
{{ post.title | escape }}
</h2>
<p>
<mark>
{{ post.date | date: '%Y-%m-%d' }}
</mark>
{{ post.content | split: '<!---->' | last | strip_html | strip_newlines | split: ' ' | join: ' ' | truncate: 200 }}
</p>
</a>
{% endfor %}
</div>
## Instruction:
Move icons to other side
## Code After:
---
layout: default
---
<div class="jumbotron">
<h1>{{ site.data.config.title | escape }}</h1>
<p>Ride Dallas.</p>
<a class="btn btn-primary btn-lg" href="https://www.facebook.com/fixed.touring" role="button">
<i class="fa fa-facebook"></i> Fixed Touring
</a>
<a class="btn btn-info btn-lg" href="https://twitter.com/fixedtouring" role="button">
<i class="fa fa-twitter"></i> Fixed Touring
</a>
</div>
<div class="list-group">
{% for post in site.posts %}
<a href="{{ post.url | escape }}" class="list-group-item">
<h2>
{{ post.title | escape }}
<small>
{% if post.categories contains 'bikes' %}
<i class="fa fa-bicycle"></i>
{% elsif post.categories contains 'rides' %}
<i class="fa fa-map-marker"></i>
{% endif %}
</small>
</h2>
<p>
<mark>
{{ post.date | date: '%Y-%m-%d' }}
</mark>
{{ post.content | split: '<!---->' | last | strip_html | strip_newlines | split: ' ' | join: ' ' | truncate: 200 }}
</p>
</a>
{% endfor %}
</div>
| ---
layout: default
---
<div class="jumbotron">
<h1>{{ site.data.config.title | escape }}</h1>
<p>Ride Dallas.</p>
<a class="btn btn-primary btn-lg" href="https://www.facebook.com/fixed.touring" role="button">
<i class="fa fa-facebook"></i> Fixed Touring
</a>
<a class="btn btn-info btn-lg" href="https://twitter.com/fixedtouring" role="button">
<i class="fa fa-twitter"></i> Fixed Touring
</a>
</div>
<div class="list-group">
{% for post in site.posts %}
<a href="{{ post.url | escape }}" class="list-group-item">
<h2>
+ {{ post.title | escape }}
- {% if post.categories contains 'bikes' %}
- <i class="fa fa-bicycle"></i>
- {% elsif post.categories contains 'rides' %}
- <i class="fa fa-map-marker"></i>
- {% endif %}
- {{ post.title | escape }}
+ <small>
+ {% if post.categories contains 'bikes' %}
+ <i class="fa fa-bicycle"></i>
+ {% elsif post.categories contains 'rides' %}
+ <i class="fa fa-map-marker"></i>
+ {% endif %}
+ </small>
</h2>
<p>
<mark>
{{ post.date | date: '%Y-%m-%d' }}
</mark>
{{ post.content | split: '<!---->' | last | strip_html | strip_newlines | split: ' ' | join: ' ' | truncate: 200 }}
</p>
</a>
{% endfor %}
</div> | 14 | 0.341463 | 8 | 6 |
07208d6ec112768ab5e1671f1c633f28cacea0e4 | src/libs/_sys.js | src/libs/_sys.js | var $module=(function($B){
return {
modules :
{'__get__':function(){return $B.builtins.dict($B.JSObject($B.imported))},
'__set__':0 // data descriptor, to force use of __get__
},
stderr : {
__set__:function(self, obj, value){$B.stderr = value},
write:function(data){$B.stderr.write(data)}
},
stdout : {
__set__:function(self, obj, value){$B.stdout = value},
write:function(data){$B.stdout.write(data)}
},
stdin : $B.stdin
}
})(__BRYTHON__)
| var $module=(function($B){
return {
modules :
{'__get__':function(){return $B.builtins.dict($B.JSObject($B.imported))},
'__set__':0 // data descriptor, to force use of __get__
},
stderr : {
__get__:function(){return $B.stderr},
__set__:function(self, obj, value){console.log('set stderr');$B.stderr = value},
write:function(data){$B.builtins.getattr($B.stderr,"write")(data)}
},
stdout : {
__get__:function(){return $B.stdout},
__set__:function(self, obj, value){console.log('set stdout');$B.stdout = value},
write:function(data){$B.builtins.getattr($B.stdout,"write")(data)}
},
stdin : $B.stdin
}
})(__BRYTHON__)
| Add __get__ to sys.stderr and stdout | Add __get__ to sys.stderr and stdout
| JavaScript | bsd-3-clause | kevinmel2000/brython,JohnDenker/brython,Hasimir/brython,molebot/brython,olemis/brython,JohnDenker/brython,Hasimir/brython,Lh4cKg/brython,Isendir/brython,brython-dev/brython,firmlyjin/brython,kikocorreoso/brython,rubyinhell/brython,Hasimir/brython,kikocorreoso/brython,amrdraz/brython,kikocorreoso/brython,JohnDenker/brython,olemis/brython,jonathanverner/brython,JohnDenker/brython,amrdraz/brython,jonathanverner/brython,Mozhuowen/brython,firmlyjin/brython,molebot/brython,brython-dev/brython,kevinmel2000/brython,Mozhuowen/brython,molebot/brython,Lh4cKg/brython,rubyinhell/brython,amrdraz/brython,amrdraz/brython,Isendir/brython,Isendir/brython,Isendir/brython,Mozhuowen/brython,rubyinhell/brython,olemis/brython,olemis/brython,firmlyjin/brython,firmlyjin/brython,firmlyjin/brython,kevinmel2000/brython,rubyinhell/brython,molebot/brython,Lh4cKg/brython,jonathanverner/brython,Mozhuowen/brython,kevinmel2000/brython,Hasimir/brython,brython-dev/brython,jonathanverner/brython,Lh4cKg/brython | javascript | ## Code Before:
var $module=(function($B){
return {
modules :
{'__get__':function(){return $B.builtins.dict($B.JSObject($B.imported))},
'__set__':0 // data descriptor, to force use of __get__
},
stderr : {
__set__:function(self, obj, value){$B.stderr = value},
write:function(data){$B.stderr.write(data)}
},
stdout : {
__set__:function(self, obj, value){$B.stdout = value},
write:function(data){$B.stdout.write(data)}
},
stdin : $B.stdin
}
})(__BRYTHON__)
## Instruction:
Add __get__ to sys.stderr and stdout
## Code After:
var $module=(function($B){
return {
modules :
{'__get__':function(){return $B.builtins.dict($B.JSObject($B.imported))},
'__set__':0 // data descriptor, to force use of __get__
},
stderr : {
__get__:function(){return $B.stderr},
__set__:function(self, obj, value){console.log('set stderr');$B.stderr = value},
write:function(data){$B.builtins.getattr($B.stderr,"write")(data)}
},
stdout : {
__get__:function(){return $B.stdout},
__set__:function(self, obj, value){console.log('set stdout');$B.stdout = value},
write:function(data){$B.builtins.getattr($B.stdout,"write")(data)}
},
stdin : $B.stdin
}
})(__BRYTHON__)
| var $module=(function($B){
return {
modules :
{'__get__':function(){return $B.builtins.dict($B.JSObject($B.imported))},
'__set__':0 // data descriptor, to force use of __get__
},
stderr : {
+ __get__:function(){return $B.stderr},
- __set__:function(self, obj, value){$B.stderr = value},
+ __set__:function(self, obj, value){console.log('set stderr');$B.stderr = value},
? ++++++++++++++++++++++++++
- write:function(data){$B.stderr.write(data)}
? ^
+ write:function(data){$B.builtins.getattr($B.stderr,"write")(data)}
? ++++++++++++++++++++ ^^ ++
},
stdout : {
+ __get__:function(){return $B.stdout},
- __set__:function(self, obj, value){$B.stdout = value},
+ __set__:function(self, obj, value){console.log('set stdout');$B.stdout = value},
? ++++++++++++++++++++++++++
- write:function(data){$B.stdout.write(data)}
? ^
+ write:function(data){$B.builtins.getattr($B.stdout,"write")(data)}
? ++++++++++++++++++++ ^^ ++
},
stdin : $B.stdin
}
})(__BRYTHON__)
+ | 11 | 0.611111 | 7 | 4 |
241f8379347845280c5ae1d6d8947103ea9abe28 | gists/gist8065433/main.go | gists/gist8065433/main.go | package gist8065433
import "net"
// GetPublicIps returns a string slice of non-loopback IPs.
func GetPublicIps() (publicIps []string, err error) {
ifis, err := net.Interfaces()
if err != nil {
return nil, err
}
for _, ifi := range ifis {
addrs, err := ifi.Addrs()
if err != nil {
return nil, err
}
for _, addr := range addrs {
ipNet, ok := addr.(*net.IPNet)
if !ok {
continue
}
ip4 := ipNet.IP.To4()
if ip4 == nil || ip4.IsLoopback() {
continue
}
publicIps = append(publicIps, ipNet.IP.String())
}
}
return publicIps, nil
}
| package gist8065433
import "net"
// GetPublicIps returns a string slice of non-loopback IPs.
func GetPublicIps() (publicIps []string, err error) {
ifis, err := net.Interfaces()
if err != nil {
return nil, err
}
for _, ifi := range ifis {
addrs, err := ifi.Addrs()
if err != nil {
return nil, err
}
for _, addr := range addrs {
ipNet, ok := addr.(*net.IPNet)
if !ok {
continue
}
ip4 := ipNet.IP.To4()
if ip4 == nil || ip4.IsLoopback() {
continue
}
publicIps = append(publicIps, ipNet.IP.String())
}
}
return publicIps, nil
}
// GetAllIps returns a string slice of all IPs.
func GetAllIps() (ips []string, err error) {
ifis, err := net.Interfaces()
if err != nil {
return nil, err
}
for _, ifi := range ifis {
addrs, err := ifi.Addrs()
if err != nil {
return nil, err
}
for _, addr := range addrs {
ipNet, ok := addr.(*net.IPNet)
if !ok {
continue
}
ip4 := ipNet.IP.To4()
if ip4 == nil {
continue
}
ips = append(ips, ipNet.IP.String())
}
}
return ips, nil
}
| Add GetAllIps to get a list of all IPv4 interfaces, including loopback. | Add GetAllIps to get a list of all IPv4 interfaces, including loopback.
| Go | mit | shurcooL/go | go | ## Code Before:
package gist8065433
import "net"
// GetPublicIps returns a string slice of non-loopback IPs.
func GetPublicIps() (publicIps []string, err error) {
ifis, err := net.Interfaces()
if err != nil {
return nil, err
}
for _, ifi := range ifis {
addrs, err := ifi.Addrs()
if err != nil {
return nil, err
}
for _, addr := range addrs {
ipNet, ok := addr.(*net.IPNet)
if !ok {
continue
}
ip4 := ipNet.IP.To4()
if ip4 == nil || ip4.IsLoopback() {
continue
}
publicIps = append(publicIps, ipNet.IP.String())
}
}
return publicIps, nil
}
## Instruction:
Add GetAllIps to get a list of all IPv4 interfaces, including loopback.
## Code After:
package gist8065433
import "net"
// GetPublicIps returns a string slice of non-loopback IPs.
func GetPublicIps() (publicIps []string, err error) {
ifis, err := net.Interfaces()
if err != nil {
return nil, err
}
for _, ifi := range ifis {
addrs, err := ifi.Addrs()
if err != nil {
return nil, err
}
for _, addr := range addrs {
ipNet, ok := addr.(*net.IPNet)
if !ok {
continue
}
ip4 := ipNet.IP.To4()
if ip4 == nil || ip4.IsLoopback() {
continue
}
publicIps = append(publicIps, ipNet.IP.String())
}
}
return publicIps, nil
}
// GetAllIps returns a string slice of all IPs.
func GetAllIps() (ips []string, err error) {
ifis, err := net.Interfaces()
if err != nil {
return nil, err
}
for _, ifi := range ifis {
addrs, err := ifi.Addrs()
if err != nil {
return nil, err
}
for _, addr := range addrs {
ipNet, ok := addr.(*net.IPNet)
if !ok {
continue
}
ip4 := ipNet.IP.To4()
if ip4 == nil {
continue
}
ips = append(ips, ipNet.IP.String())
}
}
return ips, nil
}
| package gist8065433
import "net"
// GetPublicIps returns a string slice of non-loopback IPs.
func GetPublicIps() (publicIps []string, err error) {
ifis, err := net.Interfaces()
if err != nil {
return nil, err
}
for _, ifi := range ifis {
addrs, err := ifi.Addrs()
if err != nil {
return nil, err
}
for _, addr := range addrs {
ipNet, ok := addr.(*net.IPNet)
if !ok {
continue
}
ip4 := ipNet.IP.To4()
if ip4 == nil || ip4.IsLoopback() {
continue
}
publicIps = append(publicIps, ipNet.IP.String())
}
}
return publicIps, nil
}
+
+ // GetAllIps returns a string slice of all IPs.
+ func GetAllIps() (ips []string, err error) {
+ ifis, err := net.Interfaces()
+ if err != nil {
+ return nil, err
+ }
+
+ for _, ifi := range ifis {
+ addrs, err := ifi.Addrs()
+ if err != nil {
+ return nil, err
+ }
+
+ for _, addr := range addrs {
+ ipNet, ok := addr.(*net.IPNet)
+ if !ok {
+ continue
+ }
+
+ ip4 := ipNet.IP.To4()
+ if ip4 == nil {
+ continue
+ }
+
+ ips = append(ips, ipNet.IP.String())
+ }
+ }
+
+ return ips, nil
+ } | 31 | 0.911765 | 31 | 0 |
828564035891500b1ad538d7b17ae643fd9666db | interfaces/web_desktop/apps/Admin/Templates/applications_details.html | interfaces/web_desktop/apps/Admin/Templates/applications_details.html |
<h2>
{i18n_application_profile}
</h2>
<h1 class="ImageHeading">
{application_name}
</h1>
<h2 class="MarginTop">
{i18n_app_marketplace_info}
</h2>
<div class="Box Padding">
<div class="HRow">
<div class="HContent50 FloatLeft Ellipsis">
<strong>{i18n_application_visible}</strong>
</div>
<div class="HContent50 FloatLeft Ellipsis">
{application_visible}
</div>
</div>
<div class="HRow">
<div class="HContent50 FloatLeft Ellipsis">
<strong>{i18n_application_featured}</strong>
</div>
<div class="HContent50 FloatLeft Ellipsis">
{application_featured}
</div>
</div>
</div>
<h2 class="MarginTop">
{i18n_application_graphics}
</h2>
<div class="Box Padding" id="WorkgroupGui">
{graphics}
<div class="HRow">
<button class="IconButton IconSmall ButtonSmall FloatRight fa-edit" id="ApplicationGfxEdit"></button>
</div>
</div>
<h2 class="MarginTop">
{i18n_application_information}
</h2>
<div class="Box Padding" id="WorkgroupGui">
{info}
<div class="HRow">
<button class="IconButton IconSmall ButtonSmall FloatRight fa-edit" id="ApplicationInfoEdit"></button>
</div>
</div>
|
<h2>
{i18n_application_profile}
</h2>
<h1 class="ImageHeading">
{application_name}
</h1>
<h2 class="MarginTop">
{i18n_app_marketplace_info}
</h2>
<div class="Box Padding">
<div class="HRow">
<div class="HContent50 FloatLeft Ellipsis">
<strong>{i18n_application_visible}</strong>
</div>
<div class="HContent50 FloatLeft Ellipsis">
{application_visible}
</div>
</div>
<div class="HRow">
<div class="HContent50 FloatLeft Ellipsis">
<strong>{i18n_application_featured}</strong>
</div>
<div class="HContent50 FloatLeft Ellipsis">
{application_featured}
</div>
</div>
</div>
| Disable features that are not usable. | Disable features that are not usable.
| HTML | agpl-3.0 | FriendSoftwareLabs/friendup,FriendSoftwareLabs/friendup,FriendSoftwareLabs/friendup,FriendSoftwareLabs/friendup,FriendSoftwareLabs/friendup,FriendSoftwareLabs/friendup,FriendSoftwareLabs/friendup,FriendSoftwareLabs/friendup | html | ## Code Before:
<h2>
{i18n_application_profile}
</h2>
<h1 class="ImageHeading">
{application_name}
</h1>
<h2 class="MarginTop">
{i18n_app_marketplace_info}
</h2>
<div class="Box Padding">
<div class="HRow">
<div class="HContent50 FloatLeft Ellipsis">
<strong>{i18n_application_visible}</strong>
</div>
<div class="HContent50 FloatLeft Ellipsis">
{application_visible}
</div>
</div>
<div class="HRow">
<div class="HContent50 FloatLeft Ellipsis">
<strong>{i18n_application_featured}</strong>
</div>
<div class="HContent50 FloatLeft Ellipsis">
{application_featured}
</div>
</div>
</div>
<h2 class="MarginTop">
{i18n_application_graphics}
</h2>
<div class="Box Padding" id="WorkgroupGui">
{graphics}
<div class="HRow">
<button class="IconButton IconSmall ButtonSmall FloatRight fa-edit" id="ApplicationGfxEdit"></button>
</div>
</div>
<h2 class="MarginTop">
{i18n_application_information}
</h2>
<div class="Box Padding" id="WorkgroupGui">
{info}
<div class="HRow">
<button class="IconButton IconSmall ButtonSmall FloatRight fa-edit" id="ApplicationInfoEdit"></button>
</div>
</div>
## Instruction:
Disable features that are not usable.
## Code After:
<h2>
{i18n_application_profile}
</h2>
<h1 class="ImageHeading">
{application_name}
</h1>
<h2 class="MarginTop">
{i18n_app_marketplace_info}
</h2>
<div class="Box Padding">
<div class="HRow">
<div class="HContent50 FloatLeft Ellipsis">
<strong>{i18n_application_visible}</strong>
</div>
<div class="HContent50 FloatLeft Ellipsis">
{application_visible}
</div>
</div>
<div class="HRow">
<div class="HContent50 FloatLeft Ellipsis">
<strong>{i18n_application_featured}</strong>
</div>
<div class="HContent50 FloatLeft Ellipsis">
{application_featured}
</div>
</div>
</div>
|
<h2>
{i18n_application_profile}
</h2>
<h1 class="ImageHeading">
{application_name}
</h1>
<h2 class="MarginTop">
{i18n_app_marketplace_info}
</h2>
<div class="Box Padding">
<div class="HRow">
<div class="HContent50 FloatLeft Ellipsis">
<strong>{i18n_application_visible}</strong>
</div>
<div class="HContent50 FloatLeft Ellipsis">
{application_visible}
</div>
</div>
<div class="HRow">
<div class="HContent50 FloatLeft Ellipsis">
<strong>{i18n_application_featured}</strong>
</div>
<div class="HContent50 FloatLeft Ellipsis">
{application_featured}
</div>
</div>
</div>
- <h2 class="MarginTop">
- {i18n_application_graphics}
- </h2>
- <div class="Box Padding" id="WorkgroupGui">
- {graphics}
- <div class="HRow">
- <button class="IconButton IconSmall ButtonSmall FloatRight fa-edit" id="ApplicationGfxEdit"></button>
- </div>
- </div>
- <h2 class="MarginTop">
- {i18n_application_information}
- </h2>
- <div class="Box Padding" id="WorkgroupGui">
- {info}
- <div class="HRow">
- <button class="IconButton IconSmall ButtonSmall FloatRight fa-edit" id="ApplicationInfoEdit"></button>
- </div>
- </div>
| 18 | 0.352941 | 0 | 18 |
f6a2ca21c72b8d97cd0f89a0a436bf90b431698b | recipes-devtools/python/rpio_0.10.0.bb | recipes-devtools/python/rpio_0.10.0.bb | DESCRIPTION = "Advanced GPIO for the Raspberry Pi. Extends RPi.GPIO with PWM, \
GPIO interrups, TCP socket interrupts, command line tools and more"
HOMEPAGE = "https://github.com/metachris/RPIO"
SECTION = "devel/python"
LICENSE = "LGPLv3+"
LIC_FILES_CHKSUM = "file://README.rst;beginline=41;endline=53;md5=d5d95d7486a4d98c999675c23196b25a"
SRCNAME = "RPIO"
SRC_URI = "http://pypi.python.org/packages/source/R/RPIO/${SRCNAME}-${PV}.tar.gz \
file://0001-include-sys-types.h-explicitly-for-getting-caddr_t-d.patch \
"
S = "${WORKDIR}/${SRCNAME}-${PV}"
inherit setuptools
COMPATIBLE_MACHINE = "raspberrypi"
SRC_URI[md5sum] = "cefc45422833dcafcd59b78dffc540f4"
SRC_URI[sha256sum] = "b89f75dec9de354681209ebfaedfe22b7c178aacd91a604a7bd6d92024e4cf7e"
| DESCRIPTION = "Advanced GPIO for the Raspberry Pi. Extends RPi.GPIO with PWM, \
GPIO interrups, TCP socket interrupts, command line tools and more"
HOMEPAGE = "https://github.com/metachris/RPIO"
SECTION = "devel/python"
LICENSE = "LGPLv3+"
LIC_FILES_CHKSUM = "file://README.rst;beginline=41;endline=53;md5=d5d95d7486a4d98c999675c23196b25a"
SRCNAME = "RPIO"
SRC_URI = "http://pypi.python.org/packages/source/R/RPIO/${SRCNAME}-${PV}.tar.gz \
file://0001-include-sys-types.h-explicitly-for-getting-caddr_t-d.patch \
"
S = "${WORKDIR}/${SRCNAME}-${PV}"
inherit setuptools
COMPATIBLE_MACHINE = "raspberrypi"
RDEPENDS_${PN} = "\
python-logging \
python-threading \
"
SRC_URI[md5sum] = "cefc45422833dcafcd59b78dffc540f4"
SRC_URI[sha256sum] = "b89f75dec9de354681209ebfaedfe22b7c178aacd91a604a7bd6d92024e4cf7e"
| Add RDEPENDS For python-logging & python-threading | rpio: Add RDEPENDS For python-logging & python-threading
[GitHub Ticket #98 - rpio requires the logging and threading Python
packages but does not RDEPENDS them in recipie]
The rpio tool needs the Python logging and threading pacakges installed
on the target system for it to work. The pacakges are not included when
doing a rpi-basci-image. This change updates the recipe so that all the
required dependencies of the prio script are identified by the recipie.
Fixes #98
Signed-off-by: Thomas A F Thorne <3857bccc88203a3a5096056ecf8a6f860bf50edf@GoogleMail.com>
| BitBake | mit | schnitzeltony/meta-raspberrypi,leon-anavi/meta-raspberrypi,agherzan/meta-raspberrypi,d21d3q/meta-raspberrypi,leon-anavi/meta-raspberrypi,d21d3q/meta-raspberrypi,d21d3q/meta-raspberrypi,agherzan/meta-raspberrypi,kraj/meta-raspberrypi,kraj/meta-raspberrypi,agherzan/meta-raspberrypi,kraj/meta-raspberrypi,schnitzeltony/meta-raspberrypi,schnitzeltony/meta-raspberrypi,agherzan/meta-raspberrypi,leon-anavi/meta-raspberrypi,d21d3q/meta-raspberrypi,agherzan/meta-raspberrypi,agherzan/meta-raspberrypi | bitbake | ## Code Before:
DESCRIPTION = "Advanced GPIO for the Raspberry Pi. Extends RPi.GPIO with PWM, \
GPIO interrups, TCP socket interrupts, command line tools and more"
HOMEPAGE = "https://github.com/metachris/RPIO"
SECTION = "devel/python"
LICENSE = "LGPLv3+"
LIC_FILES_CHKSUM = "file://README.rst;beginline=41;endline=53;md5=d5d95d7486a4d98c999675c23196b25a"
SRCNAME = "RPIO"
SRC_URI = "http://pypi.python.org/packages/source/R/RPIO/${SRCNAME}-${PV}.tar.gz \
file://0001-include-sys-types.h-explicitly-for-getting-caddr_t-d.patch \
"
S = "${WORKDIR}/${SRCNAME}-${PV}"
inherit setuptools
COMPATIBLE_MACHINE = "raspberrypi"
SRC_URI[md5sum] = "cefc45422833dcafcd59b78dffc540f4"
SRC_URI[sha256sum] = "b89f75dec9de354681209ebfaedfe22b7c178aacd91a604a7bd6d92024e4cf7e"
## Instruction:
rpio: Add RDEPENDS For python-logging & python-threading
[GitHub Ticket #98 - rpio requires the logging and threading Python
packages but does not RDEPENDS them in recipie]
The rpio tool needs the Python logging and threading pacakges installed
on the target system for it to work. The pacakges are not included when
doing a rpi-basci-image. This change updates the recipe so that all the
required dependencies of the prio script are identified by the recipie.
Fixes #98
Signed-off-by: Thomas A F Thorne <3857bccc88203a3a5096056ecf8a6f860bf50edf@GoogleMail.com>
## Code After:
DESCRIPTION = "Advanced GPIO for the Raspberry Pi. Extends RPi.GPIO with PWM, \
GPIO interrups, TCP socket interrupts, command line tools and more"
HOMEPAGE = "https://github.com/metachris/RPIO"
SECTION = "devel/python"
LICENSE = "LGPLv3+"
LIC_FILES_CHKSUM = "file://README.rst;beginline=41;endline=53;md5=d5d95d7486a4d98c999675c23196b25a"
SRCNAME = "RPIO"
SRC_URI = "http://pypi.python.org/packages/source/R/RPIO/${SRCNAME}-${PV}.tar.gz \
file://0001-include-sys-types.h-explicitly-for-getting-caddr_t-d.patch \
"
S = "${WORKDIR}/${SRCNAME}-${PV}"
inherit setuptools
COMPATIBLE_MACHINE = "raspberrypi"
RDEPENDS_${PN} = "\
python-logging \
python-threading \
"
SRC_URI[md5sum] = "cefc45422833dcafcd59b78dffc540f4"
SRC_URI[sha256sum] = "b89f75dec9de354681209ebfaedfe22b7c178aacd91a604a7bd6d92024e4cf7e"
| DESCRIPTION = "Advanced GPIO for the Raspberry Pi. Extends RPi.GPIO with PWM, \
GPIO interrups, TCP socket interrupts, command line tools and more"
HOMEPAGE = "https://github.com/metachris/RPIO"
SECTION = "devel/python"
LICENSE = "LGPLv3+"
LIC_FILES_CHKSUM = "file://README.rst;beginline=41;endline=53;md5=d5d95d7486a4d98c999675c23196b25a"
SRCNAME = "RPIO"
SRC_URI = "http://pypi.python.org/packages/source/R/RPIO/${SRCNAME}-${PV}.tar.gz \
file://0001-include-sys-types.h-explicitly-for-getting-caddr_t-d.patch \
"
S = "${WORKDIR}/${SRCNAME}-${PV}"
inherit setuptools
COMPATIBLE_MACHINE = "raspberrypi"
+ RDEPENDS_${PN} = "\
+ python-logging \
+ python-threading \
+ "
+
SRC_URI[md5sum] = "cefc45422833dcafcd59b78dffc540f4"
SRC_URI[sha256sum] = "b89f75dec9de354681209ebfaedfe22b7c178aacd91a604a7bd6d92024e4cf7e" | 5 | 0.25 | 5 | 0 |
1e2f1ea69cd79e274b66a14f8699b2252fbde381 | README.md | README.md | aircraft-python
===============
The is a game developed upon pygame.
| aircraft-python
===============
This is a game developed upon pygame.
The aim of this programme is for personal practice on python
The images in this repo come from the web resource, such as http://lunar.lostgarden.com/labels/free%20game%20graphics.html
| Modify on read me file | Modify on read me file
| Markdown | unlicense | Tvli/aircraft-python | markdown | ## Code Before:
aircraft-python
===============
The is a game developed upon pygame.
## Instruction:
Modify on read me file
## Code After:
aircraft-python
===============
This is a game developed upon pygame.
The aim of this programme is for personal practice on python
The images in this repo come from the web resource, such as http://lunar.lostgarden.com/labels/free%20game%20graphics.html
| aircraft-python
===============
- The is a game developed upon pygame.
? ^
+ This is a game developed upon pygame.
? ^^
+
+ The aim of this programme is for personal practice on python
+
+ The images in this repo come from the web resource, such as http://lunar.lostgarden.com/labels/free%20game%20graphics.html
+ | 7 | 1.75 | 6 | 1 |
58852dbdd399b43ffe4a2793edf92c45c1e35c58 | .travis.yml | .travis.yml | before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
script: "bundle exec rake --trace fulcrum:setup db:setup spec jasmine:ci"
| before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "bundle exec rake --trace fulcrum:setup db:setup"
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
script:
- "bundle exec rspec spec"
- "bundle exec rake jasmine:ci"
| Use bundle exec rspec to run rspec and separately run jasmine:ci through rake. | Use bundle exec rspec to run rspec and separately run jasmine:ci through rake.
| YAML | agpl-3.0 | nh-platform/demo-fulcrum,HenryYan2012/fulcrum,PedroFelipe/cm42-central,ipmobiletech/fulcrum,Codeminer42/cm42-central,privatt/privatt-agile-tracker,HenryYan2012/fulcrum,ipmobiletech/fulcrum,jimbeaudoin/agile-tracker,fulcrum-agile/fulcrum,ipmobiletech/fulcrum,nh-platform/demo-fulcrum,MikeRuby/fulcrumapp,Aupajo/fulcrum,DrTom/fulcrum,jimbeaudoin/agile-tracker,HenryYan2012/fulcrum,privatt/privatt-agile-tracker,DrTom/fulcrum,KentFujii/fulcrum,DrTom/fulcrum,jimbeaudoin/agile-tracker,Aupajo/fulcrum,nh-platform/demo-fulcrum,MikeRuby/fulcrumapp,Aupajo/fulcrum,Codeminer42/cm42-central,fulcrum-agile/fulcrum,KentFujii/fulcrum,PedroFelipe/cm42-central,fulcrum-agile/fulcrum,KentFujii/fulcrum,PedroFelipe/cm42-central,privatt/privatt-agile-tracker,Codeminer42/cm42-central | yaml | ## Code Before:
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
script: "bundle exec rake --trace fulcrum:setup db:setup spec jasmine:ci"
## Instruction:
Use bundle exec rspec to run rspec and separately run jasmine:ci through rake.
## Code After:
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- "bundle exec rake --trace fulcrum:setup db:setup"
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
script:
- "bundle exec rspec spec"
- "bundle exec rake jasmine:ci"
| before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
+ - "bundle exec rake --trace fulcrum:setup db:setup"
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- script: "bundle exec rake --trace fulcrum:setup db:setup spec jasmine:ci"
+ script:
+ - "bundle exec rspec spec"
+ - "bundle exec rake jasmine:ci" | 5 | 0.625 | 4 | 1 |
722ec5b194f8788e8c6cf5a2568fe6fd75138fa4 | readme.md | readme.md |
This little project tries to put together several JavaScript technologies
in order to learn a workflow for doing Test Driven Development (TDD).
The technologies used are the following:
* [NodeJS](https://github.com/nodejs/node)
* [ExpressJS](https://github.com/expressjs/express)
* [SuperTest](https://github.com/visionmedia/supertest)
* [Mocha](https://github.com/mochajs/mocha)
To run the tests simply `cd` into your project directory and run `npm test`.
---
More to come
|
This little project tries to put together several JavaScript technologies
in order to learn a workflow for doing Test Driven Development (TDD).
The technologies used are the following:
* [NodeJS](https://github.com/nodejs/node)
* [ExpressJS](https://github.com/expressjs/express)
* [SuperTest](https://github.com/visionmedia/supertest)
* [Mocha](https://github.com/mochajs/mocha)
To run the tests simply `cd` into your project directory and run `npm test`.
To try the live demo please check <https://obscure-dawn-76650.herokuapp.com>.
---
More to come
| Add heroku hosted live demo | Add heroku hosted live demo
| Markdown | mit | uriStolar/express-test,uriStolar/express-test | markdown | ## Code Before:
This little project tries to put together several JavaScript technologies
in order to learn a workflow for doing Test Driven Development (TDD).
The technologies used are the following:
* [NodeJS](https://github.com/nodejs/node)
* [ExpressJS](https://github.com/expressjs/express)
* [SuperTest](https://github.com/visionmedia/supertest)
* [Mocha](https://github.com/mochajs/mocha)
To run the tests simply `cd` into your project directory and run `npm test`.
---
More to come
## Instruction:
Add heroku hosted live demo
## Code After:
This little project tries to put together several JavaScript technologies
in order to learn a workflow for doing Test Driven Development (TDD).
The technologies used are the following:
* [NodeJS](https://github.com/nodejs/node)
* [ExpressJS](https://github.com/expressjs/express)
* [SuperTest](https://github.com/visionmedia/supertest)
* [Mocha](https://github.com/mochajs/mocha)
To run the tests simply `cd` into your project directory and run `npm test`.
To try the live demo please check <https://obscure-dawn-76650.herokuapp.com>.
---
More to come
|
This little project tries to put together several JavaScript technologies
in order to learn a workflow for doing Test Driven Development (TDD).
The technologies used are the following:
* [NodeJS](https://github.com/nodejs/node)
* [ExpressJS](https://github.com/expressjs/express)
* [SuperTest](https://github.com/visionmedia/supertest)
* [Mocha](https://github.com/mochajs/mocha)
To run the tests simply `cd` into your project directory and run `npm test`.
-
+ To try the live demo please check <https://obscure-dawn-76650.herokuapp.com>.
---
More to come | 2 | 0.133333 | 1 | 1 |
99c4c301710daa555bb95e4aa278d6a6a294678a | lib/AppleClient.php | lib/AppleClient.php | <?php
namespace Busuu\IosReceiptsApi;
use GuzzleHttp\Client;
class AppleClient
{
/** @var Client $client */
private $client;
/** @var string */
private $password;
public function __construct($password)
{
$this->client = new Client();
$this->password = $password;
}
/**
* Fetch the receipt from apple
*
* @param $receiptData
* @param $endpoint
* @return array
*/
public function fetchReceipt($receiptData, $endpoint)
{
try {
$data = [
'password' => $this->password,
'receipt-data' => $receiptData
];
$response = $this->client->post($endpoint, ['body' => json_encode($data)]);
return json_decode($response->getBody(), true);
} catch (\Exception $e) {
throw new \InvalidArgumentException(
sprintf('Error in the communication with Apple - %s', $e->getMessage())
);
}
}
}
| <?php
namespace Busuu\IosReceiptsApi;
use Exception;
use GuzzleHttp\Client;
class AppleClient
{
/** @var Client $client */
private $client;
/** @var string */
private $password;
public function __construct($password)
{
$this->client = new Client();
$this->password = $password;
}
/**
* Fetch the receipt from apple
*
* @param $receiptData
* @param $endpoint
*
* @return array
* @throws Exception
*/
public function fetchReceipt($receiptData, $endpoint)
{
$data = [
'password' => $this->password,
'receipt-data' => $receiptData
];
$response = $this->client->post($endpoint, [
'body' => json_encode($data),
'timeout' => 10
]);
$jsonResponse = json_decode($response->getBody(), true);
if (null !== $jsonResponse) {
return $jsonResponse;
}
throw new Exception(sprintf('Invalid Response from Apple Server: %s', $response));
}
}
| Add error checking on invalid json | Add error checking on invalid json
| PHP | mit | Busuu/ios-receipts-api | php | ## Code Before:
<?php
namespace Busuu\IosReceiptsApi;
use GuzzleHttp\Client;
class AppleClient
{
/** @var Client $client */
private $client;
/** @var string */
private $password;
public function __construct($password)
{
$this->client = new Client();
$this->password = $password;
}
/**
* Fetch the receipt from apple
*
* @param $receiptData
* @param $endpoint
* @return array
*/
public function fetchReceipt($receiptData, $endpoint)
{
try {
$data = [
'password' => $this->password,
'receipt-data' => $receiptData
];
$response = $this->client->post($endpoint, ['body' => json_encode($data)]);
return json_decode($response->getBody(), true);
} catch (\Exception $e) {
throw new \InvalidArgumentException(
sprintf('Error in the communication with Apple - %s', $e->getMessage())
);
}
}
}
## Instruction:
Add error checking on invalid json
## Code After:
<?php
namespace Busuu\IosReceiptsApi;
use Exception;
use GuzzleHttp\Client;
class AppleClient
{
/** @var Client $client */
private $client;
/** @var string */
private $password;
public function __construct($password)
{
$this->client = new Client();
$this->password = $password;
}
/**
* Fetch the receipt from apple
*
* @param $receiptData
* @param $endpoint
*
* @return array
* @throws Exception
*/
public function fetchReceipt($receiptData, $endpoint)
{
$data = [
'password' => $this->password,
'receipt-data' => $receiptData
];
$response = $this->client->post($endpoint, [
'body' => json_encode($data),
'timeout' => 10
]);
$jsonResponse = json_decode($response->getBody(), true);
if (null !== $jsonResponse) {
return $jsonResponse;
}
throw new Exception(sprintf('Invalid Response from Apple Server: %s', $response));
}
}
| <?php
namespace Busuu\IosReceiptsApi;
+ use Exception;
use GuzzleHttp\Client;
class AppleClient
{
/** @var Client $client */
private $client;
/** @var string */
private $password;
public function __construct($password)
{
$this->client = new Client();
$this->password = $password;
}
/**
* Fetch the receipt from apple
*
* @param $receiptData
* @param $endpoint
+ *
* @return array
+ * @throws Exception
*/
public function fetchReceipt($receiptData, $endpoint)
{
- try {
- $data = [
? ----
+ $data = [
- 'password' => $this->password,
? ----
+ 'password' => $this->password,
- 'receipt-data' => $receiptData
? ----
+ 'receipt-data' => $receiptData
- ];
? ----
+ ];
- $response = $this->client->post($endpoint, ['body' => json_encode($data)]);
+ $response = $this->client->post($endpoint, [
+ 'body' => json_encode($data),
+ 'timeout' => 10
+ ]);
- return json_decode($response->getBody(), true);
? ^^^^^^^^^
+ $jsonResponse = json_decode($response->getBody(), true);
? +++++++++++++ ^
+
+ if (null !== $jsonResponse) {
+ return $jsonResponse;
- } catch (\Exception $e) {
- throw new \InvalidArgumentException(
- sprintf('Error in the communication with Apple - %s', $e->getMessage())
- );
}
+
+ throw new Exception(sprintf('Invalid Response from Apple Server: %s', $response));
}
} | 28 | 0.636364 | 17 | 11 |
2112997ae8b2fcf7d752d173c4a727dc25f6efac | .travis.yml | .travis.yml | sudo: false
language: node_js
install:
- npm install -g yarn
- yarn self-update
- yarn install
before_script:
- npm run build
- ./index.js init
node_js:
- "7"
notifications:
email: false
webhooks: http://cq-dokidokivisual.rhcloud.com/travis
# blacklist
branches:
except:
- tmp
cache:
directories:
- node_modules
- $HOME/.yarn-cache
| sudo: false
language: node_js
install:
- npm install -g yarn
- yarn self-update
- yarn install
before_script:
- npm run build
- ./index.js init
node_js:
- "7"
notifications:
email: false
webhooks: http://cq-dokidokivisual.rhcloud.com/travis
# blacklist
branches:
except:
- tmp
cache:
yarn: true
directories:
- node_modules
| Enable TravisCI's builtin config for yarn | Enable TravisCI's builtin config for yarn
| YAML | mit | karen-irc/karen,karen-irc/karen | yaml | ## Code Before:
sudo: false
language: node_js
install:
- npm install -g yarn
- yarn self-update
- yarn install
before_script:
- npm run build
- ./index.js init
node_js:
- "7"
notifications:
email: false
webhooks: http://cq-dokidokivisual.rhcloud.com/travis
# blacklist
branches:
except:
- tmp
cache:
directories:
- node_modules
- $HOME/.yarn-cache
## Instruction:
Enable TravisCI's builtin config for yarn
## Code After:
sudo: false
language: node_js
install:
- npm install -g yarn
- yarn self-update
- yarn install
before_script:
- npm run build
- ./index.js init
node_js:
- "7"
notifications:
email: false
webhooks: http://cq-dokidokivisual.rhcloud.com/travis
# blacklist
branches:
except:
- tmp
cache:
yarn: true
directories:
- node_modules
| sudo: false
language: node_js
install:
- npm install -g yarn
- yarn self-update
- yarn install
before_script:
- npm run build
- ./index.js init
node_js:
- "7"
notifications:
email: false
webhooks: http://cq-dokidokivisual.rhcloud.com/travis
# blacklist
branches:
except:
- tmp
cache:
+ yarn: true
directories:
- node_modules
- - $HOME/.yarn-cache | 2 | 0.068966 | 1 | 1 |
122204a9f132359a6552b9bfe8a3c8f8c7236eef | atom/config.cson | atom/config.cson | "*":
editor:
fontFamily: "input"
fontSize: 13
showInvisibles: true
showIndentGuide: true
invisibles: {}
core:
themes: [
"one-dark-ui"
"facebook-syntax"
]
welcome:
showOnStartup: false
whitespace:
removeTrailingWhitespace: true
ignoreWhitespaceOnCurrentLine: false
ensureSingleTrailingNewline: true
"exception-reporting":
userId: "b6917109-8650-33d4-94c7-9edad015d73f"
linter: {}
"highlight-column": {}
"block-cursor":
primaryColor:
red: 195
green: 59
blue: 50
alpha: 1
"highlight-line":
hideHighlightOnSelect: true
| "*":
editor:
fontFamily: "input"
fontSize: 12
showInvisibles: true
showIndentGuide: true
invisibles: {}
core:
themes: [
"atom-material-ui"
"gotham-syntax"
]
welcome:
showOnStartup: false
whitespace:
removeTrailingWhitespace: true
ignoreWhitespaceOnCurrentLine: false
ensureSingleTrailingNewline: true
"exception-reporting":
userId: "b6917109-8650-33d4-94c7-9edad015d73f"
linter: {}
"highlight-column": {}
"block-cursor":
primaryColor:
red: 195
green: 59
blue: 50
alpha: 1
"highlight-line":
hideHighlightOnSelect: true
| Update atom theme and change font-size | Update atom theme and change font-size
| CoffeeScript | mit | therealechan/dotfiles,chankaward/dotfiles,chankaward/dotfiles,therealechan/dotfiles,therealechan/dotfiles,chankaward/dotfiles | coffeescript | ## Code Before:
"*":
editor:
fontFamily: "input"
fontSize: 13
showInvisibles: true
showIndentGuide: true
invisibles: {}
core:
themes: [
"one-dark-ui"
"facebook-syntax"
]
welcome:
showOnStartup: false
whitespace:
removeTrailingWhitespace: true
ignoreWhitespaceOnCurrentLine: false
ensureSingleTrailingNewline: true
"exception-reporting":
userId: "b6917109-8650-33d4-94c7-9edad015d73f"
linter: {}
"highlight-column": {}
"block-cursor":
primaryColor:
red: 195
green: 59
blue: 50
alpha: 1
"highlight-line":
hideHighlightOnSelect: true
## Instruction:
Update atom theme and change font-size
## Code After:
"*":
editor:
fontFamily: "input"
fontSize: 12
showInvisibles: true
showIndentGuide: true
invisibles: {}
core:
themes: [
"atom-material-ui"
"gotham-syntax"
]
welcome:
showOnStartup: false
whitespace:
removeTrailingWhitespace: true
ignoreWhitespaceOnCurrentLine: false
ensureSingleTrailingNewline: true
"exception-reporting":
userId: "b6917109-8650-33d4-94c7-9edad015d73f"
linter: {}
"highlight-column": {}
"block-cursor":
primaryColor:
red: 195
green: 59
blue: 50
alpha: 1
"highlight-line":
hideHighlightOnSelect: true
| "*":
editor:
fontFamily: "input"
- fontSize: 13
? ^
+ fontSize: 12
? ^
showInvisibles: true
showIndentGuide: true
invisibles: {}
core:
themes: [
- "one-dark-ui"
- "facebook-syntax"
+ "atom-material-ui"
+ "gotham-syntax"
]
welcome:
showOnStartup: false
whitespace:
removeTrailingWhitespace: true
ignoreWhitespaceOnCurrentLine: false
ensureSingleTrailingNewline: true
"exception-reporting":
userId: "b6917109-8650-33d4-94c7-9edad015d73f"
linter: {}
"highlight-column": {}
"block-cursor":
primaryColor:
red: 195
green: 59
blue: 50
alpha: 1
"highlight-line":
hideHighlightOnSelect: true | 6 | 0.2 | 3 | 3 |
13100b42c05a0f7c079b68cfceae28da3f1d7d36 | package.json | package.json | {
"name": "add-remove-replace",
"version": "0.1.1",
"description": "Simple package to add, remove or replace content inside strings.",
"main": ".lib/index.js",
"scripts": {
"build": "WEBPACK_ENV=build webpack",
"dev": "WEBPACK_ENV=dev webpack --progress --colors --watch",
"test": "jest"
},
"keywords": [
"add",
"remove",
"replace",
"string",
"array"
],
"author": "Gustavo Tonietto",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.24.0",
"babel-jest": "^19.0.0",
"babel-loader": "^6.4.1",
"babel-preset-es2015": "^6.24.0",
"babel-preset-flow": "^6.23.0",
"eslint": "^3.19.0",
"eslint-plugin-flowtype": "^2.30.4",
"jest": "^19.0.2",
"regenerator-runtime": "^0.10.3",
"webpack": "^2.3.2"
},
"dependencies": {
"replaceall": "^0.1.6"
}
}
| {
"name": "add-remove-replace",
"version": "0.1.1",
"description": "Simple package to add, remove or replace content inside strings.",
"main": ".lib/add-remove-replace.min.js",
"scripts": {
"build": "WEBPACK_ENV=build webpack",
"dev": "WEBPACK_ENV=dev webpack --progress --colors --watch",
"test": "jest"
},
"keywords": [
"add",
"remove",
"replace",
"string",
"array"
],
"author": "Gustavo Tonietto",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.24.0",
"babel-jest": "^19.0.0",
"babel-loader": "^6.4.1",
"babel-preset-es2015": "^6.24.0",
"babel-preset-flow": "^6.23.0",
"eslint": "^3.19.0",
"eslint-plugin-flowtype": "^2.30.4",
"jest": "^19.0.2",
"regenerator-runtime": "^0.10.3",
"webpack": "^2.3.2"
},
"dependencies": {
"replaceall": "^0.1.6"
}
}
| Merge tag '0.1.2' into dev | :twisted_rightwards_arrows: Merge tag '0.1.2' into dev
0.1.2
| JSON | mit | tonietto/add-remove-replace | json | ## Code Before:
{
"name": "add-remove-replace",
"version": "0.1.1",
"description": "Simple package to add, remove or replace content inside strings.",
"main": ".lib/index.js",
"scripts": {
"build": "WEBPACK_ENV=build webpack",
"dev": "WEBPACK_ENV=dev webpack --progress --colors --watch",
"test": "jest"
},
"keywords": [
"add",
"remove",
"replace",
"string",
"array"
],
"author": "Gustavo Tonietto",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.24.0",
"babel-jest": "^19.0.0",
"babel-loader": "^6.4.1",
"babel-preset-es2015": "^6.24.0",
"babel-preset-flow": "^6.23.0",
"eslint": "^3.19.0",
"eslint-plugin-flowtype": "^2.30.4",
"jest": "^19.0.2",
"regenerator-runtime": "^0.10.3",
"webpack": "^2.3.2"
},
"dependencies": {
"replaceall": "^0.1.6"
}
}
## Instruction:
:twisted_rightwards_arrows: Merge tag '0.1.2' into dev
0.1.2
## Code After:
{
"name": "add-remove-replace",
"version": "0.1.1",
"description": "Simple package to add, remove or replace content inside strings.",
"main": ".lib/add-remove-replace.min.js",
"scripts": {
"build": "WEBPACK_ENV=build webpack",
"dev": "WEBPACK_ENV=dev webpack --progress --colors --watch",
"test": "jest"
},
"keywords": [
"add",
"remove",
"replace",
"string",
"array"
],
"author": "Gustavo Tonietto",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.24.0",
"babel-jest": "^19.0.0",
"babel-loader": "^6.4.1",
"babel-preset-es2015": "^6.24.0",
"babel-preset-flow": "^6.23.0",
"eslint": "^3.19.0",
"eslint-plugin-flowtype": "^2.30.4",
"jest": "^19.0.2",
"regenerator-runtime": "^0.10.3",
"webpack": "^2.3.2"
},
"dependencies": {
"replaceall": "^0.1.6"
}
}
| {
"name": "add-remove-replace",
"version": "0.1.1",
"description": "Simple package to add, remove or replace content inside strings.",
- "main": ".lib/index.js",
+ "main": ".lib/add-remove-replace.min.js",
"scripts": {
"build": "WEBPACK_ENV=build webpack",
"dev": "WEBPACK_ENV=dev webpack --progress --colors --watch",
"test": "jest"
},
"keywords": [
"add",
"remove",
"replace",
"string",
"array"
],
"author": "Gustavo Tonietto",
"license": "MIT",
"devDependencies": {
"babel-core": "^6.24.0",
"babel-jest": "^19.0.0",
"babel-loader": "^6.4.1",
"babel-preset-es2015": "^6.24.0",
"babel-preset-flow": "^6.23.0",
"eslint": "^3.19.0",
"eslint-plugin-flowtype": "^2.30.4",
"jest": "^19.0.2",
"regenerator-runtime": "^0.10.3",
"webpack": "^2.3.2"
},
"dependencies": {
"replaceall": "^0.1.6"
}
} | 2 | 0.057143 | 1 | 1 |
200ee87d0bdc37d3b6db6b1c0df96c026b46be9f | handlers/main.yml | handlers/main.yml | ---
- name: restart supervisord
sudo: yes
service: name=supervisor state=restarted
- name: reread supervisord
sudo: yes
supervisorctl: reread
- name: update supervisord
sudo: yes
supervisorctl: update
| ---
- name: restart supervisord
sudo: yes
service: name=supervisor state=restarted
- name: reread supervisord
sudo: yes
command: supervisorctl reread
- name: update supervisord
sudo: yes
command: supervisorctl update
| Use command instead of supervisorctl module | Use command instead of supervisorctl module
`reread` and `update` are (now longer?) valid arguments for the `supervisorctl` module | YAML | mit | sledigabel/ansible-supervisord,zenoamaro/ansible-supervisord,haidai/ansible-supervisord,lciolecki/ansible.supervisord | yaml | ## Code Before:
---
- name: restart supervisord
sudo: yes
service: name=supervisor state=restarted
- name: reread supervisord
sudo: yes
supervisorctl: reread
- name: update supervisord
sudo: yes
supervisorctl: update
## Instruction:
Use command instead of supervisorctl module
`reread` and `update` are (now longer?) valid arguments for the `supervisorctl` module
## Code After:
---
- name: restart supervisord
sudo: yes
service: name=supervisor state=restarted
- name: reread supervisord
sudo: yes
command: supervisorctl reread
- name: update supervisord
sudo: yes
command: supervisorctl update
| ---
- name: restart supervisord
sudo: yes
service: name=supervisor state=restarted
- name: reread supervisord
sudo: yes
- supervisorctl: reread
? -
+ command: supervisorctl reread
? +++++++++
- name: update supervisord
sudo: yes
- supervisorctl: update
? -
+ command: supervisorctl update
? +++++++++
| 4 | 0.307692 | 2 | 2 |
ee104e6417b0fe06aaa82dd730cf14cd5fa93b72 | src/main/java/br/gov/servicos/foundation/http/Cookies.java | src/main/java/br/gov/servicos/foundation/http/Cookies.java | package br.gov.servicos.foundation.http;
import lombok.experimental.FieldDefaults;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import static java.util.Arrays.stream;
import static java.util.Optional.ofNullable;
import static lombok.AccessLevel.PRIVATE;
@Component
@FieldDefaults(level = PRIVATE, makeFinal = true)
class Cookies {
HttpServletRequest httpServletRequest;
@Autowired
Cookies(HttpServletRequest httpServletRequest) {
this.httpServletRequest = httpServletRequest;
}
public boolean isOn(String nome) {
return stream(ofNullable(httpServletRequest.getCookies()).orElse(new Cookie[0]))
.filter(c -> c.getName().equals(nome))
.filter(c -> c.getValue().equals("on"))
.findAny().isPresent();
}
}
| package br.gov.servicos.foundation.http;
import lombok.experimental.FieldDefaults;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import static java.util.Arrays.stream;
import static java.util.Optional.ofNullable;
import static lombok.AccessLevel.PRIVATE;
@Component
@FieldDefaults(level = PRIVATE, makeFinal = true)
class Cookies {
HttpServletRequest httpServletRequest;
@Autowired
Cookies(HttpServletRequest httpServletRequest) {
this.httpServletRequest = httpServletRequest;
}
public boolean isOn(String nome) {
return stream(ofNullable(httpServletRequest.getCookies()).orElse(new Cookie[0]))
.filter(c -> nome.equals(c.getName()))
.filter(c -> "on".equals(c.getValue()))
.findAny().isPresent();
}
}
| Resolve erro squid:S1132 no Sonar | Resolve erro squid:S1132 no Sonar
| Java | mit | rodrigomaia17/guia-de-servicos,servicosgoval/portal-de-servicos,servicosgoval/portal-de-servicos,rodrigomaia17/guia-de-servicos,servicosgoval/portal-de-servicos,servicosgovbr/portal-de-servicos,rodrigomaia17/guia-de-servicos,servicosgovbr/portal-de-servicos,servicosgoval/portal-de-servicos,servicosgoval/portal-de-servicos,rodrigomaia17/guia-de-servicos,servicosgoval/portal-de-servicos,servicosgovbr/portal-de-servicos,servicosgovbr/portal-de-servicos,rodrigomaia17/guia-de-servicos,servicosgovbr/portal-de-servicos,rodrigomaia17/guia-de-servicos | java | ## Code Before:
package br.gov.servicos.foundation.http;
import lombok.experimental.FieldDefaults;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import static java.util.Arrays.stream;
import static java.util.Optional.ofNullable;
import static lombok.AccessLevel.PRIVATE;
@Component
@FieldDefaults(level = PRIVATE, makeFinal = true)
class Cookies {
HttpServletRequest httpServletRequest;
@Autowired
Cookies(HttpServletRequest httpServletRequest) {
this.httpServletRequest = httpServletRequest;
}
public boolean isOn(String nome) {
return stream(ofNullable(httpServletRequest.getCookies()).orElse(new Cookie[0]))
.filter(c -> c.getName().equals(nome))
.filter(c -> c.getValue().equals("on"))
.findAny().isPresent();
}
}
## Instruction:
Resolve erro squid:S1132 no Sonar
## Code After:
package br.gov.servicos.foundation.http;
import lombok.experimental.FieldDefaults;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import static java.util.Arrays.stream;
import static java.util.Optional.ofNullable;
import static lombok.AccessLevel.PRIVATE;
@Component
@FieldDefaults(level = PRIVATE, makeFinal = true)
class Cookies {
HttpServletRequest httpServletRequest;
@Autowired
Cookies(HttpServletRequest httpServletRequest) {
this.httpServletRequest = httpServletRequest;
}
public boolean isOn(String nome) {
return stream(ofNullable(httpServletRequest.getCookies()).orElse(new Cookie[0]))
.filter(c -> nome.equals(c.getName()))
.filter(c -> "on".equals(c.getValue()))
.findAny().isPresent();
}
}
| package br.gov.servicos.foundation.http;
import lombok.experimental.FieldDefaults;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import static java.util.Arrays.stream;
import static java.util.Optional.ofNullable;
import static lombok.AccessLevel.PRIVATE;
@Component
@FieldDefaults(level = PRIVATE, makeFinal = true)
class Cookies {
HttpServletRequest httpServletRequest;
@Autowired
Cookies(HttpServletRequest httpServletRequest) {
this.httpServletRequest = httpServletRequest;
}
public boolean isOn(String nome) {
return stream(ofNullable(httpServletRequest.getCookies()).orElse(new Cookie[0]))
- .filter(c -> c.getName().equals(nome))
? ------------
+ .filter(c -> nome.equals(c.getName()))
? ++++++++++++
- .filter(c -> c.getValue().equals("on"))
? ------------
+ .filter(c -> "on".equals(c.getValue()))
? ++++++++++++
.findAny().isPresent();
}
} | 4 | 0.125 | 2 | 2 |
e17864ca523582621e4fbdf504bba2dd7ac7ec8e | .travis.yml | .travis.yml | language: python
sudo: false
dist: trusty
python:
- "2.7"
addons:
postgresql: "9.6"
services:
- postgresql
- docker
install:
- pip install tox==2.3.2
before_script:
- psql -c 'create database filmfest;' -U postgres
script:
- tox -e "py27-{sqlite,pg}"
before_deploy:
- sudo apt-get update
- sudo apt-get install docker-engine
deploy:
- provider: script
script: ./scripts/push_image.sh
on:
branch: master
- provider: script
script: ./scripts/deploy.sh
on:
branch: master
| language: python
sudo: false
dist: trusty
python:
- "2.7"
addons:
postgresql: "9.6"
services:
- postgresql
- docker
install:
- pip install tox==2.3.2
before_script:
- psql -c 'create database filmfest;' -U postgres
script:
- tox -e "py27-{sqlite,pg}"
before_deploy:
- sudo apt-get update
- sudo apt-get install docker-engine
- git fetch --unshallow
deploy:
- provider: script
script: ./scripts/push_image.sh
on:
branch: master
- provider: script
script: ./scripts/deploy.sh
on:
branch: master
| Add `git fetch --unshallow` to before_deploy in Travis | Add `git fetch --unshallow` to before_deploy in Travis
Travis downloads only 50 recent commits (which is known as shallow copy) by default:
```
git clone --depth=50 https://github.com/kinaklub/next.filmfest.by.git kinaklub/next.filmfest.by
```
It makes sense for PR checks because `clone` process is faster on big
repositories. However it can break one of the commands we use for
deployment:
```
git describe --tags
```
The command above expects to have at least one tag in the downloaded
commits to produce a version like `0.3` for tag 0.3 or
`0.3-273-gc479fe0` for an untagged revision with hash `gc479fe0` that
is 273 commits forward from tag `0.3`.
So let's try to unshallow (download the full history) the repository
if we are going to deploy this version to production.
An alternative approach for fixing this is to add parameter `--always`
to return just the commit hash if there are no tags in the recent
commits:
```
$ git describe --tags --always
c479fe0
```
| YAML | unlicense | kinaklub/next.filmfest.by,kinaklub/next.filmfest.by,nott/next.filmfest.by,nott/next.filmfest.by,kinaklub/next.filmfest.by,nott/next.filmfest.by,nott/next.filmfest.by,kinaklub/next.filmfest.by | yaml | ## Code Before:
language: python
sudo: false
dist: trusty
python:
- "2.7"
addons:
postgresql: "9.6"
services:
- postgresql
- docker
install:
- pip install tox==2.3.2
before_script:
- psql -c 'create database filmfest;' -U postgres
script:
- tox -e "py27-{sqlite,pg}"
before_deploy:
- sudo apt-get update
- sudo apt-get install docker-engine
deploy:
- provider: script
script: ./scripts/push_image.sh
on:
branch: master
- provider: script
script: ./scripts/deploy.sh
on:
branch: master
## Instruction:
Add `git fetch --unshallow` to before_deploy in Travis
Travis downloads only 50 recent commits (which is known as shallow copy) by default:
```
git clone --depth=50 https://github.com/kinaklub/next.filmfest.by.git kinaklub/next.filmfest.by
```
It makes sense for PR checks because `clone` process is faster on big
repositories. However it can break one of the commands we use for
deployment:
```
git describe --tags
```
The command above expects to have at least one tag in the downloaded
commits to produce a version like `0.3` for tag 0.3 or
`0.3-273-gc479fe0` for an untagged revision with hash `gc479fe0` that
is 273 commits forward from tag `0.3`.
So let's try to unshallow (download the full history) the repository
if we are going to deploy this version to production.
An alternative approach for fixing this is to add parameter `--always`
to return just the commit hash if there are no tags in the recent
commits:
```
$ git describe --tags --always
c479fe0
```
## Code After:
language: python
sudo: false
dist: trusty
python:
- "2.7"
addons:
postgresql: "9.6"
services:
- postgresql
- docker
install:
- pip install tox==2.3.2
before_script:
- psql -c 'create database filmfest;' -U postgres
script:
- tox -e "py27-{sqlite,pg}"
before_deploy:
- sudo apt-get update
- sudo apt-get install docker-engine
- git fetch --unshallow
deploy:
- provider: script
script: ./scripts/push_image.sh
on:
branch: master
- provider: script
script: ./scripts/deploy.sh
on:
branch: master
| language: python
sudo: false
dist: trusty
python:
- "2.7"
addons:
postgresql: "9.6"
services:
- postgresql
- docker
install:
- pip install tox==2.3.2
before_script:
- psql -c 'create database filmfest;' -U postgres
script:
- tox -e "py27-{sqlite,pg}"
before_deploy:
- sudo apt-get update
- sudo apt-get install docker-engine
+ - git fetch --unshallow
deploy:
- provider: script
script: ./scripts/push_image.sh
on:
branch: master
- provider: script
script: ./scripts/deploy.sh
on:
branch: master | 1 | 0.035714 | 1 | 0 |
f8e826a2e2e2bb2c347e64dfe17f1bffe8196c36 | README.md | README.md | gCn
===
globalCALCnet hub, bridges, and service-provider bridges
### What is globalCALCnet?
gCn is a method of connecting local-area CALCnet networks over the internet, as well as connecting calculators to internet services.
<iframe width="560" height="315" src="//www.youtube.com/embed/PfAL3FqnAY0" frameborder="0" allowfullscreen></iframe>
| gCn
===
globalCALCnet hub, bridges, and service-provider bridges
| Revert "Added a definition of gCn and embedded YT video." | Revert "Added a definition of gCn and embedded YT video."
This reverts commit eb02f5b182a44d9aa0dad8b7b5c1721642e129fd.
| Markdown | bsd-3-clause | KermMartian/gCn,KermMartian/gCn | markdown | ## Code Before:
gCn
===
globalCALCnet hub, bridges, and service-provider bridges
### What is globalCALCnet?
gCn is a method of connecting local-area CALCnet networks over the internet, as well as connecting calculators to internet services.
<iframe width="560" height="315" src="//www.youtube.com/embed/PfAL3FqnAY0" frameborder="0" allowfullscreen></iframe>
## Instruction:
Revert "Added a definition of gCn and embedded YT video."
This reverts commit eb02f5b182a44d9aa0dad8b7b5c1721642e129fd.
## Code After:
gCn
===
globalCALCnet hub, bridges, and service-provider bridges
| gCn
===
globalCALCnet hub, bridges, and service-provider bridges
-
- ### What is globalCALCnet?
-
- gCn is a method of connecting local-area CALCnet networks over the internet, as well as connecting calculators to internet services.
-
- <iframe width="560" height="315" src="//www.youtube.com/embed/PfAL3FqnAY0" frameborder="0" allowfullscreen></iframe> | 6 | 0.6 | 0 | 6 |
818631a83d5676ac21641938ff5db893f042a7bf | .codecov.yml | .codecov.yml | codecov:
branch: master
coverage:
precision: 2
round: down
range: "0...100" # 70...100
status:
project: true
patch: true
changes: false
ignore:
- "build/**/*"
- "e2e/**/*"
- "lib/src/vendor/*"
- "tests/**/*"
comment:
layout: "header, diff"
behavior: default
| codecov:
branch: master
coverage:
precision: 2
round: down
range: "0...100" # 70...100
status:
project: true
patch: true
changes: false
ignore:
- "build/**/*"
- "src/e2e/**/*"
- "src/gui-qml/**/*"
- "src/lib/src/vendor/*"
- "src/tests/**/*"
comment:
layout: "header, diff"
behavior: default
| Fix code coverage not ignoring folder following src move | Fix code coverage not ignoring folder following src move
| YAML | apache-2.0 | Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber,Bionus/imgbrd-grabber | yaml | ## Code Before:
codecov:
branch: master
coverage:
precision: 2
round: down
range: "0...100" # 70...100
status:
project: true
patch: true
changes: false
ignore:
- "build/**/*"
- "e2e/**/*"
- "lib/src/vendor/*"
- "tests/**/*"
comment:
layout: "header, diff"
behavior: default
## Instruction:
Fix code coverage not ignoring folder following src move
## Code After:
codecov:
branch: master
coverage:
precision: 2
round: down
range: "0...100" # 70...100
status:
project: true
patch: true
changes: false
ignore:
- "build/**/*"
- "src/e2e/**/*"
- "src/gui-qml/**/*"
- "src/lib/src/vendor/*"
- "src/tests/**/*"
comment:
layout: "header, diff"
behavior: default
| codecov:
branch: master
coverage:
precision: 2
round: down
range: "0...100" # 70...100
status:
project: true
patch: true
changes: false
ignore:
- "build/**/*"
- - "e2e/**/*"
+ - "src/e2e/**/*"
? ++++
+ - "src/gui-qml/**/*"
- - "lib/src/vendor/*"
+ - "src/lib/src/vendor/*"
? ++++
- - "tests/**/*"
+ - "src/tests/**/*"
? ++++
comment:
layout: "header, diff"
behavior: default | 7 | 0.318182 | 4 | 3 |
8cfe89b02bdfeedc0203cacdfe8908a93661df5c | views/components/Date.jsx | views/components/Date.jsx | 'use babel';
import React from 'react';
import Moment from 'moment';
export default class Date extends React.Component {
render() {
return <div className="date">
<div className="calendar">
<div className="day">{Moment().date()}</div>
<div className="my">
<div className="month">{Moment().format('MMM')}</div>
<div className="year">{Moment().year()}</div>
</div>
</div>
<div className="today">{Moment().format('dddd')}</div>
</div>;
}
}
| 'use babel';
import React from 'react';
import Moment from 'moment';
export default class Date extends React.Component {
constructor() {
super();
this.state = { day: '',
month: '',
year: '',
weekday: ''
};
}
componentWillMount() {
this.setDate();
}
componentDidMount() {
window.setInterval(function () {
if (this.state.day !== Moment.date()) {
this.setDate();
}
}.bind(this), 1000);
}
setDate() {
this.setState({
day: Moment().date(),
month: Moment().format('MMM'),
year: Moment().year(),
weekday: Moment().format('dddd')
});
}
render() {
return <div className="date">
<div className="calendar">
<div className="day">{this.state.day}</div>
<div className="my">
<div className="month">{this.state.month}</div>
<div className="year">{this.state.year}</div>
</div>
</div>
<div className="today">{this.state.weekday}</div>
</div>;
}
}
| Move date info to state | Move date info to state
| JSX | mit | jdebarochez/todometer,jdebarochez/todometer,cassidoo/todometer,cassidoo/todometer | jsx | ## Code Before:
'use babel';
import React from 'react';
import Moment from 'moment';
export default class Date extends React.Component {
render() {
return <div className="date">
<div className="calendar">
<div className="day">{Moment().date()}</div>
<div className="my">
<div className="month">{Moment().format('MMM')}</div>
<div className="year">{Moment().year()}</div>
</div>
</div>
<div className="today">{Moment().format('dddd')}</div>
</div>;
}
}
## Instruction:
Move date info to state
## Code After:
'use babel';
import React from 'react';
import Moment from 'moment';
export default class Date extends React.Component {
constructor() {
super();
this.state = { day: '',
month: '',
year: '',
weekday: ''
};
}
componentWillMount() {
this.setDate();
}
componentDidMount() {
window.setInterval(function () {
if (this.state.day !== Moment.date()) {
this.setDate();
}
}.bind(this), 1000);
}
setDate() {
this.setState({
day: Moment().date(),
month: Moment().format('MMM'),
year: Moment().year(),
weekday: Moment().format('dddd')
});
}
render() {
return <div className="date">
<div className="calendar">
<div className="day">{this.state.day}</div>
<div className="my">
<div className="month">{this.state.month}</div>
<div className="year">{this.state.year}</div>
</div>
</div>
<div className="today">{this.state.weekday}</div>
</div>;
}
}
| 'use babel';
import React from 'react';
import Moment from 'moment';
export default class Date extends React.Component {
+ constructor() {
+ super();
+ this.state = { day: '',
+ month: '',
+ year: '',
+ weekday: ''
+ };
+ }
+
+ componentWillMount() {
+ this.setDate();
+ }
+
+ componentDidMount() {
+ window.setInterval(function () {
+ if (this.state.day !== Moment.date()) {
+ this.setDate();
+ }
+ }.bind(this), 1000);
+ }
+
+ setDate() {
+ this.setState({
+ day: Moment().date(),
+ month: Moment().format('MMM'),
+ year: Moment().year(),
+ weekday: Moment().format('dddd')
+ });
+ }
+
render() {
return <div className="date">
<div className="calendar">
- <div className="day">{Moment().date()}</div>
? ^^^ ---- ^^^^
+ <div className="day">{this.state.day}</div>
? ^^^^^^^^^ ^
<div className="my">
- <div className="month">{Moment().format('MMM')}</div>
+ <div className="month">{this.state.month}</div>
- <div className="year">{Moment().year()}</div>
? ^^^ ---- --
+ <div className="year">{this.state.year}</div>
? ^^^^^^^^^
</div>
</div>
- <div className="today">{Moment().format('dddd')}</div>
+ <div className="today">{this.state.weekday}</div>
</div>;
}
} | 38 | 2 | 34 | 4 |
60695fe90747f9f7cda8493c0b9eb5ef488b0a77 | .travis/scripts/selenium.sh | .travis/scripts/selenium.sh |
wget "http://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.1.jar"
sudo mv selenium-server-standalone-3.3.1.jar /usr/bin/selenium.jar
wget "https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz"
sudo tar -zxvf geckodriver-v0.15.0-linux64.tar.gz
sudo mv geckodriver /usr/bin/geckodriver
echo "---> Launching Selenium-Server-Standalone..."
xvfb-run --server-args='-screen 0, 1024x768x16' java -Dwebdriver.gecko.driver=/usr/bin/geckodriver -jar /usr/bin/selenium.jar -port 4444 > /dev/null & |
wget "http://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.1.jar"
sudo mv selenium-server-standalone-3.3.1.jar /usr/bin/selenium.jar
wget "https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz"
mkdir geckodriver
tar -zxf geckodriver-v0.15.0-linux64.tar.gz -C geckodriver
export PATH=$PATH:$PWD/geckodriver
echo "---> Launching Selenium-Server-Standalone..."
xvfb-run --server-args='-screen 0, 1024x768x16' java -jar /usr/bin/selenium.jar -port 4444 > /dev/null & | Add geckodriver to PATH for Selenium tests on Travis-CI | Add geckodriver to PATH for Selenium tests on Travis-CI
| Shell | mit | dshorthouse/SimpleMappr,dshorthouse/SimpleMappr,dshorthouse/SimpleMappr,dshorthouse/SimpleMappr,dshorthouse/SimpleMappr | shell | ## Code Before:
wget "http://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.1.jar"
sudo mv selenium-server-standalone-3.3.1.jar /usr/bin/selenium.jar
wget "https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz"
sudo tar -zxvf geckodriver-v0.15.0-linux64.tar.gz
sudo mv geckodriver /usr/bin/geckodriver
echo "---> Launching Selenium-Server-Standalone..."
xvfb-run --server-args='-screen 0, 1024x768x16' java -Dwebdriver.gecko.driver=/usr/bin/geckodriver -jar /usr/bin/selenium.jar -port 4444 > /dev/null &
## Instruction:
Add geckodriver to PATH for Selenium tests on Travis-CI
## Code After:
wget "http://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.1.jar"
sudo mv selenium-server-standalone-3.3.1.jar /usr/bin/selenium.jar
wget "https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz"
mkdir geckodriver
tar -zxf geckodriver-v0.15.0-linux64.tar.gz -C geckodriver
export PATH=$PATH:$PWD/geckodriver
echo "---> Launching Selenium-Server-Standalone..."
xvfb-run --server-args='-screen 0, 1024x768x16' java -jar /usr/bin/selenium.jar -port 4444 > /dev/null & |
wget "http://selenium-release.storage.googleapis.com/3.3/selenium-server-standalone-3.3.1.jar"
sudo mv selenium-server-standalone-3.3.1.jar /usr/bin/selenium.jar
wget "https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-linux64.tar.gz"
+ mkdir geckodriver
- sudo tar -zxvf geckodriver-v0.15.0-linux64.tar.gz
? ----- -
+ tar -zxf geckodriver-v0.15.0-linux64.tar.gz -C geckodriver
? +++++++++++++++
- sudo mv geckodriver /usr/bin/geckodriver
+ export PATH=$PATH:$PWD/geckodriver
echo "---> Launching Selenium-Server-Standalone..."
- xvfb-run --server-args='-screen 0, 1024x768x16' java -Dwebdriver.gecko.driver=/usr/bin/geckodriver -jar /usr/bin/selenium.jar -port 4444 > /dev/null &
? ----------------------------------------------
+ xvfb-run --server-args='-screen 0, 1024x768x16' java -jar /usr/bin/selenium.jar -port 4444 > /dev/null & | 7 | 0.7 | 4 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.