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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3ed14bcd364d1843e35cd4a6d1bd48e06379c223 | linter.py | linter.py |
"""This module exports the Hlint plugin class."""
from SublimeLinter.lint import Linter
class Hlint(Linter):
"""Provides an interface to hlint."""
defaults = {
'selector': 'source.haskell'
}
cmd = 'hlint'
regex = (
r'^.+:(?P<line>\d+):'
'(?P<col>\d+):\s*'
'(?:(?P<error>Error)|(?P<warning>Warning)):\s*'
'(?P<message>.+)$'
)
multiline = True
tempfile_suffix = 'hs'
|
"""This module exports the Hlint plugin class."""
import json
from SublimeLinter.lint import Linter, LintMatch
class Hlint(Linter):
"""Provides an interface to hlint."""
cmd = 'hlint ${args} --json -'
defaults = {
'selector': 'source.haskell'
}
def find_errors(self, output):
# type: (str) -> Iterator[LintMatch]
errors = json.loads(output)
for error in errors:
message = "{hint}. Found: {from}".format(**error)
if error['to']:
message += " Perhaps: {to}".format(**error)
yield LintMatch(
error_type=error['severity'].lower(),
line=error['startLine'] - 1,
col=error['startColumn'] - 1,
message=message
)
| Use JSON to parse hlint output | Use JSON to parse hlint output
| Python | mit | SublimeLinter/SublimeLinter-hlint | python | ## Code Before:
"""This module exports the Hlint plugin class."""
from SublimeLinter.lint import Linter
class Hlint(Linter):
"""Provides an interface to hlint."""
defaults = {
'selector': 'source.haskell'
}
cmd = 'hlint'
regex = (
r'^.+:(?P<line>\d+):'
'(?P<col>\d+):\s*'
'(?:(?P<error>Error)|(?P<warning>Warning)):\s*'
'(?P<message>.+)$'
)
multiline = True
tempfile_suffix = 'hs'
## Instruction:
Use JSON to parse hlint output
## Code After:
"""This module exports the Hlint plugin class."""
import json
from SublimeLinter.lint import Linter, LintMatch
class Hlint(Linter):
"""Provides an interface to hlint."""
cmd = 'hlint ${args} --json -'
defaults = {
'selector': 'source.haskell'
}
def find_errors(self, output):
# type: (str) -> Iterator[LintMatch]
errors = json.loads(output)
for error in errors:
message = "{hint}. Found: {from}".format(**error)
if error['to']:
message += " Perhaps: {to}".format(**error)
yield LintMatch(
error_type=error['severity'].lower(),
line=error['startLine'] - 1,
col=error['startColumn'] - 1,
message=message
)
|
"""This module exports the Hlint plugin class."""
+ import json
- from SublimeLinter.lint import Linter
+ from SublimeLinter.lint import Linter, LintMatch
? +++++++++++
class Hlint(Linter):
"""Provides an interface to hlint."""
+ cmd = 'hlint ${args} --json -'
defaults = {
'selector': 'source.haskell'
}
- cmd = 'hlint'
- regex = (
- r'^.+:(?P<line>\d+):'
- '(?P<col>\d+):\s*'
- '(?:(?P<error>Error)|(?P<warning>Warning)):\s*'
- '(?P<message>.+)$'
- )
- multiline = True
- tempfile_suffix = 'hs'
+
+ def find_errors(self, output):
+ # type: (str) -> Iterator[LintMatch]
+ errors = json.loads(output)
+
+ for error in errors:
+ message = "{hint}. Found: {from}".format(**error)
+ if error['to']:
+ message += " Perhaps: {to}".format(**error)
+ yield LintMatch(
+ error_type=error['severity'].lower(),
+ line=error['startLine'] - 1,
+ col=error['startColumn'] - 1,
+ message=message
+ ) | 28 | 1.333333 | 18 | 10 |
6009eb8db158f13b54556ebba6f2e9ae6c763c64 | .travis.yml | .travis.yml | language: go
sudo: required
env:
global:
- ORACLE_FILE=oracle-xe-11.2.0-1.0.x86_64.rpm.zip
- ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
- ORACLE_SID=XE
- PKG_CONFIG_PATH="."
before_install:
- .travis/oracle/download.sh
- .travis/oracle/install.sh
- >
{ echo "Name: oci8"; echo "Description: Oracle Call Interface"; echo "Version: 11.1";
echo "Cflags: -I$ORACLE_HOME/rdbms/public";
echo "Libs: -L$ORACLE_HOME/lib -Wl,-rpath,$ORACLE_HOME/lib -lclntsh";
} | tee oci8.pc
| language: go
sudo: required
env:
global:
- ORACLE_FILE=oracle-xe-11.2.0-1.0.x86_64.rpm.zip
- ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
- ORACLE_SID=XE
- PKG_CONFIG_PATH="."
before_install:
- .travis/oracle/download.sh
- .travis/oracle/install.sh
- >
{ echo "Name: oci8"; echo "Description: Oracle Call Interface"; echo "Version: 11.1";
echo "Cflags: -I$ORACLE_HOME/rdbms/public";
echo "Libs: -L$ORACLE_HOME/lib -Wl,-rpath,$ORACLE_HOME/lib -lclntsh";
} | tee oci8.pc
before_script:
- >
{ echo "CREATE USER scott IDENTIFIED BY tiger;";
echo "GRANT CONNECT, RESOURCE to scott;";
} | "$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA
| Create and authorize the test user | Create and authorize the test user
| YAML | mit | mattn/go-oci8,mattn/go-oci8,mattn/go-oci8 | yaml | ## Code Before:
language: go
sudo: required
env:
global:
- ORACLE_FILE=oracle-xe-11.2.0-1.0.x86_64.rpm.zip
- ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
- ORACLE_SID=XE
- PKG_CONFIG_PATH="."
before_install:
- .travis/oracle/download.sh
- .travis/oracle/install.sh
- >
{ echo "Name: oci8"; echo "Description: Oracle Call Interface"; echo "Version: 11.1";
echo "Cflags: -I$ORACLE_HOME/rdbms/public";
echo "Libs: -L$ORACLE_HOME/lib -Wl,-rpath,$ORACLE_HOME/lib -lclntsh";
} | tee oci8.pc
## Instruction:
Create and authorize the test user
## Code After:
language: go
sudo: required
env:
global:
- ORACLE_FILE=oracle-xe-11.2.0-1.0.x86_64.rpm.zip
- ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
- ORACLE_SID=XE
- PKG_CONFIG_PATH="."
before_install:
- .travis/oracle/download.sh
- .travis/oracle/install.sh
- >
{ echo "Name: oci8"; echo "Description: Oracle Call Interface"; echo "Version: 11.1";
echo "Cflags: -I$ORACLE_HOME/rdbms/public";
echo "Libs: -L$ORACLE_HOME/lib -Wl,-rpath,$ORACLE_HOME/lib -lclntsh";
} | tee oci8.pc
before_script:
- >
{ echo "CREATE USER scott IDENTIFIED BY tiger;";
echo "GRANT CONNECT, RESOURCE to scott;";
} | "$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA
| language: go
sudo: required
env:
global:
- ORACLE_FILE=oracle-xe-11.2.0-1.0.x86_64.rpm.zip
- ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
- ORACLE_SID=XE
- PKG_CONFIG_PATH="."
before_install:
- .travis/oracle/download.sh
- .travis/oracle/install.sh
- >
{ echo "Name: oci8"; echo "Description: Oracle Call Interface"; echo "Version: 11.1";
echo "Cflags: -I$ORACLE_HOME/rdbms/public";
echo "Libs: -L$ORACLE_HOME/lib -Wl,-rpath,$ORACLE_HOME/lib -lclntsh";
} | tee oci8.pc
+
+ before_script:
+ - >
+ { echo "CREATE USER scott IDENTIFIED BY tiger;";
+ echo "GRANT CONNECT, RESOURCE to scott;";
+ } | "$ORACLE_HOME/bin/sqlplus" -L -S / AS SYSDBA | 6 | 0.333333 | 6 | 0 |
fcd899d7bc1d18513b1d9a9ee05d83b28218d19d | awx/ui/client/src/shared/rbacUiControl.js | awx/ui/client/src/shared/rbacUiControl.js | /*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
angular.module('rbacUiControl', [])
.service('rbacUiControlService', ['$q', 'GetBasePath', 'Rest', 'Wait', function($q, GetBasePath, Rest, Wait){
this.canAdd = function(apiPath) {
var canAddVal = $q.defer();
if (apiPath.indexOf("api/v1") > -1) {
Rest.setUrl(apiPath);
} else {
Rest.setUrl(GetBasePath(apiPath));
}
Wait("start");
Rest.options()
.success(function(data) {
if (data.actions.POST) {
canAddVal.resolve(true);
} else {
canAddVal.reject(false);
}
Wait("stop");
});
return canAddVal.promise;
};
}]);
| /*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
angular.module('rbacUiControl', [])
.service('rbacUiControlService', ['$q', 'GetBasePath', 'Rest', 'Wait', function($q, GetBasePath, Rest, Wait){
this.canAdd = function(apiPath) {
var canAddVal = $q.defer();
if (/api\/v[0-9]+\//.test(apiPath)) {
Rest.setUrl(apiPath);
} else {
Rest.setUrl(GetBasePath(apiPath));
}
Wait("start");
Rest.options()
.success(function(data) {
if (data.actions.POST) {
canAddVal.resolve(true);
} else {
canAddVal.reject(false);
}
Wait("stop");
});
return canAddVal.promise;
};
}]);
| Fix issue preventing inventory groups from loading | Fix issue preventing inventory groups from loading
A conditional was in place to check if a URL included the base path,
if so, it was supposed to use the URL as-is, otherwise it should get
the URL by referencing a property in an object containing default
URLs.
The conditional checked only for 'api/v1'. Since we're at v2, the
check failed eventually resulting in a `replace` call on an
undefined value. I replaced the conditional to pattern match
api/v*/ instead.
| JavaScript | apache-2.0 | snahelou/awx,wwitzel3/awx,snahelou/awx,snahelou/awx,wwitzel3/awx,wwitzel3/awx,wwitzel3/awx,snahelou/awx | javascript | ## Code Before:
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
angular.module('rbacUiControl', [])
.service('rbacUiControlService', ['$q', 'GetBasePath', 'Rest', 'Wait', function($q, GetBasePath, Rest, Wait){
this.canAdd = function(apiPath) {
var canAddVal = $q.defer();
if (apiPath.indexOf("api/v1") > -1) {
Rest.setUrl(apiPath);
} else {
Rest.setUrl(GetBasePath(apiPath));
}
Wait("start");
Rest.options()
.success(function(data) {
if (data.actions.POST) {
canAddVal.resolve(true);
} else {
canAddVal.reject(false);
}
Wait("stop");
});
return canAddVal.promise;
};
}]);
## Instruction:
Fix issue preventing inventory groups from loading
A conditional was in place to check if a URL included the base path,
if so, it was supposed to use the URL as-is, otherwise it should get
the URL by referencing a property in an object containing default
URLs.
The conditional checked only for 'api/v1'. Since we're at v2, the
check failed eventually resulting in a `replace` call on an
undefined value. I replaced the conditional to pattern match
api/v*/ instead.
## Code After:
/*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
angular.module('rbacUiControl', [])
.service('rbacUiControlService', ['$q', 'GetBasePath', 'Rest', 'Wait', function($q, GetBasePath, Rest, Wait){
this.canAdd = function(apiPath) {
var canAddVal = $q.defer();
if (/api\/v[0-9]+\//.test(apiPath)) {
Rest.setUrl(apiPath);
} else {
Rest.setUrl(GetBasePath(apiPath));
}
Wait("start");
Rest.options()
.success(function(data) {
if (data.actions.POST) {
canAddVal.resolve(true);
} else {
canAddVal.reject(false);
}
Wait("stop");
});
return canAddVal.promise;
};
}]);
| /*************************************************
* Copyright (c) 2015 Ansible, Inc.
*
* All Rights Reserved
*************************************************/
export default
angular.module('rbacUiControl', [])
.service('rbacUiControlService', ['$q', 'GetBasePath', 'Rest', 'Wait', function($q, GetBasePath, Rest, Wait){
this.canAdd = function(apiPath) {
var canAddVal = $q.defer();
- if (apiPath.indexOf("api/v1") > -1) {
+ if (/api\/v[0-9]+\//.test(apiPath)) {
Rest.setUrl(apiPath);
} else {
Rest.setUrl(GetBasePath(apiPath));
}
Wait("start");
Rest.options()
.success(function(data) {
if (data.actions.POST) {
canAddVal.resolve(true);
} else {
canAddVal.reject(false);
}
Wait("stop");
});
return canAddVal.promise;
};
}]); | 2 | 0.0625 | 1 | 1 |
0a9aed9427b0b36d71a2e8fee74db74690727b15 | hardware/gpio/LEDblink_gpiozero.py | hardware/gpio/LEDblink_gpiozero.py | from gpiozero import LED
import time
# GPIO 24 ... LED ... 470 ohm resistor ... GND
led = LED(24)
try:
led.blink()
time.sleep(20)
except KeyboardInterrupt:
led.off()
| from gpiozero import LED
import time
# GPIO 24 ... LED ... 470 ohm resistor ... GND
led = LED(24)
try:
led.blink()
time.sleep(20)
except KeyboardInterrupt:
led.off()
print "done"
| Print message on completion, to aid debugging | Print message on completion, to aid debugging | Python | mit | claremacrae/raspi_code,claremacrae/raspi_code,claremacrae/raspi_code | python | ## Code Before:
from gpiozero import LED
import time
# GPIO 24 ... LED ... 470 ohm resistor ... GND
led = LED(24)
try:
led.blink()
time.sleep(20)
except KeyboardInterrupt:
led.off()
## Instruction:
Print message on completion, to aid debugging
## Code After:
from gpiozero import LED
import time
# GPIO 24 ... LED ... 470 ohm resistor ... GND
led = LED(24)
try:
led.blink()
time.sleep(20)
except KeyboardInterrupt:
led.off()
print "done"
| from gpiozero import LED
import time
# GPIO 24 ... LED ... 470 ohm resistor ... GND
led = LED(24)
try:
led.blink()
time.sleep(20)
except KeyboardInterrupt:
led.off()
-
+ print "done" | 2 | 0.166667 | 1 | 1 |
907cdbda7e94dda158620f14270837d723ca8210 | .kitchen.yml | .kitchen.yml | ---
driver:
name: vagrant
provisioner:
name: chef_zero_scheduled_task
platforms:
- name: centos-6.7
provisioner:
require_chef_omnibus: true
chef_omnibus_url: 'http://repo-par.criteo.prod/omnibus_install.sh'
driver_config:
box: opscode-centos-6.7
box_url: http://filer.criteo.prod/boxes/opscode_centos-6.7.box
- name: windows-2012r2
driver_config:
# Enable provision for custom omnibus
communicator: winrm
customize:
vrde: 'on'
vrdeport: '5000-5100'
vrdeauthtype: 'null'
box: windows-2012r2-standard-chef-12_4_1
box_url: http://filer.criteo.prod/boxes/windows-2012r2-standard-chef-12_4_1.box
suites:
- name: default
run_list:
- recipe[test]
| ---
driver:
name: vagrant
provisioner:
name: chef_zero_scheduled_task
platforms:
- name: centos-6.7
provisioner:
require_chef_omnibus: true
chef_omnibus_url: 'http://repo-par.criteo.prod/omnibus_install.sh'
driver_config:
box: opscode-centos-6.7
box_url: http://filer.criteo.prod/boxes/opscode_centos-6.7.box
suites:
- name: default
run_list:
- recipe[test]
| Remove windows box from tests | [RevertMe] Remove windows box from tests
We don't have a windows box with 12.5.1. This is required to require
chef/event_ditpach/dsl
| YAML | apache-2.0 | criteo-cookbooks/choregraphie | yaml | ## Code Before:
---
driver:
name: vagrant
provisioner:
name: chef_zero_scheduled_task
platforms:
- name: centos-6.7
provisioner:
require_chef_omnibus: true
chef_omnibus_url: 'http://repo-par.criteo.prod/omnibus_install.sh'
driver_config:
box: opscode-centos-6.7
box_url: http://filer.criteo.prod/boxes/opscode_centos-6.7.box
- name: windows-2012r2
driver_config:
# Enable provision for custom omnibus
communicator: winrm
customize:
vrde: 'on'
vrdeport: '5000-5100'
vrdeauthtype: 'null'
box: windows-2012r2-standard-chef-12_4_1
box_url: http://filer.criteo.prod/boxes/windows-2012r2-standard-chef-12_4_1.box
suites:
- name: default
run_list:
- recipe[test]
## Instruction:
[RevertMe] Remove windows box from tests
We don't have a windows box with 12.5.1. This is required to require
chef/event_ditpach/dsl
## Code After:
---
driver:
name: vagrant
provisioner:
name: chef_zero_scheduled_task
platforms:
- name: centos-6.7
provisioner:
require_chef_omnibus: true
chef_omnibus_url: 'http://repo-par.criteo.prod/omnibus_install.sh'
driver_config:
box: opscode-centos-6.7
box_url: http://filer.criteo.prod/boxes/opscode_centos-6.7.box
suites:
- name: default
run_list:
- recipe[test]
| ---
driver:
name: vagrant
provisioner:
name: chef_zero_scheduled_task
platforms:
- name: centos-6.7
provisioner:
require_chef_omnibus: true
chef_omnibus_url: 'http://repo-par.criteo.prod/omnibus_install.sh'
driver_config:
box: opscode-centos-6.7
box_url: http://filer.criteo.prod/boxes/opscode_centos-6.7.box
- - name: windows-2012r2
- driver_config:
- # Enable provision for custom omnibus
- communicator: winrm
- customize:
- vrde: 'on'
- vrdeport: '5000-5100'
- vrdeauthtype: 'null'
- box: windows-2012r2-standard-chef-12_4_1
- box_url: http://filer.criteo.prod/boxes/windows-2012r2-standard-chef-12_4_1.box
suites:
- name: default
run_list:
- recipe[test] | 10 | 0.344828 | 0 | 10 |
336af3e15f4f52e2261df58ff4abf29933d0de87 | src/main/java/org/apache/hadoop/hbase/client/AbstractHbaseClient.java | src/main/java/org/apache/hadoop/hbase/client/AbstractHbaseClient.java | package org.apache.hadoop.hbase.client;
/**
* Abstract class necessary to access protected parameters
*/
public abstract class AbstractHbaseClient {
protected final String clusterId;
/**
* Constructor
*
* @param connection to use for connection
*/
public AbstractHbaseClient(HConnection connection) {
this.clusterId = ((HConnectionManager.HConnectionImplementation) connection).clusterId;
}
} | package org.apache.hadoop.hbase.client;
/**
* Abstract class necessary to access protected parameters
*/
public abstract class AbstractHbaseClient {
protected final String clusterId;
private final HConnection connection;
/**
* Constructor
*
* @param connection to use for connection
*/
public AbstractHbaseClient(HConnection connection) {
this.connection = connection;
this.clusterId = ((HConnectionManager.HConnectionImplementation) connection).clusterId;
}
/**
* Get HConnection to talk to master/cluster
*
* @return HConnection
*/
public HConnection getConnection() {
return connection;
}
} | Add method to get Connection from HbaseClient | Add method to get Connection from HbaseClient
| Java | apache-2.0 | jurmous/async-hbase-client | java | ## Code Before:
package org.apache.hadoop.hbase.client;
/**
* Abstract class necessary to access protected parameters
*/
public abstract class AbstractHbaseClient {
protected final String clusterId;
/**
* Constructor
*
* @param connection to use for connection
*/
public AbstractHbaseClient(HConnection connection) {
this.clusterId = ((HConnectionManager.HConnectionImplementation) connection).clusterId;
}
}
## Instruction:
Add method to get Connection from HbaseClient
## Code After:
package org.apache.hadoop.hbase.client;
/**
* Abstract class necessary to access protected parameters
*/
public abstract class AbstractHbaseClient {
protected final String clusterId;
private final HConnection connection;
/**
* Constructor
*
* @param connection to use for connection
*/
public AbstractHbaseClient(HConnection connection) {
this.connection = connection;
this.clusterId = ((HConnectionManager.HConnectionImplementation) connection).clusterId;
}
/**
* Get HConnection to talk to master/cluster
*
* @return HConnection
*/
public HConnection getConnection() {
return connection;
}
} | package org.apache.hadoop.hbase.client;
/**
* Abstract class necessary to access protected parameters
*/
public abstract class AbstractHbaseClient {
protected final String clusterId;
+ private final HConnection connection;
/**
* Constructor
*
* @param connection to use for connection
*/
public AbstractHbaseClient(HConnection connection) {
+ this.connection = connection;
this.clusterId = ((HConnectionManager.HConnectionImplementation) connection).clusterId;
}
+
+ /**
+ * Get HConnection to talk to master/cluster
+ *
+ * @return HConnection
+ */
+ public HConnection getConnection() {
+ return connection;
+ }
} | 11 | 0.647059 | 11 | 0 |
98c568cd129356889dd0431c75055d506a02ccea | app/assets/javascripts/identifier-form.js | app/assets/javascripts/identifier-form.js | (function() {
$('.assignment_invitations.identifier, .group_assignment_invitations.identifier').ready(function() {
return $('form').on('change keyup', function() {
return $('.js-form-submit').prop('disabled', $('#student_identifier_value').val().length === 0);
});
});
}).call(this);
| (function() {
$('.assignment_invitations.identifier, .group_assignment_invitations.identifier').ready(function() {
return $('form').on('change keyup', function() {
if ($('#student_identifier_value').val() !== undefined) {
return $('.js-form-submit').prop('disabled', $('#student_identifier_value').val().length === 0);
}
});
});
}).call(this);
| Make sure value is defined before trying to call length | Make sure value is defined before trying to call length
| JavaScript | mit | BelieveC/classroom,BelieveC/classroom,BelieveC/classroom,BelieveC/classroom | javascript | ## Code Before:
(function() {
$('.assignment_invitations.identifier, .group_assignment_invitations.identifier').ready(function() {
return $('form').on('change keyup', function() {
return $('.js-form-submit').prop('disabled', $('#student_identifier_value').val().length === 0);
});
});
}).call(this);
## Instruction:
Make sure value is defined before trying to call length
## Code After:
(function() {
$('.assignment_invitations.identifier, .group_assignment_invitations.identifier').ready(function() {
return $('form').on('change keyup', function() {
if ($('#student_identifier_value').val() !== undefined) {
return $('.js-form-submit').prop('disabled', $('#student_identifier_value').val().length === 0);
}
});
});
}).call(this);
| (function() {
$('.assignment_invitations.identifier, .group_assignment_invitations.identifier').ready(function() {
return $('form').on('change keyup', function() {
+ if ($('#student_identifier_value').val() !== undefined) {
- return $('.js-form-submit').prop('disabled', $('#student_identifier_value').val().length === 0);
+ return $('.js-form-submit').prop('disabled', $('#student_identifier_value').val().length === 0);
? ++
+ }
});
});
}).call(this); | 4 | 0.571429 | 3 | 1 |
c089c5c85ff7f37585350bfe1fd6aaff829f27ec | .travis.yml | .travis.yml | sudo: true
dist: trusty
language: node_js
node_js:
- '6'
before_script:
- npm install -g bower
- yarn
- bower install
script: gulp test
cache:
directories:
- node_modules
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
| sudo: true
dist: trusty
language: node_js
node_js:
- '6'
before_script:
- npm install -g bower web-component-tester
- yarn
- bower install
- gulp build:tests
script: xvfb-run wct
cache:
directories:
- node_modules
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
| Use xvfb / global wct | Use xvfb / global wct
| YAML | mit | simplaio/simpla-text,simplaio/simpla-text,SimplaElements/simpla-text,SimplaElements/simpla-text | yaml | ## Code Before:
sudo: true
dist: trusty
language: node_js
node_js:
- '6'
before_script:
- npm install -g bower
- yarn
- bower install
script: gulp test
cache:
directories:
- node_modules
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
## Instruction:
Use xvfb / global wct
## Code After:
sudo: true
dist: trusty
language: node_js
node_js:
- '6'
before_script:
- npm install -g bower web-component-tester
- yarn
- bower install
- gulp build:tests
script: xvfb-run wct
cache:
directories:
- node_modules
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
| sudo: true
dist: trusty
language: node_js
node_js:
- - '6'
+ - '6'
? ++
before_script:
- - npm install -g bower
+ - npm install -g bower web-component-tester
- - yarn
+ - yarn
? ++
- - bower install
+ - bower install
? ++
- script: gulp test
+ - gulp build:tests
+ script: xvfb-run wct
cache:
directories:
- - node_modules
+ - node_modules
? ++
addons:
firefox: latest
apt:
sources:
- google-chrome
packages:
- google-chrome-stable | 13 | 0.65 | 7 | 6 |
e2497df1499f4a99e4e44cf5cfd8a143e86b762b | package.json | package.json | {
"name": "node-dev",
"homepage": "http://github.com/fgnass/node-dev",
"author": {
"name": "Felix Gnass",
"email": "felix.gnass@neteye.de",
"url": "http://fgnass.posterous.com"
},
"bin": {
"node-dev": "./node-dev"
},
"preferGlobal": true,
"repository": {
"type": "git",
"url" : "http://github.com/fgnass/node-dev.git"
},
"description": "Node.js supervisor with desktop notifications",
"keywords": ["supervisor", "restart", "reload", "auto-reload"],
"version": "0.1.6"
}
| {
"name": "node-dev",
"homepage": "http://github.com/fgnass/node-dev",
"author": {
"name": "Felix Gnass",
"email": "felix.gnass@neteye.de",
"url": "http://fgnass.posterous.com"
},
"contributors": [{
"name": "Aseem Kishore",
"email": "aseem.kishore@gmail.com",
"url": "http://aseemk.com"
}],
"bin": {
"node-dev": "./node-dev"
},
"preferGlobal": true,
"repository": {
"type": "git",
"url" : "http://github.com/fgnass/node-dev.git"
},
"description": "Node.js supervisor with desktop notifications",
"keywords": ["supervisor", "restart", "reload", "auto-reload"],
"version": "0.1.6"
}
| Add myself as a contributor. | Add myself as a contributor.
| JSON | mit | fgnass/node-dev,fgnass/node-dev,SwoopCMI/node-dev,shinygang/node-dev,Casear/node-dev,jiyinyiyong/node-dev,whitecolor/ts-node-dev,fgnass/node-dev,whitecolor/ts-node-dev | json | ## Code Before:
{
"name": "node-dev",
"homepage": "http://github.com/fgnass/node-dev",
"author": {
"name": "Felix Gnass",
"email": "felix.gnass@neteye.de",
"url": "http://fgnass.posterous.com"
},
"bin": {
"node-dev": "./node-dev"
},
"preferGlobal": true,
"repository": {
"type": "git",
"url" : "http://github.com/fgnass/node-dev.git"
},
"description": "Node.js supervisor with desktop notifications",
"keywords": ["supervisor", "restart", "reload", "auto-reload"],
"version": "0.1.6"
}
## Instruction:
Add myself as a contributor.
## Code After:
{
"name": "node-dev",
"homepage": "http://github.com/fgnass/node-dev",
"author": {
"name": "Felix Gnass",
"email": "felix.gnass@neteye.de",
"url": "http://fgnass.posterous.com"
},
"contributors": [{
"name": "Aseem Kishore",
"email": "aseem.kishore@gmail.com",
"url": "http://aseemk.com"
}],
"bin": {
"node-dev": "./node-dev"
},
"preferGlobal": true,
"repository": {
"type": "git",
"url" : "http://github.com/fgnass/node-dev.git"
},
"description": "Node.js supervisor with desktop notifications",
"keywords": ["supervisor", "restart", "reload", "auto-reload"],
"version": "0.1.6"
}
| {
"name": "node-dev",
"homepage": "http://github.com/fgnass/node-dev",
"author": {
"name": "Felix Gnass",
"email": "felix.gnass@neteye.de",
"url": "http://fgnass.posterous.com"
},
+ "contributors": [{
+ "name": "Aseem Kishore",
+ "email": "aseem.kishore@gmail.com",
+ "url": "http://aseemk.com"
+ }],
"bin": {
"node-dev": "./node-dev"
},
"preferGlobal": true,
"repository": {
"type": "git",
"url" : "http://github.com/fgnass/node-dev.git"
},
"description": "Node.js supervisor with desktop notifications",
"keywords": ["supervisor", "restart", "reload", "auto-reload"],
"version": "0.1.6"
} | 5 | 0.25 | 5 | 0 |
4c33e921d8ad6d1a69b0d198e8ea71b64339973a | us_ignite/common/tests/context_processors_tests.py | us_ignite/common/tests/context_processors_tests.py | from nose.tools import eq_
from django.test import TestCase
from us_ignite.common.tests import utils
from us_ignite.common import context_processors
class TestSettingsAvailableContextProcessor(TestCase):
def test_settings_are_available(self):
request = utils.get_request('get', '/')
context = context_processors.settings_available(request)
eq_(sorted(context.keys()),
sorted(['SITE_URL', 'IS_PRODUCTION', 'ACCOUNT_ACTIVATION_DAYS']))
| from nose.tools import eq_
from django.test import TestCase
from us_ignite.common.tests import utils
from us_ignite.common import context_processors
class TestSettingsAvailableContextProcessor(TestCase):
def test_settings_are_available(self):
request = utils.get_request('get', '/')
context = context_processors.settings_available(request)
eq_(sorted(context.keys()),
sorted(['ACCOUNT_ACTIVATION_DAYS', 'GOOGLE_ANALYTICS_ID',
'IS_PRODUCTION', 'SITE_URL']))
| Update common context processors tests. | Update common context processors tests.
| Python | bsd-3-clause | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | python | ## Code Before:
from nose.tools import eq_
from django.test import TestCase
from us_ignite.common.tests import utils
from us_ignite.common import context_processors
class TestSettingsAvailableContextProcessor(TestCase):
def test_settings_are_available(self):
request = utils.get_request('get', '/')
context = context_processors.settings_available(request)
eq_(sorted(context.keys()),
sorted(['SITE_URL', 'IS_PRODUCTION', 'ACCOUNT_ACTIVATION_DAYS']))
## Instruction:
Update common context processors tests.
## Code After:
from nose.tools import eq_
from django.test import TestCase
from us_ignite.common.tests import utils
from us_ignite.common import context_processors
class TestSettingsAvailableContextProcessor(TestCase):
def test_settings_are_available(self):
request = utils.get_request('get', '/')
context = context_processors.settings_available(request)
eq_(sorted(context.keys()),
sorted(['ACCOUNT_ACTIVATION_DAYS', 'GOOGLE_ANALYTICS_ID',
'IS_PRODUCTION', 'SITE_URL']))
| from nose.tools import eq_
from django.test import TestCase
from us_ignite.common.tests import utils
from us_ignite.common import context_processors
class TestSettingsAvailableContextProcessor(TestCase):
def test_settings_are_available(self):
request = utils.get_request('get', '/')
context = context_processors.settings_available(request)
eq_(sorted(context.keys()),
- sorted(['SITE_URL', 'IS_PRODUCTION', 'ACCOUNT_ACTIVATION_DAYS']))
+ sorted(['ACCOUNT_ACTIVATION_DAYS', 'GOOGLE_ANALYTICS_ID',
+ 'IS_PRODUCTION', 'SITE_URL'])) | 3 | 0.2 | 2 | 1 |
33bd5d7858a0e1a9b15dbb0687fa166dad5203a1 | bin/seed-prod.sh | bin/seed-prod.sh | export MIX_ENV=prod
set -x
export DATABASE_URL=`heroku config:get DATABASE_URL`
export OLD_DATABASE_URL=`heroku config:get DATABASE_URL --app critter4us`
export POOL_SIZE=3
mix compile
mix ecto.migrate
mix run priv/repo/1-seed-non-users.exs # --verbosity=verbose
mix run priv/repo/2-seed-secret-users.exs
# Don't want users with github-visible passwords in the database
# mix run priv/repo/3-seed-test-users.exs
| echo "This modifies ***PRODUCTION***. Do you want to continue?"
read -n 1 response
if [ "$response" != "y" ]; then
exit 1
fi
export MIX_ENV=prod
set -x
export DATABASE_URL=`heroku config:get DATABASE_URL`
export OLD_DATABASE_URL=`heroku config:get DATABASE_URL --app critter4us`
export POOL_SIZE=1
mix compile
mix ecto.migrate
mix run priv/repo/1-seed-non-users.exs # --verbosity=verbose
mix run priv/repo/2-seed-secret-users.exs
# Don't want users with github-visible passwords in the database
# mix run priv/repo/3-seed-test-users.exs
| Drop pool size down AGAIN | Drop pool size down AGAIN | Shell | mit | marick/eecrit,marick/eecrit,marick/eecrit | shell | ## Code Before:
export MIX_ENV=prod
set -x
export DATABASE_URL=`heroku config:get DATABASE_URL`
export OLD_DATABASE_URL=`heroku config:get DATABASE_URL --app critter4us`
export POOL_SIZE=3
mix compile
mix ecto.migrate
mix run priv/repo/1-seed-non-users.exs # --verbosity=verbose
mix run priv/repo/2-seed-secret-users.exs
# Don't want users with github-visible passwords in the database
# mix run priv/repo/3-seed-test-users.exs
## Instruction:
Drop pool size down AGAIN
## Code After:
echo "This modifies ***PRODUCTION***. Do you want to continue?"
read -n 1 response
if [ "$response" != "y" ]; then
exit 1
fi
export MIX_ENV=prod
set -x
export DATABASE_URL=`heroku config:get DATABASE_URL`
export OLD_DATABASE_URL=`heroku config:get DATABASE_URL --app critter4us`
export POOL_SIZE=1
mix compile
mix ecto.migrate
mix run priv/repo/1-seed-non-users.exs # --verbosity=verbose
mix run priv/repo/2-seed-secret-users.exs
# Don't want users with github-visible passwords in the database
# mix run priv/repo/3-seed-test-users.exs
| + echo "This modifies ***PRODUCTION***. Do you want to continue?"
+ read -n 1 response
+ if [ "$response" != "y" ]; then
+ exit 1
+ fi
+
+
+
+
export MIX_ENV=prod
set -x
export DATABASE_URL=`heroku config:get DATABASE_URL`
export OLD_DATABASE_URL=`heroku config:get DATABASE_URL --app critter4us`
- export POOL_SIZE=3
? ^
+ export POOL_SIZE=1
? ^
mix compile
mix ecto.migrate
mix run priv/repo/1-seed-non-users.exs # --verbosity=verbose
mix run priv/repo/2-seed-secret-users.exs
# Don't want users with github-visible passwords in the database
# mix run priv/repo/3-seed-test-users.exs | 11 | 0.846154 | 10 | 1 |
840a157d7c99500c0ca9435821131eab79b395aa | src/app.js | src/app.js | const webViewElement = document.querySelector('.messages-iframe');
webViewElement.addEventListener('new-window', (e) => {
require('electron').shell.openExternal(e.url);
})
window.addEventListener('focus', () => webViewElement.focus());
| const webViewElement = document.querySelector('.messages-iframe');
webViewElement.addEventListener('new-window', (e) => {
require('electron').shell.openExternal(e.url);
})
window.addEventListener('focus', () => webViewElement.focus());
window.addEventListener('blur', () => webViewElement.blur());
| Remove webview focus when parent window loses focus | Remove webview focus when parent window loses focus
This fixes desktop push notifications when the app is not active.
| JavaScript | mit | Faithlife/FaithlifeMessages | javascript | ## Code Before:
const webViewElement = document.querySelector('.messages-iframe');
webViewElement.addEventListener('new-window', (e) => {
require('electron').shell.openExternal(e.url);
})
window.addEventListener('focus', () => webViewElement.focus());
## Instruction:
Remove webview focus when parent window loses focus
This fixes desktop push notifications when the app is not active.
## Code After:
const webViewElement = document.querySelector('.messages-iframe');
webViewElement.addEventListener('new-window', (e) => {
require('electron').shell.openExternal(e.url);
})
window.addEventListener('focus', () => webViewElement.focus());
window.addEventListener('blur', () => webViewElement.blur());
| const webViewElement = document.querySelector('.messages-iframe');
webViewElement.addEventListener('new-window', (e) => {
require('electron').shell.openExternal(e.url);
})
window.addEventListener('focus', () => webViewElement.focus());
+ window.addEventListener('blur', () => webViewElement.blur()); | 1 | 0.142857 | 1 | 0 |
20654d833deb332dbbe683e6d4e38cef1cc58dd3 | webcomix/tests/test_comic_availability.py | webcomix/tests/test_comic_availability.py | import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
first_pages = Comic.verify_xpath(*comic_info)
check_first_pages(first_pages)
| import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
comic = Comic(comic_name, *comic_info)
first_pages = comic.verify_xpath()
check_first_pages(first_pages)
| Refactor comic availability test to reflect changes to Comic class | Refactor comic availability test to reflect changes to Comic class
| Python | mit | J-CPelletier/WebComicToCBZ,J-CPelletier/webcomix,J-CPelletier/webcomix | python | ## Code Before:
import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
first_pages = Comic.verify_xpath(*comic_info)
check_first_pages(first_pages)
## Instruction:
Refactor comic availability test to reflect changes to Comic class
## Code After:
import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
comic = Comic(comic_name, *comic_info)
first_pages = comic.verify_xpath()
check_first_pages(first_pages)
| import pytest
from webcomix.comic import Comic
from webcomix.supported_comics import supported_comics
from webcomix.util import check_first_pages
@pytest.mark.slow
def test_supported_comics():
for comic_name, comic_info in supported_comics.items():
+ comic = Comic(comic_name, *comic_info)
- first_pages = Comic.verify_xpath(*comic_info)
? ^ -----------
+ first_pages = comic.verify_xpath()
? ^
check_first_pages(first_pages) | 3 | 0.25 | 2 | 1 |
b9f47421eef98694666f67d72a4ad43c77eb4c4a | TODO.md | TODO.md |
* Install Sublime
* Install go
* Install java
+ brew cask install java
+ add line to .bashrc to set java_home
+ "/usr/libexec/java_home -v 12.+"
* Install Intellij
* Install WebStorm
* Install GoLand
* Install Gradle
* Install Fusion 360
* Install Quicken
|
* Install Sublime
* Install go
* Install java
+ brew cask install java
+ add line to .bashrc to set java_home
+ "/usr/libexec/java_home -v 12.+"
* Install Intellij
* Install WebStorm
* Install GoLand
* Install Gradle
* Install docker
* Install Fusion 360
* Install Quicken
| Add todo step to install docker | Add todo step to install docker | Markdown | unlicense | dave-r/dotfiles | markdown | ## Code Before:
* Install Sublime
* Install go
* Install java
+ brew cask install java
+ add line to .bashrc to set java_home
+ "/usr/libexec/java_home -v 12.+"
* Install Intellij
* Install WebStorm
* Install GoLand
* Install Gradle
* Install Fusion 360
* Install Quicken
## Instruction:
Add todo step to install docker
## Code After:
* Install Sublime
* Install go
* Install java
+ brew cask install java
+ add line to .bashrc to set java_home
+ "/usr/libexec/java_home -v 12.+"
* Install Intellij
* Install WebStorm
* Install GoLand
* Install Gradle
* Install docker
* Install Fusion 360
* Install Quicken
|
* Install Sublime
* Install go
* Install java
+ brew cask install java
+ add line to .bashrc to set java_home
+ "/usr/libexec/java_home -v 12.+"
* Install Intellij
* Install WebStorm
* Install GoLand
* Install Gradle
+ * Install docker
* Install Fusion 360
* Install Quicken | 1 | 0.076923 | 1 | 0 |
7b1efa129d54a7e3ee0cf560153e120148bb4d2d | metadata/fr.byped.bwarearea.txt | metadata/fr.byped.bwarearea.txt | Categories:Navigation
License:MIT
Web Site:https://github.com/X-Ryl669/BwareArea
Source Code:https://github.com/X-Ryl669/BwareArea
Issue Tracker:https://github.com/X-Ryl669/BwareArea/issues
Auto Name:BwareArea
Summary:An offline GPS based POI alerter with overlay
Description:
How frustrating it is to have a offline navigation software to find out you
can't be alerted approaching some point of interest / dangerous area ?
This application just solves this. You'll import a POI list and it'll start an
always-on-top widget displaying the closest POI and alerting you if you don't
follow the POI requirements. All the parameters are configurable; minimal
distance to warn, allowed over-speed, whether to automatically start when your
car's Bluetooth is connected, or to log your track.
Depending on your country's law, you can also limit to range alert (instead of
exact position alert).
.
Repo Type:git
Repo:https://github.com/X-Ryl669/BwareArea
Build:0.6.2,1
commit=v0.6.2
subdir=app
gradle=yes
Build:0.6.5,3
commit=v0.6.5
subdir=app
gradle=yes
Auto Update Mode:Version v%v
Update Check Mode:Tags
Current Version:0.6.5
Current Version Code:3
| Categories:Navigation
License:MIT
Web Site:https://github.com/X-Ryl669/BwareArea
Source Code:https://github.com/X-Ryl669/BwareArea
Issue Tracker:https://github.com/X-Ryl669/BwareArea/issues
Auto Name:BwareArea
Summary:An offline GPS based POI alerter with overlay
Description:
How frustrating it is to have a offline navigation software to find out you
can't be alerted approaching some point of interest / dangerous area ?
This application just solves this. You'll import a POI list and it'll start an
always-on-top widget displaying the closest POI and alerting you if you don't
follow the POI requirements. All the parameters are configurable; minimal
distance to warn, allowed over-speed, whether to automatically start when your
car's Bluetooth is connected, or to log your track.
Depending on your country's law, you can also limit to range alert (instead of
exact position alert).
.
Repo Type:git
Repo:https://github.com/X-Ryl669/BwareArea
Build:0.6.2,1
commit=v0.6.2
subdir=app
gradle=yes
Build:0.6.5,3
commit=v0.6.5
subdir=app
gradle=yes
Build:0.6.6,4
commit=v0.6.6
subdir=app
gradle=yes
Auto Update Mode:Version v%v
Update Check Mode:Tags
Current Version:0.6.6
Current Version Code:4
| Update BwareArea to 0.6.6 (4) | Update BwareArea to 0.6.6 (4)
| Text | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata,f-droid/fdroid-data | text | ## Code Before:
Categories:Navigation
License:MIT
Web Site:https://github.com/X-Ryl669/BwareArea
Source Code:https://github.com/X-Ryl669/BwareArea
Issue Tracker:https://github.com/X-Ryl669/BwareArea/issues
Auto Name:BwareArea
Summary:An offline GPS based POI alerter with overlay
Description:
How frustrating it is to have a offline navigation software to find out you
can't be alerted approaching some point of interest / dangerous area ?
This application just solves this. You'll import a POI list and it'll start an
always-on-top widget displaying the closest POI and alerting you if you don't
follow the POI requirements. All the parameters are configurable; minimal
distance to warn, allowed over-speed, whether to automatically start when your
car's Bluetooth is connected, or to log your track.
Depending on your country's law, you can also limit to range alert (instead of
exact position alert).
.
Repo Type:git
Repo:https://github.com/X-Ryl669/BwareArea
Build:0.6.2,1
commit=v0.6.2
subdir=app
gradle=yes
Build:0.6.5,3
commit=v0.6.5
subdir=app
gradle=yes
Auto Update Mode:Version v%v
Update Check Mode:Tags
Current Version:0.6.5
Current Version Code:3
## Instruction:
Update BwareArea to 0.6.6 (4)
## Code After:
Categories:Navigation
License:MIT
Web Site:https://github.com/X-Ryl669/BwareArea
Source Code:https://github.com/X-Ryl669/BwareArea
Issue Tracker:https://github.com/X-Ryl669/BwareArea/issues
Auto Name:BwareArea
Summary:An offline GPS based POI alerter with overlay
Description:
How frustrating it is to have a offline navigation software to find out you
can't be alerted approaching some point of interest / dangerous area ?
This application just solves this. You'll import a POI list and it'll start an
always-on-top widget displaying the closest POI and alerting you if you don't
follow the POI requirements. All the parameters are configurable; minimal
distance to warn, allowed over-speed, whether to automatically start when your
car's Bluetooth is connected, or to log your track.
Depending on your country's law, you can also limit to range alert (instead of
exact position alert).
.
Repo Type:git
Repo:https://github.com/X-Ryl669/BwareArea
Build:0.6.2,1
commit=v0.6.2
subdir=app
gradle=yes
Build:0.6.5,3
commit=v0.6.5
subdir=app
gradle=yes
Build:0.6.6,4
commit=v0.6.6
subdir=app
gradle=yes
Auto Update Mode:Version v%v
Update Check Mode:Tags
Current Version:0.6.6
Current Version Code:4
| Categories:Navigation
License:MIT
Web Site:https://github.com/X-Ryl669/BwareArea
Source Code:https://github.com/X-Ryl669/BwareArea
Issue Tracker:https://github.com/X-Ryl669/BwareArea/issues
Auto Name:BwareArea
Summary:An offline GPS based POI alerter with overlay
Description:
How frustrating it is to have a offline navigation software to find out you
can't be alerted approaching some point of interest / dangerous area ?
This application just solves this. You'll import a POI list and it'll start an
always-on-top widget displaying the closest POI and alerting you if you don't
follow the POI requirements. All the parameters are configurable; minimal
distance to warn, allowed over-speed, whether to automatically start when your
car's Bluetooth is connected, or to log your track.
Depending on your country's law, you can also limit to range alert (instead of
exact position alert).
.
Repo Type:git
Repo:https://github.com/X-Ryl669/BwareArea
Build:0.6.2,1
commit=v0.6.2
subdir=app
gradle=yes
Build:0.6.5,3
commit=v0.6.5
subdir=app
gradle=yes
+ Build:0.6.6,4
+ commit=v0.6.6
+ subdir=app
+ gradle=yes
+
Auto Update Mode:Version v%v
Update Check Mode:Tags
- Current Version:0.6.5
? ^
+ Current Version:0.6.6
? ^
- Current Version Code:3
? ^
+ Current Version Code:4
? ^
| 9 | 0.230769 | 7 | 2 |
e62e39b975ed0e8ef53b2cf57740163d0ddae718 | app/views/register-with-a-gp/register-without-signin.html | app/views/register-with-a-gp/register-without-signin.html | {% extends 'templates/nhs_layout.html' %}
{% import 'includes/form_macros.html' as form_macros %}
{% block afterHeader %}
{% include "includes/service-headers/register-with-a-gp.html" %}
{% endblock %}
{% block content %}
<main id="content" role="main">
<h1 class="heading-xlarge">
Your personal details
</h1>
<form action="" method="get" class="form">
{{
form_macros.text_field({
id: 'Full name',
label: 'Your name'
})
}}
{{
form_macros.date_field({
label: 'Date of birth',
hint_date: '31 7 1961',
id_prefix: 'dob-'
})
}}
{{
form_macros.text_field({
id: 'current-practice',
label: 'Current practice or GP'
})
}}
<div class="form-group">
<a href="register-without-signin-confirmed" class="button">Register</a>
</div>
</form>
</main>
{% endblock %}
| {% extends 'templates/nhs_layout.html' %}
{% import 'includes/form_macros.html' as form_macros %}
{% block afterHeader %}
{% include "includes/service-headers/register-with-a-gp.html" %}
{% endblock %}
{% block content %}
<main id="content" role="main">
<h1 class="heading-xlarge">
Your personal details
</h1>
<form action="" method="get" class="form">
{{
form_macros.text_field({
id: 'Full name',
label: 'Your name'
})
}}
{{
form_macros.date_field({
label: 'Date of birth',
hint_date: '31 7 1961',
id_prefix: 'dob-'
})
}}
{% include "includes/forms/gp-practice.html" %}
<div class="form-group">
<a href="register-without-signin-confirmed" class="button">Register</a>
</div>
</form>
</main>
{% endblock %}
| Use the gp-practice include in register journey | Use the gp-practice include in register journey
| HTML | mit | nhsalpha/nhs_prototype_kit,st3v3nhunt/prototype-ers,nhsalpha/nhs_prototype_kit,nhsalpha/nhs_prototype_kit,st3v3nhunt/prototype-ers,st3v3nhunt/prototype-ers,st3v3nhunt/prototype-ers,bencullimore/nhsers,bencullimore/nhsers,bencullimore/nhsers,nhsalpha/nhs_prototype_kit,bencullimore/nhsers | html | ## Code Before:
{% extends 'templates/nhs_layout.html' %}
{% import 'includes/form_macros.html' as form_macros %}
{% block afterHeader %}
{% include "includes/service-headers/register-with-a-gp.html" %}
{% endblock %}
{% block content %}
<main id="content" role="main">
<h1 class="heading-xlarge">
Your personal details
</h1>
<form action="" method="get" class="form">
{{
form_macros.text_field({
id: 'Full name',
label: 'Your name'
})
}}
{{
form_macros.date_field({
label: 'Date of birth',
hint_date: '31 7 1961',
id_prefix: 'dob-'
})
}}
{{
form_macros.text_field({
id: 'current-practice',
label: 'Current practice or GP'
})
}}
<div class="form-group">
<a href="register-without-signin-confirmed" class="button">Register</a>
</div>
</form>
</main>
{% endblock %}
## Instruction:
Use the gp-practice include in register journey
## Code After:
{% extends 'templates/nhs_layout.html' %}
{% import 'includes/form_macros.html' as form_macros %}
{% block afterHeader %}
{% include "includes/service-headers/register-with-a-gp.html" %}
{% endblock %}
{% block content %}
<main id="content" role="main">
<h1 class="heading-xlarge">
Your personal details
</h1>
<form action="" method="get" class="form">
{{
form_macros.text_field({
id: 'Full name',
label: 'Your name'
})
}}
{{
form_macros.date_field({
label: 'Date of birth',
hint_date: '31 7 1961',
id_prefix: 'dob-'
})
}}
{% include "includes/forms/gp-practice.html" %}
<div class="form-group">
<a href="register-without-signin-confirmed" class="button">Register</a>
</div>
</form>
</main>
{% endblock %}
| {% extends 'templates/nhs_layout.html' %}
{% import 'includes/form_macros.html' as form_macros %}
{% block afterHeader %}
{% include "includes/service-headers/register-with-a-gp.html" %}
{% endblock %}
{% block content %}
<main id="content" role="main">
<h1 class="heading-xlarge">
Your personal details
</h1>
<form action="" method="get" class="form">
{{
form_macros.text_field({
id: 'Full name',
label: 'Your name'
})
}}
{{
form_macros.date_field({
label: 'Date of birth',
hint_date: '31 7 1961',
id_prefix: 'dob-'
})
}}
+ {% include "includes/forms/gp-practice.html" %}
- {{
- form_macros.text_field({
- id: 'current-practice',
- label: 'Current practice or GP'
- })
- }}
<div class="form-group">
<a href="register-without-signin-confirmed" class="button">Register</a>
</div>
</form>
</main>
{% endblock %} | 7 | 0.148936 | 1 | 6 |
09fa7445158c5bcb924dbe7bf71fdeb85d0a5de4 | spec/rspec_matcher_spec.rb | spec/rspec_matcher_spec.rb | require 'spec_helper'
include Capybara::DSL
describe 'rspec matcher' do
before(:all) do
@black_box = 'black.png'
@ref_path = Gatling::Configuration.reference_image_path = File.join(spec_support_root, 'ref_path')
create_images_for_web_page
create_square_image(@ref_path, 'black')
end
after(:each) do
remove_refs(@ref_path)
end
it 'should initialize and run gatling' do
visit('/fruit_app.html')
black_element = page.find(:css, "#black")
black_element.should look_like(@black_box)
end
it 'should initialize and run training mode when GATLING_TRAINER is toggled' do
ENV['GATLING_TRAINER'] = 'true'
visit('/fruit_app.html')
black_element = page.find(:css, "#black")
black_element.should look_like(@black_box)
File.exists?(File.join(@ref_path,@black_box)).should be_true
end
end
| require 'spec_helper'
include Capybara::DSL
describe 'rspec matcher' do
before(:all) do
@black_box = 'black.png'
@ref_path = Gatling::Configuration.reference_image_path = File.join(spec_support_root, 'ref_path')
create_images_for_web_page
end
after(:each) do
ENV['GATLING_TRAINER'] = 'false'
remove_refs(@ref_path)
end
describe 'initializing and runnin gatling' do
it 'will pass if images matches refernce' do
create_square_image(@ref_path, 'black')
black_element = element_for_spec("#black")
black_element.should look_like(@black_box)
end
it 'will fail if images dosent matches refernce' do
create_square_image(@ref_path, 'black')
red_element = element_for_spec("#red")
expect{red_element.should look_like(@black_box)}.should raise_error
end
it 'will return true if it makes a new image in trainer mode' do
ENV['GATLING_TRAINER'] = 'true'
black_element = element_for_spec("#black")
black_element.should look_like(@black_box)
end
end
end
| Add test to check rspec matcher can fail | Add test to check rspec matcher can fail
| Ruby | mit | gabrielrotbart/gatling | ruby | ## Code Before:
require 'spec_helper'
include Capybara::DSL
describe 'rspec matcher' do
before(:all) do
@black_box = 'black.png'
@ref_path = Gatling::Configuration.reference_image_path = File.join(spec_support_root, 'ref_path')
create_images_for_web_page
create_square_image(@ref_path, 'black')
end
after(:each) do
remove_refs(@ref_path)
end
it 'should initialize and run gatling' do
visit('/fruit_app.html')
black_element = page.find(:css, "#black")
black_element.should look_like(@black_box)
end
it 'should initialize and run training mode when GATLING_TRAINER is toggled' do
ENV['GATLING_TRAINER'] = 'true'
visit('/fruit_app.html')
black_element = page.find(:css, "#black")
black_element.should look_like(@black_box)
File.exists?(File.join(@ref_path,@black_box)).should be_true
end
end
## Instruction:
Add test to check rspec matcher can fail
## Code After:
require 'spec_helper'
include Capybara::DSL
describe 'rspec matcher' do
before(:all) do
@black_box = 'black.png'
@ref_path = Gatling::Configuration.reference_image_path = File.join(spec_support_root, 'ref_path')
create_images_for_web_page
end
after(:each) do
ENV['GATLING_TRAINER'] = 'false'
remove_refs(@ref_path)
end
describe 'initializing and runnin gatling' do
it 'will pass if images matches refernce' do
create_square_image(@ref_path, 'black')
black_element = element_for_spec("#black")
black_element.should look_like(@black_box)
end
it 'will fail if images dosent matches refernce' do
create_square_image(@ref_path, 'black')
red_element = element_for_spec("#red")
expect{red_element.should look_like(@black_box)}.should raise_error
end
it 'will return true if it makes a new image in trainer mode' do
ENV['GATLING_TRAINER'] = 'true'
black_element = element_for_spec("#black")
black_element.should look_like(@black_box)
end
end
end
| require 'spec_helper'
include Capybara::DSL
describe 'rspec matcher' do
before(:all) do
@black_box = 'black.png'
@ref_path = Gatling::Configuration.reference_image_path = File.join(spec_support_root, 'ref_path')
create_images_for_web_page
- create_square_image(@ref_path, 'black')
end
after(:each) do
+ ENV['GATLING_TRAINER'] = 'false'
remove_refs(@ref_path)
end
- it 'should initialize and run gatling' do
? ^ ------- ^
+ describe 'initializing and runnin gatling' do
? +++++ ^^ ^^^ +++
- visit('/fruit_app.html')
- black_element = page.find(:css, "#black")
+ it 'will pass if images matches refernce' do
+ create_square_image(@ref_path, 'black')
+ black_element = element_for_spec("#black")
+ black_element.should look_like(@black_box)
+ end
+ it 'will fail if images dosent matches refernce' do
+ create_square_image(@ref_path, 'black')
+ red_element = element_for_spec("#red")
+ expect{red_element.should look_like(@black_box)}.should raise_error
+ end
+
+ it 'will return true if it makes a new image in trainer mode' do
+ ENV['GATLING_TRAINER'] = 'true'
+ black_element = element_for_spec("#black")
- black_element.should look_like(@black_box)
+ black_element.should look_like(@black_box)
? ++
+ end
+
end
-
- it 'should initialize and run training mode when GATLING_TRAINER is toggled' do
- ENV['GATLING_TRAINER'] = 'true'
- visit('/fruit_app.html')
- black_element = page.find(:css, "#black")
-
- black_element.should look_like(@black_box)
-
- File.exists?(File.join(@ref_path,@black_box)).should be_true
- end
-
end | 35 | 1 | 19 | 16 |
d161f4c535da8beabd4f7a0a721ac60c15de5bf9 | tests/functional/film-schema-0.3b.sql | tests/functional/film-schema-0.3b.sql | CREATE TABLE category (
category_id SERIAL NOT NULL PRIMARY KEY,
name VARCHAR(25) NOT NULL,
last_update TIMESTAMP WITH TIME ZONE NOT NULL
);
CREATE TABLE film_category (
film_id INTEGER NOT NULL REFERENCES film (id),
category_id INTEGER NOT NULL
REFERENCES category (category_id),
last_update TIMESTAMP WITH TIME ZONE NOT NULL,
PRIMARY KEY (film_id, category_id)
);
| CREATE TABLE genre (
genre_id INTEGER PRIMARY KEY,
name VARCHAR(25) NOT NULL
);
CREATE TABLE film_genre (
film_id INTEGER NOT NULL REFERENCES film (id),
genre_id INTEGER NOT NULL
REFERENCES genre (genre_id),
last_update TIMESTAMP WITH TIME ZONE NOT NULL,
PRIMARY KEY (film_id, genre_id)
);
| Change film functional tests to use 'genre' instead of 'category'. | Change film functional tests to use 'genre' instead of 'category'.
| SQL | bsd-3-clause | reedstrm/Pyrseas,dvarrazzo/Pyrseas,perseas/Pyrseas | sql | ## Code Before:
CREATE TABLE category (
category_id SERIAL NOT NULL PRIMARY KEY,
name VARCHAR(25) NOT NULL,
last_update TIMESTAMP WITH TIME ZONE NOT NULL
);
CREATE TABLE film_category (
film_id INTEGER NOT NULL REFERENCES film (id),
category_id INTEGER NOT NULL
REFERENCES category (category_id),
last_update TIMESTAMP WITH TIME ZONE NOT NULL,
PRIMARY KEY (film_id, category_id)
);
## Instruction:
Change film functional tests to use 'genre' instead of 'category'.
## Code After:
CREATE TABLE genre (
genre_id INTEGER PRIMARY KEY,
name VARCHAR(25) NOT NULL
);
CREATE TABLE film_genre (
film_id INTEGER NOT NULL REFERENCES film (id),
genre_id INTEGER NOT NULL
REFERENCES genre (genre_id),
last_update TIMESTAMP WITH TIME ZONE NOT NULL,
PRIMARY KEY (film_id, genre_id)
);
| - CREATE TABLE category (
? ^^^ ^^ ^
+ CREATE TABLE genre (
? ^ ^ ^
- category_id SERIAL NOT NULL PRIMARY KEY,
+ genre_id INTEGER PRIMARY KEY,
- name VARCHAR(25) NOT NULL,
? -
+ name VARCHAR(25) NOT NULL
- last_update TIMESTAMP WITH TIME ZONE NOT NULL
);
- CREATE TABLE film_category (
? ^^^ ^^ ^
+ CREATE TABLE film_genre (
? ^ ^ ^
film_id INTEGER NOT NULL REFERENCES film (id),
- category_id INTEGER NOT NULL
? ^^^ ^^ ^
+ genre_id INTEGER NOT NULL
? ^ ^ ^
- REFERENCES category (category_id),
? ^^^ ^^ ^ ^^^ ^^ ^
+ REFERENCES genre (genre_id),
? ^ ^ ^ ^ ^ ^
last_update TIMESTAMP WITH TIME ZONE NOT NULL,
- PRIMARY KEY (film_id, category_id)
? ^^^ ^^ ^
+ PRIMARY KEY (film_id, genre_id)
? ^ ^ ^
); | 15 | 1.25 | 7 | 8 |
d8d2ed0751d25a169757aa5a4dabfadde68cdcc2 | .travis.yml | .travis.yml | sudo: false
language: go
go:
- 1.7.x
- 1.8.x
- 1.9.x
- tip
# Thanks to: https://github.com/Masterminds/glide/issues/408#issuecomment-217493627
install:
- go get -v github.com/Masterminds/glide
- cd $GOPATH/src/github.com/Masterminds/glide && git checkout tags/0.13.0 && go install && cd -
- glide install
| sudo: false
language: go
go:
- 1.7.x
- 1.8.x
- 1.9.x
- tip
# A local Mongo is required for tests
services: mongodb
# Thanks to: https://github.com/Masterminds/glide/issues/408#issuecomment-217493627
install:
- go get -v github.com/Masterminds/glide
- cd $GOPATH/src/github.com/Masterminds/glide && git checkout v0.13.0 && go install && cd -
- glide install
| Fix glide tag & mongodb dependency for TravisCI | Fix glide tag & mongodb dependency for TravisCI
Travis provides an easy way to set up MongoDB during CI:
https://docs.travis-ci.com/user/database-setup/#MongoDB
| YAML | bsd-3-clause | pereztr5/cyboard,pereztr5/cyboard,pereztr5/cyboard,pereztr5/cyboard | yaml | ## Code Before:
sudo: false
language: go
go:
- 1.7.x
- 1.8.x
- 1.9.x
- tip
# Thanks to: https://github.com/Masterminds/glide/issues/408#issuecomment-217493627
install:
- go get -v github.com/Masterminds/glide
- cd $GOPATH/src/github.com/Masterminds/glide && git checkout tags/0.13.0 && go install && cd -
- glide install
## Instruction:
Fix glide tag & mongodb dependency for TravisCI
Travis provides an easy way to set up MongoDB during CI:
https://docs.travis-ci.com/user/database-setup/#MongoDB
## Code After:
sudo: false
language: go
go:
- 1.7.x
- 1.8.x
- 1.9.x
- tip
# A local Mongo is required for tests
services: mongodb
# Thanks to: https://github.com/Masterminds/glide/issues/408#issuecomment-217493627
install:
- go get -v github.com/Masterminds/glide
- cd $GOPATH/src/github.com/Masterminds/glide && git checkout v0.13.0 && go install && cd -
- glide install
| sudo: false
language: go
go:
- 1.7.x
- 1.8.x
- 1.9.x
- tip
+ # A local Mongo is required for tests
+ services: mongodb
+
# Thanks to: https://github.com/Masterminds/glide/issues/408#issuecomment-217493627
install:
- go get -v github.com/Masterminds/glide
- - cd $GOPATH/src/github.com/Masterminds/glide && git checkout tags/0.13.0 && go install && cd -
? ^^^^^
+ - cd $GOPATH/src/github.com/Masterminds/glide && git checkout v0.13.0 && go install && cd -
? ^
- glide install | 5 | 0.384615 | 4 | 1 |
f336fcdf200c2ea2c08c3218983ea56897f82fe9 | buildout.cfg | buildout.cfg | [buildout]
extends = versions.cfg
versions = versions
parts = demo
flake8
evolution
develop = .
show-picked-versions = true
eggs = django
django-blog-zinnia
Pillow
html5lib
beautifulsoup4
extensions = gp.vcsdevelop
develop-dir = django-apps-src
vcs-update = true
vcs-extend-develop = git+git://github.com/Fantomas42/django-blog-zinnia.git#egg=django-blog-zinnia
[demo]
recipe = djangorecipe
projectegg = demo_zinnia_html5
settings = settings
eggs = ${buildout:eggs}
[flake8]
recipe = zc.recipe.egg
eggs = flake8
[evolution]
recipe = zc.recipe.egg
eggs = buildout-versions-checker
scripts = check-buildout-updates=evolve
arguments = '-w --indent 32'
| [buildout]
extends = versions.cfg
versions = versions
parts = demo
flake8
evolution
develop = .
show-picked-versions = true
eggs = django
django-blog-zinnia
Pillow
html5lib
beautifulsoup4
extensions = gp.vcsdevelop
develop-dir = django-apps-src
vcs-update = true
vcs-extend-develop = git+git://github.com/Fantomas42/django-blog-zinnia.git#egg=django-blog-zinnia
[demo]
recipe = djangorecipe
projectegg = demo_zinnia_html5
settings = settings
eggs = ${buildout:eggs}
[flake8]
recipe = zc.recipe.egg
eggs = flake8
[evolution]
recipe = zc.recipe.egg
eggs = buildout-versions-checker
scripts = check-buildout-updates=evolve
arguments = '-w'
| Remove indent param for evolve script | Remove indent param for evolve script
| INI | bsd-3-clause | django-blog-zinnia/zinnia-theme-html5 | ini | ## Code Before:
[buildout]
extends = versions.cfg
versions = versions
parts = demo
flake8
evolution
develop = .
show-picked-versions = true
eggs = django
django-blog-zinnia
Pillow
html5lib
beautifulsoup4
extensions = gp.vcsdevelop
develop-dir = django-apps-src
vcs-update = true
vcs-extend-develop = git+git://github.com/Fantomas42/django-blog-zinnia.git#egg=django-blog-zinnia
[demo]
recipe = djangorecipe
projectegg = demo_zinnia_html5
settings = settings
eggs = ${buildout:eggs}
[flake8]
recipe = zc.recipe.egg
eggs = flake8
[evolution]
recipe = zc.recipe.egg
eggs = buildout-versions-checker
scripts = check-buildout-updates=evolve
arguments = '-w --indent 32'
## Instruction:
Remove indent param for evolve script
## Code After:
[buildout]
extends = versions.cfg
versions = versions
parts = demo
flake8
evolution
develop = .
show-picked-versions = true
eggs = django
django-blog-zinnia
Pillow
html5lib
beautifulsoup4
extensions = gp.vcsdevelop
develop-dir = django-apps-src
vcs-update = true
vcs-extend-develop = git+git://github.com/Fantomas42/django-blog-zinnia.git#egg=django-blog-zinnia
[demo]
recipe = djangorecipe
projectegg = demo_zinnia_html5
settings = settings
eggs = ${buildout:eggs}
[flake8]
recipe = zc.recipe.egg
eggs = flake8
[evolution]
recipe = zc.recipe.egg
eggs = buildout-versions-checker
scripts = check-buildout-updates=evolve
arguments = '-w'
| [buildout]
extends = versions.cfg
versions = versions
parts = demo
flake8
evolution
develop = .
show-picked-versions = true
eggs = django
django-blog-zinnia
Pillow
html5lib
beautifulsoup4
extensions = gp.vcsdevelop
develop-dir = django-apps-src
vcs-update = true
vcs-extend-develop = git+git://github.com/Fantomas42/django-blog-zinnia.git#egg=django-blog-zinnia
[demo]
recipe = djangorecipe
projectegg = demo_zinnia_html5
settings = settings
eggs = ${buildout:eggs}
[flake8]
recipe = zc.recipe.egg
eggs = flake8
[evolution]
recipe = zc.recipe.egg
eggs = buildout-versions-checker
scripts = check-buildout-updates=evolve
- arguments = '-w --indent 32'
? ------------
+ arguments = '-w' | 2 | 0.060606 | 1 | 1 |
42380f3d911bc804a397d74dcf0eaa4931d85f3e | supported-packages.txt | supported-packages.txt | archivers/bzip2
archivers/gtar-base
archivers/gzip
archivers/xz
devel/gmake
devel/libtool-base
devel/zlib
eliteraspberries/clang
eliteraspberries/cmake
eliteraspberries/coccinelle
eliteraspberries/cython
eliteraspberries/fftw
eliteraspberries/frama-c
eliteraspberries/python
eliteraspberries/python-numpy
eliteraspberries/python-pillow
eliteraspberries/python-setuptools
eliteraspberries/python-wheel
eliteraspberries/scons
textproc/gsed
| archivers/bzip2
archivers/gtar-base
archivers/gzip
archivers/xz
devel/gmake
devel/libtool-base
devel/zlib
eliteraspberries/clang
eliteraspberries/cmake
eliteraspberries/coccinelle
eliteraspberries/cython
eliteraspberries/fftw
eliteraspberries/frama-c
eliteraspberries/libarchive
eliteraspberries/python
eliteraspberries/python-numpy
eliteraspberries/python-pillow
eliteraspberries/python-setuptools
eliteraspberries/python-wheel
eliteraspberries/scons
textproc/gsed
| Add eliteraspberries/libarchive as a supported package. | Add eliteraspberries/libarchive as a supported package.
| Text | isc | eliteraspberries/minipkg,eliteraspberries/minipkg | text | ## Code Before:
archivers/bzip2
archivers/gtar-base
archivers/gzip
archivers/xz
devel/gmake
devel/libtool-base
devel/zlib
eliteraspberries/clang
eliteraspberries/cmake
eliteraspberries/coccinelle
eliteraspberries/cython
eliteraspberries/fftw
eliteraspberries/frama-c
eliteraspberries/python
eliteraspberries/python-numpy
eliteraspberries/python-pillow
eliteraspberries/python-setuptools
eliteraspberries/python-wheel
eliteraspberries/scons
textproc/gsed
## Instruction:
Add eliteraspberries/libarchive as a supported package.
## Code After:
archivers/bzip2
archivers/gtar-base
archivers/gzip
archivers/xz
devel/gmake
devel/libtool-base
devel/zlib
eliteraspberries/clang
eliteraspberries/cmake
eliteraspberries/coccinelle
eliteraspberries/cython
eliteraspberries/fftw
eliteraspberries/frama-c
eliteraspberries/libarchive
eliteraspberries/python
eliteraspberries/python-numpy
eliteraspberries/python-pillow
eliteraspberries/python-setuptools
eliteraspberries/python-wheel
eliteraspberries/scons
textproc/gsed
| archivers/bzip2
archivers/gtar-base
archivers/gzip
archivers/xz
devel/gmake
devel/libtool-base
devel/zlib
eliteraspberries/clang
eliteraspberries/cmake
eliteraspberries/coccinelle
eliteraspberries/cython
eliteraspberries/fftw
eliteraspberries/frama-c
+ eliteraspberries/libarchive
eliteraspberries/python
eliteraspberries/python-numpy
eliteraspberries/python-pillow
eliteraspberries/python-setuptools
eliteraspberries/python-wheel
eliteraspberries/scons
textproc/gsed | 1 | 0.05 | 1 | 0 |
63d972d7c0fc18792731496fc2ae6bdb60766dbc | src/de/wak_sh/client/Utils.java | src/de/wak_sh/client/Utils.java | package de.wak_sh.client;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Utils {
public static String match(String pattern, String subject) {
Matcher matcher = Pattern.compile(pattern).matcher(subject);
matcher.find();
return matcher.group(1);
}
public static List<String[]> matchAll(String pattern, String subject) {
List<String[]> matches = new ArrayList<String[]>();
Matcher matcher = Pattern.compile(pattern).matcher(subject);
while (matcher.find()) {
int count = matcher.groupCount();
String[] match = new String[count];
for (int i = 0; i < count; i++) {
match[i] = matcher.group(i + 1);
}
matches.add(match);
}
return matches;
}
}
| package de.wak_sh.client;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Utils {
public static String match(String pattern, String subject) {
Matcher matcher = Pattern.compile(pattern, Pattern.DOTALL).matcher(
subject);
matcher.find();
return matcher.group(1);
}
public static List<String[]> matchAll(String pattern, String subject) {
List<String[]> matches = new ArrayList<String[]>();
Matcher matcher = Pattern.compile(pattern, Pattern.DOTALL).matcher(
subject);
while (matcher.find()) {
int count = matcher.groupCount();
String[] match = new String[count];
for (int i = 0; i < count; i++) {
match[i] = matcher.group(i + 1);
}
matches.add(match);
}
return matches;
}
}
| Fix regex utils for long messages | Fix regex utils for long messages | Java | apache-2.0 | wakclient/wakclient | java | ## Code Before:
package de.wak_sh.client;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Utils {
public static String match(String pattern, String subject) {
Matcher matcher = Pattern.compile(pattern).matcher(subject);
matcher.find();
return matcher.group(1);
}
public static List<String[]> matchAll(String pattern, String subject) {
List<String[]> matches = new ArrayList<String[]>();
Matcher matcher = Pattern.compile(pattern).matcher(subject);
while (matcher.find()) {
int count = matcher.groupCount();
String[] match = new String[count];
for (int i = 0; i < count; i++) {
match[i] = matcher.group(i + 1);
}
matches.add(match);
}
return matches;
}
}
## Instruction:
Fix regex utils for long messages
## Code After:
package de.wak_sh.client;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Utils {
public static String match(String pattern, String subject) {
Matcher matcher = Pattern.compile(pattern, Pattern.DOTALL).matcher(
subject);
matcher.find();
return matcher.group(1);
}
public static List<String[]> matchAll(String pattern, String subject) {
List<String[]> matches = new ArrayList<String[]>();
Matcher matcher = Pattern.compile(pattern, Pattern.DOTALL).matcher(
subject);
while (matcher.find()) {
int count = matcher.groupCount();
String[] match = new String[count];
for (int i = 0; i < count; i++) {
match[i] = matcher.group(i + 1);
}
matches.add(match);
}
return matches;
}
}
| package de.wak_sh.client;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Utils {
public static String match(String pattern, String subject) {
- Matcher matcher = Pattern.compile(pattern).matcher(subject);
? ---------
+ Matcher matcher = Pattern.compile(pattern, Pattern.DOTALL).matcher(
? ++++++++++++++++
+ subject);
matcher.find();
return matcher.group(1);
}
public static List<String[]> matchAll(String pattern, String subject) {
List<String[]> matches = new ArrayList<String[]>();
- Matcher matcher = Pattern.compile(pattern).matcher(subject);
? ---------
+ Matcher matcher = Pattern.compile(pattern, Pattern.DOTALL).matcher(
? ++++++++++++++++
+ subject);
while (matcher.find()) {
int count = matcher.groupCount();
String[] match = new String[count];
for (int i = 0; i < count; i++) {
match[i] = matcher.group(i + 1);
}
matches.add(match);
}
return matches;
}
} | 6 | 0.214286 | 4 | 2 |
2b65baffcaa091a00477782dab6d51e5dd477710 | fogAutomatedTesting/test_all.sh | fogAutomatedTesting/test_all.sh | cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$cwd/settings.sh"
#Test the installer.
$cwd/./test_install.sh
#Test imaging.
#$cwd/./test_imaging.sh
rsync -r /var/www/html fogtesting:/var/www
| cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$cwd/settings.sh"
#Test the installer.
$cwd/./test_install.sh
#Test imaging.
#$cwd/./test_imaging.sh
/usr/bin/rsync -r /var/www/html fogtesting:/var/www
ssh -o ConnectTimeout=$sshTimeout fogtesting "systemctl restart apache2 > /dev/null 2>&1"
| Use full path of rsync just to be sure | Use full path of rsync just to be sure
| Shell | mit | FOGProject/fog-community-scripts,FOGProject/fog-community-scripts,FOGProject/fog-community-scripts | shell | ## Code Before:
cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$cwd/settings.sh"
#Test the installer.
$cwd/./test_install.sh
#Test imaging.
#$cwd/./test_imaging.sh
rsync -r /var/www/html fogtesting:/var/www
## Instruction:
Use full path of rsync just to be sure
## Code After:
cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$cwd/settings.sh"
#Test the installer.
$cwd/./test_install.sh
#Test imaging.
#$cwd/./test_imaging.sh
/usr/bin/rsync -r /var/www/html fogtesting:/var/www
ssh -o ConnectTimeout=$sshTimeout fogtesting "systemctl restart apache2 > /dev/null 2>&1"
| cwd="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$cwd/settings.sh"
#Test the installer.
$cwd/./test_install.sh
#Test imaging.
#$cwd/./test_imaging.sh
- rsync -r /var/www/html fogtesting:/var/www
+ /usr/bin/rsync -r /var/www/html fogtesting:/var/www
? +++++++++
+ ssh -o ConnectTimeout=$sshTimeout fogtesting "systemctl restart apache2 > /dev/null 2>&1"
+ | 4 | 0.307692 | 3 | 1 |
ebadd0ce62878fa53c271024f898f86bf9342bb7 | backends.yml | backends.yml | development:
primary:
type: solr
server: localhost
path: "/solr/rummager"
port: 8983
secondary:
type: none
test:
primary:
type: solr
server: solr-test-server
path: "/solr/rummager"
port: 9999
secondary:
type: solr
server: solr-test-server
path: "/solr/whitehall-rummager"
port: 9999
| development:
primary:
type: elasticsearch
server: localhost
port: 9200
index_name: "rummager"
secondary:
type: none
test:
primary:
type: solr
server: solr-test-server
path: "/solr/rummager"
port: 9999
secondary:
type: solr
server: solr-test-server
path: "/solr/whitehall-rummager"
port: 9999
| Switch the primary dev backend to elasticsearch. | Switch the primary dev backend to elasticsearch. | YAML | mit | alphagov/rummager,theodi/rummager,alphagov/rummager,theodi/rummager | yaml | ## Code Before:
development:
primary:
type: solr
server: localhost
path: "/solr/rummager"
port: 8983
secondary:
type: none
test:
primary:
type: solr
server: solr-test-server
path: "/solr/rummager"
port: 9999
secondary:
type: solr
server: solr-test-server
path: "/solr/whitehall-rummager"
port: 9999
## Instruction:
Switch the primary dev backend to elasticsearch.
## Code After:
development:
primary:
type: elasticsearch
server: localhost
port: 9200
index_name: "rummager"
secondary:
type: none
test:
primary:
type: solr
server: solr-test-server
path: "/solr/rummager"
port: 9999
secondary:
type: solr
server: solr-test-server
path: "/solr/whitehall-rummager"
port: 9999
| development:
primary:
- type: solr
+ type: elasticsearch
server: localhost
- path: "/solr/rummager"
- port: 8983
? - ^^
+ port: 9200
? ^^^
+ index_name: "rummager"
secondary:
type: none
test:
primary:
type: solr
server: solr-test-server
path: "/solr/rummager"
port: 9999
secondary:
type: solr
server: solr-test-server
path: "/solr/whitehall-rummager"
port: 9999 | 6 | 0.315789 | 3 | 3 |
66c71c3f5ef6ada4e8b2db5f3729a0dd0e177fc7 | lib/happy/context.rb | lib/happy/context.rb | require 'happy/request'
require 'happy/context_ext/helpers'
module Happy
class Context
include ContextExtensions::Helpers
attr_reader :request, :response, :remaining_path
attr_accessor :layout, :controller
delegate :params, :session, :to => :request
def initialize(request, response)
@request = request
@response = response
@remaining_path = @request.path.split('/').reject {|s| s.blank? }
@layout = nil
@controller = nil
end
def with_controller(new_controller)
# remember previous controller
old_controller = self.controller
self.controller = new_controller
# execute permissions block
controller.class.permissions_blk.try(:call, permissions, self)
# execute block
yield
ensure
# switch back to previous controller
self.controller = old_controller
end
def response=(r)
@response = r
end
private
class << self
def from_env(env)
new(Happy::Request.new(env), Rack::Response.new)
end
end
end
end
| require 'happy/request'
require 'happy/context_ext/helpers'
module Happy
class Context
include ContextExtensions::Helpers
attr_reader :request, :response, :remaining_path
attr_accessor :layout, :controller
delegate :params, :session, :to => :request
def initialize(request, response)
@request = request
@response = response
@remaining_path = @request.path.split('/').reject {|s| s.blank? }
@layout = nil
@controller = nil
end
def with_controller(new_controller)
# remember previous controller
old_controller = self.controller
self.controller = new_controller
# execute permissions block SMELL - better integration
if controller.class.respond_to?(:permissions_blk)
controller.class.permissions_blk.try(:call, permissions, self)
end
# execute block
yield
ensure
# switch back to previous controller
self.controller = old_controller
end
def response=(r)
@response = r
end
private
class << self
def from_env(env)
new(Happy::Request.new(env), Rack::Response.new)
end
end
end
end
| Make sure this stuff also works if happy/permissions is not loaded :) | Make sure this stuff also works if happy/permissions is not loaded :) | Ruby | mit | hmans/happy,hmans/happy | ruby | ## Code Before:
require 'happy/request'
require 'happy/context_ext/helpers'
module Happy
class Context
include ContextExtensions::Helpers
attr_reader :request, :response, :remaining_path
attr_accessor :layout, :controller
delegate :params, :session, :to => :request
def initialize(request, response)
@request = request
@response = response
@remaining_path = @request.path.split('/').reject {|s| s.blank? }
@layout = nil
@controller = nil
end
def with_controller(new_controller)
# remember previous controller
old_controller = self.controller
self.controller = new_controller
# execute permissions block
controller.class.permissions_blk.try(:call, permissions, self)
# execute block
yield
ensure
# switch back to previous controller
self.controller = old_controller
end
def response=(r)
@response = r
end
private
class << self
def from_env(env)
new(Happy::Request.new(env), Rack::Response.new)
end
end
end
end
## Instruction:
Make sure this stuff also works if happy/permissions is not loaded :)
## Code After:
require 'happy/request'
require 'happy/context_ext/helpers'
module Happy
class Context
include ContextExtensions::Helpers
attr_reader :request, :response, :remaining_path
attr_accessor :layout, :controller
delegate :params, :session, :to => :request
def initialize(request, response)
@request = request
@response = response
@remaining_path = @request.path.split('/').reject {|s| s.blank? }
@layout = nil
@controller = nil
end
def with_controller(new_controller)
# remember previous controller
old_controller = self.controller
self.controller = new_controller
# execute permissions block SMELL - better integration
if controller.class.respond_to?(:permissions_blk)
controller.class.permissions_blk.try(:call, permissions, self)
end
# execute block
yield
ensure
# switch back to previous controller
self.controller = old_controller
end
def response=(r)
@response = r
end
private
class << self
def from_env(env)
new(Happy::Request.new(env), Rack::Response.new)
end
end
end
end
| require 'happy/request'
require 'happy/context_ext/helpers'
module Happy
class Context
include ContextExtensions::Helpers
attr_reader :request, :response, :remaining_path
attr_accessor :layout, :controller
delegate :params, :session, :to => :request
def initialize(request, response)
@request = request
@response = response
@remaining_path = @request.path.split('/').reject {|s| s.blank? }
@layout = nil
@controller = nil
end
def with_controller(new_controller)
# remember previous controller
old_controller = self.controller
self.controller = new_controller
- # execute permissions block
+ # execute permissions block SMELL - better integration
+ if controller.class.respond_to?(:permissions_blk)
- controller.class.permissions_blk.try(:call, permissions, self)
+ controller.class.permissions_blk.try(:call, permissions, self)
? ++
+ end
# execute block
yield
ensure
# switch back to previous controller
self.controller = old_controller
end
def response=(r)
@response = r
end
private
class << self
def from_env(env)
new(Happy::Request.new(env), Rack::Response.new)
end
end
end
end | 6 | 0.12766 | 4 | 2 |
32e8dfbc0f498b531811a17d2751336141b283f0 | app/Http/Controllers/InterOp/UserGroupsController.php | app/Http/Controllers/InterOp/UserGroupsController.php | <?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Http\Controllers\InterOp;
use App\Http\Controllers\Controller;
use App\Models\User;
class UserGroupsController extends Controller
{
public function update()
{
[$user, $group] = $this->getUserAndGroupModels();
$modes = get_param_value(request()->input('modes'), 'string[]');
$user->addOrUpdateGroup($group, $modes);
return response(null, 204);
}
public function destroy()
{
[$user, $group] = $this->getUserAndGroupModels();
$user->removeFromGroup($group);
return response(null, 204);
}
public function setDefault()
{
[$user, $group] = $this->getUserAndGroupModels();
$user->setDefaultGroup($group);
return response(null, 204);
}
private function getUserAndGroupModels()
{
$params = get_params(request()->all(), null, [
'group_id:int',
'user_id:int',
]);
$group = app('groups')->byId($params['group_id'] ?? null);
abort_if($group === null, 404, 'Group not found');
return [
User::findOrFail($params['user_id'] ?? null),
$group,
];
}
}
| <?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Http\Controllers\InterOp;
use App\Http\Controllers\Controller;
use App\Models\User;
class UserGroupsController extends Controller
{
public function update()
{
[$user, $group] = $this->getUserAndGroupModels();
$modes = get_arr(request()->input('playmodes'), 'get_string');
$user->addOrUpdateGroup($group, $modes);
return response(null, 204);
}
public function destroy()
{
[$user, $group] = $this->getUserAndGroupModels();
$user->removeFromGroup($group);
return response(null, 204);
}
public function setDefault()
{
[$user, $group] = $this->getUserAndGroupModels();
$user->setDefaultGroup($group);
return response(null, 204);
}
private function getUserAndGroupModels()
{
$params = get_params(request()->all(), null, [
'group_id:int',
'user_id:int',
]);
$group = app('groups')->byId($params['group_id'] ?? null);
abort_if($group === null, 404, 'Group not found');
return [
User::findOrFail($params['user_id'] ?? null),
$group,
];
}
}
| Rename modes param to playmodes and use get_arr directly | Rename modes param to playmodes and use get_arr directly
| PHP | agpl-3.0 | nanaya/osu-web,ppy/osu-web,nanaya/osu-web,nanaya/osu-web,ppy/osu-web,notbakaneko/osu-web,ppy/osu-web,notbakaneko/osu-web,notbakaneko/osu-web,LiquidPL/osu-web,LiquidPL/osu-web,notbakaneko/osu-web,ppy/osu-web,ppy/osu-web,nanaya/osu-web,LiquidPL/osu-web,notbakaneko/osu-web,LiquidPL/osu-web,nanaya/osu-web,LiquidPL/osu-web | php | ## Code Before:
<?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Http\Controllers\InterOp;
use App\Http\Controllers\Controller;
use App\Models\User;
class UserGroupsController extends Controller
{
public function update()
{
[$user, $group] = $this->getUserAndGroupModels();
$modes = get_param_value(request()->input('modes'), 'string[]');
$user->addOrUpdateGroup($group, $modes);
return response(null, 204);
}
public function destroy()
{
[$user, $group] = $this->getUserAndGroupModels();
$user->removeFromGroup($group);
return response(null, 204);
}
public function setDefault()
{
[$user, $group] = $this->getUserAndGroupModels();
$user->setDefaultGroup($group);
return response(null, 204);
}
private function getUserAndGroupModels()
{
$params = get_params(request()->all(), null, [
'group_id:int',
'user_id:int',
]);
$group = app('groups')->byId($params['group_id'] ?? null);
abort_if($group === null, 404, 'Group not found');
return [
User::findOrFail($params['user_id'] ?? null),
$group,
];
}
}
## Instruction:
Rename modes param to playmodes and use get_arr directly
## Code After:
<?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Http\Controllers\InterOp;
use App\Http\Controllers\Controller;
use App\Models\User;
class UserGroupsController extends Controller
{
public function update()
{
[$user, $group] = $this->getUserAndGroupModels();
$modes = get_arr(request()->input('playmodes'), 'get_string');
$user->addOrUpdateGroup($group, $modes);
return response(null, 204);
}
public function destroy()
{
[$user, $group] = $this->getUserAndGroupModels();
$user->removeFromGroup($group);
return response(null, 204);
}
public function setDefault()
{
[$user, $group] = $this->getUserAndGroupModels();
$user->setDefaultGroup($group);
return response(null, 204);
}
private function getUserAndGroupModels()
{
$params = get_params(request()->all(), null, [
'group_id:int',
'user_id:int',
]);
$group = app('groups')->byId($params['group_id'] ?? null);
abort_if($group === null, 404, 'Group not found');
return [
User::findOrFail($params['user_id'] ?? null),
$group,
];
}
}
| <?php
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
// See the LICENCE file in the repository root for full licence text.
namespace App\Http\Controllers\InterOp;
use App\Http\Controllers\Controller;
use App\Models\User;
class UserGroupsController extends Controller
{
public function update()
{
[$user, $group] = $this->getUserAndGroupModels();
- $modes = get_param_value(request()->input('modes'), 'string[]');
? - ^^^^^^^^ --
+ $modes = get_arr(request()->input('playmodes'), 'get_string');
? ^ ++++ ++++
$user->addOrUpdateGroup($group, $modes);
return response(null, 204);
}
public function destroy()
{
[$user, $group] = $this->getUserAndGroupModels();
$user->removeFromGroup($group);
return response(null, 204);
}
public function setDefault()
{
[$user, $group] = $this->getUserAndGroupModels();
$user->setDefaultGroup($group);
return response(null, 204);
}
private function getUserAndGroupModels()
{
$params = get_params(request()->all(), null, [
'group_id:int',
'user_id:int',
]);
$group = app('groups')->byId($params['group_id'] ?? null);
abort_if($group === null, 404, 'Group not found');
return [
User::findOrFail($params['user_id'] ?? null),
$group,
];
}
} | 2 | 0.035714 | 1 | 1 |
1f0050d57fdd72992ee9e6cc87e6fdf76b9f3c93 | Build-Images.ps1 | Build-Images.ps1 | Param(
[Parameter(Mandatory=$true)]
[string] $Repo,
[Parameter()]
[string] $Version = '1.0.0-dev'
)
$Components = @(
'api',
'sql-executor',
'provisioning',
'ui'
)
$docker = Get-Command docker
Write-Host 'Building images...'
ForEach ($Component in $Components) {
& $docker build -t "${Repo}/${Component}:${Version}" -f Dockerfile.${Component} .
}
Write-Host 'Pushing images...'
ForEach ($Component in $Components) {
& $docker push "${Repo}/${Component}:${Version}"
}
| Param(
[Parameter(Mandatory=$true)]
[string] $Repo,
[Parameter()]
[string] $Version = '1.0.0-dev',
[Parameter()]
[switch] $Deploy
)
$Components = @(
'api',
'sql-executor',
'provisioning',
'ui'
)
$docker = Get-Command docker
Write-Host 'Building images...'
ForEach ($Component in $Components) {
& $docker build -t "${Repo}/${Component}:${Version}" -f Dockerfile.${Component} .
}
Write-Host 'Pushing images...'
ForEach ($Component in $Components) {
& $docker push "${Repo}/${Component}:${Version}"
}
If ($Deploy) {
$kubectl = Get-Command kubectl
$manifestDirectory = Join-Path $PSScriptRoot 'deploy\k8s'
Write-Host 'Deploying application...'
ForEach ($Component in $Components) {
$manifestFile = Join-Path $manifestDirectory "$Component.yml"
& $kubectl delete -f $manifestFile
& $kubectl apply -f $manifestFile
}
}
| Add deployment support to image-build script. | Add deployment support to image-build script.
| PowerShell | mit | DimensionDataResearch/daas-demo,DimensionDataResearch/daas-demo,DimensionDataResearch/daas-demo,DimensionDataResearch/daas-demo,DimensionDataResearch/daas-demo,DimensionDataResearch/daas-demo,DimensionDataResearch/daas-demo | powershell | ## Code Before:
Param(
[Parameter(Mandatory=$true)]
[string] $Repo,
[Parameter()]
[string] $Version = '1.0.0-dev'
)
$Components = @(
'api',
'sql-executor',
'provisioning',
'ui'
)
$docker = Get-Command docker
Write-Host 'Building images...'
ForEach ($Component in $Components) {
& $docker build -t "${Repo}/${Component}:${Version}" -f Dockerfile.${Component} .
}
Write-Host 'Pushing images...'
ForEach ($Component in $Components) {
& $docker push "${Repo}/${Component}:${Version}"
}
## Instruction:
Add deployment support to image-build script.
## Code After:
Param(
[Parameter(Mandatory=$true)]
[string] $Repo,
[Parameter()]
[string] $Version = '1.0.0-dev',
[Parameter()]
[switch] $Deploy
)
$Components = @(
'api',
'sql-executor',
'provisioning',
'ui'
)
$docker = Get-Command docker
Write-Host 'Building images...'
ForEach ($Component in $Components) {
& $docker build -t "${Repo}/${Component}:${Version}" -f Dockerfile.${Component} .
}
Write-Host 'Pushing images...'
ForEach ($Component in $Components) {
& $docker push "${Repo}/${Component}:${Version}"
}
If ($Deploy) {
$kubectl = Get-Command kubectl
$manifestDirectory = Join-Path $PSScriptRoot 'deploy\k8s'
Write-Host 'Deploying application...'
ForEach ($Component in $Components) {
$manifestFile = Join-Path $manifestDirectory "$Component.yml"
& $kubectl delete -f $manifestFile
& $kubectl apply -f $manifestFile
}
}
| Param(
[Parameter(Mandatory=$true)]
[string] $Repo,
[Parameter()]
- [string] $Version = '1.0.0-dev'
+ [string] $Version = '1.0.0-dev',
? +
+
+ [Parameter()]
+ [switch] $Deploy
)
$Components = @(
'api',
'sql-executor',
'provisioning',
'ui'
)
$docker = Get-Command docker
Write-Host 'Building images...'
ForEach ($Component in $Components) {
& $docker build -t "${Repo}/${Component}:${Version}" -f Dockerfile.${Component} .
}
Write-Host 'Pushing images...'
ForEach ($Component in $Components) {
& $docker push "${Repo}/${Component}:${Version}"
}
+
+ If ($Deploy) {
+ $kubectl = Get-Command kubectl
+ $manifestDirectory = Join-Path $PSScriptRoot 'deploy\k8s'
+
+ Write-Host 'Deploying application...'
+ ForEach ($Component in $Components) {
+ $manifestFile = Join-Path $manifestDirectory "$Component.yml"
+
+ & $kubectl delete -f $manifestFile
+ & $kubectl apply -f $manifestFile
+ }
+ } | 18 | 0.692308 | 17 | 1 |
bb29cfa3611e91a42c0de8cd39ff86c2541b88a9 | README.md | README.md |
This project is an attempt at creating a monkeypatch for the Olark chat console, which will enable a user to capture events related to new, unread, hopefully interesting messages, and other bits of trivia including operator status.
You might be able to find the patch in bookmarklet form [on this page][bookmarklet].
If such a thing existed, it would be sure to communicate these events to a local Python server, whose sole purpose for existence was to relay such messages on to an embedded HID USB system.
To run this Python server, one would first generate a self-signed certificate.
chmod +x generate_cert.sh
./generate_cert.sh
Fill in whatever makes you happy, for the certificate details. Next change to the `src` directory, and contemplate executing the Python script.
cd src
chmod +x observerServer.py
./observerServer.py
The hardware design will probably borrow heavily from the V-USB examples, and it will likely use the V-USB library as well. ATtiny85 seems like a good choice for the microcontroller, with 3 pins and a timer left open after V-USB (I believe/hope).
More to come on that when I find a USB cable to hack up.
[bookmarklet]: http://htmlpreview.github.io/?https://raw.githubusercontent.com/spacenate/olark-observer/master/bookmarklet.html
|
This project is an attempt at creating a monkeypatch for the Olark chat console, which will enable a user to capture events related to new, unread, hopefully interesting messages, and other bits of trivia including operator status.
You might be able to find the patch in bookmarklet form [on this page][bookmarklet].
If such a thing existed, it would be sure to communicate these events to a local Python server, whose sole purpose for existence was to relay such messages on to an embedded HID USB system.
To run this Python server, one would first generate a self-signed certificate.
./generate_cert.sh
Fill in whatever makes you happy, for the certificate details. Next change to the `src` directory, and contemplate executing the Python script.
cd src
./observerServer.py
The hardware design will probably borrow heavily from the V-USB examples, and it will likely use the V-USB library as well. ATtiny85 seems like a good choice for the microcontroller, with 3 pins and a timer left open after V-USB (I believe/hope).
More to come on that when I find a USB cable to hack up.
[bookmarklet]: http://htmlpreview.github.io/?https://raw.githubusercontent.com/spacenate/olark-observer/master/bookmarklet.html
| Remove instructions to chmod +x various files - git maintains these permissions when you clone the repo, neat! | Remove instructions to chmod +x various files - git maintains these
permissions when you clone the repo, neat!
| Markdown | mit | spacenate/olark-observer,spacenate/olark-observer,spacenate/olark-observer,spacenate/olark-observer | markdown | ## Code Before:
This project is an attempt at creating a monkeypatch for the Olark chat console, which will enable a user to capture events related to new, unread, hopefully interesting messages, and other bits of trivia including operator status.
You might be able to find the patch in bookmarklet form [on this page][bookmarklet].
If such a thing existed, it would be sure to communicate these events to a local Python server, whose sole purpose for existence was to relay such messages on to an embedded HID USB system.
To run this Python server, one would first generate a self-signed certificate.
chmod +x generate_cert.sh
./generate_cert.sh
Fill in whatever makes you happy, for the certificate details. Next change to the `src` directory, and contemplate executing the Python script.
cd src
chmod +x observerServer.py
./observerServer.py
The hardware design will probably borrow heavily from the V-USB examples, and it will likely use the V-USB library as well. ATtiny85 seems like a good choice for the microcontroller, with 3 pins and a timer left open after V-USB (I believe/hope).
More to come on that when I find a USB cable to hack up.
[bookmarklet]: http://htmlpreview.github.io/?https://raw.githubusercontent.com/spacenate/olark-observer/master/bookmarklet.html
## Instruction:
Remove instructions to chmod +x various files - git maintains these
permissions when you clone the repo, neat!
## Code After:
This project is an attempt at creating a monkeypatch for the Olark chat console, which will enable a user to capture events related to new, unread, hopefully interesting messages, and other bits of trivia including operator status.
You might be able to find the patch in bookmarklet form [on this page][bookmarklet].
If such a thing existed, it would be sure to communicate these events to a local Python server, whose sole purpose for existence was to relay such messages on to an embedded HID USB system.
To run this Python server, one would first generate a self-signed certificate.
./generate_cert.sh
Fill in whatever makes you happy, for the certificate details. Next change to the `src` directory, and contemplate executing the Python script.
cd src
./observerServer.py
The hardware design will probably borrow heavily from the V-USB examples, and it will likely use the V-USB library as well. ATtiny85 seems like a good choice for the microcontroller, with 3 pins and a timer left open after V-USB (I believe/hope).
More to come on that when I find a USB cable to hack up.
[bookmarklet]: http://htmlpreview.github.io/?https://raw.githubusercontent.com/spacenate/olark-observer/master/bookmarklet.html
|
This project is an attempt at creating a monkeypatch for the Olark chat console, which will enable a user to capture events related to new, unread, hopefully interesting messages, and other bits of trivia including operator status.
You might be able to find the patch in bookmarklet form [on this page][bookmarklet].
If such a thing existed, it would be sure to communicate these events to a local Python server, whose sole purpose for existence was to relay such messages on to an embedded HID USB system.
To run this Python server, one would first generate a self-signed certificate.
- chmod +x generate_cert.sh
./generate_cert.sh
Fill in whatever makes you happy, for the certificate details. Next change to the `src` directory, and contemplate executing the Python script.
cd src
- chmod +x observerServer.py
./observerServer.py
The hardware design will probably borrow heavily from the V-USB examples, and it will likely use the V-USB library as well. ATtiny85 seems like a good choice for the microcontroller, with 3 pins and a timer left open after V-USB (I believe/hope).
More to come on that when I find a USB cable to hack up.
[bookmarklet]: http://htmlpreview.github.io/?https://raw.githubusercontent.com/spacenate/olark-observer/master/bookmarklet.html | 2 | 0.086957 | 0 | 2 |
fcd523105e9f158f423018d45b05527435a41fb0 | geotrek/altimetry/tests/test_models.py | geotrek/altimetry/tests/test_models.py | import os
from django.test import TestCase
from django.conf import settings
from geotrek.trekking.factories import TrekFactory
from geotrek.trekking.models import Trek
class AltimetryMixinTest(TestCase):
def test_get_elevation_chart_none(self):
trek = TrekFactory.create(no_path=True)
trek.get_elevation_chart_path()
basefolder = os.path.join(settings.MEDIA_ROOT, 'profiles')
self.assertTrue(os.listdir(basefolder))
directory = os.listdir(basefolder)
self.assertIn('%s-%s-%s.png' % (Trek._meta.model_name, '1', 'en'), directory)
| import os
from django.test import TestCase
from django.conf import settings
from django.utils.translation import get_language
from geotrek.trekking.factories import TrekFactory
from geotrek.trekking.models import Trek
class AltimetryMixinTest(TestCase):
def test_get_elevation_chart_none(self):
trek = TrekFactory.create(no_path=True, published=True)
response = self.client.get('/media/profiles/trek-%s.png' % trek.pk)
self.assertEqual(response.status_code, 200)
# In PDF
trek.get_elevation_chart_path()
basefolder = os.path.join(settings.MEDIA_ROOT, 'profiles')
self.assertTrue(os.listdir(basefolder))
directory = os.listdir(basefolder)
self.assertIn('%s-%s-%s.png' % (Trek._meta.model_name, str(trek.pk), get_language()), directory)
| Change test model elevation chart | Change test model elevation chart
| Python | bsd-2-clause | GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek | python | ## Code Before:
import os
from django.test import TestCase
from django.conf import settings
from geotrek.trekking.factories import TrekFactory
from geotrek.trekking.models import Trek
class AltimetryMixinTest(TestCase):
def test_get_elevation_chart_none(self):
trek = TrekFactory.create(no_path=True)
trek.get_elevation_chart_path()
basefolder = os.path.join(settings.MEDIA_ROOT, 'profiles')
self.assertTrue(os.listdir(basefolder))
directory = os.listdir(basefolder)
self.assertIn('%s-%s-%s.png' % (Trek._meta.model_name, '1', 'en'), directory)
## Instruction:
Change test model elevation chart
## Code After:
import os
from django.test import TestCase
from django.conf import settings
from django.utils.translation import get_language
from geotrek.trekking.factories import TrekFactory
from geotrek.trekking.models import Trek
class AltimetryMixinTest(TestCase):
def test_get_elevation_chart_none(self):
trek = TrekFactory.create(no_path=True, published=True)
response = self.client.get('/media/profiles/trek-%s.png' % trek.pk)
self.assertEqual(response.status_code, 200)
# In PDF
trek.get_elevation_chart_path()
basefolder = os.path.join(settings.MEDIA_ROOT, 'profiles')
self.assertTrue(os.listdir(basefolder))
directory = os.listdir(basefolder)
self.assertIn('%s-%s-%s.png' % (Trek._meta.model_name, str(trek.pk), get_language()), directory)
| import os
from django.test import TestCase
from django.conf import settings
+ from django.utils.translation import get_language
from geotrek.trekking.factories import TrekFactory
from geotrek.trekking.models import Trek
class AltimetryMixinTest(TestCase):
def test_get_elevation_chart_none(self):
- trek = TrekFactory.create(no_path=True)
+ trek = TrekFactory.create(no_path=True, published=True)
? ++++++++++++++++
+ response = self.client.get('/media/profiles/trek-%s.png' % trek.pk)
+ self.assertEqual(response.status_code, 200)
+ # In PDF
trek.get_elevation_chart_path()
basefolder = os.path.join(settings.MEDIA_ROOT, 'profiles')
self.assertTrue(os.listdir(basefolder))
directory = os.listdir(basefolder)
- self.assertIn('%s-%s-%s.png' % (Trek._meta.model_name, '1', 'en'), directory)
? ^^^ ^ ^
+ self.assertIn('%s-%s-%s.png' % (Trek._meta.model_name, str(trek.pk), get_language()), directory)
? ^^^^^^^^^^^^ ^ ++++ ^^^^^^^
| 8 | 0.470588 | 6 | 2 |
17ca90c3f475a9cdd4bf95d09ee4631062addfba | requirements.txt | requirements.txt | -e git+https://github.com/julienaubert/django-uuidfield.git@python3#egg=django-uuidfield
-e git+https://github.com/EnTeQuAk/babel.git@support/py3k#egg=babel
-e git+https://github.com/omab/python-social-auth@d25b7934b212271ca95869ca84cb39adb6a80321#egg=python-social-auth
| -e git+https://github.com/julienaubert/django-uuidfield.git@python3#egg=django-uuidfield
-e git+https://github.com/EnTeQuAk/babel.git@support/py3k#egg=babel
-e git+https://github.com/EnTeQuAk/python-social-auth@master#egg=python-social-auth
| Use my psa fork to fix py3k migration issues | Use my psa fork to fix py3k migration issues
| Text | bsd-3-clause | YouNeedToSleep/sleepy,YouNeedToSleep/sleepy,YouNeedToSleep/sleepy | text | ## Code Before:
-e git+https://github.com/julienaubert/django-uuidfield.git@python3#egg=django-uuidfield
-e git+https://github.com/EnTeQuAk/babel.git@support/py3k#egg=babel
-e git+https://github.com/omab/python-social-auth@d25b7934b212271ca95869ca84cb39adb6a80321#egg=python-social-auth
## Instruction:
Use my psa fork to fix py3k migration issues
## Code After:
-e git+https://github.com/julienaubert/django-uuidfield.git@python3#egg=django-uuidfield
-e git+https://github.com/EnTeQuAk/babel.git@support/py3k#egg=babel
-e git+https://github.com/EnTeQuAk/python-social-auth@master#egg=python-social-auth
| -e git+https://github.com/julienaubert/django-uuidfield.git@python3#egg=django-uuidfield
-e git+https://github.com/EnTeQuAk/babel.git@support/py3k#egg=babel
- -e git+https://github.com/omab/python-social-auth@d25b7934b212271ca95869ca84cb39adb6a80321#egg=python-social-auth
+ -e git+https://github.com/EnTeQuAk/python-social-auth@master#egg=python-social-auth | 2 | 0.666667 | 1 | 1 |
5663a50ed6d36538efca048c5f4832ddbd8e7a0a | src/platform/word_wrap.rs | src/platform/word_wrap.rs | use std::io::{self, Write};
const CHARS_PER_LINE: usize = 78;
const SPACE: u8 = 32;
const LF: u8 = 10;
// This is a *very* naive algorithm. It assumes the cursor is
// currently at column 0, and that the string to be printed is
// ASCII, among other things. It's good enough for our needs
// and much more lightweight than the current crates.io
// alternative, `textwrap`, which has a lot of dependencies.
pub fn writeln_with_wrapping(s: &str) {
let stdout = io::stdout();
let mut handle = stdout.lock();
let bytes = s.as_bytes();
let mut column = 0;
let mut last_space = 0;
let mut i = 0;
for &c in bytes.iter() {
i += 1;
if c == SPACE || c == LF {
handle.write(&bytes[last_space..i]).unwrap();
if c == SPACE {
column += i - last_space;
} else {
column = 0;
}
last_space = i;
}
if column + (i - last_space) > CHARS_PER_LINE {
handle.write(b"\n").unwrap();
column = 0;
}
}
handle.write(&bytes[last_space..i]).unwrap();
handle.write(b"\n").unwrap();
}
| use std::io::{self, Write};
const CHARS_PER_LINE: usize = 78;
const SPACE: u8 = 32;
const LF: u8 = 10;
// This is a *very* naive algorithm. It assumes the cursor is
// currently at column 0, and that the string to be printed is
// ASCII, among other things. It's good enough for our needs
// and much more lightweight than the current crates.io
// alternative, `textwrap`, which has a lot of dependencies.
pub fn writeln_with_wrapping(s: &str) {
let stdout = io::stdout();
let mut handle = stdout.lock();
let bytes = s.as_bytes();
let mut column = 0;
let mut last_space = 0;
let mut i = 0;
for &c in bytes.iter() {
i += 1;
if c == SPACE || c == LF {
handle.write(&bytes[last_space..i]).unwrap();
if c == SPACE {
column += i - last_space;
} else {
column = 0;
}
last_space = i;
}
if column + (i - last_space) >= CHARS_PER_LINE {
if column == 0 {
// Ack, we've got a really long word that exceeds the
// length of a single line. Just write it out, breaking
// it at the end of the line.
handle.write(&bytes[last_space..i]).unwrap();
last_space = i;
}
handle.write(b"\n").unwrap();
column = 0;
}
}
handle.write(&bytes[last_space..i]).unwrap();
handle.write(b"\n").unwrap();
}
| Make word wrap support words longer than CHARS_PER_LINE. | Make word wrap support words longer than CHARS_PER_LINE.
| Rust | unlicense | toolness/werewolves-and-wanderer-rs,toolness/werewolves-and-wanderer-rs,toolness/werewolves-and-wanderer-rs,toolness/werewolves-and-wanderer-rs | rust | ## Code Before:
use std::io::{self, Write};
const CHARS_PER_LINE: usize = 78;
const SPACE: u8 = 32;
const LF: u8 = 10;
// This is a *very* naive algorithm. It assumes the cursor is
// currently at column 0, and that the string to be printed is
// ASCII, among other things. It's good enough for our needs
// and much more lightweight than the current crates.io
// alternative, `textwrap`, which has a lot of dependencies.
pub fn writeln_with_wrapping(s: &str) {
let stdout = io::stdout();
let mut handle = stdout.lock();
let bytes = s.as_bytes();
let mut column = 0;
let mut last_space = 0;
let mut i = 0;
for &c in bytes.iter() {
i += 1;
if c == SPACE || c == LF {
handle.write(&bytes[last_space..i]).unwrap();
if c == SPACE {
column += i - last_space;
} else {
column = 0;
}
last_space = i;
}
if column + (i - last_space) > CHARS_PER_LINE {
handle.write(b"\n").unwrap();
column = 0;
}
}
handle.write(&bytes[last_space..i]).unwrap();
handle.write(b"\n").unwrap();
}
## Instruction:
Make word wrap support words longer than CHARS_PER_LINE.
## Code After:
use std::io::{self, Write};
const CHARS_PER_LINE: usize = 78;
const SPACE: u8 = 32;
const LF: u8 = 10;
// This is a *very* naive algorithm. It assumes the cursor is
// currently at column 0, and that the string to be printed is
// ASCII, among other things. It's good enough for our needs
// and much more lightweight than the current crates.io
// alternative, `textwrap`, which has a lot of dependencies.
pub fn writeln_with_wrapping(s: &str) {
let stdout = io::stdout();
let mut handle = stdout.lock();
let bytes = s.as_bytes();
let mut column = 0;
let mut last_space = 0;
let mut i = 0;
for &c in bytes.iter() {
i += 1;
if c == SPACE || c == LF {
handle.write(&bytes[last_space..i]).unwrap();
if c == SPACE {
column += i - last_space;
} else {
column = 0;
}
last_space = i;
}
if column + (i - last_space) >= CHARS_PER_LINE {
if column == 0 {
// Ack, we've got a really long word that exceeds the
// length of a single line. Just write it out, breaking
// it at the end of the line.
handle.write(&bytes[last_space..i]).unwrap();
last_space = i;
}
handle.write(b"\n").unwrap();
column = 0;
}
}
handle.write(&bytes[last_space..i]).unwrap();
handle.write(b"\n").unwrap();
}
| use std::io::{self, Write};
const CHARS_PER_LINE: usize = 78;
const SPACE: u8 = 32;
const LF: u8 = 10;
// This is a *very* naive algorithm. It assumes the cursor is
// currently at column 0, and that the string to be printed is
// ASCII, among other things. It's good enough for our needs
// and much more lightweight than the current crates.io
// alternative, `textwrap`, which has a lot of dependencies.
pub fn writeln_with_wrapping(s: &str) {
let stdout = io::stdout();
let mut handle = stdout.lock();
let bytes = s.as_bytes();
let mut column = 0;
let mut last_space = 0;
let mut i = 0;
for &c in bytes.iter() {
i += 1;
if c == SPACE || c == LF {
handle.write(&bytes[last_space..i]).unwrap();
if c == SPACE {
column += i - last_space;
} else {
column = 0;
}
last_space = i;
}
- if column + (i - last_space) > CHARS_PER_LINE {
+ if column + (i - last_space) >= CHARS_PER_LINE {
? +
+ if column == 0 {
+ // Ack, we've got a really long word that exceeds the
+ // length of a single line. Just write it out, breaking
+ // it at the end of the line.
+ handle.write(&bytes[last_space..i]).unwrap();
+ last_space = i;
+ }
handle.write(b"\n").unwrap();
column = 0;
}
}
handle.write(&bytes[last_space..i]).unwrap();
handle.write(b"\n").unwrap();
} | 9 | 0.230769 | 8 | 1 |
d68ad428502d5fb7f60b2114d27b18851b9588c0 | test/test_api_postcode_nl.rb | test/test_api_postcode_nl.rb | require 'helper'
class TestApiPostcodeNl < Test::Unit::TestCase
context 'API.address' do
setup do
ApiPostcodeNl::API.key = 'some-api-key'
ApiPostcodeNl::API.secret = 'super-secret'
end
should 'handle non-numerical house numbers when house_number_addition is nil' do
ApiPostcodeNl::API.address('1000AA', 'Foo')
end
end
end
| require 'helper'
class TestApiPostcodeNl < Test::Unit::TestCase
class DummyFetcher
def fetch(*_)
OpenStruct.new(body: '{}')
end
end
context 'API.address' do
setup do
ApiPostcodeNl::API.fetcher = DummyFetcher.new
ApiPostcodeNl::API.key = 'some-api-key'
ApiPostcodeNl::API.secret = 'super-secret'
end
should 'handle non-numerical house numbers when house_number_addition is nil' do
ApiPostcodeNl::API.address('1000AA', 'Foo')
end
end
end
| Make tests not access the live API | Make tests not access the live API
| Ruby | mit | mvz/api_postcode_nl,rhomeister/api_postcode_nl | ruby | ## Code Before:
require 'helper'
class TestApiPostcodeNl < Test::Unit::TestCase
context 'API.address' do
setup do
ApiPostcodeNl::API.key = 'some-api-key'
ApiPostcodeNl::API.secret = 'super-secret'
end
should 'handle non-numerical house numbers when house_number_addition is nil' do
ApiPostcodeNl::API.address('1000AA', 'Foo')
end
end
end
## Instruction:
Make tests not access the live API
## Code After:
require 'helper'
class TestApiPostcodeNl < Test::Unit::TestCase
class DummyFetcher
def fetch(*_)
OpenStruct.new(body: '{}')
end
end
context 'API.address' do
setup do
ApiPostcodeNl::API.fetcher = DummyFetcher.new
ApiPostcodeNl::API.key = 'some-api-key'
ApiPostcodeNl::API.secret = 'super-secret'
end
should 'handle non-numerical house numbers when house_number_addition is nil' do
ApiPostcodeNl::API.address('1000AA', 'Foo')
end
end
end
| require 'helper'
class TestApiPostcodeNl < Test::Unit::TestCase
+ class DummyFetcher
+ def fetch(*_)
+ OpenStruct.new(body: '{}')
+ end
+ end
+
context 'API.address' do
setup do
+ ApiPostcodeNl::API.fetcher = DummyFetcher.new
+
ApiPostcodeNl::API.key = 'some-api-key'
ApiPostcodeNl::API.secret = 'super-secret'
end
should 'handle non-numerical house numbers when house_number_addition is nil' do
ApiPostcodeNl::API.address('1000AA', 'Foo')
end
end
end | 8 | 0.571429 | 8 | 0 |
a436ead176c0b1e127f8a80de5d82ba59b2571f1 | requirements.txt | requirements.txt | blinker
coveralls
mock
nose
peewee
pyfakefs
python-termstyle
rednose
sure
six
pylint
comtypes
click
-e git://github.com/codito/asana.git@python3#egg=asana
| blinker
coveralls
mock
nose
peewee
pyfakefs
python-termstyle
rednose
sure
six
pylint
comtypes
click
-e git://github.com/codito/asana.git@python3#egg=asana
cx_freeze
| Add cx_freeze as a requirement. | Add cx_freeze as a requirement.
| Text | mit | codito/pomito | text | ## Code Before:
blinker
coveralls
mock
nose
peewee
pyfakefs
python-termstyle
rednose
sure
six
pylint
comtypes
click
-e git://github.com/codito/asana.git@python3#egg=asana
## Instruction:
Add cx_freeze as a requirement.
## Code After:
blinker
coveralls
mock
nose
peewee
pyfakefs
python-termstyle
rednose
sure
six
pylint
comtypes
click
-e git://github.com/codito/asana.git@python3#egg=asana
cx_freeze
| blinker
coveralls
mock
nose
peewee
pyfakefs
python-termstyle
rednose
sure
six
pylint
comtypes
click
-e git://github.com/codito/asana.git@python3#egg=asana
+ cx_freeze | 1 | 0.071429 | 1 | 0 |
f8e29318e17d27f11bbcc36fb5c34324c285f21a | init-lsb.sh | init-lsb.sh | case "$1" in
start)
echo "Starting Docker Compose" >&2
echo "Reverse proxy domain name is \"$(hostname -i)\"" >&2
echo "REVERSE_PROXY_DOMAIN_NAME=$(hostname -i)" > .env
docker-compose build
docker-compose up -d
;;
stop)
echo "Stopping Docker Compose" >&2
docker-compose stop
;;
restart)
echo "Restarting Docker Compose" >&2
docker-compose build
docker-compose restart
;;
status)
docker-compose ps
;;
*)
echo "Usage: $0 {start|stop|restart|status}" >&2
exit 1
;;
esac
| case "$1" in
start)
echo "Starting Docker Compose" >&2
echo "Reverse proxy domain name is \"$(hostname -i | cut -d' ' -f1)\"" >&2
echo "REVERSE_PROXY_DOMAIN_NAME=$(hostname -i | cut -d' ' -f1)" > .env
docker-compose build
docker-compose up -d
;;
stop)
echo "Stopping Docker Compose" >&2
docker-compose stop
;;
restart)
echo "Restarting Docker Compose" >&2
docker-compose build
docker-compose restart
;;
status)
docker-compose ps
;;
*)
echo "Usage: $0 {start|stop|restart|status}" >&2
exit 1
;;
esac
| Fix case multiple host IP addresses | Fix case multiple host IP addresses | Shell | unlicense | Ivaprag/devtools-compose,Ivaprag/devtools-compose | shell | ## Code Before:
case "$1" in
start)
echo "Starting Docker Compose" >&2
echo "Reverse proxy domain name is \"$(hostname -i)\"" >&2
echo "REVERSE_PROXY_DOMAIN_NAME=$(hostname -i)" > .env
docker-compose build
docker-compose up -d
;;
stop)
echo "Stopping Docker Compose" >&2
docker-compose stop
;;
restart)
echo "Restarting Docker Compose" >&2
docker-compose build
docker-compose restart
;;
status)
docker-compose ps
;;
*)
echo "Usage: $0 {start|stop|restart|status}" >&2
exit 1
;;
esac
## Instruction:
Fix case multiple host IP addresses
## Code After:
case "$1" in
start)
echo "Starting Docker Compose" >&2
echo "Reverse proxy domain name is \"$(hostname -i | cut -d' ' -f1)\"" >&2
echo "REVERSE_PROXY_DOMAIN_NAME=$(hostname -i | cut -d' ' -f1)" > .env
docker-compose build
docker-compose up -d
;;
stop)
echo "Stopping Docker Compose" >&2
docker-compose stop
;;
restart)
echo "Restarting Docker Compose" >&2
docker-compose build
docker-compose restart
;;
status)
docker-compose ps
;;
*)
echo "Usage: $0 {start|stop|restart|status}" >&2
exit 1
;;
esac
| case "$1" in
start)
echo "Starting Docker Compose" >&2
- echo "Reverse proxy domain name is \"$(hostname -i)\"" >&2
+ echo "Reverse proxy domain name is \"$(hostname -i | cut -d' ' -f1)\"" >&2
? ++++++++++++++++
- echo "REVERSE_PROXY_DOMAIN_NAME=$(hostname -i)" > .env
+ echo "REVERSE_PROXY_DOMAIN_NAME=$(hostname -i | cut -d' ' -f1)" > .env
? ++++++++++++++++
docker-compose build
docker-compose up -d
;;
stop)
echo "Stopping Docker Compose" >&2
docker-compose stop
;;
restart)
echo "Restarting Docker Compose" >&2
docker-compose build
docker-compose restart
;;
status)
docker-compose ps
;;
*)
echo "Usage: $0 {start|stop|restart|status}" >&2
exit 1
;;
esac | 4 | 0.137931 | 2 | 2 |
6885a771789863d0ce54448bb4c8d707332985bb | rails/test/lib/check_locales.rb | rails/test/lib/check_locales.rb |
class CheckLocales < Thor
def self.list_locales
path_to_locales = 'rails/locale'
Dir.chdir(path_to_locales)
locale_files = Dir.glob('**/*.yml')
locales = locale_files.map{ |f| File.basename(f, '.yml') }
Dir.chdir('../..') # reset working directory
return locales.sort
end
# Returns the number of available locales
def self.count
return self.list_locales.count
end
def self.list_pluralizations
path_to_pluralizations = 'rails/pluralization'
Dir.chdir(path_to_pluralizations)
pluralization_files = Dir.glob('*.rb')
pluralizations = pluralization_files.map{ |f| File.basename(f, '.rb') }
Dir.chdir('../..') # reset working directory
return pluralizations.sort
end
# Returns pluralizations that do not have a locale file
def self.orphan_pluralizations
return self.list_pluralizations.difference(self.list_locales)
end
# Returns locales that do not have a pluralization file
def self.orphan_locales
return self.list_locales.difference(self.list_pluralizations)
end
end
|
class CheckLocales < Thor
@path_to_locales = 'rails/locale'
@path_to_pluralizations = 'rails/pluralization'
def self.list_locales
Dir.chdir(@path_to_locales)
locale_files = Dir.glob('**/*.yml')
locales = locale_files.map{ |f| File.basename(f, '.yml') }
Dir.chdir('../..') # reset working directory
return locales.sort
end
# Returns the number of available locales
def self.count
return self.list_locales.count
end
def self.list_pluralizations
Dir.chdir(@path_to_pluralizations)
pluralization_files = Dir.glob('*.rb')
pluralizations = pluralization_files.map{ |f| File.basename(f, '.rb') }
Dir.chdir('../..') # reset working directory
return pluralizations.sort
end
# Returns pluralizations that do not have a locale file
def self.orphan_pluralizations
return self.list_pluralizations.difference(self.list_locales)
end
# Returns locales that do not have a pluralization file
def self.orphan_locales
return self.list_locales.difference(self.list_pluralizations)
end
end
| Move paths to instance variables | Move paths to instance variables
Move path_to_locales and path_to_pluralizations to instance variables
| Ruby | mit | svenfuchs/rails-i18n,digitalfrost/rails-i18n | ruby | ## Code Before:
class CheckLocales < Thor
def self.list_locales
path_to_locales = 'rails/locale'
Dir.chdir(path_to_locales)
locale_files = Dir.glob('**/*.yml')
locales = locale_files.map{ |f| File.basename(f, '.yml') }
Dir.chdir('../..') # reset working directory
return locales.sort
end
# Returns the number of available locales
def self.count
return self.list_locales.count
end
def self.list_pluralizations
path_to_pluralizations = 'rails/pluralization'
Dir.chdir(path_to_pluralizations)
pluralization_files = Dir.glob('*.rb')
pluralizations = pluralization_files.map{ |f| File.basename(f, '.rb') }
Dir.chdir('../..') # reset working directory
return pluralizations.sort
end
# Returns pluralizations that do not have a locale file
def self.orphan_pluralizations
return self.list_pluralizations.difference(self.list_locales)
end
# Returns locales that do not have a pluralization file
def self.orphan_locales
return self.list_locales.difference(self.list_pluralizations)
end
end
## Instruction:
Move paths to instance variables
Move path_to_locales and path_to_pluralizations to instance variables
## Code After:
class CheckLocales < Thor
@path_to_locales = 'rails/locale'
@path_to_pluralizations = 'rails/pluralization'
def self.list_locales
Dir.chdir(@path_to_locales)
locale_files = Dir.glob('**/*.yml')
locales = locale_files.map{ |f| File.basename(f, '.yml') }
Dir.chdir('../..') # reset working directory
return locales.sort
end
# Returns the number of available locales
def self.count
return self.list_locales.count
end
def self.list_pluralizations
Dir.chdir(@path_to_pluralizations)
pluralization_files = Dir.glob('*.rb')
pluralizations = pluralization_files.map{ |f| File.basename(f, '.rb') }
Dir.chdir('../..') # reset working directory
return pluralizations.sort
end
# Returns pluralizations that do not have a locale file
def self.orphan_pluralizations
return self.list_pluralizations.difference(self.list_locales)
end
# Returns locales that do not have a pluralization file
def self.orphan_locales
return self.list_locales.difference(self.list_pluralizations)
end
end
|
class CheckLocales < Thor
+
+ @path_to_locales = 'rails/locale'
+ @path_to_pluralizations = 'rails/pluralization'
+
def self.list_locales
- path_to_locales = 'rails/locale'
- Dir.chdir(path_to_locales)
+ Dir.chdir(@path_to_locales)
? +
locale_files = Dir.glob('**/*.yml')
locales = locale_files.map{ |f| File.basename(f, '.yml') }
Dir.chdir('../..') # reset working directory
return locales.sort
end
# Returns the number of available locales
def self.count
return self.list_locales.count
end
def self.list_pluralizations
- path_to_pluralizations = 'rails/pluralization'
- Dir.chdir(path_to_pluralizations)
+ Dir.chdir(@path_to_pluralizations)
? +
pluralization_files = Dir.glob('*.rb')
pluralizations = pluralization_files.map{ |f| File.basename(f, '.rb') }
Dir.chdir('../..') # reset working directory
return pluralizations.sort
end
# Returns pluralizations that do not have a locale file
def self.orphan_pluralizations
return self.list_pluralizations.difference(self.list_locales)
end
# Returns locales that do not have a pluralization file
def self.orphan_locales
return self.list_locales.difference(self.list_pluralizations)
end
end
| 10 | 0.27027 | 6 | 4 |
dcb9cd451b520cda3e5d2fa0cfc1a8eea60a8ff7 | test/species/CMakeLists.txt | test/species/CMakeLists.txt | set( TEST_SPECIES_SOURCES test_species.cc )
set( SPECIES_SOURCES
"../../src/common/serialization.cc"
"../../src/common/species.cc"
)
include_directories(
"../../include/fish_annotator/common"
)
if( WIN32 )
add_executable( test_species WIN32
${TEST_SPECIES_SOURCES}
${SPECIES_SOURCES}
)
target_link_libraries(
test_species
${WINDOWS_LIBRARIES}
Qt5::Test
${QT_THIRD_PARTY_LIBS}
)
set_target_properties(
test_species
PROPERTIES
LINK_FLAGS "${LINK_FLAGS} /SUBSYSTEM:CONSOLE"
)
add_test(
NAME test_species
COMMAND test_species
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release"
)
set_tests_properties(
test_species PROPERTIES
FAIL_REGULAR_EXPRESSION "FAIL"
)
endif()
| set( TEST_SPECIES_SOURCES test_species.cc )
set( SPECIES_SOURCES
"../../src/common/serialization.cc"
"../../src/common/species.cc"
)
include_directories(
"../../include/fish_annotator/common"
)
if( WIN32 )
add_executable( test_species WIN32
${TEST_SPECIES_SOURCES}
${SPECIES_SOURCES}
)
target_link_libraries(
test_species
${WINDOWS_LIBRARIES}
Qt5::Test
${QT_THIRD_PARTY_LIBS}
)
set_target_properties(
test_species
PROPERTIES
LINK_FLAGS "${LINK_FLAGS} /SUBSYSTEM:CONSOLE"
)
add_test(
NAME test_species
COMMAND test_species
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release"
)
set_tests_properties(
test_species PROPERTIES
FAIL_REGULAR_EXPRESSION "FAIL"
)
elseif( APPLE )
add_executable( test_species
${TEST_SPECIES_SOURCES}
${SPECIES_SOURCES}
)
target_link_libraries(
test_species
${APPLE_LIBRARIES}
Qt5::Test
${QT_THIRD_PARTY_LIBS}
)
add_test(
NAME test_species
COMMAND test_species
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
set_tests_properties(
test_species PROPERTIES
FAIL_REGULAR_EXPRESSION "FAIL"
)
endif()
| Add species test to mac build | Add species test to mac build
| Text | mit | BGWoodward/FishDetector | text | ## Code Before:
set( TEST_SPECIES_SOURCES test_species.cc )
set( SPECIES_SOURCES
"../../src/common/serialization.cc"
"../../src/common/species.cc"
)
include_directories(
"../../include/fish_annotator/common"
)
if( WIN32 )
add_executable( test_species WIN32
${TEST_SPECIES_SOURCES}
${SPECIES_SOURCES}
)
target_link_libraries(
test_species
${WINDOWS_LIBRARIES}
Qt5::Test
${QT_THIRD_PARTY_LIBS}
)
set_target_properties(
test_species
PROPERTIES
LINK_FLAGS "${LINK_FLAGS} /SUBSYSTEM:CONSOLE"
)
add_test(
NAME test_species
COMMAND test_species
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release"
)
set_tests_properties(
test_species PROPERTIES
FAIL_REGULAR_EXPRESSION "FAIL"
)
endif()
## Instruction:
Add species test to mac build
## Code After:
set( TEST_SPECIES_SOURCES test_species.cc )
set( SPECIES_SOURCES
"../../src/common/serialization.cc"
"../../src/common/species.cc"
)
include_directories(
"../../include/fish_annotator/common"
)
if( WIN32 )
add_executable( test_species WIN32
${TEST_SPECIES_SOURCES}
${SPECIES_SOURCES}
)
target_link_libraries(
test_species
${WINDOWS_LIBRARIES}
Qt5::Test
${QT_THIRD_PARTY_LIBS}
)
set_target_properties(
test_species
PROPERTIES
LINK_FLAGS "${LINK_FLAGS} /SUBSYSTEM:CONSOLE"
)
add_test(
NAME test_species
COMMAND test_species
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release"
)
set_tests_properties(
test_species PROPERTIES
FAIL_REGULAR_EXPRESSION "FAIL"
)
elseif( APPLE )
add_executable( test_species
${TEST_SPECIES_SOURCES}
${SPECIES_SOURCES}
)
target_link_libraries(
test_species
${APPLE_LIBRARIES}
Qt5::Test
${QT_THIRD_PARTY_LIBS}
)
add_test(
NAME test_species
COMMAND test_species
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
set_tests_properties(
test_species PROPERTIES
FAIL_REGULAR_EXPRESSION "FAIL"
)
endif()
| set( TEST_SPECIES_SOURCES test_species.cc )
set( SPECIES_SOURCES
"../../src/common/serialization.cc"
"../../src/common/species.cc"
)
include_directories(
"../../include/fish_annotator/common"
)
if( WIN32 )
add_executable( test_species WIN32
${TEST_SPECIES_SOURCES}
${SPECIES_SOURCES}
)
target_link_libraries(
test_species
${WINDOWS_LIBRARIES}
Qt5::Test
${QT_THIRD_PARTY_LIBS}
)
set_target_properties(
test_species
PROPERTIES
LINK_FLAGS "${LINK_FLAGS} /SUBSYSTEM:CONSOLE"
)
add_test(
NAME test_species
COMMAND test_species
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/Release"
)
set_tests_properties(
test_species PROPERTIES
FAIL_REGULAR_EXPRESSION "FAIL"
)
+ elseif( APPLE )
+ add_executable( test_species
+ ${TEST_SPECIES_SOURCES}
+ ${SPECIES_SOURCES}
+ )
+ target_link_libraries(
+ test_species
+ ${APPLE_LIBRARIES}
+ Qt5::Test
+ ${QT_THIRD_PARTY_LIBS}
+ )
+ add_test(
+ NAME test_species
+ COMMAND test_species
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ )
+ set_tests_properties(
+ test_species PROPERTIES
+ FAIL_REGULAR_EXPRESSION "FAIL"
+ )
endif() | 20 | 0.588235 | 20 | 0 |
1b397fcaf74953b69b0a5d40a197dcea24078a07 | app/components/Nav/index.css | app/components/Nav/index.css | .Nav {
overflow-y: scroll;
background: #264653;
}
.Nav-menu {
list-style: none;
margin: 0;
padding: 0;
}
.Nav-menuItem {
padding: 0;
margin: 0;
}
.Nav-menuItemLink {
padding: 0.5em 1em;
color: #fff;
display: block;
text-decoration: none;
white-space: nowrap;
font-size: 16px;
font-weight: 300;
opacity: 0.54;
}
.Nav-menuItemLink--active,
.Nav-menuItemLink:hover {
background: #6c93ad;
}
.Nav-menuItemLink--active {
opacity: 1;
}
.Nav-menuHeading {
padding: 0.5em 1em;
text-transform: uppercase;
font-size:110%;
color: #6c93ad;
display: block;
text-decoration: none;
white-space: nowrap;
}
.Nav-brand {
display: block;
background-repeat: no-repeat;
background-image: url('../../images/logo.svg');
width: 160px;
height: 41px;
text-indent: -9999px;
margin: 1em;
}
| .Nav {
overflow-y: scroll;
background: #264653;
}
.Nav-menu {
list-style: none;
margin: 0;
padding: 0;
}
.Nav-menuItem {
padding: 0;
margin: 0;
}
.Nav-menuItemLink {
padding: 0.5em 1em;
color: #fff;
display: block;
text-decoration: none;
white-space: nowrap;
font-size: 16px;
font-weight: 300;
opacity: 0.54;
}
.Nav-menuItemLink--active,
.Nav-menuItemLink:hover {
background: #6c93ad;
}
.Nav-menuItemLink--active {
opacity: 1;
}
.Nav-menuHeading {
padding: 1.25em 1em 0.25em 1em;
text-transform: uppercase;
font-size:110%;
color: #6c93ad;
display: block;
text-decoration: none;
white-space: nowrap;
}
.Nav-brand {
display: block;
background-repeat: no-repeat;
background-image: url('../../images/logo.svg');
width: 160px;
height: 41px;
text-indent: -9999px;
margin: 1em;
}
| Increase padding on navigation headers | Increase padding on navigation headers
| CSS | mit | transparantnederland/browser,waagsociety/tnl-relationizer,transparantnederland/relationizer,transparantnederland/relationizer,transparantnederland/browser,waagsociety/tnl-relationizer | css | ## Code Before:
.Nav {
overflow-y: scroll;
background: #264653;
}
.Nav-menu {
list-style: none;
margin: 0;
padding: 0;
}
.Nav-menuItem {
padding: 0;
margin: 0;
}
.Nav-menuItemLink {
padding: 0.5em 1em;
color: #fff;
display: block;
text-decoration: none;
white-space: nowrap;
font-size: 16px;
font-weight: 300;
opacity: 0.54;
}
.Nav-menuItemLink--active,
.Nav-menuItemLink:hover {
background: #6c93ad;
}
.Nav-menuItemLink--active {
opacity: 1;
}
.Nav-menuHeading {
padding: 0.5em 1em;
text-transform: uppercase;
font-size:110%;
color: #6c93ad;
display: block;
text-decoration: none;
white-space: nowrap;
}
.Nav-brand {
display: block;
background-repeat: no-repeat;
background-image: url('../../images/logo.svg');
width: 160px;
height: 41px;
text-indent: -9999px;
margin: 1em;
}
## Instruction:
Increase padding on navigation headers
## Code After:
.Nav {
overflow-y: scroll;
background: #264653;
}
.Nav-menu {
list-style: none;
margin: 0;
padding: 0;
}
.Nav-menuItem {
padding: 0;
margin: 0;
}
.Nav-menuItemLink {
padding: 0.5em 1em;
color: #fff;
display: block;
text-decoration: none;
white-space: nowrap;
font-size: 16px;
font-weight: 300;
opacity: 0.54;
}
.Nav-menuItemLink--active,
.Nav-menuItemLink:hover {
background: #6c93ad;
}
.Nav-menuItemLink--active {
opacity: 1;
}
.Nav-menuHeading {
padding: 1.25em 1em 0.25em 1em;
text-transform: uppercase;
font-size:110%;
color: #6c93ad;
display: block;
text-decoration: none;
white-space: nowrap;
}
.Nav-brand {
display: block;
background-repeat: no-repeat;
background-image: url('../../images/logo.svg');
width: 160px;
height: 41px;
text-indent: -9999px;
margin: 1em;
}
| .Nav {
overflow-y: scroll;
background: #264653;
}
.Nav-menu {
list-style: none;
margin: 0;
padding: 0;
}
.Nav-menuItem {
padding: 0;
margin: 0;
}
.Nav-menuItemLink {
padding: 0.5em 1em;
color: #fff;
display: block;
text-decoration: none;
white-space: nowrap;
font-size: 16px;
font-weight: 300;
opacity: 0.54;
}
.Nav-menuItemLink--active,
.Nav-menuItemLink:hover {
background: #6c93ad;
}
.Nav-menuItemLink--active {
opacity: 1;
}
.Nav-menuHeading {
- padding: 0.5em 1em;
+ padding: 1.25em 1em 0.25em 1em;
? +++++++++++ +
text-transform: uppercase;
font-size:110%;
color: #6c93ad;
display: block;
text-decoration: none;
white-space: nowrap;
}
.Nav-brand {
display: block;
background-repeat: no-repeat;
background-image: url('../../images/logo.svg');
width: 160px;
height: 41px;
text-indent: -9999px;
margin: 1em;
} | 2 | 0.035714 | 1 | 1 |
1f881a47d2d1159c339414a3f2b92cf109a3c349 | docs/_data/navigation.yaml | docs/_data/navigation.yaml | main:
- title: "Docs"
url: /plank/docs/getting-started/tutorial.html
- title: "GitHub"
url: https://github.com/pinterest/plank
new_window: true | main:
- title: "Docs"
url: /plank/docs/getting-started/installation.html
- title: "GitHub"
url: https://github.com/pinterest/plank
new_window: true
| Update "Docs" link in header to point to "Installation" | Update "Docs" link in header to point to "Installation"
| YAML | apache-2.0 | pinterest/plank,pinterest/plank,maicki/plank,pinterest/plank,maicki/plank,pinterest/plank,maicki/plank,maicki/plank | yaml | ## Code Before:
main:
- title: "Docs"
url: /plank/docs/getting-started/tutorial.html
- title: "GitHub"
url: https://github.com/pinterest/plank
new_window: true
## Instruction:
Update "Docs" link in header to point to "Installation"
## Code After:
main:
- title: "Docs"
url: /plank/docs/getting-started/installation.html
- title: "GitHub"
url: https://github.com/pinterest/plank
new_window: true
| main:
- title: "Docs"
- url: /plank/docs/getting-started/tutorial.html
? -----
+ url: /plank/docs/getting-started/installation.html
? +++ ++++++
- title: "GitHub"
url: https://github.com/pinterest/plank
new_window: true | 2 | 0.333333 | 1 | 1 |
7444dda53e8f3e564cd0cb7d7db5dc9e5bc3f5ae | plugins/groovy/src/org/jetbrains/plugins/groovy/util/ClassInstanceCache.java | plugins/groovy/src/org/jetbrains/plugins/groovy/util/ClassInstanceCache.java | package org.jetbrains.plugins.groovy.util;
import com.intellij.util.containers.ConcurrentHashMap;
import org.jetbrains.annotations.NotNull;
/**
* @author Sergey Evdokimov
*/
public class ClassInstanceCache {
private static final ConcurrentHashMap<String, Object> CACHE = new ConcurrentHashMap<String, Object>();
private ClassInstanceCache() {
}
@SuppressWarnings("unchecked")
public static <T> T getInstance(@NotNull String className) {
Object res = CACHE.get(className);
if (res != null) return (T)res;
try {
Object instance = Class.forName(className).newInstance();
Object oldValue = CACHE.putIfAbsent(className, instance);
if (oldValue != null) {
instance = oldValue;
}
return (T)instance;
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
}
| package org.jetbrains.plugins.groovy.util;
import com.intellij.ide.plugins.IdeaPluginDescriptor;
import com.intellij.ide.plugins.PluginManager;
import com.intellij.util.containers.ConcurrentHashMap;
import org.jetbrains.annotations.NotNull;
/**
* @author Sergey Evdokimov
*/
public class ClassInstanceCache {
private static final ConcurrentHashMap<String, Object> CACHE = new ConcurrentHashMap<String, Object>();
private ClassInstanceCache() {
}
private static Object createInstance(@NotNull String className) {
try {
try {
return Class.forName(className).newInstance();
}
catch (ClassNotFoundException e) {
for (IdeaPluginDescriptor descriptor : PluginManager.getPlugins()) {
try {
return descriptor.getPluginClassLoader().loadClass(className).newInstance();
}
catch (ClassNotFoundException ignored) {
}
}
throw new RuntimeException("Class not found: " + className);
}
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
@SuppressWarnings("unchecked")
public static <T> T getInstance(@NotNull String className) {
Object res = CACHE.get(className);
if (res == null) {
res = createInstance(className);
Object oldValue = CACHE.putIfAbsent(className, res);
if (oldValue != null) {
res = oldValue;
}
}
return (T)res;
}
}
| Fix EA-30104: ClassNotFound exception: Don't forget that plugins loaded by different class loader. | Fix EA-30104: ClassNotFound exception: Don't forget that plugins loaded by different class loader.
| Java | apache-2.0 | tmpgit/intellij-community,ahb0327/intellij-community,TangHao1987/intellij-community,mglukhikh/intellij-community,asedunov/intellij-community,youdonghai/intellij-community,ivan-fedorov/intellij-community,signed/intellij-community,michaelgallacher/intellij-community,slisson/intellij-community,Lekanich/intellij-community,fengbaicanhe/intellij-community,lucafavatella/intellij-community,gnuhub/intellij-community,vvv1559/intellij-community,FHannes/intellij-community,pwoodworth/intellij-community,xfournet/intellij-community,youdonghai/intellij-community,tmpgit/intellij-community,izonder/intellij-community,kool79/intellij-community,Distrotech/intellij-community,ivan-fedorov/intellij-community,tmpgit/intellij-community,petteyg/intellij-community,dslomov/intellij-community,wreckJ/intellij-community,da1z/intellij-community,supersven/intellij-community,izonder/intellij-community,gnuhub/intellij-community,idea4bsd/idea4bsd,kool79/intellij-community,da1z/intellij-community,michaelgallacher/intellij-community,da1z/intellij-community,ivan-fedorov/intellij-community,supersven/intellij-community,alphafoobar/intellij-community,gnuhub/intellij-community,samthor/intellij-community,michaelgallacher/intellij-community,alphafoobar/intellij-community,dslomov/intellij-community,muntasirsyed/intellij-community,semonte/intellij-community,mglukhikh/intellij-community,ThiagoGarciaAlves/intellij-community,tmpgit/intellij-community,petteyg/intellij-community,youdonghai/intellij-community,ftomassetti/intellij-community,retomerz/intellij-community,diorcety/intellij-community,izonder/intellij-community,hurricup/intellij-community,FHannes/intellij-community,xfournet/intellij-community,orekyuu/intellij-community,signed/intellij-community,supersven/intellij-community,allotria/intellij-community,fengbaicanhe/intellij-community,MichaelNedzelsky/intellij-community,amith01994/intellij-community,adedayo/intellij-community,lucafavatella/intellij-community,Lekanich/intellij-community,ryano144/intellij-community,izonder/intellij-community,vvv1559/intellij-community,ibinti/intellij-community,MichaelNedzelsky/intellij-community,orekyuu/intellij-community,adedayo/intellij-community,ahb0327/intellij-community,signed/intellij-community,idea4bsd/idea4bsd,semonte/intellij-community,kdwink/intellij-community,ryano144/intellij-community,orekyuu/intellij-community,Lekanich/intellij-community,ibinti/intellij-community,ol-loginov/intellij-community,kool79/intellij-community,FHannes/intellij-community,amith01994/intellij-community,suncycheng/intellij-community,jagguli/intellij-community,ivan-fedorov/intellij-community,ftomassetti/intellij-community,akosyakov/intellij-community,allotria/intellij-community,ahb0327/intellij-community,SerCeMan/intellij-community,alphafoobar/intellij-community,fitermay/intellij-community,salguarnieri/intellij-community,MichaelNedzelsky/intellij-community,gnuhub/intellij-community,nicolargo/intellij-community,salguarnieri/intellij-community,xfournet/intellij-community,xfournet/intellij-community,allotria/intellij-community,pwoodworth/intellij-community,petteyg/intellij-community,adedayo/intellij-community,dslomov/intellij-community,MichaelNedzelsky/intellij-community,pwoodworth/intellij-community,diorcety/intellij-community,alphafoobar/intellij-community,ibinti/intellij-community,ThiagoGarciaAlves/intellij-community,mglukhikh/intellij-community,blademainer/intellij-community,FHannes/intellij-community,ol-loginov/intellij-community,dslomov/intellij-community,MER-GROUP/intellij-community,pwoodworth/intellij-community,MER-GROUP/intellij-community,apixandru/intellij-community,amith01994/intellij-community,consulo/consulo,Distrotech/intellij-community,gnuhub/intellij-community,orekyuu/intellij-community,xfournet/intellij-community,allotria/intellij-community,MER-GROUP/intellij-community,muntasirsyed/intellij-community,adedayo/intellij-community,youdonghai/intellij-community,muntasirsyed/intellij-community,ibinti/intellij-community,blademainer/intellij-community,fitermay/intellij-community,samthor/intellij-community,izonder/intellij-community,vvv1559/intellij-community,signed/intellij-community,diorcety/intellij-community,idea4bsd/idea4bsd,fnouama/intellij-community,fnouama/intellij-community,amith01994/intellij-community,lucafavatella/intellij-community,hurricup/intellij-community,apixandru/intellij-community,TangHao1987/intellij-community,MichaelNedzelsky/intellij-community,retomerz/intellij-community,vladmm/intellij-community,suncycheng/intellij-community,TangHao1987/intellij-community,holmes/intellij-community,jagguli/intellij-community,xfournet/intellij-community,petteyg/intellij-community,suncycheng/intellij-community,wreckJ/intellij-community,ahb0327/intellij-community,signed/intellij-community,ahb0327/intellij-community,slisson/intellij-community,adedayo/intellij-community,hurricup/intellij-community,alphafoobar/intellij-community,fitermay/intellij-community,ahb0327/intellij-community,ibinti/intellij-community,fengbaicanhe/intellij-community,pwoodworth/intellij-community,michaelgallacher/intellij-community,alphafoobar/intellij-community,blademainer/intellij-community,ibinti/intellij-community,wreckJ/intellij-community,TangHao1987/intellij-community,idea4bsd/idea4bsd,michaelgallacher/intellij-community,ThiagoGarciaAlves/intellij-community,asedunov/intellij-community,akosyakov/intellij-community,ivan-fedorov/intellij-community,diorcety/intellij-community,wreckJ/intellij-community,kool79/intellij-community,izonder/intellij-community,izonder/intellij-community,akosyakov/intellij-community,asedunov/intellij-community,semonte/intellij-community,slisson/intellij-community,FHannes/intellij-community,SerCeMan/intellij-community,consulo/consulo,Distrotech/intellij-community,youdonghai/intellij-community,slisson/intellij-community,jagguli/intellij-community,wreckJ/intellij-community,SerCeMan/intellij-community,amith01994/intellij-community,slisson/intellij-community,vladmm/intellij-community,youdonghai/intellij-community,gnuhub/intellij-community,blademainer/intellij-community,alphafoobar/intellij-community,ryano144/intellij-community,samthor/intellij-community,fitermay/intellij-community,akosyakov/intellij-community,da1z/intellij-community,hurricup/intellij-community,apixandru/intellij-community,wreckJ/intellij-community,da1z/intellij-community,adedayo/intellij-community,michaelgallacher/intellij-community,ibinti/intellij-community,fnouama/intellij-community,kdwink/intellij-community,vvv1559/intellij-community,mglukhikh/intellij-community,kdwink/intellij-community,kdwink/intellij-community,vladmm/intellij-community,gnuhub/intellij-community,robovm/robovm-studio,fitermay/intellij-community,petteyg/intellij-community,signed/intellij-community,dslomov/intellij-community,consulo/consulo,consulo/consulo,ol-loginov/intellij-community,mglukhikh/intellij-community,SerCeMan/intellij-community,tmpgit/intellij-community,supersven/intellij-community,FHannes/intellij-community,jagguli/intellij-community,da1z/intellij-community,hurricup/intellij-community,kdwink/intellij-community,mglukhikh/intellij-community,michaelgallacher/intellij-community,michaelgallacher/intellij-community,dslomov/intellij-community,fnouama/intellij-community,caot/intellij-community,gnuhub/intellij-community,apixandru/intellij-community,salguarnieri/intellij-community,Lekanich/intellij-community,nicolargo/intellij-community,caot/intellij-community,dslomov/intellij-community,akosyakov/intellij-community,supersven/intellij-community,idea4bsd/idea4bsd,tmpgit/intellij-community,vvv1559/intellij-community,FHannes/intellij-community,semonte/intellij-community,nicolargo/intellij-community,Lekanich/intellij-community,SerCeMan/intellij-community,allotria/intellij-community,ryano144/intellij-community,idea4bsd/idea4bsd,slisson/intellij-community,allotria/intellij-community,asedunov/intellij-community,ftomassetti/intellij-community,holmes/intellij-community,Distrotech/intellij-community,clumsy/intellij-community,orekyuu/intellij-community,mglukhikh/intellij-community,youdonghai/intellij-community,youdonghai/intellij-community,kdwink/intellij-community,samthor/intellij-community,muntasirsyed/intellij-community,vvv1559/intellij-community,nicolargo/intellij-community,holmes/intellij-community,petteyg/intellij-community,supersven/intellij-community,blademainer/intellij-community,idea4bsd/idea4bsd,kool79/intellij-community,retomerz/intellij-community,ftomassetti/intellij-community,signed/intellij-community,retomerz/intellij-community,robovm/robovm-studio,gnuhub/intellij-community,Distrotech/intellij-community,asedunov/intellij-community,semonte/intellij-community,suncycheng/intellij-community,TangHao1987/intellij-community,holmes/intellij-community,amith01994/intellij-community,asedunov/intellij-community,semonte/intellij-community,retomerz/intellij-community,jagguli/intellij-community,vladmm/intellij-community,MichaelNedzelsky/intellij-community,orekyuu/intellij-community,idea4bsd/idea4bsd,dslomov/intellij-community,ThiagoGarciaAlves/intellij-community,suncycheng/intellij-community,hurricup/intellij-community,retomerz/intellij-community,clumsy/intellij-community,vvv1559/intellij-community,pwoodworth/intellij-community,kdwink/intellij-community,retomerz/intellij-community,clumsy/intellij-community,tmpgit/intellij-community,vvv1559/intellij-community,signed/intellij-community,tmpgit/intellij-community,salguarnieri/intellij-community,ryano144/intellij-community,nicolargo/intellij-community,da1z/intellij-community,semonte/intellij-community,MER-GROUP/intellij-community,da1z/intellij-community,caot/intellij-community,MER-GROUP/intellij-community,semonte/intellij-community,wreckJ/intellij-community,retomerz/intellij-community,lucafavatella/intellij-community,lucafavatella/intellij-community,FHannes/intellij-community,mglukhikh/intellij-community,vvv1559/intellij-community,kdwink/intellij-community,idea4bsd/idea4bsd,MER-GROUP/intellij-community,robovm/robovm-studio,hurricup/intellij-community,jagguli/intellij-community,ryano144/intellij-community,clumsy/intellij-community,vladmm/intellij-community,fitermay/intellij-community,vvv1559/intellij-community,xfournet/intellij-community,samthor/intellij-community,caot/intellij-community,alphafoobar/intellij-community,consulo/consulo,caot/intellij-community,ahb0327/intellij-community,petteyg/intellij-community,holmes/intellij-community,Lekanich/intellij-community,idea4bsd/idea4bsd,fnouama/intellij-community,fengbaicanhe/intellij-community,robovm/robovm-studio,nicolargo/intellij-community,kool79/intellij-community,nicolargo/intellij-community,semonte/intellij-community,alphafoobar/intellij-community,salguarnieri/intellij-community,xfournet/intellij-community,wreckJ/intellij-community,FHannes/intellij-community,suncycheng/intellij-community,fengbaicanhe/intellij-community,izonder/intellij-community,holmes/intellij-community,wreckJ/intellij-community,allotria/intellij-community,semonte/intellij-community,tmpgit/intellij-community,salguarnieri/intellij-community,ernestp/consulo,youdonghai/intellij-community,MichaelNedzelsky/intellij-community,nicolargo/intellij-community,alphafoobar/intellij-community,supersven/intellij-community,salguarnieri/intellij-community,hurricup/intellij-community,slisson/intellij-community,youdonghai/intellij-community,Distrotech/intellij-community,amith01994/intellij-community,idea4bsd/idea4bsd,SerCeMan/intellij-community,Distrotech/intellij-community,MER-GROUP/intellij-community,ol-loginov/intellij-community,adedayo/intellij-community,akosyakov/intellij-community,Distrotech/intellij-community,ivan-fedorov/intellij-community,allotria/intellij-community,fengbaicanhe/intellij-community,caot/intellij-community,apixandru/intellij-community,samthor/intellij-community,blademainer/intellij-community,retomerz/intellij-community,supersven/intellij-community,Lekanich/intellij-community,apixandru/intellij-community,pwoodworth/intellij-community,clumsy/intellij-community,ahb0327/intellij-community,muntasirsyed/intellij-community,MichaelNedzelsky/intellij-community,holmes/intellij-community,allotria/intellij-community,holmes/intellij-community,blademainer/intellij-community,jagguli/intellij-community,blademainer/intellij-community,kdwink/intellij-community,mglukhikh/intellij-community,ernestp/consulo,asedunov/intellij-community,robovm/robovm-studio,akosyakov/intellij-community,suncycheng/intellij-community,wreckJ/intellij-community,SerCeMan/intellij-community,ol-loginov/intellij-community,izonder/intellij-community,blademainer/intellij-community,fitermay/intellij-community,dslomov/intellij-community,gnuhub/intellij-community,akosyakov/intellij-community,diorcety/intellij-community,FHannes/intellij-community,consulo/consulo,robovm/robovm-studio,ibinti/intellij-community,holmes/intellij-community,mglukhikh/intellij-community,clumsy/intellij-community,idea4bsd/idea4bsd,SerCeMan/intellij-community,orekyuu/intellij-community,TangHao1987/intellij-community,vladmm/intellij-community,kdwink/intellij-community,hurricup/intellij-community,akosyakov/intellij-community,MER-GROUP/intellij-community,caot/intellij-community,lucafavatella/intellij-community,signed/intellij-community,adedayo/intellij-community,ivan-fedorov/intellij-community,fitermay/intellij-community,pwoodworth/intellij-community,MER-GROUP/intellij-community,allotria/intellij-community,retomerz/intellij-community,ibinti/intellij-community,ftomassetti/intellij-community,michaelgallacher/intellij-community,slisson/intellij-community,orekyuu/intellij-community,diorcety/intellij-community,ThiagoGarciaAlves/intellij-community,fengbaicanhe/intellij-community,semonte/intellij-community,lucafavatella/intellij-community,Lekanich/intellij-community,adedayo/intellij-community,clumsy/intellij-community,apixandru/intellij-community,ahb0327/intellij-community,ThiagoGarciaAlves/intellij-community,samthor/intellij-community,clumsy/intellij-community,fengbaicanhe/intellij-community,ivan-fedorov/intellij-community,akosyakov/intellij-community,vvv1559/intellij-community,robovm/robovm-studio,muntasirsyed/intellij-community,fnouama/intellij-community,robovm/robovm-studio,diorcety/intellij-community,gnuhub/intellij-community,ThiagoGarciaAlves/intellij-community,ThiagoGarciaAlves/intellij-community,fnouama/intellij-community,kool79/intellij-community,vladmm/intellij-community,FHannes/intellij-community,vladmm/intellij-community,SerCeMan/intellij-community,muntasirsyed/intellij-community,orekyuu/intellij-community,youdonghai/intellij-community,hurricup/intellij-community,ftomassetti/intellij-community,kool79/intellij-community,caot/intellij-community,vvv1559/intellij-community,Lekanich/intellij-community,fengbaicanhe/intellij-community,ol-loginov/intellij-community,semonte/intellij-community,diorcety/intellij-community,petteyg/intellij-community,alphafoobar/intellij-community,signed/intellij-community,da1z/intellij-community,SerCeMan/intellij-community,dslomov/intellij-community,FHannes/intellij-community,samthor/intellij-community,ernestp/consulo,ol-loginov/intellij-community,diorcety/intellij-community,adedayo/intellij-community,nicolargo/intellij-community,vvv1559/intellij-community,muntasirsyed/intellij-community,amith01994/intellij-community,TangHao1987/intellij-community,allotria/intellij-community,izonder/intellij-community,samthor/intellij-community,wreckJ/intellij-community,ibinti/intellij-community,retomerz/intellij-community,caot/intellij-community,salguarnieri/intellij-community,fengbaicanhe/intellij-community,clumsy/intellij-community,idea4bsd/idea4bsd,salguarnieri/intellij-community,ThiagoGarciaAlves/intellij-community,muntasirsyed/intellij-community,ivan-fedorov/intellij-community,ftomassetti/intellij-community,samthor/intellij-community,fitermay/intellij-community,MER-GROUP/intellij-community,TangHao1987/intellij-community,clumsy/intellij-community,diorcety/intellij-community,ibinti/intellij-community,jagguli/intellij-community,suncycheng/intellij-community,fnouama/intellij-community,orekyuu/intellij-community,clumsy/intellij-community,dslomov/intellij-community,youdonghai/intellij-community,TangHao1987/intellij-community,lucafavatella/intellij-community,ftomassetti/intellij-community,ahb0327/intellij-community,vladmm/intellij-community,supersven/intellij-community,ol-loginov/intellij-community,slisson/intellij-community,asedunov/intellij-community,supersven/intellij-community,holmes/intellij-community,ThiagoGarciaAlves/intellij-community,supersven/intellij-community,apixandru/intellij-community,MER-GROUP/intellij-community,asedunov/intellij-community,mglukhikh/intellij-community,ryano144/intellij-community,akosyakov/intellij-community,petteyg/intellij-community,ahb0327/intellij-community,akosyakov/intellij-community,suncycheng/intellij-community,xfournet/intellij-community,fengbaicanhe/intellij-community,amith01994/intellij-community,ivan-fedorov/intellij-community,MichaelNedzelsky/intellij-community,jagguli/intellij-community,xfournet/intellij-community,diorcety/intellij-community,ryano144/intellij-community,ryano144/intellij-community,salguarnieri/intellij-community,michaelgallacher/intellij-community,petteyg/intellij-community,robovm/robovm-studio,fnouama/intellij-community,fengbaicanhe/intellij-community,kool79/intellij-community,apixandru/intellij-community,lucafavatella/intellij-community,retomerz/intellij-community,salguarnieri/intellij-community,SerCeMan/intellij-community,wreckJ/intellij-community,muntasirsyed/intellij-community,slisson/intellij-community,ryano144/intellij-community,michaelgallacher/intellij-community,apixandru/intellij-community,ol-loginov/intellij-community,kool79/intellij-community,fitermay/intellij-community,nicolargo/intellij-community,jagguli/intellij-community,FHannes/intellij-community,fitermay/intellij-community,asedunov/intellij-community,ibinti/intellij-community,holmes/intellij-community,blademainer/intellij-community,robovm/robovm-studio,jagguli/intellij-community,xfournet/intellij-community,diorcety/intellij-community,lucafavatella/intellij-community,ernestp/consulo,slisson/intellij-community,orekyuu/intellij-community,youdonghai/intellij-community,semonte/intellij-community,ivan-fedorov/intellij-community,izonder/intellij-community,michaelgallacher/intellij-community,SerCeMan/intellij-community,mglukhikh/intellij-community,Distrotech/intellij-community,kool79/intellij-community,vladmm/intellij-community,allotria/intellij-community,ahb0327/intellij-community,asedunov/intellij-community,Distrotech/intellij-community,pwoodworth/intellij-community,ibinti/intellij-community,nicolargo/intellij-community,MER-GROUP/intellij-community,jagguli/intellij-community,dslomov/intellij-community,ol-loginov/intellij-community,ernestp/consulo,TangHao1987/intellij-community,asedunov/intellij-community,pwoodworth/intellij-community,signed/intellij-community,ThiagoGarciaAlves/intellij-community,ftomassetti/intellij-community,salguarnieri/intellij-community,da1z/intellij-community,mglukhikh/intellij-community,pwoodworth/intellij-community,ThiagoGarciaAlves/intellij-community,xfournet/intellij-community,xfournet/intellij-community,da1z/intellij-community,petteyg/intellij-community,hurricup/intellij-community,gnuhub/intellij-community,alphafoobar/intellij-community,ernestp/consulo,TangHao1987/intellij-community,fnouama/intellij-community,ol-loginov/intellij-community,samthor/intellij-community,MichaelNedzelsky/intellij-community,robovm/robovm-studio,signed/intellij-community,adedayo/intellij-community,fnouama/intellij-community,robovm/robovm-studio,fitermay/intellij-community,ftomassetti/intellij-community,samthor/intellij-community,signed/intellij-community,vladmm/intellij-community,apixandru/intellij-community,hurricup/intellij-community,ftomassetti/intellij-community,lucafavatella/intellij-community,vladmm/intellij-community,ryano144/intellij-community,fitermay/intellij-community,nicolargo/intellij-community,orekyuu/intellij-community,kdwink/intellij-community,ryano144/intellij-community,blademainer/intellij-community,slisson/intellij-community,apixandru/intellij-community,suncycheng/intellij-community,clumsy/intellij-community,allotria/intellij-community,Lekanich/intellij-community,kdwink/intellij-community,amith01994/intellij-community,ol-loginov/intellij-community,ftomassetti/intellij-community,Distrotech/intellij-community,Lekanich/intellij-community,da1z/intellij-community,apixandru/intellij-community,TangHao1987/intellij-community,supersven/intellij-community,suncycheng/intellij-community,lucafavatella/intellij-community,caot/intellij-community,muntasirsyed/intellij-community,suncycheng/intellij-community,caot/intellij-community,hurricup/intellij-community,fnouama/intellij-community,MichaelNedzelsky/intellij-community,tmpgit/intellij-community,Lekanich/intellij-community,blademainer/intellij-community,apixandru/intellij-community,retomerz/intellij-community,da1z/intellij-community,pwoodworth/intellij-community,lucafavatella/intellij-community,Distrotech/intellij-community,kool79/intellij-community,asedunov/intellij-community,muntasirsyed/intellij-community,tmpgit/intellij-community,izonder/intellij-community,amith01994/intellij-community,ivan-fedorov/intellij-community,adedayo/intellij-community,petteyg/intellij-community,amith01994/intellij-community,caot/intellij-community,tmpgit/intellij-community,MichaelNedzelsky/intellij-community,holmes/intellij-community | java | ## Code Before:
package org.jetbrains.plugins.groovy.util;
import com.intellij.util.containers.ConcurrentHashMap;
import org.jetbrains.annotations.NotNull;
/**
* @author Sergey Evdokimov
*/
public class ClassInstanceCache {
private static final ConcurrentHashMap<String, Object> CACHE = new ConcurrentHashMap<String, Object>();
private ClassInstanceCache() {
}
@SuppressWarnings("unchecked")
public static <T> T getInstance(@NotNull String className) {
Object res = CACHE.get(className);
if (res != null) return (T)res;
try {
Object instance = Class.forName(className).newInstance();
Object oldValue = CACHE.putIfAbsent(className, instance);
if (oldValue != null) {
instance = oldValue;
}
return (T)instance;
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
}
## Instruction:
Fix EA-30104: ClassNotFound exception: Don't forget that plugins loaded by different class loader.
## Code After:
package org.jetbrains.plugins.groovy.util;
import com.intellij.ide.plugins.IdeaPluginDescriptor;
import com.intellij.ide.plugins.PluginManager;
import com.intellij.util.containers.ConcurrentHashMap;
import org.jetbrains.annotations.NotNull;
/**
* @author Sergey Evdokimov
*/
public class ClassInstanceCache {
private static final ConcurrentHashMap<String, Object> CACHE = new ConcurrentHashMap<String, Object>();
private ClassInstanceCache() {
}
private static Object createInstance(@NotNull String className) {
try {
try {
return Class.forName(className).newInstance();
}
catch (ClassNotFoundException e) {
for (IdeaPluginDescriptor descriptor : PluginManager.getPlugins()) {
try {
return descriptor.getPluginClassLoader().loadClass(className).newInstance();
}
catch (ClassNotFoundException ignored) {
}
}
throw new RuntimeException("Class not found: " + className);
}
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
@SuppressWarnings("unchecked")
public static <T> T getInstance(@NotNull String className) {
Object res = CACHE.get(className);
if (res == null) {
res = createInstance(className);
Object oldValue = CACHE.putIfAbsent(className, res);
if (oldValue != null) {
res = oldValue;
}
}
return (T)res;
}
}
| package org.jetbrains.plugins.groovy.util;
+ import com.intellij.ide.plugins.IdeaPluginDescriptor;
+ import com.intellij.ide.plugins.PluginManager;
import com.intellij.util.containers.ConcurrentHashMap;
import org.jetbrains.annotations.NotNull;
/**
* @author Sergey Evdokimov
*/
public class ClassInstanceCache {
private static final ConcurrentHashMap<String, Object> CACHE = new ConcurrentHashMap<String, Object>();
private ClassInstanceCache() {
}
- @SuppressWarnings("unchecked")
- public static <T> T getInstance(@NotNull String className) {
? ^^^ ^ ^^^ ^^^
+ private static Object createInstance(@NotNull String className) {
? ^ ^^^^ ^^^^^^ ^^ + +
- Object res = CACHE.get(className);
- if (res != null) return (T)res;
+ try {
+ try {
+ return Class.forName(className).newInstance();
+ }
+ catch (ClassNotFoundException e) {
+ for (IdeaPluginDescriptor descriptor : PluginManager.getPlugins()) {
+ try {
+ return descriptor.getPluginClassLoader().loadClass(className).newInstance();
+ }
+ catch (ClassNotFoundException ignored) {
- try {
- Object instance = Class.forName(className).newInstance();
+ }
+ }
+ throw new RuntimeException("Class not found: " + className);
- Object oldValue = CACHE.putIfAbsent(className, instance);
- if (oldValue != null) {
- instance = oldValue;
}
-
- return (T)instance;
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
+
+ @SuppressWarnings("unchecked")
+ public static <T> T getInstance(@NotNull String className) {
+ Object res = CACHE.get(className);
+ if (res == null) {
+ res = createInstance(className);
+
+ Object oldValue = CACHE.putIfAbsent(className, res);
+ if (oldValue != null) {
+ res = oldValue;
+ }
+ }
+
+ return (T)res;
+ }
} | 42 | 1.166667 | 31 | 11 |
a17c2ce30f30d0441b1475457b0bc9d04da9f143 | coil/__init__.py | coil/__init__.py | """Coil: A Configuration Library."""
__version__ = "0.2.2"
| """Coil: A Configuration Library."""
__version__ = "0.3.0"
from coil.parser import Parser
def parse_file(file_name):
"""Open and parse a coil file.
Returns the root Struct.
"""
coil = open(file_name)
return Parser(coil, file_name).root()
def parse(string):
"""Parse a coil string.
Returns the root Struct.
"""
return Parser(string.splitlines()).root()
| Add helpers for parsing files and strings | Add helpers for parsing files and strings
| Python | mit | tectronics/coil,marineam/coil,kovacsbalu/coil,kovacsbalu/coil,marineam/coil,tectronics/coil | python | ## Code Before:
"""Coil: A Configuration Library."""
__version__ = "0.2.2"
## Instruction:
Add helpers for parsing files and strings
## Code After:
"""Coil: A Configuration Library."""
__version__ = "0.3.0"
from coil.parser import Parser
def parse_file(file_name):
"""Open and parse a coil file.
Returns the root Struct.
"""
coil = open(file_name)
return Parser(coil, file_name).root()
def parse(string):
"""Parse a coil string.
Returns the root Struct.
"""
return Parser(string.splitlines()).root()
| """Coil: A Configuration Library."""
- __version__ = "0.2.2"
? ^ ^
+ __version__ = "0.3.0"
? ^ ^
+
+ from coil.parser import Parser
+
+ def parse_file(file_name):
+ """Open and parse a coil file.
+
+ Returns the root Struct.
+ """
+ coil = open(file_name)
+ return Parser(coil, file_name).root()
+
+ def parse(string):
+ """Parse a coil string.
+
+ Returns the root Struct.
+ """
+ return Parser(string.splitlines()).root() | 19 | 6.333333 | 18 | 1 |
d4ff2719cd470a8e47beebce8f62dcde30cf08ef | client/src/index.js | client/src/index.js | import initOpbeat from 'opbeat-react';
import 'opbeat-react/router';
let opbeat_app_id = process.env.REACT_APP_OPBEAT_APP_ID;
let opbeat_org_id = process.env.REACT_APP_OPBEAT_ORG_ID;
if(process.env.NODE_ENV === 'production' && opbeat_app_id && opbeat_org_id) {
initOpbeat({
appId: opbeat_app_id,
orgId: opbeat_org_id,
});
}
import React from 'react';
import ReactDOM from 'react-dom';
import { browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import configureStore from './store/configureStore';
import Routes from './routes';
const store = configureStore();
import './index.css';
import './semantic-ui/semantic.min.css';
ReactDOM.render(
<Provider store={store}>
<Routes history={browserHistory} />
</Provider>,
document.getElementById('root')
);
| import initOpbeat from 'opbeat-react';
import 'opbeat-react/router';
let opbeat_app_id = process.env.REACT_APP_OPBEAT_APP_ID;
let opbeat_org_id = process.env.REACT_APP_OPBEAT_ORG_ID;
if(process.env.NODE_ENV === 'production' && opbeat_app_id && opbeat_org_id) {
initOpbeat({
appId: opbeat_app_id,
orgId: opbeat_org_id,
performance: {
'initial-page-load': true
},
});
}
import React from 'react';
import ReactDOM from 'react-dom';
import { browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import configureStore from './store/configureStore';
import Routes from './routes';
const store = configureStore();
import './index.css';
import './semantic-ui/semantic.min.css';
ReactDOM.render(
<Provider store={store}>
<Routes history={browserHistory} />
</Provider>,
document.getElementById('root')
);
| Add Opbeat performance flag for client | Add Opbeat performance flag for client
| JavaScript | mit | opbeat/opbeans,opbeat/opbeans,opbeat/opbeans | javascript | ## Code Before:
import initOpbeat from 'opbeat-react';
import 'opbeat-react/router';
let opbeat_app_id = process.env.REACT_APP_OPBEAT_APP_ID;
let opbeat_org_id = process.env.REACT_APP_OPBEAT_ORG_ID;
if(process.env.NODE_ENV === 'production' && opbeat_app_id && opbeat_org_id) {
initOpbeat({
appId: opbeat_app_id,
orgId: opbeat_org_id,
});
}
import React from 'react';
import ReactDOM from 'react-dom';
import { browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import configureStore from './store/configureStore';
import Routes from './routes';
const store = configureStore();
import './index.css';
import './semantic-ui/semantic.min.css';
ReactDOM.render(
<Provider store={store}>
<Routes history={browserHistory} />
</Provider>,
document.getElementById('root')
);
## Instruction:
Add Opbeat performance flag for client
## Code After:
import initOpbeat from 'opbeat-react';
import 'opbeat-react/router';
let opbeat_app_id = process.env.REACT_APP_OPBEAT_APP_ID;
let opbeat_org_id = process.env.REACT_APP_OPBEAT_ORG_ID;
if(process.env.NODE_ENV === 'production' && opbeat_app_id && opbeat_org_id) {
initOpbeat({
appId: opbeat_app_id,
orgId: opbeat_org_id,
performance: {
'initial-page-load': true
},
});
}
import React from 'react';
import ReactDOM from 'react-dom';
import { browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import configureStore from './store/configureStore';
import Routes from './routes';
const store = configureStore();
import './index.css';
import './semantic-ui/semantic.min.css';
ReactDOM.render(
<Provider store={store}>
<Routes history={browserHistory} />
</Provider>,
document.getElementById('root')
);
| import initOpbeat from 'opbeat-react';
import 'opbeat-react/router';
let opbeat_app_id = process.env.REACT_APP_OPBEAT_APP_ID;
let opbeat_org_id = process.env.REACT_APP_OPBEAT_ORG_ID;
if(process.env.NODE_ENV === 'production' && opbeat_app_id && opbeat_org_id) {
initOpbeat({
appId: opbeat_app_id,
orgId: opbeat_org_id,
+ performance: {
+ 'initial-page-load': true
+ },
});
}
import React from 'react';
import ReactDOM from 'react-dom';
import { browserHistory } from 'react-router';
import { Provider } from 'react-redux';
import configureStore from './store/configureStore';
import Routes from './routes';
const store = configureStore();
import './index.css';
import './semantic-ui/semantic.min.css';
ReactDOM.render(
<Provider store={store}>
<Routes history={browserHistory} />
</Provider>,
document.getElementById('root')
); | 3 | 0.09375 | 3 | 0 |
965cda3443193e8dfaaf9132af38d98bc523b28f | tweet.js | tweet.js | const fs = require('fs')
const Twit = require('twit')
const config = require('./config')
const quotes = JSON.parse(fs.readFileSync('./data/backup-2016-11-03.json', 'utf8'))
const T = new Twit(config.oauth_creds)
function randomQuote () {
return quotes[Math.floor(Math.random() * quotes.length)]
}
function tweetMessage (quote) {
let msg = quote.msg + '\n' + quote.src
T.post('statuses/update', {status: msg}, (err, res) => {
if (err) {
console.error('--->>>')
console.error(msg)
console.error(quote)
console.dir(err)
} else {
console.log('tweet succeed.')
console.log(res.text)
}
})
}
tweetMessage(randomQuote())
| const quotes = JSON.parse(require('fs').readFileSync('./data/backup-2016-11-03.json', 'utf8'))
const config = require('./config')
const Twit = require('twit')
const T = new Twit(config.oauth_creds)
function randomQuote () {
return quotes[Math.floor(Math.random() * quotes.length)]
}
function tweetMessage (quote) {
let msg = quote.msg + '\n' + quote.src
T.post('statuses/update', {status: msg}, (err, res) => {
if (err) {
console.error('--->>>')
console.error(msg)
console.error(quote)
console.dir(err)
} else {
console.log('tweet succeed at ', new Date())
console.log(res.text)
}
})
}
tweetMessage(randomQuote())
| Clean up code and add timestamp | Clean up code and add timestamp
| JavaScript | mit | ntalbs/tweetbot-js,ntalbs/tweetbot-js | javascript | ## Code Before:
const fs = require('fs')
const Twit = require('twit')
const config = require('./config')
const quotes = JSON.parse(fs.readFileSync('./data/backup-2016-11-03.json', 'utf8'))
const T = new Twit(config.oauth_creds)
function randomQuote () {
return quotes[Math.floor(Math.random() * quotes.length)]
}
function tweetMessage (quote) {
let msg = quote.msg + '\n' + quote.src
T.post('statuses/update', {status: msg}, (err, res) => {
if (err) {
console.error('--->>>')
console.error(msg)
console.error(quote)
console.dir(err)
} else {
console.log('tweet succeed.')
console.log(res.text)
}
})
}
tweetMessage(randomQuote())
## Instruction:
Clean up code and add timestamp
## Code After:
const quotes = JSON.parse(require('fs').readFileSync('./data/backup-2016-11-03.json', 'utf8'))
const config = require('./config')
const Twit = require('twit')
const T = new Twit(config.oauth_creds)
function randomQuote () {
return quotes[Math.floor(Math.random() * quotes.length)]
}
function tweetMessage (quote) {
let msg = quote.msg + '\n' + quote.src
T.post('statuses/update', {status: msg}, (err, res) => {
if (err) {
console.error('--->>>')
console.error(msg)
console.error(quote)
console.dir(err)
} else {
console.log('tweet succeed at ', new Date())
console.log(res.text)
}
})
}
tweetMessage(randomQuote())
| + const quotes = JSON.parse(require('fs').readFileSync('./data/backup-2016-11-03.json', 'utf8'))
- const fs = require('fs')
? ^ ^
+ const config = require('./config')
? +++ ^^ +++++ ^^
const Twit = require('twit')
- const config = require('./config')
-
- const quotes = JSON.parse(fs.readFileSync('./data/backup-2016-11-03.json', 'utf8'))
const T = new Twit(config.oauth_creds)
function randomQuote () {
return quotes[Math.floor(Math.random() * quotes.length)]
}
function tweetMessage (quote) {
let msg = quote.msg + '\n' + quote.src
T.post('statuses/update', {status: msg}, (err, res) => {
if (err) {
console.error('--->>>')
console.error(msg)
console.error(quote)
console.dir(err)
} else {
- console.log('tweet succeed.')
? ^
+ console.log('tweet succeed at ', new Date())
? ^^^^ +++++++++++ +
console.log(res.text)
}
})
}
tweetMessage(randomQuote()) | 8 | 0.296296 | 3 | 5 |
fb19e76bc369edac910164702f8eed979e13e129 | general-purpose-software-install.sh | general-purpose-software-install.sh |
sudo apt-get install calibre gaphor curl synaptic pidgin remmina \
gparted chromium-browser
# in order to install `dropbox`, use the following command:
# $ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
# the following lines are necessary to swap function keys behaviour
# for Apple keyboards.
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u
# in order to play restricted dvds:
sudo apt-get install libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh
sudo apt-get install gsfonts-x11
|
sudo apt-get install calibre gaphor curl synaptic pidgin remmina \
gparted chromium-browser evince-gtk gsfonts-x11
# in order to install `dropbox`, use the following command:
# $ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
# the following lines are necessary to swap function keys behaviour
# for Apple keyboards.
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u
# in order to play restricted dvds:
sudo apt-get install libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh
| Add `evince-gtk` in general purpose software script. | Add `evince-gtk` in general purpose software script.
| Shell | mit | massimo-nocentini/install-dependencies-scripts | shell | ## Code Before:
sudo apt-get install calibre gaphor curl synaptic pidgin remmina \
gparted chromium-browser
# in order to install `dropbox`, use the following command:
# $ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
# the following lines are necessary to swap function keys behaviour
# for Apple keyboards.
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u
# in order to play restricted dvds:
sudo apt-get install libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh
sudo apt-get install gsfonts-x11
## Instruction:
Add `evince-gtk` in general purpose software script.
## Code After:
sudo apt-get install calibre gaphor curl synaptic pidgin remmina \
gparted chromium-browser evince-gtk gsfonts-x11
# in order to install `dropbox`, use the following command:
# $ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
# the following lines are necessary to swap function keys behaviour
# for Apple keyboards.
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u
# in order to play restricted dvds:
sudo apt-get install libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh
|
sudo apt-get install calibre gaphor curl synaptic pidgin remmina \
- gparted chromium-browser
+ gparted chromium-browser evince-gtk gsfonts-x11
# in order to install `dropbox`, use the following command:
# $ cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
# the following lines are necessary to swap function keys behaviour
# for Apple keyboards.
echo options hid_apple fnmode=2 | sudo tee -a /etc/modprobe.d/hid_apple.conf
sudo update-initramfs -u
# in order to play restricted dvds:
sudo apt-get install libdvdread4
sudo /usr/share/doc/libdvdread4/install-css.sh
-
- sudo apt-get install gsfonts-x11 | 4 | 0.235294 | 1 | 3 |
201e7b8fa98361a8a6284cfe0482933c5efa2096 | .travis.yml | .travis.yml | language: php
php:
- 5.5
- 5.6
- hhvm
install:
- composer selfupdate
- composer install --prefer-source
- if [ "$TRAVIS_PHP_VERSION" == 'hhvm' ]; then
composer remove henrikbjorn/phpspec-code-coverage --dev --no-update;
fi;
script:
- ./vendor/bin/phpunit
- ./vendor/bin/phpspec run
after_success:
- if [ "$TRAVIS_PHP_VERSION" == '5.6' ]; then
wget https://scrutinizer-ci.com/ocular.phar;
php ocular.phar code-coverage:upload --format=php-clover build/reports/phpspec.xml;
php ocular.phar code-coverage:upload --format=php-clover build/reports/phpunit.xml;
fi; | language: php
php:
- 5.5
- 5.6
- hhvm
install:
- composer selfupdate
- composer install --prefer-source
- if [ "$TRAVIS_PHP_VERSION" == 'hhvm' ]; then
composer remove henrikbjorn/phpspec-code-coverage --dev;
fi;
script:
- ./vendor/bin/phpunit
- ./vendor/bin/phpspec run
after_success:
- if [ "$TRAVIS_PHP_VERSION" == '5.6' ]; then
wget https://scrutinizer-ci.com/ocular.phar;
php ocular.phar code-coverage:upload --format=php-clover build/reports/phpspec.xml;
php ocular.phar code-coverage:upload --format=php-clover build/reports/phpunit.xml;
fi; | Remove no update flag from hhvm fix | Remove no update flag from hhvm fix
| YAML | mit | dennisdegreef/php-assumptions,rskuipers/php-assumptions | yaml | ## Code Before:
language: php
php:
- 5.5
- 5.6
- hhvm
install:
- composer selfupdate
- composer install --prefer-source
- if [ "$TRAVIS_PHP_VERSION" == 'hhvm' ]; then
composer remove henrikbjorn/phpspec-code-coverage --dev --no-update;
fi;
script:
- ./vendor/bin/phpunit
- ./vendor/bin/phpspec run
after_success:
- if [ "$TRAVIS_PHP_VERSION" == '5.6' ]; then
wget https://scrutinizer-ci.com/ocular.phar;
php ocular.phar code-coverage:upload --format=php-clover build/reports/phpspec.xml;
php ocular.phar code-coverage:upload --format=php-clover build/reports/phpunit.xml;
fi;
## Instruction:
Remove no update flag from hhvm fix
## Code After:
language: php
php:
- 5.5
- 5.6
- hhvm
install:
- composer selfupdate
- composer install --prefer-source
- if [ "$TRAVIS_PHP_VERSION" == 'hhvm' ]; then
composer remove henrikbjorn/phpspec-code-coverage --dev;
fi;
script:
- ./vendor/bin/phpunit
- ./vendor/bin/phpspec run
after_success:
- if [ "$TRAVIS_PHP_VERSION" == '5.6' ]; then
wget https://scrutinizer-ci.com/ocular.phar;
php ocular.phar code-coverage:upload --format=php-clover build/reports/phpspec.xml;
php ocular.phar code-coverage:upload --format=php-clover build/reports/phpunit.xml;
fi; | language: php
php:
- 5.5
- 5.6
- hhvm
install:
- composer selfupdate
- composer install --prefer-source
- if [ "$TRAVIS_PHP_VERSION" == 'hhvm' ]; then
- composer remove henrikbjorn/phpspec-code-coverage --dev --no-update;
? ------------
+ composer remove henrikbjorn/phpspec-code-coverage --dev;
fi;
script:
- ./vendor/bin/phpunit
- ./vendor/bin/phpspec run
after_success:
- if [ "$TRAVIS_PHP_VERSION" == '5.6' ]; then
wget https://scrutinizer-ci.com/ocular.phar;
php ocular.phar code-coverage:upload --format=php-clover build/reports/phpspec.xml;
php ocular.phar code-coverage:upload --format=php-clover build/reports/phpunit.xml;
fi; | 2 | 0.1 | 1 | 1 |
26444116fa39899577e4ac4ba38b23321061cea4 | content/the-making-of/index.html | content/the-making-of/index.html | <article>
<header>
<h1>The Making Of</h1>
<p>
A summary of technical learnings over the course of implementing my
personal blog
</p>
</header>
</article>
| <article>
<header>
<h1>The Making Of</h1>
<p>
A summary of technical learnings over the course of implementing my
personal blog
</p>
</header>
<section>
<h1>Design Resources</h1>
<ul>
<li><a href="http://webdesignledger.com/wireframe-sketches">Drafting Tips for Creative Wireframe Sketches</a></li>
<li><a href="http://abduzeedo.com/wikipedia-redesign-concept">Wikipedia Redesign Concept</a></li>
<li><a href="http://abduzeedo.com/functional-and-visual-redesign-google-news">Functional and visual redesign of Google News</a></li>
<li><a href="http://blog.weare1910.com/post/78113100010/a-typographic-approach-to-email">A Typographic Approach to Email</a></li>
<li><a href="http://blog.weare1910.com/post/75576312730/a-readable-wikipedia">A Readable Wikipedia</a></li>
<li><a href="http://blog.weare1910.com/post/72755990718/grids-from-typography">Grids From Typography</a></li>
<li><a href="http://abduzeedo.com/breaking-grid-web">Breaking the Grid on the Web</a></li>
<li><a href="http://www.moments-with-typography.com/">Moments With Typography</a></li>
</ul>
</section>
</article>
| Add design resources to making of | Add design resources to making of
| HTML | mit | vinsonchuong/blog,vinsonchuong/blog | html | ## Code Before:
<article>
<header>
<h1>The Making Of</h1>
<p>
A summary of technical learnings over the course of implementing my
personal blog
</p>
</header>
</article>
## Instruction:
Add design resources to making of
## Code After:
<article>
<header>
<h1>The Making Of</h1>
<p>
A summary of technical learnings over the course of implementing my
personal blog
</p>
</header>
<section>
<h1>Design Resources</h1>
<ul>
<li><a href="http://webdesignledger.com/wireframe-sketches">Drafting Tips for Creative Wireframe Sketches</a></li>
<li><a href="http://abduzeedo.com/wikipedia-redesign-concept">Wikipedia Redesign Concept</a></li>
<li><a href="http://abduzeedo.com/functional-and-visual-redesign-google-news">Functional and visual redesign of Google News</a></li>
<li><a href="http://blog.weare1910.com/post/78113100010/a-typographic-approach-to-email">A Typographic Approach to Email</a></li>
<li><a href="http://blog.weare1910.com/post/75576312730/a-readable-wikipedia">A Readable Wikipedia</a></li>
<li><a href="http://blog.weare1910.com/post/72755990718/grids-from-typography">Grids From Typography</a></li>
<li><a href="http://abduzeedo.com/breaking-grid-web">Breaking the Grid on the Web</a></li>
<li><a href="http://www.moments-with-typography.com/">Moments With Typography</a></li>
</ul>
</section>
</article>
| <article>
<header>
<h1>The Making Of</h1>
<p>
A summary of technical learnings over the course of implementing my
personal blog
</p>
</header>
+
+ <section>
+ <h1>Design Resources</h1>
+ <ul>
+ <li><a href="http://webdesignledger.com/wireframe-sketches">Drafting Tips for Creative Wireframe Sketches</a></li>
+ <li><a href="http://abduzeedo.com/wikipedia-redesign-concept">Wikipedia Redesign Concept</a></li>
+ <li><a href="http://abduzeedo.com/functional-and-visual-redesign-google-news">Functional and visual redesign of Google News</a></li>
+ <li><a href="http://blog.weare1910.com/post/78113100010/a-typographic-approach-to-email">A Typographic Approach to Email</a></li>
+ <li><a href="http://blog.weare1910.com/post/75576312730/a-readable-wikipedia">A Readable Wikipedia</a></li>
+ <li><a href="http://blog.weare1910.com/post/72755990718/grids-from-typography">Grids From Typography</a></li>
+ <li><a href="http://abduzeedo.com/breaking-grid-web">Breaking the Grid on the Web</a></li>
+ <li><a href="http://www.moments-with-typography.com/">Moments With Typography</a></li>
+ </ul>
+ </section>
</article> | 14 | 1.555556 | 14 | 0 |
bae4d93a782f276348180bd024559fddce035fd1 | test/lib/course_planner/tasks_test.exs | test/lib/course_planner/tasks_test.exs | defmodule CoursePlanner.TasksTest do
use CoursePlanner.ModelCase
alias CoursePlanner.{Tasks, Volunteers}
@valid_task %{name: "some content", start_time: Timex.now(), finish_time: Timex.now()}
@volunteer %{
name: "Test Volunteer",
email: "volunteer@courseplanner.com",
password: "secret",
password_confirmation: "secret",
role: "Volunteer"}
test "assign volunteer to task" do
{:ok, task} = Tasks.new(@valid_task)
{:ok, volunteer} = Volunteers.new(@volunteer, "whatever")
{:ok, task} = Tasks.update(task.id, %{user_id: volunteer.id})
assert task.user_id == volunteer.id
end
end
| defmodule CoursePlanner.TasksTest do
use CoursePlanner.ModelCase
alias CoursePlanner.{Tasks, Volunteers}
import Timex
@valid_task %{name: "some content", start_time: Timex.now(), finish_time: Timex.now()}
@volunteer %{
name: "Test Volunteer",
email: "volunteer@courseplanner.com",
password: "secret",
password_confirmation: "secret",
role: "Volunteer"}
test "assign volunteer to task" do
{:ok, task} = Tasks.new(@valid_task)
{:ok, volunteer} = Volunteers.new(@volunteer, "whatever")
{:ok, task} = Tasks.update(task.id, %{user_id: volunteer.id})
assert task.user_id == volunteer.id
end
end
| Remove done action and status timestamps. | Remove done action and status timestamps.
| Elixir | mit | digitalnatives/course_planner,digitalnatives/course_planner,digitalnatives/course_planner | elixir | ## Code Before:
defmodule CoursePlanner.TasksTest do
use CoursePlanner.ModelCase
alias CoursePlanner.{Tasks, Volunteers}
@valid_task %{name: "some content", start_time: Timex.now(), finish_time: Timex.now()}
@volunteer %{
name: "Test Volunteer",
email: "volunteer@courseplanner.com",
password: "secret",
password_confirmation: "secret",
role: "Volunteer"}
test "assign volunteer to task" do
{:ok, task} = Tasks.new(@valid_task)
{:ok, volunteer} = Volunteers.new(@volunteer, "whatever")
{:ok, task} = Tasks.update(task.id, %{user_id: volunteer.id})
assert task.user_id == volunteer.id
end
end
## Instruction:
Remove done action and status timestamps.
## Code After:
defmodule CoursePlanner.TasksTest do
use CoursePlanner.ModelCase
alias CoursePlanner.{Tasks, Volunteers}
import Timex
@valid_task %{name: "some content", start_time: Timex.now(), finish_time: Timex.now()}
@volunteer %{
name: "Test Volunteer",
email: "volunteer@courseplanner.com",
password: "secret",
password_confirmation: "secret",
role: "Volunteer"}
test "assign volunteer to task" do
{:ok, task} = Tasks.new(@valid_task)
{:ok, volunteer} = Volunteers.new(@volunteer, "whatever")
{:ok, task} = Tasks.update(task.id, %{user_id: volunteer.id})
assert task.user_id == volunteer.id
end
end
| defmodule CoursePlanner.TasksTest do
use CoursePlanner.ModelCase
alias CoursePlanner.{Tasks, Volunteers}
+ import Timex
@valid_task %{name: "some content", start_time: Timex.now(), finish_time: Timex.now()}
@volunteer %{
name: "Test Volunteer",
email: "volunteer@courseplanner.com",
password: "secret",
password_confirmation: "secret",
role: "Volunteer"}
test "assign volunteer to task" do
{:ok, task} = Tasks.new(@valid_task)
{:ok, volunteer} = Volunteers.new(@volunteer, "whatever")
{:ok, task} = Tasks.update(task.id, %{user_id: volunteer.id})
assert task.user_id == volunteer.id
end
end | 1 | 0.047619 | 1 | 0 |
82defd111a0b5fe51ed35def82132c570956d20a | plugins/github/src/org/jetbrains/plugins/github/pullrequest/search/GithubPullRequestSearchQueryHolderImpl.kt | plugins/github/src/org/jetbrains/plugins/github/pullrequest/search/GithubPullRequestSearchQueryHolderImpl.kt | // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.github.pullrequest.search
import com.intellij.openapi.Disposable
import com.intellij.util.EventDispatcher
import org.jetbrains.plugins.github.pullrequest.ui.SimpleEventListener
import kotlin.properties.Delegates
internal class GithubPullRequestSearchQueryHolderImpl : GithubPullRequestSearchQueryHolder {
override var query: GithubPullRequestSearchQuery
by Delegates.observable(GithubPullRequestSearchQuery(emptyList())) { _, _, _ ->
queryChangeEventDispatcher.multicaster.eventOccurred()
}
private val queryChangeEventDispatcher = EventDispatcher.create(SimpleEventListener::class.java)
init {
query = GithubPullRequestSearchQuery.parseFromString("state:open")
}
override fun addQueryChangeListener(disposable: Disposable, listener: () -> Unit) =
SimpleEventListener.addDisposableListener(queryChangeEventDispatcher, disposable, listener)
} | // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.github.pullrequest.search
import com.intellij.openapi.Disposable
import org.jetbrains.plugins.github.ui.util.SingleValueModel
internal class GithubPullRequestSearchQueryHolderImpl : GithubPullRequestSearchQueryHolder {
private val delegate = SingleValueModel(GithubPullRequestSearchQuery.parseFromString("state:open"))
override var query: GithubPullRequestSearchQuery
get() = delegate.value
set(value) {
delegate.value = value
}
override fun addQueryChangeListener(disposable: Disposable, listener: () -> Unit) =
delegate.addValueChangedListener(disposable, listener)
} | Use single value model for search holder | [github] Use single value model for search holder
Code reuse FTW
GitOrigin-RevId: bf0e7d0b1e3db3e07000273c12899687dcfbc6a3 | Kotlin | apache-2.0 | allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community,allotria/intellij-community | kotlin | ## Code Before:
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.github.pullrequest.search
import com.intellij.openapi.Disposable
import com.intellij.util.EventDispatcher
import org.jetbrains.plugins.github.pullrequest.ui.SimpleEventListener
import kotlin.properties.Delegates
internal class GithubPullRequestSearchQueryHolderImpl : GithubPullRequestSearchQueryHolder {
override var query: GithubPullRequestSearchQuery
by Delegates.observable(GithubPullRequestSearchQuery(emptyList())) { _, _, _ ->
queryChangeEventDispatcher.multicaster.eventOccurred()
}
private val queryChangeEventDispatcher = EventDispatcher.create(SimpleEventListener::class.java)
init {
query = GithubPullRequestSearchQuery.parseFromString("state:open")
}
override fun addQueryChangeListener(disposable: Disposable, listener: () -> Unit) =
SimpleEventListener.addDisposableListener(queryChangeEventDispatcher, disposable, listener)
}
## Instruction:
[github] Use single value model for search holder
Code reuse FTW
GitOrigin-RevId: bf0e7d0b1e3db3e07000273c12899687dcfbc6a3
## Code After:
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.github.pullrequest.search
import com.intellij.openapi.Disposable
import org.jetbrains.plugins.github.ui.util.SingleValueModel
internal class GithubPullRequestSearchQueryHolderImpl : GithubPullRequestSearchQueryHolder {
private val delegate = SingleValueModel(GithubPullRequestSearchQuery.parseFromString("state:open"))
override var query: GithubPullRequestSearchQuery
get() = delegate.value
set(value) {
delegate.value = value
}
override fun addQueryChangeListener(disposable: Disposable, listener: () -> Unit) =
delegate.addValueChangedListener(disposable, listener)
} | // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.jetbrains.plugins.github.pullrequest.search
import com.intellij.openapi.Disposable
+ import org.jetbrains.plugins.github.ui.util.SingleValueModel
- import com.intellij.util.EventDispatcher
- import org.jetbrains.plugins.github.pullrequest.ui.SimpleEventListener
- import kotlin.properties.Delegates
internal class GithubPullRequestSearchQueryHolderImpl : GithubPullRequestSearchQueryHolder {
+ private val delegate = SingleValueModel(GithubPullRequestSearchQuery.parseFromString("state:open"))
+
override var query: GithubPullRequestSearchQuery
- by Delegates.observable(GithubPullRequestSearchQuery(emptyList())) { _, _, _ ->
- queryChangeEventDispatcher.multicaster.eventOccurred()
+ get() = delegate.value
+ set(value) {
+ delegate.value = value
}
- private val queryChangeEventDispatcher = EventDispatcher.create(SimpleEventListener::class.java)
-
- init {
- query = GithubPullRequestSearchQuery.parseFromString("state:open")
- }
-
override fun addQueryChangeListener(disposable: Disposable, listener: () -> Unit) =
- SimpleEventListener.addDisposableListener(queryChangeEventDispatcher, disposable, listener)
+ delegate.addValueChangedListener(disposable, listener)
} | 19 | 0.826087 | 7 | 12 |
66e8e572fa16042ef4fae95680aefefe63fc1ac7 | src/constants/enums.ts | src/constants/enums.ts | export enum AudioSource {
NEW_SEARCH_RESULT = 'https://k003.kiwi6.com/hotlink/bbgk5w2fhz/ping.ogg',
SUCCESSFUL_WATCHER_ACCEPT = 'https://k003.kiwi6.com/hotlink/sd6quj2ecs/horn.ogg'
}
export enum TabIndex {
SEARCH = 0,
QUEUE = 1,
WATCHERS = 2,
BLOCKLIST = 3,
ACCOUNT = 4,
SETTINGS = 5
}
export enum Duration {
SECONDS = 'seconds',
HOURS = 'hours',
DAYS = 'days',
WEEKS = 'weeks'
}
| export enum AudioSource {
NEW_SEARCH_RESULT = 'https://k003.kiwi6.com/hotlink/bbgk5w2fhz/ping.ogg',
SUCCESSFUL_WATCHER_ACCEPT = 'https://k003.kiwi6.com/hotlink/sd6quj2ecs/horn.ogg'
}
export enum TabIndex {
SEARCH = 0,
QUEUE = 1,
WATCHERS = 2,
BLOCKLIST = 3,
ACCOUNT = 4,
SETTINGS = 5
}
export enum Duration {
SECONDS = 'seconds',
HOURS = 'hours',
DAYS = 'days',
WEEKS = 'weeks',
MONTHS = 'months'
}
| Add MONTHS to Duration enum. | Add MONTHS to Duration enum.
| TypeScript | mit | Anveio/mturk-engine,Anveio/mturk-engine,Anveio/mturk-engine | typescript | ## Code Before:
export enum AudioSource {
NEW_SEARCH_RESULT = 'https://k003.kiwi6.com/hotlink/bbgk5w2fhz/ping.ogg',
SUCCESSFUL_WATCHER_ACCEPT = 'https://k003.kiwi6.com/hotlink/sd6quj2ecs/horn.ogg'
}
export enum TabIndex {
SEARCH = 0,
QUEUE = 1,
WATCHERS = 2,
BLOCKLIST = 3,
ACCOUNT = 4,
SETTINGS = 5
}
export enum Duration {
SECONDS = 'seconds',
HOURS = 'hours',
DAYS = 'days',
WEEKS = 'weeks'
}
## Instruction:
Add MONTHS to Duration enum.
## Code After:
export enum AudioSource {
NEW_SEARCH_RESULT = 'https://k003.kiwi6.com/hotlink/bbgk5w2fhz/ping.ogg',
SUCCESSFUL_WATCHER_ACCEPT = 'https://k003.kiwi6.com/hotlink/sd6quj2ecs/horn.ogg'
}
export enum TabIndex {
SEARCH = 0,
QUEUE = 1,
WATCHERS = 2,
BLOCKLIST = 3,
ACCOUNT = 4,
SETTINGS = 5
}
export enum Duration {
SECONDS = 'seconds',
HOURS = 'hours',
DAYS = 'days',
WEEKS = 'weeks',
MONTHS = 'months'
}
| export enum AudioSource {
NEW_SEARCH_RESULT = 'https://k003.kiwi6.com/hotlink/bbgk5w2fhz/ping.ogg',
SUCCESSFUL_WATCHER_ACCEPT = 'https://k003.kiwi6.com/hotlink/sd6quj2ecs/horn.ogg'
}
export enum TabIndex {
SEARCH = 0,
QUEUE = 1,
WATCHERS = 2,
BLOCKLIST = 3,
ACCOUNT = 4,
SETTINGS = 5
}
export enum Duration {
SECONDS = 'seconds',
HOURS = 'hours',
DAYS = 'days',
- WEEKS = 'weeks'
+ WEEKS = 'weeks',
? +
+ MONTHS = 'months'
} | 3 | 0.15 | 2 | 1 |
169542ed952f782a06235cab7e75f0adba1ceded | spec/microphite_spec.rb | spec/microphite_spec.rb | module Microphite
describe :client do
before_block = Proc.new { @client = Microphite::Client::Socket.new(host: 'localhost') }
after_block = Proc.new {}
it_should_behave_like 'a microphite client', before_block, after_block
end
describe :noop do
before_block = Proc.new { @client = Microphite::Client::Noop.new(host: 'localhost') }
after_block = Proc.new {}
it_should_behave_like 'a microphite client', before_block, after_block
end
end
| module Microphite
describe :client do
before_block = Proc.new { @client = Microphite.client(host: 'localhost') }
after_block = Proc.new {}
it_should_behave_like 'a microphite client', before_block, after_block
end
describe :noop do
before_block = Proc.new { @client = Microphite.noop(host: 'localhost') }
after_block = Proc.new {}
it_should_behave_like 'a microphite client', before_block, after_block
end
end
| Fix module convenience method coverage | Fix module convenience method coverage
| Ruby | mit | bz-technology/microphite | ruby | ## Code Before:
module Microphite
describe :client do
before_block = Proc.new { @client = Microphite::Client::Socket.new(host: 'localhost') }
after_block = Proc.new {}
it_should_behave_like 'a microphite client', before_block, after_block
end
describe :noop do
before_block = Proc.new { @client = Microphite::Client::Noop.new(host: 'localhost') }
after_block = Proc.new {}
it_should_behave_like 'a microphite client', before_block, after_block
end
end
## Instruction:
Fix module convenience method coverage
## Code After:
module Microphite
describe :client do
before_block = Proc.new { @client = Microphite.client(host: 'localhost') }
after_block = Proc.new {}
it_should_behave_like 'a microphite client', before_block, after_block
end
describe :noop do
before_block = Proc.new { @client = Microphite.noop(host: 'localhost') }
after_block = Proc.new {}
it_should_behave_like 'a microphite client', before_block, after_block
end
end
| module Microphite
describe :client do
- before_block = Proc.new { @client = Microphite::Client::Socket.new(host: 'localhost') }
? ^^^ ------------
+ before_block = Proc.new { @client = Microphite.client(host: 'localhost') }
? ^^
after_block = Proc.new {}
it_should_behave_like 'a microphite client', before_block, after_block
end
describe :noop do
- before_block = Proc.new { @client = Microphite::Client::Noop.new(host: 'localhost') }
? ^^^^^^ ---- ----
+ before_block = Proc.new { @client = Microphite.noop(host: 'localhost') }
? ^
after_block = Proc.new {}
it_should_behave_like 'a microphite client', before_block, after_block
end
end | 4 | 0.266667 | 2 | 2 |
7c87340a41ff08d538eedff502cbc9fb0138d986 | metadata/com.palliser.nztides.txt | metadata/com.palliser.nztides.txt | Categories:Navigation
License:GPLv3
Web Site:https://code.google.com/p/nztides
Source Code:https://code.google.com/p/nztides/source
Issue Tracker:
Auto Name:NZ Tides
Summary:Tide table for New Zealand
Description:
Based on lookup table of official LINZ tide predictions so should be accurate.
Transcription errors are unlikely but possible. This program shouldn't be used
where life or property is at risk. Predictions run till about the end of 2014
with version 5.
.
Repo Type:git
Repo:https://code.google.com/p/nztides
Build:4.0,4
commit=93f349
subdir=nztides_app
init=rm -rf ../packages
target=android-7
Build:5,5
commit=b5a82b
subdir=nztides_app
prebuild=rm -rf ../packages
Build:6,6
commit=6af80b648250
subdir=nztides_app
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:6
Current Version Code:6
| Categories:Navigation
License:GPLv3
Web Site:
Source Code:https://github.com/jevonlongdell/nztides
Issue Tracker:https://github.com/jevonlongdell/nztides/issues
Auto Name:NZ Tides
Summary:Tide table for New Zealand
Description:
Based on lookup table of official LINZ tide predictions so should be accurate.
Transcription errors are unlikely but possible. This program shouldn't be used
where life or property is at risk. Predictions run till about the end of 2016
with version 7.
.
Repo Type:git
Repo:https://github.com/jevonlongdell/nztides
Build:4.0,4
commit=93f349
subdir=nztides_app
init=rm -rf ../packages
target=android-7
Build:5,5
commit=b5a82b
subdir=nztides_app
prebuild=rm -rf ../packages
Build:6,6
commit=6af80b648250
subdir=nztides_app
Build:7,7
commit=5d3016480c744c55b79f58125a5d497423d8f03a
subdir=nztides_app/app
gradle=yes
Maintainer Notes:
Licensed taken from closed down https://code.google.com/p/nztides ,
issue opened at: https://github.com/jevonlongdell/nztides/issues/5
.
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:7
Current Version Code:7
| Update NZ Tides to 7 (7) | Update NZ Tides to 7 (7)
| Text | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata,f-droid/fdroid-data | text | ## Code Before:
Categories:Navigation
License:GPLv3
Web Site:https://code.google.com/p/nztides
Source Code:https://code.google.com/p/nztides/source
Issue Tracker:
Auto Name:NZ Tides
Summary:Tide table for New Zealand
Description:
Based on lookup table of official LINZ tide predictions so should be accurate.
Transcription errors are unlikely but possible. This program shouldn't be used
where life or property is at risk. Predictions run till about the end of 2014
with version 5.
.
Repo Type:git
Repo:https://code.google.com/p/nztides
Build:4.0,4
commit=93f349
subdir=nztides_app
init=rm -rf ../packages
target=android-7
Build:5,5
commit=b5a82b
subdir=nztides_app
prebuild=rm -rf ../packages
Build:6,6
commit=6af80b648250
subdir=nztides_app
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:6
Current Version Code:6
## Instruction:
Update NZ Tides to 7 (7)
## Code After:
Categories:Navigation
License:GPLv3
Web Site:
Source Code:https://github.com/jevonlongdell/nztides
Issue Tracker:https://github.com/jevonlongdell/nztides/issues
Auto Name:NZ Tides
Summary:Tide table for New Zealand
Description:
Based on lookup table of official LINZ tide predictions so should be accurate.
Transcription errors are unlikely but possible. This program shouldn't be used
where life or property is at risk. Predictions run till about the end of 2016
with version 7.
.
Repo Type:git
Repo:https://github.com/jevonlongdell/nztides
Build:4.0,4
commit=93f349
subdir=nztides_app
init=rm -rf ../packages
target=android-7
Build:5,5
commit=b5a82b
subdir=nztides_app
prebuild=rm -rf ../packages
Build:6,6
commit=6af80b648250
subdir=nztides_app
Build:7,7
commit=5d3016480c744c55b79f58125a5d497423d8f03a
subdir=nztides_app/app
gradle=yes
Maintainer Notes:
Licensed taken from closed down https://code.google.com/p/nztides ,
issue opened at: https://github.com/jevonlongdell/nztides/issues/5
.
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:7
Current Version Code:7
| Categories:Navigation
License:GPLv3
- Web Site:https://code.google.com/p/nztides
- Source Code:https://code.google.com/p/nztides/source
- Issue Tracker:
+ Web Site:
+ Source Code:https://github.com/jevonlongdell/nztides
+ Issue Tracker:https://github.com/jevonlongdell/nztides/issues
Auto Name:NZ Tides
Summary:Tide table for New Zealand
Description:
Based on lookup table of official LINZ tide predictions so should be accurate.
Transcription errors are unlikely but possible. This program shouldn't be used
- where life or property is at risk. Predictions run till about the end of 2014
? ^
+ where life or property is at risk. Predictions run till about the end of 2016
? ^
- with version 5.
? ^
+ with version 7.
? ^
.
Repo Type:git
- Repo:https://code.google.com/p/nztides
+ Repo:https://github.com/jevonlongdell/nztides
Build:4.0,4
commit=93f349
subdir=nztides_app
init=rm -rf ../packages
target=android-7
Build:5,5
commit=b5a82b
subdir=nztides_app
prebuild=rm -rf ../packages
Build:6,6
commit=6af80b648250
subdir=nztides_app
+ Build:7,7
+ commit=5d3016480c744c55b79f58125a5d497423d8f03a
+ subdir=nztides_app/app
+ gradle=yes
+
+ Maintainer Notes:
+ Licensed taken from closed down https://code.google.com/p/nztides ,
+ issue opened at: https://github.com/jevonlongdell/nztides/issues/5
+ .
+
Auto Update Mode:None
Update Check Mode:RepoManifest
- Current Version:6
? ^
+ Current Version:7
? ^
- Current Version Code:6
? ^
+ Current Version Code:7
? ^
| 26 | 0.702703 | 18 | 8 |
9277715617867f4c35c443089fe19669000e1b6a | .codeclimate.yml | .codeclimate.yml | engines:
phpcodesniffer:
enabled: true
phpmd:
enabled: true
ratings:
paths:
- "**.php"
- "**.module"
- "**.inc"
exclude_paths: []
| engines:
phpcodesniffer:
enabled: true
phpmd:
enabled: true
ratings:
paths:
- "**.php"
- "**.module"
- "**.inc"
exclude_paths:
- "tests/_files/*"
| Exclude test files from CodeClimate | Exclude test files from CodeClimate
| YAML | mit | stefandoorn/3dbinpacking-php-api | yaml | ## Code Before:
engines:
phpcodesniffer:
enabled: true
phpmd:
enabled: true
ratings:
paths:
- "**.php"
- "**.module"
- "**.inc"
exclude_paths: []
## Instruction:
Exclude test files from CodeClimate
## Code After:
engines:
phpcodesniffer:
enabled: true
phpmd:
enabled: true
ratings:
paths:
- "**.php"
- "**.module"
- "**.inc"
exclude_paths:
- "tests/_files/*"
| engines:
phpcodesniffer:
enabled: true
phpmd:
enabled: true
ratings:
paths:
- "**.php"
- "**.module"
- "**.inc"
- exclude_paths: []
? ---
+ exclude_paths:
+ - "tests/_files/*" | 3 | 0.272727 | 2 | 1 |
7fa4899076290f3ea3ba9a13212e070f9c047cee | library/Mockery/Generator/DefinedTargetClass.php | library/Mockery/Generator/DefinedTargetClass.php | <?php
namespace Mockery\Generator;
class DefinedTargetClass
{
private $rfc;
public function __construct(\ReflectionClass $rfc)
{
$this->rfc = $rfc;
}
public static function factory($name)
{
return new static(new \ReflectionClass($name));
}
public function getName()
{
return $this->rfc->getName();
}
public function isAbstract()
{
return $this->rfc->isAbstract();
}
public function isFinal()
{
return $this->rfc->isFinal();
}
public function getMethods()
{
return array_map(function ($method) {
return new Method($method);
}, $this->rfc->getMethods());
}
public function getInterfaces()
{
return array_map(function ($interface) {
return new static($interface);
}, $this->rfc->getInterfaces());
}
public function __toString()
{
return $this->getName();
}
public function getNamespaceName()
{
return $this->rfc->getNamespaceName();
}
public function inNamespace()
{
return $this->rfc->inNamespace();
}
public function getShortName()
{
return $this->rfc->getShortName();
}
}
| <?php
namespace Mockery\Generator;
class DefinedTargetClass
{
private $rfc;
public function __construct(\ReflectionClass $rfc)
{
$this->rfc = $rfc;
}
public static function factory($name)
{
return new self(new \ReflectionClass($name));
}
public function getName()
{
return $this->rfc->getName();
}
public function isAbstract()
{
return $this->rfc->isAbstract();
}
public function isFinal()
{
return $this->rfc->isFinal();
}
public function getMethods()
{
return array_map(function ($method) {
return new Method($method);
}, $this->rfc->getMethods());
}
public function getInterfaces()
{
return array_map(function ($interface) {
return new self($interface);
}, $this->rfc->getInterfaces());
}
public function __toString()
{
return $this->getName();
}
public function getNamespaceName()
{
return $this->rfc->getNamespaceName();
}
public function inNamespace()
{
return $this->rfc->inNamespace();
}
public function getShortName()
{
return $this->rfc->getShortName();
}
}
| Use self for php 5.3 | Use self for php 5.3
| PHP | bsd-3-clause | fhinkel/mockery,tfrommen/mockery,Big-Shark/mockery,jenswiese/mockery,kminh/mockery,yeka/mockery,Big-Shark/mockery,TiagoMaiaL/mockery,yeka/mockery,padraic/mockery,tfrommen/mockery,kminh/mockery,5outh/mockery,TiagoMaiaL/mockery,fhinkel/mockery,florianeckerstorfer/mockery,5outh/mockery,jenswiese/mockery,florianeckerstorfer/mockery | php | ## Code Before:
<?php
namespace Mockery\Generator;
class DefinedTargetClass
{
private $rfc;
public function __construct(\ReflectionClass $rfc)
{
$this->rfc = $rfc;
}
public static function factory($name)
{
return new static(new \ReflectionClass($name));
}
public function getName()
{
return $this->rfc->getName();
}
public function isAbstract()
{
return $this->rfc->isAbstract();
}
public function isFinal()
{
return $this->rfc->isFinal();
}
public function getMethods()
{
return array_map(function ($method) {
return new Method($method);
}, $this->rfc->getMethods());
}
public function getInterfaces()
{
return array_map(function ($interface) {
return new static($interface);
}, $this->rfc->getInterfaces());
}
public function __toString()
{
return $this->getName();
}
public function getNamespaceName()
{
return $this->rfc->getNamespaceName();
}
public function inNamespace()
{
return $this->rfc->inNamespace();
}
public function getShortName()
{
return $this->rfc->getShortName();
}
}
## Instruction:
Use self for php 5.3
## Code After:
<?php
namespace Mockery\Generator;
class DefinedTargetClass
{
private $rfc;
public function __construct(\ReflectionClass $rfc)
{
$this->rfc = $rfc;
}
public static function factory($name)
{
return new self(new \ReflectionClass($name));
}
public function getName()
{
return $this->rfc->getName();
}
public function isAbstract()
{
return $this->rfc->isAbstract();
}
public function isFinal()
{
return $this->rfc->isFinal();
}
public function getMethods()
{
return array_map(function ($method) {
return new Method($method);
}, $this->rfc->getMethods());
}
public function getInterfaces()
{
return array_map(function ($interface) {
return new self($interface);
}, $this->rfc->getInterfaces());
}
public function __toString()
{
return $this->getName();
}
public function getNamespaceName()
{
return $this->rfc->getNamespaceName();
}
public function inNamespace()
{
return $this->rfc->inNamespace();
}
public function getShortName()
{
return $this->rfc->getShortName();
}
}
| <?php
namespace Mockery\Generator;
class DefinedTargetClass
{
private $rfc;
public function __construct(\ReflectionClass $rfc)
{
$this->rfc = $rfc;
}
public static function factory($name)
{
- return new static(new \ReflectionClass($name));
? ^^^^^
+ return new self(new \ReflectionClass($name));
? ^^^
}
public function getName()
{
return $this->rfc->getName();
}
public function isAbstract()
{
return $this->rfc->isAbstract();
}
public function isFinal()
{
return $this->rfc->isFinal();
}
public function getMethods()
{
return array_map(function ($method) {
return new Method($method);
}, $this->rfc->getMethods());
}
public function getInterfaces()
{
return array_map(function ($interface) {
- return new static($interface);
? ^^^^^
+ return new self($interface);
? ^^^
}, $this->rfc->getInterfaces());
}
public function __toString()
{
return $this->getName();
}
public function getNamespaceName()
{
return $this->rfc->getNamespaceName();
}
public function inNamespace()
{
return $this->rfc->inNamespace();
}
public function getShortName()
{
return $this->rfc->getShortName();
}
} | 4 | 0.059701 | 2 | 2 |
f2da7b2e91da0327098be2f608ed7ee353c770f3 | app/reducers/cards.js | app/reducers/cards.js |
var initialState = {
}
function cards(state = initialState, action) {
switch (action.type) {
case 'SHOW_CARD':
var newState = {...state};
if (newState[action.id])
newState[action.id] = true;
return newState;
case 'HIDE_CARD':
var newState = {...state};
if (newState[action.id])
newState[action.id] = false;
return newState;
case 'ADD_CARD':
var newState = {...state};
// check for duplicate, early exit
if (newState[action.id])
return newState;
newState[action.id] = true;
return newState;
case 'DELETE_CARD':
var newState = {...state};
delete newState[action.id];
return newState;
}
return state;
}
module.exports = cards
|
const AppSettings = require('../AppSettings');
var initialState = {
'weather': AppSettings.WEATHER_CARD_ENABLED,
'shuttle': AppSettings.SHUTTLE_CARD_ENABLED,
'events': AppSettings.EVENTS_CARD_ENABLED,
'news': AppSettings.NEWS_CARD_ENABLED
}
function cards(state = initialState, action) {
switch (action.type) {
case 'SHOW_CARD':
var newState = {...state};
if (newState[action.id])
newState[action.id] = true;
return newState;
case 'HIDE_CARD':
var newState = {...state};
if (newState[action.id])
newState[action.id] = false;
return newState;
case 'ADD_CARD':
var newState = {...state};
// check for duplicate, early exit
if (newState[action.id])
return newState;
newState[action.id] = true;
return newState;
case 'DELETE_CARD':
var newState = {...state};
delete newState[action.id];
return newState;
}
return state;
}
module.exports = cards
| Set initial state from app settings | Set initial state from app settings
| JavaScript | mit | UCSD/campus-mobile,UCSD/now-mobile,UCSD/now-mobile,UCSD/campus-mobile,UCSD/now-mobile,UCSD/campus-mobile,UCSD/campus-mobile,UCSD/campus-mobile,UCSD/campus-mobile | javascript | ## Code Before:
var initialState = {
}
function cards(state = initialState, action) {
switch (action.type) {
case 'SHOW_CARD':
var newState = {...state};
if (newState[action.id])
newState[action.id] = true;
return newState;
case 'HIDE_CARD':
var newState = {...state};
if (newState[action.id])
newState[action.id] = false;
return newState;
case 'ADD_CARD':
var newState = {...state};
// check for duplicate, early exit
if (newState[action.id])
return newState;
newState[action.id] = true;
return newState;
case 'DELETE_CARD':
var newState = {...state};
delete newState[action.id];
return newState;
}
return state;
}
module.exports = cards
## Instruction:
Set initial state from app settings
## Code After:
const AppSettings = require('../AppSettings');
var initialState = {
'weather': AppSettings.WEATHER_CARD_ENABLED,
'shuttle': AppSettings.SHUTTLE_CARD_ENABLED,
'events': AppSettings.EVENTS_CARD_ENABLED,
'news': AppSettings.NEWS_CARD_ENABLED
}
function cards(state = initialState, action) {
switch (action.type) {
case 'SHOW_CARD':
var newState = {...state};
if (newState[action.id])
newState[action.id] = true;
return newState;
case 'HIDE_CARD':
var newState = {...state};
if (newState[action.id])
newState[action.id] = false;
return newState;
case 'ADD_CARD':
var newState = {...state};
// check for duplicate, early exit
if (newState[action.id])
return newState;
newState[action.id] = true;
return newState;
case 'DELETE_CARD':
var newState = {...state};
delete newState[action.id];
return newState;
}
return state;
}
module.exports = cards
| +
+ const AppSettings = require('../AppSettings');
var initialState = {
+ 'weather': AppSettings.WEATHER_CARD_ENABLED,
+ 'shuttle': AppSettings.SHUTTLE_CARD_ENABLED,
+ 'events': AppSettings.EVENTS_CARD_ENABLED,
+ 'news': AppSettings.NEWS_CARD_ENABLED
}
function cards(state = initialState, action) {
switch (action.type) {
case 'SHOW_CARD':
var newState = {...state};
if (newState[action.id])
newState[action.id] = true;
return newState;
case 'HIDE_CARD':
var newState = {...state};
if (newState[action.id])
newState[action.id] = false;
return newState;
case 'ADD_CARD':
var newState = {...state};
// check for duplicate, early exit
if (newState[action.id])
return newState;
newState[action.id] = true;
return newState;
case 'DELETE_CARD':
var newState = {...state};
delete newState[action.id];
return newState;
}
return state;
}
module.exports = cards | 6 | 0.166667 | 6 | 0 |
95054b80b8fbd213429f807f9ad409a4a43d2fe3 | Development/Shake/Language/C/Config.hs | Development/Shake/Language/C/Config.hs | {-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
module Development.Shake.Language.C.Config(
withConfig
, getList
) where
import Control.Applicative
import qualified Data.HashMap.Strict as Map
import Development.Shake
import Development.Shake.Classes
import Development.Shake.Config (readConfigFile)
import Development.Shake.Language.C.Util (words')
newtype Config = Config (FilePath, String) deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
withConfig :: [FilePath] -> Rules (FilePath -> String -> Action (Maybe String))
withConfig deps = do
fileCache <- newCache $ \file -> do
need deps
liftIO $ readConfigFile file
query <- addOracle $ \(Config (file, key)) -> Map.lookup key <$> fileCache file
return $ \file key -> query (Config (file, key))
getList :: (String -> Action (Maybe String)) -> [String] -> Action [String]
getList getConfig keys = do
sources <- mapM (fmap (fmap words') . getConfig) keys
return $ concatMap (maybe [] id) sources
| {-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
module Development.Shake.Language.C.Config(
withConfig
, parsePaths
, getPaths
) where
import Control.Applicative
import qualified Data.HashMap.Strict as Map
import Development.Shake
import Development.Shake.Classes
import Development.Shake.Config (readConfigFileWithEnv)
import Development.Shake.Language.C.Util (words')
newtype Config = Config ([(String, String)], FilePath, String) deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
withConfig :: [FilePath] -> Rules ([(String,String)] -> FilePath -> String -> Action (Maybe String))
withConfig deps = do
fileCache <- newCache $ \(env, file) -> do
need deps
liftIO $ readConfigFileWithEnv env file
query <- addOracle $ \(Config (env, file, key)) -> Map.lookup key <$> fileCache (env, file)
return $ \env file key -> query (Config (env, file, key))
parsePaths :: String -> [FilePath]
parsePaths = words'
getPaths :: (String -> Action (Maybe String)) -> [String] -> Action [String]
getPaths getConfig keys = do
sources <- mapM (fmap (fmap parsePaths) . getConfig) keys
return $ concatMap (maybe [] id) sources
| Rename getList to getPaths and export parsePaths | Rename getList to getPaths and export parsePaths
| Haskell | apache-2.0 | samplecount/shake-language-c | haskell | ## Code Before:
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
module Development.Shake.Language.C.Config(
withConfig
, getList
) where
import Control.Applicative
import qualified Data.HashMap.Strict as Map
import Development.Shake
import Development.Shake.Classes
import Development.Shake.Config (readConfigFile)
import Development.Shake.Language.C.Util (words')
newtype Config = Config (FilePath, String) deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
withConfig :: [FilePath] -> Rules (FilePath -> String -> Action (Maybe String))
withConfig deps = do
fileCache <- newCache $ \file -> do
need deps
liftIO $ readConfigFile file
query <- addOracle $ \(Config (file, key)) -> Map.lookup key <$> fileCache file
return $ \file key -> query (Config (file, key))
getList :: (String -> Action (Maybe String)) -> [String] -> Action [String]
getList getConfig keys = do
sources <- mapM (fmap (fmap words') . getConfig) keys
return $ concatMap (maybe [] id) sources
## Instruction:
Rename getList to getPaths and export parsePaths
## Code After:
{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
module Development.Shake.Language.C.Config(
withConfig
, parsePaths
, getPaths
) where
import Control.Applicative
import qualified Data.HashMap.Strict as Map
import Development.Shake
import Development.Shake.Classes
import Development.Shake.Config (readConfigFileWithEnv)
import Development.Shake.Language.C.Util (words')
newtype Config = Config ([(String, String)], FilePath, String) deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
withConfig :: [FilePath] -> Rules ([(String,String)] -> FilePath -> String -> Action (Maybe String))
withConfig deps = do
fileCache <- newCache $ \(env, file) -> do
need deps
liftIO $ readConfigFileWithEnv env file
query <- addOracle $ \(Config (env, file, key)) -> Map.lookup key <$> fileCache (env, file)
return $ \env file key -> query (Config (env, file, key))
parsePaths :: String -> [FilePath]
parsePaths = words'
getPaths :: (String -> Action (Maybe String)) -> [String] -> Action [String]
getPaths getConfig keys = do
sources <- mapM (fmap (fmap parsePaths) . getConfig) keys
return $ concatMap (maybe [] id) sources
| {-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving #-}
module Development.Shake.Language.C.Config(
withConfig
- , getList
+ , parsePaths
+ , getPaths
) where
import Control.Applicative
import qualified Data.HashMap.Strict as Map
import Development.Shake
import Development.Shake.Classes
- import Development.Shake.Config (readConfigFile)
+ import Development.Shake.Config (readConfigFileWithEnv)
? +++++++
import Development.Shake.Language.C.Util (words')
- newtype Config = Config (FilePath, String) deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
+ newtype Config = Config ([(String, String)], FilePath, String) deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
? ++++++++++++++++++++
- withConfig :: [FilePath] -> Rules (FilePath -> String -> Action (Maybe String))
+ withConfig :: [FilePath] -> Rules ([(String,String)] -> FilePath -> String -> Action (Maybe String))
? +++++++++++++++++++++
withConfig deps = do
- fileCache <- newCache $ \file -> do
+ fileCache <- newCache $ \(env, file) -> do
? ++++++ +
need deps
- liftIO $ readConfigFile file
+ liftIO $ readConfigFileWithEnv env file
? +++++++++++
- query <- addOracle $ \(Config (file, key)) -> Map.lookup key <$> fileCache file
+ query <- addOracle $ \(Config (env, file, key)) -> Map.lookup key <$> fileCache (env, file)
? +++++ ++++++ +
- return $ \file key -> query (Config (file, key))
+ return $ \env file key -> query (Config (env, file, key))
? ++++ +++++
+ parsePaths :: String -> [FilePath]
+ parsePaths = words'
+
- getList :: (String -> Action (Maybe String)) -> [String] -> Action [String]
? ^^ -
+ getPaths :: (String -> Action (Maybe String)) -> [String] -> Action [String]
? ^^^^
- getList getConfig keys = do
? ^^ -
+ getPaths getConfig keys = do
? ^^^^
- sources <- mapM (fmap (fmap words') . getConfig) keys
? ^^ - ^
+ sources <- mapM (fmap (fmap parsePaths) . getConfig) keys
? ^^ ^^^^^^
return $ concatMap (maybe [] id) sources | 26 | 0.928571 | 15 | 11 |
f9360cb89da5c24a096bf2fa1c47d8af596cee4b | src/js/mep-feature-stop.js | src/js/mep-feature-stop.js | (function($) {
$.extend(mejs.MepDefaults, {
stopText: 'Stop'
});
// STOP BUTTON
$.extend(MediaElementPlayer.prototype, {
buildstop: function(player, controls, layers, media) {
var t = this,
stop =
$('<div class="mejs-button mejs-stop-button mejs-stop">' +
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '"></button>' +
'</div>')
.appendTo(controls)
.click(function() {
if (!media.paused) {
media.pause();
}
if (media.currentTime > 0) {
media.setCurrentTime(0);
controls.find('.mejs-time-current').width('0px');
controls.find('.mejs-time-handle').css('left', '0px');
controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
layers.find('.mejs-poster').show();
}
});
}
});
})(mejs.$); | (function($) {
$.extend(mejs.MepDefaults, {
stopText: 'Stop'
});
// STOP BUTTON
$.extend(MediaElementPlayer.prototype, {
buildstop: function(player, controls, layers, media) {
var t = this,
stop =
$('<div class="mejs-button mejs-stop-button mejs-stop">' +
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '"></button>' +
'</div>')
.appendTo(controls)
.click(function() {
if (!media.paused) {
media.pause();
}
if (media.currentTime > 0) {
media.setCurrentTime(0);
media.pause();
controls.find('.mejs-time-current').width('0px');
controls.find('.mejs-time-handle').css('left', '0px');
controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
layers.find('.mejs-poster').show();
}
});
}
});
})(mejs.$); | Fix a bug when Stop button does not behaves as expected in selected browsers (Firefox, Opera) Windows 7 64 bit Opera 12.11 Firefox 16.0.2 | Fix a bug when Stop button does not behaves as expected in selected browsers (Firefox, Opera)
Windows 7 64 bit
Opera 12.11
Firefox 16.0.2
| JavaScript | agpl-3.0 | libeo/Vibeo,libeo/Vibeo,libeo/Vibeo,libeo/Vibeo | javascript | ## Code Before:
(function($) {
$.extend(mejs.MepDefaults, {
stopText: 'Stop'
});
// STOP BUTTON
$.extend(MediaElementPlayer.prototype, {
buildstop: function(player, controls, layers, media) {
var t = this,
stop =
$('<div class="mejs-button mejs-stop-button mejs-stop">' +
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '"></button>' +
'</div>')
.appendTo(controls)
.click(function() {
if (!media.paused) {
media.pause();
}
if (media.currentTime > 0) {
media.setCurrentTime(0);
controls.find('.mejs-time-current').width('0px');
controls.find('.mejs-time-handle').css('left', '0px');
controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
layers.find('.mejs-poster').show();
}
});
}
});
})(mejs.$);
## Instruction:
Fix a bug when Stop button does not behaves as expected in selected browsers (Firefox, Opera)
Windows 7 64 bit
Opera 12.11
Firefox 16.0.2
## Code After:
(function($) {
$.extend(mejs.MepDefaults, {
stopText: 'Stop'
});
// STOP BUTTON
$.extend(MediaElementPlayer.prototype, {
buildstop: function(player, controls, layers, media) {
var t = this,
stop =
$('<div class="mejs-button mejs-stop-button mejs-stop">' +
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '"></button>' +
'</div>')
.appendTo(controls)
.click(function() {
if (!media.paused) {
media.pause();
}
if (media.currentTime > 0) {
media.setCurrentTime(0);
media.pause();
controls.find('.mejs-time-current').width('0px');
controls.find('.mejs-time-handle').css('left', '0px');
controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
layers.find('.mejs-poster').show();
}
});
}
});
})(mejs.$); | (function($) {
$.extend(mejs.MepDefaults, {
stopText: 'Stop'
});
// STOP BUTTON
$.extend(MediaElementPlayer.prototype, {
buildstop: function(player, controls, layers, media) {
var t = this,
stop =
$('<div class="mejs-button mejs-stop-button mejs-stop">' +
'<button type="button" aria-controls="' + t.id + '" title="' + t.options.stopText + '"></button>' +
'</div>')
.appendTo(controls)
.click(function() {
if (!media.paused) {
media.pause();
}
if (media.currentTime > 0) {
- media.setCurrentTime(0);
? -
+ media.setCurrentTime(0);
+ media.pause();
controls.find('.mejs-time-current').width('0px');
controls.find('.mejs-time-handle').css('left', '0px');
controls.find('.mejs-time-float-current').html( mejs.Utility.secondsToTimeCode(0) );
controls.find('.mejs-currenttime').html( mejs.Utility.secondsToTimeCode(0) );
layers.find('.mejs-poster').show();
}
});
}
});
})(mejs.$); | 3 | 0.09375 | 2 | 1 |
35370a7090dbb4aa980ed8c220c3dd48b7e49d6e | README.md | README.md | Stalk your friends on Tinder. Don't actually do that. It's just a description of what this code does.
To run it using Python 3, just do:
```
pip install -r requirements.txt
python3 app.py
```
You'll then need to answer "y" to a prompt asking you if you really want to look at your real-life friends' Tinder profiles. Otherwise the app will quit.
If you answer "y", the app will be available at `http://localhost:5000`.
Help it's not working
=====================
Listen pal you gotta put your Facebook id and Facebook auth token in SECRETS.json. I have no idea how to get these without sniffing the traffic of the Tinder app with mitmproxy. Or you can use any proxy, really. Or there's probably another way to do it. Or you could just close this page and go talk to them, I'm sure they're nice.
# Why did you make this?
¯\\\_(ツ)\_/¯
| Stalk your friends on Tinder. Don't actually do that. It's just a description of what this code does.
To run it using Python 3, just do:
```
pip install -r requirements.txt
python3 app.py
```
You'll then need to answer "y" to a prompt asking you if you really want to look at your real-life friends' Tinder profiles. Otherwise the app will quit.
If you answer "y", the app will be available at `http://localhost:5000`.
Help it's not working
=====================
Listen pal you gotta put your Facebook id and Facebook auth token in SECRETS.json. I have no idea how to get these without sniffing the traffic of the Tinder app with mitmproxy. Or you can use any proxy, really. Or there's probably another way to do it. Or you could just close this page and go talk to them, I'm sure they're nice.
# Why did you make this?
So people on Tinder would know that their Facebook friends could creepily stalk them.
Hey I have a really moral reason for using this code to stalk an actual human being I know
------------------------------------------------------------------------------------------
_Do_ you though? Are you _sure_ you wouldn't rather just close this page and talk to them? It's probably going to help you a lot more than this code is.
| Add ~the power of communication~ | Add ~the power of communication~ | Markdown | mit | defaultnamehere/tinder-detective,defaultnamehere/tinder-detective | markdown | ## Code Before:
Stalk your friends on Tinder. Don't actually do that. It's just a description of what this code does.
To run it using Python 3, just do:
```
pip install -r requirements.txt
python3 app.py
```
You'll then need to answer "y" to a prompt asking you if you really want to look at your real-life friends' Tinder profiles. Otherwise the app will quit.
If you answer "y", the app will be available at `http://localhost:5000`.
Help it's not working
=====================
Listen pal you gotta put your Facebook id and Facebook auth token in SECRETS.json. I have no idea how to get these without sniffing the traffic of the Tinder app with mitmproxy. Or you can use any proxy, really. Or there's probably another way to do it. Or you could just close this page and go talk to them, I'm sure they're nice.
# Why did you make this?
¯\\\_(ツ)\_/¯
## Instruction:
Add ~the power of communication~
## Code After:
Stalk your friends on Tinder. Don't actually do that. It's just a description of what this code does.
To run it using Python 3, just do:
```
pip install -r requirements.txt
python3 app.py
```
You'll then need to answer "y" to a prompt asking you if you really want to look at your real-life friends' Tinder profiles. Otherwise the app will quit.
If you answer "y", the app will be available at `http://localhost:5000`.
Help it's not working
=====================
Listen pal you gotta put your Facebook id and Facebook auth token in SECRETS.json. I have no idea how to get these without sniffing the traffic of the Tinder app with mitmproxy. Or you can use any proxy, really. Or there's probably another way to do it. Or you could just close this page and go talk to them, I'm sure they're nice.
# Why did you make this?
So people on Tinder would know that their Facebook friends could creepily stalk them.
Hey I have a really moral reason for using this code to stalk an actual human being I know
------------------------------------------------------------------------------------------
_Do_ you though? Are you _sure_ you wouldn't rather just close this page and talk to them? It's probably going to help you a lot more than this code is.
| Stalk your friends on Tinder. Don't actually do that. It's just a description of what this code does.
To run it using Python 3, just do:
```
pip install -r requirements.txt
python3 app.py
```
You'll then need to answer "y" to a prompt asking you if you really want to look at your real-life friends' Tinder profiles. Otherwise the app will quit.
If you answer "y", the app will be available at `http://localhost:5000`.
Help it's not working
=====================
Listen pal you gotta put your Facebook id and Facebook auth token in SECRETS.json. I have no idea how to get these without sniffing the traffic of the Tinder app with mitmproxy. Or you can use any proxy, really. Or there's probably another way to do it. Or you could just close this page and go talk to them, I'm sure they're nice.
# Why did you make this?
- ¯\\\_(ツ)\_/¯
+ So people on Tinder would know that their Facebook friends could creepily stalk them.
+
+
+ Hey I have a really moral reason for using this code to stalk an actual human being I know
+ ------------------------------------------------------------------------------------------
+ _Do_ you though? Are you _sure_ you wouldn't rather just close this page and talk to them? It's probably going to help you a lot more than this code is. | 7 | 0.411765 | 6 | 1 |
71d13bf3217d3af1795068245fe656488c6135b9 | CMakeLists.txt | CMakeLists.txt | cmake_minimum_required(VERSION 3.1)
IF(NOT PROJECT_NAME)
project(miniglog)
ENDIF(NOT PROJECT_NAME)
set(TARGET_SRC ${CMAKE_CURRENT_LIST_DIR}/glog/logging.cc)
set(TARGET_HDR ${CMAKE_CURRENT_LIST_DIR}/glog/logging.h)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_library(miniglog SHARED ${TARGET_SRC} ${TARGET_HDR})
# when other libraries or executables link to <target>.
target_include_directories(miniglog PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include> # <prefix>/include
)
#----------------------------------------------------------------------------
# Install instructions.
#----------------------------------------------------------------------------
install(
TARGETS miniglog
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
install(FILES glog/logging.h DESTINATION include/glog)
| cmake_minimum_required(VERSION 3.1)
IF(NOT PROJECT_NAME)
project(miniglog)
ENDIF(NOT PROJECT_NAME)
set(TARGET_SRC ${CMAKE_CURRENT_LIST_DIR}/glog/logging.cc)
set(TARGET_HDR ${CMAKE_CURRENT_LIST_DIR}/glog/logging.h)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# option to build either a shared or a static library. default: shared
option (BUILD_SHARED "Build shared library" ON)
if (BUILD_SHARED)
add_library(miniglog SHARED ${TARGET_SRC} ${TARGET_HDR})
else (BUILD_SHARED)
add_library(miniglog STATIC ${TARGET_SRC} ${TARGET_HDR})
endif (BUILD_SHARED)
# when other libraries or executables link to <target>.
target_include_directories(miniglog PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include> # <prefix>/include
)
#----------------------------------------------------------------------------
# Install instructions.
#----------------------------------------------------------------------------
install(
TARGETS miniglog
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(FILES glog/logging.h DESTINATION include/glog)
| Add cmake support for static library build | Add cmake support for static library build
| Text | bsd-3-clause | tzutalin/miniglog,tzutalin/miniglog | text | ## Code Before:
cmake_minimum_required(VERSION 3.1)
IF(NOT PROJECT_NAME)
project(miniglog)
ENDIF(NOT PROJECT_NAME)
set(TARGET_SRC ${CMAKE_CURRENT_LIST_DIR}/glog/logging.cc)
set(TARGET_HDR ${CMAKE_CURRENT_LIST_DIR}/glog/logging.h)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_library(miniglog SHARED ${TARGET_SRC} ${TARGET_HDR})
# when other libraries or executables link to <target>.
target_include_directories(miniglog PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include> # <prefix>/include
)
#----------------------------------------------------------------------------
# Install instructions.
#----------------------------------------------------------------------------
install(
TARGETS miniglog
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
install(FILES glog/logging.h DESTINATION include/glog)
## Instruction:
Add cmake support for static library build
## Code After:
cmake_minimum_required(VERSION 3.1)
IF(NOT PROJECT_NAME)
project(miniglog)
ENDIF(NOT PROJECT_NAME)
set(TARGET_SRC ${CMAKE_CURRENT_LIST_DIR}/glog/logging.cc)
set(TARGET_HDR ${CMAKE_CURRENT_LIST_DIR}/glog/logging.h)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
# option to build either a shared or a static library. default: shared
option (BUILD_SHARED "Build shared library" ON)
if (BUILD_SHARED)
add_library(miniglog SHARED ${TARGET_SRC} ${TARGET_HDR})
else (BUILD_SHARED)
add_library(miniglog STATIC ${TARGET_SRC} ${TARGET_HDR})
endif (BUILD_SHARED)
# when other libraries or executables link to <target>.
target_include_directories(miniglog PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include> # <prefix>/include
)
#----------------------------------------------------------------------------
# Install instructions.
#----------------------------------------------------------------------------
install(
TARGETS miniglog
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
install(FILES glog/logging.h DESTINATION include/glog)
| cmake_minimum_required(VERSION 3.1)
IF(NOT PROJECT_NAME)
project(miniglog)
ENDIF(NOT PROJECT_NAME)
set(TARGET_SRC ${CMAKE_CURRENT_LIST_DIR}/glog/logging.cc)
set(TARGET_HDR ${CMAKE_CURRENT_LIST_DIR}/glog/logging.h)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+
+ # option to build either a shared or a static library. default: shared
+ option (BUILD_SHARED "Build shared library" ON)
+
+ if (BUILD_SHARED)
- add_library(miniglog SHARED ${TARGET_SRC} ${TARGET_HDR})
+ add_library(miniglog SHARED ${TARGET_SRC} ${TARGET_HDR})
? ++++
+ else (BUILD_SHARED)
+ add_library(miniglog STATIC ${TARGET_SRC} ${TARGET_HDR})
+ endif (BUILD_SHARED)
# when other libraries or executables link to <target>.
target_include_directories(miniglog PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include> # <prefix>/include
)
#----------------------------------------------------------------------------
# Install instructions.
#----------------------------------------------------------------------------
install(
TARGETS miniglog
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
)
install(FILES glog/logging.h DESTINATION include/glog) | 11 | 0.37931 | 10 | 1 |
e93a321e3d137fb21a42d0e0bfd257a537be05d3 | diy/parerga/config.py | diy/parerga/config.py |
import os
# directories constants
PARERGA_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
PARERGA_ENTRY_DIR = os.path.join(PARERGA_ROOT_DIR, "p")
PARERGA_STATIC_DIR = os.path.join(PARERGA_ROOT_DIR, "static")
PARERGA_TEMPLATE_DIR = os.path.join(PARERGA_ROOT_DIR, "templates")
# database location
PARERGA_DB = os.path.join(PARERGA_ROOT_DIR, 'static', 'parerga.db')
|
import os
# directories constants
PARERGA_ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PARERGA_ENTRY_DIR = os.path.join(PARERGA_ROOT_DIR, "p")
PARERGA_STATIC_DIR = os.path.join(PARERGA_ROOT_DIR, "static")
PARERGA_TEMPLATE_DIR = os.path.join(PARERGA_ROOT_DIR, "templates")
# database location
PARERGA_DB = os.path.join(PARERGA_ROOT_DIR, 'static', 'parerga.db')
| Update path vars for the new source location | Update path vars for the new source location
| Python | bsd-3-clause | nadirs/parerga,nadirs/parerga | python | ## Code Before:
import os
# directories constants
PARERGA_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
PARERGA_ENTRY_DIR = os.path.join(PARERGA_ROOT_DIR, "p")
PARERGA_STATIC_DIR = os.path.join(PARERGA_ROOT_DIR, "static")
PARERGA_TEMPLATE_DIR = os.path.join(PARERGA_ROOT_DIR, "templates")
# database location
PARERGA_DB = os.path.join(PARERGA_ROOT_DIR, 'static', 'parerga.db')
## Instruction:
Update path vars for the new source location
## Code After:
import os
# directories constants
PARERGA_ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
PARERGA_ENTRY_DIR = os.path.join(PARERGA_ROOT_DIR, "p")
PARERGA_STATIC_DIR = os.path.join(PARERGA_ROOT_DIR, "static")
PARERGA_TEMPLATE_DIR = os.path.join(PARERGA_ROOT_DIR, "templates")
# database location
PARERGA_DB = os.path.join(PARERGA_ROOT_DIR, 'static', 'parerga.db')
|
import os
# directories constants
- PARERGA_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
+ PARERGA_ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
? ++++++++++++++++ +
PARERGA_ENTRY_DIR = os.path.join(PARERGA_ROOT_DIR, "p")
PARERGA_STATIC_DIR = os.path.join(PARERGA_ROOT_DIR, "static")
PARERGA_TEMPLATE_DIR = os.path.join(PARERGA_ROOT_DIR, "templates")
# database location
PARERGA_DB = os.path.join(PARERGA_ROOT_DIR, 'static', 'parerga.db') | 2 | 0.181818 | 1 | 1 |
03e1ace65afad97aee1296b697462b467e50dc2d | src/common/appId.js | src/common/appId.js | var utils = require('utils');
var AppId = {
app_id: ( document.location.port === '8080' ) ? 1168 : ( ( document.location.hostname.indexOf('github.io') >= 0 ) ? 1180 : 1169 ),
redirectOauth: function oauthLogin(){
document.location = 'https://oauth.binary.com/oauth2/authorize?app_id=' + this.app_id + '&l=' + window.lang.toUpperCase();
},
oauthLogin: function getToken(done) {
var queryStr = utils.parseQueryString();
var tokenList = [];
Object.keys(queryStr).forEach(function(key){
if ( key.indexOf('token') === 0 ) {
tokenList.push(queryStr[key]);
}
});
if (tokenList.length) {
utils.addAllTokens(tokenList, function(){
document.location.pathname += ((document.location.pathname.slice(-1) === '/')?'':'/') + 'bot.html';
});
} else {
if (done) {
done();
}
}
},
removeTokenFromUrl: function removeTokenFromUrl(){
var queryStr = utils.parseQueryString();
if (queryStr.token1) {
document.location.href = document.location.href.split('?')[0];
}
},
getAppId: function getAppId(){
return this.app_id;
}
};
module.exports = AppId; | var utils = require('utils');
var $ = require('jquery');
var AppId = {
app_id: ( document.location.port === '8080' ) ? 1168 : ( ( document.location.hostname.indexOf('github.io') >= 0 ) ? 1180 : 1169 ),
redirectOauth: function oauthLogin(){
document.location = 'https://oauth.binary.com/oauth2/authorize?app_id=' + this.app_id + '&l=' + window.lang.toUpperCase();
},
oauthLogin: function getToken(done) {
var queryStr = utils.parseQueryString();
var tokenList = [];
Object.keys(queryStr).forEach(function(key){
if ( key.indexOf('token') === 0 ) {
tokenList.push(queryStr[key]);
}
});
if (tokenList.length) {
$('#main').hide();
utils.addAllTokens(tokenList, function(){
document.location.pathname += ((document.location.pathname.slice(-1) === '/')?'':'/') + 'bot.html';
});
} else {
if (done) {
done();
}
}
},
removeTokenFromUrl: function removeTokenFromUrl(){
var queryStr = utils.parseQueryString();
if (queryStr.token1) {
document.location.href = document.location.href.split('?')[0];
}
},
getAppId: function getAppId(){
return this.app_id;
}
};
module.exports = AppId; | Hide body of the index page when redirecting | Hide body of the index page when redirecting
| JavaScript | mit | aminmarashi/binary-bot,aminmarashi/binary-bot,binary-com/binary-bot,binary-com/binary-bot | javascript | ## Code Before:
var utils = require('utils');
var AppId = {
app_id: ( document.location.port === '8080' ) ? 1168 : ( ( document.location.hostname.indexOf('github.io') >= 0 ) ? 1180 : 1169 ),
redirectOauth: function oauthLogin(){
document.location = 'https://oauth.binary.com/oauth2/authorize?app_id=' + this.app_id + '&l=' + window.lang.toUpperCase();
},
oauthLogin: function getToken(done) {
var queryStr = utils.parseQueryString();
var tokenList = [];
Object.keys(queryStr).forEach(function(key){
if ( key.indexOf('token') === 0 ) {
tokenList.push(queryStr[key]);
}
});
if (tokenList.length) {
utils.addAllTokens(tokenList, function(){
document.location.pathname += ((document.location.pathname.slice(-1) === '/')?'':'/') + 'bot.html';
});
} else {
if (done) {
done();
}
}
},
removeTokenFromUrl: function removeTokenFromUrl(){
var queryStr = utils.parseQueryString();
if (queryStr.token1) {
document.location.href = document.location.href.split('?')[0];
}
},
getAppId: function getAppId(){
return this.app_id;
}
};
module.exports = AppId;
## Instruction:
Hide body of the index page when redirecting
## Code After:
var utils = require('utils');
var $ = require('jquery');
var AppId = {
app_id: ( document.location.port === '8080' ) ? 1168 : ( ( document.location.hostname.indexOf('github.io') >= 0 ) ? 1180 : 1169 ),
redirectOauth: function oauthLogin(){
document.location = 'https://oauth.binary.com/oauth2/authorize?app_id=' + this.app_id + '&l=' + window.lang.toUpperCase();
},
oauthLogin: function getToken(done) {
var queryStr = utils.parseQueryString();
var tokenList = [];
Object.keys(queryStr).forEach(function(key){
if ( key.indexOf('token') === 0 ) {
tokenList.push(queryStr[key]);
}
});
if (tokenList.length) {
$('#main').hide();
utils.addAllTokens(tokenList, function(){
document.location.pathname += ((document.location.pathname.slice(-1) === '/')?'':'/') + 'bot.html';
});
} else {
if (done) {
done();
}
}
},
removeTokenFromUrl: function removeTokenFromUrl(){
var queryStr = utils.parseQueryString();
if (queryStr.token1) {
document.location.href = document.location.href.split('?')[0];
}
},
getAppId: function getAppId(){
return this.app_id;
}
};
module.exports = AppId; | var utils = require('utils');
+ var $ = require('jquery');
var AppId = {
app_id: ( document.location.port === '8080' ) ? 1168 : ( ( document.location.hostname.indexOf('github.io') >= 0 ) ? 1180 : 1169 ),
redirectOauth: function oauthLogin(){
document.location = 'https://oauth.binary.com/oauth2/authorize?app_id=' + this.app_id + '&l=' + window.lang.toUpperCase();
},
oauthLogin: function getToken(done) {
var queryStr = utils.parseQueryString();
var tokenList = [];
Object.keys(queryStr).forEach(function(key){
if ( key.indexOf('token') === 0 ) {
tokenList.push(queryStr[key]);
}
});
if (tokenList.length) {
+ $('#main').hide();
utils.addAllTokens(tokenList, function(){
document.location.pathname += ((document.location.pathname.slice(-1) === '/')?'':'/') + 'bot.html';
});
} else {
if (done) {
done();
}
}
},
removeTokenFromUrl: function removeTokenFromUrl(){
var queryStr = utils.parseQueryString();
if (queryStr.token1) {
document.location.href = document.location.href.split('?')[0];
}
},
getAppId: function getAppId(){
return this.app_id;
}
};
module.exports = AppId; | 2 | 0.054054 | 2 | 0 |
cc29bccc89271f9d863e3230d953d4cde407b0da | app/scripts/components/slurm/slurm-allocation-config.js | app/scripts/components/slurm/slurm-allocation-config.js | const SlurmAllocationConfig = {
order: [
'name',
'description',
'cpu_limit',
],
options: {
name: {
type: 'string',
required: true,
label: gettext('Allocation name'),
maxlength: 150
},
description: {
type: 'text',
required: false,
label: gettext('Description'),
maxlength: 500,
},
cpu_limit: {
type: 'integer',
required: true,
label: 'CPU limit, minutes',
default_value: -1,
},
}
};
// @ngInject
export default function fieldsConfig(AppstoreFieldConfigurationProvider) {
AppstoreFieldConfigurationProvider.register('SLURM.Allocation', SlurmAllocationConfig);
}
| const SlurmAllocationConfig = {
order: [
'name',
'description',
'cpu_limit',
],
options: {
name: {
type: 'string',
required: true,
label: gettext('Allocation name'),
form_text: gettext('This name will be visible in accounting data.'),
maxlength: 150
},
description: {
type: 'text',
required: false,
label: gettext('Description'),
maxlength: 500,
},
cpu_limit: {
type: 'integer',
required: true,
label: 'CPU limit, minutes',
default_value: -1,
},
}
};
// @ngInject
export default function fieldsConfig(AppstoreFieldConfigurationProvider) {
AppstoreFieldConfigurationProvider.register('SLURM.Allocation', SlurmAllocationConfig);
}
| Add warning about accounting name for SLURM allocation provision form | Add warning about accounting name for SLURM allocation provision form [WAL-1131]
| JavaScript | mit | opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport,opennode/waldur-homeport | javascript | ## Code Before:
const SlurmAllocationConfig = {
order: [
'name',
'description',
'cpu_limit',
],
options: {
name: {
type: 'string',
required: true,
label: gettext('Allocation name'),
maxlength: 150
},
description: {
type: 'text',
required: false,
label: gettext('Description'),
maxlength: 500,
},
cpu_limit: {
type: 'integer',
required: true,
label: 'CPU limit, minutes',
default_value: -1,
},
}
};
// @ngInject
export default function fieldsConfig(AppstoreFieldConfigurationProvider) {
AppstoreFieldConfigurationProvider.register('SLURM.Allocation', SlurmAllocationConfig);
}
## Instruction:
Add warning about accounting name for SLURM allocation provision form [WAL-1131]
## Code After:
const SlurmAllocationConfig = {
order: [
'name',
'description',
'cpu_limit',
],
options: {
name: {
type: 'string',
required: true,
label: gettext('Allocation name'),
form_text: gettext('This name will be visible in accounting data.'),
maxlength: 150
},
description: {
type: 'text',
required: false,
label: gettext('Description'),
maxlength: 500,
},
cpu_limit: {
type: 'integer',
required: true,
label: 'CPU limit, minutes',
default_value: -1,
},
}
};
// @ngInject
export default function fieldsConfig(AppstoreFieldConfigurationProvider) {
AppstoreFieldConfigurationProvider.register('SLURM.Allocation', SlurmAllocationConfig);
}
| const SlurmAllocationConfig = {
order: [
'name',
'description',
'cpu_limit',
],
options: {
name: {
type: 'string',
required: true,
label: gettext('Allocation name'),
+ form_text: gettext('This name will be visible in accounting data.'),
maxlength: 150
},
description: {
type: 'text',
required: false,
label: gettext('Description'),
maxlength: 500,
},
cpu_limit: {
type: 'integer',
required: true,
label: 'CPU limit, minutes',
default_value: -1,
},
}
};
// @ngInject
export default function fieldsConfig(AppstoreFieldConfigurationProvider) {
AppstoreFieldConfigurationProvider.register('SLURM.Allocation', SlurmAllocationConfig);
} | 1 | 0.03125 | 1 | 0 |
89c0ffe3e995444439466832e1a1635f7e295cb4 | bower.json | bower.json | {
"name": "kalendae",
"version": "0.5.1",
"homepage": "https://github.com/chipersoft/kalendae",
"authors": [
"Jarvis Badgley",
"Geremia Taglialatela"
],
"main": ["kalendae.min.js", "kalendae.css"],
"description": "A framework agnostic javascript date picker.",
"keywords": [
"datepicker",
"kalendae",
"calendar",
"purejs"
],
"dependencies": {
"moment": "2.1.0"
},
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"src"
]
} | {
"name": "kalendae",
"version": "0.5.1",
"homepage": "https://github.com/chipersoft/kalendae",
"authors": [
"Jarvis Badgley",
"Geremia Taglialatela"
],
"main": ["build/kalendae.min.js", "build/kalendae.css"],
"description": "A framework agnostic javascript date picker.",
"keywords": [
"datepicker",
"kalendae",
"calendar",
"purejs"
],
"dependencies": {
"moment": "2.1.0"
},
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"src"
]
}
| Correct location for the main files. | Correct location for the main files. | JSON | mit | ChiperSoft/Kalendae,coreyzev/Kalendae,scientiacloud/Kalendae,coreyzev/Kalendae,scientiacloud/Kalendae,ChiperSoft/Kalendae | json | ## Code Before:
{
"name": "kalendae",
"version": "0.5.1",
"homepage": "https://github.com/chipersoft/kalendae",
"authors": [
"Jarvis Badgley",
"Geremia Taglialatela"
],
"main": ["kalendae.min.js", "kalendae.css"],
"description": "A framework agnostic javascript date picker.",
"keywords": [
"datepicker",
"kalendae",
"calendar",
"purejs"
],
"dependencies": {
"moment": "2.1.0"
},
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"src"
]
}
## Instruction:
Correct location for the main files.
## Code After:
{
"name": "kalendae",
"version": "0.5.1",
"homepage": "https://github.com/chipersoft/kalendae",
"authors": [
"Jarvis Badgley",
"Geremia Taglialatela"
],
"main": ["build/kalendae.min.js", "build/kalendae.css"],
"description": "A framework agnostic javascript date picker.",
"keywords": [
"datepicker",
"kalendae",
"calendar",
"purejs"
],
"dependencies": {
"moment": "2.1.0"
},
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"src"
]
}
| {
"name": "kalendae",
"version": "0.5.1",
"homepage": "https://github.com/chipersoft/kalendae",
"authors": [
"Jarvis Badgley",
"Geremia Taglialatela"
],
- "main": ["kalendae.min.js", "kalendae.css"],
+ "main": ["build/kalendae.min.js", "build/kalendae.css"],
? ++++++ ++++++
"description": "A framework agnostic javascript date picker.",
"keywords": [
"datepicker",
"kalendae",
"calendar",
"purejs"
],
"dependencies": {
"moment": "2.1.0"
},
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"src"
]
} | 2 | 0.068966 | 1 | 1 |
31509c6f962b7af4ca6690b7a549232715a0bbc4 | src/mcfedr/Queue/JobManagerBundle/Manager/JobManager.php | src/mcfedr/Queue/JobManagerBundle/Manager/JobManager.php | <?php
/**
* Created by mcfedr on 21/03/2014 14:19
*/
namespace mcfedr\Queue\JobManagerBundle\Manager;
use mcfedr\Queue\QueueManagerBundle\Manager\QueueManager;
use mcfedr\Queue\QueueManagerBundle\Queue\Job;
class JobManager
{
/**
* @var \mcfedr\Queue\QueueManagerBundle\Manager\QueueManager
*/
protected $manager;
public function __construct(QueueManager $manager)
{
$this->manager = $manager;
}
/**
* Put a new job on a queue
*
* @param string $name The name of the worker
* @param array $options Options to pass to execute - must be json_encode-able
* @param string $queue Optional queue name, otherwise the default queue will be used
* @param int $priority
* @param \DateTime $when Optionally set a time in the future when this task should happen
* @return Job
*/
public function put($name, array $options = null, $queue = null, $priority = null, $when = null)
{
return $this->manager->put(json_encode([
'name' => $name,
'options' => $options
]), $queue, $priority, $when);
}
}
| <?php
/**
* Created by mcfedr on 21/03/2014 14:19
*/
namespace mcfedr\Queue\JobManagerBundle\Manager;
use mcfedr\Queue\QueueManagerBundle\Exception\WrongJobException;
use mcfedr\Queue\QueueManagerBundle\Manager\QueueManager;
use mcfedr\Queue\QueueManagerBundle\Queue\Job;
class JobManager
{
/**
* @var \mcfedr\Queue\QueueManagerBundle\Manager\QueueManager
*/
protected $manager;
public function __construct(QueueManager $manager)
{
$this->manager = $manager;
}
/**
* Put a new job on a queue
*
* @param string $name The name of the worker
* @param array $options Options to pass to execute - must be json_encode-able
* @param string $queue Optional queue name, otherwise the default queue will be used
* @param int $priority
* @param \DateTime $when Optionally set a time in the future when this task should happen
* @return Job
*/
public function put($name, array $options = null, $queue = null, $priority = null, $when = null)
{
return $this->manager->put(json_encode([
'name' => $name,
'options' => $options
]), $queue, $priority, $when);
}
/**
* Remove a job
*
* @param $job
* @throws WrongJobException
*/
public function delete(Job $job)
{
$this->manager->delete($job);
}
}
| Add possibility to delete a job | Add possibility to delete a job
| PHP | mit | mcfedr/job-manager-bundle | php | ## Code Before:
<?php
/**
* Created by mcfedr on 21/03/2014 14:19
*/
namespace mcfedr\Queue\JobManagerBundle\Manager;
use mcfedr\Queue\QueueManagerBundle\Manager\QueueManager;
use mcfedr\Queue\QueueManagerBundle\Queue\Job;
class JobManager
{
/**
* @var \mcfedr\Queue\QueueManagerBundle\Manager\QueueManager
*/
protected $manager;
public function __construct(QueueManager $manager)
{
$this->manager = $manager;
}
/**
* Put a new job on a queue
*
* @param string $name The name of the worker
* @param array $options Options to pass to execute - must be json_encode-able
* @param string $queue Optional queue name, otherwise the default queue will be used
* @param int $priority
* @param \DateTime $when Optionally set a time in the future when this task should happen
* @return Job
*/
public function put($name, array $options = null, $queue = null, $priority = null, $when = null)
{
return $this->manager->put(json_encode([
'name' => $name,
'options' => $options
]), $queue, $priority, $when);
}
}
## Instruction:
Add possibility to delete a job
## Code After:
<?php
/**
* Created by mcfedr on 21/03/2014 14:19
*/
namespace mcfedr\Queue\JobManagerBundle\Manager;
use mcfedr\Queue\QueueManagerBundle\Exception\WrongJobException;
use mcfedr\Queue\QueueManagerBundle\Manager\QueueManager;
use mcfedr\Queue\QueueManagerBundle\Queue\Job;
class JobManager
{
/**
* @var \mcfedr\Queue\QueueManagerBundle\Manager\QueueManager
*/
protected $manager;
public function __construct(QueueManager $manager)
{
$this->manager = $manager;
}
/**
* Put a new job on a queue
*
* @param string $name The name of the worker
* @param array $options Options to pass to execute - must be json_encode-able
* @param string $queue Optional queue name, otherwise the default queue will be used
* @param int $priority
* @param \DateTime $when Optionally set a time in the future when this task should happen
* @return Job
*/
public function put($name, array $options = null, $queue = null, $priority = null, $when = null)
{
return $this->manager->put(json_encode([
'name' => $name,
'options' => $options
]), $queue, $priority, $when);
}
/**
* Remove a job
*
* @param $job
* @throws WrongJobException
*/
public function delete(Job $job)
{
$this->manager->delete($job);
}
}
| <?php
/**
* Created by mcfedr on 21/03/2014 14:19
*/
namespace mcfedr\Queue\JobManagerBundle\Manager;
+ use mcfedr\Queue\QueueManagerBundle\Exception\WrongJobException;
use mcfedr\Queue\QueueManagerBundle\Manager\QueueManager;
use mcfedr\Queue\QueueManagerBundle\Queue\Job;
class JobManager
{
/**
* @var \mcfedr\Queue\QueueManagerBundle\Manager\QueueManager
*/
protected $manager;
public function __construct(QueueManager $manager)
{
$this->manager = $manager;
}
/**
* Put a new job on a queue
*
* @param string $name The name of the worker
* @param array $options Options to pass to execute - must be json_encode-able
* @param string $queue Optional queue name, otherwise the default queue will be used
* @param int $priority
* @param \DateTime $when Optionally set a time in the future when this task should happen
* @return Job
*/
public function put($name, array $options = null, $queue = null, $priority = null, $when = null)
{
return $this->manager->put(json_encode([
'name' => $name,
'options' => $options
]), $queue, $priority, $when);
}
+
+ /**
+ * Remove a job
+ *
+ * @param $job
+ * @throws WrongJobException
+ */
+ public function delete(Job $job)
+ {
+ $this->manager->delete($job);
+ }
} | 12 | 0.3 | 12 | 0 |
949ffe39dfc6f049ffeaa33985c7405c6886d86b | src/index.html | src/index.html | <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GitHub Notifications Snoozer</title>
<link rel="stylesheet" type="text/less" href="components/App/App.less">
</head>
<body>
<div id="content"></div>
<script>
const React = require('react')
const ReactDom = require('react-dom')
const ReactRedux = require('react-redux')
const Redux = require('redux')
const App = require('./components/App')
const reducer = require('./reducers/reducer')
const store = Redux.createStore(reducer)
ReactDom.render(
<ReactRedux.Provider store={store}>
<App />
</ReactRedux.Provider>,
document.getElementById('content')
)
</script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GitHub Notifications Snoozer</title>
<link rel="stylesheet" type="text/less" href="components/App/App.less">
</head>
<body>
<div id="content"></div>
<script type="text/jsx">
const React = require('react')
const ReactDom = require('react-dom')
const ReactRedux = require('react-redux')
const Redux = require('redux')
const App = require('./components/App')
const reducer = require('./reducers/reducer')
const store = Redux.createStore(reducer)
ReactDom.render(
<ReactRedux.Provider store={store}>
<App />
</ReactRedux.Provider>,
document.getElementById('content')
)
</script>
</body>
</html>
| Add text/jsx type to script for syntax highlighting | Add text/jsx type to script for syntax highlighting
| HTML | mit | cheshire137/gh-notifications-snoozer,cheshire137/gh-notifications-snoozer | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GitHub Notifications Snoozer</title>
<link rel="stylesheet" type="text/less" href="components/App/App.less">
</head>
<body>
<div id="content"></div>
<script>
const React = require('react')
const ReactDom = require('react-dom')
const ReactRedux = require('react-redux')
const Redux = require('redux')
const App = require('./components/App')
const reducer = require('./reducers/reducer')
const store = Redux.createStore(reducer)
ReactDom.render(
<ReactRedux.Provider store={store}>
<App />
</ReactRedux.Provider>,
document.getElementById('content')
)
</script>
</body>
</html>
## Instruction:
Add text/jsx type to script for syntax highlighting
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GitHub Notifications Snoozer</title>
<link rel="stylesheet" type="text/less" href="components/App/App.less">
</head>
<body>
<div id="content"></div>
<script type="text/jsx">
const React = require('react')
const ReactDom = require('react-dom')
const ReactRedux = require('react-redux')
const Redux = require('redux')
const App = require('./components/App')
const reducer = require('./reducers/reducer')
const store = Redux.createStore(reducer)
ReactDom.render(
<ReactRedux.Provider store={store}>
<App />
</ReactRedux.Provider>,
document.getElementById('content')
)
</script>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>GitHub Notifications Snoozer</title>
<link rel="stylesheet" type="text/less" href="components/App/App.less">
</head>
<body>
<div id="content"></div>
- <script>
+ <script type="text/jsx">
const React = require('react')
const ReactDom = require('react-dom')
const ReactRedux = require('react-redux')
const Redux = require('redux')
const App = require('./components/App')
const reducer = require('./reducers/reducer')
const store = Redux.createStore(reducer)
ReactDom.render(
<ReactRedux.Provider store={store}>
<App />
</ReactRedux.Provider>,
document.getElementById('content')
)
</script>
</body>
</html> | 2 | 0.071429 | 1 | 1 |
54360cd59e197a85a5172cf614221120161eb3cf | android/README.md | android/README.md | - Create a Splunk Storm account
- Move splunkstormmobileanalytics.jar into the libs directory of your Android mobile app project
- Connect to SplunkStorm in the main activity of the app
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Storm.connect("STORM_PROJECT_KEY", "STORM_ACCESS_TOKEN", getApplicationContext());
```
- You may also send events through TCP
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Storm.TCPconnect("STORM_RECEIVING_URL", PORT_NUMBER, getApplicationContext());
```
- Add access internet permission between the **"manifest"** element in the AndroidManifest.xml
```xml
<uses-permission android:name="android.permission.INTERNET"/>
```
- If you wish to forward the data to Splunk Enterprise, do the following:
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Splunk.connect("SPLUNKD_URL", "SPLUNKD_USERNAME", "SPLUNKD_PASSWORD", getApplicationContext());
```
- You are set
- Go to the Storm dashboard to perform crash analytics!
- Thank you for trying this logging library!
| - Create a Splunk Storm account
- Move splunkstormmobileanalytics.jar into the libs directory of your Android mobile app project
- Connect to SplunkStorm in the main activity of the app
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Storm.connect("STORM_PROJECT_KEY", "STORM_ACCESS_TOKEN", getApplicationContext());
```
- You may also send events through TCP
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Storm.TCPconnect("STORM_RECEIVING_URL", PORT_NUMBER, getApplicationContext());
```
- Add access internet permission between the **"manifest"** element in the AndroidManifest.xml
```xml
<uses-permission android:name="android.permission.INTERNET"/>
```
- If you wish to forward the data to Splunk Enterprise, do the following:
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Splunk.connect("SPLUNKD_URL", "SPLUNKD_USERNAME", "SPLUNKD_PASSWORD", getApplicationContext());
```
- You are set
- Go to the Storm dashboard to perform crash analytics!
- Thank you for trying this logging library!
#LIABILITY
Splunk does not assume any liability upon the usage of this library. Use it as is.
#SUPPORT
This is not a Splunk officially supported library.
#License
The Mobile Analytics with Splunk Storm is licensed under the Apache License 2.0. Details can be found in the LICENSE file.
| Update readme with license, liability and support | Update readme with license, liability and support | Markdown | apache-2.0 | nicholaskeytholeong/splunk-storm-mobile-analytics | markdown | ## Code Before:
- Create a Splunk Storm account
- Move splunkstormmobileanalytics.jar into the libs directory of your Android mobile app project
- Connect to SplunkStorm in the main activity of the app
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Storm.connect("STORM_PROJECT_KEY", "STORM_ACCESS_TOKEN", getApplicationContext());
```
- You may also send events through TCP
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Storm.TCPconnect("STORM_RECEIVING_URL", PORT_NUMBER, getApplicationContext());
```
- Add access internet permission between the **"manifest"** element in the AndroidManifest.xml
```xml
<uses-permission android:name="android.permission.INTERNET"/>
```
- If you wish to forward the data to Splunk Enterprise, do the following:
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Splunk.connect("SPLUNKD_URL", "SPLUNKD_USERNAME", "SPLUNKD_PASSWORD", getApplicationContext());
```
- You are set
- Go to the Storm dashboard to perform crash analytics!
- Thank you for trying this logging library!
## Instruction:
Update readme with license, liability and support
## Code After:
- Create a Splunk Storm account
- Move splunkstormmobileanalytics.jar into the libs directory of your Android mobile app project
- Connect to SplunkStorm in the main activity of the app
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Storm.connect("STORM_PROJECT_KEY", "STORM_ACCESS_TOKEN", getApplicationContext());
```
- You may also send events through TCP
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Storm.TCPconnect("STORM_RECEIVING_URL", PORT_NUMBER, getApplicationContext());
```
- Add access internet permission between the **"manifest"** element in the AndroidManifest.xml
```xml
<uses-permission android:name="android.permission.INTERNET"/>
```
- If you wish to forward the data to Splunk Enterprise, do the following:
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Splunk.connect("SPLUNKD_URL", "SPLUNKD_USERNAME", "SPLUNKD_PASSWORD", getApplicationContext());
```
- You are set
- Go to the Storm dashboard to perform crash analytics!
- Thank you for trying this logging library!
#LIABILITY
Splunk does not assume any liability upon the usage of this library. Use it as is.
#SUPPORT
This is not a Splunk officially supported library.
#License
The Mobile Analytics with Splunk Storm is licensed under the Apache License 2.0. Details can be found in the LICENSE file.
| - Create a Splunk Storm account
- Move splunkstormmobileanalytics.jar into the libs directory of your Android mobile app project
- Connect to SplunkStorm in the main activity of the app
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Storm.connect("STORM_PROJECT_KEY", "STORM_ACCESS_TOKEN", getApplicationContext());
```
- You may also send events through TCP
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Storm.TCPconnect("STORM_RECEIVING_URL", PORT_NUMBER, getApplicationContext());
```
- Add access internet permission between the **"manifest"** element in the AndroidManifest.xml
```xml
<uses-permission android:name="android.permission.INTERNET"/>
```
- If you wish to forward the data to Splunk Enterprise, do the following:
```java
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Splunk.connect("SPLUNKD_URL", "SPLUNKD_USERNAME", "SPLUNKD_PASSWORD", getApplicationContext());
```
- You are set
- Go to the Storm dashboard to perform crash analytics!
- Thank you for trying this logging library!
+
+ #LIABILITY
+ Splunk does not assume any liability upon the usage of this library. Use it as is.
+
+ #SUPPORT
+ This is not a Splunk officially supported library.
+
+ #License
+ The Mobile Analytics with Splunk Storm is licensed under the Apache License 2.0. Details can be found in the LICENSE file. | 9 | 0.257143 | 9 | 0 |
be148a98ba3af5f01f5c5c6b831c471d87b7422f | package.json | package.json | {
"name": "pure-formatters",
"version": "1.0.0",
"description": "A collection of pure JS functions that return formatted data. Useful in any view engine.",
"main": "index.js",
"scripts": {
"test": "npm run build && mocha ./test",
"build": "webpack"
},
"author": "Travis Horn (https://travishorn.com)",
"license": "MIT",
"devDependencies": {
"mocha": "^3.5.3",
"webpack": "^3.6.0"
}
}
| {
"name": "pure-formatters",
"version": "1.0.0",
"description": "A collection of pure JS functions that return formatted data. Useful in any view engine.",
"main": "index.js",
"scripts": {
"test": "npm run build && mocha ./test",
"build": "webpack"
},
"author": "Travis Horn (https://travishorn.com)",
"license": "MIT",
"devDependencies": {
"mocha": "^3.5.3",
"webpack": "^3.6.0"
},
"files": [
"dist/"
]
}
| Whitelist production files for npm | Whitelist production files for npm
| JSON | mit | travishorn/pure-formatters | json | ## Code Before:
{
"name": "pure-formatters",
"version": "1.0.0",
"description": "A collection of pure JS functions that return formatted data. Useful in any view engine.",
"main": "index.js",
"scripts": {
"test": "npm run build && mocha ./test",
"build": "webpack"
},
"author": "Travis Horn (https://travishorn.com)",
"license": "MIT",
"devDependencies": {
"mocha": "^3.5.3",
"webpack": "^3.6.0"
}
}
## Instruction:
Whitelist production files for npm
## Code After:
{
"name": "pure-formatters",
"version": "1.0.0",
"description": "A collection of pure JS functions that return formatted data. Useful in any view engine.",
"main": "index.js",
"scripts": {
"test": "npm run build && mocha ./test",
"build": "webpack"
},
"author": "Travis Horn (https://travishorn.com)",
"license": "MIT",
"devDependencies": {
"mocha": "^3.5.3",
"webpack": "^3.6.0"
},
"files": [
"dist/"
]
}
| {
"name": "pure-formatters",
"version": "1.0.0",
"description": "A collection of pure JS functions that return formatted data. Useful in any view engine.",
"main": "index.js",
"scripts": {
"test": "npm run build && mocha ./test",
"build": "webpack"
},
"author": "Travis Horn (https://travishorn.com)",
"license": "MIT",
"devDependencies": {
"mocha": "^3.5.3",
"webpack": "^3.6.0"
- }
+ },
? +
+ "files": [
+ "dist/"
+ ]
} | 5 | 0.3125 | 4 | 1 |
e97555843bf6d7ce2e7e7612f42ddba2d696fe36 | console/src/test/java/de/marza/firstspirit/modules/logging/console/utilities/ReadTextFromFileTest.java | console/src/test/java/de/marza/firstspirit/modules/logging/console/utilities/ReadTextFromFileTest.java | package de.marza.firstspirit.modules.logging.console.utilities;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.SystemErrRule;
import javax.swing.JEditorPane;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public class ReadTextFromFileTest {
public static final String EOL = System.lineSeparator();
@Rule
public SystemErrRule rule = new SystemErrRule();
private ReadTextFromFile testling;
@Before
public void setUp() throws Exception {
testling = new ReadTextFromFile("/test.txt");
}
@Test
public void readAsJEditor() throws Exception {
final JEditorPane editorPane = testling.readAsJEditor();
final String expectedText = "<html>\n " +
"<head>\n \n </head>\n " +
"<body>\n This is a test!\n </body>\n" +
"</html>\n";
assertThat(editorPane.getText(), is(expectedText));
}
@Test(expected = IllegalArgumentException.class)
public void testNullArgumentConstructor() throws Exception {
new ReadTextFromFile(null);
}
@Test
@Ignore
public void testFileNotFound() throws Exception {
rule.enableLog();
testling = new ReadTextFromFile("/test.text");
testling.readAsJEditor();
assertThat("An error occurred while reading the about text: java.lang.NullPointerException" + EOL,
is(rule.getLog()));
}
} | package de.marza.firstspirit.modules.logging.console.utilities;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.SystemErrRule;
import javax.swing.JEditorPane;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public class ReadTextFromFileTest {
public static final String EOL = System.lineSeparator();
@Rule
public SystemErrRule rule = new SystemErrRule();
private ReadTextFromFile testling;
@Before
public void setUp() throws Exception {
testling = new ReadTextFromFile("/test.txt");
}
@Test
public void readAsJEditor() throws Exception {
final JEditorPane editorPane = testling.readAsJEditor();
final String expectedText = "<html>\n " +
"<head>\n \n </head>\n " +
"<body>\n This is a test!\n </body>\n" +
"</html>\n";
assertThat(editorPane.getText(), is(expectedText));
}
@Test(expected = IllegalArgumentException.class)
public void testNullArgumentConstructor() throws Exception {
new ReadTextFromFile(null);
}
@Test
@Ignore
public void testFileNotFound() throws Exception {
rule.enableLog();
testling = new ReadTextFromFile("/test.text");
testling.readAsJEditor();
assertThat("An error occurred while reading the about text: java.lang.NullPointerException" + EOL,
is(rule.getLog()));
}
} | Fix compilation error & ignore test since it fails sometimes in parallel test execution | Fix compilation error & ignore test since it fails sometimes in parallel test execution
| Java | mit | zaplatynski/second-hand-log | java | ## Code Before:
package de.marza.firstspirit.modules.logging.console.utilities;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.SystemErrRule;
import javax.swing.JEditorPane;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public class ReadTextFromFileTest {
public static final String EOL = System.lineSeparator();
@Rule
public SystemErrRule rule = new SystemErrRule();
private ReadTextFromFile testling;
@Before
public void setUp() throws Exception {
testling = new ReadTextFromFile("/test.txt");
}
@Test
public void readAsJEditor() throws Exception {
final JEditorPane editorPane = testling.readAsJEditor();
final String expectedText = "<html>\n " +
"<head>\n \n </head>\n " +
"<body>\n This is a test!\n </body>\n" +
"</html>\n";
assertThat(editorPane.getText(), is(expectedText));
}
@Test(expected = IllegalArgumentException.class)
public void testNullArgumentConstructor() throws Exception {
new ReadTextFromFile(null);
}
@Test
@Ignore
public void testFileNotFound() throws Exception {
rule.enableLog();
testling = new ReadTextFromFile("/test.text");
testling.readAsJEditor();
assertThat("An error occurred while reading the about text: java.lang.NullPointerException" + EOL,
is(rule.getLog()));
}
}
## Instruction:
Fix compilation error & ignore test since it fails sometimes in parallel test execution
## Code After:
package de.marza.firstspirit.modules.logging.console.utilities;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.SystemErrRule;
import javax.swing.JEditorPane;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public class ReadTextFromFileTest {
public static final String EOL = System.lineSeparator();
@Rule
public SystemErrRule rule = new SystemErrRule();
private ReadTextFromFile testling;
@Before
public void setUp() throws Exception {
testling = new ReadTextFromFile("/test.txt");
}
@Test
public void readAsJEditor() throws Exception {
final JEditorPane editorPane = testling.readAsJEditor();
final String expectedText = "<html>\n " +
"<head>\n \n </head>\n " +
"<body>\n This is a test!\n </body>\n" +
"</html>\n";
assertThat(editorPane.getText(), is(expectedText));
}
@Test(expected = IllegalArgumentException.class)
public void testNullArgumentConstructor() throws Exception {
new ReadTextFromFile(null);
}
@Test
@Ignore
public void testFileNotFound() throws Exception {
rule.enableLog();
testling = new ReadTextFromFile("/test.text");
testling.readAsJEditor();
assertThat("An error occurred while reading the about text: java.lang.NullPointerException" + EOL,
is(rule.getLog()));
}
} | package de.marza.firstspirit.modules.logging.console.utilities;
import org.junit.Before;
+ import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.contrib.java.lang.system.SystemErrRule;
import javax.swing.JEditorPane;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public class ReadTextFromFileTest {
public static final String EOL = System.lineSeparator();
@Rule
public SystemErrRule rule = new SystemErrRule();
private ReadTextFromFile testling;
@Before
public void setUp() throws Exception {
testling = new ReadTextFromFile("/test.txt");
}
@Test
public void readAsJEditor() throws Exception {
final JEditorPane editorPane = testling.readAsJEditor();
final String expectedText = "<html>\n " +
"<head>\n \n </head>\n " +
"<body>\n This is a test!\n </body>\n" +
"</html>\n";
assertThat(editorPane.getText(), is(expectedText));
}
@Test(expected = IllegalArgumentException.class)
public void testNullArgumentConstructor() throws Exception {
new ReadTextFromFile(null);
}
@Test
@Ignore
public void testFileNotFound() throws Exception {
rule.enableLog();
testling = new ReadTextFromFile("/test.text");
testling.readAsJEditor();
assertThat("An error occurred while reading the about text: java.lang.NullPointerException" + EOL,
is(rule.getLog()));
}
} | 1 | 0.018182 | 1 | 0 |
f7eb287296e173a045a0d99f1587602da9c1a6fa | features/support/env.rb | features/support/env.rb | require 'aruba/api'
require 'aruba/cucumber'
require 'fileutils'
require 'vim-flavor'
class FakeUserEnvironment
include Vim::Flavor::ShellUtility
def expand(virtual_path)
virtual_path.gsub(/\$([a-z_]+)/) {
variable_table[$1]
}
end
def make_flavor_path(vimfiles_path, repo_name)
"#{vimfiles_path.to_flavors_path}/#{repo_name.zap}"
end
def make_repo_path(basename)
"#{expand("$tmp")}/repos/#{basename}"
end
def make_repo_uri(basename)
"file://#{make_repo_path(basename)}"
end
def variable_table
@variable_table ||= Hash.new
end
end
Before do
variable_table['tmp'] = File.absolute_path(current_dir)
steps %Q{
Given a directory named "home"
}
variable_table['home'] = File.absolute_path(File.join([current_dir, 'home']))
end
Aruba.configure do |config|
config.before_cmd do |cmd|
set_env 'HOME', variable_table['home']
set_env 'VIM_FLAVOR_GITHUB_URI_PREFIX', expand('file://$tmp/repos/')
set_env 'VIM_FLAVOR_GITHUB_URI_SUFFIX', ''
end
end
World do
FakeUserEnvironment.new
end
ENV['THOR_DEBUG'] = '1' # To raise an exception as is.
| require 'aruba/api'
require 'aruba/cucumber'
require 'fileutils'
require 'vim-flavor'
class FakeUserEnvironment
include Vim::Flavor::ShellUtility
def expand(virtual_path)
virtual_path.gsub(/\$([a-z_]+)/) {
variable_table[$1]
}
end
def make_flavor_path(vimfiles_path, repo_name)
"#{vimfiles_path.to_flavors_path}/#{repo_name.zap}"
end
def make_repo_path(basename)
"#{expand("$tmp")}/repos/#{basename}"
end
def make_repo_uri(basename)
"file://#{make_repo_path(basename)}"
end
def variable_table
@variable_table ||= Hash.new
end
end
Before do
variable_table['tmp'] = File.absolute_path(current_dir)
steps %Q{
Given a directory named "home"
}
variable_table['home'] = File.absolute_path(File.join([current_dir, 'home']))
end
Aruba.configure do |config|
config.before_cmd do |cmd|
set_env 'HOME', variable_table['home']
set_env 'VIM_FLAVOR_GITHUB_URI_PREFIX', expand('file://$tmp/repos/')
set_env 'VIM_FLAVOR_GITHUB_URI_SUFFIX', ''
end
end
World do
FakeUserEnvironment.new
end
| Revert THOR_DEBUG to the default for proper tests | Revert THOR_DEBUG to the default for proper tests
| Ruby | mit | kana/vim-flavor,ngtk/vim-flavor | ruby | ## Code Before:
require 'aruba/api'
require 'aruba/cucumber'
require 'fileutils'
require 'vim-flavor'
class FakeUserEnvironment
include Vim::Flavor::ShellUtility
def expand(virtual_path)
virtual_path.gsub(/\$([a-z_]+)/) {
variable_table[$1]
}
end
def make_flavor_path(vimfiles_path, repo_name)
"#{vimfiles_path.to_flavors_path}/#{repo_name.zap}"
end
def make_repo_path(basename)
"#{expand("$tmp")}/repos/#{basename}"
end
def make_repo_uri(basename)
"file://#{make_repo_path(basename)}"
end
def variable_table
@variable_table ||= Hash.new
end
end
Before do
variable_table['tmp'] = File.absolute_path(current_dir)
steps %Q{
Given a directory named "home"
}
variable_table['home'] = File.absolute_path(File.join([current_dir, 'home']))
end
Aruba.configure do |config|
config.before_cmd do |cmd|
set_env 'HOME', variable_table['home']
set_env 'VIM_FLAVOR_GITHUB_URI_PREFIX', expand('file://$tmp/repos/')
set_env 'VIM_FLAVOR_GITHUB_URI_SUFFIX', ''
end
end
World do
FakeUserEnvironment.new
end
ENV['THOR_DEBUG'] = '1' # To raise an exception as is.
## Instruction:
Revert THOR_DEBUG to the default for proper tests
## Code After:
require 'aruba/api'
require 'aruba/cucumber'
require 'fileutils'
require 'vim-flavor'
class FakeUserEnvironment
include Vim::Flavor::ShellUtility
def expand(virtual_path)
virtual_path.gsub(/\$([a-z_]+)/) {
variable_table[$1]
}
end
def make_flavor_path(vimfiles_path, repo_name)
"#{vimfiles_path.to_flavors_path}/#{repo_name.zap}"
end
def make_repo_path(basename)
"#{expand("$tmp")}/repos/#{basename}"
end
def make_repo_uri(basename)
"file://#{make_repo_path(basename)}"
end
def variable_table
@variable_table ||= Hash.new
end
end
Before do
variable_table['tmp'] = File.absolute_path(current_dir)
steps %Q{
Given a directory named "home"
}
variable_table['home'] = File.absolute_path(File.join([current_dir, 'home']))
end
Aruba.configure do |config|
config.before_cmd do |cmd|
set_env 'HOME', variable_table['home']
set_env 'VIM_FLAVOR_GITHUB_URI_PREFIX', expand('file://$tmp/repos/')
set_env 'VIM_FLAVOR_GITHUB_URI_SUFFIX', ''
end
end
World do
FakeUserEnvironment.new
end
| require 'aruba/api'
require 'aruba/cucumber'
require 'fileutils'
require 'vim-flavor'
class FakeUserEnvironment
include Vim::Flavor::ShellUtility
def expand(virtual_path)
virtual_path.gsub(/\$([a-z_]+)/) {
variable_table[$1]
}
end
def make_flavor_path(vimfiles_path, repo_name)
"#{vimfiles_path.to_flavors_path}/#{repo_name.zap}"
end
def make_repo_path(basename)
"#{expand("$tmp")}/repos/#{basename}"
end
def make_repo_uri(basename)
"file://#{make_repo_path(basename)}"
end
def variable_table
@variable_table ||= Hash.new
end
end
Before do
variable_table['tmp'] = File.absolute_path(current_dir)
steps %Q{
Given a directory named "home"
}
variable_table['home'] = File.absolute_path(File.join([current_dir, 'home']))
end
Aruba.configure do |config|
config.before_cmd do |cmd|
set_env 'HOME', variable_table['home']
set_env 'VIM_FLAVOR_GITHUB_URI_PREFIX', expand('file://$tmp/repos/')
set_env 'VIM_FLAVOR_GITHUB_URI_SUFFIX', ''
end
end
World do
FakeUserEnvironment.new
end
-
- ENV['THOR_DEBUG'] = '1' # To raise an exception as is. | 2 | 0.037736 | 0 | 2 |
d860e221a0e20cf3435f6455d6c830f6ac6b8bec | packages/haste-map-webpack-resolver-demo-webpack2/webpack.config.js | packages/haste-map-webpack-resolver-demo-webpack2/webpack.config.js | // volontary written in ES5, so that it works with Node 4.x
var path = require('path');
var webpack = require('webpack');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var buildResolver = require('haste-map-webpack-resolver');
var currentDir = path.resolve(__dirname, '.');
module.exports = {
context: currentDir,
entry: './entry-point.js',
output: {
path: './dist',
filename: 'entry-point.bundle.js',
library: 'entry-point',
libraryTarget: 'umd',
umdNamedDefine: true
},
devtool: 'sourcemap',
target: 'node',
module: {
rules: [
{
test: /\.js/,
exclude: /(node_modules)/,
use: [
{
loader: 'babel-loader',
query: {
presets: ['babel-preset-es2015']
},
}
]
}
],
},
resolve: {
plugins: [buildResolver({
rootPath: path.resolve(__dirname, '.'),
})],
},
plugins: [
new webpack.BannerPlugin(
{
banner: 'require("source-map-support").install();',
raw: true,
entryOnly: false,
}
),
new ProgressBarPlugin(),
],
};
| // volontary written in ES5, so that it works with Node 4.x
var path = require('path');
var webpack = require('webpack');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var HasteMapWebPackResolver = require('haste-map-webpack-resolver');
var currentDir = path.resolve(__dirname, '.');
module.exports = {
context: currentDir,
entry: './entry-point.js',
output: {
path: './dist',
filename: 'entry-point.bundle.js',
library: 'entry-point',
libraryTarget: 'umd',
umdNamedDefine: true
},
devtool: 'sourcemap',
target: 'node',
module: {
rules: [
{
test: /\.js/,
exclude: /(node_modules)/,
use: [
{
loader: 'babel-loader',
query: {
presets: ['babel-preset-es2015']
},
}
]
}
],
},
resolve: {
plugins: [new HasteMapWebPackResolver({
rootPath: path.resolve(__dirname, '.'),
})],
},
plugins: [
new webpack.BannerPlugin(
{
banner: 'require("source-map-support").install();',
raw: true,
entryOnly: false,
}
),
new ProgressBarPlugin(),
],
};
| Use more natural constructor call | Use more natural constructor call
| JavaScript | mit | flegall/haste-map-webpack-resolver | javascript | ## Code Before:
// volontary written in ES5, so that it works with Node 4.x
var path = require('path');
var webpack = require('webpack');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var buildResolver = require('haste-map-webpack-resolver');
var currentDir = path.resolve(__dirname, '.');
module.exports = {
context: currentDir,
entry: './entry-point.js',
output: {
path: './dist',
filename: 'entry-point.bundle.js',
library: 'entry-point',
libraryTarget: 'umd',
umdNamedDefine: true
},
devtool: 'sourcemap',
target: 'node',
module: {
rules: [
{
test: /\.js/,
exclude: /(node_modules)/,
use: [
{
loader: 'babel-loader',
query: {
presets: ['babel-preset-es2015']
},
}
]
}
],
},
resolve: {
plugins: [buildResolver({
rootPath: path.resolve(__dirname, '.'),
})],
},
plugins: [
new webpack.BannerPlugin(
{
banner: 'require("source-map-support").install();',
raw: true,
entryOnly: false,
}
),
new ProgressBarPlugin(),
],
};
## Instruction:
Use more natural constructor call
## Code After:
// volontary written in ES5, so that it works with Node 4.x
var path = require('path');
var webpack = require('webpack');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
var HasteMapWebPackResolver = require('haste-map-webpack-resolver');
var currentDir = path.resolve(__dirname, '.');
module.exports = {
context: currentDir,
entry: './entry-point.js',
output: {
path: './dist',
filename: 'entry-point.bundle.js',
library: 'entry-point',
libraryTarget: 'umd',
umdNamedDefine: true
},
devtool: 'sourcemap',
target: 'node',
module: {
rules: [
{
test: /\.js/,
exclude: /(node_modules)/,
use: [
{
loader: 'babel-loader',
query: {
presets: ['babel-preset-es2015']
},
}
]
}
],
},
resolve: {
plugins: [new HasteMapWebPackResolver({
rootPath: path.resolve(__dirname, '.'),
})],
},
plugins: [
new webpack.BannerPlugin(
{
banner: 'require("source-map-support").install();',
raw: true,
entryOnly: false,
}
),
new ProgressBarPlugin(),
],
};
| // volontary written in ES5, so that it works with Node 4.x
var path = require('path');
var webpack = require('webpack');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');
- var buildResolver = require('haste-map-webpack-resolver');
? ^^^^
+ var HasteMapWebPackResolver = require('haste-map-webpack-resolver');
? ++++++++++ ^^^^
var currentDir = path.resolve(__dirname, '.');
module.exports = {
context: currentDir,
entry: './entry-point.js',
output: {
path: './dist',
filename: 'entry-point.bundle.js',
library: 'entry-point',
libraryTarget: 'umd',
umdNamedDefine: true
},
devtool: 'sourcemap',
target: 'node',
module: {
rules: [
{
test: /\.js/,
exclude: /(node_modules)/,
use: [
{
loader: 'babel-loader',
query: {
presets: ['babel-preset-es2015']
},
}
]
}
],
},
resolve: {
- plugins: [buildResolver({
+ plugins: [new HasteMapWebPackResolver({
rootPath: path.resolve(__dirname, '.'),
})],
},
plugins: [
new webpack.BannerPlugin(
{
banner: 'require("source-map-support").install();',
raw: true,
entryOnly: false,
}
),
new ProgressBarPlugin(),
],
}; | 4 | 0.076923 | 2 | 2 |
af7086452c8850d39152f93045ab87133530f0d4 | junit5-allure/README.md | junit5-allure/README.md |
Execute the JUnit 5 tests and get the Allure report as follows. With Maven:
```
mvn test allure:serve
```
... or with Gradle:
```
gradle test allureServe
```
[Logo]: http://bonigarcia.github.io/img/mastering_junit5_logo.png
[GitHub Repository]: https://github.com/bonigarcia/mastering-junit5
|
With this example, you can execute the JUnit 5 tests defined in the project and get the Allure report in a easy way. With Maven:
```
mvn test allure:serve
```
... or with Gradle:
```
gradle test allureServe
```
| Update mini doc for junit5-allure project | Update mini doc for junit5-allure project
| Markdown | apache-2.0 | bonigarcia/mastering-junit5,bonigarcia/mastering-junit5 | markdown | ## Code Before:
Execute the JUnit 5 tests and get the Allure report as follows. With Maven:
```
mvn test allure:serve
```
... or with Gradle:
```
gradle test allureServe
```
[Logo]: http://bonigarcia.github.io/img/mastering_junit5_logo.png
[GitHub Repository]: https://github.com/bonigarcia/mastering-junit5
## Instruction:
Update mini doc for junit5-allure project
## Code After:
With this example, you can execute the JUnit 5 tests defined in the project and get the Allure report in a easy way. With Maven:
```
mvn test allure:serve
```
... or with Gradle:
```
gradle test allureServe
```
|
- Execute the JUnit 5 tests and get the Allure report as follows. With Maven:
+ With this example, you can execute the JUnit 5 tests defined in the project and get the Allure report in a easy way. With Maven:
```
mvn test allure:serve
```
... or with Gradle:
```
gradle test allureServe
```
-
- [Logo]: http://bonigarcia.github.io/img/mastering_junit5_logo.png
- [GitHub Repository]: https://github.com/bonigarcia/mastering-junit5 | 5 | 0.333333 | 1 | 4 |
25e486b479b3af5ade47fac64d4940bb2b29e9f7 | .travis.yml | .travis.yml | language: java
jdk: openjdk8
after_success:
- mvn clean cobertura:cobertura coveralls:report
deploy:
provider: script
script: "mvn deploy"
skip_cleanup: true
on:
branch: refactor | language: java
jdk: openjdk8
after_success:
- mvn coveralls:report
deploy:
provider: script
script: "mvn deploy"
skip_cleanup: true
on:
branch: refactor | Remove coverage mvn call after success. | Remove coverage mvn call after success.
| YAML | apache-2.0 | Tomschi/commons,Tomschi/commons | yaml | ## Code Before:
language: java
jdk: openjdk8
after_success:
- mvn clean cobertura:cobertura coveralls:report
deploy:
provider: script
script: "mvn deploy"
skip_cleanup: true
on:
branch: refactor
## Instruction:
Remove coverage mvn call after success.
## Code After:
language: java
jdk: openjdk8
after_success:
- mvn coveralls:report
deploy:
provider: script
script: "mvn deploy"
skip_cleanup: true
on:
branch: refactor | language: java
jdk: openjdk8
after_success:
- - mvn clean cobertura:cobertura coveralls:report
+ - mvn coveralls:report
deploy:
provider: script
script: "mvn deploy"
skip_cleanup: true
on:
branch: refactor | 2 | 0.166667 | 1 | 1 |
0b7e5c7f012f0ecee95e82a8c30de4c3cf9e02aa | Ubuntu_14_04_OCE_PythonOCC_Setup.sh | Ubuntu_14_04_OCE_PythonOCC_Setup.sh | PYTHONOCCTAG="0.16-pre-1"
POCCMAKEPATH="pythonocc-core/cmake-build"
sudo apt-get install swig
sudo add-apt-repository "deb http://ppa.launchpad.net/freecad-maintainers/oce-release/ubuntu precise main" -y
sudo apt-get update -q
sudo apt-get install liboce-ocaf-dev oce-draw
sudo apt-get install python-wxgtk2.8
sudo python -c "import wx"
sudo apt-get install python-qt4 python-qt4-gl
sudo python -c "from PyQt4 import QtGui, QtCore, QtOpenGL"
sudo apt-get install python-pyside
sudo python -c "from PySide import QtGui, QtCore, QtOpenGL"
#Install PythonOCC requirements
apt-get install swig python-sympy
#Clone PythonOCC so we can start building the components we need
git clone --branch $PYTHONOCCTAG https://github.com/tpaviot/pythonocc-core.git
mkdir $POCCMAKEPATH && cd $POCCMAKEPATH
#Guild the geom extension
cmake -DOCE_INCLUDE_PATH="/usr/local/include/oce" -DOCE_LIB_PATH="/usr/local/lib/oce-0.16/" ..
make && make install
| PYTHONOCCTAG="0.16-pre-1"
POCCMAKEPATH="pythonocc-core/cmake-build"
sudo apt-get install -y swig
sudo add-apt-repository "deb http://ppa.launchpad.net/freecad-maintainers/oce-release/ubuntu precise main" -y
sudo apt-get update -q
sudo apt-get install -y liboce-ocaf-dev oce-draw
sudo apt-get install -y python-wxgtk2.8
sudo python -c "import wx"
sudo apt-get install -y python-qt4 python-qt4-gl
sudo python -c "from PyQt4 import QtGui, QtCore, QtOpenGL"
sudo apt-get install -y python-pyside
sudo python -c "from PySide import QtGui, QtCore, QtOpenGL"
#Install PythonOCC requirements
apt-get install -y swig python-sympy
#Clone PythonOCC so we can start building the components we need
git clone --branch $PYTHONOCCTAG https://github.com/tpaviot/pythonocc-core.git
mkdir $POCCMAKEPATH && cd $POCCMAKEPATH
#Guild the geom extension
cmake -DOCE_INCLUDE_PATH="/usr/local/include/oce" -DOCE_LIB_PATH="/usr/local/lib/oce-0.16/" ..
make && make install
| Set apt-get installs up to answer yes automatically. | Set apt-get installs up to answer yes automatically.
| Shell | lgpl-2.1 | jmwright/pythonocc_oce_setup | shell | ## Code Before:
PYTHONOCCTAG="0.16-pre-1"
POCCMAKEPATH="pythonocc-core/cmake-build"
sudo apt-get install swig
sudo add-apt-repository "deb http://ppa.launchpad.net/freecad-maintainers/oce-release/ubuntu precise main" -y
sudo apt-get update -q
sudo apt-get install liboce-ocaf-dev oce-draw
sudo apt-get install python-wxgtk2.8
sudo python -c "import wx"
sudo apt-get install python-qt4 python-qt4-gl
sudo python -c "from PyQt4 import QtGui, QtCore, QtOpenGL"
sudo apt-get install python-pyside
sudo python -c "from PySide import QtGui, QtCore, QtOpenGL"
#Install PythonOCC requirements
apt-get install swig python-sympy
#Clone PythonOCC so we can start building the components we need
git clone --branch $PYTHONOCCTAG https://github.com/tpaviot/pythonocc-core.git
mkdir $POCCMAKEPATH && cd $POCCMAKEPATH
#Guild the geom extension
cmake -DOCE_INCLUDE_PATH="/usr/local/include/oce" -DOCE_LIB_PATH="/usr/local/lib/oce-0.16/" ..
make && make install
## Instruction:
Set apt-get installs up to answer yes automatically.
## Code After:
PYTHONOCCTAG="0.16-pre-1"
POCCMAKEPATH="pythonocc-core/cmake-build"
sudo apt-get install -y swig
sudo add-apt-repository "deb http://ppa.launchpad.net/freecad-maintainers/oce-release/ubuntu precise main" -y
sudo apt-get update -q
sudo apt-get install -y liboce-ocaf-dev oce-draw
sudo apt-get install -y python-wxgtk2.8
sudo python -c "import wx"
sudo apt-get install -y python-qt4 python-qt4-gl
sudo python -c "from PyQt4 import QtGui, QtCore, QtOpenGL"
sudo apt-get install -y python-pyside
sudo python -c "from PySide import QtGui, QtCore, QtOpenGL"
#Install PythonOCC requirements
apt-get install -y swig python-sympy
#Clone PythonOCC so we can start building the components we need
git clone --branch $PYTHONOCCTAG https://github.com/tpaviot/pythonocc-core.git
mkdir $POCCMAKEPATH && cd $POCCMAKEPATH
#Guild the geom extension
cmake -DOCE_INCLUDE_PATH="/usr/local/include/oce" -DOCE_LIB_PATH="/usr/local/lib/oce-0.16/" ..
make && make install
| PYTHONOCCTAG="0.16-pre-1"
POCCMAKEPATH="pythonocc-core/cmake-build"
- sudo apt-get install swig
+ sudo apt-get install -y swig
? +++
sudo add-apt-repository "deb http://ppa.launchpad.net/freecad-maintainers/oce-release/ubuntu precise main" -y
sudo apt-get update -q
- sudo apt-get install liboce-ocaf-dev oce-draw
+ sudo apt-get install -y liboce-ocaf-dev oce-draw
? +++
- sudo apt-get install python-wxgtk2.8
+ sudo apt-get install -y python-wxgtk2.8
? +++
sudo python -c "import wx"
- sudo apt-get install python-qt4 python-qt4-gl
+ sudo apt-get install -y python-qt4 python-qt4-gl
? +++
sudo python -c "from PyQt4 import QtGui, QtCore, QtOpenGL"
- sudo apt-get install python-pyside
+ sudo apt-get install -y python-pyside
? +++
sudo python -c "from PySide import QtGui, QtCore, QtOpenGL"
#Install PythonOCC requirements
- apt-get install swig python-sympy
+ apt-get install -y swig python-sympy
? +++
#Clone PythonOCC so we can start building the components we need
git clone --branch $PYTHONOCCTAG https://github.com/tpaviot/pythonocc-core.git
mkdir $POCCMAKEPATH && cd $POCCMAKEPATH
#Guild the geom extension
cmake -DOCE_INCLUDE_PATH="/usr/local/include/oce" -DOCE_LIB_PATH="/usr/local/lib/oce-0.16/" ..
make && make install | 12 | 0.48 | 6 | 6 |
ffe139b8d4d6bb335a94b6fde60f012172f7f2c4 | test/index.js | test/index.js | var expect = require('chai').expect;
var thirteen = require('../index.js');
describe('thirteen', function () {
it('should be a function', function () {
expect(thirteen).to.be.a("function");
});
it('should return its argument multiplied by thirteen', function () {
expect(thirteen(10)).to.eql(130);
});
it('should NOT return its argument multiplied by twelve', function () {
expect(thirteen(10)).to.not.eql(120);
});
it('should return its arguments number-like value multiplied by thirteen', function () {
var wannabeString = {};
var wannabeValue = {};
wannabeString.toString = function () { return '13'; };
wannabeValue.valueOf = function () { return '13'; };
expect(thirteen(wannabeString)).to.eql(169);
expect(thirteen(wannabeValue)).to.eql(169);
});
});
| var expect = require('chai').expect;
var thirteen = require('../index.js');
describe('thirteen', function () {
it('should be a function', function () {
expect(thirteen).to.be.a("function");
});
it('should return its argument multiplied by thirteen', function () {
// Cast to number from string for test comparison. Test will pass even if value is returned with more force (i.e. "130!!!!!!!!").
var returnedAsNumber = parseFloat(thirteen(10).replace(/\!/g, ""));
expect(returnedAsNumber).to.eql(130);
});
it('should NOT return its argument multiplied by twelve', function () {
var returnedAsNumber = parseFloat(thirteen(10).replace(/\!/g, ""));
expect(returnedAsNumber).to.not.eql(120);
});
it('should return its arguments number-like value multiplied by thirteen', function () {
var wannabeString = {};
var wannabeValue = {};
wannabeString.toString = function () { return '13'; };
wannabeValue.valueOf = function () { return '13'; };
expect(thirteen(wannabeString)).to.eql(169);
expect(thirteen(wannabeValue)).to.eql(169);
});
});
| Fix test for returning correct value. String trimmed and parsed. | Fix test for returning correct value. String trimmed and parsed.
| JavaScript | bsd-3-clause | phillipalexander/thirteen | javascript | ## Code Before:
var expect = require('chai').expect;
var thirteen = require('../index.js');
describe('thirteen', function () {
it('should be a function', function () {
expect(thirteen).to.be.a("function");
});
it('should return its argument multiplied by thirteen', function () {
expect(thirteen(10)).to.eql(130);
});
it('should NOT return its argument multiplied by twelve', function () {
expect(thirteen(10)).to.not.eql(120);
});
it('should return its arguments number-like value multiplied by thirteen', function () {
var wannabeString = {};
var wannabeValue = {};
wannabeString.toString = function () { return '13'; };
wannabeValue.valueOf = function () { return '13'; };
expect(thirteen(wannabeString)).to.eql(169);
expect(thirteen(wannabeValue)).to.eql(169);
});
});
## Instruction:
Fix test for returning correct value. String trimmed and parsed.
## Code After:
var expect = require('chai').expect;
var thirteen = require('../index.js');
describe('thirteen', function () {
it('should be a function', function () {
expect(thirteen).to.be.a("function");
});
it('should return its argument multiplied by thirteen', function () {
// Cast to number from string for test comparison. Test will pass even if value is returned with more force (i.e. "130!!!!!!!!").
var returnedAsNumber = parseFloat(thirteen(10).replace(/\!/g, ""));
expect(returnedAsNumber).to.eql(130);
});
it('should NOT return its argument multiplied by twelve', function () {
var returnedAsNumber = parseFloat(thirteen(10).replace(/\!/g, ""));
expect(returnedAsNumber).to.not.eql(120);
});
it('should return its arguments number-like value multiplied by thirteen', function () {
var wannabeString = {};
var wannabeValue = {};
wannabeString.toString = function () { return '13'; };
wannabeValue.valueOf = function () { return '13'; };
expect(thirteen(wannabeString)).to.eql(169);
expect(thirteen(wannabeValue)).to.eql(169);
});
});
| var expect = require('chai').expect;
var thirteen = require('../index.js');
describe('thirteen', function () {
it('should be a function', function () {
expect(thirteen).to.be.a("function");
});
it('should return its argument multiplied by thirteen', function () {
- expect(thirteen(10)).to.eql(130);
+ // Cast to number from string for test comparison. Test will pass even if value is returned with more force (i.e. "130!!!!!!!!").
+ var returnedAsNumber = parseFloat(thirteen(10).replace(/\!/g, ""));
+ expect(returnedAsNumber).to.eql(130);
});
it('should NOT return its argument multiplied by twelve', function () {
+ var returnedAsNumber = parseFloat(thirteen(10).replace(/\!/g, ""));
- expect(thirteen(10)).to.not.eql(120);
? ^^ ^ ^^^^^
+ expect(returnedAsNumber).to.not.eql(120);
? ++ ^ ^ +++++++ ^
});
it('should return its arguments number-like value multiplied by thirteen', function () {
var wannabeString = {};
var wannabeValue = {};
wannabeString.toString = function () { return '13'; };
wannabeValue.valueOf = function () { return '13'; };
expect(thirteen(wannabeString)).to.eql(169);
expect(thirteen(wannabeValue)).to.eql(169);
});
});
- | 8 | 0.285714 | 5 | 3 |
cf1da65820085a84eee51884431b0020d3018f23 | bot/project_info.py | bot/project_info.py |
name = 'telegram-bot-framework'
description = 'Python Telegram bot API framework'
url = 'https://github.com/alvarogzp/telegram-bot-framework'
author_name = 'Alvaro Gutierrez Perez'
author_email = 'alvarogzp@gmail.com'
authors_credits = (
("@AlvaroGP", "main developer"),
("@KouteiCheke", "i18n & UI/UX support")
)
is_open_source = True
license_name = 'GNU AGPL 3.0+'
license_url = 'https://www.gnu.org/licenses/agpl-3.0.en.html'
donation_addresses = ()
|
name = 'telegram-bot-framework'
description = 'Python Telegram bot API framework'
url = 'https://github.com/alvarogzp/telegram-bot-framework'
author_name = 'Alvaro Gutierrez Perez'
author_email = 'alvarogzp@gmail.com'
authors_credits = (
("@AlvaroGP", "main developer"),
("@KouteiCheke", "i18n & UI/UX support")
)
is_open_source = True
license_name = 'GNU AGPL 3.0+'
license_url = 'https://www.gnu.org/licenses/agpl-3.0.en.html'
donation_addresses = (
("Bitcoin", "36rwcSgcU1H9fuMvZoebZD3auus6h9wVXk"),
("Bitcoin (bech32 format)", "bc1q4943c5p5dl0hujmmcg2g0568hetynajd3qqtv0")
)
| Add bitcoin address to donation addresses | Add bitcoin address to donation addresses
| Python | agpl-3.0 | alvarogzp/telegram-bot,alvarogzp/telegram-bot | python | ## Code Before:
name = 'telegram-bot-framework'
description = 'Python Telegram bot API framework'
url = 'https://github.com/alvarogzp/telegram-bot-framework'
author_name = 'Alvaro Gutierrez Perez'
author_email = 'alvarogzp@gmail.com'
authors_credits = (
("@AlvaroGP", "main developer"),
("@KouteiCheke", "i18n & UI/UX support")
)
is_open_source = True
license_name = 'GNU AGPL 3.0+'
license_url = 'https://www.gnu.org/licenses/agpl-3.0.en.html'
donation_addresses = ()
## Instruction:
Add bitcoin address to donation addresses
## Code After:
name = 'telegram-bot-framework'
description = 'Python Telegram bot API framework'
url = 'https://github.com/alvarogzp/telegram-bot-framework'
author_name = 'Alvaro Gutierrez Perez'
author_email = 'alvarogzp@gmail.com'
authors_credits = (
("@AlvaroGP", "main developer"),
("@KouteiCheke", "i18n & UI/UX support")
)
is_open_source = True
license_name = 'GNU AGPL 3.0+'
license_url = 'https://www.gnu.org/licenses/agpl-3.0.en.html'
donation_addresses = (
("Bitcoin", "36rwcSgcU1H9fuMvZoebZD3auus6h9wVXk"),
("Bitcoin (bech32 format)", "bc1q4943c5p5dl0hujmmcg2g0568hetynajd3qqtv0")
)
|
name = 'telegram-bot-framework'
description = 'Python Telegram bot API framework'
url = 'https://github.com/alvarogzp/telegram-bot-framework'
author_name = 'Alvaro Gutierrez Perez'
author_email = 'alvarogzp@gmail.com'
authors_credits = (
("@AlvaroGP", "main developer"),
("@KouteiCheke", "i18n & UI/UX support")
)
is_open_source = True
license_name = 'GNU AGPL 3.0+'
license_url = 'https://www.gnu.org/licenses/agpl-3.0.en.html'
- donation_addresses = ()
? -
+ donation_addresses = (
+ ("Bitcoin", "36rwcSgcU1H9fuMvZoebZD3auus6h9wVXk"),
+ ("Bitcoin (bech32 format)", "bc1q4943c5p5dl0hujmmcg2g0568hetynajd3qqtv0")
+ ) | 5 | 0.238095 | 4 | 1 |
87ba36e1854866e9496c66d6105b2e8cff4b63fd | src/components/atoms/ReloadButton/ReloadButton.jsx | src/components/atoms/ReloadButton/ReloadButton.jsx | /*
Copyright (C) 2017 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from 'react'
import styled from 'styled-components'
import reloadImage from './images/reload.svg'
const Wrapper = styled.div`
width: 16px;
height: 16px;
background: url('${reloadImage}') no-repeat center;
cursor: pointer;
`
class ReloadButton extends React.Component {
render() {
return (
<Wrapper {...this.props} />
)
}
}
export default ReloadButton
| /*
Copyright (C) 2017 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from 'react'
import styled, { injectGlobal } from 'styled-components'
import PropTypes from 'prop-types'
import reloadImage from './images/reload.svg'
const Wrapper = styled.div`
width: 16px;
height: 16px;
background: url('${reloadImage}') no-repeat center;
cursor: pointer;
`
injectGlobal`
.reload-animation {
transform: rotate(360deg);
transition: transform 1s cubic-bezier(0, 1.4, 1, 1);
}
`
class ReloadButton extends React.Component {
static propTypes = {
onClick: PropTypes.func,
}
onClick() {
if (this.timeout) {
return
}
if (this.props.onClick) {
this.props.onClick()
}
this.wrapper.className += ' reload-animation'
this.timeout = setTimeout(() => {
this.wrapper.className = this.wrapper.className.substr(0, this.wrapper.className.indexOf(' reload-animation'))
this.timeout = null
}, 1000)
}
render() {
return (
<Wrapper innerRef={div => { this.wrapper = div }} {...this.props} onClick={() => { this.onClick() }} />
)
}
}
export default ReloadButton
| Add `Reload` button animation to lists | Add `Reload` button animation to lists
| JSX | agpl-3.0 | aznashwan/coriolis-web,aznashwan/coriolis-web | jsx | ## Code Before:
/*
Copyright (C) 2017 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from 'react'
import styled from 'styled-components'
import reloadImage from './images/reload.svg'
const Wrapper = styled.div`
width: 16px;
height: 16px;
background: url('${reloadImage}') no-repeat center;
cursor: pointer;
`
class ReloadButton extends React.Component {
render() {
return (
<Wrapper {...this.props} />
)
}
}
export default ReloadButton
## Instruction:
Add `Reload` button animation to lists
## Code After:
/*
Copyright (C) 2017 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from 'react'
import styled, { injectGlobal } from 'styled-components'
import PropTypes from 'prop-types'
import reloadImage from './images/reload.svg'
const Wrapper = styled.div`
width: 16px;
height: 16px;
background: url('${reloadImage}') no-repeat center;
cursor: pointer;
`
injectGlobal`
.reload-animation {
transform: rotate(360deg);
transition: transform 1s cubic-bezier(0, 1.4, 1, 1);
}
`
class ReloadButton extends React.Component {
static propTypes = {
onClick: PropTypes.func,
}
onClick() {
if (this.timeout) {
return
}
if (this.props.onClick) {
this.props.onClick()
}
this.wrapper.className += ' reload-animation'
this.timeout = setTimeout(() => {
this.wrapper.className = this.wrapper.className.substr(0, this.wrapper.className.indexOf(' reload-animation'))
this.timeout = null
}, 1000)
}
render() {
return (
<Wrapper innerRef={div => { this.wrapper = div }} {...this.props} onClick={() => { this.onClick() }} />
)
}
}
export default ReloadButton
| /*
Copyright (C) 2017 Cloudbase Solutions SRL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import React from 'react'
- import styled from 'styled-components'
+ import styled, { injectGlobal } from 'styled-components'
? ++++++++++++++++++
+ import PropTypes from 'prop-types'
import reloadImage from './images/reload.svg'
const Wrapper = styled.div`
width: 16px;
height: 16px;
background: url('${reloadImage}') no-repeat center;
cursor: pointer;
`
+ injectGlobal`
+ .reload-animation {
+ transform: rotate(360deg);
+ transition: transform 1s cubic-bezier(0, 1.4, 1, 1);
+ }
+ `
+
class ReloadButton extends React.Component {
+ static propTypes = {
+ onClick: PropTypes.func,
+ }
+
+ onClick() {
+ if (this.timeout) {
+ return
+ }
+
+ if (this.props.onClick) {
+ this.props.onClick()
+ }
+
+ this.wrapper.className += ' reload-animation'
+ this.timeout = setTimeout(() => {
+ this.wrapper.className = this.wrapper.className.substr(0, this.wrapper.className.indexOf(' reload-animation'))
+ this.timeout = null
+ }, 1000)
+ }
+
render() {
return (
- <Wrapper {...this.props} />
+ <Wrapper innerRef={div => { this.wrapper = div }} {...this.props} onClick={() => { this.onClick() }} />
)
}
}
export default ReloadButton | 32 | 0.914286 | 30 | 2 |
101aeeea00eede121a9cf07081648f5c99f3bdc5 | src/View/HelperTrait.php | src/View/HelperTrait.php | <?php
namespace Zend\I18n\View;
use IntlDateFormatter;
// @codingStandardsIgnoreStart
/**
* Trait HelperTrait
*
* The trait provides convenience methods for view helpers,
* defined by the zend-i18n component. It is designed to be used
* for type-hinting $this variable inside zend-view templates via doc blocks.
*
* The base class is PhpRenderer, followed by the helper trait from
* the zend-i18n component. However, multiple helper traits from different
* Zend components can be chained afterwards.
*
* @example @var \Zend\View\Renderer\PhpRenderer|\Zend\I18n\View\HelperTrait $this
*
* @method string currencyFormat($number, $currencyCode = null, $showDecimals = null, $locale = null, $pattern = null)
* @method string dateFormat($date, $dateType = IntlDateFormatter::NONE, $timeType = IntlDateFormatter::NONE, $locale = null, $pattern = null)
* @method string numberFormat($number, $formatStyle = null, $formatType = null, $locale = null, $decimals = null, array $textAttributes = null)
* @method string plural($strings, $number)
* @method string translate($message, $textDomain = null, $locale = null)
* @method string translatePlural($singular, $plural, $number, $textDomain = null, $locale = null)
*/
trait HelperTrait
{
}
| <?php
namespace Zend\I18n\View;
use IntlDateFormatter;
// @codingStandardsIgnoreStart
/**
* Trait HelperTrait
*
* The trait provides convenience methods for view helpers,
* defined by the zend-i18n component. It is designed to be used
* for type-hinting $this variable inside zend-view templates via doc blocks.
*
* The base class is PhpRenderer, followed by the helper trait from
* the zend-i18n component. However, multiple helper traits from different
* Zend components can be chained afterwards.
*
* @example @var \Zend\View\Renderer\PhpRenderer|\Zend\I18n\View\HelperTrait $this
*
* @method string currencyFormat($number, $currencyCode = null, $showDecimals = null, $locale = null, $pattern = null)
* @method string dateFormat($date, $dateType = IntlDateFormatter::NONE, $timeType = IntlDateFormatter::NONE, $locale = null, $pattern = null)
* @method string numberFormat($number, $formatStyle = null, $formatType = null, $locale = null, $decimals = null, array $textAttributes = null)
* @method string plural($strings, $number)
* @method string translate($message, $textDomain = null, $locale = null)
* @method string translatePlural($singular, $plural, $number, $textDomain = null, $locale = null)
*/
trait HelperTrait
{
}
// @codingStandardsIgnoreEnd
| Add ending doc block annotation for ignoring coding standards | Add ending doc block annotation for ignoring coding standards
| PHP | bsd-3-clause | zendframework/zend-i18n | php | ## Code Before:
<?php
namespace Zend\I18n\View;
use IntlDateFormatter;
// @codingStandardsIgnoreStart
/**
* Trait HelperTrait
*
* The trait provides convenience methods for view helpers,
* defined by the zend-i18n component. It is designed to be used
* for type-hinting $this variable inside zend-view templates via doc blocks.
*
* The base class is PhpRenderer, followed by the helper trait from
* the zend-i18n component. However, multiple helper traits from different
* Zend components can be chained afterwards.
*
* @example @var \Zend\View\Renderer\PhpRenderer|\Zend\I18n\View\HelperTrait $this
*
* @method string currencyFormat($number, $currencyCode = null, $showDecimals = null, $locale = null, $pattern = null)
* @method string dateFormat($date, $dateType = IntlDateFormatter::NONE, $timeType = IntlDateFormatter::NONE, $locale = null, $pattern = null)
* @method string numberFormat($number, $formatStyle = null, $formatType = null, $locale = null, $decimals = null, array $textAttributes = null)
* @method string plural($strings, $number)
* @method string translate($message, $textDomain = null, $locale = null)
* @method string translatePlural($singular, $plural, $number, $textDomain = null, $locale = null)
*/
trait HelperTrait
{
}
## Instruction:
Add ending doc block annotation for ignoring coding standards
## Code After:
<?php
namespace Zend\I18n\View;
use IntlDateFormatter;
// @codingStandardsIgnoreStart
/**
* Trait HelperTrait
*
* The trait provides convenience methods for view helpers,
* defined by the zend-i18n component. It is designed to be used
* for type-hinting $this variable inside zend-view templates via doc blocks.
*
* The base class is PhpRenderer, followed by the helper trait from
* the zend-i18n component. However, multiple helper traits from different
* Zend components can be chained afterwards.
*
* @example @var \Zend\View\Renderer\PhpRenderer|\Zend\I18n\View\HelperTrait $this
*
* @method string currencyFormat($number, $currencyCode = null, $showDecimals = null, $locale = null, $pattern = null)
* @method string dateFormat($date, $dateType = IntlDateFormatter::NONE, $timeType = IntlDateFormatter::NONE, $locale = null, $pattern = null)
* @method string numberFormat($number, $formatStyle = null, $formatType = null, $locale = null, $decimals = null, array $textAttributes = null)
* @method string plural($strings, $number)
* @method string translate($message, $textDomain = null, $locale = null)
* @method string translatePlural($singular, $plural, $number, $textDomain = null, $locale = null)
*/
trait HelperTrait
{
}
// @codingStandardsIgnoreEnd
| <?php
namespace Zend\I18n\View;
use IntlDateFormatter;
// @codingStandardsIgnoreStart
+
/**
* Trait HelperTrait
*
* The trait provides convenience methods for view helpers,
* defined by the zend-i18n component. It is designed to be used
* for type-hinting $this variable inside zend-view templates via doc blocks.
*
* The base class is PhpRenderer, followed by the helper trait from
* the zend-i18n component. However, multiple helper traits from different
* Zend components can be chained afterwards.
*
* @example @var \Zend\View\Renderer\PhpRenderer|\Zend\I18n\View\HelperTrait $this
*
* @method string currencyFormat($number, $currencyCode = null, $showDecimals = null, $locale = null, $pattern = null)
* @method string dateFormat($date, $dateType = IntlDateFormatter::NONE, $timeType = IntlDateFormatter::NONE, $locale = null, $pattern = null)
* @method string numberFormat($number, $formatStyle = null, $formatType = null, $locale = null, $decimals = null, array $textAttributes = null)
* @method string plural($strings, $number)
* @method string translate($message, $textDomain = null, $locale = null)
* @method string translatePlural($singular, $plural, $number, $textDomain = null, $locale = null)
*/
trait HelperTrait
{
}
+ // @codingStandardsIgnoreEnd | 2 | 0.066667 | 2 | 0 |
a45d392ac468411cdd8d8e79558482d33edb12be | test/features/importere_laaner.feature | test/features/importere_laaner.feature |
@wip
Egenskap: Import av låner
Som låner, registrert i gammelt system
For å kunne låne bøker fra Hjørnebiblioteket
Ønsker jeg å bli låner hos Hjørnebiblioteket
@wip
Scenario:
Gitt at det finnes data som beskriver en låner "Kari"
Og at "Kari" ikke finnes som låner
Når dataene importeres til systemet
Så registrerer systemet at "Kari" er låner |
@wip
Egenskap: Import av låner
Som adminbruker
For å slippe å registrere eksisterende lånere på nytt
Ønsker jeg å importere lånerdata fra eksisterende system
@wip
Scenario:
Gitt at det finnes data som beskriver en låner "Kari"
Og at "Kari" ikke finnes som låner
Når dataene importeres til systemet
Så registrerer systemet at "Kari" er låner | Change property to use administrator as subject | Change property to use administrator as subject
| Cucumber | mit | digibib/ls.ext,digibib/ls.ext,digibib/ls.ext,digibib/ls.ext | cucumber | ## Code Before:
@wip
Egenskap: Import av låner
Som låner, registrert i gammelt system
For å kunne låne bøker fra Hjørnebiblioteket
Ønsker jeg å bli låner hos Hjørnebiblioteket
@wip
Scenario:
Gitt at det finnes data som beskriver en låner "Kari"
Og at "Kari" ikke finnes som låner
Når dataene importeres til systemet
Så registrerer systemet at "Kari" er låner
## Instruction:
Change property to use administrator as subject
## Code After:
@wip
Egenskap: Import av låner
Som adminbruker
For å slippe å registrere eksisterende lånere på nytt
Ønsker jeg å importere lånerdata fra eksisterende system
@wip
Scenario:
Gitt at det finnes data som beskriver en låner "Kari"
Og at "Kari" ikke finnes som låner
Når dataene importeres til systemet
Så registrerer systemet at "Kari" er låner |
@wip
Egenskap: Import av låner
- Som låner, registrert i gammelt system
- For å kunne låne bøker fra Hjørnebiblioteket
- Ønsker jeg å bli låner hos Hjørnebiblioteket
+ Som adminbruker
+ For å slippe å registrere eksisterende lånere på nytt
+ Ønsker jeg å importere lånerdata fra eksisterende system
@wip
Scenario:
Gitt at det finnes data som beskriver en låner "Kari"
Og at "Kari" ikke finnes som låner
Når dataene importeres til systemet
Så registrerer systemet at "Kari" er låner | 6 | 0.461538 | 3 | 3 |
6e47e89cf8fb0389428c2d38ba1f1bf424eaabc9 | .github/workflows/main.yml | .github/workflows/main.yml | name: Build and push to docker
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the dev branch
push:
branches: [ dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Check Out Repo
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: cofacts/rumors-line-bot:test
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
| name: Build and push to docker
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the dev branch
push:
branches: [ dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Generate .env file
run: 'echo "$ENV_FILE" > .env'
shell: bash
env:
ENV_FILE: ${{secrets.ENV_FILE}}
- name: Checkout repo
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: cofacts/rumors-line-bot:test
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
| Write secret ENV_FILE to .env | [workflow] Write secret ENV_FILE to .env
| YAML | mit | cofacts/rumors-line-bot,cofacts/rumors-line-bot,cofacts/rumors-line-bot | yaml | ## Code Before:
name: Build and push to docker
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the dev branch
push:
branches: [ dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Check Out Repo
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: cofacts/rumors-line-bot:test
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
## Instruction:
[workflow] Write secret ENV_FILE to .env
## Code After:
name: Build and push to docker
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the dev branch
push:
branches: [ dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Generate .env file
run: 'echo "$ENV_FILE" > .env'
shell: bash
env:
ENV_FILE: ${{secrets.ENV_FILE}}
- name: Checkout repo
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: cofacts/rumors-line-bot:test
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
| name: Build and push to docker
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the dev branch
push:
branches: [ dev ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
+ - name: Generate .env file
+ run: 'echo "$ENV_FILE" > .env'
+ shell: bash
+ env:
+ ENV_FILE: ${{secrets.ENV_FILE}}
+
- - name: Check Out Repo
? ^^ ^
+ - name: Checkout repo
? ^ ^
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: cofacts/rumors-line-bot:test
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }} | 8 | 0.181818 | 7 | 1 |
6cd28e734c926178868dd572a79524d174daa070 | autoprofile/internal/timer_test.go | autoprofile/internal/timer_test.go | package internal_test
import (
"testing"
"time"
"github.com/instana/go-sensor/autoprofile/internal"
"github.com/stretchr/testify/assert"
)
func TestTimer_Restart(t *testing.T) {
var fired int
timer := internal.NewTimer(0, 20*time.Millisecond, func() {
fired++
})
time.Sleep(30 * time.Millisecond)
timer.Stop()
assert.Equal(t, 1, fired)
time.Sleep(50 * time.Millisecond)
assert.Equal(t, 1, fired)
}
func TestTimer_Sleep(t *testing.T) {
var fired int
timer := internal.NewTimer(20*time.Millisecond, 0, func() {
fired++
})
time.Sleep(30 * time.Millisecond)
timer.Stop()
assert.Equal(t, 1, fired)
}
func TestTimer_Sleep_Stopped(t *testing.T) {
var fired int
timer := internal.NewTimer(20*time.Millisecond, 0, func() {
fired++
})
timer.Stop()
time.Sleep(30 * time.Millisecond)
assert.Equal(t, 0, fired)
}
| package internal_test
import (
"sync/atomic"
"testing"
"time"
"github.com/instana/go-sensor/autoprofile/internal"
"github.com/stretchr/testify/assert"
)
func TestTimer_Restart(t *testing.T) {
var fired int64
timer := internal.NewTimer(0, 20*time.Millisecond, func() {
atomic.AddInt64(&fired, 1)
})
time.Sleep(30 * time.Millisecond)
timer.Stop()
assert.EqualValues(t, 1, atomic.LoadInt64(&fired))
time.Sleep(50 * time.Millisecond)
assert.EqualValues(t, 1, atomic.LoadInt64(&fired))
}
func TestTimer_Sleep(t *testing.T) {
var fired int64
timer := internal.NewTimer(0, 20*time.Millisecond, func() {
atomic.AddInt64(&fired, 1)
})
time.Sleep(30 * time.Millisecond)
timer.Stop()
assert.EqualValues(t, 1, atomic.LoadInt64(&fired))
}
func TestTimer_Sleep_Stopped(t *testing.T) {
timer := internal.NewTimer(20*time.Millisecond, 0, func() {
t.Error("stopped timer has fired")
})
timer.Stop()
time.Sleep(30 * time.Millisecond)
}
| Fix data races in internal.Timer tests | Fix data races in internal.Timer tests
| Go | mit | instana/golang-sensor,instana/golang-sensor | go | ## Code Before:
package internal_test
import (
"testing"
"time"
"github.com/instana/go-sensor/autoprofile/internal"
"github.com/stretchr/testify/assert"
)
func TestTimer_Restart(t *testing.T) {
var fired int
timer := internal.NewTimer(0, 20*time.Millisecond, func() {
fired++
})
time.Sleep(30 * time.Millisecond)
timer.Stop()
assert.Equal(t, 1, fired)
time.Sleep(50 * time.Millisecond)
assert.Equal(t, 1, fired)
}
func TestTimer_Sleep(t *testing.T) {
var fired int
timer := internal.NewTimer(20*time.Millisecond, 0, func() {
fired++
})
time.Sleep(30 * time.Millisecond)
timer.Stop()
assert.Equal(t, 1, fired)
}
func TestTimer_Sleep_Stopped(t *testing.T) {
var fired int
timer := internal.NewTimer(20*time.Millisecond, 0, func() {
fired++
})
timer.Stop()
time.Sleep(30 * time.Millisecond)
assert.Equal(t, 0, fired)
}
## Instruction:
Fix data races in internal.Timer tests
## Code After:
package internal_test
import (
"sync/atomic"
"testing"
"time"
"github.com/instana/go-sensor/autoprofile/internal"
"github.com/stretchr/testify/assert"
)
func TestTimer_Restart(t *testing.T) {
var fired int64
timer := internal.NewTimer(0, 20*time.Millisecond, func() {
atomic.AddInt64(&fired, 1)
})
time.Sleep(30 * time.Millisecond)
timer.Stop()
assert.EqualValues(t, 1, atomic.LoadInt64(&fired))
time.Sleep(50 * time.Millisecond)
assert.EqualValues(t, 1, atomic.LoadInt64(&fired))
}
func TestTimer_Sleep(t *testing.T) {
var fired int64
timer := internal.NewTimer(0, 20*time.Millisecond, func() {
atomic.AddInt64(&fired, 1)
})
time.Sleep(30 * time.Millisecond)
timer.Stop()
assert.EqualValues(t, 1, atomic.LoadInt64(&fired))
}
func TestTimer_Sleep_Stopped(t *testing.T) {
timer := internal.NewTimer(20*time.Millisecond, 0, func() {
t.Error("stopped timer has fired")
})
timer.Stop()
time.Sleep(30 * time.Millisecond)
}
| package internal_test
import (
+ "sync/atomic"
"testing"
"time"
"github.com/instana/go-sensor/autoprofile/internal"
"github.com/stretchr/testify/assert"
)
func TestTimer_Restart(t *testing.T) {
- var fired int
+ var fired int64
? ++
timer := internal.NewTimer(0, 20*time.Millisecond, func() {
- fired++
+ atomic.AddInt64(&fired, 1)
})
time.Sleep(30 * time.Millisecond)
timer.Stop()
- assert.Equal(t, 1, fired)
+ assert.EqualValues(t, 1, atomic.LoadInt64(&fired))
time.Sleep(50 * time.Millisecond)
- assert.Equal(t, 1, fired)
+ assert.EqualValues(t, 1, atomic.LoadInt64(&fired))
}
func TestTimer_Sleep(t *testing.T) {
- var fired int
+ var fired int64
? ++
- timer := internal.NewTimer(20*time.Millisecond, 0, func() {
? ---
+ timer := internal.NewTimer(0, 20*time.Millisecond, func() {
? +++
- fired++
+ atomic.AddInt64(&fired, 1)
})
time.Sleep(30 * time.Millisecond)
timer.Stop()
- assert.Equal(t, 1, fired)
+ assert.EqualValues(t, 1, atomic.LoadInt64(&fired))
}
func TestTimer_Sleep_Stopped(t *testing.T) {
- var fired int
timer := internal.NewTimer(20*time.Millisecond, 0, func() {
- fired++
+ t.Error("stopped timer has fired")
})
timer.Stop()
time.Sleep(30 * time.Millisecond)
-
- assert.Equal(t, 0, fired)
} | 22 | 0.458333 | 10 | 12 |
e90b994d9cd7d831b94ff4dd59753845dcd6b39d | tuskar_ui/infrastructure/nodes/templates/nodes/index.html | tuskar_ui/infrastructure/nodes/templates/nodes/index.html | {% extends 'infrastructure/base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans 'Nodes' %}{% endblock %}
{% block page_header %}
{% include 'horizon/common/_items_count_domain_page_header.html' with title=_('Nodes') items_count=nodes_count %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-xs-12">
<div class="actions pull-right">
<a href="{% url 'horizon:infrastructure:nodes:register' %}" class="btn ajax-modal">
{% trans 'Register Nodes' %}
</a>
</div>
{{ tab_group.render }}
</div>
</div>
{% endblock %}
| {% extends 'infrastructure/base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans 'Nodes' %}{% endblock %}
{% block page_header %}
{% include 'horizon/common/_items_count_domain_page_header.html' with title=_('Nodes') items_count=nodes_count %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-xs-12">
<div class="actions pull-right">
<a href="{% url 'horizon:infrastructure:nodes:register' %}" class="btn btn-primary ajax-modal">
<span class="glyphicon glyphicon-plus"></span>
{% trans 'Register Nodes' %}
</a>
</div>
{{ tab_group.render }}
</div>
</div>
{% endblock %}
| Fix Register Nodes button styling and add icon to it | Fix Register Nodes button styling and add icon to it
Change-Id: I83a2a542ff04b7643961af63781a960a098816ed
| HTML | apache-2.0 | rdo-management/tuskar-ui,rdo-management/tuskar-ui,rdo-management/tuskar-ui,rdo-management/tuskar-ui | html | ## Code Before:
{% extends 'infrastructure/base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans 'Nodes' %}{% endblock %}
{% block page_header %}
{% include 'horizon/common/_items_count_domain_page_header.html' with title=_('Nodes') items_count=nodes_count %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-xs-12">
<div class="actions pull-right">
<a href="{% url 'horizon:infrastructure:nodes:register' %}" class="btn ajax-modal">
{% trans 'Register Nodes' %}
</a>
</div>
{{ tab_group.render }}
</div>
</div>
{% endblock %}
## Instruction:
Fix Register Nodes button styling and add icon to it
Change-Id: I83a2a542ff04b7643961af63781a960a098816ed
## Code After:
{% extends 'infrastructure/base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans 'Nodes' %}{% endblock %}
{% block page_header %}
{% include 'horizon/common/_items_count_domain_page_header.html' with title=_('Nodes') items_count=nodes_count %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-xs-12">
<div class="actions pull-right">
<a href="{% url 'horizon:infrastructure:nodes:register' %}" class="btn btn-primary ajax-modal">
<span class="glyphicon glyphicon-plus"></span>
{% trans 'Register Nodes' %}
</a>
</div>
{{ tab_group.render }}
</div>
</div>
{% endblock %}
| {% extends 'infrastructure/base.html' %}
{% load i18n %}
{% load url from future %}
{% block title %}{% trans 'Nodes' %}{% endblock %}
{% block page_header %}
{% include 'horizon/common/_items_count_domain_page_header.html' with title=_('Nodes') items_count=nodes_count %}
{% endblock page_header %}
{% block main %}
<div class="row">
<div class="col-xs-12">
<div class="actions pull-right">
- <a href="{% url 'horizon:infrastructure:nodes:register' %}" class="btn ajax-modal">
+ <a href="{% url 'horizon:infrastructure:nodes:register' %}" class="btn btn-primary ajax-modal">
? ++++++++++++
+ <span class="glyphicon glyphicon-plus"></span>
{% trans 'Register Nodes' %}
</a>
</div>
{{ tab_group.render }}
</div>
</div>
{% endblock %} | 3 | 0.142857 | 2 | 1 |
799bb656ddcda5e3bf6afde2e0f6c0572a0cf86c | Cargo.toml | Cargo.toml | [package]
name = "serde_bytes"
version = "0.11.3" # remember to update html_root_url
authors = ["David Tolnay <dtolnay@gmail.com>"]
license = "MIT OR Apache-2.0"
description = "Optimized handling of `&[u8]` and `Vec<u8>` for Serde"
repository = "https://github.com/serde-rs/bytes"
documentation = "https://docs.serde.rs/serde_bytes/"
keywords = ["serde", "serialization", "no_std"]
categories = ["encoding"]
readme = "README.md"
edition = "2018"
[features]
default = ["std"]
std = ["serde/std"]
alloc = ["serde/alloc"]
[dependencies]
serde = { version = "1.0", default-features = false }
[dev-dependencies]
bincode = "1.0"
serde_derive = "1.0"
serde_test = "1.0"
[badges]
travis-ci = { repository = "serde-rs/bytes" }
| [package]
name = "serde_bytes"
version = "0.11.3" # remember to update html_root_url
authors = ["David Tolnay <dtolnay@gmail.com>"]
license = "MIT OR Apache-2.0"
description = "Optimized handling of `&[u8]` and `Vec<u8>` for Serde"
repository = "https://github.com/serde-rs/bytes"
documentation = "https://docs.serde.rs/serde_bytes/"
keywords = ["serde", "serialization", "no_std"]
categories = ["encoding"]
readme = "README.md"
edition = "2018"
[features]
default = ["std"]
std = ["serde/std"]
alloc = ["serde/alloc"]
[dependencies]
serde = { version = "1.0", default-features = false }
[dev-dependencies]
bincode = "1.0"
serde_derive = "1.0"
serde_test = "1.0"
[badges]
travis-ci = { repository = "serde-rs/bytes" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
| Select a single docs.rs build target | Select a single docs.rs build target
| TOML | apache-2.0 | serde-rs/bytes | toml | ## Code Before:
[package]
name = "serde_bytes"
version = "0.11.3" # remember to update html_root_url
authors = ["David Tolnay <dtolnay@gmail.com>"]
license = "MIT OR Apache-2.0"
description = "Optimized handling of `&[u8]` and `Vec<u8>` for Serde"
repository = "https://github.com/serde-rs/bytes"
documentation = "https://docs.serde.rs/serde_bytes/"
keywords = ["serde", "serialization", "no_std"]
categories = ["encoding"]
readme = "README.md"
edition = "2018"
[features]
default = ["std"]
std = ["serde/std"]
alloc = ["serde/alloc"]
[dependencies]
serde = { version = "1.0", default-features = false }
[dev-dependencies]
bincode = "1.0"
serde_derive = "1.0"
serde_test = "1.0"
[badges]
travis-ci = { repository = "serde-rs/bytes" }
## Instruction:
Select a single docs.rs build target
## Code After:
[package]
name = "serde_bytes"
version = "0.11.3" # remember to update html_root_url
authors = ["David Tolnay <dtolnay@gmail.com>"]
license = "MIT OR Apache-2.0"
description = "Optimized handling of `&[u8]` and `Vec<u8>` for Serde"
repository = "https://github.com/serde-rs/bytes"
documentation = "https://docs.serde.rs/serde_bytes/"
keywords = ["serde", "serialization", "no_std"]
categories = ["encoding"]
readme = "README.md"
edition = "2018"
[features]
default = ["std"]
std = ["serde/std"]
alloc = ["serde/alloc"]
[dependencies]
serde = { version = "1.0", default-features = false }
[dev-dependencies]
bincode = "1.0"
serde_derive = "1.0"
serde_test = "1.0"
[badges]
travis-ci = { repository = "serde-rs/bytes" }
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
| [package]
name = "serde_bytes"
version = "0.11.3" # remember to update html_root_url
authors = ["David Tolnay <dtolnay@gmail.com>"]
license = "MIT OR Apache-2.0"
description = "Optimized handling of `&[u8]` and `Vec<u8>` for Serde"
repository = "https://github.com/serde-rs/bytes"
documentation = "https://docs.serde.rs/serde_bytes/"
keywords = ["serde", "serialization", "no_std"]
categories = ["encoding"]
readme = "README.md"
edition = "2018"
[features]
default = ["std"]
std = ["serde/std"]
alloc = ["serde/alloc"]
[dependencies]
serde = { version = "1.0", default-features = false }
[dev-dependencies]
bincode = "1.0"
serde_derive = "1.0"
serde_test = "1.0"
[badges]
travis-ci = { repository = "serde-rs/bytes" }
+
+ [package.metadata.docs.rs]
+ targets = ["x86_64-unknown-linux-gnu"] | 3 | 0.107143 | 3 | 0 |
b7950a5bbf46e2772ea4284992bb265a13dcf85a | ipywidgets/build_css.js | ipywidgets/build_css.js | // Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var path = require('path');
var spawn = require('spawn-sync');
var source = './ipywidgets/static/widgets/less/widgets.less';
var css_destination = './ipywidgets/static/widgets/css/widgets.css';
var min_destination = './ipywidgets/static/widgets/css/widgets.min.css';
function run(cmd) {
// run a command, with some help:
// - echo command
// - die on failure
// - show stdout/err
console.log('> ' + cmd.join(' '));
var p = spawn(cmd[0], cmd.slice(1));
process.stdout.write(p.stdout.toString());
process.stderr.write(p.stderr.toString());
if (p.status !== 0) {
console.error("`%s` failed with status=%s", cmd.join(' '), p.status);
process.exit(p.status);
}
return p.stdout.toString();
}
run(['lessc',
'--include-path=./ipywidgets/static/components',
source,
css_destination,
]);
run(['cleancss',
'--source-map',
'--skip-restructuring ',
'-o',
min_destination,
css_destination]);
| // Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var path = require('path');
var spawn = require('spawn-sync');
var source = './static/widgets/less/widgets.less';
var css_destination = './static/widgets/css/widgets.css';
var min_destination = './static/widgets/css/widgets.min.css';
function run(cmd) {
// run a command, with some help:
// - echo command
// - die on failure
// - show stdout/err
console.log('> ' + cmd.join(' '));
var p = spawn(cmd[0], cmd.slice(1));
process.stdout.write(p.stdout.toString());
process.stderr.write(p.stderr.toString());
if (p.status !== 0) {
console.error("`%s` failed with status=%s", cmd.join(' '), p.status);
process.exit(p.status);
}
return p.stdout.toString();
}
run(['lessc',
'--include-path=./static/components',
source,
css_destination,
]);
run(['cleancss',
'--source-map',
'--skip-restructuring ',
'-o',
min_destination,
css_destination]);
| Update paths in CSS build | Update paths in CSS build
| JavaScript | bsd-3-clause | cornhundred/ipywidgets,jupyter-widgets/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,cornhundred/ipywidgets,cornhundred/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets | javascript | ## Code Before:
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var path = require('path');
var spawn = require('spawn-sync');
var source = './ipywidgets/static/widgets/less/widgets.less';
var css_destination = './ipywidgets/static/widgets/css/widgets.css';
var min_destination = './ipywidgets/static/widgets/css/widgets.min.css';
function run(cmd) {
// run a command, with some help:
// - echo command
// - die on failure
// - show stdout/err
console.log('> ' + cmd.join(' '));
var p = spawn(cmd[0], cmd.slice(1));
process.stdout.write(p.stdout.toString());
process.stderr.write(p.stderr.toString());
if (p.status !== 0) {
console.error("`%s` failed with status=%s", cmd.join(' '), p.status);
process.exit(p.status);
}
return p.stdout.toString();
}
run(['lessc',
'--include-path=./ipywidgets/static/components',
source,
css_destination,
]);
run(['cleancss',
'--source-map',
'--skip-restructuring ',
'-o',
min_destination,
css_destination]);
## Instruction:
Update paths in CSS build
## Code After:
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var path = require('path');
var spawn = require('spawn-sync');
var source = './static/widgets/less/widgets.less';
var css_destination = './static/widgets/css/widgets.css';
var min_destination = './static/widgets/css/widgets.min.css';
function run(cmd) {
// run a command, with some help:
// - echo command
// - die on failure
// - show stdout/err
console.log('> ' + cmd.join(' '));
var p = spawn(cmd[0], cmd.slice(1));
process.stdout.write(p.stdout.toString());
process.stderr.write(p.stderr.toString());
if (p.status !== 0) {
console.error("`%s` failed with status=%s", cmd.join(' '), p.status);
process.exit(p.status);
}
return p.stdout.toString();
}
run(['lessc',
'--include-path=./static/components',
source,
css_destination,
]);
run(['cleancss',
'--source-map',
'--skip-restructuring ',
'-o',
min_destination,
css_destination]);
| // Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
var path = require('path');
var spawn = require('spawn-sync');
- var source = './ipywidgets/static/widgets/less/widgets.less';
? -----------
+ var source = './static/widgets/less/widgets.less';
- var css_destination = './ipywidgets/static/widgets/css/widgets.css';
? -----------
+ var css_destination = './static/widgets/css/widgets.css';
- var min_destination = './ipywidgets/static/widgets/css/widgets.min.css';
? -----------
+ var min_destination = './static/widgets/css/widgets.min.css';
function run(cmd) {
// run a command, with some help:
// - echo command
// - die on failure
// - show stdout/err
console.log('> ' + cmd.join(' '));
var p = spawn(cmd[0], cmd.slice(1));
process.stdout.write(p.stdout.toString());
process.stderr.write(p.stderr.toString());
if (p.status !== 0) {
console.error("`%s` failed with status=%s", cmd.join(' '), p.status);
process.exit(p.status);
}
return p.stdout.toString();
}
run(['lessc',
- '--include-path=./ipywidgets/static/components',
? -----------
+ '--include-path=./static/components',
source,
css_destination,
]);
run(['cleancss',
'--source-map',
'--skip-restructuring ',
'-o',
min_destination,
css_destination]);
| 8 | 0.2 | 4 | 4 |
865d5233ece315ce3e0d055aaf5f9e1868a16381 | composer.json | composer.json | {
"name": "doctrine/spatial",
"type": "library",
"authors": [
{"name": "Jan Sorgalla", "email": "jsorgalla@googlemail.com"}
],
"require": {
"php": ">=5.3.2",
"symfony/console": "2.1.0-dev",
"symfony/class-loader": "2.1.0-dev",
"doctrine/common": "master-dev",
"doctrine/dbal": "master-dev",
"doctrine/orm": "master-dev",
"jsor/dbal-sqlite3": "master-dev"
},
"autoload": {
"psr-0": { "Doctrine\\Spatial": "src/" }
}
}
| {
"type": "library",
"authors": [
{"name": "Jan Sorgalla", "email": "jsorgalla@googlemail.com"}
],
"require": {
"php": ">=5.3.2",
"symfony/console": "2.1.0-dev",
"symfony/class-loader": "2.1.0-dev",
"doctrine/common": "master-dev",
"doctrine/dbal": "master-dev",
"doctrine/orm": "master-dev",
"jsor/dbal-sqlite3": "master-dev"
},
"autoload": {
"psr-0": { "Doctrine\\Spatial": "src/" }
}
}
| Remove name to prevent publishing | Remove name to prevent publishing | JSON | mit | jsor/doctrine-spatial-sandbox | json | ## Code Before:
{
"name": "doctrine/spatial",
"type": "library",
"authors": [
{"name": "Jan Sorgalla", "email": "jsorgalla@googlemail.com"}
],
"require": {
"php": ">=5.3.2",
"symfony/console": "2.1.0-dev",
"symfony/class-loader": "2.1.0-dev",
"doctrine/common": "master-dev",
"doctrine/dbal": "master-dev",
"doctrine/orm": "master-dev",
"jsor/dbal-sqlite3": "master-dev"
},
"autoload": {
"psr-0": { "Doctrine\\Spatial": "src/" }
}
}
## Instruction:
Remove name to prevent publishing
## Code After:
{
"type": "library",
"authors": [
{"name": "Jan Sorgalla", "email": "jsorgalla@googlemail.com"}
],
"require": {
"php": ">=5.3.2",
"symfony/console": "2.1.0-dev",
"symfony/class-loader": "2.1.0-dev",
"doctrine/common": "master-dev",
"doctrine/dbal": "master-dev",
"doctrine/orm": "master-dev",
"jsor/dbal-sqlite3": "master-dev"
},
"autoload": {
"psr-0": { "Doctrine\\Spatial": "src/" }
}
}
| {
- "name": "doctrine/spatial",
"type": "library",
"authors": [
{"name": "Jan Sorgalla", "email": "jsorgalla@googlemail.com"}
],
"require": {
"php": ">=5.3.2",
"symfony/console": "2.1.0-dev",
"symfony/class-loader": "2.1.0-dev",
"doctrine/common": "master-dev",
"doctrine/dbal": "master-dev",
"doctrine/orm": "master-dev",
"jsor/dbal-sqlite3": "master-dev"
},
"autoload": {
"psr-0": { "Doctrine\\Spatial": "src/" }
}
} | 1 | 0.052632 | 0 | 1 |
5e53f1e86fc7c4f1c7b42479684ac393c997ce52 | client/test/test-unrealcv.py | client/test/test-unrealcv.py | import unittest, time, sys
from common_conf import *
from test_server import EchoServer, MessageServer
import argparse
import threading
from test_server import TestMessageServer
from test_client import TestClientWithDummyServer
from test_commands import TestCommands
from test_realistic_rendering import TestRealisticRendering
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--travis', action='store_true') # Only run test availabe to travis CI
args = parser.parse_args()
suites = []
load = unittest.TestLoader().loadTestsFromTestCase
s = load(TestMessageServer); suites.append(s)
s = load(TestClientWithDummyServer); suites.append(s)
if not args.travis:
s = load(TestCommands); suites.append(s)
s = load(TestRealisticRendering); suites.append(s)
suite_obj = unittest.TestSuite(suites)
unittest.TextTestRunner(verbosity = 2).run(suite_obj)
| import unittest, time, sys
from common_conf import *
from test_server import EchoServer, MessageServer
import argparse
import threading
from test_server import TestMessageServer
from test_client import TestClientWithDummyServer
from test_commands import TestCommands
from test_realistic_rendering import TestRealisticRendering
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--travis', action='store_true') # Only run test availabe to travis CI
args = parser.parse_args()
suites = []
load = unittest.TestLoader().loadTestsFromTestCase
s = load(TestMessageServer); suites.append(s)
s = load(TestClientWithDummyServer); suites.append(s)
if not args.travis:
s = load(TestCommands); suites.append(s)
s = load(TestRealisticRendering); suites.append(s)
suite_obj = unittest.TestSuite(suites)
ret = not unittest.TextTestRunner(verbosity = 2).run(suite_obj).wasSucessful()
sys.exit(ret)
| Fix exit code of unittest. | Fix exit code of unittest.
| Python | mit | qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,qiuwch/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv | python | ## Code Before:
import unittest, time, sys
from common_conf import *
from test_server import EchoServer, MessageServer
import argparse
import threading
from test_server import TestMessageServer
from test_client import TestClientWithDummyServer
from test_commands import TestCommands
from test_realistic_rendering import TestRealisticRendering
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--travis', action='store_true') # Only run test availabe to travis CI
args = parser.parse_args()
suites = []
load = unittest.TestLoader().loadTestsFromTestCase
s = load(TestMessageServer); suites.append(s)
s = load(TestClientWithDummyServer); suites.append(s)
if not args.travis:
s = load(TestCommands); suites.append(s)
s = load(TestRealisticRendering); suites.append(s)
suite_obj = unittest.TestSuite(suites)
unittest.TextTestRunner(verbosity = 2).run(suite_obj)
## Instruction:
Fix exit code of unittest.
## Code After:
import unittest, time, sys
from common_conf import *
from test_server import EchoServer, MessageServer
import argparse
import threading
from test_server import TestMessageServer
from test_client import TestClientWithDummyServer
from test_commands import TestCommands
from test_realistic_rendering import TestRealisticRendering
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--travis', action='store_true') # Only run test availabe to travis CI
args = parser.parse_args()
suites = []
load = unittest.TestLoader().loadTestsFromTestCase
s = load(TestMessageServer); suites.append(s)
s = load(TestClientWithDummyServer); suites.append(s)
if not args.travis:
s = load(TestCommands); suites.append(s)
s = load(TestRealisticRendering); suites.append(s)
suite_obj = unittest.TestSuite(suites)
ret = not unittest.TextTestRunner(verbosity = 2).run(suite_obj).wasSucessful()
sys.exit(ret)
| import unittest, time, sys
from common_conf import *
from test_server import EchoServer, MessageServer
import argparse
import threading
from test_server import TestMessageServer
from test_client import TestClientWithDummyServer
from test_commands import TestCommands
from test_realistic_rendering import TestRealisticRendering
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--travis', action='store_true') # Only run test availabe to travis CI
args = parser.parse_args()
suites = []
load = unittest.TestLoader().loadTestsFromTestCase
s = load(TestMessageServer); suites.append(s)
s = load(TestClientWithDummyServer); suites.append(s)
if not args.travis:
s = load(TestCommands); suites.append(s)
s = load(TestRealisticRendering); suites.append(s)
suite_obj = unittest.TestSuite(suites)
- unittest.TextTestRunner(verbosity = 2).run(suite_obj)
+ ret = not unittest.TextTestRunner(verbosity = 2).run(suite_obj).wasSucessful()
? ++++++++++ +++++++++++++++
+ sys.exit(ret) | 3 | 0.115385 | 2 | 1 |
63f01051dbc0a02218f061b6d024f9f25cc8a43b | app/presenters/source_presenter.rb | app/presenters/source_presenter.rb | class SourcePresenter
attr_reader :source
def initialize(source)
@source = source
end
def as_json(opts = {})
{
id: source.id,
name: source.name,
citation: source.description,
citation_id: source.citation_id,
source_type: source.source_type,
asco_abstract_id: source.asco_abstract_id,
source_url: source.source_url,
open_access: source.open_access,
pmc_id: source.pmc_id,
publication_date: publication_date,
journal: source.journal,
full_journal_title: source.full_journal_title,
status: source.status,
is_review: source.is_review?,
clinical_trials: source.clinical_trials.map { |t| ClinicalTrialPresenter.new(t) },
}
end
private
def publication_date
{}.tap do |date|
if source.publication_year
date[:year] = source.publication_year
end
if source.publication_month
date[:month] = source.publication_month
end
if source.publication_day
date[:day] = source.publication_day
end
end
end
end
| class SourcePresenter
attr_reader :source
def initialize(source)
@source = source
end
def as_json(opts = {})
{
id: source.id,
name: source.name,
citation: source.description,
citation_id: source.citation_id,
source_type: source.source_type,
asco_abstract_id: source.asco_abstract_id,
source_url: source.source_url,
open_access: source.open_access,
pmc_id: source.pmc_id,
publication_date: publication_date,
journal: source.journal,
full_journal_title: source.full_journal_title,
status: source.status,
is_review: source.is_review?,
clinical_trials: source.clinical_trials.map { |t| ClinicalTrialPresenter.new(t) },
evidence_item_count: source.evidence_items.size,
}
end
private
def publication_date
{}.tap do |date|
if source.publication_year
date[:year] = source.publication_year
end
if source.publication_month
date[:month] = source.publication_month
end
if source.publication_day
date[:day] = source.publication_day
end
end
end
end
| Add evidence item count to source presenter | Add evidence item count to source presenter
| Ruby | mit | genome/civic-server,genome/civic-server,genome/civic-server,genome/civic-server,genome/civic-server | ruby | ## Code Before:
class SourcePresenter
attr_reader :source
def initialize(source)
@source = source
end
def as_json(opts = {})
{
id: source.id,
name: source.name,
citation: source.description,
citation_id: source.citation_id,
source_type: source.source_type,
asco_abstract_id: source.asco_abstract_id,
source_url: source.source_url,
open_access: source.open_access,
pmc_id: source.pmc_id,
publication_date: publication_date,
journal: source.journal,
full_journal_title: source.full_journal_title,
status: source.status,
is_review: source.is_review?,
clinical_trials: source.clinical_trials.map { |t| ClinicalTrialPresenter.new(t) },
}
end
private
def publication_date
{}.tap do |date|
if source.publication_year
date[:year] = source.publication_year
end
if source.publication_month
date[:month] = source.publication_month
end
if source.publication_day
date[:day] = source.publication_day
end
end
end
end
## Instruction:
Add evidence item count to source presenter
## Code After:
class SourcePresenter
attr_reader :source
def initialize(source)
@source = source
end
def as_json(opts = {})
{
id: source.id,
name: source.name,
citation: source.description,
citation_id: source.citation_id,
source_type: source.source_type,
asco_abstract_id: source.asco_abstract_id,
source_url: source.source_url,
open_access: source.open_access,
pmc_id: source.pmc_id,
publication_date: publication_date,
journal: source.journal,
full_journal_title: source.full_journal_title,
status: source.status,
is_review: source.is_review?,
clinical_trials: source.clinical_trials.map { |t| ClinicalTrialPresenter.new(t) },
evidence_item_count: source.evidence_items.size,
}
end
private
def publication_date
{}.tap do |date|
if source.publication_year
date[:year] = source.publication_year
end
if source.publication_month
date[:month] = source.publication_month
end
if source.publication_day
date[:day] = source.publication_day
end
end
end
end
| class SourcePresenter
attr_reader :source
def initialize(source)
@source = source
end
def as_json(opts = {})
{
id: source.id,
name: source.name,
citation: source.description,
citation_id: source.citation_id,
source_type: source.source_type,
asco_abstract_id: source.asco_abstract_id,
source_url: source.source_url,
open_access: source.open_access,
pmc_id: source.pmc_id,
publication_date: publication_date,
journal: source.journal,
full_journal_title: source.full_journal_title,
status: source.status,
is_review: source.is_review?,
clinical_trials: source.clinical_trials.map { |t| ClinicalTrialPresenter.new(t) },
+ evidence_item_count: source.evidence_items.size,
}
end
private
def publication_date
{}.tap do |date|
if source.publication_year
date[:year] = source.publication_year
end
if source.publication_month
date[:month] = source.publication_month
end
if source.publication_day
date[:day] = source.publication_day
end
end
end
end | 1 | 0.02381 | 1 | 0 |
ae1056a7e3587f3a17e869386206d691647649ca | .github/workflows/ci.yml | .github/workflows/ci.yml | name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout Scaladex
uses: actions/checkout@v2
with:
path: scaladex
- name: Checkout Scaladex small index
uses: actions/checkout@v2
with:
repository: scalacenter/scaladex-small-index
path: scaladex-small-index
- name: Checkout Scaladex contrib
uses: actions/checkout@v2
with:
repository: scalacenter/scaladex-contrib
path: scaladex-contrib
- uses: olafurpg/setup-scala@v10
with:
java-version: "adopt@1.8"
- uses: coursier/cache-action@v5
- name: Formatting
run: |
cd scaladex
./bin/scalafmt --test
shell: bash
- name: Load elastic search
run: |
cd scaladex
sbt "data/run elastic"
shell: bash
- name: Unit tests
run: |
cd scaladex
sbt test
shell: bash
- name: Package server
run: |
cd scaladex
sbt server/universal:packageBin
shell: bash
| name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout Scaladex
uses: actions/checkout@v2
with:
path: scaladex
- name: Checkout Scaladex small index
uses: actions/checkout@v2
with:
repository: scalacenter/scaladex-small-index
path: scaladex-small-index
- name: Checkout Scaladex contrib
uses: actions/checkout@v2
with:
repository: scalacenter/scaladex-contrib
path: scaladex-contrib
- uses: laughedelic/coursier-setup@v1
with:
jvm: "adopt:1.8"
- uses: coursier/cache-action@v5
- name: Formatting
run: |
cd scaladex
./bin/scalafmt --test
shell: bash
- name: Load elastic search
run: |
cd scaladex
sbtn "data/run elastic"
shell: bash
- name: Unit tests
run: |
cd scaladex
sbtn test
shell: bash
- name: Package server
run: |
cd scaladex
sbtn server/universal:packageBin
shell: bash
| Use sbtn in CI to load sbt once | Use sbtn in CI to load sbt once
| YAML | bsd-3-clause | scalacenter/scaladex,scalacenter/scaladex | yaml | ## Code Before:
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout Scaladex
uses: actions/checkout@v2
with:
path: scaladex
- name: Checkout Scaladex small index
uses: actions/checkout@v2
with:
repository: scalacenter/scaladex-small-index
path: scaladex-small-index
- name: Checkout Scaladex contrib
uses: actions/checkout@v2
with:
repository: scalacenter/scaladex-contrib
path: scaladex-contrib
- uses: olafurpg/setup-scala@v10
with:
java-version: "adopt@1.8"
- uses: coursier/cache-action@v5
- name: Formatting
run: |
cd scaladex
./bin/scalafmt --test
shell: bash
- name: Load elastic search
run: |
cd scaladex
sbt "data/run elastic"
shell: bash
- name: Unit tests
run: |
cd scaladex
sbt test
shell: bash
- name: Package server
run: |
cd scaladex
sbt server/universal:packageBin
shell: bash
## Instruction:
Use sbtn in CI to load sbt once
## Code After:
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout Scaladex
uses: actions/checkout@v2
with:
path: scaladex
- name: Checkout Scaladex small index
uses: actions/checkout@v2
with:
repository: scalacenter/scaladex-small-index
path: scaladex-small-index
- name: Checkout Scaladex contrib
uses: actions/checkout@v2
with:
repository: scalacenter/scaladex-contrib
path: scaladex-contrib
- uses: laughedelic/coursier-setup@v1
with:
jvm: "adopt:1.8"
- uses: coursier/cache-action@v5
- name: Formatting
run: |
cd scaladex
./bin/scalafmt --test
shell: bash
- name: Load elastic search
run: |
cd scaladex
sbtn "data/run elastic"
shell: bash
- name: Unit tests
run: |
cd scaladex
sbtn test
shell: bash
- name: Package server
run: |
cd scaladex
sbtn server/universal:packageBin
shell: bash
| name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
unit:
runs-on: ubuntu-latest
steps:
- name: Checkout Scaladex
uses: actions/checkout@v2
with:
path: scaladex
- name: Checkout Scaladex small index
uses: actions/checkout@v2
with:
repository: scalacenter/scaladex-small-index
path: scaladex-small-index
- name: Checkout Scaladex contrib
uses: actions/checkout@v2
with:
repository: scalacenter/scaladex-contrib
path: scaladex-contrib
- - uses: olafurpg/setup-scala@v10
+ - uses: laughedelic/coursier-setup@v1
with:
- java-version: "adopt@1.8"
? - ^^^^^^^^^ ^
+ jvm: "adopt:1.8"
? ^ ^
- uses: coursier/cache-action@v5
- name: Formatting
run: |
cd scaladex
./bin/scalafmt --test
shell: bash
- name: Load elastic search
run: |
cd scaladex
- sbt "data/run elastic"
+ sbtn "data/run elastic"
? +
shell: bash
- name: Unit tests
run: |
cd scaladex
- sbt test
+ sbtn test
? +
shell: bash
- name: Package server
run: |
cd scaladex
- sbt server/universal:packageBin
+ sbtn server/universal:packageBin
? +
shell: bash | 10 | 0.2 | 5 | 5 |
85a812a0399c444c52b7354b334d324252b74a7e | .circleci/config.yml | .circleci/config.yml | version: 2
jobs:
build:
working_directory: ~/datavisyn
docker:
- image: circleci/node:12.13-buster-browsers
steps:
- checkout
- restore_cache:
key: deps3-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
- run:
name: install-npm-wee
command: npm install
- save_cache:
key: deps3-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: dist
command: npm run dist
- store_artifacts:
path: dist
workflows:
version: 2
build-branch:
jobs:
- build:
filters:
tags:
ignore: /^v.*/
build-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
| version: 2
jobs:
build:
working_directory: ~/datavisyn
docker:
- image: circleci/node:12.13-buster-browsers
steps:
- checkout
- restore_cache:
key: deps3-{{ .Branch }}-{{ checksum "package.json" }}
- run:
name: install-npm-wee
command: npm install
- save_cache:
key: deps3-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: dist
command: npm run dist
- store_artifacts:
path: dist
workflows:
version: 2
build-branch:
jobs:
- build:
filters:
tags:
ignore: /^v.*/
build-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
| Remove package-lock.json from CircleCI cache hash | Remove package-lock.json from CircleCI cache hash
| YAML | bsd-3-clause | datavisyn/datavisyn-scatterplot,datavisyn/datavisyn-scatterplot | yaml | ## Code Before:
version: 2
jobs:
build:
working_directory: ~/datavisyn
docker:
- image: circleci/node:12.13-buster-browsers
steps:
- checkout
- restore_cache:
key: deps3-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
- run:
name: install-npm-wee
command: npm install
- save_cache:
key: deps3-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: dist
command: npm run dist
- store_artifacts:
path: dist
workflows:
version: 2
build-branch:
jobs:
- build:
filters:
tags:
ignore: /^v.*/
build-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
## Instruction:
Remove package-lock.json from CircleCI cache hash
## Code After:
version: 2
jobs:
build:
working_directory: ~/datavisyn
docker:
- image: circleci/node:12.13-buster-browsers
steps:
- checkout
- restore_cache:
key: deps3-{{ .Branch }}-{{ checksum "package.json" }}
- run:
name: install-npm-wee
command: npm install
- save_cache:
key: deps3-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: dist
command: npm run dist
- store_artifacts:
path: dist
workflows:
version: 2
build-branch:
jobs:
- build:
filters:
tags:
ignore: /^v.*/
build-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/
| version: 2
jobs:
build:
working_directory: ~/datavisyn
docker:
- image: circleci/node:12.13-buster-browsers
steps:
- checkout
- restore_cache:
- key: deps3-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
? -----------------------------------
+ key: deps3-{{ .Branch }}-{{ checksum "package.json" }}
- run:
name: install-npm-wee
command: npm install
- save_cache:
- key: deps3-{{ .Branch }}-{{ checksum "package.json" }}-{{ checksum "package-lock.json" }}
? -----------------------------------
+ key: deps3-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- ./node_modules
- run:
name: dist
command: npm run dist
- store_artifacts:
path: dist
workflows:
version: 2
build-branch:
jobs:
- build:
filters:
tags:
ignore: /^v.*/
build-tag:
jobs:
- build:
filters:
branches:
ignore: /.*/
tags:
only: /^v.*/ | 4 | 0.105263 | 2 | 2 |
dca3427da0ff1a5ae85d42b8503174560cf0fc12 | clean_summary/README.md | clean_summary/README.md |
Plugin to clean your summary of excess images. Images can take up much more
space than text and lead to summaries being different sizes on archive and
index pages. With this plugin you can specify a maximum number of images that
will appear in your summaries.
There is also an option to include a minimum of one image.
##Settings##
This plugin has two settings. `CLEAN_SUMMARY_MAXIMUM` which takes an int, and
`CLEAN_SUMMARY_MINIMUM_ONE` which takes a boolean. They default to 0 and False.
`CLEAN_SUMMARY_MAXIMUM` sets the maximum number of images that will appear in
your summary.
if `CLEAN_SUMMARY_MINIMUM_ONE` is set to `True` and your summary doesn't already
contain an image, the plugin will add the first image in your article (if one
exists) to the beginning of the summary.
##Requirements##
Requires Beautiful Soup:
pip install BeautifulSoup4
##Usage with Summary Plugin##
If using the summary plugin, make sure summary appears in your plugins before
clean summary. Eg.
PLUGINS = ['summary', 'clean_summary', ... ]
|
This plugin cleans your summary of excess images. Images can take up much more
space than text and lead to summaries being different sizes on archive and
index pages. With this plugin, you can specify a maximum number of images that
will appear in your summaries.
There is also an option to include a minimum of one image.
## Settings
This plugin has two settings: `CLEAN_SUMMARY_MAXIMUM`, which takes an integer,
and `CLEAN_SUMMARY_MINIMUM_ONE`, which takes a Boolean value. They default to
`0` and `False`, respectively.
`CLEAN_SUMMARY_MAXIMUM` sets the maximum number of images that will appear in
your summary.
If `CLEAN_SUMMARY_MINIMUM_ONE` is set to `True` and your summary doesn't already
contain an image, the plugin will add the first image in your article (if one
exists) to the beginning of the summary.
## Requirements
Requires Beautiful Soup:
pip install BeautifulSoup4
## Usage with Summary Plugin
If using the Summary plugin, make sure it appears in your plugin list before
the Clean Summary plugin. For example:
PLUGINS = ['summary', 'clean_summary', ... ]
| Improve Clean Summary plugin ReadME | Improve Clean Summary plugin ReadME
| Markdown | agpl-3.0 | MarkusH/pelican-plugins,pxquim/pelican-plugins,xsteadfastx/pelican-plugins,wilsonfreitas/pelican-plugins,kdheepak89/pelican-plugins,florianjacob/pelican-plugins,talha131/pelican-plugins,rlaboiss/pelican-plugins,mortada/pelican-plugins,UHBiocomputation/pelican-plugins,talha131/pelican-plugins,benjaminabel/pelican-plugins,jantman/pelican-plugins,ingwinlu/pelican-plugins,mitchins/pelican-plugins,andreas-h/pelican-plugins,jantman/pelican-plugins,gjreda/pelican-plugins,mikitex70/pelican-plugins,xsteadfastx/pelican-plugins,pxquim/pelican-plugins,pxquim/pelican-plugins,talha131/pelican-plugins,wilsonfreitas/pelican-plugins,danmackinlay/pelican-plugins,UHBiocomputation/pelican-plugins,M157q/pelican-plugins,howthebodyworks/pelican-plugins,farseerfc/pelican-plugins,talha131/pelican-plugins,kdheepak89/pelican-plugins,publicus/pelican-plugins,UHBiocomputation/pelican-plugins,MarkusH/pelican-plugins,florianjacob/pelican-plugins,florianjacob/pelican-plugins,M157q/pelican-plugins,farseerfc/pelican-plugins,rlaboiss/pelican-plugins,prisae/pelican-plugins,jantman/pelican-plugins,howthebodyworks/pelican-plugins,farseerfc/pelican-plugins,andreas-h/pelican-plugins,ingwinlu/pelican-plugins,benjaminabel/pelican-plugins,farseerfc/pelican-plugins,M157q/pelican-plugins,howthebodyworks/pelican-plugins,jantman/pelican-plugins,MarkusH/pelican-plugins,prisae/pelican-plugins,prisae/pelican-plugins,kdheepak89/pelican-plugins,andreas-h/pelican-plugins,pxquim/pelican-plugins,mortada/pelican-plugins,mikitex70/pelican-plugins,gjreda/pelican-plugins,mortada/pelican-plugins,MarkusH/pelican-plugins,howthebodyworks/pelican-plugins,gjreda/pelican-plugins,xsteadfastx/pelican-plugins,andreas-h/pelican-plugins,publicus/pelican-plugins,wilsonfreitas/pelican-plugins,florianjacob/pelican-plugins,talha131/pelican-plugins,danmackinlay/pelican-plugins,publicus/pelican-plugins,danmackinlay/pelican-plugins,MarkusH/pelican-plugins,rlaboiss/pelican-plugins,benjaminabel/pelican-plugins,UHBiocomputation/pelican-plugins,wilsonfreitas/pelican-plugins,ingwinlu/pelican-plugins,mortada/pelican-plugins,gjreda/pelican-plugins,benjaminabel/pelican-plugins,mitchins/pelican-plugins,rlaboiss/pelican-plugins,publicus/pelican-plugins,danmackinlay/pelican-plugins,prisae/pelican-plugins,mikitex70/pelican-plugins,farseerfc/pelican-plugins,mortada/pelican-plugins,mikitex70/pelican-plugins,ingwinlu/pelican-plugins,M157q/pelican-plugins,kdheepak89/pelican-plugins,mitchins/pelican-plugins,mitchins/pelican-plugins,xsteadfastx/pelican-plugins | markdown | ## Code Before:
Plugin to clean your summary of excess images. Images can take up much more
space than text and lead to summaries being different sizes on archive and
index pages. With this plugin you can specify a maximum number of images that
will appear in your summaries.
There is also an option to include a minimum of one image.
##Settings##
This plugin has two settings. `CLEAN_SUMMARY_MAXIMUM` which takes an int, and
`CLEAN_SUMMARY_MINIMUM_ONE` which takes a boolean. They default to 0 and False.
`CLEAN_SUMMARY_MAXIMUM` sets the maximum number of images that will appear in
your summary.
if `CLEAN_SUMMARY_MINIMUM_ONE` is set to `True` and your summary doesn't already
contain an image, the plugin will add the first image in your article (if one
exists) to the beginning of the summary.
##Requirements##
Requires Beautiful Soup:
pip install BeautifulSoup4
##Usage with Summary Plugin##
If using the summary plugin, make sure summary appears in your plugins before
clean summary. Eg.
PLUGINS = ['summary', 'clean_summary', ... ]
## Instruction:
Improve Clean Summary plugin ReadME
## Code After:
This plugin cleans your summary of excess images. Images can take up much more
space than text and lead to summaries being different sizes on archive and
index pages. With this plugin, you can specify a maximum number of images that
will appear in your summaries.
There is also an option to include a minimum of one image.
## Settings
This plugin has two settings: `CLEAN_SUMMARY_MAXIMUM`, which takes an integer,
and `CLEAN_SUMMARY_MINIMUM_ONE`, which takes a Boolean value. They default to
`0` and `False`, respectively.
`CLEAN_SUMMARY_MAXIMUM` sets the maximum number of images that will appear in
your summary.
If `CLEAN_SUMMARY_MINIMUM_ONE` is set to `True` and your summary doesn't already
contain an image, the plugin will add the first image in your article (if one
exists) to the beginning of the summary.
## Requirements
Requires Beautiful Soup:
pip install BeautifulSoup4
## Usage with Summary Plugin
If using the Summary plugin, make sure it appears in your plugin list before
the Clean Summary plugin. For example:
PLUGINS = ['summary', 'clean_summary', ... ]
|
- Plugin to clean your summary of excess images. Images can take up much more
? ^ ---
+ This plugin cleans your summary of excess images. Images can take up much more
? ^^^^^^ +
- space than text and lead to summaries being different sizes on archive and
? -
+ space than text and lead to summaries being different sizes on archive and
- index pages. With this plugin you can specify a maximum number of images that
+ index pages. With this plugin, you can specify a maximum number of images that
? +
will appear in your summaries.
There is also an option to include a minimum of one image.
- ##Settings##
? --
+ ## Settings
? +
- This plugin has two settings. `CLEAN_SUMMARY_MAXIMUM` which takes an int, and
? ^ -----
+ This plugin has two settings: `CLEAN_SUMMARY_MAXIMUM`, which takes an integer,
? ^ + ++++
- `CLEAN_SUMMARY_MINIMUM_ONE` which takes a boolean. They default to 0 and False.
? ^ -------------
+ and `CLEAN_SUMMARY_MINIMUM_ONE`, which takes a Boolean value. They default to
? ++++ + ^ ++++++
+ `0` and `False`, respectively.
- `CLEAN_SUMMARY_MAXIMUM` sets the maximum number of images that will appear in
? -
+ `CLEAN_SUMMARY_MAXIMUM` sets the maximum number of images that will appear in
your summary.
- if `CLEAN_SUMMARY_MINIMUM_ONE` is set to `True` and your summary doesn't already
? ^
+ If `CLEAN_SUMMARY_MINIMUM_ONE` is set to `True` and your summary doesn't already
? ^
- contain an image, the plugin will add the first image in your article (if one
? -
+ contain an image, the plugin will add the first image in your article (if one
exists) to the beginning of the summary.
- ##Requirements##
? --
+ ## Requirements
? +
Requires Beautiful Soup:
pip install BeautifulSoup4
+ ## Usage with Summary Plugin
- ##Usage with Summary Plugin##
-
- If using the summary plugin, make sure summary appears in your plugins before
? ^ ^^^^^^^
+ If using the Summary plugin, make sure it appears in your plugin list before
? ^ ^^ +++ +
- clean summary. Eg.
+ the Clean Summary plugin. For example:
PLUGINS = ['summary', 'clean_summary', ... ] | 28 | 0.848485 | 14 | 14 |
d3607f0353cc9144a71c1a0afc23e3ffc9b1557a | _posts/2014-09-09-harmony.markdown | _posts/2014-09-09-harmony.markdown | ---
layout: post
title: "Harmony"
date: 2014-09-09 00:16:00
homepage: https://github.com/gayanvirajith/harmony
download: https://github.com/gayanvirajith/harmony/releases/latest
demo: http://webcreate.lk/harmony/
author: Gayan Virajith
thumbnail: harmony.jpg
license: MIT License
license_link: https://github.com/gayanvirajith/harmony/blob/master/LICENSE.md
---
Harmony is a responsive jekyll theme.
- Build for jekyll 2.x
- Support Google anaytics and RSS feeds
- Sass based styles
- Browser support: IE 8+, Chrome, Safari and Firefox
- Fluidly responsive
### Screenshots
#### Home page

#### Article page

#### Blog archive page

| ---
layout: post
title: "Harmony"
date: 2014-09-09 00:16:00
homepage: https://github.com/gayanvirajith/harmony
download: https://github.com/gayanvirajith/harmony/releases/latest
demo: http://gayan.me/harmony/
author: Gayan Virajith
thumbnail: harmony.jpg
license: MIT License
license_link: https://github.com/gayanvirajith/harmony/blob/master/LICENSE.md
---
Harmony is a responsive jekyll theme.
- Build for jekyll 2.x
- Support Google anaytics and RSS feeds
- Sass based styles
- Browser support: IE 8+, Chrome, Safari and Firefox
- Fluidly responsive
### Screenshots
#### Home page

#### Article page

#### Blog archive page

| Update live demo url of harmony | Update live demo url of harmony
| Markdown | mit | lauheeliu/lauheeliu.github.io,lach76/lach76.github.io,lauheeliu/lauheeliu.github.io | markdown | ## Code Before:
---
layout: post
title: "Harmony"
date: 2014-09-09 00:16:00
homepage: https://github.com/gayanvirajith/harmony
download: https://github.com/gayanvirajith/harmony/releases/latest
demo: http://webcreate.lk/harmony/
author: Gayan Virajith
thumbnail: harmony.jpg
license: MIT License
license_link: https://github.com/gayanvirajith/harmony/blob/master/LICENSE.md
---
Harmony is a responsive jekyll theme.
- Build for jekyll 2.x
- Support Google anaytics and RSS feeds
- Sass based styles
- Browser support: IE 8+, Chrome, Safari and Firefox
- Fluidly responsive
### Screenshots
#### Home page

#### Article page

#### Blog archive page

## Instruction:
Update live demo url of harmony
## Code After:
---
layout: post
title: "Harmony"
date: 2014-09-09 00:16:00
homepage: https://github.com/gayanvirajith/harmony
download: https://github.com/gayanvirajith/harmony/releases/latest
demo: http://gayan.me/harmony/
author: Gayan Virajith
thumbnail: harmony.jpg
license: MIT License
license_link: https://github.com/gayanvirajith/harmony/blob/master/LICENSE.md
---
Harmony is a responsive jekyll theme.
- Build for jekyll 2.x
- Support Google anaytics and RSS feeds
- Sass based styles
- Browser support: IE 8+, Chrome, Safari and Firefox
- Fluidly responsive
### Screenshots
#### Home page

#### Article page

#### Blog archive page

| ---
layout: post
title: "Harmony"
date: 2014-09-09 00:16:00
homepage: https://github.com/gayanvirajith/harmony
download: https://github.com/gayanvirajith/harmony/releases/latest
- demo: http://webcreate.lk/harmony/
+ demo: http://gayan.me/harmony/
author: Gayan Virajith
thumbnail: harmony.jpg
license: MIT License
license_link: https://github.com/gayanvirajith/harmony/blob/master/LICENSE.md
---
Harmony is a responsive jekyll theme.
- Build for jekyll 2.x
- Support Google anaytics and RSS feeds
- Sass based styles
- Browser support: IE 8+, Chrome, Safari and Firefox
- Fluidly responsive
### Screenshots
#### Home page

#### Article page

#### Blog archive page

| 2 | 0.057143 | 1 | 1 |
026cc79eb826540251195a23257a08f1a92a3937 | Support/lib/rspec/mate/text_mate_formatter.rb | Support/lib/rspec/mate/text_mate_formatter.rb | require 'cgi'
require 'rspec/core/formatters/html_formatter'
# This formatter is only used for RSpec 3 (older RSpec versions ship their own TextMateFormatter).
module RSpec
module Mate
module Formatters
class HtmlPrinterWithClickableBacktrace < RSpec::Core::Formatters::HtmlPrinter
def make_backtrace_clickable(backtrace)
backtrace.gsub!(/(^.*?):(\d+):(.*)/) do
path, line, rest = $1, $2, $3
url = "txmt://open?url=file://#{CGI::escape(File.expand_path(path))}&line=#{$2}"
link_text = "#{path}:#{line}"
"<a href='#{CGI::h(url)}'>#{CGI::h(link_text)}</a>:#{CGI.h(rest)}"
end
end
def print_example_failed(pending_fixed, description, run_time, failure_id, exception, extra_content, escape_backtrace = false)
exception[:backtrace] = make_backtrace_clickable(exception[:backtrace])
# Call original implementation, but pass false for `escape_backtrace`
super(pending_fixed, description, run_time, failure_id, exception, extra_content, false)
end
end
class TextMateFormatter < RSpec::Core::Formatters::HtmlFormatter
RSpec::Core::Formatters.register self, *RSpec::Core::Formatters::Loader.formatters[superclass]
def initialize(output)
super
@printer = HtmlPrinterWithClickableBacktrace.new(output)
end
end
end
end
end
| require 'cgi'
require 'rspec/core/formatters/html_formatter'
# This formatter is only used for RSpec 3 (older RSpec versions ship their own TextMateFormatter).
module RSpec
module Mate
module Formatters
class HtmlPrinterWithClickableBacktrace < RSpec::Core::Formatters::HtmlPrinter
def make_backtrace_clickable(backtrace)
backtrace.gsub!(/(^.*?):(\d+):(.*)/) do
path, line, rest = $1, $2, $3
url = "txmt://open?url=file://#{CGI::escape(File.expand_path(path))}&line=#{$2}"
link_text = "#{path}:#{line}"
"<a href='#{CGI.escape_html(url)}'>#{CGI.escape_html(link_text)}</a>:#{CGI.escape_html(rest)}"
end
end
def print_example_failed(pending_fixed, description, run_time, failure_id, exception, extra_content, escape_backtrace = false)
exception[:backtrace] = make_backtrace_clickable(exception[:backtrace])
# Call original implementation, but pass false for `escape_backtrace`
super(pending_fixed, description, run_time, failure_id, exception, extra_content, false)
end
end
class TextMateFormatter < RSpec::Core::Formatters::HtmlFormatter
RSpec::Core::Formatters.register self, *RSpec::Core::Formatters::Loader.formatters[superclass]
def initialize(output)
super
@printer = HtmlPrinterWithClickableBacktrace.new(output)
end
end
end
end
end
| Fix TextMateFormatter for Ruby <= 2.1. | Fix TextMateFormatter for Ruby <= 2.1.
`CGI.h` isn’t available before Ruby 2.1.0.
| Ruby | mit | infininight/rspec-tmbundle,rspec/rspec.tmbundle,rspec/rspec.tmbundle,infininight/rspec-tmbundle,die-antwort/rspec-tmbundle,die-antwort/rspec-tmbundle | ruby | ## Code Before:
require 'cgi'
require 'rspec/core/formatters/html_formatter'
# This formatter is only used for RSpec 3 (older RSpec versions ship their own TextMateFormatter).
module RSpec
module Mate
module Formatters
class HtmlPrinterWithClickableBacktrace < RSpec::Core::Formatters::HtmlPrinter
def make_backtrace_clickable(backtrace)
backtrace.gsub!(/(^.*?):(\d+):(.*)/) do
path, line, rest = $1, $2, $3
url = "txmt://open?url=file://#{CGI::escape(File.expand_path(path))}&line=#{$2}"
link_text = "#{path}:#{line}"
"<a href='#{CGI::h(url)}'>#{CGI::h(link_text)}</a>:#{CGI.h(rest)}"
end
end
def print_example_failed(pending_fixed, description, run_time, failure_id, exception, extra_content, escape_backtrace = false)
exception[:backtrace] = make_backtrace_clickable(exception[:backtrace])
# Call original implementation, but pass false for `escape_backtrace`
super(pending_fixed, description, run_time, failure_id, exception, extra_content, false)
end
end
class TextMateFormatter < RSpec::Core::Formatters::HtmlFormatter
RSpec::Core::Formatters.register self, *RSpec::Core::Formatters::Loader.formatters[superclass]
def initialize(output)
super
@printer = HtmlPrinterWithClickableBacktrace.new(output)
end
end
end
end
end
## Instruction:
Fix TextMateFormatter for Ruby <= 2.1.
`CGI.h` isn’t available before Ruby 2.1.0.
## Code After:
require 'cgi'
require 'rspec/core/formatters/html_formatter'
# This formatter is only used for RSpec 3 (older RSpec versions ship their own TextMateFormatter).
module RSpec
module Mate
module Formatters
class HtmlPrinterWithClickableBacktrace < RSpec::Core::Formatters::HtmlPrinter
def make_backtrace_clickable(backtrace)
backtrace.gsub!(/(^.*?):(\d+):(.*)/) do
path, line, rest = $1, $2, $3
url = "txmt://open?url=file://#{CGI::escape(File.expand_path(path))}&line=#{$2}"
link_text = "#{path}:#{line}"
"<a href='#{CGI.escape_html(url)}'>#{CGI.escape_html(link_text)}</a>:#{CGI.escape_html(rest)}"
end
end
def print_example_failed(pending_fixed, description, run_time, failure_id, exception, extra_content, escape_backtrace = false)
exception[:backtrace] = make_backtrace_clickable(exception[:backtrace])
# Call original implementation, but pass false for `escape_backtrace`
super(pending_fixed, description, run_time, failure_id, exception, extra_content, false)
end
end
class TextMateFormatter < RSpec::Core::Formatters::HtmlFormatter
RSpec::Core::Formatters.register self, *RSpec::Core::Formatters::Loader.formatters[superclass]
def initialize(output)
super
@printer = HtmlPrinterWithClickableBacktrace.new(output)
end
end
end
end
end
| require 'cgi'
require 'rspec/core/formatters/html_formatter'
# This formatter is only used for RSpec 3 (older RSpec versions ship their own TextMateFormatter).
module RSpec
module Mate
module Formatters
class HtmlPrinterWithClickableBacktrace < RSpec::Core::Formatters::HtmlPrinter
def make_backtrace_clickable(backtrace)
backtrace.gsub!(/(^.*?):(\d+):(.*)/) do
path, line, rest = $1, $2, $3
url = "txmt://open?url=file://#{CGI::escape(File.expand_path(path))}&line=#{$2}"
link_text = "#{path}:#{line}"
- "<a href='#{CGI::h(url)}'>#{CGI::h(link_text)}</a>:#{CGI.h(rest)}"
? ^^ ^^
+ "<a href='#{CGI.escape_html(url)}'>#{CGI.escape_html(link_text)}</a>:#{CGI.escape_html(rest)}"
? ^^^^^^^^ +++ ^^^^^^^^ +++ +++++++ +++
end
end
def print_example_failed(pending_fixed, description, run_time, failure_id, exception, extra_content, escape_backtrace = false)
exception[:backtrace] = make_backtrace_clickable(exception[:backtrace])
# Call original implementation, but pass false for `escape_backtrace`
super(pending_fixed, description, run_time, failure_id, exception, extra_content, false)
end
end
class TextMateFormatter < RSpec::Core::Formatters::HtmlFormatter
RSpec::Core::Formatters.register self, *RSpec::Core::Formatters::Loader.formatters[superclass]
def initialize(output)
super
@printer = HtmlPrinterWithClickableBacktrace.new(output)
end
end
end
end
end | 2 | 0.057143 | 1 | 1 |
a388b37c1a6c48271d9c0d6be26d3fea6fd39927 | test/unit/helpers/locations_options_helper_test.rb | test/unit/helpers/locations_options_helper_test.rb | require "test_helper"
class LocationsOptionsTest < ActionView::TestCase
include LocationsOptionsHelper
test "#locations_options returns locations options with the default selected" do
location = create(:world_location, :translated)
option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options)
option_set.css("option")[0].tap do |option|
assert_equal "selected", option.attributes["selected"].value
assert_equal "All locations", option.text
assert_equal "all", option["value"]
end
option_set.css("option")[1].tap do |option|
assert_equal nil, option.attributes["selected"]
assert_equal location.name, option.text
assert_equal location.slug, option["value"]
end
end
test "#locations_options returns locations options with the selected options" do
location = create(:world_location)
option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options([location]))
option_set.css("option")[0].tap do |option|
assert_equal nil, option.attributes["selected"]
assert_equal "All locations", option.text
assert_equal "all", option["value"]
end
option_set.css("option")[1].tap do |option|
assert_equal "selected", option.attributes["selected"].value
assert_equal location.name, option.text
assert_equal location.slug, option["value"]
end
end
end
| require "test_helper"
class LocationsOptionsTest < ActionView::TestCase
include LocationsOptionsHelper
test "#locations_options returns locations options with the default selected" do
location = create(:world_location, :translated)
option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options)
option_set.css("option")[0].tap do |option|
assert_equal "selected", option.attributes["selected"].value
assert_equal "All locations", option.text
assert_equal "all", option["value"]
end
option_set.css("option")[1].tap do |option|
assert_nil option.attributes["selected"]
assert_equal location.name, option.text
assert_equal location.slug, option["value"]
end
end
test "#locations_options returns locations options with the selected options" do
location = create(:world_location)
option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options([location]))
option_set.css("option")[0].tap do |option|
assert_nil option.attributes["selected"]
assert_equal "All locations", option.text
assert_equal "all", option["value"]
end
option_set.css("option")[1].tap do |option|
assert_equal "selected", option.attributes["selected"].value
assert_equal location.name, option.text
assert_equal location.slug, option["value"]
end
end
end
| Fix deprecation calling assert_equal nil | Fix deprecation calling assert_equal nil
Fix the deprecation:
```
DEPRECATED: Use assert_nil if expecting nil from
test/unit/helpers/locations_options_helper_test.rb:17. This will fail in
Minitest 6.
```
| Ruby | mit | alphagov/whitehall,alphagov/whitehall,alphagov/whitehall,alphagov/whitehall | ruby | ## Code Before:
require "test_helper"
class LocationsOptionsTest < ActionView::TestCase
include LocationsOptionsHelper
test "#locations_options returns locations options with the default selected" do
location = create(:world_location, :translated)
option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options)
option_set.css("option")[0].tap do |option|
assert_equal "selected", option.attributes["selected"].value
assert_equal "All locations", option.text
assert_equal "all", option["value"]
end
option_set.css("option")[1].tap do |option|
assert_equal nil, option.attributes["selected"]
assert_equal location.name, option.text
assert_equal location.slug, option["value"]
end
end
test "#locations_options returns locations options with the selected options" do
location = create(:world_location)
option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options([location]))
option_set.css("option")[0].tap do |option|
assert_equal nil, option.attributes["selected"]
assert_equal "All locations", option.text
assert_equal "all", option["value"]
end
option_set.css("option")[1].tap do |option|
assert_equal "selected", option.attributes["selected"].value
assert_equal location.name, option.text
assert_equal location.slug, option["value"]
end
end
end
## Instruction:
Fix deprecation calling assert_equal nil
Fix the deprecation:
```
DEPRECATED: Use assert_nil if expecting nil from
test/unit/helpers/locations_options_helper_test.rb:17. This will fail in
Minitest 6.
```
## Code After:
require "test_helper"
class LocationsOptionsTest < ActionView::TestCase
include LocationsOptionsHelper
test "#locations_options returns locations options with the default selected" do
location = create(:world_location, :translated)
option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options)
option_set.css("option")[0].tap do |option|
assert_equal "selected", option.attributes["selected"].value
assert_equal "All locations", option.text
assert_equal "all", option["value"]
end
option_set.css("option")[1].tap do |option|
assert_nil option.attributes["selected"]
assert_equal location.name, option.text
assert_equal location.slug, option["value"]
end
end
test "#locations_options returns locations options with the selected options" do
location = create(:world_location)
option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options([location]))
option_set.css("option")[0].tap do |option|
assert_nil option.attributes["selected"]
assert_equal "All locations", option.text
assert_equal "all", option["value"]
end
option_set.css("option")[1].tap do |option|
assert_equal "selected", option.attributes["selected"].value
assert_equal location.name, option.text
assert_equal location.slug, option["value"]
end
end
end
| require "test_helper"
class LocationsOptionsTest < ActionView::TestCase
include LocationsOptionsHelper
test "#locations_options returns locations options with the default selected" do
location = create(:world_location, :translated)
option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options)
option_set.css("option")[0].tap do |option|
assert_equal "selected", option.attributes["selected"].value
assert_equal "All locations", option.text
assert_equal "all", option["value"]
end
option_set.css("option")[1].tap do |option|
- assert_equal nil, option.attributes["selected"]
? ------ -
+ assert_nil option.attributes["selected"]
assert_equal location.name, option.text
assert_equal location.slug, option["value"]
end
end
test "#locations_options returns locations options with the selected options" do
location = create(:world_location)
option_set = Nokogiri::HTML::DocumentFragment.parse(locations_options([location]))
option_set.css("option")[0].tap do |option|
- assert_equal nil, option.attributes["selected"]
? ------ -
+ assert_nil option.attributes["selected"]
assert_equal "All locations", option.text
assert_equal "all", option["value"]
end
option_set.css("option")[1].tap do |option|
assert_equal "selected", option.attributes["selected"].value
assert_equal location.name, option.text
assert_equal location.slug, option["value"]
end
end
end | 4 | 0.102564 | 2 | 2 |
bb0898b433318a6efcbe68e8b74b6cf526764d5e | Pharo/PharoJsCoreLibrariesTest/PjObjectTest.class.st | Pharo/PharoJsCoreLibrariesTest/PjObjectTest.class.st | Class {
#name : #PjObjectTest,
#superclass : #PjBridgeTestCase,
#category : #PharoJsCoreLibrariesTest
}
{ #category : #testing }
PjObjectTest >> testPrintString [
self assert: [ Object new printString ] evaluatesTo: 'an Object'.
self assert: [ PjSet new printString ] evaluatesTo: 'a PjSet'.
self assert: [ 'hello world' printString ] evaluatesTo: 'hello world'.
self assert: [ 123 printString ] evaluatesTo: '123'.
self assert: [ true printString ] evaluatesTo: 'true'.
]
| Class {
#name : #PjObjectTest,
#superclass : #PjBridgeTestCase,
#category : #PharoJsCoreLibrariesTest
}
{ #category : #testing }
PjObjectTest >> testNewObjectHasNoEnumeratableKeys [
"This is important for many JS third party libraries"
self assertBlock: [ Object new allEnumeratableKeys isEmpty ] .
]
{ #category : #testing }
PjObjectTest >> testPrintString [
self assert: [ Object new printString ] evaluatesTo: 'an Object'.
self assert: [ PjSet new printString ] evaluatesTo: 'a PjSet'.
self assert: [ 'hello world' printString ] evaluatesTo: 'hello world'.
self assert: [ 123 printString ] evaluatesTo: '123'.
self assert: [ true printString ] evaluatesTo: 'true'.
]
| Test that new objects (Object new) have no enumeratable keys neitehr owned nor inherited | Test that new objects (Object new) have no enumeratable keys neitehr owned nor inherited | Smalltalk | mit | bouraqadi/PharoJS,bouraqadi/PharoJS,bouraqadi/PharoJS | smalltalk | ## Code Before:
Class {
#name : #PjObjectTest,
#superclass : #PjBridgeTestCase,
#category : #PharoJsCoreLibrariesTest
}
{ #category : #testing }
PjObjectTest >> testPrintString [
self assert: [ Object new printString ] evaluatesTo: 'an Object'.
self assert: [ PjSet new printString ] evaluatesTo: 'a PjSet'.
self assert: [ 'hello world' printString ] evaluatesTo: 'hello world'.
self assert: [ 123 printString ] evaluatesTo: '123'.
self assert: [ true printString ] evaluatesTo: 'true'.
]
## Instruction:
Test that new objects (Object new) have no enumeratable keys neitehr owned nor inherited
## Code After:
Class {
#name : #PjObjectTest,
#superclass : #PjBridgeTestCase,
#category : #PharoJsCoreLibrariesTest
}
{ #category : #testing }
PjObjectTest >> testNewObjectHasNoEnumeratableKeys [
"This is important for many JS third party libraries"
self assertBlock: [ Object new allEnumeratableKeys isEmpty ] .
]
{ #category : #testing }
PjObjectTest >> testPrintString [
self assert: [ Object new printString ] evaluatesTo: 'an Object'.
self assert: [ PjSet new printString ] evaluatesTo: 'a PjSet'.
self assert: [ 'hello world' printString ] evaluatesTo: 'hello world'.
self assert: [ 123 printString ] evaluatesTo: '123'.
self assert: [ true printString ] evaluatesTo: 'true'.
]
| Class {
#name : #PjObjectTest,
#superclass : #PjBridgeTestCase,
#category : #PharoJsCoreLibrariesTest
}
+
+ { #category : #testing }
+ PjObjectTest >> testNewObjectHasNoEnumeratableKeys [
+ "This is important for many JS third party libraries"
+ self assertBlock: [ Object new allEnumeratableKeys isEmpty ] .
+
+ ]
{ #category : #testing }
PjObjectTest >> testPrintString [
self assert: [ Object new printString ] evaluatesTo: 'an Object'.
self assert: [ PjSet new printString ] evaluatesTo: 'a PjSet'.
self assert: [ 'hello world' printString ] evaluatesTo: 'hello world'.
self assert: [ 123 printString ] evaluatesTo: '123'.
self assert: [ true printString ] evaluatesTo: 'true'.
] | 7 | 0.4375 | 7 | 0 |
4848dfc9e965f7f82eb1f7aa4d90e8b39489a6a0 | recipes/pyglet/display_import_tests.py | recipes/pyglet/display_import_tests.py |
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
|
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
print('Importing {}'.format(module))
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
| Add a tiny bit of output | Add a tiny bit of output
| Python | bsd-3-clause | data-exp-lab/staged-recipes,Savvysherpa/staged-recipes,hbredin/staged-recipes,tylere/staged-recipes,johannesring/staged-recipes,shadowwalkersb/staged-recipes,kwilcox/staged-recipes,mcernak/staged-recipes,rvalieris/staged-recipes,barkls/staged-recipes,johanneskoester/staged-recipes,birdsarah/staged-recipes,rmcgibbo/staged-recipes,bmabey/staged-recipes,hadim/staged-recipes,caspervdw/staged-recipes,caspervdw/staged-recipes,dschreij/staged-recipes,guillochon/staged-recipes,atedstone/staged-recipes,koverholt/staged-recipes,larray-project/staged-recipes,hajapy/staged-recipes,isuruf/staged-recipes,gqmelo/staged-recipes,chrisburr/staged-recipes,NOAA-ORR-ERD/staged-recipes,mcs07/staged-recipes,conda-forge/staged-recipes,pstjohn/staged-recipes,grlee77/staged-recipes,igortg/staged-recipes,jochym/staged-recipes,jakirkham/staged-recipes,rmcgibbo/staged-recipes,asmeurer/staged-recipes,jcb91/staged-recipes,OpenPIV/staged-recipes,data-exp-lab/staged-recipes,benvandyke/staged-recipes,goanpeca/staged-recipes,tylere/staged-recipes,khallock/staged-recipes,stuertz/staged-recipes,pmlandwehr/staged-recipes,cpaulik/staged-recipes,nicoddemus/staged-recipes,planetarypy/staged-recipes,mcernak/staged-recipes,ceholden/staged-recipes,pstjohn/staged-recipes,sodre/staged-recipes,hadim/staged-recipes,basnijholt/staged-recipes,patricksnape/staged-recipes,scopatz/staged-recipes,glemaitre/staged-recipes,mariusvniekerk/staged-recipes,rolando-contrib/staged-recipes,planetarypy/staged-recipes,bmabey/staged-recipes,mcs07/staged-recipes,NOAA-ORR-ERD/staged-recipes,basnijholt/staged-recipes,goanpeca/staged-recipes,sodre/staged-recipes,hajapy/staged-recipes,SylvainCorlay/staged-recipes,shadowwalkersb/staged-recipes,dfroger/staged-recipes,ReimarBauer/staged-recipes,gqmelo/staged-recipes,jcb91/staged-recipes,stuertz/staged-recipes,chohner/staged-recipes,asmeurer/staged-recipes,scopatz/staged-recipes,patricksnape/staged-recipes,richardotis/staged-recipes,valgur/staged-recipes,JohnGreeley/staged-recipes,richardotis/staged-recipes,blowekamp/staged-recipes,sannykr/staged-recipes,dschreij/staged-recipes,kwilcox/staged-recipes,petrushy/staged-recipes,petrushy/staged-recipes,koverholt/staged-recipes,jerowe/staged-recipes,chrisburr/staged-recipes,benvandyke/staged-recipes,dharhas/staged-recipes,ocefpaf/staged-recipes,guillochon/staged-recipes,Cashalow/staged-recipes,jjhelmus/staged-recipes,sodre/staged-recipes,rvalieris/staged-recipes,blowekamp/staged-recipes,Cashalow/staged-recipes,jochym/staged-recipes,johannesring/staged-recipes,grlee77/staged-recipes,atedstone/staged-recipes,vamega/staged-recipes,SylvainCorlay/staged-recipes,vamega/staged-recipes,cpaulik/staged-recipes,glemaitre/staged-recipes,barkls/staged-recipes,conda-forge/staged-recipes,larray-project/staged-recipes,dfroger/staged-recipes,mariusvniekerk/staged-recipes,Juanlu001/staged-recipes,chohner/staged-recipes,rolando-contrib/staged-recipes,ceholden/staged-recipes,jerowe/staged-recipes,JohnGreeley/staged-recipes,OpenPIV/staged-recipes,khallock/staged-recipes,johanneskoester/staged-recipes,ocefpaf/staged-recipes,ReimarBauer/staged-recipes,isuruf/staged-recipes,Juanlu001/staged-recipes,nicoddemus/staged-recipes,synapticarbors/staged-recipes,jjhelmus/staged-recipes,Savvysherpa/staged-recipes,pmlandwehr/staged-recipes,hbredin/staged-recipes,sannykr/staged-recipes,synapticarbors/staged-recipes,dharhas/staged-recipes,jakirkham/staged-recipes,igortg/staged-recipes,birdsarah/staged-recipes,valgur/staged-recipes | python | ## Code Before:
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
## Instruction:
Add a tiny bit of output
## Code After:
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
print('Importing {}'.format(module))
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa')
|
test_imports = [
'pyglet.font',
'pyglet.gl',
'pyglet.graphics',
'pyglet.image',
'pyglet.image.codecs',
'pyglet.input',
'pyglet.media',
'pyglet.media.drivers',
'pyglet.media.drivers.directsound',
'pyglet.window',
'pyglet.text',
'pyglet.text.formats',
]
def expected_fail(module):
try:
+ print('Importing {}'.format(module))
__import__(module)
except Exception as e:
# Yes, make the exception general, because we can't import the specific
# exception on linux without an actual display. Look at the source
# code if you want to see why.
assert 'No standard config is available.' in str(e)
# Handle an import that should only happen on linux and requires
# a display.
for module in test_imports:
expected_fail(module)
import sys
if sys.platform.startswith('linux'):
expected_fail('pyglet.window.xlib')
# And another import that is expected to fail in...
if sys.platform == 'darwin':
expected_fail('pyglet.window.cocoa') | 1 | 0.025 | 1 | 0 |
cd47cca5f12152777fc03431d291a27015c60e17 | app/src/main/java/com/satsumasoftware/timetable/framework/Assignment.kt | app/src/main/java/com/satsumasoftware/timetable/framework/Assignment.kt | package com.satsumasoftware.timetable.framework
import org.threeten.bp.LocalDate
class Assignment(val id: Int, val classId: Int, val title: String, val detail: String,
val dueDate: LocalDate)
| package com.satsumasoftware.timetable.framework
import org.threeten.bp.LocalDate
class Assignment(val id: Int, val classId: Int, val title: String, val detail: String,
val dueDate: LocalDate, val completionProgress: Int)
| Add a property for recording completion progress of assignments | Add a property for recording completion progress of assignments
| Kotlin | apache-2.0 | FarbodSalamat-Zadeh/TimetableApp,FarbodSalamat-Zadeh/TimetableApp | kotlin | ## Code Before:
package com.satsumasoftware.timetable.framework
import org.threeten.bp.LocalDate
class Assignment(val id: Int, val classId: Int, val title: String, val detail: String,
val dueDate: LocalDate)
## Instruction:
Add a property for recording completion progress of assignments
## Code After:
package com.satsumasoftware.timetable.framework
import org.threeten.bp.LocalDate
class Assignment(val id: Int, val classId: Int, val title: String, val detail: String,
val dueDate: LocalDate, val completionProgress: Int)
| package com.satsumasoftware.timetable.framework
import org.threeten.bp.LocalDate
class Assignment(val id: Int, val classId: Int, val title: String, val detail: String,
- val dueDate: LocalDate)
+ val dueDate: LocalDate, val completionProgress: Int) | 2 | 0.333333 | 1 | 1 |
493b13dd49f7d1e954f83aff9aa3e56f5b82aa54 | client/index.html | client/index.html | <head>
<title>Bánh Chưng Xanh - Nâu Studio</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,600&subset=latin,vietnamese' rel='stylesheet' type='text/css'>
<meta property="og:url" content="http://demo.naustud.io:3000" />
<meta property="og:title" content="Bánh Chưng Xanh" />
<meta property="og:description" content="" />
<meta property="og:image" content="" />
</head>
<template name="ApplicationLayout">
{{> Challenge }}
{{> Menu }}
{{> Header }}
{{> yield }}
{{> Login}}
{{> ModalStatus}}
</template>
| <head>
<title>Bánh Chưng Xanh - Nâu Studio</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,600&subset=latin,vietnamese' rel='stylesheet' type='text/css'>
<meta property="og:url" content="http://demo.naustud.io:3000" />
<meta property="og:title" content="Bánh Chưng Xanh" />
<meta property="og:description" content="Bánh Chưng Xanh là trò chơi logic đơn giản nhưng cũng khó nhằn cho những ai thiếu kiên nhẫn. Bạn có đủ tinh tế để chấp nhận thử thách của chúng tôi không?" />
<meta property="og:image" content="http://demo.naustud.io:3000/img/character2x/main-character.png" />
</head>
<template name="ApplicationLayout">
{{> Challenge }}
{{> Menu }}
{{> Header }}
{{> yield }}
{{> Login}}
{{> ModalStatus}}
</template>
| Update temporary FB sharing metadata | Update temporary FB sharing metadata
| HTML | mit | naustudio/banh-chung-xanh,naustudio/banh-chung-xanh,naustudio/banh-chung-xanh | html | ## Code Before:
<head>
<title>Bánh Chưng Xanh - Nâu Studio</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,600&subset=latin,vietnamese' rel='stylesheet' type='text/css'>
<meta property="og:url" content="http://demo.naustud.io:3000" />
<meta property="og:title" content="Bánh Chưng Xanh" />
<meta property="og:description" content="" />
<meta property="og:image" content="" />
</head>
<template name="ApplicationLayout">
{{> Challenge }}
{{> Menu }}
{{> Header }}
{{> yield }}
{{> Login}}
{{> ModalStatus}}
</template>
## Instruction:
Update temporary FB sharing metadata
## Code After:
<head>
<title>Bánh Chưng Xanh - Nâu Studio</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,600&subset=latin,vietnamese' rel='stylesheet' type='text/css'>
<meta property="og:url" content="http://demo.naustud.io:3000" />
<meta property="og:title" content="Bánh Chưng Xanh" />
<meta property="og:description" content="Bánh Chưng Xanh là trò chơi logic đơn giản nhưng cũng khó nhằn cho những ai thiếu kiên nhẫn. Bạn có đủ tinh tế để chấp nhận thử thách của chúng tôi không?" />
<meta property="og:image" content="http://demo.naustud.io:3000/img/character2x/main-character.png" />
</head>
<template name="ApplicationLayout">
{{> Challenge }}
{{> Menu }}
{{> Header }}
{{> yield }}
{{> Login}}
{{> ModalStatus}}
</template>
| <head>
<title>Bánh Chưng Xanh - Nâu Studio</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,600&subset=latin,vietnamese' rel='stylesheet' type='text/css'>
<meta property="og:url" content="http://demo.naustud.io:3000" />
<meta property="og:title" content="Bánh Chưng Xanh" />
- <meta property="og:description" content="" />
- <meta property="og:image" content="" />
+ <meta property="og:description" content="Bánh Chưng Xanh là trò chơi logic đơn giản nhưng cũng khó nhằn cho những ai thiếu kiên nhẫn. Bạn có đủ tinh tế để chấp nhận thử thách của chúng tôi không?" />
+ <meta property="og:image" content="http://demo.naustud.io:3000/img/character2x/main-character.png" />
</head>
<template name="ApplicationLayout">
{{> Challenge }}
{{> Menu }}
{{> Header }}
{{> yield }}
{{> Login}}
{{> ModalStatus}}
</template> | 4 | 0.210526 | 2 | 2 |
0ac024b32c50b19e5a88e6e6053d5ef57942742f | README.md | README.md |
A flowchart builder for programming our hardware DSP project.
To set up the development environment, download Qt: http://www.qt.io/download-open-source/
|
A flowchart builder for programming our hardware DSP project.
## Installing the dev environment
### On windows:
- Install Qt
- Download: http://www.qt.io/download-open-source/
- At minimum, install the latest version of Qt 5.5 for MinGW with OpenGL, and the latest version of MinGW in Tools (unless you already have MinGW).
- Get the repository using git (https://git-scm.com/downloads)
#### Building from command line (first time)
- Set up Path
- For permanent setup, add two entries to the Path variable: `C:\path_to_Qt\5.5\mingw492_32\bin` and `C:\path_to_Qt\Tools\mingw492_32\bin`
- Otherwise, you can temporarily set up the path for the current terminal by running `"C:\path_to_Qt\5.5\mingw492_32\bin\qtenv2.bat"`
- In the repo directory:
```
mkdir build
cd build
qmake ..\SignalCraft.pro -r
mingw32-make
```
- Executible ends up in `build/release`
#### Building with the Qt Creator IDE (first time)
- Open Qt Creator
- Click "Open Project", and navigate to SignalCraft.pro
- In the "Configure Project" dialog, a kit called "Desktop Qt 5.5.X MinGW 32bit" should be set up for you. Otherwise you will have to set it up manually by navigating to qmake and g++ inside the Qt install directory.
- You can modify the default build directories by clicking "Details"
- Click "Configure Project" and everything should work as expected
### On Debian/Ubuntu/Mint (apt-get)
- Run `sudo apt-get install build-essential libgl1-mesa-dev qtdeclarative5-devq`
- Get the repository using git (`sudo apt-get install git`)
#### Building from the command line
- In the repo directory
```
mkdir build
cd build
qmake ../SignalCraft.pro -r
make
```
#### Building with the Qt Creator IDE
- Don't even bother with this on linux
| Add detailed dev environment instructions | Add detailed dev environment instructions | Markdown | mit | SignalCraft/SignalCraft-Designer,SignalCraft/SignalCraft-Designer,UnnamedCompany/UnnamedSoftware,UnnamedCompany/UnnamedSoftware | markdown | ## Code Before:
A flowchart builder for programming our hardware DSP project.
To set up the development environment, download Qt: http://www.qt.io/download-open-source/
## Instruction:
Add detailed dev environment instructions
## Code After:
A flowchart builder for programming our hardware DSP project.
## Installing the dev environment
### On windows:
- Install Qt
- Download: http://www.qt.io/download-open-source/
- At minimum, install the latest version of Qt 5.5 for MinGW with OpenGL, and the latest version of MinGW in Tools (unless you already have MinGW).
- Get the repository using git (https://git-scm.com/downloads)
#### Building from command line (first time)
- Set up Path
- For permanent setup, add two entries to the Path variable: `C:\path_to_Qt\5.5\mingw492_32\bin` and `C:\path_to_Qt\Tools\mingw492_32\bin`
- Otherwise, you can temporarily set up the path for the current terminal by running `"C:\path_to_Qt\5.5\mingw492_32\bin\qtenv2.bat"`
- In the repo directory:
```
mkdir build
cd build
qmake ..\SignalCraft.pro -r
mingw32-make
```
- Executible ends up in `build/release`
#### Building with the Qt Creator IDE (first time)
- Open Qt Creator
- Click "Open Project", and navigate to SignalCraft.pro
- In the "Configure Project" dialog, a kit called "Desktop Qt 5.5.X MinGW 32bit" should be set up for you. Otherwise you will have to set it up manually by navigating to qmake and g++ inside the Qt install directory.
- You can modify the default build directories by clicking "Details"
- Click "Configure Project" and everything should work as expected
### On Debian/Ubuntu/Mint (apt-get)
- Run `sudo apt-get install build-essential libgl1-mesa-dev qtdeclarative5-devq`
- Get the repository using git (`sudo apt-get install git`)
#### Building from the command line
- In the repo directory
```
mkdir build
cd build
qmake ../SignalCraft.pro -r
make
```
#### Building with the Qt Creator IDE
- Don't even bother with this on linux
|
A flowchart builder for programming our hardware DSP project.
- To set up the development environment, download Qt: http://www.qt.io/download-open-source/
+ ## Installing the dev environment
+
+ ### On windows:
+ - Install Qt
+ - Download: http://www.qt.io/download-open-source/
+ - At minimum, install the latest version of Qt 5.5 for MinGW with OpenGL, and the latest version of MinGW in Tools (unless you already have MinGW).
+ - Get the repository using git (https://git-scm.com/downloads)
+
+ #### Building from command line (first time)
+ - Set up Path
+ - For permanent setup, add two entries to the Path variable: `C:\path_to_Qt\5.5\mingw492_32\bin` and `C:\path_to_Qt\Tools\mingw492_32\bin`
+ - Otherwise, you can temporarily set up the path for the current terminal by running `"C:\path_to_Qt\5.5\mingw492_32\bin\qtenv2.bat"`
+ - In the repo directory:
+ ```
+ mkdir build
+ cd build
+ qmake ..\SignalCraft.pro -r
+ mingw32-make
+ ```
+ - Executible ends up in `build/release`
+
+ #### Building with the Qt Creator IDE (first time)
+ - Open Qt Creator
+ - Click "Open Project", and navigate to SignalCraft.pro
+ - In the "Configure Project" dialog, a kit called "Desktop Qt 5.5.X MinGW 32bit" should be set up for you. Otherwise you will have to set it up manually by navigating to qmake and g++ inside the Qt install directory.
+ - You can modify the default build directories by clicking "Details"
+ - Click "Configure Project" and everything should work as expected
+
+ ### On Debian/Ubuntu/Mint (apt-get)
+
+ - Run `sudo apt-get install build-essential libgl1-mesa-dev qtdeclarative5-devq`
+ - Get the repository using git (`sudo apt-get install git`)
+
+ #### Building from the command line
+
+ - In the repo directory
+ ```
+ mkdir build
+ cd build
+ qmake ../SignalCraft.pro -r
+ make
+ ```
+
+ #### Building with the Qt Creator IDE
+
+ - Don't even bother with this on linux | 47 | 11.75 | 46 | 1 |
aa18c9ab391d8549e4b50f4009325fbd56074c48 | lib/merged_tree.js | lib/merged_tree.js | var RSVP = require('rsvp')
var temp = require('temp')
temp.track()
var helpers = require('./helpers')
exports.MergedTree = MergedTree
function MergedTree (trees) {
this._trees = trees
}
MergedTree.prototype.read = function (readTree) {
var destDir = temp.mkdirSync({
prefix: 'broccoli-merged-tree-',
suffix: '.tmp',
dir: process.cwd()
})
return this._trees.reduce(function (promise, tree) {
return promise
.then(function () {
return readTree(tree)
})
.then(function (treeDir) {
helpers.linkRecursivelySync(treeDir, destDir)
})
}, RSVP.resolve())
.then(function () {
return destDir
})
}
| var RSVP = require('rsvp')
var temp = require('temp')
temp.track()
var rimraf = require('rimraf')
var helpers = require('./helpers')
exports.MergedTree = MergedTree
function MergedTree (trees) {
this._trees = trees
}
MergedTree.prototype.read = function (readTree) {
var self = this
this._destDirThatWillBeDeleted = temp.mkdirSync({
prefix: 'broccoli-merged-tree-',
suffix: '.tmp',
dir: process.cwd()
})
return this._trees.reduce(function (promise, tree) {
return promise
.then(function () {
return readTree(tree)
})
.then(function (treeDir) {
helpers.linkRecursivelySync(treeDir, self._destDirThatWillBeDeleted)
})
}, RSVP.resolve())
.then(function () {
return self._destDirThatWillBeDeleted
})
}
MergedTree.prototype.afterBuild = function () {
if (this._destDirThatWillBeDeleted == null) {
throw new Error('Expected to have MergedTree::_destDirThatWillBeDeleted set')
}
rimraf.sync(this._destDirThatWillBeDeleted)
}
| Add afterBuild cleanup for MergedTree | Add afterBuild cleanup for MergedTree
| JavaScript | mit | broccolijs/broccoli,broccolijs/broccoli,gabesoft/broccoli,osxi/broccoli,ixisystems/broccoli,osxi/broccoli,broccolijs/broccoli,osxi/broccoli,jnicklas/broccoli,ember-cli/broccoli,broccolijs/broccoli,gabesoft/broccoli,ixisystems/broccoli,gabesoft/broccoli,ember-cli/broccoli,rwjblue/broccoli,ember-cli/broccoli | javascript | ## Code Before:
var RSVP = require('rsvp')
var temp = require('temp')
temp.track()
var helpers = require('./helpers')
exports.MergedTree = MergedTree
function MergedTree (trees) {
this._trees = trees
}
MergedTree.prototype.read = function (readTree) {
var destDir = temp.mkdirSync({
prefix: 'broccoli-merged-tree-',
suffix: '.tmp',
dir: process.cwd()
})
return this._trees.reduce(function (promise, tree) {
return promise
.then(function () {
return readTree(tree)
})
.then(function (treeDir) {
helpers.linkRecursivelySync(treeDir, destDir)
})
}, RSVP.resolve())
.then(function () {
return destDir
})
}
## Instruction:
Add afterBuild cleanup for MergedTree
## Code After:
var RSVP = require('rsvp')
var temp = require('temp')
temp.track()
var rimraf = require('rimraf')
var helpers = require('./helpers')
exports.MergedTree = MergedTree
function MergedTree (trees) {
this._trees = trees
}
MergedTree.prototype.read = function (readTree) {
var self = this
this._destDirThatWillBeDeleted = temp.mkdirSync({
prefix: 'broccoli-merged-tree-',
suffix: '.tmp',
dir: process.cwd()
})
return this._trees.reduce(function (promise, tree) {
return promise
.then(function () {
return readTree(tree)
})
.then(function (treeDir) {
helpers.linkRecursivelySync(treeDir, self._destDirThatWillBeDeleted)
})
}, RSVP.resolve())
.then(function () {
return self._destDirThatWillBeDeleted
})
}
MergedTree.prototype.afterBuild = function () {
if (this._destDirThatWillBeDeleted == null) {
throw new Error('Expected to have MergedTree::_destDirThatWillBeDeleted set')
}
rimraf.sync(this._destDirThatWillBeDeleted)
}
| var RSVP = require('rsvp')
var temp = require('temp')
temp.track()
+ var rimraf = require('rimraf')
var helpers = require('./helpers')
exports.MergedTree = MergedTree
function MergedTree (trees) {
this._trees = trees
}
MergedTree.prototype.read = function (readTree) {
- var destDir = temp.mkdirSync({
+ var self = this
+
+ this._destDirThatWillBeDeleted = temp.mkdirSync({
prefix: 'broccoli-merged-tree-',
suffix: '.tmp',
dir: process.cwd()
})
return this._trees.reduce(function (promise, tree) {
return promise
.then(function () {
return readTree(tree)
})
.then(function (treeDir) {
- helpers.linkRecursivelySync(treeDir, destDir)
+ helpers.linkRecursivelySync(treeDir, self._destDirThatWillBeDeleted)
? ++++++ +++++++++++++++++
})
}, RSVP.resolve())
.then(function () {
- return destDir
+ return self._destDirThatWillBeDeleted
})
}
+
+ MergedTree.prototype.afterBuild = function () {
+ if (this._destDirThatWillBeDeleted == null) {
+ throw new Error('Expected to have MergedTree::_destDirThatWillBeDeleted set')
+ }
+ rimraf.sync(this._destDirThatWillBeDeleted)
+ } | 16 | 0.5 | 13 | 3 |
4447aedd0b2fa88be5ffa8f0d1aef7e0a9289116 | gulpfile.js/tasks/styles.js | gulpfile.js/tasks/styles.js | var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var config = require('../config').styles;
var autoprefixer = require('gulp-autoprefixer');
gulp.task('styles', function () {
return gulp.src(config.src)
.pipe(sourcemaps.init())
.pipe(sass(config.settings))
.on('error', handleErrors)
.pipe(sourcemaps.write())
.pipe(autoprefixer({ browsers: ['last 2 version'] }))
.pipe(gulp.dest(config.dest))
.pipe(browserSync.reload({stream:true}));
});
| var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var config = require('../config').styles;
var autoprefixer = require('gulp-autoprefixer');
gulp.task('styles', function () {
return gulp.src(config.src)
.pipe(sourcemaps.init())
.pipe(sass(config.settings))
.on('error', handleErrors)
.pipe(autoprefixer({ browsers: ['last 2 version'] }))
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.dest))
.pipe(browserSync.reload({stream:true}));
});
| Include Autoprefixer into sourcemaps process | Include Autoprefixer into sourcemaps process
| JavaScript | mit | Bastly/bastly-tumblr-theme,Bastly/bastly-tumblr-theme | javascript | ## Code Before:
var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var config = require('../config').styles;
var autoprefixer = require('gulp-autoprefixer');
gulp.task('styles', function () {
return gulp.src(config.src)
.pipe(sourcemaps.init())
.pipe(sass(config.settings))
.on('error', handleErrors)
.pipe(sourcemaps.write())
.pipe(autoprefixer({ browsers: ['last 2 version'] }))
.pipe(gulp.dest(config.dest))
.pipe(browserSync.reload({stream:true}));
});
## Instruction:
Include Autoprefixer into sourcemaps process
## Code After:
var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var config = require('../config').styles;
var autoprefixer = require('gulp-autoprefixer');
gulp.task('styles', function () {
return gulp.src(config.src)
.pipe(sourcemaps.init())
.pipe(sass(config.settings))
.on('error', handleErrors)
.pipe(autoprefixer({ browsers: ['last 2 version'] }))
.pipe(sourcemaps.write())
.pipe(gulp.dest(config.dest))
.pipe(browserSync.reload({stream:true}));
});
| var gulp = require('gulp');
var browserSync = require('browser-sync');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var handleErrors = require('../util/handleErrors');
var config = require('../config').styles;
var autoprefixer = require('gulp-autoprefixer');
gulp.task('styles', function () {
return gulp.src(config.src)
.pipe(sourcemaps.init())
.pipe(sass(config.settings))
.on('error', handleErrors)
+ .pipe(autoprefixer({ browsers: ['last 2 version'] }))
.pipe(sourcemaps.write())
- .pipe(autoprefixer({ browsers: ['last 2 version'] }))
.pipe(gulp.dest(config.dest))
.pipe(browserSync.reload({stream:true}));
}); | 2 | 0.111111 | 1 | 1 |
7f04969d76e32c2f40610c9a999e2c44da89abbe | openwrt/patches/229-netifd-add-hostname.patch | openwrt/patches/229-netifd-add-hostname.patch | diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index abfdaaf..290dcc3 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -42,6 +42,7 @@ proto_dhcp_setup() {
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ "$release" = 1 ] && release="-R" || release=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
+ [ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname OpenWrt)"
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
[ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
[ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
| diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index abfdaaf..efebcdb 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -42,6 +42,7 @@ proto_dhcp_setup() {
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ "$release" = 1 ] && release="-R" || release=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
+ [ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname OpenWrt)"
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
[ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
[ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
@@ -56,7 +57,7 @@ proto_dhcp_setup() {
-s /lib/netifd/dhcp.script \
-f -t 0 -i "$iface" \
${ipaddr:+-r $ipaddr} \
- ${hostname:+-H "$hostname"} \
+ ${hostname:+-x hostname:"$hostname"} \
${vendorid:+-V "$vendorid"} \
$clientid $broadcast $release $dhcpopts
}
| Update add hostname patch for compatibility with latest udhcpc | [wrt] Update add hostname patch for compatibility with latest udhcpc
| Diff | mit | shmick/HeaterMeter,CapnBry/HeaterMeter,shmick/HeaterMeter,shmick/HeaterMeter,shmick/HeaterMeter,CapnBry/HeaterMeter,CapnBry/HeaterMeter,CapnBry/HeaterMeter,shmick/HeaterMeter,CapnBry/HeaterMeter,CapnBry/HeaterMeter,shmick/HeaterMeter,shmick/HeaterMeter,CapnBry/HeaterMeter | diff | ## Code Before:
diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index abfdaaf..290dcc3 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -42,6 +42,7 @@ proto_dhcp_setup() {
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ "$release" = 1 ] && release="-R" || release=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
+ [ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname OpenWrt)"
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
[ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
[ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
## Instruction:
[wrt] Update add hostname patch for compatibility with latest udhcpc
## Code After:
diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
index abfdaaf..efebcdb 100755
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -42,6 +42,7 @@ proto_dhcp_setup() {
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ "$release" = 1 ] && release="-R" || release=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
+ [ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname OpenWrt)"
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
[ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
[ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
@@ -56,7 +57,7 @@ proto_dhcp_setup() {
-s /lib/netifd/dhcp.script \
-f -t 0 -i "$iface" \
${ipaddr:+-r $ipaddr} \
- ${hostname:+-H "$hostname"} \
+ ${hostname:+-x hostname:"$hostname"} \
${vendorid:+-V "$vendorid"} \
$clientid $broadcast $release $dhcpopts
}
| diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
- index abfdaaf..290dcc3 100755
? ^^^ ^^^
+ index abfdaaf..efebcdb 100755
? ^^^^^ ^
--- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
+++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
@@ -42,6 +42,7 @@ proto_dhcp_setup() {
[ "$broadcast" = 1 ] && broadcast="-B" || broadcast=
[ "$release" = 1 ] && release="-R" || release=
[ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"
+ [ -z "$hostname" ] && hostname="$(uci_get system @system[0] hostname OpenWrt)"
[ -n "$iface6rd" ] && proto_export "IFACE6RD=$iface6rd"
[ "$iface6rd" != 0 -a -f /lib/netifd/proto/6rd.sh ] && append dhcpopts "-O 212"
[ -n "$zone6rd" ] && proto_export "ZONE6RD=$zone6rd"
+ @@ -56,7 +57,7 @@ proto_dhcp_setup() {
+ -s /lib/netifd/dhcp.script \
+ -f -t 0 -i "$iface" \
+ ${ipaddr:+-r $ipaddr} \
+ - ${hostname:+-H "$hostname"} \
+ + ${hostname:+-x hostname:"$hostname"} \
+ ${vendorid:+-V "$vendorid"} \
+ $clientid $broadcast $release $dhcpopts
+ } | 11 | 0.916667 | 10 | 1 |
15109316c573ec29801a7d1b11ad008a5fd4c410 | src/apps/adviser/repos.js | src/apps/adviser/repos.js | const { get } = require('lodash')
const config = require('../../../config')
const { authorisedRequest } = require('../../lib/authorised-request')
function getAdvisers (token) {
return authorisedRequest(token, `${config.apiRoot}/adviser/?limit=100000&offset=0`)
.then(response => {
const results = response.results.filter(adviser => get(adviser, 'name', '').trim().length)
return {
results,
count: results.length,
}
})
}
function getAdviser (token, id) {
return authorisedRequest(token, `${config.apiRoot}/adviser/${id}/`)
}
async function fetchAdviserSearchResults (token, params) {
const url = `${config.apiRoot}/adviser/?autocomplete=${params.term}&is_active=${params.is_active}`
const adviserResults = await authorisedRequest(token, { url })
return adviserResults.results
}
module.exports = {
getAdvisers,
getAdviser,
fetchAdviserSearchResults,
}
| const { get } = require('lodash')
const config = require('../../../config')
const { authorisedRequest } = require('../../lib/authorised-request')
function getAdvisers (token) {
return authorisedRequest(token, `${config.apiRoot}/adviser/?limit=100000&offset=0`)
.then(response => {
const results = response.results.filter(adviser => get(adviser, 'name', '').trim().length)
return {
results,
count: results.length,
}
})
}
function getAdviser (token, id) {
return authorisedRequest(token, `${config.apiRoot}/adviser/${id}/`)
}
async function fetchAdviserSearchResults (token, params) {
const url = `${config.apiRoot}/adviser/?autocomplete=${params.term}`
const adviserResults = await authorisedRequest(token, { url })
return adviserResults.results
}
module.exports = {
getAdvisers,
getAdviser,
fetchAdviserSearchResults,
}
| Remove the param to filter inactive advisers | Remove the param to filter inactive advisers
| JavaScript | mit | uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2 | javascript | ## Code Before:
const { get } = require('lodash')
const config = require('../../../config')
const { authorisedRequest } = require('../../lib/authorised-request')
function getAdvisers (token) {
return authorisedRequest(token, `${config.apiRoot}/adviser/?limit=100000&offset=0`)
.then(response => {
const results = response.results.filter(adviser => get(adviser, 'name', '').trim().length)
return {
results,
count: results.length,
}
})
}
function getAdviser (token, id) {
return authorisedRequest(token, `${config.apiRoot}/adviser/${id}/`)
}
async function fetchAdviserSearchResults (token, params) {
const url = `${config.apiRoot}/adviser/?autocomplete=${params.term}&is_active=${params.is_active}`
const adviserResults = await authorisedRequest(token, { url })
return adviserResults.results
}
module.exports = {
getAdvisers,
getAdviser,
fetchAdviserSearchResults,
}
## Instruction:
Remove the param to filter inactive advisers
## Code After:
const { get } = require('lodash')
const config = require('../../../config')
const { authorisedRequest } = require('../../lib/authorised-request')
function getAdvisers (token) {
return authorisedRequest(token, `${config.apiRoot}/adviser/?limit=100000&offset=0`)
.then(response => {
const results = response.results.filter(adviser => get(adviser, 'name', '').trim().length)
return {
results,
count: results.length,
}
})
}
function getAdviser (token, id) {
return authorisedRequest(token, `${config.apiRoot}/adviser/${id}/`)
}
async function fetchAdviserSearchResults (token, params) {
const url = `${config.apiRoot}/adviser/?autocomplete=${params.term}`
const adviserResults = await authorisedRequest(token, { url })
return adviserResults.results
}
module.exports = {
getAdvisers,
getAdviser,
fetchAdviserSearchResults,
}
| const { get } = require('lodash')
const config = require('../../../config')
const { authorisedRequest } = require('../../lib/authorised-request')
function getAdvisers (token) {
return authorisedRequest(token, `${config.apiRoot}/adviser/?limit=100000&offset=0`)
.then(response => {
const results = response.results.filter(adviser => get(adviser, 'name', '').trim().length)
return {
results,
count: results.length,
}
})
}
function getAdviser (token, id) {
return authorisedRequest(token, `${config.apiRoot}/adviser/${id}/`)
}
async function fetchAdviserSearchResults (token, params) {
- const url = `${config.apiRoot}/adviser/?autocomplete=${params.term}&is_active=${params.is_active}`
? ------------------------------
+ const url = `${config.apiRoot}/adviser/?autocomplete=${params.term}`
const adviserResults = await authorisedRequest(token, { url })
return adviserResults.results
}
module.exports = {
getAdvisers,
getAdviser,
fetchAdviserSearchResults,
} | 2 | 0.064516 | 1 | 1 |
caeec46397ed024cc7790652e8ae063deb0377ad | icekit/project_template/docker-compose.yml | icekit/project_template/docker-compose.yml | version: "2"
services:
celery:
command: entrypoint.sh celery -A icekit.project worker -l info
extends: django
celerybeat:
command: entrypoint.sh celery -A icekit.project beat -l info -S djcelery.schedulers.DatabaseScheduler --pidfile=
extends: django
celeryflower:
command: entrypoint.sh celery -A icekit.project flower
extends: django
django:
command: entrypoint.sh manage.py runserver 0.0.0.0:8000
environment:
BASE_SETTINGS_MODULE: docker
ICEKIT_PROJECT_DIR: /opt/icekit-project
PGHOST: postgres
PGUSER: postgres
image: icekit-project/icekit:latest
tmpfs:
- /tmp
volumes:
- ./:/opt/icekit-project
elasticsearch:
image: interaction/elasticsearch-icu:1
haproxy:
image: dockercloud/haproxy:1.5.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
postgres:
image: onjin/alpine-postgres:9.4
redis:
command: redis-server --appendonly yes
image: redis:3-alpine
| version: "2"
services:
celery:
command: entrypoint.sh celery.sh
extends: django
celerybeat:
command: entrypoint.sh celerybeat.sh
extends: django
celeryflower:
command: entrypoint.sh celeryflower.sh
extends: django
django:
command: entrypoint.sh supervisord.sh
environment:
BASE_SETTINGS_MODULE: docker
ICEKIT_PROJECT_DIR: /opt/icekit-project
PGHOST: postgres
PGUSER: postgres
image: icekit-project/icekit:latest
tmpfs:
- /tmp
volumes:
- ./:/opt/icekit-project
elasticsearch:
image: interaction/elasticsearch-icu:1
haproxy:
image: dockercloud/haproxy:1.5.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
postgres:
image: onjin/alpine-postgres:9.4
redis:
command: redis-server --appendonly yes
image: redis:3-alpine
| Use wrapper scripts for service commands. | Use wrapper scripts for service commands.
| YAML | mit | ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit | yaml | ## Code Before:
version: "2"
services:
celery:
command: entrypoint.sh celery -A icekit.project worker -l info
extends: django
celerybeat:
command: entrypoint.sh celery -A icekit.project beat -l info -S djcelery.schedulers.DatabaseScheduler --pidfile=
extends: django
celeryflower:
command: entrypoint.sh celery -A icekit.project flower
extends: django
django:
command: entrypoint.sh manage.py runserver 0.0.0.0:8000
environment:
BASE_SETTINGS_MODULE: docker
ICEKIT_PROJECT_DIR: /opt/icekit-project
PGHOST: postgres
PGUSER: postgres
image: icekit-project/icekit:latest
tmpfs:
- /tmp
volumes:
- ./:/opt/icekit-project
elasticsearch:
image: interaction/elasticsearch-icu:1
haproxy:
image: dockercloud/haproxy:1.5.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
postgres:
image: onjin/alpine-postgres:9.4
redis:
command: redis-server --appendonly yes
image: redis:3-alpine
## Instruction:
Use wrapper scripts for service commands.
## Code After:
version: "2"
services:
celery:
command: entrypoint.sh celery.sh
extends: django
celerybeat:
command: entrypoint.sh celerybeat.sh
extends: django
celeryflower:
command: entrypoint.sh celeryflower.sh
extends: django
django:
command: entrypoint.sh supervisord.sh
environment:
BASE_SETTINGS_MODULE: docker
ICEKIT_PROJECT_DIR: /opt/icekit-project
PGHOST: postgres
PGUSER: postgres
image: icekit-project/icekit:latest
tmpfs:
- /tmp
volumes:
- ./:/opt/icekit-project
elasticsearch:
image: interaction/elasticsearch-icu:1
haproxy:
image: dockercloud/haproxy:1.5.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
postgres:
image: onjin/alpine-postgres:9.4
redis:
command: redis-server --appendonly yes
image: redis:3-alpine
| version: "2"
services:
celery:
- command: entrypoint.sh celery -A icekit.project worker -l info
+ command: entrypoint.sh celery.sh
extends: django
celerybeat:
- command: entrypoint.sh celery -A icekit.project beat -l info -S djcelery.schedulers.DatabaseScheduler --pidfile=
+ command: entrypoint.sh celerybeat.sh
extends: django
celeryflower:
- command: entrypoint.sh celery -A icekit.project flower
? -------------------
+ command: entrypoint.sh celeryflower.sh
? +++
extends: django
django:
- command: entrypoint.sh manage.py runserver 0.0.0.0:8000
+ command: entrypoint.sh supervisord.sh
environment:
BASE_SETTINGS_MODULE: docker
ICEKIT_PROJECT_DIR: /opt/icekit-project
PGHOST: postgres
PGUSER: postgres
image: icekit-project/icekit:latest
tmpfs:
- /tmp
volumes:
- ./:/opt/icekit-project
elasticsearch:
image: interaction/elasticsearch-icu:1
haproxy:
image: dockercloud/haproxy:1.5.1
volumes:
- /var/run/docker.sock:/var/run/docker.sock
postgres:
image: onjin/alpine-postgres:9.4
redis:
command: redis-server --appendonly yes
image: redis:3-alpine | 8 | 0.235294 | 4 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.