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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3e0addc192f25e01f476ada9f67924f0b28ca594 | tox.ini | tox.ini |
[tox]
envlist = py26, py27, py32, py33, py34, py35, pypy, jython
[testenv]
commands = {envpython} setup.py test
deps =
|
[tox]
# envlist = py26, py27, py32, py33, py34, py35, pypy, jython
envlist = py27, py32, py33, py34, pypy, jython
[testenv]
commands = {envpython} setup.py test
deps =
| Modify the versions to test with for the time being. | Modify the versions to test with for the time being.
| INI | bsd-3-clause | zzzirk/codewords | ini | ## Code Before:
[tox]
envlist = py26, py27, py32, py33, py34, py35, pypy, jython
[testenv]
commands = {envpython} setup.py test
deps =
## Instruction:
Modify the versions to test with for the time being.
## Code After:
[tox]
# envlist = py26, py27, py32, py33, py34, py35, pypy, jython
envlist = py27, py32, py33, py34, pypy, jython
[testenv]
commands = {envpython} setup.py test
deps =
|
[tox]
- envlist = py26, py27, py32, py33, py34, py35, pypy, jython
+ # envlist = py26, py27, py32, py33, py34, py35, pypy, jython
? ++
+ envlist = py27, py32, py33, py34, pypy, jython
[testenv]
commands = {envpython} setup.py test
deps =
| 3 | 0.375 | 2 | 1 |
67c2ac1e322a5e3c58fd769cbc53debe579d4a4c | newbuild.yml | newbuild.yml |
- hosts: all
gather_facts: False
tasks:
- name: Wait for server to be alive
local_action: wait_for port=22 host="{{ ansible_ssh_host | default(inventory_hostname) }}" search_regex=OpenSSH delay=10
become: no
- include: playbook.yml
|
- hosts: all
gather_facts: False
tasks:
- name: Wait for server to be alive
local_action: wait_for port=22 host="{{ ansible_ssh_host | default(inventory_hostname) }}" search_regex=OpenSSH delay=10
become: no
- include: playbook.yml
- include: reboot-patch.yml
| Patch host and reboot on build | Patch host and reboot on build
| YAML | mit | jfautley/ansible-base | yaml | ## Code Before:
- hosts: all
gather_facts: False
tasks:
- name: Wait for server to be alive
local_action: wait_for port=22 host="{{ ansible_ssh_host | default(inventory_hostname) }}" search_regex=OpenSSH delay=10
become: no
- include: playbook.yml
## Instruction:
Patch host and reboot on build
## Code After:
- hosts: all
gather_facts: False
tasks:
- name: Wait for server to be alive
local_action: wait_for port=22 host="{{ ansible_ssh_host | default(inventory_hostname) }}" search_regex=OpenSSH delay=10
become: no
- include: playbook.yml
- include: reboot-patch.yml
|
- hosts: all
gather_facts: False
tasks:
- name: Wait for server to be alive
local_action: wait_for port=22 host="{{ ansible_ssh_host | default(inventory_hostname) }}" search_regex=OpenSSH delay=10
become: no
- include: playbook.yml
+ - include: reboot-patch.yml | 1 | 0.1 | 1 | 0 |
5a3b3144fabe1a21cc5a49f7fb9de3712898c5e7 | src/server/random-users-retriever.js | src/server/random-users-retriever.js | export default class RandomUsersRetriever {
getUsers(numberOfUsers) {
const users = [];
// Add nodes to random parents
for (let i = 0; i < numberOfUsers; i++) {
const user = this.getAppUser(
i,
i === 0 ? null : this._getRandomIntInclusive(0, i)); // eslint-disable-line no-magic-numbers
users.push(user);
}
return Promise.resolve(users);
}
getAppUser(i, managerId) {
const user = {
id: i,
displayName: '{{ displayName }}',
jobTitle: '{{ job_title }}',
department: '{{ department }}',
userPrincipalName: `${i}@example.com`,
city: 'New York',
state: 'NY',
country: 'USA',
email: `${i}@example.com`,
telephoneNumber: '555-555-1212',
manager: managerId ? this.getAppUser(managerId) : null
};
this.counter++;
return user;
}
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
_getRandomIntInclusive(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min; // eslint-disable-line no-magic-numbers
}
}
| /* eslint-disable no-magic-numbers */
export default class RandomUsersRetriever {
getUsers(numberOfUsers, numberOfDepartments = 1) {
const users = [];
// Add nodes to random parents
for (let i = 0; i < numberOfUsers; i++) {
const user = this.getAppUser(
i,
i === 0 ? null : this._getRandomIntInclusive(0, i),
`Department ${this._getRandomIntInclusive(1, numberOfDepartments)}`);
users.push(user);
}
return Promise.resolve(users);
}
getAppUser(i, managerId, department) {
const user = {
id: i,
displayName: '{{ displayName }}',
jobTitle: '{{ job_title }}',
department: department,
userPrincipalName: `${i}@example.com`,
city: 'New York',
state: 'NY',
country: 'USA',
email: `${i}@example.com`,
telephoneNumber: '555-555-1212',
manager: managerId ? this.getAppUser(managerId) : null
};
this.counter++;
return user;
}
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
_getRandomIntInclusive(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
}
| Add configurable numberOfDepartments to RandomUsersRetriever getUsers | Add configurable numberOfDepartments to RandomUsersRetriever getUsers
| JavaScript | mit | ritterim/star-orgs,kendaleiv/star-orgs,kendaleiv/star-orgs,ritterim/star-orgs | javascript | ## Code Before:
export default class RandomUsersRetriever {
getUsers(numberOfUsers) {
const users = [];
// Add nodes to random parents
for (let i = 0; i < numberOfUsers; i++) {
const user = this.getAppUser(
i,
i === 0 ? null : this._getRandomIntInclusive(0, i)); // eslint-disable-line no-magic-numbers
users.push(user);
}
return Promise.resolve(users);
}
getAppUser(i, managerId) {
const user = {
id: i,
displayName: '{{ displayName }}',
jobTitle: '{{ job_title }}',
department: '{{ department }}',
userPrincipalName: `${i}@example.com`,
city: 'New York',
state: 'NY',
country: 'USA',
email: `${i}@example.com`,
telephoneNumber: '555-555-1212',
manager: managerId ? this.getAppUser(managerId) : null
};
this.counter++;
return user;
}
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
_getRandomIntInclusive(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min; // eslint-disable-line no-magic-numbers
}
}
## Instruction:
Add configurable numberOfDepartments to RandomUsersRetriever getUsers
## Code After:
/* eslint-disable no-magic-numbers */
export default class RandomUsersRetriever {
getUsers(numberOfUsers, numberOfDepartments = 1) {
const users = [];
// Add nodes to random parents
for (let i = 0; i < numberOfUsers; i++) {
const user = this.getAppUser(
i,
i === 0 ? null : this._getRandomIntInclusive(0, i),
`Department ${this._getRandomIntInclusive(1, numberOfDepartments)}`);
users.push(user);
}
return Promise.resolve(users);
}
getAppUser(i, managerId, department) {
const user = {
id: i,
displayName: '{{ displayName }}',
jobTitle: '{{ job_title }}',
department: department,
userPrincipalName: `${i}@example.com`,
city: 'New York',
state: 'NY',
country: 'USA',
email: `${i}@example.com`,
telephoneNumber: '555-555-1212',
manager: managerId ? this.getAppUser(managerId) : null
};
this.counter++;
return user;
}
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
_getRandomIntInclusive(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
}
| + /* eslint-disable no-magic-numbers */
+
export default class RandomUsersRetriever {
- getUsers(numberOfUsers) {
+ getUsers(numberOfUsers, numberOfDepartments = 1) {
const users = [];
// Add nodes to random parents
for (let i = 0; i < numberOfUsers; i++) {
const user = this.getAppUser(
i,
- i === 0 ? null : this._getRandomIntInclusive(0, i)); // eslint-disable-line no-magic-numbers
+ i === 0 ? null : this._getRandomIntInclusive(0, i),
+ `Department ${this._getRandomIntInclusive(1, numberOfDepartments)}`);
users.push(user);
}
return Promise.resolve(users);
}
- getAppUser(i, managerId) {
+ getAppUser(i, managerId, department) {
? ++++++++++++
const user = {
id: i,
displayName: '{{ displayName }}',
jobTitle: '{{ job_title }}',
- department: '{{ department }}',
? ---- ----
+ department: department,
userPrincipalName: `${i}@example.com`,
city: 'New York',
state: 'NY',
country: 'USA',
email: `${i}@example.com`,
telephoneNumber: '555-555-1212',
manager: managerId ? this.getAppUser(managerId) : null
};
this.counter++;
return user;
}
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
_getRandomIntInclusive(min, max) {
- return Math.floor(Math.random() * (max - min + 1)) + min; // eslint-disable-line no-magic-numbers
? ----------------------------------------
+ return Math.floor(Math.random() * (max - min + 1)) + min;
}
} | 13 | 0.317073 | 8 | 5 |
29540b8ba08287cd50a6806980209d7dca5be409 | functions.php | functions.php | <?php
/**
* Roots includes
*/
require_once locate_template('/lib/utils.php'); // Utility functions
require_once locate_template('/lib/init.php'); // Initial theme setup and constants
require_once locate_template('/lib/sidebar.php'); // Sidebar class
require_once locate_template('/lib/config.php'); // Configuration
require_once locate_template('/lib/activation.php'); // Theme activation
require_once locate_template('/lib/cleanup.php'); // Cleanup
require_once locate_template('/lib/nav.php'); // Custom nav modifications
require_once locate_template('/lib/comments.php'); // Custom comments modifications
require_once locate_template('/lib/rewrites.php'); // URL rewriting for assets
require_once locate_template('/lib/widgets.php'); // Sidebars and widgets
require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets
require_once locate_template('/lib/custom.php'); // Custom functions
require_once locate_template('/lib/customizer/init.php'); // Initialize the Customizer
require_once locate_template('/lib/lessphp/lessc.inc.php'); // Include the less compiler
require_once locate_template('/lib/image_resize/resize.php'); // Include the Image Resizer
| <?php
/**
* Roots includes
*/
require_once locate_template('/lib/utils.php'); // Utility functions
require_once locate_template('/lib/init.php'); // Initial theme setup and constants
require_once locate_template('/lib/sidebar.php'); // Sidebar class
require_once locate_template('/lib/config.php'); // Configuration
require_once locate_template('/lib/activation.php'); // Theme activation
require_once locate_template('/lib/cleanup.php'); // Cleanup
require_once locate_template('/lib/nav.php'); // Custom nav modifications
require_once locate_template('/lib/comments.php'); // Custom comments modifications
require_once locate_template('/lib/rewrites.php'); // URL rewriting for assets
require_once locate_template('/lib/widgets.php'); // Sidebars and widgets
require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets
require_once locate_template('/lib/custom.php'); // Custom functions
require_once locate_template('/lib/lessphp/lessc.inc.php'); // Include the less compiler
require_once locate_template('/lib/image_resize/resize.php'); // Include the Image Resizer
require_once locate_template('/lib/customizer/init.php'); // Initialize the Customizer
| Initialize the customizer AFTER including lessphp & image_resize | Initialize the customizer AFTER including lessphp & image_resize
| PHP | mit | jloosli/shoestrap-3,shoestrap/shoestrap-3,theportlandcompany/shoestrap-3,jloosli/shoestrap-3,theportlandcompany/shoestrap-3,cadr-sa/shoestrap-3,shoestrap/shoestrap-3,cadr-sa/shoestrap-3,jloosli/shoestrap-3 | php | ## Code Before:
<?php
/**
* Roots includes
*/
require_once locate_template('/lib/utils.php'); // Utility functions
require_once locate_template('/lib/init.php'); // Initial theme setup and constants
require_once locate_template('/lib/sidebar.php'); // Sidebar class
require_once locate_template('/lib/config.php'); // Configuration
require_once locate_template('/lib/activation.php'); // Theme activation
require_once locate_template('/lib/cleanup.php'); // Cleanup
require_once locate_template('/lib/nav.php'); // Custom nav modifications
require_once locate_template('/lib/comments.php'); // Custom comments modifications
require_once locate_template('/lib/rewrites.php'); // URL rewriting for assets
require_once locate_template('/lib/widgets.php'); // Sidebars and widgets
require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets
require_once locate_template('/lib/custom.php'); // Custom functions
require_once locate_template('/lib/customizer/init.php'); // Initialize the Customizer
require_once locate_template('/lib/lessphp/lessc.inc.php'); // Include the less compiler
require_once locate_template('/lib/image_resize/resize.php'); // Include the Image Resizer
## Instruction:
Initialize the customizer AFTER including lessphp & image_resize
## Code After:
<?php
/**
* Roots includes
*/
require_once locate_template('/lib/utils.php'); // Utility functions
require_once locate_template('/lib/init.php'); // Initial theme setup and constants
require_once locate_template('/lib/sidebar.php'); // Sidebar class
require_once locate_template('/lib/config.php'); // Configuration
require_once locate_template('/lib/activation.php'); // Theme activation
require_once locate_template('/lib/cleanup.php'); // Cleanup
require_once locate_template('/lib/nav.php'); // Custom nav modifications
require_once locate_template('/lib/comments.php'); // Custom comments modifications
require_once locate_template('/lib/rewrites.php'); // URL rewriting for assets
require_once locate_template('/lib/widgets.php'); // Sidebars and widgets
require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets
require_once locate_template('/lib/custom.php'); // Custom functions
require_once locate_template('/lib/lessphp/lessc.inc.php'); // Include the less compiler
require_once locate_template('/lib/image_resize/resize.php'); // Include the Image Resizer
require_once locate_template('/lib/customizer/init.php'); // Initialize the Customizer
| <?php
/**
* Roots includes
*/
require_once locate_template('/lib/utils.php'); // Utility functions
require_once locate_template('/lib/init.php'); // Initial theme setup and constants
require_once locate_template('/lib/sidebar.php'); // Sidebar class
require_once locate_template('/lib/config.php'); // Configuration
require_once locate_template('/lib/activation.php'); // Theme activation
require_once locate_template('/lib/cleanup.php'); // Cleanup
require_once locate_template('/lib/nav.php'); // Custom nav modifications
require_once locate_template('/lib/comments.php'); // Custom comments modifications
require_once locate_template('/lib/rewrites.php'); // URL rewriting for assets
require_once locate_template('/lib/widgets.php'); // Sidebars and widgets
require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets
require_once locate_template('/lib/custom.php'); // Custom functions
- require_once locate_template('/lib/customizer/init.php'); // Initialize the Customizer
require_once locate_template('/lib/lessphp/lessc.inc.php'); // Include the less compiler
require_once locate_template('/lib/image_resize/resize.php'); // Include the Image Resizer
+
+ require_once locate_template('/lib/customizer/init.php'); // Initialize the Customizer | 3 | 0.15 | 2 | 1 |
b75f4cf5e95b3ebed93fe20b6a4a2687e7357bb4 | src/ViewData.php | src/ViewData.php | <?php namespace TightenCo\Jigsaw;
use Exception;
use TightenCo\Jigsaw\IterableObject;
class ViewData extends IterableObject
{
private $data;
private $globals = ['extends', 'section', 'content', 'link'];
public $item;
public static function withCollectionItem($data, $collectionName, $itemName)
{
$viewData = new static($data);
$viewData->setCollectionItem($collectionName, $itemName);
return $viewData;
}
public function __call($method, $args)
{
return $this->getHelper($method)->__invoke($this, ...$args);
}
private function getHelper($name)
{
$helper = $this->has('helpers') ? $this->helpers->{$name} : null;
return $helper ?: function() use ($name) {
throw new Exception("No helper function named '$name' in 'config.php'.");
};
}
private function setCollectionItem($collection, $item)
{
if ($this->has($collection)) {
$this->item = $this->get($collection)->get($item);
$this->setGloballyAvailableItemVariables();
}
}
private function setGloballyAvailableItemVariables()
{
collect($this->globals)->each(function ($variable) {
$this[$variable] = $this->item->{$variable};
});
}
}
| <?php namespace TightenCo\Jigsaw;
use Exception;
use TightenCo\Jigsaw\IterableObject;
class ViewData extends IterableObject
{
private $data;
private $globals = ['extends', 'section', 'content', 'link'];
public $item;
public static function withCollectionItem($data, $collectionName, $itemName)
{
$viewData = new static($data);
$viewData->setCollectionItem($collectionName, $itemName);
return $viewData;
}
public function __call($method, $args)
{
return $this->getHelper($method)->__invoke($this, ...$args);
}
private function getHelper($name)
{
$helper = $this->has('helpers') ? $this->helpers->{$name} : null;
return $helper ?: function() use ($name) {
throw new Exception("No helper function named '$name' in 'config.php'.");
};
}
private function setCollectionItem($collection, $item)
{
if ($this->has($collection)) {
$this->item = $this->get($collection)->get($item);
$this->addSingularCollectionReference($collection);
$this->setGloballyAvailableItemVariables();
}
}
private function addSingularCollectionReference($collection)
{
if (str_singular($collection) != $collection) {
$this->{str_singular($collection)} = $this->item;
};
}
private function setGloballyAvailableItemVariables()
{
collect($this->globals)->each(function ($variable) {
$this[$variable] = $this->item->{$variable};
});
}
}
| Add reference to CollectionItems by singular collection name, if possible | Add reference to CollectionItems by singular collection name, if possible
| PHP | mit | quickliketurtle/jigsaw,tightenco/jigsaw,tightenco/jigsaw,quickliketurtle/jigsaw,adamwathan/jigsaw,adamwathan/jigsaw,quickliketurtle/jigsaw,tightenco/jigsaw | php | ## Code Before:
<?php namespace TightenCo\Jigsaw;
use Exception;
use TightenCo\Jigsaw\IterableObject;
class ViewData extends IterableObject
{
private $data;
private $globals = ['extends', 'section', 'content', 'link'];
public $item;
public static function withCollectionItem($data, $collectionName, $itemName)
{
$viewData = new static($data);
$viewData->setCollectionItem($collectionName, $itemName);
return $viewData;
}
public function __call($method, $args)
{
return $this->getHelper($method)->__invoke($this, ...$args);
}
private function getHelper($name)
{
$helper = $this->has('helpers') ? $this->helpers->{$name} : null;
return $helper ?: function() use ($name) {
throw new Exception("No helper function named '$name' in 'config.php'.");
};
}
private function setCollectionItem($collection, $item)
{
if ($this->has($collection)) {
$this->item = $this->get($collection)->get($item);
$this->setGloballyAvailableItemVariables();
}
}
private function setGloballyAvailableItemVariables()
{
collect($this->globals)->each(function ($variable) {
$this[$variable] = $this->item->{$variable};
});
}
}
## Instruction:
Add reference to CollectionItems by singular collection name, if possible
## Code After:
<?php namespace TightenCo\Jigsaw;
use Exception;
use TightenCo\Jigsaw\IterableObject;
class ViewData extends IterableObject
{
private $data;
private $globals = ['extends', 'section', 'content', 'link'];
public $item;
public static function withCollectionItem($data, $collectionName, $itemName)
{
$viewData = new static($data);
$viewData->setCollectionItem($collectionName, $itemName);
return $viewData;
}
public function __call($method, $args)
{
return $this->getHelper($method)->__invoke($this, ...$args);
}
private function getHelper($name)
{
$helper = $this->has('helpers') ? $this->helpers->{$name} : null;
return $helper ?: function() use ($name) {
throw new Exception("No helper function named '$name' in 'config.php'.");
};
}
private function setCollectionItem($collection, $item)
{
if ($this->has($collection)) {
$this->item = $this->get($collection)->get($item);
$this->addSingularCollectionReference($collection);
$this->setGloballyAvailableItemVariables();
}
}
private function addSingularCollectionReference($collection)
{
if (str_singular($collection) != $collection) {
$this->{str_singular($collection)} = $this->item;
};
}
private function setGloballyAvailableItemVariables()
{
collect($this->globals)->each(function ($variable) {
$this[$variable] = $this->item->{$variable};
});
}
}
| <?php namespace TightenCo\Jigsaw;
use Exception;
use TightenCo\Jigsaw\IterableObject;
class ViewData extends IterableObject
{
private $data;
private $globals = ['extends', 'section', 'content', 'link'];
public $item;
public static function withCollectionItem($data, $collectionName, $itemName)
{
$viewData = new static($data);
$viewData->setCollectionItem($collectionName, $itemName);
return $viewData;
}
public function __call($method, $args)
{
return $this->getHelper($method)->__invoke($this, ...$args);
}
private function getHelper($name)
{
$helper = $this->has('helpers') ? $this->helpers->{$name} : null;
return $helper ?: function() use ($name) {
throw new Exception("No helper function named '$name' in 'config.php'.");
};
}
private function setCollectionItem($collection, $item)
{
if ($this->has($collection)) {
$this->item = $this->get($collection)->get($item);
+ $this->addSingularCollectionReference($collection);
$this->setGloballyAvailableItemVariables();
}
+ }
+
+ private function addSingularCollectionReference($collection)
+ {
+ if (str_singular($collection) != $collection) {
+ $this->{str_singular($collection)} = $this->item;
+ };
}
private function setGloballyAvailableItemVariables()
{
collect($this->globals)->each(function ($variable) {
$this[$variable] = $this->item->{$variable};
});
}
} | 8 | 0.166667 | 8 | 0 |
3ea532d66627233f9a1db93f10631a3eecf1dff6 | README.md | README.md | orgsync-api-java
================
Java REST client for the OrgSync API
|
Java REST client for the OrgSync API
# Dev setup
run `gradle eclipse` to create the eclipse files and then import into eclipse. Other IDEs are probably avilable
| Add some comments on readme for getting started | Add some comments on readme for getting started
| Markdown | apache-2.0 | orgsync/orgsync-api-java | markdown | ## Code Before:
orgsync-api-java
================
Java REST client for the OrgSync API
## Instruction:
Add some comments on readme for getting started
## Code After:
Java REST client for the OrgSync API
# Dev setup
run `gradle eclipse` to create the eclipse files and then import into eclipse. Other IDEs are probably avilable
| - orgsync-api-java
- ================
Java REST client for the OrgSync API
+
+ # Dev setup
+
+ run `gradle eclipse` to create the eclipse files and then import into eclipse. Other IDEs are probably avilable
+ | 7 | 1.75 | 5 | 2 |
2022357fd0f81be6f3ca91718a6c8c1d1d46ac1b | examples/olfaction/config_files/gen_olf_stimuli.py | examples/olfaction/config_files/gen_olf_stimuli.py |
"""
Create the gexf configuration based on E. Hallem's cell paper on 2006
"""
import numpy as np
import h5py
osn_num = 1375;
f = h5py.File("al.hdf5","w")
dt = 1e-4 # time step
Ot = 2000 # number of data point during reset period
Rt = 1000 # number of data point during odor delivery period
Nt = 4*Ot + 3*Rt # number of data point
t = np.arange(0,dt*Nt,dt)
I = -1.*0.0195 # amplitude of the onset odorant concentration
u_on = I*np.ones( Ot, dtype=np.float64)
u_off = np.zeros( Ot, dtype=np.float64)
u_reset = np.zeros( Rt, dtype=np.float64)
u = np.concatenate((u_off,u_reset,u_on,u_reset,u_off,u_reset,u_on))
u_all = np.transpose( np.kron( np.ones((osn_num,1)), u))
# create the dataset
dset = f.create_dataset("acetone_on_off.hdf5",(Nt, osn_num), dtype=np.float64,\
data = u_all)
f.close()
|
"""
Create the gexf configuration based on E. Hallem's cell paper on 2006
"""
import numpy as np
import h5py
osn_num = 1375;
f = h5py.File("olfactory_stimulus.h5","w")
dt = 1e-4 # time step
Ot = 2000 # number of data point during reset period
Rt = 1000 # number of data point during odor delivery period
Nt = 4*Ot + 3*Rt # number of data point
t = np.arange(0,dt*Nt,dt)
I = -1.*0.0195 # amplitude of the onset odorant concentration
u_on = I*np.ones( Ot, dtype=np.float64)
u_off = np.zeros( Ot, dtype=np.float64)
u_reset = np.zeros( Rt, dtype=np.float64)
u = np.concatenate((u_off,u_reset,u_on,u_reset,u_off,u_reset,u_on))
u_all = np.transpose( np.kron( np.ones((osn_num,1)), u))
# create the dataset
dset = f.create_dataset("real",(Nt, osn_num), dtype=np.float64,\
data = u_all)
f.close()
| Rename olfactory stimulus file and internal array. | Rename olfactory stimulus file and internal array.
--HG--
branch : LPU
| Python | bsd-3-clause | cerrno/neurokernel | python | ## Code Before:
"""
Create the gexf configuration based on E. Hallem's cell paper on 2006
"""
import numpy as np
import h5py
osn_num = 1375;
f = h5py.File("al.hdf5","w")
dt = 1e-4 # time step
Ot = 2000 # number of data point during reset period
Rt = 1000 # number of data point during odor delivery period
Nt = 4*Ot + 3*Rt # number of data point
t = np.arange(0,dt*Nt,dt)
I = -1.*0.0195 # amplitude of the onset odorant concentration
u_on = I*np.ones( Ot, dtype=np.float64)
u_off = np.zeros( Ot, dtype=np.float64)
u_reset = np.zeros( Rt, dtype=np.float64)
u = np.concatenate((u_off,u_reset,u_on,u_reset,u_off,u_reset,u_on))
u_all = np.transpose( np.kron( np.ones((osn_num,1)), u))
# create the dataset
dset = f.create_dataset("acetone_on_off.hdf5",(Nt, osn_num), dtype=np.float64,\
data = u_all)
f.close()
## Instruction:
Rename olfactory stimulus file and internal array.
--HG--
branch : LPU
## Code After:
"""
Create the gexf configuration based on E. Hallem's cell paper on 2006
"""
import numpy as np
import h5py
osn_num = 1375;
f = h5py.File("olfactory_stimulus.h5","w")
dt = 1e-4 # time step
Ot = 2000 # number of data point during reset period
Rt = 1000 # number of data point during odor delivery period
Nt = 4*Ot + 3*Rt # number of data point
t = np.arange(0,dt*Nt,dt)
I = -1.*0.0195 # amplitude of the onset odorant concentration
u_on = I*np.ones( Ot, dtype=np.float64)
u_off = np.zeros( Ot, dtype=np.float64)
u_reset = np.zeros( Rt, dtype=np.float64)
u = np.concatenate((u_off,u_reset,u_on,u_reset,u_off,u_reset,u_on))
u_all = np.transpose( np.kron( np.ones((osn_num,1)), u))
# create the dataset
dset = f.create_dataset("real",(Nt, osn_num), dtype=np.float64,\
data = u_all)
f.close()
|
"""
Create the gexf configuration based on E. Hallem's cell paper on 2006
"""
import numpy as np
import h5py
osn_num = 1375;
- f = h5py.File("al.hdf5","w")
+ f = h5py.File("olfactory_stimulus.h5","w")
dt = 1e-4 # time step
Ot = 2000 # number of data point during reset period
Rt = 1000 # number of data point during odor delivery period
Nt = 4*Ot + 3*Rt # number of data point
t = np.arange(0,dt*Nt,dt)
I = -1.*0.0195 # amplitude of the onset odorant concentration
u_on = I*np.ones( Ot, dtype=np.float64)
u_off = np.zeros( Ot, dtype=np.float64)
u_reset = np.zeros( Rt, dtype=np.float64)
u = np.concatenate((u_off,u_reset,u_on,u_reset,u_off,u_reset,u_on))
u_all = np.transpose( np.kron( np.ones((osn_num,1)), u))
# create the dataset
- dset = f.create_dataset("acetone_on_off.hdf5",(Nt, osn_num), dtype=np.float64,\
? ^^^^^^^^^^^^^^^^^^
+ dset = f.create_dataset("real",(Nt, osn_num), dtype=np.float64,\
? ++ ^
data = u_all)
f.close() | 4 | 0.133333 | 2 | 2 |
905a725bb341064337a8176be5630912a734c5bf | deploy.sh | deploy.sh |
set -e
HOST=yuca.yunity.org
REF=$1
DIR=$2
if [ -z "$REF" ] || [ -z "$DIR" ]; then
echo "Usage: <ref> <dir>"
exit 1
fi
echo "deploying frontend branch [$REF] to [$HOST] in [$DIR] dir"
echo "$REF" > dist/version
echo "$REF" > storybook-static/version
# send it all to the host
rsync -avz --delete dist/ "deploy@$HOST:karrot-frontend/$DIR/"
rsync -avz --delete storybook-static/ "deploy@$HOST:karrot-frontend-storybook/$DIR/"
|
set -e
HOST=yuca.yunity.org
REF=$1
DIR=$2
if [ -z "$REF" ] || [ -z "$DIR" ]; then
echo "Usage: <ref> <dir>"
exit 1
fi
ssh-keyscan -H $HOST >> ~/.ssh/known_hosts
echo "deploying frontend branch [$REF] to [$HOST] in [$DIR] dir"
echo "$REF" > dist/version
echo "$REF" > storybook-static/version
# send it all to the host
rsync -avz --delete dist/ "deploy@$HOST:karrot-frontend/$DIR/"
rsync -avz --delete storybook-static/ "deploy@$HOST:karrot-frontend-storybook/$DIR/"
| Add ssh key to known hosts | Add ssh key to known hosts
| Shell | mit | yunity/karrot-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend,yunity/karrot-frontend | shell | ## Code Before:
set -e
HOST=yuca.yunity.org
REF=$1
DIR=$2
if [ -z "$REF" ] || [ -z "$DIR" ]; then
echo "Usage: <ref> <dir>"
exit 1
fi
echo "deploying frontend branch [$REF] to [$HOST] in [$DIR] dir"
echo "$REF" > dist/version
echo "$REF" > storybook-static/version
# send it all to the host
rsync -avz --delete dist/ "deploy@$HOST:karrot-frontend/$DIR/"
rsync -avz --delete storybook-static/ "deploy@$HOST:karrot-frontend-storybook/$DIR/"
## Instruction:
Add ssh key to known hosts
## Code After:
set -e
HOST=yuca.yunity.org
REF=$1
DIR=$2
if [ -z "$REF" ] || [ -z "$DIR" ]; then
echo "Usage: <ref> <dir>"
exit 1
fi
ssh-keyscan -H $HOST >> ~/.ssh/known_hosts
echo "deploying frontend branch [$REF] to [$HOST] in [$DIR] dir"
echo "$REF" > dist/version
echo "$REF" > storybook-static/version
# send it all to the host
rsync -avz --delete dist/ "deploy@$HOST:karrot-frontend/$DIR/"
rsync -avz --delete storybook-static/ "deploy@$HOST:karrot-frontend-storybook/$DIR/"
|
set -e
HOST=yuca.yunity.org
REF=$1
DIR=$2
if [ -z "$REF" ] || [ -z "$DIR" ]; then
echo "Usage: <ref> <dir>"
exit 1
fi
+ ssh-keyscan -H $HOST >> ~/.ssh/known_hosts
+
echo "deploying frontend branch [$REF] to [$HOST] in [$DIR] dir"
echo "$REF" > dist/version
echo "$REF" > storybook-static/version
# send it all to the host
rsync -avz --delete dist/ "deploy@$HOST:karrot-frontend/$DIR/"
rsync -avz --delete storybook-static/ "deploy@$HOST:karrot-frontend-storybook/$DIR/" | 2 | 0.095238 | 2 | 0 |
40ae78589324fe08724df365b49e4b39659b9176 | src/options/validate.js | src/options/validate.js | 'use strict';
const { validate } = require('../validation');
// Validation for main options
const validateOptions = function ({ options }) {
const schema = {
type: 'object',
required: ['conf'],
properties: {
conf: {
type: ['string', 'object'],
},
onRequestError: {
typeof: 'function',
arity: 1,
},
logger: {
typeof: 'function',
returnType: 'function',
arity: 1,
},
maxDataLength: {
type: 'integer',
minimum: 0,
},
defaultPageSize: {
type: 'integer',
minimum: 0,
},
maxPageSize: {
type: 'integer',
minimum: {
$data: '1/defaultPageSize',
},
},
},
additionalProperties: false,
};
validate({ schema, data: options, reportInfo: { type: 'options' } });
};
module.exports = {
validateOptions,
};
| 'use strict';
const { validate } = require('../validation');
// Validation for main options
const validateOptions = function ({ options }) {
const schema = {
type: 'object',
required: ['conf'],
properties: {
conf: {
type: ['string', 'object'],
},
onRequestError: {
typeof: 'function',
arity: 1,
},
logger: {
typeof: 'function',
returnType: 'function',
arity: 1,
},
maxDataLength: {
type: 'integer',
minimum: 0,
},
defaultPageSize: {
type: 'integer',
minimum: 0,
},
maxPageSize: {
type: 'integer',
minimum: {
$data: '1/defaultPageSize',
},
},
},
additionalProperties: false,
};
validate({ schema, data: options, reportInfo: { type: 'options', dataVar: 'options' } });
};
module.exports = {
validateOptions,
};
| Improve error message for options validation | Improve error message for options validation
| JavaScript | apache-2.0 | autoserver-org/autoserver,autoserver-org/autoserver | javascript | ## Code Before:
'use strict';
const { validate } = require('../validation');
// Validation for main options
const validateOptions = function ({ options }) {
const schema = {
type: 'object',
required: ['conf'],
properties: {
conf: {
type: ['string', 'object'],
},
onRequestError: {
typeof: 'function',
arity: 1,
},
logger: {
typeof: 'function',
returnType: 'function',
arity: 1,
},
maxDataLength: {
type: 'integer',
minimum: 0,
},
defaultPageSize: {
type: 'integer',
minimum: 0,
},
maxPageSize: {
type: 'integer',
minimum: {
$data: '1/defaultPageSize',
},
},
},
additionalProperties: false,
};
validate({ schema, data: options, reportInfo: { type: 'options' } });
};
module.exports = {
validateOptions,
};
## Instruction:
Improve error message for options validation
## Code After:
'use strict';
const { validate } = require('../validation');
// Validation for main options
const validateOptions = function ({ options }) {
const schema = {
type: 'object',
required: ['conf'],
properties: {
conf: {
type: ['string', 'object'],
},
onRequestError: {
typeof: 'function',
arity: 1,
},
logger: {
typeof: 'function',
returnType: 'function',
arity: 1,
},
maxDataLength: {
type: 'integer',
minimum: 0,
},
defaultPageSize: {
type: 'integer',
minimum: 0,
},
maxPageSize: {
type: 'integer',
minimum: {
$data: '1/defaultPageSize',
},
},
},
additionalProperties: false,
};
validate({ schema, data: options, reportInfo: { type: 'options', dataVar: 'options' } });
};
module.exports = {
validateOptions,
};
| 'use strict';
const { validate } = require('../validation');
// Validation for main options
const validateOptions = function ({ options }) {
const schema = {
type: 'object',
required: ['conf'],
properties: {
conf: {
type: ['string', 'object'],
},
onRequestError: {
typeof: 'function',
arity: 1,
},
logger: {
typeof: 'function',
returnType: 'function',
arity: 1,
},
maxDataLength: {
type: 'integer',
minimum: 0,
},
defaultPageSize: {
type: 'integer',
minimum: 0,
},
maxPageSize: {
type: 'integer',
minimum: {
$data: '1/defaultPageSize',
},
},
},
additionalProperties: false,
};
- validate({ schema, data: options, reportInfo: { type: 'options' } });
+ validate({ schema, data: options, reportInfo: { type: 'options', dataVar: 'options' } });
? ++++++++++++++++++++
};
module.exports = {
validateOptions,
}; | 2 | 0.035714 | 1 | 1 |
c962bdffcf4dcc535600afec287090c1bfc4d5f3 | docs/api/backends.rst | docs/api/backends.rst | .. _backend-api:
***********
Backend API
***********
.. module:: mopidy.backends.base
:synopsis: The API implemented by backends
The backend API is the interface that must be implemented when you create a
backend. If you are working on a frontend and need to access the backend, see
the :ref:`core-api`.
Backend class
=============
.. autoclass:: mopidy.backends.base.Backend
:members:
Playback provider
=================
.. autoclass:: mopidy.backends.base.BasePlaybackProvider
:members:
Playlists provider
==================
.. autoclass:: mopidy.backends.base.BasePlaylistsProvider
:members:
Library provider
================
.. autoclass:: mopidy.backends.base.BaseLibraryProvider
:members:
Backend listener
================
.. autoclass:: mopidy.backends.listener.BackendListener
:members:
.. _backend-implementations:
Backend implementations
=======================
* :mod:`mopidy.backends.dummy`
* :mod:`mopidy.local`
* :mod:`mopidy.stream`
| .. _backend-api:
***********
Backend API
***********
.. module:: mopidy.backends.base
:synopsis: The API implemented by backends
The backend API is the interface that must be implemented when you create a
backend. If you are working on a frontend and need to access the backend, see
the :ref:`core-api`.
Backend class
=============
.. autoclass:: mopidy.backends.base.Backend
:members:
Playback provider
=================
.. autoclass:: mopidy.backends.base.BasePlaybackProvider
:members:
Playlists provider
==================
.. autoclass:: mopidy.backends.base.BasePlaylistsProvider
:members:
Library provider
================
.. autoclass:: mopidy.backends.base.BaseLibraryProvider
:members:
Backend listener
================
.. autoclass:: mopidy.backends.listener.BackendListener
:members:
.. _backend-implementations:
Backend implementations
=======================
* :mod:`mopidy.local`
* :mod:`mopidy.stream`
| Remove reference to dummy backend | docs: Remove reference to dummy backend
| reStructuredText | apache-2.0 | adamcik/mopidy,ZenithDK/mopidy,glogiotatidis/mopidy,pacificIT/mopidy,woutervanwijk/mopidy,rawdlite/mopidy,jcass77/mopidy,bacontext/mopidy,mokieyue/mopidy,ZenithDK/mopidy,pacificIT/mopidy,priestd09/mopidy,diandiankan/mopidy,mopidy/mopidy,quartz55/mopidy,priestd09/mopidy,mokieyue/mopidy,ZenithDK/mopidy,vrs01/mopidy,hkariti/mopidy,pacificIT/mopidy,ZenithDK/mopidy,jcass77/mopidy,woutervanwijk/mopidy,ali/mopidy,vrs01/mopidy,jmarsik/mopidy,hkariti/mopidy,hkariti/mopidy,glogiotatidis/mopidy,SuperStarPL/mopidy,quartz55/mopidy,vrs01/mopidy,tkem/mopidy,dbrgn/mopidy,dbrgn/mopidy,liamw9534/mopidy,jmarsik/mopidy,swak/mopidy,mopidy/mopidy,swak/mopidy,jodal/mopidy,quartz55/mopidy,kingosticks/mopidy,mokieyue/mopidy,liamw9534/mopidy,abarisain/mopidy,SuperStarPL/mopidy,mopidy/mopidy,bacontext/mopidy,diandiankan/mopidy,jodal/mopidy,rawdlite/mopidy,bacontext/mopidy,glogiotatidis/mopidy,hkariti/mopidy,jodal/mopidy,bencevans/mopidy,jcass77/mopidy,abarisain/mopidy,ali/mopidy,bacontext/mopidy,mokieyue/mopidy,dbrgn/mopidy,ali/mopidy,tkem/mopidy,SuperStarPL/mopidy,bencevans/mopidy,pacificIT/mopidy,jmarsik/mopidy,rawdlite/mopidy,adamcik/mopidy,kingosticks/mopidy,tkem/mopidy,diandiankan/mopidy,vrs01/mopidy,diandiankan/mopidy,bencevans/mopidy,swak/mopidy,quartz55/mopidy,bencevans/mopidy,tkem/mopidy,ali/mopidy,swak/mopidy,glogiotatidis/mopidy,dbrgn/mopidy,rawdlite/mopidy,priestd09/mopidy,kingosticks/mopidy,adamcik/mopidy,SuperStarPL/mopidy,jmarsik/mopidy | restructuredtext | ## Code Before:
.. _backend-api:
***********
Backend API
***********
.. module:: mopidy.backends.base
:synopsis: The API implemented by backends
The backend API is the interface that must be implemented when you create a
backend. If you are working on a frontend and need to access the backend, see
the :ref:`core-api`.
Backend class
=============
.. autoclass:: mopidy.backends.base.Backend
:members:
Playback provider
=================
.. autoclass:: mopidy.backends.base.BasePlaybackProvider
:members:
Playlists provider
==================
.. autoclass:: mopidy.backends.base.BasePlaylistsProvider
:members:
Library provider
================
.. autoclass:: mopidy.backends.base.BaseLibraryProvider
:members:
Backend listener
================
.. autoclass:: mopidy.backends.listener.BackendListener
:members:
.. _backend-implementations:
Backend implementations
=======================
* :mod:`mopidy.backends.dummy`
* :mod:`mopidy.local`
* :mod:`mopidy.stream`
## Instruction:
docs: Remove reference to dummy backend
## Code After:
.. _backend-api:
***********
Backend API
***********
.. module:: mopidy.backends.base
:synopsis: The API implemented by backends
The backend API is the interface that must be implemented when you create a
backend. If you are working on a frontend and need to access the backend, see
the :ref:`core-api`.
Backend class
=============
.. autoclass:: mopidy.backends.base.Backend
:members:
Playback provider
=================
.. autoclass:: mopidy.backends.base.BasePlaybackProvider
:members:
Playlists provider
==================
.. autoclass:: mopidy.backends.base.BasePlaylistsProvider
:members:
Library provider
================
.. autoclass:: mopidy.backends.base.BaseLibraryProvider
:members:
Backend listener
================
.. autoclass:: mopidy.backends.listener.BackendListener
:members:
.. _backend-implementations:
Backend implementations
=======================
* :mod:`mopidy.local`
* :mod:`mopidy.stream`
| .. _backend-api:
***********
Backend API
***********
.. module:: mopidy.backends.base
:synopsis: The API implemented by backends
The backend API is the interface that must be implemented when you create a
backend. If you are working on a frontend and need to access the backend, see
the :ref:`core-api`.
Backend class
=============
.. autoclass:: mopidy.backends.base.Backend
:members:
Playback provider
=================
.. autoclass:: mopidy.backends.base.BasePlaybackProvider
:members:
Playlists provider
==================
.. autoclass:: mopidy.backends.base.BasePlaylistsProvider
:members:
Library provider
================
.. autoclass:: mopidy.backends.base.BaseLibraryProvider
:members:
Backend listener
================
.. autoclass:: mopidy.backends.listener.BackendListener
:members:
.. _backend-implementations:
Backend implementations
=======================
- * :mod:`mopidy.backends.dummy`
* :mod:`mopidy.local`
* :mod:`mopidy.stream` | 1 | 0.017544 | 0 | 1 |
1b53ed854a3dafea93066f77818a778001c1c4ea | opencog/timeoctomap/CMakeLists.txt | opencog/timeoctomap/CMakeLists.txt | ADD_LIBRARY (time_octomap SHARED
AtomOcTree.cc
AtomOcTreeNode.cc
TimeOctomap.cc
)
TARGET_LINK_LIBRARIES(time_octomap
${OCTOMAP_LIBRARY}
${OCTOMAP_OCTOMATH_LIBRARY}
${ATOMSPACE_LIBRARIES}
)
INSTALL (TARGETS time_octomap
DESTINATION "lib${LIB_DIR_SUFFIX}/opencog"
)
INSTALL (FILES
AtomOcTree.h
AtomOcTreeNode.h
TimeOctomap.h
DESTINATION "include/${PROJECT_NAME}/timeoctomap"
)
ADD_SUBDIRECTORY (pointmemory)
| ADD_LIBRARY (time_octomap SHARED
AtomOcTree.cc
AtomOcTreeNode.cc
TimeOctomap.cc
)
TARGET_LINK_LIBRARIES(time_octomap
${OCTOMAP_LIBRARY}
${OCTOMAP_OCTOMATH_LIBRARY}
)
INSTALL (TARGETS time_octomap
DESTINATION "lib${LIB_DIR_SUFFIX}/opencog"
)
INSTALL (FILES
AtomOcTree.h
AtomOcTreeNode.h
TimeOctomap.h
DESTINATION "include/${PROJECT_NAME}/timeoctomap"
)
ADD_SUBDIRECTORY (pointmemory)
| Remove atomspace dependency from the cmake file | Remove atomspace dependency from the cmake file
| Text | agpl-3.0 | inflector/opencog,andre-senna/opencog,inflector/opencog,andre-senna/opencog,inflector/opencog,AmeBel/opencog,AmeBel/opencog,inflector/opencog,misgeatgit/opencog,misgeatgit/opencog,misgeatgit/opencog,misgeatgit/opencog,AmeBel/opencog,andre-senna/opencog,AmeBel/opencog,AmeBel/opencog,andre-senna/opencog,inflector/opencog,andre-senna/opencog,AmeBel/opencog,misgeatgit/opencog,inflector/opencog,andre-senna/opencog,misgeatgit/opencog,andre-senna/opencog,misgeatgit/opencog,inflector/opencog,AmeBel/opencog,misgeatgit/opencog,inflector/opencog,misgeatgit/opencog | text | ## Code Before:
ADD_LIBRARY (time_octomap SHARED
AtomOcTree.cc
AtomOcTreeNode.cc
TimeOctomap.cc
)
TARGET_LINK_LIBRARIES(time_octomap
${OCTOMAP_LIBRARY}
${OCTOMAP_OCTOMATH_LIBRARY}
${ATOMSPACE_LIBRARIES}
)
INSTALL (TARGETS time_octomap
DESTINATION "lib${LIB_DIR_SUFFIX}/opencog"
)
INSTALL (FILES
AtomOcTree.h
AtomOcTreeNode.h
TimeOctomap.h
DESTINATION "include/${PROJECT_NAME}/timeoctomap"
)
ADD_SUBDIRECTORY (pointmemory)
## Instruction:
Remove atomspace dependency from the cmake file
## Code After:
ADD_LIBRARY (time_octomap SHARED
AtomOcTree.cc
AtomOcTreeNode.cc
TimeOctomap.cc
)
TARGET_LINK_LIBRARIES(time_octomap
${OCTOMAP_LIBRARY}
${OCTOMAP_OCTOMATH_LIBRARY}
)
INSTALL (TARGETS time_octomap
DESTINATION "lib${LIB_DIR_SUFFIX}/opencog"
)
INSTALL (FILES
AtomOcTree.h
AtomOcTreeNode.h
TimeOctomap.h
DESTINATION "include/${PROJECT_NAME}/timeoctomap"
)
ADD_SUBDIRECTORY (pointmemory)
| ADD_LIBRARY (time_octomap SHARED
AtomOcTree.cc
AtomOcTreeNode.cc
TimeOctomap.cc
)
TARGET_LINK_LIBRARIES(time_octomap
${OCTOMAP_LIBRARY}
${OCTOMAP_OCTOMATH_LIBRARY}
- ${ATOMSPACE_LIBRARIES}
)
INSTALL (TARGETS time_octomap
DESTINATION "lib${LIB_DIR_SUFFIX}/opencog"
)
INSTALL (FILES
AtomOcTree.h
AtomOcTreeNode.h
TimeOctomap.h
DESTINATION "include/${PROJECT_NAME}/timeoctomap"
)
ADD_SUBDIRECTORY (pointmemory) | 1 | 0.041667 | 0 | 1 |
93cb75e77b02fdd1df6db7ca9f6f645a802a9972 | app/views/tags/index.html.haml | app/views/tags/index.html.haml | %div
%h2 Tags
= render :partial => 'tags/tag', :collection => tags_objects()
| %div
.main.panel.section
.header
%h2.icon.tags Tags
.body
.tag-cloud
= render :partial => 'tags/tag', :collection => tags_objects()
.footer
| Bring over BBYIDX's Tag index template | Bring over BBYIDX's Tag index template
| Haml | agpl-3.0 | robinsonj/P4IdeaX,robinsonj/P4IdeaX | haml | ## Code Before:
%div
%h2 Tags
= render :partial => 'tags/tag', :collection => tags_objects()
## Instruction:
Bring over BBYIDX's Tag index template
## Code After:
%div
.main.panel.section
.header
%h2.icon.tags Tags
.body
.tag-cloud
= render :partial => 'tags/tag', :collection => tags_objects()
.footer
| %div
- %h2 Tags
+ .main.panel.section
+ .header
+ %h2.icon.tags Tags
+ .body
+ .tag-cloud
- = render :partial => 'tags/tag', :collection => tags_objects()
+ = render :partial => 'tags/tag', :collection => tags_objects()
? ++++++
+ .footer | 9 | 3 | 7 | 2 |
32148c71c5c1cf280a51c65d6dddecb029542300 | config/initializers/gds_sso.rb | config/initializers/gds_sso.rb | GDS::SSO.config do |config|
config.user_model = "User"
config.oauth_id = ENV.fetch("OAUTH_ID", "oauth_id")
config.oauth_secret = ENV.fetch("OAUTH_SECRET", "secret")
config.oauth_root_url = Plek.new.external_url_for("signon")
config.cache = Rails.cache
config.api_only = true
end
| GDS::SSO.config do |config|
config.api_only = true
end
| Remove redundant GDS SSO initializer | Remove redundant GDS SSO initializer
This was made redundant in [1].
[1]: https://github.com/alphagov/gds-sso/pull/241
| Ruby | mit | alphagov/content-store,alphagov/content-store | ruby | ## Code Before:
GDS::SSO.config do |config|
config.user_model = "User"
config.oauth_id = ENV.fetch("OAUTH_ID", "oauth_id")
config.oauth_secret = ENV.fetch("OAUTH_SECRET", "secret")
config.oauth_root_url = Plek.new.external_url_for("signon")
config.cache = Rails.cache
config.api_only = true
end
## Instruction:
Remove redundant GDS SSO initializer
This was made redundant in [1].
[1]: https://github.com/alphagov/gds-sso/pull/241
## Code After:
GDS::SSO.config do |config|
config.api_only = true
end
| GDS::SSO.config do |config|
- config.user_model = "User"
- config.oauth_id = ENV.fetch("OAUTH_ID", "oauth_id")
- config.oauth_secret = ENV.fetch("OAUTH_SECRET", "secret")
- config.oauth_root_url = Plek.new.external_url_for("signon")
- config.cache = Rails.cache
config.api_only = true
end | 5 | 0.625 | 0 | 5 |
5d645cf4bde35a92753563fd31fd908693a3c582 | cfg/after/plugin/tmux_navigator.vim | cfg/after/plugin/tmux_navigator.vim | " map meta keys for tmux-navigator
silent! execute 'set <F31>=\<Esc>h'
silent! execute 'set <F32>=\<Esc>j'
silent! execute 'set <F33>=\<Esc>k'
silent! execute 'set <F34>=\<Esc>l'
nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
nmap <F31> <M-h>
nmap <F32> <M-j>
nmap <F33> <M-k>
nmap <F34> <M-l>
| " map Meta keys for tmux-navigator
nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
" handle Meta keys in terminal
if !has('gui_running')
silent! execute 'set <F31>=h'
silent! execute 'set <F32>=j'
silent! execute 'set <F33>=k'
silent! execute 'set <F34>=l'
nmap <F31> <M-h>
nmap <F32> <M-j>
nmap <F33> <M-k>
nmap <F34> <M-l>
endif
| Fix Meta keybinds in terminal | Fix Meta keybinds in terminal
Apparently my previous incarnation of after/plugin/tmux_navigator.vim
actually fails to trigger for terminal Meta...
I now use the literal byte instead of \<Esc>, plus I wrapped it in a
nice conditional that checks for GUI (since Meta in GUI works already).
| VimL | mit | igemnace/vim-config,igemnace/vim-config,igemnace/vim-config,igemnace/my-vim-config | viml | ## Code Before:
" map meta keys for tmux-navigator
silent! execute 'set <F31>=\<Esc>h'
silent! execute 'set <F32>=\<Esc>j'
silent! execute 'set <F33>=\<Esc>k'
silent! execute 'set <F34>=\<Esc>l'
nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
nmap <F31> <M-h>
nmap <F32> <M-j>
nmap <F33> <M-k>
nmap <F34> <M-l>
## Instruction:
Fix Meta keybinds in terminal
Apparently my previous incarnation of after/plugin/tmux_navigator.vim
actually fails to trigger for terminal Meta...
I now use the literal byte instead of \<Esc>, plus I wrapped it in a
nice conditional that checks for GUI (since Meta in GUI works already).
## Code After:
" map Meta keys for tmux-navigator
nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
" handle Meta keys in terminal
if !has('gui_running')
silent! execute 'set <F31>=h'
silent! execute 'set <F32>=j'
silent! execute 'set <F33>=k'
silent! execute 'set <F34>=l'
nmap <F31> <M-h>
nmap <F32> <M-j>
nmap <F33> <M-k>
nmap <F34> <M-l>
endif
| - " map meta keys for tmux-navigator
? ^
+ " map Meta keys for tmux-navigator
? ^
- silent! execute 'set <F31>=\<Esc>h'
- silent! execute 'set <F32>=\<Esc>j'
- silent! execute 'set <F33>=\<Esc>k'
- silent! execute 'set <F34>=\<Esc>l'
nnoremap <silent> <M-h> :TmuxNavigateLeft<CR>
nnoremap <silent> <M-j> :TmuxNavigateDown<CR>
nnoremap <silent> <M-k> :TmuxNavigateUp<CR>
nnoremap <silent> <M-l> :TmuxNavigateRight<CR>
+
+ " handle Meta keys in terminal
+ if !has('gui_running')
+ silent! execute 'set <F31>=h'
+ silent! execute 'set <F32>=j'
+ silent! execute 'set <F33>=k'
+ silent! execute 'set <F34>=l'
- nmap <F31> <M-h>
+ nmap <F31> <M-h>
? ++
- nmap <F32> <M-j>
+ nmap <F32> <M-j>
? ++
- nmap <F33> <M-k>
+ nmap <F33> <M-k>
? ++
- nmap <F34> <M-l>
+ nmap <F34> <M-l>
? ++
+ endif | 22 | 1.692308 | 13 | 9 |
e344f92f5434773a354bde0bce39032e054f9382 | lib/query_string_search/comparator.rb | lib/query_string_search/comparator.rb | module Comparator
def self.does(subject)
Comparison.new(subject)
end
class Comparison
attr_accessor :subject
def initialize(subject)
self.subject = subject
end
def equal?(other)
normalize(subject) == normalize(other)
end
def normalize(unnormalized)
if unnormalized.respond_to?(:each)
unnormalized.map(&:to_s).map(&:upcase)
else
unnormalized.to_s.upcase
end
end
def contain?(other)
normalize(subject).include?(normalize(other))
end
end
end
| module QueryStringSearch
module Comparator
def self.does(subject)
Comparison.new(subject)
end
class Comparison
attr_accessor :subject
def initialize(subject)
self.subject = subject
end
def equal?(other)
normalize(subject) == normalize(other)
end
def normalize(unnormalized)
if unnormalized.respond_to?(:each)
unnormalized.map(&:to_s).map(&:upcase)
else
unnormalized.to_s.upcase
end
end
def contain?(other)
normalize(subject).include?(normalize(other))
end
end
end
end
| Move Comparator under the QueryStringSearch namespace | Move Comparator under the QueryStringSearch namespace
| Ruby | mit | umn-asr/query_string_search | ruby | ## Code Before:
module Comparator
def self.does(subject)
Comparison.new(subject)
end
class Comparison
attr_accessor :subject
def initialize(subject)
self.subject = subject
end
def equal?(other)
normalize(subject) == normalize(other)
end
def normalize(unnormalized)
if unnormalized.respond_to?(:each)
unnormalized.map(&:to_s).map(&:upcase)
else
unnormalized.to_s.upcase
end
end
def contain?(other)
normalize(subject).include?(normalize(other))
end
end
end
## Instruction:
Move Comparator under the QueryStringSearch namespace
## Code After:
module QueryStringSearch
module Comparator
def self.does(subject)
Comparison.new(subject)
end
class Comparison
attr_accessor :subject
def initialize(subject)
self.subject = subject
end
def equal?(other)
normalize(subject) == normalize(other)
end
def normalize(unnormalized)
if unnormalized.respond_to?(:each)
unnormalized.map(&:to_s).map(&:upcase)
else
unnormalized.to_s.upcase
end
end
def contain?(other)
normalize(subject).include?(normalize(other))
end
end
end
end
| + module QueryStringSearch
- module Comparator
+ module Comparator
? ++
- def self.does(subject)
+ def self.does(subject)
? ++
- Comparison.new(subject)
+ Comparison.new(subject)
? ++
- end
-
- class Comparison
- attr_accessor :subject
-
- def initialize(subject)
- self.subject = subject
end
+ class Comparison
+ attr_accessor :subject
- def equal?(other)
- normalize(subject) == normalize(other)
- end
+ def initialize(subject)
+ self.subject = subject
- def normalize(unnormalized)
- if unnormalized.respond_to?(:each)
- unnormalized.map(&:to_s).map(&:upcase)
- else
- unnormalized.to_s.upcase
end
- end
+ def equal?(other)
+ normalize(subject) == normalize(other)
+ end
+
+ def normalize(unnormalized)
+ if unnormalized.respond_to?(:each)
+ unnormalized.map(&:to_s).map(&:upcase)
+ else
+ unnormalized.to_s.upcase
+ end
+ end
+
- def contain?(other)
+ def contain?(other)
? ++
- normalize(subject).include?(normalize(other))
+ normalize(subject).include?(normalize(other))
? ++
+ end
end
end
end | 44 | 1.517241 | 23 | 21 |
d537d6c355be1a51bbb808e9da214f5595d75f3d | ios/web/public/browser_state.h | ios/web/public/browser_state.h | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_
#include "base/supports_user_data.h"
namespace net {
class URLRequestContextGetter;
}
namespace web {
// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class BrowserState : public base::SupportsUserData {
public:
~BrowserState() override;
// Return whether this BrowserState is incognito. Default is false.
virtual bool IsOffTheRecord() const = 0;
// Returns the request context information associated with this
// BrowserState.
virtual net::URLRequestContextGetter* GetRequestContext() = 0;
protected:
BrowserState();
};
} // namespace web
#endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_
| // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_
#include "base/supports_user_data.h"
namespace base {
class FilePath;
}
namespace net {
class URLRequestContextGetter;
}
namespace web {
// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class BrowserState : public base::SupportsUserData {
public:
~BrowserState() override;
// Return whether this BrowserState is incognito. Default is false.
virtual bool IsOffTheRecord() const = 0;
// Retrieves the path where the BrowserState data is stored.
virtual base::FilePath GetPath() const = 0;
// Returns the request context information associated with this
// BrowserState.
virtual net::URLRequestContextGetter* GetRequestContext() = 0;
protected:
BrowserState();
};
} // namespace web
#endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_
| Expand web::BrowserState to add GetPath() method | Expand web::BrowserState to add GetPath() method
Add a method to web::BrowserState returning the path where the
BrowserState data is stored.
BUG=429756
Review URL: https://codereview.chromium.org/740353002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#305191}
| C | bsd-3-clause | krieger-od/nwjs_chromium.src,dednal/chromium.src,markYoungH/chromium.src,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,ltilve/chromium,krieger-od/nwjs_chromium.src,jaruba/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,Fireblend/chromium-crosswalk,dushu1203/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,dednal/chromium.src,fujunwei/chromium-crosswalk,ltilve/chromium,Chilledheart/chromium,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,ltilve/chromium,M4sse/chromium.src,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dednal/chromium.src,Fireblend/chromium-crosswalk,markYoungH/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,PeterWangIntel/chromium-crosswalk,jaruba/chromium.src,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,ltilve/chromium,dushu1203/chromium.src,chuan9/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,M4sse/chromium.src,Just-D/chromium-1,Jonekee/chromium.src,dednal/chromium.src,Chilledheart/chromium,ltilve/chromium,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,markYoungH/chromium.src,ltilve/chromium,krieger-od/nwjs_chromium.src,dednal/chromium.src,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,Fireblend/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,M4sse/chromium.src,jaruba/chromium.src,dushu1203/chromium.src,dushu1203/chromium.src,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,ltilve/chromium,dushu1203/chromium.src,jaruba/chromium.src,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,dushu1203/chromium.src,Jonekee/chromium.src,hgl888/chromium-crosswalk,dednal/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,Just-D/chromium-1,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,fujunwei/chromium-crosswalk,Chilledheart/chromium,markYoungH/chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,fujunwei/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,dushu1203/chromium.src,M4sse/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,Just-D/chromium-1,dushu1203/chromium.src,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,jaruba/chromium.src,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,TheTypoMaster/chromium-crosswalk,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,chuan9/chromium-crosswalk,Chilledheart/chromium,chuan9/chromium-crosswalk,Fireblend/chromium-crosswalk,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,fujunwei/chromium-crosswalk,Jonekee/chromium.src,Jonekee/chromium.src,jaruba/chromium.src,krieger-od/nwjs_chromium.src,jaruba/chromium.src,jaruba/chromium.src,markYoungH/chromium.src,M4sse/chromium.src,chuan9/chromium-crosswalk,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,hgl888/chromium-crosswalk,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,krieger-od/nwjs_chromium.src,dednal/chromium.src,Just-D/chromium-1,dednal/chromium.src,krieger-od/nwjs_chromium.src,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,markYoungH/chromium.src,Just-D/chromium-1,Pluto-tv/chromium-crosswalk | c | ## Code Before:
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_
#include "base/supports_user_data.h"
namespace net {
class URLRequestContextGetter;
}
namespace web {
// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class BrowserState : public base::SupportsUserData {
public:
~BrowserState() override;
// Return whether this BrowserState is incognito. Default is false.
virtual bool IsOffTheRecord() const = 0;
// Returns the request context information associated with this
// BrowserState.
virtual net::URLRequestContextGetter* GetRequestContext() = 0;
protected:
BrowserState();
};
} // namespace web
#endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_
## Instruction:
Expand web::BrowserState to add GetPath() method
Add a method to web::BrowserState returning the path where the
BrowserState data is stored.
BUG=429756
Review URL: https://codereview.chromium.org/740353002
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#305191}
## Code After:
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_
#include "base/supports_user_data.h"
namespace base {
class FilePath;
}
namespace net {
class URLRequestContextGetter;
}
namespace web {
// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class BrowserState : public base::SupportsUserData {
public:
~BrowserState() override;
// Return whether this BrowserState is incognito. Default is false.
virtual bool IsOffTheRecord() const = 0;
// Retrieves the path where the BrowserState data is stored.
virtual base::FilePath GetPath() const = 0;
// Returns the request context information associated with this
// BrowserState.
virtual net::URLRequestContextGetter* GetRequestContext() = 0;
protected:
BrowserState();
};
} // namespace web
#endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_
| // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_WEB_PUBLIC_BROWSER_STATE_H_
#define IOS_WEB_PUBLIC_BROWSER_STATE_H_
#include "base/supports_user_data.h"
+
+ namespace base {
+ class FilePath;
+ }
namespace net {
class URLRequestContextGetter;
}
namespace web {
// This class holds the context needed for a browsing session.
// It lives on the UI thread. All these methods must only be called on the UI
// thread.
class BrowserState : public base::SupportsUserData {
public:
~BrowserState() override;
// Return whether this BrowserState is incognito. Default is false.
virtual bool IsOffTheRecord() const = 0;
+ // Retrieves the path where the BrowserState data is stored.
+ virtual base::FilePath GetPath() const = 0;
+
// Returns the request context information associated with this
// BrowserState.
virtual net::URLRequestContextGetter* GetRequestContext() = 0;
protected:
BrowserState();
};
} // namespace web
#endif // IOS_WEB_PUBLIC_BROWSER_STATE_H_ | 7 | 0.194444 | 7 | 0 |
0a0eccb2c7aa11a4cecf1ea5a0bf2100bf290250 | .travis.yml | .travis.yml | language: ruby
bundler_args: --without development
script: "bundle exec rspec spec"
rvm:
- 2.0
- 1.9.3
- jruby
- 1.9.2
- ruby-head
notifications:
recipients:
- michael@rabbitmq.com
matrix:
allow_failures:
- rvm: ruby-head
| language: ruby
bundler_args: --without development
script: "bundle exec rspec spec"
rvm:
- 2.2
- 2.1
- 2.0
- ruby-head
notifications:
recipients:
- michael@rabbitmq.com
matrix:
allow_failures:
- rvm: ruby-head
| Test against 2.1 and 2.2, drop 1.9.x | Test against 2.1 and 2.2, drop 1.9.x
Just like Bunny 2.0+ did. | YAML | mit | ruby-amqp/amq-protocol,ruby-amqp/amq-protocol | yaml | ## Code Before:
language: ruby
bundler_args: --without development
script: "bundle exec rspec spec"
rvm:
- 2.0
- 1.9.3
- jruby
- 1.9.2
- ruby-head
notifications:
recipients:
- michael@rabbitmq.com
matrix:
allow_failures:
- rvm: ruby-head
## Instruction:
Test against 2.1 and 2.2, drop 1.9.x
Just like Bunny 2.0+ did.
## Code After:
language: ruby
bundler_args: --without development
script: "bundle exec rspec spec"
rvm:
- 2.2
- 2.1
- 2.0
- ruby-head
notifications:
recipients:
- michael@rabbitmq.com
matrix:
allow_failures:
- rvm: ruby-head
| language: ruby
bundler_args: --without development
script: "bundle exec rspec spec"
rvm:
+ - 2.2
+ - 2.1
- 2.0
- - 1.9.3
- - jruby
- - 1.9.2
- ruby-head
notifications:
recipients:
- michael@rabbitmq.com
matrix:
allow_failures:
- rvm: ruby-head | 5 | 0.333333 | 2 | 3 |
92d5aa45f016618c86252e82ab9c4891c54f3b1e | _includes/comments.html | _includes/comments.html | {% if site.disqus_shortname %}
<div class="comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus_shortname }}';
(function () {
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
{% endif %} | {% if site.disqus_shortname %}
<div class="comments">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8&appId=442279082478382";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="https://oanhnn.github.io" data-numposts="10"></div>
{% comment %}
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus_shortname }}';
(function () {
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{% endcomment %}
</div>
{% endif %}
| Change to use Facebook comment plugin instead Disqus | Change to use Facebook comment plugin instead Disqus
| HTML | mit | oanhnn/oanhnn.github.io,oanhnn/oanhnn.github.io,oanhnn/oanhnn.github.io | html | ## Code Before:
{% if site.disqus_shortname %}
<div class="comments">
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus_shortname }}';
(function () {
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
{% endif %}
## Instruction:
Change to use Facebook comment plugin instead Disqus
## Code After:
{% if site.disqus_shortname %}
<div class="comments">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8&appId=442279082478382";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-comments" data-href="https://oanhnn.github.io" data-numposts="10"></div>
{% comment %}
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus_shortname }}';
(function () {
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{% endcomment %}
</div>
{% endif %}
| {% if site.disqus_shortname %}
<div class="comments">
+ <div id="fb-root"></div>
+ <script>(function(d, s, id) {
+ var js, fjs = d.getElementsByTagName(s)[0];
+ if (d.getElementById(id)) return;
+ js = d.createElement(s); js.id = id;
+ js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.8&appId=442279082478382";
+ fjs.parentNode.insertBefore(js, fjs);
+ }(document, 'script', 'facebook-jssdk'));</script>
+ <div class="fb-comments" data-href="https://oanhnn.github.io" data-numposts="10"></div>
+ {% comment %}
<div id="disqus_thread"></div>
<script type="text/javascript">
var disqus_shortname = '{{ site.disqus_shortname }}';
(function () {
var dsq = document.createElement('script');
dsq.type = 'text/javascript';
dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
- <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+ <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
? +
+ {% endcomment %}
</div>
{% endif %} | 13 | 0.8125 | 12 | 1 |
40bd25f06d10cbe1433a6d751dac7b3f22b39b02 | src/lib/configuration-template.ini | src/lib/configuration-template.ini | ; This is the configuration file of LegionBoard.
; Copy this file or rename it to "configuration.ini".
;
; @author Nico Alt
; @date 16.03.2016
;
; See the file "LICENSE" for the full license governing this code.
[MySQL]
; The host name or IP address of the MySQL databse.
Host = ""
; The MySQL user name.
User = ""
; The MySQL password.
Password = ""
; The MySQL database name.
Database = ""
; A prefix for the MySQL table names.
Table_Prefix = "lb_0"
| ; This is the configuration file of LegionBoard.
; Copy this file or rename it to "configuration.ini".
;
; @author Nico Alt
; @date 16.03.2016
;
; See the file "LICENSE" for the full license governing this code.
[MySQL]
; The host name or IP address of the MySQL databse.
Host = "localhost"
; The MySQL user name.
User = ""
; The MySQL password.
Password = ""
; The MySQL database name.
Database = "legionboard"
; A prefix for the MySQL table names.
Table_Prefix = "lb_0"
| Add default values for MySQL host and database | Add default values for MySQL host and database
| INI | agpl-3.0 | legionboard/heart | ini | ## Code Before:
; This is the configuration file of LegionBoard.
; Copy this file or rename it to "configuration.ini".
;
; @author Nico Alt
; @date 16.03.2016
;
; See the file "LICENSE" for the full license governing this code.
[MySQL]
; The host name or IP address of the MySQL databse.
Host = ""
; The MySQL user name.
User = ""
; The MySQL password.
Password = ""
; The MySQL database name.
Database = ""
; A prefix for the MySQL table names.
Table_Prefix = "lb_0"
## Instruction:
Add default values for MySQL host and database
## Code After:
; This is the configuration file of LegionBoard.
; Copy this file or rename it to "configuration.ini".
;
; @author Nico Alt
; @date 16.03.2016
;
; See the file "LICENSE" for the full license governing this code.
[MySQL]
; The host name or IP address of the MySQL databse.
Host = "localhost"
; The MySQL user name.
User = ""
; The MySQL password.
Password = ""
; The MySQL database name.
Database = "legionboard"
; A prefix for the MySQL table names.
Table_Prefix = "lb_0"
| ; This is the configuration file of LegionBoard.
; Copy this file or rename it to "configuration.ini".
;
; @author Nico Alt
; @date 16.03.2016
;
; See the file "LICENSE" for the full license governing this code.
[MySQL]
; The host name or IP address of the MySQL databse.
- Host = ""
+ Host = "localhost"
; The MySQL user name.
User = ""
; The MySQL password.
Password = ""
; The MySQL database name.
- Database = ""
+ Database = "legionboard"
; A prefix for the MySQL table names.
Table_Prefix = "lb_0" | 4 | 0.210526 | 2 | 2 |
eaf605dd5c49f3831d1b04592cd7f3aecb3b06b0 | spec/lib/netsweet/sso_spec.rb | spec/lib/netsweet/sso_spec.rb | require 'spec_helper'
describe Netsweet::SSO do
Given(:id) { new_id }
Given(:customer_attributes) do
{ external_id: id,
email: gen_email,
first_name: 'Alex',
last_name: 'Burkhart',
password: 'super_secret',
password2: 'super_secret',
give_access: true,
access_role: '1017',
is_person: true }.freeze
end
Given(:customer) { Netsweet::Customer.create(customer_attributes) }
context 'map_sso' do
Given(:sso) do
Netsweet::SSO.map_sso(customer, customer_attributes[:password])
end
Then { expect(sso).to_not have_failed(Netsweet::MapSSOFailed) }
end
end
| require 'spec_helper'
describe Netsweet::SSO do
Given(:id) { new_id }
Given(:customer_attributes) do
{ external_id: id,
email: gen_email,
first_name: 'Alex',
last_name: 'Burkhart',
password: 'super_secret',
password2: 'super_secret',
give_access: true,
access_role: '1017',
is_person: true }.freeze
end
Given(:customer) { Netsweet::Customer.create(customer_attributes) }
context 'map_sso' do
Given(:sso) do
Netsweet::SSO.map_sso(customer, customer_attributes[:password])
end
Then { expect(sso).to_not have_failed }
end
end
| Remove specific error class check when checking not failed | Remove specific error class check when checking not failed
| Ruby | mit | forever-inc/netsweet | ruby | ## Code Before:
require 'spec_helper'
describe Netsweet::SSO do
Given(:id) { new_id }
Given(:customer_attributes) do
{ external_id: id,
email: gen_email,
first_name: 'Alex',
last_name: 'Burkhart',
password: 'super_secret',
password2: 'super_secret',
give_access: true,
access_role: '1017',
is_person: true }.freeze
end
Given(:customer) { Netsweet::Customer.create(customer_attributes) }
context 'map_sso' do
Given(:sso) do
Netsweet::SSO.map_sso(customer, customer_attributes[:password])
end
Then { expect(sso).to_not have_failed(Netsweet::MapSSOFailed) }
end
end
## Instruction:
Remove specific error class check when checking not failed
## Code After:
require 'spec_helper'
describe Netsweet::SSO do
Given(:id) { new_id }
Given(:customer_attributes) do
{ external_id: id,
email: gen_email,
first_name: 'Alex',
last_name: 'Burkhart',
password: 'super_secret',
password2: 'super_secret',
give_access: true,
access_role: '1017',
is_person: true }.freeze
end
Given(:customer) { Netsweet::Customer.create(customer_attributes) }
context 'map_sso' do
Given(:sso) do
Netsweet::SSO.map_sso(customer, customer_attributes[:password])
end
Then { expect(sso).to_not have_failed }
end
end
| require 'spec_helper'
describe Netsweet::SSO do
Given(:id) { new_id }
Given(:customer_attributes) do
{ external_id: id,
email: gen_email,
first_name: 'Alex',
last_name: 'Burkhart',
password: 'super_secret',
password2: 'super_secret',
give_access: true,
access_role: '1017',
is_person: true }.freeze
end
Given(:customer) { Netsweet::Customer.create(customer_attributes) }
context 'map_sso' do
Given(:sso) do
Netsweet::SSO.map_sso(customer, customer_attributes[:password])
end
- Then { expect(sso).to_not have_failed(Netsweet::MapSSOFailed) }
? ------------------------
+ Then { expect(sso).to_not have_failed }
end
end | 2 | 0.074074 | 1 | 1 |
6f054e2ac2164b11eab2b087047ba708cc9b3a7d | example/QCheck_ounit_test.ml | example/QCheck_ounit_test.ml | let passing =
QCheck.Test.make ~count:1000
~name:"list_rev_is_involutive"
QCheck.(list small_int)
(fun l -> List.rev (List.rev l) = l);;
let failing =
QCheck.Test.make ~count:10
~name:"fail_sort_id"
QCheck.(list small_int)
(fun l -> l = List.sort compare l);;
let () =
let open OUnit2 in
run_test_tt_main
("tests" >:::
List.map QCheck_runner.to_ounit2_test [passing; failing])
| let passing =
QCheck.Test.make ~count:1000
~name:"list_rev_is_involutive"
QCheck.(list small_int)
(fun l -> List.rev (List.rev l) = l);;
let failing =
QCheck.Test.make ~count:10
~name:"fail_sort_id"
QCheck.(list small_int)
(fun l -> l = List.sort compare l);;
exception Error
let error =
QCheck.Test.make ~count:10
~name:"error_raise_exn"
QCheck.int
(fun _ -> raise Error)
let () =
Printexc.record_backtrace true;
let open OUnit2 in
run_test_tt_main
("tests" >:::
List.map QCheck_runner.to_ounit2_test [passing; failing; error])
| Add test case for raising exception | Add test case for raising exception
| OCaml | bsd-2-clause | c-cube/qcheck | ocaml | ## Code Before:
let passing =
QCheck.Test.make ~count:1000
~name:"list_rev_is_involutive"
QCheck.(list small_int)
(fun l -> List.rev (List.rev l) = l);;
let failing =
QCheck.Test.make ~count:10
~name:"fail_sort_id"
QCheck.(list small_int)
(fun l -> l = List.sort compare l);;
let () =
let open OUnit2 in
run_test_tt_main
("tests" >:::
List.map QCheck_runner.to_ounit2_test [passing; failing])
## Instruction:
Add test case for raising exception
## Code After:
let passing =
QCheck.Test.make ~count:1000
~name:"list_rev_is_involutive"
QCheck.(list small_int)
(fun l -> List.rev (List.rev l) = l);;
let failing =
QCheck.Test.make ~count:10
~name:"fail_sort_id"
QCheck.(list small_int)
(fun l -> l = List.sort compare l);;
exception Error
let error =
QCheck.Test.make ~count:10
~name:"error_raise_exn"
QCheck.int
(fun _ -> raise Error)
let () =
Printexc.record_backtrace true;
let open OUnit2 in
run_test_tt_main
("tests" >:::
List.map QCheck_runner.to_ounit2_test [passing; failing; error])
| let passing =
QCheck.Test.make ~count:1000
~name:"list_rev_is_involutive"
QCheck.(list small_int)
(fun l -> List.rev (List.rev l) = l);;
let failing =
QCheck.Test.make ~count:10
~name:"fail_sort_id"
QCheck.(list small_int)
(fun l -> l = List.sort compare l);;
+ exception Error
+
+ let error =
+ QCheck.Test.make ~count:10
+ ~name:"error_raise_exn"
+ QCheck.int
+ (fun _ -> raise Error)
+
let () =
+ Printexc.record_backtrace true;
let open OUnit2 in
run_test_tt_main
("tests" >:::
- List.map QCheck_runner.to_ounit2_test [passing; failing])
? --
+ List.map QCheck_runner.to_ounit2_test [passing; failing; error])
? +++++++
| 11 | 0.647059 | 10 | 1 |
96a9193955e818744a4f0b4217786370481310b9 | src/main/webapp/view/UserMenu.fragment.xml | src/main/webapp/view/UserMenu.fragment.xml | <core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:u="sap.ui.unified">
<u:Menu>
<u:MenuItem
text="Go to my own profile"
visible="{config>/IsMentor}"
select="onGotoMyProfile"
icon="sap-icon://customer"/>
<u:MenuItem
text="Logout"
select="onPressLogout"
icon="sap-icon://log"/>
</u:Menu>
</core:FragmentDefinition> | <core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:u="sap.ui.unified">
<u:Menu class="sapUiSizeCozy">
<u:MenuItem
text="Go to my own profile"
visible="{config>/IsMentor}"
select="onGotoMyProfile"
icon="sap-icon://customer"/>
<u:MenuItem
text="Logout"
select="onPressLogout"
icon="sap-icon://log"/>
</u:Menu>
</core:FragmentDefinition> | Make the user menu class cozy | Make the user menu class cozy | XML | mit | sapmentors/lemonaid,sapmentors/lemonaid,sapmentors/lemonaid | xml | ## Code Before:
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:u="sap.ui.unified">
<u:Menu>
<u:MenuItem
text="Go to my own profile"
visible="{config>/IsMentor}"
select="onGotoMyProfile"
icon="sap-icon://customer"/>
<u:MenuItem
text="Logout"
select="onPressLogout"
icon="sap-icon://log"/>
</u:Menu>
</core:FragmentDefinition>
## Instruction:
Make the user menu class cozy
## Code After:
<core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:u="sap.ui.unified">
<u:Menu class="sapUiSizeCozy">
<u:MenuItem
text="Go to my own profile"
visible="{config>/IsMentor}"
select="onGotoMyProfile"
icon="sap-icon://customer"/>
<u:MenuItem
text="Logout"
select="onPressLogout"
icon="sap-icon://log"/>
</u:Menu>
</core:FragmentDefinition> | <core:FragmentDefinition
xmlns="sap.m"
xmlns:core="sap.ui.core"
xmlns:u="sap.ui.unified">
- <u:Menu>
+ <u:Menu class="sapUiSizeCozy">
<u:MenuItem
text="Go to my own profile"
visible="{config>/IsMentor}"
select="onGotoMyProfile"
icon="sap-icon://customer"/>
<u:MenuItem
text="Logout"
select="onPressLogout"
icon="sap-icon://log"/>
</u:Menu>
-
</core:FragmentDefinition> | 3 | 0.176471 | 1 | 2 |
0bfb68437305e318f92c33080aaecaa4e569b54a | Readme.md | Readme.md | A simple wrapper for Google's LevelDB.
To make this work:
1. Drag LevelDB.h and LevelDB.mm into your project.
2. Clone [Google's leveldb](http://code.google.com/p/leveldb/source/checkout), preferably as a submodule of your project
3. In the leveldb library source directory, run `make PLATFORM=IOS` to build the library file
4. Add libleveldb.a to your project as a dependency
5. Add the leveldb/include path to your header path
6. Make sure any class that imports leveldb is a `.mm` file. LevelDB is written in C++, so it can only be included by an Objective-C++ file
Here is a simple example:
LevelDB *ldb = [LevelDB databaseInLibraryWithName:@"test.ldb"];
//test string
[ldb setObject:@"laval" forKey:@"string_test"];
NSLog(@"String Value: %@", [ldb getString:@"string_test"]);
//test dictionary
[ldb setObject:[NSDictionary dictionaryWithObjectsAndKeys:@"val1", @"key1", @"val2", @"key2", nil] forKey:@"dict_test"];
NSLog(@"Dictionary Value: %@", [ldb getDictionary:@"dict_test"]);
[super viewDidLoad]; |
This is a simple wrapper for Google's LevelDB. LevelDB is a fast key-value store written by Google.
### Instructions
1. Drag LevelDB.h and LevelDB.mm into your project.
2. Clone [Google's leveldb](http://code.google.com/p/leveldb/source/checkout), preferably as a submodule of your project
3. In the leveldb library source directory, run `make PLATFORM=IOS` to build the library file
4. Add libleveldb.a to your project as a dependency
5. Add the leveldb/include path to your header path
6. Make sure any class that imports leveldb is a `.mm` file. LevelDB is written in C++, so it can only be included by an Objective-C++ file
### Example
LevelDB *ldb = [LevelDB databaseInLibraryWithName:@"test.ldb"];
//test string
[ldb setObject:@"laval" forKey:@"string_test"];
NSLog(@"String Value: %@", [ldb getString:@"string_test"]);
//test dictionary
[ldb setObject:[NSDictionary dictionaryWithObjectsAndKeys:@"val1", @"key1", @"val2", @"key2", nil] forKey:@"dict_test"];
NSLog(@"Dictionary Value: %@", [ldb getDictionary:@"dict_test"]);
[super viewDidLoad];
### License
Distributed under the MIT license | Update the readme with license info | Update the readme with license info
| Markdown | mit | cybertk/Objective-LevelDB,matehat/Objective-LevelDB,yincheng1988/Objective-LevelDB,i-miss-you/Objective-LevelDB,fullstackclub/Objective-LevelDB,i-miss-you/Objective-LevelDB,uber/Objective-LevelDB,cureHsu/Objective-LevelDB,fullstackclub/Objective-LevelDB,cybertk/Objective-LevelDB,uber/Objective-LevelDB,cybertk/Objective-LevelDB,i-miss-you/Objective-LevelDB,akkakks/Objective-LevelDB,cureHsu/Objective-LevelDB,yincheng1988/Objective-LevelDB,jinjian1991/Objective-LevelDB,lsm/LevelDB-ObjC,matehat/Objective-LevelDB,uber/Objective-LevelDB,uber/Objective-LevelDB,matehat/Objective-LevelDB,appunite/Objective-LevelDB,cureHsu/Objective-LevelDB,fullstackclub/Objective-LevelDB,appunite/Objective-LevelDB,appunite/Objective-LevelDB,cureHsu/Objective-LevelDB,jinjian1991/Objective-LevelDB,lsm/LevelDB-ObjC,yincheng1988/Objective-LevelDB,i-miss-you/Objective-LevelDB,jinjian1991/Objective-LevelDB,lsm/LevelDB-ObjC | markdown | ## Code Before:
A simple wrapper for Google's LevelDB.
To make this work:
1. Drag LevelDB.h and LevelDB.mm into your project.
2. Clone [Google's leveldb](http://code.google.com/p/leveldb/source/checkout), preferably as a submodule of your project
3. In the leveldb library source directory, run `make PLATFORM=IOS` to build the library file
4. Add libleveldb.a to your project as a dependency
5. Add the leveldb/include path to your header path
6. Make sure any class that imports leveldb is a `.mm` file. LevelDB is written in C++, so it can only be included by an Objective-C++ file
Here is a simple example:
LevelDB *ldb = [LevelDB databaseInLibraryWithName:@"test.ldb"];
//test string
[ldb setObject:@"laval" forKey:@"string_test"];
NSLog(@"String Value: %@", [ldb getString:@"string_test"]);
//test dictionary
[ldb setObject:[NSDictionary dictionaryWithObjectsAndKeys:@"val1", @"key1", @"val2", @"key2", nil] forKey:@"dict_test"];
NSLog(@"Dictionary Value: %@", [ldb getDictionary:@"dict_test"]);
[super viewDidLoad];
## Instruction:
Update the readme with license info
## Code After:
This is a simple wrapper for Google's LevelDB. LevelDB is a fast key-value store written by Google.
### Instructions
1. Drag LevelDB.h and LevelDB.mm into your project.
2. Clone [Google's leveldb](http://code.google.com/p/leveldb/source/checkout), preferably as a submodule of your project
3. In the leveldb library source directory, run `make PLATFORM=IOS` to build the library file
4. Add libleveldb.a to your project as a dependency
5. Add the leveldb/include path to your header path
6. Make sure any class that imports leveldb is a `.mm` file. LevelDB is written in C++, so it can only be included by an Objective-C++ file
### Example
LevelDB *ldb = [LevelDB databaseInLibraryWithName:@"test.ldb"];
//test string
[ldb setObject:@"laval" forKey:@"string_test"];
NSLog(@"String Value: %@", [ldb getString:@"string_test"]);
//test dictionary
[ldb setObject:[NSDictionary dictionaryWithObjectsAndKeys:@"val1", @"key1", @"val2", @"key2", nil] forKey:@"dict_test"];
NSLog(@"Dictionary Value: %@", [ldb getDictionary:@"dict_test"]);
[super viewDidLoad];
### License
Distributed under the MIT license | - A simple wrapper for Google's LevelDB.
- To make this work:
+ This is a simple wrapper for Google's LevelDB. LevelDB is a fast key-value store written by Google.
+
+ ### Instructions
1. Drag LevelDB.h and LevelDB.mm into your project.
2. Clone [Google's leveldb](http://code.google.com/p/leveldb/source/checkout), preferably as a submodule of your project
3. In the leveldb library source directory, run `make PLATFORM=IOS` to build the library file
4. Add libleveldb.a to your project as a dependency
5. Add the leveldb/include path to your header path
6. Make sure any class that imports leveldb is a `.mm` file. LevelDB is written in C++, so it can only be included by an Objective-C++ file
- Here is a simple example:
+ ### Example
LevelDB *ldb = [LevelDB databaseInLibraryWithName:@"test.ldb"];
//test string
[ldb setObject:@"laval" forKey:@"string_test"];
NSLog(@"String Value: %@", [ldb getString:@"string_test"]);
//test dictionary
[ldb setObject:[NSDictionary dictionaryWithObjectsAndKeys:@"val1", @"key1", @"val2", @"key2", nil] forKey:@"dict_test"];
NSLog(@"Dictionary Value: %@", [ldb getDictionary:@"dict_test"]);
[super viewDidLoad];
+
+ ### License
+
+ Distributed under the MIT license | 11 | 0.478261 | 8 | 3 |
3a47e3ffa11b75fd676c2e74add761bf36da6b01 | guacamole-ext/src/main/java/net/sourceforge/guacamole/net/event/listener/package-info.java | guacamole-ext/src/main/java/net/sourceforge/guacamole/net/event/listener/package-info.java |
/**
* Provides classes for hooking into various events that take place as
* users log into and use the Guacamole web application. These event
* hooks can be used to take action upon occurence of an event and,
* in some cases, prevent the web application from allowing the
* event to continue for the user that triggered it.
*/
package net.sourceforge.guacamole.net.event;
|
/**
* Provides classes for hooking into various events that take place as
* users log into and use the Guacamole web application. These event
* hooks can be used to take action upon occurrence of an event and,
* in some cases, prevent the web application from allowing the
* event to continue for the user that triggered it.
*/
package net.sourceforge.guacamole.net.event.listener;
| Fix wrong package and typo. | Fix wrong package and typo. | Java | apache-2.0 | lato333/guacamole-client,MaxSmile/guacamole-client,mike-jumper/incubator-guacamole-client,Akheon23/guacamole-client,jmuehlner/incubator-guacamole-client,MaxSmile/guacamole-client,glyptodon/guacamole-client,hguehl/incubator-guacamole-client,Akheon23/guacamole-client,necouchman/incubator-guacamole-client,DaanWillemsen/guacamole-client,flangelo/guacamole-client,lato333/guacamole-client,mike-jumper/incubator-guacamole-client,TribeMedia/guacamole-client,necouchman/incubator-guacamole-client,AIexandr/guacamole-client,lato333/guacamole-client,noelbk/guacamole-client,Akheon23/guacamole-client,jmuehlner/incubator-guacamole-client,necouchman/incubator-guacamole-client,lato333/guacamole-client,mike-jumper/incubator-guacamole-client,hguehl/incubator-guacamole-client,softpymesJeffer/incubator-guacamole-client,jmuehlner/incubator-guacamole-client,TheAxnJaxn/guacamole-client,nkoterba/guacamole-common-js,softpymesJeffer/incubator-guacamole-client,glyptodon/guacamole-client,hguehl/incubator-guacamole-client,AIexandr/guacamole-client,glyptodon/guacamole-client,AIexandr/guacamole-client,hguehl/incubator-guacamole-client,TribeMedia/guacamole-client,DaanWillemsen/guacamole-client,flangelo/guacamole-client,MaxSmile/guacamole-client,esmailpour-hosein/incubator-guacamole-client,TheAxnJaxn/guacamole-client,glyptodon/guacamole-client,flangelo/guacamole-client,noelbk/guacamole-client,qiangyee/guacamole-client,mike-jumper/incubator-guacamole-client,glyptodon/guacamole-client,DaanWillemsen/guacamole-client,noelbk/guacamole-client,softpymesJeffer/incubator-guacamole-client,softpymesJeffer/incubator-guacamole-client,jmuehlner/incubator-guacamole-client,necouchman/incubator-guacamole-client,qiangyee/guacamole-client,qiangyee/guacamole-client,TheAxnJaxn/guacamole-client,TribeMedia/guacamole-client | java | ## Code Before:
/**
* Provides classes for hooking into various events that take place as
* users log into and use the Guacamole web application. These event
* hooks can be used to take action upon occurence of an event and,
* in some cases, prevent the web application from allowing the
* event to continue for the user that triggered it.
*/
package net.sourceforge.guacamole.net.event;
## Instruction:
Fix wrong package and typo.
## Code After:
/**
* Provides classes for hooking into various events that take place as
* users log into and use the Guacamole web application. These event
* hooks can be used to take action upon occurrence of an event and,
* in some cases, prevent the web application from allowing the
* event to continue for the user that triggered it.
*/
package net.sourceforge.guacamole.net.event.listener;
|
/**
* Provides classes for hooking into various events that take place as
* users log into and use the Guacamole web application. These event
- * hooks can be used to take action upon occurence of an event and,
+ * hooks can be used to take action upon occurrence of an event and,
? +
* in some cases, prevent the web application from allowing the
* event to continue for the user that triggered it.
*/
- package net.sourceforge.guacamole.net.event;
+ package net.sourceforge.guacamole.net.event.listener;
? +++++++++
| 4 | 0.4 | 2 | 2 |
f886ff902d3f3fef08d4fb0d44d79499607ba2c1 | tests/BasicClassTemplateTest.php | tests/BasicClassTemplateTest.php | <?php
/*
* This file is part of the Onema ClassyFile Package.
* For the full copyright and license information,
* please view the LICENSE file that was distributed
* with this source code.
*/
namespace Onema\Test;
use Onema\ClassyFile\Template\BasicClassTemplate;
/**
* BasicClassTemplateTest - Description.
*
* @author Juan Manuel Torres <kinojman@gmail.com>
* @copyright (c) 2015, Onema
* @group template
*/
class BasicClassTemplateTest extends \PHPUnit_Framework_TestCase
{
public function testDefaultTest ()
{
$date = new \DateTime();
$templateClass = new BasicClassTemplate();
$template = $templateClass->getTemplate('foo', 'bar', 'blah', 'lala');
$this->assertRegExp(sprintf('/%s/', $date->format('Y')), $template);
$this->assertRegExp(sprintf('/%s/', 'Juan Manuel Torres'), $template);
}
public function testCustomTest ()
{
$expectedTemplate = sprintf('<?php%s%s%s%s%s%s%s%s%s', '', 'foo', PHP_EOL, 'bar', PHP_EOL, 'blah', PHP_EOL, 'lala', PHP_EOL);
$templateClass = new BasicClassTemplate('');
$template = $templateClass->getTemplate('foo', 'bar', 'blah', 'lala');
$this->assertEquals($expectedTemplate, $template);
}
}
| <?php
/*
* This file is part of the Onema ClassyFile Package.
* For the full copyright and license information,
* please view the LICENSE file that was distributed
* with this source code.
*/
namespace Onema\Test;
use Onema\ClassyFile\Template\BasicClassTemplate;
/**
* BasicClassTemplateTest - Description.
*
* @author Juan Manuel Torres <kinojman@gmail.com>
* @copyright (c) 2015, Onema
* @group template
*/
class BasicClassTemplateTest extends \PHPUnit_Framework_TestCase
{
public function testDefaultTest ()
{
$date = new \DateTime();
$templateClass = new BasicClassTemplate();
$template = $templateClass->getTemplate('foo', 'bar', 'blah', 'lala');
$this->assertRegExp(sprintf('/%s/', $date->format('Y')), $template);
$this->assertRegExp(sprintf('/%s/', 'Juan Manuel Torres'), $template);
}
public function testCustomTest ()
{
$expectedTemplate = sprintf('<?php%s%s%s%s%s%s%s%s%s%s', PHP_EOL, 'foo', PHP_EOL, 'bar', PHP_EOL, PHP_EOL, 'blah', PHP_EOL, 'lala', PHP_EOL);
$templateClass = new BasicClassTemplate('');
$template = $templateClass->getTemplate('foo', 'bar', 'blah', 'lala');
$this->assertEquals($expectedTemplate, $template);
}
}
| Update unit test to test for latest updates in the basic class template class. | Update unit test to test for latest updates in the basic class template class.
| PHP | mit | onema/classyfile | php | ## Code Before:
<?php
/*
* This file is part of the Onema ClassyFile Package.
* For the full copyright and license information,
* please view the LICENSE file that was distributed
* with this source code.
*/
namespace Onema\Test;
use Onema\ClassyFile\Template\BasicClassTemplate;
/**
* BasicClassTemplateTest - Description.
*
* @author Juan Manuel Torres <kinojman@gmail.com>
* @copyright (c) 2015, Onema
* @group template
*/
class BasicClassTemplateTest extends \PHPUnit_Framework_TestCase
{
public function testDefaultTest ()
{
$date = new \DateTime();
$templateClass = new BasicClassTemplate();
$template = $templateClass->getTemplate('foo', 'bar', 'blah', 'lala');
$this->assertRegExp(sprintf('/%s/', $date->format('Y')), $template);
$this->assertRegExp(sprintf('/%s/', 'Juan Manuel Torres'), $template);
}
public function testCustomTest ()
{
$expectedTemplate = sprintf('<?php%s%s%s%s%s%s%s%s%s', '', 'foo', PHP_EOL, 'bar', PHP_EOL, 'blah', PHP_EOL, 'lala', PHP_EOL);
$templateClass = new BasicClassTemplate('');
$template = $templateClass->getTemplate('foo', 'bar', 'blah', 'lala');
$this->assertEquals($expectedTemplate, $template);
}
}
## Instruction:
Update unit test to test for latest updates in the basic class template class.
## Code After:
<?php
/*
* This file is part of the Onema ClassyFile Package.
* For the full copyright and license information,
* please view the LICENSE file that was distributed
* with this source code.
*/
namespace Onema\Test;
use Onema\ClassyFile\Template\BasicClassTemplate;
/**
* BasicClassTemplateTest - Description.
*
* @author Juan Manuel Torres <kinojman@gmail.com>
* @copyright (c) 2015, Onema
* @group template
*/
class BasicClassTemplateTest extends \PHPUnit_Framework_TestCase
{
public function testDefaultTest ()
{
$date = new \DateTime();
$templateClass = new BasicClassTemplate();
$template = $templateClass->getTemplate('foo', 'bar', 'blah', 'lala');
$this->assertRegExp(sprintf('/%s/', $date->format('Y')), $template);
$this->assertRegExp(sprintf('/%s/', 'Juan Manuel Torres'), $template);
}
public function testCustomTest ()
{
$expectedTemplate = sprintf('<?php%s%s%s%s%s%s%s%s%s%s', PHP_EOL, 'foo', PHP_EOL, 'bar', PHP_EOL, PHP_EOL, 'blah', PHP_EOL, 'lala', PHP_EOL);
$templateClass = new BasicClassTemplate('');
$template = $templateClass->getTemplate('foo', 'bar', 'blah', 'lala');
$this->assertEquals($expectedTemplate, $template);
}
}
| <?php
/*
* This file is part of the Onema ClassyFile Package.
* For the full copyright and license information,
* please view the LICENSE file that was distributed
* with this source code.
*/
namespace Onema\Test;
use Onema\ClassyFile\Template\BasicClassTemplate;
/**
* BasicClassTemplateTest - Description.
*
* @author Juan Manuel Torres <kinojman@gmail.com>
* @copyright (c) 2015, Onema
* @group template
*/
class BasicClassTemplateTest extends \PHPUnit_Framework_TestCase
{
public function testDefaultTest ()
{
$date = new \DateTime();
$templateClass = new BasicClassTemplate();
$template = $templateClass->getTemplate('foo', 'bar', 'blah', 'lala');
$this->assertRegExp(sprintf('/%s/', $date->format('Y')), $template);
$this->assertRegExp(sprintf('/%s/', 'Juan Manuel Torres'), $template);
}
public function testCustomTest ()
{
- $expectedTemplate = sprintf('<?php%s%s%s%s%s%s%s%s%s', '', 'foo', PHP_EOL, 'bar', PHP_EOL, 'blah', PHP_EOL, 'lala', PHP_EOL);
? ^^
+ $expectedTemplate = sprintf('<?php%s%s%s%s%s%s%s%s%s%s', PHP_EOL, 'foo', PHP_EOL, 'bar', PHP_EOL, PHP_EOL, 'blah', PHP_EOL, 'lala', PHP_EOL);
? ++ ^^^^^^^ +++++++++
$templateClass = new BasicClassTemplate('');
$template = $templateClass->getTemplate('foo', 'bar', 'blah', 'lala');
$this->assertEquals($expectedTemplate, $template);
}
} | 2 | 0.051282 | 1 | 1 |
29a46de2a2c386cde54826874d5fc082bbd80f5b | command_cleanup.go | command_cleanup.go | package main
import "fmt"
func commandCleanupChecks(done chan bool, printOnly bool) {
if !printOnly {
dbOpen()
}
stmts := []string{
`DELETE FROM check_instance_configurations;`,
`DELETE FROM check_instance_configuration_dependencies;`,
`DELETE FROM check_instances;`,
`DELETE FROM checks;`,
`DELETE FROM configuration_thresholds;`,
`DELETE FROM constraints_custom_property;`,
`DELETE FROM constraints_native_property;`,
`DELETE FROM constraints_oncall_property;`,
`DELETE FROM constraints_service_attribute;`,
`DELETE FROM constraints_service_property;`,
`DELETE FROM constraints_system_property;`,
`DELETE FROM check_configurations;`,
}
for _, stmt := range stmts {
if printOnly {
fmt.Println(stmt)
continue
}
db.Exec(stmt)
}
}
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix
| package main
import "fmt"
func commandCleanupChecks(done chan bool, printOnly bool) {
if !printOnly {
dbOpen()
}
stmts := []string{
`DELETE FROM check_instance_configurations;`,
`DELETE FROM check_instance_configuration_dependencies;`,
`DELETE FROM check_instances;`,
`DELETE FROM checks;`,
`DELETE FROM configuration_thresholds;`,
`DELETE FROM constraints_custom_property;`,
`DELETE FROM constraints_native_property;`,
`DELETE FROM constraints_oncall_property;`,
`DELETE FROM constraints_service_attribute;`,
`DELETE FROM constraints_service_property;`,
`DELETE FROM constraints_system_property;`,
`DELETE FROM check_configurations;`,
}
for _, stmt := range stmts {
if printOnly {
fmt.Println(stmt)
continue
}
db.Exec(stmt)
}
done <- true
}
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix
| Make cleanup checks command terminate | Make cleanup checks command terminate
| Go | bsd-2-clause | 1and1/soma | go | ## Code Before:
package main
import "fmt"
func commandCleanupChecks(done chan bool, printOnly bool) {
if !printOnly {
dbOpen()
}
stmts := []string{
`DELETE FROM check_instance_configurations;`,
`DELETE FROM check_instance_configuration_dependencies;`,
`DELETE FROM check_instances;`,
`DELETE FROM checks;`,
`DELETE FROM configuration_thresholds;`,
`DELETE FROM constraints_custom_property;`,
`DELETE FROM constraints_native_property;`,
`DELETE FROM constraints_oncall_property;`,
`DELETE FROM constraints_service_attribute;`,
`DELETE FROM constraints_service_property;`,
`DELETE FROM constraints_system_property;`,
`DELETE FROM check_configurations;`,
}
for _, stmt := range stmts {
if printOnly {
fmt.Println(stmt)
continue
}
db.Exec(stmt)
}
}
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix
## Instruction:
Make cleanup checks command terminate
## Code After:
package main
import "fmt"
func commandCleanupChecks(done chan bool, printOnly bool) {
if !printOnly {
dbOpen()
}
stmts := []string{
`DELETE FROM check_instance_configurations;`,
`DELETE FROM check_instance_configuration_dependencies;`,
`DELETE FROM check_instances;`,
`DELETE FROM checks;`,
`DELETE FROM configuration_thresholds;`,
`DELETE FROM constraints_custom_property;`,
`DELETE FROM constraints_native_property;`,
`DELETE FROM constraints_oncall_property;`,
`DELETE FROM constraints_service_attribute;`,
`DELETE FROM constraints_service_property;`,
`DELETE FROM constraints_system_property;`,
`DELETE FROM check_configurations;`,
}
for _, stmt := range stmts {
if printOnly {
fmt.Println(stmt)
continue
}
db.Exec(stmt)
}
done <- true
}
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix
| package main
import "fmt"
func commandCleanupChecks(done chan bool, printOnly bool) {
if !printOnly {
dbOpen()
}
stmts := []string{
`DELETE FROM check_instance_configurations;`,
`DELETE FROM check_instance_configuration_dependencies;`,
`DELETE FROM check_instances;`,
`DELETE FROM checks;`,
`DELETE FROM configuration_thresholds;`,
`DELETE FROM constraints_custom_property;`,
`DELETE FROM constraints_native_property;`,
`DELETE FROM constraints_oncall_property;`,
`DELETE FROM constraints_service_attribute;`,
`DELETE FROM constraints_service_property;`,
`DELETE FROM constraints_system_property;`,
`DELETE FROM check_configurations;`,
}
for _, stmt := range stmts {
if printOnly {
fmt.Println(stmt)
continue
}
db.Exec(stmt)
}
+
+ done <- true
}
// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix | 2 | 0.058824 | 2 | 0 |
0740d16b60a3ecc26e72c51ea85257b2c0d03d18 | setup.py | setup.py | from __future__ import absolute_import
from setuptools import setup
long_description="""TravisCI results
.. image:: https://travis-ci.org/nanonyme/simplecpreprocessor.svg
"""
setup(
name = "simplecpreprocessor",
author = "Seppo Yli-Olli",
author_email = "seppo.yli-olli@iki.fi",
description = "Simple C preprocessor for usage eg before CFFI",
keywords = "python c preprocessor",
license = "BSD",
url = "https://github.com/nanonyme/simplecpreprocessor",
py_modules=["simplecpreprocessor"],
long_description=long_description,
use_scm_version=True,
setup_requires=["setuptools_scm"],
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
)
| from __future__ import absolute_import
from setuptools import setup
long_description="""http://github.com/nanonyme/simplepreprocessor"""
setup(
name = "simplecpreprocessor",
author = "Seppo Yli-Olli",
author_email = "seppo.yli-olli@iki.fi",
description = "Simple C preprocessor for usage eg before CFFI",
keywords = "python c preprocessor",
license = "BSD",
url = "https://github.com/nanonyme/simplecpreprocessor",
py_modules=["simplecpreprocessor"],
long_description=long_description,
use_scm_version=True,
setup_requires=["setuptools_scm"],
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
)
| Make long description not point to Travis since can't guarantee tag | Make long description not point to Travis since can't guarantee tag
| Python | mit | nanonyme/simplecpreprocessor | python | ## Code Before:
from __future__ import absolute_import
from setuptools import setup
long_description="""TravisCI results
.. image:: https://travis-ci.org/nanonyme/simplecpreprocessor.svg
"""
setup(
name = "simplecpreprocessor",
author = "Seppo Yli-Olli",
author_email = "seppo.yli-olli@iki.fi",
description = "Simple C preprocessor for usage eg before CFFI",
keywords = "python c preprocessor",
license = "BSD",
url = "https://github.com/nanonyme/simplecpreprocessor",
py_modules=["simplecpreprocessor"],
long_description=long_description,
use_scm_version=True,
setup_requires=["setuptools_scm"],
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
)
## Instruction:
Make long description not point to Travis since can't guarantee tag
## Code After:
from __future__ import absolute_import
from setuptools import setup
long_description="""http://github.com/nanonyme/simplepreprocessor"""
setup(
name = "simplecpreprocessor",
author = "Seppo Yli-Olli",
author_email = "seppo.yli-olli@iki.fi",
description = "Simple C preprocessor for usage eg before CFFI",
keywords = "python c preprocessor",
license = "BSD",
url = "https://github.com/nanonyme/simplecpreprocessor",
py_modules=["simplecpreprocessor"],
long_description=long_description,
use_scm_version=True,
setup_requires=["setuptools_scm"],
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
)
| from __future__ import absolute_import
from setuptools import setup
+ long_description="""http://github.com/nanonyme/simplepreprocessor"""
- long_description="""TravisCI results
- .. image:: https://travis-ci.org/nanonyme/simplecpreprocessor.svg
- """
-
setup(
name = "simplecpreprocessor",
author = "Seppo Yli-Olli",
author_email = "seppo.yli-olli@iki.fi",
description = "Simple C preprocessor for usage eg before CFFI",
keywords = "python c preprocessor",
license = "BSD",
url = "https://github.com/nanonyme/simplecpreprocessor",
py_modules=["simplecpreprocessor"],
long_description=long_description,
use_scm_version=True,
setup_requires=["setuptools_scm"],
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
],
) | 5 | 0.192308 | 1 | 4 |
bd2d78b6b19b3ba8d336d98000df2829f7cc42e8 | basis/furnace/alloy/alloy.factor | basis/furnace/alloy/alloy.factor | ! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel sequences db.tuples alarms calendar db fry
furnace.db
furnace.cache
furnace.asides
furnace.referrer
furnace.sessions
furnace.conversations
furnace.auth.providers
furnace.auth.login.permits ;
IN: furnace.alloy
: state-classes { session aside conversation permit } ; inline
: init-furnace-tables ( -- )
state-classes ensure-tables
user ensure-table ;
: <alloy> ( responder db -- responder' )
[ [ init-furnace-tables ] with-db ] keep
[
<asides>
<conversations>
<sessions>
] dip
<db-persistence>
<check-form-submissions> ;
: start-expiring ( db -- )
'[
_ [ state-classes [ expire-state ] each ] with-db
] 5 minutes every drop ;
| ! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel sequences db.tuples alarms calendar db fry
furnace.db
furnace.cache
furnace.asides
furnace.sessions
furnace.conversations
furnace.auth.providers
furnace.auth.login.permits ;
IN: furnace.alloy
: state-classes { session aside conversation permit } ; inline
: init-furnace-tables ( -- )
state-classes ensure-tables
user ensure-table ;
: <alloy> ( responder db -- responder' )
[ [ init-furnace-tables ] with-db ] keep
[
<asides>
<conversations>
<sessions>
] dip
<db-persistence> ;
: start-expiring ( db -- )
'[
_ [ state-classes [ expire-state ] each ] with-db
] 5 minutes every drop ;
| Disable referrer checking by default since adblock doesn't send it for some lame reason | Disable referrer checking by default since adblock doesn't send it for some lame reason
| Factor | bsd-2-clause | factor/factor,sarvex/factor-lang,dharmatech/factor,AlexIljin/factor,dharmatech/factor,bjourne/factor,seckar/factor,mrjbq7/factor,bjourne/factor,jwmerrill/factor,dharmatech/factor,bjourne/factor,kingcons/factor,sarvex/factor-lang,slavapestov/factor,tgunr/factor,kingcons/factor,mrjbq7/factor,erg/factor,mcandre/factor,ehird/factor,factor/factor,littledan/Factor,Keyholder/factor,nicolas-p/factor,nicolas-p/factor,cataska/factor,bjourne/factor,AlexIljin/factor,ehird/factor,mrjbq7/factor,ceninan/factor,slavapestov/factor,mcandre/factor,mcandre/factor,tgunr/factor,slavapestov/factor,seckar/factor,littledan/Factor,sarvex/factor-lang,mcandre/factor,slavapestov/factor,factor/factor,mrjbq7/factor,tgunr/factor,slavapestov/factor,cataska/factor,cataska/factor,AlexIljin/factor,slavapestov/factor,tgunr/factor,bpollack/factor,mcandre/factor,mcandre/factor,nicolas-p/factor,bpollack/factor,Keyholder/factor,jwmerrill/factor,tgunr/factor,slavapestov/factor,factor/factor,bjourne/factor,littledan/Factor,dch/factor,sarvex/factor-lang,mrjbq7/factor,bpollack/factor,AlexIljin/factor,kingcons/factor,erg/factor,factor/factor,seckar/factor,jwmerrill/factor,bpollack/factor,dch/factor,factor/factor,dch/factor,sarvex/factor-lang,Keyholder/factor,dch/factor,nicolas-p/factor,nicolas-p/factor,AlexIljin/factor,kingcons/factor,ceninan/factor,sarvex/factor-lang,erg/factor,bpollack/factor,erg/factor,littledan/Factor,sarvex/factor-lang,mrjbq7/factor,mcandre/factor,dch/factor,cataska/factor,AlexIljin/factor,nicolas-p/factor,AlexIljin/factor,bpollack/factor,ceninan/factor,ehird/factor,bjourne/factor,erg/factor,erg/factor,dch/factor,ceninan/factor,erg/factor,tgunr/factor,nicolas-p/factor,bpollack/factor,bjourne/factor | factor | ## Code Before:
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel sequences db.tuples alarms calendar db fry
furnace.db
furnace.cache
furnace.asides
furnace.referrer
furnace.sessions
furnace.conversations
furnace.auth.providers
furnace.auth.login.permits ;
IN: furnace.alloy
: state-classes { session aside conversation permit } ; inline
: init-furnace-tables ( -- )
state-classes ensure-tables
user ensure-table ;
: <alloy> ( responder db -- responder' )
[ [ init-furnace-tables ] with-db ] keep
[
<asides>
<conversations>
<sessions>
] dip
<db-persistence>
<check-form-submissions> ;
: start-expiring ( db -- )
'[
_ [ state-classes [ expire-state ] each ] with-db
] 5 minutes every drop ;
## Instruction:
Disable referrer checking by default since adblock doesn't send it for some lame reason
## Code After:
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel sequences db.tuples alarms calendar db fry
furnace.db
furnace.cache
furnace.asides
furnace.sessions
furnace.conversations
furnace.auth.providers
furnace.auth.login.permits ;
IN: furnace.alloy
: state-classes { session aside conversation permit } ; inline
: init-furnace-tables ( -- )
state-classes ensure-tables
user ensure-table ;
: <alloy> ( responder db -- responder' )
[ [ init-furnace-tables ] with-db ] keep
[
<asides>
<conversations>
<sessions>
] dip
<db-persistence> ;
: start-expiring ( db -- )
'[
_ [ state-classes [ expire-state ] each ] with-db
] 5 minutes every drop ;
| ! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel sequences db.tuples alarms calendar db fry
furnace.db
furnace.cache
furnace.asides
- furnace.referrer
furnace.sessions
furnace.conversations
furnace.auth.providers
furnace.auth.login.permits ;
IN: furnace.alloy
: state-classes { session aside conversation permit } ; inline
: init-furnace-tables ( -- )
state-classes ensure-tables
user ensure-table ;
: <alloy> ( responder db -- responder' )
[ [ init-furnace-tables ] with-db ] keep
[
<asides>
<conversations>
<sessions>
] dip
- <db-persistence>
+ <db-persistence> ;
? ++
- <check-form-submissions> ;
: start-expiring ( db -- )
'[
_ [ state-classes [ expire-state ] each ] with-db
] 5 minutes every drop ; | 4 | 0.121212 | 1 | 3 |
41dd740d6aa4ac2912ed58005bfd638607f2bccf | README.md | README.md | Open Mafia
==========
I'm creating a simple text based mafia MMORPG to reminisce on playing these years ago.
| Open Mafia
==========
I'm creating a simple text based mafia MMORPG to reminisce on playing these years ago.
Creating one of these games years ago was a catapult into this industry and here I am creating one again. I remember times where internet cafes and libraries had teenagers playing these style of games against each other.
I don't intend on launching this for people to play as there really isn't any demand for this genre anymore. However, if you would like to take this code then be my guest.
| Add more to the readme | Add more to the readme
| Markdown | mit | ThomasLomas/Open-Mafia,ThomasLomas/Open-Mafia | markdown | ## Code Before:
Open Mafia
==========
I'm creating a simple text based mafia MMORPG to reminisce on playing these years ago.
## Instruction:
Add more to the readme
## Code After:
Open Mafia
==========
I'm creating a simple text based mafia MMORPG to reminisce on playing these years ago.
Creating one of these games years ago was a catapult into this industry and here I am creating one again. I remember times where internet cafes and libraries had teenagers playing these style of games against each other.
I don't intend on launching this for people to play as there really isn't any demand for this genre anymore. However, if you would like to take this code then be my guest.
| Open Mafia
==========
I'm creating a simple text based mafia MMORPG to reminisce on playing these years ago.
+
+ Creating one of these games years ago was a catapult into this industry and here I am creating one again. I remember times where internet cafes and libraries had teenagers playing these style of games against each other.
+
+ I don't intend on launching this for people to play as there really isn't any demand for this genre anymore. However, if you would like to take this code then be my guest. | 4 | 1 | 4 | 0 |
1dc4cac91a841ce835eedb27ad81f38f296b99df | app/Http/Controllers/DashboardController.php | app/Http/Controllers/DashboardController.php | <?php
/**
* Bareos Reporter
* Application for managing Bareos Backup Email Reports
*
* Dashboard Controller
*
* @license The MIT License (MIT) See: LICENSE file
* @copyright Copyright (c) 2016 Matt Clinton
* @author Matt Clinton <matt@laralabs.uk>
* @website http://www.magelabs.uk/
*/
namespace App\Http\Controllers;
use App\Catalogs;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Session;
class DashboardController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('dashboard.index');
}
/**
* Change the active director, set active_director
* session variable if input value not empty.
*
* @return \Illuminate\Http\Response
*/
public function changeDirector()
{
$director_id = Input::get('director-select');
if(!empty($director_id))
{
Session::set('active_director', $director_id);
return redirect('directors')->with('success', 'Director changed successfully');
}
else
{
return redirect('directors')->with('failed', 'Unable to change director');
}
}
}
| <?php
/**
* Bareos Reporter
* Application for managing Bareos Backup Email Reports
*
* Dashboard Controller
*
* @license The MIT License (MIT) See: LICENSE file
* @copyright Copyright (c) 2016 Matt Clinton
* @author Matt Clinton <matt@laralabs.uk>
* @website http://www.magelabs.uk/
*/
namespace App\Http\Controllers;
use App\Catalogs;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Session;
class DashboardController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('dashboard.index');
}
/**
* Change the active director, set active_director
* session variable if input value not empty.
*
* @return \Illuminate\Http\Response
*/
public function changeDirector()
{
$director_id = Input::get('director-select');
if(!empty($director_id))
{
$connectionName = Catalogs::getCatalogName($director_id);
Session::set('active_connection', $connectionName);
Session::set('active_director', $director_id);
return redirect('directors')->with('success', 'Director changed successfully');
}
else
{
return redirect('directors')->with('failed', 'Unable to change director');
}
}
}
| Save connection name in session too | Save connection name in session too
| PHP | mit | laralabs/bareos-reporter,laralabs/bareos-reporter,laralabs/bareos-reporter | php | ## Code Before:
<?php
/**
* Bareos Reporter
* Application for managing Bareos Backup Email Reports
*
* Dashboard Controller
*
* @license The MIT License (MIT) See: LICENSE file
* @copyright Copyright (c) 2016 Matt Clinton
* @author Matt Clinton <matt@laralabs.uk>
* @website http://www.magelabs.uk/
*/
namespace App\Http\Controllers;
use App\Catalogs;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Session;
class DashboardController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('dashboard.index');
}
/**
* Change the active director, set active_director
* session variable if input value not empty.
*
* @return \Illuminate\Http\Response
*/
public function changeDirector()
{
$director_id = Input::get('director-select');
if(!empty($director_id))
{
Session::set('active_director', $director_id);
return redirect('directors')->with('success', 'Director changed successfully');
}
else
{
return redirect('directors')->with('failed', 'Unable to change director');
}
}
}
## Instruction:
Save connection name in session too
## Code After:
<?php
/**
* Bareos Reporter
* Application for managing Bareos Backup Email Reports
*
* Dashboard Controller
*
* @license The MIT License (MIT) See: LICENSE file
* @copyright Copyright (c) 2016 Matt Clinton
* @author Matt Clinton <matt@laralabs.uk>
* @website http://www.magelabs.uk/
*/
namespace App\Http\Controllers;
use App\Catalogs;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Session;
class DashboardController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('dashboard.index');
}
/**
* Change the active director, set active_director
* session variable if input value not empty.
*
* @return \Illuminate\Http\Response
*/
public function changeDirector()
{
$director_id = Input::get('director-select');
if(!empty($director_id))
{
$connectionName = Catalogs::getCatalogName($director_id);
Session::set('active_connection', $connectionName);
Session::set('active_director', $director_id);
return redirect('directors')->with('success', 'Director changed successfully');
}
else
{
return redirect('directors')->with('failed', 'Unable to change director');
}
}
}
| <?php
/**
* Bareos Reporter
* Application for managing Bareos Backup Email Reports
*
* Dashboard Controller
*
* @license The MIT License (MIT) See: LICENSE file
* @copyright Copyright (c) 2016 Matt Clinton
* @author Matt Clinton <matt@laralabs.uk>
* @website http://www.magelabs.uk/
*/
namespace App\Http\Controllers;
use App\Catalogs;
use Illuminate\Http\Request;
use App\Http\Requests;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Session;
class DashboardController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('dashboard.index');
}
/**
* Change the active director, set active_director
* session variable if input value not empty.
*
* @return \Illuminate\Http\Response
*/
public function changeDirector()
{
$director_id = Input::get('director-select');
if(!empty($director_id))
{
+ $connectionName = Catalogs::getCatalogName($director_id);
+
+ Session::set('active_connection', $connectionName);
Session::set('active_director', $director_id);
return redirect('directors')->with('success', 'Director changed successfully');
}
else
{
return redirect('directors')->with('failed', 'Unable to change director');
}
}
} | 3 | 0.045455 | 3 | 0 |
a71e7dcd225a4ec00cbca7e1afd1b140f2078c29 | go/vt/callinfo/callinfo.go | go/vt/callinfo/callinfo.go | // Package callinfo stores custom values into the Context
// (related to the RPC source)
package callinfo
import (
"html/template"
"golang.org/x/net/context"
)
// CallInfo is the extra data stored in the Context
type CallInfo interface {
// RemoteAddr is the remote address information for this rpc call.
RemoteAddr() string
// Username is associated with this rpc call, if any.
Username() string
// Text is a text version of this connection, as specifically as possible.
Text() string
// HTML represents this rpc call connection in a web-friendly way.
HTML() template.HTML
}
// internal type and value
type key string
var callInfoKey key = "vt.CallInfo"
// NewContext adds the provided CallInfo to the context
func NewContext(ctx context.Context, ci CallInfo) context.Context {
return context.WithValue(ctx, callInfoKey, ci)
}
// FromContext returns the CallInfo value stored in ctx, if any.
func FromContext(ctx context.Context) (CallInfo, bool) {
ci, ok := ctx.Value(callInfoKey).(CallInfo)
return ci, ok
}
| // Package callinfo stores custom values into the Context
// (related to the RPC source)
package callinfo
import (
"html/template"
"golang.org/x/net/context"
)
// CallInfo is the extra data stored in the Context
type CallInfo interface {
// RemoteAddr is the remote address information for this rpc call.
RemoteAddr() string
// Username is associated with this rpc call, if any.
Username() string
// Text is a text version of this connection, as specifically as possible.
Text() string
// HTML represents this rpc call connection in a web-friendly way.
HTML() template.HTML
}
// internal type and value
type key int
var callInfoKey key = 0
// NewContext adds the provided CallInfo to the context
func NewContext(ctx context.Context, ci CallInfo) context.Context {
return context.WithValue(ctx, callInfoKey, ci)
}
// FromContext returns the CallInfo value stored in ctx, if any.
func FromContext(ctx context.Context) (CallInfo, bool) {
ci, ok := ctx.Value(callInfoKey).(CallInfo)
return ci, ok
}
| Use 0 as the context key | Use 0 as the context key
| Go | apache-2.0 | nurblieh/vitess,mattharden/vitess,SDHM/vitess,enisoc/vitess,cgvarela/vitess,netroby/vitess,mapbased/vitess,xgwubin/vitess,skyportsystems/vitess,kmiku7/vitess-annotated,cgvarela/vitess,erzel/vitess,davygeek/vitess,erzel/vitess,nurblieh/vitess,vitessio/vitess,fengshao0907/vitess,yangzhongj/vitess,enisoc/vitess,skyportsystems/vitess,applift/vitess,guokeno0/vitess,kmiku7/vitess-annotated,yaoshengzhe/vitess,rnavarro/vitess,applift/vitess,kmiku7/vitess-annotated,kuipertan/vitess,yangzhongj/vitess,tjyang/vitess,mapbased/vitess,anusornc/vitess,applift/vitess,vitessio/vitess,dumbunny/vitess,kuipertan/vitess,mlc0202/vitess,tinyspeck/vitess,mapbased/vitess,mlc0202/vitess,tirsen/vitess,tinyspeck/vitess,fengshao0907/vitess,AndyDiamondstein/vitess,anusornc/vitess,guokeno0/vitess,mahak/vitess,vitessio/vitess,tirsen/vitess,fengshao0907/vitess,guokeno0/vitess,yangzhongj/vitess,anusornc/vitess,xgwubin/vitess,yangzhongj/vitess,HubSpot/vitess,atyenoria/vitess,pivanof/vitess,HubSpot/vitess,xgwubin/vitess,yaoshengzhe/vitess,mahak/vitess,yaoshengzhe/vitess,cgvarela/vitess,mattharden/vitess,ptomasroos/vitess,cloudbearings/vitess,ptomasroos/vitess,cgvarela/vitess,anusornc/vitess,sougou/vitess,cloudbearings/vitess,dumbunny/vitess,tjyang/vitess,SDHM/vitess,mattharden/vitess,cloudbearings/vitess,tirsen/vitess,applift/vitess,mapbased/vitess,mattharden/vitess,rnavarro/vitess,yangzhongj/vitess,erzel/vitess,AndyDiamondstein/vitess,rnavarro/vitess,AndyDiamondstein/vitess,ptomasroos/vitess,mattharden/vitess,cloudbearings/vitess,mapbased/vitess,AndyDiamondstein/vitess,dumbunny/vitess,aaijazi/vitess,netroby/vitess,sougou/vitess,vitessio/vitess,guokeno0/vitess,netroby/vitess,mattharden/vitess,mapbased/vitess,davygeek/vitess,dcadevil/vitess,tjyang/vitess,atyenoria/vitess,mattharden/vitess,alainjobart/vitess,pivanof/vitess,tjyang/vitess,fengshao0907/vitess,netroby/vitess,tirsen/vitess,atyenoria/vitess,mlc0202/vitess,skyportsystems/vitess,ptomasroos/vitess,aaijazi/vitess,kmiku7/vitess-annotated,tinyspeck/vitess,ptomasroos/vitess,HubSpot/vitess,xgwubin/vitess,HubSpot/vitess,cloudbearings/vitess,sougou/vitess,dumbunny/vitess,fengshao0907/vitess,xgwubin/vitess,kuipertan/vitess,tinyspeck/vitess,AndyDiamondstein/vitess,nurblieh/vitess,applift/vitess,davygeek/vitess,yaoshengzhe/vitess,guokeno0/vitess,ptomasroos/vitess,alainjobart/vitess,mahak/vitess,tinyspeck/vitess,SDHM/vitess,kuipertan/vitess,enisoc/vitess,aaijazi/vitess,pivanof/vitess,fengshao0907/vitess,mattharden/vitess,cgvarela/vitess,cgvarela/vitess,mapbased/vitess,rnavarro/vitess,ptomasroos/vitess,rnavarro/vitess,tjyang/vitess,atyenoria/vitess,erzel/vitess,fengshao0907/vitess,erzel/vitess,mahak/vitess,dcadevil/vitess,michael-berlin/vitess,netroby/vitess,rnavarro/vitess,erzel/vitess,netroby/vitess,tirsen/vitess,nurblieh/vitess,davygeek/vitess,davygeek/vitess,HubSpot/vitess,enisoc/vitess,sougou/vitess,kmiku7/vitess-annotated,dumbunny/vitess,applift/vitess,pivanof/vitess,aaijazi/vitess,dumbunny/vitess,tjyang/vitess,ptomasroos/vitess,atyenoria/vitess,guokeno0/vitess,netroby/vitess,netroby/vitess,skyportsystems/vitess,mapbased/vitess,tirsen/vitess,skyportsystems/vitess,atyenoria/vitess,fengshao0907/vitess,tinyspeck/vitess,dumbunny/vitess,skyportsystems/vitess,alainjobart/vitess,mapbased/vitess,alainjobart/vitess,aaijazi/vitess,michael-berlin/vitess,xgwubin/vitess,applift/vitess,pivanof/vitess,cgvarela/vitess,rnavarro/vitess,pivanof/vitess,mlc0202/vitess,erzel/vitess,applift/vitess,tjyang/vitess,alainjobart/vitess,michael-berlin/vitess,dcadevil/vitess,SDHM/vitess,mlc0202/vitess,dumbunny/vitess,michael-berlin/vitess,SDHM/vitess,dumbunny/vitess,michael-berlin/vitess,mahak/vitess,erzel/vitess,atyenoria/vitess,SDHM/vitess,nurblieh/vitess,tinyspeck/vitess,yangzhongj/vitess,yangzhongj/vitess,vitessio/vitess,applift/vitess,alainjobart/vitess,yaoshengzhe/vitess,kuipertan/vitess,mahak/vitess,erzel/vitess,vitessio/vitess,anusornc/vitess,anusornc/vitess,dcadevil/vitess,yaoshengzhe/vitess,kmiku7/vitess-annotated,netroby/vitess,enisoc/vitess,anusornc/vitess,ptomasroos/vitess,mlc0202/vitess,michael-berlin/vitess,nurblieh/vitess,dcadevil/vitess,tjyang/vitess,HubSpot/vitess,mlc0202/vitess,aaijazi/vitess,guokeno0/vitess,davygeek/vitess,fengshao0907/vitess,guokeno0/vitess,pivanof/vitess,yaoshengzhe/vitess,kuipertan/vitess,yaoshengzhe/vitess,dcadevil/vitess,kmiku7/vitess-annotated,michael-berlin/vitess,sougou/vitess,AndyDiamondstein/vitess,mattharden/vitess,SDHM/vitess,vitessio/vitess,alainjobart/vitess,AndyDiamondstein/vitess,xgwubin/vitess,kuipertan/vitess,nurblieh/vitess,aaijazi/vitess,aaijazi/vitess,mahak/vitess,cloudbearings/vitess,anusornc/vitess,rnavarro/vitess,vitessio/vitess,sougou/vitess,AndyDiamondstein/vitess,cgvarela/vitess,sougou/vitess,atyenoria/vitess,tirsen/vitess,atyenoria/vitess,xgwubin/vitess,mlc0202/vitess,enisoc/vitess,AndyDiamondstein/vitess,applift/vitess,kuipertan/vitess,mlc0202/vitess,nurblieh/vitess,michael-berlin/vitess,mattharden/vitess,pivanof/vitess,skyportsystems/vitess,michael-berlin/vitess,dcadevil/vitess,pivanof/vitess,tirsen/vitess,dumbunny/vitess,sougou/vitess,erzel/vitess,enisoc/vitess,alainjobart/vitess,mahak/vitess,yaoshengzhe/vitess,kmiku7/vitess-annotated,mapbased/vitess,guokeno0/vitess,HubSpot/vitess,cloudbearings/vitess,rnavarro/vitess,yangzhongj/vitess,HubSpot/vitess,cloudbearings/vitess,cloudbearings/vitess,yangzhongj/vitess,davygeek/vitess,skyportsystems/vitess,kuipertan/vitess,tjyang/vitess,cgvarela/vitess,skyportsystems/vitess,SDHM/vitess,nurblieh/vitess,xgwubin/vitess,anusornc/vitess,tirsen/vitess,aaijazi/vitess,SDHM/vitess,kmiku7/vitess-annotated | go | ## Code Before:
// Package callinfo stores custom values into the Context
// (related to the RPC source)
package callinfo
import (
"html/template"
"golang.org/x/net/context"
)
// CallInfo is the extra data stored in the Context
type CallInfo interface {
// RemoteAddr is the remote address information for this rpc call.
RemoteAddr() string
// Username is associated with this rpc call, if any.
Username() string
// Text is a text version of this connection, as specifically as possible.
Text() string
// HTML represents this rpc call connection in a web-friendly way.
HTML() template.HTML
}
// internal type and value
type key string
var callInfoKey key = "vt.CallInfo"
// NewContext adds the provided CallInfo to the context
func NewContext(ctx context.Context, ci CallInfo) context.Context {
return context.WithValue(ctx, callInfoKey, ci)
}
// FromContext returns the CallInfo value stored in ctx, if any.
func FromContext(ctx context.Context) (CallInfo, bool) {
ci, ok := ctx.Value(callInfoKey).(CallInfo)
return ci, ok
}
## Instruction:
Use 0 as the context key
## Code After:
// Package callinfo stores custom values into the Context
// (related to the RPC source)
package callinfo
import (
"html/template"
"golang.org/x/net/context"
)
// CallInfo is the extra data stored in the Context
type CallInfo interface {
// RemoteAddr is the remote address information for this rpc call.
RemoteAddr() string
// Username is associated with this rpc call, if any.
Username() string
// Text is a text version of this connection, as specifically as possible.
Text() string
// HTML represents this rpc call connection in a web-friendly way.
HTML() template.HTML
}
// internal type and value
type key int
var callInfoKey key = 0
// NewContext adds the provided CallInfo to the context
func NewContext(ctx context.Context, ci CallInfo) context.Context {
return context.WithValue(ctx, callInfoKey, ci)
}
// FromContext returns the CallInfo value stored in ctx, if any.
func FromContext(ctx context.Context) (CallInfo, bool) {
ci, ok := ctx.Value(callInfoKey).(CallInfo)
return ci, ok
}
| // Package callinfo stores custom values into the Context
// (related to the RPC source)
package callinfo
import (
"html/template"
"golang.org/x/net/context"
)
// CallInfo is the extra data stored in the Context
type CallInfo interface {
// RemoteAddr is the remote address information for this rpc call.
RemoteAddr() string
// Username is associated with this rpc call, if any.
Username() string
// Text is a text version of this connection, as specifically as possible.
Text() string
// HTML represents this rpc call connection in a web-friendly way.
HTML() template.HTML
}
// internal type and value
- type key string
? --- ^
+ type key int
? ^
- var callInfoKey key = "vt.CallInfo"
? ^^^^^^^^^^^^^
+ var callInfoKey key = 0
? ^
// NewContext adds the provided CallInfo to the context
func NewContext(ctx context.Context, ci CallInfo) context.Context {
return context.WithValue(ctx, callInfoKey, ci)
}
// FromContext returns the CallInfo value stored in ctx, if any.
func FromContext(ctx context.Context) (CallInfo, bool) {
ci, ok := ctx.Value(callInfoKey).(CallInfo)
return ci, ok
} | 4 | 0.1 | 2 | 2 |
94aafd5611e1b4771ea7adfd7769be4a608a347e | assets/src/app.css | assets/src/app.css | .gameapp {
display: flex;
flex-direction: row;
height: 100vh;
width: 100vw;
}
.gameboard {
flex: 1;
position: relative;
margin: 1lh;
}
.gameboard-canvas {
position: absolute;
height: 100%;
width: 100%;
left: 0;
}
.controls {
display: flex;
justify-content: space-evenly;
}
.scoreboard {
background: var(--bg-accent-color);
color: var(--font-accent-color);
padding: 1lh;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.scoreboard-snakes {
flex: 1;
}
.scoreboard-header {
margin-bottom: 2lh;
}
.scoreboard-snake ~ .scoreboard-snake {
margin-top: 1lh;
}
.scoreboard-snake-dead {
opacity: 0.5;
}
.healthbar-text {
display: flex;
justify-content: space-between;
}
.healthbar {
height: 0.2lh;
}
.division-logo {
margin: 0 2lh;
}
| .gameapp {
display: flex;
flex-direction: row;
height: 100vh;
width: 100vw;
}
.gameboard {
flex: 1;
position: relative;
margin: 1lh;
}
.gameboard-canvas {
position: absolute;
height: 100%;
width: 100%;
left: 0;
}
.controls {
display: flex;
justify-content: space-evenly;
}
.scoreboard {
background: var(--bg-accent-color);
color: var(--font-accent-color);
padding: 1lh;
display: flex;
flex-direction: column;
justify-content: space-between;
min-width: 300px;
}
.scoreboard-snakes {
flex: 1;
}
.scoreboard-header {
margin-bottom: 2lh;
}
.scoreboard-snake ~ .scoreboard-snake {
margin-top: 1lh;
}
.scoreboard-snake-dead {
opacity: 0.5;
}
.healthbar-text {
display: flex;
justify-content: space-between;
}
.healthbar {
height: 0.2lh;
}
.division-logo {
margin: 0 2lh;
}
| Fix bad sizing on scoreboard. | Fix bad sizing on scoreboard.
| CSS | agpl-3.0 | Dkendal/battle_snake,Dkendal/battle_snake,Dkendal/battle_snake,Dkendal/battle_snake,Dkendal/battle_snake | css | ## Code Before:
.gameapp {
display: flex;
flex-direction: row;
height: 100vh;
width: 100vw;
}
.gameboard {
flex: 1;
position: relative;
margin: 1lh;
}
.gameboard-canvas {
position: absolute;
height: 100%;
width: 100%;
left: 0;
}
.controls {
display: flex;
justify-content: space-evenly;
}
.scoreboard {
background: var(--bg-accent-color);
color: var(--font-accent-color);
padding: 1lh;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.scoreboard-snakes {
flex: 1;
}
.scoreboard-header {
margin-bottom: 2lh;
}
.scoreboard-snake ~ .scoreboard-snake {
margin-top: 1lh;
}
.scoreboard-snake-dead {
opacity: 0.5;
}
.healthbar-text {
display: flex;
justify-content: space-between;
}
.healthbar {
height: 0.2lh;
}
.division-logo {
margin: 0 2lh;
}
## Instruction:
Fix bad sizing on scoreboard.
## Code After:
.gameapp {
display: flex;
flex-direction: row;
height: 100vh;
width: 100vw;
}
.gameboard {
flex: 1;
position: relative;
margin: 1lh;
}
.gameboard-canvas {
position: absolute;
height: 100%;
width: 100%;
left: 0;
}
.controls {
display: flex;
justify-content: space-evenly;
}
.scoreboard {
background: var(--bg-accent-color);
color: var(--font-accent-color);
padding: 1lh;
display: flex;
flex-direction: column;
justify-content: space-between;
min-width: 300px;
}
.scoreboard-snakes {
flex: 1;
}
.scoreboard-header {
margin-bottom: 2lh;
}
.scoreboard-snake ~ .scoreboard-snake {
margin-top: 1lh;
}
.scoreboard-snake-dead {
opacity: 0.5;
}
.healthbar-text {
display: flex;
justify-content: space-between;
}
.healthbar {
height: 0.2lh;
}
.division-logo {
margin: 0 2lh;
}
| .gameapp {
display: flex;
flex-direction: row;
height: 100vh;
width: 100vw;
}
.gameboard {
flex: 1;
position: relative;
margin: 1lh;
}
.gameboard-canvas {
position: absolute;
height: 100%;
width: 100%;
left: 0;
}
.controls {
display: flex;
justify-content: space-evenly;
}
.scoreboard {
background: var(--bg-accent-color);
color: var(--font-accent-color);
padding: 1lh;
display: flex;
flex-direction: column;
justify-content: space-between;
+ min-width: 300px;
}
.scoreboard-snakes {
flex: 1;
}
.scoreboard-header {
margin-bottom: 2lh;
}
.scoreboard-snake ~ .scoreboard-snake {
margin-top: 1lh;
}
.scoreboard-snake-dead {
opacity: 0.5;
}
.healthbar-text {
display: flex;
justify-content: space-between;
}
.healthbar {
height: 0.2lh;
}
.division-logo {
margin: 0 2lh;
} | 1 | 0.016129 | 1 | 0 |
c6ac1540025159c0f242c9fa142362b23d8a9b15 | ie-urls.sh | ie-urls.sh |
curl -s https://www.modern.ie/en-gb/virtualization-tools \
| grep -oiE 'https://[A-Z0-9._/]+For\.Linux\.VirtualBox\.txt' \
| sort | uniq
|
cat <<EOF 1>&2
By downloading and using these VMs, you are agreeing Microsoft Software License
Terms. You should go to https://www.modern.ie and read them if you haven't
before
EOF
curl -s https://www.modern.ie/en-gb/virtualization-tools \
| grep -oiE 'https://[A-Z0-9._/]+For\.Linux\.VirtualBox\.txt' \
| sort | uniq
| Add note about having a look at MS' licence | Add note about having a look at MS' licence
| Shell | mit | lentinj/ie-vm,lentinj/ie-vm | shell | ## Code Before:
curl -s https://www.modern.ie/en-gb/virtualization-tools \
| grep -oiE 'https://[A-Z0-9._/]+For\.Linux\.VirtualBox\.txt' \
| sort | uniq
## Instruction:
Add note about having a look at MS' licence
## Code After:
cat <<EOF 1>&2
By downloading and using these VMs, you are agreeing Microsoft Software License
Terms. You should go to https://www.modern.ie and read them if you haven't
before
EOF
curl -s https://www.modern.ie/en-gb/virtualization-tools \
| grep -oiE 'https://[A-Z0-9._/]+For\.Linux\.VirtualBox\.txt' \
| sort | uniq
| +
+ cat <<EOF 1>&2
+ By downloading and using these VMs, you are agreeing Microsoft Software License
+ Terms. You should go to https://www.modern.ie and read them if you haven't
+ before
+
+ EOF
curl -s https://www.modern.ie/en-gb/virtualization-tools \
| grep -oiE 'https://[A-Z0-9._/]+For\.Linux\.VirtualBox\.txt' \
| sort | uniq | 7 | 1.75 | 7 | 0 |
e3c2ce871f3d84fad9306e141b8d384ff8e374f5 | lib/discordrb/api/invite.rb | lib/discordrb/api/invite.rb | module Discordrb::API::Invite
module_function
# Resolve an invite
# https://discordapp.com/developers/docs/resources/invite#get-invite
def resolve(token, invite_code)
Discordrb::API.request(
__method__,
:get,
"#{Discordrb::API.api_base}/invite/#{invite_code}",
Authorization: token
)
end
# Delete an invite by code
# https://discordapp.com/developers/docs/resources/invite#delete-invite
def delete(token, code)
Discordrb::API.request(
__method__,
:delete,
"#{Discordrb::API.api_base}/invites/#{code}",
Authorization: token
)
end
# Join a server using an invite
# https://discordapp.com/developers/docs/resources/invite#accept-invite
def accept(token, invite_code)
Discordrb::API.request(
__method__,
:post,
"#{Discordrb::API.api_base}/invite/#{invite_code}",
nil,
Authorization: token
)
end
end
| module Discordrb::API::Invite
module_function
# Resolve an invite
# https://discordapp.com/developers/docs/resources/invite#get-invite
def resolve(token, invite_code)
Discordrb::API.request(
:invite_code,
:get,
"#{Discordrb::API.api_base}/invite/#{invite_code}",
Authorization: token
)
end
# Delete an invite by code
# https://discordapp.com/developers/docs/resources/invite#delete-invite
def delete(token, code)
Discordrb::API.request(
:invites_code,
:delete,
"#{Discordrb::API.api_base}/invites/#{code}",
Authorization: token
)
end
# Join a server using an invite
# https://discordapp.com/developers/docs/resources/invite#accept-invite
def accept(token, invite_code)
Discordrb::API.request(
:invite_code,
:post,
"#{Discordrb::API.api_base}/invite/#{invite_code}",
nil,
Authorization: token
)
end
end
| Replace method-based RL keys with route-based ones in API::Invite | Replace method-based RL keys with route-based ones in API::Invite
| Ruby | mit | Roughsketch/discordrb,meew0/discordrb,meew0/discordrb,Roughsketch/discordrb,VxJasonxV/discordrb,VxJasonxV/discordrb | ruby | ## Code Before:
module Discordrb::API::Invite
module_function
# Resolve an invite
# https://discordapp.com/developers/docs/resources/invite#get-invite
def resolve(token, invite_code)
Discordrb::API.request(
__method__,
:get,
"#{Discordrb::API.api_base}/invite/#{invite_code}",
Authorization: token
)
end
# Delete an invite by code
# https://discordapp.com/developers/docs/resources/invite#delete-invite
def delete(token, code)
Discordrb::API.request(
__method__,
:delete,
"#{Discordrb::API.api_base}/invites/#{code}",
Authorization: token
)
end
# Join a server using an invite
# https://discordapp.com/developers/docs/resources/invite#accept-invite
def accept(token, invite_code)
Discordrb::API.request(
__method__,
:post,
"#{Discordrb::API.api_base}/invite/#{invite_code}",
nil,
Authorization: token
)
end
end
## Instruction:
Replace method-based RL keys with route-based ones in API::Invite
## Code After:
module Discordrb::API::Invite
module_function
# Resolve an invite
# https://discordapp.com/developers/docs/resources/invite#get-invite
def resolve(token, invite_code)
Discordrb::API.request(
:invite_code,
:get,
"#{Discordrb::API.api_base}/invite/#{invite_code}",
Authorization: token
)
end
# Delete an invite by code
# https://discordapp.com/developers/docs/resources/invite#delete-invite
def delete(token, code)
Discordrb::API.request(
:invites_code,
:delete,
"#{Discordrb::API.api_base}/invites/#{code}",
Authorization: token
)
end
# Join a server using an invite
# https://discordapp.com/developers/docs/resources/invite#accept-invite
def accept(token, invite_code)
Discordrb::API.request(
:invite_code,
:post,
"#{Discordrb::API.api_base}/invite/#{invite_code}",
nil,
Authorization: token
)
end
end
| module Discordrb::API::Invite
module_function
# Resolve an invite
# https://discordapp.com/developers/docs/resources/invite#get-invite
def resolve(token, invite_code)
Discordrb::API.request(
- __method__,
+ :invite_code,
:get,
"#{Discordrb::API.api_base}/invite/#{invite_code}",
Authorization: token
)
end
# Delete an invite by code
# https://discordapp.com/developers/docs/resources/invite#delete-invite
def delete(token, code)
Discordrb::API.request(
- __method__,
+ :invites_code,
:delete,
"#{Discordrb::API.api_base}/invites/#{code}",
Authorization: token
)
end
# Join a server using an invite
# https://discordapp.com/developers/docs/resources/invite#accept-invite
def accept(token, invite_code)
Discordrb::API.request(
- __method__,
+ :invite_code,
:post,
"#{Discordrb::API.api_base}/invite/#{invite_code}",
nil,
Authorization: token
)
end
end | 6 | 0.162162 | 3 | 3 |
3948501471cc54ecd60a83a15d494f90f210461d | README.rdoc | README.rdoc | = Ruby Zabbix Api Module.
Simple and lightweight ruby module for work with zabbix api version 1.8.2
You can:
* Create host/template/application/items/triggers and screens;
* Get info about all zabbix essences;
== Get Start.
* Get hostid from zabbix api:
zbx = Zabbix::ZabbixApi.new('https://zabbix.example.com', 'login', 'password')
hostid = zbx.get_host_id('my.example.com')
p hostid
== Dependencies
* net/http
* net/https
* json
* Zabbix Project Homepage -> http://zabbix.com/
* Zabbix Api Draft docs -> http://www.zabbix.com/documentation/1.8/api
| = Ruby Zabbix Api Module.
Simple and lightweight ruby module for work with zabbix api version 1.8.2
You can:
* Create host/template/application/items/triggers and screens;
* Get info about all zabbix essences;
== Get Start.
* Get hostid from zabbix api:
zbx = Zabbix::ZabbixApi.new('https://zabbix.example.com', 'login', 'password')
hostid = zbx.get_host_id('my.example.com')
p hostid
== Dependencies
* net/http
* net/https
* json
== Zabbix documentation
* Zabbix Project Homepage -> http://zabbix.com/
* Zabbix Api Draft docs -> http://www.zabbix.com/documentation/1.8/api
| Add links to zabbix documentation | Add links to zabbix documentation
| RDoc | mit | mrThe/zabbixapi,jrbeilke/zabbixapi,express42/zabbixapi | rdoc | ## Code Before:
= Ruby Zabbix Api Module.
Simple and lightweight ruby module for work with zabbix api version 1.8.2
You can:
* Create host/template/application/items/triggers and screens;
* Get info about all zabbix essences;
== Get Start.
* Get hostid from zabbix api:
zbx = Zabbix::ZabbixApi.new('https://zabbix.example.com', 'login', 'password')
hostid = zbx.get_host_id('my.example.com')
p hostid
== Dependencies
* net/http
* net/https
* json
* Zabbix Project Homepage -> http://zabbix.com/
* Zabbix Api Draft docs -> http://www.zabbix.com/documentation/1.8/api
## Instruction:
Add links to zabbix documentation
## Code After:
= Ruby Zabbix Api Module.
Simple and lightweight ruby module for work with zabbix api version 1.8.2
You can:
* Create host/template/application/items/triggers and screens;
* Get info about all zabbix essences;
== Get Start.
* Get hostid from zabbix api:
zbx = Zabbix::ZabbixApi.new('https://zabbix.example.com', 'login', 'password')
hostid = zbx.get_host_id('my.example.com')
p hostid
== Dependencies
* net/http
* net/https
* json
== Zabbix documentation
* Zabbix Project Homepage -> http://zabbix.com/
* Zabbix Api Draft docs -> http://www.zabbix.com/documentation/1.8/api
| = Ruby Zabbix Api Module.
Simple and lightweight ruby module for work with zabbix api version 1.8.2
You can:
* Create host/template/application/items/triggers and screens;
* Get info about all zabbix essences;
== Get Start.
* Get hostid from zabbix api:
zbx = Zabbix::ZabbixApi.new('https://zabbix.example.com', 'login', 'password')
hostid = zbx.get_host_id('my.example.com')
p hostid
== Dependencies
* net/http
* net/https
* json
+ == Zabbix documentation
* Zabbix Project Homepage -> http://zabbix.com/
* Zabbix Api Draft docs -> http://www.zabbix.com/documentation/1.8/api
| 1 | 0.037037 | 1 | 0 |
7cbd21a050a9e94d0f8f1f5c3ce4f81c812e279c | trump/templating/tests/test_templates.py | trump/templating/tests/test_templates.py |
from ..templates import QuandlFT
class TestTemplates(object):
def test_quandl_ft(self):
ftemp = QuandlFT("xxx", trim_start="yyyy-mm-dd", authtoken="yyy")
assert ftemp.sourcing == {'authtoken': 'yyy',
'trim_start': 'yyyy-mm-dd',
'dataset': 'xxx'}
|
from ..templates import QuandlFT, QuandlSecureFT, GoogleFinanceFT
class TestTemplates(object):
def test_quandl_ft(self):
ftemp = QuandlFT("xxx", trim_start="yyyy-mm-dd", authtoken="yyy")
assert ftemp.sourcing == {'authtoken': 'yyy',
'trim_start': 'yyyy-mm-dd',
'dataset': 'xxx'}
def test_quandl_secure_ft(self):
ftemp = QuandlSecureFT("xxx", trim_start="yyyy-mm-dd")
assert ftemp.sourcing == {'trim_start': 'yyyy-mm-dd',
'dataset': 'xxx'}
assert ftemp.meta == {'sourcing_key' : 'userone',
'stype' : 'Quandl'}
def test_google_finance_ft(self):
ftemp = GoogleFinanceFT("xxx")
assert ftemp.sourcing == {'name': 'xxx',
'start': '2000-01-01,
'end': 'now',
'data_source' : 'google',
'data_column' : 'Close'}
assert ftemp.meta == {'stype' : 'PyDataDataReaderST'}
| Add two tests for templates | Add two tests for templates | Python | bsd-3-clause | Equitable/trump,Asiant/trump,jnmclarty/trump | python | ## Code Before:
from ..templates import QuandlFT
class TestTemplates(object):
def test_quandl_ft(self):
ftemp = QuandlFT("xxx", trim_start="yyyy-mm-dd", authtoken="yyy")
assert ftemp.sourcing == {'authtoken': 'yyy',
'trim_start': 'yyyy-mm-dd',
'dataset': 'xxx'}
## Instruction:
Add two tests for templates
## Code After:
from ..templates import QuandlFT, QuandlSecureFT, GoogleFinanceFT
class TestTemplates(object):
def test_quandl_ft(self):
ftemp = QuandlFT("xxx", trim_start="yyyy-mm-dd", authtoken="yyy")
assert ftemp.sourcing == {'authtoken': 'yyy',
'trim_start': 'yyyy-mm-dd',
'dataset': 'xxx'}
def test_quandl_secure_ft(self):
ftemp = QuandlSecureFT("xxx", trim_start="yyyy-mm-dd")
assert ftemp.sourcing == {'trim_start': 'yyyy-mm-dd',
'dataset': 'xxx'}
assert ftemp.meta == {'sourcing_key' : 'userone',
'stype' : 'Quandl'}
def test_google_finance_ft(self):
ftemp = GoogleFinanceFT("xxx")
assert ftemp.sourcing == {'name': 'xxx',
'start': '2000-01-01,
'end': 'now',
'data_source' : 'google',
'data_column' : 'Close'}
assert ftemp.meta == {'stype' : 'PyDataDataReaderST'}
|
- from ..templates import QuandlFT
+ from ..templates import QuandlFT, QuandlSecureFT, GoogleFinanceFT
class TestTemplates(object):
def test_quandl_ft(self):
ftemp = QuandlFT("xxx", trim_start="yyyy-mm-dd", authtoken="yyy")
assert ftemp.sourcing == {'authtoken': 'yyy',
'trim_start': 'yyyy-mm-dd',
'dataset': 'xxx'}
+
+ def test_quandl_secure_ft(self):
+ ftemp = QuandlSecureFT("xxx", trim_start="yyyy-mm-dd")
+ assert ftemp.sourcing == {'trim_start': 'yyyy-mm-dd',
+ 'dataset': 'xxx'}
+ assert ftemp.meta == {'sourcing_key' : 'userone',
+ 'stype' : 'Quandl'}
+
+ def test_google_finance_ft(self):
+ ftemp = GoogleFinanceFT("xxx")
+ assert ftemp.sourcing == {'name': 'xxx',
+ 'start': '2000-01-01,
+ 'end': 'now',
+ 'data_source' : 'google',
+ 'data_column' : 'Close'}
+ assert ftemp.meta == {'stype' : 'PyDataDataReaderST'} | 18 | 1.8 | 17 | 1 |
20880a949b764ae35c9d69b55358f932094a6621 | core/modules/catalog/components/ProductGallery.ts | core/modules/catalog/components/ProductGallery.ts | import VueOffline from 'vue-offline'
import store from '@vue-storefront/store'
export const ProductGallery = {
name: 'ProductGallery',
components: {
VueOffline
},
props: {
gallery: {
type: Array,
required: true
},
configuration: {
type: Object,
required: true
},
offline: {
type: Object,
required: true
},
product: {
type: Object,
required: true
}
},
beforeMount () {
this.$bus.$on('filter-changed-product', this.selectVariant)
this.$bus.$on('product-after-load', this.selectVariant)
},
mounted () {
this.$forceUpdate()
document.addEventListener('keydown', this.handleEscKey)
},
beforeDestroy () {
this.$bus.$off('filter-changed-product', this.selectVariant)
this.$bus.$off('product-after-load', this.selectVariant)
document.removeEventListener('keydown', this.handleEscKey)
},
computed: {
defaultImage () {
return this.gallery.length ? this.gallery[0] : false
}
},
methods: {
toggleZoom () {
this.isZoomOpen = !this.isZoomOpen
},
handleEscKey (event) {
if (this.isZoomOpen && event.keyCode === 27) {
this.toggleZoom()
}
}
}
}
| import VueOffline from 'vue-offline'
import store from '@vue-storefront/store'
export const ProductGallery = {
name: 'ProductGallery',
components: {
VueOffline
},
props: {
gallery: {
type: Array,
required: true
},
configuration: {
type: Object,
required: true
},
offline: {
type: Object,
required: true
},
product: {
type: Object,
required: true
}
},
beforeMount () {
this.$bus.$on('filter-changed-product', this.selectVariant)
this.$bus.$on('product-after-load', this.selectVariant)
},
mounted () {
document.addEventListener('keydown', this.handleEscKey)
},
beforeDestroy () {
this.$bus.$off('filter-changed-product', this.selectVariant)
this.$bus.$off('product-after-load', this.selectVariant)
document.removeEventListener('keydown', this.handleEscKey)
},
computed: {
defaultImage () {
return this.gallery.length ? this.gallery[0] : false
}
},
methods: {
toggleZoom () {
this.isZoomOpen = !this.isZoomOpen
},
handleEscKey (event) {
if (this.isZoomOpen && event.keyCode === 27) {
this.toggleZoom()
}
}
}
}
| Remove forceUpdate from mounted and removed whitespace | Remove forceUpdate from mounted and removed whitespace
| TypeScript | mit | DivanteLtd/vue-storefront,DivanteLtd/vue-storefront,DivanteLtd/vue-storefront,DivanteLtd/vue-storefront,pkarw/vue-storefront,pkarw/vue-storefront,pkarw/vue-storefront,pkarw/vue-storefront | typescript | ## Code Before:
import VueOffline from 'vue-offline'
import store from '@vue-storefront/store'
export const ProductGallery = {
name: 'ProductGallery',
components: {
VueOffline
},
props: {
gallery: {
type: Array,
required: true
},
configuration: {
type: Object,
required: true
},
offline: {
type: Object,
required: true
},
product: {
type: Object,
required: true
}
},
beforeMount () {
this.$bus.$on('filter-changed-product', this.selectVariant)
this.$bus.$on('product-after-load', this.selectVariant)
},
mounted () {
this.$forceUpdate()
document.addEventListener('keydown', this.handleEscKey)
},
beforeDestroy () {
this.$bus.$off('filter-changed-product', this.selectVariant)
this.$bus.$off('product-after-load', this.selectVariant)
document.removeEventListener('keydown', this.handleEscKey)
},
computed: {
defaultImage () {
return this.gallery.length ? this.gallery[0] : false
}
},
methods: {
toggleZoom () {
this.isZoomOpen = !this.isZoomOpen
},
handleEscKey (event) {
if (this.isZoomOpen && event.keyCode === 27) {
this.toggleZoom()
}
}
}
}
## Instruction:
Remove forceUpdate from mounted and removed whitespace
## Code After:
import VueOffline from 'vue-offline'
import store from '@vue-storefront/store'
export const ProductGallery = {
name: 'ProductGallery',
components: {
VueOffline
},
props: {
gallery: {
type: Array,
required: true
},
configuration: {
type: Object,
required: true
},
offline: {
type: Object,
required: true
},
product: {
type: Object,
required: true
}
},
beforeMount () {
this.$bus.$on('filter-changed-product', this.selectVariant)
this.$bus.$on('product-after-load', this.selectVariant)
},
mounted () {
document.addEventListener('keydown', this.handleEscKey)
},
beforeDestroy () {
this.$bus.$off('filter-changed-product', this.selectVariant)
this.$bus.$off('product-after-load', this.selectVariant)
document.removeEventListener('keydown', this.handleEscKey)
},
computed: {
defaultImage () {
return this.gallery.length ? this.gallery[0] : false
}
},
methods: {
toggleZoom () {
this.isZoomOpen = !this.isZoomOpen
},
handleEscKey (event) {
if (this.isZoomOpen && event.keyCode === 27) {
this.toggleZoom()
}
}
}
}
| import VueOffline from 'vue-offline'
import store from '@vue-storefront/store'
export const ProductGallery = {
name: 'ProductGallery',
components: {
VueOffline
},
props: {
gallery: {
type: Array,
required: true
},
configuration: {
type: Object,
required: true
},
offline: {
type: Object,
required: true
},
product: {
type: Object,
required: true
}
},
beforeMount () {
this.$bus.$on('filter-changed-product', this.selectVariant)
this.$bus.$on('product-after-load', this.selectVariant)
},
mounted () {
- this.$forceUpdate()
document.addEventListener('keydown', this.handleEscKey)
},
beforeDestroy () {
this.$bus.$off('filter-changed-product', this.selectVariant)
this.$bus.$off('product-after-load', this.selectVariant)
document.removeEventListener('keydown', this.handleEscKey)
},
computed: {
defaultImage () {
return this.gallery.length ? this.gallery[0] : false
}
},
methods: {
toggleZoom () {
this.isZoomOpen = !this.isZoomOpen
},
handleEscKey (event) {
if (this.isZoomOpen && event.keyCode === 27) {
this.toggleZoom()
}
- }
+ }
}
} | 3 | 0.054545 | 1 | 2 |
be9d2e72705460f36a0e9ab1033a42d5a9c1bf6e | lib/refinery/redactor/engine.rb | lib/refinery/redactor/engine.rb | module Refinery
module Redactor
class Engine < ::Rails::Engine
include Refinery::Engine
isolate_namespace Refinery
engine_name :refinery_redactor
# set the manifests and assets to be precompiled
config.to_prepare do
Rails.application.config.assets.precompile += %w(
refinery-redactor/index.css
refinery-redactor/plugins.js
refinery-redactor/index.js
)
end
before_inclusion do
Refinery::Plugin.register do |plugin|
plugin.pathname = root
plugin.name = "refinerycms_redactor"
plugin.hide_from_menu = true
plugin.menu_match = %r{refinery/redactor}
end
end
config.after_initialize do
Refinery.register_engine Refinery::Redactor
end
after_inclusion do
%w(refinery-redactor/index).each do |stylesheet|
Refinery::Core.config.register_visual_editor_stylesheet stylesheet
end
%W(refinery-redactor/index refinery-redactor/plugins).each do |javascript|
Refinery::Core.config.register_visual_editor_javascript javascript
end
end
end
end
end
| module Refinery
module Redactor
class Engine < ::Rails::Engine
include Refinery::Engine
isolate_namespace Refinery
engine_name :refinery_redactor
# set the manifests and assets to be precompiled
config.to_prepare do
Rails.application.config.assets.precompile += %w(
refinery-redactor/index.css
refinery-redactor/plugins.css
refinery-redactor/plugins.js
refinery-redactor/index.js
)
end
before_inclusion do
Refinery::Plugin.register do |plugin|
plugin.pathname = root
plugin.name = "refinerycms_redactor"
plugin.hide_from_menu = true
plugin.menu_match = %r{refinery/redactor}
end
end
config.after_initialize do
Refinery.register_engine Refinery::Redactor
end
after_inclusion do
%w(refinery-redactor/plugins refinery-redactor/index).each do |stylesheet|
Refinery::Core.config.register_visual_editor_stylesheet stylesheet
end
%W(refinery-redactor/plugins refinery-redactor/index).each do |javascript|
Refinery::Core.config.register_visual_editor_javascript javascript
end
end
end
end
end
| Load all plugins by default | Load all plugins by default
| Ruby | mit | rabid/refinerycms-redactor,rabid/refinerycms-redactor,rabid/refinerycms-redactor | ruby | ## Code Before:
module Refinery
module Redactor
class Engine < ::Rails::Engine
include Refinery::Engine
isolate_namespace Refinery
engine_name :refinery_redactor
# set the manifests and assets to be precompiled
config.to_prepare do
Rails.application.config.assets.precompile += %w(
refinery-redactor/index.css
refinery-redactor/plugins.js
refinery-redactor/index.js
)
end
before_inclusion do
Refinery::Plugin.register do |plugin|
plugin.pathname = root
plugin.name = "refinerycms_redactor"
plugin.hide_from_menu = true
plugin.menu_match = %r{refinery/redactor}
end
end
config.after_initialize do
Refinery.register_engine Refinery::Redactor
end
after_inclusion do
%w(refinery-redactor/index).each do |stylesheet|
Refinery::Core.config.register_visual_editor_stylesheet stylesheet
end
%W(refinery-redactor/index refinery-redactor/plugins).each do |javascript|
Refinery::Core.config.register_visual_editor_javascript javascript
end
end
end
end
end
## Instruction:
Load all plugins by default
## Code After:
module Refinery
module Redactor
class Engine < ::Rails::Engine
include Refinery::Engine
isolate_namespace Refinery
engine_name :refinery_redactor
# set the manifests and assets to be precompiled
config.to_prepare do
Rails.application.config.assets.precompile += %w(
refinery-redactor/index.css
refinery-redactor/plugins.css
refinery-redactor/plugins.js
refinery-redactor/index.js
)
end
before_inclusion do
Refinery::Plugin.register do |plugin|
plugin.pathname = root
plugin.name = "refinerycms_redactor"
plugin.hide_from_menu = true
plugin.menu_match = %r{refinery/redactor}
end
end
config.after_initialize do
Refinery.register_engine Refinery::Redactor
end
after_inclusion do
%w(refinery-redactor/plugins refinery-redactor/index).each do |stylesheet|
Refinery::Core.config.register_visual_editor_stylesheet stylesheet
end
%W(refinery-redactor/plugins refinery-redactor/index).each do |javascript|
Refinery::Core.config.register_visual_editor_javascript javascript
end
end
end
end
end
| module Refinery
module Redactor
class Engine < ::Rails::Engine
include Refinery::Engine
isolate_namespace Refinery
engine_name :refinery_redactor
# set the manifests and assets to be precompiled
config.to_prepare do
Rails.application.config.assets.precompile += %w(
refinery-redactor/index.css
+ refinery-redactor/plugins.css
refinery-redactor/plugins.js
refinery-redactor/index.js
)
end
before_inclusion do
Refinery::Plugin.register do |plugin|
plugin.pathname = root
plugin.name = "refinerycms_redactor"
plugin.hide_from_menu = true
plugin.menu_match = %r{refinery/redactor}
end
end
config.after_initialize do
Refinery.register_engine Refinery::Redactor
end
after_inclusion do
- %w(refinery-redactor/index).each do |stylesheet|
+ %w(refinery-redactor/plugins refinery-redactor/index).each do |stylesheet|
? ++++++++++++++++++++++++++
Refinery::Core.config.register_visual_editor_stylesheet stylesheet
end
- %W(refinery-redactor/index refinery-redactor/plugins).each do |javascript|
? ^^^ ---- ^
+ %W(refinery-redactor/plugins refinery-redactor/index).each do |javascript|
? ++++ ^ ^^^
Refinery::Core.config.register_visual_editor_javascript javascript
end
end
end
end
end | 5 | 0.119048 | 3 | 2 |
6345c88fb935c9b38343846122a442ab3a9ad07d | scripts/run_test_component.sh | scripts/run_test_component.sh | ENMASSE_DIR=$1
DIR=`dirname $0`
set -x
source $DIR/common.sh
failure=0
oc login -u test -p test --insecure-skip-tls-verify=true https://localhost:8443
setup_test enmasse-ci $ENMASSE_DIR
run_test enmasse-ci true || failure=$(($failure + 1))
# teardown_test enmasse-ci
if [ $failure -gt 0 ]
then
echo "Systemtests failed"
exit 1
fi
| ENMASSE_DIR=$1
DIR=`dirname $0`
source $DIR/common.sh
failure=0
OPENSHIFT_URL=${OPENSHIFT_URL:-https://localhost:8443}
OPENSHIFT_USER=${OPENSHIFT_USER:-test}
OPENSHIFT_PASSWD=${OPENSHIFT_PASSWD:-test}
OPENSHIFT_PROJECT=${OPENSHIFT_PROJECT:-enmasseci}
MULTITENANT=${MULTITENANT:-false}
oc login -u ${OPENSHIFT_USER} -p ${OPENSHIFT_PASSWD} --insecure-skip-tls-verify=true ${OPENSHIFT_URL}
setup_test $OPENSHIFT_PROJECT $ENMASSE_DIR $MULTITENANT $OPENSHIFT_URL $OPENSHIFT_USER
run_test $OPENSHIFT_PROJECT true || failure=$(($failure + 1))
teardown_test $OPENSHIFT_PROJECT
if [ $failure -gt 0 ]
then
echo "Systemtests failed"
exit 1
fi
| Use variables from environment if set | Use variables from environment if set
| Shell | apache-2.0 | jenmalloy/enmasse,EnMasseProject/enmasse,jenmalloy/enmasse,jenmalloy/enmasse,EnMasseProject/enmasse,jenmalloy/enmasse,EnMasseProject/enmasse,EnMasseProject/enmasse,EnMasseProject/enmasse,EnMasseProject/enmasse,jenmalloy/enmasse,jenmalloy/enmasse,jenmalloy/enmasse,EnMasseProject/enmasse | shell | ## Code Before:
ENMASSE_DIR=$1
DIR=`dirname $0`
set -x
source $DIR/common.sh
failure=0
oc login -u test -p test --insecure-skip-tls-verify=true https://localhost:8443
setup_test enmasse-ci $ENMASSE_DIR
run_test enmasse-ci true || failure=$(($failure + 1))
# teardown_test enmasse-ci
if [ $failure -gt 0 ]
then
echo "Systemtests failed"
exit 1
fi
## Instruction:
Use variables from environment if set
## Code After:
ENMASSE_DIR=$1
DIR=`dirname $0`
source $DIR/common.sh
failure=0
OPENSHIFT_URL=${OPENSHIFT_URL:-https://localhost:8443}
OPENSHIFT_USER=${OPENSHIFT_USER:-test}
OPENSHIFT_PASSWD=${OPENSHIFT_PASSWD:-test}
OPENSHIFT_PROJECT=${OPENSHIFT_PROJECT:-enmasseci}
MULTITENANT=${MULTITENANT:-false}
oc login -u ${OPENSHIFT_USER} -p ${OPENSHIFT_PASSWD} --insecure-skip-tls-verify=true ${OPENSHIFT_URL}
setup_test $OPENSHIFT_PROJECT $ENMASSE_DIR $MULTITENANT $OPENSHIFT_URL $OPENSHIFT_USER
run_test $OPENSHIFT_PROJECT true || failure=$(($failure + 1))
teardown_test $OPENSHIFT_PROJECT
if [ $failure -gt 0 ]
then
echo "Systemtests failed"
exit 1
fi
| ENMASSE_DIR=$1
DIR=`dirname $0`
- set -x
source $DIR/common.sh
failure=0
+ OPENSHIFT_URL=${OPENSHIFT_URL:-https://localhost:8443}
+ OPENSHIFT_USER=${OPENSHIFT_USER:-test}
+ OPENSHIFT_PASSWD=${OPENSHIFT_PASSWD:-test}
+ OPENSHIFT_PROJECT=${OPENSHIFT_PROJECT:-enmasseci}
+ MULTITENANT=${MULTITENANT:-false}
- oc login -u test -p test --insecure-skip-tls-verify=true https://localhost:8443
+ oc login -u ${OPENSHIFT_USER} -p ${OPENSHIFT_PASSWD} --insecure-skip-tls-verify=true ${OPENSHIFT_URL}
- setup_test enmasse-ci $ENMASSE_DIR
+ setup_test $OPENSHIFT_PROJECT $ENMASSE_DIR $MULTITENANT $OPENSHIFT_URL $OPENSHIFT_USER
- run_test enmasse-ci true || failure=$(($failure + 1))
? ^^^^^^^^^^
+ run_test $OPENSHIFT_PROJECT true || failure=$(($failure + 1))
? ^^^^^^^^^^^^^^^^^^
- # teardown_test enmasse-ci
+ teardown_test $OPENSHIFT_PROJECT
if [ $failure -gt 0 ]
then
echo "Systemtests failed"
exit 1
fi | 14 | 0.823529 | 9 | 5 |
c66f5426d12423d3cd2709ed642669ffd3685c5e | README.md | README.md | Asessment for applying to GingerPayments
| Asessment for applying to GingerPayments ([link to the original description](https://github.com/gingerpayments/hiring/blob/master/coding-assignments/python-address-book-assignment/python-address-book-assignment.rst)).
| Add the link to the original description | Add the link to the original description | Markdown | mit | dizpers/python-address-book-assignment | markdown | ## Code Before:
Asessment for applying to GingerPayments
## Instruction:
Add the link to the original description
## Code After:
Asessment for applying to GingerPayments ([link to the original description](https://github.com/gingerpayments/hiring/blob/master/coding-assignments/python-address-book-assignment/python-address-book-assignment.rst)).
| - Asessment for applying to GingerPayments
+ Asessment for applying to GingerPayments ([link to the original description](https://github.com/gingerpayments/hiring/blob/master/coding-assignments/python-address-book-assignment/python-address-book-assignment.rst)). | 2 | 2 | 1 | 1 |
88a24ba80e2bb38f3ec899955743d00655e553cd | spec/support/chargeback_helper.rb | spec/support/chargeback_helper.rb | module Spec
module Support
module ChargebackHelper
def set_tier_param_for(metric, param, value, num_of_tier = 0)
tier = chargeback_rate.chargeback_rate_details.where(:metric => metric).first.chargeback_tiers[num_of_tier]
tier.send("#{param}=", value)
tier.save
end
def used_average_for(metric, hours_in_interval, resource)
resource.metric_rollups.sum(&metric) / hours_in_interval
end
end
end
end
| module Spec
module Support
module ChargebackHelper
def set_tier_param_for(metric, param, value, num_of_tier = 0)
tier = chargeback_rate.chargeback_rate_details.where(:metric => metric).first.chargeback_tiers[num_of_tier]
tier.send("#{param}=", value)
tier.save
end
def used_average_for(metric, hours_in_interval, resource)
resource.metric_rollups.sum(&metric) / hours_in_interval
end
def add_metric_rollups_for(resources, range, step, metric_rollup_params, trait = :with_data)
range.step_value(step).each do |time|
Array(resources).each do |resource|
metric_rollup_params[:timestamp] = time
metric_rollup_params[:resource_id] = resource.id
metric_rollup_params[:resource_name] = resource.name
params = [:metric_rollup_vm_hr, trait, metric_rollup_params].compact
resource.metric_rollups << FactoryGirl.create(*params)
end
end
end
end
end
end
| Add helper method for generating MetricRollups | Add helper method for generating MetricRollups
| Ruby | apache-2.0 | lpichler/manageiq,gmcculloug/manageiq,jntullo/manageiq,kbrock/manageiq,jrafanie/manageiq,israel-hdez/manageiq,matobet/manageiq,lpichler/manageiq,ilackarms/manageiq,israel-hdez/manageiq,borod108/manageiq,mzazrivec/manageiq,josejulio/manageiq,pkomanek/manageiq,kbrock/manageiq,israel-hdez/manageiq,NickLaMuro/manageiq,mfeifer/manageiq,mresti/manageiq,durandom/manageiq,juliancheal/manageiq,andyvesel/manageiq,d-m-u/manageiq,syncrou/manageiq,romanblanco/manageiq,branic/manageiq,agrare/manageiq,romanblanco/manageiq,jrafanie/manageiq,tzumainn/manageiq,djberg96/manageiq,mfeifer/manageiq,tzumainn/manageiq,billfitzgerald0120/manageiq,NaNi-Z/manageiq,gerikis/manageiq,pkomanek/manageiq,juliancheal/manageiq,skateman/manageiq,jrafanie/manageiq,NaNi-Z/manageiq,billfitzgerald0120/manageiq,pkomanek/manageiq,gerikis/manageiq,romanblanco/manageiq,tzumainn/manageiq,andyvesel/manageiq,aufi/manageiq,branic/manageiq,agrare/manageiq,borod108/manageiq,fbladilo/manageiq,jameswnl/manageiq,mzazrivec/manageiq,tzumainn/manageiq,jntullo/manageiq,josejulio/manageiq,andyvesel/manageiq,billfitzgerald0120/manageiq,andyvesel/manageiq,d-m-u/manageiq,skateman/manageiq,matobet/manageiq,billfitzgerald0120/manageiq,aufi/manageiq,agrare/manageiq,fbladilo/manageiq,ilackarms/manageiq,hstastna/manageiq,ManageIQ/manageiq,ailisp/manageiq,gmcculloug/manageiq,ailisp/manageiq,d-m-u/manageiq,chessbyte/manageiq,fbladilo/manageiq,jvlcek/manageiq,borod108/manageiq,juliancheal/manageiq,juliancheal/manageiq,josejulio/manageiq,jvlcek/manageiq,chessbyte/manageiq,gerikis/manageiq,ilackarms/manageiq,josejulio/manageiq,yaacov/manageiq,ManageIQ/manageiq,kbrock/manageiq,jntullo/manageiq,jvlcek/manageiq,jameswnl/manageiq,pkomanek/manageiq,syncrou/manageiq,ManageIQ/manageiq,mkanoor/manageiq,lpichler/manageiq,skateman/manageiq,agrare/manageiq,hstastna/manageiq,chessbyte/manageiq,yaacov/manageiq,borod108/manageiq,syncrou/manageiq,ilackarms/manageiq,NickLaMuro/manageiq,djberg96/manageiq,NaNi-Z/manageiq,yaacov/manageiq,branic/manageiq,mkanoor/manageiq,lpichler/manageiq,tinaafitz/manageiq,durandom/manageiq,aufi/manageiq,skateman/manageiq,kbrock/manageiq,tinaafitz/manageiq,NickLaMuro/manageiq,matobet/manageiq,djberg96/manageiq,mresti/manageiq,durandom/manageiq,djberg96/manageiq,NickLaMuro/manageiq,jrafanie/manageiq,tinaafitz/manageiq,aufi/manageiq,mkanoor/manageiq,jameswnl/manageiq,jvlcek/manageiq,hstastna/manageiq,d-m-u/manageiq,NaNi-Z/manageiq,ManageIQ/manageiq,chessbyte/manageiq,gmcculloug/manageiq,hstastna/manageiq,syncrou/manageiq,gerikis/manageiq,matobet/manageiq,romanblanco/manageiq,mresti/manageiq,jameswnl/manageiq,gmcculloug/manageiq,tinaafitz/manageiq,fbladilo/manageiq,yaacov/manageiq,mresti/manageiq,jntullo/manageiq,mkanoor/manageiq,mzazrivec/manageiq,mfeifer/manageiq,mzazrivec/manageiq,branic/manageiq,ailisp/manageiq,mfeifer/manageiq,ailisp/manageiq,durandom/manageiq,israel-hdez/manageiq | ruby | ## Code Before:
module Spec
module Support
module ChargebackHelper
def set_tier_param_for(metric, param, value, num_of_tier = 0)
tier = chargeback_rate.chargeback_rate_details.where(:metric => metric).first.chargeback_tiers[num_of_tier]
tier.send("#{param}=", value)
tier.save
end
def used_average_for(metric, hours_in_interval, resource)
resource.metric_rollups.sum(&metric) / hours_in_interval
end
end
end
end
## Instruction:
Add helper method for generating MetricRollups
## Code After:
module Spec
module Support
module ChargebackHelper
def set_tier_param_for(metric, param, value, num_of_tier = 0)
tier = chargeback_rate.chargeback_rate_details.where(:metric => metric).first.chargeback_tiers[num_of_tier]
tier.send("#{param}=", value)
tier.save
end
def used_average_for(metric, hours_in_interval, resource)
resource.metric_rollups.sum(&metric) / hours_in_interval
end
def add_metric_rollups_for(resources, range, step, metric_rollup_params, trait = :with_data)
range.step_value(step).each do |time|
Array(resources).each do |resource|
metric_rollup_params[:timestamp] = time
metric_rollup_params[:resource_id] = resource.id
metric_rollup_params[:resource_name] = resource.name
params = [:metric_rollup_vm_hr, trait, metric_rollup_params].compact
resource.metric_rollups << FactoryGirl.create(*params)
end
end
end
end
end
end
| module Spec
module Support
module ChargebackHelper
def set_tier_param_for(metric, param, value, num_of_tier = 0)
tier = chargeback_rate.chargeback_rate_details.where(:metric => metric).first.chargeback_tiers[num_of_tier]
tier.send("#{param}=", value)
tier.save
end
def used_average_for(metric, hours_in_interval, resource)
resource.metric_rollups.sum(&metric) / hours_in_interval
end
+
+ def add_metric_rollups_for(resources, range, step, metric_rollup_params, trait = :with_data)
+ range.step_value(step).each do |time|
+ Array(resources).each do |resource|
+ metric_rollup_params[:timestamp] = time
+ metric_rollup_params[:resource_id] = resource.id
+ metric_rollup_params[:resource_name] = resource.name
+ params = [:metric_rollup_vm_hr, trait, metric_rollup_params].compact
+ resource.metric_rollups << FactoryGirl.create(*params)
+ end
+ end
+ end
end
end
end | 12 | 0.8 | 12 | 0 |
51b0f8da60b475844470b80756ae7d6690732deb | salt/monitoring/client/init.sls | salt/monitoring/client/init.sls | diamond-depends:
pkg.installed:
- pkgs:
- python-configobj
- python-psutil
diamond:
pkg.installed:
- sources:
- python-diamond: salt://monitoring/client/packages/python-diamond_3.4.421_all.deb
- require:
- pkg: diamond-depends
group.present:
- system: True
user.present:
- shell: /bin/false
- system: True
- gid_from_name: True
- require:
- group: diamond
/etc/diamond/diamond.conf:
file.managed:
- source: salt://monitoring/client/configs/diamond.conf.jinja
- template: jinja
- user: root
- group: root
- mode: 644
- require:
- pkg: diamond
| diamond-depends:
pkg.installed:
- pkgs:
- python-configobj
- python-psutil
diamond:
pkg.installed:
- sources:
- python-diamond: salt://monitoring/client/packages/python-diamond_3.4.421_all.deb
- require:
- pkg: diamond-depends
group.present:
- system: True
user.present:
- shell: /bin/false
- system: True
- gid_from_name: True
- require:
- group: diamond
service.running:
- enable: True
- watch:
- file: /etc/diamond/diamond.conf
- require:
- pkg: diamond
- user: diamond
/etc/diamond/diamond.conf:
file.managed:
- source: salt://monitoring/client/configs/diamond.conf.jinja
- template: jinja
- user: root
- group: root
- mode: 644
- require:
- pkg: diamond
| Set the diamond client to running | Set the diamond client to running
| SaltStack | mit | dstufft/psf-salt,zware/psf-salt,zooba/psf-salt,python/psf-salt,caktus/psf-salt,caktus/psf-salt,dstufft/psf-salt,python/psf-salt,zooba/psf-salt,dstufft/psf-salt,zware/psf-salt,zware/psf-salt,python/psf-salt,caktus/psf-salt,python/psf-salt,zware/psf-salt,zooba/psf-salt | saltstack | ## Code Before:
diamond-depends:
pkg.installed:
- pkgs:
- python-configobj
- python-psutil
diamond:
pkg.installed:
- sources:
- python-diamond: salt://monitoring/client/packages/python-diamond_3.4.421_all.deb
- require:
- pkg: diamond-depends
group.present:
- system: True
user.present:
- shell: /bin/false
- system: True
- gid_from_name: True
- require:
- group: diamond
/etc/diamond/diamond.conf:
file.managed:
- source: salt://monitoring/client/configs/diamond.conf.jinja
- template: jinja
- user: root
- group: root
- mode: 644
- require:
- pkg: diamond
## Instruction:
Set the diamond client to running
## Code After:
diamond-depends:
pkg.installed:
- pkgs:
- python-configobj
- python-psutil
diamond:
pkg.installed:
- sources:
- python-diamond: salt://monitoring/client/packages/python-diamond_3.4.421_all.deb
- require:
- pkg: diamond-depends
group.present:
- system: True
user.present:
- shell: /bin/false
- system: True
- gid_from_name: True
- require:
- group: diamond
service.running:
- enable: True
- watch:
- file: /etc/diamond/diamond.conf
- require:
- pkg: diamond
- user: diamond
/etc/diamond/diamond.conf:
file.managed:
- source: salt://monitoring/client/configs/diamond.conf.jinja
- template: jinja
- user: root
- group: root
- mode: 644
- require:
- pkg: diamond
| diamond-depends:
pkg.installed:
- pkgs:
- python-configobj
- python-psutil
diamond:
pkg.installed:
- sources:
- python-diamond: salt://monitoring/client/packages/python-diamond_3.4.421_all.deb
- require:
- pkg: diamond-depends
group.present:
- system: True
user.present:
- shell: /bin/false
- system: True
- gid_from_name: True
- require:
- group: diamond
+ service.running:
+ - enable: True
+ - watch:
+ - file: /etc/diamond/diamond.conf
+ - require:
+ - pkg: diamond
+ - user: diamond
+
/etc/diamond/diamond.conf:
file.managed:
- source: salt://monitoring/client/configs/diamond.conf.jinja
- template: jinja
- user: root
- group: root
- mode: 644
- require:
- pkg: diamond
-
- | 10 | 0.277778 | 8 | 2 |
157d9da9e4b1b690e0c4d0379fed80e512d0ecad | ftp/CMakeLists.txt | ftp/CMakeLists.txt | project(ftp-client)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
set(CMAKE_C_FLAGS "-std=gnu99 -Wall -g")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(PCRE)
if (PCRE_FOUND)
include_directories(${PCRE_INCLUDE_DIRS})
target_link_libraries (ftp-client ${PCRE_LIBRARIES})
endif (PCRE_FOUND)
| project(download)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
set(CMAKE_C_FLAGS "-std=gnu99 -Wall -g")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(PCRE)
if (PCRE_FOUND)
include_directories(${PCRE_INCLUDE_DIRS})
target_link_libraries (${PROJECT_NAME} ${PCRE_LIBRARIES})
endif (PCRE_FOUND)
| Change executable name from ftp-client to download | Change executable name from ftp-client to download
| Text | mit | DDuarte/feup-rcom-serialport_and_ftp | text | ## Code Before:
project(ftp-client)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
set(CMAKE_C_FLAGS "-std=gnu99 -Wall -g")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(PCRE)
if (PCRE_FOUND)
include_directories(${PCRE_INCLUDE_DIRS})
target_link_libraries (ftp-client ${PCRE_LIBRARIES})
endif (PCRE_FOUND)
## Instruction:
Change executable name from ftp-client to download
## Code After:
project(download)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
set(CMAKE_C_FLAGS "-std=gnu99 -Wall -g")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(PCRE)
if (PCRE_FOUND)
include_directories(${PCRE_INCLUDE_DIRS})
target_link_libraries (${PROJECT_NAME} ${PCRE_LIBRARIES})
endif (PCRE_FOUND)
| - project(ftp-client)
+ project(download)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
set(CMAKE_C_FLAGS "-std=gnu99 -Wall -g")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
find_package(PCRE)
if (PCRE_FOUND)
include_directories(${PCRE_INCLUDE_DIRS})
- target_link_libraries (ftp-client ${PCRE_LIBRARIES})
? ^^^^^^^^^^
+ target_link_libraries (${PROJECT_NAME} ${PCRE_LIBRARIES})
? ^^^^^^^^^^^^^^^
endif (PCRE_FOUND) | 4 | 0.285714 | 2 | 2 |
1a721d6b1bd32da9f48fb5f3dc0b26eee8bfd095 | test/__snapshots__/show.js | test/__snapshots__/show.js |
var fs = require('fs')
var path = require('path')
var chalk = require('chalk')
function show (result) {
Object.keys(result).sort().reverse().forEach(file => {
var test = file.replace(/\.test\.js\.snap$/, '')
result[file].split('exports[`')
.filter(str => str.indexOf('// ') !== 0)
.forEach(str => {
if (str.trim().length === 0) return
var parts = str.replace(/"\s*`;\s*$/, '').split(/`] = `\s*"/)
process.stdout.write(
chalk.gray(`${ test } ${ parts[0].replace(/ 1$/, '') }:\n\n`))
process.stdout.write(parts[1])
})
})
}
fs.readdir(__dirname, (err, list) => {
if (err) throw err
var snaps = list.filter(i => /\.snap$/.test(i))
var result = { }
snaps.forEach(file => {
fs.readFile(path.join(__dirname, file), (err2, content) => {
if (err2) throw err2
result[file] = content.toString()
if (Object.keys(result).length === snaps.length) show(result)
})
})
})
|
var fs = require('fs')
var path = require('path')
var chalk = require('chalk')
var filter = process.argv[2]
function show (result) {
Object.keys(result).sort().reverse().forEach(file => {
var test = file.replace(/\.test\.js\.snap$/, '')
result[file].split('exports[`')
.filter(str => str.indexOf('// ') !== 0)
.filter(str => !filter || str.indexOf(filter) !== -1)
.forEach(str => {
if (str.trim().length === 0) return
var parts = str.replace(/"\s*`;\s*$/, '').split(/`] = `\s*"/)
process.stdout.write(
chalk.gray(`${ test } ${ parts[0].replace(/ 1$/, '') }:\n\n`))
process.stdout.write(parts[1])
})
})
}
fs.readdir(__dirname, (err, list) => {
if (err) throw err
var snaps = list.filter(i => /\.snap$/.test(i))
var result = { }
snaps.forEach(file => {
fs.readFile(path.join(__dirname, file), (err2, content) => {
if (err2) throw err2
result[file] = content.toString()
if (Object.keys(result).length === snaps.length) show(result)
})
})
})
| Add filters to snapshot preview | Add filters to snapshot preview
| JavaScript | mit | logux/logux-server | javascript | ## Code Before:
var fs = require('fs')
var path = require('path')
var chalk = require('chalk')
function show (result) {
Object.keys(result).sort().reverse().forEach(file => {
var test = file.replace(/\.test\.js\.snap$/, '')
result[file].split('exports[`')
.filter(str => str.indexOf('// ') !== 0)
.forEach(str => {
if (str.trim().length === 0) return
var parts = str.replace(/"\s*`;\s*$/, '').split(/`] = `\s*"/)
process.stdout.write(
chalk.gray(`${ test } ${ parts[0].replace(/ 1$/, '') }:\n\n`))
process.stdout.write(parts[1])
})
})
}
fs.readdir(__dirname, (err, list) => {
if (err) throw err
var snaps = list.filter(i => /\.snap$/.test(i))
var result = { }
snaps.forEach(file => {
fs.readFile(path.join(__dirname, file), (err2, content) => {
if (err2) throw err2
result[file] = content.toString()
if (Object.keys(result).length === snaps.length) show(result)
})
})
})
## Instruction:
Add filters to snapshot preview
## Code After:
var fs = require('fs')
var path = require('path')
var chalk = require('chalk')
var filter = process.argv[2]
function show (result) {
Object.keys(result).sort().reverse().forEach(file => {
var test = file.replace(/\.test\.js\.snap$/, '')
result[file].split('exports[`')
.filter(str => str.indexOf('// ') !== 0)
.filter(str => !filter || str.indexOf(filter) !== -1)
.forEach(str => {
if (str.trim().length === 0) return
var parts = str.replace(/"\s*`;\s*$/, '').split(/`] = `\s*"/)
process.stdout.write(
chalk.gray(`${ test } ${ parts[0].replace(/ 1$/, '') }:\n\n`))
process.stdout.write(parts[1])
})
})
}
fs.readdir(__dirname, (err, list) => {
if (err) throw err
var snaps = list.filter(i => /\.snap$/.test(i))
var result = { }
snaps.forEach(file => {
fs.readFile(path.join(__dirname, file), (err2, content) => {
if (err2) throw err2
result[file] = content.toString()
if (Object.keys(result).length === snaps.length) show(result)
})
})
})
|
var fs = require('fs')
var path = require('path')
var chalk = require('chalk')
+
+ var filter = process.argv[2]
function show (result) {
Object.keys(result).sort().reverse().forEach(file => {
var test = file.replace(/\.test\.js\.snap$/, '')
result[file].split('exports[`')
.filter(str => str.indexOf('// ') !== 0)
+ .filter(str => !filter || str.indexOf(filter) !== -1)
.forEach(str => {
if (str.trim().length === 0) return
var parts = str.replace(/"\s*`;\s*$/, '').split(/`] = `\s*"/)
process.stdout.write(
chalk.gray(`${ test } ${ parts[0].replace(/ 1$/, '') }:\n\n`))
process.stdout.write(parts[1])
})
})
}
fs.readdir(__dirname, (err, list) => {
if (err) throw err
var snaps = list.filter(i => /\.snap$/.test(i))
var result = { }
snaps.forEach(file => {
fs.readFile(path.join(__dirname, file), (err2, content) => {
if (err2) throw err2
result[file] = content.toString()
if (Object.keys(result).length === snaps.length) show(result)
})
})
}) | 3 | 0.090909 | 3 | 0 |
d131752554acd5cb10d19acc0c43048fdd457975 | app/views/components/navigation/_secondary.html.haml | app/views/components/navigation/_secondary.html.haml | -# The inline navigation for wide screens
.wv--split--right.nav--inline.nav--secondary.wv--block
- properties[:items].each do |n|
- active = n[:title] == properties[:section_name] || (n[:slug].end_with? properties[:section_name].downcase.strip.gsub(' ', '-'))
%a.nav__item.nav__item--secondary.js-nav-item{:class=>(active ? 'current' : ''), :href=> n[:slug]}<
= n[:title]
-# The select navigation for small screens
.wv--split--right.nav--inline.nav--secondary.wv--hidden.nav--secondary__dropdown
= ui_component('navigation/dropdown', properties: { action: "/redirector", dropdown: {name: 'url', options: subnav_options(properties[:responsive_items] || properties[:items]), selected: properties[:section_name], placeholder: properties[:responsive_placeholder], class: 'js-responsive-nav', data: { form_submit: "true" }} })
| -# The inline navigation for wide screens
.wv--split--right.nav--inline.nav--secondary.wv--block
- properties[:items].each do |n|
- active = n[:title] == properties[:section_name] || (n[:slug].end_with? properties[:section_name].downcase.strip.gsub(' ', '-'))
%a.nav__item.nav__item--secondary.js-nav-item{:class=>(active ? 'current' : ''), :href=> n[:slug]}<
= n[:title]
-# The select navigation for small screens
.wv--split--right.nav--inline.nav--secondary.wv--hidden.nav--secondary__dropdown
= ui_component('navigation/dropdown', properties: { action: (properties[:action] || "/redirector"), dropdown: {name: 'url', options: subnav_options(properties[:responsive_items] || properties[:items]), selected: properties[:section_name], placeholder: properties[:responsive_placeholder], class: 'js-responsive-nav', data: { form_submit: "true" }} })
| Allow to specify action in secondary nav for mobile | Allow to specify action in secondary nav for mobile
Currently hardcoded path is /redirector, it doesn't work when app is
mounted in subdirectory (i.e. Community)
| Haml | mit | Lostmyname/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo,Lostmyname/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo,lonelyplanet/rizzo,lonelyplanet/rizzo | haml | ## Code Before:
-# The inline navigation for wide screens
.wv--split--right.nav--inline.nav--secondary.wv--block
- properties[:items].each do |n|
- active = n[:title] == properties[:section_name] || (n[:slug].end_with? properties[:section_name].downcase.strip.gsub(' ', '-'))
%a.nav__item.nav__item--secondary.js-nav-item{:class=>(active ? 'current' : ''), :href=> n[:slug]}<
= n[:title]
-# The select navigation for small screens
.wv--split--right.nav--inline.nav--secondary.wv--hidden.nav--secondary__dropdown
= ui_component('navigation/dropdown', properties: { action: "/redirector", dropdown: {name: 'url', options: subnav_options(properties[:responsive_items] || properties[:items]), selected: properties[:section_name], placeholder: properties[:responsive_placeholder], class: 'js-responsive-nav', data: { form_submit: "true" }} })
## Instruction:
Allow to specify action in secondary nav for mobile
Currently hardcoded path is /redirector, it doesn't work when app is
mounted in subdirectory (i.e. Community)
## Code After:
-# The inline navigation for wide screens
.wv--split--right.nav--inline.nav--secondary.wv--block
- properties[:items].each do |n|
- active = n[:title] == properties[:section_name] || (n[:slug].end_with? properties[:section_name].downcase.strip.gsub(' ', '-'))
%a.nav__item.nav__item--secondary.js-nav-item{:class=>(active ? 'current' : ''), :href=> n[:slug]}<
= n[:title]
-# The select navigation for small screens
.wv--split--right.nav--inline.nav--secondary.wv--hidden.nav--secondary__dropdown
= ui_component('navigation/dropdown', properties: { action: (properties[:action] || "/redirector"), dropdown: {name: 'url', options: subnav_options(properties[:responsive_items] || properties[:items]), selected: properties[:section_name], placeholder: properties[:responsive_placeholder], class: 'js-responsive-nav', data: { form_submit: "true" }} })
| -# The inline navigation for wide screens
.wv--split--right.nav--inline.nav--secondary.wv--block
- properties[:items].each do |n|
- active = n[:title] == properties[:section_name] || (n[:slug].end_with? properties[:section_name].downcase.strip.gsub(' ', '-'))
%a.nav__item.nav__item--secondary.js-nav-item{:class=>(active ? 'current' : ''), :href=> n[:slug]}<
= n[:title]
-# The select navigation for small screens
.wv--split--right.nav--inline.nav--secondary.wv--hidden.nav--secondary__dropdown
- = ui_component('navigation/dropdown', properties: { action: "/redirector", dropdown: {name: 'url', options: subnav_options(properties[:responsive_items] || properties[:items]), selected: properties[:section_name], placeholder: properties[:responsive_placeholder], class: 'js-responsive-nav', data: { form_submit: "true" }} })
+ = ui_component('navigation/dropdown', properties: { action: (properties[:action] || "/redirector"), dropdown: {name: 'url', options: subnav_options(properties[:responsive_items] || properties[:items]), selected: properties[:section_name], placeholder: properties[:responsive_placeholder], class: 'js-responsive-nav', data: { form_submit: "true" }} })
? ++++++++++++++++++++++++ +
| 2 | 0.2 | 1 | 1 |
330a5767acaa4d83fb36b6622fcab2c789646646 | config.ru | config.ru | require './config/app.rb'
module Rack
class ScsBlog < Static
def call(env)
status, headers, response = @file_server.call(env)
if status == 404
if env["PATH_INFO"] == "/"
env["PATH_INFO"] = "index.html"
else
env["PATH_INFO"] = "#{env["PATH_INFO"]}.html"
end
status, headers, response = @file_server.call(env)
if status == 404
env["PATH_INFO"] = App::ERROR_404_PATH
end
end
super
end
end
end
use Rack::ScsBlog,
:urls => [""],
:root => "build",
:index => 'index.html'
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('build/index.html', File::RDONLY)
]
} | require './config/app.rb'
module Rack
class ScsBlog < Static
def call(env)
status, headers, response = @file_server.call(env)
if status == 404
ori_path = env["PATH_INFO"]
if ori_path == "/"
env["PATH_INFO"] = "index.html"
else
env["PATH_INFO"] = "#{ori_path}.html"
status, headers, response = @file_server.call(env)
if status == 404
env["PATH_INFO"] = "#{ori_path}/index.html"
status, headers, response = @file_server.call(env)
env["PATH_INFO"] = App::ERROR_404_PATH if status == 404
end
end
end
super
end
end
end
use Rack::ScsBlog,
:urls => [""],
:root => "build",
:index => 'index.html'
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('build/index.html', File::RDONLY)
]
}
| Fix posts/index.html is not found | B: Fix posts/index.html is not found
| Ruby | mit | sibevin/scs-blog,sibevin/scs-blog | ruby | ## Code Before:
require './config/app.rb'
module Rack
class ScsBlog < Static
def call(env)
status, headers, response = @file_server.call(env)
if status == 404
if env["PATH_INFO"] == "/"
env["PATH_INFO"] = "index.html"
else
env["PATH_INFO"] = "#{env["PATH_INFO"]}.html"
end
status, headers, response = @file_server.call(env)
if status == 404
env["PATH_INFO"] = App::ERROR_404_PATH
end
end
super
end
end
end
use Rack::ScsBlog,
:urls => [""],
:root => "build",
:index => 'index.html'
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('build/index.html', File::RDONLY)
]
}
## Instruction:
B: Fix posts/index.html is not found
## Code After:
require './config/app.rb'
module Rack
class ScsBlog < Static
def call(env)
status, headers, response = @file_server.call(env)
if status == 404
ori_path = env["PATH_INFO"]
if ori_path == "/"
env["PATH_INFO"] = "index.html"
else
env["PATH_INFO"] = "#{ori_path}.html"
status, headers, response = @file_server.call(env)
if status == 404
env["PATH_INFO"] = "#{ori_path}/index.html"
status, headers, response = @file_server.call(env)
env["PATH_INFO"] = App::ERROR_404_PATH if status == 404
end
end
end
super
end
end
end
use Rack::ScsBlog,
:urls => [""],
:root => "build",
:index => 'index.html'
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('build/index.html', File::RDONLY)
]
}
| require './config/app.rb'
module Rack
class ScsBlog < Static
def call(env)
status, headers, response = @file_server.call(env)
if status == 404
- if env["PATH_INFO"] == "/"
? ^ -------
+ ori_path = env["PATH_INFO"]
? ++ ^^^^^^^
+ if ori_path == "/"
env["PATH_INFO"] = "index.html"
else
- env["PATH_INFO"] = "#{env["PATH_INFO"]}.html"
? ^^^^^^^^^ ^^^^^^
+ env["PATH_INFO"] = "#{ori_path}.html"
? ^^^ ^^^^
- end
- status, headers, response = @file_server.call(env)
+ status, headers, response = @file_server.call(env)
? ++
- if status == 404
+ if status == 404
? ++
+ env["PATH_INFO"] = "#{ori_path}/index.html"
+ status, headers, response = @file_server.call(env)
- env["PATH_INFO"] = App::ERROR_404_PATH
+ env["PATH_INFO"] = App::ERROR_404_PATH if status == 404
? ++ +++++++++++++++++
+ end
end
end
super
end
end
end
use Rack::ScsBlog,
:urls => [""],
:root => "build",
:index => 'index.html'
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
},
File.open('build/index.html', File::RDONLY)
]
} | 15 | 0.405405 | 9 | 6 |
d03eadd665524db9512f8a5ffef93aa443e1be8e | app/code/community/Sign2pay/Payment/Block/Form/Sign2pay.php | app/code/community/Sign2pay/Payment/Block/Form/Sign2pay.php | <?php
class Sign2pay_Payment_Block_Form_Sign2pay extends Mage_Payment_Block_Form
{
protected function _construct()
{
parent::_construct();
$this->setTemplate('sign2pay/form/sign2pay.phtml');
}
protected function _prepareLayout()
{
parent::_prepareLayout();
// This block might not be constructed
// with whole magento layout
if (Mage::app()->getLayout()->getBlock('head')) {
Mage::app()->getLayout()->getBlock('content')->append(
Mage::app()->getLayout()->createBlock('sign2pay/riskAssessment')
);
}
}
public function getOrderId()
{
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
return $lastOrderId;
}
public function getFullOrderID()
{
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
$paymentTransactionId = $order->getIncrementId();
return $paymentTransactionId;
}
}
| <?php
class Sign2pay_Payment_Block_Form_Sign2pay extends Mage_Payment_Block_Form
{
protected function _construct()
{
parent::_construct();
$this->setTemplate('sign2pay/form/sign2pay.phtml')
->setMethodLabelAfterHtml('<img src="https://app.sign2pay.com/api/v2/banks/logo.gif" alt="Sign2pay" height="20" style="margin-right: 0.4em;"/>');
}
protected function _prepareLayout()
{
parent::_prepareLayout();
// This block might not be constructed
// with whole magento layout
if (Mage::app()->getLayout()->getBlock('head')) {
Mage::app()->getLayout()->getBlock('content')->append(
Mage::app()->getLayout()->createBlock('sign2pay/riskAssessment')
);
}
}
public function getOrderId()
{
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
return $lastOrderId;
}
public function getFullOrderID()
{
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
$paymentTransactionId = $order->getIncrementId();
return $paymentTransactionId;
}
}
| Add logo to payment method | Add logo to payment method
| PHP | mit | magently/magento-sign2pay,magently/magento-sign2pay,Sign2Pay/magento-sign2pay,magently/magento-sign2pay,Sign2Pay/magento-sign2pay,Sign2Pay/magento-sign2pay | php | ## Code Before:
<?php
class Sign2pay_Payment_Block_Form_Sign2pay extends Mage_Payment_Block_Form
{
protected function _construct()
{
parent::_construct();
$this->setTemplate('sign2pay/form/sign2pay.phtml');
}
protected function _prepareLayout()
{
parent::_prepareLayout();
// This block might not be constructed
// with whole magento layout
if (Mage::app()->getLayout()->getBlock('head')) {
Mage::app()->getLayout()->getBlock('content')->append(
Mage::app()->getLayout()->createBlock('sign2pay/riskAssessment')
);
}
}
public function getOrderId()
{
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
return $lastOrderId;
}
public function getFullOrderID()
{
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
$paymentTransactionId = $order->getIncrementId();
return $paymentTransactionId;
}
}
## Instruction:
Add logo to payment method
## Code After:
<?php
class Sign2pay_Payment_Block_Form_Sign2pay extends Mage_Payment_Block_Form
{
protected function _construct()
{
parent::_construct();
$this->setTemplate('sign2pay/form/sign2pay.phtml')
->setMethodLabelAfterHtml('<img src="https://app.sign2pay.com/api/v2/banks/logo.gif" alt="Sign2pay" height="20" style="margin-right: 0.4em;"/>');
}
protected function _prepareLayout()
{
parent::_prepareLayout();
// This block might not be constructed
// with whole magento layout
if (Mage::app()->getLayout()->getBlock('head')) {
Mage::app()->getLayout()->getBlock('content')->append(
Mage::app()->getLayout()->createBlock('sign2pay/riskAssessment')
);
}
}
public function getOrderId()
{
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
return $lastOrderId;
}
public function getFullOrderID()
{
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
$paymentTransactionId = $order->getIncrementId();
return $paymentTransactionId;
}
}
| <?php
class Sign2pay_Payment_Block_Form_Sign2pay extends Mage_Payment_Block_Form
{
protected function _construct()
{
parent::_construct();
- $this->setTemplate('sign2pay/form/sign2pay.phtml');
? -
+ $this->setTemplate('sign2pay/form/sign2pay.phtml')
+ ->setMethodLabelAfterHtml('<img src="https://app.sign2pay.com/api/v2/banks/logo.gif" alt="Sign2pay" height="20" style="margin-right: 0.4em;"/>');
}
protected function _prepareLayout()
{
parent::_prepareLayout();
// This block might not be constructed
// with whole magento layout
if (Mage::app()->getLayout()->getBlock('head')) {
Mage::app()->getLayout()->getBlock('content')->append(
Mage::app()->getLayout()->createBlock('sign2pay/riskAssessment')
);
}
}
public function getOrderId()
{
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
return $lastOrderId;
}
public function getFullOrderID()
{
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getModel('sales/order')->load($lastOrderId);
$paymentTransactionId = $order->getIncrementId();
return $paymentTransactionId;
}
} | 3 | 0.081081 | 2 | 1 |
75e651cba761fad782dcac3b02695abc5d668e7e | index.js | index.js | 'use strict';
var es = require('event-stream');
var Mocha = require('mocha');
module.exports = function (options) {
var mocha = new Mocha(options);
return es.through(function (file) {
mocha.addFile(file.path);
this.emit('data', file);
}, function () {
mocha.run(function (errCount) {
if (errCount > 0) {
return this.emit('error', new Error('gulp-mocha: ' + errCount + ' ' + (errCount === 1 ? 'test' : 'tests') + ' failed.'));
}
this.emit('end');
}.bind(this));
});
};
| 'use strict';
var es = require('event-stream');
var Mocha = require('mocha');
var path = require('path');
module.exports = function (options) {
var mocha = new Mocha(options);
return es.through(function (file) {
delete require.cache[require.resolve(path.resolve(file.path))];
mocha.addFile(file.path);
this.emit('data', file);
}, function () {
mocha.run(function (errCount) {
if (errCount > 0) {
return this.emit('error', new Error('gulp-mocha: ' + errCount + ' ' + (errCount === 1 ? 'test' : 'tests') + ' failed.'));
}
this.emit('end');
}.bind(this));
});
};
| Make gulp-mocha comatible with watch | Make gulp-mocha comatible with watch
Since mocha uses `require` to load tests - we need either run mocha in
spawned process or clear requires cache.
| JavaScript | mit | tteltrab/gulp-mocha,sindresorhus/gulp-mocha | javascript | ## Code Before:
'use strict';
var es = require('event-stream');
var Mocha = require('mocha');
module.exports = function (options) {
var mocha = new Mocha(options);
return es.through(function (file) {
mocha.addFile(file.path);
this.emit('data', file);
}, function () {
mocha.run(function (errCount) {
if (errCount > 0) {
return this.emit('error', new Error('gulp-mocha: ' + errCount + ' ' + (errCount === 1 ? 'test' : 'tests') + ' failed.'));
}
this.emit('end');
}.bind(this));
});
};
## Instruction:
Make gulp-mocha comatible with watch
Since mocha uses `require` to load tests - we need either run mocha in
spawned process or clear requires cache.
## Code After:
'use strict';
var es = require('event-stream');
var Mocha = require('mocha');
var path = require('path');
module.exports = function (options) {
var mocha = new Mocha(options);
return es.through(function (file) {
delete require.cache[require.resolve(path.resolve(file.path))];
mocha.addFile(file.path);
this.emit('data', file);
}, function () {
mocha.run(function (errCount) {
if (errCount > 0) {
return this.emit('error', new Error('gulp-mocha: ' + errCount + ' ' + (errCount === 1 ? 'test' : 'tests') + ' failed.'));
}
this.emit('end');
}.bind(this));
});
};
| 'use strict';
var es = require('event-stream');
var Mocha = require('mocha');
+ var path = require('path');
module.exports = function (options) {
var mocha = new Mocha(options);
return es.through(function (file) {
+ delete require.cache[require.resolve(path.resolve(file.path))];
mocha.addFile(file.path);
this.emit('data', file);
}, function () {
mocha.run(function (errCount) {
if (errCount > 0) {
return this.emit('error', new Error('gulp-mocha: ' + errCount + ' ' + (errCount === 1 ? 'test' : 'tests') + ' failed.'));
}
this.emit('end');
}.bind(this));
});
}; | 2 | 0.1 | 2 | 0 |
e5953ff552c831c40c480b67da081eedbc389202 | lib/acts_as_groupable.rb | lib/acts_as_groupable.rb | module Groupable #:nodoc:
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def acts_as_groupable
has_and_belongs_to_many :groups
include Groupable::InstanceMethods
end
end
module InstanceMethods
def join_group(group)
groups << group
end
def leave_group(group)
groups.find(group).destroy
end
end
end
ActiveRecord::Base.send(:include, Groupable) | module Groupable #:nodoc:
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def acts_as_groupable
has_and_belongs_to_many :groups
include Groupable::InstanceMethods
end
end
module InstanceMethods
def join_group(group)
groups << group
end
def leave_group(group)
ActiveRecord::Base.connection.execute("delete from groups_users where group_id = #{group.id} and user_id = #{id}")
end
end
end
ActiveRecord::Base.send(:include, Groupable) | Make leave_group method work for realz | Make leave_group method work for realz
| Ruby | mit | jasontorres/acts_as_groupable | ruby | ## Code Before:
module Groupable #:nodoc:
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def acts_as_groupable
has_and_belongs_to_many :groups
include Groupable::InstanceMethods
end
end
module InstanceMethods
def join_group(group)
groups << group
end
def leave_group(group)
groups.find(group).destroy
end
end
end
ActiveRecord::Base.send(:include, Groupable)
## Instruction:
Make leave_group method work for realz
## Code After:
module Groupable #:nodoc:
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def acts_as_groupable
has_and_belongs_to_many :groups
include Groupable::InstanceMethods
end
end
module InstanceMethods
def join_group(group)
groups << group
end
def leave_group(group)
ActiveRecord::Base.connection.execute("delete from groups_users where group_id = #{group.id} and user_id = #{id}")
end
end
end
ActiveRecord::Base.send(:include, Groupable) | module Groupable #:nodoc:
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def acts_as_groupable
has_and_belongs_to_many :groups
include Groupable::InstanceMethods
end
end
module InstanceMethods
def join_group(group)
groups << group
end
def leave_group(group)
- groups.find(group).destroy
+ ActiveRecord::Base.connection.execute("delete from groups_users where group_id = #{group.id} and user_id = #{id}")
end
end
end
ActiveRecord::Base.send(:include, Groupable) | 2 | 0.076923 | 1 | 1 |
8b908f8adfb54e60e2886751bd67be645e1807c9 | src/jasmine.js | src/jasmine.js | /* eslint-env jasmine */
import { assertions } from 'redux-actions-assertions-js';
const toDispatchActions = () => {
return {
compare(action, expectedActions, done) {
assertions.toDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
};
const toNotDispatchActions = () => {
return {
compare(action, expectedActions, done) {
assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
};
const toDispatchActionsWithState = () => {
return {
compare(action, state, expectedActions, done) {
assertions.toDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
};
const toNotDispatchActionsWithState = () => {
return {
compare(action, state, expectedActions, done) {
assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
};
const matchers = {
toDispatchActions,
toNotDispatchActions,
toDispatchActionsWithState,
toNotDispatchActionsWithState
};
const registerAssertions = () => {
jasmine.addMatchers(matchers);
};
export {
registerAssertions,
matchers
};
| /* eslint-env jasmine */
import { assertions } from 'redux-actions-assertions-js';
function toDispatchActions() {
return {
compare(action, expectedActions, done) {
assertions.toDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
},
negativeCompare(action, expectedActions, done) {
assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
function toNotDispatchActions() {
return {
compare(action, expectedActions, done) {
assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
function toDispatchActionsWithState() {
return {
compare(action, state, expectedActions, done) {
assertions.toDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
},
negativeCompare(action, state, expectedActions, done) {
assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
function toNotDispatchActionsWithState() {
return {
compare(action, state, expectedActions, done) {
assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
const matchers = {
toDispatchActions,
toNotDispatchActions,
toDispatchActionsWithState,
toNotDispatchActionsWithState
};
function registerAssertions() {
jasmine.addMatchers(matchers);
}
export {
registerAssertions,
matchers
};
| Add support for negativeCompare, use function syntax | Add support for negativeCompare, use function syntax
| JavaScript | mit | redux-things/redux-actions-assertions,dmitry-zaets/redux-actions-assertions | javascript | ## Code Before:
/* eslint-env jasmine */
import { assertions } from 'redux-actions-assertions-js';
const toDispatchActions = () => {
return {
compare(action, expectedActions, done) {
assertions.toDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
};
const toNotDispatchActions = () => {
return {
compare(action, expectedActions, done) {
assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
};
const toDispatchActionsWithState = () => {
return {
compare(action, state, expectedActions, done) {
assertions.toDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
};
const toNotDispatchActionsWithState = () => {
return {
compare(action, state, expectedActions, done) {
assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
};
const matchers = {
toDispatchActions,
toNotDispatchActions,
toDispatchActionsWithState,
toNotDispatchActionsWithState
};
const registerAssertions = () => {
jasmine.addMatchers(matchers);
};
export {
registerAssertions,
matchers
};
## Instruction:
Add support for negativeCompare, use function syntax
## Code After:
/* eslint-env jasmine */
import { assertions } from 'redux-actions-assertions-js';
function toDispatchActions() {
return {
compare(action, expectedActions, done) {
assertions.toDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
},
negativeCompare(action, expectedActions, done) {
assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
function toNotDispatchActions() {
return {
compare(action, expectedActions, done) {
assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
function toDispatchActionsWithState() {
return {
compare(action, state, expectedActions, done) {
assertions.toDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
},
negativeCompare(action, state, expectedActions, done) {
assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
function toNotDispatchActionsWithState() {
return {
compare(action, state, expectedActions, done) {
assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
}
const matchers = {
toDispatchActions,
toNotDispatchActions,
toDispatchActionsWithState,
toNotDispatchActionsWithState
};
function registerAssertions() {
jasmine.addMatchers(matchers);
}
export {
registerAssertions,
matchers
};
| /* eslint-env jasmine */
import { assertions } from 'redux-actions-assertions-js';
- const toDispatchActions = () => {
? -- --- ---
+ function toDispatchActions() {
? +++ ++
return {
compare(action, expectedActions, done) {
assertions.toDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
+ },
+ negativeCompare(action, expectedActions, done) {
+ assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
+ return { pass: true };
}
};
- };
+ }
- const toNotDispatchActions = () => {
? -- --- ---
+ function toNotDispatchActions() {
? +++ ++
return {
compare(action, expectedActions, done) {
assertions.toNotDispatchActions(action, expectedActions, done, done.fail);
return { pass: true };
}
};
- };
+ }
- const toDispatchActionsWithState = () => {
? -- --- ---
+ function toDispatchActionsWithState() {
? +++ ++
return {
compare(action, state, expectedActions, done) {
assertions.toDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
+ },
+ negativeCompare(action, state, expectedActions, done) {
+ assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
+ return { pass: true };
}
};
- };
+ }
- const toNotDispatchActionsWithState = () => {
? -- --- ---
+ function toNotDispatchActionsWithState() {
? +++ ++
return {
compare(action, state, expectedActions, done) {
assertions.toNotDispatchActionsWithState(state, action, expectedActions, done, done.fail);
return { pass: true };
}
};
- };
+ }
const matchers = {
toDispatchActions,
toNotDispatchActions,
toDispatchActionsWithState,
toNotDispatchActionsWithState
};
- const registerAssertions = () => {
? -- --- ---
+ function registerAssertions() {
? +++ ++
jasmine.addMatchers(matchers);
- };
+ }
export {
registerAssertions,
matchers
}; | 28 | 0.518519 | 18 | 10 |
7fc4a8d2a12100bae9b2ddb5c0b08fbfd94091f2 | dataproperty/_container.py | dataproperty/_container.py |
'''
@author: Tsuyoshi Hombashi
'''
class MinMaxContainer(object):
@property
def min_value(self):
return self.__min_value
@property
def max_value(self):
return self.__max_value
def __init__(self, value_list=[]):
self.__min_value = None
self.__max_value = None
for value in value_list:
self.update(value)
def diff(self):
try:
return self.max_value - self.min_value
except TypeError:
return float("nan")
def mean(self):
try:
return (self.max_value + self.min_value) * 0.5
except TypeError:
return float("nan")
def update(self, value):
if value is None:
return
if self.__min_value is None:
self.__min_value = value
else:
self.__min_value = min(self.__min_value, value)
if self.__max_value is None:
self.__max_value = value
else:
self.__max_value = max(self.__max_value, value)
|
'''
@author: Tsuyoshi Hombashi
'''
class MinMaxContainer(object):
@property
def min_value(self):
return self.__min_value
@property
def max_value(self):
return self.__max_value
def __init__(self, value_list=[]):
self.__min_value = None
self.__max_value = None
for value in value_list:
self.update(value)
def __eq__(self, other):
return all([
self.min_value == other.min_value,
self.max_value == other.max_value,
])
def __ne__(self, other):
return any([
self.min_value != other.min_value,
self.max_value != other.max_value,
])
def __contains__(self, x):
return self.min_value <= x <= self.max_value
def diff(self):
try:
return self.max_value - self.min_value
except TypeError:
return float("nan")
def mean(self):
try:
return (self.max_value + self.min_value) * 0.5
except TypeError:
return float("nan")
def update(self, value):
if value is None:
return
if self.__min_value is None:
self.__min_value = value
else:
self.__min_value = min(self.__min_value, value)
if self.__max_value is None:
self.__max_value = value
else:
self.__max_value = max(self.__max_value, value)
| Add __eq__, __ne__, __contains__ methods | Add __eq__, __ne__, __contains__ methods
| Python | mit | thombashi/DataProperty | python | ## Code Before:
'''
@author: Tsuyoshi Hombashi
'''
class MinMaxContainer(object):
@property
def min_value(self):
return self.__min_value
@property
def max_value(self):
return self.__max_value
def __init__(self, value_list=[]):
self.__min_value = None
self.__max_value = None
for value in value_list:
self.update(value)
def diff(self):
try:
return self.max_value - self.min_value
except TypeError:
return float("nan")
def mean(self):
try:
return (self.max_value + self.min_value) * 0.5
except TypeError:
return float("nan")
def update(self, value):
if value is None:
return
if self.__min_value is None:
self.__min_value = value
else:
self.__min_value = min(self.__min_value, value)
if self.__max_value is None:
self.__max_value = value
else:
self.__max_value = max(self.__max_value, value)
## Instruction:
Add __eq__, __ne__, __contains__ methods
## Code After:
'''
@author: Tsuyoshi Hombashi
'''
class MinMaxContainer(object):
@property
def min_value(self):
return self.__min_value
@property
def max_value(self):
return self.__max_value
def __init__(self, value_list=[]):
self.__min_value = None
self.__max_value = None
for value in value_list:
self.update(value)
def __eq__(self, other):
return all([
self.min_value == other.min_value,
self.max_value == other.max_value,
])
def __ne__(self, other):
return any([
self.min_value != other.min_value,
self.max_value != other.max_value,
])
def __contains__(self, x):
return self.min_value <= x <= self.max_value
def diff(self):
try:
return self.max_value - self.min_value
except TypeError:
return float("nan")
def mean(self):
try:
return (self.max_value + self.min_value) * 0.5
except TypeError:
return float("nan")
def update(self, value):
if value is None:
return
if self.__min_value is None:
self.__min_value = value
else:
self.__min_value = min(self.__min_value, value)
if self.__max_value is None:
self.__max_value = value
else:
self.__max_value = max(self.__max_value, value)
|
'''
@author: Tsuyoshi Hombashi
'''
class MinMaxContainer(object):
@property
def min_value(self):
return self.__min_value
@property
def max_value(self):
return self.__max_value
def __init__(self, value_list=[]):
self.__min_value = None
self.__max_value = None
for value in value_list:
self.update(value)
+
+ def __eq__(self, other):
+ return all([
+ self.min_value == other.min_value,
+ self.max_value == other.max_value,
+ ])
+
+ def __ne__(self, other):
+ return any([
+ self.min_value != other.min_value,
+ self.max_value != other.max_value,
+ ])
+
+ def __contains__(self, x):
+ return self.min_value <= x <= self.max_value
def diff(self):
try:
return self.max_value - self.min_value
except TypeError:
return float("nan")
def mean(self):
try:
return (self.max_value + self.min_value) * 0.5
except TypeError:
return float("nan")
def update(self, value):
if value is None:
return
if self.__min_value is None:
self.__min_value = value
else:
self.__min_value = min(self.__min_value, value)
if self.__max_value is None:
self.__max_value = value
else:
self.__max_value = max(self.__max_value, value) | 15 | 0.3125 | 15 | 0 |
59935c54b9b00dd15f47044517d13dabc78f0019 | .github/workflows/mac_os.yml | .github/workflows/mac_os.yml |
name: ci-mac-os
# We want to run CI on all pull requests. Additionally, Bors needs workflows to
# run on the `staging` and `trying` branches.
on:
pull_request:
push:
branches:
- staging
- trying
jobs:
ci-mac-os:
runs-on: macos-10.15
steps:
# Clones a single commit from the libtock-rs repository. The commit cloned
# is a merge commit between the PR's target branch and the PR's source.
# Note that we checkout submodules so that we can invoke Tock's CI setup
# scripts, but we do not recursively checkout submodules as we need Tock's
# makefile to set up the qemu submodule itself.
- name: Clone repository
uses: actions/checkout@v2.3.0
with:
submodules: true
# Install the toolchains we need, the run the Makefile's test action. We
# let the makefile do most of the work because the makefile can be tested
# locally. Using -j2 because the Actions VMs have 2 cores.
- name: Build and Test
run: |
brew tap riscv/riscv
brew update
brew install riscv-gnu-toolchain --with-multilib
cd "${GITHUB_WORKSPACE}"
make -j2 setup
make -j2 test
|
name: ci-mac-os
# We want to run CI on all pull requests. Additionally, Bors needs workflows to
# run on the `staging` and `trying` branches.
on:
pull_request:
push:
branches:
- staging
- trying
jobs:
ci-mac-os:
runs-on: macos-10.15
steps:
# Clones a single commit from the libtock-rs repository. The commit cloned
# is a merge commit between the PR's target branch and the PR's source.
# Note that we checkout submodules so that we can invoke Tock's CI setup
# scripts, but we do not recursively checkout submodules as we need Tock's
# makefile to set up the qemu submodule itself.
- name: Clone repository
uses: actions/checkout@v2.3.0
with:
submodules: true
# Install the toolchains we need, the run the Makefile's test action. We
# let the makefile do most of the work because the makefile can be tested
# locally. Using -j2 because the Actions VMs have 2 cores.
- name: Build and Test
run: |
brew tap riscv/riscv
brew update
brew install riscv-gnu-toolchain --with-multilib
cd "${GITHUB_WORKSPACE}"
LIBTOCK_PLATFORM=hifive1 cargo build -p libtock_runtime \
--target=riscv32imac-unknown-none-elf
| Trim down the Mac OS CI to just a `cargo build` on libtock_runtime. | Trim down the Mac OS CI to just a `cargo build` on libtock_runtime.
The Mac runner took over 1 hour 15 minutes to build QEMU (and it didn't even succeed), so I don't think running `make setup` on Mac OS is reasonable. Shrink its test to `cargo build -p libtock_runtime`, which should be relatively simple and test the most critical items.
In the future, we'll probably want to point it at a more substantial crate, but libtock_runtime is our best option for now.
| YAML | apache-2.0 | tock/libtock-rs | yaml | ## Code Before:
name: ci-mac-os
# We want to run CI on all pull requests. Additionally, Bors needs workflows to
# run on the `staging` and `trying` branches.
on:
pull_request:
push:
branches:
- staging
- trying
jobs:
ci-mac-os:
runs-on: macos-10.15
steps:
# Clones a single commit from the libtock-rs repository. The commit cloned
# is a merge commit between the PR's target branch and the PR's source.
# Note that we checkout submodules so that we can invoke Tock's CI setup
# scripts, but we do not recursively checkout submodules as we need Tock's
# makefile to set up the qemu submodule itself.
- name: Clone repository
uses: actions/checkout@v2.3.0
with:
submodules: true
# Install the toolchains we need, the run the Makefile's test action. We
# let the makefile do most of the work because the makefile can be tested
# locally. Using -j2 because the Actions VMs have 2 cores.
- name: Build and Test
run: |
brew tap riscv/riscv
brew update
brew install riscv-gnu-toolchain --with-multilib
cd "${GITHUB_WORKSPACE}"
make -j2 setup
make -j2 test
## Instruction:
Trim down the Mac OS CI to just a `cargo build` on libtock_runtime.
The Mac runner took over 1 hour 15 minutes to build QEMU (and it didn't even succeed), so I don't think running `make setup` on Mac OS is reasonable. Shrink its test to `cargo build -p libtock_runtime`, which should be relatively simple and test the most critical items.
In the future, we'll probably want to point it at a more substantial crate, but libtock_runtime is our best option for now.
## Code After:
name: ci-mac-os
# We want to run CI on all pull requests. Additionally, Bors needs workflows to
# run on the `staging` and `trying` branches.
on:
pull_request:
push:
branches:
- staging
- trying
jobs:
ci-mac-os:
runs-on: macos-10.15
steps:
# Clones a single commit from the libtock-rs repository. The commit cloned
# is a merge commit between the PR's target branch and the PR's source.
# Note that we checkout submodules so that we can invoke Tock's CI setup
# scripts, but we do not recursively checkout submodules as we need Tock's
# makefile to set up the qemu submodule itself.
- name: Clone repository
uses: actions/checkout@v2.3.0
with:
submodules: true
# Install the toolchains we need, the run the Makefile's test action. We
# let the makefile do most of the work because the makefile can be tested
# locally. Using -j2 because the Actions VMs have 2 cores.
- name: Build and Test
run: |
brew tap riscv/riscv
brew update
brew install riscv-gnu-toolchain --with-multilib
cd "${GITHUB_WORKSPACE}"
LIBTOCK_PLATFORM=hifive1 cargo build -p libtock_runtime \
--target=riscv32imac-unknown-none-elf
|
name: ci-mac-os
# We want to run CI on all pull requests. Additionally, Bors needs workflows to
# run on the `staging` and `trying` branches.
on:
pull_request:
push:
branches:
- staging
- trying
jobs:
ci-mac-os:
runs-on: macos-10.15
steps:
# Clones a single commit from the libtock-rs repository. The commit cloned
# is a merge commit between the PR's target branch and the PR's source.
# Note that we checkout submodules so that we can invoke Tock's CI setup
# scripts, but we do not recursively checkout submodules as we need Tock's
# makefile to set up the qemu submodule itself.
- name: Clone repository
uses: actions/checkout@v2.3.0
with:
submodules: true
# Install the toolchains we need, the run the Makefile's test action. We
# let the makefile do most of the work because the makefile can be tested
# locally. Using -j2 because the Actions VMs have 2 cores.
- name: Build and Test
run: |
brew tap riscv/riscv
brew update
brew install riscv-gnu-toolchain --with-multilib
cd "${GITHUB_WORKSPACE}"
- make -j2 setup
- make -j2 test
+ LIBTOCK_PLATFORM=hifive1 cargo build -p libtock_runtime \
+ --target=riscv32imac-unknown-none-elf | 4 | 0.105263 | 2 | 2 |
3184cc30ddca764973e772aaffed7429865fbef9 | src/index.js | src/index.js | const http = require('http');
const jsdom = require('jsdom');
const jQuery = require('jquery');
const Router = require('./router/index');
const body = require('./body/index');
/**
* The jQuerate Class
*
* Patches the emitter and listen handler
* to allow max jQuery gainz
*/
class Yttrium {
constructor(options) {
this.dom = new jsdom.JSDOM('<!DOCTYPE html>');
this.$ = jQuery(this.dom.window);
const r = new Router(options);
const router = r.router;
this.server = ((httpServer, jQueryInstance) => {
const ser = httpServer;
const jq = jQueryInstance;
const oldEmit = ser.emit;
ser.emit = function emit(type, ...data) {
jq(ser).trigger(type, data);
oldEmit.apply(ser, [type, ...data]);
};
jq.listen = (s, ...args) => s.listen(...args);
return ser;
})(http.createServer(), this.$);
this.$.route = r.$;
this.$.body = body;
this.router = router;
}
}
module.exports = options => new Yttrium(options);
| const http = require('http');
const jsdom = require('jsdom');
const jQuery = require('jquery');
const Router = require('./router/index');
const body = require('./body/index');
/**
* The jQuerate Class
*
* Patches the emitter and listen handler
* to allow max jQuery gainz
*/
class Yttrium {
constructor(options) {
this.dom = new jsdom.JSDOM('<!DOCTYPE html>');
this.$ = jQuery(this.dom.window);
this.$ = this.$.bind(this);
const r = new Router(options);
const router = r.router;
this.server = http.createServer();
const oldEmit = this.server.emit;
const emit = (type, ...data) => {
this.$(this.server).trigger(type, data);
oldEmit.apply(this.server, [type, ...data]);
};
this.server.emit = emit.bind(this);
this.$.listen = (s, ...args) => s.listen(...args);
this.$.route = r.$;
this.$.body = body;
this.router = router;
}
}
module.exports = options => new Yttrium(options);
| Remove unnecessary IIFE from Y class | Remove unnecessary IIFE from Y class
| JavaScript | mit | YttriumJS/yttrium-server | javascript | ## Code Before:
const http = require('http');
const jsdom = require('jsdom');
const jQuery = require('jquery');
const Router = require('./router/index');
const body = require('./body/index');
/**
* The jQuerate Class
*
* Patches the emitter and listen handler
* to allow max jQuery gainz
*/
class Yttrium {
constructor(options) {
this.dom = new jsdom.JSDOM('<!DOCTYPE html>');
this.$ = jQuery(this.dom.window);
const r = new Router(options);
const router = r.router;
this.server = ((httpServer, jQueryInstance) => {
const ser = httpServer;
const jq = jQueryInstance;
const oldEmit = ser.emit;
ser.emit = function emit(type, ...data) {
jq(ser).trigger(type, data);
oldEmit.apply(ser, [type, ...data]);
};
jq.listen = (s, ...args) => s.listen(...args);
return ser;
})(http.createServer(), this.$);
this.$.route = r.$;
this.$.body = body;
this.router = router;
}
}
module.exports = options => new Yttrium(options);
## Instruction:
Remove unnecessary IIFE from Y class
## Code After:
const http = require('http');
const jsdom = require('jsdom');
const jQuery = require('jquery');
const Router = require('./router/index');
const body = require('./body/index');
/**
* The jQuerate Class
*
* Patches the emitter and listen handler
* to allow max jQuery gainz
*/
class Yttrium {
constructor(options) {
this.dom = new jsdom.JSDOM('<!DOCTYPE html>');
this.$ = jQuery(this.dom.window);
this.$ = this.$.bind(this);
const r = new Router(options);
const router = r.router;
this.server = http.createServer();
const oldEmit = this.server.emit;
const emit = (type, ...data) => {
this.$(this.server).trigger(type, data);
oldEmit.apply(this.server, [type, ...data]);
};
this.server.emit = emit.bind(this);
this.$.listen = (s, ...args) => s.listen(...args);
this.$.route = r.$;
this.$.body = body;
this.router = router;
}
}
module.exports = options => new Yttrium(options);
| const http = require('http');
const jsdom = require('jsdom');
const jQuery = require('jquery');
const Router = require('./router/index');
const body = require('./body/index');
/**
* The jQuerate Class
*
* Patches the emitter and listen handler
* to allow max jQuery gainz
*/
class Yttrium {
constructor(options) {
this.dom = new jsdom.JSDOM('<!DOCTYPE html>');
this.$ = jQuery(this.dom.window);
+ this.$ = this.$.bind(this);
const r = new Router(options);
const router = r.router;
+ this.server = http.createServer();
- this.server = ((httpServer, jQueryInstance) => {
- const ser = httpServer;
- const jq = jQueryInstance;
- const oldEmit = ser.emit;
? --
+ const oldEmit = this.server.emit;
? +++ +++++
- ser.emit = function emit(type, ...data) {
+ const emit = (type, ...data) => {
- jq(ser).trigger(type, data);
? ^^^^
+ this.$(this.server).trigger(type, data);
? ^^^^^^ +++ +++++
- oldEmit.apply(ser, [type, ...data]);
? --
+ oldEmit.apply(this.server, [type, ...data]);
? +++ +++++
- };
? --
+ };
- jq.listen = (s, ...args) => s.listen(...args);
+ this.server.emit = emit.bind(this);
+ this.$.listen = (s, ...args) => s.listen(...args);
- return ser;
- })(http.createServer(), this.$);
-
this.$.route = r.$;
this.$.body = body;
this.router = router;
}
}
module.exports = options => new Yttrium(options); | 21 | 0.488372 | 9 | 12 |
53309e588ae23a85ad1839d2a5412c9381e6f80a | README.md | README.md | [liburi](https://github.com/nevali/liburi) is a simple interface for parsing
URIs. Under the hood, the actual URI parsing is handled by
[uriparser](http://uriparser.sourceforge.net/) -- liburi aims to provide
an API which is easier to work with than uriparser's.
liburi provides:
* The ability to parse [IRIs](http://tools.ietf.org/html/rfc3987)
* Accessor methods for each parsed URI component and information about the URIs
liburi is licensed under the Apache License 2.0, while uriparser is licensed
under the [New BSD license](http://uriparser.git.sourceforge.net/git/gitweb.cgi?p=uriparser/uriparser;a=blob;f=COPYING).
| [liburi](https://github.com/nevali/liburi) is a simple interface for parsing
URIs. Under the hood, the actual URI parsing is handled by
[uriparser](http://uriparser.sourceforge.net/) -- liburi aims to provide
an API which is easier to work with than uriparser's.
liburi provides:
* The ability to parse [IRIs](http://tools.ietf.org/html/rfc3987)
* Accessor methods for each parsed URI component and information about the URIs
liburi is licensed under the Apache License 2.0, while uriparser is licensed
under the [New BSD license](http://uriparser.git.sourceforge.net/git/gitweb.cgi?p=uriparser/uriparser;a=blob;f=COPYING).
### Building from git
You will need git, automake, autoconf and libtool. You'll also need a
DocBook 5 and DocBook-XSL toolchain (i.e., xsltproc and the stylesheets)
if you wish to rebuild the documentation. Both liburi and uriparser have
minimal external dependencies.
$ git clone git://github.com/nevali/liburi.git
$ cd liburi
$ git submodule update --init --recursive
$ autoreconf -i
$ ./configure --prefix=/some/path
$ make
$ sudo make install
| Add "building from git" section | Add "building from git" section
| Markdown | apache-2.0 | nevali/liburi,dxq-git/liburi,bbcarchdev/liburi,dxq-git/liburi | markdown | ## Code Before:
[liburi](https://github.com/nevali/liburi) is a simple interface for parsing
URIs. Under the hood, the actual URI parsing is handled by
[uriparser](http://uriparser.sourceforge.net/) -- liburi aims to provide
an API which is easier to work with than uriparser's.
liburi provides:
* The ability to parse [IRIs](http://tools.ietf.org/html/rfc3987)
* Accessor methods for each parsed URI component and information about the URIs
liburi is licensed under the Apache License 2.0, while uriparser is licensed
under the [New BSD license](http://uriparser.git.sourceforge.net/git/gitweb.cgi?p=uriparser/uriparser;a=blob;f=COPYING).
## Instruction:
Add "building from git" section
## Code After:
[liburi](https://github.com/nevali/liburi) is a simple interface for parsing
URIs. Under the hood, the actual URI parsing is handled by
[uriparser](http://uriparser.sourceforge.net/) -- liburi aims to provide
an API which is easier to work with than uriparser's.
liburi provides:
* The ability to parse [IRIs](http://tools.ietf.org/html/rfc3987)
* Accessor methods for each parsed URI component and information about the URIs
liburi is licensed under the Apache License 2.0, while uriparser is licensed
under the [New BSD license](http://uriparser.git.sourceforge.net/git/gitweb.cgi?p=uriparser/uriparser;a=blob;f=COPYING).
### Building from git
You will need git, automake, autoconf and libtool. You'll also need a
DocBook 5 and DocBook-XSL toolchain (i.e., xsltproc and the stylesheets)
if you wish to rebuild the documentation. Both liburi and uriparser have
minimal external dependencies.
$ git clone git://github.com/nevali/liburi.git
$ cd liburi
$ git submodule update --init --recursive
$ autoreconf -i
$ ./configure --prefix=/some/path
$ make
$ sudo make install
| [liburi](https://github.com/nevali/liburi) is a simple interface for parsing
URIs. Under the hood, the actual URI parsing is handled by
[uriparser](http://uriparser.sourceforge.net/) -- liburi aims to provide
an API which is easier to work with than uriparser's.
liburi provides:
* The ability to parse [IRIs](http://tools.ietf.org/html/rfc3987)
* Accessor methods for each parsed URI component and information about the URIs
liburi is licensed under the Apache License 2.0, while uriparser is licensed
under the [New BSD license](http://uriparser.git.sourceforge.net/git/gitweb.cgi?p=uriparser/uriparser;a=blob;f=COPYING).
+ ### Building from git
+
+ You will need git, automake, autoconf and libtool. You'll also need a
+ DocBook 5 and DocBook-XSL toolchain (i.e., xsltproc and the stylesheets)
+ if you wish to rebuild the documentation. Both liburi and uriparser have
+ minimal external dependencies.
+
+ $ git clone git://github.com/nevali/liburi.git
+ $ cd liburi
+ $ git submodule update --init --recursive
+ $ autoreconf -i
+ $ ./configure --prefix=/some/path
+ $ make
+ $ sudo make install | 14 | 1.076923 | 14 | 0 |
676d1f0571f7df6fd587651c5367e6968bf08e09 | utils/db.js | utils/db.js | import mongoose from 'mongoose'
import grid from 'gridfs-stream'
import { log } from './'
const dbHost = process.env.DB_HOST || 'localhost'
const dbName = process.env.DB_NAME || 'muffin'
// Connect to DB using the credentials set in the ".env" file
mongoose.connect('mongodb://' + dbHost + '/' + dbName, {
user: process.env.DB_USER,
pass: process.env.DB_PASSWORD
})
const connection = mongoose.connection
connection.on('error', function (info) {
if (info.message.includes('ECONNREFUSED')) {
info.message = 'Please make sure it\'s running and accessible!'
}
log('Couldn\'t connect to DB: ' + info.message)
process.exit(1)
})
process.on('SIGINT', () => connection.close(() => {
process.exit(0)
}))
export { connection as rope }
export { mongoose as goose }
// Tell gridfs where to find the files
grid.mongo = mongoose.mongo
const gridConnection = grid(connection.db)
export { gridConnection as fs }
| import mongoose from 'mongoose'
import grid from 'gridfs-stream'
import { log } from './'
const dbHost = process.env.DB_HOST || 'localhost'
const dbName = process.env.DB_NAME || 'muffin'
// Connect to DB using the credentials set in the ".env" file
mongoose.connect('mongodb://' + dbHost + '/' + dbName, {
user: process.env.DB_USER,
pass: process.env.DB_PASSWORD
})
mongoose.Promise = require('es6-promise').Promise;
const connection = mongoose.connection
connection.on('error', function (info) {
if (info.message.includes('ECONNREFUSED')) {
info.message = 'Please make sure it\'s running and accessible!'
}
log('Couldn\'t connect to DB: ' + info.message)
process.exit(1)
})
process.on('SIGINT', () => connection.close(() => {
process.exit(0)
}))
export { connection as rope }
export { mongoose as goose }
// Tell gridfs where to find the files
grid.mongo = mongoose.mongo
const gridConnection = grid(connection.db)
export { gridConnection as fs }
| Fix - Mongoose Promise Deprecation warning | Fix - Mongoose Promise Deprecation warning
| JavaScript | mit | kunni80/server | javascript | ## Code Before:
import mongoose from 'mongoose'
import grid from 'gridfs-stream'
import { log } from './'
const dbHost = process.env.DB_HOST || 'localhost'
const dbName = process.env.DB_NAME || 'muffin'
// Connect to DB using the credentials set in the ".env" file
mongoose.connect('mongodb://' + dbHost + '/' + dbName, {
user: process.env.DB_USER,
pass: process.env.DB_PASSWORD
})
const connection = mongoose.connection
connection.on('error', function (info) {
if (info.message.includes('ECONNREFUSED')) {
info.message = 'Please make sure it\'s running and accessible!'
}
log('Couldn\'t connect to DB: ' + info.message)
process.exit(1)
})
process.on('SIGINT', () => connection.close(() => {
process.exit(0)
}))
export { connection as rope }
export { mongoose as goose }
// Tell gridfs where to find the files
grid.mongo = mongoose.mongo
const gridConnection = grid(connection.db)
export { gridConnection as fs }
## Instruction:
Fix - Mongoose Promise Deprecation warning
## Code After:
import mongoose from 'mongoose'
import grid from 'gridfs-stream'
import { log } from './'
const dbHost = process.env.DB_HOST || 'localhost'
const dbName = process.env.DB_NAME || 'muffin'
// Connect to DB using the credentials set in the ".env" file
mongoose.connect('mongodb://' + dbHost + '/' + dbName, {
user: process.env.DB_USER,
pass: process.env.DB_PASSWORD
})
mongoose.Promise = require('es6-promise').Promise;
const connection = mongoose.connection
connection.on('error', function (info) {
if (info.message.includes('ECONNREFUSED')) {
info.message = 'Please make sure it\'s running and accessible!'
}
log('Couldn\'t connect to DB: ' + info.message)
process.exit(1)
})
process.on('SIGINT', () => connection.close(() => {
process.exit(0)
}))
export { connection as rope }
export { mongoose as goose }
// Tell gridfs where to find the files
grid.mongo = mongoose.mongo
const gridConnection = grid(connection.db)
export { gridConnection as fs }
| import mongoose from 'mongoose'
import grid from 'gridfs-stream'
import { log } from './'
const dbHost = process.env.DB_HOST || 'localhost'
const dbName = process.env.DB_NAME || 'muffin'
// Connect to DB using the credentials set in the ".env" file
mongoose.connect('mongodb://' + dbHost + '/' + dbName, {
user: process.env.DB_USER,
pass: process.env.DB_PASSWORD
})
+
+ mongoose.Promise = require('es6-promise').Promise;
const connection = mongoose.connection
connection.on('error', function (info) {
if (info.message.includes('ECONNREFUSED')) {
info.message = 'Please make sure it\'s running and accessible!'
}
log('Couldn\'t connect to DB: ' + info.message)
process.exit(1)
})
process.on('SIGINT', () => connection.close(() => {
process.exit(0)
}))
export { connection as rope }
export { mongoose as goose }
// Tell gridfs where to find the files
grid.mongo = mongoose.mongo
const gridConnection = grid(connection.db)
export { gridConnection as fs } | 2 | 0.055556 | 2 | 0 |
53324d7433b663423ce3672b0c4808e17a174919 | tasks/addBanner.js | tasks/addBanner.js | let banner = require('add-banner');
let fs = require('fs');
let path = require('path');
const buildFolder = './build/';
function appendBanner(directory) {
let files = fs.readdirSync(directory);
for (let i = 0; i < files.length; ++i) {
let stat = fs.statSync(directory + files[i]);
if (stat.isDirectory()) {
let subDirectory = directory + files[i] + '/';
appendBanner(subDirectory);
} else if (path.extname(files[i]) === '.js') {
let options = {
banner: './tasks/banner.tmpl',
filename: files[i]
};
let newFile = banner(directory + files[i], options);
fs.writeFileSync(directory + files[i], newFile);
console.log('\t' + files[i]);
} else {
console.log('\tIgnoring ' + files[i]);
}
}
}
let files = fs.readdirSync(buildFolder);
console.log('Adding banners to files: ');
appendBanner(buildFolder, files);
| let banner = require('add-banner');
let fs = require('fs');
let path = require('path');
const buildFolder = './build/';
function appendBanner(directory) {
let files = fs.readdirSync(directory);
for (let i = 0; i < files.length; ++i) {
let stat = fs.statSync(directory + files[i]);
if (stat.isDirectory()) {
const subDirectory = directory + files[i] + '/';
appendBanner(subDirectory);
} else if (path.extname(files[i]) === '.js') {
const options = {
template: './tasks/banner.tmpl',
filename: files[i]
};
const newFile = banner(directory + files[i], options);
fs.writeFileSync(directory + files[i], newFile);
console.log('\t' + files[i]);
} else {
console.log('\tIgnoring ' + files[i]);
}
}
}
let files = fs.readdirSync(buildFolder);
console.log('Adding banners to files: ');
appendBanner(buildFolder, files);
| Update options key to match updated package | fix: Update options key to match updated package
| JavaScript | mit | fosenutvikling/fuhttp-ts,fosenutvikling/fuhttp-ts | javascript | ## Code Before:
let banner = require('add-banner');
let fs = require('fs');
let path = require('path');
const buildFolder = './build/';
function appendBanner(directory) {
let files = fs.readdirSync(directory);
for (let i = 0; i < files.length; ++i) {
let stat = fs.statSync(directory + files[i]);
if (stat.isDirectory()) {
let subDirectory = directory + files[i] + '/';
appendBanner(subDirectory);
} else if (path.extname(files[i]) === '.js') {
let options = {
banner: './tasks/banner.tmpl',
filename: files[i]
};
let newFile = banner(directory + files[i], options);
fs.writeFileSync(directory + files[i], newFile);
console.log('\t' + files[i]);
} else {
console.log('\tIgnoring ' + files[i]);
}
}
}
let files = fs.readdirSync(buildFolder);
console.log('Adding banners to files: ');
appendBanner(buildFolder, files);
## Instruction:
fix: Update options key to match updated package
## Code After:
let banner = require('add-banner');
let fs = require('fs');
let path = require('path');
const buildFolder = './build/';
function appendBanner(directory) {
let files = fs.readdirSync(directory);
for (let i = 0; i < files.length; ++i) {
let stat = fs.statSync(directory + files[i]);
if (stat.isDirectory()) {
const subDirectory = directory + files[i] + '/';
appendBanner(subDirectory);
} else if (path.extname(files[i]) === '.js') {
const options = {
template: './tasks/banner.tmpl',
filename: files[i]
};
const newFile = banner(directory + files[i], options);
fs.writeFileSync(directory + files[i], newFile);
console.log('\t' + files[i]);
} else {
console.log('\tIgnoring ' + files[i]);
}
}
}
let files = fs.readdirSync(buildFolder);
console.log('Adding banners to files: ');
appendBanner(buildFolder, files);
| let banner = require('add-banner');
let fs = require('fs');
let path = require('path');
const buildFolder = './build/';
function appendBanner(directory) {
let files = fs.readdirSync(directory);
for (let i = 0; i < files.length; ++i) {
let stat = fs.statSync(directory + files[i]);
if (stat.isDirectory()) {
- let subDirectory = directory + files[i] + '/';
? ^^
+ const subDirectory = directory + files[i] + '/';
? ^^^^
appendBanner(subDirectory);
} else if (path.extname(files[i]) === '.js') {
- let options = {
? ^^
+ const options = {
? ^^^^
- banner: './tasks/banner.tmpl',
? ^ ^^ -
+ template: './tasks/banner.tmpl',
? ^^^^^ ^
filename: files[i]
};
- let newFile = banner(directory + files[i], options);
? ^^
+ const newFile = banner(directory + files[i], options);
? ^^^^
fs.writeFileSync(directory + files[i], newFile);
console.log('\t' + files[i]);
} else {
console.log('\tIgnoring ' + files[i]);
}
}
}
let files = fs.readdirSync(buildFolder);
console.log('Adding banners to files: ');
appendBanner(buildFolder, files); | 8 | 0.242424 | 4 | 4 |
a45d5b16fe896c216622f429e0af95eb141f485b | web/src/main/ember/app/serializers/application.js | web/src/main/ember/app/serializers/application.js | import Ember from 'ember';
import DS from 'ember-data';
// Adapted from http://springember.blogspot.com.au/2014/08/using-ember-data-restadapter-with.html
export default DS.RESTSerializer.extend({
serializeIntoHash: function(hash, type, record, options) {
var serialized = this.serialize(record, options);
//Remove id from the payload for new records
//Jackson was complaining when it received a null or 'new' id ...
if (record.get('id') == null || record.get('isNew')) {
delete serialized.id;
}
//Remove null values
Object.keys(serialized).forEach(function(k) {
if (!serialized[k]) {
delete serialized[k];
}
});
//Remove the root element
Ember.merge(hash, serialized);
},
extractMeta: function (store, type, payload) {
// Read the meta information about objects that should be
// reloaded - purge them from the store to force reload
if (payload && payload.meta && payload.meta.purge) {
payload.meta.purge.forEach(function (p) {
var entity = store.getById(p.type, p.id);
if (!Ember.isNone(entity)) {
Ember.run.next(entity, "reload");
}
});
}
return this._super(store, type, payload);
}
});
| import Ember from 'ember';
import DS from 'ember-data';
// Adapted from http://springember.blogspot.com.au/2014/08/using-ember-data-restadapter-with.html
export default DS.RESTSerializer.extend({
serializeIntoHash: function(hash, type, record, options) {
var serialized = this.serialize(record, options);
//Remove id from the payload for new records
//Jackson was complaining when it received a null or 'new' id ...
if (record.get('id') == null || record.get('isNew')) {
delete serialized.id;
}
//Remove null values
Object.keys(serialized).forEach(function(k) {
if (serialized[k] === null) {
delete serialized[k];
}
});
//Remove the root element
Ember.merge(hash, serialized);
},
extractMeta: function (store, type, payload) {
// Read the meta information about objects that should be
// reloaded - purge them from the store to force reload
if (payload && payload.meta && payload.meta.purge) {
payload.meta.purge.forEach(function (p) {
var entity = store.getById(p.type, p.id);
if (!Ember.isNone(entity)) {
Ember.run.next(entity, "reload");
}
});
}
return this._super(store, type, payload);
}
});
| Fix serializer to keep 'false' values | Fix serializer to keep 'false' values
| JavaScript | agpl-3.0 | MarSik/shelves,MarSik/shelves,MarSik/shelves,MarSik/shelves | javascript | ## Code Before:
import Ember from 'ember';
import DS from 'ember-data';
// Adapted from http://springember.blogspot.com.au/2014/08/using-ember-data-restadapter-with.html
export default DS.RESTSerializer.extend({
serializeIntoHash: function(hash, type, record, options) {
var serialized = this.serialize(record, options);
//Remove id from the payload for new records
//Jackson was complaining when it received a null or 'new' id ...
if (record.get('id') == null || record.get('isNew')) {
delete serialized.id;
}
//Remove null values
Object.keys(serialized).forEach(function(k) {
if (!serialized[k]) {
delete serialized[k];
}
});
//Remove the root element
Ember.merge(hash, serialized);
},
extractMeta: function (store, type, payload) {
// Read the meta information about objects that should be
// reloaded - purge them from the store to force reload
if (payload && payload.meta && payload.meta.purge) {
payload.meta.purge.forEach(function (p) {
var entity = store.getById(p.type, p.id);
if (!Ember.isNone(entity)) {
Ember.run.next(entity, "reload");
}
});
}
return this._super(store, type, payload);
}
});
## Instruction:
Fix serializer to keep 'false' values
## Code After:
import Ember from 'ember';
import DS from 'ember-data';
// Adapted from http://springember.blogspot.com.au/2014/08/using-ember-data-restadapter-with.html
export default DS.RESTSerializer.extend({
serializeIntoHash: function(hash, type, record, options) {
var serialized = this.serialize(record, options);
//Remove id from the payload for new records
//Jackson was complaining when it received a null or 'new' id ...
if (record.get('id') == null || record.get('isNew')) {
delete serialized.id;
}
//Remove null values
Object.keys(serialized).forEach(function(k) {
if (serialized[k] === null) {
delete serialized[k];
}
});
//Remove the root element
Ember.merge(hash, serialized);
},
extractMeta: function (store, type, payload) {
// Read the meta information about objects that should be
// reloaded - purge them from the store to force reload
if (payload && payload.meta && payload.meta.purge) {
payload.meta.purge.forEach(function (p) {
var entity = store.getById(p.type, p.id);
if (!Ember.isNone(entity)) {
Ember.run.next(entity, "reload");
}
});
}
return this._super(store, type, payload);
}
});
| import Ember from 'ember';
import DS from 'ember-data';
// Adapted from http://springember.blogspot.com.au/2014/08/using-ember-data-restadapter-with.html
export default DS.RESTSerializer.extend({
serializeIntoHash: function(hash, type, record, options) {
var serialized = this.serialize(record, options);
//Remove id from the payload for new records
//Jackson was complaining when it received a null or 'new' id ...
if (record.get('id') == null || record.get('isNew')) {
delete serialized.id;
}
//Remove null values
Object.keys(serialized).forEach(function(k) {
- if (!serialized[k]) {
? -
+ if (serialized[k] === null) {
? +++++++++
delete serialized[k];
}
});
//Remove the root element
Ember.merge(hash, serialized);
},
extractMeta: function (store, type, payload) {
// Read the meta information about objects that should be
// reloaded - purge them from the store to force reload
if (payload && payload.meta && payload.meta.purge) {
payload.meta.purge.forEach(function (p) {
var entity = store.getById(p.type, p.id);
if (!Ember.isNone(entity)) {
Ember.run.next(entity, "reload");
}
});
}
return this._super(store, type, payload);
}
}); | 2 | 0.051282 | 1 | 1 |
2d57b170bc65d64bc3e18779b826d08578162509 | app/controllers/service_types_controller.rb | app/controllers/service_types_controller.rb | class ServiceTypesController < ApplicationController
# Used to supply valid service type names to the service upload page.
# Authentication by default inherited from ApplicationController.
before_action :authorize_for_districtwide_access_admin, only: [:is_service_working]
def authorize_for_districtwide_access_admin
unless current_educator.admin? && current_educator.districtwide_access?
render json: { error: "You don't have the correct authorization." }
end
end
def index
render json: ServiceType.pluck(:name).sort
end
def is_service_working_json
service_type_id = params[:service_type_id]
service_type = ServiceType.find(service_type_id)
student_ids = service_type.services.where('date_started > ?', Time.current - 1.year).map(&:student_id)
chart_data = Student.active.where(id: student_ids).map do |student|
{
student: student,
school: student.school.local_id,
services: student.services.where(service_type_id: service_type_id),
absences: student.absences.order(occurred_at: :desc)
}
end
render json: { chart_data: chart_data }
end
def is_service_working
render 'shared/serialized_data'
end
end
| class ServiceTypesController < ApplicationController
# Used to supply valid service type names to the service upload page.
# Authentication by default inherited from ApplicationController.
before_action :authorize_for_districtwide_access_admin, except: [:index]
def authorize_for_districtwide_access_admin
unless current_educator.admin? && current_educator.districtwide_access?
render json: { error: "You don't have the correct authorization." }
end
end
def index
render json: ServiceType.pluck(:name).sort
end
def is_service_working_json
service_type_id = params[:service_type_id]
service_type = ServiceType.find(service_type_id)
student_ids = service_type.services.where('date_started > ?', Time.current - 1.year).map(&:student_id)
chart_data = Student.active.where(id: student_ids).map do |student|
{
student: student,
school: student.school.local_id,
services: student.services.where(service_type_id: service_type_id),
absences: student.absences.order(occurred_at: :desc)
}
end
render json: { chart_data: chart_data }
end
def is_service_working
render 'shared/serialized_data'
end
end
| Make sure JSON endpoint auth is restricted to districtwide access users only | Make sure JSON endpoint auth is restricted to districtwide access users only
| Ruby | mit | studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights,studentinsights/studentinsights | ruby | ## Code Before:
class ServiceTypesController < ApplicationController
# Used to supply valid service type names to the service upload page.
# Authentication by default inherited from ApplicationController.
before_action :authorize_for_districtwide_access_admin, only: [:is_service_working]
def authorize_for_districtwide_access_admin
unless current_educator.admin? && current_educator.districtwide_access?
render json: { error: "You don't have the correct authorization." }
end
end
def index
render json: ServiceType.pluck(:name).sort
end
def is_service_working_json
service_type_id = params[:service_type_id]
service_type = ServiceType.find(service_type_id)
student_ids = service_type.services.where('date_started > ?', Time.current - 1.year).map(&:student_id)
chart_data = Student.active.where(id: student_ids).map do |student|
{
student: student,
school: student.school.local_id,
services: student.services.where(service_type_id: service_type_id),
absences: student.absences.order(occurred_at: :desc)
}
end
render json: { chart_data: chart_data }
end
def is_service_working
render 'shared/serialized_data'
end
end
## Instruction:
Make sure JSON endpoint auth is restricted to districtwide access users only
## Code After:
class ServiceTypesController < ApplicationController
# Used to supply valid service type names to the service upload page.
# Authentication by default inherited from ApplicationController.
before_action :authorize_for_districtwide_access_admin, except: [:index]
def authorize_for_districtwide_access_admin
unless current_educator.admin? && current_educator.districtwide_access?
render json: { error: "You don't have the correct authorization." }
end
end
def index
render json: ServiceType.pluck(:name).sort
end
def is_service_working_json
service_type_id = params[:service_type_id]
service_type = ServiceType.find(service_type_id)
student_ids = service_type.services.where('date_started > ?', Time.current - 1.year).map(&:student_id)
chart_data = Student.active.where(id: student_ids).map do |student|
{
student: student,
school: student.school.local_id,
services: student.services.where(service_type_id: service_type_id),
absences: student.absences.order(occurred_at: :desc)
}
end
render json: { chart_data: chart_data }
end
def is_service_working
render 'shared/serialized_data'
end
end
| class ServiceTypesController < ApplicationController
# Used to supply valid service type names to the service upload page.
# Authentication by default inherited from ApplicationController.
- before_action :authorize_for_districtwide_access_admin, only: [:is_service_working]
? ^^^^ ^^^ ^^^^^^^^^^^^^
+ before_action :authorize_for_districtwide_access_admin, except: [:index]
? ^^^^^^ ^^ ^
def authorize_for_districtwide_access_admin
unless current_educator.admin? && current_educator.districtwide_access?
render json: { error: "You don't have the correct authorization." }
end
end
def index
render json: ServiceType.pluck(:name).sort
end
def is_service_working_json
service_type_id = params[:service_type_id]
service_type = ServiceType.find(service_type_id)
student_ids = service_type.services.where('date_started > ?', Time.current - 1.year).map(&:student_id)
chart_data = Student.active.where(id: student_ids).map do |student|
{
student: student,
school: student.school.local_id,
services: student.services.where(service_type_id: service_type_id),
absences: student.absences.order(occurred_at: :desc)
}
end
render json: { chart_data: chart_data }
end
def is_service_working
render 'shared/serialized_data'
end
end | 2 | 0.05 | 1 | 1 |
1d59714c204045aaedd18669d72c1bb8eb04c414 | CHANGES.md | CHANGES.md |
* Update version of angular to 1.2.3
* List dependencies on angular and pouchdb latest explicitly.
# v. 0.1.3
* Add a `pouch-repeat` directive, to traverse all elements in a collection.
* Add support for sorting in `pouch-repeat`.
# v. 0.1.4
* Add support for inserting new elements into exactly the right position, based on your sort order.
* Using ngAnimate to add, remove and move elements.
* Switching to PouchDB 2.0
# v. 0.1.5
* Fixes for PouchDB 2.0
* Upgrade bower dependency to 2.1.0
|
* Fixes for PouchDB 2.0
* Upgrade bower dependency to 2.1.0
# v. 0.1.4
* Add support for inserting new elements into exactly the right position, based on your sort order.
* Using ngAnimate to add, remove and move elements.
* Switching to PouchDB 2.0
# v. 0.1.3
* Add a `pouch-repeat` directive, to traverse all elements in a collection.
* Add support for sorting in `pouch-repeat`.
# v. 0.1.2
* Update version of angular to 1.2.3
* List dependencies on angular and pouchdb latest explicitly.
| Change the order of the version in the change log. Most recent is up now. | Change the order of the version in the change log. Most recent is up now.
| Markdown | mit | trgpwild/angular-pouchdb,wspringer/angular-pouchdb,sajeetharan/angular-pouchdb | markdown | ## Code Before:
* Update version of angular to 1.2.3
* List dependencies on angular and pouchdb latest explicitly.
# v. 0.1.3
* Add a `pouch-repeat` directive, to traverse all elements in a collection.
* Add support for sorting in `pouch-repeat`.
# v. 0.1.4
* Add support for inserting new elements into exactly the right position, based on your sort order.
* Using ngAnimate to add, remove and move elements.
* Switching to PouchDB 2.0
# v. 0.1.5
* Fixes for PouchDB 2.0
* Upgrade bower dependency to 2.1.0
## Instruction:
Change the order of the version in the change log. Most recent is up now.
## Code After:
* Fixes for PouchDB 2.0
* Upgrade bower dependency to 2.1.0
# v. 0.1.4
* Add support for inserting new elements into exactly the right position, based on your sort order.
* Using ngAnimate to add, remove and move elements.
* Switching to PouchDB 2.0
# v. 0.1.3
* Add a `pouch-repeat` directive, to traverse all elements in a collection.
* Add support for sorting in `pouch-repeat`.
# v. 0.1.2
* Update version of angular to 1.2.3
* List dependencies on angular and pouchdb latest explicitly.
|
+ * Fixes for PouchDB 2.0
+ * Upgrade bower dependency to 2.1.0
- * Update version of angular to 1.2.3
- * List dependencies on angular and pouchdb latest explicitly.
-
- # v. 0.1.3
-
- * Add a `pouch-repeat` directive, to traverse all elements in a collection.
- * Add support for sorting in `pouch-repeat`.
# v. 0.1.4
* Add support for inserting new elements into exactly the right position, based on your sort order.
* Using ngAnimate to add, remove and move elements.
* Switching to PouchDB 2.0
- # v. 0.1.5
? ^
+ # v. 0.1.3
? ^
- * Fixes for PouchDB 2.0
- * Upgrade bower dependency to 2.1.0
+ * Add a `pouch-repeat` directive, to traverse all elements in a collection.
+ * Add support for sorting in `pouch-repeat`.
+
+ # v. 0.1.2
+
+ * Update version of angular to 1.2.3
+ * List dependencies on angular and pouchdb latest explicitly.
| 20 | 0.869565 | 10 | 10 |
8983942fc2db3d843374c350b9a44cd7a5928841 | lib/generators/stripe_webhooks/callback_generator.rb | lib/generators/stripe_webhooks/callback_generator.rb | require 'generators/stripe_webhooks'
module StripeWebhooks
module Generators
class CallbackGenerator < Base
desc 'Creates a stripe webhook callback object'
argument :event_types, type: :array, default: [], banner: 'event.type.a event.type.b ...'
source_root File.expand_path('../templates', __FILE__)
def create_callback
application_callback = 'app/callbacks/application_callback.rb'
unless File.exist?(application_callback)
template 'application_callback.rb.erb', application_callback
end
template 'callback.rb.erb', "app/callbacks/#{name.underscore}_callback.rb"
if defined?(RSpec)
template 'callback_spec.rb.erb',
"#{RSpec.configuration.default_path}/callbacks/#{name.underscore}_callback_spec.rb"
end
end
end
end
end
| require 'generators/stripe_webhooks'
module StripeWebhooks
module Generators
class CallbackGenerator < Base
desc 'Creates a stripe webhook callback object'
argument :event_types, type: :array, default: [], banner: 'event.type.a event.type.b ...'
source_root File.expand_path('../templates', __FILE__)
def create_callback
application_callback = 'app/callbacks/application_callback.rb'
unless File.exist?(application_callback)
template 'application_callback.rb.erb', application_callback
end
template 'callback.rb.erb', "app/callbacks/#{name.underscore}_callback.rb"
if defined?(RSpec) && Dir.exist?(Rails.root.join('spec'))
template 'callback_spec.rb.erb',
Rails.root.join('spec', 'callbacks', "#{name.underscore}_callback_spec.rb")
end
end
end
end
end
| Fix issue in generator where RSpec.configuration is nil | Fix issue in generator where RSpec.configuration is nil
| Ruby | mit | westlakedesign/stripe_webhooks,westlakedesign/stripe_webhooks,westlakedesign/stripe_webhooks | ruby | ## Code Before:
require 'generators/stripe_webhooks'
module StripeWebhooks
module Generators
class CallbackGenerator < Base
desc 'Creates a stripe webhook callback object'
argument :event_types, type: :array, default: [], banner: 'event.type.a event.type.b ...'
source_root File.expand_path('../templates', __FILE__)
def create_callback
application_callback = 'app/callbacks/application_callback.rb'
unless File.exist?(application_callback)
template 'application_callback.rb.erb', application_callback
end
template 'callback.rb.erb', "app/callbacks/#{name.underscore}_callback.rb"
if defined?(RSpec)
template 'callback_spec.rb.erb',
"#{RSpec.configuration.default_path}/callbacks/#{name.underscore}_callback_spec.rb"
end
end
end
end
end
## Instruction:
Fix issue in generator where RSpec.configuration is nil
## Code After:
require 'generators/stripe_webhooks'
module StripeWebhooks
module Generators
class CallbackGenerator < Base
desc 'Creates a stripe webhook callback object'
argument :event_types, type: :array, default: [], banner: 'event.type.a event.type.b ...'
source_root File.expand_path('../templates', __FILE__)
def create_callback
application_callback = 'app/callbacks/application_callback.rb'
unless File.exist?(application_callback)
template 'application_callback.rb.erb', application_callback
end
template 'callback.rb.erb', "app/callbacks/#{name.underscore}_callback.rb"
if defined?(RSpec) && Dir.exist?(Rails.root.join('spec'))
template 'callback_spec.rb.erb',
Rails.root.join('spec', 'callbacks', "#{name.underscore}_callback_spec.rb")
end
end
end
end
end
| require 'generators/stripe_webhooks'
module StripeWebhooks
module Generators
class CallbackGenerator < Base
desc 'Creates a stripe webhook callback object'
argument :event_types, type: :array, default: [], banner: 'event.type.a event.type.b ...'
source_root File.expand_path('../templates', __FILE__)
def create_callback
application_callback = 'app/callbacks/application_callback.rb'
unless File.exist?(application_callback)
template 'application_callback.rb.erb', application_callback
end
template 'callback.rb.erb', "app/callbacks/#{name.underscore}_callback.rb"
- if defined?(RSpec)
+ if defined?(RSpec) && Dir.exist?(Rails.root.join('spec'))
template 'callback_spec.rb.erb',
- "#{RSpec.configuration.default_path}/callbacks/#{name.underscore}_callback_spec.rb"
+ Rails.root.join('spec', 'callbacks', "#{name.underscore}_callback_spec.rb")
end
end
end
end
end | 4 | 0.153846 | 2 | 2 |
4991ef381e68ef91d9da1af10d0160d607ff9620 | .travis.yml | .travis.yml | language: objective-c
xcode_project: RNCryptor.xcodeproj
xcode_scheme: RNCryptor
xcode_sdk: iphonesimulator7.0
xcode_sdk: iphonesimulator5.0
matrix:
include:
- xcode_scheme: "RNCryptor OS X"
xcode_sdk: macosx10.9
- xcode_scheme: "RNCryptor OS X"
xcode_sdk: macosx10.8
before_install:
- git submodule update --init --recursive
| language: objective-c
before_install:
- git submodule update --init --recursive
script:
- xctool -project RNCryptor.xcodeproj -scheme RNCryptor -sdk iphonesimulator5.0 build test
- xctool -project RNCryptor.xcodeproj -scheme RNCryptor -sdk iphonesimulator7.0 build test
- xctool -project RNCryptor.xcodeproj -scheme "RNCryptor OS X" -sdk macosx10.9 build
- xctool -project RNCryptor.xcodeproj -scheme "RNCryptor OS X" -sdk macosx10.8 build
| Switch to individual scripts to handle build vs test | Switch to individual scripts to handle build vs test
| YAML | mit | RNCryptor/RNCryptor,RNCryptor/RNCryptor | yaml | ## Code Before:
language: objective-c
xcode_project: RNCryptor.xcodeproj
xcode_scheme: RNCryptor
xcode_sdk: iphonesimulator7.0
xcode_sdk: iphonesimulator5.0
matrix:
include:
- xcode_scheme: "RNCryptor OS X"
xcode_sdk: macosx10.9
- xcode_scheme: "RNCryptor OS X"
xcode_sdk: macosx10.8
before_install:
- git submodule update --init --recursive
## Instruction:
Switch to individual scripts to handle build vs test
## Code After:
language: objective-c
before_install:
- git submodule update --init --recursive
script:
- xctool -project RNCryptor.xcodeproj -scheme RNCryptor -sdk iphonesimulator5.0 build test
- xctool -project RNCryptor.xcodeproj -scheme RNCryptor -sdk iphonesimulator7.0 build test
- xctool -project RNCryptor.xcodeproj -scheme "RNCryptor OS X" -sdk macosx10.9 build
- xctool -project RNCryptor.xcodeproj -scheme "RNCryptor OS X" -sdk macosx10.8 build
| language: objective-c
- xcode_project: RNCryptor.xcodeproj
-
- xcode_scheme: RNCryptor
- xcode_sdk: iphonesimulator7.0
- xcode_sdk: iphonesimulator5.0
-
- matrix:
- include:
- - xcode_scheme: "RNCryptor OS X"
- xcode_sdk: macosx10.9
- - xcode_scheme: "RNCryptor OS X"
- xcode_sdk: macosx10.8
before_install:
- git submodule update --init --recursive
+
+ script:
+ - xctool -project RNCryptor.xcodeproj -scheme RNCryptor -sdk iphonesimulator5.0 build test
+ - xctool -project RNCryptor.xcodeproj -scheme RNCryptor -sdk iphonesimulator7.0 build test
+ - xctool -project RNCryptor.xcodeproj -scheme "RNCryptor OS X" -sdk macosx10.9 build
+ - xctool -project RNCryptor.xcodeproj -scheme "RNCryptor OS X" -sdk macosx10.8 build | 18 | 1.125 | 6 | 12 |
f73618b763c1bdfdacc35193d2f0613b3f956b59 | Command/DumpCommand.php | Command/DumpCommand.php | <?php
namespace Padam87\CronBundle\Command;
use Doctrine\Common\Annotations\AnnotationReader;
use Padam87\CronBundle\Util\Helper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class DumpCommand extends ConfigurationAwareCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
parent::configure();
$this
->setName('cron:dump')
->setDescription('Dumps jobs to a crontab file')
;
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->dump($input);
return 0;
}
protected function dump(InputInterface $input): string
{
$reader = new AnnotationReader();
$helper = new Helper($this->getApplication(), $reader);
$tab = $helper->createTab($input, $this->getConfiguration());
$path = strtolower(
sprintf(
'%s.crontab',
$this->getApplication()->getName()
)
);
file_put_contents($path, (string) $tab);
return $path;
}
}
| <?php
namespace Padam87\CronBundle\Command;
use Doctrine\Common\Annotations\AnnotationReader;
use Padam87\CronBundle\Util\Helper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class DumpCommand extends ConfigurationAwareCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
parent::configure();
$this
->setName('cron:dump')
->setDescription('Dumps jobs to a crontab file')
;
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->dump($input);
return self::SUCCESS;
}
protected function dump(InputInterface $input): string
{
$reader = new AnnotationReader();
$helper = new Helper($this->getApplication(), $reader);
$tab = $helper->createTab($input, $this->getConfiguration());
$path = strtolower(
sprintf(
'%s.crontab',
$this->getApplication()->getName()
)
);
file_put_contents($path, (string) $tab);
return $path;
}
}
| Use the exit code constant | Use the exit code constant | PHP | mit | Padam87/CronBundle | php | ## Code Before:
<?php
namespace Padam87\CronBundle\Command;
use Doctrine\Common\Annotations\AnnotationReader;
use Padam87\CronBundle\Util\Helper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class DumpCommand extends ConfigurationAwareCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
parent::configure();
$this
->setName('cron:dump')
->setDescription('Dumps jobs to a crontab file')
;
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->dump($input);
return 0;
}
protected function dump(InputInterface $input): string
{
$reader = new AnnotationReader();
$helper = new Helper($this->getApplication(), $reader);
$tab = $helper->createTab($input, $this->getConfiguration());
$path = strtolower(
sprintf(
'%s.crontab',
$this->getApplication()->getName()
)
);
file_put_contents($path, (string) $tab);
return $path;
}
}
## Instruction:
Use the exit code constant
## Code After:
<?php
namespace Padam87\CronBundle\Command;
use Doctrine\Common\Annotations\AnnotationReader;
use Padam87\CronBundle\Util\Helper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class DumpCommand extends ConfigurationAwareCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
parent::configure();
$this
->setName('cron:dump')
->setDescription('Dumps jobs to a crontab file')
;
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->dump($input);
return self::SUCCESS;
}
protected function dump(InputInterface $input): string
{
$reader = new AnnotationReader();
$helper = new Helper($this->getApplication(), $reader);
$tab = $helper->createTab($input, $this->getConfiguration());
$path = strtolower(
sprintf(
'%s.crontab',
$this->getApplication()->getName()
)
);
file_put_contents($path, (string) $tab);
return $path;
}
}
| <?php
namespace Padam87\CronBundle\Command;
use Doctrine\Common\Annotations\AnnotationReader;
use Padam87\CronBundle\Util\Helper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class DumpCommand extends ConfigurationAwareCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
parent::configure();
$this
->setName('cron:dump')
->setDescription('Dumps jobs to a crontab file')
;
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->dump($input);
- return 0;
+ return self::SUCCESS;
}
protected function dump(InputInterface $input): string
{
$reader = new AnnotationReader();
$helper = new Helper($this->getApplication(), $reader);
$tab = $helper->createTab($input, $this->getConfiguration());
$path = strtolower(
sprintf(
'%s.crontab',
$this->getApplication()->getName()
)
);
file_put_contents($path, (string) $tab);
return $path;
}
} | 2 | 0.037736 | 1 | 1 |
850327b68ab30e9fe0b788eadbfc1e2a4044d006 | docs/guide/events/intro.rst | docs/guide/events/intro.rst | Event types
-----------
Following event types are emitted by NodeConductor.
.. include:: events/backup.rst
.. include:: events/iaas.rst
.. include:: events/core.rst
.. include:: events/structure.rst
.. include:: events/template.rst | Event types
-----------
Following event types are emitted by NodeConductor.
.. include:: events/backup.rst
.. include:: events/iaas.rst
.. include:: events/core.rst
.. include:: events/structure.rst
.. include:: events/template.rst
.. include:: events/invoices.rst
| Include invoice docs in index | Include invoice docs in index
| reStructuredText | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | restructuredtext | ## Code Before:
Event types
-----------
Following event types are emitted by NodeConductor.
.. include:: events/backup.rst
.. include:: events/iaas.rst
.. include:: events/core.rst
.. include:: events/structure.rst
.. include:: events/template.rst
## Instruction:
Include invoice docs in index
## Code After:
Event types
-----------
Following event types are emitted by NodeConductor.
.. include:: events/backup.rst
.. include:: events/iaas.rst
.. include:: events/core.rst
.. include:: events/structure.rst
.. include:: events/template.rst
.. include:: events/invoices.rst
| Event types
-----------
Following event types are emitted by NodeConductor.
.. include:: events/backup.rst
.. include:: events/iaas.rst
.. include:: events/core.rst
.. include:: events/structure.rst
.. include:: events/template.rst
+ .. include:: events/invoices.rst | 1 | 0.1 | 1 | 0 |
4fddde8855ef6a9230c0750177efd813e2406fd3 | config/initializers/params_parsers.rb | config/initializers/params_parsers.rb | ActionDispatch::Request.parameter_parsers = ActionDispatch::Request.parameter_parsers.merge(
Mime[:json].symbol => -> (raw_post) {
::JSON.parse(raw_post).tap do |res|
begin
unless Hash === res or Array === res
raise StandardError.new "Expecting a hash or array"
end
rescue
raise ActionDispatch::ParamsParser::ParseError
end
end
}
)
class CatchJsonParseErrors
def initialize(app)
@app = app
end
def call(env)
begin
@app.call(env)
rescue ActionDispatch::ParamsParser::ParseError => error
if env['action_dispatch.request.content_type'] == Mime[:json]
error_output = "There was a problem in the JSON you submitted: #{error}"
return [
400, { "Content-Type" => "application/json" },
[ { status: 400, error: error_output }.to_json ]
]
else
raise error
end
end
end
end
Rails.application.configure do
config.middleware.use CatchJsonParseErrors
end
| ActionDispatch::Request.parameter_parsers = ActionDispatch::Request.parameter_parsers.merge(
Mime[:json].symbol => -> (raw_post) {
::JSON.parse(raw_post).tap do |res|
begin
unless Hash === res or Array === res
raise StandardError.new "Expecting a hash or array"
end
rescue
raise ActionDispatch::Http::Parameters::ParseError
end
end
}
)
class CatchJsonParseErrors
def initialize(app)
@app = app
end
def call(env)
begin
@app.call(env)
rescue ActionDispatch::Http::Parameters::ParseError => error
if env['action_dispatch.request.content_type'] == Mime[:json]
error_output = "There was a problem in the JSON you submitted: #{error}"
return [
400, { "Content-Type" => "application/json" },
[ { status: 400, error: error_output }.to_json ]
]
else
raise error
end
end
end
end
Rails.application.configure do
config.middleware.use CatchJsonParseErrors
end
| Change error to new Rails error type | Change error to new Rails error type
| Ruby | mit | kif-ev/oskiosk-server,kif-ev/oskiosk-server | ruby | ## Code Before:
ActionDispatch::Request.parameter_parsers = ActionDispatch::Request.parameter_parsers.merge(
Mime[:json].symbol => -> (raw_post) {
::JSON.parse(raw_post).tap do |res|
begin
unless Hash === res or Array === res
raise StandardError.new "Expecting a hash or array"
end
rescue
raise ActionDispatch::ParamsParser::ParseError
end
end
}
)
class CatchJsonParseErrors
def initialize(app)
@app = app
end
def call(env)
begin
@app.call(env)
rescue ActionDispatch::ParamsParser::ParseError => error
if env['action_dispatch.request.content_type'] == Mime[:json]
error_output = "There was a problem in the JSON you submitted: #{error}"
return [
400, { "Content-Type" => "application/json" },
[ { status: 400, error: error_output }.to_json ]
]
else
raise error
end
end
end
end
Rails.application.configure do
config.middleware.use CatchJsonParseErrors
end
## Instruction:
Change error to new Rails error type
## Code After:
ActionDispatch::Request.parameter_parsers = ActionDispatch::Request.parameter_parsers.merge(
Mime[:json].symbol => -> (raw_post) {
::JSON.parse(raw_post).tap do |res|
begin
unless Hash === res or Array === res
raise StandardError.new "Expecting a hash or array"
end
rescue
raise ActionDispatch::Http::Parameters::ParseError
end
end
}
)
class CatchJsonParseErrors
def initialize(app)
@app = app
end
def call(env)
begin
@app.call(env)
rescue ActionDispatch::Http::Parameters::ParseError => error
if env['action_dispatch.request.content_type'] == Mime[:json]
error_output = "There was a problem in the JSON you submitted: #{error}"
return [
400, { "Content-Type" => "application/json" },
[ { status: 400, error: error_output }.to_json ]
]
else
raise error
end
end
end
end
Rails.application.configure do
config.middleware.use CatchJsonParseErrors
end
| ActionDispatch::Request.parameter_parsers = ActionDispatch::Request.parameter_parsers.merge(
Mime[:json].symbol => -> (raw_post) {
::JSON.parse(raw_post).tap do |res|
begin
unless Hash === res or Array === res
raise StandardError.new "Expecting a hash or array"
end
rescue
- raise ActionDispatch::ParamsParser::ParseError
? ^^^ --
+ raise ActionDispatch::Http::Parameters::ParseError
? ++++++ ^^^
end
end
}
)
class CatchJsonParseErrors
def initialize(app)
@app = app
end
def call(env)
begin
@app.call(env)
- rescue ActionDispatch::ParamsParser::ParseError => error
? ^^^ --
+ rescue ActionDispatch::Http::Parameters::ParseError => error
? ++++++ ^^^
if env['action_dispatch.request.content_type'] == Mime[:json]
error_output = "There was a problem in the JSON you submitted: #{error}"
return [
400, { "Content-Type" => "application/json" },
[ { status: 400, error: error_output }.to_json ]
]
else
raise error
end
end
end
end
Rails.application.configure do
config.middleware.use CatchJsonParseErrors
end
| 4 | 0.1 | 2 | 2 |
6fe20a5c021fb0cf6faca7fb7a9867007869d2ad | akonadi/agents/CMakeLists.txt | akonadi/agents/CMakeLists.txt | add_subdirectory( mailthreader )
add_subdirectory( strigifeeder )
if( Nepomuk_FOUND AND NOT Q_WS_MAC )
#The following code to compute SOPRANO_PLUGIN_RAPTORPARSER_FOUND is lifted
#from KDE4.2's FindSoprano.cmake. We have this code here for backwards
#compatibility, and can be removed sometime after KDE 4.3 is released.
find_path(_PLUGIN_DIR
NAMES
soprano/plugins
PATHS
${SHARE_INSTALL_PREFIX} /usr/share /usr/local/share
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
set(_PLUGIN_DIR "${_PLUGIN_DIR}/soprano/plugins")
if(EXISTS ${_PLUGIN_DIR}/raptorparser.desktop)
set(SOPRANO_PLUGIN_RAPTORPARSER_FOUND TRUE)
endif(EXISTS ${_PLUGIN_DIR}/raptorparser.desktop)
if(SOPRANO_PLUGIN_RAPTORPARSER_FOUND)
add_subdirectory( nie )
add_subdirectory( nepomuk_email_feeder )
add_subdirectory( nepomuk_contact_feeder )
endif(SOPRANO_PLUGIN_RAPTORPARSER_FOUND)
endif( Nepomuk_FOUND AND NOT Q_WS_MAC )
| add_subdirectory( strigifeeder )
if( Nepomuk_FOUND AND NOT Q_WS_MAC )
#The following code to compute SOPRANO_PLUGIN_RAPTORPARSER_FOUND is lifted
#from KDE4.2's FindSoprano.cmake. We have this code here for backwards
#compatibility, and can be removed sometime after KDE 4.3 is released.
find_path(_PLUGIN_DIR
NAMES
soprano/plugins
PATHS
${SHARE_INSTALL_PREFIX} /usr/share /usr/local/share
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
set(_PLUGIN_DIR "${_PLUGIN_DIR}/soprano/plugins")
if(EXISTS ${_PLUGIN_DIR}/raptorparser.desktop)
set(SOPRANO_PLUGIN_RAPTORPARSER_FOUND TRUE)
endif(EXISTS ${_PLUGIN_DIR}/raptorparser.desktop)
if(SOPRANO_PLUGIN_RAPTORPARSER_FOUND)
add_subdirectory( nie )
add_subdirectory( nepomuk_email_feeder )
add_subdirectory( nepomuk_contact_feeder )
endif(SOPRANO_PLUGIN_RAPTORPARSER_FOUND)
endif( Nepomuk_FOUND AND NOT Q_WS_MAC )
| Remove mailthreader from CMake file. | Remove mailthreader from CMake file.
svn path=/trunk/KDE/kdepim/; revision=979954
| Text | lgpl-2.1 | lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi | text | ## Code Before:
add_subdirectory( mailthreader )
add_subdirectory( strigifeeder )
if( Nepomuk_FOUND AND NOT Q_WS_MAC )
#The following code to compute SOPRANO_PLUGIN_RAPTORPARSER_FOUND is lifted
#from KDE4.2's FindSoprano.cmake. We have this code here for backwards
#compatibility, and can be removed sometime after KDE 4.3 is released.
find_path(_PLUGIN_DIR
NAMES
soprano/plugins
PATHS
${SHARE_INSTALL_PREFIX} /usr/share /usr/local/share
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
set(_PLUGIN_DIR "${_PLUGIN_DIR}/soprano/plugins")
if(EXISTS ${_PLUGIN_DIR}/raptorparser.desktop)
set(SOPRANO_PLUGIN_RAPTORPARSER_FOUND TRUE)
endif(EXISTS ${_PLUGIN_DIR}/raptorparser.desktop)
if(SOPRANO_PLUGIN_RAPTORPARSER_FOUND)
add_subdirectory( nie )
add_subdirectory( nepomuk_email_feeder )
add_subdirectory( nepomuk_contact_feeder )
endif(SOPRANO_PLUGIN_RAPTORPARSER_FOUND)
endif( Nepomuk_FOUND AND NOT Q_WS_MAC )
## Instruction:
Remove mailthreader from CMake file.
svn path=/trunk/KDE/kdepim/; revision=979954
## Code After:
add_subdirectory( strigifeeder )
if( Nepomuk_FOUND AND NOT Q_WS_MAC )
#The following code to compute SOPRANO_PLUGIN_RAPTORPARSER_FOUND is lifted
#from KDE4.2's FindSoprano.cmake. We have this code here for backwards
#compatibility, and can be removed sometime after KDE 4.3 is released.
find_path(_PLUGIN_DIR
NAMES
soprano/plugins
PATHS
${SHARE_INSTALL_PREFIX} /usr/share /usr/local/share
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
set(_PLUGIN_DIR "${_PLUGIN_DIR}/soprano/plugins")
if(EXISTS ${_PLUGIN_DIR}/raptorparser.desktop)
set(SOPRANO_PLUGIN_RAPTORPARSER_FOUND TRUE)
endif(EXISTS ${_PLUGIN_DIR}/raptorparser.desktop)
if(SOPRANO_PLUGIN_RAPTORPARSER_FOUND)
add_subdirectory( nie )
add_subdirectory( nepomuk_email_feeder )
add_subdirectory( nepomuk_contact_feeder )
endif(SOPRANO_PLUGIN_RAPTORPARSER_FOUND)
endif( Nepomuk_FOUND AND NOT Q_WS_MAC )
| - add_subdirectory( mailthreader )
add_subdirectory( strigifeeder )
if( Nepomuk_FOUND AND NOT Q_WS_MAC )
#The following code to compute SOPRANO_PLUGIN_RAPTORPARSER_FOUND is lifted
#from KDE4.2's FindSoprano.cmake. We have this code here for backwards
#compatibility, and can be removed sometime after KDE 4.3 is released.
find_path(_PLUGIN_DIR
NAMES
soprano/plugins
PATHS
${SHARE_INSTALL_PREFIX} /usr/share /usr/local/share
NO_DEFAULT_PATH
NO_SYSTEM_ENVIRONMENT_PATH
)
set(_PLUGIN_DIR "${_PLUGIN_DIR}/soprano/plugins")
if(EXISTS ${_PLUGIN_DIR}/raptorparser.desktop)
set(SOPRANO_PLUGIN_RAPTORPARSER_FOUND TRUE)
endif(EXISTS ${_PLUGIN_DIR}/raptorparser.desktop)
if(SOPRANO_PLUGIN_RAPTORPARSER_FOUND)
add_subdirectory( nie )
add_subdirectory( nepomuk_email_feeder )
add_subdirectory( nepomuk_contact_feeder )
endif(SOPRANO_PLUGIN_RAPTORPARSER_FOUND)
endif( Nepomuk_FOUND AND NOT Q_WS_MAC ) | 1 | 0.034483 | 0 | 1 |
ca88057f1a5ccb841e8a3820ef2a229e433d285c | config/software/oc-chef-pedant.rb | config/software/oc-chef-pedant.rb | name "oc-chef-pedant"
default_version "1.0.47.1"
dependency "ruby"
dependency "bundler"
dependency "rsync"
source :git => "git@github.com:opscode/oc-chef-pedant.git"
relative_path "oc-chef-pedant"
bundle_path = "#{install_dir}/embedded/service/gem"
build do
bundle "install --path=#{bundle_path}"
command "mkdir -p #{install_dir}/embedded/service/oc-chef-pedant"
command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/oc-chef-pedant/"
# cleanup the .git directories in the bundle path before commiting
# them as submodules to the git cache
command "find #{bundle_path} -type d -name .git | xargs rm -rf"
end
| name "oc-chef-pedant"
default_version "dt/remove_focus"
dependency "ruby"
dependency "bundler"
dependency "rsync"
source :git => "git@github.com:opscode/oc-chef-pedant.git"
relative_path "oc-chef-pedant"
bundle_path = "#{install_dir}/embedded/service/gem"
build do
bundle "install --path=#{bundle_path}"
command "mkdir -p #{install_dir}/embedded/service/oc-chef-pedant"
command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/oc-chef-pedant/"
# cleanup the .git directories in the bundle path before commiting
# them as submodules to the git cache
command "find #{bundle_path} -type d -name .git | xargs rm -rf"
end
| Change branch of oc-chef-pedand to dt/remove_focus | Change branch of oc-chef-pedand to dt/remove_focus
| Ruby | apache-2.0 | charlesjohnson/chef-server,marcparadise/chef-server,chef/opscode-omnibus,rmoorman/chef-server,charlesjohnson/chef-server,stephenbm/chef-server,charlesjohnson/chef-server,itmustbejj/chef-server,rmoorman/chef-server,stephenbm/chef-server,charlesjohnson/chef-server,poliva83/chef-server,Minerapp/chef-server,marcparadise/chef-server,chef/chef-server,chef/chef-server,itmustbejj/chef-server,itmustbejj/chef-server,stephenbm/chef-server,poliva83/chef-server,rmoorman/chef-server,chef/chef-server,juliandunn/chef-server-1,poliva83/chef-server,marcparadise/chef-server,juliandunn/chef-server-1,vladuemilian/chef-server,Minerapp/chef-server,itmustbejj/chef-server,chef/chef-server,itmustbejj/chef-server,charlesjohnson/chef-server,poliva83/chef-server,vladuemilian/chef-server,vladuemilian/chef-server,juliandunn/chef-server-1,Minerapp/chef-server,chef/opscode-omnibus,rmoorman/chef-server,juliandunn/chef-server-1,marcparadise/chef-server,poliva83/chef-server,marcparadise/chef-server,Minerapp/chef-server,stephenbm/chef-server,chef/opscode-omnibus,chef/opscode-omnibus,chef/chef-server,juliandunn/chef-server-1,rmoorman/chef-server,vladuemilian/chef-server,chef/chef-server,vladuemilian/chef-server,Minerapp/chef-server,stephenbm/chef-server | ruby | ## Code Before:
name "oc-chef-pedant"
default_version "1.0.47.1"
dependency "ruby"
dependency "bundler"
dependency "rsync"
source :git => "git@github.com:opscode/oc-chef-pedant.git"
relative_path "oc-chef-pedant"
bundle_path = "#{install_dir}/embedded/service/gem"
build do
bundle "install --path=#{bundle_path}"
command "mkdir -p #{install_dir}/embedded/service/oc-chef-pedant"
command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/oc-chef-pedant/"
# cleanup the .git directories in the bundle path before commiting
# them as submodules to the git cache
command "find #{bundle_path} -type d -name .git | xargs rm -rf"
end
## Instruction:
Change branch of oc-chef-pedand to dt/remove_focus
## Code After:
name "oc-chef-pedant"
default_version "dt/remove_focus"
dependency "ruby"
dependency "bundler"
dependency "rsync"
source :git => "git@github.com:opscode/oc-chef-pedant.git"
relative_path "oc-chef-pedant"
bundle_path = "#{install_dir}/embedded/service/gem"
build do
bundle "install --path=#{bundle_path}"
command "mkdir -p #{install_dir}/embedded/service/oc-chef-pedant"
command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/oc-chef-pedant/"
# cleanup the .git directories in the bundle path before commiting
# them as submodules to the git cache
command "find #{bundle_path} -type d -name .git | xargs rm -rf"
end
| name "oc-chef-pedant"
- default_version "1.0.47.1"
+ default_version "dt/remove_focus"
dependency "ruby"
dependency "bundler"
dependency "rsync"
source :git => "git@github.com:opscode/oc-chef-pedant.git"
relative_path "oc-chef-pedant"
bundle_path = "#{install_dir}/embedded/service/gem"
build do
bundle "install --path=#{bundle_path}"
command "mkdir -p #{install_dir}/embedded/service/oc-chef-pedant"
command "#{install_dir}/embedded/bin/rsync -a --delete --exclude=.git/*** --exclude=.gitignore ./ #{install_dir}/embedded/service/oc-chef-pedant/"
# cleanup the .git directories in the bundle path before commiting
# them as submodules to the git cache
command "find #{bundle_path} -type d -name .git | xargs rm -rf"
end | 2 | 0.090909 | 1 | 1 |
ad1345eb948895e73360937e9a037811a2d1573b | g3doc/_toc.yaml | g3doc/_toc.yaml | toc:
- title: "Improving Model Quality"
path: /tfx/guide/tfma
- title: "Install"
path: /tfx/model_analysis/install
- title: "Get started"
path: /tfx/model_analysis/get_started
- title: "Setup"
path: /tfx/model_analysis/setup
- title: "Metrics and Plots"
path: /tfx/model_analysis/metrics
- title: "Visualizations"
path: /tfx/model_analysis/visualizations
- title: "Model Validations"
path: /tfx/model_analysis/model_validations
- title: "Using Fairness Indicators"
path: /tfx/guide/fairness_indicators
- title: "Using Fairness Indicators with Pandas DataFrames"
path: /tfx/fairness_indicators/examples/Fairness_Indicators_Pandas_Case_Study
- title: "Architecture"
path: /tfx/model_analysis/architecture
- title: "FAQ"
path: /tfx/model_analysis/faq
| toc:
- title: "Improving Model Quality"
path: /tfx/guide/tfma
- title: "Install"
path: /tfx/model_analysis/install
- title: "Get started"
path: /tfx/model_analysis/get_started
- title: "Setup"
path: /tfx/model_analysis/setup
- title: "Metrics and Plots"
path: /tfx/model_analysis/metrics
- title: "Visualizations"
path: /tfx/model_analysis/visualizations
- title: "Model Validations"
path: /tfx/model_analysis/model_validations
- title: "Using Fairness Indicators"
path: /tfx/guide/fairness_indicators
- title: "Using Fairness Indicators with Pandas DataFrames"
path: /responsible_ai/fairness_indicators/tutorials/Fairness_Indicators_Pandas_Case_Study
- title: "Architecture"
path: /tfx/model_analysis/architecture
- title: "FAQ"
path: /tfx/model_analysis/faq
| Fix paths to Pandas case study | Fix paths to Pandas case study
PiperOrigin-RevId: 367696749
| YAML | apache-2.0 | tensorflow/model-analysis,tensorflow/model-analysis,tensorflow/model-analysis,tensorflow/model-analysis | yaml | ## Code Before:
toc:
- title: "Improving Model Quality"
path: /tfx/guide/tfma
- title: "Install"
path: /tfx/model_analysis/install
- title: "Get started"
path: /tfx/model_analysis/get_started
- title: "Setup"
path: /tfx/model_analysis/setup
- title: "Metrics and Plots"
path: /tfx/model_analysis/metrics
- title: "Visualizations"
path: /tfx/model_analysis/visualizations
- title: "Model Validations"
path: /tfx/model_analysis/model_validations
- title: "Using Fairness Indicators"
path: /tfx/guide/fairness_indicators
- title: "Using Fairness Indicators with Pandas DataFrames"
path: /tfx/fairness_indicators/examples/Fairness_Indicators_Pandas_Case_Study
- title: "Architecture"
path: /tfx/model_analysis/architecture
- title: "FAQ"
path: /tfx/model_analysis/faq
## Instruction:
Fix paths to Pandas case study
PiperOrigin-RevId: 367696749
## Code After:
toc:
- title: "Improving Model Quality"
path: /tfx/guide/tfma
- title: "Install"
path: /tfx/model_analysis/install
- title: "Get started"
path: /tfx/model_analysis/get_started
- title: "Setup"
path: /tfx/model_analysis/setup
- title: "Metrics and Plots"
path: /tfx/model_analysis/metrics
- title: "Visualizations"
path: /tfx/model_analysis/visualizations
- title: "Model Validations"
path: /tfx/model_analysis/model_validations
- title: "Using Fairness Indicators"
path: /tfx/guide/fairness_indicators
- title: "Using Fairness Indicators with Pandas DataFrames"
path: /responsible_ai/fairness_indicators/tutorials/Fairness_Indicators_Pandas_Case_Study
- title: "Architecture"
path: /tfx/model_analysis/architecture
- title: "FAQ"
path: /tfx/model_analysis/faq
| toc:
- title: "Improving Model Quality"
path: /tfx/guide/tfma
- title: "Install"
path: /tfx/model_analysis/install
- title: "Get started"
path: /tfx/model_analysis/get_started
- title: "Setup"
path: /tfx/model_analysis/setup
- title: "Metrics and Plots"
path: /tfx/model_analysis/metrics
- title: "Visualizations"
path: /tfx/model_analysis/visualizations
- title: "Model Validations"
path: /tfx/model_analysis/model_validations
- title: "Using Fairness Indicators"
path: /tfx/guide/fairness_indicators
- title: "Using Fairness Indicators with Pandas DataFrames"
- path: /tfx/fairness_indicators/examples/Fairness_Indicators_Pandas_Case_Study
? ^^^ ^^ -- -
+ path: /responsible_ai/fairness_indicators/tutorials/Fairness_Indicators_Pandas_Case_Study
? ^^^^^^^^^^^^^^ ^^^^^^
- title: "Architecture"
path: /tfx/model_analysis/architecture
- title: "FAQ"
path: /tfx/model_analysis/faq | 2 | 0.086957 | 1 | 1 |
ab86365fc892d434423f9dae80c4b64d7e8261ea | README.md | README.md | ActionSendGridview
==================
|
Standalone widget for retrieving and displaying the action_SEND intents on the user's device.
- Allows you to set the message/subject/url that will be sent.
- Allows you to set a precedence list so that you can determine the precedence in which intents will be shown.
- Initially shows 6 intents with a 'More' button that when clicked slides down in an animation to reveal the rest of the intents on the device.
## USAGE
Include GridviewFragment in your layout xml as a new fragment
```
<fragment
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/coupon_sharing_fragment"
android:name="com.citylifeapps.cups.actionsendgridview.GridviewFragment"/>
```
In order to properly display this widget, you should allocate about half the area of a standard phone screen.
In the onCreate method of your activity, before you call setcontentview, you should initialize some values for the widget using the static methods provided:
- Change the message text that you want to send:
GridviewFragment.setMsgPayload("This is the message text");
- Change the message subject that you want to send:
GridviewFragment.setMsgSubject("This is the subject");
- Change the message url that you want to send:
GridviewFragment.setUrlPayload("www.tester.com");
- Change the precedence of the intents on the screen:
Step one - create a new map<String,Integer>
private final Map<String,Integer> precedenceMap= new HashMap<String,Integer>();
Step two - populate the map. The key should be the label of the intent (for example, WhatsApp, Gmail, etc.) - this does not have to be case sensitive. The value should be the precedence you want to give the intent in the list of intents, in which lower numbers appear before larger numbers.
precedenceMap.put("WhatsApp",1);
Step three - pass your precedenceMap to the widget:
GridviewFragment.setPrecedenceMap(precedenceMap);
Once you are finished presetting the widget, you can display it onscreen by using
setcontentview(R.layout.your_layout)
The default precedence list (if none is specified and passed to the widget) is "Twitter, Facebook Messenger, Copy to Clipboard, Facebook, Gmail, WhatsApp, Email".
## DOWNLOAD
Clone the project from Github and reference it as a library project within your application ('file->import module…' in android studio).
## LICENSE
Copyright 2014 Urbancups, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
| Update with description, instructions, license | Update with description, instructions, license | Markdown | apache-2.0 | urbancups/action-send-gridview | markdown | ## Code Before:
ActionSendGridview
==================
## Instruction:
Update with description, instructions, license
## Code After:
Standalone widget for retrieving and displaying the action_SEND intents on the user's device.
- Allows you to set the message/subject/url that will be sent.
- Allows you to set a precedence list so that you can determine the precedence in which intents will be shown.
- Initially shows 6 intents with a 'More' button that when clicked slides down in an animation to reveal the rest of the intents on the device.
## USAGE
Include GridviewFragment in your layout xml as a new fragment
```
<fragment
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/coupon_sharing_fragment"
android:name="com.citylifeapps.cups.actionsendgridview.GridviewFragment"/>
```
In order to properly display this widget, you should allocate about half the area of a standard phone screen.
In the onCreate method of your activity, before you call setcontentview, you should initialize some values for the widget using the static methods provided:
- Change the message text that you want to send:
GridviewFragment.setMsgPayload("This is the message text");
- Change the message subject that you want to send:
GridviewFragment.setMsgSubject("This is the subject");
- Change the message url that you want to send:
GridviewFragment.setUrlPayload("www.tester.com");
- Change the precedence of the intents on the screen:
Step one - create a new map<String,Integer>
private final Map<String,Integer> precedenceMap= new HashMap<String,Integer>();
Step two - populate the map. The key should be the label of the intent (for example, WhatsApp, Gmail, etc.) - this does not have to be case sensitive. The value should be the precedence you want to give the intent in the list of intents, in which lower numbers appear before larger numbers.
precedenceMap.put("WhatsApp",1);
Step three - pass your precedenceMap to the widget:
GridviewFragment.setPrecedenceMap(precedenceMap);
Once you are finished presetting the widget, you can display it onscreen by using
setcontentview(R.layout.your_layout)
The default precedence list (if none is specified and passed to the widget) is "Twitter, Facebook Messenger, Copy to Clipboard, Facebook, Gmail, WhatsApp, Email".
## DOWNLOAD
Clone the project from Github and reference it as a library project within your application ('file->import module…' in android studio).
## LICENSE
Copyright 2014 Urbancups, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
| - ActionSendGridview
- ==================
+
+ Standalone widget for retrieving and displaying the action_SEND intents on the user's device.
+
+ - Allows you to set the message/subject/url that will be sent.
+
+ - Allows you to set a precedence list so that you can determine the precedence in which intents will be shown.
+
+ - Initially shows 6 intents with a 'More' button that when clicked slides down in an animation to reveal the rest of the intents on the device.
+
+
+
+ ## USAGE
+
+ Include GridviewFragment in your layout xml as a new fragment
+
+ ```
+ <fragment
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/coupon_sharing_fragment"
+ android:name="com.citylifeapps.cups.actionsendgridview.GridviewFragment"/>
+ ```
+
+ In order to properly display this widget, you should allocate about half the area of a standard phone screen.
+
+ In the onCreate method of your activity, before you call setcontentview, you should initialize some values for the widget using the static methods provided:
+
+ - Change the message text that you want to send:
+
+
+ GridviewFragment.setMsgPayload("This is the message text");
+
+ - Change the message subject that you want to send:
+
+
+ GridviewFragment.setMsgSubject("This is the subject");
+
+
+ - Change the message url that you want to send:
+
+
+ GridviewFragment.setUrlPayload("www.tester.com");
+
+ - Change the precedence of the intents on the screen:
+
+ Step one - create a new map<String,Integer>
+
+ private final Map<String,Integer> precedenceMap= new HashMap<String,Integer>();
+
+
+ Step two - populate the map. The key should be the label of the intent (for example, WhatsApp, Gmail, etc.) - this does not have to be case sensitive. The value should be the precedence you want to give the intent in the list of intents, in which lower numbers appear before larger numbers.
+
+ precedenceMap.put("WhatsApp",1);
+
+
+ Step three - pass your precedenceMap to the widget:
+
+ GridviewFragment.setPrecedenceMap(precedenceMap);
+
+ Once you are finished presetting the widget, you can display it onscreen by using
+
+ setcontentview(R.layout.your_layout)
+
+ The default precedence list (if none is specified and passed to the widget) is "Twitter, Facebook Messenger, Copy to Clipboard, Facebook, Gmail, WhatsApp, Email".
+
+
+ ## DOWNLOAD
+
+ Clone the project from Github and reference it as a library project within your application ('file->import module…' in android studio).
+
+
+ ## LICENSE
+
+ Copyright 2014 Urbancups, Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. | 88 | 44 | 86 | 2 |
c7ff2da3b45de66a7d4af0e5f0d173adfff221e8 | Testing/Code/_TDD.cpp | Testing/Code/_TDD.cpp |
// BTK error messages are not displayed
#define TDD_SILENT_CERR
int main()
{
#if defined(TDD_SILENT_CERR)
std::streambuf* standardErrorOutput = std::cerr.rdbuf(0);
#endif
int err = CxxTest::ErrorPrinter().run();
#if defined(TDD_SILENT_CERR)
std::cerr.rdbuf(standardErrorOutput);
#endif
return err;
};
#include <cxxtest/Root.cpp>
|
// BTK error messages are not displayed
#define TDD_SILENT_CERR
int main()
{
#if defined(TDD_SILENT_CERR)
btk::Logger::SetVerboseMode(btk::Logger::Quiet);
#endif
return CxxTest::ErrorPrinter().run();;
};
#include <cxxtest/Root.cpp>
| Use of the command btk::Logger::SetVerbose instead of setting the stream buffer of std::cerr to null when the symbol TDD_SILENT_CERR is defined. | [UPD] Use of the command btk::Logger::SetVerbose instead of setting the stream buffer of std::cerr to null when the symbol TDD_SILENT_CERR is defined.
| C++ | bsd-3-clause | letaureau/b-tk.core,letaureau/b-tk.core,Biomechanical-ToolKit/BTKCore,xyproto/b-tk.core,letaureau/b-tk.core,letaureau/b-tk.core,xyproto/b-tk.core,xyproto/b-tk.core,xyproto/b-tk.core,Biomechanical-ToolKit/BTKCore,Biomechanical-ToolKit/BTKCore,letaureau/b-tk.core,Biomechanical-ToolKit/BTKCore,xyproto/b-tk.core,letaureau/b-tk.core,letaureau/b-tk.core,Biomechanical-ToolKit/BTKCore,letaureau/b-tk.core,xyproto/b-tk.core,Biomechanical-ToolKit/BTKCore,Biomechanical-ToolKit/BTKCore,xyproto/b-tk.core,Biomechanical-ToolKit/BTKCore,xyproto/b-tk.core | c++ | ## Code Before:
// BTK error messages are not displayed
#define TDD_SILENT_CERR
int main()
{
#if defined(TDD_SILENT_CERR)
std::streambuf* standardErrorOutput = std::cerr.rdbuf(0);
#endif
int err = CxxTest::ErrorPrinter().run();
#if defined(TDD_SILENT_CERR)
std::cerr.rdbuf(standardErrorOutput);
#endif
return err;
};
#include <cxxtest/Root.cpp>
## Instruction:
[UPD] Use of the command btk::Logger::SetVerbose instead of setting the stream buffer of std::cerr to null when the symbol TDD_SILENT_CERR is defined.
## Code After:
// BTK error messages are not displayed
#define TDD_SILENT_CERR
int main()
{
#if defined(TDD_SILENT_CERR)
btk::Logger::SetVerboseMode(btk::Logger::Quiet);
#endif
return CxxTest::ErrorPrinter().run();;
};
#include <cxxtest/Root.cpp>
|
// BTK error messages are not displayed
#define TDD_SILENT_CERR
int main()
{
#if defined(TDD_SILENT_CERR)
- std::streambuf* standardErrorOutput = std::cerr.rdbuf(0);
+ btk::Logger::SetVerboseMode(btk::Logger::Quiet);
#endif
-
- int err = CxxTest::ErrorPrinter().run();
? ^ -------
+ return CxxTest::ErrorPrinter().run();;
? ^^^^^ +
-
- #if defined(TDD_SILENT_CERR)
- std::cerr.rdbuf(standardErrorOutput);
- #endif
-
- return err;
};
#include <cxxtest/Root.cpp> | 11 | 0.55 | 2 | 9 |
7c7cbec79f8a4fd3256155c60176009ce2a9bc0b | test/index.html | test/index.html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BlueMath Tests</title>
<script src="../build/bluemath-test.js"></script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" />
<style>
select {
font-size: 120%;
position: absolute;
right: 10px;
top: 10px;
z-index: 10;
}
svg {
position: absolute;
left: 0;
top: 0;
}
</style>
</head>
<body>
<select>
<option value="bboxes">Bounding Boxes</option>
<option value="circarcs">Circular Arcs</option>
<option value="int-line-ellipse-full">Intersections Line Ellipse-full</option>
<option value="int-line-ellipse-partial">Intersections Line Ellipse-partial</option>
<option value="int-line-cbez">Intersections Line Cubic Bezier</option>
<option value="nurbs-basis">Plot NURBS basis</option>
<option value="unittests">Unit Tests</option>
<option value="ndarrunittests">NDArray Unit Tests</option>
</select>
</body>
</html> | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BlueMath Tests</title>
<script src="../build/bluemath-test.js"></script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" />
<style>
</style>
</head>
<body>
</body>
</html> | Remove obsolete html and css | Remove obsolete html and css
| HTML | apache-2.0 | bluemathsoft/bluemath,bluemathsoft/bluemath,bluemathsoft/bluemath,bluemathsoft/bluemath | html | ## Code Before:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BlueMath Tests</title>
<script src="../build/bluemath-test.js"></script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" />
<style>
select {
font-size: 120%;
position: absolute;
right: 10px;
top: 10px;
z-index: 10;
}
svg {
position: absolute;
left: 0;
top: 0;
}
</style>
</head>
<body>
<select>
<option value="bboxes">Bounding Boxes</option>
<option value="circarcs">Circular Arcs</option>
<option value="int-line-ellipse-full">Intersections Line Ellipse-full</option>
<option value="int-line-ellipse-partial">Intersections Line Ellipse-partial</option>
<option value="int-line-cbez">Intersections Line Cubic Bezier</option>
<option value="nurbs-basis">Plot NURBS basis</option>
<option value="unittests">Unit Tests</option>
<option value="ndarrunittests">NDArray Unit Tests</option>
</select>
</body>
</html>
## Instruction:
Remove obsolete html and css
## Code After:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BlueMath Tests</title>
<script src="../build/bluemath-test.js"></script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" />
<style>
</style>
</head>
<body>
</body>
</html> | <!DOCTYPE html>
<html lang="en">
-
<head>
<meta charset="UTF-8">
<title>BlueMath Tests</title>
<script src="../build/bluemath-test.js"></script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css" />
<style>
- select {
- font-size: 120%;
- position: absolute;
- right: 10px;
- top: 10px;
- z-index: 10;
- }
-
- svg {
- position: absolute;
- left: 0;
- top: 0;
- }
</style>
</head>
<body>
-
- <select>
- <option value="bboxes">Bounding Boxes</option>
- <option value="circarcs">Circular Arcs</option>
- <option value="int-line-ellipse-full">Intersections Line Ellipse-full</option>
- <option value="int-line-ellipse-partial">Intersections Line Ellipse-partial</option>
- <option value="int-line-cbez">Intersections Line Cubic Bezier</option>
- <option value="nurbs-basis">Plot NURBS basis</option>
- <option value="unittests">Unit Tests</option>
- <option value="ndarrunittests">NDArray Unit Tests</option>
- </select>
</body>
</html> | 25 | 0.609756 | 0 | 25 |
de154a6d314a46eeaef7dec0a51148b1578e4af4 | app/controllers/api/v1/contests_controller.rb | app/controllers/api/v1/contests_controller.rb | module Api::V1
class ContestsController < Api::ApiController
def index
contests = Contest.order("begins DESC")
if params[:current_only] == "1"
contests = contests.current
end
if timetable_filter = params[:timetables_public]
filter_value = timetable_filter == "1" ? true : false
contests = contests.with_timetables_public(filter_value)
end
@contests = contests
end
end
end
| module Api::V1
class ContestsController < Api::ApiController
def index
contests = Contest.includes(:host).order("begins DESC")
if params[:current_only] == "1"
contests = contests.current
end
if timetable_filter = params[:timetables_public]
filter_value = timetable_filter == "1" ? true : false
contests = contests.with_timetables_public(filter_value)
end
@contests = contests
end
end
end
| Reduce n+1 queries for API /contests response | Reduce n+1 queries for API /contests response
| Ruby | mit | richeterre/jumubase-rails,richeterre/jumubase-rails,richeterre/jumubase-rails | ruby | ## Code Before:
module Api::V1
class ContestsController < Api::ApiController
def index
contests = Contest.order("begins DESC")
if params[:current_only] == "1"
contests = contests.current
end
if timetable_filter = params[:timetables_public]
filter_value = timetable_filter == "1" ? true : false
contests = contests.with_timetables_public(filter_value)
end
@contests = contests
end
end
end
## Instruction:
Reduce n+1 queries for API /contests response
## Code After:
module Api::V1
class ContestsController < Api::ApiController
def index
contests = Contest.includes(:host).order("begins DESC")
if params[:current_only] == "1"
contests = contests.current
end
if timetable_filter = params[:timetables_public]
filter_value = timetable_filter == "1" ? true : false
contests = contests.with_timetables_public(filter_value)
end
@contests = contests
end
end
end
| module Api::V1
class ContestsController < Api::ApiController
def index
- contests = Contest.order("begins DESC")
+ contests = Contest.includes(:host).order("begins DESC")
? ++++++++++++++++
if params[:current_only] == "1"
contests = contests.current
end
if timetable_filter = params[:timetables_public]
filter_value = timetable_filter == "1" ? true : false
contests = contests.with_timetables_public(filter_value)
end
@contests = contests
end
end
end | 2 | 0.111111 | 1 | 1 |
3ff5fe2e7a9b530bdfca3b8703a5ec70d9d48978 | .travis.yml | .travis.yml | language: ruby
rvm:
- 1.9.3
- 2.1.3
- jruby-1.7.18
jdk:
- oraclejdk7
- openjdk7
matrix:
exclude:
- rvm: 1.9.3
jdk: openjdk7
- rvm: 2.1.3
jdk: openjdk7
notifications:
email:
- mflorisson@gmail.com
- ldonnet@cityway.fr
- metienne@cityway.fr
- zbouziane@cityway.fr
before_script:
- "bundle exec rake ci:db_travis_config"
- "bundle exec rake db:create"
- "bundle exec rake db:migrate"
script: "bundle exec rake spec"
| language: ruby
rvm:
- 1.9.3
- 2.1.3
- jruby-1.7.18
jdk:
- oraclejdk7
- openjdk7
matrix:
exclude:
- rvm: 1.9.3
jdk: openjdk7
- rvm: 2.1.3
jdk: openjdk7
notifications:
email:
- mflorisson@gmail.com
- bruno@atnos.com
- metienne@cityway.fr
- zbouziane@cityway.fr
before_script:
- "bundle exec rake ci:db_travis_config"
- "bundle exec rake db:create"
- "bundle exec rake db:migrate"
script: "bundle exec rake spec"
| Add Bruno email to Travis | Add Bruno email to Travis
| YAML | mit | afimb/ninoxe,afimb/ninoxe,afimb/ninoxe | yaml | ## Code Before:
language: ruby
rvm:
- 1.9.3
- 2.1.3
- jruby-1.7.18
jdk:
- oraclejdk7
- openjdk7
matrix:
exclude:
- rvm: 1.9.3
jdk: openjdk7
- rvm: 2.1.3
jdk: openjdk7
notifications:
email:
- mflorisson@gmail.com
- ldonnet@cityway.fr
- metienne@cityway.fr
- zbouziane@cityway.fr
before_script:
- "bundle exec rake ci:db_travis_config"
- "bundle exec rake db:create"
- "bundle exec rake db:migrate"
script: "bundle exec rake spec"
## Instruction:
Add Bruno email to Travis
## Code After:
language: ruby
rvm:
- 1.9.3
- 2.1.3
- jruby-1.7.18
jdk:
- oraclejdk7
- openjdk7
matrix:
exclude:
- rvm: 1.9.3
jdk: openjdk7
- rvm: 2.1.3
jdk: openjdk7
notifications:
email:
- mflorisson@gmail.com
- bruno@atnos.com
- metienne@cityway.fr
- zbouziane@cityway.fr
before_script:
- "bundle exec rake ci:db_travis_config"
- "bundle exec rake db:create"
- "bundle exec rake db:migrate"
script: "bundle exec rake spec"
| language: ruby
rvm:
- 1.9.3
- 2.1.3
- jruby-1.7.18
jdk:
- oraclejdk7
- openjdk7
matrix:
exclude:
- rvm: 1.9.3
jdk: openjdk7
- rvm: 2.1.3
jdk: openjdk7
notifications:
email:
- mflorisson@gmail.com
- - ldonnet@cityway.fr
+ - bruno@atnos.com
- metienne@cityway.fr
- zbouziane@cityway.fr
before_script:
- "bundle exec rake ci:db_travis_config"
- "bundle exec rake db:create"
- "bundle exec rake db:migrate"
script: "bundle exec rake spec" | 2 | 0.08 | 1 | 1 |
76786bdd11eac589bdaeb9a8cea5dcacaf613225 | .pre-commit-config.yaml | .pre-commit-config.yaml | repos:
- repo: https://github.com/psf/black
rev: 19.3b0
hooks:
- id: black
| repos:
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: v1.4.0
hooks:
- id: blacken-docs
| Update black in pre-commit and add blacken-docs. | Update black in pre-commit and add blacken-docs.
| YAML | mit | jaraco/portend,jaraco/jaraco.path,jaraco/zipp,hugovk/inflect.py,yougov/pmxbot,jaraco/jaraco.stream,python/importlib_metadata,jaraco/tempora,jaraco/jaraco.logging,jaraco/jaraco.collections,jaraco/irc,jaraco/hgtools,jaraco/keyring,jaraco/jaraco.functools,yougov/pmxbot,jaraco/jaraco.text,pytest-dev/pytest-runner,jaraco/backports.functools_lru_cache,jaraco/jaraco.context,jaraco/calendra,pwdyson/inflect.py,jaraco/jaraco.classes,jaraco/jaraco.itertools,yougov/pmxbot,jazzband/inflect | yaml | ## Code Before:
repos:
- repo: https://github.com/psf/black
rev: 19.3b0
hooks:
- id: black
## Instruction:
Update black in pre-commit and add blacken-docs.
## Code After:
repos:
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: v1.4.0
hooks:
- id: blacken-docs
| repos:
- repo: https://github.com/psf/black
- rev: 19.3b0
? ^
+ rev: 19.10b0
? ^^
hooks:
- id: black
+
+ - repo: https://github.com/asottile/blacken-docs
+ rev: v1.4.0
+ hooks:
+ - id: blacken-docs | 7 | 1.4 | 6 | 1 |
a261846c7796da45de52f3bf61dc1cb7c6a03c7e | app/home/home.html | app/home/home.html | <!-- htmlhint doctype-first:false -->
<div id="top-nav" class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<a href class="navbar-brand" ui-sref="home.map">FDA Food Recalls</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 alert alert-info">
<p>
This is a tool for reviewing FDA recalls on food products based on producing and
distribution states on a month by month basis. The tool was created as a
response to 18F's RFQ 4QTFHS150004.
</p>
<p>
Use the criteria below to filter the results displayed on the map of the
United States. Click on a state to review the recalls affecting that state.
</p>
</div>
</div>
</div>
<ui-view></ui-view>
| <!-- htmlhint doctype-first:false -->
<div id="top-nav" class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<a href class="navbar-brand" ui-sref="home.map">FDA Food Recalls</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="alert alert-info">
<p>
This is a tool for reviewing FDA recalls on food products based on producing and
distribution states on a month by month basis. The tool was created as a
response to 18F's RFQ 4QTFHS150004.
</p>
<p>
Use the criteria below to filter the results displayed on the map of the
United States. Click on a state to review the recalls affecting that state.
</p>
</div>
</div>
</div>
</div>
<ui-view></ui-view>
| Change status message at top of page to be inset of page and not edge to edge | Change status message at top of page to be inset of page and not edge to edge
| HTML | mit | StrictlyBusiness/fda-food-recalls,StrictlyBusiness/fda-food-recalls | html | ## Code Before:
<!-- htmlhint doctype-first:false -->
<div id="top-nav" class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<a href class="navbar-brand" ui-sref="home.map">FDA Food Recalls</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 alert alert-info">
<p>
This is a tool for reviewing FDA recalls on food products based on producing and
distribution states on a month by month basis. The tool was created as a
response to 18F's RFQ 4QTFHS150004.
</p>
<p>
Use the criteria below to filter the results displayed on the map of the
United States. Click on a state to review the recalls affecting that state.
</p>
</div>
</div>
</div>
<ui-view></ui-view>
## Instruction:
Change status message at top of page to be inset of page and not edge to edge
## Code After:
<!-- htmlhint doctype-first:false -->
<div id="top-nav" class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<a href class="navbar-brand" ui-sref="home.map">FDA Food Recalls</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<div class="alert alert-info">
<p>
This is a tool for reviewing FDA recalls on food products based on producing and
distribution states on a month by month basis. The tool was created as a
response to 18F's RFQ 4QTFHS150004.
</p>
<p>
Use the criteria below to filter the results displayed on the map of the
United States. Click on a state to review the recalls affecting that state.
</p>
</div>
</div>
</div>
</div>
<ui-view></ui-view>
| <!-- htmlhint doctype-first:false -->
<div id="top-nav" class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<a href class="navbar-brand" ui-sref="home.map">FDA Food Recalls</a>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
+ <div class="col-xs-12">
- <div class="col-xs-12 alert alert-info">
? ----------
+ <div class="alert alert-info">
? ++
- <p>
+ <p>
? ++
- This is a tool for reviewing FDA recalls on food products based on producing and
+ This is a tool for reviewing FDA recalls on food products based on producing and
? ++
- distribution states on a month by month basis. The tool was created as a
+ distribution states on a month by month basis. The tool was created as a
? ++
- response to 18F's RFQ 4QTFHS150004.
+ response to 18F's RFQ 4QTFHS150004.
? ++
- </p>
+ </p>
? ++
- <p>
+ <p>
? ++
- Use the criteria below to filter the results displayed on the map of the
+ Use the criteria below to filter the results displayed on the map of the
? ++
- United States. Click on a state to review the recalls affecting that state.
+ United States. Click on a state to review the recalls affecting that state.
? ++
- </p>
+ </p>
? ++
+ </div>
</div>
</div>
</div>
<ui-view></ui-view> | 22 | 0.758621 | 12 | 10 |
c2ebd0311d15ebc266971d0f9dbd90c6b4c46e56 | api.json | api.json | {
"version": "3.2.0",
"methods": [
"addStickerToSet",
"answerCallbackQuery",
"answerInlineQuery",
"answerPreCheckoutQuery",
"answerShippingQuery",
"createNewStickerSet",
"deleteChatPhoto",
"deleteMessage",
"deleteStickerFromSet",
"deleteWebhook",
"editMessageCaption",
"editMessageReplyMarkup",
"editMessageText",
"exportChatInviteLink",
"forwardMessage",
"getChat",
"getChatAdministrators",
"getChatMember",
"getChatMembersCount",
"getGameHighScores",
"getMe",
"getStickerSet",
"getUpdates",
"getUserProfilePhotos",
"getWebhookInfo",
"kickChatMember",
"leaveChat",
"pinChatMessage",
"promoteChatMember",
"restrictChatMember",
"sendAudio",
"sendChatAction",
"sendContact",
"sendDocument",
"sendGame",
"sendInvoice",
"sendLocation",
"sendMessage",
"sendPhoto",
"sendSticker",
"sendVenue",
"sendVideo",
"sendVideoNote",
"sendVoice",
"setChatDescription",
"setChatPhoto",
"setChatTitle",
"setGameScore",
"setStickerPositionInSet",
"setWebhook",
"unbanChatMember",
"unpinChatMessage",
"uploadStickerFile"
]
}
| {
"version": "3.4.0",
"methods": [
"addStickerToSet",
"answerCallbackQuery",
"answerInlineQuery",
"answerPreCheckoutQuery",
"answerShippingQuery",
"createNewStickerSet",
"deleteChatPhoto",
"deleteChatStickerSet",
"deleteMessage",
"deleteStickerFromSet",
"deleteWebhook",
"editMessageCaption",
"editMessageLiveLocation",
"editMessageReplyMarkup",
"editMessageText",
"exportChatInviteLink",
"forwardMessage",
"getChat",
"getChatAdministrators",
"getChatMember",
"getChatMembersCount",
"getGameHighScores",
"getMe",
"getStickerSet",
"getUpdates",
"getUserProfilePhotos",
"getWebhookInfo",
"kickChatMember",
"leaveChat",
"pinChatMessage",
"promoteChatMember",
"restrictChatMember",
"sendAudio",
"sendChatAction",
"sendContact",
"sendDocument",
"sendGame",
"sendInvoice",
"sendLocation",
"sendMessage",
"sendPhoto",
"sendSticker",
"sendVenue",
"sendVideo",
"sendVideoNote",
"sendVoice",
"setChatDescription",
"setChatPhoto",
"setChatStickerSet",
"setChatTitle",
"setGameScore",
"setStickerPositionInSet",
"setWebhook",
"stopMessageLiveLocation",
"unbanChatMember",
"unpinChatMessage",
"uploadStickerFile"
]
}
| Update to 3.4 version. 👷 | [API]: Update to 3.4 version. 👷
| JSON | mit | telekits/teleapi,nof1000/teleapi | json | ## Code Before:
{
"version": "3.2.0",
"methods": [
"addStickerToSet",
"answerCallbackQuery",
"answerInlineQuery",
"answerPreCheckoutQuery",
"answerShippingQuery",
"createNewStickerSet",
"deleteChatPhoto",
"deleteMessage",
"deleteStickerFromSet",
"deleteWebhook",
"editMessageCaption",
"editMessageReplyMarkup",
"editMessageText",
"exportChatInviteLink",
"forwardMessage",
"getChat",
"getChatAdministrators",
"getChatMember",
"getChatMembersCount",
"getGameHighScores",
"getMe",
"getStickerSet",
"getUpdates",
"getUserProfilePhotos",
"getWebhookInfo",
"kickChatMember",
"leaveChat",
"pinChatMessage",
"promoteChatMember",
"restrictChatMember",
"sendAudio",
"sendChatAction",
"sendContact",
"sendDocument",
"sendGame",
"sendInvoice",
"sendLocation",
"sendMessage",
"sendPhoto",
"sendSticker",
"sendVenue",
"sendVideo",
"sendVideoNote",
"sendVoice",
"setChatDescription",
"setChatPhoto",
"setChatTitle",
"setGameScore",
"setStickerPositionInSet",
"setWebhook",
"unbanChatMember",
"unpinChatMessage",
"uploadStickerFile"
]
}
## Instruction:
[API]: Update to 3.4 version. 👷
## Code After:
{
"version": "3.4.0",
"methods": [
"addStickerToSet",
"answerCallbackQuery",
"answerInlineQuery",
"answerPreCheckoutQuery",
"answerShippingQuery",
"createNewStickerSet",
"deleteChatPhoto",
"deleteChatStickerSet",
"deleteMessage",
"deleteStickerFromSet",
"deleteWebhook",
"editMessageCaption",
"editMessageLiveLocation",
"editMessageReplyMarkup",
"editMessageText",
"exportChatInviteLink",
"forwardMessage",
"getChat",
"getChatAdministrators",
"getChatMember",
"getChatMembersCount",
"getGameHighScores",
"getMe",
"getStickerSet",
"getUpdates",
"getUserProfilePhotos",
"getWebhookInfo",
"kickChatMember",
"leaveChat",
"pinChatMessage",
"promoteChatMember",
"restrictChatMember",
"sendAudio",
"sendChatAction",
"sendContact",
"sendDocument",
"sendGame",
"sendInvoice",
"sendLocation",
"sendMessage",
"sendPhoto",
"sendSticker",
"sendVenue",
"sendVideo",
"sendVideoNote",
"sendVoice",
"setChatDescription",
"setChatPhoto",
"setChatStickerSet",
"setChatTitle",
"setGameScore",
"setStickerPositionInSet",
"setWebhook",
"stopMessageLiveLocation",
"unbanChatMember",
"unpinChatMessage",
"uploadStickerFile"
]
}
| {
- "version": "3.2.0",
? ^
+ "version": "3.4.0",
? ^
"methods": [
"addStickerToSet",
"answerCallbackQuery",
"answerInlineQuery",
"answerPreCheckoutQuery",
"answerShippingQuery",
"createNewStickerSet",
"deleteChatPhoto",
+ "deleteChatStickerSet",
"deleteMessage",
"deleteStickerFromSet",
"deleteWebhook",
"editMessageCaption",
+ "editMessageLiveLocation",
"editMessageReplyMarkup",
"editMessageText",
"exportChatInviteLink",
"forwardMessage",
"getChat",
"getChatAdministrators",
"getChatMember",
"getChatMembersCount",
"getGameHighScores",
"getMe",
"getStickerSet",
"getUpdates",
"getUserProfilePhotos",
"getWebhookInfo",
"kickChatMember",
"leaveChat",
"pinChatMessage",
"promoteChatMember",
"restrictChatMember",
"sendAudio",
"sendChatAction",
"sendContact",
"sendDocument",
"sendGame",
"sendInvoice",
"sendLocation",
"sendMessage",
"sendPhoto",
"sendSticker",
"sendVenue",
"sendVideo",
"sendVideoNote",
"sendVoice",
"setChatDescription",
"setChatPhoto",
+ "setChatStickerSet",
"setChatTitle",
"setGameScore",
"setStickerPositionInSet",
"setWebhook",
+ "stopMessageLiveLocation",
"unbanChatMember",
"unpinChatMessage",
"uploadStickerFile"
]
} | 6 | 0.103448 | 5 | 1 |
0ca5a857940312ac7fd76955af64fe061b0856a0 | .travis.yml | .travis.yml | language: cpp
compiler:
- gcc
- clang
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- if [ "$CXX" == "clang++" ]; then sudo add-apt-repository -y 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main'; fi
- sudo apt-get update -qq
install:
- sudo apt-get install liblua5.1-dev libncurses-dev libboost-dev libz-dev
- if [ "$CXX" == "g++" ]; then sudo apt-get install g++-4.9; fi
- if [ "$CXX" == "g++" ]; then export CXX="g++-4.9"; fi
- if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated libstdc++-4.9-dev clang-3.5; fi
- if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.5"; fi
script: cmake . && make && make install
| language: cpp
compiler:
- gcc
- clang
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- if [ "$CXX" == "clang++" ]; then sudo add-apt-repository -y 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main'; fi
- sudo apt-get update -qq
install:
- sudo apt-get install liblua5.1-dev lua5.1 libncurses-dev libboost-dev libz-dev
- if [ "$CXX" == "g++" ]; then sudo apt-get install g++-4.9; fi
- if [ "$CXX" == "g++" ]; then export CXX="g++-4.9"; fi
- if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated libstdc++-4.9-dev clang-3.5; fi
- if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.5"; fi
script:
- cmake . && make && make install
- echo "os.exit()" | lua -l color_coded
| Test if lua can load the library | Test if lua can load the library
In addition to compiling the library file, we can also check if lua can
load it. This may reveal linker errors such as undefined references.
| YAML | mit | tushar2708/color_coded,jeaye/color_coded,tony/color_coded,Hexcles/color_coded,jeaye/color_coded,tony/color_coded,UnrealQuester/color_coded,Hexcles/color_coded,Hexcles/color_coded,UnrealQuester/color_coded,UnrealQuester/color_coded,tony/color_coded,tushar2708/color_coded,jeaye/color_coded,tushar2708/color_coded,tony/color_coded,UnrealQuester/color_coded,tushar2708/color_coded,jeaye/color_coded,Hexcles/color_coded | yaml | ## Code Before:
language: cpp
compiler:
- gcc
- clang
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- if [ "$CXX" == "clang++" ]; then sudo add-apt-repository -y 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main'; fi
- sudo apt-get update -qq
install:
- sudo apt-get install liblua5.1-dev libncurses-dev libboost-dev libz-dev
- if [ "$CXX" == "g++" ]; then sudo apt-get install g++-4.9; fi
- if [ "$CXX" == "g++" ]; then export CXX="g++-4.9"; fi
- if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated libstdc++-4.9-dev clang-3.5; fi
- if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.5"; fi
script: cmake . && make && make install
## Instruction:
Test if lua can load the library
In addition to compiling the library file, we can also check if lua can
load it. This may reveal linker errors such as undefined references.
## Code After:
language: cpp
compiler:
- gcc
- clang
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- if [ "$CXX" == "clang++" ]; then sudo add-apt-repository -y 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main'; fi
- sudo apt-get update -qq
install:
- sudo apt-get install liblua5.1-dev lua5.1 libncurses-dev libboost-dev libz-dev
- if [ "$CXX" == "g++" ]; then sudo apt-get install g++-4.9; fi
- if [ "$CXX" == "g++" ]; then export CXX="g++-4.9"; fi
- if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated libstdc++-4.9-dev clang-3.5; fi
- if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.5"; fi
script:
- cmake . && make && make install
- echo "os.exit()" | lua -l color_coded
| language: cpp
compiler:
- gcc
- clang
before_install:
- sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
- if [ "$CXX" == "clang++" ]; then sudo add-apt-repository -y 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.5 main'; fi
- sudo apt-get update -qq
install:
- - sudo apt-get install liblua5.1-dev libncurses-dev libboost-dev libz-dev
+ - sudo apt-get install liblua5.1-dev lua5.1 libncurses-dev libboost-dev libz-dev
? +++++++
- if [ "$CXX" == "g++" ]; then sudo apt-get install g++-4.9; fi
- if [ "$CXX" == "g++" ]; then export CXX="g++-4.9"; fi
- if [ "$CXX" == "clang++" ]; then sudo apt-get install --allow-unauthenticated libstdc++-4.9-dev clang-3.5; fi
- if [ "$CXX" == "clang++" ]; then export CXX="clang++-3.5"; fi
+ script:
- script: cmake . && make && make install
? ^^^^^^^
+ - cmake . && make && make install
? ^^^
+ - echo "os.exit()" | lua -l color_coded | 6 | 0.4 | 4 | 2 |
3dd695292838bc3a80bf83c77f837ce6c64e54e3 | README.md | README.md |
This project explores patterns and 3rd party webchat implementations. It implements prototypes which are copies of real pages and services on [GOV.UK](https://www.gov.uk), with added webchat support flows and call to actions.
Prior art: [webchat-prototype](https://github.com/alphagov/webchat-prototype)
## Building and running
This is based on the [GOV.UK prototype kit](https://github.com/alphagov/govuk_prototype_kit), so most instructions that apply to that work here too. In short:
```bash
git clone git@github.com:alphagov/webchat-alpha.git
cd webchat-alpha
npm i
npm start
open http://localhost:3000
```
Tested on node `v4.x` and `v6.x`, and npm `v3.x`.
|
This project is for doing user research around emails and text messages.
It implements prototypes which are copies of real pages and services on
[GOV.UK](https://www.gov.uk), with added email/text message flows and
call to actions, powered by the GOV.UK Notify API.
Based on: [webchat-prototype](https://github.com/alphagov/webchat-alpha)
## Building and running
This is based on the [GOV.UK prototype kit](https://github.com/alphagov/govuk_prototype_kit),
so most instructions that apply to that work here too. In short:
```bash
npm i
npm start
open http://localhost:3000
```
| Update readme to not talk about webchat | Update readme to not talk about webchat
| Markdown | mit | quis/notify-public-research-prototype,quis/notify-public-research-prototype,quis/notify-public-research-prototype | markdown | ## Code Before:
This project explores patterns and 3rd party webchat implementations. It implements prototypes which are copies of real pages and services on [GOV.UK](https://www.gov.uk), with added webchat support flows and call to actions.
Prior art: [webchat-prototype](https://github.com/alphagov/webchat-prototype)
## Building and running
This is based on the [GOV.UK prototype kit](https://github.com/alphagov/govuk_prototype_kit), so most instructions that apply to that work here too. In short:
```bash
git clone git@github.com:alphagov/webchat-alpha.git
cd webchat-alpha
npm i
npm start
open http://localhost:3000
```
Tested on node `v4.x` and `v6.x`, and npm `v3.x`.
## Instruction:
Update readme to not talk about webchat
## Code After:
This project is for doing user research around emails and text messages.
It implements prototypes which are copies of real pages and services on
[GOV.UK](https://www.gov.uk), with added email/text message flows and
call to actions, powered by the GOV.UK Notify API.
Based on: [webchat-prototype](https://github.com/alphagov/webchat-alpha)
## Building and running
This is based on the [GOV.UK prototype kit](https://github.com/alphagov/govuk_prototype_kit),
so most instructions that apply to that work here too. In short:
```bash
npm i
npm start
open http://localhost:3000
```
|
- This project explores patterns and 3rd party webchat implementations. It implements prototypes which are copies of real pages and services on [GOV.UK](https://www.gov.uk), with added webchat support flows and call to actions.
+ This project is for doing user research around emails and text messages.
+ It implements prototypes which are copies of real pages and services on
+ [GOV.UK](https://www.gov.uk), with added email/text message flows and
+ call to actions, powered by the GOV.UK Notify API.
- Prior art: [webchat-prototype](https://github.com/alphagov/webchat-prototype)
? ^^^ ^^^^^ ^^^^^^^^
+ Based on: [webchat-prototype](https://github.com/alphagov/webchat-alpha)
? ^^^^^^ ^ ++ ^^
## Building and running
- This is based on the [GOV.UK prototype kit](https://github.com/alphagov/govuk_prototype_kit), so most instructions that apply to that work here too. In short:
+ This is based on the [GOV.UK prototype kit](https://github.com/alphagov/govuk_prototype_kit),
+ so most instructions that apply to that work here too. In short:
```bash
- git clone git@github.com:alphagov/webchat-alpha.git
- cd webchat-alpha
npm i
npm start
open http://localhost:3000
```
-
- Tested on node `v4.x` and `v6.x`, and npm `v3.x`. | 14 | 0.777778 | 7 | 7 |
21c1afeccaf0b54740d4ec93293e24ffb91d9131 | config/database.yml | config/database.yml | default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
user: <%= ENV['POSTGRES_USER'] %>
host: <%= ENV['POSTGRES_HOST'] %>
password: <%= ENV['POSTGRES_PASSWORD'] %>
development:
<<: *default
database: operationcode_development
test:
<<: *default
database: operationcode_test
production:
<<: *default
host: <%= ENV['POSTGRES_HOST'].present? ? ENV['POSTGRES_HOST'] : 'operationcode-psql-postgresql' %>
user: <%= ENV['POSTGRES_USER'] %>
database: operationcode_production
password: <%= ENV['POSTGRES_PASSWORD'] %>
| default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
user: <%= ENV['POSTGRES_USER'] %>
host: <%= ENV['POSTGRES_HOST'] %>
password: <%= ENV['POSTGRES_PASSWORD'] %>
development:
<<: *default
database: operationcode_development
test:
<<: *default
database: operationcode_test
production:
<<: *default
host: <%= ENV['POSTGRES_HOST'].present? ? ENV['POSTGRES_HOST'] : 'operationcode-psql-postgresql' %>
database: operationcode_production
| Revert "add user and password values to prod" | Revert "add user and password values to prod"
| YAML | mit | OperationCode/operationcode_backend,OperationCode/operationcode_backend,OperationCode/operationcode_backend | yaml | ## Code Before:
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
user: <%= ENV['POSTGRES_USER'] %>
host: <%= ENV['POSTGRES_HOST'] %>
password: <%= ENV['POSTGRES_PASSWORD'] %>
development:
<<: *default
database: operationcode_development
test:
<<: *default
database: operationcode_test
production:
<<: *default
host: <%= ENV['POSTGRES_HOST'].present? ? ENV['POSTGRES_HOST'] : 'operationcode-psql-postgresql' %>
user: <%= ENV['POSTGRES_USER'] %>
database: operationcode_production
password: <%= ENV['POSTGRES_PASSWORD'] %>
## Instruction:
Revert "add user and password values to prod"
## Code After:
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
user: <%= ENV['POSTGRES_USER'] %>
host: <%= ENV['POSTGRES_HOST'] %>
password: <%= ENV['POSTGRES_PASSWORD'] %>
development:
<<: *default
database: operationcode_development
test:
<<: *default
database: operationcode_test
production:
<<: *default
host: <%= ENV['POSTGRES_HOST'].present? ? ENV['POSTGRES_HOST'] : 'operationcode-psql-postgresql' %>
database: operationcode_production
| default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
user: <%= ENV['POSTGRES_USER'] %>
host: <%= ENV['POSTGRES_HOST'] %>
password: <%= ENV['POSTGRES_PASSWORD'] %>
development:
<<: *default
database: operationcode_development
test:
<<: *default
database: operationcode_test
production:
<<: *default
host: <%= ENV['POSTGRES_HOST'].present? ? ENV['POSTGRES_HOST'] : 'operationcode-psql-postgresql' %>
- user: <%= ENV['POSTGRES_USER'] %>
database: operationcode_production
- password: <%= ENV['POSTGRES_PASSWORD'] %> | 2 | 0.083333 | 0 | 2 |
b379ecd03cf8faad81fc2b6e8beede28fa5fecc2 | src/cronstrue-i18n.ts | src/cronstrue-i18n.ts | import { ExpressionDescriptor } from "./expressionDescriptor"
import { allLocalesLoader } from "./i18n/allLocalesLoader"
ExpressionDescriptor.initialize(new allLocalesLoader());
export = ExpressionDescriptor;
| import { ExpressionDescriptor } from "./expressionDescriptor"
import { allLocalesLoader } from "./i18n/allLocalesLoader"
ExpressionDescriptor.initialize(new allLocalesLoader());
export default ExpressionDescriptor;
let toString = ExpressionDescriptor.toString;
export { toString };
| Use named export for 'toString' for i18n version | Use named export for 'toString' for i18n version
| TypeScript | mit | bradyholt/cRonstrue,bradyholt/cRonstrue | typescript | ## Code Before:
import { ExpressionDescriptor } from "./expressionDescriptor"
import { allLocalesLoader } from "./i18n/allLocalesLoader"
ExpressionDescriptor.initialize(new allLocalesLoader());
export = ExpressionDescriptor;
## Instruction:
Use named export for 'toString' for i18n version
## Code After:
import { ExpressionDescriptor } from "./expressionDescriptor"
import { allLocalesLoader } from "./i18n/allLocalesLoader"
ExpressionDescriptor.initialize(new allLocalesLoader());
export default ExpressionDescriptor;
let toString = ExpressionDescriptor.toString;
export { toString };
| import { ExpressionDescriptor } from "./expressionDescriptor"
import { allLocalesLoader } from "./i18n/allLocalesLoader"
ExpressionDescriptor.initialize(new allLocalesLoader());
+ export default ExpressionDescriptor;
- export = ExpressionDescriptor;
+ let toString = ExpressionDescriptor.toString;
+ export { toString };
+ | 5 | 0.833333 | 4 | 1 |
5bde41a567063ba0b17b996e0ef8a1f3e8294eed | src/models/rule.js | src/models/rule.js | 'use strict'
const ElectronConfig = require('electron-config')
const storage = new ElectronConfig()
const Rules = require('./rules')
class Rule {
constructor(key) {
this.key = key
}
exists() {
return storage.has(this.key)
}
retrieve() {
if (this.exists()) {
return storage.get(this.key)
}
return {}
}
store(value) {
storage.set(this.key, value)
Rules.addKey(this.key)
}
}
module.exports = Rule
| 'use strict'
const ElectronConfig = require('electron-config')
const storage = new ElectronConfig()
const Rules = require('./rules')
class Rule {
constructor(key) {
this.key = key
}
exists() {
return storage.has(this.key)
}
retrieve() {
if (this.exists()) {
return storage.get(this.key)
}
return {}
}
store(value) {
storage.set(this.key, value)
Rules.addKey(this.key)
}
delete() {
storage.delete(this.key)
Rules.deleteKey(this.key)
}
}
module.exports = Rule
| Add delete to Rule model | Add delete to Rule model
| JavaScript | mit | cheshire137/gh-notifications-snoozer,cheshire137/gh-notifications-snoozer | javascript | ## Code Before:
'use strict'
const ElectronConfig = require('electron-config')
const storage = new ElectronConfig()
const Rules = require('./rules')
class Rule {
constructor(key) {
this.key = key
}
exists() {
return storage.has(this.key)
}
retrieve() {
if (this.exists()) {
return storage.get(this.key)
}
return {}
}
store(value) {
storage.set(this.key, value)
Rules.addKey(this.key)
}
}
module.exports = Rule
## Instruction:
Add delete to Rule model
## Code After:
'use strict'
const ElectronConfig = require('electron-config')
const storage = new ElectronConfig()
const Rules = require('./rules')
class Rule {
constructor(key) {
this.key = key
}
exists() {
return storage.has(this.key)
}
retrieve() {
if (this.exists()) {
return storage.get(this.key)
}
return {}
}
store(value) {
storage.set(this.key, value)
Rules.addKey(this.key)
}
delete() {
storage.delete(this.key)
Rules.deleteKey(this.key)
}
}
module.exports = Rule
| 'use strict'
const ElectronConfig = require('electron-config')
const storage = new ElectronConfig()
const Rules = require('./rules')
class Rule {
constructor(key) {
this.key = key
}
exists() {
return storage.has(this.key)
}
retrieve() {
if (this.exists()) {
return storage.get(this.key)
}
return {}
}
store(value) {
storage.set(this.key, value)
Rules.addKey(this.key)
}
+
+ delete() {
+ storage.delete(this.key)
+ Rules.deleteKey(this.key)
+ }
}
module.exports = Rule | 5 | 0.172414 | 5 | 0 |
bc3abc363813433db504ea4b5ddfebc716232950 | lib/cloudflair/api/zone/custom_hostname.rb | lib/cloudflair/api/zone/custom_hostname.rb | require 'cloudflair/entity'
module Cloudflair
class CustomHostname
include Cloudflair::Entity
attr_reader :zone_id, :custom_hostname_id
deletable true
patchable_fields :ssl, :custom_origin_server
path 'zones/:zone_id/custom_hostnames/:custom_hostname_id'
def initialize(zone_id, custom_hostname_id)
@zone_id = zone_id
@custom_hostname_id = custom_hostname_id
end
end
end
| require 'cloudflair/entity'
module Cloudflair
class CustomHostname
include Cloudflair::Entity
attr_reader :zone_id, :custom_hostname_id
deletable true
patchable_fields :ssl, :custom_origin_server, :custom_metadata
path 'zones/:zone_id/custom_hostnames/:custom_hostname_id'
def initialize(zone_id, custom_hostname_id)
@zone_id = zone_id
@custom_hostname_id = custom_hostname_id
end
end
end
| Add custom_metadata as patchable field on custom hostname endpoint | Add custom_metadata as patchable field on custom hostname endpoint
| Ruby | mit | ninech/cloudflair,ninech/cloudflair | ruby | ## Code Before:
require 'cloudflair/entity'
module Cloudflair
class CustomHostname
include Cloudflair::Entity
attr_reader :zone_id, :custom_hostname_id
deletable true
patchable_fields :ssl, :custom_origin_server
path 'zones/:zone_id/custom_hostnames/:custom_hostname_id'
def initialize(zone_id, custom_hostname_id)
@zone_id = zone_id
@custom_hostname_id = custom_hostname_id
end
end
end
## Instruction:
Add custom_metadata as patchable field on custom hostname endpoint
## Code After:
require 'cloudflair/entity'
module Cloudflair
class CustomHostname
include Cloudflair::Entity
attr_reader :zone_id, :custom_hostname_id
deletable true
patchable_fields :ssl, :custom_origin_server, :custom_metadata
path 'zones/:zone_id/custom_hostnames/:custom_hostname_id'
def initialize(zone_id, custom_hostname_id)
@zone_id = zone_id
@custom_hostname_id = custom_hostname_id
end
end
end
| require 'cloudflair/entity'
module Cloudflair
class CustomHostname
include Cloudflair::Entity
attr_reader :zone_id, :custom_hostname_id
deletable true
- patchable_fields :ssl, :custom_origin_server
+ patchable_fields :ssl, :custom_origin_server, :custom_metadata
? ++++++++++++++++++
path 'zones/:zone_id/custom_hostnames/:custom_hostname_id'
def initialize(zone_id, custom_hostname_id)
@zone_id = zone_id
@custom_hostname_id = custom_hostname_id
end
end
end | 2 | 0.117647 | 1 | 1 |
54295bea1ee0c41826482b04d55ac973211c8d74 | test/generator/files/generate_cases_test.rb | test/generator/files/generate_cases_test.rb | require_relative '../../test_helper.rb'
module Generator
module Files
class GeneratorCasesTest < Minitest::Test
def test_available_returns_exercise_names
track_path = 'test/fixtures/xruby'
Dir.stub :glob, %w(/alpha_cases.rb hy_phen_ated_cases.rb) do
assert_equal %w(alpha hy-phen-ated), GeneratorCases.available(track_path)
end
end
def test_filename
exercise_name = 'two-parter'
assert_equal 'two_parter_cases', GeneratorCases.filename(exercise_name)
end
def test_class_name
assert_equal 'TwoParterCase', GeneratorCases.class_name('two-parter')
end
def test_source_filename
track_path = 'test/fixtures/xruby'
exercise_name = 'foo'
expected_filename = track_path + '/exercises/foo/.meta/generator/foo_cases.rb'
File.stub(:exist?, true) do
assert_equal(
expected_filename,
GeneratorCases.source_filename(track_path, exercise_name)
)
end
end
end
end
end
| require_relative '../../test_helper.rb'
module Generator
module Files
class GeneratorCasesTest < Minitest::Test
def test_available_returns_exercise_names
track_path = 'test/fixtures/xruby'
Dir.stub :glob, %w(/alpha_cases.rb hy_phen_ated_cases.rb) do
assert_equal %w(alpha hy-phen-ated), GeneratorCases.available(track_path)
end
end
def test_available_calls_glob_with_the_right_arguments
track_path = '/track'
expected_glob = "#{track_path}/exercises/*/.meta/generator/*_cases.rb"
mock_glob_call = Minitest::Mock.new
mock_glob_call.expect :call, [], [expected_glob, File::FNM_DOTMATCH]
Dir.stub :glob, mock_glob_call do
GeneratorCases.available(track_path)
end
mock_glob_call.verify
end
def test_filename
exercise_name = 'two-parter'
assert_equal 'two_parter_cases', GeneratorCases.filename(exercise_name)
end
def test_class_name
assert_equal 'TwoParterCase', GeneratorCases.class_name('two-parter')
end
def test_source_filename
track_path = 'test/fixtures/xruby'
exercise_name = 'foo'
expected_filename = track_path + '/exercises/foo/.meta/generator/foo_cases.rb'
File.stub(:exist?, true) do
assert_equal(
expected_filename,
GeneratorCases.source_filename(track_path, exercise_name)
)
end
end
end
end
end
| Test that glob is called with expected arguments | Test that glob is called with expected arguments
| Ruby | mit | exercism/xruby,Insti/exercism-ruby,NeimadTL/ruby,exercism/xruby,Insti/xruby,Insti/exercism-ruby,Insti/xruby,NeimadTL/ruby,Insti/exercism-ruby,NeimadTL/ruby | ruby | ## Code Before:
require_relative '../../test_helper.rb'
module Generator
module Files
class GeneratorCasesTest < Minitest::Test
def test_available_returns_exercise_names
track_path = 'test/fixtures/xruby'
Dir.stub :glob, %w(/alpha_cases.rb hy_phen_ated_cases.rb) do
assert_equal %w(alpha hy-phen-ated), GeneratorCases.available(track_path)
end
end
def test_filename
exercise_name = 'two-parter'
assert_equal 'two_parter_cases', GeneratorCases.filename(exercise_name)
end
def test_class_name
assert_equal 'TwoParterCase', GeneratorCases.class_name('two-parter')
end
def test_source_filename
track_path = 'test/fixtures/xruby'
exercise_name = 'foo'
expected_filename = track_path + '/exercises/foo/.meta/generator/foo_cases.rb'
File.stub(:exist?, true) do
assert_equal(
expected_filename,
GeneratorCases.source_filename(track_path, exercise_name)
)
end
end
end
end
end
## Instruction:
Test that glob is called with expected arguments
## Code After:
require_relative '../../test_helper.rb'
module Generator
module Files
class GeneratorCasesTest < Minitest::Test
def test_available_returns_exercise_names
track_path = 'test/fixtures/xruby'
Dir.stub :glob, %w(/alpha_cases.rb hy_phen_ated_cases.rb) do
assert_equal %w(alpha hy-phen-ated), GeneratorCases.available(track_path)
end
end
def test_available_calls_glob_with_the_right_arguments
track_path = '/track'
expected_glob = "#{track_path}/exercises/*/.meta/generator/*_cases.rb"
mock_glob_call = Minitest::Mock.new
mock_glob_call.expect :call, [], [expected_glob, File::FNM_DOTMATCH]
Dir.stub :glob, mock_glob_call do
GeneratorCases.available(track_path)
end
mock_glob_call.verify
end
def test_filename
exercise_name = 'two-parter'
assert_equal 'two_parter_cases', GeneratorCases.filename(exercise_name)
end
def test_class_name
assert_equal 'TwoParterCase', GeneratorCases.class_name('two-parter')
end
def test_source_filename
track_path = 'test/fixtures/xruby'
exercise_name = 'foo'
expected_filename = track_path + '/exercises/foo/.meta/generator/foo_cases.rb'
File.stub(:exist?, true) do
assert_equal(
expected_filename,
GeneratorCases.source_filename(track_path, exercise_name)
)
end
end
end
end
end
| require_relative '../../test_helper.rb'
module Generator
module Files
class GeneratorCasesTest < Minitest::Test
def test_available_returns_exercise_names
track_path = 'test/fixtures/xruby'
Dir.stub :glob, %w(/alpha_cases.rb hy_phen_ated_cases.rb) do
assert_equal %w(alpha hy-phen-ated), GeneratorCases.available(track_path)
end
+ end
+
+ def test_available_calls_glob_with_the_right_arguments
+ track_path = '/track'
+ expected_glob = "#{track_path}/exercises/*/.meta/generator/*_cases.rb"
+ mock_glob_call = Minitest::Mock.new
+ mock_glob_call.expect :call, [], [expected_glob, File::FNM_DOTMATCH]
+ Dir.stub :glob, mock_glob_call do
+ GeneratorCases.available(track_path)
+ end
+ mock_glob_call.verify
end
def test_filename
exercise_name = 'two-parter'
assert_equal 'two_parter_cases', GeneratorCases.filename(exercise_name)
end
def test_class_name
assert_equal 'TwoParterCase', GeneratorCases.class_name('two-parter')
end
def test_source_filename
track_path = 'test/fixtures/xruby'
exercise_name = 'foo'
expected_filename = track_path + '/exercises/foo/.meta/generator/foo_cases.rb'
File.stub(:exist?, true) do
assert_equal(
expected_filename,
GeneratorCases.source_filename(track_path, exercise_name)
)
end
end
end
end
end | 11 | 0.314286 | 11 | 0 |
517c4a814b13456fa4f00e7e68c7abf4d2def423 | tests/PingpongTestCase.php | tests/PingpongTestCase.php | <?php
abstract class PingpongTestCase extends \Pingpong\Testing\TestCase {
/**
* @return string
*/
public function getBasePath()
{
return realpath(__DIR__ . '/../fixture');
}
/**
* @return \Illuminate\Foundation\Application
*/
public function getApplication()
{
return $this->app;
}
/**
* @return \Illuminate\Foundation\Application
*/
public static function getLaravel()
{
return (new static)->getApplication();
}
protected function getPackageProviders()
{
return [
'Pingpong\Modules\ModulesServiceProvider',
'Pingpong\Modules\ModulesServiceProvider',
'Pingpong\Trusty\TrustyServiceProvider',
'Pingpong\Menus\MenusServiceProvider',
'Pingpong\Widget\WidgetServiceProvider',
'Pingpong\Themes\ThemesServiceProvider',
'Pingpong\Shortcode\ShortcodeServiceProvider',
'Pingpong\Oembed\OembedServiceProvider',
'Pingpong\Generators\Providers\ConsoleServiceProvider',
];
}
protected function getPackageAliases()
{
return [
'Module' => 'Pingpong\Modules\Facades\Module',
];
}
} | <?php
abstract class PingpongTestCase extends \Pingpong\Testing\TestCase {
/**
* @return string
*/
public function getBasePath()
{
return realpath(__DIR__ . '/../fixture');
}
/**
* @return \Illuminate\Foundation\Application
*/
public function getApplication()
{
return $this->app;
}
/**
* @return \Illuminate\Foundation\Application
*/
public static function getLaravel()
{
return (new static)->getApplication();
}
protected function getPackageProviders()
{
return [
'Pingpong\Modules\ModulesServiceProvider',
'Pingpong\Modules\ModulesServiceProvider',
'Pingpong\Trusty\TrustyServiceProvider',
'Pingpong\Menus\MenusServiceProvider',
'Pingpong\Widget\WidgetServiceProvider',
'Pingpong\Themes\ThemesServiceProvider',
'Pingpong\Shortcode\ShortcodeServiceProvider',
'Pingpong\Oembed\OembedServiceProvider',
'Pingpong\Generators\GeneratorsServiceProvider',
];
}
protected function getPackageAliases()
{
return [
'Module' => 'Pingpong\Modules\Facades\Module',
];
}
} | Fix service provider not found | Fix service provider not found
| PHP | bsd-3-clause | pingpong-labs/sky,pingpong-labs/sky,pingpong-labs/sky | php | ## Code Before:
<?php
abstract class PingpongTestCase extends \Pingpong\Testing\TestCase {
/**
* @return string
*/
public function getBasePath()
{
return realpath(__DIR__ . '/../fixture');
}
/**
* @return \Illuminate\Foundation\Application
*/
public function getApplication()
{
return $this->app;
}
/**
* @return \Illuminate\Foundation\Application
*/
public static function getLaravel()
{
return (new static)->getApplication();
}
protected function getPackageProviders()
{
return [
'Pingpong\Modules\ModulesServiceProvider',
'Pingpong\Modules\ModulesServiceProvider',
'Pingpong\Trusty\TrustyServiceProvider',
'Pingpong\Menus\MenusServiceProvider',
'Pingpong\Widget\WidgetServiceProvider',
'Pingpong\Themes\ThemesServiceProvider',
'Pingpong\Shortcode\ShortcodeServiceProvider',
'Pingpong\Oembed\OembedServiceProvider',
'Pingpong\Generators\Providers\ConsoleServiceProvider',
];
}
protected function getPackageAliases()
{
return [
'Module' => 'Pingpong\Modules\Facades\Module',
];
}
}
## Instruction:
Fix service provider not found
## Code After:
<?php
abstract class PingpongTestCase extends \Pingpong\Testing\TestCase {
/**
* @return string
*/
public function getBasePath()
{
return realpath(__DIR__ . '/../fixture');
}
/**
* @return \Illuminate\Foundation\Application
*/
public function getApplication()
{
return $this->app;
}
/**
* @return \Illuminate\Foundation\Application
*/
public static function getLaravel()
{
return (new static)->getApplication();
}
protected function getPackageProviders()
{
return [
'Pingpong\Modules\ModulesServiceProvider',
'Pingpong\Modules\ModulesServiceProvider',
'Pingpong\Trusty\TrustyServiceProvider',
'Pingpong\Menus\MenusServiceProvider',
'Pingpong\Widget\WidgetServiceProvider',
'Pingpong\Themes\ThemesServiceProvider',
'Pingpong\Shortcode\ShortcodeServiceProvider',
'Pingpong\Oembed\OembedServiceProvider',
'Pingpong\Generators\GeneratorsServiceProvider',
];
}
protected function getPackageAliases()
{
return [
'Module' => 'Pingpong\Modules\Facades\Module',
];
}
} | <?php
abstract class PingpongTestCase extends \Pingpong\Testing\TestCase {
/**
* @return string
*/
public function getBasePath()
{
return realpath(__DIR__ . '/../fixture');
}
/**
* @return \Illuminate\Foundation\Application
*/
public function getApplication()
{
return $this->app;
}
/**
* @return \Illuminate\Foundation\Application
*/
public static function getLaravel()
{
return (new static)->getApplication();
}
protected function getPackageProviders()
{
return [
'Pingpong\Modules\ModulesServiceProvider',
'Pingpong\Modules\ModulesServiceProvider',
'Pingpong\Trusty\TrustyServiceProvider',
'Pingpong\Menus\MenusServiceProvider',
'Pingpong\Widget\WidgetServiceProvider',
'Pingpong\Themes\ThemesServiceProvider',
'Pingpong\Shortcode\ShortcodeServiceProvider',
'Pingpong\Oembed\OembedServiceProvider',
- 'Pingpong\Generators\Providers\ConsoleServiceProvider',
? ^^^^^^ --------
+ 'Pingpong\Generators\GeneratorsServiceProvider',
? ^^^ ++++
];
}
protected function getPackageAliases()
{
return [
'Module' => 'Pingpong\Modules\Facades\Module',
];
}
} | 2 | 0.038462 | 1 | 1 |
0575b4345fc21ca537a95866ff2a24d25128c698 | readthedocs/config/find.py | readthedocs/config/find.py | """Helper functions to search files."""
from __future__ import division, print_function, unicode_literals
import os
import re
def find_all(path, filename_regex):
"""Find all files in ``path`` that match ``filename_regex`` regex."""
path = os.path.abspath(path)
for root, dirs, files in os.walk(path, topdown=True):
dirs.sort()
for filename in files:
if re.match(filename_regex, filename):
yield os.path.abspath(os.path.join(root, filename))
def find_one(path, filename_regex):
"""Find the first file in ``path`` that match ``filename_regex`` regex."""
for _path in find_all(path, filename_regex):
return _path
return ''
| """Helper functions to search files."""
from __future__ import division, print_function, unicode_literals
import os
import re
def find_one(path, filename_regex):
"""Find the first file in ``path`` that match ``filename_regex`` regex."""
_path = os.path.abspath(path)
for filename in os.listdir(_path):
if re.match(filename_regex, filename):
return os.path.join(_path, filename)
return ''
| Remove logic for iterating directories to search for config file | Remove logic for iterating directories to search for config file
| Python | mit | rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org | python | ## Code Before:
"""Helper functions to search files."""
from __future__ import division, print_function, unicode_literals
import os
import re
def find_all(path, filename_regex):
"""Find all files in ``path`` that match ``filename_regex`` regex."""
path = os.path.abspath(path)
for root, dirs, files in os.walk(path, topdown=True):
dirs.sort()
for filename in files:
if re.match(filename_regex, filename):
yield os.path.abspath(os.path.join(root, filename))
def find_one(path, filename_regex):
"""Find the first file in ``path`` that match ``filename_regex`` regex."""
for _path in find_all(path, filename_regex):
return _path
return ''
## Instruction:
Remove logic for iterating directories to search for config file
## Code After:
"""Helper functions to search files."""
from __future__ import division, print_function, unicode_literals
import os
import re
def find_one(path, filename_regex):
"""Find the first file in ``path`` that match ``filename_regex`` regex."""
_path = os.path.abspath(path)
for filename in os.listdir(_path):
if re.match(filename_regex, filename):
return os.path.join(_path, filename)
return ''
| """Helper functions to search files."""
from __future__ import division, print_function, unicode_literals
import os
import re
- def find_all(path, filename_regex):
- """Find all files in ``path`` that match ``filename_regex`` regex."""
- path = os.path.abspath(path)
- for root, dirs, files in os.walk(path, topdown=True):
- dirs.sort()
- for filename in files:
- if re.match(filename_regex, filename):
- yield os.path.abspath(os.path.join(root, filename))
-
-
def find_one(path, filename_regex):
"""Find the first file in ``path`` that match ``filename_regex`` regex."""
- for _path in find_all(path, filename_regex):
- return _path
+ _path = os.path.abspath(path)
+ for filename in os.listdir(_path):
+ if re.match(filename_regex, filename):
+ return os.path.join(_path, filename)
+
return '' | 17 | 0.73913 | 5 | 12 |
d49ec1f41fdab63036c83fead714af9408e683ae | lib/secret_santa.rb | lib/secret_santa.rb | class SecretSanta
def self.create_list(names)
if names.length <= 2
"ERROR: List too short"
elsif names.length != names.uniq.length
"ERROR: Please enter unique names"
else
# shuffle names and build lists
list = []
digraph_list = []
names.shuffle!
names.each_with_index do |name, i|
list << "#{name} -> #{names[i - 1]}"
end
# write the list to a graphviz dot file
digraph_list = list.join("; ")
digraph = "digraph {#{digraph_list}}\n"
File.open("#{Time.now.year}_secret_santa_list.dot", 'w') { |f| f.write("#{digraph}") }
# return the list
puts "\n#{Time.now.year} Secret Santa List:"
list
end
end
def self.solicit_input
puts "Enter each name in the Secret Santa pool, separated by a space:"
names = gets.downcase.chomp
create_list(names.split(" "))
end
end
| class SecretSanta
# Create the Secret Santa list
def self.create_list(names)
if names.length <= 2
"ERROR: List too short"
elsif names.length != names.uniq.length
"ERROR: Please enter unique names"
else
# Build the list
list = []
digraph_list = []
names.shuffle!
names.each_with_index do |name, i|
list << "#{name} -> #{names[i - 1]}"
end
# Write the list to a graphviz dot file
digraph_list = list.join("; ")
digraph = "digraph {#{digraph_list}}\n"
File.open("#{Time.now.year}_secret_santa_list.dot", 'w') { |f| f.write("#{digraph}") }
# Return the list
puts "\n#{Time.now.year} Secret Santa List:"
puts list
"\nList saved to #{Time.now.year}_secret_santa_list.png"
end
end
# Get Secret Santa names and handle
def self.solicit_input
puts "Enter each name in the Secret Santa pool, separated by a space:"
names = gets.downcase.chomp
create_list(names.split(" "))
end
end
| Add better comments and messages | Add better comments and messages
| Ruby | mit | jwworth/secret_santa | ruby | ## Code Before:
class SecretSanta
def self.create_list(names)
if names.length <= 2
"ERROR: List too short"
elsif names.length != names.uniq.length
"ERROR: Please enter unique names"
else
# shuffle names and build lists
list = []
digraph_list = []
names.shuffle!
names.each_with_index do |name, i|
list << "#{name} -> #{names[i - 1]}"
end
# write the list to a graphviz dot file
digraph_list = list.join("; ")
digraph = "digraph {#{digraph_list}}\n"
File.open("#{Time.now.year}_secret_santa_list.dot", 'w') { |f| f.write("#{digraph}") }
# return the list
puts "\n#{Time.now.year} Secret Santa List:"
list
end
end
def self.solicit_input
puts "Enter each name in the Secret Santa pool, separated by a space:"
names = gets.downcase.chomp
create_list(names.split(" "))
end
end
## Instruction:
Add better comments and messages
## Code After:
class SecretSanta
# Create the Secret Santa list
def self.create_list(names)
if names.length <= 2
"ERROR: List too short"
elsif names.length != names.uniq.length
"ERROR: Please enter unique names"
else
# Build the list
list = []
digraph_list = []
names.shuffle!
names.each_with_index do |name, i|
list << "#{name} -> #{names[i - 1]}"
end
# Write the list to a graphviz dot file
digraph_list = list.join("; ")
digraph = "digraph {#{digraph_list}}\n"
File.open("#{Time.now.year}_secret_santa_list.dot", 'w') { |f| f.write("#{digraph}") }
# Return the list
puts "\n#{Time.now.year} Secret Santa List:"
puts list
"\nList saved to #{Time.now.year}_secret_santa_list.png"
end
end
# Get Secret Santa names and handle
def self.solicit_input
puts "Enter each name in the Secret Santa pool, separated by a space:"
names = gets.downcase.chomp
create_list(names.split(" "))
end
end
| class SecretSanta
+ # Create the Secret Santa list
def self.create_list(names)
if names.length <= 2
"ERROR: List too short"
elsif names.length != names.uniq.length
"ERROR: Please enter unique names"
else
- # shuffle names and build lists
+ # Build the list
list = []
digraph_list = []
names.shuffle!
names.each_with_index do |name, i|
list << "#{name} -> #{names[i - 1]}"
end
- # write the list to a graphviz dot file
? ^
+ # Write the list to a graphviz dot file
? ^
digraph_list = list.join("; ")
digraph = "digraph {#{digraph_list}}\n"
File.open("#{Time.now.year}_secret_santa_list.dot", 'w') { |f| f.write("#{digraph}") }
- # return the list
? ^
+ # Return the list
? ^
puts "\n#{Time.now.year} Secret Santa List:"
- list
+ puts list
? +++++
+ "\nList saved to #{Time.now.year}_secret_santa_list.png"
end
end
+ # Get Secret Santa names and handle
def self.solicit_input
puts "Enter each name in the Secret Santa pool, separated by a space:"
names = gets.downcase.chomp
create_list(names.split(" "))
end
end | 11 | 0.366667 | 7 | 4 |
ff4fce75ccd9b85519cc71db2c09f33191506526 | loritta-discord/src/main/java/net/perfectdreams/loritta/commands/vanilla/misc/DiscordBotListStatusCommand.kt | loritta-discord/src/main/java/net/perfectdreams/loritta/commands/vanilla/misc/DiscordBotListStatusCommand.kt | package net.perfectdreams.loritta.commands.vanilla.misc
import net.perfectdreams.loritta.api.commands.CommandCategory
import net.perfectdreams.loritta.api.messages.LorittaReply
import net.perfectdreams.loritta.platform.discord.LorittaDiscord
import net.perfectdreams.loritta.platform.discord.commands.DiscordAbstractCommandBase
import net.perfectdreams.loritta.tables.BotVotes
import org.jetbrains.exposed.sql.select
class DiscordBotListStatusCommand(loritta: LorittaDiscord): DiscordAbstractCommandBase(loritta, listOf("dbl status", "upvote status"), CommandCategory.MISC) {
companion object {
private const val LOCALE_PREFIX = "commands.command.dblstatus"
}
override fun command() = create {
localizedDescription("$LOCALE_PREFIX.description")
executesDiscord {
val context = this
val votes = loritta.newSuspendedTransaction {
BotVotes.select { BotVotes.userId eq context.user.idLong }.count()
}
context.reply(
LorittaReply(
locale["$LOCALE_PREFIX.youVoted", votes]
)
)
}
}
} | package net.perfectdreams.loritta.commands.vanilla.misc
import net.perfectdreams.loritta.api.commands.CommandCategory
import net.perfectdreams.loritta.api.messages.LorittaReply
import net.perfectdreams.loritta.platform.discord.LorittaDiscord
import net.perfectdreams.loritta.platform.discord.commands.DiscordAbstractCommandBase
import net.perfectdreams.loritta.tables.BotVotes
import org.jetbrains.exposed.sql.select
class DiscordBotListStatusCommand(loritta: LorittaDiscord): DiscordAbstractCommandBase(loritta, listOf("dbl status", "upvote status"), CommandCategory.MISC) {
companion object {
private const val LOCALE_PREFIX = "commands.command.dblstatus"
}
override fun command() = create {
localizedDescription("$LOCALE_PREFIX.description")
executesDiscord {
val user = user(0) ?: this.message.author
val votes = loritta.newSuspendedTransaction {
BotVotes.select { BotVotes.userId eq user.id }.count()
}
if (user == this.message.author) {
reply(
LorittaReply(
locale["$LOCALE_PREFIX.youVoted", votes]
)
)
} else {
reply(
LorittaReply(
locale["$LOCALE_PREFIX.userVoted", user, votes]
)
)
}
}
}
} | Allow looking up other users top.gg vote count | Allow looking up other users top.gg vote count
| Kotlin | agpl-3.0 | LorittaBot/Loritta,LorittaBot/Loritta,LorittaBot/Loritta,LorittaBot/Loritta | kotlin | ## Code Before:
package net.perfectdreams.loritta.commands.vanilla.misc
import net.perfectdreams.loritta.api.commands.CommandCategory
import net.perfectdreams.loritta.api.messages.LorittaReply
import net.perfectdreams.loritta.platform.discord.LorittaDiscord
import net.perfectdreams.loritta.platform.discord.commands.DiscordAbstractCommandBase
import net.perfectdreams.loritta.tables.BotVotes
import org.jetbrains.exposed.sql.select
class DiscordBotListStatusCommand(loritta: LorittaDiscord): DiscordAbstractCommandBase(loritta, listOf("dbl status", "upvote status"), CommandCategory.MISC) {
companion object {
private const val LOCALE_PREFIX = "commands.command.dblstatus"
}
override fun command() = create {
localizedDescription("$LOCALE_PREFIX.description")
executesDiscord {
val context = this
val votes = loritta.newSuspendedTransaction {
BotVotes.select { BotVotes.userId eq context.user.idLong }.count()
}
context.reply(
LorittaReply(
locale["$LOCALE_PREFIX.youVoted", votes]
)
)
}
}
}
## Instruction:
Allow looking up other users top.gg vote count
## Code After:
package net.perfectdreams.loritta.commands.vanilla.misc
import net.perfectdreams.loritta.api.commands.CommandCategory
import net.perfectdreams.loritta.api.messages.LorittaReply
import net.perfectdreams.loritta.platform.discord.LorittaDiscord
import net.perfectdreams.loritta.platform.discord.commands.DiscordAbstractCommandBase
import net.perfectdreams.loritta.tables.BotVotes
import org.jetbrains.exposed.sql.select
class DiscordBotListStatusCommand(loritta: LorittaDiscord): DiscordAbstractCommandBase(loritta, listOf("dbl status", "upvote status"), CommandCategory.MISC) {
companion object {
private const val LOCALE_PREFIX = "commands.command.dblstatus"
}
override fun command() = create {
localizedDescription("$LOCALE_PREFIX.description")
executesDiscord {
val user = user(0) ?: this.message.author
val votes = loritta.newSuspendedTransaction {
BotVotes.select { BotVotes.userId eq user.id }.count()
}
if (user == this.message.author) {
reply(
LorittaReply(
locale["$LOCALE_PREFIX.youVoted", votes]
)
)
} else {
reply(
LorittaReply(
locale["$LOCALE_PREFIX.userVoted", user, votes]
)
)
}
}
}
} | package net.perfectdreams.loritta.commands.vanilla.misc
import net.perfectdreams.loritta.api.commands.CommandCategory
import net.perfectdreams.loritta.api.messages.LorittaReply
import net.perfectdreams.loritta.platform.discord.LorittaDiscord
import net.perfectdreams.loritta.platform.discord.commands.DiscordAbstractCommandBase
import net.perfectdreams.loritta.tables.BotVotes
import org.jetbrains.exposed.sql.select
class DiscordBotListStatusCommand(loritta: LorittaDiscord): DiscordAbstractCommandBase(loritta, listOf("dbl status", "upvote status"), CommandCategory.MISC) {
companion object {
private const val LOCALE_PREFIX = "commands.command.dblstatus"
}
override fun command() = create {
localizedDescription("$LOCALE_PREFIX.description")
executesDiscord {
+ val user = user(0) ?: this.message.author
-
- val context = this
val votes = loritta.newSuspendedTransaction {
- BotVotes.select { BotVotes.userId eq context.user.idLong }.count()
? -------- ----
+ BotVotes.select { BotVotes.userId eq user.id }.count()
}
+ if (user == this.message.author) {
- context.reply(
? ^^^^^^^^
+ reply(
? ^^^^
- LorittaReply(
+ LorittaReply(
? ++++
- locale["$LOCALE_PREFIX.youVoted", votes]
+ locale["$LOCALE_PREFIX.youVoted", votes]
? ++++
+ )
)
+ } else {
+ reply(
+ LorittaReply(
+ locale["$LOCALE_PREFIX.userVoted", user, votes]
+ )
+ )
- )
? ^
+ }
? ^
}
}
} | 21 | 0.636364 | 14 | 7 |
7d60b0e20d4e93336cadb941e121fa2716194445 | .travis.yml | .travis.yml | language: ruby
rvm:
- '2.1.2'
- '2.1.1'
- '2.1.0'
- '2.0.0'
- '1.9.3'
gemfile:
- gemfiles/rails_3.2.21.gemfile
- gemfiles/rails_4.0.12.gemfile
- gemfiles/rails_4.1.8.gemfile
- gemfiles/rails_4.2.0.rc1.gemfile
addons:
postgresql: '9.3'
before_script:
- psql -c 'create database travis_ci_test;' -U postgres
- cp spec/dummy/config/database.travis.yml spec/dummy/config/database.yml
script: 'bundle exec rspec spec'
| language: ruby
rvm:
- '2.1.2'
- '2.1.1'
- '2.1.0'
- '2.0.0'
- '1.9.3'
gemfile:
- gemfiles/rails_3.2.21.gemfile
- gemfiles/rails_4.0.12.gemfile
- gemfiles/rails_4.1.8.gemfile
- gemfiles/rails_4.2.0.rc1.gemfile
addons:
postgresql: '9.3'
before_script:
- psql -c 'create database travis_ci_test;' -U postgres
- cd spec/dummy/
- cp config/database.travis.yml config/database.yml
- bundle exec rake db:schema:load
- cd ../../
script: 'bundle exec rspec spec'
| Load and prepare DB before test | Load and prepare DB before test
The bin/rake db:migrate task runs the migrations and then dumps the
structure of the database to a file called db/schema.rb. This structure
allows you to restore your database using the bin/rake db:schema:load
task if you wish, which is better than running all the migrations on a
large project again!
Source:
http://www.42.mach7x.com/2013/10/03/dbmigrate-or-dbschemaload-for-rails-
project-with-many-migations/
| YAML | mit | itsmrwave/annotator_store-gem,itsmrwave/annotator_store-gem | yaml | ## Code Before:
language: ruby
rvm:
- '2.1.2'
- '2.1.1'
- '2.1.0'
- '2.0.0'
- '1.9.3'
gemfile:
- gemfiles/rails_3.2.21.gemfile
- gemfiles/rails_4.0.12.gemfile
- gemfiles/rails_4.1.8.gemfile
- gemfiles/rails_4.2.0.rc1.gemfile
addons:
postgresql: '9.3'
before_script:
- psql -c 'create database travis_ci_test;' -U postgres
- cp spec/dummy/config/database.travis.yml spec/dummy/config/database.yml
script: 'bundle exec rspec spec'
## Instruction:
Load and prepare DB before test
The bin/rake db:migrate task runs the migrations and then dumps the
structure of the database to a file called db/schema.rb. This structure
allows you to restore your database using the bin/rake db:schema:load
task if you wish, which is better than running all the migrations on a
large project again!
Source:
http://www.42.mach7x.com/2013/10/03/dbmigrate-or-dbschemaload-for-rails-
project-with-many-migations/
## Code After:
language: ruby
rvm:
- '2.1.2'
- '2.1.1'
- '2.1.0'
- '2.0.0'
- '1.9.3'
gemfile:
- gemfiles/rails_3.2.21.gemfile
- gemfiles/rails_4.0.12.gemfile
- gemfiles/rails_4.1.8.gemfile
- gemfiles/rails_4.2.0.rc1.gemfile
addons:
postgresql: '9.3'
before_script:
- psql -c 'create database travis_ci_test;' -U postgres
- cd spec/dummy/
- cp config/database.travis.yml config/database.yml
- bundle exec rake db:schema:load
- cd ../../
script: 'bundle exec rspec spec'
| language: ruby
rvm:
- '2.1.2'
- '2.1.1'
- '2.1.0'
- '2.0.0'
- '1.9.3'
gemfile:
- gemfiles/rails_3.2.21.gemfile
- gemfiles/rails_4.0.12.gemfile
- gemfiles/rails_4.1.8.gemfile
- gemfiles/rails_4.2.0.rc1.gemfile
addons:
postgresql: '9.3'
before_script:
- psql -c 'create database travis_ci_test;' -U postgres
+ - cd spec/dummy/
- - cp spec/dummy/config/database.travis.yml spec/dummy/config/database.yml
? ----------- -----------
+ - cp config/database.travis.yml config/database.yml
+ - bundle exec rake db:schema:load
+ - cd ../../
script: 'bundle exec rspec spec' | 5 | 0.277778 | 4 | 1 |
cb13ef44219720ff006f4dd26b7ee6deb70c063d | dot-install.sh | dot-install.sh |
FILES=( bashrc bash_profile vimrc tmux.conf gitconfig sqliterc )
# This function takes a filename (without the preceding .) and backs
# it up before installing a symbolic link to the repository version
function backup_and_install {
echo "Installing $1..."
if [ -f "$HOME/.$1" ]; then
# If it's a link just delete it
if [ -h "$HOME/.$1" ]; then
rm -f $HOME/.$1
else
mv $HOME/.$1 $HOME/.dotfiles/system-originals/$1
fi
fi
ln -s $HOME/.dotfiles/$1 $HOME/.$1
}
for DOTFILE in ${FILES[@]}; do
backup_and_install $DOTFILE
done
# Start using the new profile :)
source $HOME/.bash_profile
|
FILES=( bashrc bash_profile vimrc tmux.conf gitconfig sqliterc )
# This function takes a filename (without the preceding .) and backs
# it up before installing a symbolic link to the repository version
function backup_and_install {
echo "Installing $1..."
if [ -f "$HOME/.$1" ]; then
# If it's a link just delete it
if [ -h "$HOME/.$1" ]; then
rm -f $HOME/.$1
else
mv $HOME/.$1 $HOME/.dotfiles/system-originals/$1
fi
fi
ln -s $HOME/.dotfiles/$1 $HOME/.$1
}
for DOTFILE in ${FILES[@]}; do
backup_and_install $DOTFILE
done
# Mark the git file as untracked locally so we can make changes without
# affecting what's in the repo
pushd $HOME/.dotfiles/ > /dev/null
git update-index --assume-unchanged system-specific/git-user-info.sh
popd > /dev/null
# Start using the new profile :)
source $HOME/.bash_profile
| Update to not track git information file on install | Update to not track git information file on install
| Shell | mit | sstelfox/dotfiles,sstelfox/dotfiles | shell | ## Code Before:
FILES=( bashrc bash_profile vimrc tmux.conf gitconfig sqliterc )
# This function takes a filename (without the preceding .) and backs
# it up before installing a symbolic link to the repository version
function backup_and_install {
echo "Installing $1..."
if [ -f "$HOME/.$1" ]; then
# If it's a link just delete it
if [ -h "$HOME/.$1" ]; then
rm -f $HOME/.$1
else
mv $HOME/.$1 $HOME/.dotfiles/system-originals/$1
fi
fi
ln -s $HOME/.dotfiles/$1 $HOME/.$1
}
for DOTFILE in ${FILES[@]}; do
backup_and_install $DOTFILE
done
# Start using the new profile :)
source $HOME/.bash_profile
## Instruction:
Update to not track git information file on install
## Code After:
FILES=( bashrc bash_profile vimrc tmux.conf gitconfig sqliterc )
# This function takes a filename (without the preceding .) and backs
# it up before installing a symbolic link to the repository version
function backup_and_install {
echo "Installing $1..."
if [ -f "$HOME/.$1" ]; then
# If it's a link just delete it
if [ -h "$HOME/.$1" ]; then
rm -f $HOME/.$1
else
mv $HOME/.$1 $HOME/.dotfiles/system-originals/$1
fi
fi
ln -s $HOME/.dotfiles/$1 $HOME/.$1
}
for DOTFILE in ${FILES[@]}; do
backup_and_install $DOTFILE
done
# Mark the git file as untracked locally so we can make changes without
# affecting what's in the repo
pushd $HOME/.dotfiles/ > /dev/null
git update-index --assume-unchanged system-specific/git-user-info.sh
popd > /dev/null
# Start using the new profile :)
source $HOME/.bash_profile
|
FILES=( bashrc bash_profile vimrc tmux.conf gitconfig sqliterc )
# This function takes a filename (without the preceding .) and backs
# it up before installing a symbolic link to the repository version
function backup_and_install {
echo "Installing $1..."
if [ -f "$HOME/.$1" ]; then
# If it's a link just delete it
if [ -h "$HOME/.$1" ]; then
rm -f $HOME/.$1
else
mv $HOME/.$1 $HOME/.dotfiles/system-originals/$1
fi
fi
ln -s $HOME/.dotfiles/$1 $HOME/.$1
}
for DOTFILE in ${FILES[@]}; do
backup_and_install $DOTFILE
done
+ # Mark the git file as untracked locally so we can make changes without
+ # affecting what's in the repo
+ pushd $HOME/.dotfiles/ > /dev/null
+ git update-index --assume-unchanged system-specific/git-user-info.sh
+ popd > /dev/null
+
# Start using the new profile :)
source $HOME/.bash_profile | 6 | 0.230769 | 6 | 0 |
29537a2df3c8f07c1736a78bd78e1086bdb28179 | commands/silly_commands.js | commands/silly_commands.js |
module.exports = {
effify: (message, _, msg) => {
const effify = (str) => {
const dict = {
'á': 'a',
'é': 'e',
'í': 'i',
'ó': 'o',
'ú': 'u',
'ï': 'i',
'ü': 'u',
};
return str.replace(/[aeiouáéíóúü]/gi, char => (
`${char}f${dict[char.toLowerCase()] || char.toLowerCase()}`
));
};
message.channel.send(effify(msg));
},
};
|
module.exports = {
effify: (message, _, msg) => {
if (!msg) {
message.channel.send('Provide some text to effify.');
} else {
message.channel.send(effify(msg));
}
function effify(str) {
const dict = {
'á': 'a',
'é': 'e',
'í': 'i',
'ó': 'o',
'ú': 'u',
'ï': 'i',
'ü': 'u',
};
return str.replace(/[aeiouáéíóúü]/gi, char => (
`${char}f${dict[char.toLowerCase()] || char.toLowerCase()}`
));
}
},
};
| Make s.effify handle empty msg | Make s.effify handle empty msg
| JavaScript | mit | Rafer45/soup | javascript | ## Code Before:
module.exports = {
effify: (message, _, msg) => {
const effify = (str) => {
const dict = {
'á': 'a',
'é': 'e',
'í': 'i',
'ó': 'o',
'ú': 'u',
'ï': 'i',
'ü': 'u',
};
return str.replace(/[aeiouáéíóúü]/gi, char => (
`${char}f${dict[char.toLowerCase()] || char.toLowerCase()}`
));
};
message.channel.send(effify(msg));
},
};
## Instruction:
Make s.effify handle empty msg
## Code After:
module.exports = {
effify: (message, _, msg) => {
if (!msg) {
message.channel.send('Provide some text to effify.');
} else {
message.channel.send(effify(msg));
}
function effify(str) {
const dict = {
'á': 'a',
'é': 'e',
'í': 'i',
'ó': 'o',
'ú': 'u',
'ï': 'i',
'ü': 'u',
};
return str.replace(/[aeiouáéíóúü]/gi, char => (
`${char}f${dict[char.toLowerCase()] || char.toLowerCase()}`
));
}
},
};
|
module.exports = {
effify: (message, _, msg) => {
+ if (!msg) {
+ message.channel.send('Provide some text to effify.');
+ } else {
+ message.channel.send(effify(msg));
+ }
+
- const effify = (str) => {
? -- --- ---
+ function effify(str) {
? +++ ++
const dict = {
'á': 'a',
'é': 'e',
'í': 'i',
'ó': 'o',
'ú': 'u',
'ï': 'i',
'ü': 'u',
};
return str.replace(/[aeiouáéíóúü]/gi, char => (
`${char}f${dict[char.toLowerCase()] || char.toLowerCase()}`
));
- };
? -
+ }
-
- message.channel.send(effify(msg));
},
}; | 12 | 0.545455 | 8 | 4 |
a9c53bc97c0e62a959c1115ec61d0a28d71aac68 | devtools/ci/update-versions.py | devtools/ci/update-versions.py | from __future__ import print_function
import os
import boto
from boto.s3.key import Key
import msmbuilder.version
if msmbuilder.version.release:
# The secret key is available as a secure environment variable
# on travis-ci to push the build documentation to Amazon S3.
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
BUCKET_NAME = 'msmbuilder.org'
bucket_name = AWS_ACCESS_KEY_ID.lower() + '-' + BUCKET_NAME
conn = boto.connect_s3(AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY)
bucket = conn.get_bucket(BUCKET_NAME)
root = 'doc/_build'
versions = json.load(urllib2.urlopen('http://www.msmbuilder.org/versions.json'))
# new release so all the others are now old
for i in xrange(len(versions)):
versions[i]['latest'] = False
versions.append({'version' : msmbuilder.version.short_version, 'latest' : True})
k = Key(bucket)
k.key = 'versions.json'
k.set_contents_from_string(json.dumps(versions))
else:
print("This is not a release.")
| from __future__ import print_function
import os
import pip
import json
from tempfile import NamedTemporaryFile
import subprocess
from msmbuilder import version
from six.moves.urllib.request import urlopen
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
raise ImportError('The s3cmd pacakge is required. try $ pip install s3cmd')
URL = 'http://www.msmbuilder.org/versions.json'
BUCKET_NAME = 'msmbuilder.org'
if not version.release:
print("This is not a release.")
exit(0)
versions = json.load(urlopen(URL))
# new release so all the others are now old
for i in xrange(len(versions)):
versions[i]['latest'] = False
versions.append({
'version': version.short_version,
'latest': True})
# The secret key is available as a secure environment variable
# on travis-ci to push the build documentation to Amazon S3.
with NamedTemporaryFile('w') as config, NamedTemporaryFile('w') as v:
config.write('''[default]
access_key = {AWS_ACCESS_KEY_ID}
secret_key = {AWS_SECRET_ACCESS_KEY}
'''.format(**os.environ))
json.dump(versions, v)
config.flush()
v.flush()
template = ('s3cmd --config {config} '
'put {vfile} s3://{bucket}/versions.json')
cmd = template.format(
config=config.name,
vfile=v.name,
bucket=BUCKET_NAME)
subprocess.call(cmd.split())
| Fix script for updating version dropdown | Fix script for updating version dropdown
| Python | lgpl-2.1 | mpharrigan/mixtape,brookehus/msmbuilder,peastman/msmbuilder,peastman/msmbuilder,rafwiewiora/msmbuilder,dr-nate/msmbuilder,dr-nate/msmbuilder,msmbuilder/msmbuilder,peastman/msmbuilder,Eigenstate/msmbuilder,Eigenstate/msmbuilder,msultan/msmbuilder,msultan/msmbuilder,rmcgibbo/msmbuilder,msmbuilder/msmbuilder,msultan/msmbuilder,cxhernandez/msmbuilder,rmcgibbo/msmbuilder,Eigenstate/msmbuilder,stephenliu1989/msmbuilder,dotsdl/msmbuilder,peastman/msmbuilder,cxhernandez/msmbuilder,stephenliu1989/msmbuilder,rafwiewiora/msmbuilder,mpharrigan/mixtape,rafwiewiora/msmbuilder,brookehus/msmbuilder,rmcgibbo/msmbuilder,mpharrigan/mixtape,Eigenstate/msmbuilder,msultan/msmbuilder,cxhernandez/msmbuilder,cxhernandez/msmbuilder,peastman/msmbuilder,msmbuilder/msmbuilder,rafwiewiora/msmbuilder,dotsdl/msmbuilder,cxhernandez/msmbuilder,msultan/msmbuilder,brookehus/msmbuilder,dotsdl/msmbuilder,mpharrigan/mixtape,dotsdl/msmbuilder,rmcgibbo/msmbuilder,rafwiewiora/msmbuilder,stephenliu1989/msmbuilder,stephenliu1989/msmbuilder,msmbuilder/msmbuilder,dr-nate/msmbuilder,Eigenstate/msmbuilder,mpharrigan/mixtape,dr-nate/msmbuilder,brookehus/msmbuilder,dr-nate/msmbuilder,msmbuilder/msmbuilder,brookehus/msmbuilder | python | ## Code Before:
from __future__ import print_function
import os
import boto
from boto.s3.key import Key
import msmbuilder.version
if msmbuilder.version.release:
# The secret key is available as a secure environment variable
# on travis-ci to push the build documentation to Amazon S3.
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
BUCKET_NAME = 'msmbuilder.org'
bucket_name = AWS_ACCESS_KEY_ID.lower() + '-' + BUCKET_NAME
conn = boto.connect_s3(AWS_ACCESS_KEY_ID,
AWS_SECRET_ACCESS_KEY)
bucket = conn.get_bucket(BUCKET_NAME)
root = 'doc/_build'
versions = json.load(urllib2.urlopen('http://www.msmbuilder.org/versions.json'))
# new release so all the others are now old
for i in xrange(len(versions)):
versions[i]['latest'] = False
versions.append({'version' : msmbuilder.version.short_version, 'latest' : True})
k = Key(bucket)
k.key = 'versions.json'
k.set_contents_from_string(json.dumps(versions))
else:
print("This is not a release.")
## Instruction:
Fix script for updating version dropdown
## Code After:
from __future__ import print_function
import os
import pip
import json
from tempfile import NamedTemporaryFile
import subprocess
from msmbuilder import version
from six.moves.urllib.request import urlopen
if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
raise ImportError('The s3cmd pacakge is required. try $ pip install s3cmd')
URL = 'http://www.msmbuilder.org/versions.json'
BUCKET_NAME = 'msmbuilder.org'
if not version.release:
print("This is not a release.")
exit(0)
versions = json.load(urlopen(URL))
# new release so all the others are now old
for i in xrange(len(versions)):
versions[i]['latest'] = False
versions.append({
'version': version.short_version,
'latest': True})
# The secret key is available as a secure environment variable
# on travis-ci to push the build documentation to Amazon S3.
with NamedTemporaryFile('w') as config, NamedTemporaryFile('w') as v:
config.write('''[default]
access_key = {AWS_ACCESS_KEY_ID}
secret_key = {AWS_SECRET_ACCESS_KEY}
'''.format(**os.environ))
json.dump(versions, v)
config.flush()
v.flush()
template = ('s3cmd --config {config} '
'put {vfile} s3://{bucket}/versions.json')
cmd = template.format(
config=config.name,
vfile=v.name,
bucket=BUCKET_NAME)
subprocess.call(cmd.split())
| from __future__ import print_function
import os
- import boto
- from boto.s3.key import Key
- import msmbuilder.version
+ import pip
+ import json
+ from tempfile import NamedTemporaryFile
+ import subprocess
+ from msmbuilder import version
+ from six.moves.urllib.request import urlopen
+ if not any(d.project_name == 's3cmd' for d in pip.get_installed_distributions()):
+ raise ImportError('The s3cmd pacakge is required. try $ pip install s3cmd')
+ URL = 'http://www.msmbuilder.org/versions.json'
- if msmbuilder.version.release:
- # The secret key is available as a secure environment variable
- # on travis-ci to push the build documentation to Amazon S3.
- AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
- AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
- BUCKET_NAME = 'msmbuilder.org'
? ----
+ BUCKET_NAME = 'msmbuilder.org'
+ if not version.release:
+ print("This is not a release.")
+ exit(0)
- bucket_name = AWS_ACCESS_KEY_ID.lower() + '-' + BUCKET_NAME
- conn = boto.connect_s3(AWS_ACCESS_KEY_ID,
- AWS_SECRET_ACCESS_KEY)
- bucket = conn.get_bucket(BUCKET_NAME)
- root = 'doc/_build'
- versions = json.load(urllib2.urlopen('http://www.msmbuilder.org/versions.json'))
+ versions = json.load(urlopen(URL))
- # new release so all the others are now old
? ----
+ # new release so all the others are now old
- for i in xrange(len(versions)):
? ----
+ for i in xrange(len(versions)):
- versions[i]['latest'] = False
? ----
+ versions[i]['latest'] = False
- versions.append({'version' : msmbuilder.version.short_version, 'latest' : True})
+ versions.append({
+ 'version': version.short_version,
+ 'latest': True})
- k = Key(bucket)
- k.key = 'versions.json'
- k.set_contents_from_string(json.dumps(versions))
-
- else:
- print("This is not a release.")
+ # The secret key is available as a secure environment variable
+ # on travis-ci to push the build documentation to Amazon S3.
+ with NamedTemporaryFile('w') as config, NamedTemporaryFile('w') as v:
+ config.write('''[default]
+ access_key = {AWS_ACCESS_KEY_ID}
+ secret_key = {AWS_SECRET_ACCESS_KEY}
+ '''.format(**os.environ))
+ json.dump(versions, v)
+ config.flush()
+ v.flush()
+
+ template = ('s3cmd --config {config} '
+ 'put {vfile} s3://{bucket}/versions.json')
+ cmd = template.format(
+ config=config.name,
+ vfile=v.name,
+ bucket=BUCKET_NAME)
+ subprocess.call(cmd.split()) | 63 | 1.852941 | 38 | 25 |
57d00375936cee83a42a63a845d8fa3a489e5cca | init/test/unit.js | init/test/unit.js | describe('<%= name %>', function () {
});
| import version from '../src/version';
describe('<%= name %>', function () {
it('version', function () {
expect(version).to.be.a('string');
});
});
| Add initial test for version string. | Add initial test for version string.
| JavaScript | mit | skatejs/build,skatejs/build | javascript | ## Code Before:
describe('<%= name %>', function () {
});
## Instruction:
Add initial test for version string.
## Code After:
import version from '../src/version';
describe('<%= name %>', function () {
it('version', function () {
expect(version).to.be.a('string');
});
});
| + import version from '../src/version';
+
describe('<%= name %>', function () {
-
+ it('version', function () {
+ expect(version).to.be.a('string');
+ });
}); | 6 | 2 | 5 | 1 |
92345eedc8dd08d5c307a7c8d96f3091b108c178 | .travis.yml | .travis.yml | language: php
php:
- 5.3
- 5.4
before_script:
- pecl install memcached
script: cd ./tests && phpunit
| language: php
php:
- 5.3
- 5.4
before_script:
- wget http://pecl.php.net/get/memcache-2.2.6.tgz
- tar -xzf memcache-2.2.6.tgz
- sh -c "cd memcache-2.2.6 && phpize && ./configure --enable-memcache && make && sudo make install"
- echo "extension=memcache.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
script: cd ./tests && phpunit
| Install Memcache extension for automated build | Install Memcache extension for automated build
| YAML | mit | sgpatil/orientdb-php,jadell/neo4jphp,Vinelab/neo4jphp,markus-perl/neo4jphp,stevenmaguire/neo4jphp | yaml | ## Code Before:
language: php
php:
- 5.3
- 5.4
before_script:
- pecl install memcached
script: cd ./tests && phpunit
## Instruction:
Install Memcache extension for automated build
## Code After:
language: php
php:
- 5.3
- 5.4
before_script:
- wget http://pecl.php.net/get/memcache-2.2.6.tgz
- tar -xzf memcache-2.2.6.tgz
- sh -c "cd memcache-2.2.6 && phpize && ./configure --enable-memcache && make && sudo make install"
- echo "extension=memcache.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
script: cd ./tests && phpunit
| language: php
php:
- 5.3
- 5.4
before_script:
- - pecl install memcached
+ - wget http://pecl.php.net/get/memcache-2.2.6.tgz
+ - tar -xzf memcache-2.2.6.tgz
+ - sh -c "cd memcache-2.2.6 && phpize && ./configure --enable-memcache && make && sudo make install"
+ - echo "extension=memcache.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
script: cd ./tests && phpunit | 5 | 0.555556 | 4 | 1 |
41836cdf8cc377dd72e5e75cc387bf540c70bf01 | change-notes/1.20/analysis-python.md | change-notes/1.20/analysis-python.md |
## General improvements
> Changes that affect alerts in many files or from many queries
> For example, changes to file classification
## New queries
| **Query** | **Tags** | **Purpose** |
|-----------------------------|-----------|--------------------------------------------------------------------|
| Default version of SSL/TLS may be insecure (`py/insecure-default-protocol`) | security, external/cwe/cwe-327 | Results are shown on LGTM by default. |
| Use of insecure SSL/TLS version (`py/insecure-protocol`) | security, external/cwe/cwe-327 | Results are shown on LGTM by default. |
## Changes to existing queries
All taint-tracking queries now support visualization of paths in QL for Eclipse.
Most security alerts are now visible on LGTM by default.
| **Query** | **Expected impact** | **Change** |
|----------------------------|------------------------|------------------------------------------------------------------|
## Changes to code extraction
* *Series of bullet points*
## Changes to QL libraries
* *Series of bullet points*
|
## General improvements
> Changes that affect alerts in many files or from many queries
> For example, changes to file classification
## New queries
| **Query** | **Tags** | **Purpose** |
|-----------------------------|-----------|--------------------------------------------------------------------|
| Default version of SSL/TLS may be insecure (`py/insecure-default-protocol`) | security, external/cwe/cwe-327 | Finds instances where an insecure default protocol may be used. Results are shown on LGTM by default. |
| Use of insecure SSL/TLS version (`py/insecure-protocol`) | security, external/cwe/cwe-327 | Finds instances where a known insecure protocol has been specified. Results are shown on LGTM by default. |
## Changes to existing queries
| **Query** | **Expected impact** | **Change** |
|----------------------------|------------------------|------------------------------------------------------------------|
## Changes to code extraction
* *Series of bullet points*
## Changes to QL libraries
* *Series of bullet points*
| Add descriptions and remove leftovers from old change note. | Add descriptions and remove leftovers from old change note.
| Markdown | mit | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | markdown | ## Code Before:
## General improvements
> Changes that affect alerts in many files or from many queries
> For example, changes to file classification
## New queries
| **Query** | **Tags** | **Purpose** |
|-----------------------------|-----------|--------------------------------------------------------------------|
| Default version of SSL/TLS may be insecure (`py/insecure-default-protocol`) | security, external/cwe/cwe-327 | Results are shown on LGTM by default. |
| Use of insecure SSL/TLS version (`py/insecure-protocol`) | security, external/cwe/cwe-327 | Results are shown on LGTM by default. |
## Changes to existing queries
All taint-tracking queries now support visualization of paths in QL for Eclipse.
Most security alerts are now visible on LGTM by default.
| **Query** | **Expected impact** | **Change** |
|----------------------------|------------------------|------------------------------------------------------------------|
## Changes to code extraction
* *Series of bullet points*
## Changes to QL libraries
* *Series of bullet points*
## Instruction:
Add descriptions and remove leftovers from old change note.
## Code After:
## General improvements
> Changes that affect alerts in many files or from many queries
> For example, changes to file classification
## New queries
| **Query** | **Tags** | **Purpose** |
|-----------------------------|-----------|--------------------------------------------------------------------|
| Default version of SSL/TLS may be insecure (`py/insecure-default-protocol`) | security, external/cwe/cwe-327 | Finds instances where an insecure default protocol may be used. Results are shown on LGTM by default. |
| Use of insecure SSL/TLS version (`py/insecure-protocol`) | security, external/cwe/cwe-327 | Finds instances where a known insecure protocol has been specified. Results are shown on LGTM by default. |
## Changes to existing queries
| **Query** | **Expected impact** | **Change** |
|----------------------------|------------------------|------------------------------------------------------------------|
## Changes to code extraction
* *Series of bullet points*
## Changes to QL libraries
* *Series of bullet points*
|
## General improvements
> Changes that affect alerts in many files or from many queries
> For example, changes to file classification
## New queries
| **Query** | **Tags** | **Purpose** |
|-----------------------------|-----------|--------------------------------------------------------------------|
- | Default version of SSL/TLS may be insecure (`py/insecure-default-protocol`) | security, external/cwe/cwe-327 | Results are shown on LGTM by default. |
+ | Default version of SSL/TLS may be insecure (`py/insecure-default-protocol`) | security, external/cwe/cwe-327 | Finds instances where an insecure default protocol may be used. Results are shown on LGTM by default. |
? ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- | Use of insecure SSL/TLS version (`py/insecure-protocol`) | security, external/cwe/cwe-327 | Results are shown on LGTM by default. |
+ | Use of insecure SSL/TLS version (`py/insecure-protocol`) | security, external/cwe/cwe-327 | Finds instances where a known insecure protocol has been specified. Results are shown on LGTM by default. |
? ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Changes to existing queries
-
- All taint-tracking queries now support visualization of paths in QL for Eclipse.
- Most security alerts are now visible on LGTM by default.
| **Query** | **Expected impact** | **Change** |
|----------------------------|------------------------|------------------------------------------------------------------|
## Changes to code extraction
* *Series of bullet points*
## Changes to QL libraries
* *Series of bullet points* | 7 | 0.25 | 2 | 5 |
2a0e28ab7837a94b764ab2b360db0f60f34e4734 | trucking-topology/src/main/scala/com/orendainx/hortonworks/trucking/topology/nifi/ByteArrayToNiFiPacket.scala | trucking-topology/src/main/scala/com/orendainx/hortonworks/trucking/topology/nifi/ByteArrayToNiFiPacket.scala | package com.orendainx.hortonworks.trucking.topology.nifi
import com.typesafe.scalalogging.Logger
import org.apache.nifi.storm.{NiFiDataPacket, NiFiDataPacketBuilder, StandardNiFiDataPacket}
import org.apache.storm.tuple.Tuple
import scala.collection.JavaConverters._
/**
* @author Edgar Orendain <edgar@orendainx.com>
*/
class ByteArrayToNiFiPacket extends NiFiDataPacketBuilder with Serializable {
private lazy val logger = Logger(this.getClass)
override def createNiFiDataPacket(tuple: Tuple): NiFiDataPacket = {
val newAttributes = Map("processed" -> "true").asJava
new StandardNiFiDataPacket(tuple.getValueByField("data").asInstanceOf[Array[Byte]], newAttributes)
}
}
| package com.orendainx.hortonworks.trucking.topology.nifi
import com.typesafe.scalalogging.Logger
import org.apache.nifi.storm.{NiFiDataPacket, NiFiDataPacketBuilder, StandardNiFiDataPacket}
import org.apache.storm.tuple.Tuple
import scala.collection.JavaConverters._
/**
* @author Edgar Orendain <edgar@orendainx.com>
*/
class ByteArrayToNiFiPacket extends NiFiDataPacketBuilder with Serializable {
private lazy val logger = Logger(this.getClass)
override def createNiFiDataPacket(tuple: Tuple): NiFiDataPacket = {
val newAttributes = Map("processed" -> "true").asJava
new StandardNiFiDataPacket(tuple.getBinaryByField("data"), newAttributes)
}
}
| Change getStringByField to getBinaryByField, for retrieving an array of bytes | Change getStringByField to getBinaryByField, for retrieving an array of bytes
| Scala | apache-2.0 | orendain/trucking-iot,orendain/trucking-iot,orendain/trucking-iot,orendain/trucking-iot,orendain/trucking-iot | scala | ## Code Before:
package com.orendainx.hortonworks.trucking.topology.nifi
import com.typesafe.scalalogging.Logger
import org.apache.nifi.storm.{NiFiDataPacket, NiFiDataPacketBuilder, StandardNiFiDataPacket}
import org.apache.storm.tuple.Tuple
import scala.collection.JavaConverters._
/**
* @author Edgar Orendain <edgar@orendainx.com>
*/
class ByteArrayToNiFiPacket extends NiFiDataPacketBuilder with Serializable {
private lazy val logger = Logger(this.getClass)
override def createNiFiDataPacket(tuple: Tuple): NiFiDataPacket = {
val newAttributes = Map("processed" -> "true").asJava
new StandardNiFiDataPacket(tuple.getValueByField("data").asInstanceOf[Array[Byte]], newAttributes)
}
}
## Instruction:
Change getStringByField to getBinaryByField, for retrieving an array of bytes
## Code After:
package com.orendainx.hortonworks.trucking.topology.nifi
import com.typesafe.scalalogging.Logger
import org.apache.nifi.storm.{NiFiDataPacket, NiFiDataPacketBuilder, StandardNiFiDataPacket}
import org.apache.storm.tuple.Tuple
import scala.collection.JavaConverters._
/**
* @author Edgar Orendain <edgar@orendainx.com>
*/
class ByteArrayToNiFiPacket extends NiFiDataPacketBuilder with Serializable {
private lazy val logger = Logger(this.getClass)
override def createNiFiDataPacket(tuple: Tuple): NiFiDataPacket = {
val newAttributes = Map("processed" -> "true").asJava
new StandardNiFiDataPacket(tuple.getBinaryByField("data"), newAttributes)
}
}
| package com.orendainx.hortonworks.trucking.topology.nifi
import com.typesafe.scalalogging.Logger
import org.apache.nifi.storm.{NiFiDataPacket, NiFiDataPacketBuilder, StandardNiFiDataPacket}
import org.apache.storm.tuple.Tuple
import scala.collection.JavaConverters._
/**
* @author Edgar Orendain <edgar@orendainx.com>
*/
class ByteArrayToNiFiPacket extends NiFiDataPacketBuilder with Serializable {
private lazy val logger = Logger(this.getClass)
override def createNiFiDataPacket(tuple: Tuple): NiFiDataPacket = {
val newAttributes = Map("processed" -> "true").asJava
- new StandardNiFiDataPacket(tuple.getValueByField("data").asInstanceOf[Array[Byte]], newAttributes)
? ^ ^^^ --------------------------
+ new StandardNiFiDataPacket(tuple.getBinaryByField("data"), newAttributes)
? ^^^ ^^
}
} | 2 | 0.1 | 1 | 1 |
9eb334ad246ed4df811ebd3a3d1fbcea0d8789db | webkit/data/purify/test_shell_tests.exe.gtest.txt | webkit/data/purify/test_shell_tests.exe.gtest.txt | BMP*
| BMPImageDecoderTest.ChunkedDecodingSlow
BMPImageDecoderTest.DecodingSlow
| Enable the fast BMPImageDecoderTest tests under Purify. | Enable the fast BMPImageDecoderTest tests under Purify.
BUG=9177
Review URL: http://codereview.chromium.org/115373
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@16096 0039d316-1c4b-4281-b951-d872f2087c98
| Text | bsd-3-clause | adobe/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,ropik/chromium,ropik/chromium,gavinp/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,ropik/chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,ropik/chromium,adobe/chromium,adobe/chromium,yitian134/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,gavinp/chromium,adobe/chromium | text | ## Code Before:
BMP*
## Instruction:
Enable the fast BMPImageDecoderTest tests under Purify.
BUG=9177
Review URL: http://codereview.chromium.org/115373
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@16096 0039d316-1c4b-4281-b951-d872f2087c98
## Code After:
BMPImageDecoderTest.ChunkedDecodingSlow
BMPImageDecoderTest.DecodingSlow
| - BMP*
+ BMPImageDecoderTest.ChunkedDecodingSlow
+ BMPImageDecoderTest.DecodingSlow | 3 | 3 | 2 | 1 |
069e325d0b4701e6c21c3b2902885f77478a1823 | resources/linux/code.desktop | resources/linux/code.desktop | [Desktop Entry]
Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/bin/@@NAME@@ %U
Icon=@@NAME@@
Type=Application
StartupNotify=true
StartupWMClass=@@NAME_SHORT@@
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;
Actions=new-window;
[Desktop Action new-window]
Name=New Window
Name[de]=Neues Fenster
Name[es]=Nueva ventana
Name[fr]=Nouvelle fenêtre
Name[it]=Nuova finestra
Name[ja]=新規ウインドウ
Name[ko]=새 창
Name[ru]=Новое окно
Name[zh_CN]=新建窗口
Name[zh_TW]=開新視窗
Exec=/usr/bin/@@NAME@@ --new-window %U
Icon=@@NAME@@
| [Desktop Entry]
Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/@@NAME@@/@@NAME@@ %U
Icon=@@NAME@@
Type=Application
StartupNotify=true
StartupWMClass=@@NAME_SHORT@@
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;
Actions=new-window;
[Desktop Action new-window]
Name=New Window
Name[de]=Neues Fenster
Name[es]=Nueva ventana
Name[fr]=Nouvelle fenêtre
Name[it]=Nuova finestra
Name[ja]=新規ウインドウ
Name[ko]=새 창
Name[ru]=Новое окно
Name[zh_CN]=新建窗口
Name[zh_TW]=開新視窗
Exec=/usr/share/@@NAME@@/@@NAME@@ --new-window %U
Icon=@@NAME@@
| Use electron binary over CLI in desktop entry | Use electron binary over CLI in desktop entry
Fixes #6110
| desktop | mit | eklavyamirani/vscode,the-ress/vscode,rishii7/vscode,stringham/vscode,radshit/vscode,joaomoreno/vscode,landonepps/vscode,bsmr-x-script/vscode,eklavyamirani/vscode,0xmohit/vscode,zyml/vscode,jchadwick/vscode,gagangupt16/vscode,veeramarni/vscode,williamcspace/vscode,eamodio/vscode,hashhar/vscode,williamcspace/vscode,mjbvz/vscode,gagangupt16/vscode,Krzysztof-Cieslak/vscode,hashhar/vscode,the-ress/vscode,hoovercj/vscode,0xmohit/vscode,williamcspace/vscode,eklavyamirani/vscode,bsmr-x-script/vscode,ups216/vscode,bsmr-x-script/vscode,mjbvz/vscode,stringham/vscode,zyml/vscode,KattMingMing/vscode,gagangupt16/vscode,ups216/vscode,charlespierce/vscode,KattMingMing/vscode,eklavyamirani/vscode,DustinCampbell/vscode,ups216/vscode,cleidigh/vscode,veeramarni/vscode,gagangupt16/vscode,eamodio/vscode,0xmohit/vscode,zyml/vscode,cleidigh/vscode,KattMingMing/vscode,williamcspace/vscode,hashhar/vscode,matthewshirley/vscode,Zalastax/vscode,eamodio/vscode,hashhar/vscode,hashhar/vscode,charlespierce/vscode,KattMingMing/vscode,microlv/vscode,matthewshirley/vscode,0xmohit/vscode,Zalastax/vscode,radshit/vscode,charlespierce/vscode,veeramarni/vscode,Microsoft/vscode,ups216/vscode,hashhar/vscode,Krzysztof-Cieslak/vscode,matthewshirley/vscode,gagangupt16/vscode,gagangupt16/vscode,radshit/vscode,jchadwick/vscode,Zalastax/vscode,landonepps/vscode,mjbvz/vscode,hoovercj/vscode,joaomoreno/vscode,landonepps/vscode,eklavyamirani/vscode,gagangupt16/vscode,0xmohit/vscode,williamcspace/vscode,the-ress/vscode,mjbvz/vscode,joaomoreno/vscode,zyml/vscode,radshit/vscode,0xmohit/vscode,the-ress/vscode,cleidigh/vscode,the-ress/vscode,0xmohit/vscode,Microsoft/vscode,DustinCampbell/vscode,eamodio/vscode,hashhar/vscode,DustinCampbell/vscode,jchadwick/vscode,Zalastax/vscode,Krzysztof-Cieslak/vscode,eklavyamirani/vscode,the-ress/vscode,radshit/vscode,Microsoft/vscode,bsmr-x-script/vscode,the-ress/vscode,microsoft/vscode,hoovercj/vscode,ups216/vscode,radshit/vscode,williamcspace/vscode,joaomoreno/vscode,0xmohit/vscode,landonepps/vscode,veeramarni/vscode,microlv/vscode,charlespierce/vscode,0xmohit/vscode,ups216/vscode,gagangupt16/vscode,charlespierce/vscode,cleidigh/vscode,matthewshirley/vscode,hungys/vscode,cleidigh/vscode,KattMingMing/vscode,gagangupt16/vscode,charlespierce/vscode,KattMingMing/vscode,hoovercj/vscode,gagangupt16/vscode,veeramarni/vscode,0xmohit/vscode,eklavyamirani/vscode,microlv/vscode,hungys/vscode,zyml/vscode,eamodio/vscode,DustinCampbell/vscode,stringham/vscode,ups216/vscode,microsoft/vscode,bsmr-x-script/vscode,joaomoreno/vscode,DustinCampbell/vscode,joaomoreno/vscode,KattMingMing/vscode,matthewshirley/vscode,eklavyamirani/vscode,the-ress/vscode,microlv/vscode,Zalastax/vscode,jchadwick/vscode,bsmr-x-script/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,rkeithhill/VSCode,rishii7/vscode,hoovercj/vscode,Microsoft/vscode,the-ress/vscode,radshit/vscode,jchadwick/vscode,eamodio/vscode,DustinCampbell/vscode,joaomoreno/vscode,DustinCampbell/vscode,microsoft/vscode,bsmr-x-script/vscode,microsoft/vscode,mjbvz/vscode,cleidigh/vscode,hungys/vscode,DustinCampbell/vscode,zyml/vscode,microsoft/vscode,rishii7/vscode,hashhar/vscode,ups216/vscode,0xmohit/vscode,microlv/vscode,ups216/vscode,gagangupt16/vscode,KattMingMing/vscode,microlv/vscode,DustinCampbell/vscode,KattMingMing/vscode,williamcspace/vscode,cleidigh/vscode,eamodio/vscode,hungys/vscode,gagangupt16/vscode,bsmr-x-script/vscode,mjbvz/vscode,landonepps/vscode,jchadwick/vscode,hungys/vscode,the-ress/vscode,microsoft/vscode,ups216/vscode,mjbvz/vscode,stringham/vscode,landonepps/vscode,the-ress/vscode,hoovercj/vscode,DustinCampbell/vscode,gagangupt16/vscode,microsoft/vscode,landonepps/vscode,DustinCampbell/vscode,matthewshirley/vscode,stringham/vscode,Zalastax/vscode,hoovercj/vscode,hashhar/vscode,eamodio/vscode,microlv/vscode,microsoft/vscode,Microsoft/vscode,Microsoft/vscode,rishii7/vscode,eklavyamirani/vscode,Microsoft/vscode,microlv/vscode,rishii7/vscode,jchadwick/vscode,hungys/vscode,rishii7/vscode,Zalastax/vscode,Zalastax/vscode,DustinCampbell/vscode,ups216/vscode,hoovercj/vscode,ups216/vscode,radshit/vscode,cleidigh/vscode,cleidigh/vscode,microsoft/vscode,landonepps/vscode,eklavyamirani/vscode,mjbvz/vscode,charlespierce/vscode,mjbvz/vscode,bsmr-x-script/vscode,microlv/vscode,williamcspace/vscode,hoovercj/vscode,stringham/vscode,microlv/vscode,williamcspace/vscode,landonepps/vscode,microsoft/vscode,stringham/vscode,rishii7/vscode,eamodio/vscode,charlespierce/vscode,joaomoreno/vscode,jchadwick/vscode,stringham/vscode,Krzysztof-Cieslak/vscode,rishii7/vscode,veeramarni/vscode,stringham/vscode,gagangupt16/vscode,DustinCampbell/vscode,gagangupt16/vscode,microlv/vscode,eklavyamirani/vscode,jchadwick/vscode,hashhar/vscode,zyml/vscode,the-ress/vscode,veeramarni/vscode,radshit/vscode,mjbvz/vscode,hashhar/vscode,hoovercj/vscode,eamodio/vscode,hashhar/vscode,Microsoft/vscode,matthewshirley/vscode,stringham/vscode,0xmohit/vscode,radshit/vscode,microlv/vscode,KattMingMing/vscode,KattMingMing/vscode,ups216/vscode,veeramarni/vscode,Microsoft/vscode,mjbvz/vscode,eklavyamirani/vscode,williamcspace/vscode,rishii7/vscode,hashhar/vscode,veeramarni/vscode,hoovercj/vscode,rishii7/vscode,stringham/vscode,landonepps/vscode,zyml/vscode,0xmohit/vscode,jchadwick/vscode,zyml/vscode,stringham/vscode,eamodio/vscode,veeramarni/vscode,hashhar/vscode,veeramarni/vscode,eklavyamirani/vscode,cleidigh/vscode,DustinCampbell/vscode,bsmr-x-script/vscode,bsmr-x-script/vscode,DustinCampbell/vscode,hoovercj/vscode,hungys/vscode,matthewshirley/vscode,williamcspace/vscode,rishii7/vscode,hungys/vscode,zyml/vscode,rishii7/vscode,ups216/vscode,matthewshirley/vscode,Zalastax/vscode,bsmr-x-script/vscode,radshit/vscode,jchadwick/vscode,joaomoreno/vscode,0xmohit/vscode,veeramarni/vscode,Zalastax/vscode,landonepps/vscode,charlespierce/vscode,Zalastax/vscode,hungys/vscode,microlv/vscode,rishii7/vscode,hungys/vscode,cleidigh/vscode,KattMingMing/vscode,zyml/vscode,cleidigh/vscode,stringham/vscode,cleidigh/vscode,matthewshirley/vscode,joaomoreno/vscode,williamcspace/vscode,hoovercj/vscode,Microsoft/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,landonepps/vscode,hungys/vscode,charlespierce/vscode,microsoft/vscode,hungys/vscode,matthewshirley/vscode,landonepps/vscode,charlespierce/vscode,0xmohit/vscode,Zalastax/vscode,mjbvz/vscode,hungys/vscode,williamcspace/vscode,jchadwick/vscode,matthewshirley/vscode,hungys/vscode,microlv/vscode,hoovercj/vscode,microsoft/vscode,williamcspace/vscode,charlespierce/vscode,Krzysztof-Cieslak/vscode,landonepps/vscode,microsoft/vscode,Zalastax/vscode,Krzysztof-Cieslak/vscode,charlespierce/vscode,microlv/vscode,ups216/vscode,cleidigh/vscode,rishii7/vscode,eamodio/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,matthewshirley/vscode,hoovercj/vscode,0xmohit/vscode,hungys/vscode,radshit/vscode,mjbvz/vscode,microlv/vscode,radshit/vscode,radshit/vscode,jchadwick/vscode,gagangupt16/vscode,jchadwick/vscode,Krzysztof-Cieslak/vscode,the-ress/vscode,eamodio/vscode,mjbvz/vscode,joaomoreno/vscode,the-ress/vscode,williamcspace/vscode,0xmohit/vscode,jchadwick/vscode,landonepps/vscode,matthewshirley/vscode,KattMingMing/vscode,williamcspace/vscode,radshit/vscode,jchadwick/vscode,bsmr-x-script/vscode,Zalastax/vscode,Microsoft/vscode,bsmr-x-script/vscode,Krzysztof-Cieslak/vscode,williamcspace/vscode,hungys/vscode,rishii7/vscode,zyml/vscode,charlespierce/vscode,KattMingMing/vscode,joaomoreno/vscode,KattMingMing/vscode,cleidigh/vscode,cra0zy/VSCode,hungys/vscode,stringham/vscode,landonepps/vscode,hoovercj/vscode,joaomoreno/vscode,eamodio/vscode,bsmr-x-script/vscode,zyml/vscode,zyml/vscode,joaomoreno/vscode,veeramarni/vscode,veeramarni/vscode,stringham/vscode,veeramarni/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,cleidigh/vscode,rishii7/vscode,landonepps/vscode,hashhar/vscode,joaomoreno/vscode,microlv/vscode,Microsoft/vscode,microsoft/vscode,eklavyamirani/vscode,rishii7/vscode,mjbvz/vscode,cleidigh/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,ups216/vscode,DustinCampbell/vscode,bsmr-x-script/vscode,matthewshirley/vscode,zyml/vscode,joaomoreno/vscode,eamodio/vscode,KattMingMing/vscode,microsoft/vscode,microsoft/vscode,Krzysztof-Cieslak/vscode,eamodio/vscode,mjbvz/vscode,hashhar/vscode,mjbvz/vscode,hashhar/vscode,Zalastax/vscode,matthewshirley/vscode,the-ress/vscode,DustinCampbell/vscode,matthewshirley/vscode,veeramarni/vscode,Krzysztof-Cieslak/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,KattMingMing/vscode,charlespierce/vscode,zyml/vscode,radshit/vscode,Microsoft/vscode,Krzysztof-Cieslak/vscode,charlespierce/vscode,Zalastax/vscode,joaomoreno/vscode,charlespierce/vscode,Zalastax/vscode,ups216/vscode,stringham/vscode,radshit/vscode,eklavyamirani/vscode,stringham/vscode,the-ress/vscode,jchadwick/vscode,eklavyamirani/vscode,eklavyamirani/vscode,gagangupt16/vscode,zyml/vscode,veeramarni/vscode,hoovercj/vscode | desktop | ## Code Before:
[Desktop Entry]
Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/bin/@@NAME@@ %U
Icon=@@NAME@@
Type=Application
StartupNotify=true
StartupWMClass=@@NAME_SHORT@@
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;
Actions=new-window;
[Desktop Action new-window]
Name=New Window
Name[de]=Neues Fenster
Name[es]=Nueva ventana
Name[fr]=Nouvelle fenêtre
Name[it]=Nuova finestra
Name[ja]=新規ウインドウ
Name[ko]=새 창
Name[ru]=Новое окно
Name[zh_CN]=新建窗口
Name[zh_TW]=開新視窗
Exec=/usr/bin/@@NAME@@ --new-window %U
Icon=@@NAME@@
## Instruction:
Use electron binary over CLI in desktop entry
Fixes #6110
## Code After:
[Desktop Entry]
Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/@@NAME@@/@@NAME@@ %U
Icon=@@NAME@@
Type=Application
StartupNotify=true
StartupWMClass=@@NAME_SHORT@@
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;
Actions=new-window;
[Desktop Action new-window]
Name=New Window
Name[de]=Neues Fenster
Name[es]=Nueva ventana
Name[fr]=Nouvelle fenêtre
Name[it]=Nuova finestra
Name[ja]=新規ウインドウ
Name[ko]=새 창
Name[ru]=Новое окно
Name[zh_CN]=新建窗口
Name[zh_TW]=開新視窗
Exec=/usr/share/@@NAME@@/@@NAME@@ --new-window %U
Icon=@@NAME@@
| [Desktop Entry]
Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
- Exec=/usr/bin/@@NAME@@ %U
+ Exec=/usr/share/@@NAME@@/@@NAME@@ %U
Icon=@@NAME@@
Type=Application
StartupNotify=true
StartupWMClass=@@NAME_SHORT@@
Categories=Utility;TextEditor;Development;IDE;
MimeType=text/plain;
Actions=new-window;
[Desktop Action new-window]
Name=New Window
Name[de]=Neues Fenster
Name[es]=Nueva ventana
Name[fr]=Nouvelle fenêtre
Name[it]=Nuova finestra
Name[ja]=新規ウインドウ
Name[ko]=새 창
Name[ru]=Новое окно
Name[zh_CN]=新建窗口
Name[zh_TW]=開新視窗
- Exec=/usr/bin/@@NAME@@ --new-window %U
? ^^^
+ Exec=/usr/share/@@NAME@@/@@NAME@@ --new-window %U
? ^^^^^^^^^^^^^^
Icon=@@NAME@@ | 4 | 0.153846 | 2 | 2 |
bdc19a8d97cff8b13f9e520a39b8c7f2489d166d | recipes/screen_sharing_app.rb | recipes/screen_sharing_app.rb | unless File.exists?("/Applications/Screen Sharing.app")
execute "create symbolic link in /Applications" do
command "ln -s /System/Library/CoreServices/Screen\\ Sharing.app /Applications/"
user WS_USER
end
ruby_block "test to see if Chrome was installed" do
block do
raise "Chrome install failed" unless File.exists?("/Applications/Screen Sharing.app")
end
end
end
| unless File.exists?("/Applications/Screen Sharing.app")
link "/Applications/Screen\ Sharing.app" do
to "/System/Library/CoreServices/Screen\ Sharing.app"
end
ruby_block "test to see if Screen Sharing was installed" do
block do
raise "Screen Sharing install failed" unless File.exists?("/Applications/Screen Sharing.app")
end
end
end
| Fix error message and use chef's built-in link command | Fix error message and use chef's built-in link command
Error message on screensharing app failure shouldn't say that Chrome failed to install ;)
Also the failure message references chrome instead
| Ruby | mit | webcoyote/pivotal_workstation,1000Bulbs/sprout,wendorf/sprout-osx-apps,Yesware/sprout,1000Bulbs/pivotal_workstation,cowboyd/pivotal_workstation,pivotal-sprout/sprout-osx-apps,se3000/pivotal_workstation,Yesware/sprout,Yesware/sprout,1000Bulbs/pivotal_workstation,wendorf/sprout-osx-apps,webcoyote/pivotal_workstation,wendorf/sprout-osx-apps,1000Bulbs/sprout,pivotal-sprout/sprout-osx-apps,webcoyote/pivotal_workstation,pivotal-sprout/sprout-osx-apps | ruby | ## Code Before:
unless File.exists?("/Applications/Screen Sharing.app")
execute "create symbolic link in /Applications" do
command "ln -s /System/Library/CoreServices/Screen\\ Sharing.app /Applications/"
user WS_USER
end
ruby_block "test to see if Chrome was installed" do
block do
raise "Chrome install failed" unless File.exists?("/Applications/Screen Sharing.app")
end
end
end
## Instruction:
Fix error message and use chef's built-in link command
Error message on screensharing app failure shouldn't say that Chrome failed to install ;)
Also the failure message references chrome instead
## Code After:
unless File.exists?("/Applications/Screen Sharing.app")
link "/Applications/Screen\ Sharing.app" do
to "/System/Library/CoreServices/Screen\ Sharing.app"
end
ruby_block "test to see if Screen Sharing was installed" do
block do
raise "Screen Sharing install failed" unless File.exists?("/Applications/Screen Sharing.app")
end
end
end
| unless File.exists?("/Applications/Screen Sharing.app")
-
- execute "create symbolic link in /Applications" do
+
+ link "/Applications/Screen\ Sharing.app" do
- command "ln -s /System/Library/CoreServices/Screen\\ Sharing.app /Applications/"
? ^ ----- ------ - ---------------
+ to "/System/Library/CoreServices/Screen\ Sharing.app"
? ^
- user WS_USER
end
- ruby_block "test to see if Chrome was installed" do
? ^ ^^^
+ ruby_block "test to see if Screen Sharing was installed" do
? ^^^^^^^^ + ^^^
block do
- raise "Chrome install failed" unless File.exists?("/Applications/Screen Sharing.app")
? ^ ^^^
+ raise "Screen Sharing install failed" unless File.exists?("/Applications/Screen Sharing.app")
? ^^^^^^^^ + ^^^
end
end
end | 11 | 0.846154 | 5 | 6 |
86ba30d457049bfc7bab36497e443f9d23d678f7 | .travis.yml | .travis.yml | language: php
php:
- 7.1
- 7.0
- hhvm
before_script:
- pip install --user codecov
- composer self-update && composer install --dev
script:
- docker build -t matthiasmullie/php-api .
- docker run -d -p 80:80 matthiasmullie/php-api
- ./vendor/bin/phpunit
after_success:
- vendor/bin/cauditor
- codecov
| language: php
php:
- 7.1
- 7.0
- hhvm
before_script:
- pip install --user codecov
- composer self-update && composer install --dev
script:
- sudo kill -9 `sudo lsof -t -i:80`
- docker build -t matthiasmullie/php-api .
- docker run -d -p 80:80 matthiasmullie/php-api
- ./vendor/bin/phpunit
after_success:
- vendor/bin/cauditor
- codecov
| Make sure nothing is running on port 80 | Make sure nothing is running on port 80
| YAML | mit | matthiasmullie/php-api | yaml | ## Code Before:
language: php
php:
- 7.1
- 7.0
- hhvm
before_script:
- pip install --user codecov
- composer self-update && composer install --dev
script:
- docker build -t matthiasmullie/php-api .
- docker run -d -p 80:80 matthiasmullie/php-api
- ./vendor/bin/phpunit
after_success:
- vendor/bin/cauditor
- codecov
## Instruction:
Make sure nothing is running on port 80
## Code After:
language: php
php:
- 7.1
- 7.0
- hhvm
before_script:
- pip install --user codecov
- composer self-update && composer install --dev
script:
- sudo kill -9 `sudo lsof -t -i:80`
- docker build -t matthiasmullie/php-api .
- docker run -d -p 80:80 matthiasmullie/php-api
- ./vendor/bin/phpunit
after_success:
- vendor/bin/cauditor
- codecov
| language: php
php:
- 7.1
- 7.0
- hhvm
before_script:
- pip install --user codecov
- composer self-update && composer install --dev
script:
+ - sudo kill -9 `sudo lsof -t -i:80`
- docker build -t matthiasmullie/php-api .
- docker run -d -p 80:80 matthiasmullie/php-api
- ./vendor/bin/phpunit
after_success:
- vendor/bin/cauditor
- codecov | 1 | 0.052632 | 1 | 0 |
266909430637daf570253508a2c2c83672a9975b | package.json | package.json | {
"name": "community",
"description": "Social platform web application.",
"version": "0.0.0",
"private": true,
"license": "MIT",
"main": "server/index.js",
"repository": {
"type": "git",
"url": "https://github.com/lxanders/community.git"
},
"dependencies": {
"express": "4.9.5",
"morgan": "1.3.2"
},
"devDependencies": {
"bower": "1.3.11",
"eslint": "0.8.2",
"less": "1.7.5"
},
"scripts": {
"build": "npm run prepare-directories && npm run copy-html && npm run compile-css",
"clean": "npm run clean-node && npm run clean-bower && npm run clean-build",
"clean-bower": "rm -rf client/bower_components",
"clean-build": "rm -rf client/build",
"clean-node": "rm -rf node_modules",
"copy-html": "cp -r client/templates/* client/build/",
"compile-css": "lessc client/styles/styles.less > client/build/css/styles.css",
"install-client": "bower install",
"prepare-directories": "npm run clean-build && mkdir client/build && mkdir client/build/css",
"start": "node server"
},
"engines": {
"node": "0.10.32"
}
}
| {
"name": "community",
"description": "Social platform web application.",
"version": "0.0.0",
"private": true,
"license": "MIT",
"main": "server/index.js",
"repository": {
"type": "git",
"url": "https://github.com/lxanders/community.git"
},
"dependencies": {
"express": "4.9.5",
"morgan": "1.3.2"
},
"devDependencies": {
"bower": "1.3.11",
"eslint": "0.8.2",
"less": "1.7.5"
},
"scripts": {
"build": "npm run prepare-directories && npm run copy-html && npm run compile-css",
"clean": "npm run clean-node && npm run clean-bower && npm run clean-build",
"clean-bower": "rm -rf client/bower_components",
"clean-build": "rm -rf client/build",
"clean-client": "npm run clean-bower && npm run clean-build",
"clean-node": "rm -rf node_modules",
"copy-html": "cp -r client/templates/* client/build/",
"compile-css": "lessc client/styles/styles.less > client/build/css/styles.css",
"install-client": "bower install",
"prepare-directories": "npm run clean-build && mkdir client/build && mkdir client/build/css",
"start": "node server"
},
"engines": {
"node": "0.10.32"
}
}
| Add convenience script for cleaning the client. | Add convenience script for cleaning the client.
| JSON | mit | lxanders/community | json | ## Code Before:
{
"name": "community",
"description": "Social platform web application.",
"version": "0.0.0",
"private": true,
"license": "MIT",
"main": "server/index.js",
"repository": {
"type": "git",
"url": "https://github.com/lxanders/community.git"
},
"dependencies": {
"express": "4.9.5",
"morgan": "1.3.2"
},
"devDependencies": {
"bower": "1.3.11",
"eslint": "0.8.2",
"less": "1.7.5"
},
"scripts": {
"build": "npm run prepare-directories && npm run copy-html && npm run compile-css",
"clean": "npm run clean-node && npm run clean-bower && npm run clean-build",
"clean-bower": "rm -rf client/bower_components",
"clean-build": "rm -rf client/build",
"clean-node": "rm -rf node_modules",
"copy-html": "cp -r client/templates/* client/build/",
"compile-css": "lessc client/styles/styles.less > client/build/css/styles.css",
"install-client": "bower install",
"prepare-directories": "npm run clean-build && mkdir client/build && mkdir client/build/css",
"start": "node server"
},
"engines": {
"node": "0.10.32"
}
}
## Instruction:
Add convenience script for cleaning the client.
## Code After:
{
"name": "community",
"description": "Social platform web application.",
"version": "0.0.0",
"private": true,
"license": "MIT",
"main": "server/index.js",
"repository": {
"type": "git",
"url": "https://github.com/lxanders/community.git"
},
"dependencies": {
"express": "4.9.5",
"morgan": "1.3.2"
},
"devDependencies": {
"bower": "1.3.11",
"eslint": "0.8.2",
"less": "1.7.5"
},
"scripts": {
"build": "npm run prepare-directories && npm run copy-html && npm run compile-css",
"clean": "npm run clean-node && npm run clean-bower && npm run clean-build",
"clean-bower": "rm -rf client/bower_components",
"clean-build": "rm -rf client/build",
"clean-client": "npm run clean-bower && npm run clean-build",
"clean-node": "rm -rf node_modules",
"copy-html": "cp -r client/templates/* client/build/",
"compile-css": "lessc client/styles/styles.less > client/build/css/styles.css",
"install-client": "bower install",
"prepare-directories": "npm run clean-build && mkdir client/build && mkdir client/build/css",
"start": "node server"
},
"engines": {
"node": "0.10.32"
}
}
| {
"name": "community",
"description": "Social platform web application.",
"version": "0.0.0",
"private": true,
"license": "MIT",
"main": "server/index.js",
"repository": {
"type": "git",
"url": "https://github.com/lxanders/community.git"
},
"dependencies": {
"express": "4.9.5",
"morgan": "1.3.2"
},
"devDependencies": {
"bower": "1.3.11",
"eslint": "0.8.2",
"less": "1.7.5"
},
"scripts": {
"build": "npm run prepare-directories && npm run copy-html && npm run compile-css",
"clean": "npm run clean-node && npm run clean-bower && npm run clean-build",
"clean-bower": "rm -rf client/bower_components",
"clean-build": "rm -rf client/build",
+ "clean-client": "npm run clean-bower && npm run clean-build",
"clean-node": "rm -rf node_modules",
"copy-html": "cp -r client/templates/* client/build/",
"compile-css": "lessc client/styles/styles.less > client/build/css/styles.css",
"install-client": "bower install",
"prepare-directories": "npm run clean-build && mkdir client/build && mkdir client/build/css",
"start": "node server"
},
"engines": {
"node": "0.10.32"
}
} | 1 | 0.027778 | 1 | 0 |
4ec2b94551858e404f0de6d8ad3827d9c6138491 | slurmec2utils/sysinit.py | slurmec2utils/sysinit.py | from __future__ import absolute_import, print_function
import boto.s3
from boto.s3.key import Key
from .clusterconfig import ClusterConfiguration
from .instanceinfo import get_instance_id
def check_munge_
| from __future__ import absolute_import, print_function
import boto.s3
from boto.s3.key import Key
from .clusterconfig import ClusterConfiguration
from .instanceinfo import get_instance_id
def get_munge_key(cluster_configuration=None):
if cluster_configuration is None:
cluster_configuration = ClusterConfiguration()
| Fix syntax errors. (preventing install) | Fix syntax errors. (preventing install)
| Python | apache-2.0 | dacut/slurm-ec2-utils,dacut/slurm-ec2-utils | python | ## Code Before:
from __future__ import absolute_import, print_function
import boto.s3
from boto.s3.key import Key
from .clusterconfig import ClusterConfiguration
from .instanceinfo import get_instance_id
def check_munge_
## Instruction:
Fix syntax errors. (preventing install)
## Code After:
from __future__ import absolute_import, print_function
import boto.s3
from boto.s3.key import Key
from .clusterconfig import ClusterConfiguration
from .instanceinfo import get_instance_id
def get_munge_key(cluster_configuration=None):
if cluster_configuration is None:
cluster_configuration = ClusterConfiguration()
| from __future__ import absolute_import, print_function
import boto.s3
from boto.s3.key import Key
from .clusterconfig import ClusterConfiguration
from .instanceinfo import get_instance_id
- def check_munge_
+ def get_munge_key(cluster_configuration=None):
+ if cluster_configuration is None:
+ cluster_configuration = ClusterConfiguration() | 4 | 0.571429 | 3 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.