commit
stringlengths 40
40
| old_file
stringlengths 4
237
| new_file
stringlengths 4
237
| old_contents
stringlengths 1
4.24k
| new_contents
stringlengths 5
4.84k
| subject
stringlengths 15
778
| message
stringlengths 16
6.86k
| lang
stringlengths 1
30
| license
stringclasses 13
values | repos
stringlengths 5
116k
| config
stringlengths 1
30
| content
stringlengths 105
8.72k
|
---|---|---|---|---|---|---|---|---|---|---|---|
b9c5e1f8d4d50da6c05b26482a118878b6c0080b
|
sonar-project.properties
|
sonar-project.properties
|
sonar.organization=evilz-github
sonar.projectKey=evilz_vscode-reveal
# relative paths to source directories. More details and properties are described
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
sonar.sources=./src
|
sonar.organization=evilz-github
sonar.projectKey=evilz_vscode-reveal
# relative paths to source directories. More details and properties are described
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
sonar.sources=./src
sonar.testExecutionReportPaths=test-report.xml
|
Add test cover for sonar
|
Add test cover for sonar
|
INI
|
mit
|
evilz/vscode-reveal,evilz/vscode-reveal,evilz/vscode-reveal
|
ini
|
## Code Before:
sonar.organization=evilz-github
sonar.projectKey=evilz_vscode-reveal
# relative paths to source directories. More details and properties are described
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
sonar.sources=./src
## Instruction:
Add test cover for sonar
## Code After:
sonar.organization=evilz-github
sonar.projectKey=evilz_vscode-reveal
# relative paths to source directories. More details and properties are described
# in https://sonarcloud.io/documentation/project-administration/narrowing-the-focus/
sonar.sources=./src
sonar.testExecutionReportPaths=test-report.xml
|
8e5af5327fa39ce2a345a58ed87340c52b1378c1
|
src/Bjoerne/MyAlbumsBundle/Resources/config/routing.yml
|
src/Bjoerne/MyAlbumsBundle/Resources/config/routing.yml
|
bjoerne_my_albums_homepage:
pattern: /hello/{name}
defaults: { _controller: BjoerneMyAlbumsBundle:Default:index }
|
bjoerne_my_albums_homepage:
pattern: /hello/{name}
defaults: { _controller: BjoerneMyAlbumsBundle:Default:index }
my_albums_controller:
resource: "@BjoerneMyAlbumsBundle/Controller"
type: annotation
|
Add routes for BjoerneMyAlbumsBundle/Controller annotations
|
Add routes for BjoerneMyAlbumsBundle/Controller annotations
|
YAML
|
mit
|
bjoerne2/symfony-myalbums,bjoerne2/symfony-myalbums
|
yaml
|
## Code Before:
bjoerne_my_albums_homepage:
pattern: /hello/{name}
defaults: { _controller: BjoerneMyAlbumsBundle:Default:index }
## Instruction:
Add routes for BjoerneMyAlbumsBundle/Controller annotations
## Code After:
bjoerne_my_albums_homepage:
pattern: /hello/{name}
defaults: { _controller: BjoerneMyAlbumsBundle:Default:index }
my_albums_controller:
resource: "@BjoerneMyAlbumsBundle/Controller"
type: annotation
|
95356d7f1bba9cb43f2c1e6bde35f8fa1599312c
|
README.md
|
README.md
|
[](https://travis-ci.org/markdalgleish/generator-bespoke)
A generator for Yeoman. This is a work in progress.
## License
[MIT License](http://markdalgleish.mit-license.org)
|
[](https://travis-ci.org/markdalgleish/generator-bespoke)
A generator for Yeoman. This is a work in progress.
## FAQ
### Q: I'm getting `EMFILE, too many open files`
EMFILE means you've reached the OS limit of concurrently open files. You can permanently increase it to 1200 by running the following command:
```bash
echo "ulimit -n 1200" >> ~/.bashrc
```
## License
[MIT License](http://markdalgleish.mit-license.org)
|
Add EMFILE solution to FAQ
|
Add EMFILE solution to FAQ
|
Markdown
|
mit
|
markdalgleish/generator-bespoke,markdalgleish/generator-bespoke,bespokejs/generator-bespoke,mikemaccana/generator-bespoke,bespokejs/generator-bespoke,bguiz/generator-bespoke,pimterry/generator-bespoke,bespokejs/generator-bespoke,markdalgleish/generator-bespoke
|
markdown
|
## Code Before:
[](https://travis-ci.org/markdalgleish/generator-bespoke)
A generator for Yeoman. This is a work in progress.
## License
[MIT License](http://markdalgleish.mit-license.org)
## Instruction:
Add EMFILE solution to FAQ
## Code After:
[](https://travis-ci.org/markdalgleish/generator-bespoke)
A generator for Yeoman. This is a work in progress.
## FAQ
### Q: I'm getting `EMFILE, too many open files`
EMFILE means you've reached the OS limit of concurrently open files. You can permanently increase it to 1200 by running the following command:
```bash
echo "ulimit -n 1200" >> ~/.bashrc
```
## License
[MIT License](http://markdalgleish.mit-license.org)
|
d708f86f01be4c9a8843283a0d4ea279be6feeaa
|
Zara4/API/Communication/Config.php
|
Zara4/API/Communication/Config.php
|
<?php namespace Zara4\API\Communication;
class Config {
const VERSION = '1.1.0';
const USER_AGENT = 'Zara 4 PHP-SDK, Version-1.1.0';
const PRODUCTION_API_ENDPOINT = "https://api.zara4.com";
const DEVELOPMENT_API_ENDPOINT = "http://api.zara4.dev";
private static $BASE_URL = self::PRODUCTION_API_ENDPOINT;
// --- --- --- --- ---
/**
* Get the base url.
*
* @return string
*/
public static function BASE_URL() {
return self::$BASE_URL;
}
/**
* Configure production mode.
*/
public static function enterProductionMode() {
self::$BASE_URL = self::PRODUCTION_API_ENDPOINT;
}
/**
* Configure development mode.
*/
public static function enterDevelopmentMode() {
self::$BASE_URL = self::DEVELOPMENT_API_ENDPOINT;
}
}
|
<?php namespace Zara4\API\Communication;
class Config {
const VERSION = '1.2.3';
const USER_AGENT = 'Zara 4 PHP-SDK, Version-1.2.3';
const PRODUCTION_API_ENDPOINT = "https://api.zara4.com";
const DEVELOPMENT_API_ENDPOINT = "http://api.zara4.dev";
public static $BASE_URL = self::PRODUCTION_API_ENDPOINT;
// --- --- --- --- ---
/**
* Get the base url.
*
* @return string
*/
public static function BASE_URL() {
return self::$BASE_URL;
}
/**
* Set the base url
*
* @param $baseUrl
*/
public static function setBaseUrl($baseUrl) {
self::$BASE_URL = $baseUrl;
}
/**
* Configure production mode.
*/
public static function enterProductionMode() {
self::setBaseUrl(self::PRODUCTION_API_ENDPOINT);
}
/**
* Configure development mode.
*/
public static function enterDevelopmentMode() {
self::setBaseUrl(self::DEVELOPMENT_API_ENDPOINT);
}
}
|
Update communication configuration class to allow the base url to be set for the purpose of testing
|
Update communication configuration class to allow the base url to be set for the purpose of testing
|
PHP
|
mit
|
zara-4/php-sdk
|
php
|
## Code Before:
<?php namespace Zara4\API\Communication;
class Config {
const VERSION = '1.1.0';
const USER_AGENT = 'Zara 4 PHP-SDK, Version-1.1.0';
const PRODUCTION_API_ENDPOINT = "https://api.zara4.com";
const DEVELOPMENT_API_ENDPOINT = "http://api.zara4.dev";
private static $BASE_URL = self::PRODUCTION_API_ENDPOINT;
// --- --- --- --- ---
/**
* Get the base url.
*
* @return string
*/
public static function BASE_URL() {
return self::$BASE_URL;
}
/**
* Configure production mode.
*/
public static function enterProductionMode() {
self::$BASE_URL = self::PRODUCTION_API_ENDPOINT;
}
/**
* Configure development mode.
*/
public static function enterDevelopmentMode() {
self::$BASE_URL = self::DEVELOPMENT_API_ENDPOINT;
}
}
## Instruction:
Update communication configuration class to allow the base url to be set for the purpose of testing
## Code After:
<?php namespace Zara4\API\Communication;
class Config {
const VERSION = '1.2.3';
const USER_AGENT = 'Zara 4 PHP-SDK, Version-1.2.3';
const PRODUCTION_API_ENDPOINT = "https://api.zara4.com";
const DEVELOPMENT_API_ENDPOINT = "http://api.zara4.dev";
public static $BASE_URL = self::PRODUCTION_API_ENDPOINT;
// --- --- --- --- ---
/**
* Get the base url.
*
* @return string
*/
public static function BASE_URL() {
return self::$BASE_URL;
}
/**
* Set the base url
*
* @param $baseUrl
*/
public static function setBaseUrl($baseUrl) {
self::$BASE_URL = $baseUrl;
}
/**
* Configure production mode.
*/
public static function enterProductionMode() {
self::setBaseUrl(self::PRODUCTION_API_ENDPOINT);
}
/**
* Configure development mode.
*/
public static function enterDevelopmentMode() {
self::setBaseUrl(self::DEVELOPMENT_API_ENDPOINT);
}
}
|
9132ed970a4425ff8d0dca691de90136c21379c7
|
packages/strapi-plugin-content-manager/services/utils/configuration/settings.js
|
packages/strapi-plugin-content-manager/services/utils/configuration/settings.js
|
'use strict';
const _ = require('lodash');
const { isSortable } = require('./attributes');
const getDefaultMainField = schema => {
if (schema.modelType == 'group') {
// find first group attribute that is sortable
return (
Object.keys(schema.attributes).find(key => isSortable(schema, key)) ||
'id'
);
}
return 'id';
};
/**
* Retunrs a configuration default settings
*/
async function createDefaultSettings(schema) {
const generalSettings = await strapi.plugins[
'content-manager'
].services.generalsettings.getGeneralSettings();
let defaultField = getDefaultMainField(schema);
return {
...generalSettings,
mainField: defaultField,
defaultSortBy: defaultField,
defaultSortOrder: 'ASC',
..._.pick(_.get(schema, ['config', 'settings'], {}), [
'searchable',
'filterable',
'bulkable',
'pageSize',
'mainField',
'defaultSortBy',
'defaultSortOrder',
]),
};
}
/** Synchronisation functions */
async function syncSettings(configuration, schema) {
if (_.isEmpty(configuration.settings)) return createDefaultSettings(schema);
let defaultField = getDefaultMainField(schema);
const { mainField = defaultField, defaultSortBy = defaultField } =
configuration.settings || {};
return {
...configuration.settings,
mainField: isSortable(schema, mainField) ? mainField : defaultField,
defaultSortBy: isSortable(schema, defaultSortBy)
? defaultSortBy
: defaultField,
};
}
module.exports = {
createDefaultSettings,
syncSettings,
};
|
'use strict';
const _ = require('lodash');
const { isSortable } = require('./attributes');
const getDefaultMainField = schema =>
Object.keys(schema.attributes).find(
key => schema.attributes[key].type === 'string'
) || 'id';
/**
* Retunrs a configuration default settings
*/
async function createDefaultSettings(schema) {
const generalSettings = await strapi.plugins[
'content-manager'
].services.generalsettings.getGeneralSettings();
let defaultField = getDefaultMainField(schema);
return {
...generalSettings,
mainField: defaultField,
defaultSortBy: defaultField,
defaultSortOrder: 'ASC',
..._.pick(_.get(schema, ['config', 'settings'], {}), [
'searchable',
'filterable',
'bulkable',
'pageSize',
'mainField',
'defaultSortBy',
'defaultSortOrder',
]),
};
}
/** Synchronisation functions */
async function syncSettings(configuration, schema) {
if (_.isEmpty(configuration.settings)) return createDefaultSettings(schema);
let defaultField = getDefaultMainField(schema);
const { mainField = defaultField, defaultSortBy = defaultField } =
configuration.settings || {};
return {
...configuration.settings,
mainField: isSortable(schema, mainField) ? mainField : defaultField,
defaultSortBy: isSortable(schema, defaultSortBy)
? defaultSortBy
: defaultField,
};
}
module.exports = {
createDefaultSettings,
syncSettings,
};
|
Set content type mainField to be a string if possible else id
|
Set content type mainField to be a string if possible else id
|
JavaScript
|
mit
|
wistityhq/strapi,wistityhq/strapi
|
javascript
|
## Code Before:
'use strict';
const _ = require('lodash');
const { isSortable } = require('./attributes');
const getDefaultMainField = schema => {
if (schema.modelType == 'group') {
// find first group attribute that is sortable
return (
Object.keys(schema.attributes).find(key => isSortable(schema, key)) ||
'id'
);
}
return 'id';
};
/**
* Retunrs a configuration default settings
*/
async function createDefaultSettings(schema) {
const generalSettings = await strapi.plugins[
'content-manager'
].services.generalsettings.getGeneralSettings();
let defaultField = getDefaultMainField(schema);
return {
...generalSettings,
mainField: defaultField,
defaultSortBy: defaultField,
defaultSortOrder: 'ASC',
..._.pick(_.get(schema, ['config', 'settings'], {}), [
'searchable',
'filterable',
'bulkable',
'pageSize',
'mainField',
'defaultSortBy',
'defaultSortOrder',
]),
};
}
/** Synchronisation functions */
async function syncSettings(configuration, schema) {
if (_.isEmpty(configuration.settings)) return createDefaultSettings(schema);
let defaultField = getDefaultMainField(schema);
const { mainField = defaultField, defaultSortBy = defaultField } =
configuration.settings || {};
return {
...configuration.settings,
mainField: isSortable(schema, mainField) ? mainField : defaultField,
defaultSortBy: isSortable(schema, defaultSortBy)
? defaultSortBy
: defaultField,
};
}
module.exports = {
createDefaultSettings,
syncSettings,
};
## Instruction:
Set content type mainField to be a string if possible else id
## Code After:
'use strict';
const _ = require('lodash');
const { isSortable } = require('./attributes');
const getDefaultMainField = schema =>
Object.keys(schema.attributes).find(
key => schema.attributes[key].type === 'string'
) || 'id';
/**
* Retunrs a configuration default settings
*/
async function createDefaultSettings(schema) {
const generalSettings = await strapi.plugins[
'content-manager'
].services.generalsettings.getGeneralSettings();
let defaultField = getDefaultMainField(schema);
return {
...generalSettings,
mainField: defaultField,
defaultSortBy: defaultField,
defaultSortOrder: 'ASC',
..._.pick(_.get(schema, ['config', 'settings'], {}), [
'searchable',
'filterable',
'bulkable',
'pageSize',
'mainField',
'defaultSortBy',
'defaultSortOrder',
]),
};
}
/** Synchronisation functions */
async function syncSettings(configuration, schema) {
if (_.isEmpty(configuration.settings)) return createDefaultSettings(schema);
let defaultField = getDefaultMainField(schema);
const { mainField = defaultField, defaultSortBy = defaultField } =
configuration.settings || {};
return {
...configuration.settings,
mainField: isSortable(schema, mainField) ? mainField : defaultField,
defaultSortBy: isSortable(schema, defaultSortBy)
? defaultSortBy
: defaultField,
};
}
module.exports = {
createDefaultSettings,
syncSettings,
};
|
a894c88bb0fdff33b1ab327bea15a12ea90368ef
|
scripts/steps/06_cleanup.sh
|
scripts/steps/06_cleanup.sh
|
if [ "$FUNCTIONS_LOADED" != 'TRUE' ]; then
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${DIR}/../functions.sh"
fi
cleanup_brew() {
brew cleanup --force
rm -rf "$(brew --cache)"
}
final_message() {
clear
echo "All the automated scripts have now finished."
echo "Dotfiles setup is complete! ♥️ ♥️ ♥️"
}
cleanup_brew
final_message
|
if [ "$FUNCTIONS_LOADED" != 'TRUE' ]; then
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${DIR}/../functions.sh"
fi
cleanup_brew() {
brew cleanup --force
rm -rf "$(brew --cache)"
}
final_message() {
clear
echo "All the automated scripts have now finished."
echo "Dotfiles setup is complete! ♥️ ♥️ ♥️"
}
cleanup_brew
killall caffeinate # computer can go back to sleep
final_message
|
Kill caffeinate at the end of script execution
|
Kill caffeinate at the end of script execution
Otherwise it won't go sleep.
|
Shell
|
unlicense
|
gabrielalmeida/dotfiles
|
shell
|
## Code Before:
if [ "$FUNCTIONS_LOADED" != 'TRUE' ]; then
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${DIR}/../functions.sh"
fi
cleanup_brew() {
brew cleanup --force
rm -rf "$(brew --cache)"
}
final_message() {
clear
echo "All the automated scripts have now finished."
echo "Dotfiles setup is complete! ♥️ ♥️ ♥️"
}
cleanup_brew
final_message
## Instruction:
Kill caffeinate at the end of script execution
Otherwise it won't go sleep.
## Code After:
if [ "$FUNCTIONS_LOADED" != 'TRUE' ]; then
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "${DIR}/../functions.sh"
fi
cleanup_brew() {
brew cleanup --force
rm -rf "$(brew --cache)"
}
final_message() {
clear
echo "All the automated scripts have now finished."
echo "Dotfiles setup is complete! ♥️ ♥️ ♥️"
}
cleanup_brew
killall caffeinate # computer can go back to sleep
final_message
|
7f4e327b4f0d5eed6c60018245c121748896d60c
|
package.json
|
package.json
|
{
"name": "plist",
"description": "Mac OS X Plist parser for NodeJS. Convert a Plist file or string into a native JS object",
"version": "0.2.0",
"author": "Nathan Rajlich <[email protected]>",
"contributors": [ "Hans Huebner <[email protected]>" ],
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/node-plist.git"
},
"keywords": [
"apple",
"mac",
"plist",
"parser",
"xml"
],
"main": "./lib/plist",
"dependencies": {
"sax": "0.1.x"
},
"engines": {
"node": ">= 0.1.100"
},
"devDependencies": {}
}
|
{
"name": "plist",
"description": "Mac OS X Plist parser for NodeJS. Convert a Plist file or string into a native JS object",
"version": "0.2.0",
"author": "Nathan Rajlich <[email protected]>",
"contributors": [ "Hans Huebner <[email protected]>" ],
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/node-plist.git"
},
"keywords": [
"apple",
"mac",
"plist",
"parser",
"xml"
],
"main": "./lib/plist",
"dependencies": {
"sax": "0.1.x"
},
"scripts": {
"test": "for i in tests/test*.js; do node \"$i\"; done"
},
"engines": {
"node": ">= 0.1.100"
},
"devDependencies": {}
}
|
Add an 'npm test' command
|
Add an 'npm test' command
|
JSON
|
mit
|
vladimir-kotikov/plist.js,Jonahss/plist.js,TooTallNate/plist.js,nathansobo/node-plist
|
json
|
## Code Before:
{
"name": "plist",
"description": "Mac OS X Plist parser for NodeJS. Convert a Plist file or string into a native JS object",
"version": "0.2.0",
"author": "Nathan Rajlich <[email protected]>",
"contributors": [ "Hans Huebner <[email protected]>" ],
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/node-plist.git"
},
"keywords": [
"apple",
"mac",
"plist",
"parser",
"xml"
],
"main": "./lib/plist",
"dependencies": {
"sax": "0.1.x"
},
"engines": {
"node": ">= 0.1.100"
},
"devDependencies": {}
}
## Instruction:
Add an 'npm test' command
## Code After:
{
"name": "plist",
"description": "Mac OS X Plist parser for NodeJS. Convert a Plist file or string into a native JS object",
"version": "0.2.0",
"author": "Nathan Rajlich <[email protected]>",
"contributors": [ "Hans Huebner <[email protected]>" ],
"repository": {
"type": "git",
"url": "git://github.com/TooTallNate/node-plist.git"
},
"keywords": [
"apple",
"mac",
"plist",
"parser",
"xml"
],
"main": "./lib/plist",
"dependencies": {
"sax": "0.1.x"
},
"scripts": {
"test": "for i in tests/test*.js; do node \"$i\"; done"
},
"engines": {
"node": ">= 0.1.100"
},
"devDependencies": {}
}
|
9b3ca310a0c1192635e5e101eb70c8f2332d0b4e
|
project.clj
|
project.clj
|
(defproject tile-game "1.0.0-SNAPSHOT"
:description "A Tile Puzzle Game and Solver"
:min-lein-version "2.0.0"
:main tile-game.core
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.494"]
[reagent "0.6.1"]]
:plugins [[lein-figwheel "0.5.9"]
[lein-cljsbuild "1.1.5"]]
:sources-paths ["src"]
:clean-targets ^{:protect false}
["resources/public/js/out"
"resources/public/js/release"
"resources/public/js/tile-game.js"
:target-path]
:cljsbuild
{ :builds [{:id "dev"
:source-paths ["src"]
:figwheel true
:compiler {:main tile-game.grid
:asset-path "js/out"
:output-to "resources/public/js/tile-game.js"
:output-dir "resources/public/js/out"
:source-map-timestamp true}}
{:id "release"
:source-paths ["src"]
:compiler {:main tile-game.grid
:output-to "resources/public/js/tile-game.js"
:output-dir "resources/public/js/release"
:optimizations :advanced
:source-map "resources/public/js/tile-game.js.map"}}]}
:figwheel { :css-dirs ["resources/public/css"]
:open-file-command "emacsclient" })
|
(defproject tile-game "1.0.0-SNAPSHOT"
:description "A Tile Puzzle Game and Solver"
:min-lein-version "2.0.0"
:main tile-game.core
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.494"]
[reagent "0.6.1"]]
:plugins [[lein-figwheel "0.5.9"]
[lein-cljsbuild "1.1.5"]]
:sources-paths ["src"]
:clean-targets ^{:protect false}
["resources/public/js/out"
"resources/public/js/release"
"resources/public/js/tile-game.js"
:target-path]
:cljsbuild {:builds
{"dev"
{:source-paths ["src"]
:figwheel {}
:compiler {:main tile-game.grid
:asset-path "js/out"
:output-to "resources/public/js/tile-game.js"
:output-dir "resources/public/js/out"
:optimizations :none
:source-map-timestamp true}}
"release"
{:source-paths ["src"]
:compiler {:main tile-game.grid
:output-to "resources/public/js/tile-game.js"
:output-dir "resources/public/js/release"
:optimizations :advanced
:source-map "resources/public/js/tile-game.js.map"}}}}
:figwheel {:css-dirs ["resources/public/css"]
:open-file-command "emacsclient"})
|
Reformat cljsbuild & fighwheel config and specify more
|
Reformat cljsbuild & fighwheel config and specify more
|
Clojure
|
mit
|
dgtized/tile-game,dgtized/tile-game
|
clojure
|
## Code Before:
(defproject tile-game "1.0.0-SNAPSHOT"
:description "A Tile Puzzle Game and Solver"
:min-lein-version "2.0.0"
:main tile-game.core
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.494"]
[reagent "0.6.1"]]
:plugins [[lein-figwheel "0.5.9"]
[lein-cljsbuild "1.1.5"]]
:sources-paths ["src"]
:clean-targets ^{:protect false}
["resources/public/js/out"
"resources/public/js/release"
"resources/public/js/tile-game.js"
:target-path]
:cljsbuild
{ :builds [{:id "dev"
:source-paths ["src"]
:figwheel true
:compiler {:main tile-game.grid
:asset-path "js/out"
:output-to "resources/public/js/tile-game.js"
:output-dir "resources/public/js/out"
:source-map-timestamp true}}
{:id "release"
:source-paths ["src"]
:compiler {:main tile-game.grid
:output-to "resources/public/js/tile-game.js"
:output-dir "resources/public/js/release"
:optimizations :advanced
:source-map "resources/public/js/tile-game.js.map"}}]}
:figwheel { :css-dirs ["resources/public/css"]
:open-file-command "emacsclient" })
## Instruction:
Reformat cljsbuild & fighwheel config and specify more
## Code After:
(defproject tile-game "1.0.0-SNAPSHOT"
:description "A Tile Puzzle Game and Solver"
:min-lein-version "2.0.0"
:main tile-game.core
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.494"]
[reagent "0.6.1"]]
:plugins [[lein-figwheel "0.5.9"]
[lein-cljsbuild "1.1.5"]]
:sources-paths ["src"]
:clean-targets ^{:protect false}
["resources/public/js/out"
"resources/public/js/release"
"resources/public/js/tile-game.js"
:target-path]
:cljsbuild {:builds
{"dev"
{:source-paths ["src"]
:figwheel {}
:compiler {:main tile-game.grid
:asset-path "js/out"
:output-to "resources/public/js/tile-game.js"
:output-dir "resources/public/js/out"
:optimizations :none
:source-map-timestamp true}}
"release"
{:source-paths ["src"]
:compiler {:main tile-game.grid
:output-to "resources/public/js/tile-game.js"
:output-dir "resources/public/js/release"
:optimizations :advanced
:source-map "resources/public/js/tile-game.js.map"}}}}
:figwheel {:css-dirs ["resources/public/css"]
:open-file-command "emacsclient"})
|
1130ea1e6d5542578fe7268cef40954677c8557b
|
infra/roles/osm/tasks/main.yml
|
infra/roles/osm/tasks/main.yml
|
---
- name: Create path for maps
file: path=/var/osm/ state=directory owner=root group=root mode=0644
tags:
- osm
- name: Download OSM map from Geofabrik
sudo: yes
shell: wget http://download.geofabrik.de/australia-oceania/new-zealand-latest.osm.pbf
args:
chdir: /var/osm/
creates: /var/osm/new-zealand-latest.osm.pbf
tags:
- osm
- name: Read data using imposm
sudo: yes
shell: imposm --proj=EPSG:3857 --read new-zealand-latest.osm.pbf && touch /var/osm/imposm_coords.cache
args:
creates: /var/osm/imposm_coords.cache
chdir: /var/osm/
tags:
- osm
- name: Writes data using imposm
sudo: yes
shell: imposm --proj=EPSG:3857 --write --connection postgis://osm:osm@localhost/osm new-zealand-latest.osm.pbf && touch /var/osm/write_ansible_flag
args:
creates: /var/osm/write_ansible_flag
chdir: /var/osm/
tags:
- osm
- name: Deploy and optimise tables
sudo: yes
shell: imposm --optimize -d osm && touch /var/osm/optimise_ansible_flag
args:
creates: /var/osm/optimise_ansible_flag
chdir: /var/osm/
tags:
- osm
|
---
- name: Create path for maps
file: path=/var/osm/ state=directory owner=root group=root mode=0644
tags:
- osm
- name: Download OSM map from Geofabrik
sudo: yes
shell: wget http://download.geofabrik.de/australia-oceania/new-zealand-latest.osm.pbf
args:
chdir: /var/osm/
creates: /var/osm/new-zealand-latest.osm.pbf
tags:
- osm
- name: Read data using imposm
sudo: yes
shell: imposm --proj=EPSG:3857 --read new-zealand-latest.osm.pbf
args:
creates: /var/osm/imposm_coords.cache
chdir: /var/osm/
tags:
- osm
- name: Writes data using imposm
sudo: yes
shell: imposm --proj=EPSG:3857 --write --connection postgis://osm:osm@localhost/osm new-zealand-latest.osm.pbf && touch /var/osm/write_ansible_flag
args:
creates: /var/osm/write_ansible_flag
chdir: /var/osm/
tags:
- osm
- name: Deploy and optimise tables
sudo: yes
shell: imposm --optimize -d osm && touch /var/osm/optimise_ansible_flag
args:
creates: /var/osm/optimise_ansible_flag
chdir: /var/osm/
tags:
- osm
|
Remove touch for imposm_coords.cache since it's created by imposm
|
Remove touch for imposm_coords.cache since it's created by imposm
|
YAML
|
mit
|
kinow/nz-osm-server,kinow/nz-osm-server,kinow/nz-osm-server,kinow/nz-osm-server
|
yaml
|
## Code Before:
---
- name: Create path for maps
file: path=/var/osm/ state=directory owner=root group=root mode=0644
tags:
- osm
- name: Download OSM map from Geofabrik
sudo: yes
shell: wget http://download.geofabrik.de/australia-oceania/new-zealand-latest.osm.pbf
args:
chdir: /var/osm/
creates: /var/osm/new-zealand-latest.osm.pbf
tags:
- osm
- name: Read data using imposm
sudo: yes
shell: imposm --proj=EPSG:3857 --read new-zealand-latest.osm.pbf && touch /var/osm/imposm_coords.cache
args:
creates: /var/osm/imposm_coords.cache
chdir: /var/osm/
tags:
- osm
- name: Writes data using imposm
sudo: yes
shell: imposm --proj=EPSG:3857 --write --connection postgis://osm:osm@localhost/osm new-zealand-latest.osm.pbf && touch /var/osm/write_ansible_flag
args:
creates: /var/osm/write_ansible_flag
chdir: /var/osm/
tags:
- osm
- name: Deploy and optimise tables
sudo: yes
shell: imposm --optimize -d osm && touch /var/osm/optimise_ansible_flag
args:
creates: /var/osm/optimise_ansible_flag
chdir: /var/osm/
tags:
- osm
## Instruction:
Remove touch for imposm_coords.cache since it's created by imposm
## Code After:
---
- name: Create path for maps
file: path=/var/osm/ state=directory owner=root group=root mode=0644
tags:
- osm
- name: Download OSM map from Geofabrik
sudo: yes
shell: wget http://download.geofabrik.de/australia-oceania/new-zealand-latest.osm.pbf
args:
chdir: /var/osm/
creates: /var/osm/new-zealand-latest.osm.pbf
tags:
- osm
- name: Read data using imposm
sudo: yes
shell: imposm --proj=EPSG:3857 --read new-zealand-latest.osm.pbf
args:
creates: /var/osm/imposm_coords.cache
chdir: /var/osm/
tags:
- osm
- name: Writes data using imposm
sudo: yes
shell: imposm --proj=EPSG:3857 --write --connection postgis://osm:osm@localhost/osm new-zealand-latest.osm.pbf && touch /var/osm/write_ansible_flag
args:
creates: /var/osm/write_ansible_flag
chdir: /var/osm/
tags:
- osm
- name: Deploy and optimise tables
sudo: yes
shell: imposm --optimize -d osm && touch /var/osm/optimise_ansible_flag
args:
creates: /var/osm/optimise_ansible_flag
chdir: /var/osm/
tags:
- osm
|
9c3c7c971dbe3e66c57524f16811b4a2a2577236
|
src/components/CartItems.jsx
|
src/components/CartItems.jsx
|
var React = require('react');
var ItemName = require('./ItemName.jsx');
var RemoveButton = require('./RemoveButton.jsx');
var CartItems = React.createClass({
render: function () {
var _this = this;
var itemNames = this.props.items.map(function (item, index) {
return (
<li key={index} className="item">
<ItemName value={item.name} isEditable={item.edit} onEdit={_this.props.editItem} /> -
<span className="item-quantity">{item.quantity}</span>
{item.edit ? <button>ok</button> : <RemoveButton name={item.name} action={_this.props.remove}/>}
</li>
);
});
return (
<ul>
{itemNames}
</ul>
);
}
});
module.exports = CartItems;
|
var React = require('react');
var ItemName = require('./ItemName.jsx');
var RemoveButton = require('./RemoveButton.jsx');
var CartItems = React.createClass({
render: function () {
var itemNames = this.props.items.map((item, index) => {
return (
<li key={index} className="item">
<ItemName value={item.name} isEditable={item.edit} onEdit={this.props.editItem} /> -
<span className="item-quantity">{item.quantity}</span>
{item.edit ? <button>ok</button> : <RemoveButton name={item.name} action={this.props.remove}/>}
</li>
);
});
return (
<ul>
{itemNames}
</ul>
);
}
});
module.exports = CartItems;
|
Use ES6 arrow functions to avoid 'this' binding
|
Use ES6 arrow functions to avoid 'this' binding
|
JSX
|
mit
|
rahulbaphana/Reactive-Cart,rahulbaphana/Reactive-Cart
|
jsx
|
## Code Before:
var React = require('react');
var ItemName = require('./ItemName.jsx');
var RemoveButton = require('./RemoveButton.jsx');
var CartItems = React.createClass({
render: function () {
var _this = this;
var itemNames = this.props.items.map(function (item, index) {
return (
<li key={index} className="item">
<ItemName value={item.name} isEditable={item.edit} onEdit={_this.props.editItem} /> -
<span className="item-quantity">{item.quantity}</span>
{item.edit ? <button>ok</button> : <RemoveButton name={item.name} action={_this.props.remove}/>}
</li>
);
});
return (
<ul>
{itemNames}
</ul>
);
}
});
module.exports = CartItems;
## Instruction:
Use ES6 arrow functions to avoid 'this' binding
## Code After:
var React = require('react');
var ItemName = require('./ItemName.jsx');
var RemoveButton = require('./RemoveButton.jsx');
var CartItems = React.createClass({
render: function () {
var itemNames = this.props.items.map((item, index) => {
return (
<li key={index} className="item">
<ItemName value={item.name} isEditable={item.edit} onEdit={this.props.editItem} /> -
<span className="item-quantity">{item.quantity}</span>
{item.edit ? <button>ok</button> : <RemoveButton name={item.name} action={this.props.remove}/>}
</li>
);
});
return (
<ul>
{itemNames}
</ul>
);
}
});
module.exports = CartItems;
|
e0f837ca87aac19f1cd43f274c18bae11a3f4dae
|
pages/_app.tsx
|
pages/_app.tsx
|
import { Fragment } from "react"
import App, { Container } from "next/app"
import Head from "next/head"
import "normalize.css/normalize.css"
// A custom app to support importing CSS files globally
class MyApp extends App {
public render(): JSX.Element {
const { Component, pageProps } = this.props
return (
<Fragment>
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<div>
<Component {...pageProps} />
</div>
<style jsx>{`
div {
width: 70vw;
}
`}</style>
<style jsx global>{`
body {
display: flex;
justify-content: center;
align-items: center;
background: black;
color: white;
}
a {
color: #ffcc00;
}
@media (prefers-color-scheme: light) {
body {
background: white;
color: black;
}
a {
color: #007aff;
}
}
`}</style>
</Fragment>
)
}
}
export default MyApp
|
import { Fragment } from "react"
import App, { Container } from "next/app"
import Head from "next/head"
import "normalize.css/normalize.css"
// A custom app to support importing CSS files globally
class MyApp extends App {
public render(): JSX.Element {
const { Component, pageProps } = this.props
return (
<Fragment>
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<div>
<Component {...pageProps} />
</div>
<style jsx>{`
div {
width: calc(100vw - 32px);
}
@media (min-width: 480px) {
div {
width: 90vw;
}
}
@media (min-width: 1024px) {
div {
width: 70vw;
}
}
`}</style>
<style jsx global>{`
body {
display: flex;
justify-content: center;
align-items: center;
background: black;
color: white;
}
a {
color: #ffcc00;
}
@media (prefers-color-scheme: light) {
body {
background: white;
color: black;
}
a {
color: #007aff;
}
}
`}</style>
</Fragment>
)
}
}
export default MyApp
|
Increase width of content on smaller screens
|
Increase width of content on smaller screens
|
TypeScript
|
mit
|
JosephDuffy/josephduffy.co.uk,JosephDuffy/josephduffy.co.uk,JosephDuffy/josephduffy.co.uk
|
typescript
|
## Code Before:
import { Fragment } from "react"
import App, { Container } from "next/app"
import Head from "next/head"
import "normalize.css/normalize.css"
// A custom app to support importing CSS files globally
class MyApp extends App {
public render(): JSX.Element {
const { Component, pageProps } = this.props
return (
<Fragment>
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<div>
<Component {...pageProps} />
</div>
<style jsx>{`
div {
width: 70vw;
}
`}</style>
<style jsx global>{`
body {
display: flex;
justify-content: center;
align-items: center;
background: black;
color: white;
}
a {
color: #ffcc00;
}
@media (prefers-color-scheme: light) {
body {
background: white;
color: black;
}
a {
color: #007aff;
}
}
`}</style>
</Fragment>
)
}
}
export default MyApp
## Instruction:
Increase width of content on smaller screens
## Code After:
import { Fragment } from "react"
import App, { Container } from "next/app"
import Head from "next/head"
import "normalize.css/normalize.css"
// A custom app to support importing CSS files globally
class MyApp extends App {
public render(): JSX.Element {
const { Component, pageProps } = this.props
return (
<Fragment>
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</Head>
<div>
<Component {...pageProps} />
</div>
<style jsx>{`
div {
width: calc(100vw - 32px);
}
@media (min-width: 480px) {
div {
width: 90vw;
}
}
@media (min-width: 1024px) {
div {
width: 70vw;
}
}
`}</style>
<style jsx global>{`
body {
display: flex;
justify-content: center;
align-items: center;
background: black;
color: white;
}
a {
color: #ffcc00;
}
@media (prefers-color-scheme: light) {
body {
background: white;
color: black;
}
a {
color: #007aff;
}
}
`}</style>
</Fragment>
)
}
}
export default MyApp
|
fb21faaec025a0a6ca2d98c8b2381902f3b1444a
|
pybug/align/lucaskanade/__init__.py
|
pybug/align/lucaskanade/__init__.py
|
import appearance
import image
from residual import (LSIntensity,
ECC,
GradientImages,
GradientCorrelation)
|
import appearance
import image
from residual import (LSIntensity,
ECC,
GaborFourier,
GradientImages,
GradientCorrelation)
|
Add GaborFourier to default import
|
Add GaborFourier to default import
|
Python
|
bsd-3-clause
|
menpo/menpo,yuxiang-zhou/menpo,grigorisg9gr/menpo,mozata/menpo,mozata/menpo,mozata/menpo,mozata/menpo,grigorisg9gr/menpo,menpo/menpo,menpo/menpo,jabooth/menpo-archive,jabooth/menpo-archive,jabooth/menpo-archive,yuxiang-zhou/menpo,grigorisg9gr/menpo,patricksnape/menpo,yuxiang-zhou/menpo,jabooth/menpo-archive,patricksnape/menpo,patricksnape/menpo
|
python
|
## Code Before:
import appearance
import image
from residual import (LSIntensity,
ECC,
GradientImages,
GradientCorrelation)
## Instruction:
Add GaborFourier to default import
## Code After:
import appearance
import image
from residual import (LSIntensity,
ECC,
GaborFourier,
GradientImages,
GradientCorrelation)
|
4c5483125fcd12e111cffe1a1cadf67b8777ff7e
|
src/nbsp-positions.js
|
src/nbsp-positions.js
|
'use strict';
var execall = require('regexp.execall');
module.exports = function (text) {
return execall(/ \w{1,2} [^ ]/g, text).map(function (match) {
return match.index + match[0].length - 2;
});
};
|
'use strict';
var execall = require('regexp.execall');
module.exports = function (text) {
return execall(/(^|\s\W*)(\w{1,2})(?= [^ ])/g, text)
.filter(function (match) {
return !/\d/.test(match[1]);
})
.map(function (match) {
return match.index + match[0].length;
});
};
|
Improve regular expression's overlapping and details
|
Improve regular expression's overlapping and details
|
JavaScript
|
mit
|
eush77/nbsp-advisor
|
javascript
|
## Code Before:
'use strict';
var execall = require('regexp.execall');
module.exports = function (text) {
return execall(/ \w{1,2} [^ ]/g, text).map(function (match) {
return match.index + match[0].length - 2;
});
};
## Instruction:
Improve regular expression's overlapping and details
## Code After:
'use strict';
var execall = require('regexp.execall');
module.exports = function (text) {
return execall(/(^|\s\W*)(\w{1,2})(?= [^ ])/g, text)
.filter(function (match) {
return !/\d/.test(match[1]);
})
.map(function (match) {
return match.index + match[0].length;
});
};
|
18dbcfa13ba598b97b3396f90bef0833954eb5bb
|
src/Rectangle.js
|
src/Rectangle.js
|
import Shape from 'kittik-shape-basic';
/**
* Implements rectangle shape with text support.
*
* @since 1.0.0
* @version 1.0.0
*/
export default class Rectangle extends Shape {
render(cursor) {
let text = this.getText();
let width = this.getWidth();
let height = this.getHeight();
let x1 = this.getX();
let y1 = this.getY();
let x2 = x1 + width - 1;
let y2 = y1 + height - 1;
let background = this.getBackground();
let foreground = this.getForeground();
let filler = ' '.repeat(width);
if (typeof background !== 'undefined') cursor.background(background);
if (typeof foreground !== 'undefined') cursor.foreground(foreground);
cursor.moveTo(x1, y1);
while (y1 <= y2) {
cursor.write(filler);
cursor.moveTo(x1, ++y1);
}
cursor.moveTo(x1 + (width / 2 - text.length / 2), this.getY() + (height / 2)).write(text);
return this;
}
}
|
import Shape from 'kittik-shape-basic';
/**
* Implements rectangle shape with text support.
*
* @since 1.0.0
* @version 1.0.0
*/
export default class Rectangle extends Shape {
render(cursor) {
let text = this.getText();
let width = this.getWidth();
let height = this.getHeight();
let x1 = this.getX();
let y1 = this.getY();
let x2 = x1 + width;
let y2 = y1 + height;
let background = this.getBackground();
let foreground = this.getForeground();
let filler = ' '.repeat(width);
if (typeof background !== 'undefined') cursor.background(background);
if (typeof foreground !== 'undefined') cursor.foreground(foreground);
cursor.moveTo(x1, y1);
for (let y = y1; y <= y2; y++) {
cursor.write(filler);
cursor.moveTo(x1, y);
}
cursor.moveTo(x1 + (width / 2 - text.length / 2), y1 + (height / 2)).write(text);
return this;
}
}
|
Simplify logic where calculates coordinates
|
fix(shape): Simplify logic where calculates coordinates
|
JavaScript
|
mit
|
kittikjs/shape-rectangle
|
javascript
|
## Code Before:
import Shape from 'kittik-shape-basic';
/**
* Implements rectangle shape with text support.
*
* @since 1.0.0
* @version 1.0.0
*/
export default class Rectangle extends Shape {
render(cursor) {
let text = this.getText();
let width = this.getWidth();
let height = this.getHeight();
let x1 = this.getX();
let y1 = this.getY();
let x2 = x1 + width - 1;
let y2 = y1 + height - 1;
let background = this.getBackground();
let foreground = this.getForeground();
let filler = ' '.repeat(width);
if (typeof background !== 'undefined') cursor.background(background);
if (typeof foreground !== 'undefined') cursor.foreground(foreground);
cursor.moveTo(x1, y1);
while (y1 <= y2) {
cursor.write(filler);
cursor.moveTo(x1, ++y1);
}
cursor.moveTo(x1 + (width / 2 - text.length / 2), this.getY() + (height / 2)).write(text);
return this;
}
}
## Instruction:
fix(shape): Simplify logic where calculates coordinates
## Code After:
import Shape from 'kittik-shape-basic';
/**
* Implements rectangle shape with text support.
*
* @since 1.0.0
* @version 1.0.0
*/
export default class Rectangle extends Shape {
render(cursor) {
let text = this.getText();
let width = this.getWidth();
let height = this.getHeight();
let x1 = this.getX();
let y1 = this.getY();
let x2 = x1 + width;
let y2 = y1 + height;
let background = this.getBackground();
let foreground = this.getForeground();
let filler = ' '.repeat(width);
if (typeof background !== 'undefined') cursor.background(background);
if (typeof foreground !== 'undefined') cursor.foreground(foreground);
cursor.moveTo(x1, y1);
for (let y = y1; y <= y2; y++) {
cursor.write(filler);
cursor.moveTo(x1, y);
}
cursor.moveTo(x1 + (width / 2 - text.length / 2), y1 + (height / 2)).write(text);
return this;
}
}
|
e8f5cc7745c94fc15e80a273705792d4381ace31
|
CONTRIBUTING.md
|
CONTRIBUTING.md
|
We’d love to accept your patches and contributions to this project. Please review the following guidelines you'll need to follow in order to make a contribution.
## Contributor License Agreement
All contributors to this project must have a signed Contributor License Agreement (**"CLA"**) on file with us. The CLA grants us the permissions we need to use and redistribute your contributions as part of the project; you or your employer retain the copyright to your contribution. Head over to https://cla.pivotal.io/ to see your current agreement(s) on file or to sign a new one.
We generally only need you (or your employer) to sign our CLA once and once signed, you should be able to submit contributions to any Pivotal project.
Note: if you would like to submit an "_obvious fix_" for something like a typo, formatting issue or spelling mistake, you may not need to sign the CLA. Please see our information on [obvious fixes](https://cla.pivotal.io/about#obvious-fix) for more details.
## Code reviews
All submissions, including submissions by project members, require review and we use GitHub's pull requests for this purpose. Please consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) if you need more information about using pull requests.
|
:+1::tada: We’d love to accept your patches and contributions to this project. :+1::tada:
Please review the following guidelines you'll need to follow in order to make a contribution.
## Contributor License Agreement
All contributors to this project must have a signed Contributor License Agreement (**"CLA"**) on file with us. The CLA grants us the permissions we need to use and redistribute your contributions as part of the project; you or your employer retain the copyright to your contribution. Head over to https://cla.pivotal.io/ to see your current agreement(s) on file or to sign a new one.
We generally only need you (or your employer) to sign our CLA once and once signed, you should be able to submit contributions to any Pivotal project.
Note: if you would like to submit an "_obvious fix_" for something like a typo, formatting issue or spelling mistake, you may not need to sign the CLA. Please see our information on [obvious fixes](https://cla.pivotal.io/about#obvious-fix) for more details.
## Code reviews
All submissions, including submissions by project members, require review and we use GitHub's pull requests for this purpose. Please consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) if you need more information about using pull requests.
## Code style
Please carefully follow the whitespace and formatting conventions already
present in the codebase. Here is a short summary of the style:
1. Tabs (smart tabs), not spaces
2. Unix (LF), not DOS (CRLF) line endings
3. Eliminate all trailing whitespace
4. Wrap Javadoc at 120 characters
5. Aim to wrap code at 120 characters, but favor readability over wrapping
6. Preserve existing formatting; i.e. do not reformat code for its own sake
7. Open brackets on same line, close brackets isolated on a dedicated new line
8. `else`, `catch`, `finally` on a new line
|
Add code style expectations for the contributions
|
Add code style expectations for the contributions
|
Markdown
|
apache-2.0
|
reactor/reactor-netty,reactor/reactor-netty
|
markdown
|
## Code Before:
We’d love to accept your patches and contributions to this project. Please review the following guidelines you'll need to follow in order to make a contribution.
## Contributor License Agreement
All contributors to this project must have a signed Contributor License Agreement (**"CLA"**) on file with us. The CLA grants us the permissions we need to use and redistribute your contributions as part of the project; you or your employer retain the copyright to your contribution. Head over to https://cla.pivotal.io/ to see your current agreement(s) on file or to sign a new one.
We generally only need you (or your employer) to sign our CLA once and once signed, you should be able to submit contributions to any Pivotal project.
Note: if you would like to submit an "_obvious fix_" for something like a typo, formatting issue or spelling mistake, you may not need to sign the CLA. Please see our information on [obvious fixes](https://cla.pivotal.io/about#obvious-fix) for more details.
## Code reviews
All submissions, including submissions by project members, require review and we use GitHub's pull requests for this purpose. Please consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) if you need more information about using pull requests.
## Instruction:
Add code style expectations for the contributions
## Code After:
:+1::tada: We’d love to accept your patches and contributions to this project. :+1::tada:
Please review the following guidelines you'll need to follow in order to make a contribution.
## Contributor License Agreement
All contributors to this project must have a signed Contributor License Agreement (**"CLA"**) on file with us. The CLA grants us the permissions we need to use and redistribute your contributions as part of the project; you or your employer retain the copyright to your contribution. Head over to https://cla.pivotal.io/ to see your current agreement(s) on file or to sign a new one.
We generally only need you (or your employer) to sign our CLA once and once signed, you should be able to submit contributions to any Pivotal project.
Note: if you would like to submit an "_obvious fix_" for something like a typo, formatting issue or spelling mistake, you may not need to sign the CLA. Please see our information on [obvious fixes](https://cla.pivotal.io/about#obvious-fix) for more details.
## Code reviews
All submissions, including submissions by project members, require review and we use GitHub's pull requests for this purpose. Please consult [GitHub Help](https://help.github.com/articles/about-pull-requests/) if you need more information about using pull requests.
## Code style
Please carefully follow the whitespace and formatting conventions already
present in the codebase. Here is a short summary of the style:
1. Tabs (smart tabs), not spaces
2. Unix (LF), not DOS (CRLF) line endings
3. Eliminate all trailing whitespace
4. Wrap Javadoc at 120 characters
5. Aim to wrap code at 120 characters, but favor readability over wrapping
6. Preserve existing formatting; i.e. do not reformat code for its own sake
7. Open brackets on same line, close brackets isolated on a dedicated new line
8. `else`, `catch`, `finally` on a new line
|
fc15117588cb1a9d6022e7ffd068e1f6b2b7b38d
|
lib/happy-helpers/templates.rb
|
lib/happy-helpers/templates.rb
|
require 'tilt'
module HappyHelpers
module Templates
def self.render(name, scope = nil, variables = {}, &block)
load("views/%s" % name).render(scope, variables, &block)
end
def self.load(name)
if false # Freddie.env.production?
@templates ||= {}
@templates[name] ||= Tilt.new(name, :default_encoding => 'utf-8')
else
Tilt.new(name, :default_encoding => 'utf-8')
end
end
end
end
|
require 'tilt'
module HappyHelpers
module Templates
def self.render(name, scope = nil, variables = {}, &block)
load(name).render(scope, variables, &block)
end
def self.load(name)
name = File.expand_path(name)
if false # Freddie.env.production?
@templates ||= {}
@templates[name] ||= Tilt.new(name, :default_encoding => 'utf-8')
else
Tilt.new(name, :default_encoding => 'utf-8')
end
end
end
end
|
Remove hardcoded "views/" view path.
|
Remove hardcoded "views/" view path.
|
Ruby
|
mit
|
hmans/happy-helpers
|
ruby
|
## Code Before:
require 'tilt'
module HappyHelpers
module Templates
def self.render(name, scope = nil, variables = {}, &block)
load("views/%s" % name).render(scope, variables, &block)
end
def self.load(name)
if false # Freddie.env.production?
@templates ||= {}
@templates[name] ||= Tilt.new(name, :default_encoding => 'utf-8')
else
Tilt.new(name, :default_encoding => 'utf-8')
end
end
end
end
## Instruction:
Remove hardcoded "views/" view path.
## Code After:
require 'tilt'
module HappyHelpers
module Templates
def self.render(name, scope = nil, variables = {}, &block)
load(name).render(scope, variables, &block)
end
def self.load(name)
name = File.expand_path(name)
if false # Freddie.env.production?
@templates ||= {}
@templates[name] ||= Tilt.new(name, :default_encoding => 'utf-8')
else
Tilt.new(name, :default_encoding => 'utf-8')
end
end
end
end
|
c8e99fa4baba7779368ffcbb95a83cd76493a462
|
_includes/masthead.html
|
_includes/masthead.html
|
{% include base_path %}
<div class="masthead">
<div class="masthead__inner-wrap">
<img src="{{ base_path }}/images/moosefood-banner-1024x188.jpg">
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
<button><div class="navicon"></div></button>
<ul class="visible-links">
<li class="masthead__menu-item masthead__menu-item--lg"><a href="{{ base_path }}/">{{ site.title }}</a></li>
{% for link in site.data.navigation.main %}
{% if link.url contains 'http' %}
{% assign domain = '' %}
{% else %}
{% assign domain = base_path %}
{% endif %}
<li class="masthead__menu-item"><a href="{{ domain }}{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
<ul class="hidden-links hidden"></ul>
</nav>
</div>
</div>
</div>
|
{% include base_path %}
<div class="masthead">
<div class="masthead__inner-wrap">
<a href="{{ base_path }}/"><img src="{{ base_path }}/images/moosefood-banner-1024x188.jpg"></a>
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
<button><div class="navicon"></div></button>
<ul class="visible-links">
<li class="masthead__menu-item masthead__menu-item--lg"><a href="{{ base_path }}/">{{ site.title }}</a></li>
{% for link in site.data.navigation.main %}
{% if link.url contains 'http' %}
{% assign domain = '' %}
{% else %}
{% assign domain = base_path %}
{% endif %}
<li class="masthead__menu-item"><a href="{{ domain }}{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
<ul class="hidden-links hidden"></ul>
</nav>
</div>
</div>
</div>
|
Add link to homepage surrounding banner image
|
Add link to homepage surrounding banner image
|
HTML
|
mit
|
jengalas/thegourmetmoose,jengalas/thegourmetmoose,jengalas/thegourmetmoose
|
html
|
## Code Before:
{% include base_path %}
<div class="masthead">
<div class="masthead__inner-wrap">
<img src="{{ base_path }}/images/moosefood-banner-1024x188.jpg">
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
<button><div class="navicon"></div></button>
<ul class="visible-links">
<li class="masthead__menu-item masthead__menu-item--lg"><a href="{{ base_path }}/">{{ site.title }}</a></li>
{% for link in site.data.navigation.main %}
{% if link.url contains 'http' %}
{% assign domain = '' %}
{% else %}
{% assign domain = base_path %}
{% endif %}
<li class="masthead__menu-item"><a href="{{ domain }}{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
<ul class="hidden-links hidden"></ul>
</nav>
</div>
</div>
</div>
## Instruction:
Add link to homepage surrounding banner image
## Code After:
{% include base_path %}
<div class="masthead">
<div class="masthead__inner-wrap">
<a href="{{ base_path }}/"><img src="{{ base_path }}/images/moosefood-banner-1024x188.jpg"></a>
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
<button><div class="navicon"></div></button>
<ul class="visible-links">
<li class="masthead__menu-item masthead__menu-item--lg"><a href="{{ base_path }}/">{{ site.title }}</a></li>
{% for link in site.data.navigation.main %}
{% if link.url contains 'http' %}
{% assign domain = '' %}
{% else %}
{% assign domain = base_path %}
{% endif %}
<li class="masthead__menu-item"><a href="{{ domain }}{{ link.url }}">{{ link.title }}</a></li>
{% endfor %}
</ul>
<ul class="hidden-links hidden"></ul>
</nav>
</div>
</div>
</div>
|
4c927b055f5ea0f1095ed5a6eb68253f0c004733
|
src/Conversation/Conversation.js
|
src/Conversation/Conversation.js
|
import React, { PropTypes } from 'react';
import Messages from '../Messages/Messages';
class Conversation extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
messages: [],
messagesToBeDisplayed: props.messages
};
}
componentDidMount() {
this.timer = setInterval(this.showMessage, 1000);
}
componentWillUnMount() {
clearInterval(this.timer);
}
showMessage = () => {
// has duration passed
// dispatch show message
var messages = this.state.messages;
var messagesToBeDisplayed = this.state.messagesToBeDisplayed;
messages.push(this.state.messagesToBeDisplayed.pop());
this.setState({
messages,
messagesToBeDisplayed
});
}
componentDidUpdate() {
console.log('DID UPDATE')
}
render() {
return (
<div>
<Messages messages={this.state.messages} />
</div>
);
}
}
Conversation.propTypes = {
messages: PropTypes.arrayOf(
PropTypes.shape({
message: PropTypes.string.isRequired,
from: PropTypes.string.isRequired,
backColor: PropTypes.string.isRequired
})
).isRequired
}
export default Conversation;
|
import React, { PropTypes } from 'react';
import Messages from '../Messages/Messages';
class Conversation extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
messages: [],
messagesToBeDisplayed: props.messages
};
}
componentDidMount() {
this.timer = setInterval(this.showMessage, 1000);
}
componentWillUnMount() {
clearInterval(this.timer);
}
showMessage = () => {
// has duration passed
// dispatch show message
var messages = this.state.messages;
var messagesToBeDisplayed = this.state.messagesToBeDisplayed;
if (this.state.messagesToBeDisplayed.length === 0) {
clearInterval(this.timer);
} else {
messages.push(this.state.messagesToBeDisplayed.pop());
this.setState({
messages,
messagesToBeDisplayed
});
}
}
componentDidUpdate() {
console.log('DID UPDATE')
}
render() {
return (
<div>
<Messages messages={this.state.messages} />
</div>
);
}
}
Conversation.propTypes = {
messages: PropTypes.arrayOf(
PropTypes.shape({
message: PropTypes.string.isRequired,
from: PropTypes.string.isRequired,
backColor: PropTypes.string.isRequired
})
).isRequired
}
export default Conversation;
|
Stop the interval when all messages have been displadyed
|
Stop the interval when all messages have been displadyed
|
JavaScript
|
mit
|
sevenleaps/chat-template,sevenleaps/chat-template
|
javascript
|
## Code Before:
import React, { PropTypes } from 'react';
import Messages from '../Messages/Messages';
class Conversation extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
messages: [],
messagesToBeDisplayed: props.messages
};
}
componentDidMount() {
this.timer = setInterval(this.showMessage, 1000);
}
componentWillUnMount() {
clearInterval(this.timer);
}
showMessage = () => {
// has duration passed
// dispatch show message
var messages = this.state.messages;
var messagesToBeDisplayed = this.state.messagesToBeDisplayed;
messages.push(this.state.messagesToBeDisplayed.pop());
this.setState({
messages,
messagesToBeDisplayed
});
}
componentDidUpdate() {
console.log('DID UPDATE')
}
render() {
return (
<div>
<Messages messages={this.state.messages} />
</div>
);
}
}
Conversation.propTypes = {
messages: PropTypes.arrayOf(
PropTypes.shape({
message: PropTypes.string.isRequired,
from: PropTypes.string.isRequired,
backColor: PropTypes.string.isRequired
})
).isRequired
}
export default Conversation;
## Instruction:
Stop the interval when all messages have been displadyed
## Code After:
import React, { PropTypes } from 'react';
import Messages from '../Messages/Messages';
class Conversation extends React.Component {
constructor(props, context) {
super(props, context);
this.state = {
messages: [],
messagesToBeDisplayed: props.messages
};
}
componentDidMount() {
this.timer = setInterval(this.showMessage, 1000);
}
componentWillUnMount() {
clearInterval(this.timer);
}
showMessage = () => {
// has duration passed
// dispatch show message
var messages = this.state.messages;
var messagesToBeDisplayed = this.state.messagesToBeDisplayed;
if (this.state.messagesToBeDisplayed.length === 0) {
clearInterval(this.timer);
} else {
messages.push(this.state.messagesToBeDisplayed.pop());
this.setState({
messages,
messagesToBeDisplayed
});
}
}
componentDidUpdate() {
console.log('DID UPDATE')
}
render() {
return (
<div>
<Messages messages={this.state.messages} />
</div>
);
}
}
Conversation.propTypes = {
messages: PropTypes.arrayOf(
PropTypes.shape({
message: PropTypes.string.isRequired,
from: PropTypes.string.isRequired,
backColor: PropTypes.string.isRequired
})
).isRequired
}
export default Conversation;
|
df4b07c6525a0c40eba4e0043af4e201d08e88e4
|
src/shogun2-core/shogun2-service/src/main/java/de/terrestris/shogun2/service/AbstractCrudService.java
|
src/shogun2-core/shogun2-service/src/main/java/de/terrestris/shogun2/service/AbstractCrudService.java
|
package de.terrestris.shogun2.service;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import de.terrestris.shogun2.model.PersistentObject;
/**
* This abstract service class provides basic CRUD functionality.
*
* @author Nils Bühner
* @see AbstractDaoService
*
*/
public abstract class AbstractCrudService<E extends PersistentObject> extends
AbstractDaoService<E> {
/**
*
* @param e
* @return
*/
@Transactional(readOnly = false)
public E saveOrUpdate(E e) {
dao.saveOrUpdate(e);
return e;
}
/**
*
* @param id
* @return
*/
public E findById(Integer id) {
return dao.findById(id);
}
/**
*
* @return
*/
public List<E> findAll() {
return dao.findAll();
}
/**
*
* @param e
*/
@Transactional(readOnly = false)
public void delete(E e) {
dao.delete(e);
}
}
|
package de.terrestris.shogun2.service;
import java.util.List;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.security.access.prepost.PostFilter;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import de.terrestris.shogun2.model.PersistentObject;
/**
* This abstract service class provides basic CRUD functionality.
*
* @author Nils Bühner
* @see AbstractDaoService
*
*/
public abstract class AbstractCrudService<E extends PersistentObject> extends
AbstractDaoService<E> {
/**
*
* @param e
* @return
*/
@Transactional(readOnly = false)
@PreAuthorize("isAuthenticated()")
public E saveOrUpdate(E e) {
dao.saveOrUpdate(e);
return e;
}
/**
*
* @param id
* @return
*/
@PostAuthorize("hasPermission(returnObject, 'READ')")
public E findById(Integer id) {
return dao.findById(id);
}
/**
*
* @return
*/
@PostFilter("hasPermission(filterObject, 'READ')")
public List<E> findAll() {
return dao.findAll();
}
/**
*
* @param e
*/
@PreAuthorize("hasPermission(#e, 'DELETE')")
@Transactional(readOnly = false)
public void delete(E e) {
dao.delete(e);
}
}
|
Add basic security annotations to the CRUD service
|
Add basic security annotations to the CRUD service
|
Java
|
apache-2.0
|
annarieger/shogun2,annarieger/shogun2,buehner/shogun2,marcjansen/shogun2,terrestris/shogun2,ahennr/shogun2,dnlkoch/shogun2,annarieger/shogun2,buehner/shogun2,terrestris/shogun2,marcjansen/shogun2,dnlkoch/shogun2,ahennr/shogun2,terrestris/shogun2,ahennr/shogun2,marcjansen/shogun2,dnlkoch/shogun2,buehner/shogun2
|
java
|
## Code Before:
package de.terrestris.shogun2.service;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
import de.terrestris.shogun2.model.PersistentObject;
/**
* This abstract service class provides basic CRUD functionality.
*
* @author Nils Bühner
* @see AbstractDaoService
*
*/
public abstract class AbstractCrudService<E extends PersistentObject> extends
AbstractDaoService<E> {
/**
*
* @param e
* @return
*/
@Transactional(readOnly = false)
public E saveOrUpdate(E e) {
dao.saveOrUpdate(e);
return e;
}
/**
*
* @param id
* @return
*/
public E findById(Integer id) {
return dao.findById(id);
}
/**
*
* @return
*/
public List<E> findAll() {
return dao.findAll();
}
/**
*
* @param e
*/
@Transactional(readOnly = false)
public void delete(E e) {
dao.delete(e);
}
}
## Instruction:
Add basic security annotations to the CRUD service
## Code After:
package de.terrestris.shogun2.service;
import java.util.List;
import org.springframework.security.access.prepost.PostAuthorize;
import org.springframework.security.access.prepost.PostFilter;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import de.terrestris.shogun2.model.PersistentObject;
/**
* This abstract service class provides basic CRUD functionality.
*
* @author Nils Bühner
* @see AbstractDaoService
*
*/
public abstract class AbstractCrudService<E extends PersistentObject> extends
AbstractDaoService<E> {
/**
*
* @param e
* @return
*/
@Transactional(readOnly = false)
@PreAuthorize("isAuthenticated()")
public E saveOrUpdate(E e) {
dao.saveOrUpdate(e);
return e;
}
/**
*
* @param id
* @return
*/
@PostAuthorize("hasPermission(returnObject, 'READ')")
public E findById(Integer id) {
return dao.findById(id);
}
/**
*
* @return
*/
@PostFilter("hasPermission(filterObject, 'READ')")
public List<E> findAll() {
return dao.findAll();
}
/**
*
* @param e
*/
@PreAuthorize("hasPermission(#e, 'DELETE')")
@Transactional(readOnly = false)
public void delete(E e) {
dao.delete(e);
}
}
|
8d0243a52d23037045d310beb94e94bd4e25e152
|
bosh_cli/lib/cli/file_with_progress_bar.rb
|
bosh_cli/lib/cli/file_with_progress_bar.rb
|
module Bosh
module Cli
class FileWithProgressBar < ::File
def progress_bar
return @progress_bar if @progress_bar
out = Bosh::Cli::Config.output || StringIO.new
@progress_bar = ProgressBar.new(file_name, size, out)
@progress_bar.file_transfer_mode
@progress_bar
end
def file_name
File.basename(self.path)
end
def stop_progress_bar
progress_bar.halt unless progress_bar.finished?
end
def size
@size || File.size(self.path)
end
def size=(size)
@size=size
end
def read(*args)
result = super(*args)
if result && result.size > 0
progress_bar.inc(result.size)
else
progress_bar.finish
end
result
end
def write(*args)
count = super(*args)
if count
progress_bar.inc(count)
else
progress_bar.finish
end
count
end
end
end
end
|
module Bosh
module Cli
class FileWithProgressBar < ::File
def progress_bar
return @progress_bar if @progress_bar
out = Bosh::Cli::Config.output || StringIO.new
@progress_bar = ProgressBar.new(file_name, size, out)
@progress_bar.file_transfer_mode
@progress_bar
end
def file_name
File.basename(self.path)
end
def stop_progress_bar
progress_bar.halt unless progress_bar.finished?
end
def size
@size || File.size(self.path)
end
def size=(size)
@size=size
end
def read(*args)
result = super(*args)
if result && result.size > 0
progress_bar.inc(result.size)
else
progress_bar.set(size)
progress_bar.finish
end
result
end
def write(*args)
count = super(*args)
if count
progress_bar.inc(count)
else
progress_bar.set(size)
progress_bar.finish
end
count
end
end
end
end
|
Make sure the progress bar goes to 100%
|
Make sure the progress bar goes to 100%
No one likes it when an operation ends and the progress bar never went all the way to 100%. @zachgersh was showing me some concourseci output and the progress bars always ended at 96%. Rather than sort out exactly why the chunks never match up exactly, just set the progress bar to 100% when we're done.
|
Ruby
|
apache-2.0
|
barthy1/bosh,barthy1/bosh,barthy1/bosh,barthy1/bosh
|
ruby
|
## Code Before:
module Bosh
module Cli
class FileWithProgressBar < ::File
def progress_bar
return @progress_bar if @progress_bar
out = Bosh::Cli::Config.output || StringIO.new
@progress_bar = ProgressBar.new(file_name, size, out)
@progress_bar.file_transfer_mode
@progress_bar
end
def file_name
File.basename(self.path)
end
def stop_progress_bar
progress_bar.halt unless progress_bar.finished?
end
def size
@size || File.size(self.path)
end
def size=(size)
@size=size
end
def read(*args)
result = super(*args)
if result && result.size > 0
progress_bar.inc(result.size)
else
progress_bar.finish
end
result
end
def write(*args)
count = super(*args)
if count
progress_bar.inc(count)
else
progress_bar.finish
end
count
end
end
end
end
## Instruction:
Make sure the progress bar goes to 100%
No one likes it when an operation ends and the progress bar never went all the way to 100%. @zachgersh was showing me some concourseci output and the progress bars always ended at 96%. Rather than sort out exactly why the chunks never match up exactly, just set the progress bar to 100% when we're done.
## Code After:
module Bosh
module Cli
class FileWithProgressBar < ::File
def progress_bar
return @progress_bar if @progress_bar
out = Bosh::Cli::Config.output || StringIO.new
@progress_bar = ProgressBar.new(file_name, size, out)
@progress_bar.file_transfer_mode
@progress_bar
end
def file_name
File.basename(self.path)
end
def stop_progress_bar
progress_bar.halt unless progress_bar.finished?
end
def size
@size || File.size(self.path)
end
def size=(size)
@size=size
end
def read(*args)
result = super(*args)
if result && result.size > 0
progress_bar.inc(result.size)
else
progress_bar.set(size)
progress_bar.finish
end
result
end
def write(*args)
count = super(*args)
if count
progress_bar.inc(count)
else
progress_bar.set(size)
progress_bar.finish
end
count
end
end
end
end
|
7584aafb4732deb0428e07376719ab4140c0cd84
|
tests/isolate/isolate2_negative_test.dart
|
tests/isolate/isolate2_negative_test.dart
|
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Dart test program for testing that exceptions in other isolates bring down
// the program.
#library('Isolate2NegativeTest');
#import('dart:isolate');
#import('../../lib/unittest/unittest.dart');
void entry() {
throw "foo";
}
main() {
test("catch exception from other isolate", () {
spawnFunction(entry);
});
}
|
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Dart test program for testing that exceptions in other isolates bring down
// the program.
#library('Isolate2NegativeTest');
#import('dart:isolate');
void entry() {
throw "foo";
}
main() {
SendPort port = spawnFunction(entry);
}
|
Fix negative test by not complicating it by using the unit test framework.
|
Fix negative test by not complicating it by using the unit test framework.
[email protected]
BUG=
Review URL: https://chromiumcodereview.appspot.com//10828145
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@10215 260f80e4-7a28-3924-810f-c04153c831b5
|
Dart
|
bsd-3-clause
|
dartino/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dartino/dart-sdk
|
dart
|
## Code Before:
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Dart test program for testing that exceptions in other isolates bring down
// the program.
#library('Isolate2NegativeTest');
#import('dart:isolate');
#import('../../lib/unittest/unittest.dart');
void entry() {
throw "foo";
}
main() {
test("catch exception from other isolate", () {
spawnFunction(entry);
});
}
## Instruction:
Fix negative test by not complicating it by using the unit test framework.
[email protected]
BUG=
Review URL: https://chromiumcodereview.appspot.com//10828145
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@10215 260f80e4-7a28-3924-810f-c04153c831b5
## Code After:
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Dart test program for testing that exceptions in other isolates bring down
// the program.
#library('Isolate2NegativeTest');
#import('dart:isolate');
void entry() {
throw "foo";
}
main() {
SendPort port = spawnFunction(entry);
}
|
0f999232b847b3f4de0d61700303becf87197be5
|
cmake_has_regex_test.cpp
|
cmake_has_regex_test.cpp
|
int main()
{
std::regex r(R"(\s*(SIGNAL|SLOT)\s*\(\s*(.+)\s*\(.*)");
return 0;
}
|
/*
This file is part of the clang-lazy static checker.
Copyright (C) 2015 Sergio Martins <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <regex>
int main()
{
std::regex r(R"(\s*(SIGNAL|SLOT)\s*\(\s*(.+)\s*\(.*)");
return 0;
}
|
Add license to this test file so license checkers don't complain
|
Add license to this test file so license checkers don't complain
|
C++
|
lgpl-2.1
|
nyalldawson/clazy,nyalldawson/clazy,nyalldawson/clazy,nyalldawson/clazy
|
c++
|
## Code Before:
int main()
{
std::regex r(R"(\s*(SIGNAL|SLOT)\s*\(\s*(.+)\s*\(.*)");
return 0;
}
## Instruction:
Add license to this test file so license checkers don't complain
## Code After:
/*
This file is part of the clang-lazy static checker.
Copyright (C) 2015 Sergio Martins <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#include <regex>
int main()
{
std::regex r(R"(\s*(SIGNAL|SLOT)\s*\(\s*(.+)\s*\(.*)");
return 0;
}
|
f8a5aa4e2f2d360634b5902882ad8173b57de314
|
.travis.yml
|
.travis.yml
|
language: python
python:
- "2.7"
env:
- NUMPY_VERSION=1.8
- NUMPY_VERSION=1.7
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/anaconda/bin:$PATH
# Update conda itself
- conda update --yes conda
install:
- conda create --yes -n env_name python=$TRAVIS_PYTHON_VERSION pip numpy=$NUMPY_VERSION scipy matplotlib nose pep8 Sphinx
- source activate env_name
- pip install sphinx-bootstrap-theme future
- pip install -e . --no-deps
script:
- nosetests --with-doctest
- pep8 skbio setup.py
- pushd doc
- make clean
- make html
- make linkcheck
- popd
|
language: python
python:
- "2.7"
env:
- NUMPY_VERSION=1.8
- NUMPY_VERSION=1.8 USE_CYTHON=True
- NUMPY_VERSION=1.7
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/anaconda/bin:$PATH
# Update conda itself
- conda update --yes conda
install:
- conda create --yes -n env_name python=$TRAVIS_PYTHON_VERSION pip numpy=$NUMPY_VERSION scipy matplotlib nose pep8 Sphinx
- if [ ${USE_CYTHON}]; then conda install -n env_name cython; fi
- source activate env_name
- pip install sphinx-bootstrap-theme future
- pip install -e . --no-deps
script:
- nosetests --with-doctest
- pep8 skbio setup.py
- pushd doc
- make clean
- make html
- make linkcheck
- popd
|
Add another build that regenerates '.c' files from '.pyx'.
|
TST: Add another build that regenerates '.c' files from '.pyx'.
|
YAML
|
bsd-3-clause
|
jdrudolph/scikit-bio,colinbrislawn/scikit-bio,anderspitman/scikit-bio,jairideout/scikit-bio,wdwvt1/scikit-bio,jensreeder/scikit-bio,gregcaporaso/scikit-bio,xguse/scikit-bio,johnchase/scikit-bio,jensreeder/scikit-bio,colinbrislawn/scikit-bio,johnchase/scikit-bio,corburn/scikit-bio,jairideout/scikit-bio,jdrudolph/scikit-bio,wdwvt1/scikit-bio,SamStudio8/scikit-bio,demis001/scikit-bio,corburn/scikit-bio,averagehat/scikit-bio,Achuth17/scikit-bio,averagehat/scikit-bio,Kleptobismol/scikit-bio,SamStudio8/scikit-bio,Kleptobismol/scikit-bio,gregcaporaso/scikit-bio,kdmurray91/scikit-bio,Achuth17/scikit-bio,kdmurray91/scikit-bio,xguse/scikit-bio,demis001/scikit-bio,anderspitman/scikit-bio,Kleptobismol/scikit-bio
|
yaml
|
## Code Before:
language: python
python:
- "2.7"
env:
- NUMPY_VERSION=1.8
- NUMPY_VERSION=1.7
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/anaconda/bin:$PATH
# Update conda itself
- conda update --yes conda
install:
- conda create --yes -n env_name python=$TRAVIS_PYTHON_VERSION pip numpy=$NUMPY_VERSION scipy matplotlib nose pep8 Sphinx
- source activate env_name
- pip install sphinx-bootstrap-theme future
- pip install -e . --no-deps
script:
- nosetests --with-doctest
- pep8 skbio setup.py
- pushd doc
- make clean
- make html
- make linkcheck
- popd
## Instruction:
TST: Add another build that regenerates '.c' files from '.pyx'.
## Code After:
language: python
python:
- "2.7"
env:
- NUMPY_VERSION=1.8
- NUMPY_VERSION=1.8 USE_CYTHON=True
- NUMPY_VERSION=1.7
before_install:
- wget http://repo.continuum.io/miniconda/Miniconda-2.2.2-Linux-x86_64.sh -O miniconda.sh
- chmod +x miniconda.sh
- ./miniconda.sh -b
- export PATH=/home/travis/anaconda/bin:$PATH
# Update conda itself
- conda update --yes conda
install:
- conda create --yes -n env_name python=$TRAVIS_PYTHON_VERSION pip numpy=$NUMPY_VERSION scipy matplotlib nose pep8 Sphinx
- if [ ${USE_CYTHON}]; then conda install -n env_name cython; fi
- source activate env_name
- pip install sphinx-bootstrap-theme future
- pip install -e . --no-deps
script:
- nosetests --with-doctest
- pep8 skbio setup.py
- pushd doc
- make clean
- make html
- make linkcheck
- popd
|
1bd2883368b0c3d51a1e0b46c3e3da86d8c9295d
|
recipes/r-dbchip/meta.yaml
|
recipes/r-dbchip/meta.yaml
|
package:
name: r-dbchip
version: "1.1.6"
source:
fn: DBChIP_1.1.6.tar.gz
url: http://pages.cs.wisc.edu/~kliang/DBChIP/DBChIP_1.1.6.tar.gz
md5: f4b22bb2051ad6b2d33d4687754e8cee
build:
number: 0
# This is required to make R link correctly on Linux.
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- bioconductor-deseq
- bioconductor-edger
run:
- bioconductor-deseq
- bioconductor-edger
test:
commands:
- $R -e "library('DBChIP')" # [not win]
about:
home: http://pages.cs.wisc.edu/~kliang/DBChIP
license: 'GPL (>= 2)'
summary: 'ChIP-seq differential binding'
|
package:
name: r-dbchip
version: "1.1.6"
source:
fn: DBChIP_1.1.6.tar.gz
url: http://pages.cs.wisc.edu/~kliang/DBChIP/DBChIP_1.1.6.tar.gz
md5: f4b22bb2051ad6b2d33d4687754e8cee
build:
number: 1
# This is required to make R link correctly on Linux.
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- r
- bioconductor-deseq
- bioconductor-edger
run:
- r
- bioconductor-deseq
- bioconductor-edger
test:
commands:
- $R -e "library('DBChIP')" # [not win]
about:
home: http://pages.cs.wisc.edu/~kliang/DBChIP
license: 'GPL (>= 2)'
summary: 'ChIP-seq differential binding'
|
Add explicit build/run r requirement
|
Add explicit build/run r requirement
|
YAML
|
mit
|
acaprez/recipes,ivirshup/bioconda-recipes,jasper1918/bioconda-recipes,daler/bioconda-recipes,jfallmann/bioconda-recipes,gvlproject/bioconda-recipes,rob-p/bioconda-recipes,JenCabral/bioconda-recipes,joachimwolff/bioconda-recipes,phac-nml/bioconda-recipes,JenCabral/bioconda-recipes,saketkc/bioconda-recipes,ivirshup/bioconda-recipes,matthdsm/bioconda-recipes,pinguinkiste/bioconda-recipes,CGATOxford/bioconda-recipes,saketkc/bioconda-recipes,cokelaer/bioconda-recipes,shenwei356/bioconda-recipes,Luobiny/bioconda-recipes,blankenberg/bioconda-recipes,colinbrislawn/bioconda-recipes,bioconda/recipes,zachcp/bioconda-recipes,CGATOxford/bioconda-recipes,JingchaoZhang/bioconda-recipes,HassanAmr/bioconda-recipes,mdehollander/bioconda-recipes,dmaticzka/bioconda-recipes,jfallmann/bioconda-recipes,lpantano/recipes,instituteofpathologyheidelberg/bioconda-recipes,abims-sbr/bioconda-recipes,mdehollander/bioconda-recipes,blankenberg/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,omicsnut/bioconda-recipes,rob-p/bioconda-recipes,gvlproject/bioconda-recipes,bioconda/recipes,jasper1918/bioconda-recipes,martin-mann/bioconda-recipes,peterjc/bioconda-recipes,mcornwell1957/bioconda-recipes,joachimwolff/bioconda-recipes,jfallmann/bioconda-recipes,daler/bioconda-recipes,mcornwell1957/bioconda-recipes,peterjc/bioconda-recipes,ThomasWollmann/bioconda-recipes,rvalieris/bioconda-recipes,keuv-grvl/bioconda-recipes,omicsnut/bioconda-recipes,bow/bioconda-recipes,peterjc/bioconda-recipes,zachcp/bioconda-recipes,mdehollander/bioconda-recipes,omicsnut/bioconda-recipes,gvlproject/bioconda-recipes,guowei-he/bioconda-recipes,rvalieris/bioconda-recipes,keuv-grvl/bioconda-recipes,bow/bioconda-recipes,ostrokach/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,HassanAmr/bioconda-recipes,mcornwell1957/bioconda-recipes,bow/bioconda-recipes,hardingnj/bioconda-recipes,matthdsm/bioconda-recipes,peterjc/bioconda-recipes,keuv-grvl/bioconda-recipes,xguse/bioconda-recipes,blankenberg/bioconda-recipes,zwanli/bioconda-recipes,rvalieris/bioconda-recipes,gregvonkuster/bioconda-recipes,zwanli/bioconda-recipes,saketkc/bioconda-recipes,cokelaer/bioconda-recipes,pinguinkiste/bioconda-recipes,cokelaer/bioconda-recipes,dmaticzka/bioconda-recipes,keuv-grvl/bioconda-recipes,JenCabral/bioconda-recipes,JingchaoZhang/bioconda-recipes,gregvonkuster/bioconda-recipes,colinbrislawn/bioconda-recipes,Luobiny/bioconda-recipes,bebatut/bioconda-recipes,bow/bioconda-recipes,CGATOxford/bioconda-recipes,lpantano/recipes,gregvonkuster/bioconda-recipes,pinguinkiste/bioconda-recipes,guowei-he/bioconda-recipes,rob-p/bioconda-recipes,colinbrislawn/bioconda-recipes,acaprez/recipes,rvalieris/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,oena/bioconda-recipes,jasper1918/bioconda-recipes,chapmanb/bioconda-recipes,dkoppstein/recipes,roryk/recipes,JingchaoZhang/bioconda-recipes,colinbrislawn/bioconda-recipes,zachcp/bioconda-recipes,gvlproject/bioconda-recipes,abims-sbr/bioconda-recipes,daler/bioconda-recipes,jfallmann/bioconda-recipes,colinbrislawn/bioconda-recipes,zwanli/bioconda-recipes,JenCabral/bioconda-recipes,dkoppstein/recipes,rob-p/bioconda-recipes,oena/bioconda-recipes,chapmanb/bioconda-recipes,mdehollander/bioconda-recipes,acaprez/recipes,joachimwolff/bioconda-recipes,chapmanb/bioconda-recipes,ThomasWollmann/bioconda-recipes,CGATOxford/bioconda-recipes,matthdsm/bioconda-recipes,hardingnj/bioconda-recipes,ostrokach/bioconda-recipes,hardingnj/bioconda-recipes,dmaticzka/bioconda-recipes,bebatut/bioconda-recipes,xguse/bioconda-recipes,instituteofpathologyheidelberg/bioconda-recipes,pinguinkiste/bioconda-recipes,chapmanb/bioconda-recipes,ivirshup/bioconda-recipes,shenwei356/bioconda-recipes,phac-nml/bioconda-recipes,martin-mann/bioconda-recipes,xguse/bioconda-recipes,joachimwolff/bioconda-recipes,npavlovikj/bioconda-recipes,phac-nml/bioconda-recipes,ostrokach/bioconda-recipes,jasper1918/bioconda-recipes,joachimwolff/bioconda-recipes,mdehollander/bioconda-recipes,yesimon/bioconda-recipes,roryk/recipes,ivirshup/bioconda-recipes,roryk/recipes,ostrokach/bioconda-recipes,ThomasWollmann/bioconda-recipes,JingchaoZhang/bioconda-recipes,ivirshup/bioconda-recipes,bioconda/recipes,saketkc/bioconda-recipes,pinguinkiste/bioconda-recipes,abims-sbr/bioconda-recipes,yesimon/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,yesimon/bioconda-recipes,joachimwolff/bioconda-recipes,shenwei356/bioconda-recipes,saketkc/bioconda-recipes,CGATOxford/bioconda-recipes,bebatut/bioconda-recipes,npavlovikj/bioconda-recipes,keuv-grvl/bioconda-recipes,zachcp/bioconda-recipes,matthdsm/bioconda-recipes,abims-sbr/bioconda-recipes,mcornwell1957/bioconda-recipes,ThomasWollmann/bioconda-recipes,saketkc/bioconda-recipes,Luobiny/bioconda-recipes,martin-mann/bioconda-recipes,guowei-he/bioconda-recipes,gvlproject/bioconda-recipes,bow/bioconda-recipes,ThomasWollmann/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,xguse/bioconda-recipes,yesimon/bioconda-recipes,bioconda/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,dkoppstein/recipes,instituteofpathologyheidelberg/bioconda-recipes,npavlovikj/bioconda-recipes,guowei-he/bioconda-recipes,npavlovikj/bioconda-recipes,chapmanb/bioconda-recipes,oena/bioconda-recipes,phac-nml/bioconda-recipes,rvalieris/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,bioconda/bioconda-recipes,lpantano/recipes,martin-mann/bioconda-recipes,shenwei356/bioconda-recipes,ThomasWollmann/bioconda-recipes,ostrokach/bioconda-recipes,JenCabral/bioconda-recipes,dmaticzka/bioconda-recipes,hardingnj/bioconda-recipes,blankenberg/bioconda-recipes,bioconda/bioconda-recipes,peterjc/bioconda-recipes,hardingnj/bioconda-recipes,daler/bioconda-recipes,Luobiny/bioconda-recipes,daler/bioconda-recipes,gvlproject/bioconda-recipes,pinguinkiste/bioconda-recipes,matthdsm/bioconda-recipes,mcornwell1957/bioconda-recipes,CGATOxford/bioconda-recipes,HassanAmr/bioconda-recipes,dmaticzka/bioconda-recipes,rvalieris/bioconda-recipes,abims-sbr/bioconda-recipes,ivirshup/bioconda-recipes,mdehollander/bioconda-recipes,JenCabral/bioconda-recipes,zwanli/bioconda-recipes,jasper1918/bioconda-recipes,keuv-grvl/bioconda-recipes,daler/bioconda-recipes,peterjc/bioconda-recipes,omicsnut/bioconda-recipes,HassanAmr/bioconda-recipes,zwanli/bioconda-recipes,omicsnut/bioconda-recipes,martin-mann/bioconda-recipes,gregvonkuster/bioconda-recipes,abims-sbr/bioconda-recipes,oena/bioconda-recipes,matthdsm/bioconda-recipes,lpantano/recipes,guowei-he/bioconda-recipes,dmaticzka/bioconda-recipes,zwanli/bioconda-recipes,oena/bioconda-recipes,bebatut/bioconda-recipes,bow/bioconda-recipes,HassanAmr/bioconda-recipes,ostrokach/bioconda-recipes,xguse/bioconda-recipes,phac-nml/bioconda-recipes,cokelaer/bioconda-recipes,acaprez/recipes,colinbrislawn/bioconda-recipes,BIMSBbioinfo/bioconda-recipes,HassanAmr/bioconda-recipes,bioconda/bioconda-recipes
|
yaml
|
## Code Before:
package:
name: r-dbchip
version: "1.1.6"
source:
fn: DBChIP_1.1.6.tar.gz
url: http://pages.cs.wisc.edu/~kliang/DBChIP/DBChIP_1.1.6.tar.gz
md5: f4b22bb2051ad6b2d33d4687754e8cee
build:
number: 0
# This is required to make R link correctly on Linux.
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- bioconductor-deseq
- bioconductor-edger
run:
- bioconductor-deseq
- bioconductor-edger
test:
commands:
- $R -e "library('DBChIP')" # [not win]
about:
home: http://pages.cs.wisc.edu/~kliang/DBChIP
license: 'GPL (>= 2)'
summary: 'ChIP-seq differential binding'
## Instruction:
Add explicit build/run r requirement
## Code After:
package:
name: r-dbchip
version: "1.1.6"
source:
fn: DBChIP_1.1.6.tar.gz
url: http://pages.cs.wisc.edu/~kliang/DBChIP/DBChIP_1.1.6.tar.gz
md5: f4b22bb2051ad6b2d33d4687754e8cee
build:
number: 1
# This is required to make R link correctly on Linux.
rpaths:
- lib/R/lib/
- lib/
requirements:
build:
- r
- bioconductor-deseq
- bioconductor-edger
run:
- r
- bioconductor-deseq
- bioconductor-edger
test:
commands:
- $R -e "library('DBChIP')" # [not win]
about:
home: http://pages.cs.wisc.edu/~kliang/DBChIP
license: 'GPL (>= 2)'
summary: 'ChIP-seq differential binding'
|
56a23eec7152ea6772923e29288dd7843e93ab4a
|
core/app/assets/stylesheets/facts/discussion2.css.less
|
core/app/assets/stylesheets/facts/discussion2.css.less
|
@discussion-width: 810px;
.discussion2 {
width: 810px;
margin: 90px auto 0;
z-index: 0;
position: relative;
}
|
@discussion-width: 810px;
.discussion2 {
width: 810px;
margin: 0 auto;
padding: 90px 0 0;
z-index: 0;
position: relative;
}
|
Use padding instead of margin, to make sure the page stays 100% height
|
Use padding instead of margin, to make sure the page stays 100% height
|
Less
|
mit
|
Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core
|
less
|
## Code Before:
@discussion-width: 810px;
.discussion2 {
width: 810px;
margin: 90px auto 0;
z-index: 0;
position: relative;
}
## Instruction:
Use padding instead of margin, to make sure the page stays 100% height
## Code After:
@discussion-width: 810px;
.discussion2 {
width: 810px;
margin: 0 auto;
padding: 90px 0 0;
z-index: 0;
position: relative;
}
|
4cf25f82046a4c64d2316d55ebf09823aa6925f8
|
templates/index.html
|
templates/index.html
|
<html>
<head>
<script src="/static/js/index.js"></script>
<title>Play Server</title>
</head>
<body>
<div id="track-info">
<span id="song-name"></span>
<span id="artist-name"></span>
<span id="album-name"></span>
</div>
<div id="controls">
<button id="previous">Previous</button>
<button id="playpause">Play/Pause</button>
<button id="next">Next</button>
</div>
</body>
</html>
|
<html>
<head>
<script src="/static/js/index.js"></script>
<title>Play Server</title>
</head>
<body>
<div id="track-info">
<div id="track-line-1">
<span id="song-name"></span>
</div>
<div id= "track-line-2">
<span id="artist-name"></span>
<span id="album-name"></span>
</div>
</div>
<div id="controls">
<button id="previous">Previous</button>
<button id="playpause">Play/Pause</button>
<button id="next">Next</button>
</div>
</body>
</html>
|
Add container divs in preperating for styling
|
Add container divs in preperating for styling
|
HTML
|
mit
|
ollien/playserver,ollien/playserver,ollien/playserver
|
html
|
## Code Before:
<html>
<head>
<script src="/static/js/index.js"></script>
<title>Play Server</title>
</head>
<body>
<div id="track-info">
<span id="song-name"></span>
<span id="artist-name"></span>
<span id="album-name"></span>
</div>
<div id="controls">
<button id="previous">Previous</button>
<button id="playpause">Play/Pause</button>
<button id="next">Next</button>
</div>
</body>
</html>
## Instruction:
Add container divs in preperating for styling
## Code After:
<html>
<head>
<script src="/static/js/index.js"></script>
<title>Play Server</title>
</head>
<body>
<div id="track-info">
<div id="track-line-1">
<span id="song-name"></span>
</div>
<div id= "track-line-2">
<span id="artist-name"></span>
<span id="album-name"></span>
</div>
</div>
<div id="controls">
<button id="previous">Previous</button>
<button id="playpause">Play/Pause</button>
<button id="next">Next</button>
</div>
</body>
</html>
|
e883e9f348f9137c79edc6c2cd7ac2a95998e30c
|
app/views/devise/sessions/new.html.haml
|
app/views/devise/sessions/new.html.haml
|
= render 'users/demo' if Rails.env.demo?
= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
= f.input :email, :input_html => {'data-autofocus' => true}
= f.input :password, :hint => false
- if devise_mapping.rememberable?
= f.input :remember_me, :as => :boolean
.form-actions
= f.button :submit, t('devise.sign_in')
= render "devise/shared/links"
|
= boot_page_title t('devise.sign_in')
= render 'users/demo' if Rails.env.demo?
= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
= f.input :email, :input_html => {'data-autofocus' => true}
= f.input :password, :hint => false
- if devise_mapping.rememberable?
= f.input :remember_me, :as => :boolean
.form-actions
= f.button :submit, t('devise.sign_in')
= render "devise/shared/links"
|
Add page title to login form.
|
Add page title to login form.
|
Haml
|
agpl-3.0
|
gaapt/bookyt,xuewenfei/bookyt,huerlisi/bookyt,wtag/bookyt,huerlisi/bookyt,hauledev/bookyt,hauledev/bookyt,silvermind/bookyt,gaapt/bookyt,huerlisi/bookyt,gaapt/bookyt,gaapt/bookyt,wtag/bookyt,hauledev/bookyt,hauledev/bookyt,silvermind/bookyt,xuewenfei/bookyt,xuewenfei/bookyt,silvermind/bookyt,wtag/bookyt,silvermind/bookyt
|
haml
|
## Code Before:
= render 'users/demo' if Rails.env.demo?
= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
= f.input :email, :input_html => {'data-autofocus' => true}
= f.input :password, :hint => false
- if devise_mapping.rememberable?
= f.input :remember_me, :as => :boolean
.form-actions
= f.button :submit, t('devise.sign_in')
= render "devise/shared/links"
## Instruction:
Add page title to login form.
## Code After:
= boot_page_title t('devise.sign_in')
= render 'users/demo' if Rails.env.demo?
= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
= f.input :email, :input_html => {'data-autofocus' => true}
= f.input :password, :hint => false
- if devise_mapping.rememberable?
= f.input :remember_me, :as => :boolean
.form-actions
= f.button :submit, t('devise.sign_in')
= render "devise/shared/links"
|
4c404bad9fb071b2d72e7051601394cf750961cb
|
lib/ui/src/components/sidebar/Heading.tsx
|
lib/ui/src/components/sidebar/Heading.tsx
|
import React, { FunctionComponent, ComponentProps } from 'react';
import { styled } from '@storybook/theming';
import { Brand } from './Brand';
import { SidebarMenu, MenuList } from './Menu';
export interface HeadingProps {
menuHighlighted?: boolean;
menu: MenuList;
}
const BrandArea = styled.div(({ theme }) => ({
fontSize: theme.typography.size.s2,
fontWeight: theme.typography.weight.bold,
color: theme.color.defaultText,
marginRight: 40,
display: 'flex',
width: '100%',
alignItems: 'center',
minHeight: 22,
'& > *': {
maxWidth: '100%',
height: 'auto',
width: 'auto',
display: 'block',
},
}));
const HeadingWrapper = styled.div({
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
position: 'relative',
});
export const Heading: FunctionComponent<HeadingProps & ComponentProps<typeof HeadingWrapper>> = ({
menuHighlighted = false,
menu,
...props
}) => {
return (
<HeadingWrapper {...props}>
<BrandArea>
<Brand />
</BrandArea>
<SidebarMenu menu={menu} isHighlighted={menuHighlighted} />
</HeadingWrapper>
);
};
|
import React, { FunctionComponent, ComponentProps } from 'react';
import { styled } from '@storybook/theming';
import { Brand } from './Brand';
import { SidebarMenu, MenuList } from './Menu';
export interface HeadingProps {
menuHighlighted?: boolean;
menu: MenuList;
}
const BrandArea = styled.div(({ theme }) => ({
fontSize: theme.typography.size.s2,
fontWeight: theme.typography.weight.bold,
color: theme.color.defaultText,
marginRight: 40,
display: 'flex',
width: '100%',
alignItems: 'center',
minHeight: 22,
'& > *': {
maxWidth: '100%',
height: 'auto',
display: 'block',
flex: '1 1 auto',
},
}));
const HeadingWrapper = styled.div({
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
position: 'relative',
});
export const Heading: FunctionComponent<HeadingProps & ComponentProps<typeof HeadingWrapper>> = ({
menuHighlighted = false,
menu,
...props
}) => {
return (
<HeadingWrapper {...props}>
<BrandArea>
<Brand />
</BrandArea>
<SidebarMenu menu={menu} isHighlighted={menuHighlighted} />
</HeadingWrapper>
);
};
|
Fix display of sidebar logo
|
UI: Fix display of sidebar logo
|
TypeScript
|
mit
|
kadirahq/react-storybook,storybooks/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/react-storybook,kadirahq/react-storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook
|
typescript
|
## Code Before:
import React, { FunctionComponent, ComponentProps } from 'react';
import { styled } from '@storybook/theming';
import { Brand } from './Brand';
import { SidebarMenu, MenuList } from './Menu';
export interface HeadingProps {
menuHighlighted?: boolean;
menu: MenuList;
}
const BrandArea = styled.div(({ theme }) => ({
fontSize: theme.typography.size.s2,
fontWeight: theme.typography.weight.bold,
color: theme.color.defaultText,
marginRight: 40,
display: 'flex',
width: '100%',
alignItems: 'center',
minHeight: 22,
'& > *': {
maxWidth: '100%',
height: 'auto',
width: 'auto',
display: 'block',
},
}));
const HeadingWrapper = styled.div({
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
position: 'relative',
});
export const Heading: FunctionComponent<HeadingProps & ComponentProps<typeof HeadingWrapper>> = ({
menuHighlighted = false,
menu,
...props
}) => {
return (
<HeadingWrapper {...props}>
<BrandArea>
<Brand />
</BrandArea>
<SidebarMenu menu={menu} isHighlighted={menuHighlighted} />
</HeadingWrapper>
);
};
## Instruction:
UI: Fix display of sidebar logo
## Code After:
import React, { FunctionComponent, ComponentProps } from 'react';
import { styled } from '@storybook/theming';
import { Brand } from './Brand';
import { SidebarMenu, MenuList } from './Menu';
export interface HeadingProps {
menuHighlighted?: boolean;
menu: MenuList;
}
const BrandArea = styled.div(({ theme }) => ({
fontSize: theme.typography.size.s2,
fontWeight: theme.typography.weight.bold,
color: theme.color.defaultText,
marginRight: 40,
display: 'flex',
width: '100%',
alignItems: 'center',
minHeight: 22,
'& > *': {
maxWidth: '100%',
height: 'auto',
display: 'block',
flex: '1 1 auto',
},
}));
const HeadingWrapper = styled.div({
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
position: 'relative',
});
export const Heading: FunctionComponent<HeadingProps & ComponentProps<typeof HeadingWrapper>> = ({
menuHighlighted = false,
menu,
...props
}) => {
return (
<HeadingWrapper {...props}>
<BrandArea>
<Brand />
</BrandArea>
<SidebarMenu menu={menu} isHighlighted={menuHighlighted} />
</HeadingWrapper>
);
};
|
b9146bf9079e48dc6b71cdb9854a1797ba4a4a65
|
CONTRIBUTING.md
|
CONTRIBUTING.md
|
Please include the following information to help us reproduce and fix:
* What you did
* What you expected to happen
* What actually happened
* Browser and version
* Example code that reproduces the problem (if possible)
* *(l33t mode)* A failing test
## Making contributions
Want to be listed as a *Contributor*? Make a pull request with:
* Unit and/or functional tests that validate changes you're making.
* Run unit tests in the latest IE, Firefox, Chrome, Safari and Opera and make sure they pass.
* Rebase your changes onto origin/HEAD if you can do so cleanly.
* If submitting additional functionality, provide an example of how to use it.
* Please keep code style consistent with surrounding code.
## Dev Setup
* Make sure you have [NodeJS v0.10](http://nodejs.org/) installed
* Run `npm install` from the project directory
## Testing
* (Local) Run `npm test`. Make sure [Karma Local Config](karma.conf.js) has the browsers you want
* (Any browser, remotely) Run `make test-ci` to run tests on [Sauce Labs](https://saucelabs.com).
Make sure the target browser is enabled in [Karma CI Config](karma.conf.ci.js)
|
Please include the following information to help us reproduce and fix:
* What you did
* What you expected to happen
* What actually happened
* Browser and version
* Example code that reproduces the problem (if possible)
* *(l33t mode)* A failing test
## Making contributions
Want to be listed as a *Contributor*? Make a pull request with:
* Unit and/or functional tests that validate changes you're making.
* Run unit tests in the latest IE, Firefox, Chrome, Safari and Opera and make sure they pass.
* Rebase your changes onto origin/HEAD if you can do so cleanly.
* If submitting additional functionality, provide an example of how to use it.
* Please keep code style consistent with surrounding code.
## Dev Setup
* Make sure you have [NodeJS v0.10](http://nodejs.org/) installed
* Run `npm install` from the project directory
## Testing
* (Local) Run `make test`. Make sure [Karma Local Config](karma.conf.js) has the browsers you want.
* (Any browser, remotely) If you have a [Sauce Labs](https://saucelabs.com) account, you can run `make ci`.
Make sure the target browser is enabled in [Karma CI Config](karma.conf.ci.js).
Otherwise, Travis will run all browsers if you submit a Pull Request.
|
Update testing section of Contributing guide.
|
Update testing section of Contributing guide.
|
Markdown
|
mit
|
stacktracejs/stacktrace.js,auchenberg/stacktrace.js,qiangyee/stacktrace.js,talves/stacktrace.js,oliversalzburg/stacktrace.js
|
markdown
|
## Code Before:
Please include the following information to help us reproduce and fix:
* What you did
* What you expected to happen
* What actually happened
* Browser and version
* Example code that reproduces the problem (if possible)
* *(l33t mode)* A failing test
## Making contributions
Want to be listed as a *Contributor*? Make a pull request with:
* Unit and/or functional tests that validate changes you're making.
* Run unit tests in the latest IE, Firefox, Chrome, Safari and Opera and make sure they pass.
* Rebase your changes onto origin/HEAD if you can do so cleanly.
* If submitting additional functionality, provide an example of how to use it.
* Please keep code style consistent with surrounding code.
## Dev Setup
* Make sure you have [NodeJS v0.10](http://nodejs.org/) installed
* Run `npm install` from the project directory
## Testing
* (Local) Run `npm test`. Make sure [Karma Local Config](karma.conf.js) has the browsers you want
* (Any browser, remotely) Run `make test-ci` to run tests on [Sauce Labs](https://saucelabs.com).
Make sure the target browser is enabled in [Karma CI Config](karma.conf.ci.js)
## Instruction:
Update testing section of Contributing guide.
## Code After:
Please include the following information to help us reproduce and fix:
* What you did
* What you expected to happen
* What actually happened
* Browser and version
* Example code that reproduces the problem (if possible)
* *(l33t mode)* A failing test
## Making contributions
Want to be listed as a *Contributor*? Make a pull request with:
* Unit and/or functional tests that validate changes you're making.
* Run unit tests in the latest IE, Firefox, Chrome, Safari and Opera and make sure they pass.
* Rebase your changes onto origin/HEAD if you can do so cleanly.
* If submitting additional functionality, provide an example of how to use it.
* Please keep code style consistent with surrounding code.
## Dev Setup
* Make sure you have [NodeJS v0.10](http://nodejs.org/) installed
* Run `npm install` from the project directory
## Testing
* (Local) Run `make test`. Make sure [Karma Local Config](karma.conf.js) has the browsers you want.
* (Any browser, remotely) If you have a [Sauce Labs](https://saucelabs.com) account, you can run `make ci`.
Make sure the target browser is enabled in [Karma CI Config](karma.conf.ci.js).
Otherwise, Travis will run all browsers if you submit a Pull Request.
|
15753fbcf8e1dd6904b26065b70b534f10236f4e
|
packages/co/collections-api.yaml
|
packages/co/collections-api.yaml
|
homepage: http://code.haskell.org/collections/
changelog-type: ''
hash: ed9fa09839e364045653ef99ff0cf8c9771ad55df5bfd754f594aa1eb651308e
test-bench-deps: {}
maintainer: jeanphilippe.bernardy (google mail)
synopsis: API for collection data structures.
changelog: ''
basic-deps:
base: ! '>=3 && <5'
array: -any
QuickCheck: ==2.*
all-versions:
- '1.0.0.0'
author: Jean-Philippe Bernardy
latest: '1.0.0.0'
description-type: haddock
description: ! 'This package provides classes for a consistent API to data
structures. The behaviour of the interface is specified by QuickCheck properties.
It is intended as an evolution of the API of the data structures in the @containers@
package.'
license-name: BSD3
|
homepage: http://code.haskell.org/collections/
changelog-type: ''
hash: b497904367aafbe7949dfa846aa34eec27b9ee99bc61ee2f665d48fdf83e7d1c
test-bench-deps: {}
maintainer: jeanphilippe.bernardy (google mail)
synopsis: API for collection data structures.
changelog: ''
basic-deps:
base: ! '>=3 && <4.8'
array: -any
QuickCheck: ==2.*
all-versions:
- '1.0.0.0'
author: Jean-Philippe Bernardy
latest: '1.0.0.0'
description-type: haddock
description: ! 'This package provides classes for a consistent API to data
structures. The behaviour of the interface is specified by QuickCheck properties.
It is intended as an evolution of the API of the data structures in the @containers@
package.'
license-name: BSD3
|
Update from Hackage at 2016-12-07T19:52:25Z
|
Update from Hackage at 2016-12-07T19:52:25Z
|
YAML
|
mit
|
commercialhaskell/all-cabal-metadata
|
yaml
|
## Code Before:
homepage: http://code.haskell.org/collections/
changelog-type: ''
hash: ed9fa09839e364045653ef99ff0cf8c9771ad55df5bfd754f594aa1eb651308e
test-bench-deps: {}
maintainer: jeanphilippe.bernardy (google mail)
synopsis: API for collection data structures.
changelog: ''
basic-deps:
base: ! '>=3 && <5'
array: -any
QuickCheck: ==2.*
all-versions:
- '1.0.0.0'
author: Jean-Philippe Bernardy
latest: '1.0.0.0'
description-type: haddock
description: ! 'This package provides classes for a consistent API to data
structures. The behaviour of the interface is specified by QuickCheck properties.
It is intended as an evolution of the API of the data structures in the @containers@
package.'
license-name: BSD3
## Instruction:
Update from Hackage at 2016-12-07T19:52:25Z
## Code After:
homepage: http://code.haskell.org/collections/
changelog-type: ''
hash: b497904367aafbe7949dfa846aa34eec27b9ee99bc61ee2f665d48fdf83e7d1c
test-bench-deps: {}
maintainer: jeanphilippe.bernardy (google mail)
synopsis: API for collection data structures.
changelog: ''
basic-deps:
base: ! '>=3 && <4.8'
array: -any
QuickCheck: ==2.*
all-versions:
- '1.0.0.0'
author: Jean-Philippe Bernardy
latest: '1.0.0.0'
description-type: haddock
description: ! 'This package provides classes for a consistent API to data
structures. The behaviour of the interface is specified by QuickCheck properties.
It is intended as an evolution of the API of the data structures in the @containers@
package.'
license-name: BSD3
|
3fe8e1ab9cfede9afe59ec9b0ed303d6ff8ac727
|
manageiq-appliance-dependencies.rb
|
manageiq-appliance-dependencies.rb
|
gem "manageiq-appliance_console", "~>3.2", :require => false
gem "manageiq-postgres_ha_admin", "~>2.0", :require => false
|
gem "manageiq-appliance_console", "~>3.2", :require => false
|
Remove manageiq-postgres_ha_admin from the appliance dependencies
|
Remove manageiq-postgres_ha_admin from the appliance dependencies
We use the gem from manageiq's core repo now, so we will move
the dependency there.
https://bugzilla.redhat.com/show_bug.cgi?id=1391095
|
Ruby
|
apache-2.0
|
ManageIQ/manageiq-appliance,ManageIQ/manageiq-appliance,ManageIQ/manageiq-appliance
|
ruby
|
## Code Before:
gem "manageiq-appliance_console", "~>3.2", :require => false
gem "manageiq-postgres_ha_admin", "~>2.0", :require => false
## Instruction:
Remove manageiq-postgres_ha_admin from the appliance dependencies
We use the gem from manageiq's core repo now, so we will move
the dependency there.
https://bugzilla.redhat.com/show_bug.cgi?id=1391095
## Code After:
gem "manageiq-appliance_console", "~>3.2", :require => false
|
9ac496491fccc1bd1ba55d3302608a0fe34957a1
|
tests/test_population.py
|
tests/test_population.py
|
import os
from neat.population import Population
from neat.config import Config
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
local_dir = os.path.dirname(__file__)
config = Config(os.path.join(local_dir, 'test_configuration'))
pop = Population(config)
# runs the simulation for 250 epochs
pop.epoch(eval_fitness, 250)
def test_config_options():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
local_dir = os.path.dirname(__file__)
config = Config(os.path.join(local_dir, 'test_configuration'))
for hn in (0, 1, 2):
config.hidden_nodes = hn
for fc in (0, 1):
config.fully_connected = fc
for act in ('exp', 'tanh'):
config.nn_activation = act
for ff in (0, 1):
config.feedforward = ff
pop = Population(config)
pop.epoch(eval_fitness, 250)
|
import os
from neat.population import Population
from neat.config import Config
from neat.statistics import get_average_fitness
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
local_dir = os.path.dirname(__file__)
config = Config(os.path.join(local_dir, 'test_configuration'))
pop = Population(config)
# runs the simulation for up to 20 epochs
pop.epoch(eval_fitness, 20)
# get statistics
avg_fitness = get_average_fitness(pop)
assert len(avg_fitness) == 1
assert all(f == 1 for f in avg_fitness)
# Change fitness threshold and do another run.
config.max_fitness_threshold = 1.1
pop = Population(config)
# runs the simulation for 20 epochs
pop.epoch(eval_fitness, 20)
# get statistics
avg_fitness = get_average_fitness(pop)
assert len(avg_fitness) == 20
assert all(f == 1 for f in avg_fitness)
def test_config_options():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
local_dir = os.path.dirname(__file__)
config = Config(os.path.join(local_dir, 'test_configuration'))
for hn in (0, 1, 2):
config.hidden_nodes = hn
for fc in (0, 1):
config.fully_connected = fc
for act in ('exp', 'tanh'):
config.nn_activation = act
for ff in (0, 1):
config.feedforward = ff
pop = Population(config)
pop.epoch(eval_fitness, 250)
|
Include statistics usage in existing tests.
|
Include statistics usage in existing tests.
|
Python
|
bsd-3-clause
|
drallensmith/neat-python,machinebrains/neat-python,CodeReclaimers/neat-python
|
python
|
## Code Before:
import os
from neat.population import Population
from neat.config import Config
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
local_dir = os.path.dirname(__file__)
config = Config(os.path.join(local_dir, 'test_configuration'))
pop = Population(config)
# runs the simulation for 250 epochs
pop.epoch(eval_fitness, 250)
def test_config_options():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
local_dir = os.path.dirname(__file__)
config = Config(os.path.join(local_dir, 'test_configuration'))
for hn in (0, 1, 2):
config.hidden_nodes = hn
for fc in (0, 1):
config.fully_connected = fc
for act in ('exp', 'tanh'):
config.nn_activation = act
for ff in (0, 1):
config.feedforward = ff
pop = Population(config)
pop.epoch(eval_fitness, 250)
## Instruction:
Include statistics usage in existing tests.
## Code After:
import os
from neat.population import Population
from neat.config import Config
from neat.statistics import get_average_fitness
def test_minimal():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
# creates the population
local_dir = os.path.dirname(__file__)
config = Config(os.path.join(local_dir, 'test_configuration'))
pop = Population(config)
# runs the simulation for up to 20 epochs
pop.epoch(eval_fitness, 20)
# get statistics
avg_fitness = get_average_fitness(pop)
assert len(avg_fitness) == 1
assert all(f == 1 for f in avg_fitness)
# Change fitness threshold and do another run.
config.max_fitness_threshold = 1.1
pop = Population(config)
# runs the simulation for 20 epochs
pop.epoch(eval_fitness, 20)
# get statistics
avg_fitness = get_average_fitness(pop)
assert len(avg_fitness) == 20
assert all(f == 1 for f in avg_fitness)
def test_config_options():
# sample fitness function
def eval_fitness(population):
for individual in population:
individual.fitness = 1.0
local_dir = os.path.dirname(__file__)
config = Config(os.path.join(local_dir, 'test_configuration'))
for hn in (0, 1, 2):
config.hidden_nodes = hn
for fc in (0, 1):
config.fully_connected = fc
for act in ('exp', 'tanh'):
config.nn_activation = act
for ff in (0, 1):
config.feedforward = ff
pop = Population(config)
pop.epoch(eval_fitness, 250)
|
f32a84458e1d59d755e62f0b24c54b1d3f150846
|
db/seeds/post_history_types.yml
|
db/seeds/post_history_types.yml
|
- name: post_edited
- name: post_deleted
- name: post_undeleted
- name: question_closed
- name: question_reopened
- name: initial_revision
- name: attribution_notice_added
- name: attribution_notice_removed
- name: attribution_notice_changed
|
- name: post_edited
- name: post_deleted
- name: post_undeleted
- name: question_closed
- name: question_reopened
- name: initial_revision
- name: attribution_notice_added
- name: attribution_notice_removed
- name: attribution_notice_changed
- name: imported_from_external_source
|
Add new post history type
|
Add new post history type
|
YAML
|
agpl-3.0
|
ArtOfCode-/qpixel,ArtOfCode-/qpixel,ArtOfCode-/qpixel,ArtOfCode-/qpixel
|
yaml
|
## Code Before:
- name: post_edited
- name: post_deleted
- name: post_undeleted
- name: question_closed
- name: question_reopened
- name: initial_revision
- name: attribution_notice_added
- name: attribution_notice_removed
- name: attribution_notice_changed
## Instruction:
Add new post history type
## Code After:
- name: post_edited
- name: post_deleted
- name: post_undeleted
- name: question_closed
- name: question_reopened
- name: initial_revision
- name: attribution_notice_added
- name: attribution_notice_removed
- name: attribution_notice_changed
- name: imported_from_external_source
|
316c885ff2c13a5f333a5cb2bca31407a9011f00
|
package_test/test_testsuite.sh
|
package_test/test_testsuite.sh
|
if [ -z "${BRANCH}" ] ; then
echo "Error : BRANCH env variable not defined"
exit 1
fi
wd=`pwd`
echo Working dir $wd
# Get testsuite
git clone [email protected]:C2SM-RCM/testsuite
cd testsuite
git checkout ${BRANCH}
echo "Last commit in testsuite repo:"
git --no-pager log -1
cd $wd
# First, test cosmo-pompa
git clone [email protected]:MeteoSwiss-APN/cosmo-pompa
rm -rf cosmo-pompa/cosmo/testsuite/src/*
cp -rf testsuite/* cosmo-pompa/cosmo/test/testsuite/src
cd cosmo-pompa/cosmo/test
export compiler="cray"
test -f ./jenkins/jenkins.sh || exit 1
./jenkins/jenkins.sh test
# Next, test int2lm
cd $wd
git clone [email protected]:MeteoSwiss-APN/int2lm
cp -rf testsuite/* int2lm/test/testsuite/src
cd int2lm/test
test -f ./jenkins/jenkins.sh || exit 1
export target="release"
export compiler="gnu"
./jenkins/jenkins.sh test
|
if [ -z "${BRANCH}" ] ; then
echo "Error : BRANCH env variable not defined"
exit 1
fi
if [ -z "${ORGANIZATION}" ] ; then
export ORGANIZATION="C2SM-RCM"
fi
wd=`pwd`
echo Working dir $wd
# Get testsuite
git clone [email protected]:${ORGANIZATION}/testsuite
cd testsuite
git checkout ${BRANCH}
echo "Last commit in testsuite repo:"
git --no-pager log -1
cd $wd
# First, test cosmo-pompa
git clone [email protected]:MeteoSwiss-APN/cosmo-pompa
rm -rf cosmo-pompa/cosmo/testsuite/src/*
cp -rf testsuite/* cosmo-pompa/cosmo/test/testsuite/src
cd cosmo-pompa/cosmo/test
export compiler="cray"
test -f ./jenkins/jenkins.sh || exit 1
./jenkins/jenkins.sh test
# Next, test int2lm
cd $wd
git clone [email protected]:MeteoSwiss-APN/int2lm
cp -rf testsuite/* int2lm/test/testsuite/src
cd int2lm/test
test -f ./jenkins/jenkins.sh || exit 1
export target="release"
export compiler="gnu"
./jenkins/jenkins.sh test
|
Add github ORGANIZATION variable to testsuite_test
|
Add github ORGANIZATION variable to testsuite_test
|
Shell
|
bsd-2-clause
|
C2SM-RCM/buildenv,C2SM-RCM/buildenv
|
shell
|
## Code Before:
if [ -z "${BRANCH}" ] ; then
echo "Error : BRANCH env variable not defined"
exit 1
fi
wd=`pwd`
echo Working dir $wd
# Get testsuite
git clone [email protected]:C2SM-RCM/testsuite
cd testsuite
git checkout ${BRANCH}
echo "Last commit in testsuite repo:"
git --no-pager log -1
cd $wd
# First, test cosmo-pompa
git clone [email protected]:MeteoSwiss-APN/cosmo-pompa
rm -rf cosmo-pompa/cosmo/testsuite/src/*
cp -rf testsuite/* cosmo-pompa/cosmo/test/testsuite/src
cd cosmo-pompa/cosmo/test
export compiler="cray"
test -f ./jenkins/jenkins.sh || exit 1
./jenkins/jenkins.sh test
# Next, test int2lm
cd $wd
git clone [email protected]:MeteoSwiss-APN/int2lm
cp -rf testsuite/* int2lm/test/testsuite/src
cd int2lm/test
test -f ./jenkins/jenkins.sh || exit 1
export target="release"
export compiler="gnu"
./jenkins/jenkins.sh test
## Instruction:
Add github ORGANIZATION variable to testsuite_test
## Code After:
if [ -z "${BRANCH}" ] ; then
echo "Error : BRANCH env variable not defined"
exit 1
fi
if [ -z "${ORGANIZATION}" ] ; then
export ORGANIZATION="C2SM-RCM"
fi
wd=`pwd`
echo Working dir $wd
# Get testsuite
git clone [email protected]:${ORGANIZATION}/testsuite
cd testsuite
git checkout ${BRANCH}
echo "Last commit in testsuite repo:"
git --no-pager log -1
cd $wd
# First, test cosmo-pompa
git clone [email protected]:MeteoSwiss-APN/cosmo-pompa
rm -rf cosmo-pompa/cosmo/testsuite/src/*
cp -rf testsuite/* cosmo-pompa/cosmo/test/testsuite/src
cd cosmo-pompa/cosmo/test
export compiler="cray"
test -f ./jenkins/jenkins.sh || exit 1
./jenkins/jenkins.sh test
# Next, test int2lm
cd $wd
git clone [email protected]:MeteoSwiss-APN/int2lm
cp -rf testsuite/* int2lm/test/testsuite/src
cd int2lm/test
test -f ./jenkins/jenkins.sh || exit 1
export target="release"
export compiler="gnu"
./jenkins/jenkins.sh test
|
e09214068a12768e9aafd04363d353359ca7e1f3
|
src/actions/actions/timetracking/__init__.py
|
src/actions/actions/timetracking/__init__.py
|
import stathat
import time
import syslog
def action(**kwargs):
''' This method is called to action a reaction '''
updateStathat(kwargs['jdata'])
return True
def updateStathat(jdata):
''' This method will be called to update a stathat Statistic '''
ez_key = jdata['time_tracking']['ez_key']
stat_name = "[%s] End to End Monitor transaction time" % jdata[
'time_tracking']['env']
value = time.time() - jdata['time_tracking']['control']
stathat.ez_value(ez_key, stat_name, value)
line = "timetracker: Sent stat to StatHat for %s" % jdata['cid']
syslog.syslog(syslog.LOG_INFO, line)
|
import stathat
import time
def action(**kwargs):
''' This method is called to action a reaction '''
logger = kwargs['logger']
updateStathat(kwargs['jdata'], logger)
return True
def updateStathat(jdata, logger):
''' This method will be called to update a stathat Statistic '''
ez_key = jdata['time_tracking']['ez_key']
stat_name = "[%s] End to End Monitor transaction time" % jdata[
'time_tracking']['env']
value = time.time() - jdata['time_tracking']['control']
stathat.ez_value(ez_key, stat_name, value)
line = "timetracker: Sent stat to StatHat for %s" % jdata['cid']
logger.info(line)
|
Convert reactions syslog to logger: timetracking
|
Convert reactions syslog to logger: timetracking
|
Python
|
unknown
|
dethos/cloudroutes-service,asm-products/cloudroutes-service,rbramwell/runbook,codecakes/cloudroutes-service,codecakes/cloudroutes-service,asm-products/cloudroutes-service,madflojo/cloudroutes-service,Runbook/runbook,codecakes/cloudroutes-service,asm-products/cloudroutes-service,codecakes/cloudroutes-service,madflojo/cloudroutes-service,rbramwell/runbook,madflojo/cloudroutes-service,Runbook/runbook,rbramwell/runbook,rbramwell/runbook,Runbook/runbook,dethos/cloudroutes-service,madflojo/cloudroutes-service,dethos/cloudroutes-service,asm-products/cloudroutes-service,Runbook/runbook,dethos/cloudroutes-service
|
python
|
## Code Before:
import stathat
import time
import syslog
def action(**kwargs):
''' This method is called to action a reaction '''
updateStathat(kwargs['jdata'])
return True
def updateStathat(jdata):
''' This method will be called to update a stathat Statistic '''
ez_key = jdata['time_tracking']['ez_key']
stat_name = "[%s] End to End Monitor transaction time" % jdata[
'time_tracking']['env']
value = time.time() - jdata['time_tracking']['control']
stathat.ez_value(ez_key, stat_name, value)
line = "timetracker: Sent stat to StatHat for %s" % jdata['cid']
syslog.syslog(syslog.LOG_INFO, line)
## Instruction:
Convert reactions syslog to logger: timetracking
## Code After:
import stathat
import time
def action(**kwargs):
''' This method is called to action a reaction '''
logger = kwargs['logger']
updateStathat(kwargs['jdata'], logger)
return True
def updateStathat(jdata, logger):
''' This method will be called to update a stathat Statistic '''
ez_key = jdata['time_tracking']['ez_key']
stat_name = "[%s] End to End Monitor transaction time" % jdata[
'time_tracking']['env']
value = time.time() - jdata['time_tracking']['control']
stathat.ez_value(ez_key, stat_name, value)
line = "timetracker: Sent stat to StatHat for %s" % jdata['cid']
logger.info(line)
|
fa610209334a53cd29441429609c5b045641b4d7
|
exp/lib/models/content_node.py
|
exp/lib/models/content_node.py
|
from .. import api_utils
class ContentNode(object):
def __init__(self, document, _isChildrenPopulated=False):
self.document = document
self._isChildrenPopulated = _isChildrenPopulated
def get_url(self):
return api_utils.generate_url("/api/delivery" + self.document.get("path"))
def get_children(self):
if not self._isChildrenPopulated:
self.document = api_utils.get('/api/content/' + self.document.get("uuid") + '/children')
self._isChildrenPopulated = True
return [ContentNode(x) for x in self.document.get("children")]
|
import urllib
from .. import api_utils
class ContentNode(object):
def __init__(self, document, _isChildrenPopulated=False):
self.document = document
self._isChildrenPopulated = _isChildrenPopulated
def get_url(self):
return api_utils.generate_url("/api/delivery" + self.document.get("path"))
def get_variant_url(self, variant_name):
query = '?variant={0}'.format(variant_name)
return api_utils.generate_url('/api/delivery' + self.document.get('path')) + query
def get_children(self):
if not self._isChildrenPopulated:
self.document = api_utils.get('/api/content/' + self.document.get("uuid") + '/children')
self._isChildrenPopulated = True
return [ContentNode(x) for x in self.document.get("children")]
|
Add get_variant_url method to content node.
|
Add get_variant_url method to content node.
|
Python
|
mit
|
ScalaInc/exp-python2-sdk,ScalaInc/exp-python2-sdk
|
python
|
## Code Before:
from .. import api_utils
class ContentNode(object):
def __init__(self, document, _isChildrenPopulated=False):
self.document = document
self._isChildrenPopulated = _isChildrenPopulated
def get_url(self):
return api_utils.generate_url("/api/delivery" + self.document.get("path"))
def get_children(self):
if not self._isChildrenPopulated:
self.document = api_utils.get('/api/content/' + self.document.get("uuid") + '/children')
self._isChildrenPopulated = True
return [ContentNode(x) for x in self.document.get("children")]
## Instruction:
Add get_variant_url method to content node.
## Code After:
import urllib
from .. import api_utils
class ContentNode(object):
def __init__(self, document, _isChildrenPopulated=False):
self.document = document
self._isChildrenPopulated = _isChildrenPopulated
def get_url(self):
return api_utils.generate_url("/api/delivery" + self.document.get("path"))
def get_variant_url(self, variant_name):
query = '?variant={0}'.format(variant_name)
return api_utils.generate_url('/api/delivery' + self.document.get('path')) + query
def get_children(self):
if not self._isChildrenPopulated:
self.document = api_utils.get('/api/content/' + self.document.get("uuid") + '/children')
self._isChildrenPopulated = True
return [ContentNode(x) for x in self.document.get("children")]
|
9058174b23f381c57c016bfd929cd89a2e1c92fd
|
src/main.rs
|
src/main.rs
|
extern crate sassers;
extern crate docopt;
use docopt::Docopt;
use std::fs::File;
use std::io::Read;
use std::path::Path;
fn main() {
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
static USAGE: &'static str = "
Usage:
sassers [-t <style>] <inputfile>
sassers [-vh]
Options:
-h, --help Show this message
-v, --version Show the version
-t <style>, --style <style> Output style [default: nested]
";
let args = Docopt::new(USAGE)
.and_then(|d| d.parse())
.unwrap_or_else(|e| e.exit());
if args.get_bool("-v") {
println!("{}", VERSION);
} else {
let style = args.get_str("-t");
let inputfile = args.get_str("<inputfile>");
let mut sass = String::new();
File::open(&Path::new(&inputfile)).unwrap().read_to_string(&mut sass).unwrap();
match sassers::compile(&sass, style) {
Ok(compiled) => println!("{}", compiled),
Err(msg) => println!("Compilation failed: {}", msg),
}
}
}
|
extern crate sassers;
extern crate docopt;
use docopt::Docopt;
use std::fs::File;
use std::io::Read;
use std::path::Path;
fn main() {
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
static USAGE: &'static str = "
Usage:
sassers [-t <style>] <inputfile>
sassers [-vh]
Options:
-h, --help Show this message
-v, --version Show the version
-t <style>, --style <style> Output style [default: nested]
";
let args = Docopt::new(USAGE)
.and_then(|d| d.parse())
.unwrap_or_else(|e| e.exit());
if args.get_bool("-v") {
println!("{}", VERSION);
} else {
let style = args.get_str("-t");
let inputfile = args.get_str("<inputfile>");
let mut sass = String::new();
let mut file = match File::open(&Path::new(&inputfile)) {
Ok(f) => f,
Err(msg) => panic!("File not found! {}", msg),
};
match file.read_to_string(&mut sass) {
Ok(_) => {
match sassers::compile(&sass, style) {
Ok(compiled) => println!("{}", compiled),
Err(msg) => println!("Compilation failed: {}", msg),
}
},
Err(msg) => panic!("Could not read file! {}", msg),
}
}
}
|
Print nicer error messages for myself
|
Print nicer error messages for myself
|
Rust
|
mit
|
carols10cents/sassers
|
rust
|
## Code Before:
extern crate sassers;
extern crate docopt;
use docopt::Docopt;
use std::fs::File;
use std::io::Read;
use std::path::Path;
fn main() {
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
static USAGE: &'static str = "
Usage:
sassers [-t <style>] <inputfile>
sassers [-vh]
Options:
-h, --help Show this message
-v, --version Show the version
-t <style>, --style <style> Output style [default: nested]
";
let args = Docopt::new(USAGE)
.and_then(|d| d.parse())
.unwrap_or_else(|e| e.exit());
if args.get_bool("-v") {
println!("{}", VERSION);
} else {
let style = args.get_str("-t");
let inputfile = args.get_str("<inputfile>");
let mut sass = String::new();
File::open(&Path::new(&inputfile)).unwrap().read_to_string(&mut sass).unwrap();
match sassers::compile(&sass, style) {
Ok(compiled) => println!("{}", compiled),
Err(msg) => println!("Compilation failed: {}", msg),
}
}
}
## Instruction:
Print nicer error messages for myself
## Code After:
extern crate sassers;
extern crate docopt;
use docopt::Docopt;
use std::fs::File;
use std::io::Read;
use std::path::Path;
fn main() {
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
static USAGE: &'static str = "
Usage:
sassers [-t <style>] <inputfile>
sassers [-vh]
Options:
-h, --help Show this message
-v, --version Show the version
-t <style>, --style <style> Output style [default: nested]
";
let args = Docopt::new(USAGE)
.and_then(|d| d.parse())
.unwrap_or_else(|e| e.exit());
if args.get_bool("-v") {
println!("{}", VERSION);
} else {
let style = args.get_str("-t");
let inputfile = args.get_str("<inputfile>");
let mut sass = String::new();
let mut file = match File::open(&Path::new(&inputfile)) {
Ok(f) => f,
Err(msg) => panic!("File not found! {}", msg),
};
match file.read_to_string(&mut sass) {
Ok(_) => {
match sassers::compile(&sass, style) {
Ok(compiled) => println!("{}", compiled),
Err(msg) => println!("Compilation failed: {}", msg),
}
},
Err(msg) => panic!("Could not read file! {}", msg),
}
}
}
|
5ab9b834c0e45b4ee65a8be7ed30d50aac99c6ec
|
recipes/r-justifyalpha/build.sh
|
recipes/r-justifyalpha/build.sh
|
export DISABLE_AUTOBREW=1
# R refuses to build packages that mark themselves as Priority: Recommended
mv DESCRIPTION DESCRIPTION.old
grep -va '^Priority: ' DESCRIPTION.old > DESCRIPTION
# shellcheck disable=SC2086
${R} CMD INSTALL --build . ${R_ARGS}
# Add more build steps here, if they are necessary.
# See
# https://docs.conda.io/projects/conda-build
# for a list of environment variables that are set during the build process.
|
mv DESCRIPTION DESCRIPTION.old
grep -va '^Priority: ' DESCRIPTION.old > DESCRIPTION
${R} CMD INSTALL --build . "${R_ARGS}"
|
Remove comments and add maintainers
|
Remove comments and add maintainers
|
Shell
|
bsd-3-clause
|
ocefpaf/staged-recipes,johanneskoester/staged-recipes,johanneskoester/staged-recipes,conda-forge/staged-recipes,conda-forge/staged-recipes,ocefpaf/staged-recipes
|
shell
|
## Code Before:
export DISABLE_AUTOBREW=1
# R refuses to build packages that mark themselves as Priority: Recommended
mv DESCRIPTION DESCRIPTION.old
grep -va '^Priority: ' DESCRIPTION.old > DESCRIPTION
# shellcheck disable=SC2086
${R} CMD INSTALL --build . ${R_ARGS}
# Add more build steps here, if they are necessary.
# See
# https://docs.conda.io/projects/conda-build
# for a list of environment variables that are set during the build process.
## Instruction:
Remove comments and add maintainers
## Code After:
mv DESCRIPTION DESCRIPTION.old
grep -va '^Priority: ' DESCRIPTION.old > DESCRIPTION
${R} CMD INSTALL --build . "${R_ARGS}"
|
14669956edfc39124d740d065ef8ef1634966946
|
.travis.yml
|
.travis.yml
|
language: ruby
rvm:
- 2.3.1
before_script:
- cp .rspec.example .rspec
script:
- bundle exec thor bronze:ci:default
# Travis-CI Configuration
cache: bundler
sudo: false # Enable containerized builds.
services:
- mongodb
|
language: ruby
rvm:
- 2.3.1
before_script:
- cp .rspec.example .rspec
script:
- bundle exec thor bronze:ci:default
# Travis-CI Configuration
cache: bundler
sudo: false # Enable containerized builds.
services:
- mongodb
addons:
apt:
sources:
- mongodb-3.0-precise
packages:
- mongodb-org-server
|
Add MongoDB 3 Haddon to Travis-CI build.
|
Add MongoDB 3 Haddon to Travis-CI build.
|
YAML
|
mit
|
sleepingkingstudios/bronze
|
yaml
|
## Code Before:
language: ruby
rvm:
- 2.3.1
before_script:
- cp .rspec.example .rspec
script:
- bundle exec thor bronze:ci:default
# Travis-CI Configuration
cache: bundler
sudo: false # Enable containerized builds.
services:
- mongodb
## Instruction:
Add MongoDB 3 Haddon to Travis-CI build.
## Code After:
language: ruby
rvm:
- 2.3.1
before_script:
- cp .rspec.example .rspec
script:
- bundle exec thor bronze:ci:default
# Travis-CI Configuration
cache: bundler
sudo: false # Enable containerized builds.
services:
- mongodb
addons:
apt:
sources:
- mongodb-3.0-precise
packages:
- mongodb-org-server
|
eb6cc542836e3daf41330956f588204730db94e9
|
cmd/README.md
|
cmd/README.md
|
The example of use of Grafana HTTP API.
Saves all dashboards to JSON files in the current directory.
Requires API key with admin rights.
## backup-datasources
The example of use of Grafana HTTP API.
Saves all datasources to JSON files in the current directory.
Requires API key with admin rights.
|
The example of use of Grafana HTTP API.
Saves all dashboards to JSON files in the current directory.
Requires API key with admin rights.
## backup-datasources
The example of use of Grafana HTTP API.
Saves all datasources to JSON files in the current directory.
Requires API key with admin rights.
## import-dashboards
The example of use of Grafana HTTP API.
It imports all dashboards from JSON files in the current directory.
It will silently replace all existing dashboards with a same name.
Requires API key with admin rights.
## import-datasources
The example of use of Grafana HTTP API.
It imports all datasources from JSON files in the current directory.
It will silently replace all existing datasources with a same name.
Requires API key with admin rights.
|
Add new examples to the doc
|
Add new examples to the doc
|
Markdown
|
apache-2.0
|
grafov/autograf,grafana-tools/sdk
|
markdown
|
## Code Before:
The example of use of Grafana HTTP API.
Saves all dashboards to JSON files in the current directory.
Requires API key with admin rights.
## backup-datasources
The example of use of Grafana HTTP API.
Saves all datasources to JSON files in the current directory.
Requires API key with admin rights.
## Instruction:
Add new examples to the doc
## Code After:
The example of use of Grafana HTTP API.
Saves all dashboards to JSON files in the current directory.
Requires API key with admin rights.
## backup-datasources
The example of use of Grafana HTTP API.
Saves all datasources to JSON files in the current directory.
Requires API key with admin rights.
## import-dashboards
The example of use of Grafana HTTP API.
It imports all dashboards from JSON files in the current directory.
It will silently replace all existing dashboards with a same name.
Requires API key with admin rights.
## import-datasources
The example of use of Grafana HTTP API.
It imports all datasources from JSON files in the current directory.
It will silently replace all existing datasources with a same name.
Requires API key with admin rights.
|
ffc1b8c83e32f4c2b5454a0ae71b9c30cc8e7596
|
toolz/tests/test_serialization.py
|
toolz/tests/test_serialization.py
|
from toolz import *
import pickle
def test_compose():
f = compose(str, sum)
g = pickle.loads(pickle.dumps(f))
assert f((1, 2)) == g((1, 2))
def test_curry():
f = curry(map)(str)
g = pickle.loads(pickle.dumps(f))
assert list(f((1, 2, 3))) == list(g((1, 2, 3)))
def test_juxt():
f = juxt(str, int, bool)
g = pickle.loads(pickle.dumps(f))
assert f(1) == g(1)
assert f.funcs == g.funcs
|
from toolz import *
import pickle
def test_compose():
f = compose(str, sum)
g = pickle.loads(pickle.dumps(f))
assert f((1, 2)) == g((1, 2))
def test_curry():
f = curry(map)(str)
g = pickle.loads(pickle.dumps(f))
assert list(f((1, 2, 3))) == list(g((1, 2, 3)))
def test_juxt():
f = juxt(str, int, bool)
g = pickle.loads(pickle.dumps(f))
assert f(1) == g(1)
assert f.funcs == g.funcs
def test_complement():
f = complement(bool)
assert f(True) is False
assert f(False) is True
g = pickle.loads(pickle.dumps(f))
assert f(True) == g(True)
assert f(False) == g(False)
|
Add serialization test for `complement`
|
Add serialization test for `complement`
|
Python
|
bsd-3-clause
|
pombredanne/toolz,simudream/toolz,machinelearningdeveloper/toolz,quantopian/toolz,jdmcbr/toolz,bartvm/toolz,jcrist/toolz,cpcloud/toolz,pombredanne/toolz,quantopian/toolz,simudream/toolz,machinelearningdeveloper/toolz,bartvm/toolz,llllllllll/toolz,jdmcbr/toolz,llllllllll/toolz,cpcloud/toolz,jcrist/toolz
|
python
|
## Code Before:
from toolz import *
import pickle
def test_compose():
f = compose(str, sum)
g = pickle.loads(pickle.dumps(f))
assert f((1, 2)) == g((1, 2))
def test_curry():
f = curry(map)(str)
g = pickle.loads(pickle.dumps(f))
assert list(f((1, 2, 3))) == list(g((1, 2, 3)))
def test_juxt():
f = juxt(str, int, bool)
g = pickle.loads(pickle.dumps(f))
assert f(1) == g(1)
assert f.funcs == g.funcs
## Instruction:
Add serialization test for `complement`
## Code After:
from toolz import *
import pickle
def test_compose():
f = compose(str, sum)
g = pickle.loads(pickle.dumps(f))
assert f((1, 2)) == g((1, 2))
def test_curry():
f = curry(map)(str)
g = pickle.loads(pickle.dumps(f))
assert list(f((1, 2, 3))) == list(g((1, 2, 3)))
def test_juxt():
f = juxt(str, int, bool)
g = pickle.loads(pickle.dumps(f))
assert f(1) == g(1)
assert f.funcs == g.funcs
def test_complement():
f = complement(bool)
assert f(True) is False
assert f(False) is True
g = pickle.loads(pickle.dumps(f))
assert f(True) == g(True)
assert f(False) == g(False)
|
31f63019c61dcfa851687841e253b3c4e9aef4e5
|
src/resource.js
|
src/resource.js
|
import {Container} from './';
export default class Resource {
/**
* @param {Object} params
*/
constructor({service, name, identifierName, collectionRoot, itemRoot}) {
this.service = service;
this.name = name;
this.identifierName = identifierName;
this.collectionRoot = collectionRoot;
this.itemRoot = itemRoot;
this.descriptor = Container.get(this.service);
}
}
|
import {Container} from './';
export default class Resource {
/**
* @param {Object} params
*/
constructor({service, name, identifierName, collectionRoot, itemRoot}) {
this.service = service;
this.name = name;
this.identifierName = identifierName;
this.collectionRoot = collectionRoot;
this.itemRoot = itemRoot;
this.descriptor = Container.get(this.service);
this.attributes = {};
this.parentResource = null;
}
/**
* @returns {bool}
*/
hasParentResource() {
return this.parentResource === null;
}
/**
* @param {Resource} resource
* @return {Resource}
*/
childResource(resource) {
resource.parentResource = this;
return resource;
}
}
|
Add parentResource helpers to Resource
|
Add parentResource helpers to Resource
|
JavaScript
|
mit
|
jay-ess/restinga-node
|
javascript
|
## Code Before:
import {Container} from './';
export default class Resource {
/**
* @param {Object} params
*/
constructor({service, name, identifierName, collectionRoot, itemRoot}) {
this.service = service;
this.name = name;
this.identifierName = identifierName;
this.collectionRoot = collectionRoot;
this.itemRoot = itemRoot;
this.descriptor = Container.get(this.service);
}
}
## Instruction:
Add parentResource helpers to Resource
## Code After:
import {Container} from './';
export default class Resource {
/**
* @param {Object} params
*/
constructor({service, name, identifierName, collectionRoot, itemRoot}) {
this.service = service;
this.name = name;
this.identifierName = identifierName;
this.collectionRoot = collectionRoot;
this.itemRoot = itemRoot;
this.descriptor = Container.get(this.service);
this.attributes = {};
this.parentResource = null;
}
/**
* @returns {bool}
*/
hasParentResource() {
return this.parentResource === null;
}
/**
* @param {Resource} resource
* @return {Resource}
*/
childResource(resource) {
resource.parentResource = this;
return resource;
}
}
|
6b0a06489d30c22f529ca7f60c80f93cc7128347
|
app.js
|
app.js
|
/**
* Main entrypoint for banknote.
*
* Copyright 2015 Ethan Smith
*/
var Backbone = require('backbone'),
Marionette = require('backbone.marionette'),
$ = require('jquery'),
_ = require('underscore'),
MainLayout = require('./src/view/MainLayout'),
RegionModal = require('./src/common/modal/RegionModal.js'),
CategorizedController = require('./src/controller/CategorizedController');
require('./src/common/library/CurrencyInputStyler');
var Banknote = new Marionette.Application();
Banknote.addRegions({
central: '#app',
modal: RegionModal
});
Banknote.addInitializer(function(options) {
$.getJSON('demo.json', function(data) {
var incomeCollection = new AmountEntryCollection(_.map(data.income, function(note) {
return new AmountEntry(note);
}));
var controller = new CategorizedController({
title: 'Income Totals'
});
Banknote.central.show(controller.render(incomeCollection));
});
});
Banknote.start();
// Make Banknote available globally
global.Banknote = Banknote;
|
/**
* Main entrypoint for banknote.
*
* Copyright 2015 Ethan Smith
*/
var Backbone = require('backbone'),
Marionette = require('backbone.marionette'),
$ = require('jquery'),
_ = require('underscore'),
MainLayout = require('./src/view/MainLayout'),
RegionModal = require('./src/common/modal/RegionModal.js'),
CategorizedController = require('./src/controller/CategorizedController');
require('./src/common/library/CurrencyInputStyler');
var Banknote = new Marionette.Application();
Banknote.addRegions({
central: '#app',
modal: RegionModal
});
Banknote.addInitializer(function(options) {
$.getJSON('demo.json', function(data) {
var incomeCollection = new AmountEntryCollection(data.income);
var controller = new CategorizedController({
title: 'Income Totals'
});
Banknote.central.show(controller.render(incomeCollection));
});
});
Banknote.start();
// Make Banknote available globally
global.Banknote = Banknote;
|
Remove unneeded map for collection model
|
Remove unneeded map for collection model
|
JavaScript
|
mit
|
onebytegone/banknote-client,onebytegone/banknote-client
|
javascript
|
## Code Before:
/**
* Main entrypoint for banknote.
*
* Copyright 2015 Ethan Smith
*/
var Backbone = require('backbone'),
Marionette = require('backbone.marionette'),
$ = require('jquery'),
_ = require('underscore'),
MainLayout = require('./src/view/MainLayout'),
RegionModal = require('./src/common/modal/RegionModal.js'),
CategorizedController = require('./src/controller/CategorizedController');
require('./src/common/library/CurrencyInputStyler');
var Banknote = new Marionette.Application();
Banknote.addRegions({
central: '#app',
modal: RegionModal
});
Banknote.addInitializer(function(options) {
$.getJSON('demo.json', function(data) {
var incomeCollection = new AmountEntryCollection(_.map(data.income, function(note) {
return new AmountEntry(note);
}));
var controller = new CategorizedController({
title: 'Income Totals'
});
Banknote.central.show(controller.render(incomeCollection));
});
});
Banknote.start();
// Make Banknote available globally
global.Banknote = Banknote;
## Instruction:
Remove unneeded map for collection model
## Code After:
/**
* Main entrypoint for banknote.
*
* Copyright 2015 Ethan Smith
*/
var Backbone = require('backbone'),
Marionette = require('backbone.marionette'),
$ = require('jquery'),
_ = require('underscore'),
MainLayout = require('./src/view/MainLayout'),
RegionModal = require('./src/common/modal/RegionModal.js'),
CategorizedController = require('./src/controller/CategorizedController');
require('./src/common/library/CurrencyInputStyler');
var Banknote = new Marionette.Application();
Banknote.addRegions({
central: '#app',
modal: RegionModal
});
Banknote.addInitializer(function(options) {
$.getJSON('demo.json', function(data) {
var incomeCollection = new AmountEntryCollection(data.income);
var controller = new CategorizedController({
title: 'Income Totals'
});
Banknote.central.show(controller.render(incomeCollection));
});
});
Banknote.start();
// Make Banknote available globally
global.Banknote = Banknote;
|
08ca035de14e927c4fdaa151491ebe9050563f69
|
examples/IncrementalIndexedBasedDecode.hs
|
examples/IncrementalIndexedBasedDecode.hs
|
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}
import Control.Monad
import qualified Data.ByteString as B
import Data.Csv.Incremental
import System.Exit
import System.IO
main :: IO ()
main = withFile "salaries.csv" ReadMode $ \ csvFile -> do
let loop !_ (Fail _ errMsg) = putStrLn errMsg >> exitFailure
loop acc (Partial k) = loop acc =<< feed k
loop acc (Some rs k) = loop (acc + sumSalaries rs) =<< feed k
loop acc (Done rs) = putStrLn $ "Total salaries: " ++
show (sumSalaries rs + acc)
feed k = do
isEof <- hIsEOF csvFile
if isEof
then return $ k B.empty
else k `fmap` B.hGetSome csvFile 4096
loop 0 (decode NoHeader)
where
sumSalaries rs = sum [salary | Right (_ :: String, salary :: Int) <- rs]
|
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}
import Control.Monad
import qualified Data.ByteString as B
import Data.Csv.Incremental
import System.Exit
import System.IO
main :: IO ()
main = withFile "salaries.csv" ReadMode $ \ csvFile -> do
let loop !_ (Fail _ errMsg) = putStrLn errMsg >> exitFailure
loop acc (Many rs k) = loop (acc + sumSalaries rs) =<< feed k
loop acc (Done rs) = putStrLn $ "Total salaries: " ++
show (sumSalaries rs + acc)
feed k = do
isEof <- hIsEOF csvFile
if isEof
then return $ k B.empty
else k `fmap` B.hGetSome csvFile 4096
loop 0 (decode NoHeader)
where
sumSalaries rs = sum [salary | Right (_ :: String, salary :: Int) <- rs]
|
Update examples to follow changes to incremental API
|
Update examples to follow changes to incremental API
|
Haskell
|
bsd-3-clause
|
hvr/cassava,psibi/cassava,jb55/cassava,ahodgen/cassava,bgamari/cassava,richardfergie/cassava,treeowl/cassava,tibbe/cassava,bergmark/cassava
|
haskell
|
## Code Before:
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}
import Control.Monad
import qualified Data.ByteString as B
import Data.Csv.Incremental
import System.Exit
import System.IO
main :: IO ()
main = withFile "salaries.csv" ReadMode $ \ csvFile -> do
let loop !_ (Fail _ errMsg) = putStrLn errMsg >> exitFailure
loop acc (Partial k) = loop acc =<< feed k
loop acc (Some rs k) = loop (acc + sumSalaries rs) =<< feed k
loop acc (Done rs) = putStrLn $ "Total salaries: " ++
show (sumSalaries rs + acc)
feed k = do
isEof <- hIsEOF csvFile
if isEof
then return $ k B.empty
else k `fmap` B.hGetSome csvFile 4096
loop 0 (decode NoHeader)
where
sumSalaries rs = sum [salary | Right (_ :: String, salary :: Int) <- rs]
## Instruction:
Update examples to follow changes to incremental API
## Code After:
{-# LANGUAGE BangPatterns, ScopedTypeVariables #-}
import Control.Monad
import qualified Data.ByteString as B
import Data.Csv.Incremental
import System.Exit
import System.IO
main :: IO ()
main = withFile "salaries.csv" ReadMode $ \ csvFile -> do
let loop !_ (Fail _ errMsg) = putStrLn errMsg >> exitFailure
loop acc (Many rs k) = loop (acc + sumSalaries rs) =<< feed k
loop acc (Done rs) = putStrLn $ "Total salaries: " ++
show (sumSalaries rs + acc)
feed k = do
isEof <- hIsEOF csvFile
if isEof
then return $ k B.empty
else k `fmap` B.hGetSome csvFile 4096
loop 0 (decode NoHeader)
where
sumSalaries rs = sum [salary | Right (_ :: String, salary :: Int) <- rs]
|
3282342652ef367d27a5988e8e5d0c996e3aadbb
|
app/styles/wysihtml5.scss
|
app/styles/wysihtml5.scss
|
a.wysihtml5-command-active,
a.wysihtml5-command-dialog-opened {
background-color: $darken-3;
}
|
a.wysihtml5-command-active,
a.wysihtml5-command-dialog-opened {
background-color: $darken-3;
}
.wysiwyg-font-size-h6 { font-size: .5rem; }
.wysiwyg-font-size-h5 { font-size: 1rem; }
.wysiwyg-font-size-h4 { font-size: 1.5rem; }
.wysiwyg-font-size-h3 { font-size: 2rem; }
.wysiwyg-font-size-h2 { font-size: 3rem; }
.wysiwyg-font-size-h1 { font-size: 5rem; }
|
Fix put wysihtml heading classes back.
|
Fix put wysihtml heading classes back.
|
SCSS
|
agpl-3.0
|
nossas/bonde-client,nossas/bonde-client,nossas/bonde-client
|
scss
|
## Code Before:
a.wysihtml5-command-active,
a.wysihtml5-command-dialog-opened {
background-color: $darken-3;
}
## Instruction:
Fix put wysihtml heading classes back.
## Code After:
a.wysihtml5-command-active,
a.wysihtml5-command-dialog-opened {
background-color: $darken-3;
}
.wysiwyg-font-size-h6 { font-size: .5rem; }
.wysiwyg-font-size-h5 { font-size: 1rem; }
.wysiwyg-font-size-h4 { font-size: 1.5rem; }
.wysiwyg-font-size-h3 { font-size: 2rem; }
.wysiwyg-font-size-h2 { font-size: 3rem; }
.wysiwyg-font-size-h1 { font-size: 5rem; }
|
4d003e1600c9aa5963237638ccccf4cbb361c9b7
|
.github/workflows/build.yml
|
.github/workflows/build.yml
|
name: build
on: [push]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0']
name: Testing on PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v2
- name: setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring,bcmath
tools: phpunit,composer
- name: install deps
run: composer install -o -q
- name: run phpunit
run: vendor/bin/phpunit
- name: run phpstan
run: composer require --dev illuminate/support && vendor/bin/phpstan analyze --no-progress --autoload-file=tests/phpstan/bootstrap.php --level=5 src/
|
name: Tests
on: [push]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0']
name: Testing on PHP ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring,bcmath
tools: composer
- name: Install PHP dependencies
run: composer install -q
- name: Run phpunit
run: vendor/bin/phpunit
- name: Run phpstan
run: composer require --dev illuminate/support && vendor/bin/phpstan analyze --no-progress --autoload-file=tests/phpstan/bootstrap.php --level=5 src/
|
Rename vars and changed text in test workflow
|
Rename vars and changed text in test workflow
|
YAML
|
mit
|
Intervention/httpauth
|
yaml
|
## Code Before:
name: build
on: [push]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0']
name: Testing on PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v2
- name: setup
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring,bcmath
tools: phpunit,composer
- name: install deps
run: composer install -o -q
- name: run phpunit
run: vendor/bin/phpunit
- name: run phpstan
run: composer require --dev illuminate/support && vendor/bin/phpstan analyze --no-progress --autoload-file=tests/phpstan/bootstrap.php --level=5 src/
## Instruction:
Rename vars and changed text in test workflow
## Code After:
name: Tests
on: [push]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0']
name: Testing on PHP ${{ matrix.php }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring,bcmath
tools: composer
- name: Install PHP dependencies
run: composer install -q
- name: Run phpunit
run: vendor/bin/phpunit
- name: Run phpstan
run: composer require --dev illuminate/support && vendor/bin/phpstan analyze --no-progress --autoload-file=tests/phpstan/bootstrap.php --level=5 src/
|
af6c31d09aef686ba896b2a2c74fbb88cc7f1be0
|
tests/test_utils.py
|
tests/test_utils.py
|
__authors__ = [
'"Augie Fackler" <[email protected]>',
]
class MockRequest(object):
"""Shared dummy request object to mock common aspects of a request.
"""
def __init__(self, path=None):
self.REQUEST = self.GET = self.POST = {}
self.path = path
|
__authors__ = [
'"Augie Fackler" <[email protected]>',
'"Sverre Rabbelier" <[email protected]>',
]
from soc.modules import callback
class MockRequest(object):
"""Shared dummy request object to mock common aspects of a request.
Before using the object, start should be called, when done (and
before calling start on a new request), end should be called.
"""
def __init__(self, path=None):
"""Creates a new empty request object.
self.REQUEST, self.GET and self.POST are set to an empty
dictionary, and path to the value specified.
"""
self.REQUEST = {}
self.GET = {}
self.POST = {}
self.path = path
def start(self):
"""Readies the core for a new request.
"""
core = callback.getCore()
core.startNewRequest(self)
def end(self):
"""Finishes up the current request.
"""
core = callback.getCore()
core.endRequest(self, False)
|
Add a start and end method to MockRequest
|
Add a start and end method to MockRequest
|
Python
|
apache-2.0
|
SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange,SRabbelier/Melange
|
python
|
## Code Before:
__authors__ = [
'"Augie Fackler" <[email protected]>',
]
class MockRequest(object):
"""Shared dummy request object to mock common aspects of a request.
"""
def __init__(self, path=None):
self.REQUEST = self.GET = self.POST = {}
self.path = path
## Instruction:
Add a start and end method to MockRequest
## Code After:
__authors__ = [
'"Augie Fackler" <[email protected]>',
'"Sverre Rabbelier" <[email protected]>',
]
from soc.modules import callback
class MockRequest(object):
"""Shared dummy request object to mock common aspects of a request.
Before using the object, start should be called, when done (and
before calling start on a new request), end should be called.
"""
def __init__(self, path=None):
"""Creates a new empty request object.
self.REQUEST, self.GET and self.POST are set to an empty
dictionary, and path to the value specified.
"""
self.REQUEST = {}
self.GET = {}
self.POST = {}
self.path = path
def start(self):
"""Readies the core for a new request.
"""
core = callback.getCore()
core.startNewRequest(self)
def end(self):
"""Finishes up the current request.
"""
core = callback.getCore()
core.endRequest(self, False)
|
a4d928f45e4b53fc59c17ca5eb1cf36ce305a536
|
app/controllers/paper_trail_ui/reports_controller.rb
|
app/controllers/paper_trail_ui/reports_controller.rb
|
require 'will_paginate/array'
require 'yaml'
require_dependency "paper_trail_ui/application_controller"
module PaperTrailUi
class ReportsController < ApplicationController
MODEL_NAMES = PaperTrail::Version.select("DISTINCT item_type").map(&:item_type)
EVENT_TYPES = PaperTrail::Version.select("DISTINCT event").map(&:event)
def index
@model_names = {"All" => ""}.merge(MODEL_NAMES.reduce({}){|a, x| a[x] = x; a})
@event_names = {"All" => ""}.merge(EVENT_TYPES.reduce({}){|a, x| a[x] = x; a})
@query = PaperTrail::Version.search params[:q]
@versions = @query.result(distinct: true).paginate(page: params[:page], per_page: 100)
end
def show
@version = PaperTrail::Version.find params[:id]
@object = YAML.load(@version.object)
end
end
end
|
require 'will_paginate/array'
require 'yaml'
require_dependency "paper_trail_ui/application_controller"
module PaperTrailUi
class ReportsController < ApplicationController
MODEL_NAMES = PaperTrail::Version.select("DISTINCT item_type").map(&:item_type)
EVENT_TYPES = PaperTrail::Version.select("DISTINCT event").map(&:event)
ACTOR_NAMES = PaperTrail::Version.select("DISTINCT whodunnit").map(&:whodunnit)
def index
@model_names = array_to_filter_hash(MODEL_NAMES)
@event_names = array_to_filter_hash(EVENT_TYPES)
@actor_names = array_to_filter_hash(ACTOR_NAMES)
@query = PaperTrail::Version.search params[:q]
@versions = @query.result(distinct: true).paginate(page: params[:page], per_page: 100)
end
def show
@version = PaperTrail::Version.find params[:id]
@object = YAML.load(@version.object || "---") || {}
end
private
def array_to_filter_hash(array)
{"All" => ""}.merge(array.reduce({}){|a, x| a[x] = x; a})
end
end
end
|
Add method to generate a hash from array to be used in converting model names, events, and actors to filter hashes
|
Add method to generate a hash from array to be used in converting model names, events, and actors to filter hashes
|
Ruby
|
mit
|
buttercloud/paper_trail_ui,buttercloud/paper_trail_ui,buttercloud/paper_trail_ui
|
ruby
|
## Code Before:
require 'will_paginate/array'
require 'yaml'
require_dependency "paper_trail_ui/application_controller"
module PaperTrailUi
class ReportsController < ApplicationController
MODEL_NAMES = PaperTrail::Version.select("DISTINCT item_type").map(&:item_type)
EVENT_TYPES = PaperTrail::Version.select("DISTINCT event").map(&:event)
def index
@model_names = {"All" => ""}.merge(MODEL_NAMES.reduce({}){|a, x| a[x] = x; a})
@event_names = {"All" => ""}.merge(EVENT_TYPES.reduce({}){|a, x| a[x] = x; a})
@query = PaperTrail::Version.search params[:q]
@versions = @query.result(distinct: true).paginate(page: params[:page], per_page: 100)
end
def show
@version = PaperTrail::Version.find params[:id]
@object = YAML.load(@version.object)
end
end
end
## Instruction:
Add method to generate a hash from array to be used in converting model names, events, and actors to filter hashes
## Code After:
require 'will_paginate/array'
require 'yaml'
require_dependency "paper_trail_ui/application_controller"
module PaperTrailUi
class ReportsController < ApplicationController
MODEL_NAMES = PaperTrail::Version.select("DISTINCT item_type").map(&:item_type)
EVENT_TYPES = PaperTrail::Version.select("DISTINCT event").map(&:event)
ACTOR_NAMES = PaperTrail::Version.select("DISTINCT whodunnit").map(&:whodunnit)
def index
@model_names = array_to_filter_hash(MODEL_NAMES)
@event_names = array_to_filter_hash(EVENT_TYPES)
@actor_names = array_to_filter_hash(ACTOR_NAMES)
@query = PaperTrail::Version.search params[:q]
@versions = @query.result(distinct: true).paginate(page: params[:page], per_page: 100)
end
def show
@version = PaperTrail::Version.find params[:id]
@object = YAML.load(@version.object || "---") || {}
end
private
def array_to_filter_hash(array)
{"All" => ""}.merge(array.reduce({}){|a, x| a[x] = x; a})
end
end
end
|
72b42470a4ddecb446de32ce98c900d2f5c859b5
|
CHANGELOG.md
|
CHANGELOG.md
|
- Pheanstalk 4.X is required
- PHP 7.2+ is required
### Fixed
n/a
### Added
- `Pheanstalk\Contract\PheanstalkInterface` is aliased to the default Pheanstalk
connection so autowiring should work.
- `PMG\PheanstalkBundle\ConnectionManager` to provide a way to access all
connections outside of the container.
## 1.0
Brand new!
BC Breaks:
- None
New Features:
- Brand new bundle! Everything is new.
|
- Pheanstalk 4.X is required
- PHP 7.2+ is required
- Symfony 3.4 or 4.X are required
### Fixed
n/a
### Added
- `Pheanstalk\Contract\PheanstalkInterface` is aliased to the default Pheanstalk
connection so autowiring should work.
- `PMG\PheanstalkBundle\ConnectionManager` to provide a way to access all
connections outside of the container.
## 1.0
Brand new!
BC Breaks:
- None
New Features:
- Brand new bundle! Everything is new.
|
Include the Symfony Requirements in the Changelog
|
Include the Symfony Requirements in the Changelog
|
Markdown
|
apache-2.0
|
AgencyPMG/PheanstalkBundle
|
markdown
|
## Code Before:
- Pheanstalk 4.X is required
- PHP 7.2+ is required
### Fixed
n/a
### Added
- `Pheanstalk\Contract\PheanstalkInterface` is aliased to the default Pheanstalk
connection so autowiring should work.
- `PMG\PheanstalkBundle\ConnectionManager` to provide a way to access all
connections outside of the container.
## 1.0
Brand new!
BC Breaks:
- None
New Features:
- Brand new bundle! Everything is new.
## Instruction:
Include the Symfony Requirements in the Changelog
## Code After:
- Pheanstalk 4.X is required
- PHP 7.2+ is required
- Symfony 3.4 or 4.X are required
### Fixed
n/a
### Added
- `Pheanstalk\Contract\PheanstalkInterface` is aliased to the default Pheanstalk
connection so autowiring should work.
- `PMG\PheanstalkBundle\ConnectionManager` to provide a way to access all
connections outside of the container.
## 1.0
Brand new!
BC Breaks:
- None
New Features:
- Brand new bundle! Everything is new.
|
e28b49259ce45a40037210fe84a6e8b4ba674c84
|
resources/assets/js/app/main.js
|
resources/assets/js/app/main.js
|
(function($){
$(function(){
$('.tooltipped').tooltip({delay: 50});
// Smooth scroll for links on the current page
$(document.body).on('click', 'a[href^="#"]', function (e) {
e.preventDefault();
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
var offset = 0;
if (target[0].id.indexOf("feature-") == 0) {
offset = 100;
}
$('html,body').animate({
scrollTop: target.offset().top - offset
}, 1000);
return false;
}
}
});
// Allow toasts to be dismissed with a click
$(document).on('click', '#toast-container .toast', function() {
$(this).fadeOut(function(){
$(this).remove();
});
});
});
})(jQuery);
|
(function($){
$(function(){
$('.tooltipped').tooltip({delay: 50});
// Smooth scroll for links on the current page
$(document.body).on('click', 'a[href^="#"]', function (e) {
e.preventDefault();
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
var offset = 0;
if (target[0].id.indexOf("feature-") == 0) {
offset = 100;
}
$('html,body').animate({
scrollTop: target.offset().top - offset
}, 1000);
return false;
}
}
});
// Allow toasts to be dismissed with a click
$(document).on('click', '#toast-container .toast', function() {
$(this).fadeOut(function(){
$(this).remove();
});
});
// Setup all ajax queries to use the CSRF token
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
});
})(jQuery);
|
Add our meta tag CSRF token to every ajax request
|
Add our meta tag CSRF token to every ajax request
|
JavaScript
|
mit
|
TheJokersThief/Penance,TheJokersThief/Penance
|
javascript
|
## Code Before:
(function($){
$(function(){
$('.tooltipped').tooltip({delay: 50});
// Smooth scroll for links on the current page
$(document.body).on('click', 'a[href^="#"]', function (e) {
e.preventDefault();
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
var offset = 0;
if (target[0].id.indexOf("feature-") == 0) {
offset = 100;
}
$('html,body').animate({
scrollTop: target.offset().top - offset
}, 1000);
return false;
}
}
});
// Allow toasts to be dismissed with a click
$(document).on('click', '#toast-container .toast', function() {
$(this).fadeOut(function(){
$(this).remove();
});
});
});
})(jQuery);
## Instruction:
Add our meta tag CSRF token to every ajax request
## Code After:
(function($){
$(function(){
$('.tooltipped').tooltip({delay: 50});
// Smooth scroll for links on the current page
$(document.body).on('click', 'a[href^="#"]', function (e) {
e.preventDefault();
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
var offset = 0;
if (target[0].id.indexOf("feature-") == 0) {
offset = 100;
}
$('html,body').animate({
scrollTop: target.offset().top - offset
}, 1000);
return false;
}
}
});
// Allow toasts to be dismissed with a click
$(document).on('click', '#toast-container .toast', function() {
$(this).fadeOut(function(){
$(this).remove();
});
});
// Setup all ajax queries to use the CSRF token
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
});
})(jQuery);
|
30c59942108a8a78bd666190d9ab61c27ddf95f8
|
source/_download.markdown
|
source/_download.markdown
|
Just include the plugin file,
[Coffeescript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.js.coffee) or [JavaScript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.plain.js)
stylesheet,
[SASS](https://github.com/camerond/Windoze/blob/master/source/stylesheets/jquery.windoze.css.sass) or [CSS](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.plain.css)
and keep reading:
|
Just include the plugin file,
[Coffeescript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.js.coffee) or [JavaScript](https://github.com/camerond/Windoze/blob/master/build/javascripts/jquery.windoze.js)
stylesheet,
[SASS](https://github.com/camerond/Windoze/blob/master/source/stylesheets/jquery.windoze.css.sass) or [CSS](https://github.com/camerond/Windoze/blob/master/build/javascripts/jquery.windoze.css)
and keep reading:
|
Fix links to static files
|
Fix links to static files
|
Markdown
|
mit
|
camerond/windoze,camerond/windoze,camerond/windoze
|
markdown
|
## Code Before:
Just include the plugin file,
[Coffeescript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.js.coffee) or [JavaScript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.plain.js)
stylesheet,
[SASS](https://github.com/camerond/Windoze/blob/master/source/stylesheets/jquery.windoze.css.sass) or [CSS](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.plain.css)
and keep reading:
## Instruction:
Fix links to static files
## Code After:
Just include the plugin file,
[Coffeescript](https://github.com/camerond/Windoze/blob/master/source/javascripts/jquery.windoze.js.coffee) or [JavaScript](https://github.com/camerond/Windoze/blob/master/build/javascripts/jquery.windoze.js)
stylesheet,
[SASS](https://github.com/camerond/Windoze/blob/master/source/stylesheets/jquery.windoze.css.sass) or [CSS](https://github.com/camerond/Windoze/blob/master/build/javascripts/jquery.windoze.css)
and keep reading:
|
7c660626f303137d850f96d50f7aec9ed4a3ca13
|
.travis.yml
|
.travis.yml
|
language: php
php:
- 5.4
- 5.3
before_script:
- composer install
script:
- phpunit --bootstrap=bootstrap.php --coverage-text="php://stdout" --configuration="phpunit.xml" src/Navarr/Socket/Tests
|
language: php
php:
- 5.4
- 5.3
before_script:
- composer install
- composer require phpunit/phpunit 3.7.18
script:
- phpunit --bootstrap=bootstrap.php --coverage-text="php://stdout" --configuration="phpunit.xml" src/Navarr/Socket/Tests
|
Add PHPUnit for Travis-CI Only
|
Add PHPUnit for Travis-CI Only
|
YAML
|
mit
|
navarr/Sockets
|
yaml
|
## Code Before:
language: php
php:
- 5.4
- 5.3
before_script:
- composer install
script:
- phpunit --bootstrap=bootstrap.php --coverage-text="php://stdout" --configuration="phpunit.xml" src/Navarr/Socket/Tests
## Instruction:
Add PHPUnit for Travis-CI Only
## Code After:
language: php
php:
- 5.4
- 5.3
before_script:
- composer install
- composer require phpunit/phpunit 3.7.18
script:
- phpunit --bootstrap=bootstrap.php --coverage-text="php://stdout" --configuration="phpunit.xml" src/Navarr/Socket/Tests
|
0de4e419ab107ad2ea3d31083ff3210865ade793
|
README.md
|
README.md
|
This is the monorepo for the testdeck packages.
## Packages
- [@testdeck/mocha](./packages/mocha)
- [@testdeck/jasmine](./packages/jasmine)
- [@testdeck/jest](./packages/jest)
- [@testdeck/di-typedi](./packages/di-typedi)
- [@testdeck/core](./packages/core)
## Build
Clone this repository using
```
git clone https://github.com/testdeck/testdeck.git
```
Then from inside the so created `testdeck` directory run
```
npm install
```
This will install all required dependencies and will also bootstrap `lerna`.
The following npm scripts are available
- `npm run tslint` -- runs `tslint` on all sources in all available packages
- `npm run tslint-fix` -- runs `tslint --fix` on all sources in all available packages
- `npm test` -- run all tests on all available packages
## Resources
- [Official Documentation](https://testdeck.org)
- [Usage: npm-stat.js](https://npm-stat.com/charts.html?package=mocha-typescript&package=%40testdeck%2Fmocha&package=%40testdeck%2Fjest&package=%40testdeck%2Fmocha&package=%40testdeck%2Fjasmine)
|
The JavaScript OOP style tests!
```TypeScript
// Use one of the mocha/jest/jasmine test runners:
import { suite, test } from "@testdeck/mocha";
import { suite, test } from "@testdeck/jest";
import { suite, test } from "@testdeck/jasmine";
// And write your tests like:
import { expect } from 'chai';
@suite
class Hello {
@test
world() {
expect(false).to.be.true;
}
}
```
## Packages
This is the monorepo for the testdeck packages.
- [@testdeck/mocha](./packages/mocha)
- [@testdeck/jasmine](./packages/jasmine)
- [@testdeck/jest](./packages/jest)
- [@testdeck/di-typedi](./packages/di-typedi)
- [@testdeck/core](./packages/core)
## Build
Clone this repository using
```
git clone https://github.com/testdeck/testdeck.git
```
Then from inside the so created `testdeck` directory run
```
npm install
```
This will install all required dependencies and will also bootstrap `lerna`.
The following npm scripts are available
- `npm run tslint` -- runs `tslint` on all sources in all available packages
- `npm run tslint-fix` -- runs `tslint --fix` on all sources in all available packages
- `npm test` -- run all tests on all available packages
## Resources
- [Official Documentation](https://testdeck.org)
- [Usage: npm-stat.js](https://npm-stat.com/charts.html?package=mocha-typescript&package=%40testdeck%2Fmocha&package=%40testdeck%2Fjest&package=%40testdeck%2Fmocha&package=%40testdeck%2Fjasmine)
|
Add a short example in the readme
|
Add a short example in the readme
We need this so people randomly landing on the monorepo, will have idea what testdeck is about.
|
Markdown
|
apache-2.0
|
pana-cc/mocha-typescript,pana-cc/mocha-typescript
|
markdown
|
## Code Before:
This is the monorepo for the testdeck packages.
## Packages
- [@testdeck/mocha](./packages/mocha)
- [@testdeck/jasmine](./packages/jasmine)
- [@testdeck/jest](./packages/jest)
- [@testdeck/di-typedi](./packages/di-typedi)
- [@testdeck/core](./packages/core)
## Build
Clone this repository using
```
git clone https://github.com/testdeck/testdeck.git
```
Then from inside the so created `testdeck` directory run
```
npm install
```
This will install all required dependencies and will also bootstrap `lerna`.
The following npm scripts are available
- `npm run tslint` -- runs `tslint` on all sources in all available packages
- `npm run tslint-fix` -- runs `tslint --fix` on all sources in all available packages
- `npm test` -- run all tests on all available packages
## Resources
- [Official Documentation](https://testdeck.org)
- [Usage: npm-stat.js](https://npm-stat.com/charts.html?package=mocha-typescript&package=%40testdeck%2Fmocha&package=%40testdeck%2Fjest&package=%40testdeck%2Fmocha&package=%40testdeck%2Fjasmine)
## Instruction:
Add a short example in the readme
We need this so people randomly landing on the monorepo, will have idea what testdeck is about.
## Code After:
The JavaScript OOP style tests!
```TypeScript
// Use one of the mocha/jest/jasmine test runners:
import { suite, test } from "@testdeck/mocha";
import { suite, test } from "@testdeck/jest";
import { suite, test } from "@testdeck/jasmine";
// And write your tests like:
import { expect } from 'chai';
@suite
class Hello {
@test
world() {
expect(false).to.be.true;
}
}
```
## Packages
This is the monorepo for the testdeck packages.
- [@testdeck/mocha](./packages/mocha)
- [@testdeck/jasmine](./packages/jasmine)
- [@testdeck/jest](./packages/jest)
- [@testdeck/di-typedi](./packages/di-typedi)
- [@testdeck/core](./packages/core)
## Build
Clone this repository using
```
git clone https://github.com/testdeck/testdeck.git
```
Then from inside the so created `testdeck` directory run
```
npm install
```
This will install all required dependencies and will also bootstrap `lerna`.
The following npm scripts are available
- `npm run tslint` -- runs `tslint` on all sources in all available packages
- `npm run tslint-fix` -- runs `tslint --fix` on all sources in all available packages
- `npm test` -- run all tests on all available packages
## Resources
- [Official Documentation](https://testdeck.org)
- [Usage: npm-stat.js](https://npm-stat.com/charts.html?package=mocha-typescript&package=%40testdeck%2Fmocha&package=%40testdeck%2Fjest&package=%40testdeck%2Fmocha&package=%40testdeck%2Fjasmine)
|
80b75ff473abd05108a4d930ef89e8ebcbc058fa
|
packages/wr/writer-cps-full.yaml
|
packages/wr/writer-cps-full.yaml
|
homepage: https://github.com/minad/writer-cps-full#readme
changelog-type: ''
hash: 8f2b44a4ea6d59d5f693b0ec73336a0b815e058d9b8a42916a90d6e82a53275b
test-bench-deps: {}
maintainer: [email protected]
synopsis: WriteT and RWST monad transformers (Reexport with all dependencies)
changelog: ''
basic-deps:
writer-cps-morph: ! '>=0.1.0.1 && <0.2'
writer-cps-transformers: ! '>=0.1.1.2 && <0.2'
base: ! '>=4.5 && <5'
writer-cps-lens: ! '>=0.1.0.0 && <0.2'
writer-cps-mtl: ! '>=0.1.1.2 && <0.2'
all-versions:
- 0.1.0.0
author: Daniel Mendler
latest: 0.1.0.0
description-type: haddock
description: The WriterT and RWST monad transformers provided by writer-cps-transformers
are written in continuation passing style and avoid the space-leak problem of the
traditional Control.Monad.Trans.Writer.Strict and Control.Monad.Trans.Writer.Lazy.
This package reexports from writer-cps-transformers and provides all missing orphan
instances, e.g. from mtl.
license-name: BSD-3-Clause
|
homepage: https://github.com/minad/writer-cps-full#readme
changelog-type: ''
hash: c1184180631618add72cebf1020fc265afeec56d27978df5f8654e333bfcf107
test-bench-deps: {}
maintainer: [email protected]
synopsis: WriteT and RWST monad transformers (Reexport with all dependencies)
changelog: ''
basic-deps:
writer-cps-morph: ! '>=0.1.0.1 && <0.2'
writer-cps-transformers: ! '>=0.1.1.2 && <0.6'
base: ! '>=4.5 && <5'
writer-cps-lens: ! '>=0.1.0.0 && <0.2'
writer-cps-mtl: ! '>=0.1.1.2 && <0.2'
all-versions:
- 0.1.0.0
author: Daniel Mendler
latest: 0.1.0.0
description-type: haddock
description: The WriterT and RWST monad transformers provided by writer-cps-transformers
are written in continuation passing style and avoid the space-leak problem of the
traditional Control.Monad.Trans.Writer.Strict and Control.Monad.Trans.Writer.Lazy.
This package reexports from writer-cps-transformers and provides all missing orphan
instances, e.g. from mtl.
license-name: BSD-3-Clause
|
Update from Hackage at 2019-03-07T14:26:28Z
|
Update from Hackage at 2019-03-07T14:26:28Z
|
YAML
|
mit
|
commercialhaskell/all-cabal-metadata
|
yaml
|
## Code Before:
homepage: https://github.com/minad/writer-cps-full#readme
changelog-type: ''
hash: 8f2b44a4ea6d59d5f693b0ec73336a0b815e058d9b8a42916a90d6e82a53275b
test-bench-deps: {}
maintainer: [email protected]
synopsis: WriteT and RWST monad transformers (Reexport with all dependencies)
changelog: ''
basic-deps:
writer-cps-morph: ! '>=0.1.0.1 && <0.2'
writer-cps-transformers: ! '>=0.1.1.2 && <0.2'
base: ! '>=4.5 && <5'
writer-cps-lens: ! '>=0.1.0.0 && <0.2'
writer-cps-mtl: ! '>=0.1.1.2 && <0.2'
all-versions:
- 0.1.0.0
author: Daniel Mendler
latest: 0.1.0.0
description-type: haddock
description: The WriterT and RWST monad transformers provided by writer-cps-transformers
are written in continuation passing style and avoid the space-leak problem of the
traditional Control.Monad.Trans.Writer.Strict and Control.Monad.Trans.Writer.Lazy.
This package reexports from writer-cps-transformers and provides all missing orphan
instances, e.g. from mtl.
license-name: BSD-3-Clause
## Instruction:
Update from Hackage at 2019-03-07T14:26:28Z
## Code After:
homepage: https://github.com/minad/writer-cps-full#readme
changelog-type: ''
hash: c1184180631618add72cebf1020fc265afeec56d27978df5f8654e333bfcf107
test-bench-deps: {}
maintainer: [email protected]
synopsis: WriteT and RWST monad transformers (Reexport with all dependencies)
changelog: ''
basic-deps:
writer-cps-morph: ! '>=0.1.0.1 && <0.2'
writer-cps-transformers: ! '>=0.1.1.2 && <0.6'
base: ! '>=4.5 && <5'
writer-cps-lens: ! '>=0.1.0.0 && <0.2'
writer-cps-mtl: ! '>=0.1.1.2 && <0.2'
all-versions:
- 0.1.0.0
author: Daniel Mendler
latest: 0.1.0.0
description-type: haddock
description: The WriterT and RWST monad transformers provided by writer-cps-transformers
are written in continuation passing style and avoid the space-leak problem of the
traditional Control.Monad.Trans.Writer.Strict and Control.Monad.Trans.Writer.Lazy.
This package reexports from writer-cps-transformers and provides all missing orphan
instances, e.g. from mtl.
license-name: BSD-3-Clause
|
9b0d5796c1e48a3bf294971dc129499876936a36
|
send2trash/plat_osx.py
|
send2trash/plat_osx.py
|
from platform import mac_ver
from sys import version_info
# If macOS is 11.0 or newer try to use the pyobjc version to get around #51
# NOTE: pyobjc only supports python >= 3.6
if version_info >= (3, 6) and int(mac_ver()[0].split(".", 1)[0]) >= 11:
try:
from .plat_osx_pyobjc import send2trash
except ImportError:
# Try to fall back to ctypes version, although likely problematic still
from .plat_osx_ctypes import send2trash
else:
# Just use the old version otherwise
from .plat_osx_ctypes import send2trash # noqa: F401
|
from platform import mac_ver
from sys import version_info
# NOTE: version of pyobjc only supports python >= 3.6 and 10.9+
macos_ver = tuple(int(part) for part in mac_ver()[0].split("."))
if version_info >= (3, 6) and macos_ver >= (10, 9):
try:
from .plat_osx_pyobjc import send2trash
except ImportError:
# Try to fall back to ctypes version, although likely problematic still
from .plat_osx_ctypes import send2trash
else:
# Just use the old version otherwise
from .plat_osx_ctypes import send2trash # noqa: F401
|
Change conditional for macos pyobjc usage
|
Change conditional for macos pyobjc usage
macOS 11.x will occasionally identify as 10.16, since there was no real
reason to prevent on all supported platforms allow.
|
Python
|
bsd-3-clause
|
hsoft/send2trash
|
python
|
## Code Before:
from platform import mac_ver
from sys import version_info
# If macOS is 11.0 or newer try to use the pyobjc version to get around #51
# NOTE: pyobjc only supports python >= 3.6
if version_info >= (3, 6) and int(mac_ver()[0].split(".", 1)[0]) >= 11:
try:
from .plat_osx_pyobjc import send2trash
except ImportError:
# Try to fall back to ctypes version, although likely problematic still
from .plat_osx_ctypes import send2trash
else:
# Just use the old version otherwise
from .plat_osx_ctypes import send2trash # noqa: F401
## Instruction:
Change conditional for macos pyobjc usage
macOS 11.x will occasionally identify as 10.16, since there was no real
reason to prevent on all supported platforms allow.
## Code After:
from platform import mac_ver
from sys import version_info
# NOTE: version of pyobjc only supports python >= 3.6 and 10.9+
macos_ver = tuple(int(part) for part in mac_ver()[0].split("."))
if version_info >= (3, 6) and macos_ver >= (10, 9):
try:
from .plat_osx_pyobjc import send2trash
except ImportError:
# Try to fall back to ctypes version, although likely problematic still
from .plat_osx_ctypes import send2trash
else:
# Just use the old version otherwise
from .plat_osx_ctypes import send2trash # noqa: F401
|
3539b935d1d5b70fff1335c04dd320edb3cbe511
|
lib/setup.js
|
lib/setup.js
|
module.exports = function () {
var browser = require('openurl');
var config = require('./config');
var REDIRECT_URI = 'https://rogeriopvl.github.com/downstagram';
console.log('\n********** DOWNSTAGRAM OAUTH SETUP **********');
console.log('\n To use downstagram you need to authorize it to access your instagram account.');
console.log('Your browser will open for you to authorize the app...');
var authURI = [
'https://instagram.com/oauth/authorize/?',
'client_id=' + config.auth.client_id,
'&redirect_uri=' + REDIRECT_URI,
'&response_type=token'
].join('');
browser.open(authURI);
console.log('Now according to the intructions in the App page, insert your access token here:');
var stdin = process.openStdin();
stdin.on('data', function(chunk) {
var token = chunk.toString().trim();
config.auth.access_token = token;
config.save(config.auth);
process.exit(0);
});
};
|
module.exports = function () {
var browser = require('openurl');
var config = require('./config');
var REDIRECT_URI = 'https://rogeriopvl.github.com/downstagram';
console.log('\n********** DOWNSTAGRAM OAUTH SETUP **********');
console.log('\n To use downstagram you need to authorize it to access your instagram account.');
console.log('Your browser will open for you to authorize the app...');
var authURI = [
'https://instagram.com/oauth/authorize/?',
'client_id=' + config.auth.client_id,
'&redirect_uri=' + REDIRECT_URI,
'&response_type=token'
].join('');
try {
browser.open(authURI);
} catch (e) {
console.log('Could not open browser. Maybe you are on a headless server?');
console.log('Open a web browser on this URL to continue: ', authURI);
}
console.log('Now according to the intructions in the App page, insert your access token here:');
var stdin = process.openStdin();
stdin.on('data', function(chunk) {
var token = chunk.toString().trim();
config.auth.access_token = token;
config.save(config.auth);
process.exit(0);
});
};
|
Add alternative to browser opening on headless servers
|
Add alternative to browser opening on headless servers
|
JavaScript
|
mit
|
rogeriopvl/downstagram,afrolov/downstagram
|
javascript
|
## Code Before:
module.exports = function () {
var browser = require('openurl');
var config = require('./config');
var REDIRECT_URI = 'https://rogeriopvl.github.com/downstagram';
console.log('\n********** DOWNSTAGRAM OAUTH SETUP **********');
console.log('\n To use downstagram you need to authorize it to access your instagram account.');
console.log('Your browser will open for you to authorize the app...');
var authURI = [
'https://instagram.com/oauth/authorize/?',
'client_id=' + config.auth.client_id,
'&redirect_uri=' + REDIRECT_URI,
'&response_type=token'
].join('');
browser.open(authURI);
console.log('Now according to the intructions in the App page, insert your access token here:');
var stdin = process.openStdin();
stdin.on('data', function(chunk) {
var token = chunk.toString().trim();
config.auth.access_token = token;
config.save(config.auth);
process.exit(0);
});
};
## Instruction:
Add alternative to browser opening on headless servers
## Code After:
module.exports = function () {
var browser = require('openurl');
var config = require('./config');
var REDIRECT_URI = 'https://rogeriopvl.github.com/downstagram';
console.log('\n********** DOWNSTAGRAM OAUTH SETUP **********');
console.log('\n To use downstagram you need to authorize it to access your instagram account.');
console.log('Your browser will open for you to authorize the app...');
var authURI = [
'https://instagram.com/oauth/authorize/?',
'client_id=' + config.auth.client_id,
'&redirect_uri=' + REDIRECT_URI,
'&response_type=token'
].join('');
try {
browser.open(authURI);
} catch (e) {
console.log('Could not open browser. Maybe you are on a headless server?');
console.log('Open a web browser on this URL to continue: ', authURI);
}
console.log('Now according to the intructions in the App page, insert your access token here:');
var stdin = process.openStdin();
stdin.on('data', function(chunk) {
var token = chunk.toString().trim();
config.auth.access_token = token;
config.save(config.auth);
process.exit(0);
});
};
|
b4b9e6d8d2ac2f4017e32aebd42327d4b5230d18
|
test/frontend/instant-share/instant_share_test.js
|
test/frontend/instant-share/instant_share_test.js
|
/* global sinon, Event, InstantShareApp */
describe("InstantShareApp", function() {
"use strict";
var sandbox, xhr;
beforeEach(function() {
sandbox = sinon.sandbox.create();
xhr = {
open: sinon.spy(),
setRequestHeader: function() {},
send: function() {}
};
sandbox.stub(window, "XMLHttpRequest").returns(xhr);
});
afterEach(function() {
sandbox.restore();
});
describe("click event on the call button", function() {
it("should post an xhr request to the instant-share ping back API",
function() {
var instantShareApp = new InstantShareApp();
instantShareApp.start();
var event = new Event('click');
document.querySelector("#instant-share-call a")
.dispatchEvent(event);
sinon.assert.calledOnce(xhr.open);
sinon.assert.calledWithExactly(xhr.open, "POST", window.location, true);
});
});
});
|
/* global sinon, Event, InstantShareApp, chai */
describe("InstantShareApp", function() {
"use strict";
var expect = chai.expect;
var xhr, request;
beforeEach(function() {
xhr = sinon.useFakeXMLHttpRequest();
request = undefined;
xhr.onCreate = function (req) {
request = req;
};
});
afterEach(function() {
xhr.restore();
});
// XXX error behavior!
describe("click event on the call button", function() {
it("should post an xhr request with an empty object to the " +
"instant-share pingback API",
function() {
var instantShareApp = new InstantShareApp();
instantShareApp.start();
var event = new Event('click');
document.querySelector("#instant-share-call a")
.dispatchEvent(event);
expect(request.method.toLowerCase()).to.equal("post");
expect(request.async).to.equal(true);
expect(request.url).to.equal(window.location);
expect(request.requestBody).to.equal(JSON.stringify({}));
});
});
});
|
Switch InstantShare test to use Sinon infrastructure as per review comment
|
Switch InstantShare test to use Sinon infrastructure as per review comment
|
JavaScript
|
mpl-2.0
|
mozilla/talkilla,mozilla/talkilla,mozilla/talkilla
|
javascript
|
## Code Before:
/* global sinon, Event, InstantShareApp */
describe("InstantShareApp", function() {
"use strict";
var sandbox, xhr;
beforeEach(function() {
sandbox = sinon.sandbox.create();
xhr = {
open: sinon.spy(),
setRequestHeader: function() {},
send: function() {}
};
sandbox.stub(window, "XMLHttpRequest").returns(xhr);
});
afterEach(function() {
sandbox.restore();
});
describe("click event on the call button", function() {
it("should post an xhr request to the instant-share ping back API",
function() {
var instantShareApp = new InstantShareApp();
instantShareApp.start();
var event = new Event('click');
document.querySelector("#instant-share-call a")
.dispatchEvent(event);
sinon.assert.calledOnce(xhr.open);
sinon.assert.calledWithExactly(xhr.open, "POST", window.location, true);
});
});
});
## Instruction:
Switch InstantShare test to use Sinon infrastructure as per review comment
## Code After:
/* global sinon, Event, InstantShareApp, chai */
describe("InstantShareApp", function() {
"use strict";
var expect = chai.expect;
var xhr, request;
beforeEach(function() {
xhr = sinon.useFakeXMLHttpRequest();
request = undefined;
xhr.onCreate = function (req) {
request = req;
};
});
afterEach(function() {
xhr.restore();
});
// XXX error behavior!
describe("click event on the call button", function() {
it("should post an xhr request with an empty object to the " +
"instant-share pingback API",
function() {
var instantShareApp = new InstantShareApp();
instantShareApp.start();
var event = new Event('click');
document.querySelector("#instant-share-call a")
.dispatchEvent(event);
expect(request.method.toLowerCase()).to.equal("post");
expect(request.async).to.equal(true);
expect(request.url).to.equal(window.location);
expect(request.requestBody).to.equal(JSON.stringify({}));
});
});
});
|
642a56ec1e97af1f7ca5cfa4fe767d33dd0de0cb
|
zsh/aliases.zsh
|
zsh/aliases.zsh
|
[ `which hub` ] && alias git='nocorrect hub'
alias trog='trash **/*.orig'
alias -g A='|ack'
alias -g L='|less'
alias -g V='|vim -'
alias -g M='|mvim -'
alias -g G='|grep'
alias -g T='|tail'
alias -g H='|head'
alias -g N='&>/dev/null&'
alias -g W='|wc'
|
type hub &>/dev/null && alias git='nocorrect hub'
alias trog='trash **/*.orig'
alias -g A='|ack'
alias -g L='|less'
alias -g V='|vim -'
alias -g M='|mvim -'
alias -g G='|grep'
alias -g T='|tail'
alias -g H='|head'
alias -g N='&>/dev/null&'
alias -g W='|wc'
|
Use type to detect presence of `hub`
|
Use type to detect presence of `hub`
|
Shell
|
mit
|
jcf/ansible-dotfiles,jcf/ansible-dotfiles,jcf/ansible-dotfiles,jcf/ansible-dotfiles,jcf/ansible-dotfiles
|
shell
|
## Code Before:
[ `which hub` ] && alias git='nocorrect hub'
alias trog='trash **/*.orig'
alias -g A='|ack'
alias -g L='|less'
alias -g V='|vim -'
alias -g M='|mvim -'
alias -g G='|grep'
alias -g T='|tail'
alias -g H='|head'
alias -g N='&>/dev/null&'
alias -g W='|wc'
## Instruction:
Use type to detect presence of `hub`
## Code After:
type hub &>/dev/null && alias git='nocorrect hub'
alias trog='trash **/*.orig'
alias -g A='|ack'
alias -g L='|less'
alias -g V='|vim -'
alias -g M='|mvim -'
alias -g G='|grep'
alias -g T='|tail'
alias -g H='|head'
alias -g N='&>/dev/null&'
alias -g W='|wc'
|
8711f5cc15bb0ac1fb05dd2975923b7b91e5c313
|
README.md
|
README.md
|
A java port of orb: a library for simple orbital mechanics
|
A java port of [orb](https://github.com/benelsen/orb): a library for simple orbital mechanics
So far only some part of the orb library have been ported to java. Feel free to port other parts!
## Usage
Calculate the position and velocity of a celesitial body:
```java
double a = 149598261150.0; // semimajor axis of orbit [m]
double e = 0.01671123; // eccentricity of orbit
double i = 7.155 * Math.PI / 180; // inclination of orbit [rad]
double Ω = 348.73936 * Math.PI / 180; // right ascension of orbit [rad]
double ω = 114.20783 * Math.PI / 180; // argument of periapsis of orbit [rad]
double T0 = 0; // epoch of given elements
double t = 1 * 365.256363004 * 86400; // time [s]
double massEarth = 1.988546944e30;
double massSun = 5.9725801308e24 * 1.0123000371;
Position.KeplerResult result = Position.keplerian(a, e, i, Ω, ω, t, T0, 0, massEarth, massSun);
```
|
Update readme on how to calculate celestial positions
|
Update readme on how to calculate celestial positions
|
Markdown
|
mit
|
molp/orbicular
|
markdown
|
## Code Before:
A java port of orb: a library for simple orbital mechanics
## Instruction:
Update readme on how to calculate celestial positions
## Code After:
A java port of [orb](https://github.com/benelsen/orb): a library for simple orbital mechanics
So far only some part of the orb library have been ported to java. Feel free to port other parts!
## Usage
Calculate the position and velocity of a celesitial body:
```java
double a = 149598261150.0; // semimajor axis of orbit [m]
double e = 0.01671123; // eccentricity of orbit
double i = 7.155 * Math.PI / 180; // inclination of orbit [rad]
double Ω = 348.73936 * Math.PI / 180; // right ascension of orbit [rad]
double ω = 114.20783 * Math.PI / 180; // argument of periapsis of orbit [rad]
double T0 = 0; // epoch of given elements
double t = 1 * 365.256363004 * 86400; // time [s]
double massEarth = 1.988546944e30;
double massSun = 5.9725801308e24 * 1.0123000371;
Position.KeplerResult result = Position.keplerian(a, e, i, Ω, ω, t, T0, 0, massEarth, massSun);
```
|
d3cb29aa20afd385b746a99741608ab73c8fdd4d
|
js/mapRequest.control.js
|
js/mapRequest.control.js
|
L.Control.MapRequest = L.Control.extend({
options: {
position: "topright"
},
initialize: function(options) {
L.setOptions(this, options);
},
onAdd: function(map) {
let self = this;
let container = L.DomUtil.create("div", "bm-map-request");
container.innerHTML = "<p>Would you like to play some other map? <a target='blank' href='https://feedback.userreport.com/2229a84e-c2fa-4427-99ab-27639f103569/'>Issue a map request.</a></p>";
L.DomEvent.disableClickPropagation(container);
L.DomEvent.disableScrollPropagation(container);
return container;
}
});
L.control.mapRequest = function(opts) {
return new L.Control.MapRequest(opts);
};
|
L.Control.MapRequest = L.Control.extend({
options: {
position: "topright"
},
initialize: function(options) {
L.setOptions(this, options);
},
onAdd: function(map) {
let self = this;
let container = L.DomUtil.create("div", "bm-map-request");
container.innerHTML = "<p>Would you like to play some other map? <a target='blank' href='https://feedback.userreport.com/2229a84e-c2fa-4427-99ab-27639f103569/'>Issue a map request.</a></p>";
container.innerHTML += "<p>Chose the wrong map? <a href='/'>Choose again!</a></p>"
L.DomEvent.disableClickPropagation(container);
L.DomEvent.disableScrollPropagation(container);
return container;
}
});
L.control.mapRequest = function(opts) {
return new L.Control.MapRequest(opts);
};
|
Add link to home page
|
Add link to home page
|
JavaScript
|
mit
|
zimmicz/blind-maps,zimmicz/blind-maps
|
javascript
|
## Code Before:
L.Control.MapRequest = L.Control.extend({
options: {
position: "topright"
},
initialize: function(options) {
L.setOptions(this, options);
},
onAdd: function(map) {
let self = this;
let container = L.DomUtil.create("div", "bm-map-request");
container.innerHTML = "<p>Would you like to play some other map? <a target='blank' href='https://feedback.userreport.com/2229a84e-c2fa-4427-99ab-27639f103569/'>Issue a map request.</a></p>";
L.DomEvent.disableClickPropagation(container);
L.DomEvent.disableScrollPropagation(container);
return container;
}
});
L.control.mapRequest = function(opts) {
return new L.Control.MapRequest(opts);
};
## Instruction:
Add link to home page
## Code After:
L.Control.MapRequest = L.Control.extend({
options: {
position: "topright"
},
initialize: function(options) {
L.setOptions(this, options);
},
onAdd: function(map) {
let self = this;
let container = L.DomUtil.create("div", "bm-map-request");
container.innerHTML = "<p>Would you like to play some other map? <a target='blank' href='https://feedback.userreport.com/2229a84e-c2fa-4427-99ab-27639f103569/'>Issue a map request.</a></p>";
container.innerHTML += "<p>Chose the wrong map? <a href='/'>Choose again!</a></p>"
L.DomEvent.disableClickPropagation(container);
L.DomEvent.disableScrollPropagation(container);
return container;
}
});
L.control.mapRequest = function(opts) {
return new L.Control.MapRequest(opts);
};
|
37a155226210640f16018e1033d4769b2fb36909
|
gitst.c
|
gitst.c
|
int
main(int argc, char **argv)
{
char* gitbuff;
int out = run_proc(&gitbuff, "git", "branch", "--list", 0);
//int out = run_proc(&gitbuff, "ls", "-l", "-h", 0);
if (out != 0)
{
fprintf(stderr, "Error running subprocess:%d\n", out);
exit(1);
}
//printf("run_proc exit code = %d\nresponse= '''%s'''\n", out, gitbuff);
char *br;
br = gitbuff;
putchar('(');
while(*br++ != '*') {}
// skip the '*' and the space after it
br++;
while(*br != '\n')
{
putchar(*br++);
}
putchar(')');
putchar('\n');
}
|
int
main(int argc, char **argv)
{
char* gitbuff;
int out = run_proc(&gitbuff, "git", "branch", "--list", 0);
if (out != 0)
{
exit(1);
}
char *token;
char *sep=" \r\n";
int next = 0;
while((token = strsep(&gitbuff, sep)) != NULL)
{
if (token[0] == '*') {
token = strsep(&gitbuff, sep);
printf("(%s)", token);
break;
}
}
return 0;
}
|
Use strsep to split output
|
Use strsep to split output
|
C
|
bsd-3-clause
|
wnh/prompt_utils
|
c
|
## Code Before:
int
main(int argc, char **argv)
{
char* gitbuff;
int out = run_proc(&gitbuff, "git", "branch", "--list", 0);
//int out = run_proc(&gitbuff, "ls", "-l", "-h", 0);
if (out != 0)
{
fprintf(stderr, "Error running subprocess:%d\n", out);
exit(1);
}
//printf("run_proc exit code = %d\nresponse= '''%s'''\n", out, gitbuff);
char *br;
br = gitbuff;
putchar('(');
while(*br++ != '*') {}
// skip the '*' and the space after it
br++;
while(*br != '\n')
{
putchar(*br++);
}
putchar(')');
putchar('\n');
}
## Instruction:
Use strsep to split output
## Code After:
int
main(int argc, char **argv)
{
char* gitbuff;
int out = run_proc(&gitbuff, "git", "branch", "--list", 0);
if (out != 0)
{
exit(1);
}
char *token;
char *sep=" \r\n";
int next = 0;
while((token = strsep(&gitbuff, sep)) != NULL)
{
if (token[0] == '*') {
token = strsep(&gitbuff, sep);
printf("(%s)", token);
break;
}
}
return 0;
}
|
798bde0536667a6d151835f03b3ef207b250eef6
|
.travis.yml
|
.travis.yml
|
language: csharp
install:
# Restore nuget packages
- nuget restore Pixie.sln
script:
# Build Pixie.
- msbuild /p:Configuration=Release /verbosity:quiet /nologo Pixie.sln
# Run the examples.
- mono ./Examples/CaretDiagnostics/bin/Release/net45/CaretDiagnostics.exe
- mono ./Examples/FormattedList/bin/Release/net45/FormattedList.exe
- mono ./Examples/LoycInterop/bin/Release/net45/LoycInterop.exe
- mono ./Examples/ParseOptions/bin/Release/net45/ParseOptions.exe a.txt -fno-syntax-only --files -O1 -Ofast b.txt --files=c.txt - -- -v
- mono ./Examples/PrintHelp/bin/Release/net45/PrintHelp.exe
- mono ./Examples/SimpleErrorMessage/bin/Release/net45/SimpleErrorMessage.exe
# Run the tests
- mono ./Tests/bin/Release/net45/Tests.exe
|
language: csharp
matrix:
include:
- dotnet: 2.1.502
mono: none
env: DOTNETCORE=2
env: DOTNET=dotnet
env: RESTORE=dotnet restore
env: MSBUILD=dotnet build --framework netcoreapp2.0
env: EXE=dll
env: TARGET=netcoreapp2.0
- mono: latest
env: DOTNET=mono
env: RESTORE=nuget restore
env: MSBUILD=msbuild
env: EXE=exe
env: TARGET=net45
install:
# Restore NuGet packages
- $(RESTORE) Pixie.sln
script:
# Build Pixie.
- $(MSBUILD) /p:Configuration=Release /verbosity:quiet /nologo Pixie.sln
# Run the examples.
- $(DOTNET) ./Examples/CaretDiagnostics/bin/Release/$(TARGET)/CaretDiagnostics.$(EXE)
- $(DOTNET) ./Examples/FormattedList/bin/Release/$(TARGET)/FormattedList.$(EXE)
- $(DOTNET) ./Examples/LoycInterop/bin/Release/$(TARGET)/LoycInterop.$(EXE)
- $(DOTNET) ./Examples/ParseOptions/bin/Release/$(TARGET)/ParseOptions.$(EXE) a.txt -fno-syntax-only --files -O1 -Ofast b.txt --files=c.txt - -- -v
- $(DOTNET) ./Examples/PrintHelp/bin/Release/$(TARGET)/PrintHelp.$(EXE)
- $(DOTNET) ./Examples/SimpleErrorMessage/bin/Release/$(TARGET)/SimpleErrorMessage.$(EXE)
# Run the tests
- $(DOTNET) ./Tests/bin/Release/$(TARGET)/Tests.$(EXE)
|
Add a .NET Core Travis configuration
|
Add a .NET Core Travis configuration
|
YAML
|
mit
|
jonathanvdc/Pixie,jonathanvdc/Pixie
|
yaml
|
## Code Before:
language: csharp
install:
# Restore nuget packages
- nuget restore Pixie.sln
script:
# Build Pixie.
- msbuild /p:Configuration=Release /verbosity:quiet /nologo Pixie.sln
# Run the examples.
- mono ./Examples/CaretDiagnostics/bin/Release/net45/CaretDiagnostics.exe
- mono ./Examples/FormattedList/bin/Release/net45/FormattedList.exe
- mono ./Examples/LoycInterop/bin/Release/net45/LoycInterop.exe
- mono ./Examples/ParseOptions/bin/Release/net45/ParseOptions.exe a.txt -fno-syntax-only --files -O1 -Ofast b.txt --files=c.txt - -- -v
- mono ./Examples/PrintHelp/bin/Release/net45/PrintHelp.exe
- mono ./Examples/SimpleErrorMessage/bin/Release/net45/SimpleErrorMessage.exe
# Run the tests
- mono ./Tests/bin/Release/net45/Tests.exe
## Instruction:
Add a .NET Core Travis configuration
## Code After:
language: csharp
matrix:
include:
- dotnet: 2.1.502
mono: none
env: DOTNETCORE=2
env: DOTNET=dotnet
env: RESTORE=dotnet restore
env: MSBUILD=dotnet build --framework netcoreapp2.0
env: EXE=dll
env: TARGET=netcoreapp2.0
- mono: latest
env: DOTNET=mono
env: RESTORE=nuget restore
env: MSBUILD=msbuild
env: EXE=exe
env: TARGET=net45
install:
# Restore NuGet packages
- $(RESTORE) Pixie.sln
script:
# Build Pixie.
- $(MSBUILD) /p:Configuration=Release /verbosity:quiet /nologo Pixie.sln
# Run the examples.
- $(DOTNET) ./Examples/CaretDiagnostics/bin/Release/$(TARGET)/CaretDiagnostics.$(EXE)
- $(DOTNET) ./Examples/FormattedList/bin/Release/$(TARGET)/FormattedList.$(EXE)
- $(DOTNET) ./Examples/LoycInterop/bin/Release/$(TARGET)/LoycInterop.$(EXE)
- $(DOTNET) ./Examples/ParseOptions/bin/Release/$(TARGET)/ParseOptions.$(EXE) a.txt -fno-syntax-only --files -O1 -Ofast b.txt --files=c.txt - -- -v
- $(DOTNET) ./Examples/PrintHelp/bin/Release/$(TARGET)/PrintHelp.$(EXE)
- $(DOTNET) ./Examples/SimpleErrorMessage/bin/Release/$(TARGET)/SimpleErrorMessage.$(EXE)
# Run the tests
- $(DOTNET) ./Tests/bin/Release/$(TARGET)/Tests.$(EXE)
|
b02a02654b372f066f4acd09e67cfb6e29aa7a48
|
.travis.yml
|
.travis.yml
|
language: julia
os:
- linux
- osx
julia:
- 0.6
- 0.7
- 1.0
env:
- PYTHON=""
|
language: julia
os:
- linux
- osx
julia:
- 0.6
- 0.7
- 1.0
env:
- PYTHON=""
- PYTHON="python3"
|
Test with Conda python and built-in one.
|
Test with Conda python and built-in one.
|
YAML
|
bsd-3-clause
|
rawlik/Coils.jl
|
yaml
|
## Code Before:
language: julia
os:
- linux
- osx
julia:
- 0.6
- 0.7
- 1.0
env:
- PYTHON=""
## Instruction:
Test with Conda python and built-in one.
## Code After:
language: julia
os:
- linux
- osx
julia:
- 0.6
- 0.7
- 1.0
env:
- PYTHON=""
- PYTHON="python3"
|
412727440beb678ba3beef78ee0b934d412afe64
|
examples/permissionsexample/views.py
|
examples/permissionsexample/views.py
|
from djangorestframework.views import View
from djangorestframework.permissions import PerUserThrottling, IsAuthenticated
from django.core.urlresolvers import reverse
class PermissionsExampleView(View):
"""
A container view for permissions examples.
"""
def get(self, request):
return [{'name': 'Throttling Example', 'url': reverse('throttled-resource')},
{'name': 'Logged in example', 'url': reverse('loggedin-resource')},]
class ThrottlingExampleView(View):
"""
A basic read-only View that has a **per-user throttle** of 10 requests per minute.
If a user exceeds the 10 requests limit within a period of one minute, the
throttle will be applied until 60 seconds have passed since the first request.
"""
permissions = ( PerUserThrottling, )
throttle = '10/min'
def get(self, request):
"""
Handle GET requests.
"""
return "Successful response to GET request because throttle is not yet active."
class LoggedInExampleView(View):
"""
You can login with **'test', 'test'.**
"""
permissions = (IsAuthenticated, )
def get(self, request):
return 'Logged in or not?'
|
from djangorestframework.views import View
from djangorestframework.permissions import PerUserThrottling, IsAuthenticated
from django.core.urlresolvers import reverse
class PermissionsExampleView(View):
"""
A container view for permissions examples.
"""
def get(self, request):
return [{'name': 'Throttling Example', 'url': reverse('throttled-resource')},
{'name': 'Logged in example', 'url': reverse('loggedin-resource')},]
class ThrottlingExampleView(View):
"""
A basic read-only View that has a **per-user throttle** of 10 requests per minute.
If a user exceeds the 10 requests limit within a period of one minute, the
throttle will be applied until 60 seconds have passed since the first request.
"""
permissions = ( PerUserThrottling, )
throttle = '10/min'
def get(self, request):
"""
Handle GET requests.
"""
return "Successful response to GET request because throttle is not yet active."
class LoggedInExampleView(View):
"""
You can login with **'test', 'test'.** or use curl:
`curl -X GET -H 'Accept: application/json' -u test:test http://localhost:8000/permissions-example`
"""
permissions = (IsAuthenticated, )
def get(self, request):
return 'Logged in or not?'
|
Add an extra explenation on how to use curl on this view.
|
Add an extra explenation on how to use curl on this view.
|
Python
|
bsd-2-clause
|
cyberj/django-rest-framework,johnraz/django-rest-framework,dmwyatt/django-rest-framework,ajaali/django-rest-framework,d0ugal/django-rest-framework,adambain-vokal/django-rest-framework,linovia/django-rest-framework,ticosax/django-rest-framework,xiaotangyuan/django-rest-framework,alacritythief/django-rest-framework,akalipetis/django-rest-framework,iheitlager/django-rest-framework,raphaelmerx/django-rest-framework,kylefox/django-rest-framework,ticosax/django-rest-framework,tomchristie/django-rest-framework,fishky/django-rest-framework,AlexandreProenca/django-rest-framework,elim/django-rest-framework,jerryhebert/django-rest-framework,kennydude/django-rest-framework,antonyc/django-rest-framework,kennydude/django-rest-framework,nhorelik/django-rest-framework,leeahoward/django-rest-framework,edx/django-rest-framework,kennydude/django-rest-framework,ossanna16/django-rest-framework,rafaelang/django-rest-framework,davesque/django-rest-framework,callorico/django-rest-framework,wangpanjun/django-rest-framework,zeldalink0515/django-rest-framework,paolopaolopaolo/django-rest-framework,kezabelle/django-rest-framework,jness/django-rest-framework,adambain-vokal/django-rest-framework,rafaelcaricio/django-rest-framework,wangpanjun/django-rest-framework,ebsaral/django-rest-framework,MJafarMashhadi/django-rest-framework,tigeraniya/django-rest-framework,vstoykov/django-rest-framework,wangpanjun/django-rest-framework,jpulec/django-rest-framework,leeahoward/django-rest-framework,sbellem/django-rest-framework,abdulhaq-e/django-rest-framework,gregmuellegger/django-rest-framework,rubendura/django-rest-framework,maryokhin/django-rest-framework,qsorix/django-rest-framework,d0ugal/django-rest-framework,ajaali/django-rest-framework,uploadcare/django-rest-framework,wzbozon/django-rest-framework,leeahoward/django-rest-framework,linovia/django-rest-framework,elim/django-rest-framework,jtiai/django-rest-framework,arpheno/django-rest-framework,abdulhaq-e/django-rest-framework,uruz/django-rest-framework,tigeraniya/django-rest-framework,alacritythief/django-rest-framework,jness/django-rest-framework,damycra/django-rest-framework,mgaitan/django-rest-framework,andriy-s/django-rest-framework,delinhabit/django-rest-framework,kgeorgy/django-rest-framework,wwj718/django-rest-framework,sheppard/django-rest-framework,werthen/django-rest-framework,delinhabit/django-rest-framework,VishvajitP/django-rest-framework,VishvajitP/django-rest-framework,tcroiset/django-rest-framework,akalipetis/django-rest-framework,xiaotangyuan/django-rest-framework,thedrow/django-rest-framework-1,canassa/django-rest-framework,mgaitan/django-rest-framework,justanr/django-rest-framework,jerryhebert/django-rest-framework,ashishfinoit/django-rest-framework,hnakamur/django-rest-framework,kylefox/django-rest-framework,rhblind/django-rest-framework,simudream/django-rest-framework,iheitlager/django-rest-framework,krinart/django-rest-framework,sehmaschine/django-rest-framework,simudream/django-rest-framework,dmwyatt/django-rest-framework,callorico/django-rest-framework,ambivalentno/django-rest-framework,justanr/django-rest-framework,wedaly/django-rest-framework,bluedazzle/django-rest-framework,douwevandermeij/django-rest-framework,maryokhin/django-rest-framework,mgaitan/django-rest-framework,brandoncazander/django-rest-framework,ashishfinoit/django-rest-framework,potpath/django-rest-framework,jpulec/django-rest-framework,wwj718/django-rest-framework,kgeorgy/django-rest-framework,rhblind/django-rest-framework,canassa/django-rest-framework,antonyc/django-rest-framework,cheif/django-rest-framework,dmwyatt/django-rest-framework,ezheidtmann/django-rest-framework,James1345/django-rest-framework,rubendura/django-rest-framework,zeldalink0515/django-rest-framework,rafaelcaricio/django-rest-framework,YBJAY00000/django-rest-framework,delinhabit/django-rest-framework,jpadilla/django-rest-framework,douwevandermeij/django-rest-framework,ambivalentno/django-rest-framework,hunter007/django-rest-framework,alacritythief/django-rest-framework,wedaly/django-rest-framework,davesque/django-rest-framework,ashishfinoit/django-rest-framework,yiyocx/django-rest-framework,xiaotangyuan/django-rest-framework,callorico/django-rest-framework,raphaelmerx/django-rest-framework,thedrow/django-rest-framework-1,fishky/django-rest-framework,douwevandermeij/django-rest-framework,jpadilla/django-rest-framework,johnraz/django-rest-framework,hnakamur/django-rest-framework,sbellem/django-rest-framework,damycra/django-rest-framework,yiyocx/django-rest-framework,d0ugal/django-rest-framework,edx/django-rest-framework,lubomir/django-rest-framework,uruz/django-rest-framework,krinart/django-rest-framework,hnarayanan/django-rest-framework,edx/django-rest-framework,fishky/django-rest-framework,tcroiset/django-rest-framework,hnarayanan/django-rest-framework,gregmuellegger/django-rest-framework,zeldalink0515/django-rest-framework,potpath/django-rest-framework,brandoncazander/django-rest-framework,qsorix/django-rest-framework,jpulec/django-rest-framework,cyberj/django-rest-framework,hnakamur/django-rest-framework,sehmaschine/django-rest-framework,aericson/django-rest-framework,HireAnEsquire/django-rest-framework,lubomir/django-rest-framework,rafaelcaricio/django-rest-framework,davesque/django-rest-framework,AlexandreProenca/django-rest-framework,werthen/django-rest-framework,antonyc/django-rest-framework,cheif/django-rest-framework,cyberj/django-rest-framework,wzbozon/django-rest-framework,HireAnEsquire/django-rest-framework,ebsaral/django-rest-framework,waytai/django-rest-framework,ossanna16/django-rest-framework,sheppard/django-rest-framework,paolopaolopaolo/django-rest-framework,ossanna16/django-rest-framework,akalipetis/django-rest-framework,waytai/django-rest-framework,wedaly/django-rest-framework,tomchristie/django-rest-framework,hunter007/django-rest-framework,buptlsl/django-rest-framework,sbellem/django-rest-framework,pombredanne/django-rest-framework,atombrella/django-rest-framework,sheppard/django-rest-framework,rafaelang/django-rest-framework,qsorix/django-rest-framework,ezheidtmann/django-rest-framework,maryokhin/django-rest-framework,paolopaolopaolo/django-rest-framework,raphaelmerx/django-rest-framework,MJafarMashhadi/django-rest-framework,abdulhaq-e/django-rest-framework,pombredanne/django-rest-framework,MJafarMashhadi/django-rest-framework,cheif/django-rest-framework,thedrow/django-rest-framework-1,uploadcare/django-rest-framework,aericson/django-rest-framework,damycra/django-rest-framework,atombrella/django-rest-framework,jpadilla/django-rest-framework,potpath/django-rest-framework,arpheno/django-rest-framework,gregmuellegger/django-rest-framework,YBJAY00000/django-rest-framework,waytai/django-rest-framework,vstoykov/django-rest-framework,kylefox/django-rest-framework,bluedazzle/django-rest-framework,ajaali/django-rest-framework,ticosax/django-rest-framework,rhblind/django-rest-framework,jerryhebert/django-rest-framework,jness/django-rest-framework,canassa/django-rest-framework,ebsaral/django-rest-framework,rafaelang/django-rest-framework,jtiai/django-rest-framework,atombrella/django-rest-framework,nhorelik/django-rest-framework,kezabelle/django-rest-framework,buptlsl/django-rest-framework,brandoncazander/django-rest-framework,andriy-s/django-rest-framework,iheitlager/django-rest-framework,YBJAY00000/django-rest-framework,VishvajitP/django-rest-framework,tigeraniya/django-rest-framework,rubendura/django-rest-framework,arpheno/django-rest-framework,nryoung/django-rest-framework,James1345/django-rest-framework,yiyocx/django-rest-framework,kgeorgy/django-rest-framework,buptlsl/django-rest-framework,tcroiset/django-rest-framework,elim/django-rest-framework,sehmaschine/django-rest-framework,kezabelle/django-rest-framework,lubomir/django-rest-framework,vstoykov/django-rest-framework,agconti/django-rest-framework,uploadcare/django-rest-framework,nryoung/django-rest-framework,johnraz/django-rest-framework,hnarayanan/django-rest-framework,andriy-s/django-rest-framework,simudream/django-rest-framework,agconti/django-rest-framework,James1345/django-rest-framework,agconti/django-rest-framework,hunter007/django-rest-framework,wwj718/django-rest-framework,ezheidtmann/django-rest-framework,tomchristie/django-rest-framework,justanr/django-rest-framework,pombredanne/django-rest-framework,AlexandreProenca/django-rest-framework,werthen/django-rest-framework,nhorelik/django-rest-framework,aericson/django-rest-framework,uruz/django-rest-framework,krinart/django-rest-framework,adambain-vokal/django-rest-framework,ambivalentno/django-rest-framework,jtiai/django-rest-framework,HireAnEsquire/django-rest-framework,nryoung/django-rest-framework,wzbozon/django-rest-framework,bluedazzle/django-rest-framework,linovia/django-rest-framework
|
python
|
## Code Before:
from djangorestframework.views import View
from djangorestframework.permissions import PerUserThrottling, IsAuthenticated
from django.core.urlresolvers import reverse
class PermissionsExampleView(View):
"""
A container view for permissions examples.
"""
def get(self, request):
return [{'name': 'Throttling Example', 'url': reverse('throttled-resource')},
{'name': 'Logged in example', 'url': reverse('loggedin-resource')},]
class ThrottlingExampleView(View):
"""
A basic read-only View that has a **per-user throttle** of 10 requests per minute.
If a user exceeds the 10 requests limit within a period of one minute, the
throttle will be applied until 60 seconds have passed since the first request.
"""
permissions = ( PerUserThrottling, )
throttle = '10/min'
def get(self, request):
"""
Handle GET requests.
"""
return "Successful response to GET request because throttle is not yet active."
class LoggedInExampleView(View):
"""
You can login with **'test', 'test'.**
"""
permissions = (IsAuthenticated, )
def get(self, request):
return 'Logged in or not?'
## Instruction:
Add an extra explenation on how to use curl on this view.
## Code After:
from djangorestframework.views import View
from djangorestframework.permissions import PerUserThrottling, IsAuthenticated
from django.core.urlresolvers import reverse
class PermissionsExampleView(View):
"""
A container view for permissions examples.
"""
def get(self, request):
return [{'name': 'Throttling Example', 'url': reverse('throttled-resource')},
{'name': 'Logged in example', 'url': reverse('loggedin-resource')},]
class ThrottlingExampleView(View):
"""
A basic read-only View that has a **per-user throttle** of 10 requests per minute.
If a user exceeds the 10 requests limit within a period of one minute, the
throttle will be applied until 60 seconds have passed since the first request.
"""
permissions = ( PerUserThrottling, )
throttle = '10/min'
def get(self, request):
"""
Handle GET requests.
"""
return "Successful response to GET request because throttle is not yet active."
class LoggedInExampleView(View):
"""
You can login with **'test', 'test'.** or use curl:
`curl -X GET -H 'Accept: application/json' -u test:test http://localhost:8000/permissions-example`
"""
permissions = (IsAuthenticated, )
def get(self, request):
return 'Logged in or not?'
|
279a7dfcdd854999d490164da3dc3790430e639a
|
membership/management/commands/public_memberlist.py
|
membership/management/commands/public_memberlist.py
|
from django.db.models import Q
from django.core.management.base import NoArgsCommand
from django.template.loader import render_to_string
from django.conf import settings
from membership.models import *
from membership.public_memberlist import public_memberlist_data
class Command(NoArgsCommand):
def handle_noargs(self, **options):
template_name = 'membership/public_memberlist.xml'
data = public_memberlist_data()
return render_to_string(template_name, data).encode('utf-8')
|
from django.db.models import Q
from django.core.management.base import NoArgsCommand
from django.template.loader import render_to_string
from django.conf import settings
from membership.models import *
from membership.public_memberlist import public_memberlist_data
class Command(NoArgsCommand):
def handle_noargs(self, **options):
template_name = 'membership/public_memberlist.xml'
data = public_memberlist_data()
return render_to_string(template_name, data)
|
Fix UnicodeDecodeError: Return text string, not bytes
|
Fix UnicodeDecodeError: Return text string, not bytes
|
Python
|
mit
|
kapsiry/sikteeri,AriMartti/sikteeri,kapsiry/sikteeri,kapsiry/sikteeri,annttu/sikteeri,joneskoo/sikteeri,annttu/sikteeri,AriMartti/sikteeri,kapsiry/sikteeri,joneskoo/sikteeri,AriMartti/sikteeri,annttu/sikteeri,joneskoo/sikteeri,annttu/sikteeri,AriMartti/sikteeri,joneskoo/sikteeri
|
python
|
## Code Before:
from django.db.models import Q
from django.core.management.base import NoArgsCommand
from django.template.loader import render_to_string
from django.conf import settings
from membership.models import *
from membership.public_memberlist import public_memberlist_data
class Command(NoArgsCommand):
def handle_noargs(self, **options):
template_name = 'membership/public_memberlist.xml'
data = public_memberlist_data()
return render_to_string(template_name, data).encode('utf-8')
## Instruction:
Fix UnicodeDecodeError: Return text string, not bytes
## Code After:
from django.db.models import Q
from django.core.management.base import NoArgsCommand
from django.template.loader import render_to_string
from django.conf import settings
from membership.models import *
from membership.public_memberlist import public_memberlist_data
class Command(NoArgsCommand):
def handle_noargs(self, **options):
template_name = 'membership/public_memberlist.xml'
data = public_memberlist_data()
return render_to_string(template_name, data)
|
8de495abec3b871ecd85c6f723ec3448b971f9a3
|
css/outer/docs/categories.less
|
css/outer/docs/categories.less
|
// Categories view
#content > .categories {
.container;
padding-top: 0;
padding-bottom: 60px;
}
.categories {
li {
list-style: none;
}
a {
display: block;
margin-bottom: 15px;
padding: 10px;
background-color: #1E598F;
// #gradient > .vertical(#115EA6, #0F5391);
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.55);
.border-radius(5px);
.clearfix;
}
i {
font-size: 48px;
}
hgroup {
float: right;
width: 90%;
}
h2 {
font-size: 20px;
margin: 0;
padding-top: 5px;
}
h3 {
margin: 0;
font-size: 16px;
font-weight: normal;
padding-top: 5px;
color: #ABEEFF;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35);
}
}
|
// Categories view
#content > .categories {
.container;
padding-top: 0;
padding-bottom: 60px;
}
.categories {
ul { padding-left: 0; }
li { list-style: none; }
a {
display: block;
margin-bottom: 15px;
padding: 10px;
background-color: #1E598F;
// #gradient > .vertical(#115EA6, #0F5391);
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.55);
.border-radius(5px);
.clearfix;
}
i { font-size: 48px; }
hgroup {
float: right;
width: 90%;
}
h2 {
font-size: 20px;
margin: 0;
padding-top: 7px;
}
h3 {
margin: 0;
font-size: 16px;
font-weight: normal;
padding-top: 5px;
color: #ABEEFF;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35);
}
}
|
Remove unneeded left padding from ul Fix spacing
|
Remove unneeded left padding from ul
Fix spacing
|
Less
|
epl-1.0
|
prathamesh-sonpatki/frontend,circleci/frontend,RayRutjes/frontend,circleci/frontend,RayRutjes/frontend,prathamesh-sonpatki/frontend,circleci/frontend
|
less
|
## Code Before:
// Categories view
#content > .categories {
.container;
padding-top: 0;
padding-bottom: 60px;
}
.categories {
li {
list-style: none;
}
a {
display: block;
margin-bottom: 15px;
padding: 10px;
background-color: #1E598F;
// #gradient > .vertical(#115EA6, #0F5391);
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.55);
.border-radius(5px);
.clearfix;
}
i {
font-size: 48px;
}
hgroup {
float: right;
width: 90%;
}
h2 {
font-size: 20px;
margin: 0;
padding-top: 5px;
}
h3 {
margin: 0;
font-size: 16px;
font-weight: normal;
padding-top: 5px;
color: #ABEEFF;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35);
}
}
## Instruction:
Remove unneeded left padding from ul
Fix spacing
## Code After:
// Categories view
#content > .categories {
.container;
padding-top: 0;
padding-bottom: 60px;
}
.categories {
ul { padding-left: 0; }
li { list-style: none; }
a {
display: block;
margin-bottom: 15px;
padding: 10px;
background-color: #1E598F;
// #gradient > .vertical(#115EA6, #0F5391);
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.55);
.border-radius(5px);
.clearfix;
}
i { font-size: 48px; }
hgroup {
float: right;
width: 90%;
}
h2 {
font-size: 20px;
margin: 0;
padding-top: 7px;
}
h3 {
margin: 0;
font-size: 16px;
font-weight: normal;
padding-top: 5px;
color: #ABEEFF;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.35);
}
}
|
24bb1f52ec6e1a3be30987ecafb0d159b501eeb0
|
workflowhelpers/as_user.go
|
workflowhelpers/as_user.go
|
package workflowhelpers
import (
"time"
)
type userContext interface {
SetCfHomeDir() (string, string)
UnsetCfHomeDir(string, string)
Login()
Logout()
TargetSpace()
}
var AsUser = func(uc userContext, timeout time.Duration, actions func()) {
originalCfHomeDir, currentCfHomeDir := uc.SetCfHomeDir()
uc.Login()
defer func() {
uc.Logout()
uc.UnsetCfHomeDir(originalCfHomeDir, currentCfHomeDir)
}()
uc.TargetSpace()
actions()
}
|
package workflowhelpers
import (
"time"
)
type userContext interface {
SetCfHomeDir() (string, string)
UnsetCfHomeDir(string, string)
Login()
Logout()
TargetSpace()
}
func AsUser(uc userContext, timeout time.Duration, actions func()) {
originalCfHomeDir, currentCfHomeDir := uc.SetCfHomeDir()
uc.Login()
defer uc.Logout()
defer uc.UnsetCfHomeDir(originalCfHomeDir, currentCfHomeDir)
uc.TargetSpace()
actions()
}
|
Refactor variable declaration as function
|
Refactor variable declaration as function
Signed-off-by: Alexander Berezovsky <[email protected]>
|
Go
|
apache-2.0
|
cloudfoundry-incubator/cf-test-helpers,cloudfoundry-incubator/cf-test-helpers
|
go
|
## Code Before:
package workflowhelpers
import (
"time"
)
type userContext interface {
SetCfHomeDir() (string, string)
UnsetCfHomeDir(string, string)
Login()
Logout()
TargetSpace()
}
var AsUser = func(uc userContext, timeout time.Duration, actions func()) {
originalCfHomeDir, currentCfHomeDir := uc.SetCfHomeDir()
uc.Login()
defer func() {
uc.Logout()
uc.UnsetCfHomeDir(originalCfHomeDir, currentCfHomeDir)
}()
uc.TargetSpace()
actions()
}
## Instruction:
Refactor variable declaration as function
Signed-off-by: Alexander Berezovsky <[email protected]>
## Code After:
package workflowhelpers
import (
"time"
)
type userContext interface {
SetCfHomeDir() (string, string)
UnsetCfHomeDir(string, string)
Login()
Logout()
TargetSpace()
}
func AsUser(uc userContext, timeout time.Duration, actions func()) {
originalCfHomeDir, currentCfHomeDir := uc.SetCfHomeDir()
uc.Login()
defer uc.Logout()
defer uc.UnsetCfHomeDir(originalCfHomeDir, currentCfHomeDir)
uc.TargetSpace()
actions()
}
|
e27156d5631337e86618b201e4e5f473e2ad1eb5
|
projects.md
|
projects.md
|
---
layout: page
title: Projects
permalink: /projects/
---
- [OSM Parquetizer](https://github.com/adrianulbona/osm-parquetizer)
- [Hidden Markov Models Java Library](https://github.com/adrianulbona/hmm)
- [JTS-Discretizer](https://github.com/adrianulbona/jts-discretizer)
|
---
layout: page
title: Projects
permalink: /projects/
---
- [OSM Parquetizer](https://github.com/adrianulbona/osm-parquetizer)
- [Hidden Markov Models Java Library](https://github.com/adrianulbona/hmm)
- [jts-discretizer](https://github.com/adrianulbona/jts-discretizer)
- [borders](https://github.com/adrianulbona/borders)
|
Add borders to project list
|
Add borders to project list
|
Markdown
|
apache-2.0
|
adrianulbona/adrianulbona.github.io,adrianulbona/adrianulbona.github.io
|
markdown
|
## Code Before:
---
layout: page
title: Projects
permalink: /projects/
---
- [OSM Parquetizer](https://github.com/adrianulbona/osm-parquetizer)
- [Hidden Markov Models Java Library](https://github.com/adrianulbona/hmm)
- [JTS-Discretizer](https://github.com/adrianulbona/jts-discretizer)
## Instruction:
Add borders to project list
## Code After:
---
layout: page
title: Projects
permalink: /projects/
---
- [OSM Parquetizer](https://github.com/adrianulbona/osm-parquetizer)
- [Hidden Markov Models Java Library](https://github.com/adrianulbona/hmm)
- [jts-discretizer](https://github.com/adrianulbona/jts-discretizer)
- [borders](https://github.com/adrianulbona/borders)
|
14537b8260891f03f478fd0c4ff1736d57bffe5e
|
src/com/markupartist/crimesweeper/PlayerLocationOverlay.java
|
src/com/markupartist/crimesweeper/PlayerLocationOverlay.java
|
package com.markupartist.crimesweeper;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.MapView;
import android.content.Context;
import android.location.Location;
import java.util.List;
public class PlayerLocationOverlay extends MyLocationOverlay {
private CrimeLocationHitListener listener;
private List<CrimeSite> _crimeSites = null;
public PlayerLocationOverlay(Context context, MapView mapView) {
super(context, mapView);
_crimeSites = CrimeSite.getCrimeSites(24 * 60);
}
public void setCrimeLocationHitListener(CrimeLocationHitListener listener) {
this.listener = listener;
}
@Override
public void onLocationChanged(Location location) {
super.onLocationChanged(location);
for(CrimeSite crimeSite : _crimeSites) {
if(crimeSite.intersectWithPlayer(location)) {
listener.onCrimeLocationHit(crimeSite);
}
}
}
}
|
package com.markupartist.crimesweeper;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.MapView;
import android.content.Context;
import android.location.Location;
import java.util.List;
public class PlayerLocationOverlay extends MyLocationOverlay {
private CrimeLocationHitListener listener;
private List<CrimeSite> _crimeSites = null;
public PlayerLocationOverlay(Context context, MapView mapView) {
super(context, mapView);
_crimeSites = CrimeSite.getCrimeSites(24 * 60);
}
public void setCrimeLocationHitListener(CrimeLocationHitListener listener) {
this.listener = listener;
}
@Override
public void onLocationChanged(Location location) {
super.onLocationChanged(location);
if(listener == null) {
return;
}
for(CrimeSite crimeSite : _crimeSites) {
if(crimeSite.intersectWithPlayer(location)) {
listener.onCrimeLocationHit(crimeSite);
}
}
}
}
|
Allow the listener to be set to null
|
Allow the listener to be set to null
|
Java
|
apache-2.0
|
joakimk/CrimeSweeper
|
java
|
## Code Before:
package com.markupartist.crimesweeper;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.MapView;
import android.content.Context;
import android.location.Location;
import java.util.List;
public class PlayerLocationOverlay extends MyLocationOverlay {
private CrimeLocationHitListener listener;
private List<CrimeSite> _crimeSites = null;
public PlayerLocationOverlay(Context context, MapView mapView) {
super(context, mapView);
_crimeSites = CrimeSite.getCrimeSites(24 * 60);
}
public void setCrimeLocationHitListener(CrimeLocationHitListener listener) {
this.listener = listener;
}
@Override
public void onLocationChanged(Location location) {
super.onLocationChanged(location);
for(CrimeSite crimeSite : _crimeSites) {
if(crimeSite.intersectWithPlayer(location)) {
listener.onCrimeLocationHit(crimeSite);
}
}
}
}
## Instruction:
Allow the listener to be set to null
## Code After:
package com.markupartist.crimesweeper;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.MapView;
import android.content.Context;
import android.location.Location;
import java.util.List;
public class PlayerLocationOverlay extends MyLocationOverlay {
private CrimeLocationHitListener listener;
private List<CrimeSite> _crimeSites = null;
public PlayerLocationOverlay(Context context, MapView mapView) {
super(context, mapView);
_crimeSites = CrimeSite.getCrimeSites(24 * 60);
}
public void setCrimeLocationHitListener(CrimeLocationHitListener listener) {
this.listener = listener;
}
@Override
public void onLocationChanged(Location location) {
super.onLocationChanged(location);
if(listener == null) {
return;
}
for(CrimeSite crimeSite : _crimeSites) {
if(crimeSite.intersectWithPlayer(location)) {
listener.onCrimeLocationHit(crimeSite);
}
}
}
}
|
ae7aebf561302e8b494388ac106df6913bc307e3
|
package.json
|
package.json
|
{
"author": {
"name": "Michael Benford",
"email": "[email protected]"
},
"name": "ng-tags-input",
"version": "1.0.0",
"description": "Tags input directive for AngularJS",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/mbenford/ngTagsInput.git"
},
"scripts": {
"test": "grunt test"
},
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-compress": "~0.5.3",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-ng-annotate": "~0.0.4",
"grunt-angular-templates": "~0.5.1",
"grunt-karma": "~0.6.2",
"karma-ng-html2js-preprocessor": "~0.1.0",
"load-grunt-tasks": "~0.2.1"
}
}
|
{
"author": {
"name": "Michael Benford",
"email": "[email protected]"
},
"name": "ng-tags-input",
"version": "1.0.0",
"description": "Tags input directive for AngularJS",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/mbenford/ngTagsInput.git"
},
"scripts": {
"test": "grunt test"
},
"dependencies": {},
"devDependencies": {
"grunt": "0.4.2",
"grunt-contrib-uglify": "0.2.7",
"grunt-contrib-cssmin": "0.7.0",
"grunt-contrib-watch": "0.5.3",
"grunt-contrib-jshint": "0.8.0",
"grunt-contrib-compress": "0.5.3",
"grunt-contrib-clean": "0.5.0",
"grunt-contrib-concat": "0.3.0",
"grunt-ng-annotate": "0.0.4",
"grunt-angular-templates": "0.5.1",
"grunt-karma": "0.6.2",
"karma-ng-html2js-preprocessor": "0.1.0",
"load-grunt-tasks": "0.2.1"
}
}
|
Update grunt to version 0.4.2
|
chore(grunt): Update grunt to version 0.4.2
|
JSON
|
mit
|
lejard-h/ngTagsInput,tamtakoe/ngTagsInput,Movideo/ngTagsInput,hyukchan/ngTagsInput,ukitazume/ngTagsInput,Smarp/ngTagsInput,blaskovicz/ngTagsInput,shoutakenaka/ngTagsInput,schinkowitch/ngTagsInput,dlukez/ngTagsInput,carlosmoran092/ngTagsInput,mbenford/ngTagsInput,mbenford/ngTagsInput,igorprado/ngTagsInput,kangkot/ngTagsInput,dlukez/ngTagsInput,StitchedCode/ngTagsInput,kangkot/ngTagsInput,klalex/ngTagsInput,TheControllerShop/ngTagsInput,tamtakoe/ngTagsInput,zzyclark/ngTagsInput,showpad/angular-tags,shoutakenaka/ngTagsInput,Movideo/ngTagsInput,Tim-Erwin/ngTagsInput,Smarp/ngTagsInput,hyukchan/ngTagsInput,TheControllerShop/ngTagsInput,klalex/ngTagsInput,StitchedCode/ngTagsInput,jradness/ngTagsInput,showpad/angular-tags,jesucarr/ngTagsInput,carlosmoran092/ngTagsInput,Aitor1995/ngTagsInput,ukitazume/ngTagsInput,Tim-Erwin/ngTagsInput,blaskovicz/ngTagsInput,jradness/ngTagsInput,Aitor1995/ngTagsInput,schinkowitch/ngTagsInput,lejard-h/ngTagsInput,jesucarr/ngTagsInput,igorprado/ngTagsInput,zzyclark/ngTagsInput
|
json
|
## Code Before:
{
"author": {
"name": "Michael Benford",
"email": "[email protected]"
},
"name": "ng-tags-input",
"version": "1.0.0",
"description": "Tags input directive for AngularJS",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/mbenford/ngTagsInput.git"
},
"scripts": {
"test": "grunt test"
},
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-uglify": "~0.2.7",
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-compress": "~0.5.3",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-concat": "~0.3.0",
"grunt-ng-annotate": "~0.0.4",
"grunt-angular-templates": "~0.5.1",
"grunt-karma": "~0.6.2",
"karma-ng-html2js-preprocessor": "~0.1.0",
"load-grunt-tasks": "~0.2.1"
}
}
## Instruction:
chore(grunt): Update grunt to version 0.4.2
## Code After:
{
"author": {
"name": "Michael Benford",
"email": "[email protected]"
},
"name": "ng-tags-input",
"version": "1.0.0",
"description": "Tags input directive for AngularJS",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/mbenford/ngTagsInput.git"
},
"scripts": {
"test": "grunt test"
},
"dependencies": {},
"devDependencies": {
"grunt": "0.4.2",
"grunt-contrib-uglify": "0.2.7",
"grunt-contrib-cssmin": "0.7.0",
"grunt-contrib-watch": "0.5.3",
"grunt-contrib-jshint": "0.8.0",
"grunt-contrib-compress": "0.5.3",
"grunt-contrib-clean": "0.5.0",
"grunt-contrib-concat": "0.3.0",
"grunt-ng-annotate": "0.0.4",
"grunt-angular-templates": "0.5.1",
"grunt-karma": "0.6.2",
"karma-ng-html2js-preprocessor": "0.1.0",
"load-grunt-tasks": "0.2.1"
}
}
|
0302fa33e5ded22bc3e7f7b31003e6b5a9124ee3
|
templates/service.mustache
|
templates/service.mustache
|
/* tslint:disable */
import { Injectable } from '@angular/core';
import {
HttpClient, HttpRequest, HttpResponse,
HttpHeaders, HttpParams } from '@angular/common/http';
import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { Observable } from 'rxjs/Observable';
import { map } from 'rxjs/operators/map';
import { filter } from 'rxjs/operators/filter';
{{#serviceDependencies}}import { {{modelName}} } from '../models/{{modelFile}}';
{{/serviceDependencies}}
{{{serviceComments}}}@Injectable()
class {{serviceClass}} extends BaseService {
constructor(
config: ApiConfiguration,
http: HttpClient
) {
super(config, http);
}
{{#serviceOperations}}{{>operationResponse}}{{>operationBody}}{{/serviceOperations}}
}
module {{serviceClass}} {
{{#serviceOperations}}{{#operationParamsClass}}
{{{operationParamsClassComments}}}export interface {{operationParamsClass}} {
{{#operationParameters}}
{{{paramComments}}}{{paramVar}}{{^paramRequired}}?{{/paramRequired}}: {{{paramType}}};
{{/operationParameters}}
}
{{/operationParamsClass}}{{/serviceOperations}}
}
export { {{serviceClass}} }
|
/* tslint:disable */
import { Injectable } from '@angular/core';
import {
HttpClient, HttpRequest, HttpResponse,
HttpHeaders, HttpParams } from '@angular/common/http';
import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { Observable } from 'rxjs';
import { map, filter } from 'rxjs/operators';
{{#serviceDependencies}}import { {{modelName}} } from '../models/{{modelFile}}';
{{/serviceDependencies}}
{{{serviceComments}}}@Injectable()
class {{serviceClass}} extends BaseService {
constructor(
config: ApiConfiguration,
http: HttpClient
) {
super(config, http);
}
{{#serviceOperations}}{{>operationResponse}}{{>operationBody}}{{/serviceOperations}}
}
module {{serviceClass}} {
{{#serviceOperations}}{{#operationParamsClass}}
{{{operationParamsClassComments}}}export interface {{operationParamsClass}} {
{{#operationParameters}}
{{{paramComments}}}{{paramVar}}{{^paramRequired}}?{{/paramRequired}}: {{{paramType}}};
{{/operationParameters}}
}
{{/operationParamsClass}}{{/serviceOperations}}
}
export { {{serviceClass}} }
|
Update RxJs operators and inputs to v6
|
Update RxJs operators and inputs to v6
|
HTML+Django
|
mit
|
cyclosproject/ng-swagger-gen,cyclosproject/ng-swagger-gen
|
html+django
|
## Code Before:
/* tslint:disable */
import { Injectable } from '@angular/core';
import {
HttpClient, HttpRequest, HttpResponse,
HttpHeaders, HttpParams } from '@angular/common/http';
import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { Observable } from 'rxjs/Observable';
import { map } from 'rxjs/operators/map';
import { filter } from 'rxjs/operators/filter';
{{#serviceDependencies}}import { {{modelName}} } from '../models/{{modelFile}}';
{{/serviceDependencies}}
{{{serviceComments}}}@Injectable()
class {{serviceClass}} extends BaseService {
constructor(
config: ApiConfiguration,
http: HttpClient
) {
super(config, http);
}
{{#serviceOperations}}{{>operationResponse}}{{>operationBody}}{{/serviceOperations}}
}
module {{serviceClass}} {
{{#serviceOperations}}{{#operationParamsClass}}
{{{operationParamsClassComments}}}export interface {{operationParamsClass}} {
{{#operationParameters}}
{{{paramComments}}}{{paramVar}}{{^paramRequired}}?{{/paramRequired}}: {{{paramType}}};
{{/operationParameters}}
}
{{/operationParamsClass}}{{/serviceOperations}}
}
export { {{serviceClass}} }
## Instruction:
Update RxJs operators and inputs to v6
## Code After:
/* tslint:disable */
import { Injectable } from '@angular/core';
import {
HttpClient, HttpRequest, HttpResponse,
HttpHeaders, HttpParams } from '@angular/common/http';
import { BaseService } from '../base-service';
import { ApiConfiguration } from '../api-configuration';
import { Observable } from 'rxjs';
import { map, filter } from 'rxjs/operators';
{{#serviceDependencies}}import { {{modelName}} } from '../models/{{modelFile}}';
{{/serviceDependencies}}
{{{serviceComments}}}@Injectable()
class {{serviceClass}} extends BaseService {
constructor(
config: ApiConfiguration,
http: HttpClient
) {
super(config, http);
}
{{#serviceOperations}}{{>operationResponse}}{{>operationBody}}{{/serviceOperations}}
}
module {{serviceClass}} {
{{#serviceOperations}}{{#operationParamsClass}}
{{{operationParamsClassComments}}}export interface {{operationParamsClass}} {
{{#operationParameters}}
{{{paramComments}}}{{paramVar}}{{^paramRequired}}?{{/paramRequired}}: {{{paramType}}};
{{/operationParameters}}
}
{{/operationParamsClass}}{{/serviceOperations}}
}
export { {{serviceClass}} }
|
e5c584b5e7a72a191d8456ad7efc80003416b2fb
|
app/assets/javascripts/backbone/views/chatbox.js.coffee
|
app/assets/javascripts/backbone/views/chatbox.js.coffee
|
class Kandan.Views.Chatbox extends Backbone.View
template: JST['chatbox']
tagName: 'div'
className: 'chatbox'
events:
"keypress .chat-input": 'postMessageOnEnter'
"click .post" : 'postMessage'
postMessageOnEnter: (event)->
if event.keyCode == 13
@postMessage(event)
event.preventDefault()
postMessage: (event)->
$chatbox = $(event.target).parent().find(".chat-input")
chatInput = $chatbox.val()
return false if chatInput.trim().length==0
activity = new Kandan.Models.Activity({
'content': chatInput,
'action': 'message',
'channel_id': @channel.get('id')
})
$chatbox.val("")
Kandan.Helpers.Channels.addActivity(
_.extend(activity.toJSON(), {cid: activity.cid, user: Kandan.Data.Users.currentUser()}, created_at: new Date()),
Kandan.Helpers.Activities.ACTIVE_STATE,
true
)
activity.save({},{success: (model, response)->
$("#activity-c#{model.cid}").attr("id", "activity-#{model.get('id')}")
$scrollbox = $(event.target).parent().find(".paginated-activities")
$scrollbox.prop("scrollTop", $scrollbox.prop('scrollHeight'))
})
render: ()->
@channel = @options.channel
$(@el).html(@template())
@
|
class Kandan.Views.Chatbox extends Backbone.View
template: JST['chatbox']
tagName: 'div'
className: 'chatbox'
events:
"keypress .chat-input": 'postMessageOnEnter'
"click .post" : 'postMessage'
postMessageOnEnter: (event)->
if event.keyCode == 13
@postMessage(event)
event.preventDefault()
postMessage: (event)->
$chatbox = $(event.target).parent().find(".chat-input")
chatInput = $chatbox.val()
return false if chatInput.trim().length==0
activity = new Kandan.Models.Activity({
'content': chatInput,
'action': 'message',
'channel_id': @channel.get('id')
})
$chatbox.val("")
activity.save({},{success: (model, response)->
Kandan.Helpers.Channels.addActivity(
_.extend(activity.toJSON(), {cid: activity.cid, user: Kandan.Data.Users.currentUser()}, created_at: new Date()),
Kandan.Helpers.Activities.ACTIVE_STATE,
true
)
$("#activity-c#{model.cid}").attr("id", "activity-#{model.get('id')}")
$scrollbox = $(event.target).parent().find(".paginated-activities")
$scrollbox.prop("scrollTop", $scrollbox.prop('scrollHeight'))
})
render: ()->
@channel = @options.channel
$(@el).html(@template())
@
|
Fix message sender pastie link
|
Fix message sender pastie link
|
CoffeeScript
|
agpl-3.0
|
cloudstead/kandan,kandanapp/kandan,yfix/kandan,sai43/kandan,kandanapp/kandan,codefellows/kandan,sai43/kandan,cloudstead/kandan,kandanapp/kandan,yfix/kandan,Stackato-Apps/kandan,ipmobiletech/kandan,dz0ny/kandan,ych06/kandan,sai43/kandan,dz0ny/kandan,sai43/kandan,moss-zc/kandan,leohmoraes/kandan,miurahr/kandan,ych06/kandan,ivanoats/uw-ruby-chat,ivanoats/kandan,moss-zc/kandan,yfix/kandan,codefellows/kandan,Stackato-Apps/kandan,dz0ny/kandan,ivanoats/uw-ruby-chat,yfix/kandan,Stackato-Apps/kandan,ych06/kandan,cloudstead/kandan,ych06/kandan,moss-zc/kandan,cloudstead/kandan,leohmoraes/kandan,miurahr/kandan,ipmobiletech/kandan,ipmobiletech/kandan,kandanapp/kandan,ivanoats/kandan,Stackato-Apps/kandan,moss-zc/kandan,ipmobiletech/kandan,leohmoraes/kandan,miurahr/kandan,leohmoraes/kandan,ivanoats/kandan,codefellows/kandan,miurahr/kandan
|
coffeescript
|
## Code Before:
class Kandan.Views.Chatbox extends Backbone.View
template: JST['chatbox']
tagName: 'div'
className: 'chatbox'
events:
"keypress .chat-input": 'postMessageOnEnter'
"click .post" : 'postMessage'
postMessageOnEnter: (event)->
if event.keyCode == 13
@postMessage(event)
event.preventDefault()
postMessage: (event)->
$chatbox = $(event.target).parent().find(".chat-input")
chatInput = $chatbox.val()
return false if chatInput.trim().length==0
activity = new Kandan.Models.Activity({
'content': chatInput,
'action': 'message',
'channel_id': @channel.get('id')
})
$chatbox.val("")
Kandan.Helpers.Channels.addActivity(
_.extend(activity.toJSON(), {cid: activity.cid, user: Kandan.Data.Users.currentUser()}, created_at: new Date()),
Kandan.Helpers.Activities.ACTIVE_STATE,
true
)
activity.save({},{success: (model, response)->
$("#activity-c#{model.cid}").attr("id", "activity-#{model.get('id')}")
$scrollbox = $(event.target).parent().find(".paginated-activities")
$scrollbox.prop("scrollTop", $scrollbox.prop('scrollHeight'))
})
render: ()->
@channel = @options.channel
$(@el).html(@template())
@
## Instruction:
Fix message sender pastie link
## Code After:
class Kandan.Views.Chatbox extends Backbone.View
template: JST['chatbox']
tagName: 'div'
className: 'chatbox'
events:
"keypress .chat-input": 'postMessageOnEnter'
"click .post" : 'postMessage'
postMessageOnEnter: (event)->
if event.keyCode == 13
@postMessage(event)
event.preventDefault()
postMessage: (event)->
$chatbox = $(event.target).parent().find(".chat-input")
chatInput = $chatbox.val()
return false if chatInput.trim().length==0
activity = new Kandan.Models.Activity({
'content': chatInput,
'action': 'message',
'channel_id': @channel.get('id')
})
$chatbox.val("")
activity.save({},{success: (model, response)->
Kandan.Helpers.Channels.addActivity(
_.extend(activity.toJSON(), {cid: activity.cid, user: Kandan.Data.Users.currentUser()}, created_at: new Date()),
Kandan.Helpers.Activities.ACTIVE_STATE,
true
)
$("#activity-c#{model.cid}").attr("id", "activity-#{model.get('id')}")
$scrollbox = $(event.target).parent().find(".paginated-activities")
$scrollbox.prop("scrollTop", $scrollbox.prop('scrollHeight'))
})
render: ()->
@channel = @options.channel
$(@el).html(@template())
@
|
f8475c04be6d547e975cc05b6c8517a71606df8b
|
fol.hs
|
fol.hs
|
module Main where
import FOL.Optimize.Optimize
main :: IO ()
main = interact optimize
|
module Main where
import FOL.Optimize.Optimize
main :: IO ()
main = interact optimize >> putChar '\n'
|
Print newline at the end of the output.
|
Print newline at the end of the output.
|
Haskell
|
agpl-3.0
|
axch/dysvunctional-language,axch/dysvunctional-language,axch/dysvunctional-language,axch/dysvunctional-language
|
haskell
|
## Code Before:
module Main where
import FOL.Optimize.Optimize
main :: IO ()
main = interact optimize
## Instruction:
Print newline at the end of the output.
## Code After:
module Main where
import FOL.Optimize.Optimize
main :: IO ()
main = interact optimize >> putChar '\n'
|
dc4ef23627636b42ff1235e4fce05cca2a4231dd
|
appveyor.yml
|
appveyor.yml
|
init:
- git config --global core.autocrlf true
test: off # this turns of AppVeyor automatic searching for test-assemblies, not the actual testing
build_script:
- ps: .\build.ps1 -target=All -archive
artifacts:
- path: artifacts/package/*.zip
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: YW4vAIFrVIdyKBNxyVGWGKHP2UejoZcTcD0cf7KYEgZefUWY2XFHjetDW4Q0cICx
artifact: /.*\.zip/
on:
appveyor_repo_tag: true
notifications:
- provider: Slack
auth_token:
secure: OU7mWtP+JWLRV2Ofq3/QMQbudeN632xLgWb4zMJtOssi2v5HER4qe0GFoj/rnIYOBXd3d/5+glfKG3ijvCU3bA==
channel: '#general'
|
init:
- git config --global core.autocrlf true
test: off # this turns of AppVeyor automatic searching for test-assemblies, not the actual testing
build_script:
- ps: .\build.ps1 -target=All -archive
artifacts:
- path: artifacts/package/*.zip
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: YW4vAIFrVIdyKBNxyVGWGKHP2UejoZcTcD0cf7KYEgZefUWY2XFHjetDW4Q0cICx
artifact: /.*\.zip/
on:
appveyor_repo_tag: true
notifications:
- provider: Slack
auth_token:
secure: OU7mWtP+JWLRV2Ofq3/QMQbudeN632xLgWb4zMJtOssi2v5HER4qe0GFoj/rnIYOBXd3d/5+glfKG3ijvCU3bA==
channel: '#integrations'
|
Move slack integration to `integrations`
|
Move slack integration to `integrations`
|
YAML
|
mit
|
DustinCampbell/omnisharp-roslyn,DustinCampbell/omnisharp-roslyn,OmniSharp/omnisharp-roslyn,OmniSharp/omnisharp-roslyn
|
yaml
|
## Code Before:
init:
- git config --global core.autocrlf true
test: off # this turns of AppVeyor automatic searching for test-assemblies, not the actual testing
build_script:
- ps: .\build.ps1 -target=All -archive
artifacts:
- path: artifacts/package/*.zip
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: YW4vAIFrVIdyKBNxyVGWGKHP2UejoZcTcD0cf7KYEgZefUWY2XFHjetDW4Q0cICx
artifact: /.*\.zip/
on:
appveyor_repo_tag: true
notifications:
- provider: Slack
auth_token:
secure: OU7mWtP+JWLRV2Ofq3/QMQbudeN632xLgWb4zMJtOssi2v5HER4qe0GFoj/rnIYOBXd3d/5+glfKG3ijvCU3bA==
channel: '#general'
## Instruction:
Move slack integration to `integrations`
## Code After:
init:
- git config --global core.autocrlf true
test: off # this turns of AppVeyor automatic searching for test-assemblies, not the actual testing
build_script:
- ps: .\build.ps1 -target=All -archive
artifacts:
- path: artifacts/package/*.zip
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: YW4vAIFrVIdyKBNxyVGWGKHP2UejoZcTcD0cf7KYEgZefUWY2XFHjetDW4Q0cICx
artifact: /.*\.zip/
on:
appveyor_repo_tag: true
notifications:
- provider: Slack
auth_token:
secure: OU7mWtP+JWLRV2Ofq3/QMQbudeN632xLgWb4zMJtOssi2v5HER4qe0GFoj/rnIYOBXd3d/5+glfKG3ijvCU3bA==
channel: '#integrations'
|
c6ae4a50b9b3a0a8d9f39a3c23d8ae97fcd6be0b
|
src/settings.rs
|
src/settings.rs
|
use encoding::EncodingRef;
use encoding::all::UTF_8;
use loirc::{MonitorSettings, ReconnectionSettings};
/// Settings for the dispatcher.
pub struct Settings<'a> {
/// Address of the irc server.
pub addr: &'a str,
/// Preferred nickname.
pub nickname: &'a str,
/// Username.
pub username: &'a str,
/// Real name.
pub realname: &'a str,
/// Reconnection settings. If None, reconnection is disabled.
pub reconnection: ReconnectionSettings,
/// Monitor settings. If None, monitoring is disabled.
pub monitor: Option<MonitorSettings>,
/// Automatically identify after reconnection.
pub auto_ident: bool,
/// Automatically reply to ping requests.
pub auto_ping: bool,
/// Encoding used for the connection.
pub encoding: EncodingRef,
}
impl<'a> Settings<'a> {
/// Create new settings with sensible defaults.
pub fn new<'b>(addr: &'b str, nickname: &'b str) -> Settings<'b> {
Settings {
addr: addr,
nickname: nickname,
username: "hiirc",
realname: "hiirc",
reconnection: ReconnectionSettings::DoNotReconnect,
monitor: None,
auto_ident: true,
auto_ping: true,
encoding: UTF_8,
}
}
}
|
use encoding::EncodingRef;
use encoding::all::UTF_8;
use loirc::{MonitorSettings, ReconnectionSettings};
/// Settings for the dispatcher.
pub struct Settings<'a> {
/// Address of the irc server.
pub addr: &'a str,
/// Preferred nickname.
pub nickname: &'a str,
/// Username.
pub username: &'a str,
/// Real name.
pub realname: &'a str,
/// Reconnection settings. If None, reconnection is disabled.
pub reconnection: ReconnectionSettings,
/// Monitor settings. If None, monitoring is disabled.
pub monitor: Option<MonitorSettings>,
/// Automatically identify after reconnection.
pub auto_ident: bool,
/// Automatically reply to ping requests.
pub auto_ping: bool,
/// Encoding used for the connection.
pub encoding: EncodingRef,
}
impl<'a> Settings<'a> {
/// Create new settings with sensible default values.
///
/// The default values are:
///
/// ```
/// username: "hiirc",
/// realname: "hiirc",
/// reconnection: ReonnectionSettings::DoNotReconnect,
/// monitor: None,
/// auto_ident: true,
/// auto_ping: true,
/// encoding: UTF_8,
/// ```
pub fn new<'b>(addr: &'b str, nickname: &'b str) -> Settings<'b> {
Settings {
addr: addr,
nickname: nickname,
username: "hiirc",
realname: "hiirc",
reconnection: ReconnectionSettings::DoNotReconnect,
monitor: None,
auto_ident: true,
auto_ping: true,
encoding: UTF_8,
}
}
}
|
Document the default values of Settings::new
|
Document the default values of Settings::new
|
Rust
|
mit
|
SBSTP/hiirc,SBSTP/hiirc
|
rust
|
## Code Before:
use encoding::EncodingRef;
use encoding::all::UTF_8;
use loirc::{MonitorSettings, ReconnectionSettings};
/// Settings for the dispatcher.
pub struct Settings<'a> {
/// Address of the irc server.
pub addr: &'a str,
/// Preferred nickname.
pub nickname: &'a str,
/// Username.
pub username: &'a str,
/// Real name.
pub realname: &'a str,
/// Reconnection settings. If None, reconnection is disabled.
pub reconnection: ReconnectionSettings,
/// Monitor settings. If None, monitoring is disabled.
pub monitor: Option<MonitorSettings>,
/// Automatically identify after reconnection.
pub auto_ident: bool,
/// Automatically reply to ping requests.
pub auto_ping: bool,
/// Encoding used for the connection.
pub encoding: EncodingRef,
}
impl<'a> Settings<'a> {
/// Create new settings with sensible defaults.
pub fn new<'b>(addr: &'b str, nickname: &'b str) -> Settings<'b> {
Settings {
addr: addr,
nickname: nickname,
username: "hiirc",
realname: "hiirc",
reconnection: ReconnectionSettings::DoNotReconnect,
monitor: None,
auto_ident: true,
auto_ping: true,
encoding: UTF_8,
}
}
}
## Instruction:
Document the default values of Settings::new
## Code After:
use encoding::EncodingRef;
use encoding::all::UTF_8;
use loirc::{MonitorSettings, ReconnectionSettings};
/// Settings for the dispatcher.
pub struct Settings<'a> {
/// Address of the irc server.
pub addr: &'a str,
/// Preferred nickname.
pub nickname: &'a str,
/// Username.
pub username: &'a str,
/// Real name.
pub realname: &'a str,
/// Reconnection settings. If None, reconnection is disabled.
pub reconnection: ReconnectionSettings,
/// Monitor settings. If None, monitoring is disabled.
pub monitor: Option<MonitorSettings>,
/// Automatically identify after reconnection.
pub auto_ident: bool,
/// Automatically reply to ping requests.
pub auto_ping: bool,
/// Encoding used for the connection.
pub encoding: EncodingRef,
}
impl<'a> Settings<'a> {
/// Create new settings with sensible default values.
///
/// The default values are:
///
/// ```
/// username: "hiirc",
/// realname: "hiirc",
/// reconnection: ReonnectionSettings::DoNotReconnect,
/// monitor: None,
/// auto_ident: true,
/// auto_ping: true,
/// encoding: UTF_8,
/// ```
pub fn new<'b>(addr: &'b str, nickname: &'b str) -> Settings<'b> {
Settings {
addr: addr,
nickname: nickname,
username: "hiirc",
realname: "hiirc",
reconnection: ReconnectionSettings::DoNotReconnect,
monitor: None,
auto_ident: true,
auto_ping: true,
encoding: UTF_8,
}
}
}
|
cebd4d613cc95ef6e775581a6f77f4850e39020a
|
src/mdformat/_conf.py
|
src/mdformat/_conf.py
|
from __future__ import annotations
import functools
from pathlib import Path
from typing import Mapping
import tomli
DEFAULT_OPTS = {
"wrap": "keep",
"number": False,
"end_of_line": "lf",
}
class InvalidConfError(Exception):
"""Error raised given invalid TOML or a key that is not valid for
mdformat."""
@functools.lru_cache()
def read_toml_opts(conf_dir: Path) -> Mapping:
conf_path = conf_dir / ".mdformat.toml"
if not conf_path.is_file():
parent_dir = conf_dir.parent
if conf_dir == parent_dir:
return {}
return read_toml_opts(parent_dir)
with open(conf_path, "rb") as f:
try:
toml_opts = tomli.load(f)
except tomli.TOMLDecodeError as e:
raise InvalidConfError(f"Invalid TOML syntax: {e}")
for key in toml_opts:
if key not in DEFAULT_OPTS:
raise InvalidConfError(f"Invalid key {key!r} in {conf_path}")
return toml_opts
|
from __future__ import annotations
import functools
from pathlib import Path
from typing import Mapping
import tomli
DEFAULT_OPTS = {
"wrap": "keep",
"number": False,
"end_of_line": "lf",
}
class InvalidConfError(Exception):
"""Error raised given invalid TOML or a key that is not valid for
mdformat."""
@functools.lru_cache()
def read_toml_opts(conf_dir: Path) -> Mapping:
conf_path = conf_dir / ".mdformat.toml"
if not conf_path.is_file():
parent_dir = conf_dir.parent
if conf_dir == parent_dir:
return {}
return read_toml_opts(parent_dir)
with open(conf_path, "rb") as f:
try:
toml_opts = tomli.load(f)
except tomli.TOMLDecodeError as e:
raise InvalidConfError(f"Invalid TOML syntax: {e}")
for key in toml_opts:
if key not in DEFAULT_OPTS:
raise InvalidConfError(
f"Invalid key {key!r} in {conf_path}."
f" Keys must be one of {set(DEFAULT_OPTS)}."
)
return toml_opts
|
Improve error message on invalid conf key
|
Improve error message on invalid conf key
|
Python
|
mit
|
executablebooks/mdformat
|
python
|
## Code Before:
from __future__ import annotations
import functools
from pathlib import Path
from typing import Mapping
import tomli
DEFAULT_OPTS = {
"wrap": "keep",
"number": False,
"end_of_line": "lf",
}
class InvalidConfError(Exception):
"""Error raised given invalid TOML or a key that is not valid for
mdformat."""
@functools.lru_cache()
def read_toml_opts(conf_dir: Path) -> Mapping:
conf_path = conf_dir / ".mdformat.toml"
if not conf_path.is_file():
parent_dir = conf_dir.parent
if conf_dir == parent_dir:
return {}
return read_toml_opts(parent_dir)
with open(conf_path, "rb") as f:
try:
toml_opts = tomli.load(f)
except tomli.TOMLDecodeError as e:
raise InvalidConfError(f"Invalid TOML syntax: {e}")
for key in toml_opts:
if key not in DEFAULT_OPTS:
raise InvalidConfError(f"Invalid key {key!r} in {conf_path}")
return toml_opts
## Instruction:
Improve error message on invalid conf key
## Code After:
from __future__ import annotations
import functools
from pathlib import Path
from typing import Mapping
import tomli
DEFAULT_OPTS = {
"wrap": "keep",
"number": False,
"end_of_line": "lf",
}
class InvalidConfError(Exception):
"""Error raised given invalid TOML or a key that is not valid for
mdformat."""
@functools.lru_cache()
def read_toml_opts(conf_dir: Path) -> Mapping:
conf_path = conf_dir / ".mdformat.toml"
if not conf_path.is_file():
parent_dir = conf_dir.parent
if conf_dir == parent_dir:
return {}
return read_toml_opts(parent_dir)
with open(conf_path, "rb") as f:
try:
toml_opts = tomli.load(f)
except tomli.TOMLDecodeError as e:
raise InvalidConfError(f"Invalid TOML syntax: {e}")
for key in toml_opts:
if key not in DEFAULT_OPTS:
raise InvalidConfError(
f"Invalid key {key!r} in {conf_path}."
f" Keys must be one of {set(DEFAULT_OPTS)}."
)
return toml_opts
|
4833af57024e9a6e07b28c0612cf8a1c02fc8098
|
src/Draw/TabbedWindow.hs
|
src/Draw/TabbedWindow.hs
|
module Draw.TabbedWindow
( drawTabbedWindow
)
where
import Prelude ()
import Prelude.MH
import Brick
import Brick.Widgets.Border
import Brick.Widgets.Center
import Types
import Themes
tabbedWindowWidth :: Int
tabbedWindowWidth = 78
tabbedWindowHeight :: Int
tabbedWindowHeight = 25
drawTabbedWindow :: (Eq a, Show a)
=> TabbedWindow a
-> ChatState
-> Widget Name
drawTabbedWindow w cs =
let cur = getCurrentTabbedWindowEntry w
body = tabBody <=> fill ' '
tabBody = tweRender cur (twValue w) cs
title = twtTitle (twTemplate w) (tweValue cur)
in centerLayer $
vLimit tabbedWindowHeight $
hLimit tabbedWindowWidth $
joinBorders $
borderWithLabel title $
(tabBar w <=> hBorder <=> body)
tabBar :: (Eq a, Show a)
=> TabbedWindow a
-> Widget Name
tabBar w =
let cur = getCurrentTabbedWindowEntry w
entries = twtEntries (twTemplate w)
renderEntry e =
let useAttr = if isCurrent
then withDefAttr tabSelectedAttr
else withDefAttr tabUnselectedAttr
isCurrent = tweValue e == tweValue cur
in useAttr $
padLeftRight 2 $
tweTitle e (tweValue e) isCurrent
renderings = renderEntry <$> entries
in hBox renderings
|
module Draw.TabbedWindow
( drawTabbedWindow
)
where
import Prelude ()
import Prelude.MH
import Brick
import Brick.Widgets.Border
import Brick.Widgets.Center
import Types
import Themes
tabbedWindowWidth :: Int
tabbedWindowWidth = 78
tabbedWindowHeight :: Int
tabbedWindowHeight = 25
drawTabbedWindow :: (Eq a, Show a)
=> TabbedWindow a
-> ChatState
-> Widget Name
drawTabbedWindow w cs =
let cur = getCurrentTabbedWindowEntry w
body = tabBody <=> fill ' '
tabBody = tweRender cur (twValue w) cs
title = forceAttr clientEmphAttr $ twtTitle (twTemplate w) (tweValue cur)
in centerLayer $
vLimit tabbedWindowHeight $
hLimit tabbedWindowWidth $
joinBorders $
borderWithLabel title $
(tabBar w <=> hBorder <=> body)
tabBar :: (Eq a, Show a)
=> TabbedWindow a
-> Widget Name
tabBar w =
let cur = getCurrentTabbedWindowEntry w
entries = twtEntries (twTemplate w)
renderEntry e =
let useAttr = if isCurrent
then withDefAttr tabSelectedAttr
else withDefAttr tabUnselectedAttr
isCurrent = tweValue e == tweValue cur
in useAttr $
padLeftRight 2 $
tweTitle e (tweValue e) isCurrent
renderings = renderEntry <$> entries
in hBox renderings
|
Use emphasis attribute in tabbed window title
|
Use emphasis attribute in tabbed window title
|
Haskell
|
bsd-3-clause
|
matterhorn-chat/matterhorn
|
haskell
|
## Code Before:
module Draw.TabbedWindow
( drawTabbedWindow
)
where
import Prelude ()
import Prelude.MH
import Brick
import Brick.Widgets.Border
import Brick.Widgets.Center
import Types
import Themes
tabbedWindowWidth :: Int
tabbedWindowWidth = 78
tabbedWindowHeight :: Int
tabbedWindowHeight = 25
drawTabbedWindow :: (Eq a, Show a)
=> TabbedWindow a
-> ChatState
-> Widget Name
drawTabbedWindow w cs =
let cur = getCurrentTabbedWindowEntry w
body = tabBody <=> fill ' '
tabBody = tweRender cur (twValue w) cs
title = twtTitle (twTemplate w) (tweValue cur)
in centerLayer $
vLimit tabbedWindowHeight $
hLimit tabbedWindowWidth $
joinBorders $
borderWithLabel title $
(tabBar w <=> hBorder <=> body)
tabBar :: (Eq a, Show a)
=> TabbedWindow a
-> Widget Name
tabBar w =
let cur = getCurrentTabbedWindowEntry w
entries = twtEntries (twTemplate w)
renderEntry e =
let useAttr = if isCurrent
then withDefAttr tabSelectedAttr
else withDefAttr tabUnselectedAttr
isCurrent = tweValue e == tweValue cur
in useAttr $
padLeftRight 2 $
tweTitle e (tweValue e) isCurrent
renderings = renderEntry <$> entries
in hBox renderings
## Instruction:
Use emphasis attribute in tabbed window title
## Code After:
module Draw.TabbedWindow
( drawTabbedWindow
)
where
import Prelude ()
import Prelude.MH
import Brick
import Brick.Widgets.Border
import Brick.Widgets.Center
import Types
import Themes
tabbedWindowWidth :: Int
tabbedWindowWidth = 78
tabbedWindowHeight :: Int
tabbedWindowHeight = 25
drawTabbedWindow :: (Eq a, Show a)
=> TabbedWindow a
-> ChatState
-> Widget Name
drawTabbedWindow w cs =
let cur = getCurrentTabbedWindowEntry w
body = tabBody <=> fill ' '
tabBody = tweRender cur (twValue w) cs
title = forceAttr clientEmphAttr $ twtTitle (twTemplate w) (tweValue cur)
in centerLayer $
vLimit tabbedWindowHeight $
hLimit tabbedWindowWidth $
joinBorders $
borderWithLabel title $
(tabBar w <=> hBorder <=> body)
tabBar :: (Eq a, Show a)
=> TabbedWindow a
-> Widget Name
tabBar w =
let cur = getCurrentTabbedWindowEntry w
entries = twtEntries (twTemplate w)
renderEntry e =
let useAttr = if isCurrent
then withDefAttr tabSelectedAttr
else withDefAttr tabUnselectedAttr
isCurrent = tweValue e == tweValue cur
in useAttr $
padLeftRight 2 $
tweTitle e (tweValue e) isCurrent
renderings = renderEntry <$> entries
in hBox renderings
|
e3619a7a6976908c95473b97f191eba1d9184054
|
travis.sh
|
travis.sh
|
set -e # exit on errors
set -x # echo each line
export PATH=/home/travis/.cabal/bin:$PATH
git clone https://github.com/ndmitchell/neil
(cd neil && cabal install)
echo $PATH
ls /home/travis/.cabal/bin
neil test
|
set -e # exit on errors
set -x # echo each line
export PATH=/home/travis/.cabal/bin:$PATH
git clone https://github.com/ndmitchell/neil
(cd neil && cabal install)
neil test
|
Remove the debugging stuff, it does now work, just cache issues
|
Remove the debugging stuff, it does now work, just cache issues
|
Shell
|
bsd-3-clause
|
saep/neil,Daniel-Diaz/neil
|
shell
|
## Code Before:
set -e # exit on errors
set -x # echo each line
export PATH=/home/travis/.cabal/bin:$PATH
git clone https://github.com/ndmitchell/neil
(cd neil && cabal install)
echo $PATH
ls /home/travis/.cabal/bin
neil test
## Instruction:
Remove the debugging stuff, it does now work, just cache issues
## Code After:
set -e # exit on errors
set -x # echo each line
export PATH=/home/travis/.cabal/bin:$PATH
git clone https://github.com/ndmitchell/neil
(cd neil && cabal install)
neil test
|
e0acd4d03fce9b4235c5a693923536e8485d221b
|
package.json
|
package.json
|
{
"name": "RBFS",
"version": "0.1.0",
"private": true,
"description": "A RESTful FileSystem API for NodeJS ",
"dependencies": {
"basic-auth": "^1.1.0",
"config": "^1.24.0",
"express": "^4.14.0",
"express-ipfilter": "^0.2.1",
"filesize": "^3.3.0",
"find-remove": "^1.0.0",
"formidable": "^1.0.17",
"fs-extra": "^1.0.0",
"js-yaml": "^3.7.0",
"md5-file": "^3.1.1",
"mime": "^1.3.4"
},
"devDependencies": {
"chai": "^3.5.0",
"chai-http": "^2.0.1",
"mocha": "^2.4.5",
"really-need": "^1.9.2"
},
"scripts": {
"start": "node server.js",
"test": "export NODE_ENV=test && mocha"
},
"author": "Bradley A. Thornton",
"license": "MIT",
"readmeFilename": "README.md"
}
|
{
"name": "RBFS",
"version": "0.1.0",
"private": true,
"description": "A RESTful FileSystem API for NodeJS ",
"dependencies": {
"basic-auth": "^1.1.0",
"config": "^1.24.0",
"express": "^4.14.0",
"express-ipfilter": "^0.2.1",
"filesize": "^3.3.0",
"find-remove": "^1.0.0",
"formidable": "^1.0.17",
"fs-extra": "^1.0.0",
"js-yaml": "^3.7.0",
"md5-file": "^3.1.1",
"mime": "^1.3.4"
},
"devDependencies": {
"chai": "^3.5.0",
"chai-http": "^2.0.1",
"mocha": "^2.4.5",
"really-need": "^1.9.2"
},
"scripts": {
"start": "node server.js",
"test": "export NODE_ENV=test && mkdir tempdir && mkdir rootdir && mocha"
},
"author": "Bradley A. Thornton",
"license": "MIT",
"readmeFilename": "README.md"
}
|
Add mkdir to npm test
|
Add mkdir to npm test
|
JSON
|
mit
|
cidrblock/RBFS
|
json
|
## Code Before:
{
"name": "RBFS",
"version": "0.1.0",
"private": true,
"description": "A RESTful FileSystem API for NodeJS ",
"dependencies": {
"basic-auth": "^1.1.0",
"config": "^1.24.0",
"express": "^4.14.0",
"express-ipfilter": "^0.2.1",
"filesize": "^3.3.0",
"find-remove": "^1.0.0",
"formidable": "^1.0.17",
"fs-extra": "^1.0.0",
"js-yaml": "^3.7.0",
"md5-file": "^3.1.1",
"mime": "^1.3.4"
},
"devDependencies": {
"chai": "^3.5.0",
"chai-http": "^2.0.1",
"mocha": "^2.4.5",
"really-need": "^1.9.2"
},
"scripts": {
"start": "node server.js",
"test": "export NODE_ENV=test && mocha"
},
"author": "Bradley A. Thornton",
"license": "MIT",
"readmeFilename": "README.md"
}
## Instruction:
Add mkdir to npm test
## Code After:
{
"name": "RBFS",
"version": "0.1.0",
"private": true,
"description": "A RESTful FileSystem API for NodeJS ",
"dependencies": {
"basic-auth": "^1.1.0",
"config": "^1.24.0",
"express": "^4.14.0",
"express-ipfilter": "^0.2.1",
"filesize": "^3.3.0",
"find-remove": "^1.0.0",
"formidable": "^1.0.17",
"fs-extra": "^1.0.0",
"js-yaml": "^3.7.0",
"md5-file": "^3.1.1",
"mime": "^1.3.4"
},
"devDependencies": {
"chai": "^3.5.0",
"chai-http": "^2.0.1",
"mocha": "^2.4.5",
"really-need": "^1.9.2"
},
"scripts": {
"start": "node server.js",
"test": "export NODE_ENV=test && mkdir tempdir && mkdir rootdir && mocha"
},
"author": "Bradley A. Thornton",
"license": "MIT",
"readmeFilename": "README.md"
}
|
f0bc01603b491f14e593cc24329c18efc2beaf40
|
lib/amazon/metadata-config.js
|
lib/amazon/metadata-config.js
|
// --------------------------------------------------------------------------------------------------------------------
//
// metadata-config.js - config for AWS Instance Metadata
//
// Copyright (c) 2011, 2012 AppsAttic Ltd - http://www.appsattic.com/
// Written by Andrew Chilton <[email protected]>
//
// License: http://opensource.org/licenses/MIT
//
// --------------------------------------------------------------------------------------------------------------------
function pathCategory(options, args) {
return '/' + args.Version + args.Category;
}
function pathLatest(options, args) {
return '/latest/' + args.Category;
}
// --------------------------------------------------------------------------------------------------------------------
// From: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html
module.exports = {
'ListApiVersions' : {
// request
'path' : '/',
// response
'body' : 'blob',
},
'Get' : {
// request
'path' : pathCategory,
'args' : {
Category : {
'required' : true,
'type' : 'special',
},
Version : {
'required' : true,
'type' : 'special',
},
},
// response
'body' : 'blob',
},
};
// --------------------------------------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------------------------------------
//
// metadata-config.js - config for AWS Instance Metadata
//
// Copyright (c) 2011, 2012 AppsAttic Ltd - http://www.appsattic.com/
// Written by Andrew Chilton <[email protected]>
//
// License: http://opensource.org/licenses/MIT
//
// --------------------------------------------------------------------------------------------------------------------
function path(options, args) {
return '/' + args.Version + args.Category;
}
// --------------------------------------------------------------------------------------------------------------------
// From: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html
module.exports = {
'ListApiVersions' : {
// request
'path' : '/',
// response
'extractBody' : 'blob',
},
'Get' : {
// request
'path' : path,
'args' : {
Category : {
'required' : true,
'type' : 'special',
},
Version : {
'required' : true,
'type' : 'special',
},
},
// response
'extractBody' : 'blob',
},
};
// --------------------------------------------------------------------------------------------------------------------
|
Make sure the extractBody is set (not just body)
|
Make sure the extractBody is set (not just body)
|
JavaScript
|
mit
|
chilts/awssum
|
javascript
|
## Code Before:
// --------------------------------------------------------------------------------------------------------------------
//
// metadata-config.js - config for AWS Instance Metadata
//
// Copyright (c) 2011, 2012 AppsAttic Ltd - http://www.appsattic.com/
// Written by Andrew Chilton <[email protected]>
//
// License: http://opensource.org/licenses/MIT
//
// --------------------------------------------------------------------------------------------------------------------
function pathCategory(options, args) {
return '/' + args.Version + args.Category;
}
function pathLatest(options, args) {
return '/latest/' + args.Category;
}
// --------------------------------------------------------------------------------------------------------------------
// From: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html
module.exports = {
'ListApiVersions' : {
// request
'path' : '/',
// response
'body' : 'blob',
},
'Get' : {
// request
'path' : pathCategory,
'args' : {
Category : {
'required' : true,
'type' : 'special',
},
Version : {
'required' : true,
'type' : 'special',
},
},
// response
'body' : 'blob',
},
};
// --------------------------------------------------------------------------------------------------------------------
## Instruction:
Make sure the extractBody is set (not just body)
## Code After:
// --------------------------------------------------------------------------------------------------------------------
//
// metadata-config.js - config for AWS Instance Metadata
//
// Copyright (c) 2011, 2012 AppsAttic Ltd - http://www.appsattic.com/
// Written by Andrew Chilton <[email protected]>
//
// License: http://opensource.org/licenses/MIT
//
// --------------------------------------------------------------------------------------------------------------------
function path(options, args) {
return '/' + args.Version + args.Category;
}
// --------------------------------------------------------------------------------------------------------------------
// From: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/AESDG-chapter-instancedata.html
module.exports = {
'ListApiVersions' : {
// request
'path' : '/',
// response
'extractBody' : 'blob',
},
'Get' : {
// request
'path' : path,
'args' : {
Category : {
'required' : true,
'type' : 'special',
},
Version : {
'required' : true,
'type' : 'special',
},
},
// response
'extractBody' : 'blob',
},
};
// --------------------------------------------------------------------------------------------------------------------
|
abb7024f69410852fae10885434f068b89ce50d0
|
lib/crispy/crispy_internal/class_spy.rb
|
lib/crispy/crispy_internal/class_spy.rb
|
module Crispy
module CrispyInternal
class ClassSpy < ::Module
include SpyMixin
include WithStubber
@registry = {}
def initialize klass, stubs_map = {}
super()
@received_messages = []
initialize_stubber stubs_map
prepend_stubber klass
sneak_into Target.new(klass)
end
def define_wrapper method_name
#return method_name if method_name == :initialize
return method_name if method_name == :method_missing
p method_name
define_method method_name do|*arguments, &attached_block|
#::Kernel.print "e" # <= with this statement, prepend-ing :method_missing doesn't cause the segfault.
::Crispy::CrispyInternal::ClassSpy.of_class(::Kernel.p self.class).received_messages <<
::Crispy::CrispyReceivedMessageWithReceiver.new(self, method_name, *arguments, &attached_block)
super(*arguments, &attached_block)
end
method_name
end
private :define_wrapper
class Target
def initialize klass
@target_class = klass
end
def as_class
@target_class
end
# define accessor after prepending to avoid to spy unexpectedly.
def pass_spy_through spy
::Crispy::CrispyInternal::ClassSpy.register spy: spy, of_class: @target_class
end
end
def self.register(spy: nil, of_class: nil)
@registry[of_class] = spy
end
def self.of_class(klass)
@registry[klass]
end
end
end
end
|
module Crispy
module CrispyInternal
class ClassSpy < ::Module
include SpyMixin
include WithStubber
@registry = {}
def initialize klass, stubs_map = {}
super()
@received_messages = []
initialize_stubber stubs_map
prepend_stubber klass
sneak_into Target.new(klass)
end
def define_wrapper method_name
define_method method_name do|*arguments, &attached_block|
::Crispy::CrispyInternal::ClassSpy.of_class(self.class).received_messages <<
::Crispy::CrispyReceivedMessageWithReceiver.new(self, method_name, *arguments, &attached_block)
super(*arguments, &attached_block)
end
method_name
end
private :define_wrapper
class Target
def initialize klass
@target_class = klass
end
def as_class
@target_class
end
# define accessor after prepending to avoid to spy unexpectedly.
def pass_spy_through spy
::Crispy::CrispyInternal::ClassSpy.register spy: spy, of_class: @target_class
end
end
def self.register(spy: nil, of_class: nil)
@registry[of_class] = spy
end
def self.of_class(klass)
@registry[klass]
end
end
end
end
|
Revert "add more codes to reproduce segfault more."
|
Revert "add more codes to reproduce segfault more."
This reverts commit a56586e48bf3a88dd9d19068d53fdb67f3e2faac.
|
Ruby
|
mit
|
igrep/crispy
|
ruby
|
## Code Before:
module Crispy
module CrispyInternal
class ClassSpy < ::Module
include SpyMixin
include WithStubber
@registry = {}
def initialize klass, stubs_map = {}
super()
@received_messages = []
initialize_stubber stubs_map
prepend_stubber klass
sneak_into Target.new(klass)
end
def define_wrapper method_name
#return method_name if method_name == :initialize
return method_name if method_name == :method_missing
p method_name
define_method method_name do|*arguments, &attached_block|
#::Kernel.print "e" # <= with this statement, prepend-ing :method_missing doesn't cause the segfault.
::Crispy::CrispyInternal::ClassSpy.of_class(::Kernel.p self.class).received_messages <<
::Crispy::CrispyReceivedMessageWithReceiver.new(self, method_name, *arguments, &attached_block)
super(*arguments, &attached_block)
end
method_name
end
private :define_wrapper
class Target
def initialize klass
@target_class = klass
end
def as_class
@target_class
end
# define accessor after prepending to avoid to spy unexpectedly.
def pass_spy_through spy
::Crispy::CrispyInternal::ClassSpy.register spy: spy, of_class: @target_class
end
end
def self.register(spy: nil, of_class: nil)
@registry[of_class] = spy
end
def self.of_class(klass)
@registry[klass]
end
end
end
end
## Instruction:
Revert "add more codes to reproduce segfault more."
This reverts commit a56586e48bf3a88dd9d19068d53fdb67f3e2faac.
## Code After:
module Crispy
module CrispyInternal
class ClassSpy < ::Module
include SpyMixin
include WithStubber
@registry = {}
def initialize klass, stubs_map = {}
super()
@received_messages = []
initialize_stubber stubs_map
prepend_stubber klass
sneak_into Target.new(klass)
end
def define_wrapper method_name
define_method method_name do|*arguments, &attached_block|
::Crispy::CrispyInternal::ClassSpy.of_class(self.class).received_messages <<
::Crispy::CrispyReceivedMessageWithReceiver.new(self, method_name, *arguments, &attached_block)
super(*arguments, &attached_block)
end
method_name
end
private :define_wrapper
class Target
def initialize klass
@target_class = klass
end
def as_class
@target_class
end
# define accessor after prepending to avoid to spy unexpectedly.
def pass_spy_through spy
::Crispy::CrispyInternal::ClassSpy.register spy: spy, of_class: @target_class
end
end
def self.register(spy: nil, of_class: nil)
@registry[of_class] = spy
end
def self.of_class(klass)
@registry[klass]
end
end
end
end
|
9c0d2c756a6228a448cbf3a4883adfe27e9c7ea1
|
CMakeLists.txt
|
CMakeLists.txt
|
cmake_minimum_required(VERSION 2.8.4)
set(CMAKE_VERBOSE_MAKEFILE off)
project(asio_http)
include_directories(include)
file(GLOB SOURCE_FILES src/*.cpp src/http/*.cpp)
add_executable(asio_http ${SOURCE_FILES})
set_property(TARGET asio_http PROPERTY CXX_STANDARD 11)
|
cmake_minimum_required(VERSION 2.8.4)
set(CMAKE_VERBOSE_MAKEFILE off)
project(asio_http)
include_directories(include)
file(GLOB SOURCE_FILES src/*.cpp src/http/*.cpp)
add_executable(asio_http ${SOURCE_FILES})
target_link_libraries(asio_http pthread)
set_property(TARGET asio_http PROPERTY CXX_STANDARD 11)
|
Fix build: link with pthread
|
Fix build: link with pthread
|
Text
|
mit
|
guoxiao/asio_http
|
text
|
## Code Before:
cmake_minimum_required(VERSION 2.8.4)
set(CMAKE_VERBOSE_MAKEFILE off)
project(asio_http)
include_directories(include)
file(GLOB SOURCE_FILES src/*.cpp src/http/*.cpp)
add_executable(asio_http ${SOURCE_FILES})
set_property(TARGET asio_http PROPERTY CXX_STANDARD 11)
## Instruction:
Fix build: link with pthread
## Code After:
cmake_minimum_required(VERSION 2.8.4)
set(CMAKE_VERBOSE_MAKEFILE off)
project(asio_http)
include_directories(include)
file(GLOB SOURCE_FILES src/*.cpp src/http/*.cpp)
add_executable(asio_http ${SOURCE_FILES})
target_link_libraries(asio_http pthread)
set_property(TARGET asio_http PROPERTY CXX_STANDARD 11)
|
17e4ddc2ef99dc4b5ac09ae7c243c5a7e5af4347
|
roles/shell/tasks/main.yml
|
roles/shell/tasks/main.yml
|
---
- file: path=~/.bin
state=directory
- include: packages.yml
sudo: true
- include: vim.yml
- include: zsh.yml
### Other dotfiles
- file: path=~/.config/htop state=directory
- copy: dest=~/.{{ item }}
src={{ item }}
with_items:
- gitconfig
- hgrc
- tmux.conf
- tmux.theme.conf
- screenrc
- config/htop/htoprc
# this file needs to exist, but it just for local customizations
- file: path=~/.tmux.local state=touch
|
---
- file: path=~/.bin
state=directory
- include: packages.yml
sudo: true
- include: vim.yml
- include: zsh.yml
### Other dotfiles
- file: path=~/.config/htop state=directory
- file: path=~/.config/htop state=directory
sudo: true
- copy: dest=~/.{{ item }}
src={{ item }}
with_items:
- gitconfig
- hgrc
- tmux.conf
- tmux.theme.conf
- screenrc
- config/htop/htoprc
- copy: dest=~/.{{ item }}
src={{ item }}
sudo: true
with_items:
- screenrc
- config/htop/htoprc
# this file needs to exist, but it just for local customizations
- file: path=~/.tmux.local state=touch
|
Add `htop` and `screen` config files for root
|
Add `htop` and `screen` config files for root
|
YAML
|
mit
|
ryansb/workstation,ryansb/workstation,ryansb/workstation
|
yaml
|
## Code Before:
---
- file: path=~/.bin
state=directory
- include: packages.yml
sudo: true
- include: vim.yml
- include: zsh.yml
### Other dotfiles
- file: path=~/.config/htop state=directory
- copy: dest=~/.{{ item }}
src={{ item }}
with_items:
- gitconfig
- hgrc
- tmux.conf
- tmux.theme.conf
- screenrc
- config/htop/htoprc
# this file needs to exist, but it just for local customizations
- file: path=~/.tmux.local state=touch
## Instruction:
Add `htop` and `screen` config files for root
## Code After:
---
- file: path=~/.bin
state=directory
- include: packages.yml
sudo: true
- include: vim.yml
- include: zsh.yml
### Other dotfiles
- file: path=~/.config/htop state=directory
- file: path=~/.config/htop state=directory
sudo: true
- copy: dest=~/.{{ item }}
src={{ item }}
with_items:
- gitconfig
- hgrc
- tmux.conf
- tmux.theme.conf
- screenrc
- config/htop/htoprc
- copy: dest=~/.{{ item }}
src={{ item }}
sudo: true
with_items:
- screenrc
- config/htop/htoprc
# this file needs to exist, but it just for local customizations
- file: path=~/.tmux.local state=touch
|
8e83da29f42e3b0f918779db904fec2274a45092
|
lib/plugins/console/deploy.js
|
lib/plugins/console/deploy.js
|
var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
/*
var generate = function(callback){
spawn({
command: hexo.core_dir + 'bin/hexo',
args: ['generate'],
exit: function(code){
if (code === 0) callback();
}
});
};
*/
extend.console.register('deploy', 'Deploy', function(args){
var config = hexo.config.deploy;
if (!config || !config.type){
var help = '\nYou should configure deployment settings in ' + '_config.yml'.bold + ' first!\n\nType:\n';
help += ' ' + Object.keys(list).join(', ');
console.log(help + '\n\nMore info: http://zespia.tw/hexo/docs/deploy.html\n');
} else {
async.series([
function(next){
if (args.generate){
generate(next);
} else {
fs.exists(hexo.public_dir, function(exist){
if (exist) return next();
generate(next);
});
}
},
function(next){
list[config.type](args, callback);
}
]);
}
});
|
var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
extend.console.register('deploy', 'Deploy', function(args){
var config = hexo.config.deploy;
if (!config || !config.type){
var help = '\nYou should configure deployment settings in ' + '_config.yml'.bold + ' first!\n\nType:\n';
help += ' ' + Object.keys(list).join(', ');
console.log(help + '\n\nMore info: http://zespia.tw/hexo/docs/deploy.html\n');
} else {
async.series([
function(next){
if (args.g || args.generate){
hexo.call('generate', next);
} else {
fs.exists(hexo.public_dir, function(exist){
if (exist) return next();
hexo.call('generate', next);
});
}
},
function(next){
list[config.type](args, callback);
}
]);
}
});
|
Use call API to call generate console
|
Deploy: Use call API to call generate console
|
JavaScript
|
mit
|
glabcn/hexo,elegantwww/hexo,amobiz/hexo,sailtoy/hexo,chenbojian/hexo,JasonMPE/hexo,zhipengyan/hexo,wyfyyy818818/hexo,nextexit/hexo,Richardphp/hexo,lknny/hexo,HiWong/hexo,hugoxia/hexo,0111001101111010/hexo,cjwind/hexx,meaverick/hexo,kennethlyn/hexo,DevinLow/DevinLow.github.io,allengaller/hexo,zoubin/hexo,zongkelong/hexo,biezhihua/hexo,wangjordy/wangjordy.github.io,DevinLow/DevinLow.github.io,hanhailong/hexo,delkyd/hexo,maominghui/hexo,tzq668766/hexo,jonesgithub/hexo,wenzhucjy/hexo,xushuwei202/hexo,kywk/hexi,gaojinhua/hexo,Bob1993/hexo,r4-keisuke/hexo,SampleLiao/hexo,fuchao2012/hexo,crystalwm/hexo,tibic/hexo,wwff/hexo,ppker/hexo,karenpeng/hexo,magicdawn/hexo,liuhongjiang/hexo,leikegeek/hexo,dieface/hexo,zhangg/hexo,ChaofengZhou/hexo,kywk/hexi,hexojs/hexo,luodengxiong/hexo,0111001101111010/blog,wangjordy/wangjordy.github.io,oomusou/hexo,hexojs/hexo,noikiy/hexo,wflmax/hexo,G-g-beringei/hexo,xiaoliuzi/hexo,liukaijv/hexo,ppker/hexo,dreamren/hexo,hackjustu/hexo,jp1017/hexo,memezilla/hexo,chenzaichun/hexo,viethang/hexo,znanl/znanl,haoyuchen1992/hexo,lukw00/hexo,XGHeaven/hexo,initiumlab/hexo,beni55/hexo,iamprasad88/hexo,aulphar/hexo,xcatliu/hexo,sundyxfan/hexo,imjerrybao/hexo,Carbs0126/hexo,Gtskk/hexo,zhi1ong/hexo,keeleys/hexo,GGuang/hexo,registercosmo/hexo,zhipengyan/hexo,luinnx/hexo,noname007/hexo-1,BruceChao/hexo,zhoulingjun/hexo,logonmy/hexo,leelynd/tapohuck,k2byew/hexo,Jeremy017/hexo,will-zhangweilin/myhexo,SaiNadh001/hexo,HcySunYang/hexo,jollylulu/hexo,Regis25489/hexo,DanielHit/hexo,runlevelsix/hexo,littledogboy/hexo,lookii/looki
|
javascript
|
## Code Before:
var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
/*
var generate = function(callback){
spawn({
command: hexo.core_dir + 'bin/hexo',
args: ['generate'],
exit: function(code){
if (code === 0) callback();
}
});
};
*/
extend.console.register('deploy', 'Deploy', function(args){
var config = hexo.config.deploy;
if (!config || !config.type){
var help = '\nYou should configure deployment settings in ' + '_config.yml'.bold + ' first!\n\nType:\n';
help += ' ' + Object.keys(list).join(', ');
console.log(help + '\n\nMore info: http://zespia.tw/hexo/docs/deploy.html\n');
} else {
async.series([
function(next){
if (args.generate){
generate(next);
} else {
fs.exists(hexo.public_dir, function(exist){
if (exist) return next();
generate(next);
});
}
},
function(next){
list[config.type](args, callback);
}
]);
}
});
## Instruction:
Deploy: Use call API to call generate console
## Code After:
var term = require('term'),
async = require('async'),
fs = require('graceful-fs'),
extend = require('../../extend'),
list = extend.deployer.list(),
util = require('../../util'),
spawn = util.spawn;
extend.console.register('deploy', 'Deploy', function(args){
var config = hexo.config.deploy;
if (!config || !config.type){
var help = '\nYou should configure deployment settings in ' + '_config.yml'.bold + ' first!\n\nType:\n';
help += ' ' + Object.keys(list).join(', ');
console.log(help + '\n\nMore info: http://zespia.tw/hexo/docs/deploy.html\n');
} else {
async.series([
function(next){
if (args.g || args.generate){
hexo.call('generate', next);
} else {
fs.exists(hexo.public_dir, function(exist){
if (exist) return next();
hexo.call('generate', next);
});
}
},
function(next){
list[config.type](args, callback);
}
]);
}
});
|
4440c18228fa5f6e8ff9cbaff527dfa7a5f67df4
|
tox.ini
|
tox.ini
|
[tox]
envlist = py25,py26,py27,py32,py33,pypy
[testenv]
deps=nose
coverage
pyyaml
six
tempita
commands=nosetests --with-coverage --cover-package=depsolver depsolver
[testenv:pypy]
deps=nose
coverage
pyyaml
six
tempita
unittest2
[testenv:py25]
deps=nose
coverage
pyyaml
six
tempita
unittest2
[testenv:py26]
deps=nose
coverage
pyyaml
six
tempita
unittest2
[testenv:py27]
deps=nose
coverage
pyyaml
six
tempita
unittest2
|
[tox]
envlist = py26,py27,py32,py33,pypy
[testenv]
deps=nose
coverage
pyyaml
six
tempita
commands=nosetests --with-coverage --cover-package=depsolver depsolver
[testenv:pypy]
deps=nose
coverage
pyyaml
six
tempita
unittest2
[testenv:py26]
deps=nose
coverage
pyyaml
six
tempita
unittest2
[testenv:py27]
deps=nose
coverage
pyyaml
six
tempita
unittest2
|
Revert "MAINT: let's add 2.5 as well."
|
Revert "MAINT: let's add 2.5 as well."
This reverts commit 5a6dc5467a04666b7cfa2b00efa43c8147957804.
|
INI
|
bsd-3-clause
|
enthought/depsolver,enthought/depsolver
|
ini
|
## Code Before:
[tox]
envlist = py25,py26,py27,py32,py33,pypy
[testenv]
deps=nose
coverage
pyyaml
six
tempita
commands=nosetests --with-coverage --cover-package=depsolver depsolver
[testenv:pypy]
deps=nose
coverage
pyyaml
six
tempita
unittest2
[testenv:py25]
deps=nose
coverage
pyyaml
six
tempita
unittest2
[testenv:py26]
deps=nose
coverage
pyyaml
six
tempita
unittest2
[testenv:py27]
deps=nose
coverage
pyyaml
six
tempita
unittest2
## Instruction:
Revert "MAINT: let's add 2.5 as well."
This reverts commit 5a6dc5467a04666b7cfa2b00efa43c8147957804.
## Code After:
[tox]
envlist = py26,py27,py32,py33,pypy
[testenv]
deps=nose
coverage
pyyaml
six
tempita
commands=nosetests --with-coverage --cover-package=depsolver depsolver
[testenv:pypy]
deps=nose
coverage
pyyaml
six
tempita
unittest2
[testenv:py26]
deps=nose
coverage
pyyaml
six
tempita
unittest2
[testenv:py27]
deps=nose
coverage
pyyaml
six
tempita
unittest2
|
db4078b3db30ab7634de87b228ec81cd42e5d372
|
thinc/linear/avgtron.pxd
|
thinc/linear/avgtron.pxd
|
from cymem.cymem cimport Pool
from preshed.maps cimport PreshMap
from .features cimport ConjunctionExtracter
from ..typedefs cimport weight_t, feat_t, class_t
from ..structs cimport FeatureC
from ..structs cimport ExampleC
cdef class AveragedPerceptron:
cdef readonly Pool mem
cdef readonly PreshMap weights
cdef readonly PreshMap averages
cdef readonly PreshMap lasso_ledger
cdef ConjunctionExtracter extracter
cdef public int time
cdef public weight_t learn_rate
cdef public weight_t l1_penalty
cdef public weight_t momentum
cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil
cdef int updateC(self, const ExampleC* eg) except -1
cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1
|
from cymem.cymem cimport Pool
from preshed.maps cimport PreshMap
from .features cimport ConjunctionExtracter
from ..typedefs cimport weight_t, feat_t, class_t
from ..structs cimport FeatureC
from ..structs cimport ExampleC
cdef class AveragedPerceptron:
cdef readonly Pool mem
cdef readonly PreshMap weights
cdef readonly PreshMap averages
cdef readonly PreshMap lasso_ledger
cdef ConjunctionExtracter extracter
cdef public int time
cdef readonly int nr_out
cdef public weight_t learn_rate
cdef public weight_t l1_penalty
cdef public weight_t momentum
cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil
cdef int updateC(self, const ExampleC* eg) except -1
cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1
|
Add nr_out attribute to AveragedPerceptron
|
Add nr_out attribute to AveragedPerceptron
|
Cython
|
mit
|
explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc
|
cython
|
## Code Before:
from cymem.cymem cimport Pool
from preshed.maps cimport PreshMap
from .features cimport ConjunctionExtracter
from ..typedefs cimport weight_t, feat_t, class_t
from ..structs cimport FeatureC
from ..structs cimport ExampleC
cdef class AveragedPerceptron:
cdef readonly Pool mem
cdef readonly PreshMap weights
cdef readonly PreshMap averages
cdef readonly PreshMap lasso_ledger
cdef ConjunctionExtracter extracter
cdef public int time
cdef public weight_t learn_rate
cdef public weight_t l1_penalty
cdef public weight_t momentum
cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil
cdef int updateC(self, const ExampleC* eg) except -1
cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1
## Instruction:
Add nr_out attribute to AveragedPerceptron
## Code After:
from cymem.cymem cimport Pool
from preshed.maps cimport PreshMap
from .features cimport ConjunctionExtracter
from ..typedefs cimport weight_t, feat_t, class_t
from ..structs cimport FeatureC
from ..structs cimport ExampleC
cdef class AveragedPerceptron:
cdef readonly Pool mem
cdef readonly PreshMap weights
cdef readonly PreshMap averages
cdef readonly PreshMap lasso_ledger
cdef ConjunctionExtracter extracter
cdef public int time
cdef readonly int nr_out
cdef public weight_t learn_rate
cdef public weight_t l1_penalty
cdef public weight_t momentum
cdef void set_scoresC(self, weight_t* scores, const FeatureC* feats, int nr_feat) nogil
cdef int updateC(self, const ExampleC* eg) except -1
cpdef int update_weight(self, feat_t feat_id, class_t clas, weight_t upd) except -1
|
1dc2856368e5e6852b526d86a0c78c5fe10b1550
|
myhronet/models.py
|
myhronet/models.py
|
import string
from django.db import models
class Blacklist(models.Model):
domain = models.CharField(max_length=255, unique=True, null=True)
def __unicode__(self):
return self.domain
class URL(models.Model):
hashcode = models.CharField(max_length=10, unique=True,
db_index=True, null=True)
longurl = models.CharField(max_length=1024, unique=True,
db_index=True, null=True)
views = models.IntegerField(default=0)
ip = models.GenericIPAddressField(null=True)
data = models.DateTimeField(auto_now_add=True, null=True)
def save(self, *args, **kwargs):
if URL.objects.count():
last = URL.objects.latest('id').pk + 1
alphabet = string.digits + string.ascii_lowercase
base36 = ''
while last != 0:
last, i = divmod(last, len(alphabet))
base36 = alphabet[i] + base36
self.hashcode = base36
else:
self.hashcode = '1'
return super(URL, self).save(*args, **kwargs)
def short_url(self, request):
return ''.join([
request.scheme,
'://', request.get_host(),
'/', self.hashcode,
])
def __unicode__(self):
return ' - '.join([self.hashcode, self.longurl])
|
import string
from django.db import models
class Blacklist(models.Model):
domain = models.CharField(max_length=255, unique=True, null=True)
def __unicode__(self):
return self.domain
class URL(models.Model):
hashcode = models.CharField(max_length=10, unique=True,
db_index=True, null=True)
longurl = models.CharField(max_length=1024, unique=True,
db_index=True, null=True)
views = models.IntegerField(default=0)
ip = models.GenericIPAddressField(null=True)
data = models.DateTimeField(auto_now_add=True, null=True)
def save(self, *args, **kwargs):
if not self.pk:
if URL.objects.count():
last = URL.objects.latest('id').pk + 1
alphabet = string.digits + string.ascii_lowercase
base36 = ''
while last != 0:
last, i = divmod(last, len(alphabet))
base36 = alphabet[i] + base36
self.hashcode = base36
else:
self.hashcode = '1'
return super(URL, self).save(*args, **kwargs)
def short_url(self, request):
return ''.join([
request.scheme,
'://', request.get_host(),
'/', self.hashcode,
])
def __unicode__(self):
return ' - '.join([self.hashcode, self.longurl])
|
Fix hashcode generation for existing URLs
|
Fix hashcode generation for existing URLs
|
Python
|
mit
|
myhro/myhronet,myhro/myhronet
|
python
|
## Code Before:
import string
from django.db import models
class Blacklist(models.Model):
domain = models.CharField(max_length=255, unique=True, null=True)
def __unicode__(self):
return self.domain
class URL(models.Model):
hashcode = models.CharField(max_length=10, unique=True,
db_index=True, null=True)
longurl = models.CharField(max_length=1024, unique=True,
db_index=True, null=True)
views = models.IntegerField(default=0)
ip = models.GenericIPAddressField(null=True)
data = models.DateTimeField(auto_now_add=True, null=True)
def save(self, *args, **kwargs):
if URL.objects.count():
last = URL.objects.latest('id').pk + 1
alphabet = string.digits + string.ascii_lowercase
base36 = ''
while last != 0:
last, i = divmod(last, len(alphabet))
base36 = alphabet[i] + base36
self.hashcode = base36
else:
self.hashcode = '1'
return super(URL, self).save(*args, **kwargs)
def short_url(self, request):
return ''.join([
request.scheme,
'://', request.get_host(),
'/', self.hashcode,
])
def __unicode__(self):
return ' - '.join([self.hashcode, self.longurl])
## Instruction:
Fix hashcode generation for existing URLs
## Code After:
import string
from django.db import models
class Blacklist(models.Model):
domain = models.CharField(max_length=255, unique=True, null=True)
def __unicode__(self):
return self.domain
class URL(models.Model):
hashcode = models.CharField(max_length=10, unique=True,
db_index=True, null=True)
longurl = models.CharField(max_length=1024, unique=True,
db_index=True, null=True)
views = models.IntegerField(default=0)
ip = models.GenericIPAddressField(null=True)
data = models.DateTimeField(auto_now_add=True, null=True)
def save(self, *args, **kwargs):
if not self.pk:
if URL.objects.count():
last = URL.objects.latest('id').pk + 1
alphabet = string.digits + string.ascii_lowercase
base36 = ''
while last != 0:
last, i = divmod(last, len(alphabet))
base36 = alphabet[i] + base36
self.hashcode = base36
else:
self.hashcode = '1'
return super(URL, self).save(*args, **kwargs)
def short_url(self, request):
return ''.join([
request.scheme,
'://', request.get_host(),
'/', self.hashcode,
])
def __unicode__(self):
return ' - '.join([self.hashcode, self.longurl])
|
c00187d8ada14b3de0b0e057e34751d582789857
|
content/browser/android/devtools_auth.cc
|
content/browser/android/devtools_auth.cc
|
// Copyright (c) 2012 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.
#include "content/public/browser/android/devtools_auth.h"
#include "base/logging.h"
namespace content {
bool CanUserConnectToDevTools(uid_t uid, gid_t gid) {
struct passwd* creds = getpwuid(uid);
if (!creds || !creds->pw_name) {
LOG(WARNING) << "DevTools: can't obtain creds for uid " << uid;
return false;
}
if (gid == uid &&
(strcmp("root", creds->pw_name) == 0 || // For rooted devices
strcmp("shell", creds->pw_name) == 0)) { // For non-rooted devices
return true;
}
LOG(WARNING) << "DevTools: connection attempt from " << creds->pw_name;
return false;
}
} // namespace content
|
// Copyright (c) 2012 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.
#include "content/public/browser/android/devtools_auth.h"
#include <unistd.h>
#include <sys/types.h>
#include "base/logging.h"
namespace content {
bool CanUserConnectToDevTools(uid_t uid, gid_t gid) {
struct passwd* creds = getpwuid(uid);
if (!creds || !creds->pw_name) {
LOG(WARNING) << "DevTools: can't obtain creds for uid " << uid;
return false;
}
if (gid == uid &&
(strcmp("root", creds->pw_name) == 0 || // For rooted devices
strcmp("shell", creds->pw_name) == 0 || // For non-rooted devices
uid == getuid())) { // From processes signed with the same key
return true;
}
LOG(WARNING) << "DevTools: connection attempt from " << creds->pw_name;
return false;
}
} // namespace content
|
Allow connections from the same user to DevTools server socket
|
[Android] Allow connections from the same user to DevTools server socket
Allow connections to DevTools web debugging socket from the apps that run under
the same UID than the browser app process itself. This requires signing the
corresponding APK with the same keys than the browser app.
BUG=398357
Review URL: https://codereview.chromium.org/425013002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@286179 0039d316-1c4b-4281-b951-d872f2087c98
|
C++
|
bsd-3-clause
|
crosswalk-project/chromium-crosswalk-efl,mohamed--abdel-maksoud/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,dushu1203/chromium.src,ondra-novak/chromium.src,chuan9/chromium-crosswalk,M4sse/chromium.src,dednal/chromium.src,Jonekee/chromium.src,dushu1203/chromium.src,M4sse/chromium.src,markYoungH/chromium.src,Chilledheart/chromium,Jonekee/chromium.src,fujunwei/chromium-crosswalk,bright-sparks/chromium-spacewalk,ltilve/chromium,krieger-od/nwjs_chromium.src,ltilve/chromium,hgl888/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,jaruba/chromium.src,Fireblend/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,bright-sparks/chromium-spacewalk,markYoungH/chromium.src,Fireblend/chromium-crosswalk,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,krieger-od/nwjs_chromium.src,M4sse/chromium.src,jaruba/chromium.src,bright-sparks/chromium-spacewalk,hgl888/chromium-crosswalk,ltilve/chromium,dednal/chromium.src,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,ondra-novak/chromium.src,ondra-novak/chromium.src,Fireblend/chromium-crosswalk,dednal/chromium.src,ltilve/chromium,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,bright-sparks/chromium-spacewalk,Pluto-tv/chromium-crosswalk,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,Chilledheart/chromium,littlstar/chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,hgl888/chromium-crosswalk,littlstar/chromium.src,ltilve/chromium,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,krieger-od/nwjs_chromium.src,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk-efl,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,Fireblend/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,jaruba/chromium.src,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,markYoungH/chromium.src,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,markYoungH/chromium.src,Fireblend/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,dushu1203/chromium.src,ltilve/chromium,dednal/chromium.src,chuan9/chromium-crosswalk,markYoungH/chromium.src,crosswalk-project/chromium-crosswalk-efl,littlstar/chromium.src,hgl888/chromium-crosswalk,Jonekee/chromium.src,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,littlstar/chromium.src,M4sse/chromium.src,ondra-novak/chromium.src,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,littlstar/chromium.src,axinging/chromium-crosswalk,ltilve/chromium,jaruba/chromium.src,krieger-od/nwjs_chromium.src,krieger-od/nwjs_chromium.src,Jonekee/chromium.src,M4sse/chromium.src,littlstar/chromium.src,fujunwei/chromium-crosswalk,Just-D/chromium-1,bright-sparks/chromium-spacewalk,TheTypoMaster/chromium-crosswalk,dednal/chromium.src,Jonekee/chromium.src,krieger-od/nwjs_chromium.src,Just-D/chromium-1,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,Just-D/chromium-1,dednal/chromium.src,jaruba/chromium.src,dednal/chromium.src,bright-sparks/chromium-spacewalk,jaruba/chromium.src,Jonekee/chromium.src,fujunwei/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,markYoungH/chromium.src,markYoungH/chromium.src,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,mohamed--abdel-maksoud/chromium.src,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,M4sse/chromium.src,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,jaruba/chromium.src,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk-efl,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,axinging/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,M4sse/chromium.src,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,Just-D/chromium-1,dushu1203/chromium.src,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,dednal/chromium.src,littlstar/chromium.src,mohamed--abdel-maksoud/chromium.src,PeterWangIntel/chromium-crosswalk,M4sse/chromium.src,dednal/chromium.src,ondra-novak/chromium.src,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,markYoungH/chromium.src,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,Jonekee/chromium.src,dushu1203/chromium.src,PeterWangIntel/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk-efl,chuan9/chromium-crosswalk,M4sse/chromium.src,TheTypoMaster/chromium-crosswalk,axinging/chromium-crosswalk,fujunwei/chromium-crosswalk,chuan9/chromium-crosswalk,markYoungH/chromium.src,Chilledheart/chromium,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,Pluto-tv/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,Chilledheart/chromium,Chilledheart/chromium,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,axinging/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,fujunwei/chromium-crosswalk,markYoungH/chromium.src
|
c++
|
## Code Before:
// Copyright (c) 2012 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.
#include "content/public/browser/android/devtools_auth.h"
#include "base/logging.h"
namespace content {
bool CanUserConnectToDevTools(uid_t uid, gid_t gid) {
struct passwd* creds = getpwuid(uid);
if (!creds || !creds->pw_name) {
LOG(WARNING) << "DevTools: can't obtain creds for uid " << uid;
return false;
}
if (gid == uid &&
(strcmp("root", creds->pw_name) == 0 || // For rooted devices
strcmp("shell", creds->pw_name) == 0)) { // For non-rooted devices
return true;
}
LOG(WARNING) << "DevTools: connection attempt from " << creds->pw_name;
return false;
}
} // namespace content
## Instruction:
[Android] Allow connections from the same user to DevTools server socket
Allow connections to DevTools web debugging socket from the apps that run under
the same UID than the browser app process itself. This requires signing the
corresponding APK with the same keys than the browser app.
BUG=398357
Review URL: https://codereview.chromium.org/425013002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@286179 0039d316-1c4b-4281-b951-d872f2087c98
## Code After:
// Copyright (c) 2012 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.
#include "content/public/browser/android/devtools_auth.h"
#include <unistd.h>
#include <sys/types.h>
#include "base/logging.h"
namespace content {
bool CanUserConnectToDevTools(uid_t uid, gid_t gid) {
struct passwd* creds = getpwuid(uid);
if (!creds || !creds->pw_name) {
LOG(WARNING) << "DevTools: can't obtain creds for uid " << uid;
return false;
}
if (gid == uid &&
(strcmp("root", creds->pw_name) == 0 || // For rooted devices
strcmp("shell", creds->pw_name) == 0 || // For non-rooted devices
uid == getuid())) { // From processes signed with the same key
return true;
}
LOG(WARNING) << "DevTools: connection attempt from " << creds->pw_name;
return false;
}
} // namespace content
|
cc3f28e74145729c8b572fd9d2ed04d8fb297360
|
Testing/TestDICOMPython.py
|
Testing/TestDICOMPython.py
|
import sys
import vtk
import vtkDICOMPython
# put everything into the vtk namespace
for a in dir(vtkDICOMPython):
if a[0] != '_':
setattr(vtk, a, getattr(vtkDICOMPython, a))
m = vtk.vtkDICOMMetaData()
m.SetAttributeValue(vtk.vtkDICOMTag(0x0008, 0x0005), 'ISO_IR 100')
v = m.GetAttributeValue(vtk.vtkDICOMTag(0x0008, 0x0005))
if v.AsString() != 'ISO_IR 100':
sys.exit(1)
|
import sys
import vtk
import vtkDICOMPython
# put everything into the vtk namespace
for a in dir(vtkDICOMPython):
if a[0] != '_':
setattr(vtk, a, getattr(vtkDICOMPython, a))
m = vtk.vtkDICOMMetaData()
if vtk.vtkVersion.GetVTKMajorVersion() < 6:
sys.stderr.write("This test requires VTK 6 or higher.\n");
sys.exit(0)
m.SetAttributeValue(vtk.vtkDICOMTag(0x0008, 0x0005), 'ISO_IR 100')
v = m.GetAttributeValue(vtk.vtkDICOMTag(0x0008, 0x0005))
if v.AsString() != 'ISO_IR 100':
sys.exit(1)
|
Modify python test for VTK 5.
|
Modify python test for VTK 5.
|
Python
|
bsd-3-clause
|
dgobbi/vtk-dicom,dgobbi/vtk-dicom,hendradarwin/vtk-dicom,dgobbi/vtk-dicom,hendradarwin/vtk-dicom,hendradarwin/vtk-dicom
|
python
|
## Code Before:
import sys
import vtk
import vtkDICOMPython
# put everything into the vtk namespace
for a in dir(vtkDICOMPython):
if a[0] != '_':
setattr(vtk, a, getattr(vtkDICOMPython, a))
m = vtk.vtkDICOMMetaData()
m.SetAttributeValue(vtk.vtkDICOMTag(0x0008, 0x0005), 'ISO_IR 100')
v = m.GetAttributeValue(vtk.vtkDICOMTag(0x0008, 0x0005))
if v.AsString() != 'ISO_IR 100':
sys.exit(1)
## Instruction:
Modify python test for VTK 5.
## Code After:
import sys
import vtk
import vtkDICOMPython
# put everything into the vtk namespace
for a in dir(vtkDICOMPython):
if a[0] != '_':
setattr(vtk, a, getattr(vtkDICOMPython, a))
m = vtk.vtkDICOMMetaData()
if vtk.vtkVersion.GetVTKMajorVersion() < 6:
sys.stderr.write("This test requires VTK 6 or higher.\n");
sys.exit(0)
m.SetAttributeValue(vtk.vtkDICOMTag(0x0008, 0x0005), 'ISO_IR 100')
v = m.GetAttributeValue(vtk.vtkDICOMTag(0x0008, 0x0005))
if v.AsString() != 'ISO_IR 100':
sys.exit(1)
|
c2b5f97a24b80a336e0683249a8aab4434c8c8ee
|
cp4d/vgw/tenantConfig.json
|
cp4d/vgw/tenantConfig.json
|
{
"tenants": [{
"tenantURI": "watson",
"description": "Sample tenant configuration for CP4D.",
"conversation": {
"url": "",
"workspaceID": "",
"bearerToken": ""
},
"stt": {
"credentials": {
"url": "",
"bearerToken": ""
}
},
"tts": {
"credentials": {
"url": "",
"bearerToken": ""
},
"config": {
"voice": "en-US_AllisonV3Voice"
}
}
}]
}
|
{
"tenants": [{
"tenantURI": "1234567890",
"description": "Voice Gateway Demo US 1",
"conversation": {
"url": "",
"workspaceID": "",
"bearerToken": ""
},
"stt": {
"credentials": {
"url": "",
"bearerToken": ""
}
},
"tts": {
"credentials": {
"url": "",
"bearerToken": ""
},
"config": {
"voice": ""
}
}
},
{
"tenantURI": "0987654321",
"description": "Voice Gateway Demo US 2",
"conversation": {
"url": "",
"workspaceID": "",
"bearerToken": ""
},
"stt": {
"credentials": {
"url": "",
"bearerToken": ""
}
},
"tts": {
"credentials": {
"url": "",
"bearerToken": ""
},
"config": {
"voice": ""
}
}
}
]
}
|
Clarify that tenantURI is usually a phone number
|
Clarify that tenantURI is usually a phone number
|
JSON
|
apache-2.0
|
WASdev/sample.voice.gateway,WASdev/sample.voice.gateway,WASdev/sample.voice.gateway,WASdev/sample.voice.gateway,WASdev/sample.voice.gateway
|
json
|
## Code Before:
{
"tenants": [{
"tenantURI": "watson",
"description": "Sample tenant configuration for CP4D.",
"conversation": {
"url": "",
"workspaceID": "",
"bearerToken": ""
},
"stt": {
"credentials": {
"url": "",
"bearerToken": ""
}
},
"tts": {
"credentials": {
"url": "",
"bearerToken": ""
},
"config": {
"voice": "en-US_AllisonV3Voice"
}
}
}]
}
## Instruction:
Clarify that tenantURI is usually a phone number
## Code After:
{
"tenants": [{
"tenantURI": "1234567890",
"description": "Voice Gateway Demo US 1",
"conversation": {
"url": "",
"workspaceID": "",
"bearerToken": ""
},
"stt": {
"credentials": {
"url": "",
"bearerToken": ""
}
},
"tts": {
"credentials": {
"url": "",
"bearerToken": ""
},
"config": {
"voice": ""
}
}
},
{
"tenantURI": "0987654321",
"description": "Voice Gateway Demo US 2",
"conversation": {
"url": "",
"workspaceID": "",
"bearerToken": ""
},
"stt": {
"credentials": {
"url": "",
"bearerToken": ""
}
},
"tts": {
"credentials": {
"url": "",
"bearerToken": ""
},
"config": {
"voice": ""
}
}
}
]
}
|
84015e61d993fb9e453baf0f4df6e1283c6f162f
|
features/step_definitions/debug_steps.rb
|
features/step_definitions/debug_steps.rb
|
And /^I wait for (\d*) seconds$/ do |seconds|
sleep seconds.to_i
end
|
And /^I wait for (\d*) seconds$/ do |seconds|
sleep seconds.to_i
end
And /^I take a page screenshot$/ do
Capybara::Screenshot.screenshot_and_open_image
end
|
Add capybara screenshot debug step.
|
Add capybara screenshot debug step.
|
Ruby
|
mit
|
iridakos/duckrails,iridakos/duckrails,iridakos/duckrails,iridakos/duckrails
|
ruby
|
## Code Before:
And /^I wait for (\d*) seconds$/ do |seconds|
sleep seconds.to_i
end
## Instruction:
Add capybara screenshot debug step.
## Code After:
And /^I wait for (\d*) seconds$/ do |seconds|
sleep seconds.to_i
end
And /^I take a page screenshot$/ do
Capybara::Screenshot.screenshot_and_open_image
end
|
9dfde68464d1a6cb8e42fc0ba86d4cded346b089
|
src/app/forms/flatpickr/flatpickr.component.sass
|
src/app/forms/flatpickr/flatpickr.component.sass
|
// *************************************#
// [flatpickr.component.sass]
// *************************************#
|
// *************************************#
// [flatpickr.component.sass]
// *************************************#
.form-control[readonly]
background-color: #FFFFFF
|
Fix input styling for flatpickr input element
|
Fix input styling for flatpickr input element
|
Sass
|
mit
|
ecsnavarretemit/sarai-ng2,ecsnavarretemit/sarai-interactive-maps,ecsnavarretemit/sarai-ng2,ecsnavarretemit/sarai-interactive-maps,ecsnavarretemit/sarai-ng2,ecsnavarretemit/sarai-interactive-maps
|
sass
|
## Code Before:
// *************************************#
// [flatpickr.component.sass]
// *************************************#
## Instruction:
Fix input styling for flatpickr input element
## Code After:
// *************************************#
// [flatpickr.component.sass]
// *************************************#
.form-control[readonly]
background-color: #FFFFFF
|
840b3e47e6a58f800883b1cb6f763eb3f4f99db6
|
.travis.yml
|
.travis.yml
|
language: python
python:
- "2.7"
# command to install dependencies
install: "pip install -r requirements.txt"
# command to run tests
script: python -m unittest discover
deploy:
provider: releases
api_key:
secure: FD56NspznFaROwJp9BZycpjVPD9fuy9m25S3lFnQaDS93ztCAiBp1h53SrCKsDIZqY7ah9G9+AXP0/0NTJPMYGTH6W7B6oSe0UCvzaSCQpJ/J9fbfdU+rEUupCff6TzxWjsWX+xmawk1fzcfi096vRSEGu4xo/NZ3zYK14M7hewyAn0M4rKaLLWDQpeKRnyLDWK9U5HgP1IE7yXUoQ5qBaBBTqf8P7Z0lrljG8meyP3/u8Cd+TjJMtkhoaqiynkvfffEo3EK97NNMSDYQzz4ANkcq0S2bx0dEfA5OJWc1W3exY/4iJaa4tmKJMYTnZVU2a4LCJeoSNyWccBp4GLGcPEKsPUMjfwVQXNUZCfMM+IjVayEt06FhoofAip4YundL64LqL+VF1dqhUnAmLGkgp91OUUSZYdRX7Rz0EFR2tL3a7yiFfcVfkfThEIphfDycSWhpJ1/w2yk2v/GDgaEDtxTpcEVfdE8a1vv79eXpHmldVw7lhSVfd/yeMaZKkpfX9PEJ6GLdvCspfJbiYvfCVQeeBawSpaBLGzE/i6nxbjCN+btp1shxcimLBZW6vSybYp59TVhtWjV3y2Gd0YLXVTY2zJwhAFrItrsVnrmuek0jF+hVjyl98BC0ChlCJnhrAWhGsnK2/bpbKLi5nqKQHwnQl1G7oiH9biPGzTHBsQ=
skip_cleanup: true
on:
tags: true
|
language: python
python:
- "2.7"
# command to install dependencies
install: "pip install -r requirements.txt"
# command to run tests
script: python -m unittest discover
after_success:
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- export GIT_TAG=build-$TRAVIS_BUILD_NUMBER
- git tag $GIT_TAG -a -m "Generated tag from TravisCI build $TRAVIS_BUILD_NUMBER"
- git push origin $GIT_TAG
|
Use git to create tag after successful build.
|
Use git to create tag after successful build.
|
YAML
|
apache-2.0
|
tomaszguzialek/flask-api,tomaszguzialek/flask-api,tomaszguzialek/flask-api
|
yaml
|
## Code Before:
language: python
python:
- "2.7"
# command to install dependencies
install: "pip install -r requirements.txt"
# command to run tests
script: python -m unittest discover
deploy:
provider: releases
api_key:
secure: FD56NspznFaROwJp9BZycpjVPD9fuy9m25S3lFnQaDS93ztCAiBp1h53SrCKsDIZqY7ah9G9+AXP0/0NTJPMYGTH6W7B6oSe0UCvzaSCQpJ/J9fbfdU+rEUupCff6TzxWjsWX+xmawk1fzcfi096vRSEGu4xo/NZ3zYK14M7hewyAn0M4rKaLLWDQpeKRnyLDWK9U5HgP1IE7yXUoQ5qBaBBTqf8P7Z0lrljG8meyP3/u8Cd+TjJMtkhoaqiynkvfffEo3EK97NNMSDYQzz4ANkcq0S2bx0dEfA5OJWc1W3exY/4iJaa4tmKJMYTnZVU2a4LCJeoSNyWccBp4GLGcPEKsPUMjfwVQXNUZCfMM+IjVayEt06FhoofAip4YundL64LqL+VF1dqhUnAmLGkgp91OUUSZYdRX7Rz0EFR2tL3a7yiFfcVfkfThEIphfDycSWhpJ1/w2yk2v/GDgaEDtxTpcEVfdE8a1vv79eXpHmldVw7lhSVfd/yeMaZKkpfX9PEJ6GLdvCspfJbiYvfCVQeeBawSpaBLGzE/i6nxbjCN+btp1shxcimLBZW6vSybYp59TVhtWjV3y2Gd0YLXVTY2zJwhAFrItrsVnrmuek0jF+hVjyl98BC0ChlCJnhrAWhGsnK2/bpbKLi5nqKQHwnQl1G7oiH9biPGzTHBsQ=
skip_cleanup: true
on:
tags: true
## Instruction:
Use git to create tag after successful build.
## Code After:
language: python
python:
- "2.7"
# command to install dependencies
install: "pip install -r requirements.txt"
# command to run tests
script: python -m unittest discover
after_success:
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- export GIT_TAG=build-$TRAVIS_BUILD_NUMBER
- git tag $GIT_TAG -a -m "Generated tag from TravisCI build $TRAVIS_BUILD_NUMBER"
- git push origin $GIT_TAG
|
242a53f529f6350c70906069825fd0cf8fc7bd96
|
features/settings/default-php-version.feature
|
features/settings/default-php-version.feature
|
Feature: It is possible to interact with the settings of the generator
Scenario: Get the default php version
When I run the command "settings:reset"
And I run the command "settings:get:default-php-version"
Then the output should be
"""
7.0
"""
|
Feature: It is possible to interact with the settings of the generator
Scenario: Get the default php version
When I run the command "settings:reset"
And I run the command "settings:get:default-php-version"
Then the output should be
"""
7.0
"""
Scenario: Check if you can change the default version
When I run the command "settings:reset"
And I run the command "settings:set:default-php-version 5.6"
And I run the command "settings:get:default-php-version"
Then the output should be
"""
5.6
"""
Scenario: Check if the reset works
When I run the command "settings:set:default-php-version 5.6"
And I run the command "settings:reset"
And I run the command "settings:get:default-php-version"
Then the output should be
"""
7.0
"""
|
Check the setting and resetting of the php version
|
Check the setting and resetting of the php version
|
Cucumber
|
mit
|
carakas/fork-cms-module-generator,carakas/fork-cms-module-generator,carakas/fork-cms-module-generator
|
cucumber
|
## Code Before:
Feature: It is possible to interact with the settings of the generator
Scenario: Get the default php version
When I run the command "settings:reset"
And I run the command "settings:get:default-php-version"
Then the output should be
"""
7.0
"""
## Instruction:
Check the setting and resetting of the php version
## Code After:
Feature: It is possible to interact with the settings of the generator
Scenario: Get the default php version
When I run the command "settings:reset"
And I run the command "settings:get:default-php-version"
Then the output should be
"""
7.0
"""
Scenario: Check if you can change the default version
When I run the command "settings:reset"
And I run the command "settings:set:default-php-version 5.6"
And I run the command "settings:get:default-php-version"
Then the output should be
"""
5.6
"""
Scenario: Check if the reset works
When I run the command "settings:set:default-php-version 5.6"
And I run the command "settings:reset"
And I run the command "settings:get:default-php-version"
Then the output should be
"""
7.0
"""
|
f9421ab35aecdede1ca8454e231043e9f94edba6
|
server/config.js
|
server/config.js
|
path = require('path');
module.exports = {
mongo: {
dbUrl: 'https://api.mongolab.com/api/1', // The base url of the MongoLab DB server
apiKey: 'gubV4zs5yN-ItUUQDpgUx0pUA98K3MYH', // Our MongoLab API key
dbPath: 'mongodb://root:[email protected]:29979/paymymeeting'
},
server: {
listenPort: 3000,
distFolder: path.resolve(__dirname, '../client/dist'),
staticUrl: ''
}
};
|
path = require('path');
module.exports = {
mongo: {
dbUrl: 'https://api.mongolab.com/api/1', // The base url of the MongoLab DB server
apiKey: 'gubV4zs5yN-ItUUQDpgUx0pUA98K3MYH', // Our MongoLab API key
//dbPath: 'mongodb://root:[email protected]:29979/paymymeeting'
dbPath: 'mongodb://localhost:27017'
},
server: {
listenPort: 3000,
distFolder: path.resolve(__dirname, '../client/dist'),
staticUrl: ''
}
};
|
Add localhost path for MongoDB
|
Add localhost path for MongoDB
|
JavaScript
|
mit
|
PythagoreLab/PayMyMeeting
|
javascript
|
## Code Before:
path = require('path');
module.exports = {
mongo: {
dbUrl: 'https://api.mongolab.com/api/1', // The base url of the MongoLab DB server
apiKey: 'gubV4zs5yN-ItUUQDpgUx0pUA98K3MYH', // Our MongoLab API key
dbPath: 'mongodb://root:[email protected]:29979/paymymeeting'
},
server: {
listenPort: 3000,
distFolder: path.resolve(__dirname, '../client/dist'),
staticUrl: ''
}
};
## Instruction:
Add localhost path for MongoDB
## Code After:
path = require('path');
module.exports = {
mongo: {
dbUrl: 'https://api.mongolab.com/api/1', // The base url of the MongoLab DB server
apiKey: 'gubV4zs5yN-ItUUQDpgUx0pUA98K3MYH', // Our MongoLab API key
//dbPath: 'mongodb://root:[email protected]:29979/paymymeeting'
dbPath: 'mongodb://localhost:27017'
},
server: {
listenPort: 3000,
distFolder: path.resolve(__dirname, '../client/dist'),
staticUrl: ''
}
};
|
ef404caed4279726cd5d4edf9aca93b318273f54
|
lib/eventful/performer.rb
|
lib/eventful/performer.rb
|
module Eventful
class Performer
include Resource
def self.all(date = nil)
feed_for(:performers, :full, date)
end
def self.updates(date = nil)
feed_for(:performers, :updates, date)
end
def self.find(id, options = {})
options.merge!(id: id)
response = get('performers/get', options)
performer = instantiate(response.body['performer'])
respond_with performer, response, with_errors: true
end
end
end
|
module Eventful
class Performer
include Resource
def self.all(date = nil)
feed_for(:performers, :full, date)
end
def self.updates(date = nil)
feed_for(:performers, :updates, date)
end
def self.find(id, options = {})
options.merge!(id: id)
response = get('performers/get', options)
performer = instantiate(response.body['performer'])
respond_with performer, response
end
end
end
|
Remove with_errors option from Performer
|
Remove with_errors option from Performer
|
Ruby
|
mit
|
tabeso/eventful-ruby
|
ruby
|
## Code Before:
module Eventful
class Performer
include Resource
def self.all(date = nil)
feed_for(:performers, :full, date)
end
def self.updates(date = nil)
feed_for(:performers, :updates, date)
end
def self.find(id, options = {})
options.merge!(id: id)
response = get('performers/get', options)
performer = instantiate(response.body['performer'])
respond_with performer, response, with_errors: true
end
end
end
## Instruction:
Remove with_errors option from Performer
## Code After:
module Eventful
class Performer
include Resource
def self.all(date = nil)
feed_for(:performers, :full, date)
end
def self.updates(date = nil)
feed_for(:performers, :updates, date)
end
def self.find(id, options = {})
options.merge!(id: id)
response = get('performers/get', options)
performer = instantiate(response.body['performer'])
respond_with performer, response
end
end
end
|
27573a51540fa24dabf0fffdc10ee4297d981a59
|
.travis.yml
|
.travis.yml
|
language: python
python:
- 2.7
- 3.2
- 3.3
- 3.4
- nightly
- pypy
- pypy3
matrix:
allow_failures:
- python: nightly
- python: pypy3
sudo: false
install:
- pip install coveralls flake8 pep257
- npm install eslint
script:
- flake8 farcy
- pep257 farcy
- coverage run --source=farcy setup.py test
after_success: coveralls
|
language: python
python:
- 2.7
- 3.2
- 3.3
- 3.4
- nightly
- pypy
- pypy3
matrix:
allow_failures:
- python: nightly
- python: pypy3
sudo: false
install:
- pip install coveralls flake8 pep257
- npm install eslint
- gem install rubocop
script:
- flake8 farcy
- pep257 farcy
- coverage run --source=farcy setup.py test
after_success: coveralls
|
Install rubocop before tests run
|
Install rubocop before tests run
|
YAML
|
bsd-2-clause
|
appfolio/farcy,balloob/farcy,balloob/farcy,appfolio/farcy,balloob/farcy,appfolio/farcy
|
yaml
|
## Code Before:
language: python
python:
- 2.7
- 3.2
- 3.3
- 3.4
- nightly
- pypy
- pypy3
matrix:
allow_failures:
- python: nightly
- python: pypy3
sudo: false
install:
- pip install coveralls flake8 pep257
- npm install eslint
script:
- flake8 farcy
- pep257 farcy
- coverage run --source=farcy setup.py test
after_success: coveralls
## Instruction:
Install rubocop before tests run
## Code After:
language: python
python:
- 2.7
- 3.2
- 3.3
- 3.4
- nightly
- pypy
- pypy3
matrix:
allow_failures:
- python: nightly
- python: pypy3
sudo: false
install:
- pip install coveralls flake8 pep257
- npm install eslint
- gem install rubocop
script:
- flake8 farcy
- pep257 farcy
- coverage run --source=farcy setup.py test
after_success: coveralls
|
02d3c60b7f596c188ae6e7d93b10c80f58e1d0c4
|
src/main/java/space/gatt/magicaproject/managers/BlockManager.java
|
src/main/java/space/gatt/magicaproject/managers/BlockManager.java
|
package space.gatt.magicaproject.managers;
import org.bukkit.Bukkit;
import space.gatt.magicaproject.MagicaMain;
import space.gatt.magicaproject.objects.MagicaBlock;
import java.util.ArrayList;
import java.util.List;
public class BlockManager {
private List<MagicaBlock> runningBlocks = new ArrayList<>();
public BlockManager() {
Bukkit.getScheduler().runTaskTimer(MagicaMain.getMagicaMain(), ()->{
for (MagicaBlock mb : runningBlocks){
mb.runParticles();
}
}, 10, 10);
}
public void registerBlock(MagicaBlock mb){
if (!runningBlocks.contains(mb)){
runningBlocks.add(mb);
}
}
}
|
package space.gatt.magicaproject.managers;
import org.bukkit.Bukkit;
import space.gatt.magicaproject.MagicaMain;
import space.gatt.magicaproject.objects.MagicCrafter;
import space.gatt.magicaproject.objects.MagicaBlock;
import java.util.ArrayList;
import java.util.List;
public class BlockManager {
private List<MagicaBlock> runningBlocks = new ArrayList<>();
public BlockManager() {
Bukkit.getScheduler().runTaskTimer(MagicaMain.getMagicaMain(), ()->{
for (MagicaBlock mb : runningBlocks){
mb.runParticles();
}
}, 10, 10);
}
public void registerBlock(MagicaBlock mb){
if (!runningBlocks.contains(mb)){
runningBlocks.add(mb);
}
}
public void shutdown(){
for (MagicaBlock mb : runningBlocks){
if (mb instanceof Saveable){
((Saveable)mb).shutdownCall();
}
}
}
}
|
Call for all blocks to save
|
Call for all blocks to save
|
Java
|
mit
|
RealGatt/MagicaProject
|
java
|
## Code Before:
package space.gatt.magicaproject.managers;
import org.bukkit.Bukkit;
import space.gatt.magicaproject.MagicaMain;
import space.gatt.magicaproject.objects.MagicaBlock;
import java.util.ArrayList;
import java.util.List;
public class BlockManager {
private List<MagicaBlock> runningBlocks = new ArrayList<>();
public BlockManager() {
Bukkit.getScheduler().runTaskTimer(MagicaMain.getMagicaMain(), ()->{
for (MagicaBlock mb : runningBlocks){
mb.runParticles();
}
}, 10, 10);
}
public void registerBlock(MagicaBlock mb){
if (!runningBlocks.contains(mb)){
runningBlocks.add(mb);
}
}
}
## Instruction:
Call for all blocks to save
## Code After:
package space.gatt.magicaproject.managers;
import org.bukkit.Bukkit;
import space.gatt.magicaproject.MagicaMain;
import space.gatt.magicaproject.objects.MagicCrafter;
import space.gatt.magicaproject.objects.MagicaBlock;
import java.util.ArrayList;
import java.util.List;
public class BlockManager {
private List<MagicaBlock> runningBlocks = new ArrayList<>();
public BlockManager() {
Bukkit.getScheduler().runTaskTimer(MagicaMain.getMagicaMain(), ()->{
for (MagicaBlock mb : runningBlocks){
mb.runParticles();
}
}, 10, 10);
}
public void registerBlock(MagicaBlock mb){
if (!runningBlocks.contains(mb)){
runningBlocks.add(mb);
}
}
public void shutdown(){
for (MagicaBlock mb : runningBlocks){
if (mb instanceof Saveable){
((Saveable)mb).shutdownCall();
}
}
}
}
|
c3a05c1ac23a7120500ff9fb3f0e1d573c7c91d4
|
app/gem/actions.coffee
|
app/gem/actions.coffee
|
'use strict'
toggleGem = Reflux.createAction()
module.exports =
toggleGem: toggleGem
|
'use strict'
actions = Reflux.createActions [
'toggleGem'
]
module.exports = actions
|
Refactor using Reflux sugar functions
|
Refactor using Reflux sugar functions
Reflux has quite a few sugar functions that prevent coderz from writing down
useless boilerplate.
- On the actions side, one can simply specify an array of action names
- On the store side, one can listen to an array of actions and handle them
with CoC methods
Beautiful.
|
CoffeeScript
|
apache-2.0
|
IngloriousCoderz/reflux-proto,IngloriousCoderz/reflux-proto
|
coffeescript
|
## Code Before:
'use strict'
toggleGem = Reflux.createAction()
module.exports =
toggleGem: toggleGem
## Instruction:
Refactor using Reflux sugar functions
Reflux has quite a few sugar functions that prevent coderz from writing down
useless boilerplate.
- On the actions side, one can simply specify an array of action names
- On the store side, one can listen to an array of actions and handle them
with CoC methods
Beautiful.
## Code After:
'use strict'
actions = Reflux.createActions [
'toggleGem'
]
module.exports = actions
|
293af0e7172c87bec1ece10c2886ad03117fcdba
|
app/main/fonts.sass
|
app/main/fonts.sass
|
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700|Montserrat:300,500,600|Material+Icons|Lobster')
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css')
|
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700|Montserrat:300,500,600|Material+Icons|Lobster')
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css')
@font-face
font-family: Charis
font-style: normal
font-weight: bold
src: local('Charis'), url('https://arkis.io/home/fonts/charissil-b-webfont.woff2') format('woff2'), url('https://arkis.io/home/fonts/charissil-b-webfont.woff') format('woff'), url('https://arkis.io/home/fonts/CharisSIL-B.ttf') format('ttf')
|
Load Charis font for Arkis logo
|
Load Charis font for Arkis logo
|
Sass
|
mit
|
controversial/controversial.io,controversial/controversial.io,controversial/controversial.io
|
sass
|
## Code Before:
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700|Montserrat:300,500,600|Material+Icons|Lobster')
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css')
## Instruction:
Load Charis font for Arkis logo
## Code After:
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,600,700|Montserrat:300,500,600|Material+Icons|Lobster')
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css')
@font-face
font-family: Charis
font-style: normal
font-weight: bold
src: local('Charis'), url('https://arkis.io/home/fonts/charissil-b-webfont.woff2') format('woff2'), url('https://arkis.io/home/fonts/charissil-b-webfont.woff') format('woff'), url('https://arkis.io/home/fonts/CharisSIL-B.ttf') format('ttf')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.