commit stringlengths 40 40 | old_file stringlengths 4 184 | new_file stringlengths 4 184 | old_contents stringlengths 1 3.6k | new_contents stringlengths 5 3.38k | subject stringlengths 15 778 | message stringlengths 16 6.74k | lang stringclasses 201 values | license stringclasses 13 values | repos stringlengths 6 116k | config stringclasses 201 values | content stringlengths 137 7.24k | diff stringlengths 26 5.55k | diff_length int64 1 123 | relative_diff_length float64 0.01 89 | n_lines_added int64 0 108 | n_lines_deleted int64 0 106 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
830a868dad8344dab5567d859efd21581f2c3f1c | build/scripts/travis-deployment.sh | build/scripts/travis-deployment.sh | yarn build
SEMVER_LAST_TAG=$(npm view apparena-patterns-react version)
SEMVER_RELEASE_LEVEL=$(git log --oneline -1 --pretty=%B | cat | tr -d '\n' | cut -d "[" -f2 | cut -d "]" -f1)
ROOT_DIR=$(pwd)
case ${SEMVER_RELEASE_LEVEL} in
*\ *)
>&2 echo "Specified release level invalid"
;;
*)
if [ -n ${SEMVER_RELEASE_LEVEL} ]; then
case ${SEMVER_RELEASE_LEVEL} in
major|minor|patch)
cp ~/.npmrc ~/.npmrc.bak
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
git clone https://github.com/fsaintjacques/semver-tool /tmp/semver &> /dev/null
SEMVER_NEW_TAG=$(/tmp/semver/src/semver bump ${SEMVER_RELEASE_LEVEL} ${SEMVER_LAST_TAG})
npm --no-git-tag-version version ${SEMVER_NEW_TAG} --allow-same-version
cd build/apparena-patterns-react
npm publish
;;
*)
>&2 echo "Specified release level invalid"
;;
esac
else
>&2 echo "No release level specified"
fi
;;
esac
cd ${ROOT_DIR}
| yarn build
SEMVER_LAST_TAG=$(npm view apparena-patterns-react version)
SEMVER_RELEASE_LEVEL=$(git log --oneline -1 --pretty=%B | cat | tr -d '\n' | cut -d "[" -f2 | cut -d "]" -f1)
ROOT_DIR=$(pwd)
if [ -n $SEMVER_RELEASE_LEVEL ]; then
git clone https://github.com/fsaintjacques/semver-tool /tmp/semver &> /dev/null
SEMVER_NEW_TAG=$(/tmp/semver/src/semver bump $SEMVER_RELEASE_LEVEL $SEMVER_LAST_TAG)
npm --no-git-tag-version version ${SEMVER_NEW_TAG} --allow-same-version
cd build/apparena-patterns-react
npm publish
else
>&2 echo "No release level specified"
fi
cd ${ROOT_DIR}
| Check if the travis deplyoment script does work correctly | Check if the travis deplyoment script does work correctly
| Shell | mit | apparena/patterns,apparena/patterns,apparena/patterns,apparena/patterns | shell | ## Code Before:
yarn build
SEMVER_LAST_TAG=$(npm view apparena-patterns-react version)
SEMVER_RELEASE_LEVEL=$(git log --oneline -1 --pretty=%B | cat | tr -d '\n' | cut -d "[" -f2 | cut -d "]" -f1)
ROOT_DIR=$(pwd)
case ${SEMVER_RELEASE_LEVEL} in
*\ *)
>&2 echo "Specified release level invalid"
;;
*)
if [ -n ${SEMVER_RELEASE_LEVEL} ]; then
case ${SEMVER_RELEASE_LEVEL} in
major|minor|patch)
cp ~/.npmrc ~/.npmrc.bak
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
git clone https://github.com/fsaintjacques/semver-tool /tmp/semver &> /dev/null
SEMVER_NEW_TAG=$(/tmp/semver/src/semver bump ${SEMVER_RELEASE_LEVEL} ${SEMVER_LAST_TAG})
npm --no-git-tag-version version ${SEMVER_NEW_TAG} --allow-same-version
cd build/apparena-patterns-react
npm publish
;;
*)
>&2 echo "Specified release level invalid"
;;
esac
else
>&2 echo "No release level specified"
fi
;;
esac
cd ${ROOT_DIR}
## Instruction:
Check if the travis deplyoment script does work correctly
## Code After:
yarn build
SEMVER_LAST_TAG=$(npm view apparena-patterns-react version)
SEMVER_RELEASE_LEVEL=$(git log --oneline -1 --pretty=%B | cat | tr -d '\n' | cut -d "[" -f2 | cut -d "]" -f1)
ROOT_DIR=$(pwd)
if [ -n $SEMVER_RELEASE_LEVEL ]; then
git clone https://github.com/fsaintjacques/semver-tool /tmp/semver &> /dev/null
SEMVER_NEW_TAG=$(/tmp/semver/src/semver bump $SEMVER_RELEASE_LEVEL $SEMVER_LAST_TAG)
npm --no-git-tag-version version ${SEMVER_NEW_TAG} --allow-same-version
cd build/apparena-patterns-react
npm publish
else
>&2 echo "No release level specified"
fi
cd ${ROOT_DIR}
| yarn build
SEMVER_LAST_TAG=$(npm view apparena-patterns-react version)
SEMVER_RELEASE_LEVEL=$(git log --oneline -1 --pretty=%B | cat | tr -d '\n' | cut -d "[" -f2 | cut -d "]" -f1)
ROOT_DIR=$(pwd)
- case ${SEMVER_RELEASE_LEVEL} in
- *\ *)
- >&2 echo "Specified release level invalid"
- ;;
- *)
- if [ -n ${SEMVER_RELEASE_LEVEL} ]; then
? ---- - -
+ if [ -n $SEMVER_RELEASE_LEVEL ]; then
- case ${SEMVER_RELEASE_LEVEL} in
- major|minor|patch)
- cp ~/.npmrc ~/.npmrc.bak
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- git clone https://github.com/fsaintjacques/semver-tool /tmp/semver &> /dev/null
? --------
+ git clone https://github.com/fsaintjacques/semver-tool /tmp/semver &> /dev/null
- SEMVER_NEW_TAG=$(/tmp/semver/src/semver bump ${SEMVER_RELEASE_LEVEL} ${SEMVER_LAST_TAG})
? -------- - - - -
+ SEMVER_NEW_TAG=$(/tmp/semver/src/semver bump $SEMVER_RELEASE_LEVEL $SEMVER_LAST_TAG)
- npm --no-git-tag-version version ${SEMVER_NEW_TAG} --allow-same-version
? --------
+ npm --no-git-tag-version version ${SEMVER_NEW_TAG} --allow-same-version
- cd build/apparena-patterns-react
? --------
+ cd build/apparena-patterns-react
- npm publish
? --------
+ npm publish
+ else
- ;;
- *)
- >&2 echo "Specified release level invalid"
- ;;
- esac
- else
- >&2 echo "No release level specified"
? ----
+ >&2 echo "No release level specified"
+ fi
- fi
- ;;
- esac
cd ${ROOT_DIR} | 34 | 1.0625 | 9 | 25 |
a525bbb6936877c73edfd3c4df7f836aa5f794ac | .travis.yml | .travis.yml | language: objective-c
os: osx
matrix:
include:
- os: linux
script:
- bash -n *.sh
- ./script/setup
- export PS1
- bash -c "source ~/.bashrc"
- zsh -c "source ~/.zshrc"
| language: objective-c
os: osx
matrix:
include:
- os: linux
script:
- bash -n *.sh
- "./script/setup"
- export PS1
- bash -c "source ~/.bashrc"
- zsh -c "source ~/.zshrc"
notifications:
slack:
secure: RJJNNlayjRIistp6j55LVPQgkBGRrBD8M7+v2Z+HM8g3OcPnIP7XjkHN1ytkrzglqX4ztxvlS4WyumbhSVlreW+PSSWWwidVyq/SRAF2W+PKKVrqrHnTW7F+HTBa+/thsQ6vMHnvIyVDYjNmdYIKsnfCokdyfIsARThue8Sgqv/ZcNoaIzQSDXrBhb+a8PlD9Pz+Gh0VzPAe5xvwGMxa30Pc00BTrrbjBv2crnacAbg1G3Ae+ksJqDirRVRHpZrJ+WFzD4JJYk+e5UBpBkdQP6iOoUA2DpixIGImixYCZlSCDrN/qZEldqDEiSgxTC+gHaMecwPeCB6pof4Y6Nuev8Lssenh3TAtOlRJNp5kOR/yT1SZtwypOJCTHxH5/kbknm766JP+sf250yB4Wtc5UW0t3fEGl0vOOc7oY0Ltb4N/07Lvrjn4VjjgqVhTofWZRcT6JYrb1P2VoYMAp5uysnOoKz3dd9iHICwyK85opLTgUFU8NJfmoortgOTA3r3ZZ4xBFtYLjxlTSTRs4x2P+UvEcT1p3Cp3uESURULDbPND3kjb5crVdNrLHWbZ+agJWjPR7NNIM4bK3pJcSIqk1a3TAQmpoiR9Mvq9ToElM+vf4MmgGtfkdOuAN815fco1LdwSjIHUAHyXPRM3xvTGKVUAvu7zuoohOeK0Ou3ZxcM=
| Add slack integration for builds | Add slack integration for builds
| YAML | mit | mikesplain/dotfiles | yaml | ## Code Before:
language: objective-c
os: osx
matrix:
include:
- os: linux
script:
- bash -n *.sh
- ./script/setup
- export PS1
- bash -c "source ~/.bashrc"
- zsh -c "source ~/.zshrc"
## Instruction:
Add slack integration for builds
## Code After:
language: objective-c
os: osx
matrix:
include:
- os: linux
script:
- bash -n *.sh
- "./script/setup"
- export PS1
- bash -c "source ~/.bashrc"
- zsh -c "source ~/.zshrc"
notifications:
slack:
secure: RJJNNlayjRIistp6j55LVPQgkBGRrBD8M7+v2Z+HM8g3OcPnIP7XjkHN1ytkrzglqX4ztxvlS4WyumbhSVlreW+PSSWWwidVyq/SRAF2W+PKKVrqrHnTW7F+HTBa+/thsQ6vMHnvIyVDYjNmdYIKsnfCokdyfIsARThue8Sgqv/ZcNoaIzQSDXrBhb+a8PlD9Pz+Gh0VzPAe5xvwGMxa30Pc00BTrrbjBv2crnacAbg1G3Ae+ksJqDirRVRHpZrJ+WFzD4JJYk+e5UBpBkdQP6iOoUA2DpixIGImixYCZlSCDrN/qZEldqDEiSgxTC+gHaMecwPeCB6pof4Y6Nuev8Lssenh3TAtOlRJNp5kOR/yT1SZtwypOJCTHxH5/kbknm766JP+sf250yB4Wtc5UW0t3fEGl0vOOc7oY0Ltb4N/07Lvrjn4VjjgqVhTofWZRcT6JYrb1P2VoYMAp5uysnOoKz3dd9iHICwyK85opLTgUFU8NJfmoortgOTA3r3ZZ4xBFtYLjxlTSTRs4x2P+UvEcT1p3Cp3uESURULDbPND3kjb5crVdNrLHWbZ+agJWjPR7NNIM4bK3pJcSIqk1a3TAQmpoiR9Mvq9ToElM+vf4MmgGtfkdOuAN815fco1LdwSjIHUAHyXPRM3xvTGKVUAvu7zuoohOeK0Ou3ZxcM=
| language: objective-c
os: osx
matrix:
include:
- - os: linux
? --
+ - os: linux
-
script:
- - bash -n *.sh
? --
+ - bash -n *.sh
- - ./script/setup
? --
+ - "./script/setup"
? + +
- - export PS1
? --
+ - export PS1
- - bash -c "source ~/.bashrc"
? --
+ - bash -c "source ~/.bashrc"
- - zsh -c "source ~/.zshrc"
? --
+ - zsh -c "source ~/.zshrc"
+ notifications:
+ slack:
+ secure: RJJNNlayjRIistp6j55LVPQgkBGRrBD8M7+v2Z+HM8g3OcPnIP7XjkHN1ytkrzglqX4ztxvlS4WyumbhSVlreW+PSSWWwidVyq/SRAF2W+PKKVrqrHnTW7F+HTBa+/thsQ6vMHnvIyVDYjNmdYIKsnfCokdyfIsARThue8Sgqv/ZcNoaIzQSDXrBhb+a8PlD9Pz+Gh0VzPAe5xvwGMxa30Pc00BTrrbjBv2crnacAbg1G3Ae+ksJqDirRVRHpZrJ+WFzD4JJYk+e5UBpBkdQP6iOoUA2DpixIGImixYCZlSCDrN/qZEldqDEiSgxTC+gHaMecwPeCB6pof4Y6Nuev8Lssenh3TAtOlRJNp5kOR/yT1SZtwypOJCTHxH5/kbknm766JP+sf250yB4Wtc5UW0t3fEGl0vOOc7oY0Ltb4N/07Lvrjn4VjjgqVhTofWZRcT6JYrb1P2VoYMAp5uysnOoKz3dd9iHICwyK85opLTgUFU8NJfmoortgOTA3r3ZZ4xBFtYLjxlTSTRs4x2P+UvEcT1p3Cp3uESURULDbPND3kjb5crVdNrLHWbZ+agJWjPR7NNIM4bK3pJcSIqk1a3TAQmpoiR9Mvq9ToElM+vf4MmgGtfkdOuAN815fco1LdwSjIHUAHyXPRM3xvTGKVUAvu7zuoohOeK0Ou3ZxcM= | 16 | 1.333333 | 9 | 7 |
983baab20356c65d8cf57176d2f0ef5d6cf75220 | priv/ember_riak_explorer/app/templates/riak-object-edit.hbs | priv/ember_riak_explorer/app/templates/riak-object-edit.hbs | {{#object-location object=model.obj isEditing=true}}{{/object-location}}
<br />
<div class="container">
<div class="row">
<div class="col-md-12">
{{#object-headers headers=model.obj.headersIndexes
title='Secondary Indexes'}}{{/object-headers}}
</div>
</div>
<div class="row">
<div class="col-md-12">
{{#object-headers headers=model.obj.headersCustom
title='Custom Headers'}}{{/object-headers}}
</div>
</div>
</div>
<br />
<div class="container">
<h4>Contents</h4>
<div class="row">
<div class="col-md-12">
Content Type: <b>{{model.obj.contentType}}</b>
</div>
</div>
</div>
<br />
<div class="container">
{{textarea value=model.obj.contents rows=20 cols=100}}
</div>
<div class="container">
<button type="button" class="btn btn-md btn-primary"
{{action 'saveObject' model.obj}}>
Save</button>
</div>
{{#object-version object=model.obj}}{{/object-version}}
| {{#object-location object=model.obj isEditing=true}}{{/object-location}}
<br />
<div class="container">
<div class="row">
<div class="col-md-12">
{{#object-headers headers=model.obj.headersIndexes
title='Secondary Indexes'}}{{/object-headers}}
</div>
</div>
<div class="row">
<div class="col-md-12">
{{#object-headers headers=model.obj.headersCustom
title='Custom Headers'}}{{/object-headers}}
</div>
</div>
</div>
<br />
<div class="container">
<h4>Content</h4>
<div class="row">
<div class="col-md-12 form-group">
<label for='contentType'>Content Type:</label>
{{input value=model.obj.contentType id='contentType' class="form-control"}}
</div>
</div>
</div>
<br />
<div class="container">
{{textarea value=model.obj.contents autofocus=true rows=20 cols=100}}
</div>
<div class="container">
<button type="button" class="btn btn-md btn-primary"
{{action 'saveObject' model.obj}}>
Save</button>
</div>
{{#object-version object=model.obj}}{{/object-version}}
| Add edit content type field to Edit Object view (REX-36) | Add edit content type field to Edit Object view (REX-36)
| Handlebars | apache-2.0 | travisbhartwell/riak_explorer,travisbhartwell/riak_explorer,basho-labs/riak_explorer,basho-labs/riak_explorer,basho-labs/riak_explorer,travisbhartwell/riak_explorer | handlebars | ## Code Before:
{{#object-location object=model.obj isEditing=true}}{{/object-location}}
<br />
<div class="container">
<div class="row">
<div class="col-md-12">
{{#object-headers headers=model.obj.headersIndexes
title='Secondary Indexes'}}{{/object-headers}}
</div>
</div>
<div class="row">
<div class="col-md-12">
{{#object-headers headers=model.obj.headersCustom
title='Custom Headers'}}{{/object-headers}}
</div>
</div>
</div>
<br />
<div class="container">
<h4>Contents</h4>
<div class="row">
<div class="col-md-12">
Content Type: <b>{{model.obj.contentType}}</b>
</div>
</div>
</div>
<br />
<div class="container">
{{textarea value=model.obj.contents rows=20 cols=100}}
</div>
<div class="container">
<button type="button" class="btn btn-md btn-primary"
{{action 'saveObject' model.obj}}>
Save</button>
</div>
{{#object-version object=model.obj}}{{/object-version}}
## Instruction:
Add edit content type field to Edit Object view (REX-36)
## Code After:
{{#object-location object=model.obj isEditing=true}}{{/object-location}}
<br />
<div class="container">
<div class="row">
<div class="col-md-12">
{{#object-headers headers=model.obj.headersIndexes
title='Secondary Indexes'}}{{/object-headers}}
</div>
</div>
<div class="row">
<div class="col-md-12">
{{#object-headers headers=model.obj.headersCustom
title='Custom Headers'}}{{/object-headers}}
</div>
</div>
</div>
<br />
<div class="container">
<h4>Content</h4>
<div class="row">
<div class="col-md-12 form-group">
<label for='contentType'>Content Type:</label>
{{input value=model.obj.contentType id='contentType' class="form-control"}}
</div>
</div>
</div>
<br />
<div class="container">
{{textarea value=model.obj.contents autofocus=true rows=20 cols=100}}
</div>
<div class="container">
<button type="button" class="btn btn-md btn-primary"
{{action 'saveObject' model.obj}}>
Save</button>
</div>
{{#object-version object=model.obj}}{{/object-version}}
| {{#object-location object=model.obj isEditing=true}}{{/object-location}}
<br />
<div class="container">
<div class="row">
<div class="col-md-12">
{{#object-headers headers=model.obj.headersIndexes
title='Secondary Indexes'}}{{/object-headers}}
</div>
</div>
<div class="row">
<div class="col-md-12">
{{#object-headers headers=model.obj.headersCustom
title='Custom Headers'}}{{/object-headers}}
</div>
</div>
</div>
<br />
<div class="container">
- <h4>Contents</h4>
? -
+ <h4>Content</h4>
<div class="row">
- <div class="col-md-12">
+ <div class="col-md-12 form-group">
? +++++++++++
- Content Type: <b>{{model.obj.contentType}}</b>
+ <label for='contentType'>Content Type:</label>
+ {{input value=model.obj.contentType id='contentType' class="form-control"}}
+
</div>
</div>
</div>
<br />
<div class="container">
- {{textarea value=model.obj.contents rows=20 cols=100}}
+ {{textarea value=model.obj.contents autofocus=true rows=20 cols=100}}
? +++++++++++++++
</div>
<div class="container">
<button type="button" class="btn btn-md btn-primary"
{{action 'saveObject' model.obj}}>
Save</button>
</div>
{{#object-version object=model.obj}}{{/object-version}} | 10 | 0.25641 | 6 | 4 |
f06abc7601e382bdefc514abde8527b788795ce4 | .travis.yml | .travis.yml | rvm:
- 2.2.2
cache: bundler
addons:
code_climate:
repo_token: 1f9743a554140a590819de5967c4411398a22e31f2d5d439127cdbf33c72a6ab
| rvm:
- 2.2.2
cache: bundler
before_script:
- if [ "${$TRAVIS_OS_NAME}" = "linux" ]; then
wget https://github.com/mozilla/geckodriver/releases/geckodriver-v0.11.1-linux64.tar.gz -O /tmp/geckodriver.tar.gz;
fi
- if [ "${$TRAVIS_OS_NAME}" = "osx" ]; then
wget https://github.com/mozilla/geckodriver/releases/geckodriver-v0.11.1-macos.tar.gz -O /tmp/geckodriver.tar.gz;
fi
- tar -xzvf /tmp/geckodriver.tar.gz
- export PATH=$PATH:$PWD
addons:
code_climate:
repo_token: 1f9743a554140a590819de5967c4411398a22e31f2d5d439127cdbf33c72a6ab
| Add geckodriver to Travis yml. Nathan Pannell | Add geckodriver to Travis yml. Nathan Pannell | YAML | mit | CommunityGrows/communitygrows,CommunityGrows/communitygrows,hsp1324/communitygrows,CommunityGrows/communitygrows,hsp1324/communitygrows,hsp1324/communitygrows | yaml | ## Code Before:
rvm:
- 2.2.2
cache: bundler
addons:
code_climate:
repo_token: 1f9743a554140a590819de5967c4411398a22e31f2d5d439127cdbf33c72a6ab
## Instruction:
Add geckodriver to Travis yml. Nathan Pannell
## Code After:
rvm:
- 2.2.2
cache: bundler
before_script:
- if [ "${$TRAVIS_OS_NAME}" = "linux" ]; then
wget https://github.com/mozilla/geckodriver/releases/geckodriver-v0.11.1-linux64.tar.gz -O /tmp/geckodriver.tar.gz;
fi
- if [ "${$TRAVIS_OS_NAME}" = "osx" ]; then
wget https://github.com/mozilla/geckodriver/releases/geckodriver-v0.11.1-macos.tar.gz -O /tmp/geckodriver.tar.gz;
fi
- tar -xzvf /tmp/geckodriver.tar.gz
- export PATH=$PATH:$PWD
addons:
code_climate:
repo_token: 1f9743a554140a590819de5967c4411398a22e31f2d5d439127cdbf33c72a6ab
| rvm:
- 2.2.2
cache: bundler
+
+ before_script:
+ - if [ "${$TRAVIS_OS_NAME}" = "linux" ]; then
+ wget https://github.com/mozilla/geckodriver/releases/geckodriver-v0.11.1-linux64.tar.gz -O /tmp/geckodriver.tar.gz;
+ fi
+ - if [ "${$TRAVIS_OS_NAME}" = "osx" ]; then
+ wget https://github.com/mozilla/geckodriver/releases/geckodriver-v0.11.1-macos.tar.gz -O /tmp/geckodriver.tar.gz;
+ fi
+ - tar -xzvf /tmp/geckodriver.tar.gz
+ - export PATH=$PATH:$PWD
+
addons:
code_climate:
repo_token: 1f9743a554140a590819de5967c4411398a22e31f2d5d439127cdbf33c72a6ab | 11 | 1.571429 | 11 | 0 |
9b7c163508aa84b6a284a2b853c05ad4e2cbe08e | Manifest.txt | Manifest.txt | .autotest
History.txt
LICENSE.txt
Manifest.txt
README.txt
Rakefile
lib/rulog.rb
test/test_rulog.rb
| .autotest
History.txt
LICENSE.txt
Manifest.txt
README.txt
README.rdoc
Rakefile
lib/rulog.rb
test/test_rulog.rb
| Update for rdoc/txt README hack, to placate both Hoe and github. | Update for rdoc/txt README hack, to placate both Hoe and github.
| Text | bsd-2-clause | jimwise/rulog | text | ## Code Before:
.autotest
History.txt
LICENSE.txt
Manifest.txt
README.txt
Rakefile
lib/rulog.rb
test/test_rulog.rb
## Instruction:
Update for rdoc/txt README hack, to placate both Hoe and github.
## Code After:
.autotest
History.txt
LICENSE.txt
Manifest.txt
README.txt
README.rdoc
Rakefile
lib/rulog.rb
test/test_rulog.rb
| .autotest
History.txt
LICENSE.txt
Manifest.txt
README.txt
+ README.rdoc
Rakefile
lib/rulog.rb
test/test_rulog.rb | 1 | 0.125 | 1 | 0 |
7ebf9fb55a1bfeab9d052b0c1f269a467d98768c | vim/install_vim.sh | vim/install_vim.sh |
set -o errexit
set -o nounset
parentdir=$(cd $(dirname "$0")/..; pwd)
echo "== VIM configuration"
echo "=== The vim you have is the following: "
vim --version | head -1
echo "=== Installing vim configuration (vimrc and vim folder from $parentdir)"
ln -sf $parentdir/vimrc ~/.vimrc
ln -sf $parentdir/vim ~/.vim
echo "=== Installing vim plugins (using neobundle)"
vim +NeoBundleInstall +qall
|
set -o errexit
set -o nounset
parentdir=$(cd $(dirname "$0")/..; pwd)
echo "== VIM configuration"
echo "=== The vim you have is the following: "
vim --version | head -1
echo "=== Installing vim configuration (vimrc and vim folder from $parentdir)"
mv ~/.vimrc ~/.vim /tmp/
ln -s $parentdir/vimrc ~/.vimrc
ln -s $parentdir/vim ~/.vim
echo "=== Installing vim plugins (using neobundle)"
vim +NeoBundleInstall +qall
| Install vim removes old vim and vimrc | Install vim removes old vim and vimrc
| Shell | mit | labianchin/dotfiles,labianchin/dotfiles,labianchin/dotfiles | shell | ## Code Before:
set -o errexit
set -o nounset
parentdir=$(cd $(dirname "$0")/..; pwd)
echo "== VIM configuration"
echo "=== The vim you have is the following: "
vim --version | head -1
echo "=== Installing vim configuration (vimrc and vim folder from $parentdir)"
ln -sf $parentdir/vimrc ~/.vimrc
ln -sf $parentdir/vim ~/.vim
echo "=== Installing vim plugins (using neobundle)"
vim +NeoBundleInstall +qall
## Instruction:
Install vim removes old vim and vimrc
## Code After:
set -o errexit
set -o nounset
parentdir=$(cd $(dirname "$0")/..; pwd)
echo "== VIM configuration"
echo "=== The vim you have is the following: "
vim --version | head -1
echo "=== Installing vim configuration (vimrc and vim folder from $parentdir)"
mv ~/.vimrc ~/.vim /tmp/
ln -s $parentdir/vimrc ~/.vimrc
ln -s $parentdir/vim ~/.vim
echo "=== Installing vim plugins (using neobundle)"
vim +NeoBundleInstall +qall
|
set -o errexit
set -o nounset
parentdir=$(cd $(dirname "$0")/..; pwd)
echo "== VIM configuration"
echo "=== The vim you have is the following: "
vim --version | head -1
echo "=== Installing vim configuration (vimrc and vim folder from $parentdir)"
+ mv ~/.vimrc ~/.vim /tmp/
- ln -sf $parentdir/vimrc ~/.vimrc
? -
+ ln -s $parentdir/vimrc ~/.vimrc
- ln -sf $parentdir/vim ~/.vim
? -
+ ln -s $parentdir/vim ~/.vim
echo "=== Installing vim plugins (using neobundle)"
vim +NeoBundleInstall +qall | 5 | 0.3125 | 3 | 2 |
d0882c4726583a3735968c7a497bd3b8dc63e1d6 | src/main/java/org/crygier/graphql/JavaScalars.java | src/main/java/org/crygier/graphql/JavaScalars.java | package org.crygier.graphql;
import java.math.BigInteger;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import graphql.language.IntValue;
import graphql.language.StringValue;
import graphql.schema.Coercing;
import graphql.schema.GraphQLScalarType;
public class JavaScalars {
public static GraphQLScalarType GraphQLDate = new GraphQLScalarType("Date", "Date type", new Coercing() {
@Override
public Object serialize(Object input) {
if (input instanceof String) {
try {
return DateFormat.getInstance().parse((String)input);
} catch (ParseException e) {
throw new IllegalArgumentException(e.getMessage());
}
} else if (input instanceof Date) {
return input;
} else if (input instanceof Long) {
return new Date(((Long) input));
} else if (input instanceof Integer) {
return new Date(((Integer) input).longValue());
} else {
return null;
}
}
@Override
public Object parseValue(Object input) {
return serialize(input);
}
@Override
public Object parseLiteral(Object input) {
if (input instanceof StringValue) {
try {
return DateFormat.getInstance().parse(((StringValue) input).getValue());
} catch (ParseException e) {
throw new IllegalArgumentException(e.getMessage());
}
} else if (input instanceof IntValue) {
BigInteger value = ((IntValue) input).getValue();
return new Date(value.longValue());
}
return null;
}
});
}
| package org.crygier.graphql;
import java.math.BigInteger;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import graphql.language.IntValue;
import graphql.language.StringValue;
import graphql.schema.Coercing;
import graphql.schema.GraphQLScalarType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JavaScalars {
static final Logger log = LoggerFactory.getLogger(JavaScalars.class);
public static GraphQLScalarType GraphQLDate = new GraphQLScalarType("Date", "Date type", new Coercing() {
@Override
public Object serialize(Object input) {
if (input instanceof String) {
return parseStringToDate((String) input);
} else if (input instanceof Date) {
return input;
} else if (input instanceof Long) {
return new Date(((Long) input).longValue());
} else if (input instanceof Integer) {
return new Date(((Integer) input).longValue());
}
return null;
}
@Override
public Object parseValue(Object input) {
return serialize(input);
}
@Override
public Object parseLiteral(Object input) {
if (input instanceof StringValue) {
return parseStringToDate(((StringValue) input).getValue());
} else if (input instanceof IntValue) {
BigInteger value = ((IntValue) input).getValue();
return new Date(value.longValue());
}
return null;
}
private Date parseStringToDate(String input) {
try {
return DateFormat.getInstance().parse(input);
} catch (ParseException e) {
log.warn("Failed to parse Date from input: " + input, e);
return null;
}
}
});
}
| Return null on parse errors as per specification; Do not throw Exception | Return null on parse errors as per specification; Do not throw Exception | Java | mit | stomf/graphql-jpa,jcrygier/graphql-jpa,jcrygier/graphql-jpa,stomf/graphql-jpa | java | ## Code Before:
package org.crygier.graphql;
import java.math.BigInteger;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import graphql.language.IntValue;
import graphql.language.StringValue;
import graphql.schema.Coercing;
import graphql.schema.GraphQLScalarType;
public class JavaScalars {
public static GraphQLScalarType GraphQLDate = new GraphQLScalarType("Date", "Date type", new Coercing() {
@Override
public Object serialize(Object input) {
if (input instanceof String) {
try {
return DateFormat.getInstance().parse((String)input);
} catch (ParseException e) {
throw new IllegalArgumentException(e.getMessage());
}
} else if (input instanceof Date) {
return input;
} else if (input instanceof Long) {
return new Date(((Long) input));
} else if (input instanceof Integer) {
return new Date(((Integer) input).longValue());
} else {
return null;
}
}
@Override
public Object parseValue(Object input) {
return serialize(input);
}
@Override
public Object parseLiteral(Object input) {
if (input instanceof StringValue) {
try {
return DateFormat.getInstance().parse(((StringValue) input).getValue());
} catch (ParseException e) {
throw new IllegalArgumentException(e.getMessage());
}
} else if (input instanceof IntValue) {
BigInteger value = ((IntValue) input).getValue();
return new Date(value.longValue());
}
return null;
}
});
}
## Instruction:
Return null on parse errors as per specification; Do not throw Exception
## Code After:
package org.crygier.graphql;
import java.math.BigInteger;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import graphql.language.IntValue;
import graphql.language.StringValue;
import graphql.schema.Coercing;
import graphql.schema.GraphQLScalarType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class JavaScalars {
static final Logger log = LoggerFactory.getLogger(JavaScalars.class);
public static GraphQLScalarType GraphQLDate = new GraphQLScalarType("Date", "Date type", new Coercing() {
@Override
public Object serialize(Object input) {
if (input instanceof String) {
return parseStringToDate((String) input);
} else if (input instanceof Date) {
return input;
} else if (input instanceof Long) {
return new Date(((Long) input).longValue());
} else if (input instanceof Integer) {
return new Date(((Integer) input).longValue());
}
return null;
}
@Override
public Object parseValue(Object input) {
return serialize(input);
}
@Override
public Object parseLiteral(Object input) {
if (input instanceof StringValue) {
return parseStringToDate(((StringValue) input).getValue());
} else if (input instanceof IntValue) {
BigInteger value = ((IntValue) input).getValue();
return new Date(value.longValue());
}
return null;
}
private Date parseStringToDate(String input) {
try {
return DateFormat.getInstance().parse(input);
} catch (ParseException e) {
log.warn("Failed to parse Date from input: " + input, e);
return null;
}
}
});
}
| package org.crygier.graphql;
import java.math.BigInteger;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.Date;
import graphql.language.IntValue;
import graphql.language.StringValue;
import graphql.schema.Coercing;
import graphql.schema.GraphQLScalarType;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
public class JavaScalars {
+ static final Logger log = LoggerFactory.getLogger(JavaScalars.class);
+
public static GraphQLScalarType GraphQLDate = new GraphQLScalarType("Date", "Date type", new Coercing() {
@Override
public Object serialize(Object input) {
if (input instanceof String) {
+ return parseStringToDate((String) input);
- try {
- return DateFormat.getInstance().parse((String)input);
- } catch (ParseException e) {
- throw new IllegalArgumentException(e.getMessage());
- }
} else if (input instanceof Date) {
return input;
} else if (input instanceof Long) {
- return new Date(((Long) input));
+ return new Date(((Long) input).longValue());
? ++++++++++++
} else if (input instanceof Integer) {
return new Date(((Integer) input).longValue());
- } else {
- return null;
}
+ return null;
}
@Override
public Object parseValue(Object input) {
return serialize(input);
}
@Override
public Object parseLiteral(Object input) {
if (input instanceof StringValue) {
- try {
- return DateFormat.getInstance().parse(((StringValue) input).getValue());
? ---- -------------------------
+ return parseStringToDate(((StringValue) input).getValue());
? ++++++++++++
- } catch (ParseException e) {
- throw new IllegalArgumentException(e.getMessage());
- }
} else if (input instanceof IntValue) {
BigInteger value = ((IntValue) input).getValue();
return new Date(value.longValue());
}
return null;
}
+
+ private Date parseStringToDate(String input) {
+ try {
+ return DateFormat.getInstance().parse(input);
+ } catch (ParseException e) {
+ log.warn("Failed to parse Date from input: " + input, e);
+ return null;
+ }
+ }
});
} | 30 | 0.555556 | 17 | 13 |
398c4daaa75e0b60f4a7cc5f8b9d12c540b37113 | app/js/collections/search.js | app/js/collections/search.js |
define([
'jquery',
'underscore',
'backbone',
'helpers/app'
], function ($, _, Backbone, AppHelper) {
var Search = Backbone.Collection.extend ({
query: '',
url: function () {
return AppHelper.urlPrefix + 'autocomplete/query?q=' +
escape (this.query);
},
parse: function (resp) {
var data = [];
_.each (resp.Titles, function (title) {
data.push ({'title': title});
});
_.each (resp.Nicks, function (title) {
data.push ({'title': '@' + title});
});
return data;
},
fetch: function (options) {
options = options || {};
options.headers = {
'X-Requested-With': 'XMLHttpRequest'
};
return Backbone.Collection.prototype.fetch.call (this, options);
}
});
return Search;
});
|
define([
'jquery',
'underscore',
'backbone',
'helpers/app'
], function ($, _, Backbone, AppHelper) {
var Search = Backbone.Collection.extend ({
query: '',
url: function () {
return AppHelper.urlPrefix + 'autocomplete/query?q=' +
escape (this.query);
},
parse: function (resp) {
var data = [];
_.each (resp.Titles, function (title) {
data.push ({'title': title});
});
_.each (resp.Nicks, function (title) {
data.push ({'title': '@' + title});
});
return data;
},
fetch: function (options) {
options = options || {};
if (AppHelper.isExtension)
options.headers = {
'X-Requested-With': 'XMLHttpRequest'
};
return Backbone.Collection.prototype.fetch.call (this, options);
}
});
return Search;
});
| Send X-Requested-With header if app is extension | Send X-Requested-With header if app is extension
| JavaScript | mit | onuraslan/EksiOkuyucu,onur/EksiOkuyucu,onur/EksiOkuyucu,onuraslan/EksiOkuyucu | javascript | ## Code Before:
define([
'jquery',
'underscore',
'backbone',
'helpers/app'
], function ($, _, Backbone, AppHelper) {
var Search = Backbone.Collection.extend ({
query: '',
url: function () {
return AppHelper.urlPrefix + 'autocomplete/query?q=' +
escape (this.query);
},
parse: function (resp) {
var data = [];
_.each (resp.Titles, function (title) {
data.push ({'title': title});
});
_.each (resp.Nicks, function (title) {
data.push ({'title': '@' + title});
});
return data;
},
fetch: function (options) {
options = options || {};
options.headers = {
'X-Requested-With': 'XMLHttpRequest'
};
return Backbone.Collection.prototype.fetch.call (this, options);
}
});
return Search;
});
## Instruction:
Send X-Requested-With header if app is extension
## Code After:
define([
'jquery',
'underscore',
'backbone',
'helpers/app'
], function ($, _, Backbone, AppHelper) {
var Search = Backbone.Collection.extend ({
query: '',
url: function () {
return AppHelper.urlPrefix + 'autocomplete/query?q=' +
escape (this.query);
},
parse: function (resp) {
var data = [];
_.each (resp.Titles, function (title) {
data.push ({'title': title});
});
_.each (resp.Nicks, function (title) {
data.push ({'title': '@' + title});
});
return data;
},
fetch: function (options) {
options = options || {};
if (AppHelper.isExtension)
options.headers = {
'X-Requested-With': 'XMLHttpRequest'
};
return Backbone.Collection.prototype.fetch.call (this, options);
}
});
return Search;
});
|
define([
'jquery',
'underscore',
'backbone',
'helpers/app'
], function ($, _, Backbone, AppHelper) {
var Search = Backbone.Collection.extend ({
query: '',
url: function () {
return AppHelper.urlPrefix + 'autocomplete/query?q=' +
escape (this.query);
},
parse: function (resp) {
var data = [];
_.each (resp.Titles, function (title) {
data.push ({'title': title});
});
_.each (resp.Nicks, function (title) {
data.push ({'title': '@' + title});
});
return data;
},
fetch: function (options) {
options = options || {};
+ if (AppHelper.isExtension)
- options.headers = {
+ options.headers = {
? ++
- 'X-Requested-With': 'XMLHttpRequest'
+ 'X-Requested-With': 'XMLHttpRequest'
? ++
- };
+ };
? ++
return Backbone.Collection.prototype.fetch.call (this, options);
}
});
return Search;
}); | 7 | 0.162791 | 4 | 3 |
c94b93e87e1364fab1f232995d3d8b2ebb64b241 | index.js | index.js | var data = require('./data');
var accounting = require('accounting');
var CurrencyFormatter = function() {
this.defaultCurrency = {
symbol: '',
thousandsSeparator: ',',
decimalSeparator: '.',
symbolOnLeft: true,
spaceBetweenAmountAndSymbol: false,
decimalDigits: 2
}
}
CurrencyFormatter.prototype.format = function (value, options) {
var currency = data.find(c => c.code === options.code) || this.defaultCurrency;
var symbolOnLeft = currency.symbolOnLeft;
var spaceBetweenAmountAndSymbol = currency.spaceBetweenAmountAndSymbol;
var format = "";
if (symbolOnLeft) {
format = spaceBetweenAmountAndSymbol
? "%s %v"
: "%s%v"
} else {
format = spaceBetweenAmountAndSymbol
? "%v %s"
: "%v%s"
}
return accounting.formatMoney(value, {
symbol: options.symbol || currency.symbol,
decimal: options.decimal || currency.decimalSeparator,
thousand: options.thousand || currency.thousandsSeparator,
precision: options.precision || currency.decimalDigits,
format: options.format || format
})
}
CurrencyFormatter.prototype.findCurrency = function (currencyCode) {
return data.find(c => c.code === currencyCode);
}
module.exports = new CurrencyFormatter();
| var data = require('./data');
var accounting = require('accounting');
var CurrencyFormatter = function() {
this.defaultCurrency = {
symbol: '',
thousandsSeparator: ',',
decimalSeparator: '.',
symbolOnLeft: true,
spaceBetweenAmountAndSymbol: false,
decimalDigits: 2
}
}
CurrencyFormatter.prototype.format = function (value, options) {
var currency = data.find(function(c) { return c.code === options.code; }) || this.defaultCurrency;
var symbolOnLeft = currency.symbolOnLeft;
var spaceBetweenAmountAndSymbol = currency.spaceBetweenAmountAndSymbol;
var format = "";
if (symbolOnLeft) {
format = spaceBetweenAmountAndSymbol
? "%s %v"
: "%s%v"
} else {
format = spaceBetweenAmountAndSymbol
? "%v %s"
: "%v%s"
}
return accounting.formatMoney(value, {
symbol: options.symbol || currency.symbol,
decimal: options.decimal || currency.decimalSeparator,
thousand: options.thousand || currency.thousandsSeparator,
precision: options.precision || currency.decimalDigits,
format: options.format || format
})
}
CurrencyFormatter.prototype.findCurrency = function (currencyCode) {
return data.find(function(c) { return c.code === currencyCode; });
}
module.exports = new CurrencyFormatter();
| Use ES5 functions instead of arrow functions | Use ES5 functions instead of arrow functions | JavaScript | mit | smirzaei/currency-formatter,enVolt/currency-formatter | javascript | ## Code Before:
var data = require('./data');
var accounting = require('accounting');
var CurrencyFormatter = function() {
this.defaultCurrency = {
symbol: '',
thousandsSeparator: ',',
decimalSeparator: '.',
symbolOnLeft: true,
spaceBetweenAmountAndSymbol: false,
decimalDigits: 2
}
}
CurrencyFormatter.prototype.format = function (value, options) {
var currency = data.find(c => c.code === options.code) || this.defaultCurrency;
var symbolOnLeft = currency.symbolOnLeft;
var spaceBetweenAmountAndSymbol = currency.spaceBetweenAmountAndSymbol;
var format = "";
if (symbolOnLeft) {
format = spaceBetweenAmountAndSymbol
? "%s %v"
: "%s%v"
} else {
format = spaceBetweenAmountAndSymbol
? "%v %s"
: "%v%s"
}
return accounting.formatMoney(value, {
symbol: options.symbol || currency.symbol,
decimal: options.decimal || currency.decimalSeparator,
thousand: options.thousand || currency.thousandsSeparator,
precision: options.precision || currency.decimalDigits,
format: options.format || format
})
}
CurrencyFormatter.prototype.findCurrency = function (currencyCode) {
return data.find(c => c.code === currencyCode);
}
module.exports = new CurrencyFormatter();
## Instruction:
Use ES5 functions instead of arrow functions
## Code After:
var data = require('./data');
var accounting = require('accounting');
var CurrencyFormatter = function() {
this.defaultCurrency = {
symbol: '',
thousandsSeparator: ',',
decimalSeparator: '.',
symbolOnLeft: true,
spaceBetweenAmountAndSymbol: false,
decimalDigits: 2
}
}
CurrencyFormatter.prototype.format = function (value, options) {
var currency = data.find(function(c) { return c.code === options.code; }) || this.defaultCurrency;
var symbolOnLeft = currency.symbolOnLeft;
var spaceBetweenAmountAndSymbol = currency.spaceBetweenAmountAndSymbol;
var format = "";
if (symbolOnLeft) {
format = spaceBetweenAmountAndSymbol
? "%s %v"
: "%s%v"
} else {
format = spaceBetweenAmountAndSymbol
? "%v %s"
: "%v%s"
}
return accounting.formatMoney(value, {
symbol: options.symbol || currency.symbol,
decimal: options.decimal || currency.decimalSeparator,
thousand: options.thousand || currency.thousandsSeparator,
precision: options.precision || currency.decimalDigits,
format: options.format || format
})
}
CurrencyFormatter.prototype.findCurrency = function (currencyCode) {
return data.find(function(c) { return c.code === currencyCode; });
}
module.exports = new CurrencyFormatter();
| var data = require('./data');
var accounting = require('accounting');
var CurrencyFormatter = function() {
this.defaultCurrency = {
symbol: '',
thousandsSeparator: ',',
decimalSeparator: '.',
symbolOnLeft: true,
spaceBetweenAmountAndSymbol: false,
decimalDigits: 2
}
}
CurrencyFormatter.prototype.format = function (value, options) {
- var currency = data.find(c => c.code === options.code) || this.defaultCurrency;
? ^^
+ var currency = data.find(function(c) { return c.code === options.code; }) || this.defaultCurrency;
? +++ +++++++ ^^^^^^^^ +++
var symbolOnLeft = currency.symbolOnLeft;
var spaceBetweenAmountAndSymbol = currency.spaceBetweenAmountAndSymbol;
var format = "";
if (symbolOnLeft) {
format = spaceBetweenAmountAndSymbol
? "%s %v"
: "%s%v"
} else {
format = spaceBetweenAmountAndSymbol
? "%v %s"
: "%v%s"
}
return accounting.formatMoney(value, {
symbol: options.symbol || currency.symbol,
decimal: options.decimal || currency.decimalSeparator,
thousand: options.thousand || currency.thousandsSeparator,
precision: options.precision || currency.decimalDigits,
format: options.format || format
})
}
CurrencyFormatter.prototype.findCurrency = function (currencyCode) {
- return data.find(c => c.code === currencyCode);
? ^^
+ return data.find(function(c) { return c.code === currencyCode; });
? +++ +++++++ ^^^^^^^^ +++
}
module.exports = new CurrencyFormatter(); | 4 | 0.088889 | 2 | 2 |
8d26d88215075739ef5d2059ee8512dde2e67b5b | provisioning/roles/discourse/tasks/main.yml | provisioning/roles/discourse/tasks/main.yml | ---
- name: Ensure git is installed
apt: pkg=git
- name: Ensure that /var/docker exists
file: path=/var/docker owner=deploy group=deploy state=directory
- name: Get the official discourse docker image
command: git clone https://github.com/discourse/discourse_docker.git /var/docker creates=/var/docker/README.md
- name: Copy over app configuration
template: src=app.yml dest=/var/docker/containers/app.yml owner=deploy group=deploy
- name: Bootstrap discourse app
command: ./launcher bootstrap app chdir=/var/docker creates=/var/docker/shared/standalone/log/rails/production.log
- name: Start discourse app
command: ./launcher start app chdir=/var/docker
- name: Generate the nginx config for the app
template: src=discourse.morph.io dest=/etc/nginx/sites-available/ owner=root group=root mode=644
notify: restart nginx
- name: Make the nginx site active
command: ln -s /etc/nginx/sites-available/discourse.morph.io /etc/nginx/sites-enabled/discourse.morph.io creates=/etc/nginx/sites-enabled/discourse.morph.io
notify: restart nginx
| ---
- name: Ensure git is installed
apt: pkg=git
- name: Ensure that /var/docker exists
file: path=/var/docker owner=deploy group=deploy state=directory
- name: Get the official discourse docker image
command: git clone https://github.com/discourse/discourse_docker.git /var/docker creates=/var/docker/README.md
- name: Copy over app configuration
template: src=app.yml dest=/var/docker/containers/app.yml owner=deploy group=deploy
# launcher bootstrap needs a key pair at /home/vagrant/.ssh/id_rsa otherwise it waits
- name: Ensure vagrant .ssh directory exists
file: path=/home/vagrant/.ssh owner=vagrant group=vagrant state=directory
- name: Generate vagrant keypair
command: ssh-keygen -f /home/vagrant/.ssh/id_rsa -t rsa -N '' creates=/home/vagrant/.ssh/id_rsa
- name: Ensure private key has correct permissions and ownership
file: path=/home/vagrant/.ssh/id_rsa owner=vagrant group=vagrant
- name: Ensure public key has correct permissions and ownership
file: path=/home/vagrant/.ssh/id_rsa.pub owner=vagrant group=vagrant
- name: Bootstrap discourse app
command: ./launcher bootstrap app chdir=/var/docker creates=/var/docker/shared/standalone/log/rails/production.log
- name: Start discourse app
command: ./launcher start app chdir=/var/docker
- name: Generate the nginx config for the app
template: src=discourse.morph.io dest=/etc/nginx/sites-available/ owner=root group=root mode=644
notify: restart nginx
- name: Make the nginx site active
command: ln -s /etc/nginx/sites-available/discourse.morph.io /etc/nginx/sites-enabled/discourse.morph.io creates=/etc/nginx/sites-enabled/discourse.morph.io
notify: restart nginx
| Install ssh keypair so discourse bootstrap works unaided | Install ssh keypair so discourse bootstrap works unaided
| YAML | agpl-3.0 | openaustralia/morph,otherchirps/morph,OpenAddressesUK/morph,openaustralia/morph,openaustralia/morph,otherchirps/morph,openaustralia/morph,otherchirps/morph,OpenAddressesUK/morph,openaustralia/morph,otherchirps/morph,openaustralia/morph,OpenAddressesUK/morph,OpenAddressesUK/morph,openaustralia/morph,otherchirps/morph,otherchirps/morph,otherchirps/morph | yaml | ## Code Before:
---
- name: Ensure git is installed
apt: pkg=git
- name: Ensure that /var/docker exists
file: path=/var/docker owner=deploy group=deploy state=directory
- name: Get the official discourse docker image
command: git clone https://github.com/discourse/discourse_docker.git /var/docker creates=/var/docker/README.md
- name: Copy over app configuration
template: src=app.yml dest=/var/docker/containers/app.yml owner=deploy group=deploy
- name: Bootstrap discourse app
command: ./launcher bootstrap app chdir=/var/docker creates=/var/docker/shared/standalone/log/rails/production.log
- name: Start discourse app
command: ./launcher start app chdir=/var/docker
- name: Generate the nginx config for the app
template: src=discourse.morph.io dest=/etc/nginx/sites-available/ owner=root group=root mode=644
notify: restart nginx
- name: Make the nginx site active
command: ln -s /etc/nginx/sites-available/discourse.morph.io /etc/nginx/sites-enabled/discourse.morph.io creates=/etc/nginx/sites-enabled/discourse.morph.io
notify: restart nginx
## Instruction:
Install ssh keypair so discourse bootstrap works unaided
## Code After:
---
- name: Ensure git is installed
apt: pkg=git
- name: Ensure that /var/docker exists
file: path=/var/docker owner=deploy group=deploy state=directory
- name: Get the official discourse docker image
command: git clone https://github.com/discourse/discourse_docker.git /var/docker creates=/var/docker/README.md
- name: Copy over app configuration
template: src=app.yml dest=/var/docker/containers/app.yml owner=deploy group=deploy
# launcher bootstrap needs a key pair at /home/vagrant/.ssh/id_rsa otherwise it waits
- name: Ensure vagrant .ssh directory exists
file: path=/home/vagrant/.ssh owner=vagrant group=vagrant state=directory
- name: Generate vagrant keypair
command: ssh-keygen -f /home/vagrant/.ssh/id_rsa -t rsa -N '' creates=/home/vagrant/.ssh/id_rsa
- name: Ensure private key has correct permissions and ownership
file: path=/home/vagrant/.ssh/id_rsa owner=vagrant group=vagrant
- name: Ensure public key has correct permissions and ownership
file: path=/home/vagrant/.ssh/id_rsa.pub owner=vagrant group=vagrant
- name: Bootstrap discourse app
command: ./launcher bootstrap app chdir=/var/docker creates=/var/docker/shared/standalone/log/rails/production.log
- name: Start discourse app
command: ./launcher start app chdir=/var/docker
- name: Generate the nginx config for the app
template: src=discourse.morph.io dest=/etc/nginx/sites-available/ owner=root group=root mode=644
notify: restart nginx
- name: Make the nginx site active
command: ln -s /etc/nginx/sites-available/discourse.morph.io /etc/nginx/sites-enabled/discourse.morph.io creates=/etc/nginx/sites-enabled/discourse.morph.io
notify: restart nginx
| ---
- name: Ensure git is installed
apt: pkg=git
- name: Ensure that /var/docker exists
file: path=/var/docker owner=deploy group=deploy state=directory
- name: Get the official discourse docker image
command: git clone https://github.com/discourse/discourse_docker.git /var/docker creates=/var/docker/README.md
- name: Copy over app configuration
template: src=app.yml dest=/var/docker/containers/app.yml owner=deploy group=deploy
+
+ # launcher bootstrap needs a key pair at /home/vagrant/.ssh/id_rsa otherwise it waits
+ - name: Ensure vagrant .ssh directory exists
+ file: path=/home/vagrant/.ssh owner=vagrant group=vagrant state=directory
+ - name: Generate vagrant keypair
+ command: ssh-keygen -f /home/vagrant/.ssh/id_rsa -t rsa -N '' creates=/home/vagrant/.ssh/id_rsa
+ - name: Ensure private key has correct permissions and ownership
+ file: path=/home/vagrant/.ssh/id_rsa owner=vagrant group=vagrant
+ - name: Ensure public key has correct permissions and ownership
+ file: path=/home/vagrant/.ssh/id_rsa.pub owner=vagrant group=vagrant
+
- name: Bootstrap discourse app
command: ./launcher bootstrap app chdir=/var/docker creates=/var/docker/shared/standalone/log/rails/production.log
+
- name: Start discourse app
command: ./launcher start app chdir=/var/docker
- name: Generate the nginx config for the app
template: src=discourse.morph.io dest=/etc/nginx/sites-available/ owner=root group=root mode=644
notify: restart nginx
- name: Make the nginx site active
command: ln -s /etc/nginx/sites-available/discourse.morph.io /etc/nginx/sites-enabled/discourse.morph.io creates=/etc/nginx/sites-enabled/discourse.morph.io
notify: restart nginx | 12 | 0.571429 | 12 | 0 |
eeb973dde50b13369e14acd29a25e4baca5f33ae | Frontend/src/Models/Page/ResetPasswordPageModel.php | Frontend/src/Models/Page/ResetPasswordPageModel.php | <?php
/**
* Copyright (c) 2016 Ruben Schmidmeister <ruben.schmidmeister@icloud.com>
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the GNU Affero General Public License,
* version 3, as published by the Free Software Foundation.
*/
namespace Timetabio\Frontend\Models\Page
{
use Timetabio\Frontend\Models\PageModel;
class ResetPasswordPageModel extends PageModel
{
/**
* @var string
*/
private $token;
public function __construct(string $token)
{
$this->token = $token;
}
public function getToken(): string
{
return $this->token;
}
}
}
| <?php
/**
* Copyright (c) 2016 Ruben Schmidmeister <ruben.schmidmeister@icloud.com>
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the GNU Affero General Public License,
* version 3, as published by the Free Software Foundation.
*/
namespace Timetabio\Frontend\Models\Page
{
use Timetabio\Frontend\Models\PageModel;
class ResetPasswordPageModel extends PageModel
{
/**
* @var string
*/
private $token;
public function __construct(string $token)
{
$this->token = $token;
}
public function getToken(): string
{
return $this->token;
}
public function getTitle(): string
{
return 'Password Reset';
}
}
}
| Add title for reset page | Add title for reset page
| PHP | agpl-3.0 | timetabio/code,timetabio/code,timetabio/code,timetabio/code,timetabio/code | php | ## Code Before:
<?php
/**
* Copyright (c) 2016 Ruben Schmidmeister <ruben.schmidmeister@icloud.com>
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the GNU Affero General Public License,
* version 3, as published by the Free Software Foundation.
*/
namespace Timetabio\Frontend\Models\Page
{
use Timetabio\Frontend\Models\PageModel;
class ResetPasswordPageModel extends PageModel
{
/**
* @var string
*/
private $token;
public function __construct(string $token)
{
$this->token = $token;
}
public function getToken(): string
{
return $this->token;
}
}
}
## Instruction:
Add title for reset page
## Code After:
<?php
/**
* Copyright (c) 2016 Ruben Schmidmeister <ruben.schmidmeister@icloud.com>
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the GNU Affero General Public License,
* version 3, as published by the Free Software Foundation.
*/
namespace Timetabio\Frontend\Models\Page
{
use Timetabio\Frontend\Models\PageModel;
class ResetPasswordPageModel extends PageModel
{
/**
* @var string
*/
private $token;
public function __construct(string $token)
{
$this->token = $token;
}
public function getToken(): string
{
return $this->token;
}
public function getTitle(): string
{
return 'Password Reset';
}
}
}
| <?php
/**
* Copyright (c) 2016 Ruben Schmidmeister <ruben.schmidmeister@icloud.com>
*
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the GNU Affero General Public License,
* version 3, as published by the Free Software Foundation.
*/
namespace Timetabio\Frontend\Models\Page
{
use Timetabio\Frontend\Models\PageModel;
class ResetPasswordPageModel extends PageModel
{
/**
* @var string
*/
private $token;
public function __construct(string $token)
{
$this->token = $token;
}
public function getToken(): string
{
return $this->token;
}
+
+ public function getTitle(): string
+ {
+ return 'Password Reset';
+ }
}
} | 5 | 0.16129 | 5 | 0 |
f3fcb652d251daeaa37637e23ba7bd421d99d718 | packages/mu/multibase.yaml | packages/mu/multibase.yaml | homepage: https://github.com/oscoin/ipfs
changelog-type: markdown
hash: bdbfb293bcc86d84f79a6db76fb83b4931f6379f1a9d5adaa66aac338c002e80
test-bench-deps:
multibase: -any
base: -any
doctest: -any
QuickCheck: -any
template-haskell: -any
maintainer: Kim Altintop <kim@monadic.xyz>, Monadic Team <team@monadic.xyz>
synopsis: Self-identifying base encodings, implementation of <https://github.com/multiformats/multihash>
changelog: ''
basic-deps:
serialise: -any
bytestring: -any
base: ! '>=4.9 && <5'
base64-bytestring: -any
text: -any
tagged: -any
formatting: -any
base58-bytestring: -any
hashable: -any
base16-bytestring: -any
deepseq: -any
aeson: -any
sandi: -any
base32-z-bytestring: -any
all-versions:
- 0.1.0.0
author: Kim Altintop
latest: 0.1.0.0
description-type: markdown
description: |
Haskell implementation of [multibase](https://github.com/multiformats/multibase): "self-identifying base encodings".
license-name: BSD-3-Clause
| homepage: https://github.com/oscoin/ipfs
changelog-type: markdown
hash: 75bf29d8c64e2a8fdfb18957f909a385b9c04cd55197d0ceaf9fa25f2eceb13f
test-bench-deps:
multibase: -any
base: -any
doctest: -any
QuickCheck: -any
template-haskell: -any
maintainer: Kim Altintop <kim@monadic.xyz>, Monadic Team <team@monadic.xyz>
synopsis: Self-identifying base encodings, implementation of <https://github.com/multiformats/multihash>
changelog: ''
basic-deps:
serialise: -any
bytestring: -any
base: '>=4.9 && <5'
base64-bytestring: -any
text: -any
tagged: -any
formatting: -any
base58-bytestring: -any
hashable: -any
base16-bytestring: -any
deepseq: -any
aeson: -any
sandi: -any
base32-z-bytestring: -any
all-versions:
- 0.1.0.0
- 0.1.1
author: Kim Altintop
latest: 0.1.1
description-type: markdown
description: |
Haskell implementation of [multibase](https://github.com/multiformats/multibase): "self-identifying base encodings".
license-name: BSD-3-Clause
| Update from Hackage at 2020-06-05T21:58:10Z | Update from Hackage at 2020-06-05T21:58:10Z
| YAML | mit | commercialhaskell/all-cabal-metadata | yaml | ## Code Before:
homepage: https://github.com/oscoin/ipfs
changelog-type: markdown
hash: bdbfb293bcc86d84f79a6db76fb83b4931f6379f1a9d5adaa66aac338c002e80
test-bench-deps:
multibase: -any
base: -any
doctest: -any
QuickCheck: -any
template-haskell: -any
maintainer: Kim Altintop <kim@monadic.xyz>, Monadic Team <team@monadic.xyz>
synopsis: Self-identifying base encodings, implementation of <https://github.com/multiformats/multihash>
changelog: ''
basic-deps:
serialise: -any
bytestring: -any
base: ! '>=4.9 && <5'
base64-bytestring: -any
text: -any
tagged: -any
formatting: -any
base58-bytestring: -any
hashable: -any
base16-bytestring: -any
deepseq: -any
aeson: -any
sandi: -any
base32-z-bytestring: -any
all-versions:
- 0.1.0.0
author: Kim Altintop
latest: 0.1.0.0
description-type: markdown
description: |
Haskell implementation of [multibase](https://github.com/multiformats/multibase): "self-identifying base encodings".
license-name: BSD-3-Clause
## Instruction:
Update from Hackage at 2020-06-05T21:58:10Z
## Code After:
homepage: https://github.com/oscoin/ipfs
changelog-type: markdown
hash: 75bf29d8c64e2a8fdfb18957f909a385b9c04cd55197d0ceaf9fa25f2eceb13f
test-bench-deps:
multibase: -any
base: -any
doctest: -any
QuickCheck: -any
template-haskell: -any
maintainer: Kim Altintop <kim@monadic.xyz>, Monadic Team <team@monadic.xyz>
synopsis: Self-identifying base encodings, implementation of <https://github.com/multiformats/multihash>
changelog: ''
basic-deps:
serialise: -any
bytestring: -any
base: '>=4.9 && <5'
base64-bytestring: -any
text: -any
tagged: -any
formatting: -any
base58-bytestring: -any
hashable: -any
base16-bytestring: -any
deepseq: -any
aeson: -any
sandi: -any
base32-z-bytestring: -any
all-versions:
- 0.1.0.0
- 0.1.1
author: Kim Altintop
latest: 0.1.1
description-type: markdown
description: |
Haskell implementation of [multibase](https://github.com/multiformats/multibase): "self-identifying base encodings".
license-name: BSD-3-Clause
| homepage: https://github.com/oscoin/ipfs
changelog-type: markdown
- hash: bdbfb293bcc86d84f79a6db76fb83b4931f6379f1a9d5adaa66aac338c002e80
+ hash: 75bf29d8c64e2a8fdfb18957f909a385b9c04cd55197d0ceaf9fa25f2eceb13f
test-bench-deps:
multibase: -any
base: -any
doctest: -any
QuickCheck: -any
template-haskell: -any
maintainer: Kim Altintop <kim@monadic.xyz>, Monadic Team <team@monadic.xyz>
synopsis: Self-identifying base encodings, implementation of <https://github.com/multiformats/multihash>
changelog: ''
basic-deps:
serialise: -any
bytestring: -any
- base: ! '>=4.9 && <5'
? --
+ base: '>=4.9 && <5'
base64-bytestring: -any
text: -any
tagged: -any
formatting: -any
base58-bytestring: -any
hashable: -any
base16-bytestring: -any
deepseq: -any
aeson: -any
sandi: -any
base32-z-bytestring: -any
all-versions:
- 0.1.0.0
+ - 0.1.1
author: Kim Altintop
- latest: 0.1.0.0
? ^^^
+ latest: 0.1.1
? ^
description-type: markdown
description: |
Haskell implementation of [multibase](https://github.com/multiformats/multibase): "self-identifying base encodings".
license-name: BSD-3-Clause | 7 | 0.2 | 4 | 3 |
28abcc08e81e20acc628c19f1273f90e8483a604 | lib/benchtool/curl-cmd-builder.rb | lib/benchtool/curl-cmd-builder.rb | module BenchTool
class CurlCmdBuilder
def initialize(params, options = {})
@params = params
@options = options
# Sample curl status cmd
# curl -IL --cookies '#{cookies}' --header '#{header}' "#{url}"
@parts = {
:base => "curl -siL ",
:cookies => "--cookie '%s' ",
:header => "--header '%s' ",
:url => "'%s'",
}
end
def to_str
cmd = ""
cmd << @parts[:base]
cmd << @parts[:cookies] % @params[:cookies]
unless @params[:headers].empty?
@params[:headers].each do |header|
cmd << @parts[:header] % header
end
end
cmd << @parts[:url] % @params[:url]
end
end # class ABCmdBuilder
end # module BenchTool
| module BenchTool
class CurlCmdBuilder
def initialize(params, options = {})
@params = params
@options = options
# Sample curl status cmd
# Flag --insecure allows use of self-signed certs
# curl -siL --insecure --cookies '#{cookies}' --header '#{header}' "#{url}"
@parts = {
:base => "curl -siL ",
:insecure => "--insecure ",
:cookies => "--cookie '%s' ",
:header => "--header '%s' ",
:url => "'%s'",
}
end
def to_str
cmd = ""
cmd << @parts[:base]
cmd << @parts[:cookies] % @params[:cookies]
unless @params[:headers].empty?
@params[:headers].each do |header|
cmd << @parts[:header] % header
end
end
cmd << @parts[:url] % @params[:url]
end
end # class ABCmdBuilder
end # module BenchTool
| Add insecure flag so we can use self-signed certs | Add insecure flag so we can use self-signed certs
| Ruby | mit | bradland/benchtool,bradland/benchtool | ruby | ## Code Before:
module BenchTool
class CurlCmdBuilder
def initialize(params, options = {})
@params = params
@options = options
# Sample curl status cmd
# curl -IL --cookies '#{cookies}' --header '#{header}' "#{url}"
@parts = {
:base => "curl -siL ",
:cookies => "--cookie '%s' ",
:header => "--header '%s' ",
:url => "'%s'",
}
end
def to_str
cmd = ""
cmd << @parts[:base]
cmd << @parts[:cookies] % @params[:cookies]
unless @params[:headers].empty?
@params[:headers].each do |header|
cmd << @parts[:header] % header
end
end
cmd << @parts[:url] % @params[:url]
end
end # class ABCmdBuilder
end # module BenchTool
## Instruction:
Add insecure flag so we can use self-signed certs
## Code After:
module BenchTool
class CurlCmdBuilder
def initialize(params, options = {})
@params = params
@options = options
# Sample curl status cmd
# Flag --insecure allows use of self-signed certs
# curl -siL --insecure --cookies '#{cookies}' --header '#{header}' "#{url}"
@parts = {
:base => "curl -siL ",
:insecure => "--insecure ",
:cookies => "--cookie '%s' ",
:header => "--header '%s' ",
:url => "'%s'",
}
end
def to_str
cmd = ""
cmd << @parts[:base]
cmd << @parts[:cookies] % @params[:cookies]
unless @params[:headers].empty?
@params[:headers].each do |header|
cmd << @parts[:header] % header
end
end
cmd << @parts[:url] % @params[:url]
end
end # class ABCmdBuilder
end # module BenchTool
| module BenchTool
class CurlCmdBuilder
def initialize(params, options = {})
@params = params
@options = options
# Sample curl status cmd
+ # Flag --insecure allows use of self-signed certs
- # curl -IL --cookies '#{cookies}' --header '#{header}' "#{url}"
? ^
+ # curl -siL --insecure --cookies '#{cookies}' --header '#{header}' "#{url}"
? ^^ +++++++++++
@parts = {
:base => "curl -siL ",
+ :insecure => "--insecure ",
:cookies => "--cookie '%s' ",
:header => "--header '%s' ",
:url => "'%s'",
}
end
def to_str
cmd = ""
cmd << @parts[:base]
cmd << @parts[:cookies] % @params[:cookies]
unless @params[:headers].empty?
@params[:headers].each do |header|
cmd << @parts[:header] % header
end
end
cmd << @parts[:url] % @params[:url]
end
end # class ABCmdBuilder
end # module BenchTool | 4 | 0.133333 | 3 | 1 |
8386d7372f9ff8bfad651efe43504746aff19b73 | app/models/rooms/rooms.py | app/models/rooms/rooms.py | from models.people.people import Staff, Fellow
from models.rooms.rooms import Office, LivingSpace
import random
class Dojo(object):
def __init__(self):
self.offices = []
self.livingrooms = []
self.staff = []
self.fellows = []
self.all_rooms = []
self.all_people = []
def get_room(self, rooms):
"""A function to generate a list of random rooms with space.
:param rooms:
:return: room_name
"""
# a room is only available if it's capacity is not exceeded
available_rooms = [room for room in rooms if len(room.occupants) < room.room_capacity]
# return False if all rooms are full
if len(available_rooms) < 1:
return False
# choose a room fro the list of available rooms.
chosen_room = random.choice(available_rooms)
return chosen_room.room_name
def create_room(self, room_name, room_type):
if room_type is 'office':
if room_name not in [room.room_name for room in self.offices]:
room = Office(room_name=room_name, room_type=room_type)
self.offices.append(room)
self.all_rooms.append(room)
return 'An office called' + ' ' + room_name + ' ' + 'has been successfully created'
return 'An office with that name already exists'
if room_type is 'livingspace':
if room_name not in [room.room_name for room in self.livingrooms]:
room = LivingSpace(room_name=room_name, room_type=room_type)
# add object to list( has both room_name and room_type)
self.livingrooms.append(room)
self.all_rooms.append(room)
return 'A room called ' + room_name + ' has been successfully created!'
return 'A living room with that name already exists'
| import os
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
class Room(object):
"""Models the kind of rooms available at Andela,
It forms the base class Room from which OfficeSpace and LivingRoom inherit"""
def __init__(self, room_name, room_type, room_capacity):
"""Initializes the base class Room
:param room_name: A string representing the name of the room
:param room_type: A string representing the type of room, whether office or residential
:param room_capacity: An integer representing the amount of space per room.
"""
self.room_name = room_name
self.room_type = room_type
self.room_capacity = room_capacity
self.occupants = []
| Implement the Room base class | Implement the Room base class
| Python | mit | Alweezy/alvin-mutisya-dojo-project | python | ## Code Before:
from models.people.people import Staff, Fellow
from models.rooms.rooms import Office, LivingSpace
import random
class Dojo(object):
def __init__(self):
self.offices = []
self.livingrooms = []
self.staff = []
self.fellows = []
self.all_rooms = []
self.all_people = []
def get_room(self, rooms):
"""A function to generate a list of random rooms with space.
:param rooms:
:return: room_name
"""
# a room is only available if it's capacity is not exceeded
available_rooms = [room for room in rooms if len(room.occupants) < room.room_capacity]
# return False if all rooms are full
if len(available_rooms) < 1:
return False
# choose a room fro the list of available rooms.
chosen_room = random.choice(available_rooms)
return chosen_room.room_name
def create_room(self, room_name, room_type):
if room_type is 'office':
if room_name not in [room.room_name for room in self.offices]:
room = Office(room_name=room_name, room_type=room_type)
self.offices.append(room)
self.all_rooms.append(room)
return 'An office called' + ' ' + room_name + ' ' + 'has been successfully created'
return 'An office with that name already exists'
if room_type is 'livingspace':
if room_name not in [room.room_name for room in self.livingrooms]:
room = LivingSpace(room_name=room_name, room_type=room_type)
# add object to list( has both room_name and room_type)
self.livingrooms.append(room)
self.all_rooms.append(room)
return 'A room called ' + room_name + ' has been successfully created!'
return 'A living room with that name already exists'
## Instruction:
Implement the Room base class
## Code After:
import os
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
class Room(object):
"""Models the kind of rooms available at Andela,
It forms the base class Room from which OfficeSpace and LivingRoom inherit"""
def __init__(self, room_name, room_type, room_capacity):
"""Initializes the base class Room
:param room_name: A string representing the name of the room
:param room_type: A string representing the type of room, whether office or residential
:param room_capacity: An integer representing the amount of space per room.
"""
self.room_name = room_name
self.room_type = room_type
self.room_capacity = room_capacity
self.occupants = []
| - from models.people.people import Staff, Fellow
- from models.rooms.rooms import Office, LivingSpace
- import random
+ import os
+ import sys
+ from os import path
+ sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
- class Dojo(object):
? ^ -
+ class Room(object):
? ^ +
- def __init__(self):
+ """Models the kind of rooms available at Andela,
+ It forms the base class Room from which OfficeSpace and LivingRoom inherit"""
+ def __init__(self, room_name, room_type, room_capacity):
+ """Initializes the base class Room
+ :param room_name: A string representing the name of the room
+ :param room_type: A string representing the type of room, whether office or residential
+ :param room_capacity: An integer representing the amount of space per room.
+ """
+ self.room_name = room_name
+ self.room_type = room_type
+ self.room_capacity = room_capacity
- self.offices = []
? --- ^
+ self.occupants = []
? ^^^^^^
- self.livingrooms = []
- self.staff = []
- self.fellows = []
- self.all_rooms = []
- self.all_people = []
- def get_room(self, rooms):
- """A function to generate a list of random rooms with space.
- :param rooms:
- :return: room_name
- """
- # a room is only available if it's capacity is not exceeded
- available_rooms = [room for room in rooms if len(room.occupants) < room.room_capacity]
- # return False if all rooms are full
- if len(available_rooms) < 1:
- return False
- # choose a room fro the list of available rooms.
- chosen_room = random.choice(available_rooms)
- return chosen_room.room_name
-
- def create_room(self, room_name, room_type):
- if room_type is 'office':
- if room_name not in [room.room_name for room in self.offices]:
- room = Office(room_name=room_name, room_type=room_type)
- self.offices.append(room)
- self.all_rooms.append(room)
- return 'An office called' + ' ' + room_name + ' ' + 'has been successfully created'
- return 'An office with that name already exists'
- if room_type is 'livingspace':
- if room_name not in [room.room_name for room in self.livingrooms]:
- room = LivingSpace(room_name=room_name, room_type=room_type)
- # add object to list( has both room_name and room_type)
- self.livingrooms.append(room)
- self.all_rooms.append(room)
- return 'A room called ' + room_name + ' has been successfully created!'
- return 'A living room with that name already exists'
- | 59 | 1.311111 | 17 | 42 |
73ff56f4b8859e82b0d69a6505c982e26de27859 | util.py | util.py |
def product(nums):
r = 1
for n in nums:
r *= n
return r
def choose(n, k):
if 0 <= k <= n:
ntok = 1
ktok = 1
for t in range(1, min(k, n - k) + 1):
ntok *= n
ktok *= t
n -= 1
return ntok // ktok
else:
return 0
def format_floats(floats):
fstr = ' '.join('{:10.08f}' for _ in floats)
return fstr.format(*floats)
| import colorsys
import random
def randcolor():
hue = random.random()
sat = random.randint(700, 1000) / 1000
val = random.randint(700, 1000) / 1000
return tuple(int(f*255) for f in colorsys.hsv_to_rgb(hue, sat, val))
def product(nums):
r = 1
for n in nums:
r *= n
return r
def choose(n, k):
if 0 <= k <= n:
ntok = 1
ktok = 1
for t in range(1, min(k, n - k) + 1):
ntok *= n
ktok *= t
n -= 1
return ntok // ktok
else:
return 0
def format_floats(floats):
fstr = ' '.join('{:10.08f}' for _ in floats)
return fstr.format(*floats)
| Add randcolor function to uitl | Add randcolor function to uitl
| Python | unlicense | joseph346/cellular | python | ## Code Before:
def product(nums):
r = 1
for n in nums:
r *= n
return r
def choose(n, k):
if 0 <= k <= n:
ntok = 1
ktok = 1
for t in range(1, min(k, n - k) + 1):
ntok *= n
ktok *= t
n -= 1
return ntok // ktok
else:
return 0
def format_floats(floats):
fstr = ' '.join('{:10.08f}' for _ in floats)
return fstr.format(*floats)
## Instruction:
Add randcolor function to uitl
## Code After:
import colorsys
import random
def randcolor():
hue = random.random()
sat = random.randint(700, 1000) / 1000
val = random.randint(700, 1000) / 1000
return tuple(int(f*255) for f in colorsys.hsv_to_rgb(hue, sat, val))
def product(nums):
r = 1
for n in nums:
r *= n
return r
def choose(n, k):
if 0 <= k <= n:
ntok = 1
ktok = 1
for t in range(1, min(k, n - k) + 1):
ntok *= n
ktok *= t
n -= 1
return ntok // ktok
else:
return 0
def format_floats(floats):
fstr = ' '.join('{:10.08f}' for _ in floats)
return fstr.format(*floats)
| + import colorsys
+ import random
+
+ def randcolor():
+ hue = random.random()
+ sat = random.randint(700, 1000) / 1000
+ val = random.randint(700, 1000) / 1000
+ return tuple(int(f*255) for f in colorsys.hsv_to_rgb(hue, sat, val))
def product(nums):
r = 1
for n in nums:
r *= n
return r
def choose(n, k):
if 0 <= k <= n:
ntok = 1
ktok = 1
for t in range(1, min(k, n - k) + 1):
ntok *= n
ktok *= t
n -= 1
return ntok // ktok
else:
return 0
def format_floats(floats):
fstr = ' '.join('{:10.08f}' for _ in floats)
return fstr.format(*floats)
| 8 | 0.32 | 8 | 0 |
d565d046274371377af5558d1a8427afc2ade651 | roles/liquidsoap/tasks/main.yml | roles/liquidsoap/tasks/main.yml | ---
- name: config directory
file: path=/etc/liquidsoap state=directory
- name: configuration file
template: src=radio.liq.j2 dest=/etc/liquidsoap/radio.liq
notify: restart
- name: 'swiss-army knife for multimedia streaming'
tags: [ 'radio', 'stream' ]
docker: image='ddub/liquidsoap' name='liquidsoap'
hostname='{{ ansible_hostname }}'
ports='1337:1337,8888:8888'
volumes='/etc/liquidsoap:/config:ro,/music:/tracks:ro,/music/recs:/recs'
command='/usr/bin/liquidsoap /config/radio.liq'
| ---
- name: config directory
file: path=/etc/liquidsoap state=directory
- name: configuration file
template: src=radio.liq.j2 dest=/etc/liquidsoap/radio.liq
notify: restart
- name: writable recording directory
file: path=/music/recs state=directory mode=777
- name: check recording directory is writable - if this fails then the host system may need to adjust the permissions on the recs folder
shell: ls -dl /music/recs/ | grep -qe '^drwxrwxrwx'
changed_when: 0
- name: 'swiss-army knife for multimedia streaming'
tags: [ 'radio', 'stream' ]
docker: image='ddub/liquidsoap' name='liquidsoap'
hostname='{{ ansible_hostname }}'
ports='1337:1337,8888:8888'
volumes='/etc/liquidsoap:/config:ro,/music:/tracks:ro,/music/recs:/recs'
command='/usr/bin/liquidsoap /config/radio.liq'
| Check that the liquidsoap docker will be able to write to the recordings directory | Check that the liquidsoap docker will be able to write to the recordings directory
| YAML | mit | intbass/radio,intbass/radio | yaml | ## Code Before:
---
- name: config directory
file: path=/etc/liquidsoap state=directory
- name: configuration file
template: src=radio.liq.j2 dest=/etc/liquidsoap/radio.liq
notify: restart
- name: 'swiss-army knife for multimedia streaming'
tags: [ 'radio', 'stream' ]
docker: image='ddub/liquidsoap' name='liquidsoap'
hostname='{{ ansible_hostname }}'
ports='1337:1337,8888:8888'
volumes='/etc/liquidsoap:/config:ro,/music:/tracks:ro,/music/recs:/recs'
command='/usr/bin/liquidsoap /config/radio.liq'
## Instruction:
Check that the liquidsoap docker will be able to write to the recordings directory
## Code After:
---
- name: config directory
file: path=/etc/liquidsoap state=directory
- name: configuration file
template: src=radio.liq.j2 dest=/etc/liquidsoap/radio.liq
notify: restart
- name: writable recording directory
file: path=/music/recs state=directory mode=777
- name: check recording directory is writable - if this fails then the host system may need to adjust the permissions on the recs folder
shell: ls -dl /music/recs/ | grep -qe '^drwxrwxrwx'
changed_when: 0
- name: 'swiss-army knife for multimedia streaming'
tags: [ 'radio', 'stream' ]
docker: image='ddub/liquidsoap' name='liquidsoap'
hostname='{{ ansible_hostname }}'
ports='1337:1337,8888:8888'
volumes='/etc/liquidsoap:/config:ro,/music:/tracks:ro,/music/recs:/recs'
command='/usr/bin/liquidsoap /config/radio.liq'
| ---
- name: config directory
file: path=/etc/liquidsoap state=directory
- name: configuration file
template: src=radio.liq.j2 dest=/etc/liquidsoap/radio.liq
notify: restart
+ - name: writable recording directory
+ file: path=/music/recs state=directory mode=777
+ - name: check recording directory is writable - if this fails then the host system may need to adjust the permissions on the recs folder
+ shell: ls -dl /music/recs/ | grep -qe '^drwxrwxrwx'
+ changed_when: 0
- name: 'swiss-army knife for multimedia streaming'
tags: [ 'radio', 'stream' ]
docker: image='ddub/liquidsoap' name='liquidsoap'
hostname='{{ ansible_hostname }}'
ports='1337:1337,8888:8888'
volumes='/etc/liquidsoap:/config:ro,/music:/tracks:ro,/music/recs:/recs'
command='/usr/bin/liquidsoap /config/radio.liq' | 5 | 0.384615 | 5 | 0 |
6a0a26efa7260230e9b867a9a8de6f102c25b11a | Factory/Worker/UseControllerWorker.php | Factory/Worker/UseControllerWorker.php | <?php
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Symfony\Bundle\AsseticBundle\Factory\Worker;
use Assetic\Asset\AssetInterface;
use Assetic\Factory\Worker\WorkerInterface;
/**
* Prepends a fake front controller so the asset knows where it is-ish.
*
* @author Kris Wallsmith <kris@symfony.com>
*/
class UseControllerWorker implements WorkerInterface
{
public function process(AssetInterface $asset)
{
$targetUrl = $asset->getTargetPath();
if ($targetUrl && '/' != $targetUrl[0] && 0 !== strpos($targetUrl, '_controller/')) {
$asset->setTargetPath('_controller/'.$targetUrl);
}
return $asset;
}
}
| <?php
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Symfony\Bundle\AsseticBundle\Factory\Worker;
use Assetic\Asset\AssetInterface;
use Assetic\Factory\Worker\WorkerInterface;
use Assetic\Factory\AssetFactory;
/**
* Prepends a fake front controller so the asset knows where it is-ish.
*
* @author Kris Wallsmith <kris@symfony.com>
*/
class UseControllerWorker implements WorkerInterface
{
public function process(AssetInterface $asset, AssetFactory $factory)
{
$targetUrl = $asset->getTargetPath();
if ($targetUrl && '/' != $targetUrl[0] && 0 !== strpos($targetUrl, '_controller/')) {
$asset->setTargetPath('_controller/'.$targetUrl);
}
return $asset;
}
}
| Fix signature of the UseControllerWork to respect last changes in WorkedInterface | Fix signature of the UseControllerWork to respect last changes in WorkedInterface
PHP Fatal error: Declaration of Symfony\Bundle\AsseticBundle\Factory\Worker\UseControllerWorker::process() must be compatible with Assetic\Factory\Worker\WorkerInterface::process(Assetic\Asset\AssetInterface $asset, Assetic\Factory\AssetFactory $factory) | PHP | mit | taueres/AsseticBundle,javiereguiluz/assetic-bundle,taueres/AsseticBundle,Soullivaneuh/AsseticBundle,xabbuh/AsseticBundle,ThatCheck/AsseticBundle,nexylan/AsseticBundle,jandevani/AsseticBundle,shieldo/AsseticBundle,robertfausk/AsseticBundle,symfony/AsseticBundle,nexylan/AsseticBundle,shieldo/AsseticBundle,stof/AsseticBundle,robertfausk/AsseticBundle,webmozart/AsseticBundle,symfony/AsseticBundle,jandevani/AsseticBundle,ThatCheck/AsseticBundle,stof/AsseticBundle,shieldo/AsseticBundle,peterkokot/AsseticBundle,xabbuh/AsseticBundle,nexylan/AsseticBundle,symfony/AsseticBundle,javiereguiluz/assetic-bundle,peterkokot/AsseticBundle,ThatCheck/AsseticBundle,Soullivaneuh/AsseticBundle,symfony/assetic-bundle,artursvonda/AsseticBundle,Soullivaneuh/AsseticBundle,stof/AsseticBundle,artursvonda/AsseticBundle,javiereguiluz/assetic-bundle,symfony/assetic-bundle,artursvonda/AsseticBundle,webmozart/AsseticBundle,jandevani/AsseticBundle,robertfausk/AsseticBundle,symfony/assetic-bundle,taueres/AsseticBundle | php | ## Code Before:
<?php
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Symfony\Bundle\AsseticBundle\Factory\Worker;
use Assetic\Asset\AssetInterface;
use Assetic\Factory\Worker\WorkerInterface;
/**
* Prepends a fake front controller so the asset knows where it is-ish.
*
* @author Kris Wallsmith <kris@symfony.com>
*/
class UseControllerWorker implements WorkerInterface
{
public function process(AssetInterface $asset)
{
$targetUrl = $asset->getTargetPath();
if ($targetUrl && '/' != $targetUrl[0] && 0 !== strpos($targetUrl, '_controller/')) {
$asset->setTargetPath('_controller/'.$targetUrl);
}
return $asset;
}
}
## Instruction:
Fix signature of the UseControllerWork to respect last changes in WorkedInterface
PHP Fatal error: Declaration of Symfony\Bundle\AsseticBundle\Factory\Worker\UseControllerWorker::process() must be compatible with Assetic\Factory\Worker\WorkerInterface::process(Assetic\Asset\AssetInterface $asset, Assetic\Factory\AssetFactory $factory)
## Code After:
<?php
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Symfony\Bundle\AsseticBundle\Factory\Worker;
use Assetic\Asset\AssetInterface;
use Assetic\Factory\Worker\WorkerInterface;
use Assetic\Factory\AssetFactory;
/**
* Prepends a fake front controller so the asset knows where it is-ish.
*
* @author Kris Wallsmith <kris@symfony.com>
*/
class UseControllerWorker implements WorkerInterface
{
public function process(AssetInterface $asset, AssetFactory $factory)
{
$targetUrl = $asset->getTargetPath();
if ($targetUrl && '/' != $targetUrl[0] && 0 !== strpos($targetUrl, '_controller/')) {
$asset->setTargetPath('_controller/'.$targetUrl);
}
return $asset;
}
}
| <?php
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Symfony\Bundle\AsseticBundle\Factory\Worker;
use Assetic\Asset\AssetInterface;
use Assetic\Factory\Worker\WorkerInterface;
+ use Assetic\Factory\AssetFactory;
/**
* Prepends a fake front controller so the asset knows where it is-ish.
*
* @author Kris Wallsmith <kris@symfony.com>
*/
class UseControllerWorker implements WorkerInterface
{
- public function process(AssetInterface $asset)
+ public function process(AssetInterface $asset, AssetFactory $factory)
? +++++++++++++++++++++++
{
$targetUrl = $asset->getTargetPath();
if ($targetUrl && '/' != $targetUrl[0] && 0 !== strpos($targetUrl, '_controller/')) {
$asset->setTargetPath('_controller/'.$targetUrl);
}
return $asset;
}
} | 3 | 0.090909 | 2 | 1 |
c74fa468a78f99c3dc305ed9c535a95e0079dcb8 | src/components/Headings.js | src/components/Headings.js | import React from 'react'
export const H1 = ({ classes, children }) => (
<h1
className={`${classes} text-3xl font-extrabold tracking-tight text-gray-800 leading-9 sm:leading-10 sm:text-4xl md:text-5xl md:leading-14`}
>
{children}
</h1>
)
export const H2 = ({ classes, children }) => (
<h2
className={`${classes} text-2xl font-bold tracking-tight text-gray-800 leading-8`}
>
{children}
</h2>
)
| import React from 'react'
export const H1 = ({ classes, children }) => (
<h1
className={`${
classes ?? ''
} text-3xl font-extrabold tracking-tight text-gray-800 leading-9 sm:leading-10 sm:text-4xl md:text-5xl md:leading-14`}
>
{children}
</h1>
)
export const H2 = ({ classes, children }) => (
<h2
className={`${
classes ?? ''
} text-2xl font-bold tracking-tight text-gray-800 leading-8`}
>
{children}
</h2>
)
| Fix undefined style corner case | Fix undefined style corner case
| JavaScript | mit | dtjv/dtjv.github.io | javascript | ## Code Before:
import React from 'react'
export const H1 = ({ classes, children }) => (
<h1
className={`${classes} text-3xl font-extrabold tracking-tight text-gray-800 leading-9 sm:leading-10 sm:text-4xl md:text-5xl md:leading-14`}
>
{children}
</h1>
)
export const H2 = ({ classes, children }) => (
<h2
className={`${classes} text-2xl font-bold tracking-tight text-gray-800 leading-8`}
>
{children}
</h2>
)
## Instruction:
Fix undefined style corner case
## Code After:
import React from 'react'
export const H1 = ({ classes, children }) => (
<h1
className={`${
classes ?? ''
} text-3xl font-extrabold tracking-tight text-gray-800 leading-9 sm:leading-10 sm:text-4xl md:text-5xl md:leading-14`}
>
{children}
</h1>
)
export const H2 = ({ classes, children }) => (
<h2
className={`${
classes ?? ''
} text-2xl font-bold tracking-tight text-gray-800 leading-8`}
>
{children}
</h2>
)
| import React from 'react'
export const H1 = ({ classes, children }) => (
<h1
+ className={`${
+ classes ?? ''
- className={`${classes} text-3xl font-extrabold tracking-tight text-gray-800 leading-9 sm:leading-10 sm:text-4xl md:text-5xl md:leading-14`}
? ---------------------
+ } text-3xl font-extrabold tracking-tight text-gray-800 leading-9 sm:leading-10 sm:text-4xl md:text-5xl md:leading-14`}
>
{children}
</h1>
)
export const H2 = ({ classes, children }) => (
<h2
+ className={`${
+ classes ?? ''
- className={`${classes} text-2xl font-bold tracking-tight text-gray-800 leading-8`}
? ---------------------
+ } text-2xl font-bold tracking-tight text-gray-800 leading-8`}
>
{children}
</h2>
) | 8 | 0.470588 | 6 | 2 |
1aad4551ca18582735c427d2ab4ace3e48d04abf | account_banking_mandate/views/account_invoice_view.xml | account_banking_mandate/views/account_invoice_view.xml | <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="invoice_form" model="ir.ui.view">
<field name="name">add.mandate.on.customer.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<field name="partner_bank_id" position="after">
<field name="mandate_id" domain="[('partner_id', '=', partner_id), ('state', '=', 'valid')]" attrs="{'invisible': [('type', '=', 'out_refund')]}"/>
</field>
</field>
</record>
</data>
</openerp>
| <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="invoice_form" model="ir.ui.view">
<field name="name">add.mandate.on.customer.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<field name="partner_bank_id" position="after">
<field name="commercial_partner_id" invisible="1"/>
<field name="mandate_id" domain="[('partner_id', '=', commercial_partner_id), ('state', '=', 'valid')]" attrs="{'invisible': [('type', '=', 'out_refund')]}"/>
</field>
</field>
</record>
</data>
</openerp>
| FIX domain on mandate_id field on invoices | FIX domain on mandate_id field on invoices
| XML | agpl-3.0 | acsone/bank-payment,diagramsoftware/bank-payment,open-synergy/bank-payment | xml | ## Code Before:
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="invoice_form" model="ir.ui.view">
<field name="name">add.mandate.on.customer.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<field name="partner_bank_id" position="after">
<field name="mandate_id" domain="[('partner_id', '=', partner_id), ('state', '=', 'valid')]" attrs="{'invisible': [('type', '=', 'out_refund')]}"/>
</field>
</field>
</record>
</data>
</openerp>
## Instruction:
FIX domain on mandate_id field on invoices
## Code After:
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="invoice_form" model="ir.ui.view">
<field name="name">add.mandate.on.customer.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<field name="partner_bank_id" position="after">
<field name="commercial_partner_id" invisible="1"/>
<field name="mandate_id" domain="[('partner_id', '=', commercial_partner_id), ('state', '=', 'valid')]" attrs="{'invisible': [('type', '=', 'out_refund')]}"/>
</field>
</field>
</record>
</data>
</openerp>
| <?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="invoice_form" model="ir.ui.view">
<field name="name">add.mandate.on.customer.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<field name="partner_bank_id" position="after">
+ <field name="commercial_partner_id" invisible="1"/>
- <field name="mandate_id" domain="[('partner_id', '=', partner_id), ('state', '=', 'valid')]" attrs="{'invisible': [('type', '=', 'out_refund')]}"/>
+ <field name="mandate_id" domain="[('partner_id', '=', commercial_partner_id), ('state', '=', 'valid')]" attrs="{'invisible': [('type', '=', 'out_refund')]}"/>
? +++++++++++
</field>
</field>
</record>
</data>
</openerp> | 3 | 0.136364 | 2 | 1 |
ee69ddf9fab513eade7242e8ecb33aed166d74ce | frontend/js/pages/Home.js | frontend/js/pages/Home.js | import React, { useState } from 'react';
import ColorChanger from '../app/example-app';
const Home = () => {
const [showBugComponent, setShowBugComponent] = useState(false);
return (
<>
<ColorChanger />
<button type="button" onClick={() => setShowBugComponent(true)}>
Click to test if Sentry is capturing frontend errors! (Should only work in Production)
</button>
{showBugComponent && showBugComponent.field.notexist}
</>
);
};
export default Home;
| import React, { useState } from 'react';
const Home = () => {
const [showBugComponent, setShowBugComponent] = useState(false);
return (
<>
<button type="button" onClick={() => setShowBugComponent(true)}>
Click to test if Sentry is capturing frontend errors! (Should only work in Production)
</button>
{showBugComponent && showBugComponent.field.notexist}
</>
);
};
export default Home;
| Remove colorchange component references from home component | Remove colorchange component references from home component
| JavaScript | mit | vintasoftware/django-react-boilerplate,vintasoftware/django-react-boilerplate,vintasoftware/django-react-boilerplate,vintasoftware/django-react-boilerplate | javascript | ## Code Before:
import React, { useState } from 'react';
import ColorChanger from '../app/example-app';
const Home = () => {
const [showBugComponent, setShowBugComponent] = useState(false);
return (
<>
<ColorChanger />
<button type="button" onClick={() => setShowBugComponent(true)}>
Click to test if Sentry is capturing frontend errors! (Should only work in Production)
</button>
{showBugComponent && showBugComponent.field.notexist}
</>
);
};
export default Home;
## Instruction:
Remove colorchange component references from home component
## Code After:
import React, { useState } from 'react';
const Home = () => {
const [showBugComponent, setShowBugComponent] = useState(false);
return (
<>
<button type="button" onClick={() => setShowBugComponent(true)}>
Click to test if Sentry is capturing frontend errors! (Should only work in Production)
</button>
{showBugComponent && showBugComponent.field.notexist}
</>
);
};
export default Home;
| import React, { useState } from 'react';
-
- import ColorChanger from '../app/example-app';
const Home = () => {
const [showBugComponent, setShowBugComponent] = useState(false);
return (
<>
- <ColorChanger />
<button type="button" onClick={() => setShowBugComponent(true)}>
Click to test if Sentry is capturing frontend errors! (Should only work in Production)
</button>
{showBugComponent && showBugComponent.field.notexist}
</>
);
};
export default Home; | 3 | 0.157895 | 0 | 3 |
f265330c093b78d1b82bfd3acec97316d730e360 | README.md | README.md |
Get information about your typekits from the command line
## Installation
* build the gem:
```rake build```
* install the gem:
```gem install /full/path/to/typekit_cli-0.0.1.gem```
OR
* install with rake:
```rake install```
## Usage
```typekit --list [options]```
OR
```typekit --ids [options]```
## Options
-f, --families Display family details for each kit. Use with --ids
-n, --with-names List with kit names. Use with --list slower, makes an extra API call for each kit.
|
Get information about your typekits from the command line
## Installation
* build the gem:
```rake build```
* install the gem:
```gem install /full/path/to/typekit_cli-0.0.1.gem```
OR
* install with rake:
```rake install```
---
## Configuration
* Set the environment variable for TYPEKIT_TOKEN
```export TYPEKIT_TOKEN=[your token here]```
## Usage
```typekit --list [options]```
OR
```typekit --ids [options]```
## Options
-f, --families Display family details for each kit. Use with --ids
-n, --with-names List with kit names. Use with --list slower, makes an extra API call for each kit.
| Add note about environment variable. | Add note about environment variable.
| Markdown | mit | boie0025/typekit_cli | markdown | ## Code Before:
Get information about your typekits from the command line
## Installation
* build the gem:
```rake build```
* install the gem:
```gem install /full/path/to/typekit_cli-0.0.1.gem```
OR
* install with rake:
```rake install```
## Usage
```typekit --list [options]```
OR
```typekit --ids [options]```
## Options
-f, --families Display family details for each kit. Use with --ids
-n, --with-names List with kit names. Use with --list slower, makes an extra API call for each kit.
## Instruction:
Add note about environment variable.
## Code After:
Get information about your typekits from the command line
## Installation
* build the gem:
```rake build```
* install the gem:
```gem install /full/path/to/typekit_cli-0.0.1.gem```
OR
* install with rake:
```rake install```
---
## Configuration
* Set the environment variable for TYPEKIT_TOKEN
```export TYPEKIT_TOKEN=[your token here]```
## Usage
```typekit --list [options]```
OR
```typekit --ids [options]```
## Options
-f, --families Display family details for each kit. Use with --ids
-n, --with-names List with kit names. Use with --list slower, makes an extra API call for each kit.
|
Get information about your typekits from the command line
## Installation
* build the gem:
```rake build```
* install the gem:
```gem install /full/path/to/typekit_cli-0.0.1.gem```
OR
* install with rake:
```rake install```
+ ---
+
+ ## Configuration
+ * Set the environment variable for TYPEKIT_TOKEN
+ ```export TYPEKIT_TOKEN=[your token here]```
+
## Usage
```typekit --list [options]```
OR
```typekit --ids [options]```
## Options
-f, --families Display family details for each kit. Use with --ids
-n, --with-names List with kit names. Use with --list slower, makes an extra API call for each kit. | 6 | 0.222222 | 6 | 0 |
ace3d0664da319356bcdbef3d8e89987565d47f7 | arms/Map.moon | arms/Map.moon | import terrain from require 'arms/constants'
class Map
new: =>
@size =
x: 96
y: 96
@data =
base_terrain: terrain.grass1
base_elevation: 1
tiles: {}
base_terrain: (type) =>
@data.base_terrain = type
base_elevation: (level = 1) =>
@data.base_elevation = level
finalize: =>
for y = 1, @size.y
@data.tiles[y] or= {}
for x = 1, @size.x
@data.tiles[y][x] or= {
t: @data.base_terrain
e: @data.base_elevation
}
to_json: =>
@finalize!
return {
size: { @size.x, @size.y }
base_terrain: @data.base_terrain
base_elevation: @data.base_elevation
tiles: @data.tiles
}
-- Exports
{ :Map }
| import terrain from require 'arms/constants'
class Tile
new: (@terrain_type, @elevation) =>
to_json: => { t: @terrain_type, e: @elevation }
class Map
new: =>
@size =
x: 96
y: 96
@data =
base_terrain: terrain.grass1
base_elevation: 1
tiles: {}
base_terrain: (type) =>
@data.base_terrain = type
base_elevation: (level = 1) =>
@data.base_elevation = level
tile: (x, y) =>
@data.tiles[y] or= {}
@data.tiles[y][x] or= Tile @data.base_terrain, @data.base_elevation
@data.tiles[y][x]
finalize: =>
for y = 1, @size.y
@data.tiles[y] or= {}
for x = 1, @size.x
@data.tiles[y][x] or= Tile @data.base_terrain, @data.base_elevation
to_json: =>
@finalize!
return {
size: { @size.x, @size.y }
base_terrain: @data.base_terrain
base_elevation: @data.base_elevation
tiles: [ [ tile\to_json! for tile in *row ] for row in *@data.tiles ]
}
-- Exports
{ :Map }
| Add Tile class to script library. | Add Tile class to script library.
| MoonScript | mit | goto-bus-stop/arms | moonscript | ## Code Before:
import terrain from require 'arms/constants'
class Map
new: =>
@size =
x: 96
y: 96
@data =
base_terrain: terrain.grass1
base_elevation: 1
tiles: {}
base_terrain: (type) =>
@data.base_terrain = type
base_elevation: (level = 1) =>
@data.base_elevation = level
finalize: =>
for y = 1, @size.y
@data.tiles[y] or= {}
for x = 1, @size.x
@data.tiles[y][x] or= {
t: @data.base_terrain
e: @data.base_elevation
}
to_json: =>
@finalize!
return {
size: { @size.x, @size.y }
base_terrain: @data.base_terrain
base_elevation: @data.base_elevation
tiles: @data.tiles
}
-- Exports
{ :Map }
## Instruction:
Add Tile class to script library.
## Code After:
import terrain from require 'arms/constants'
class Tile
new: (@terrain_type, @elevation) =>
to_json: => { t: @terrain_type, e: @elevation }
class Map
new: =>
@size =
x: 96
y: 96
@data =
base_terrain: terrain.grass1
base_elevation: 1
tiles: {}
base_terrain: (type) =>
@data.base_terrain = type
base_elevation: (level = 1) =>
@data.base_elevation = level
tile: (x, y) =>
@data.tiles[y] or= {}
@data.tiles[y][x] or= Tile @data.base_terrain, @data.base_elevation
@data.tiles[y][x]
finalize: =>
for y = 1, @size.y
@data.tiles[y] or= {}
for x = 1, @size.x
@data.tiles[y][x] or= Tile @data.base_terrain, @data.base_elevation
to_json: =>
@finalize!
return {
size: { @size.x, @size.y }
base_terrain: @data.base_terrain
base_elevation: @data.base_elevation
tiles: [ [ tile\to_json! for tile in *row ] for row in *@data.tiles ]
}
-- Exports
{ :Map }
| import terrain from require 'arms/constants'
+
+ class Tile
+ new: (@terrain_type, @elevation) =>
+ to_json: => { t: @terrain_type, e: @elevation }
class Map
new: =>
@size =
x: 96
y: 96
@data =
base_terrain: terrain.grass1
base_elevation: 1
tiles: {}
base_terrain: (type) =>
@data.base_terrain = type
base_elevation: (level = 1) =>
@data.base_elevation = level
+ tile: (x, y) =>
+ @data.tiles[y] or= {}
+ @data.tiles[y][x] or= Tile @data.base_terrain, @data.base_elevation
+ @data.tiles[y][x]
+
finalize: =>
for y = 1, @size.y
@data.tiles[y] or= {}
for x = 1, @size.x
+ @data.tiles[y][x] or= Tile @data.base_terrain, @data.base_elevation
- @data.tiles[y][x] or= {
- t: @data.base_terrain
- e: @data.base_elevation
- }
to_json: =>
@finalize!
return {
size: { @size.x, @size.y }
base_terrain: @data.base_terrain
base_elevation: @data.base_elevation
- tiles: @data.tiles
+ tiles: [ [ tile\to_json! for tile in *row ] for row in *@data.tiles ]
}
-- Exports
{ :Map } | 16 | 0.421053 | 11 | 5 |
8c04b4eb0f19f14a3d07915d0ef98d1cc3454b6b | src/elements/forms/element_radiogroup.erl | src/elements/forms/element_radiogroup.erl | % vim: sw=4 ts=4 et ft=erlang
% Nitrogen Web Framework for Erlang
% Copyright (c) 2008-2010 Rusty Klophaus
% See MIT-LICENSE for licensing information.
-module (element_radiogroup).
-include("wf.hrl").
-export([
reflect/0,
render_element/1
]).
-spec reflect() -> [atom()].
reflect() -> record_info(fields, radiogroup).
-spec render_element(#radiogroup{}) -> body().
render_element(Record) ->
% Set the group to the current HtmlID...
Anchor = Record#radiogroup.anchor,
NameFun = set_name_fun(Anchor),
{Time, Body} = timer:tc(fun() ->
wf_render_elements:recurse_body(NameFun, Record#radiogroup.body)
end),
% Render the record...
element_panel:render_element(#panel {
id=Record#radiogroup.id,
anchor=Record#radiogroup.anchor,
class=[radiogroup, Record#radiogroup.class],
title=Record#radiogroup.title,
style=Record#radiogroup.style,
data_fields=Record#radiogroup.data_fields,
body=Body
}).
set_name_fun(Name) ->
fun
(X = #radio{}) ->
X#radio{name=Name};
(X) ->
X
end.
| % vim: sw=4 ts=4 et ft=erlang
% Nitrogen Web Framework for Erlang
% Copyright (c) 2008-2010 Rusty Klophaus
% See MIT-LICENSE for licensing information.
-module (element_radiogroup).
-include("wf.hrl").
-export([
reflect/0,
render_element/1
]).
-spec reflect() -> [atom()].
reflect() -> record_info(fields, radiogroup).
-spec render_element(#radiogroup{}) -> body().
render_element(Record) ->
% Set the group to the current HtmlID...
Anchor = Record#radiogroup.anchor,
NameFun = set_name_fun(Anchor),
Body = wf_render_elements:recurse_body(NameFun, Record#radiogroup.body),
% Render the record...
element_panel:render_element(#panel {
id=Record#radiogroup.id,
anchor=Record#radiogroup.anchor,
class=[radiogroup, Record#radiogroup.class],
title=Record#radiogroup.title,
style=Record#radiogroup.style,
data_fields=Record#radiogroup.data_fields,
body=Body
}).
set_name_fun(Name) ->
fun
(X = #radio{}) ->
X#radio{name=Name};
(X) ->
X
end.
| Remove unnecessary rendering timer in radiogroup | Remove unnecessary rendering timer in radiogroup
| Erlang | mit | nitrogen/nitrogen_core,choptastic/nitrogen_core,choptastic/nitrogen_core,nitrogen/nitrogen_core,nitrogen/nitrogen_core,nitrogen/nitrogen_core,choptastic/nitrogen_core | erlang | ## Code Before:
% vim: sw=4 ts=4 et ft=erlang
% Nitrogen Web Framework for Erlang
% Copyright (c) 2008-2010 Rusty Klophaus
% See MIT-LICENSE for licensing information.
-module (element_radiogroup).
-include("wf.hrl").
-export([
reflect/0,
render_element/1
]).
-spec reflect() -> [atom()].
reflect() -> record_info(fields, radiogroup).
-spec render_element(#radiogroup{}) -> body().
render_element(Record) ->
% Set the group to the current HtmlID...
Anchor = Record#radiogroup.anchor,
NameFun = set_name_fun(Anchor),
{Time, Body} = timer:tc(fun() ->
wf_render_elements:recurse_body(NameFun, Record#radiogroup.body)
end),
% Render the record...
element_panel:render_element(#panel {
id=Record#radiogroup.id,
anchor=Record#radiogroup.anchor,
class=[radiogroup, Record#radiogroup.class],
title=Record#radiogroup.title,
style=Record#radiogroup.style,
data_fields=Record#radiogroup.data_fields,
body=Body
}).
set_name_fun(Name) ->
fun
(X = #radio{}) ->
X#radio{name=Name};
(X) ->
X
end.
## Instruction:
Remove unnecessary rendering timer in radiogroup
## Code After:
% vim: sw=4 ts=4 et ft=erlang
% Nitrogen Web Framework for Erlang
% Copyright (c) 2008-2010 Rusty Klophaus
% See MIT-LICENSE for licensing information.
-module (element_radiogroup).
-include("wf.hrl").
-export([
reflect/0,
render_element/1
]).
-spec reflect() -> [atom()].
reflect() -> record_info(fields, radiogroup).
-spec render_element(#radiogroup{}) -> body().
render_element(Record) ->
% Set the group to the current HtmlID...
Anchor = Record#radiogroup.anchor,
NameFun = set_name_fun(Anchor),
Body = wf_render_elements:recurse_body(NameFun, Record#radiogroup.body),
% Render the record...
element_panel:render_element(#panel {
id=Record#radiogroup.id,
anchor=Record#radiogroup.anchor,
class=[radiogroup, Record#radiogroup.class],
title=Record#radiogroup.title,
style=Record#radiogroup.style,
data_fields=Record#radiogroup.data_fields,
body=Body
}).
set_name_fun(Name) ->
fun
(X = #radio{}) ->
X#radio{name=Name};
(X) ->
X
end.
| % vim: sw=4 ts=4 et ft=erlang
% Nitrogen Web Framework for Erlang
% Copyright (c) 2008-2010 Rusty Klophaus
% See MIT-LICENSE for licensing information.
-module (element_radiogroup).
-include("wf.hrl").
-export([
reflect/0,
render_element/1
]).
-spec reflect() -> [atom()].
reflect() -> record_info(fields, radiogroup).
-spec render_element(#radiogroup{}) -> body().
render_element(Record) ->
% Set the group to the current HtmlID...
Anchor = Record#radiogroup.anchor,
NameFun = set_name_fun(Anchor),
- {Time, Body} = timer:tc(fun() ->
- wf_render_elements:recurse_body(NameFun, Record#radiogroup.body)
? ^^
+ Body = wf_render_elements:recurse_body(NameFun, Record#radiogroup.body),
? ++++ ^ +
- end),
% Render the record...
element_panel:render_element(#panel {
id=Record#radiogroup.id,
anchor=Record#radiogroup.anchor,
class=[radiogroup, Record#radiogroup.class],
title=Record#radiogroup.title,
style=Record#radiogroup.style,
data_fields=Record#radiogroup.data_fields,
body=Body
}).
set_name_fun(Name) ->
fun
(X = #radio{}) ->
X#radio{name=Name};
(X) ->
X
end. | 4 | 0.090909 | 1 | 3 |
99bfb5cbf9396bd463523bec05d4add1e4bead82 | .gitlab-ci.yml | .gitlab-ci.yml | image: gcc
build:
stage: build
before_script:
- apt-get update &&
apt-get install -y libogg-dev zip doxygen
script:
- ./autogen.sh
- ./configure
- make
- make distcheck
cache:
paths:
- "lib/*.o"
- "lib/.libs/*.o"
tags:
- docker
| image: gcc
autoconf:
stage: build
before_script:
- apt-get update &&
apt-get install -y libogg-dev zip doxygen
script:
- ./autogen.sh
- ./configure
- make
- make distcheck
cache:
paths:
- "lib/*.o"
- "lib/.libs/*.o"
tags:
- docker
cmake:
stage: build
before_script:
- apt-get update &&
apt-get install -y libogg-dev zip doxygen
cmake ninja-build
script:
- mkdir build
- cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release
- cmake --build build
tags:
- docker
| Add cmake build to gitlab ci. | Add cmake build to gitlab ci.
Add an additional build job to the gitlab ci pipeline to do a
cmake build. This doesn't run tests, but gives us a little
bit of converage.
| YAML | bsd-3-clause | ShiftMediaProject/vorbis,ShiftMediaProject/vorbis,ShiftMediaProject/vorbis,ShiftMediaProject/vorbis,ShiftMediaProject/vorbis,ShiftMediaProject/vorbis | yaml | ## Code Before:
image: gcc
build:
stage: build
before_script:
- apt-get update &&
apt-get install -y libogg-dev zip doxygen
script:
- ./autogen.sh
- ./configure
- make
- make distcheck
cache:
paths:
- "lib/*.o"
- "lib/.libs/*.o"
tags:
- docker
## Instruction:
Add cmake build to gitlab ci.
Add an additional build job to the gitlab ci pipeline to do a
cmake build. This doesn't run tests, but gives us a little
bit of converage.
## Code After:
image: gcc
autoconf:
stage: build
before_script:
- apt-get update &&
apt-get install -y libogg-dev zip doxygen
script:
- ./autogen.sh
- ./configure
- make
- make distcheck
cache:
paths:
- "lib/*.o"
- "lib/.libs/*.o"
tags:
- docker
cmake:
stage: build
before_script:
- apt-get update &&
apt-get install -y libogg-dev zip doxygen
cmake ninja-build
script:
- mkdir build
- cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release
- cmake --build build
tags:
- docker
| image: gcc
- build:
+ autoconf:
stage: build
before_script:
- apt-get update &&
apt-get install -y libogg-dev zip doxygen
script:
- ./autogen.sh
- ./configure
- make
- make distcheck
cache:
paths:
- "lib/*.o"
- "lib/.libs/*.o"
tags:
- docker
+
+ cmake:
+ stage: build
+ before_script:
+ - apt-get update &&
+ apt-get install -y libogg-dev zip doxygen
+ cmake ninja-build
+ script:
+ - mkdir build
+ - cmake -S . -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release
+ - cmake --build build
+ tags:
+ - docker | 15 | 0.833333 | 14 | 1 |
e63145ccaffcdb8b8f106841e8f7bd0a3e330dec | lib/devise_jwt/jwt_failure_app.rb | lib/devise_jwt/jwt_failure_app.rb |
require 'devise/failure_app'
module DeviseJwt
class JwtFailureApp < Devise::FailureApp
def http_auth
self.status = respond_status
self.content_type = request.format.to_s
self.response_body = http_auth_body
end
def http_auth_body
return i18n_message unless request_format
method = "to_#{request_format}"
if method == 'to_xml'
{ messsage: i18n_message }.to_xml(root: 'errors')
elsif {}.respond_to?(method)
{status: :error, errors: [{messsage: i18n_message}]}.send(method)
else
i18n_message
end
end
private
def respond_status
case warden.message
when :expired_token
419
else
401
end
end
end
end
|
require 'devise/failure_app'
module DeviseJwt
class JwtFailureApp < Devise::FailureApp
def http_auth
self.status = respond_status
self.content_type = request.format.to_s
self.response_body = http_auth_body
end
def http_auth_body
return i18n_message unless request_format
method = "to_#{request_format}"
if method == 'to_xml'
{messsage: i18n_message}.to_xml(root: 'errors')
elsif {}.respond_to?(method)
{status: :error, errors: [{id: warden.message, messsage: i18n_message}]}.send(method)
else
i18n_message
end
end
protected
def i18n_options(options)
options[:scope] = 'devise_jwt.failure'
options
end
private
def respond_status
case warden.message
when :expired_token
419
else
401
end
end
end
end
| Redefine scope property of i18n options from devise.failure to devise_jwt.failure | Redefine scope property of i18n options from devise.failure to devise_jwt.failure
| Ruby | mit | Alexey79/devise_jwt | ruby | ## Code Before:
require 'devise/failure_app'
module DeviseJwt
class JwtFailureApp < Devise::FailureApp
def http_auth
self.status = respond_status
self.content_type = request.format.to_s
self.response_body = http_auth_body
end
def http_auth_body
return i18n_message unless request_format
method = "to_#{request_format}"
if method == 'to_xml'
{ messsage: i18n_message }.to_xml(root: 'errors')
elsif {}.respond_to?(method)
{status: :error, errors: [{messsage: i18n_message}]}.send(method)
else
i18n_message
end
end
private
def respond_status
case warden.message
when :expired_token
419
else
401
end
end
end
end
## Instruction:
Redefine scope property of i18n options from devise.failure to devise_jwt.failure
## Code After:
require 'devise/failure_app'
module DeviseJwt
class JwtFailureApp < Devise::FailureApp
def http_auth
self.status = respond_status
self.content_type = request.format.to_s
self.response_body = http_auth_body
end
def http_auth_body
return i18n_message unless request_format
method = "to_#{request_format}"
if method == 'to_xml'
{messsage: i18n_message}.to_xml(root: 'errors')
elsif {}.respond_to?(method)
{status: :error, errors: [{id: warden.message, messsage: i18n_message}]}.send(method)
else
i18n_message
end
end
protected
def i18n_options(options)
options[:scope] = 'devise_jwt.failure'
options
end
private
def respond_status
case warden.message
when :expired_token
419
else
401
end
end
end
end
|
require 'devise/failure_app'
module DeviseJwt
class JwtFailureApp < Devise::FailureApp
def http_auth
self.status = respond_status
self.content_type = request.format.to_s
self.response_body = http_auth_body
end
def http_auth_body
return i18n_message unless request_format
method = "to_#{request_format}"
if method == 'to_xml'
- { messsage: i18n_message }.to_xml(root: 'errors')
? - -
+ {messsage: i18n_message}.to_xml(root: 'errors')
elsif {}.respond_to?(method)
- {status: :error, errors: [{messsage: i18n_message}]}.send(method)
+ {status: :error, errors: [{id: warden.message, messsage: i18n_message}]}.send(method)
? ++++++++++++++++++++
else
i18n_message
end
+ end
+
+ protected
+
+ def i18n_options(options)
+ options[:scope] = 'devise_jwt.failure'
+ options
end
private
def respond_status
case warden.message
when :expired_token
419
else
401
end
end
end
end | 11 | 0.314286 | 9 | 2 |
24dc88645ec49447323f9288d47a9a9bf1b8528f | addons/notes/package.json | addons/notes/package.json | {
"name": "@storybook/addon-notes",
"version": "3.4.0-alpha.9",
"description": "Write notes for your Storybook stories.",
"keywords": [
"addon",
"notes",
"storybook"
],
"license": "MIT",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/storybooks/storybook.git"
},
"scripts": {
"prepare": "node ../../scripts/prepare.js",
"publish-storybook": "bash .scripts/publish_storybook.sh",
"storybook": "start-storybook -p 9010"
},
"dependencies": {
"babel-runtime": "^6.26.0",
"marked": "^0.3.17",
"prop-types": "^15.6.1",
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@storybook/react": "^3.4.0-alpha.9"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0",
"react": "*"
},
"optionalDependencies": {
"@types/react": "^16.0.20"
}
}
| {
"name": "@storybook/addon-notes",
"version": "3.4.0-alpha.9",
"description": "Write notes for your Storybook stories.",
"keywords": [
"addon",
"notes",
"storybook"
],
"license": "MIT",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/storybooks/storybook.git"
},
"scripts": {
"prepare": "node ../../scripts/prepare.js",
"publish-storybook": "bash .scripts/publish_storybook.sh",
"storybook": "start-storybook -p 9010"
},
"dependencies": {
"babel-runtime": "^6.26.0",
"marked": "^0.3.17",
"prop-types": "^15.6.1",
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@storybook/react": "^3.4.0-alpha.9",
"@types/react": "^16.0.20"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0",
"react": "*"
}
}
| Move "@types/react" to dev dependencies | Move "@types/react" to dev dependencies
| JSON | mit | kadirahq/react-storybook,storybooks/storybook,kadirahq/react-storybook,rhalff/storybook,storybooks/storybook,rhalff/storybook,storybooks/react-storybook,rhalff/storybook,rhalff/storybook,storybooks/storybook,storybooks/storybook,storybooks/storybook,storybooks/react-storybook,rhalff/storybook,storybooks/react-storybook,storybooks/storybook,storybooks/react-storybook,storybooks/storybook,rhalff/storybook | json | ## Code Before:
{
"name": "@storybook/addon-notes",
"version": "3.4.0-alpha.9",
"description": "Write notes for your Storybook stories.",
"keywords": [
"addon",
"notes",
"storybook"
],
"license": "MIT",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/storybooks/storybook.git"
},
"scripts": {
"prepare": "node ../../scripts/prepare.js",
"publish-storybook": "bash .scripts/publish_storybook.sh",
"storybook": "start-storybook -p 9010"
},
"dependencies": {
"babel-runtime": "^6.26.0",
"marked": "^0.3.17",
"prop-types": "^15.6.1",
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@storybook/react": "^3.4.0-alpha.9"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0",
"react": "*"
},
"optionalDependencies": {
"@types/react": "^16.0.20"
}
}
## Instruction:
Move "@types/react" to dev dependencies
## Code After:
{
"name": "@storybook/addon-notes",
"version": "3.4.0-alpha.9",
"description": "Write notes for your Storybook stories.",
"keywords": [
"addon",
"notes",
"storybook"
],
"license": "MIT",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/storybooks/storybook.git"
},
"scripts": {
"prepare": "node ../../scripts/prepare.js",
"publish-storybook": "bash .scripts/publish_storybook.sh",
"storybook": "start-storybook -p 9010"
},
"dependencies": {
"babel-runtime": "^6.26.0",
"marked": "^0.3.17",
"prop-types": "^15.6.1",
"util-deprecate": "^1.0.2"
},
"devDependencies": {
"@storybook/react": "^3.4.0-alpha.9",
"@types/react": "^16.0.20"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0",
"react": "*"
}
}
| {
"name": "@storybook/addon-notes",
"version": "3.4.0-alpha.9",
"description": "Write notes for your Storybook stories.",
"keywords": [
"addon",
"notes",
"storybook"
],
"license": "MIT",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"repository": {
"type": "git",
"url": "https://github.com/storybooks/storybook.git"
},
"scripts": {
"prepare": "node ../../scripts/prepare.js",
"publish-storybook": "bash .scripts/publish_storybook.sh",
"storybook": "start-storybook -p 9010"
},
"dependencies": {
"babel-runtime": "^6.26.0",
"marked": "^0.3.17",
"prop-types": "^15.6.1",
"util-deprecate": "^1.0.2"
},
"devDependencies": {
- "@storybook/react": "^3.4.0-alpha.9"
+ "@storybook/react": "^3.4.0-alpha.9",
? +
+ "@types/react": "^16.0.20"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0",
"react": "*"
- },
- "optionalDependencies": {
- "@types/react": "^16.0.20"
}
} | 6 | 0.157895 | 2 | 4 |
e3b2ca70c37cbb9bd999403c5a2ca8cba715d378 | sf_dev/examples/my_example/JSON/VNFFG/vnffg1.json | sf_dev/examples/my_example/JSON/VNFFG/vnffg1.json | {
"id": "vnffg1",
"vendor": "netgroup",
"descriptor_version ": "0.1",
"version": "0.1",
"number_of_endpoints": 8 ,
"number_of_virtual_links": 4 ,
"dependent_virtual_link": "vl01",
"network_forwarding_path": [
{
"id": "nfp1",
"policy": "A policy or rule to apply to the NFP",
"connection": [
[0, "cp01"],
[1, "cp11"],
[2, "cp14"],
[3, "cp13"],
[4, "cp31"],
[5, "cp33"],
[6, "cp03"]
]
}
] ,
"connection_point":[
"cp01",
"cp11",
"cp14",
"cp13",
"cp31",
"cp33",
"cp03"
] ,
"constituent_vnfs":[
"vnf1",
"vnf3"
],
"vnffgd_security": "signature"
} | {
"id": "vnffg1",
"vendor": "netgroup",
"descriptor_version ": "0.1",
"version": "0.1",
"number_of_endpoints": 8 ,
"number_of_virtual_links": 4 ,
"dependent_virtual_link": [
"vl01",
"vl11",
"vl02",
"vl31",
"vl04"
],
"network_forwarding_path": [
{
"id": "nfp1",
"policy": "A policy or rule to apply to the NFP",
"connection": [
[0, "cp01"],
[1, "cp11"],
[2, "cp14"],
[3, "cp13"],
[4, "cp31"],
[5, "cp33"],
[6, "cp03"]
]
}
] ,
"connection_point":[
"cp01",
"cp11",
"cp14",
"cp13",
"cp31",
"cp33",
"cp03"
] ,
"constituent_vnfs":[
"vnf1",
"vnf3"
],
"vnffgd_security": "signature"
} | Fix VNF Forwarding Graph Descriptor example | Fix VNF Forwarding Graph Descriptor example
| JSON | apache-2.0 | superfluidity/RDCL3D,superfluidity/RDCL3D,superfluidity/RDCL3D,superfluidity/RDCL3D,superfluidity/RDCL3D | json | ## Code Before:
{
"id": "vnffg1",
"vendor": "netgroup",
"descriptor_version ": "0.1",
"version": "0.1",
"number_of_endpoints": 8 ,
"number_of_virtual_links": 4 ,
"dependent_virtual_link": "vl01",
"network_forwarding_path": [
{
"id": "nfp1",
"policy": "A policy or rule to apply to the NFP",
"connection": [
[0, "cp01"],
[1, "cp11"],
[2, "cp14"],
[3, "cp13"],
[4, "cp31"],
[5, "cp33"],
[6, "cp03"]
]
}
] ,
"connection_point":[
"cp01",
"cp11",
"cp14",
"cp13",
"cp31",
"cp33",
"cp03"
] ,
"constituent_vnfs":[
"vnf1",
"vnf3"
],
"vnffgd_security": "signature"
}
## Instruction:
Fix VNF Forwarding Graph Descriptor example
## Code After:
{
"id": "vnffg1",
"vendor": "netgroup",
"descriptor_version ": "0.1",
"version": "0.1",
"number_of_endpoints": 8 ,
"number_of_virtual_links": 4 ,
"dependent_virtual_link": [
"vl01",
"vl11",
"vl02",
"vl31",
"vl04"
],
"network_forwarding_path": [
{
"id": "nfp1",
"policy": "A policy or rule to apply to the NFP",
"connection": [
[0, "cp01"],
[1, "cp11"],
[2, "cp14"],
[3, "cp13"],
[4, "cp31"],
[5, "cp33"],
[6, "cp03"]
]
}
] ,
"connection_point":[
"cp01",
"cp11",
"cp14",
"cp13",
"cp31",
"cp33",
"cp03"
] ,
"constituent_vnfs":[
"vnf1",
"vnf3"
],
"vnffgd_security": "signature"
} | {
"id": "vnffg1",
"vendor": "netgroup",
"descriptor_version ": "0.1",
"version": "0.1",
"number_of_endpoints": 8 ,
"number_of_virtual_links": 4 ,
- "dependent_virtual_link": "vl01",
? ^^^^^^^
+ "dependent_virtual_link": [
? ^
+ "vl01",
+ "vl11",
+ "vl02",
+ "vl31",
+ "vl04"
+ ],
"network_forwarding_path": [
{
"id": "nfp1",
"policy": "A policy or rule to apply to the NFP",
"connection": [
[0, "cp01"],
[1, "cp11"],
[2, "cp14"],
[3, "cp13"],
[4, "cp31"],
[5, "cp33"],
[6, "cp03"]
]
}
] ,
"connection_point":[
"cp01",
"cp11",
"cp14",
"cp13",
"cp31",
"cp33",
"cp03"
] ,
"constituent_vnfs":[
"vnf1",
"vnf3"
],
"vnffgd_security": "signature"
} | 8 | 0.210526 | 7 | 1 |
25af96ec0aa9018bfea77a3b0f653168831eb9ae | scrivener.php | scrivener.php | <?php
/**
Plugin Name: Scrivener
Plugin URI: http://10up.com
Description: A WordPress plugin to enhance the post editor preview, mainly through proof of concept.
Version: 0.1.0
Author: 10up
Author URI: http://10up.com
License: GPLv2 or later
*/
if ( ! class_exists( '\\Composer\\Autoload\\ClassLoader' ) ) {
// include our default customizer classes
include_once( __DIR__ . '/classes/Customizer/Section.php' );
include_once( __DIR__ . '/classes/Customizer/Core.php' );
include_once( __DIR__ . '/classes/Scrivener/Core.php' );
}
| <?php
/**
Plugin Name: Scrivener
Plugin URI: http://10up.com
Description: A WordPress plugin to enhance the post editor preview, mainly through proof of concept.
Version: 0.1.0
Author: 10up
Author URI: http://10up.com
License: GPLv2 or later
*/
if ( ! class_exists( '\\Composer\\Autoload\\ClassLoader' ) ) {
// include our default customizer classes
include_once( __DIR__ . '/classes/Customizer/Control.php' );
include_once( __DIR__ . '/classes/Customizer/Section.php' );
include_once( __DIR__ . '/classes/Customizer/Core.php' );
include_once( __DIR__ . '/classes/Scrivener/Core.php' );
}
| Include Control.php for non-autoloaded installs | Include Control.php for non-autoloaded installs
| PHP | mit | tw2113/Post-Customizer,chirox/Post-Customizer,chirox/Post-Customizer,10up/Post-Customizer,10up/Post-Customizer,resarahman/Post-Customizer,tw2113/Post-Customizer,chirox/Post-Customizer,resarahman/Post-Customizer,resarahman/Post-Customizer | php | ## Code Before:
<?php
/**
Plugin Name: Scrivener
Plugin URI: http://10up.com
Description: A WordPress plugin to enhance the post editor preview, mainly through proof of concept.
Version: 0.1.0
Author: 10up
Author URI: http://10up.com
License: GPLv2 or later
*/
if ( ! class_exists( '\\Composer\\Autoload\\ClassLoader' ) ) {
// include our default customizer classes
include_once( __DIR__ . '/classes/Customizer/Section.php' );
include_once( __DIR__ . '/classes/Customizer/Core.php' );
include_once( __DIR__ . '/classes/Scrivener/Core.php' );
}
## Instruction:
Include Control.php for non-autoloaded installs
## Code After:
<?php
/**
Plugin Name: Scrivener
Plugin URI: http://10up.com
Description: A WordPress plugin to enhance the post editor preview, mainly through proof of concept.
Version: 0.1.0
Author: 10up
Author URI: http://10up.com
License: GPLv2 or later
*/
if ( ! class_exists( '\\Composer\\Autoload\\ClassLoader' ) ) {
// include our default customizer classes
include_once( __DIR__ . '/classes/Customizer/Control.php' );
include_once( __DIR__ . '/classes/Customizer/Section.php' );
include_once( __DIR__ . '/classes/Customizer/Core.php' );
include_once( __DIR__ . '/classes/Scrivener/Core.php' );
}
| <?php
/**
Plugin Name: Scrivener
Plugin URI: http://10up.com
Description: A WordPress plugin to enhance the post editor preview, mainly through proof of concept.
Version: 0.1.0
Author: 10up
Author URI: http://10up.com
License: GPLv2 or later
*/
if ( ! class_exists( '\\Composer\\Autoload\\ClassLoader' ) ) {
// include our default customizer classes
+ include_once( __DIR__ . '/classes/Customizer/Control.php' );
include_once( __DIR__ . '/classes/Customizer/Section.php' );
include_once( __DIR__ . '/classes/Customizer/Core.php' );
include_once( __DIR__ . '/classes/Scrivener/Core.php' );
} | 1 | 0.058824 | 1 | 0 |
0a604550e4f39b0d40732bf6cefe143ddcd00091 | alura/c/forca.c | alura/c/forca.c |
int main() {
char palavrasecreta[20];
sprintf(palavrasecreta, "MELANCIA");
int acertou = 0;
int enforcou = 0;
char chutes[26];
int tentativas = 0;
do {
for(int i = 0; i < strlen(palavrasecreta); i++) {
int achou = 0;
for(int j = 0; j < tentativas; j++) {
if(chutes[j] == palavrasecreta[i]) {
achou = 1;
break;
}
}
if(achou) {
printf("%c ", palavrasecreta[i]);
} else {
printf("_ ");
}
}
printf("\n");
char chute;
scanf(" %c", &chute);
chutes[tentativas] = chute;
tentativas++;
} while(!acertou && !enforcou);
}
|
int main() {
char palavrasecreta[20];
sprintf(palavrasecreta, "MELANCIA");
int acertou = 0;
int enforcou = 0;
char chutes[26];
int tentativas = 0;
do {
for(int i = 0; i < strlen(palavrasecreta); i++) {
int achou = 0;
for(int j = 0; j < tentativas; j++) {
if(chutes[j] == palavrasecreta[i]) {
achou = 1;
break;
}
}
if(achou) {
printf("%c ", palavrasecreta[i]);
} else {
printf("_ ");
}
}
printf("\n");
char chute;
printf("Qual letra? ");
scanf(" %c", &chute);
chutes[tentativas] = chute;
tentativas++;
} while(!acertou && !enforcou);
}
| Update files, Alura, Introdução a C - Parte 2, Aula 2.6 | Update files, Alura, Introdução a C - Parte 2, Aula 2.6
| C | mit | fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs | c | ## Code Before:
int main() {
char palavrasecreta[20];
sprintf(palavrasecreta, "MELANCIA");
int acertou = 0;
int enforcou = 0;
char chutes[26];
int tentativas = 0;
do {
for(int i = 0; i < strlen(palavrasecreta); i++) {
int achou = 0;
for(int j = 0; j < tentativas; j++) {
if(chutes[j] == palavrasecreta[i]) {
achou = 1;
break;
}
}
if(achou) {
printf("%c ", palavrasecreta[i]);
} else {
printf("_ ");
}
}
printf("\n");
char chute;
scanf(" %c", &chute);
chutes[tentativas] = chute;
tentativas++;
} while(!acertou && !enforcou);
}
## Instruction:
Update files, Alura, Introdução a C - Parte 2, Aula 2.6
## Code After:
int main() {
char palavrasecreta[20];
sprintf(palavrasecreta, "MELANCIA");
int acertou = 0;
int enforcou = 0;
char chutes[26];
int tentativas = 0;
do {
for(int i = 0; i < strlen(palavrasecreta); i++) {
int achou = 0;
for(int j = 0; j < tentativas; j++) {
if(chutes[j] == palavrasecreta[i]) {
achou = 1;
break;
}
}
if(achou) {
printf("%c ", palavrasecreta[i]);
} else {
printf("_ ");
}
}
printf("\n");
char chute;
printf("Qual letra? ");
scanf(" %c", &chute);
chutes[tentativas] = chute;
tentativas++;
} while(!acertou && !enforcou);
}
|
int main() {
char palavrasecreta[20];
sprintf(palavrasecreta, "MELANCIA");
int acertou = 0;
int enforcou = 0;
char chutes[26];
int tentativas = 0;
do {
for(int i = 0; i < strlen(palavrasecreta); i++) {
int achou = 0;
for(int j = 0; j < tentativas; j++) {
if(chutes[j] == palavrasecreta[i]) {
achou = 1;
break;
}
}
if(achou) {
printf("%c ", palavrasecreta[i]);
} else {
printf("_ ");
}
}
printf("\n");
char chute;
+ printf("Qual letra? ");
scanf(" %c", &chute);
chutes[tentativas] = chute;
tentativas++;
} while(!acertou && !enforcou);
} | 1 | 0.023256 | 1 | 0 |
6cbf4411993e6308760854d479a375933839c0e1 | lib/transforms/renderFileTree.coffee | lib/transforms/renderFileTree.coffee |
fs = require 'fs'
path = require 'path'
through = require 'through2'
log = require '../utils/log'
module.exports = (fileName, opts={}) ->
unless fileName
throw new PluginError("Render File Tree", "Missing fileName option")
filePrefix = opts.filePrefix or "window.#{opts.varName or 'files'} = [\n"
fileSuffix = opts.fileSuffix or "\n];"
output = fs.createWriteStream(fileName)
output.write filePrefix
first = true
bufferContents = (file, enc, cb) ->
output.write (if first then '' else ',\n') + JSON.stringify({
path: file.relative
originalName: path.basename file.originalPath
originalPath: file.originalRelative
name: path.basename file.path
lang: file.extra?.lang?.highlightJS or file.extra?.lang?.pygmentsLexer
title: file.extra?.toc?[0]?.title
toc: file.extra?.toc
}, false, 2)
first = false
cb null, file
endStream = (cb) ->
output.write fileSuffix
if opts.verbose
log "File tree written to #{path.basename fileName}"
cb()
through.obj bufferContents, endStream
|
fs = require 'fs'
path = require 'path'
through = require 'through2'
_ = require 'lodash'
log = require '../utils/log'
module.exports = (fileName, opts={}) ->
unless fileName
throw new PluginError("Render File Tree", "Missing fileName option")
filePrefix = opts.filePrefix or "window.#{opts.varName or 'files'} = [\n"
fileSuffix = opts.fileSuffix or "\n];"
output = fs.createWriteStream(fileName)
output.write filePrefix
first = true
bufferContents = (file, enc, cb) ->
output.write (if first then '' else ',\n') + JSON.stringify({
path: file.relative
originalName: path.basename file.originalPath
originalPath: file.originalRelative
name: path.basename file.path
lang: file.extra?.lang?.highlightJS or file.extra?.lang?.pygmentsLexer
title: _.find(file.extra?.toc, level: 1)?.title
toc: file.extra?.toc
}, false, 2)
first = false
cb null, file
endStream = (cb) ->
output.write fileSuffix
if opts.verbose
log "File tree written to #{path.basename fileName}"
cb()
through.obj bufferContents, endStream
| Choose First h1 for File Title | Choose First h1 for File Title | CoffeeScript | mit | legomushroom/grock,killercup/grock,killercup/grock,legomushroom/grock,killercup/grock,legomushroom/grock | coffeescript | ## Code Before:
fs = require 'fs'
path = require 'path'
through = require 'through2'
log = require '../utils/log'
module.exports = (fileName, opts={}) ->
unless fileName
throw new PluginError("Render File Tree", "Missing fileName option")
filePrefix = opts.filePrefix or "window.#{opts.varName or 'files'} = [\n"
fileSuffix = opts.fileSuffix or "\n];"
output = fs.createWriteStream(fileName)
output.write filePrefix
first = true
bufferContents = (file, enc, cb) ->
output.write (if first then '' else ',\n') + JSON.stringify({
path: file.relative
originalName: path.basename file.originalPath
originalPath: file.originalRelative
name: path.basename file.path
lang: file.extra?.lang?.highlightJS or file.extra?.lang?.pygmentsLexer
title: file.extra?.toc?[0]?.title
toc: file.extra?.toc
}, false, 2)
first = false
cb null, file
endStream = (cb) ->
output.write fileSuffix
if opts.verbose
log "File tree written to #{path.basename fileName}"
cb()
through.obj bufferContents, endStream
## Instruction:
Choose First h1 for File Title
## Code After:
fs = require 'fs'
path = require 'path'
through = require 'through2'
_ = require 'lodash'
log = require '../utils/log'
module.exports = (fileName, opts={}) ->
unless fileName
throw new PluginError("Render File Tree", "Missing fileName option")
filePrefix = opts.filePrefix or "window.#{opts.varName or 'files'} = [\n"
fileSuffix = opts.fileSuffix or "\n];"
output = fs.createWriteStream(fileName)
output.write filePrefix
first = true
bufferContents = (file, enc, cb) ->
output.write (if first then '' else ',\n') + JSON.stringify({
path: file.relative
originalName: path.basename file.originalPath
originalPath: file.originalRelative
name: path.basename file.path
lang: file.extra?.lang?.highlightJS or file.extra?.lang?.pygmentsLexer
title: _.find(file.extra?.toc, level: 1)?.title
toc: file.extra?.toc
}, false, 2)
first = false
cb null, file
endStream = (cb) ->
output.write fileSuffix
if opts.verbose
log "File tree written to #{path.basename fileName}"
cb()
through.obj bufferContents, endStream
|
fs = require 'fs'
path = require 'path'
through = require 'through2'
+ _ = require 'lodash'
log = require '../utils/log'
module.exports = (fileName, opts={}) ->
unless fileName
throw new PluginError("Render File Tree", "Missing fileName option")
filePrefix = opts.filePrefix or "window.#{opts.varName or 'files'} = [\n"
fileSuffix = opts.fileSuffix or "\n];"
output = fs.createWriteStream(fileName)
output.write filePrefix
first = true
bufferContents = (file, enc, cb) ->
output.write (if first then '' else ',\n') + JSON.stringify({
path: file.relative
originalName: path.basename file.originalPath
originalPath: file.originalRelative
name: path.basename file.path
lang: file.extra?.lang?.highlightJS or file.extra?.lang?.pygmentsLexer
- title: file.extra?.toc?[0]?.title
? ^^^^
+ title: _.find(file.extra?.toc, level: 1)?.title
? +++++++ ^^^^^^^^^^^
toc: file.extra?.toc
}, false, 2)
first = false
cb null, file
endStream = (cb) ->
output.write fileSuffix
if opts.verbose
log "File tree written to #{path.basename fileName}"
cb()
through.obj bufferContents, endStream | 3 | 0.076923 | 2 | 1 |
467fe7e332e83acc1a60002fb572050c03b8d40c | .travis.yml | .travis.yml | language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- hhvm
- nightly
env:
- PREFER_LOWEST="--prefer-lowest --prefer-stable"
- PREFER_LOWEST=""
matrix:
fast_finish: true
allow_failures:
- php: hhvm
- php: nightly
before_script:
- composer update $PREFER_LOWEST
script:
- ./vendor/bin/phpunit --coverage-clover clover.xml
after_success: sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/coveralls -v; fi'
| language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- hhvm
- nightly
env:
- PREFER_LOWEST="--prefer-lowest --prefer-stable"
- PREFER_LOWEST=""
matrix:
fast_finish: true
allow_failures:
- php: 7.2
- php: hhvm
- php: nightly
before_script:
- composer update $PREFER_LOWEST
script:
- ./vendor/bin/phpunit --coverage-clover clover.xml
after_success: sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/coveralls -v; fi'
| Add PHP 7.2 back to allowed failures | Add PHP 7.2 back to allowed failures
| YAML | mit | chadicus/slim-oauth2-middleware | yaml | ## Code Before:
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- hhvm
- nightly
env:
- PREFER_LOWEST="--prefer-lowest --prefer-stable"
- PREFER_LOWEST=""
matrix:
fast_finish: true
allow_failures:
- php: hhvm
- php: nightly
before_script:
- composer update $PREFER_LOWEST
script:
- ./vendor/bin/phpunit --coverage-clover clover.xml
after_success: sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/coveralls -v; fi'
## Instruction:
Add PHP 7.2 back to allowed failures
## Code After:
language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- hhvm
- nightly
env:
- PREFER_LOWEST="--prefer-lowest --prefer-stable"
- PREFER_LOWEST=""
matrix:
fast_finish: true
allow_failures:
- php: 7.2
- php: hhvm
- php: nightly
before_script:
- composer update $PREFER_LOWEST
script:
- ./vendor/bin/phpunit --coverage-clover clover.xml
after_success: sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/coveralls -v; fi'
| language: php
php:
- 5.6
- 7.0
- 7.1
- 7.2
- hhvm
- nightly
env:
- PREFER_LOWEST="--prefer-lowest --prefer-stable"
- PREFER_LOWEST=""
matrix:
fast_finish: true
allow_failures:
+ - php: 7.2
- php: hhvm
- php: nightly
before_script:
- composer update $PREFER_LOWEST
script:
- ./vendor/bin/phpunit --coverage-clover clover.xml
after_success: sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./vendor/bin/coveralls -v; fi' | 1 | 0.047619 | 1 | 0 |
ba1a15aacd739b2686441be98a67124180cd2791 | app/controllers/requests_controller.rb | app/controllers/requests_controller.rb | class RequestsController < ApplicationController
def index
@requests = Request.all
@new_request = Request.new
end
def show
@request = Request.find(params[:id])
end
def create
Request.create!(request_params)
redirect_to requests_path
end
private
def request_params
params.require(:request).permit(:name, :url, :headers, :use_ssl, :format)
end
end | class RequestsController < ApplicationController
def index
@requests = Request.all.order(:name)
@new_request = Request.new
end
def show
@request = Request.find(params[:id])
end
def create
Request.create!(request_params)
redirect_to requests_path
end
private
def request_params
params.require(:request).permit(:name, :url, :headers, :use_ssl, :format)
end
end | Sort requsts on the index page by name | Sort requsts on the index page by name
| Ruby | mit | DerekEdwards/simple-api-monitor,DerekEdwards/simple-api-monitor,DerekEdwards/simple-api-monitor | ruby | ## Code Before:
class RequestsController < ApplicationController
def index
@requests = Request.all
@new_request = Request.new
end
def show
@request = Request.find(params[:id])
end
def create
Request.create!(request_params)
redirect_to requests_path
end
private
def request_params
params.require(:request).permit(:name, :url, :headers, :use_ssl, :format)
end
end
## Instruction:
Sort requsts on the index page by name
## Code After:
class RequestsController < ApplicationController
def index
@requests = Request.all.order(:name)
@new_request = Request.new
end
def show
@request = Request.find(params[:id])
end
def create
Request.create!(request_params)
redirect_to requests_path
end
private
def request_params
params.require(:request).permit(:name, :url, :headers, :use_ssl, :format)
end
end | class RequestsController < ApplicationController
def index
- @requests = Request.all
+ @requests = Request.all.order(:name)
? +++++++++++++
@new_request = Request.new
end
def show
@request = Request.find(params[:id])
end
def create
Request.create!(request_params)
redirect_to requests_path
end
private
def request_params
params.require(:request).permit(:name, :url, :headers, :use_ssl, :format)
end
end | 2 | 0.083333 | 1 | 1 |
34c03047964244015280b2634d7d802b911076dd | generators/geokit_cache/templates/model_spec.rb | generators/geokit_cache/templates/model_spec.rb | require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
describe <%= class_name %> do
before(:each) do
@valid_attributes = {
<% attributes.each_with_index do |attribute, attribute_index| -%>
:<%= attribute.name %> => <%= attribute.default_value %><%= attribute_index == attributes.length - 1 ? '' : ','%>
<% end -%>
}
end
it "should create a new instance given valid attributes" do
<%= class_name %>.create!(@valid_attributes)
end
end
| require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
describe <%= class_name %> do
it "should provide geocode command" do
<%= class_name %>.should respond_to(:geocode)
end
end
| Replace generator for testing with sufficent one. | Replace generator for testing with sufficent one.
| Ruby | mit | pr0d1r2/geokit-cache | ruby | ## Code Before:
require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
describe <%= class_name %> do
before(:each) do
@valid_attributes = {
<% attributes.each_with_index do |attribute, attribute_index| -%>
:<%= attribute.name %> => <%= attribute.default_value %><%= attribute_index == attributes.length - 1 ? '' : ','%>
<% end -%>
}
end
it "should create a new instance given valid attributes" do
<%= class_name %>.create!(@valid_attributes)
end
end
## Instruction:
Replace generator for testing with sufficent one.
## Code After:
require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
describe <%= class_name %> do
it "should provide geocode command" do
<%= class_name %>.should respond_to(:geocode)
end
end
| require File.expand_path(File.dirname(__FILE__) + '<%= '/..' * class_nesting_depth %>/../spec_helper')
describe <%= class_name %> do
+ it "should provide geocode command" do
+ <%= class_name %>.should respond_to(:geocode)
- before(:each) do
- @valid_attributes = {
- <% attributes.each_with_index do |attribute, attribute_index| -%>
- :<%= attribute.name %> => <%= attribute.default_value %><%= attribute_index == attributes.length - 1 ? '' : ','%>
- <% end -%>
- }
- end
-
- it "should create a new instance given valid attributes" do
- <%= class_name %>.create!(@valid_attributes)
end
end | 12 | 0.705882 | 2 | 10 |
ec667529d05868d6360394adfa7919cafadb15f6 | README.md | README.md |
Add the latest version of a gem to your Gemfile from the command line.
* No need to search RubyGems for version numbers
* No need to edit your Gemfile directly
* Gemrat bundles automatically
## Installation
Add this line to your application's Gemfile:
gem 'gemrat'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gemrat
## Usage
Add the latest version of a gem to your Gemfile and bundle. Formated: (gem 'name', 'version')
<pre>
$ gemrat gem_name
</pre>
Add the latest version of sinatra to your Gemfile and bundle
<pre>
$ gemrat sinatra
#=> gem 'sinatra', '1.4.3' added.
#=> Bundling...
</pre>
Add the latest version of rspec to your Gemfile and bundle
<pre>
$ gemrat rspec
#=> gem 'rspec', '2.13.0' added.
#=> Bundling...
</pre>
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
|
Add the latest version of a gem to your Gemfile from the command line.
* No need to search RubyGems for version numbers
* No need to edit your Gemfile directly
* Gemrat bundles automatically
## Usage
Add the latest version of a gem to your Gemfile and bundle. Formated: (gem 'name', 'version')
<pre>
$ gemrat gem_name
</pre>
Add the latest version of sinatra to your Gemfile and bundle
<pre>
$ gemrat sinatra
#=> gem 'sinatra', '1.4.3' added.
#=> Bundling...
</pre>
Add the latest version of rspec to your Gemfile and bundle
<pre>
$ gemrat rspec
#=> gem 'rspec', '2.13.0' added.
#=> Bundling...
</pre>
## Installation
Add this line to your application's Gemfile:
gem 'gemrat'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gemrat
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
| Reorder usage and installation details | Reorder usage and installation details
| Markdown | mit | DruRly/gemrat | markdown | ## Code Before:
Add the latest version of a gem to your Gemfile from the command line.
* No need to search RubyGems for version numbers
* No need to edit your Gemfile directly
* Gemrat bundles automatically
## Installation
Add this line to your application's Gemfile:
gem 'gemrat'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gemrat
## Usage
Add the latest version of a gem to your Gemfile and bundle. Formated: (gem 'name', 'version')
<pre>
$ gemrat gem_name
</pre>
Add the latest version of sinatra to your Gemfile and bundle
<pre>
$ gemrat sinatra
#=> gem 'sinatra', '1.4.3' added.
#=> Bundling...
</pre>
Add the latest version of rspec to your Gemfile and bundle
<pre>
$ gemrat rspec
#=> gem 'rspec', '2.13.0' added.
#=> Bundling...
</pre>
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
## Instruction:
Reorder usage and installation details
## Code After:
Add the latest version of a gem to your Gemfile from the command line.
* No need to search RubyGems for version numbers
* No need to edit your Gemfile directly
* Gemrat bundles automatically
## Usage
Add the latest version of a gem to your Gemfile and bundle. Formated: (gem 'name', 'version')
<pre>
$ gemrat gem_name
</pre>
Add the latest version of sinatra to your Gemfile and bundle
<pre>
$ gemrat sinatra
#=> gem 'sinatra', '1.4.3' added.
#=> Bundling...
</pre>
Add the latest version of rspec to your Gemfile and bundle
<pre>
$ gemrat rspec
#=> gem 'rspec', '2.13.0' added.
#=> Bundling...
</pre>
## Installation
Add this line to your application's Gemfile:
gem 'gemrat'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gemrat
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
|
Add the latest version of a gem to your Gemfile from the command line.
* No need to search RubyGems for version numbers
* No need to edit your Gemfile directly
* Gemrat bundles automatically
-
-
- ## Installation
-
- Add this line to your application's Gemfile:
-
- gem 'gemrat'
-
- And then execute:
-
- $ bundle
-
- Or install it yourself as:
-
- $ gem install gemrat
## Usage
Add the latest version of a gem to your Gemfile and bundle. Formated: (gem 'name', 'version')
<pre>
$ gemrat gem_name
</pre>
Add the latest version of sinatra to your Gemfile and bundle
<pre>
$ gemrat sinatra
#=> gem 'sinatra', '1.4.3' added.
#=> Bundling...
</pre>
Add the latest version of rspec to your Gemfile and bundle
<pre>
$ gemrat rspec
#=> gem 'rspec', '2.13.0' added.
#=> Bundling...
</pre>
+ ## Installation
+
+ Add this line to your application's Gemfile:
+
+ gem 'gemrat'
+
+ And then execute:
+
+ $ bundle
+
+ Or install it yourself as:
+
+ $ gem install gemrat
+
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request | 29 | 0.568627 | 14 | 15 |
d202d7b2059eb440c044477993a6e0d6aa4d5086 | app/tests/test_device_msg_deserialize.c | app/tests/test_device_msg_deserialize.c | static void test_deserialize_clipboard(void) {
const unsigned char input[] = {
DEVICE_MSG_TYPE_CLIPBOARD,
0x00, 0x03, // text length
0x41, 0x42, 0x43, // "ABC"
};
struct device_msg msg;
ssize_t r = device_msg_deserialize(input, sizeof(input), &msg);
assert(r == 6);
assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD);
assert(msg.clipboard.text);
assert(!strcmp("ABC", msg.clipboard.text));
device_msg_destroy(&msg);
}
int main(void) {
test_deserialize_clipboard();
return 0;
}
|
static void test_deserialize_clipboard(void) {
const unsigned char input[] = {
DEVICE_MSG_TYPE_CLIPBOARD,
0x00, 0x03, // text length
0x41, 0x42, 0x43, // "ABC"
};
struct device_msg msg;
ssize_t r = device_msg_deserialize(input, sizeof(input), &msg);
assert(r == 6);
assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD);
assert(msg.clipboard.text);
assert(!strcmp("ABC", msg.clipboard.text));
device_msg_destroy(&msg);
}
static void test_deserialize_clipboard_big(void) {
unsigned char input[DEVICE_MSG_SERIALIZED_MAX_SIZE];
input[0] = DEVICE_MSG_TYPE_CLIPBOARD;
input[1] = DEVICE_MSG_TEXT_MAX_LENGTH >> 8; // MSB
input[2] = DEVICE_MSG_TEXT_MAX_LENGTH & 0xff; // LSB
memset(input + 3, 'a', DEVICE_MSG_TEXT_MAX_LENGTH);
struct device_msg msg;
ssize_t r = device_msg_deserialize(input, sizeof(input), &msg);
assert(r == DEVICE_MSG_SERIALIZED_MAX_SIZE);
assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD);
assert(msg.clipboard.text);
assert(strlen(msg.clipboard.text) == DEVICE_MSG_TEXT_MAX_LENGTH);
assert(msg.clipboard.text[0] == 'a');
device_msg_destroy(&msg);
}
int main(void) {
test_deserialize_clipboard();
test_deserialize_clipboard_big();
return 0;
}
| Add unit test for big clipboard device message | Add unit test for big clipboard device message
Test clipboard synchronization from the device to the computer.
| C | apache-2.0 | Genymobile/scrcpy,Genymobile/scrcpy,Genymobile/scrcpy | c | ## Code Before:
static void test_deserialize_clipboard(void) {
const unsigned char input[] = {
DEVICE_MSG_TYPE_CLIPBOARD,
0x00, 0x03, // text length
0x41, 0x42, 0x43, // "ABC"
};
struct device_msg msg;
ssize_t r = device_msg_deserialize(input, sizeof(input), &msg);
assert(r == 6);
assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD);
assert(msg.clipboard.text);
assert(!strcmp("ABC", msg.clipboard.text));
device_msg_destroy(&msg);
}
int main(void) {
test_deserialize_clipboard();
return 0;
}
## Instruction:
Add unit test for big clipboard device message
Test clipboard synchronization from the device to the computer.
## Code After:
static void test_deserialize_clipboard(void) {
const unsigned char input[] = {
DEVICE_MSG_TYPE_CLIPBOARD,
0x00, 0x03, // text length
0x41, 0x42, 0x43, // "ABC"
};
struct device_msg msg;
ssize_t r = device_msg_deserialize(input, sizeof(input), &msg);
assert(r == 6);
assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD);
assert(msg.clipboard.text);
assert(!strcmp("ABC", msg.clipboard.text));
device_msg_destroy(&msg);
}
static void test_deserialize_clipboard_big(void) {
unsigned char input[DEVICE_MSG_SERIALIZED_MAX_SIZE];
input[0] = DEVICE_MSG_TYPE_CLIPBOARD;
input[1] = DEVICE_MSG_TEXT_MAX_LENGTH >> 8; // MSB
input[2] = DEVICE_MSG_TEXT_MAX_LENGTH & 0xff; // LSB
memset(input + 3, 'a', DEVICE_MSG_TEXT_MAX_LENGTH);
struct device_msg msg;
ssize_t r = device_msg_deserialize(input, sizeof(input), &msg);
assert(r == DEVICE_MSG_SERIALIZED_MAX_SIZE);
assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD);
assert(msg.clipboard.text);
assert(strlen(msg.clipboard.text) == DEVICE_MSG_TEXT_MAX_LENGTH);
assert(msg.clipboard.text[0] == 'a');
device_msg_destroy(&msg);
}
int main(void) {
test_deserialize_clipboard();
test_deserialize_clipboard_big();
return 0;
}
| +
static void test_deserialize_clipboard(void) {
const unsigned char input[] = {
DEVICE_MSG_TYPE_CLIPBOARD,
0x00, 0x03, // text length
0x41, 0x42, 0x43, // "ABC"
};
struct device_msg msg;
ssize_t r = device_msg_deserialize(input, sizeof(input), &msg);
assert(r == 6);
assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD);
assert(msg.clipboard.text);
assert(!strcmp("ABC", msg.clipboard.text));
device_msg_destroy(&msg);
}
+ static void test_deserialize_clipboard_big(void) {
+ unsigned char input[DEVICE_MSG_SERIALIZED_MAX_SIZE];
+ input[0] = DEVICE_MSG_TYPE_CLIPBOARD;
+ input[1] = DEVICE_MSG_TEXT_MAX_LENGTH >> 8; // MSB
+ input[2] = DEVICE_MSG_TEXT_MAX_LENGTH & 0xff; // LSB
+
+ memset(input + 3, 'a', DEVICE_MSG_TEXT_MAX_LENGTH);
+
+ struct device_msg msg;
+ ssize_t r = device_msg_deserialize(input, sizeof(input), &msg);
+ assert(r == DEVICE_MSG_SERIALIZED_MAX_SIZE);
+
+ assert(msg.type == DEVICE_MSG_TYPE_CLIPBOARD);
+ assert(msg.clipboard.text);
+ assert(strlen(msg.clipboard.text) == DEVICE_MSG_TEXT_MAX_LENGTH);
+ assert(msg.clipboard.text[0] == 'a');
+
+ device_msg_destroy(&msg);
+ }
+
int main(void) {
test_deserialize_clipboard();
+ test_deserialize_clipboard_big();
return 0;
} | 22 | 1 | 22 | 0 |
258d09c40c378fd9c78841050c09420a56145b47 | examples/webgoat/vuln-27/readme.md | examples/webgoat/vuln-27/readme.md | TEST vuln-27.attack
This is a Gauntlt test to check if the vulnerability in WebGoat located at Parameter Tampering => Bypass HTML Field Restrictions (vuln-27) exists.
It will return a
- 1 (error) if the vulnerability is present
- 0 (success) if the vulnerability is fixed (aka not present)
This test assumes 3 things:
(1) That pip is installed.
```
$ sudo apt-get install python-pip
```
(2) That the python requests, json, and sys modules are all installed. The json and sys modules should both be included with python as of version 2.6 and later.
```
$ pip install requests
```
(3) WebGoat is running on http://127.0.0.1:8080/WebGoat/
Testing vuln-27 can be done outside of Gauntlt by navigating to the examples/webgoat/vuln-27/ directory and running:
```
$ python vuln-27.py
```
This Gauntlt test was written by Kyle DeHolton and Bryant Peng on Tues, December 8, 2015.
| TEST vuln-27.attack
This is a Gauntlt test to check if the vulnerability in WebGoat located at Parameter Tampering => Bypass HTML Field Restrictions (vuln-27) exists.
It will return a
- 1 (error) if the vulnerability is present
- 0 (success) if the vulnerability is fixed (aka not present)
This test assumes 5 things:
(1) That pip is installed.
```
$ sudo apt-get install python-pip
```
(2) That the python requests, json, and sys modules are all installed. The json and sys modules should both be included with python as of version 2.6 and later.
```
$ pip install requests
```
(3) WebGoat is running on http://127.0.0.1:8080/WebGoat/
(4) Both files (vuln-27.py and vuln-27.attack) exist in the same directory. They currently do, and should not be separated.
(5) That Gauntlt's running structure and present working directory do not change. Gauntlt must run from tmp/aruba/, two directories down from the directory of the attack file.
Testing vuln-27 can be done outside of Gauntlt by navigating to the examples/webgoat/vuln-27/ directory and running:
```
$ python vuln-27.py
```
This Gauntlt test was written by Kyle DeHolton and Bryant Peng on Tues, December 8, 2015.
| Add to list of assumptions/restrictions to have this work correctly. | Add to list of assumptions/restrictions to have this work correctly.
| Markdown | mit | mtesauro/gauntlt-demo,mtesauro/gauntlt-demo,gauntlt/gauntlt-demo,gauntlt/gauntlt-demo | markdown | ## Code Before:
TEST vuln-27.attack
This is a Gauntlt test to check if the vulnerability in WebGoat located at Parameter Tampering => Bypass HTML Field Restrictions (vuln-27) exists.
It will return a
- 1 (error) if the vulnerability is present
- 0 (success) if the vulnerability is fixed (aka not present)
This test assumes 3 things:
(1) That pip is installed.
```
$ sudo apt-get install python-pip
```
(2) That the python requests, json, and sys modules are all installed. The json and sys modules should both be included with python as of version 2.6 and later.
```
$ pip install requests
```
(3) WebGoat is running on http://127.0.0.1:8080/WebGoat/
Testing vuln-27 can be done outside of Gauntlt by navigating to the examples/webgoat/vuln-27/ directory and running:
```
$ python vuln-27.py
```
This Gauntlt test was written by Kyle DeHolton and Bryant Peng on Tues, December 8, 2015.
## Instruction:
Add to list of assumptions/restrictions to have this work correctly.
## Code After:
TEST vuln-27.attack
This is a Gauntlt test to check if the vulnerability in WebGoat located at Parameter Tampering => Bypass HTML Field Restrictions (vuln-27) exists.
It will return a
- 1 (error) if the vulnerability is present
- 0 (success) if the vulnerability is fixed (aka not present)
This test assumes 5 things:
(1) That pip is installed.
```
$ sudo apt-get install python-pip
```
(2) That the python requests, json, and sys modules are all installed. The json and sys modules should both be included with python as of version 2.6 and later.
```
$ pip install requests
```
(3) WebGoat is running on http://127.0.0.1:8080/WebGoat/
(4) Both files (vuln-27.py and vuln-27.attack) exist in the same directory. They currently do, and should not be separated.
(5) That Gauntlt's running structure and present working directory do not change. Gauntlt must run from tmp/aruba/, two directories down from the directory of the attack file.
Testing vuln-27 can be done outside of Gauntlt by navigating to the examples/webgoat/vuln-27/ directory and running:
```
$ python vuln-27.py
```
This Gauntlt test was written by Kyle DeHolton and Bryant Peng on Tues, December 8, 2015.
| TEST vuln-27.attack
This is a Gauntlt test to check if the vulnerability in WebGoat located at Parameter Tampering => Bypass HTML Field Restrictions (vuln-27) exists.
It will return a
- 1 (error) if the vulnerability is present
- 0 (success) if the vulnerability is fixed (aka not present)
- This test assumes 3 things:
? ^
+ This test assumes 5 things:
? ^
(1) That pip is installed.
```
$ sudo apt-get install python-pip
```
(2) That the python requests, json, and sys modules are all installed. The json and sys modules should both be included with python as of version 2.6 and later.
```
$ pip install requests
```
(3) WebGoat is running on http://127.0.0.1:8080/WebGoat/
+ (4) Both files (vuln-27.py and vuln-27.attack) exist in the same directory. They currently do, and should not be separated.
+
+ (5) That Gauntlt's running structure and present working directory do not change. Gauntlt must run from tmp/aruba/, two directories down from the directory of the attack file.
+
Testing vuln-27 can be done outside of Gauntlt by navigating to the examples/webgoat/vuln-27/ directory and running:
```
$ python vuln-27.py
```
This Gauntlt test was written by Kyle DeHolton and Bryant Peng on Tues, December 8, 2015. | 6 | 0.193548 | 5 | 1 |
c2f407a53ad1de0787bb8a7c709018007db35176 | .idea/runConfigurations/Generate_Documentation.xml | .idea/runConfigurations/Generate_Documentation.xml | <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Documentation" type="docs" factoryName="Sphinx task">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="engineer" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="docutils_input_file" value="C:\Users\Tyler\Code\engineer\engineer\docs_source" />
<option name="docutils_output_file" value="C:\Users\Tyler\Code\engineer\docs" />
<option name="docutils_params" value="" />
<option name="docutils_task" value="html" />
<option name="docutils_open_in_browser" value="false" />
<RunnerSettings RunnerId="PythonRunner" />
<ConfigurationWrapper RunnerId="PythonRunner" />
<method />
</configuration>
</component> | <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Documentation" type="docs" factoryName="Sphinx task">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="engineer" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="docutils_input_file" value="./engineer/docs_source" />
<option name="docutils_output_file" value="./docs" />
<option name="docutils_params" value="" />
<option name="docutils_task" value="html" />
<option name="docutils_open_in_browser" value="false" />
<RunnerSettings RunnerId="PythonRunner" />
<ConfigurationWrapper RunnerId="PythonRunner" />
<method />
</configuration>
</component> | Update docgen PyCharm config to be more portable. | Update docgen PyCharm config to be more portable.
| XML | mit | tylerbutler/engineer,tylerbutler/engineer,tylerbutler/engineer | xml | ## Code Before:
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Documentation" type="docs" factoryName="Sphinx task">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="engineer" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="docutils_input_file" value="C:\Users\Tyler\Code\engineer\engineer\docs_source" />
<option name="docutils_output_file" value="C:\Users\Tyler\Code\engineer\docs" />
<option name="docutils_params" value="" />
<option name="docutils_task" value="html" />
<option name="docutils_open_in_browser" value="false" />
<RunnerSettings RunnerId="PythonRunner" />
<ConfigurationWrapper RunnerId="PythonRunner" />
<method />
</configuration>
</component>
## Instruction:
Update docgen PyCharm config to be more portable.
## Code After:
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Documentation" type="docs" factoryName="Sphinx task">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="engineer" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
<option name="docutils_input_file" value="./engineer/docs_source" />
<option name="docutils_output_file" value="./docs" />
<option name="docutils_params" value="" />
<option name="docutils_task" value="html" />
<option name="docutils_open_in_browser" value="false" />
<RunnerSettings RunnerId="PythonRunner" />
<ConfigurationWrapper RunnerId="PythonRunner" />
<method />
</configuration>
</component> | <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Generate Documentation" type="docs" factoryName="Sphinx task">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs />
<option name="SDK_HOME" value="" />
- <option name="WORKING_DIRECTORY" value="" />
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
? +++++++++++++
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<module name="engineer" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
- <option name="docutils_input_file" value="C:\Users\Tyler\Code\engineer\engineer\docs_source" />
? ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^
+ <option name="docutils_input_file" value="./engineer/docs_source" />
? ^^ ^
- <option name="docutils_output_file" value="C:\Users\Tyler\Code\engineer\docs" />
? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ <option name="docutils_output_file" value="./docs" />
? ^^
<option name="docutils_params" value="" />
<option name="docutils_task" value="html" />
<option name="docutils_open_in_browser" value="false" />
<RunnerSettings RunnerId="PythonRunner" />
<ConfigurationWrapper RunnerId="PythonRunner" />
<method />
</configuration>
</component> | 6 | 0.272727 | 3 | 3 |
4523cbe19ac7c0c017eebbebaa32193bbd5cc86c | README.md | README.md |
Basically, you don't want to learn too much when you pick a boilerplate. Clone and start the prototyping.
### Installation
To install the latest release
```bash
$ npm install ts-express-angular2-node-boilerplate
```
Install the dependencies
```bash
$ npm install
```
### Scripts
- **npm start**: Start a server without watching the typescript files.
- **npm run dev**: Start a server and watch the change in typescript files concurrently.
- **npm run tsc**: Compile the typescript files.
- **npm run tsc:w**: Compile and watch the typescript files.
### Help
- [Update the typings package](https://github.com/typings/typings/issues/109)
### Note
You can access localhost:3000 to see the simple hello-world example. Feel free to clone this boilerplate and use it. Fork it if you would like to add more features.
### License
[MIT](LICENSE)
### Copyright
Copyright (C) 2016 Tony Ngan, released under the MIT License.
|
Basically, you don't want to learn too much when you pick a boilerplate. Clone and start the prototyping.
This boilerplate is built on top of [5 Min Quickstart](https://angular.io/docs/ts/latest/quickstart.html).
### Installation
To install the latest release
```bash
$ npm install ts-express-angular2-node-boilerplate
```
Install the dependencies
```bash
$ npm install
```
### Scripts
- **npm start**: Start a server without watching the typescript files.
- **npm run dev**: Start a server and watch the change in typescript files concurrently.
- **npm run tsc**: Compile the typescript files.
- **npm run tsc:w**: Compile and watch the typescript files.
### Help
- [Update the typings package](https://github.com/typings/typings/issues/109)
### Note
You can access localhost:3000 to see the simple hello-world example. Feel free to clone this boilerplate and use it. Fork it if you would like to add more features.
### License
[MIT](LICENSE)
### Copyright
Copyright (C) 2016 Tony Ngan, released under the MIT License.
| Add back reference of 5 mins quickstart | Add back reference of 5 mins quickstart | Markdown | mit | tngan/ts-express-angular2-node-boilerplate,tngan/ts-express-angular2-node-boilerplate,tngan/ts-express-angular2-node-boilerplate | markdown | ## Code Before:
Basically, you don't want to learn too much when you pick a boilerplate. Clone and start the prototyping.
### Installation
To install the latest release
```bash
$ npm install ts-express-angular2-node-boilerplate
```
Install the dependencies
```bash
$ npm install
```
### Scripts
- **npm start**: Start a server without watching the typescript files.
- **npm run dev**: Start a server and watch the change in typescript files concurrently.
- **npm run tsc**: Compile the typescript files.
- **npm run tsc:w**: Compile and watch the typescript files.
### Help
- [Update the typings package](https://github.com/typings/typings/issues/109)
### Note
You can access localhost:3000 to see the simple hello-world example. Feel free to clone this boilerplate and use it. Fork it if you would like to add more features.
### License
[MIT](LICENSE)
### Copyright
Copyright (C) 2016 Tony Ngan, released under the MIT License.
## Instruction:
Add back reference of 5 mins quickstart
## Code After:
Basically, you don't want to learn too much when you pick a boilerplate. Clone and start the prototyping.
This boilerplate is built on top of [5 Min Quickstart](https://angular.io/docs/ts/latest/quickstart.html).
### Installation
To install the latest release
```bash
$ npm install ts-express-angular2-node-boilerplate
```
Install the dependencies
```bash
$ npm install
```
### Scripts
- **npm start**: Start a server without watching the typescript files.
- **npm run dev**: Start a server and watch the change in typescript files concurrently.
- **npm run tsc**: Compile the typescript files.
- **npm run tsc:w**: Compile and watch the typescript files.
### Help
- [Update the typings package](https://github.com/typings/typings/issues/109)
### Note
You can access localhost:3000 to see the simple hello-world example. Feel free to clone this boilerplate and use it. Fork it if you would like to add more features.
### License
[MIT](LICENSE)
### Copyright
Copyright (C) 2016 Tony Ngan, released under the MIT License.
|
Basically, you don't want to learn too much when you pick a boilerplate. Clone and start the prototyping.
+
+ This boilerplate is built on top of [5 Min Quickstart](https://angular.io/docs/ts/latest/quickstart.html).
### Installation
To install the latest release
```bash
$ npm install ts-express-angular2-node-boilerplate
```
Install the dependencies
```bash
$ npm install
```
### Scripts
- **npm start**: Start a server without watching the typescript files.
- **npm run dev**: Start a server and watch the change in typescript files concurrently.
- **npm run tsc**: Compile the typescript files.
- **npm run tsc:w**: Compile and watch the typescript files.
### Help
- [Update the typings package](https://github.com/typings/typings/issues/109)
### Note
You can access localhost:3000 to see the simple hello-world example. Feel free to clone this boilerplate and use it. Fork it if you would like to add more features.
### License
[MIT](LICENSE)
### Copyright
Copyright (C) 2016 Tony Ngan, released under the MIT License. | 2 | 0.054054 | 2 | 0 |
0879f775bc769994326ef058b0a5e13de556ea23 | .github/workflows/tests.yml | .github/workflows/tests.yml | name: Tests
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
python:
- "3.6"
- "3.7"
- "3.8"
django:
- "2.2.20"
- "3.1.8"
- "3.2"
drf:
- "no"
- "3.12.4"
name: "Python ${{ matrix.python }} - Django ${{ matrix.django }} - DRF ${{ matrix.drf }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
pip install -r ci/requirements.txt
pip install --upgrade "Django==${{ matrix.django }}"
if [[ "$DRF_VERSION" != "no" ]]; then pip install --upgrade djangorestframework==${DRF_VERSION}; fi
env:
DRF_VERSION: ${{ matrix.drf }}
- name: Run Tests
run: tox -e ${{ matrix.versions.env }} | name: Tests
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
python:
- "3.6"
- "3.7"
- "3.8"
django:
- "2.2.20"
- "3.1.8"
- "3.2"
drf:
- "no"
- "3.12.4"
name: "Python ${{ matrix.python }} - Django ${{ matrix.django }} - DRF ${{ matrix.drf }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
pip install -r ci/requirements.txt
pip install --upgrade "Django==${{ matrix.django }}"
if [[ "$DRF_VERSION" != "no" ]]; then pip install --upgrade djangorestframework==${DRF_VERSION}; fi
env:
DRF_VERSION: ${{ matrix.drf }}
- name: Run Tests
run: python runtests.py | MIgrate CI to GitHub actions | MIgrate CI to GitHub actions | YAML | mit | nshafer/django-hashid-field,nshafer/django-hashid-field | yaml | ## Code Before:
name: Tests
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
python:
- "3.6"
- "3.7"
- "3.8"
django:
- "2.2.20"
- "3.1.8"
- "3.2"
drf:
- "no"
- "3.12.4"
name: "Python ${{ matrix.python }} - Django ${{ matrix.django }} - DRF ${{ matrix.drf }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
pip install -r ci/requirements.txt
pip install --upgrade "Django==${{ matrix.django }}"
if [[ "$DRF_VERSION" != "no" ]]; then pip install --upgrade djangorestframework==${DRF_VERSION}; fi
env:
DRF_VERSION: ${{ matrix.drf }}
- name: Run Tests
run: tox -e ${{ matrix.versions.env }}
## Instruction:
MIgrate CI to GitHub actions
## Code After:
name: Tests
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
python:
- "3.6"
- "3.7"
- "3.8"
django:
- "2.2.20"
- "3.1.8"
- "3.2"
drf:
- "no"
- "3.12.4"
name: "Python ${{ matrix.python }} - Django ${{ matrix.django }} - DRF ${{ matrix.drf }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
pip install -r ci/requirements.txt
pip install --upgrade "Django==${{ matrix.django }}"
if [[ "$DRF_VERSION" != "no" ]]; then pip install --upgrade djangorestframework==${DRF_VERSION}; fi
env:
DRF_VERSION: ${{ matrix.drf }}
- name: Run Tests
run: python runtests.py | name: Tests
on:
push:
pull_request:
jobs:
test:
strategy:
fail-fast: false
matrix:
python:
- "3.6"
- "3.7"
- "3.8"
django:
- "2.2.20"
- "3.1.8"
- "3.2"
drf:
- "no"
- "3.12.4"
name: "Python ${{ matrix.python }} - Django ${{ matrix.django }} - DRF ${{ matrix.drf }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
pip install -r ci/requirements.txt
pip install --upgrade "Django==${{ matrix.django }}"
if [[ "$DRF_VERSION" != "no" ]]; then pip install --upgrade djangorestframework==${DRF_VERSION}; fi
env:
DRF_VERSION: ${{ matrix.drf }}
- name: Run Tests
- run: tox -e ${{ matrix.versions.env }}
+ run: python runtests.py | 2 | 0.05 | 1 | 1 |
d866b11bc84783f370d3efa3b20dfeb9ab5f9cca | components/TopNavBar.js | components/TopNavBar.js | import React from 'react'
class Nav extends React.Component {
componentDidMount() {
// initSideNav()
}
render() {
return (
<div>
<p className="tc bg-white ma0 pa3 f1 helvetica head-text">Alumnus</p>
<style jsx>{`
.head-text{
color: #094E62;
-webkit-box-shadow: 0px 6px 5px 0px #ccc;
-moz-box-shadow: 0px 6px 5px 0px #ccc;
box-shadow: 0px 6px 5px 0px #ccc;
}
`}
</style>
</div>
)
}
}
export default Nav
| import React from 'react'
class Nav extends React.Component {
componentDidMount() {
// initSideNav()
}
render() {
return (
<div>
<p className="tc bg-white ma0 pa3 f1 helvetica shadow-3 custom-color">Alumnus</p>
<style jsx>{`
.custom-color {
color: #094E62;
}
`}</style>
</div>
)
}
}
export default Nav
| Replace custom shadow with Tachyon shadow class | Replace custom shadow with Tachyon shadow class
| JavaScript | mit | efleurine/alumnus | javascript | ## Code Before:
import React from 'react'
class Nav extends React.Component {
componentDidMount() {
// initSideNav()
}
render() {
return (
<div>
<p className="tc bg-white ma0 pa3 f1 helvetica head-text">Alumnus</p>
<style jsx>{`
.head-text{
color: #094E62;
-webkit-box-shadow: 0px 6px 5px 0px #ccc;
-moz-box-shadow: 0px 6px 5px 0px #ccc;
box-shadow: 0px 6px 5px 0px #ccc;
}
`}
</style>
</div>
)
}
}
export default Nav
## Instruction:
Replace custom shadow with Tachyon shadow class
## Code After:
import React from 'react'
class Nav extends React.Component {
componentDidMount() {
// initSideNav()
}
render() {
return (
<div>
<p className="tc bg-white ma0 pa3 f1 helvetica shadow-3 custom-color">Alumnus</p>
<style jsx>{`
.custom-color {
color: #094E62;
}
`}</style>
</div>
)
}
}
export default Nav
| import React from 'react'
class Nav extends React.Component {
componentDidMount() {
// initSideNav()
}
render() {
return (
<div>
- <p className="tc bg-white ma0 pa3 f1 helvetica head-text">Alumnus</p>
? - ^^^
+ <p className="tc bg-white ma0 pa3 f1 helvetica shadow-3 custom-color">Alumnus</p>
? + ++ +++++ ^^^^^^^^
<style jsx>{`
- .head-text{
+ .custom-color {
- color: #094E62;
? ----
+ color: #094E62;
- -webkit-box-shadow: 0px 6px 5px 0px #ccc;
- -moz-box-shadow: 0px 6px 5px 0px #ccc;
- box-shadow: 0px 6px 5px 0px #ccc;
- }
? ----
+ }
- `}
- </style>
+ `}</style>
? ++
</div>
)
}
}
export default Nav | 14 | 0.538462 | 5 | 9 |
a30aa6e90dfa1abe1f98defbd255439cc663c9ef | install.sh | install.sh |
for name in *; do
if [ ! $name == "README.md" -a ! $name == "install.sh" ]; then
target="$HOME/.$name"
if [ -h $target ]; then
rm $target
elif [ -d $target ]; then
rm -rf $target
fi
ln -s "$PWD/$name" "$target"
echo "Linked $PWD/$name to $target."
fi
done
# Bootstrap the environment
echo "####### installing homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "####### installing git"
brew install git
echo "####### python"
pip install -U pip
pip install -r ~/.requirements.txt
echo "####### installing pipsi"
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python2.7
~/.pipsi
echo "####### installing jshint globally via npm"
npm install -g jshint
|
for name in *; do
if [ ! $name == "README.md" -a ! $name == "install.sh" ]; then
target="$HOME/.$name"
if [ -h $target ]; then
rm $target
elif [ -d $target ]; then
rm -rf $target
fi
ln -s "$PWD/$name" "$target"
echo "Linked $PWD/$name to $target."
fi
done
# Bootstrap the environment
echo "####### installing homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "####### installing git"
brew install git
echo "####### homebrewing the world"
bash ~/.brew
echo "####### python"
pip install -U pip
pip install -r ~/.requirements.txt
echo "####### installing pipsi"
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python2.7
~/.pipsi
echo "####### installing jshint globally via npm"
npm install -g jshint
| Add command to run brew requirements. | Add command to run brew requirements.
| Shell | bsd-3-clause | jonathanchu/dotfiles,jonathanchu/dotfiles,jonathanchu/dotfiles | shell | ## Code Before:
for name in *; do
if [ ! $name == "README.md" -a ! $name == "install.sh" ]; then
target="$HOME/.$name"
if [ -h $target ]; then
rm $target
elif [ -d $target ]; then
rm -rf $target
fi
ln -s "$PWD/$name" "$target"
echo "Linked $PWD/$name to $target."
fi
done
# Bootstrap the environment
echo "####### installing homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "####### installing git"
brew install git
echo "####### python"
pip install -U pip
pip install -r ~/.requirements.txt
echo "####### installing pipsi"
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python2.7
~/.pipsi
echo "####### installing jshint globally via npm"
npm install -g jshint
## Instruction:
Add command to run brew requirements.
## Code After:
for name in *; do
if [ ! $name == "README.md" -a ! $name == "install.sh" ]; then
target="$HOME/.$name"
if [ -h $target ]; then
rm $target
elif [ -d $target ]; then
rm -rf $target
fi
ln -s "$PWD/$name" "$target"
echo "Linked $PWD/$name to $target."
fi
done
# Bootstrap the environment
echo "####### installing homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "####### installing git"
brew install git
echo "####### homebrewing the world"
bash ~/.brew
echo "####### python"
pip install -U pip
pip install -r ~/.requirements.txt
echo "####### installing pipsi"
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python2.7
~/.pipsi
echo "####### installing jshint globally via npm"
npm install -g jshint
|
for name in *; do
if [ ! $name == "README.md" -a ! $name == "install.sh" ]; then
target="$HOME/.$name"
if [ -h $target ]; then
rm $target
elif [ -d $target ]; then
rm -rf $target
fi
ln -s "$PWD/$name" "$target"
echo "Linked $PWD/$name to $target."
fi
done
# Bootstrap the environment
echo "####### installing homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "####### installing git"
brew install git
+ echo "####### homebrewing the world"
+ bash ~/.brew
+
echo "####### python"
pip install -U pip
pip install -r ~/.requirements.txt
echo "####### installing pipsi"
curl https://raw.githubusercontent.com/mitsuhiko/pipsi/master/get-pipsi.py | python2.7
~/.pipsi
echo "####### installing jshint globally via npm"
npm install -g jshint | 3 | 0.090909 | 3 | 0 |
a0861b328f1eae418a0613f8e1f1d99aa788a2e6 | k8s/havenapi-deployment.yaml | k8s/havenapi-deployment.yaml | ---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: havenapi
spec:
replicas: 1
template:
metadata:
annotations:
alpha.image.policy.openshift.io/resolve-names: '*'
labels:
service: havenapi
spec:
containers:
- name: havenapi
image: havengrc-docker.jfrog.io/kindlyops/havenapi:0.0.5
env:
- name: GO_ENV
value: "production"
- name: DATABASE_HOST
value: "db"
- name: DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: haven-database-credentials
key: username
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: haven-database-credentials
key: password
- name: HAVEN_JWK_PATH
value: "/etc/haven-credentials/jwk.json"
volumeMounts:
- name: secret-volume
mountPath: /etc/haven-credentials/
readOnly: true
ports:
- containerPort: 3000
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: 3000
initialDelaySeconds: 1
periodSeconds: 5
volumes:
- name: secret-volume
secret:
secretName: haven-database-credentials
restartPolicy: Always
strategy:
type: "Recreate"
paused: false
revisionHistoryLimit: 2
minReadySeconds: 0
status: {}
| ---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: havenapi
spec:
replicas: 1
template:
metadata:
annotations:
alpha.image.policy.openshift.io/resolve-names: '*'
labels:
service: havenapi
spec:
containers:
- name: havenapi
image: havengrc-docker.jfrog.io/kindlyops/havenapi:latest
env:
- name: GO_ENV
value: "production"
- name: DATABASE_HOST
value: "db"
- name: DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: haven-database-credentials
key: username
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: haven-database-credentials
key: password
- name: HAVEN_JWK_PATH
value: "/etc/haven-credentials/jwk.json"
volumeMounts:
- name: secret-volume
mountPath: /etc/haven-credentials/
readOnly: true
ports:
- containerPort: 3000
protocol: TCP
resources:
limits:
memory: 256Mi
requests:
memory: 128Mi
livenessProbe:
httpGet:
path: /healthz
port: 3000
initialDelaySeconds: 1
periodSeconds: 5
volumes:
- name: secret-volume
secret:
secretName: haven-database-credentials
restartPolicy: Always
strategy:
type: "Recreate"
paused: false
revisionHistoryLimit: 2
minReadySeconds: 0
status: {}
| Add resource limits for HavenAPI pods | Add resource limits for HavenAPI pods
Signed-off-by: Elliot Murphy <014ce8fab4ab9f8a957bfe9f974379093994de97@users.noreply.github.com>
| YAML | apache-2.0 | kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi | yaml | ## Code Before:
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: havenapi
spec:
replicas: 1
template:
metadata:
annotations:
alpha.image.policy.openshift.io/resolve-names: '*'
labels:
service: havenapi
spec:
containers:
- name: havenapi
image: havengrc-docker.jfrog.io/kindlyops/havenapi:0.0.5
env:
- name: GO_ENV
value: "production"
- name: DATABASE_HOST
value: "db"
- name: DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: haven-database-credentials
key: username
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: haven-database-credentials
key: password
- name: HAVEN_JWK_PATH
value: "/etc/haven-credentials/jwk.json"
volumeMounts:
- name: secret-volume
mountPath: /etc/haven-credentials/
readOnly: true
ports:
- containerPort: 3000
protocol: TCP
livenessProbe:
httpGet:
path: /healthz
port: 3000
initialDelaySeconds: 1
periodSeconds: 5
volumes:
- name: secret-volume
secret:
secretName: haven-database-credentials
restartPolicy: Always
strategy:
type: "Recreate"
paused: false
revisionHistoryLimit: 2
minReadySeconds: 0
status: {}
## Instruction:
Add resource limits for HavenAPI pods
Signed-off-by: Elliot Murphy <014ce8fab4ab9f8a957bfe9f974379093994de97@users.noreply.github.com>
## Code After:
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: havenapi
spec:
replicas: 1
template:
metadata:
annotations:
alpha.image.policy.openshift.io/resolve-names: '*'
labels:
service: havenapi
spec:
containers:
- name: havenapi
image: havengrc-docker.jfrog.io/kindlyops/havenapi:latest
env:
- name: GO_ENV
value: "production"
- name: DATABASE_HOST
value: "db"
- name: DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: haven-database-credentials
key: username
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: haven-database-credentials
key: password
- name: HAVEN_JWK_PATH
value: "/etc/haven-credentials/jwk.json"
volumeMounts:
- name: secret-volume
mountPath: /etc/haven-credentials/
readOnly: true
ports:
- containerPort: 3000
protocol: TCP
resources:
limits:
memory: 256Mi
requests:
memory: 128Mi
livenessProbe:
httpGet:
path: /healthz
port: 3000
initialDelaySeconds: 1
periodSeconds: 5
volumes:
- name: secret-volume
secret:
secretName: haven-database-credentials
restartPolicy: Always
strategy:
type: "Recreate"
paused: false
revisionHistoryLimit: 2
minReadySeconds: 0
status: {}
| ---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: havenapi
spec:
replicas: 1
template:
metadata:
annotations:
alpha.image.policy.openshift.io/resolve-names: '*'
labels:
service: havenapi
spec:
containers:
- name: havenapi
- image: havengrc-docker.jfrog.io/kindlyops/havenapi:0.0.5
? ^^^^^
+ image: havengrc-docker.jfrog.io/kindlyops/havenapi:latest
? ^^^^^^
env:
- name: GO_ENV
value: "production"
- name: DATABASE_HOST
value: "db"
- name: DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: haven-database-credentials
key: username
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: haven-database-credentials
key: password
- name: HAVEN_JWK_PATH
value: "/etc/haven-credentials/jwk.json"
volumeMounts:
- name: secret-volume
mountPath: /etc/haven-credentials/
readOnly: true
ports:
- containerPort: 3000
protocol: TCP
+ resources:
+ limits:
+ memory: 256Mi
+ requests:
+ memory: 128Mi
livenessProbe:
httpGet:
path: /healthz
port: 3000
initialDelaySeconds: 1
periodSeconds: 5
volumes:
- name: secret-volume
secret:
secretName: haven-database-credentials
restartPolicy: Always
strategy:
type: "Recreate"
paused: false
revisionHistoryLimit: 2
minReadySeconds: 0
status: {} | 7 | 0.12069 | 6 | 1 |
7e5690aa339af31c686d5a8d367e56305fdaeef5 | README.md | README.md |
[](https://gitter.im/trump-tracker/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Setup
Install [Jekyll](https://jekyllrb.com/) and Bundler:
gem install jekyll bundler
bundle exec jekyll serve
Site is now running at [localhost:4000](http://localhost:4000)
# To Do List
1. Add Spanish Version
2. ~~Cleaner way to add and handle policies (not hardcode it...)~~
3. ~~Fuzzy Search functionality for policies~~
4. ~~Comment section -- Reddit Integration (might be too toxic)~~
5. Sign up for weekly/ bi-weekly updates when his term begins.
6. ~~Database for Policies -- top of the agenda~~
7. ~~Add Open Source Links and Credits on Footer~~
8. Clean up duplicates, if any.
9. Implement functionality to let me click on the "broken", "in progress", "achieved" categories so I can see which things fall into those categories.
10. Rich data so Google can parse it. Maybe something on http://schema.org/?
# Report Issues
1. Pull Request would be the best option.
2. Otherwise you can email me @ {firstName}.{lastName}+trump@gmail.com |
[](https://gitter.im/trump-tracker/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Setup
Install [Jekyll](https://jekyllrb.com/) and Bundler:
gem install jekyll bundler
bundle install
bundle exec jekyll serve
Site is now running at [localhost:4000](http://localhost:4000)
# To Do List
1. Add Spanish Version
2. ~~Cleaner way to add and handle policies (not hardcode it...)~~
3. ~~Fuzzy Search functionality for policies~~
4. ~~Comment section -- Reddit Integration (might be too toxic)~~
5. Sign up for weekly/ bi-weekly updates when his term begins.
6. ~~Database for Policies -- top of the agenda~~
7. ~~Add Open Source Links and Credits on Footer~~
8. Clean up duplicates, if any.
9. Implement functionality to let me click on the "broken", "in progress", "achieved" categories so I can see which things fall into those categories.
10. Rich data so Google can parse it. Maybe something on http://schema.org/?
# Report Issues
1. Pull Request would be the best option.
2. Otherwise you can email me @ {firstName}.{lastName}+trump@gmail.com
| Add install instructions about running bundle install (for those new to bundler) | Add install instructions about running bundle install (for those new to bundler)
| Markdown | mit | TrumpTracker/trumptracker.github.io,StarCitizenTracker/StarCitizenTracker.github.io,StarCitizenTracker/StarCitizenTracker.github.io,StarCitizenTracker/StarCitizenTracker.github.io,TrumpTracker/trumptracker.github.io,TrumpTracker/trumptracker.github.io,StarCitizenTracker/StarCitizenTracker.github.io | markdown | ## Code Before:
[](https://gitter.im/trump-tracker/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Setup
Install [Jekyll](https://jekyllrb.com/) and Bundler:
gem install jekyll bundler
bundle exec jekyll serve
Site is now running at [localhost:4000](http://localhost:4000)
# To Do List
1. Add Spanish Version
2. ~~Cleaner way to add and handle policies (not hardcode it...)~~
3. ~~Fuzzy Search functionality for policies~~
4. ~~Comment section -- Reddit Integration (might be too toxic)~~
5. Sign up for weekly/ bi-weekly updates when his term begins.
6. ~~Database for Policies -- top of the agenda~~
7. ~~Add Open Source Links and Credits on Footer~~
8. Clean up duplicates, if any.
9. Implement functionality to let me click on the "broken", "in progress", "achieved" categories so I can see which things fall into those categories.
10. Rich data so Google can parse it. Maybe something on http://schema.org/?
# Report Issues
1. Pull Request would be the best option.
2. Otherwise you can email me @ {firstName}.{lastName}+trump@gmail.com
## Instruction:
Add install instructions about running bundle install (for those new to bundler)
## Code After:
[](https://gitter.im/trump-tracker/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Setup
Install [Jekyll](https://jekyllrb.com/) and Bundler:
gem install jekyll bundler
bundle install
bundle exec jekyll serve
Site is now running at [localhost:4000](http://localhost:4000)
# To Do List
1. Add Spanish Version
2. ~~Cleaner way to add and handle policies (not hardcode it...)~~
3. ~~Fuzzy Search functionality for policies~~
4. ~~Comment section -- Reddit Integration (might be too toxic)~~
5. Sign up for weekly/ bi-weekly updates when his term begins.
6. ~~Database for Policies -- top of the agenda~~
7. ~~Add Open Source Links and Credits on Footer~~
8. Clean up duplicates, if any.
9. Implement functionality to let me click on the "broken", "in progress", "achieved" categories so I can see which things fall into those categories.
10. Rich data so Google can parse it. Maybe something on http://schema.org/?
# Report Issues
1. Pull Request would be the best option.
2. Otherwise you can email me @ {firstName}.{lastName}+trump@gmail.com
|
[](https://gitter.im/trump-tracker/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
# Setup
Install [Jekyll](https://jekyllrb.com/) and Bundler:
gem install jekyll bundler
+ bundle install
bundle exec jekyll serve
Site is now running at [localhost:4000](http://localhost:4000)
# To Do List
1. Add Spanish Version
2. ~~Cleaner way to add and handle policies (not hardcode it...)~~
3. ~~Fuzzy Search functionality for policies~~
4. ~~Comment section -- Reddit Integration (might be too toxic)~~
5. Sign up for weekly/ bi-weekly updates when his term begins.
6. ~~Database for Policies -- top of the agenda~~
7. ~~Add Open Source Links and Credits on Footer~~
8. Clean up duplicates, if any.
9. Implement functionality to let me click on the "broken", "in progress", "achieved" categories so I can see which things fall into those categories.
10. Rich data so Google can parse it. Maybe something on http://schema.org/?
# Report Issues
1. Pull Request would be the best option.
2. Otherwise you can email me @ {firstName}.{lastName}+trump@gmail.com | 1 | 0.038462 | 1 | 0 |
fa858b1b1b8291b7e9966d57e66f508f01789e85 | .travis.yml | .travis.yml | language: python
python:
- "3.4"
- "3.5"
- "3.6"
cache: pip
env:
- SET="-m logic"
- SET="-m live"
- SET="-m destructive"
install:
- pip install --quiet -r requirements.txt -r test_requirements.txt
before_script:
- mkdir -p $HOME/$DEST
- curl -u $KEY $HOST/$FILE > $HOME/$DEST/$FILE
script:
- coverage run setup.py test --addopts "--profile $SET"
after_success:
- coveralls
before_deploy:
- echo "[gist]\ntoken: $GIST" > $HOME/.gist
deploy:
provider: script
script: gist create "Travis $TRAVIS_REPO_SLUG $TRAVIS_JOB_NUMBER $SET" prof/combined.svg
| language: python
python:
- "3.4"
- "3.5"
- "3.6"
cache: pip
env:
- SET="-m logic"
- SET="-m live"
- SET="-m destructive"
install:
- pip install --quiet -r requirements.txt -r test_requirements.txt
before_script:
- mkdir -p $HOME/$DEST
- curl -u $KEY $HOST/$FILE > $HOME/$DEST/$FILE
script:
- coverage run setup.py test --addopts "--profile $SET"
after_success:
- coveralls
before_deploy:
- echo "[gist]\ntoken: $GIST" > $HOME/.gist
deploy:
provider: script
script: gist create "Travis $TRAVIS_REPO_SLUG $TRAVIS_JOB_NUMBER $SET" prof/combined.svg
on:
all-branches: true
repo: Artanicus/python-cozify
| Allow profiling deploy on all branches but limit by repo | Allow profiling deploy on all branches but limit by repo
| YAML | mit | Artanicus/python-cozify,Artanicus/python-cozify | yaml | ## Code Before:
language: python
python:
- "3.4"
- "3.5"
- "3.6"
cache: pip
env:
- SET="-m logic"
- SET="-m live"
- SET="-m destructive"
install:
- pip install --quiet -r requirements.txt -r test_requirements.txt
before_script:
- mkdir -p $HOME/$DEST
- curl -u $KEY $HOST/$FILE > $HOME/$DEST/$FILE
script:
- coverage run setup.py test --addopts "--profile $SET"
after_success:
- coveralls
before_deploy:
- echo "[gist]\ntoken: $GIST" > $HOME/.gist
deploy:
provider: script
script: gist create "Travis $TRAVIS_REPO_SLUG $TRAVIS_JOB_NUMBER $SET" prof/combined.svg
## Instruction:
Allow profiling deploy on all branches but limit by repo
## Code After:
language: python
python:
- "3.4"
- "3.5"
- "3.6"
cache: pip
env:
- SET="-m logic"
- SET="-m live"
- SET="-m destructive"
install:
- pip install --quiet -r requirements.txt -r test_requirements.txt
before_script:
- mkdir -p $HOME/$DEST
- curl -u $KEY $HOST/$FILE > $HOME/$DEST/$FILE
script:
- coverage run setup.py test --addopts "--profile $SET"
after_success:
- coveralls
before_deploy:
- echo "[gist]\ntoken: $GIST" > $HOME/.gist
deploy:
provider: script
script: gist create "Travis $TRAVIS_REPO_SLUG $TRAVIS_JOB_NUMBER $SET" prof/combined.svg
on:
all-branches: true
repo: Artanicus/python-cozify
| language: python
python:
- "3.4"
- "3.5"
- "3.6"
cache: pip
env:
- SET="-m logic"
- SET="-m live"
- SET="-m destructive"
install:
- pip install --quiet -r requirements.txt -r test_requirements.txt
before_script:
- mkdir -p $HOME/$DEST
- curl -u $KEY $HOST/$FILE > $HOME/$DEST/$FILE
script:
- coverage run setup.py test --addopts "--profile $SET"
after_success:
- coveralls
before_deploy:
- echo "[gist]\ntoken: $GIST" > $HOME/.gist
deploy:
provider: script
script: gist create "Travis $TRAVIS_REPO_SLUG $TRAVIS_JOB_NUMBER $SET" prof/combined.svg
+ on:
+ all-branches: true
+ repo: Artanicus/python-cozify | 3 | 0.096774 | 3 | 0 |
60da9358ab8263c7f6f5a3625c55746576140aca | layout/default/FormField/Textarea/default.less | layout/default/FormField/Textarea/default.less | [placeholder]:empty::after {
color: @colorInputPlaceholder;
content: attr(placeholder);
pointer-events: none;
}
| [placeholder]:empty::before {
color: @colorInputPlaceholder;
content: attr(placeholder);
pointer-events: none;
position: absolute;
}
| Fix caret positioning bug that makes the contenteditabe unusable in FF (still causes a small bug) | Fix caret positioning bug that makes the contenteditabe unusable in FF (still causes a small bug)
| Less | mit | njam/CM,fauvel/CM,cargomedia/CM,cargomedia/CM,cargomedia/CM,njam/CM,cargomedia/CM,fauvel/CM,njam/CM,fauvel/CM,fauvel/CM,njam/CM,fauvel/CM,njam/CM | less | ## Code Before:
[placeholder]:empty::after {
color: @colorInputPlaceholder;
content: attr(placeholder);
pointer-events: none;
}
## Instruction:
Fix caret positioning bug that makes the contenteditabe unusable in FF (still causes a small bug)
## Code After:
[placeholder]:empty::before {
color: @colorInputPlaceholder;
content: attr(placeholder);
pointer-events: none;
position: absolute;
}
| - [placeholder]:empty::after {
? ^ ^ -
+ [placeholder]:empty::before {
? ^^ ^^
color: @colorInputPlaceholder;
content: attr(placeholder);
pointer-events: none;
+ position: absolute;
} | 3 | 0.6 | 2 | 1 |
6755a983e97e82b8cd02d59f691fdcf797a6ca15 | index.md | index.md | ---
layout: lesson
---
This lesson is a template for creating lessons of the [easy fMRI reporting]({{site.nhw_site}}) project.
It is based on the lesson template used in [Neurohackweek]({{ site.nhw_site }}) and derived from [Data Carpentry]({{ site.dc_site }})
and [Software Carpentry]({{ site.swc_site }}) templates.
| ---
layout: lesson
---
This lesson is a template for creating lessons of the [easy fMRI reporting](https://github.com/easyreporting/fmri_reporting) project.
It is based on the lesson template used in [Neurohackweek]({{ site.nhw_site }}) and derived from [Data Carpentry]({{ site.dc_site }})
and [Software Carpentry]({{ site.swc_site }}) templates.
| Update link to easy fmri reporting project | Update link to easy fmri reporting project | Markdown | mit | easyreporting/fmri_reporting,easyreporting/fmri_reporting,easyreporting/fmri_reporting,easyreporting/fmri_reporting,easyreporting/fmri_reporting,easyreporting/fmri_reporting | markdown | ## Code Before:
---
layout: lesson
---
This lesson is a template for creating lessons of the [easy fMRI reporting]({{site.nhw_site}}) project.
It is based on the lesson template used in [Neurohackweek]({{ site.nhw_site }}) and derived from [Data Carpentry]({{ site.dc_site }})
and [Software Carpentry]({{ site.swc_site }}) templates.
## Instruction:
Update link to easy fmri reporting project
## Code After:
---
layout: lesson
---
This lesson is a template for creating lessons of the [easy fMRI reporting](https://github.com/easyreporting/fmri_reporting) project.
It is based on the lesson template used in [Neurohackweek]({{ site.nhw_site }}) and derived from [Data Carpentry]({{ site.dc_site }})
and [Software Carpentry]({{ site.swc_site }}) templates.
| ---
layout: lesson
---
- This lesson is a template for creating lessons of the [easy fMRI reporting]({{site.nhw_site}}) project.
? ^^ ^ ^^ ^ ^^^^
+ This lesson is a template for creating lessons of the [easy fMRI reporting](https://github.com/easyreporting/fmri_reporting) project.
? ^^^^ ++++ ++++++++ ^^^^^^^^^^ ^^^^^^ ^^^^^^ ^^
It is based on the lesson template used in [Neurohackweek]({{ site.nhw_site }}) and derived from [Data Carpentry]({{ site.dc_site }})
and [Software Carpentry]({{ site.swc_site }}) templates. | 2 | 0.285714 | 1 | 1 |
9779d56b495f27e6681d603b2871d39abba956ee | CHANGELOG.md | CHANGELOG.md |
* BC break: Drop unused `Response::getBody()`
* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks
* BC break: Remove `$loop` argument from `HttpClient`: `Client`, `Request`, `Response`
* BC break: Update to React/Promise 2.0
* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0
## 0.3.1 (2013-04-21)
* Bug fix: Correct requirement for socket-client
## 0.3.0 (2013-04-14)
* BC break: Socket connection handling moved to new SocketClient component
## 0.2.6 (2012-12-26)
??
## 0.2.5 (2012-11-26)
* Feature: Use a promise-based API internally
* Bug fix: Use DNS resolver correctly
## 0.2.3 (2012-11-14)
??
## 0.2.2 (2012-10-28)
* Feature: HTTP client (@arnaud-lb)
|
* BC break: Drop unused `Response::getBody()`
* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks
* BC break: Remove `$loop` argument from `HttpClient`: `Client`, `Request`, `Response`
* BC break: Update to React/Promise 2.0
* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0
* Bump React dependencies to v0.4
## 0.3.1 (2013-04-21)
* Bug fix: Correct requirement for socket-client
## 0.3.0 (2013-04-14)
* BC break: Socket connection handling moved to new SocketClient component
* Bump React dependencies to v0.3
## 0.2.6 (2012-12-26)
* Version bump
## 0.2.5 (2012-11-26)
* Feature: Use a promise-based API internally
* Bug fix: Use DNS resolver correctly
## 0.2.3 (2012-11-14)
* Version bump
## 0.2.2 (2012-10-28)
* Feature: HTTP client (@arnaud-lb)
| Add bumped versions to changelog | Add bumped versions to changelog | Markdown | mit | arnaud-lb/http-client,reactphp/http-client,zengpuzhang/http-client | markdown | ## Code Before:
* BC break: Drop unused `Response::getBody()`
* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks
* BC break: Remove `$loop` argument from `HttpClient`: `Client`, `Request`, `Response`
* BC break: Update to React/Promise 2.0
* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0
## 0.3.1 (2013-04-21)
* Bug fix: Correct requirement for socket-client
## 0.3.0 (2013-04-14)
* BC break: Socket connection handling moved to new SocketClient component
## 0.2.6 (2012-12-26)
??
## 0.2.5 (2012-11-26)
* Feature: Use a promise-based API internally
* Bug fix: Use DNS resolver correctly
## 0.2.3 (2012-11-14)
??
## 0.2.2 (2012-10-28)
* Feature: HTTP client (@arnaud-lb)
## Instruction:
Add bumped versions to changelog
## Code After:
* BC break: Drop unused `Response::getBody()`
* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks
* BC break: Remove `$loop` argument from `HttpClient`: `Client`, `Request`, `Response`
* BC break: Update to React/Promise 2.0
* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0
* Bump React dependencies to v0.4
## 0.3.1 (2013-04-21)
* Bug fix: Correct requirement for socket-client
## 0.3.0 (2013-04-14)
* BC break: Socket connection handling moved to new SocketClient component
* Bump React dependencies to v0.3
## 0.2.6 (2012-12-26)
* Version bump
## 0.2.5 (2012-11-26)
* Feature: Use a promise-based API internally
* Bug fix: Use DNS resolver correctly
## 0.2.3 (2012-11-14)
* Version bump
## 0.2.2 (2012-10-28)
* Feature: HTTP client (@arnaud-lb)
|
* BC break: Drop unused `Response::getBody()`
* BC break: Bump minimum PHP version to PHP 5.4, remove 5.3 specific hacks
* BC break: Remove `$loop` argument from `HttpClient`: `Client`, `Request`, `Response`
* BC break: Update to React/Promise 2.0
* Dependency: Autoloading and filesystem structure now PSR-4 instead of PSR-0
+ * Bump React dependencies to v0.4
## 0.3.1 (2013-04-21)
* Bug fix: Correct requirement for socket-client
## 0.3.0 (2013-04-14)
* BC break: Socket connection handling moved to new SocketClient component
+ * Bump React dependencies to v0.3
## 0.2.6 (2012-12-26)
- ??
+ * Version bump
## 0.2.5 (2012-11-26)
* Feature: Use a promise-based API internally
* Bug fix: Use DNS resolver correctly
## 0.2.3 (2012-11-14)
- ??
+ * Version bump
## 0.2.2 (2012-10-28)
* Feature: HTTP client (@arnaud-lb) | 6 | 0.193548 | 4 | 2 |
e73c97463f71717a42ed2f13d02e2ef42c071267 | wagtail/wagtailadmin/static_src/wagtailadmin/js/submenu.js | wagtail/wagtailadmin/static_src/wagtailadmin/js/submenu.js | $(function() {
var $explorer = $('#explorer');
$('.nav-main .submenu-trigger').on('click', function() {
if ($(this).closest('li').find('.nav-submenu').length) {
// Close other active submenus first, if any
if ($('.nav-wrapper.submenu-active').length && !$(this).closest('li').hasClass('submenu-active')) {
$('.nav-main .submenu-active, .nav-wrapper').removeClass('submenu-active');
}
$(this).closest('li').toggleClass('submenu-active');
$('.nav-wrapper').toggleClass('submenu-active');
return false;
}
});
$(document).on('keydown click', function(e) {
if ($('.nav-wrapper.submenu-active').length && (e.keyCode == 27 || !e.keyCode)) {
$('.nav-main .submenu-active, .nav-wrapper').removeClass('submenu-active');
}
});
});
| $(function() {
$('.nav-main .submenu-trigger').on('click', function() {
if ($(this).closest('li').find('.nav-submenu').length) {
// Close other active submenus first, if any
if ($('.nav-wrapper.submenu-active').length && !$(this).closest('li').hasClass('submenu-active')) {
$('.nav-main .submenu-active, .nav-wrapper').removeClass('submenu-active');
}
$(this).closest('li').toggleClass('submenu-active');
$('.nav-wrapper').toggleClass('submenu-active');
return false;
}
});
$(document).on('keydown click', function(e) {
if ($('.nav-wrapper.submenu-active').length && (e.keyCode == 27 || !e.keyCode)) {
$('.nav-main .submenu-active, .nav-wrapper').removeClass('submenu-active');
}
});
});
| Remove useless JS referencing explorer | Remove useless JS referencing explorer
| JavaScript | bsd-3-clause | rsalmaso/wagtail,rsalmaso/wagtail,FlipperPA/wagtail,mixxorz/wagtail,takeflight/wagtail,FlipperPA/wagtail,nimasmi/wagtail,jnns/wagtail,FlipperPA/wagtail,gasman/wagtail,takeflight/wagtail,mikedingjan/wagtail,nimasmi/wagtail,zerolab/wagtail,wagtail/wagtail,kaedroho/wagtail,zerolab/wagtail,takeflight/wagtail,kaedroho/wagtail,wagtail/wagtail,mixxorz/wagtail,jnns/wagtail,thenewguy/wagtail,iansprice/wagtail,gasman/wagtail,rsalmaso/wagtail,torchbox/wagtail,nealtodd/wagtail,wagtail/wagtail,mixxorz/wagtail,takeflight/wagtail,nimasmi/wagtail,jnns/wagtail,thenewguy/wagtail,thenewguy/wagtail,timorieber/wagtail,zerolab/wagtail,jnns/wagtail,FlipperPA/wagtail,rsalmaso/wagtail,timorieber/wagtail,iansprice/wagtail,torchbox/wagtail,kaedroho/wagtail,mixxorz/wagtail,torchbox/wagtail,timorieber/wagtail,thenewguy/wagtail,kaedroho/wagtail,zerolab/wagtail,wagtail/wagtail,nealtodd/wagtail,gasman/wagtail,nimasmi/wagtail,mikedingjan/wagtail,timorieber/wagtail,iansprice/wagtail,zerolab/wagtail,nealtodd/wagtail,gasman/wagtail,wagtail/wagtail,gasman/wagtail,mixxorz/wagtail,torchbox/wagtail,mikedingjan/wagtail,kaedroho/wagtail,mikedingjan/wagtail,nealtodd/wagtail,thenewguy/wagtail,iansprice/wagtail,rsalmaso/wagtail | javascript | ## Code Before:
$(function() {
var $explorer = $('#explorer');
$('.nav-main .submenu-trigger').on('click', function() {
if ($(this).closest('li').find('.nav-submenu').length) {
// Close other active submenus first, if any
if ($('.nav-wrapper.submenu-active').length && !$(this).closest('li').hasClass('submenu-active')) {
$('.nav-main .submenu-active, .nav-wrapper').removeClass('submenu-active');
}
$(this).closest('li').toggleClass('submenu-active');
$('.nav-wrapper').toggleClass('submenu-active');
return false;
}
});
$(document).on('keydown click', function(e) {
if ($('.nav-wrapper.submenu-active').length && (e.keyCode == 27 || !e.keyCode)) {
$('.nav-main .submenu-active, .nav-wrapper').removeClass('submenu-active');
}
});
});
## Instruction:
Remove useless JS referencing explorer
## Code After:
$(function() {
$('.nav-main .submenu-trigger').on('click', function() {
if ($(this).closest('li').find('.nav-submenu').length) {
// Close other active submenus first, if any
if ($('.nav-wrapper.submenu-active').length && !$(this).closest('li').hasClass('submenu-active')) {
$('.nav-main .submenu-active, .nav-wrapper').removeClass('submenu-active');
}
$(this).closest('li').toggleClass('submenu-active');
$('.nav-wrapper').toggleClass('submenu-active');
return false;
}
});
$(document).on('keydown click', function(e) {
if ($('.nav-wrapper.submenu-active').length && (e.keyCode == 27 || !e.keyCode)) {
$('.nav-main .submenu-active, .nav-wrapper').removeClass('submenu-active');
}
});
});
| $(function() {
- var $explorer = $('#explorer');
-
$('.nav-main .submenu-trigger').on('click', function() {
if ($(this).closest('li').find('.nav-submenu').length) {
// Close other active submenus first, if any
if ($('.nav-wrapper.submenu-active').length && !$(this).closest('li').hasClass('submenu-active')) {
$('.nav-main .submenu-active, .nav-wrapper').removeClass('submenu-active');
}
$(this).closest('li').toggleClass('submenu-active');
$('.nav-wrapper').toggleClass('submenu-active');
return false;
}
});
$(document).on('keydown click', function(e) {
if ($('.nav-wrapper.submenu-active').length && (e.keyCode == 27 || !e.keyCode)) {
$('.nav-main .submenu-active, .nav-wrapper').removeClass('submenu-active');
}
});
}); | 2 | 0.086957 | 0 | 2 |
c75812a017c6010ea526e587c9afa5c57b1272ad | lib/driver/NeoTypes.ts | lib/driver/NeoTypes.ts |
import neo4j from "neo4j-driver";
export const Neo4jNode = neo4j.types.Node;
export const Neo4jRelationship = neo4j.types.Relationship;
import {Node, Relationship} from "neo4j-driver/types/v1/graph-types";
export function isNode(node: any): node is Node {
return (node && node.labels)
}
export function isRelationship(rel: any): rel is Relationship {
return (rel && rel.type)
}
| import neo4j from "neo4j-driver";
import {Node, Relationship} from "neo4j-driver/types/v1/graph-types";
const Neo4jNode = neo4j.types.Node;
const Neo4jRelationship = neo4j.types.Relationship;
export function isNode(node: any): node is Node {
return node instanceof Neo4jNode;
}
export function isRelationship(rel: any): rel is Relationship {
return rel instanceof Neo4jRelationship;
}
| Refactor type guards for Node and Relationships classes | Refactor type guards for Node and Relationships classes
| TypeScript | mit | robak86/neography | typescript | ## Code Before:
import neo4j from "neo4j-driver";
export const Neo4jNode = neo4j.types.Node;
export const Neo4jRelationship = neo4j.types.Relationship;
import {Node, Relationship} from "neo4j-driver/types/v1/graph-types";
export function isNode(node: any): node is Node {
return (node && node.labels)
}
export function isRelationship(rel: any): rel is Relationship {
return (rel && rel.type)
}
## Instruction:
Refactor type guards for Node and Relationships classes
## Code After:
import neo4j from "neo4j-driver";
import {Node, Relationship} from "neo4j-driver/types/v1/graph-types";
const Neo4jNode = neo4j.types.Node;
const Neo4jRelationship = neo4j.types.Relationship;
export function isNode(node: any): node is Node {
return node instanceof Neo4jNode;
}
export function isRelationship(rel: any): rel is Relationship {
return rel instanceof Neo4jRelationship;
}
| -
-
import neo4j from "neo4j-driver";
-
- export const Neo4jNode = neo4j.types.Node;
- export const Neo4jRelationship = neo4j.types.Relationship;
-
-
import {Node, Relationship} from "neo4j-driver/types/v1/graph-types";
+ const Neo4jNode = neo4j.types.Node;
+ const Neo4jRelationship = neo4j.types.Relationship;
+
export function isNode(node: any): node is Node {
- return (node && node.labels)
+ return node instanceof Neo4jNode;
}
export function isRelationship(rel: any): rel is Relationship {
- return (rel && rel.type)
+ return rel instanceof Neo4jRelationship;
} | 14 | 0.823529 | 5 | 9 |
a68b689aab932b09d0e7282137a559ad92b0c737 | spec/support/oauth.rb | spec/support/oauth.rb |
def construct_oauth_service(model)
FakeWeb.allow_net_connect = false
qb_key = "key"
@realm_id = "9991111222"
@oauth_consumer = OAuth::Consumer.new(qb_key, qb_key, {
:site => "https://oauth.intuit.com",
:request_token_path => "/oauth/v1/get_request_token",
:authorize_path => "/oauth/v1/get_access_token",
:access_token_path => "/oauth/v1/get_access_token"
})
@oauth = OAuth::AccessToken.new(@oauth_consumer, "blah", "blah")
@service = "Quickeebooks::Online::Service::#{model.to_s.camelcase}".constantize.new
@service.access_token = @oauth
@service.instance_eval {
@realm_id = "9991111222"
}
end
|
def construct_oauth_service(model)
FakeWeb.allow_net_connect = false
qb_key = "key"
qb_secret = "secreet"
@realm_id = "9991111222"
@oauth_consumer = OAuth::Consumer.new(qb_key, qb_secret, {
:site => "https://oauth.intuit.com",
:request_token_path => "/oauth/v1/get_request_token",
:authorize_path => "/oauth/v1/get_access_token",
:access_token_path => "/oauth/v1/get_access_token"
})
@oauth = OAuth::AccessToken.new(@oauth_consumer, "blah", "blah")
@service = "Quickeebooks::Online::Service::#{model.to_s.camelcase}".constantize.new
@service.access_token = @oauth
@service.instance_eval {
@realm_id = "9991111222"
}
end
| Add back qb_secret from recent PR but instead properly pass it in as the second arg of OAuth::Consumer.new | Add back qb_secret from recent PR but instead properly pass it in as the second arg of OAuth::Consumer.new
| Ruby | mit | shipci/quickeebooks,vidyar/quickeebooks,ruckus/quickeebooks | ruby | ## Code Before:
def construct_oauth_service(model)
FakeWeb.allow_net_connect = false
qb_key = "key"
@realm_id = "9991111222"
@oauth_consumer = OAuth::Consumer.new(qb_key, qb_key, {
:site => "https://oauth.intuit.com",
:request_token_path => "/oauth/v1/get_request_token",
:authorize_path => "/oauth/v1/get_access_token",
:access_token_path => "/oauth/v1/get_access_token"
})
@oauth = OAuth::AccessToken.new(@oauth_consumer, "blah", "blah")
@service = "Quickeebooks::Online::Service::#{model.to_s.camelcase}".constantize.new
@service.access_token = @oauth
@service.instance_eval {
@realm_id = "9991111222"
}
end
## Instruction:
Add back qb_secret from recent PR but instead properly pass it in as the second arg of OAuth::Consumer.new
## Code After:
def construct_oauth_service(model)
FakeWeb.allow_net_connect = false
qb_key = "key"
qb_secret = "secreet"
@realm_id = "9991111222"
@oauth_consumer = OAuth::Consumer.new(qb_key, qb_secret, {
:site => "https://oauth.intuit.com",
:request_token_path => "/oauth/v1/get_request_token",
:authorize_path => "/oauth/v1/get_access_token",
:access_token_path => "/oauth/v1/get_access_token"
})
@oauth = OAuth::AccessToken.new(@oauth_consumer, "blah", "blah")
@service = "Quickeebooks::Online::Service::#{model.to_s.camelcase}".constantize.new
@service.access_token = @oauth
@service.instance_eval {
@realm_id = "9991111222"
}
end
|
def construct_oauth_service(model)
FakeWeb.allow_net_connect = false
qb_key = "key"
+ qb_secret = "secreet"
@realm_id = "9991111222"
- @oauth_consumer = OAuth::Consumer.new(qb_key, qb_key, {
? ^ ^
+ @oauth_consumer = OAuth::Consumer.new(qb_key, qb_secret, {
? ^ ^^^^
:site => "https://oauth.intuit.com",
:request_token_path => "/oauth/v1/get_request_token",
:authorize_path => "/oauth/v1/get_access_token",
:access_token_path => "/oauth/v1/get_access_token"
})
@oauth = OAuth::AccessToken.new(@oauth_consumer, "blah", "blah")
@service = "Quickeebooks::Online::Service::#{model.to_s.camelcase}".constantize.new
@service.access_token = @oauth
@service.instance_eval {
@realm_id = "9991111222"
}
end | 3 | 0.157895 | 2 | 1 |
28085a25d83ace50e72553817d5ab8cead7889ef | test/remote/remote_add_receiver_test.rb | test/remote/remote_add_receiver_test.rb | require 'test_helper'
class RemoteAddReceiverTest < Test::Unit::TestCase
def setup
@environment = Spreedly::Environment.new(remote_test_environment_key, remote_test_access_secret)
end
def test_invalid_login
assert_invalid_login do |environment|
environment.add_receiver(:test, 'http://api.example.com/post')
end
end
def test_non_existent_receiver_type
assert_raise_with_message(Spreedly::UnexpectedResponseError, "Failed with 403 Forbidden") do
@environment.add_receiver(:non_existent, nil)
end
end
def test_add_test_receiver_sans_hostname
assert_raise_with_message(Spreedly::TransactionCreationError, "Hostnames can't be blank") do
@environment.add_receiver(:test, nil)
end
end
def test_add_test_receiver
receiver = @environment.add_receiver(:test, 'http://api.example.com/post')
assert_equal "test", receiver.receiver_type
assert_equal 'http://api.example.com/post', receiver.hostnames
end
# Coming soon
# def test_need_active_account
# assert_raise_with_message(Spreedly::PaymentRequiredError, "Your account has not been activated for real transactions. Please update your subscription settings.") do
# @environment.add_receiver(:braintree)
# end
# end
end
| require 'test_helper'
class RemoteAddReceiverTest < Test::Unit::TestCase
def setup
@environment = Spreedly::Environment.new(remote_test_environment_key, remote_test_access_secret)
end
def test_invalid_login
assert_invalid_login do |environment|
environment.add_receiver(:test, 'http://api.example.com/post')
end
end
def test_non_existent_receiver_type
assert_raise_with_message(Spreedly::UnexpectedResponseError, "Failed with 403 Forbidden") do
@environment.add_receiver(:non_existent, nil)
end
end
def test_add_test_receiver_sans_hostname
assert_raise_with_message(Spreedly::TransactionCreationError, "Hostnames can't be blank") do
@environment.add_receiver(:test, nil)
end
end
def test_add_test_receiver
receiver = @environment.add_receiver(:test, 'http://testserver.com')
assert_equal "test", receiver.receiver_type
assert_equal 'http://testserver.com', receiver.hostnames
end
# Coming soon
# def test_need_active_account
# assert_raise_with_message(Spreedly::PaymentRequiredError, "Your account has not been activated for real transactions. Please update your subscription settings.") do
# @environment.add_receiver(:braintree)
# end
# end
end
| Change hostname because for some reason the former one was failing this remote test | Change hostname because for some reason the former one was failing this remote test
| Ruby | mit | spreedly/spreedly-gem,SturdyCo/spreedly-gem,kieranklaassen/spreedly-gem,BitPerformanceLabs/spreedly-gem | ruby | ## Code Before:
require 'test_helper'
class RemoteAddReceiverTest < Test::Unit::TestCase
def setup
@environment = Spreedly::Environment.new(remote_test_environment_key, remote_test_access_secret)
end
def test_invalid_login
assert_invalid_login do |environment|
environment.add_receiver(:test, 'http://api.example.com/post')
end
end
def test_non_existent_receiver_type
assert_raise_with_message(Spreedly::UnexpectedResponseError, "Failed with 403 Forbidden") do
@environment.add_receiver(:non_existent, nil)
end
end
def test_add_test_receiver_sans_hostname
assert_raise_with_message(Spreedly::TransactionCreationError, "Hostnames can't be blank") do
@environment.add_receiver(:test, nil)
end
end
def test_add_test_receiver
receiver = @environment.add_receiver(:test, 'http://api.example.com/post')
assert_equal "test", receiver.receiver_type
assert_equal 'http://api.example.com/post', receiver.hostnames
end
# Coming soon
# def test_need_active_account
# assert_raise_with_message(Spreedly::PaymentRequiredError, "Your account has not been activated for real transactions. Please update your subscription settings.") do
# @environment.add_receiver(:braintree)
# end
# end
end
## Instruction:
Change hostname because for some reason the former one was failing this remote test
## Code After:
require 'test_helper'
class RemoteAddReceiverTest < Test::Unit::TestCase
def setup
@environment = Spreedly::Environment.new(remote_test_environment_key, remote_test_access_secret)
end
def test_invalid_login
assert_invalid_login do |environment|
environment.add_receiver(:test, 'http://api.example.com/post')
end
end
def test_non_existent_receiver_type
assert_raise_with_message(Spreedly::UnexpectedResponseError, "Failed with 403 Forbidden") do
@environment.add_receiver(:non_existent, nil)
end
end
def test_add_test_receiver_sans_hostname
assert_raise_with_message(Spreedly::TransactionCreationError, "Hostnames can't be blank") do
@environment.add_receiver(:test, nil)
end
end
def test_add_test_receiver
receiver = @environment.add_receiver(:test, 'http://testserver.com')
assert_equal "test", receiver.receiver_type
assert_equal 'http://testserver.com', receiver.hostnames
end
# Coming soon
# def test_need_active_account
# assert_raise_with_message(Spreedly::PaymentRequiredError, "Your account has not been activated for real transactions. Please update your subscription settings.") do
# @environment.add_receiver(:braintree)
# end
# end
end
| require 'test_helper'
class RemoteAddReceiverTest < Test::Unit::TestCase
def setup
@environment = Spreedly::Environment.new(remote_test_environment_key, remote_test_access_secret)
end
def test_invalid_login
assert_invalid_login do |environment|
environment.add_receiver(:test, 'http://api.example.com/post')
end
end
def test_non_existent_receiver_type
assert_raise_with_message(Spreedly::UnexpectedResponseError, "Failed with 403 Forbidden") do
@environment.add_receiver(:non_existent, nil)
end
end
def test_add_test_receiver_sans_hostname
assert_raise_with_message(Spreedly::TransactionCreationError, "Hostnames can't be blank") do
@environment.add_receiver(:test, nil)
end
end
def test_add_test_receiver
- receiver = @environment.add_receiver(:test, 'http://api.example.com/post')
? ^^^^ ^^^^^ -----
+ receiver = @environment.add_receiver(:test, 'http://testserver.com')
? ^ ^^^ ++++
assert_equal "test", receiver.receiver_type
- assert_equal 'http://api.example.com/post', receiver.hostnames
? ^^^^ ^^^^^ -----
+ assert_equal 'http://testserver.com', receiver.hostnames
? ^ ^^^ ++++
end
# Coming soon
# def test_need_active_account
# assert_raise_with_message(Spreedly::PaymentRequiredError, "Your account has not been activated for real transactions. Please update your subscription settings.") do
# @environment.add_receiver(:braintree)
# end
# end
end | 4 | 0.1 | 2 | 2 |
442aed80fd4a62be7142a5da1a51eae3f53e5a20 | proto_0_0.go | proto_0_0.go | package main
import (
"fmt"
"os"
"os/exec"
)
func proto_0_0(inFlag, outFlag bool, errFlag, workdir string, args []string) error {
proc := exec.Command(args[0], args[1:]...)
proc.Dir = workdir
done := make(chan bool)
done_count := 0
done_count += wrapStdin(proc, os.Stdin, inFlag, done)
if outFlag {
done_count += wrapStdout(proc, os.Stdout, 'o', done)
}
if errFlag == "out" && outFlag {
done_count += wrapStderr(proc, os.Stdout, 'o', done)
} else if errFlag == "err" {
done_count += wrapStderr(proc, os.Stdout, 'e', done)
} else if errFlag != "nil" {
fmt.Fprintf(os.Stderr, "undefined redirect: '%v'\n", errFlag)
fatal("undefined redirect")
}
err := proc.Run()
for i := 0; i < done_count; i++ {
<-done
}
return err
}
| package main
import (
"fmt"
"os"
"os/exec"
)
func proto_0_0(inFlag, outFlag bool, errFlag, workdir string, args []string) error {
proc := exec.Command(args[0], args[1:]...)
proc.Dir = workdir
done := make(chan bool)
done_count := 0
done_count += wrapStdin(proc, os.Stdin, inFlag, done)
if outFlag {
done_count += wrapStdout(proc, os.Stdout, 'o', done)
}
switch errFlag {
case "out":
if outFlag {
done_count += wrapStderr(proc, os.Stdout, 'o', done)
}
case "err":
done_count += wrapStderr(proc, os.Stdout, 'e', done)
case "nil":
// no-op
default:
fmt.Fprintf(os.Stderr, "undefined redirect: '%v'\n", errFlag)
fatal("undefined redirect")
}
err := proc.Run()
for i := 0; i < done_count; i++ {
<-done
}
return err
}
| Fix logic error in error flag handling | Fix logic error in error flag handling | Go | mit | alco/goon,felixbuenemann/goon,felixbuenemann/goon,alco/goon | go | ## Code Before:
package main
import (
"fmt"
"os"
"os/exec"
)
func proto_0_0(inFlag, outFlag bool, errFlag, workdir string, args []string) error {
proc := exec.Command(args[0], args[1:]...)
proc.Dir = workdir
done := make(chan bool)
done_count := 0
done_count += wrapStdin(proc, os.Stdin, inFlag, done)
if outFlag {
done_count += wrapStdout(proc, os.Stdout, 'o', done)
}
if errFlag == "out" && outFlag {
done_count += wrapStderr(proc, os.Stdout, 'o', done)
} else if errFlag == "err" {
done_count += wrapStderr(proc, os.Stdout, 'e', done)
} else if errFlag != "nil" {
fmt.Fprintf(os.Stderr, "undefined redirect: '%v'\n", errFlag)
fatal("undefined redirect")
}
err := proc.Run()
for i := 0; i < done_count; i++ {
<-done
}
return err
}
## Instruction:
Fix logic error in error flag handling
## Code After:
package main
import (
"fmt"
"os"
"os/exec"
)
func proto_0_0(inFlag, outFlag bool, errFlag, workdir string, args []string) error {
proc := exec.Command(args[0], args[1:]...)
proc.Dir = workdir
done := make(chan bool)
done_count := 0
done_count += wrapStdin(proc, os.Stdin, inFlag, done)
if outFlag {
done_count += wrapStdout(proc, os.Stdout, 'o', done)
}
switch errFlag {
case "out":
if outFlag {
done_count += wrapStderr(proc, os.Stdout, 'o', done)
}
case "err":
done_count += wrapStderr(proc, os.Stdout, 'e', done)
case "nil":
// no-op
default:
fmt.Fprintf(os.Stderr, "undefined redirect: '%v'\n", errFlag)
fatal("undefined redirect")
}
err := proc.Run()
for i := 0; i < done_count; i++ {
<-done
}
return err
}
| package main
import (
"fmt"
"os"
"os/exec"
)
func proto_0_0(inFlag, outFlag bool, errFlag, workdir string, args []string) error {
proc := exec.Command(args[0], args[1:]...)
proc.Dir = workdir
done := make(chan bool)
done_count := 0
done_count += wrapStdin(proc, os.Stdin, inFlag, done)
if outFlag {
done_count += wrapStdout(proc, os.Stdout, 'o', done)
}
- if errFlag == "out" && outFlag {
+ switch errFlag {
+ case "out":
+ if outFlag {
- done_count += wrapStderr(proc, os.Stdout, 'o', done)
+ done_count += wrapStderr(proc, os.Stdout, 'o', done)
? +
- } else if errFlag == "err" {
+ }
+ case "err":
done_count += wrapStderr(proc, os.Stdout, 'e', done)
- } else if errFlag != "nil" {
+ case "nil":
+ // no-op
+ default:
fmt.Fprintf(os.Stderr, "undefined redirect: '%v'\n", errFlag)
fatal("undefined redirect")
}
err := proc.Run()
for i := 0; i < done_count; i++ {
<-done
}
return err
} | 13 | 0.393939 | 9 | 4 |
18fda199cf20e39d95c6c9292ff58e1a5800196b | Documentation/index.txt | Documentation/index.txt | Gerrit2
=======
Web based code review and project management for Git based projects.
User Guide
----------
* link:user-upload.html[Uploading Changes]
Features
--------
* link:feature-roadmap.html[Roadmap]
Installation
------------
* link:install.html[Installing Gerrit2]
* link:project-setup.html[Project Setup]
Configuration
-------------
* link:config-gerrit.html[system_config Settings]
* link:config-replication.html[Git Replication/Mirroring]
* link:config-gitweb.html[Gitweb Integration]
* link:config-headerfooter.html[Site Header/Footer]
* link:config-sso.html[Single Sign-On Systems]
Developer Documentation
-----------------------
* link:dev-readme.html[Developer Setup]
* link:dev-eclipse.html[Eclipse Setup]
* link:dev-design.html[System Design]
* link:i18n-readme.html[i18n Support]
Gerrit resources:
* link:http://code.google.com/p/gerrit/[Project Site]
* link:http://code.google.com/p/gerrit/wiki/Issues?tm=3[Issue Tracking]
Upgrading
---------
* link:gerrit1-import.html[From Gerrit1]
| Gerrit2
=======
Web based code review and project management for Git based projects.
* link:http://code.google.com/p/gerrit/[Gerrit Homepage]
User Guide
----------
* link:user-upload.html[Uploading Changes]
Features
--------
* link:feature-roadmap.html[Roadmap]
Installation
------------
* link:install.html[Installing Gerrit2]
* link:project-setup.html[Project Setup]
Configuration
-------------
* link:config-gerrit.html[system_config Settings]
* link:config-replication.html[Git Replication/Mirroring]
* link:config-gitweb.html[Gitweb Integration]
* link:config-headerfooter.html[Site Header/Footer]
* link:config-sso.html[Single Sign-On Systems]
Developer Documentation
-----------------------
* link:dev-readme.html[Developer Setup]
* link:dev-eclipse.html[Eclipse Setup]
* link:dev-design.html[System Design]
* link:i18n-readme.html[i18n Support]
Gerrit resources:
* link:http://code.google.com/p/gerrit/[Project Site]
* link:http://code.google.com/p/gerrit/wiki/Issues?tm=3[Issue Tracking]
Upgrading
---------
* link:gerrit1-import.html[From Gerrit1]
| Add a link to our project homepage in the documentation | Add a link to our project homepage in the documentation
Signed-off-by: Shawn O. Pearce <f3ea74d906fa9fe97c1fef6bad9cb871485c7045@google.com>
| Text | apache-2.0 | TonyChai24/test,supriyantomaftuh/gerrit,1yvT0s/gerrit,Saulis/gerrit,Seinlin/gerrit,thinkernel/gerrit,jackminicloud/test,duboisf/gerrit,skurfuerst/gerrit,jeblair/gerrit,Saulis/gerrit,anminhsu/gerrit,dwhipstock/gerrit,bootstraponline-archive/gerrit-mirror,Overruler/gerrit,jackminicloud/test,duboisf/gerrit,1yvT0s/gerrit,hdost/gerrit,MerritCR/merrit,GerritCodeReview/gerrit,cjh1/gerrit,sudosurootdev/gerrit,GerritCodeReview/gerrit,gerrit-review/gerrit,pkdevbox/gerrit,ashang/aaron-gerrit,midnightradio/gerrit,joshuawilson/merrit,Team-OctOS/host_gerrit,zommarin/gerrit,makholm/gerrit-ceremony,evanchueng/gerrit,Team-OctOS/host_gerrit,WANdisco/gerrit,CandyShop/gerrit,Distrotech/gerrit,renchaorevee/gerrit,quyixia/gerrit,Distrotech/gerrit,jeblair/gerrit,renchaorevee/gerrit,hdost/gerrit,ashang/aaron-gerrit,ashang/aaron-gerrit,Saulis/gerrit,pkdevbox/gerrit,teamblueridge/gerrit,midnightradio/gerrit,catrope/gerrit,makholm/gerrit-ceremony,bpollack/gerrit,Overruler/gerrit,makholm/gerrit-ceremony,anminhsu/gerrit,basilgor/gerrit,catrope/gerrit,quyixia/gerrit,anminhsu/gerrit,qtproject/qtqa-gerrit,thinkernel/gerrit,keerath/gerrit_newssh,zommarin/gerrit,WANdisco/gerrit,hdost/gerrit,Team-OctOS/host_gerrit,GerritCodeReview/gerrit,Seinlin/gerrit,midnightradio/gerrit,gerrit-review/gerrit,ckamm/gerrit,gerrit-review/gerrit,jeblair/gerrit,CandyShop/gerrit,gcoders/gerrit,catrope/gerrit,m1kah/gerrit-contributions,MerritCR/merrit,gracefullife/gerrit,dwhipstock/gerrit,evanchueng/gerrit,anminhsu/gerrit,zommarin/gerrit,atdt/gerrit,bootstraponline-archive/gerrit-mirror,pkdevbox/gerrit,ckamm/gerrit,Seinlin/gerrit,m1kah/gerrit-contributions,joshuawilson/merrit,thesamet/gerrit,GerritCodeReview/gerrit,supriyantomaftuh/gerrit,TonyChai24/test,bpollack/gerrit,thesamet/gerrit,Overruler/gerrit,sudosurootdev/gerrit,evanchueng/gerrit,WANdisco/gerrit,thinkernel/gerrit,joshuawilson/merrit,pkdevbox/gerrit,hdost/gerrit,gracefullife/gerrit,m1kah/gerrit-contributions,dwhipstock/gerrit,supriyantomaftuh/gerrit,quyixia/gerrit,GerritCodeReview/gerrit,bpollack/gerrit,MerritCR/merrit,TonyChai24/test,dwhipstock/gerrit,netroby/gerrit,sudosurootdev/gerrit,supriyantomaftuh/gerrit,qtproject/qtqa-gerrit,anminhsu/gerrit,GerritCodeReview/gerrit,skurfuerst/gerrit,teamblueridge/gerrit,bootstraponline-archive/gerrit-mirror,Distrotech/gerrit,thinkernel/gerrit,Overruler/gerrit,joshuawilson/merrit,quyixia/gerrit,sudosurootdev/gerrit,quyixia/gerrit,thesamet/gerrit,midnightradio/gerrit,skurfuerst/gerrit,supriyantomaftuh/gerrit,netroby/gerrit,1yvT0s/gerrit,atdt/gerrit,qtproject/qtqa-gerrit,zommarin/gerrit,1yvT0s/gerrit,duboisf/gerrit,quyixia/gerrit,basilgor/gerrit,TonyChai24/test,keerath/gerrit_newssh,anminhsu/gerrit,ashang/aaron-gerrit,GerritCodeReview/gerrit-attic,Overruler/gerrit,TonyChai24/test,basilgor/gerrit,rtyley/mini-git-server,GerritCodeReview/gerrit,joshuawilson/merrit,Team-OctOS/host_gerrit,supriyantomaftuh/gerrit,MerritCR/merrit,gcoders/gerrit,teamblueridge/gerrit,ckamm/gerrit,m1kah/gerrit-contributions,bootstraponline-archive/gerrit-mirror,TonyChai24/test,cjh1/gerrit,Saulis/gerrit,thinkernel/gerrit,gracefullife/gerrit,Seinlin/gerrit,renchaorevee/gerrit,gcoders/gerrit,qtproject/qtqa-gerrit,WANdisco/gerrit,1yvT0s/gerrit,jeblair/gerrit,Overruler/gerrit,gracefullife/gerrit,GerritCodeReview/gerrit-attic,Team-OctOS/host_gerrit,midnightradio/gerrit,evanchueng/gerrit,makholm/gerrit-ceremony,atdt/gerrit,austinchic/Gerrit,midnightradio/gerrit,ashang/aaron-gerrit,hdost/gerrit,Distrotech/gerrit,thesamet/gerrit,netroby/gerrit,CandyShop/gerrit,basilgor/gerrit,Seinlin/gerrit,jackminicloud/test,supriyantomaftuh/gerrit,CandyShop/gerrit,joshuawilson/merrit,MerritCR/merrit,skurfuerst/gerrit,TonyChai24/test,jackminicloud/test,ckamm/gerrit,thesamet/gerrit,zommarin/gerrit,gerrit-review/gerrit,bpollack/gerrit,cjh1/gerrit,joshuawilson/merrit,catrope/gerrit,atdt/gerrit,renchaorevee/gerrit,Seinlin/gerrit,hdost/gerrit,bootstraponline-archive/gerrit-mirror,MerritCR/merrit,joshuawilson/merrit,hdost/gerrit,renchaorevee/gerrit,qtproject/qtqa-gerrit,Seinlin/gerrit,evanchueng/gerrit,renchaorevee/gerrit,Distrotech/gerrit,netroby/gerrit,dwhipstock/gerrit,bpollack/gerrit,gerrit-review/gerrit,keerath/gerrit_newssh,gerrit-review/gerrit,anminhsu/gerrit,gcoders/gerrit,pkdevbox/gerrit,sudosurootdev/gerrit,WANdisco/gerrit,MerritCR/merrit,gracefullife/gerrit,ckamm/gerrit,thesamet/gerrit,netroby/gerrit,jackminicloud/test,thinkernel/gerrit,keerath/gerrit_newssh,WANdisco/gerrit,rtyley/mini-git-server,gerrit-review/gerrit,netroby/gerrit,keerath/gerrit_newssh,gcoders/gerrit,pkdevbox/gerrit,quyixia/gerrit,cjh1/gerrit,netroby/gerrit,qtproject/qtqa-gerrit,austinchic/Gerrit,CandyShop/gerrit,qtproject/qtqa-gerrit,Distrotech/gerrit,jackminicloud/test,bpollack/gerrit,jackminicloud/test,basilgor/gerrit,austinchic/Gerrit,Team-OctOS/host_gerrit,thesamet/gerrit,pkdevbox/gerrit,austinchic/Gerrit,GerritCodeReview/gerrit-attic,Saulis/gerrit,bootstraponline-archive/gerrit-mirror,dwhipstock/gerrit,thinkernel/gerrit,MerritCR/merrit,Team-OctOS/host_gerrit,teamblueridge/gerrit,teamblueridge/gerrit,duboisf/gerrit,WANdisco/gerrit,atdt/gerrit,GerritCodeReview/gerrit,gcoders/gerrit,gcoders/gerrit,Saulis/gerrit,renchaorevee/gerrit,Distrotech/gerrit,dwhipstock/gerrit | text | ## Code Before:
Gerrit2
=======
Web based code review and project management for Git based projects.
User Guide
----------
* link:user-upload.html[Uploading Changes]
Features
--------
* link:feature-roadmap.html[Roadmap]
Installation
------------
* link:install.html[Installing Gerrit2]
* link:project-setup.html[Project Setup]
Configuration
-------------
* link:config-gerrit.html[system_config Settings]
* link:config-replication.html[Git Replication/Mirroring]
* link:config-gitweb.html[Gitweb Integration]
* link:config-headerfooter.html[Site Header/Footer]
* link:config-sso.html[Single Sign-On Systems]
Developer Documentation
-----------------------
* link:dev-readme.html[Developer Setup]
* link:dev-eclipse.html[Eclipse Setup]
* link:dev-design.html[System Design]
* link:i18n-readme.html[i18n Support]
Gerrit resources:
* link:http://code.google.com/p/gerrit/[Project Site]
* link:http://code.google.com/p/gerrit/wiki/Issues?tm=3[Issue Tracking]
Upgrading
---------
* link:gerrit1-import.html[From Gerrit1]
## Instruction:
Add a link to our project homepage in the documentation
Signed-off-by: Shawn O. Pearce <f3ea74d906fa9fe97c1fef6bad9cb871485c7045@google.com>
## Code After:
Gerrit2
=======
Web based code review and project management for Git based projects.
* link:http://code.google.com/p/gerrit/[Gerrit Homepage]
User Guide
----------
* link:user-upload.html[Uploading Changes]
Features
--------
* link:feature-roadmap.html[Roadmap]
Installation
------------
* link:install.html[Installing Gerrit2]
* link:project-setup.html[Project Setup]
Configuration
-------------
* link:config-gerrit.html[system_config Settings]
* link:config-replication.html[Git Replication/Mirroring]
* link:config-gitweb.html[Gitweb Integration]
* link:config-headerfooter.html[Site Header/Footer]
* link:config-sso.html[Single Sign-On Systems]
Developer Documentation
-----------------------
* link:dev-readme.html[Developer Setup]
* link:dev-eclipse.html[Eclipse Setup]
* link:dev-design.html[System Design]
* link:i18n-readme.html[i18n Support]
Gerrit resources:
* link:http://code.google.com/p/gerrit/[Project Site]
* link:http://code.google.com/p/gerrit/wiki/Issues?tm=3[Issue Tracking]
Upgrading
---------
* link:gerrit1-import.html[From Gerrit1]
| Gerrit2
=======
Web based code review and project management for Git based projects.
+
+ * link:http://code.google.com/p/gerrit/[Gerrit Homepage]
User Guide
----------
* link:user-upload.html[Uploading Changes]
Features
--------
* link:feature-roadmap.html[Roadmap]
Installation
------------
* link:install.html[Installing Gerrit2]
* link:project-setup.html[Project Setup]
Configuration
-------------
* link:config-gerrit.html[system_config Settings]
* link:config-replication.html[Git Replication/Mirroring]
* link:config-gitweb.html[Gitweb Integration]
* link:config-headerfooter.html[Site Header/Footer]
* link:config-sso.html[Single Sign-On Systems]
Developer Documentation
-----------------------
* link:dev-readme.html[Developer Setup]
* link:dev-eclipse.html[Eclipse Setup]
* link:dev-design.html[System Design]
* link:i18n-readme.html[i18n Support]
Gerrit resources:
* link:http://code.google.com/p/gerrit/[Project Site]
* link:http://code.google.com/p/gerrit/wiki/Issues?tm=3[Issue Tracking]
Upgrading
---------
* link:gerrit1-import.html[From Gerrit1] | 2 | 0.042553 | 2 | 0 |
74dd8ef23dafa941fdba3e9701bc8d805ee9e8a4 | README.md | README.md | Flag Bearer
===========
A small utility to help with planting IScorE flags.
Installation
------------
The recommending way to install flag bearer is through pip:
pip install flag-bearer
You may optionally install from source by cloning the repository and running
python setup.py install
| Flag Bearer
===========
A small utility to help with planting IScorE flags.
Installation
------------
The recommending way to install flag bearer is through pip:
pip install flag-bearer
You may optionally install from source by cloning the repository and running
python setup.py install
Usage
-----
The main purpose of flag bearer is to make planting blue and red flags easier.
To plant flag, start by running the following command:
flag-bearer plant
You will then be asked for your API token, you can either paste in your API
token or press enter to use your credentials instead.
Flag Bearer v0.1
Enter your IScorE API Token (leave blank to use your credentials)
>
If you are on red team, you will be prompted for which team you are trying to
plant a flag for.
Both Red and Blue teamers will be presented with a list of flags available to
place.
Pick the flag to place
0. WWW /etc/
1. Shell /etc/
2. DB /etc/
> 1
Enter the number next to the flag you want to plant.
At this point, if you are a Blue Teamer, or you have passed the `--save` flag,
you will be asked what directory you wish to place the flag. **NOTE**: The
current user must have permission to write to the specified directory. For Red
Teamers, the default functionality is to print out the contents of the flag to
make it easier to copy and paste.
| Add usage information to the readme | Add usage information to the readme
| Markdown | mit | ISEAGE-ISU/flag-bearer | markdown | ## Code Before:
Flag Bearer
===========
A small utility to help with planting IScorE flags.
Installation
------------
The recommending way to install flag bearer is through pip:
pip install flag-bearer
You may optionally install from source by cloning the repository and running
python setup.py install
## Instruction:
Add usage information to the readme
## Code After:
Flag Bearer
===========
A small utility to help with planting IScorE flags.
Installation
------------
The recommending way to install flag bearer is through pip:
pip install flag-bearer
You may optionally install from source by cloning the repository and running
python setup.py install
Usage
-----
The main purpose of flag bearer is to make planting blue and red flags easier.
To plant flag, start by running the following command:
flag-bearer plant
You will then be asked for your API token, you can either paste in your API
token or press enter to use your credentials instead.
Flag Bearer v0.1
Enter your IScorE API Token (leave blank to use your credentials)
>
If you are on red team, you will be prompted for which team you are trying to
plant a flag for.
Both Red and Blue teamers will be presented with a list of flags available to
place.
Pick the flag to place
0. WWW /etc/
1. Shell /etc/
2. DB /etc/
> 1
Enter the number next to the flag you want to plant.
At this point, if you are a Blue Teamer, or you have passed the `--save` flag,
you will be asked what directory you wish to place the flag. **NOTE**: The
current user must have permission to write to the specified directory. For Red
Teamers, the default functionality is to print out the contents of the flag to
make it easier to copy and paste.
| Flag Bearer
===========
A small utility to help with planting IScorE flags.
Installation
------------
The recommending way to install flag bearer is through pip:
pip install flag-bearer
You may optionally install from source by cloning the repository and running
python setup.py install
+
+ Usage
+ -----
+ The main purpose of flag bearer is to make planting blue and red flags easier.
+ To plant flag, start by running the following command:
+
+ flag-bearer plant
+
+ You will then be asked for your API token, you can either paste in your API
+ token or press enter to use your credentials instead.
+
+ Flag Bearer v0.1
+ Enter your IScorE API Token (leave blank to use your credentials)
+ >
+
+ If you are on red team, you will be prompted for which team you are trying to
+ plant a flag for.
+
+ Both Red and Blue teamers will be presented with a list of flags available to
+ place.
+
+ Pick the flag to place
+ 0. WWW /etc/
+ 1. Shell /etc/
+ 2. DB /etc/
+ > 1
+
+ Enter the number next to the flag you want to plant.
+
+ At this point, if you are a Blue Teamer, or you have passed the `--save` flag,
+ you will be asked what directory you wish to place the flag. **NOTE**: The
+ current user must have permission to write to the specified directory. For Red
+ Teamers, the default functionality is to print out the contents of the flag to
+ make it easier to copy and paste. | 34 | 2.615385 | 34 | 0 |
64078924b68398ebff7649df6e77fd8080acf8d3 | app/controllers/application_controller.rb | app/controllers/application_controller.rb | class ApplicationController < ActionController::Base
protect_from_forgery
helper_method :current_student
helper_method :current_user_students
# after_filter :store_location
private
def current_student
if session[:current_student_id].present?
Student.find(session[:current_student_id]) rescue nil
end
end
def current_user_students
if current_user
return current_user.students.verified
elsif session[:session_id].present?
return Student.verified.where(session_id: session[:session_id]).order(:first_name)
else
return []
end
end
# def store_location
# # store last url - this is needed for post-login redirect to whatever the user last visited.
# if (request.fullpath != "/users/sign_in" && \
# request.fullpath != "/users/sign_up" && \
# request.fullpath != "/users/password" && \
# !request.xhr?) # don't store ajax calls
# session[:previous_url] = request.fullpath
# end
# end
def after_sign_out_path_for(resource_or_scope)
root_url
end
def after_sign_up_path_for(resource)
root_path
end
def after_sign_in_path_for(resource)
current_student.update_attributes(user_id: current_user.id) if current_student.user_id.blank?
schools_url
end
end
| class ApplicationController < ActionController::Base
protect_from_forgery
helper_method :current_student
helper_method :current_user_students
# after_filter :store_location
private
def current_student
if session[:current_student_id].present?
Student.find(session[:current_student_id]) rescue nil
end
end
def current_user_students
if current_user
return current_user.students.verified
elsif session[:session_id].present?
return Student.verified.where(session_id: session[:session_id]).order(:first_name)
else
return []
end
end
# def store_location
# # store last url - this is needed for post-login redirect to whatever the user last visited.
# if (request.fullpath != "/users/sign_in" && \
# request.fullpath != "/users/sign_up" && \
# request.fullpath != "/users/password" && \
# !request.xhr?) # don't store ajax calls
# session[:previous_url] = request.fullpath
# end
# end
def after_sign_out_path_for(resource_or_scope)
root_url
end
def after_sign_up_path_for(resource)
root_path
end
def after_sign_in_path_for(resource)
current_student.update_attributes(user_id: current_user.id) if current_student.present? && current_student.user_id.blank?
schools_url
end
end
| Remove logging from students controller | Remove logging from students controller
| Ruby | mit | joelmahoney/discoverbps,joelmahoney/discoverbps,joelmahoney/discoverbps,joelmahoney/discoverbps,joelmahoney/discoverbps,joelmahoney/discoverbps,joelmahoney/discoverbps,joelmahoney/discoverbps | ruby | ## Code Before:
class ApplicationController < ActionController::Base
protect_from_forgery
helper_method :current_student
helper_method :current_user_students
# after_filter :store_location
private
def current_student
if session[:current_student_id].present?
Student.find(session[:current_student_id]) rescue nil
end
end
def current_user_students
if current_user
return current_user.students.verified
elsif session[:session_id].present?
return Student.verified.where(session_id: session[:session_id]).order(:first_name)
else
return []
end
end
# def store_location
# # store last url - this is needed for post-login redirect to whatever the user last visited.
# if (request.fullpath != "/users/sign_in" && \
# request.fullpath != "/users/sign_up" && \
# request.fullpath != "/users/password" && \
# !request.xhr?) # don't store ajax calls
# session[:previous_url] = request.fullpath
# end
# end
def after_sign_out_path_for(resource_or_scope)
root_url
end
def after_sign_up_path_for(resource)
root_path
end
def after_sign_in_path_for(resource)
current_student.update_attributes(user_id: current_user.id) if current_student.user_id.blank?
schools_url
end
end
## Instruction:
Remove logging from students controller
## Code After:
class ApplicationController < ActionController::Base
protect_from_forgery
helper_method :current_student
helper_method :current_user_students
# after_filter :store_location
private
def current_student
if session[:current_student_id].present?
Student.find(session[:current_student_id]) rescue nil
end
end
def current_user_students
if current_user
return current_user.students.verified
elsif session[:session_id].present?
return Student.verified.where(session_id: session[:session_id]).order(:first_name)
else
return []
end
end
# def store_location
# # store last url - this is needed for post-login redirect to whatever the user last visited.
# if (request.fullpath != "/users/sign_in" && \
# request.fullpath != "/users/sign_up" && \
# request.fullpath != "/users/password" && \
# !request.xhr?) # don't store ajax calls
# session[:previous_url] = request.fullpath
# end
# end
def after_sign_out_path_for(resource_or_scope)
root_url
end
def after_sign_up_path_for(resource)
root_path
end
def after_sign_in_path_for(resource)
current_student.update_attributes(user_id: current_user.id) if current_student.present? && current_student.user_id.blank?
schools_url
end
end
| class ApplicationController < ActionController::Base
protect_from_forgery
helper_method :current_student
helper_method :current_user_students
# after_filter :store_location
private
def current_student
if session[:current_student_id].present?
Student.find(session[:current_student_id]) rescue nil
end
end
def current_user_students
if current_user
return current_user.students.verified
elsif session[:session_id].present?
return Student.verified.where(session_id: session[:session_id]).order(:first_name)
else
return []
end
end
# def store_location
# # store last url - this is needed for post-login redirect to whatever the user last visited.
# if (request.fullpath != "/users/sign_in" && \
# request.fullpath != "/users/sign_up" && \
# request.fullpath != "/users/password" && \
# !request.xhr?) # don't store ajax calls
# session[:previous_url] = request.fullpath
# end
# end
def after_sign_out_path_for(resource_or_scope)
root_url
end
def after_sign_up_path_for(resource)
root_path
end
def after_sign_in_path_for(resource)
- current_student.update_attributes(user_id: current_user.id) if current_student.user_id.blank?
+ current_student.update_attributes(user_id: current_user.id) if current_student.present? && current_student.user_id.blank?
? ++++++++++++++++++++++++++++
schools_url
end
end | 2 | 0.042553 | 1 | 1 |
4abfd47d927603803af4d46c4bf5afb256672b54 | Topics/Checklists/checklists/chk_datacleaning.js | Topics/Checklists/checklists/chk_datacleaning.js | [1,"Before data cleaning: Importing the data"],
[2,"Check for importing issues such as broken lines when importing .csv files"],
[2,"Make sure you have unique IDs"],
[2,"De-identify all data and save in a new .dta file"],
[2,"Never make any changes to the raw data"],
[1,"Important steps for data cleaning"],
[2,"Label variables, don’t use special characters"],
[2,"Recode and label missing values: your data set should not have observations with -777, -88 or -9 values, for example"],
[2,"Encode variables: all categorical variables should be saved as labeled numeric variables, no strings"],
[2,"Don’t change variable names from questionnaire, except for nested repeat groups and reshaped roster data"],
[2,"Test variables consistency"],
[2,"Identify and document outliers"],
[2,"Compress dataset so it is saved in the most efficient format"],
[2,"Save cleaned data set with an informative name. Avoid saving in a very recent Stata version"],
[1,"Optional steps in data cleaning"],
[2,"Order variables – unique ID always first, then same order as questionnaire"],
[2,"Drop variables that only make sense for questionnaire review (duration, notes, calculates)"],
[2,"Rename roster variables"],
[2,"Categorize variables listed as “others”"],
[2,"Add metadata as notes: original survey question, relevance, constraints, etc"]
| [1,"Before data cleaning: Importing the data"],
[2,"Check for importing issues such as broken lines when importing .csv files"],
[2,"Make sure you have unique IDs"],
[2,"De-identify all data and save in a new .dta file"],
[2,"Never make any changes to the raw data"],
[1,"Important steps for data cleaning"],
[2,"Label variables, don’t use special characters"],
[2,"Recode and label missing values: your data set should not have observations with -777, -88 or -9 values, for example"],
[2,"Encode variables: all categorical variables should be saved as labeled numeric variables, no strings"],
[2,"Don’t change variable names from questionnaire, except for nested repeat groups and reshaped roster data"],
[2,"Check sample representativeness of age, gender, urban/rural, region and religion"],
[2,"Check administrative data such as date, time, interviewer variables included"],
[2,"Test variables consistency"],
[2,"Identify and document outliers"],
[2,"Compress dataset so it is saved in the most efficient format"],
[2,"Save cleaned data set with an informative name. Avoid saving in a very recent Stata version"],
[1,"Optional steps in data cleaning"],
[2,"Order variables – unique ID always first, then same order as questionnaire"],
[2,"Drop variables that only make sense for questionnaire review (duration, notes, calculates)"],
[2,"Rename roster variables"],
[2,"Categorize variables listed as “others”"],
[2,"Add metadata as notes: original survey question, relevance, constraints, etc"]
| Update Checking List for internal purposes | Update Checking List for internal purposes | JavaScript | mit | worldbank/DIMEwiki,worldbank/DIMEwiki | javascript | ## Code Before:
[1,"Before data cleaning: Importing the data"],
[2,"Check for importing issues such as broken lines when importing .csv files"],
[2,"Make sure you have unique IDs"],
[2,"De-identify all data and save in a new .dta file"],
[2,"Never make any changes to the raw data"],
[1,"Important steps for data cleaning"],
[2,"Label variables, don’t use special characters"],
[2,"Recode and label missing values: your data set should not have observations with -777, -88 or -9 values, for example"],
[2,"Encode variables: all categorical variables should be saved as labeled numeric variables, no strings"],
[2,"Don’t change variable names from questionnaire, except for nested repeat groups and reshaped roster data"],
[2,"Test variables consistency"],
[2,"Identify and document outliers"],
[2,"Compress dataset so it is saved in the most efficient format"],
[2,"Save cleaned data set with an informative name. Avoid saving in a very recent Stata version"],
[1,"Optional steps in data cleaning"],
[2,"Order variables – unique ID always first, then same order as questionnaire"],
[2,"Drop variables that only make sense for questionnaire review (duration, notes, calculates)"],
[2,"Rename roster variables"],
[2,"Categorize variables listed as “others”"],
[2,"Add metadata as notes: original survey question, relevance, constraints, etc"]
## Instruction:
Update Checking List for internal purposes
## Code After:
[1,"Before data cleaning: Importing the data"],
[2,"Check for importing issues such as broken lines when importing .csv files"],
[2,"Make sure you have unique IDs"],
[2,"De-identify all data and save in a new .dta file"],
[2,"Never make any changes to the raw data"],
[1,"Important steps for data cleaning"],
[2,"Label variables, don’t use special characters"],
[2,"Recode and label missing values: your data set should not have observations with -777, -88 or -9 values, for example"],
[2,"Encode variables: all categorical variables should be saved as labeled numeric variables, no strings"],
[2,"Don’t change variable names from questionnaire, except for nested repeat groups and reshaped roster data"],
[2,"Check sample representativeness of age, gender, urban/rural, region and religion"],
[2,"Check administrative data such as date, time, interviewer variables included"],
[2,"Test variables consistency"],
[2,"Identify and document outliers"],
[2,"Compress dataset so it is saved in the most efficient format"],
[2,"Save cleaned data set with an informative name. Avoid saving in a very recent Stata version"],
[1,"Optional steps in data cleaning"],
[2,"Order variables – unique ID always first, then same order as questionnaire"],
[2,"Drop variables that only make sense for questionnaire review (duration, notes, calculates)"],
[2,"Rename roster variables"],
[2,"Categorize variables listed as “others”"],
[2,"Add metadata as notes: original survey question, relevance, constraints, etc"]
| [1,"Before data cleaning: Importing the data"],
[2,"Check for importing issues such as broken lines when importing .csv files"],
[2,"Make sure you have unique IDs"],
[2,"De-identify all data and save in a new .dta file"],
[2,"Never make any changes to the raw data"],
[1,"Important steps for data cleaning"],
[2,"Label variables, don’t use special characters"],
[2,"Recode and label missing values: your data set should not have observations with -777, -88 or -9 values, for example"],
[2,"Encode variables: all categorical variables should be saved as labeled numeric variables, no strings"],
[2,"Don’t change variable names from questionnaire, except for nested repeat groups and reshaped roster data"],
+ [2,"Check sample representativeness of age, gender, urban/rural, region and religion"],
+ [2,"Check administrative data such as date, time, interviewer variables included"],
[2,"Test variables consistency"],
[2,"Identify and document outliers"],
[2,"Compress dataset so it is saved in the most efficient format"],
[2,"Save cleaned data set with an informative name. Avoid saving in a very recent Stata version"],
[1,"Optional steps in data cleaning"],
[2,"Order variables – unique ID always first, then same order as questionnaire"],
[2,"Drop variables that only make sense for questionnaire review (duration, notes, calculates)"],
[2,"Rename roster variables"],
[2,"Categorize variables listed as “others”"],
[2,"Add metadata as notes: original survey question, relevance, constraints, etc"] | 2 | 0.1 | 2 | 0 |
63b0072311b2228849554eafbb944f98b51d0159 | acinclude/ax_boost_suffix.m4 | acinclude/ax_boost_suffix.m4 | AC_DEFUN([AX_BOOST_SUFFIX],
[
AC_ARG_WITH([boost-suffix],
[AC_HELP_STRING([--with-boost-suffix=suffix suffix name for boost libraries])],
[
boostsuffix="$withval"
findsuffix="no"
],[
findsuffix="yes"
])
if test "x$findsuffix" = "xyes"; then
if test "x$BOOST_LDFLAGS" = "x"; then
AC_MSG_ERROR(BOOST_LDFLAGS not defined.)
else
boostlibpath=`echo $BOOST_LDFLAGS | sed 's/^-L//'`
changequote(<<, >>)dnl
candidates=`echo $boostlibpath/libboost_date_time* | sed 's|.*libboost_date_time||g' | sed 's/\.[^ ]*//g'`
changequote([, ])dnl
if `echo $candidates | grep -q ' '`; then
AC_MSG_ERROR(Multiple candidates found for suffix. Use --with-boostsuffix to choose one: --$candidates--)
else
BOOST_SUFFIX=$candidates
AC_SUBST(BOOST_SUFFIX)
fi
fi
AC_MSG_NOTICE(Using boost suffix: $BOOST_SUFFIX)
fi
])
| AC_DEFUN([AX_BOOST_SUFFIX],
[
AC_ARG_WITH([boost-suffix],
[AC_HELP_STRING([--with-boost-suffix=suffix suffix name for boost libraries])],
[
BOOST_SUFFIX="$withval"
findsuffix="no"
],[
findsuffix="yes"
])
if test "x$findsuffix" = "xyes"; then
if test "x$BOOST_LDFLAGS" = "x"; then
AC_MSG_ERROR(BOOST_LDFLAGS not defined.)
else
boostlibpath=`echo $BOOST_LDFLAGS | sed 's/^-L//'`
changequote(<<, >>)dnl
candidates=`echo $boostlibpath/libboost_date_time* | sed 's|.*libboost_date_time||g' | sed 's/\.[^ ]*//g'`
changequote([, ])dnl
if `echo $candidates | grep -q ' '`; then
AC_MSG_ERROR(Multiple candidates found for suffix. Use --with-boostsuffix to choose one: $candidates)
else
BOOST_SUFFIX=$candidates
fi
fi
fi
AC_SUBST(BOOST_SUFFIX)
AC_MSG_NOTICE(Using boost suffix: $BOOST_SUFFIX)
])
| Fix bug in boost suffix code. | build: Fix bug in boost suffix code.
| M4 | apache-2.0 | b1v1r/ironbee,b1v1r/ironbee,ironbee/ironbee,b1v1r/ironbee,b1v1r/ironbee,b1v1r/ironbee,ironbee/ironbee,b1v1r/ironbee,ironbee/ironbee,b1v1r/ironbee,ironbee/ironbee,ironbee/ironbee,ironbee/ironbee,ironbee/ironbee,ironbee/ironbee,ironbee/ironbee,b1v1r/ironbee,b1v1r/ironbee,b1v1r/ironbee,ironbee/ironbee,ironbee/ironbee,ironbee/ironbee,b1v1r/ironbee,b1v1r/ironbee | m4 | ## Code Before:
AC_DEFUN([AX_BOOST_SUFFIX],
[
AC_ARG_WITH([boost-suffix],
[AC_HELP_STRING([--with-boost-suffix=suffix suffix name for boost libraries])],
[
boostsuffix="$withval"
findsuffix="no"
],[
findsuffix="yes"
])
if test "x$findsuffix" = "xyes"; then
if test "x$BOOST_LDFLAGS" = "x"; then
AC_MSG_ERROR(BOOST_LDFLAGS not defined.)
else
boostlibpath=`echo $BOOST_LDFLAGS | sed 's/^-L//'`
changequote(<<, >>)dnl
candidates=`echo $boostlibpath/libboost_date_time* | sed 's|.*libboost_date_time||g' | sed 's/\.[^ ]*//g'`
changequote([, ])dnl
if `echo $candidates | grep -q ' '`; then
AC_MSG_ERROR(Multiple candidates found for suffix. Use --with-boostsuffix to choose one: --$candidates--)
else
BOOST_SUFFIX=$candidates
AC_SUBST(BOOST_SUFFIX)
fi
fi
AC_MSG_NOTICE(Using boost suffix: $BOOST_SUFFIX)
fi
])
## Instruction:
build: Fix bug in boost suffix code.
## Code After:
AC_DEFUN([AX_BOOST_SUFFIX],
[
AC_ARG_WITH([boost-suffix],
[AC_HELP_STRING([--with-boost-suffix=suffix suffix name for boost libraries])],
[
BOOST_SUFFIX="$withval"
findsuffix="no"
],[
findsuffix="yes"
])
if test "x$findsuffix" = "xyes"; then
if test "x$BOOST_LDFLAGS" = "x"; then
AC_MSG_ERROR(BOOST_LDFLAGS not defined.)
else
boostlibpath=`echo $BOOST_LDFLAGS | sed 's/^-L//'`
changequote(<<, >>)dnl
candidates=`echo $boostlibpath/libboost_date_time* | sed 's|.*libboost_date_time||g' | sed 's/\.[^ ]*//g'`
changequote([, ])dnl
if `echo $candidates | grep -q ' '`; then
AC_MSG_ERROR(Multiple candidates found for suffix. Use --with-boostsuffix to choose one: $candidates)
else
BOOST_SUFFIX=$candidates
fi
fi
fi
AC_SUBST(BOOST_SUFFIX)
AC_MSG_NOTICE(Using boost suffix: $BOOST_SUFFIX)
])
| AC_DEFUN([AX_BOOST_SUFFIX],
[
AC_ARG_WITH([boost-suffix],
[AC_HELP_STRING([--with-boost-suffix=suffix suffix name for boost libraries])],
[
- boostsuffix="$withval"
+ BOOST_SUFFIX="$withval"
findsuffix="no"
],[
findsuffix="yes"
])
if test "x$findsuffix" = "xyes"; then
if test "x$BOOST_LDFLAGS" = "x"; then
AC_MSG_ERROR(BOOST_LDFLAGS not defined.)
else
boostlibpath=`echo $BOOST_LDFLAGS | sed 's/^-L//'`
changequote(<<, >>)dnl
candidates=`echo $boostlibpath/libboost_date_time* | sed 's|.*libboost_date_time||g' | sed 's/\.[^ ]*//g'`
changequote([, ])dnl
if `echo $candidates | grep -q ' '`; then
- AC_MSG_ERROR(Multiple candidates found for suffix. Use --with-boostsuffix to choose one: --$candidates--)
? -- --
+ AC_MSG_ERROR(Multiple candidates found for suffix. Use --with-boostsuffix to choose one: $candidates)
else
BOOST_SUFFIX=$candidates
- AC_SUBST(BOOST_SUFFIX)
fi
fi
- AC_MSG_NOTICE(Using boost suffix: $BOOST_SUFFIX)
fi
+ AC_SUBST(BOOST_SUFFIX)
+ AC_MSG_NOTICE(Using boost suffix: $BOOST_SUFFIX)
]) | 8 | 0.285714 | 4 | 4 |
40122e169e6a887caa6371a0ff3029c35ce265d5 | third_party/node/node.py | third_party/node/node.py |
from os import path as os_path
import platform
import subprocess
import sys
import os
def GetBinaryPath():
return os_path.join(
os_path.dirname(__file__), *{
'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
'Windows': ('win', 'node.exe'),
}[platform.system()])
def RunNode(cmd_parts, output=subprocess.PIPE):
cmd = [GetBinaryPath()] + cmd_parts
process = subprocess.Popen(cmd,
cwd=os.getcwd(),
stdout=output,
stderr=output)
stdout, stderr = process.communicate()
if process.returncode != 0:
print('%s failed:\n%s\n%s' % (cmd, stdout, stderr))
exit(process.returncode)
return stdout
if __name__ == '__main__':
args = sys.argv[1:]
# Accept --output as the first argument, and then remove
# it from the args entirely if present.
if len(args) > 0 and args[0] == '--output':
output = None
args = sys.argv[2:]
else:
output = subprocess.PIPE
RunNode(args, output)
|
from os import path as os_path
import platform
import subprocess
import sys
import os
def GetBinaryPath():
return os_path.join(
os_path.dirname(__file__), *{
'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
'Windows': ('win', 'node.exe'),
}[platform.system()])
def RunNode(cmd_parts, output=subprocess.PIPE):
cmd = [GetBinaryPath()] + cmd_parts
process = subprocess.Popen(cmd,
cwd=os.getcwd(),
stdout=output,
stderr=output,
universal_newlines=True)
stdout, stderr = process.communicate()
if process.returncode != 0:
print('%s failed:\n%s\n%s' % (cmd, stdout, stderr))
exit(process.returncode)
return stdout
if __name__ == '__main__':
args = sys.argv[1:]
# Accept --output as the first argument, and then remove
# it from the args entirely if present.
if len(args) > 0 and args[0] == '--output':
output = None
args = sys.argv[2:]
else:
output = subprocess.PIPE
RunNode(args, output)
| Fix line ending printing on Python 3 | Fix line ending printing on Python 3
To reflect the changes in
https://chromium-review.googlesource.com/c/chromium/src/+/2896248/8/third_party/node/node.py
R=993fcadce4d04090da2fefd557a0995e7966c8d5@chromium.org
Bug: none
Change-Id: I25ba29042f537bfef57fba93115be2c194649864
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2914883
Commit-Queue: Tim van der Lippe <dba8716ee7f8d16236046f74d2167cb94410f6ed@chromium.org>
Commit-Queue: Jack Franklin <993fcadce4d04090da2fefd557a0995e7966c8d5@chromium.org>
Auto-Submit: Tim van der Lippe <dba8716ee7f8d16236046f74d2167cb94410f6ed@chromium.org>
Reviewed-by: Jack Franklin <993fcadce4d04090da2fefd557a0995e7966c8d5@chromium.org>
| Python | bsd-3-clause | ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend,ChromeDevTools/devtools-frontend | python | ## Code Before:
from os import path as os_path
import platform
import subprocess
import sys
import os
def GetBinaryPath():
return os_path.join(
os_path.dirname(__file__), *{
'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
'Windows': ('win', 'node.exe'),
}[platform.system()])
def RunNode(cmd_parts, output=subprocess.PIPE):
cmd = [GetBinaryPath()] + cmd_parts
process = subprocess.Popen(cmd,
cwd=os.getcwd(),
stdout=output,
stderr=output)
stdout, stderr = process.communicate()
if process.returncode != 0:
print('%s failed:\n%s\n%s' % (cmd, stdout, stderr))
exit(process.returncode)
return stdout
if __name__ == '__main__':
args = sys.argv[1:]
# Accept --output as the first argument, and then remove
# it from the args entirely if present.
if len(args) > 0 and args[0] == '--output':
output = None
args = sys.argv[2:]
else:
output = subprocess.PIPE
RunNode(args, output)
## Instruction:
Fix line ending printing on Python 3
To reflect the changes in
https://chromium-review.googlesource.com/c/chromium/src/+/2896248/8/third_party/node/node.py
R=993fcadce4d04090da2fefd557a0995e7966c8d5@chromium.org
Bug: none
Change-Id: I25ba29042f537bfef57fba93115be2c194649864
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2914883
Commit-Queue: Tim van der Lippe <dba8716ee7f8d16236046f74d2167cb94410f6ed@chromium.org>
Commit-Queue: Jack Franklin <993fcadce4d04090da2fefd557a0995e7966c8d5@chromium.org>
Auto-Submit: Tim van der Lippe <dba8716ee7f8d16236046f74d2167cb94410f6ed@chromium.org>
Reviewed-by: Jack Franklin <993fcadce4d04090da2fefd557a0995e7966c8d5@chromium.org>
## Code After:
from os import path as os_path
import platform
import subprocess
import sys
import os
def GetBinaryPath():
return os_path.join(
os_path.dirname(__file__), *{
'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
'Windows': ('win', 'node.exe'),
}[platform.system()])
def RunNode(cmd_parts, output=subprocess.PIPE):
cmd = [GetBinaryPath()] + cmd_parts
process = subprocess.Popen(cmd,
cwd=os.getcwd(),
stdout=output,
stderr=output,
universal_newlines=True)
stdout, stderr = process.communicate()
if process.returncode != 0:
print('%s failed:\n%s\n%s' % (cmd, stdout, stderr))
exit(process.returncode)
return stdout
if __name__ == '__main__':
args = sys.argv[1:]
# Accept --output as the first argument, and then remove
# it from the args entirely if present.
if len(args) > 0 and args[0] == '--output':
output = None
args = sys.argv[2:]
else:
output = subprocess.PIPE
RunNode(args, output)
|
from os import path as os_path
import platform
import subprocess
import sys
import os
def GetBinaryPath():
return os_path.join(
os_path.dirname(__file__), *{
'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
'Windows': ('win', 'node.exe'),
}[platform.system()])
def RunNode(cmd_parts, output=subprocess.PIPE):
cmd = [GetBinaryPath()] + cmd_parts
process = subprocess.Popen(cmd,
cwd=os.getcwd(),
stdout=output,
- stderr=output)
? ^
+ stderr=output,
? ^
+ universal_newlines=True)
stdout, stderr = process.communicate()
if process.returncode != 0:
print('%s failed:\n%s\n%s' % (cmd, stdout, stderr))
exit(process.returncode)
return stdout
if __name__ == '__main__':
args = sys.argv[1:]
# Accept --output as the first argument, and then remove
# it from the args entirely if present.
if len(args) > 0 and args[0] == '--output':
output = None
args = sys.argv[2:]
else:
output = subprocess.PIPE
RunNode(args, output) | 3 | 0.071429 | 2 | 1 |
6a6ebbc63a2e31e3ee150dffd0ae841292e9f025 | lib/pixhibitee/command.rb | lib/pixhibitee/command.rb | require "thor"
require "launchy"
require "pixhibitee"
module Pixhibitee
class Command < Thor
default_command :start
map "-v" => :version
desc "version", "Show version number."
def version
puts Pixhibitee::VERSION
end
desc "start", "Start web server."
option :silent, :type => :boolean, :desc => "Don't open in browser"
def start
web_server_thread = Thread.new { Pixhibitee::App.run! }
Launchy.open("http://localhost:4567") unless options[:silent]
web_server_thread.join
end
end
end
| require "thor"
require "launchy"
require "pixhibitee"
module Pixhibitee
class Command < Thor
default_command :start
map "-v" => :version
desc "version", "Show version number."
def version
puts Pixhibitee::VERSION
end
desc "start", "Start web server."
option :silent, :type => :boolean, :desc => "Don't open in browser"
option :public, :type => :boolean, :desc => "Publish to network"
option :port, :type => :string, :desc => "Set port number"
def start
web_server_thread = Thread.new do
if options[:public]
start_public_server
else
start_private_server
end
end
Launchy.open("http://localhost:#{port}") unless options[:silent]
web_server_thread.join
end
def port
options[:port] || "4567"
end
def start_private_server
Pixhibitee::App.run!
end
def start_public_server
Rack::Server.start({
:config => File.join(File.dirname(__FILE__), "../../config.ru"),
:Host => "0.0.0.0",
:Port => port,
})
end
end
end
| Add --public option for publishing to network | Add --public option for publishing to network
| Ruby | mit | myokoym/pixhibitee,myokoym/pixhibitee | ruby | ## Code Before:
require "thor"
require "launchy"
require "pixhibitee"
module Pixhibitee
class Command < Thor
default_command :start
map "-v" => :version
desc "version", "Show version number."
def version
puts Pixhibitee::VERSION
end
desc "start", "Start web server."
option :silent, :type => :boolean, :desc => "Don't open in browser"
def start
web_server_thread = Thread.new { Pixhibitee::App.run! }
Launchy.open("http://localhost:4567") unless options[:silent]
web_server_thread.join
end
end
end
## Instruction:
Add --public option for publishing to network
## Code After:
require "thor"
require "launchy"
require "pixhibitee"
module Pixhibitee
class Command < Thor
default_command :start
map "-v" => :version
desc "version", "Show version number."
def version
puts Pixhibitee::VERSION
end
desc "start", "Start web server."
option :silent, :type => :boolean, :desc => "Don't open in browser"
option :public, :type => :boolean, :desc => "Publish to network"
option :port, :type => :string, :desc => "Set port number"
def start
web_server_thread = Thread.new do
if options[:public]
start_public_server
else
start_private_server
end
end
Launchy.open("http://localhost:#{port}") unless options[:silent]
web_server_thread.join
end
def port
options[:port] || "4567"
end
def start_private_server
Pixhibitee::App.run!
end
def start_public_server
Rack::Server.start({
:config => File.join(File.dirname(__FILE__), "../../config.ru"),
:Host => "0.0.0.0",
:Port => port,
})
end
end
end
| require "thor"
require "launchy"
require "pixhibitee"
module Pixhibitee
class Command < Thor
default_command :start
map "-v" => :version
desc "version", "Show version number."
def version
puts Pixhibitee::VERSION
end
desc "start", "Start web server."
option :silent, :type => :boolean, :desc => "Don't open in browser"
+ option :public, :type => :boolean, :desc => "Publish to network"
+ option :port, :type => :string, :desc => "Set port number"
def start
- web_server_thread = Thread.new { Pixhibitee::App.run! }
+ web_server_thread = Thread.new do
+ if options[:public]
+ start_public_server
+ else
+ start_private_server
+ end
+ end
- Launchy.open("http://localhost:4567") unless options[:silent]
? ^^^^
+ Launchy.open("http://localhost:#{port}") unless options[:silent]
? ^^^^^^^
web_server_thread.join
+ end
+
+ def port
+ options[:port] || "4567"
+ end
+
+ def start_private_server
+ Pixhibitee::App.run!
+ end
+
+ def start_public_server
+ Rack::Server.start({
+ :config => File.join(File.dirname(__FILE__), "../../config.ru"),
+ :Host => "0.0.0.0",
+ :Port => port,
+ })
end
end
end | 28 | 1.166667 | 26 | 2 |
36ecfb4e69d726b4fe7659cf4288896b578d9aae | recipes/default.rb | recipes/default.rb |
include_recipe "et_nginx::#{node['nginx']['install_method']}"
service 'nginx' do
supports :status => true, :restart => true, :reload => true
action :start
end
node['nginx']['default']['modules'].each do |ngx_module|
include_recipe "et_nginx::#{ngx_module}"
end
|
include_recipe "et_nginx::#{node['nginx']['install_method']}"
resources(:service => 'nginx').action :start
node['nginx']['default']['modules'].each do |ngx_module|
include_recipe "et_nginx::#{ngx_module}"
end
| Call up previously defined service resource to avoid cloning | Call up previously defined service resource to avoid cloning
| Ruby | apache-2.0 | evertrue/nginx-cookbook,evertrue/nginx-cookbook,evertrue/nginx-cookbook | ruby | ## Code Before:
include_recipe "et_nginx::#{node['nginx']['install_method']}"
service 'nginx' do
supports :status => true, :restart => true, :reload => true
action :start
end
node['nginx']['default']['modules'].each do |ngx_module|
include_recipe "et_nginx::#{ngx_module}"
end
## Instruction:
Call up previously defined service resource to avoid cloning
## Code After:
include_recipe "et_nginx::#{node['nginx']['install_method']}"
resources(:service => 'nginx').action :start
node['nginx']['default']['modules'].each do |ngx_module|
include_recipe "et_nginx::#{ngx_module}"
end
|
include_recipe "et_nginx::#{node['nginx']['install_method']}"
+ resources(:service => 'nginx').action :start
- service 'nginx' do
- supports :status => true, :restart => true, :reload => true
- action :start
- end
node['nginx']['default']['modules'].each do |ngx_module|
include_recipe "et_nginx::#{ngx_module}"
end | 5 | 0.454545 | 1 | 4 |
aad92eb76eb4d3c54c05c4e2151a0bfb44e95964 | _includes/gh_contributions.html | _includes/gh_contributions.html | <a href="https://github.com/dlstadther"><img src="http://ghchart.rshah.org/dlstadther" alt="dlstadther's Github contributions" /></a>
| <style>
figure {
float: center;
width: 100%;
text-align: center;
font-style: italic;
font-size: smaller;
text-indent: 0;
border: thin silver solid;
margin: 2em;
padding: 2em;
}
</style>
<figure>
<a href="https://github.com/dlstadther"><img id="ghContributions" src="http://ghchart.rshah.org/dlstadther" alt="dlstadther's Github contributions"/></a>
<figcaption id="ghContributionsCaption"></figcaption>
</figure>
<script>
var r = Math.floor((Math.random() * 255) + 1).toString(16);
var g = Math.floor((Math.random() * 255) + 1).toString(16);
var b = Math.floor((Math.random() * 255) + 1).toString(16);
var urlColor = `http://ghchart.rshah.org/${r}${g}${b}/dlstadther`
document.getElementById("ghContributions").src = urlColor
document.getElementById("ghContributionsCaption").innerHTML = `Github Contribution Graph (Base RGB HEX: ${r}${g}${b})`
</script>
| Add hex color randomization to gh contributions; add formating | Add hex color randomization to gh contributions; add formating
| HTML | mit | dlstadther/dlstadther.github.io,dlstadther/dlstadther.github.io | html | ## Code Before:
<a href="https://github.com/dlstadther"><img src="http://ghchart.rshah.org/dlstadther" alt="dlstadther's Github contributions" /></a>
## Instruction:
Add hex color randomization to gh contributions; add formating
## Code After:
<style>
figure {
float: center;
width: 100%;
text-align: center;
font-style: italic;
font-size: smaller;
text-indent: 0;
border: thin silver solid;
margin: 2em;
padding: 2em;
}
</style>
<figure>
<a href="https://github.com/dlstadther"><img id="ghContributions" src="http://ghchart.rshah.org/dlstadther" alt="dlstadther's Github contributions"/></a>
<figcaption id="ghContributionsCaption"></figcaption>
</figure>
<script>
var r = Math.floor((Math.random() * 255) + 1).toString(16);
var g = Math.floor((Math.random() * 255) + 1).toString(16);
var b = Math.floor((Math.random() * 255) + 1).toString(16);
var urlColor = `http://ghchart.rshah.org/${r}${g}${b}/dlstadther`
document.getElementById("ghContributions").src = urlColor
document.getElementById("ghContributionsCaption").innerHTML = `Github Contribution Graph (Base RGB HEX: ${r}${g}${b})`
</script>
| - <a href="https://github.com/dlstadther"><img src="http://ghchart.rshah.org/dlstadther" alt="dlstadther's Github contributions" /></a>
+ <style>
+ figure {
+ float: center;
+ width: 100%;
+ text-align: center;
+ font-style: italic;
+ font-size: smaller;
+ text-indent: 0;
+ border: thin silver solid;
+ margin: 2em;
+ padding: 2em;
+ }
+ </style>
+ <figure>
+ <a href="https://github.com/dlstadther"><img id="ghContributions" src="http://ghchart.rshah.org/dlstadther" alt="dlstadther's Github contributions"/></a>
+ <figcaption id="ghContributionsCaption"></figcaption>
+ </figure>
+
+ <script>
+ var r = Math.floor((Math.random() * 255) + 1).toString(16);
+ var g = Math.floor((Math.random() * 255) + 1).toString(16);
+ var b = Math.floor((Math.random() * 255) + 1).toString(16);
+ var urlColor = `http://ghchart.rshah.org/${r}${g}${b}/dlstadther`
+ document.getElementById("ghContributions").src = urlColor
+ document.getElementById("ghContributionsCaption").innerHTML = `Github Contribution Graph (Base RGB HEX: ${r}${g}${b})`
+ </script> | 27 | 13.5 | 26 | 1 |
9c0fd1025e6ce0587a779c7d2e9e941cce8b03f3 | flask_website/templates/mailinglist/index.html | flask_website/templates/mailinglist/index.html | {% extends "mailinglist/layout.html" %}
{% block title %}Mailinglist{% endblock %}
{% block body %}
<h2>Mailinglist Information</h2>
<p>
There is a mailinglist for Flask hosted on <a
href=http://librelist.com/>librelist</a> you can use for both user requests
and development discussions.
<p>
To subscribe, send a mail to <em>flask@librelist.com</em> and reply
to the confirmation mail. Make sure to check your Spam folder, just in
case. To unsubscribe again, send a mail to
<em>flask-unsubscribe@librelist.com</em> and reply to the
confirmation mail.
<p>
The <a href="{{ url_for('mailinglist.archive') }}">mailinglist archive</a>
is synched every hour. Go there to read up old discussions grouped by
thread.
{% endblock %}
| {% extends "mailinglist/layout.html" %}
{% block title %}Mailinglist{% endblock %}
{% block body %}
<h2>Mailinglist Information</h2>
<p>
There is a mailinglist for Flask hosted on <a
href="https://mail.python.org/mailman/listinfo/flask/">python.org</a> that
you can use for both user requests and development discussions that may not
fit well in a Github issue or StackOverflow question.
<p>
You can subscribe or change your subscription options at
<a href="https://mail.python.org/mailman/listinfo/flask/">
https://mail.python.org/mailman/listinfo/flask/</a>. If you're having
problems, don't forget to check your Spam folder.
<p>
You can view the list archives at <a
href="http://mail.python.org/pipermail/flask/">
http://mail.python.org/pipermail/flask/</a>.
<p>
Before July 2015, we used librelist for the mailing list. You can view those
archives here: <a href="{{ url_for('mailinglist.archive') }}">
{{ url_for('mailinglist.archive') }}</a>. Just keep in mind any new messages
should now be posted to <a
href="https://mail.python.org/mailman/listinfo/flask/">the python.org
Flask mailing list</a> mentioned above.
{% endblock %}
| Update mailinglist link to python.org mailman list | Update mailinglist link to python.org mailman list
| HTML | bsd-3-clause | MurtazaB/flask-website,mitsuhiko/flask-website,eromoe/flask-website,eromoe/flask-website,MurtazaB/flask-website,LiHaoGit/flask-website,mitsuhiko/flask-website,LiHaoGit/flask-website,MurtazaB/flask-website,LiHaoGit/flask-website,mitsuhiko/flask-website,eromoe/flask-website | html | ## Code Before:
{% extends "mailinglist/layout.html" %}
{% block title %}Mailinglist{% endblock %}
{% block body %}
<h2>Mailinglist Information</h2>
<p>
There is a mailinglist for Flask hosted on <a
href=http://librelist.com/>librelist</a> you can use for both user requests
and development discussions.
<p>
To subscribe, send a mail to <em>flask@librelist.com</em> and reply
to the confirmation mail. Make sure to check your Spam folder, just in
case. To unsubscribe again, send a mail to
<em>flask-unsubscribe@librelist.com</em> and reply to the
confirmation mail.
<p>
The <a href="{{ url_for('mailinglist.archive') }}">mailinglist archive</a>
is synched every hour. Go there to read up old discussions grouped by
thread.
{% endblock %}
## Instruction:
Update mailinglist link to python.org mailman list
## Code After:
{% extends "mailinglist/layout.html" %}
{% block title %}Mailinglist{% endblock %}
{% block body %}
<h2>Mailinglist Information</h2>
<p>
There is a mailinglist for Flask hosted on <a
href="https://mail.python.org/mailman/listinfo/flask/">python.org</a> that
you can use for both user requests and development discussions that may not
fit well in a Github issue or StackOverflow question.
<p>
You can subscribe or change your subscription options at
<a href="https://mail.python.org/mailman/listinfo/flask/">
https://mail.python.org/mailman/listinfo/flask/</a>. If you're having
problems, don't forget to check your Spam folder.
<p>
You can view the list archives at <a
href="http://mail.python.org/pipermail/flask/">
http://mail.python.org/pipermail/flask/</a>.
<p>
Before July 2015, we used librelist for the mailing list. You can view those
archives here: <a href="{{ url_for('mailinglist.archive') }}">
{{ url_for('mailinglist.archive') }}</a>. Just keep in mind any new messages
should now be posted to <a
href="https://mail.python.org/mailman/listinfo/flask/">the python.org
Flask mailing list</a> mentioned above.
{% endblock %}
| {% extends "mailinglist/layout.html" %}
{% block title %}Mailinglist{% endblock %}
{% block body %}
<h2>Mailinglist Information</h2>
<p>
There is a mailinglist for Flask hosted on <a
- href=http://librelist.com/>librelist</a> you can use for both user requests
- and development discussions.
+ href="https://mail.python.org/mailman/listinfo/flask/">python.org</a> that
+ you can use for both user requests and development discussions that may not
+ fit well in a Github issue or StackOverflow question.
<p>
+ You can subscribe or change your subscription options at
+ <a href="https://mail.python.org/mailman/listinfo/flask/">
+ https://mail.python.org/mailman/listinfo/flask/</a>. If you're having
+ problems, don't forget to check your Spam folder.
- To subscribe, send a mail to <em>flask@librelist.com</em> and reply
- to the confirmation mail. Make sure to check your Spam folder, just in
- case. To unsubscribe again, send a mail to
- <em>flask-unsubscribe@librelist.com</em> and reply to the
- confirmation mail.
<p>
+ You can view the list archives at <a
+ href="http://mail.python.org/pipermail/flask/">
+ http://mail.python.org/pipermail/flask/</a>.
+
+ <p>
+ Before July 2015, we used librelist for the mailing list. You can view those
- The <a href="{{ url_for('mailinglist.archive') }}">mailinglist archive</a>
? ^ -----------------------
+ archives here: <a href="{{ url_for('mailinglist.archive') }}">
? ^^^^^^^^^ +++
- is synched every hour. Go there to read up old discussions grouped by
- thread.
+ {{ url_for('mailinglist.archive') }}</a>. Just keep in mind any new messages
+ should now be posted to <a
+ href="https://mail.python.org/mailman/listinfo/flask/">the python.org
+ Flask mailing list</a> mentioned above.
+
{% endblock %} | 29 | 1.380952 | 19 | 10 |
3bac78459082cad9d6abe791dce5279ae1ab1e1c | templates/zerver/emails/notify_change_in_email.source.html | templates/zerver/emails/notify_change_in_email.source.html | {% extends "zerver/emails/compiled/email_base_default.html" %}
{% block illustration %}
<img src="{{ email_images_base_uri }}/email_logo.png" alt=""/>
{% endblock %}
{% block content %}
<p>{{ _("Hi,") }}</p>
<p>
{% trans %}The email associated with your Zulip account was recently changed to <a href="{{ new_email }}">{{ new_email }}</a>. If you did not request this change, please contact us immediately at <a href="mailto:{{ support_email }}">{{ support_email }}</a>.{% endtrans %}
</p>
<p>
{{ _("Best,") }}<br>
{{ _("Team Zulip") }}
</p>
{% endblock %}
| {% extends "zerver/emails/compiled/email_base_default.html" %}
{% block illustration %}
<img src="{{ email_images_base_uri }}/email_logo.png" alt=""/>
{% endblock %}
{% block content %}
<p>{{ _("Hi,") }}</p>
<p>
{% trans new_email=macros.email_tag(new_email), support_email=macros.email_tag(support_email) %}The email associated with your Zulip account was recently changed to {{ new_email }}. If you did not request this change, please contact us immediately at {{ support_email }}.{% endtrans %}
</p>
<p>
{{ _("Best,") }}<br>
{{ _("Team Zulip") }}
</p>
{% endblock %}
| Use macros for email tags in notify change in email. | emails: Use macros for email tags in notify change in email.
| HTML | apache-2.0 | eeshangarg/zulip,punchagan/zulip,eeshangarg/zulip,kou/zulip,showell/zulip,showell/zulip,zulip/zulip,kou/zulip,hackerkid/zulip,andersk/zulip,andersk/zulip,hackerkid/zulip,eeshangarg/zulip,showell/zulip,hackerkid/zulip,eeshangarg/zulip,kou/zulip,punchagan/zulip,rht/zulip,kou/zulip,hackerkid/zulip,hackerkid/zulip,rht/zulip,showell/zulip,punchagan/zulip,punchagan/zulip,showell/zulip,zulip/zulip,kou/zulip,rht/zulip,hackerkid/zulip,eeshangarg/zulip,zulip/zulip,zulip/zulip,andersk/zulip,rht/zulip,eeshangarg/zulip,zulip/zulip,kou/zulip,andersk/zulip,showell/zulip,eeshangarg/zulip,andersk/zulip,rht/zulip,punchagan/zulip,zulip/zulip,punchagan/zulip,showell/zulip,andersk/zulip,andersk/zulip,punchagan/zulip,zulip/zulip,kou/zulip,hackerkid/zulip,rht/zulip,rht/zulip | html | ## Code Before:
{% extends "zerver/emails/compiled/email_base_default.html" %}
{% block illustration %}
<img src="{{ email_images_base_uri }}/email_logo.png" alt=""/>
{% endblock %}
{% block content %}
<p>{{ _("Hi,") }}</p>
<p>
{% trans %}The email associated with your Zulip account was recently changed to <a href="{{ new_email }}">{{ new_email }}</a>. If you did not request this change, please contact us immediately at <a href="mailto:{{ support_email }}">{{ support_email }}</a>.{% endtrans %}
</p>
<p>
{{ _("Best,") }}<br>
{{ _("Team Zulip") }}
</p>
{% endblock %}
## Instruction:
emails: Use macros for email tags in notify change in email.
## Code After:
{% extends "zerver/emails/compiled/email_base_default.html" %}
{% block illustration %}
<img src="{{ email_images_base_uri }}/email_logo.png" alt=""/>
{% endblock %}
{% block content %}
<p>{{ _("Hi,") }}</p>
<p>
{% trans new_email=macros.email_tag(new_email), support_email=macros.email_tag(support_email) %}The email associated with your Zulip account was recently changed to {{ new_email }}. If you did not request this change, please contact us immediately at {{ support_email }}.{% endtrans %}
</p>
<p>
{{ _("Best,") }}<br>
{{ _("Team Zulip") }}
</p>
{% endblock %}
| {% extends "zerver/emails/compiled/email_base_default.html" %}
{% block illustration %}
<img src="{{ email_images_base_uri }}/email_logo.png" alt=""/>
{% endblock %}
{% block content %}
<p>{{ _("Hi,") }}</p>
<p>
- {% trans %}The email associated with your Zulip account was recently changed to <a href="{{ new_email }}">{{ new_email }}</a>. If you did not request this change, please contact us immediately at <a href="mailto:{{ support_email }}">{{ support_email }}</a>.{% endtrans %}
+ {% trans new_email=macros.email_tag(new_email), support_email=macros.email_tag(support_email) %}The email associated with your Zulip account was recently changed to {{ new_email }}. If you did not request this change, please contact us immediately at {{ support_email }}.{% endtrans %}
</p>
<p>
{{ _("Best,") }}<br>
{{ _("Team Zulip") }}
</p>
{% endblock %} | 2 | 0.125 | 1 | 1 |
60a9d9581242f35ff0250264dbe79dcabf654658 | karma.conf.js | karma.conf.js | /* eslint-env node */
const path = require('path');
var browsers = ['Chrome'];
if (process.env.NODE_ENV === 'test') {
browsers = ['PhantomJS'];
}
module.exports = (config) => {
config.set({
basePath: '.',
frameworks: ['mocha', 'chai', 'phantomjs-shim', 'es6-shim'],
files: [
'./tests/index.js'
],
preprocessors: {
'./tests/index.js': ['webpack', 'sourcemap']
},
webpack: {
resolve: {
alias: {
'react-easy-chart': path.join(__dirname, 'modules')
}
},
module: {
loaders: [
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ }
]
},
devtool: 'inline-source-map'
},
webpackServer: {
noInfo: true
},
browsers: browsers,
singleRun: true,
reporters: ['progress'],
plugins: [
require('karma-mocha'),
require('karma-chai'),
require('karma-webpack'),
require('karma-sourcemap-loader'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'),
require('karma-phantomjs-shim'),
require('karma-es6-shim')
]
});
};
| /* eslint-env node */
const path = require('path');
var browsers = ['Chrome'];
if (process.env.NODE_ENV === 'test') {
browsers = ['PhantomJS'];
}
module.exports = (config) => {
config.set({
basePath: '.',
frameworks: ['mocha', 'chai', 'es6-shim'],
files: [
'./tests/index.js'
],
preprocessors: {
'./tests/index.js': ['webpack', 'sourcemap']
},
webpack: {
resolve: {
alias: {
'react-easy-chart': path.join(__dirname, 'modules')
}
},
module: {
loaders: [
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ }
]
},
devtool: 'inline-source-map'
},
webpackServer: {
noInfo: true
},
browsers: browsers,
singleRun: true,
reporters: ['progress'],
plugins: [
require('karma-mocha'),
require('karma-chai'),
require('karma-webpack'),
require('karma-sourcemap-loader'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'),
require('karma-es6-shim')
]
});
};
| Replace phantomjs shim with es6-shim | Replace phantomjs shim with es6-shim
| JavaScript | bsd-3-clause | rma-consulting/rc-d3,rma-consulting/react-easy-chart,rma-consulting/react-easy-chart,rma-consulting/rc-d3 | javascript | ## Code Before:
/* eslint-env node */
const path = require('path');
var browsers = ['Chrome'];
if (process.env.NODE_ENV === 'test') {
browsers = ['PhantomJS'];
}
module.exports = (config) => {
config.set({
basePath: '.',
frameworks: ['mocha', 'chai', 'phantomjs-shim', 'es6-shim'],
files: [
'./tests/index.js'
],
preprocessors: {
'./tests/index.js': ['webpack', 'sourcemap']
},
webpack: {
resolve: {
alias: {
'react-easy-chart': path.join(__dirname, 'modules')
}
},
module: {
loaders: [
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ }
]
},
devtool: 'inline-source-map'
},
webpackServer: {
noInfo: true
},
browsers: browsers,
singleRun: true,
reporters: ['progress'],
plugins: [
require('karma-mocha'),
require('karma-chai'),
require('karma-webpack'),
require('karma-sourcemap-loader'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'),
require('karma-phantomjs-shim'),
require('karma-es6-shim')
]
});
};
## Instruction:
Replace phantomjs shim with es6-shim
## Code After:
/* eslint-env node */
const path = require('path');
var browsers = ['Chrome'];
if (process.env.NODE_ENV === 'test') {
browsers = ['PhantomJS'];
}
module.exports = (config) => {
config.set({
basePath: '.',
frameworks: ['mocha', 'chai', 'es6-shim'],
files: [
'./tests/index.js'
],
preprocessors: {
'./tests/index.js': ['webpack', 'sourcemap']
},
webpack: {
resolve: {
alias: {
'react-easy-chart': path.join(__dirname, 'modules')
}
},
module: {
loaders: [
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ }
]
},
devtool: 'inline-source-map'
},
webpackServer: {
noInfo: true
},
browsers: browsers,
singleRun: true,
reporters: ['progress'],
plugins: [
require('karma-mocha'),
require('karma-chai'),
require('karma-webpack'),
require('karma-sourcemap-loader'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'),
require('karma-es6-shim')
]
});
};
| /* eslint-env node */
const path = require('path');
var browsers = ['Chrome'];
if (process.env.NODE_ENV === 'test') {
browsers = ['PhantomJS'];
}
module.exports = (config) => {
config.set({
basePath: '.',
- frameworks: ['mocha', 'chai', 'phantomjs-shim', 'es6-shim'],
? ------------------
+ frameworks: ['mocha', 'chai', 'es6-shim'],
files: [
'./tests/index.js'
],
preprocessors: {
'./tests/index.js': ['webpack', 'sourcemap']
},
webpack: {
resolve: {
alias: {
'react-easy-chart': path.join(__dirname, 'modules')
}
},
module: {
loaders: [
{ test: /\.js$/, loader: 'babel', exclude: /node_modules/ }
]
},
devtool: 'inline-source-map'
},
webpackServer: {
noInfo: true
},
browsers: browsers,
singleRun: true,
reporters: ['progress'],
plugins: [
require('karma-mocha'),
require('karma-chai'),
require('karma-webpack'),
require('karma-sourcemap-loader'),
require('karma-chrome-launcher'),
require('karma-phantomjs-launcher'),
- require('karma-phantomjs-shim'),
require('karma-es6-shim')
]
});
}; | 3 | 0.061224 | 1 | 2 |
650a4733aa6e15b80e2adeec34fc479a3b2885e3 | src/cmdline/config.py | src/cmdline/config.py | import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
script_name = os.path.basename(sys.argv[0])
for dirpath in pkg_locations + (
os.path.join(sys.prefix, 'config'),
'/etc/{}'.format(script_name),
os.path.expanduser('~/.{}'.format(script_name)),
):
full_path = dirpath
if filename:
full_path = os.path.join(full_path, filename)
yield full_path
| import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
script_name = os.path.basename(sys.argv[0])
for dirpath in pkg_locations + (
os.path.join(sys.prefix, 'config'),
os.path.join(sys.prefix, 'etc', script_name),
os.path.expanduser('~/.{}'.format(script_name)),
):
full_path = dirpath
if filename:
full_path = os.path.join(full_path, filename)
yield full_path
| Use etc relative to sys.prefix | Use etc relative to sys.prefix
| Python | apache-2.0 | rca/cmdline | python | ## Code Before:
import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
script_name = os.path.basename(sys.argv[0])
for dirpath in pkg_locations + (
os.path.join(sys.prefix, 'config'),
'/etc/{}'.format(script_name),
os.path.expanduser('~/.{}'.format(script_name)),
):
full_path = dirpath
if filename:
full_path = os.path.join(full_path, filename)
yield full_path
## Instruction:
Use etc relative to sys.prefix
## Code After:
import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
script_name = os.path.basename(sys.argv[0])
for dirpath in pkg_locations + (
os.path.join(sys.prefix, 'config'),
os.path.join(sys.prefix, 'etc', script_name),
os.path.expanduser('~/.{}'.format(script_name)),
):
full_path = dirpath
if filename:
full_path = os.path.join(full_path, filename)
yield full_path
| import os
import sys
try:
import pkg_resources
d = pkg_resources.get_distribution('metermaid')
pkg_locations = (
os.path.join(d.location, 'config'),
os.path.join(os.path.dirname(d.location), 'config'),
)
except ImportError:
pkg_locations = ()
def get_config_paths(filename=None):
script_name = os.path.basename(sys.argv[0])
for dirpath in pkg_locations + (
os.path.join(sys.prefix, 'config'),
- '/etc/{}'.format(script_name),
+ os.path.join(sys.prefix, 'etc', script_name),
os.path.expanduser('~/.{}'.format(script_name)),
):
full_path = dirpath
if filename:
full_path = os.path.join(full_path, filename)
yield full_path | 2 | 0.068966 | 1 | 1 |
9ba31ee185b6eefbfb8677c266e4f332d0e97530 | tests/EvangelistStatusTest.php | tests/EvangelistStatusTest.php | <?php
/**
* These are the test for the core files.
*
* @package Open Source Evangelist Agnostic Package
* @author Surajudeen AKANDE <surajudeen.akande@andela.com>
* @license MIT <https://opensource.org/licenses/MIT>
* @link http://www.github.com/andela-sakande
*/
namespace Sirolad\Evangelist\Test;
use Sirolad\Evangelist\EvangelistStatus;
/*
* EvangelistStatusTest is the test for the EvangelistStatus Class.
*/
class EvangelistStatusTest extends \PHPUnit_Framework_TestCase
{
//class property
protected $statustest;
//instantiate the EvangelistStatus Class with argument
public function setUp()
{
$this->statustest = new EvangelistStatus(2345678);
}
//destroy the EvangelistStatus Class
public function tearDown()
{
unset($this->statustest);
}
/*
* Test for less string output.
*/
public function testStatusOutput()
{
$this->assertTrue(is_string($this->statustest->getStatus()));
}
}
| <?php
/**
* These are the test for the core files.
*
* @package Open Source Evangelist Agnostic Package
* @author Surajudeen AKANDE <surajudeen.akande@andela.com>
* @license MIT <https://opensource.org/licenses/MIT>
* @link http://www.github.com/andela-sakande
*/
namespace Sirolad\Evangelist\Test;
use Sirolad\Evangelist\EvangelistStatus;
/*
* EvangelistStatusTest is the test for the EvangelistStatus Class.
*/
class EvangelistStatusTest extends \PHPUnit_Framework_TestCase
{
//class property
protected $statustest;
//instantiate the EvangelistStatus Class with argument
public function setUp()
{
$this->statustest = new EvangelistStatus(2345678);
}
//destroy the EvangelistStatus Class
public function tearDown()
{
unset($this->statustest);
}
/*
* Test for less string output.
*/
public function testStatusOutput()
{
$this->assertInternalType('string', $this->statustest->getStatus());
}
}
| Use assertInternalType instead of assertTrue | Use assertInternalType instead of assertTrue
| PHP | mit | andela-sakande/evangelist | php | ## Code Before:
<?php
/**
* These are the test for the core files.
*
* @package Open Source Evangelist Agnostic Package
* @author Surajudeen AKANDE <surajudeen.akande@andela.com>
* @license MIT <https://opensource.org/licenses/MIT>
* @link http://www.github.com/andela-sakande
*/
namespace Sirolad\Evangelist\Test;
use Sirolad\Evangelist\EvangelistStatus;
/*
* EvangelistStatusTest is the test for the EvangelistStatus Class.
*/
class EvangelistStatusTest extends \PHPUnit_Framework_TestCase
{
//class property
protected $statustest;
//instantiate the EvangelistStatus Class with argument
public function setUp()
{
$this->statustest = new EvangelistStatus(2345678);
}
//destroy the EvangelistStatus Class
public function tearDown()
{
unset($this->statustest);
}
/*
* Test for less string output.
*/
public function testStatusOutput()
{
$this->assertTrue(is_string($this->statustest->getStatus()));
}
}
## Instruction:
Use assertInternalType instead of assertTrue
## Code After:
<?php
/**
* These are the test for the core files.
*
* @package Open Source Evangelist Agnostic Package
* @author Surajudeen AKANDE <surajudeen.akande@andela.com>
* @license MIT <https://opensource.org/licenses/MIT>
* @link http://www.github.com/andela-sakande
*/
namespace Sirolad\Evangelist\Test;
use Sirolad\Evangelist\EvangelistStatus;
/*
* EvangelistStatusTest is the test for the EvangelistStatus Class.
*/
class EvangelistStatusTest extends \PHPUnit_Framework_TestCase
{
//class property
protected $statustest;
//instantiate the EvangelistStatus Class with argument
public function setUp()
{
$this->statustest = new EvangelistStatus(2345678);
}
//destroy the EvangelistStatus Class
public function tearDown()
{
unset($this->statustest);
}
/*
* Test for less string output.
*/
public function testStatusOutput()
{
$this->assertInternalType('string', $this->statustest->getStatus());
}
}
| <?php
/**
* These are the test for the core files.
*
* @package Open Source Evangelist Agnostic Package
* @author Surajudeen AKANDE <surajudeen.akande@andela.com>
* @license MIT <https://opensource.org/licenses/MIT>
* @link http://www.github.com/andela-sakande
*/
namespace Sirolad\Evangelist\Test;
use Sirolad\Evangelist\EvangelistStatus;
/*
* EvangelistStatusTest is the test for the EvangelistStatus Class.
*/
class EvangelistStatusTest extends \PHPUnit_Framework_TestCase
{
//class property
protected $statustest;
//instantiate the EvangelistStatus Class with argument
public function setUp()
{
$this->statustest = new EvangelistStatus(2345678);
}
//destroy the EvangelistStatus Class
public function tearDown()
{
unset($this->statustest);
}
/*
* Test for less string output.
*/
public function testStatusOutput()
{
- $this->assertTrue(is_string($this->statustest->getStatus()));
? ^^ ^^^ ^ -
+ $this->assertInternalType('string', $this->statustest->getStatus());
? ++++++++ ^^ ^ ^^^
}
} | 2 | 0.047619 | 1 | 1 |
fc2ac5214666a49af129be94b6cad7e188fe2a2c | test/update-license-test.js | test/update-license-test.js | var fs = require('fs');
var expect = require('chai').expect;
var updateLicense = require('../lib/update-license');
describe("update-license", function() {
it("updates 2015 to 2015-2016", function() {
var yearInfo = 'Copyright (c) 2015 Sung Won Cho';
var result = updateLicense(yearInfo);
expect(result).to.equal('Copyright (c) 2015-2016 Sung Won Cho');
});
it("updates 2012-2015 to 2012-2016", function() {
var yearInfo = 'Copyright (c) 2012-2015 Sung Won Cho';
var result = updateLicense(yearInfo);
expect(result).to.equal('Copyright (c) 2012-2016 Sung Won Cho');
});
});
| var fs = require('fs');
var expect = require('chai').expect;
var updateLicense = require('../lib/update-license');
describe("update-license", function() {
it("updates 2015 to 2015-2016", function(done) {
var yearInfo = 'Copyright (c) 2015 Sung Won Cho';
var result = updateLicense(yearInfo, function (err, updatedLicenseContent) {
expect(updatedLicenseContent).to.equal('Copyright (c) 2015-2016 Sung Won Cho');
done();
});
});
it("updates 2012-2015 to 2012-2016", function(done) {
var yearInfo = 'Copyright (c) 2012-2015 Sung Won Cho';
var result = updateLicense(yearInfo, function (err, updatedLicenseContent) {
expect(updatedLicenseContent).to.equal('Copyright (c) 2012-2016 Sung Won Cho');
done();
});
});
});
| Fix test using new asynchronous API | Fix test using new asynchronous API
| JavaScript | mit | sungwoncho/license-up | javascript | ## Code Before:
var fs = require('fs');
var expect = require('chai').expect;
var updateLicense = require('../lib/update-license');
describe("update-license", function() {
it("updates 2015 to 2015-2016", function() {
var yearInfo = 'Copyright (c) 2015 Sung Won Cho';
var result = updateLicense(yearInfo);
expect(result).to.equal('Copyright (c) 2015-2016 Sung Won Cho');
});
it("updates 2012-2015 to 2012-2016", function() {
var yearInfo = 'Copyright (c) 2012-2015 Sung Won Cho';
var result = updateLicense(yearInfo);
expect(result).to.equal('Copyright (c) 2012-2016 Sung Won Cho');
});
});
## Instruction:
Fix test using new asynchronous API
## Code After:
var fs = require('fs');
var expect = require('chai').expect;
var updateLicense = require('../lib/update-license');
describe("update-license", function() {
it("updates 2015 to 2015-2016", function(done) {
var yearInfo = 'Copyright (c) 2015 Sung Won Cho';
var result = updateLicense(yearInfo, function (err, updatedLicenseContent) {
expect(updatedLicenseContent).to.equal('Copyright (c) 2015-2016 Sung Won Cho');
done();
});
});
it("updates 2012-2015 to 2012-2016", function(done) {
var yearInfo = 'Copyright (c) 2012-2015 Sung Won Cho';
var result = updateLicense(yearInfo, function (err, updatedLicenseContent) {
expect(updatedLicenseContent).to.equal('Copyright (c) 2012-2016 Sung Won Cho');
done();
});
});
});
| var fs = require('fs');
var expect = require('chai').expect;
var updateLicense = require('../lib/update-license');
describe("update-license", function() {
- it("updates 2015 to 2015-2016", function() {
+ it("updates 2015 to 2015-2016", function(done) {
? ++++
var yearInfo = 'Copyright (c) 2015 Sung Won Cho';
- var result = updateLicense(yearInfo);
+ var result = updateLicense(yearInfo, function (err, updatedLicenseContent) {
- expect(result).to.equal('Copyright (c) 2015-2016 Sung Won Cho');
? ^ ^^
+ expect(updatedLicenseContent).to.equal('Copyright (c) 2015-2016 Sung Won Cho');
? ++ ^^^^^ ++++++ ^^^^^^^
+ done();
+ });
});
- it("updates 2012-2015 to 2012-2016", function() {
+ it("updates 2012-2015 to 2012-2016", function(done) {
? ++++
var yearInfo = 'Copyright (c) 2012-2015 Sung Won Cho';
- var result = updateLicense(yearInfo);
+ var result = updateLicense(yearInfo, function (err, updatedLicenseContent) {
- expect(result).to.equal('Copyright (c) 2012-2016 Sung Won Cho');
? ^ ^^
+ expect(updatedLicenseContent).to.equal('Copyright (c) 2012-2016 Sung Won Cho');
? ++ ^^^^^ ++++++ ^^^^^^^
+ done();
+ });
});
}); | 16 | 0.888889 | 10 | 6 |
ea7ad10e8a2148cafecb026e0be9f5f7109ce95e | lib/generate/json/index.js | lib/generate/json/index.js | var util = require("util");
var path = require("path");
var Q = require("q");
var fs = require("../fs");
var parse = require("../../parse");
var BaseGenerator = require("../generator");
var Generator = function() {
BaseGenerator.apply(this, arguments);
};
util.inherits(Generator, BaseGenerator);
Generator.prototype.transferFile = function(input) {
// ignore
};
Generator.prototype.convertFile = function(content, input) {
var that = this;
var json = {
progress: parse.progress(this.options.navigation, input)
};
return Q()
.then(function() {
return parse.page(content, {
repo: that.options.githubId,
dir: path.dirname(input) || '/'
});
})
.then(function(sections) {
json.sections = sections;
})
.then(function() {
return fs.writeFile(
path.join(that.options.output, input.replace(".md", ".json")),
JSON.stringify(json, null, 4)
);
});
};
Generator.prototype.finish = function() {
// ignore
};
module.exports = Generator; | var util = require("util");
var path = require("path");
var Q = require("q");
var fs = require("../fs");
var parse = require("../../parse");
var BaseGenerator = require("../generator");
var Generator = function() {
BaseGenerator.apply(this, arguments);
};
util.inherits(Generator, BaseGenerator);
Generator.prototype.transferFile = function(input) {
// ignore
};
Generator.prototype.convertFile = function(content, input) {
var that = this;
var json = {
progress: parse.progress(this.options.navigation, input)
};
return Q()
.then(function() {
return parse.page(content, {
repo: that.options.githubId,
dir: path.dirname(input) || '/'
});
})
.then(function(sections) {
json.sections = sections;
})
.then(function() {
return fs.writeFile(
path.join(that.options.output, input.replace(".md", ".json")),
JSON.stringify(json, null, 4)
);
});
};
// Generate languages index
Generator.prototype.langsIndex = function(langs) {
var that = this;
var json = {
langs: langs.list
};
return Q()
.then(function() {
return fs.writeFile(
path.join(that.options.output, "langs.json"),
JSON.stringify(json, null, 4)
);
});
};
Generator.prototype.finish = function() {
// ignore
};
module.exports = Generator; | Add support for multi-languages books in JSON format | Add support for multi-languages books in JSON format
| JavaScript | apache-2.0 | xxxhycl2010/gitbook,iflyup/gitbook,gencer/gitbook,intfrr/gitbook,JohnTroony/gitbook,strawluffy/gitbook,minghe/gitbook,escopecz/documentation,ryanswanson/gitbook,lucciano/gitbook,JozoVilcek/gitbook,xiongjungit/gitbook,gaearon/gitbook,nycitt/gitbook,npracht/documentation,athiruban/gitbook,iamchenxin/gitbook,alex-dixon/gitbook,hongbinz/gitbook,qingying5810/gitbook,boyXiong/gitbook,snowsnail/gitbook,codepiano/gitbook,gdbooks/gitbook,gdbooks/gitbook,haamop/documentation,OriPekelman/gitbook,palerdot/gitbook,minghe/gitbook,guiquanz/gitbook,yaonphy/SwiftBlog,qingying5810/gitbook,athiruban/gitbook,thelastmile/gitbook,ZachLamb/gitbook,ferrior30/gitbook,hujianfei1989/gitbook,2390183798/gitbook,shibe97/gitbook,tzq668766/gitbook,hongbinz/gitbook,ZachLamb/gitbook,CN-Sean/gitbook,iflyup/gitbook,npracht/documentation,FKV587/gitbook,vehar/gitbook,sunlianghua/gitbook,megumiteam/documentation,xiongjungit/gitbook,sudobashme/gitbook,bradparks/gitbook,sudobashme/gitbook,gaearon/gitbook,thelastmile/gitbook,bradparks/gitbook,mruse/gitbook,Keystion/gitbook,boyXiong/gitbook,FKV587/gitbook,xxxhycl2010/gitbook,palerdot/gitbook,justinleoye/gitbook,haamop/documentation,lucciano/gitbook,xcv58/gitbook,switchspan/gitbook,rohan07/gitbook,bjlxj2008/gitbook,2390183798/gitbook,kamyu104/gitbook,wewelove/gitbook,mautic/documentation,tshoper/gitbook,rohan07/gitbook,xcv58/gitbook,tzq668766/gitbook,justinleoye/gitbook,codepiano/gitbook,anrim/gitbook,sunlianghua/gitbook,iamchenxin/gitbook,JohnTroony/gitbook,ferrior30/gitbook,webwlsong/gitbook,Abhikos/gitbook,a-moses/gitbook,tshoper/gitbook,youprofit/gitbook,grokcoder/gitbook,GitbookIO/gitbook,wewelove/gitbook,bjlxj2008/gitbook,jasonslyvia/gitbook,shibe97/gitbook,nycitt/gitbook,webwlsong/gitbook,snowsnail/gitbook,switchspan/gitbook,kamyu104/gitbook,youprofit/gitbook,jocr1627/gitbook,CN-Sean/gitbook,jocr1627/gitbook,a-moses/gitbook,alex-dixon/gitbook,gencer/gitbook,guiquanz/gitbook,escopecz/documentation,grokcoder/gitbook,vehar/gitbook,megumiteam/documentation,mautic/documentation,jasonslyvia/gitbook,mruse/gitbook,hujianfei1989/gitbook,OriPekelman/gitbook,intfrr/gitbook | javascript | ## Code Before:
var util = require("util");
var path = require("path");
var Q = require("q");
var fs = require("../fs");
var parse = require("../../parse");
var BaseGenerator = require("../generator");
var Generator = function() {
BaseGenerator.apply(this, arguments);
};
util.inherits(Generator, BaseGenerator);
Generator.prototype.transferFile = function(input) {
// ignore
};
Generator.prototype.convertFile = function(content, input) {
var that = this;
var json = {
progress: parse.progress(this.options.navigation, input)
};
return Q()
.then(function() {
return parse.page(content, {
repo: that.options.githubId,
dir: path.dirname(input) || '/'
});
})
.then(function(sections) {
json.sections = sections;
})
.then(function() {
return fs.writeFile(
path.join(that.options.output, input.replace(".md", ".json")),
JSON.stringify(json, null, 4)
);
});
};
Generator.prototype.finish = function() {
// ignore
};
module.exports = Generator;
## Instruction:
Add support for multi-languages books in JSON format
## Code After:
var util = require("util");
var path = require("path");
var Q = require("q");
var fs = require("../fs");
var parse = require("../../parse");
var BaseGenerator = require("../generator");
var Generator = function() {
BaseGenerator.apply(this, arguments);
};
util.inherits(Generator, BaseGenerator);
Generator.prototype.transferFile = function(input) {
// ignore
};
Generator.prototype.convertFile = function(content, input) {
var that = this;
var json = {
progress: parse.progress(this.options.navigation, input)
};
return Q()
.then(function() {
return parse.page(content, {
repo: that.options.githubId,
dir: path.dirname(input) || '/'
});
})
.then(function(sections) {
json.sections = sections;
})
.then(function() {
return fs.writeFile(
path.join(that.options.output, input.replace(".md", ".json")),
JSON.stringify(json, null, 4)
);
});
};
// Generate languages index
Generator.prototype.langsIndex = function(langs) {
var that = this;
var json = {
langs: langs.list
};
return Q()
.then(function() {
return fs.writeFile(
path.join(that.options.output, "langs.json"),
JSON.stringify(json, null, 4)
);
});
};
Generator.prototype.finish = function() {
// ignore
};
module.exports = Generator; | var util = require("util");
var path = require("path");
var Q = require("q");
var fs = require("../fs");
var parse = require("../../parse");
var BaseGenerator = require("../generator");
var Generator = function() {
BaseGenerator.apply(this, arguments);
};
util.inherits(Generator, BaseGenerator);
Generator.prototype.transferFile = function(input) {
// ignore
};
Generator.prototype.convertFile = function(content, input) {
var that = this;
var json = {
progress: parse.progress(this.options.navigation, input)
};
return Q()
.then(function() {
return parse.page(content, {
repo: that.options.githubId,
dir: path.dirname(input) || '/'
});
})
.then(function(sections) {
json.sections = sections;
})
.then(function() {
return fs.writeFile(
path.join(that.options.output, input.replace(".md", ".json")),
JSON.stringify(json, null, 4)
);
});
};
+ // Generate languages index
+ Generator.prototype.langsIndex = function(langs) {
+ var that = this;
+
+ var json = {
+ langs: langs.list
+ };
+
+ return Q()
+ .then(function() {
+ return fs.writeFile(
+ path.join(that.options.output, "langs.json"),
+ JSON.stringify(json, null, 4)
+ );
+ });
+ };
+
Generator.prototype.finish = function() {
// ignore
};
module.exports = Generator; | 17 | 0.361702 | 17 | 0 |
57c5cb999801c9d831a7a222beb57ac244aed08e | metadata/com.thibaudperso.sonycamera.txt | metadata/com.thibaudperso.sonycamera.txt | Categories:Multimedia
License:GPLv2
Web Site:https://github.com/ThibaudM/timelapse-sony/blob/HEAD/README.md
Source Code:https://github.com/ThibaudM/timelapse-sony
Issue Tracker:https://github.com/ThibaudM/timelapse-sony/issues
Auto Name:TimeLapse
Summary:Control a Sony camera over WiFi
Description:
Take pictures with interval time in WiFi mode for your Sony camera. Works
with devices RX100-mk2, NEX-5R, QX-10 / QX-100, NEX-6, Alpha-7, RX10 and
DSC-HX50V.
.
Repo Type:git
Repo:https://github.com/ThibaudM/timelapse-sony
Build:2.0.1,13
commit=b0eb4dc3a6f80cc2b1cf0c0c85cfc56b9f11bdbd
rm=libs/*
extlibs=android/android-support-v4.jar
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:2.0.2
Current Version Code:14
| Categories:Multimedia
License:GPLv2
Web Site:https://github.com/ThibaudM/timelapse-sony/blob/HEAD/README.md
Source Code:https://github.com/ThibaudM/timelapse-sony
Issue Tracker:https://github.com/ThibaudM/timelapse-sony/issues
Auto Name:TimeLapse
Summary:Control a Sony camera over WiFi
Description:
Take pictures with interval time in WiFi mode for your Sony camera. Works
with devices RX100-mk2, NEX-5R, QX-10 / QX-100, NEX-6, Alpha-7, RX10 and
DSC-HX50V.
.
Repo Type:git
Repo:https://github.com/ThibaudM/timelapse-sony
Build:2.0.1,13
commit=b0eb4dc3a6f80cc2b1cf0c0c85cfc56b9f11bdbd
rm=libs/*
extlibs=android/android-support-v4.jar
Build:2.0.2,14
commit=39dc1b19c55aa8abe1fa6fe4c387618f0199864e
rm=libs/*
extlibs=android/android-support-v4.jar
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:2.0.2
Current Version Code:14
| Update TimeLapse to 2.0.2 (14) | Update TimeLapse to 2.0.2 (14)
| Text | agpl-3.0 | f-droid/fdroiddata,f-droid/fdroiddata,f-droid/fdroid-data | text | ## Code Before:
Categories:Multimedia
License:GPLv2
Web Site:https://github.com/ThibaudM/timelapse-sony/blob/HEAD/README.md
Source Code:https://github.com/ThibaudM/timelapse-sony
Issue Tracker:https://github.com/ThibaudM/timelapse-sony/issues
Auto Name:TimeLapse
Summary:Control a Sony camera over WiFi
Description:
Take pictures with interval time in WiFi mode for your Sony camera. Works
with devices RX100-mk2, NEX-5R, QX-10 / QX-100, NEX-6, Alpha-7, RX10 and
DSC-HX50V.
.
Repo Type:git
Repo:https://github.com/ThibaudM/timelapse-sony
Build:2.0.1,13
commit=b0eb4dc3a6f80cc2b1cf0c0c85cfc56b9f11bdbd
rm=libs/*
extlibs=android/android-support-v4.jar
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:2.0.2
Current Version Code:14
## Instruction:
Update TimeLapse to 2.0.2 (14)
## Code After:
Categories:Multimedia
License:GPLv2
Web Site:https://github.com/ThibaudM/timelapse-sony/blob/HEAD/README.md
Source Code:https://github.com/ThibaudM/timelapse-sony
Issue Tracker:https://github.com/ThibaudM/timelapse-sony/issues
Auto Name:TimeLapse
Summary:Control a Sony camera over WiFi
Description:
Take pictures with interval time in WiFi mode for your Sony camera. Works
with devices RX100-mk2, NEX-5R, QX-10 / QX-100, NEX-6, Alpha-7, RX10 and
DSC-HX50V.
.
Repo Type:git
Repo:https://github.com/ThibaudM/timelapse-sony
Build:2.0.1,13
commit=b0eb4dc3a6f80cc2b1cf0c0c85cfc56b9f11bdbd
rm=libs/*
extlibs=android/android-support-v4.jar
Build:2.0.2,14
commit=39dc1b19c55aa8abe1fa6fe4c387618f0199864e
rm=libs/*
extlibs=android/android-support-v4.jar
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:2.0.2
Current Version Code:14
| Categories:Multimedia
License:GPLv2
Web Site:https://github.com/ThibaudM/timelapse-sony/blob/HEAD/README.md
Source Code:https://github.com/ThibaudM/timelapse-sony
Issue Tracker:https://github.com/ThibaudM/timelapse-sony/issues
Auto Name:TimeLapse
Summary:Control a Sony camera over WiFi
Description:
Take pictures with interval time in WiFi mode for your Sony camera. Works
with devices RX100-mk2, NEX-5R, QX-10 / QX-100, NEX-6, Alpha-7, RX10 and
DSC-HX50V.
.
Repo Type:git
Repo:https://github.com/ThibaudM/timelapse-sony
Build:2.0.1,13
commit=b0eb4dc3a6f80cc2b1cf0c0c85cfc56b9f11bdbd
rm=libs/*
extlibs=android/android-support-v4.jar
+ Build:2.0.2,14
+ commit=39dc1b19c55aa8abe1fa6fe4c387618f0199864e
+ rm=libs/*
+ extlibs=android/android-support-v4.jar
+
Auto Update Mode:None
Update Check Mode:RepoManifest
Current Version:2.0.2
Current Version Code:14
| 5 | 0.185185 | 5 | 0 |
85fd0143b50cdc4277fead2791dab449beefc83b | include/oauth1_parameter_names.hrl | include/oauth1_parameter_names.hrl | -define(PARAM_CALLBACK , <<"oauth_callback">>).
-define(PARAM_CONSUMER_KEY , <<"oauth_consumer_key">>).
-define(PARAM_NONCE , <<"oauth_nonce">>).
-define(PARAM_REALM , <<"realm">>).
-define(PARAM_SIGNATURE , <<"oauth_signature">>).
-define(PARAM_SIGNATURE_METHOD , <<"oauth_signature_method">>).
-define(PARAM_TIMESTAMP , <<"oauth_timestamp">>).
-define(PARAM_TOKEN , <<"oauth_token">>).
-define(PARAM_TOKEN_SECRET , <<"oauth_token_secret">>).
-define(PARAM_VERIFIER , <<"oauth_verifier">>).
-define(PARAM_VERSION , <<"oauth_version">>).
| -define(PARAM_CALLBACK , <<"oauth_callback">>).
-define(PARAM_CALLBACK_CONFIRMED , <<"oauth_callback_confirmed">>).
-define(PARAM_CONSUMER_KEY , <<"oauth_consumer_key">>).
-define(PARAM_NONCE , <<"oauth_nonce">>).
-define(PARAM_REALM , <<"realm">>).
-define(PARAM_SIGNATURE , <<"oauth_signature">>).
-define(PARAM_SIGNATURE_METHOD , <<"oauth_signature_method">>).
-define(PARAM_TIMESTAMP , <<"oauth_timestamp">>).
-define(PARAM_TOKEN , <<"oauth_token">>).
-define(PARAM_TOKEN_SECRET , <<"oauth_token_secret">>).
-define(PARAM_VERIFIER , <<"oauth_verifier">>).
-define(PARAM_VERSION , <<"oauth_version">>).
| Define name macro for parameter: "oauth_callback_confirmed" | Define name macro for parameter: "oauth_callback_confirmed"
| Erlang | mit | ibnfirnas/oauth1_core | erlang | ## Code Before:
-define(PARAM_CALLBACK , <<"oauth_callback">>).
-define(PARAM_CONSUMER_KEY , <<"oauth_consumer_key">>).
-define(PARAM_NONCE , <<"oauth_nonce">>).
-define(PARAM_REALM , <<"realm">>).
-define(PARAM_SIGNATURE , <<"oauth_signature">>).
-define(PARAM_SIGNATURE_METHOD , <<"oauth_signature_method">>).
-define(PARAM_TIMESTAMP , <<"oauth_timestamp">>).
-define(PARAM_TOKEN , <<"oauth_token">>).
-define(PARAM_TOKEN_SECRET , <<"oauth_token_secret">>).
-define(PARAM_VERIFIER , <<"oauth_verifier">>).
-define(PARAM_VERSION , <<"oauth_version">>).
## Instruction:
Define name macro for parameter: "oauth_callback_confirmed"
## Code After:
-define(PARAM_CALLBACK , <<"oauth_callback">>).
-define(PARAM_CALLBACK_CONFIRMED , <<"oauth_callback_confirmed">>).
-define(PARAM_CONSUMER_KEY , <<"oauth_consumer_key">>).
-define(PARAM_NONCE , <<"oauth_nonce">>).
-define(PARAM_REALM , <<"realm">>).
-define(PARAM_SIGNATURE , <<"oauth_signature">>).
-define(PARAM_SIGNATURE_METHOD , <<"oauth_signature_method">>).
-define(PARAM_TIMESTAMP , <<"oauth_timestamp">>).
-define(PARAM_TOKEN , <<"oauth_token">>).
-define(PARAM_TOKEN_SECRET , <<"oauth_token_secret">>).
-define(PARAM_VERIFIER , <<"oauth_verifier">>).
-define(PARAM_VERSION , <<"oauth_version">>).
| -define(PARAM_CALLBACK , <<"oauth_callback">>).
+ -define(PARAM_CALLBACK_CONFIRMED , <<"oauth_callback_confirmed">>).
-define(PARAM_CONSUMER_KEY , <<"oauth_consumer_key">>).
-define(PARAM_NONCE , <<"oauth_nonce">>).
-define(PARAM_REALM , <<"realm">>).
-define(PARAM_SIGNATURE , <<"oauth_signature">>).
-define(PARAM_SIGNATURE_METHOD , <<"oauth_signature_method">>).
-define(PARAM_TIMESTAMP , <<"oauth_timestamp">>).
-define(PARAM_TOKEN , <<"oauth_token">>).
-define(PARAM_TOKEN_SECRET , <<"oauth_token_secret">>).
-define(PARAM_VERIFIER , <<"oauth_verifier">>).
-define(PARAM_VERSION , <<"oauth_version">>). | 1 | 0.090909 | 1 | 0 |
d2536ccf164567dc7cf1160cb645530d7f53b7c0 | docs/python/index.md | docs/python/index.md | ---
layout: default
title: Python
---
# Python
[Getting Started][getting-started] -- [Package Search][pypi] -- [Package Tool][pip]
## Runtimes
* python33 - 3.3.x
* python27 - 2.7.x
## Dependency Management
Python runtimes use [PyPI][pypi], [pip][pip] and [venv][venv]
([virtualenv][virtualenv] for python27).
[getting-started]: /docs/python/getting-started/
[pypi]: http://pypi.python.org/pypi
[pip]: http://www.pip-installer.org/
[venv]: http://docs.python.org/dev/library/venv.html
[virtualenv]: http://www.virtualenv.org/
| ---
layout: default
title: Python
---
# Python
[Getting Started][getting-started] -- [Package Search][pypi] -- [Package Tool][pip]
## Runtimes
* python33 - 3.3.x
* python27 - 2.7.x
## Dependency Management
Python runtimes use [PyPI][pypi], [pip][pip], and [virtualenv][virtualenv].
[getting-started]: /docs/python/getting-started/
[pypi]: http://pypi.python.org/pypi
[pip]: http://www.pip-installer.org/
[venv]: http://docs.python.org/dev/library/venv.html
[virtualenv]: http://www.virtualenv.org/
| Revert back to virtualenv as default | Revert back to virtualenv as default
| Markdown | mit | silas/rock,silas/rock,silas/rock,silas/rock,silas/rock,silas/rock,silas/rock,silas/rock | markdown | ## Code Before:
---
layout: default
title: Python
---
# Python
[Getting Started][getting-started] -- [Package Search][pypi] -- [Package Tool][pip]
## Runtimes
* python33 - 3.3.x
* python27 - 2.7.x
## Dependency Management
Python runtimes use [PyPI][pypi], [pip][pip] and [venv][venv]
([virtualenv][virtualenv] for python27).
[getting-started]: /docs/python/getting-started/
[pypi]: http://pypi.python.org/pypi
[pip]: http://www.pip-installer.org/
[venv]: http://docs.python.org/dev/library/venv.html
[virtualenv]: http://www.virtualenv.org/
## Instruction:
Revert back to virtualenv as default
## Code After:
---
layout: default
title: Python
---
# Python
[Getting Started][getting-started] -- [Package Search][pypi] -- [Package Tool][pip]
## Runtimes
* python33 - 3.3.x
* python27 - 2.7.x
## Dependency Management
Python runtimes use [PyPI][pypi], [pip][pip], and [virtualenv][virtualenv].
[getting-started]: /docs/python/getting-started/
[pypi]: http://pypi.python.org/pypi
[pip]: http://www.pip-installer.org/
[venv]: http://docs.python.org/dev/library/venv.html
[virtualenv]: http://www.virtualenv.org/
| ---
layout: default
title: Python
---
# Python
[Getting Started][getting-started] -- [Package Search][pypi] -- [Package Tool][pip]
## Runtimes
* python33 - 3.3.x
* python27 - 2.7.x
## Dependency Management
- Python runtimes use [PyPI][pypi], [pip][pip] and [venv][venv]
+ Python runtimes use [PyPI][pypi], [pip][pip], and [virtualenv][virtualenv].
? + ++++++ ++++++ +
- ([virtualenv][virtualenv] for python27).
[getting-started]: /docs/python/getting-started/
[pypi]: http://pypi.python.org/pypi
[pip]: http://www.pip-installer.org/
[venv]: http://docs.python.org/dev/library/venv.html
[virtualenv]: http://www.virtualenv.org/ | 3 | 0.125 | 1 | 2 |
4ecc6af3c7412bc8d87f3975885c8f76fcd533df | .travis.yml | .travis.yml | language: node_js
notifications:
slack:
secure: pf0TPJVjw3PosTaEWRRea8Yzlby5UnfQD8mp51o/0rQDRR9oGpWNjF6ou3kCI978mBGswmkb55FYkMNCZfPnuBGooMwMmXzBkLhu6MAmszyO3CXbNmFqdnTlMATJguJOmm/3++wbt2C4dvRf9kIhwwmJMtX3qZ1BBc7iMx0mfUs=
| sudo: false
language: node_js
cache:
directories:
- node_modules
notifications:
slack:
secure: pf0TPJVjw3PosTaEWRRea8Yzlby5UnfQD8mp51o/0rQDRR9oGpWNjF6ou3kCI978mBGswmkb55FYkMNCZfPnuBGooMwMmXzBkLhu6MAmszyO3CXbNmFqdnTlMATJguJOmm/3++wbt2C4dvRf9kIhwwmJMtX3qZ1BBc7iMx0mfUs=
| Use container based CI and enable node modules caching | Use container based CI and enable node modules caching
| YAML | mit | palcu/infoeducatie-ui,palcu/infoeducatie-ui,infoeducatie/infoeducatie-ui,infoeducatie/infoeducatie-ui,palcu/infoeducatie-ui,infoeducatie/infoeducatie-ui | yaml | ## Code Before:
language: node_js
notifications:
slack:
secure: pf0TPJVjw3PosTaEWRRea8Yzlby5UnfQD8mp51o/0rQDRR9oGpWNjF6ou3kCI978mBGswmkb55FYkMNCZfPnuBGooMwMmXzBkLhu6MAmszyO3CXbNmFqdnTlMATJguJOmm/3++wbt2C4dvRf9kIhwwmJMtX3qZ1BBc7iMx0mfUs=
## Instruction:
Use container based CI and enable node modules caching
## Code After:
sudo: false
language: node_js
cache:
directories:
- node_modules
notifications:
slack:
secure: pf0TPJVjw3PosTaEWRRea8Yzlby5UnfQD8mp51o/0rQDRR9oGpWNjF6ou3kCI978mBGswmkb55FYkMNCZfPnuBGooMwMmXzBkLhu6MAmszyO3CXbNmFqdnTlMATJguJOmm/3++wbt2C4dvRf9kIhwwmJMtX3qZ1BBc7iMx0mfUs=
| + sudo: false
language: node_js
+ cache:
+ directories:
+ - node_modules
notifications:
slack:
secure: pf0TPJVjw3PosTaEWRRea8Yzlby5UnfQD8mp51o/0rQDRR9oGpWNjF6ou3kCI978mBGswmkb55FYkMNCZfPnuBGooMwMmXzBkLhu6MAmszyO3CXbNmFqdnTlMATJguJOmm/3++wbt2C4dvRf9kIhwwmJMtX3qZ1BBc7iMx0mfUs= | 4 | 1 | 4 | 0 |
daac8bf02d5e3e7d3c09a36bc8e9bda6d20d30c6 | zthread/tests/CMakeLists.txt | zthread/tests/CMakeLists.txt |
file(GLOB SRCS
${PROJECT_SOURCE_DIR}/tests/*.cc
)
add_executable(demo ${SRCS})
target_link_libraries(demo zthread pthread)
|
file(GLOB SRCS
${PROJECT_SOURCE_DIR}/tests/*.cc
)
add_executable(demo ${SRCS})
set(DEMO_DEPENDS "zthread")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_CXX_FLAGS ${DEMO_DEPENDS} pthread)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS ${DEMO_DEPENDS} pthread)
else()
endif()
target_link_libraries(demo ${DEMO_DEPENDS})
| Fix the build error due to pthread link on windows | Fix the build error due to pthread link on windows
| Text | mit | YanShenChun/cppthread,YanShenChun/cppthread,YanShenChun/cppthread | text | ## Code Before:
file(GLOB SRCS
${PROJECT_SOURCE_DIR}/tests/*.cc
)
add_executable(demo ${SRCS})
target_link_libraries(demo zthread pthread)
## Instruction:
Fix the build error due to pthread link on windows
## Code After:
file(GLOB SRCS
${PROJECT_SOURCE_DIR}/tests/*.cc
)
add_executable(demo ${SRCS})
set(DEMO_DEPENDS "zthread")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_CXX_FLAGS ${DEMO_DEPENDS} pthread)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS ${DEMO_DEPENDS} pthread)
else()
endif()
target_link_libraries(demo ${DEMO_DEPENDS})
|
file(GLOB SRCS
${PROJECT_SOURCE_DIR}/tests/*.cc
)
add_executable(demo ${SRCS})
- target_link_libraries(demo zthread pthread)
+
+ set(DEMO_DEPENDS "zthread")
+ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(CMAKE_CXX_FLAGS ${DEMO_DEPENDS} pthread)
+ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ set(CMAKE_CXX_FLAGS ${DEMO_DEPENDS} pthread)
+ else()
+ endif()
+ target_link_libraries(demo ${DEMO_DEPENDS})
+
+ | 12 | 1.333333 | 11 | 1 |
ba1dabaccc85de6e0ada75027e44be3cd1132dd9 | bootstrap.sh | bootstrap.sh | if ! type rvm &> /dev/null; then
[[ -s /usr/local/rvm/scripts/rvm ]] && source /usr/local/rvm/scripts/rvm
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
fi
# Source Rbenv so vimius .rbenv-version takes effect
if ! type rbenv &> /dev/null; then
if [[ -s $HOME/.rvm/scripts/rvm ]]; then
eval "`$HOME/.rbenv/bin/rbenv init -`"
fi
fi
# Add <strong>.old</strong> to any existing Vim file in the home directory
for i in ~/.vim ~/.vimrc ~/.gvimrc; do
if [[ ( -e $i ) || ( -h $i ) ]]; then
echo "${i} has been renamed to ${i}.old"
mv $i $i.old;
fi
done
# Clone Vimius into .vim
git clone git://github.com/TechnoGate/vimius.git ~/.vim
# Run rake inside ~/.vim
( cd ~/.vim && rake )
| if ! type rvm &> /dev/null; then
[[ -s /usr/local/rvm/scripts/rvm ]] && source /usr/local/rvm/scripts/rvm
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
fi
# Source Rbenv so vimius .rbenv-version takes effect
if ! type rbenv &> /dev/null; then
if [[ -s $HOME/.rvm/scripts/rvm ]]; then
eval "`$HOME/.rbenv/bin/rbenv init -`"
fi
fi
# Add <strong>.old</strong> to any existing Vim file in the home directory
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc; do
if [[ ( -e $i ) || ( -h $i ) ]]; then
echo "${i} has been renamed to ${i}.old"
mv "${i}" "${i}.old"
fi
done
# Clone Vimius into .vim
git clone git://github.com/TechnoGate/vimius.git $HOME/.vim
# Run rake inside .vim
( cd $HOME/.vim && rake )
| Use $HOME instead of ~ so we can easily test it. | Bootstrap: Use $HOME instead of ~ so we can easily test it. | Shell | mit | tantion/vim,tantion/vim | shell | ## Code Before:
if ! type rvm &> /dev/null; then
[[ -s /usr/local/rvm/scripts/rvm ]] && source /usr/local/rvm/scripts/rvm
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
fi
# Source Rbenv so vimius .rbenv-version takes effect
if ! type rbenv &> /dev/null; then
if [[ -s $HOME/.rvm/scripts/rvm ]]; then
eval "`$HOME/.rbenv/bin/rbenv init -`"
fi
fi
# Add <strong>.old</strong> to any existing Vim file in the home directory
for i in ~/.vim ~/.vimrc ~/.gvimrc; do
if [[ ( -e $i ) || ( -h $i ) ]]; then
echo "${i} has been renamed to ${i}.old"
mv $i $i.old;
fi
done
# Clone Vimius into .vim
git clone git://github.com/TechnoGate/vimius.git ~/.vim
# Run rake inside ~/.vim
( cd ~/.vim && rake )
## Instruction:
Bootstrap: Use $HOME instead of ~ so we can easily test it.
## Code After:
if ! type rvm &> /dev/null; then
[[ -s /usr/local/rvm/scripts/rvm ]] && source /usr/local/rvm/scripts/rvm
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
fi
# Source Rbenv so vimius .rbenv-version takes effect
if ! type rbenv &> /dev/null; then
if [[ -s $HOME/.rvm/scripts/rvm ]]; then
eval "`$HOME/.rbenv/bin/rbenv init -`"
fi
fi
# Add <strong>.old</strong> to any existing Vim file in the home directory
for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc; do
if [[ ( -e $i ) || ( -h $i ) ]]; then
echo "${i} has been renamed to ${i}.old"
mv "${i}" "${i}.old"
fi
done
# Clone Vimius into .vim
git clone git://github.com/TechnoGate/vimius.git $HOME/.vim
# Run rake inside .vim
( cd $HOME/.vim && rake )
| if ! type rvm &> /dev/null; then
[[ -s /usr/local/rvm/scripts/rvm ]] && source /usr/local/rvm/scripts/rvm
[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm
fi
# Source Rbenv so vimius .rbenv-version takes effect
if ! type rbenv &> /dev/null; then
if [[ -s $HOME/.rvm/scripts/rvm ]]; then
eval "`$HOME/.rbenv/bin/rbenv init -`"
fi
fi
# Add <strong>.old</strong> to any existing Vim file in the home directory
- for i in ~/.vim ~/.vimrc ~/.gvimrc; do
? ^ ^ ^
+ for i in $HOME/.vim $HOME/.vimrc $HOME/.gvimrc; do
? ^^^^^ ^^^^^ ^^^^^
if [[ ( -e $i ) || ( -h $i ) ]]; then
echo "${i} has been renamed to ${i}.old"
- mv $i $i.old;
? ^
+ mv "${i}" "${i}.old"
? + + ++ + + + ^
fi
done
# Clone Vimius into .vim
- git clone git://github.com/TechnoGate/vimius.git ~/.vim
? ^
+ git clone git://github.com/TechnoGate/vimius.git $HOME/.vim
? ^^^^^
- # Run rake inside ~/.vim
? --
+ # Run rake inside .vim
- ( cd ~/.vim && rake )
? ^
+ ( cd $HOME/.vim && rake )
? ^^^^^
| 10 | 0.4 | 5 | 5 |
ee3cfb1ab98cd658ae6c4ec84fff6c1ba3e2a262 | project.clj | project.clj | (defproject yorck-ratings "2.0.0"
:description "IMDB ratings for movies playing in Yorck cinemas Berlin"
:url "https://yorck-ratings.treppo.org"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[http-kit "2.3.0"]
[ring/ring-devel "1.6.3"]
[ring/ring-core "1.6.3"]
[http-kit.fake "0.2.2"]
[luminus/config "0.8"]
[hickory "0.7.1"]
[org.clojure/core.async "0.4.474"]]
:main ^:skip-aot yorck-ratings.web
:target-path "target/%s"
:profiles {:uberjar {:aot :all}
:dev {:resource-paths ["test/resources" "config/dev"]
:dependencies [[midje "1.9.1"] [midje-notifier "0.2.0"]]
:plugins [[lein-midje "3.2.1"]]}
:test {:resource-paths ["test/resources" "config/test"]}}
:min-lein-version "2.4.0"
:uberjar-name "yorck-ratings-standalone.jar")
| (defproject yorck-ratings "2.0.0"
:description "IMDB ratings for movies playing in Yorck cinemas Berlin"
:url "https://yorck-ratings.treppo.org"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[http-kit "2.3.0"]
[ring/ring-devel "1.6.3"]
[ring/ring-core "1.6.3"]
[http-kit.fake "0.2.2"]
[luminus/config "0.8"]
[hickory "0.7.1"]
[org.clojure/core.async "0.4.474"]]
:main ^:skip-aot yorck-ratings.web
:target-path "target/%s"
:profiles {:uberjar {:aot :all}
:dev {:resource-paths ["config/dev"]
:dependencies [[midje "1.9.1"] [midje-notifier "0.2.0"]]
:plugins [[lein-midje "3.2.1"]]}
:midje {:resource-paths ["test/resources" "config/test"]}}
:min-lein-version "2.8.0"
:uberjar-name "yorck-ratings-standalone.jar")
| Use test resources only in midje profile | Use test resources only in midje profile
| Clojure | epl-1.0 | treppo/yorck-ratings-v2 | clojure | ## Code Before:
(defproject yorck-ratings "2.0.0"
:description "IMDB ratings for movies playing in Yorck cinemas Berlin"
:url "https://yorck-ratings.treppo.org"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[http-kit "2.3.0"]
[ring/ring-devel "1.6.3"]
[ring/ring-core "1.6.3"]
[http-kit.fake "0.2.2"]
[luminus/config "0.8"]
[hickory "0.7.1"]
[org.clojure/core.async "0.4.474"]]
:main ^:skip-aot yorck-ratings.web
:target-path "target/%s"
:profiles {:uberjar {:aot :all}
:dev {:resource-paths ["test/resources" "config/dev"]
:dependencies [[midje "1.9.1"] [midje-notifier "0.2.0"]]
:plugins [[lein-midje "3.2.1"]]}
:test {:resource-paths ["test/resources" "config/test"]}}
:min-lein-version "2.4.0"
:uberjar-name "yorck-ratings-standalone.jar")
## Instruction:
Use test resources only in midje profile
## Code After:
(defproject yorck-ratings "2.0.0"
:description "IMDB ratings for movies playing in Yorck cinemas Berlin"
:url "https://yorck-ratings.treppo.org"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[http-kit "2.3.0"]
[ring/ring-devel "1.6.3"]
[ring/ring-core "1.6.3"]
[http-kit.fake "0.2.2"]
[luminus/config "0.8"]
[hickory "0.7.1"]
[org.clojure/core.async "0.4.474"]]
:main ^:skip-aot yorck-ratings.web
:target-path "target/%s"
:profiles {:uberjar {:aot :all}
:dev {:resource-paths ["config/dev"]
:dependencies [[midje "1.9.1"] [midje-notifier "0.2.0"]]
:plugins [[lein-midje "3.2.1"]]}
:midje {:resource-paths ["test/resources" "config/test"]}}
:min-lein-version "2.8.0"
:uberjar-name "yorck-ratings-standalone.jar")
| (defproject yorck-ratings "2.0.0"
:description "IMDB ratings for movies playing in Yorck cinemas Berlin"
:url "https://yorck-ratings.treppo.org"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[http-kit "2.3.0"]
[ring/ring-devel "1.6.3"]
[ring/ring-core "1.6.3"]
[http-kit.fake "0.2.2"]
[luminus/config "0.8"]
[hickory "0.7.1"]
[org.clojure/core.async "0.4.474"]]
:main ^:skip-aot yorck-ratings.web
:target-path "target/%s"
:profiles {:uberjar {:aot :all}
- :dev {:resource-paths ["test/resources" "config/dev"]
? -----------------
+ :dev {:resource-paths ["config/dev"]
:dependencies [[midje "1.9.1"] [midje-notifier "0.2.0"]]
:plugins [[lein-midje "3.2.1"]]}
- :test {:resource-paths ["test/resources" "config/test"]}}
? ^ --
+ :midje {:resource-paths ["test/resources" "config/test"]}}
? ^^^^
- :min-lein-version "2.4.0"
? ^
+ :min-lein-version "2.8.0"
? ^
:uberjar-name "yorck-ratings-standalone.jar") | 6 | 0.272727 | 3 | 3 |
59d086c044298602ec9ad6b3b791debfbbf99f15 | app/models/lesson.rb | app/models/lesson.rb | class Lesson < ActiveRecord::Base
attr_accessible :background, :title
validates :title, :presence => { :message => "for lesson can't be blank" }
validates :background, :presence => { :message => "for lesson can't be blank" }
belongs_to :course
def club
course.club
end
def user
club.user
end
def assign_defaults
self.title = "Lesson #{(course.lessons.count + 1)} - #{Settings.lessons[:default_title]}"
self.background = Settings.lessons[:default_background]
end
end
| class Lesson < ActiveRecord::Base
attr_accessible :background, :free, :title
validates :title, :presence => { :message => "for lesson can't be blank" }
validates :background, :presence => { :message => "for lesson can't be blank" }
belongs_to :course
def club
course.club
end
def user
club.user
end
def assign_defaults
self.title = "Lesson #{(course.lessons.count + 1)} - #{Settings.lessons[:default_title]}"
self.background = Settings.lessons[:default_background]
self.free = Settings.lessons[:default_free]
end
end
| Update Lesson for Free Boolean Initialize | Update Lesson for Free Boolean Initialize
Update the Lesson model to include initializing the default 'free'
boolean value.
| Ruby | mit | jekhokie/IfSimply,jekhokie/IfSimply,jekhokie/IfSimply | ruby | ## Code Before:
class Lesson < ActiveRecord::Base
attr_accessible :background, :title
validates :title, :presence => { :message => "for lesson can't be blank" }
validates :background, :presence => { :message => "for lesson can't be blank" }
belongs_to :course
def club
course.club
end
def user
club.user
end
def assign_defaults
self.title = "Lesson #{(course.lessons.count + 1)} - #{Settings.lessons[:default_title]}"
self.background = Settings.lessons[:default_background]
end
end
## Instruction:
Update Lesson for Free Boolean Initialize
Update the Lesson model to include initializing the default 'free'
boolean value.
## Code After:
class Lesson < ActiveRecord::Base
attr_accessible :background, :free, :title
validates :title, :presence => { :message => "for lesson can't be blank" }
validates :background, :presence => { :message => "for lesson can't be blank" }
belongs_to :course
def club
course.club
end
def user
club.user
end
def assign_defaults
self.title = "Lesson #{(course.lessons.count + 1)} - #{Settings.lessons[:default_title]}"
self.background = Settings.lessons[:default_background]
self.free = Settings.lessons[:default_free]
end
end
| class Lesson < ActiveRecord::Base
- attr_accessible :background, :title
+ attr_accessible :background, :free, :title
? +++++++
validates :title, :presence => { :message => "for lesson can't be blank" }
validates :background, :presence => { :message => "for lesson can't be blank" }
belongs_to :course
def club
course.club
end
def user
club.user
end
def assign_defaults
self.title = "Lesson #{(course.lessons.count + 1)} - #{Settings.lessons[:default_title]}"
self.background = Settings.lessons[:default_background]
+ self.free = Settings.lessons[:default_free]
end
end | 3 | 0.142857 | 2 | 1 |
66f0cb5a4a0e359162359ea763775ead7159f62c | test-case-qsort.lisp | test-case-qsort.lisp | (test-case 'test-case-qsort
'((test test-qsort
((assert-equal '() (qsort '()))
(assert-equal '(1) (qsort '(1)))
(assert-equal '(1 2) (qsort '(1 2)))
(assert-equal '(1 2 3) (qsort '(3 1 2)))
(assert-equal '(1 2 2 3) (qsort '(2 3 1 2)))))))
| (test-case 'test-case-qsort
'((test test-qsort-without-getter
((assert-equal '() (qsort '()))
(assert-equal '(1) (qsort '(1)))
(assert-equal '(1 2) (qsort '(1 2)))
(assert-equal '(1 2 3) (qsort '(3 1 2)))
(assert-equal '(1 2 2 3) (qsort '(2 3 1 2)))))
(test test-qsort-with-getter
((assert-equal '((1 . 4) (2 . 3)) (qsort '((2 . 3) (1 . 4)) car))
(assert-equal '((2 . 3) (1 . 4)) (qsort '((1 . 4) (2 . 3)) cdr))))))
| Test qsort with and without getter | Test qsort with and without getter
| Common Lisp | mit | adjl/PolynomialArithmetic,adjl/PolynomialArithmetic | common-lisp | ## Code Before:
(test-case 'test-case-qsort
'((test test-qsort
((assert-equal '() (qsort '()))
(assert-equal '(1) (qsort '(1)))
(assert-equal '(1 2) (qsort '(1 2)))
(assert-equal '(1 2 3) (qsort '(3 1 2)))
(assert-equal '(1 2 2 3) (qsort '(2 3 1 2)))))))
## Instruction:
Test qsort with and without getter
## Code After:
(test-case 'test-case-qsort
'((test test-qsort-without-getter
((assert-equal '() (qsort '()))
(assert-equal '(1) (qsort '(1)))
(assert-equal '(1 2) (qsort '(1 2)))
(assert-equal '(1 2 3) (qsort '(3 1 2)))
(assert-equal '(1 2 2 3) (qsort '(2 3 1 2)))))
(test test-qsort-with-getter
((assert-equal '((1 . 4) (2 . 3)) (qsort '((2 . 3) (1 . 4)) car))
(assert-equal '((2 . 3) (1 . 4)) (qsort '((1 . 4) (2 . 3)) cdr))))))
| (test-case 'test-case-qsort
- '((test test-qsort
+ '((test test-qsort-without-getter
? +++++++++++++++
((assert-equal '() (qsort '()))
(assert-equal '(1) (qsort '(1)))
(assert-equal '(1 2) (qsort '(1 2)))
(assert-equal '(1 2 3) (qsort '(3 1 2)))
- (assert-equal '(1 2 2 3) (qsort '(2 3 1 2)))))))
? --
+ (assert-equal '(1 2 2 3) (qsort '(2 3 1 2)))))
+ (test test-qsort-with-getter
+ ((assert-equal '((1 . 4) (2 . 3)) (qsort '((2 . 3) (1 . 4)) car))
+ (assert-equal '((2 . 3) (1 . 4)) (qsort '((1 . 4) (2 . 3)) cdr)))))) | 7 | 1 | 5 | 2 |
4a7f54099febe2ca5d2dc50cf94661870de5f40e | .delivery/project.toml | .delivery/project.toml |
[local_phases]
unit = "chef exec rspec spec/"
lint = "chef exec cookstyle --display-cop-names --extra-details"
syntax = "chef exec foodcritic ."
provision = "chef exec kitchen create"
deploy = "chef exec kitchen converge"
smoke = "chef exec kitchen verify"
functional = "echo skipping"
cleanup = "chef exec kitchen destroy"
| remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
| Use common community delivery config | test: Use common community delivery config
Less is more
| TOML | apache-2.0 | criteo-forks/chef-zookeeper,evertrue/zookeeper-cookbook,evertrue/zookeeper-cookbook,SimpleFinance/chef-zookeeper,SimpleFinance/chef-zookeeper,evertrue/zookeeper-cookbook,SimpleFinance/chef-zookeeper | toml | ## Code Before:
[local_phases]
unit = "chef exec rspec spec/"
lint = "chef exec cookstyle --display-cop-names --extra-details"
syntax = "chef exec foodcritic ."
provision = "chef exec kitchen create"
deploy = "chef exec kitchen converge"
smoke = "chef exec kitchen verify"
functional = "echo skipping"
cleanup = "chef exec kitchen destroy"
## Instruction:
test: Use common community delivery config
Less is more
## Code After:
remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
| + remote_file = "https://raw.githubusercontent.com/chef-cookbooks/community_cookbook_tools/master/delivery/project.toml"
-
- [local_phases]
- unit = "chef exec rspec spec/"
- lint = "chef exec cookstyle --display-cop-names --extra-details"
- syntax = "chef exec foodcritic ."
- provision = "chef exec kitchen create"
- deploy = "chef exec kitchen converge"
- smoke = "chef exec kitchen verify"
- functional = "echo skipping"
- cleanup = "chef exec kitchen destroy" | 11 | 1.1 | 1 | 10 |
e1f49afe5d4aeae2306349d52df4295944598dc1 | thinglang/parser/tokens/logic.py | thinglang/parser/tokens/logic.py | from thinglang.lexer.symbols.logic import LexicalEquality
from thinglang.parser.tokens import BaseToken
class Conditional(BaseToken):
ADVANCE = False
def __init__(self, slice):
super(Conditional, self).__init__(slice)
_, self.value = slice
def describe(self):
return 'if {}'.format(self.value)
def evaluate(self, stack):
return self.value.evaluate(stack)
class UnconditionalElse(BaseToken):
pass
class ConditionalElse(Conditional):
def __init__(self, slice):
super(ConditionalElse, self).__init__(slice)
_, self.conditional = slice
def describe(self):
return 'otherwise if {}'.format(self.value)
| from thinglang.lexer.symbols.logic import LexicalEquality
from thinglang.parser.tokens import BaseToken
class Conditional(BaseToken):
ADVANCE = False
def __init__(self, slice):
super(Conditional, self).__init__(slice)
_, self.value = slice
def describe(self):
return 'if {}'.format(self.value)
def evaluate(self, stack):
return self.value.evaluate(stack)
class ElseBranchInterface(object):
pass
class UnconditionalElse(BaseToken, ElseBranchInterface):
pass
class ConditionalElse(Conditional, ElseBranchInterface):
def __init__(self, slice):
super(ConditionalElse, self).__init__(slice)
_, self.conditional = slice
def describe(self):
return 'otherwise if {}'.format(self.value)
| Update interface signatures for else branches | Update interface signatures for else branches
| Python | mit | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | python | ## Code Before:
from thinglang.lexer.symbols.logic import LexicalEquality
from thinglang.parser.tokens import BaseToken
class Conditional(BaseToken):
ADVANCE = False
def __init__(self, slice):
super(Conditional, self).__init__(slice)
_, self.value = slice
def describe(self):
return 'if {}'.format(self.value)
def evaluate(self, stack):
return self.value.evaluate(stack)
class UnconditionalElse(BaseToken):
pass
class ConditionalElse(Conditional):
def __init__(self, slice):
super(ConditionalElse, self).__init__(slice)
_, self.conditional = slice
def describe(self):
return 'otherwise if {}'.format(self.value)
## Instruction:
Update interface signatures for else branches
## Code After:
from thinglang.lexer.symbols.logic import LexicalEquality
from thinglang.parser.tokens import BaseToken
class Conditional(BaseToken):
ADVANCE = False
def __init__(self, slice):
super(Conditional, self).__init__(slice)
_, self.value = slice
def describe(self):
return 'if {}'.format(self.value)
def evaluate(self, stack):
return self.value.evaluate(stack)
class ElseBranchInterface(object):
pass
class UnconditionalElse(BaseToken, ElseBranchInterface):
pass
class ConditionalElse(Conditional, ElseBranchInterface):
def __init__(self, slice):
super(ConditionalElse, self).__init__(slice)
_, self.conditional = slice
def describe(self):
return 'otherwise if {}'.format(self.value)
| from thinglang.lexer.symbols.logic import LexicalEquality
from thinglang.parser.tokens import BaseToken
class Conditional(BaseToken):
ADVANCE = False
def __init__(self, slice):
super(Conditional, self).__init__(slice)
_, self.value = slice
def describe(self):
return 'if {}'.format(self.value)
def evaluate(self, stack):
return self.value.evaluate(stack)
- class UnconditionalElse(BaseToken):
+ class ElseBranchInterface(object):
pass
+ class UnconditionalElse(BaseToken, ElseBranchInterface):
+ pass
+
+
- class ConditionalElse(Conditional):
+ class ConditionalElse(Conditional, ElseBranchInterface):
? +++++++++++++++++++++
def __init__(self, slice):
super(ConditionalElse, self).__init__(slice)
_, self.conditional = slice
def describe(self):
return 'otherwise if {}'.format(self.value) | 8 | 0.258065 | 6 | 2 |
7d90f59407dcd69eee004686c708409fc48035c3 | middlewares/default/index.js | middlewares/default/index.js | const { Router } = require('express')
const cors = require('cors')
const bodyParser = require('body-parser')
const compression = require('compression')
const defaultMiddleware = (app) => {
app.use(compression())
app.use(bodyParser.urlencoded({ extended: true }))
app.use(bodyParser.json())
app.use(cors())
}
module.exports = defaultMiddleware
| const cors = require('cors')
const bodyParser = require('body-parser')
const compression = require('compression')
const defaultMiddleware = (app) => {
app.use(compression())
app.use(bodyParser.urlencoded({ extended: true }))
app.use(bodyParser.json())
app.use(cors())
}
module.exports = defaultMiddleware
| Remove unused require to Router | Remove unused require to Router
| JavaScript | mit | lucasrcdias/customer-mgmt | javascript | ## Code Before:
const { Router } = require('express')
const cors = require('cors')
const bodyParser = require('body-parser')
const compression = require('compression')
const defaultMiddleware = (app) => {
app.use(compression())
app.use(bodyParser.urlencoded({ extended: true }))
app.use(bodyParser.json())
app.use(cors())
}
module.exports = defaultMiddleware
## Instruction:
Remove unused require to Router
## Code After:
const cors = require('cors')
const bodyParser = require('body-parser')
const compression = require('compression')
const defaultMiddleware = (app) => {
app.use(compression())
app.use(bodyParser.urlencoded({ extended: true }))
app.use(bodyParser.json())
app.use(cors())
}
module.exports = defaultMiddleware
| - const { Router } = require('express')
const cors = require('cors')
const bodyParser = require('body-parser')
const compression = require('compression')
const defaultMiddleware = (app) => {
app.use(compression())
app.use(bodyParser.urlencoded({ extended: true }))
app.use(bodyParser.json())
app.use(cors())
}
module.exports = defaultMiddleware | 1 | 0.076923 | 0 | 1 |
9f4e11d2080f2d5c4698d0eb061de54e12b9a789 | LibraryRateMe/res/values/strings.xml | LibraryRateMe/res/values/strings.xml | <?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">LibraryRateMe</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="rateme">Rate Me</string>
<string name="message">How would you rate it ?</string>
<string name="title">Rate You Experience</string>
<string name="title2">Like our App ?</string>
<string name="title_activity_dialog">Dialog</string>
</resources>
| <?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">LibraryRateMe</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="rateme">Rate Me</string>
<string name="message">How would you rate it ?</string>
<string name="title">Rate You Experience</string>
<string name="title2">Like our App ?</string>
<string name="title_activity_dialog">Dialog</string>
<string name="thanks">Thanks for Rame Me</string>
</resources>
| Add new message in Strings | Add new message in Strings
| XML | mit | androidsx/rate-me | xml | ## Code Before:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">LibraryRateMe</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="rateme">Rate Me</string>
<string name="message">How would you rate it ?</string>
<string name="title">Rate You Experience</string>
<string name="title2">Like our App ?</string>
<string name="title_activity_dialog">Dialog</string>
</resources>
## Instruction:
Add new message in Strings
## Code After:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">LibraryRateMe</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="rateme">Rate Me</string>
<string name="message">How would you rate it ?</string>
<string name="title">Rate You Experience</string>
<string name="title2">Like our App ?</string>
<string name="title_activity_dialog">Dialog</string>
<string name="thanks">Thanks for Rame Me</string>
</resources>
| <?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">LibraryRateMe</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="rateme">Rate Me</string>
<string name="message">How would you rate it ?</string>
<string name="title">Rate You Experience</string>
<string name="title2">Like our App ?</string>
<string name="title_activity_dialog">Dialog</string>
+ <string name="thanks">Thanks for Rame Me</string>
</resources> | 1 | 0.076923 | 1 | 0 |
4d06f826a5cfb1ca3a54643282ed20214f40586e | src/react/Main.js | src/react/Main.js | import React from 'react'
import { readJSON } from '../helpers'
import Title from './Title'
export default class Main extends React.Component {
render() {
const { generic } = this.props
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{generic.title}</title>
</head>
<body>
<Title>{generic.title}</Title>
</body>
</html>
)
}
}
| import React from 'react'
import { readJSON } from '../helpers'
import Title from './Title'
export default class Main extends React.Component {
render() {
const { generic } = this.props
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{generic.title}</title>
</head>
<body>
<Title>{generic.title}</Title>
</body>
</html>
)
}
}
Main.propTypes = {
// Required
head: React.PropTypes.shape({
title: React.PropTypes.string.isRequired,
subtitle: React.PropTypes.string,
description: React.PropTypes.string,
}).isRequired,
// Optional
constact: React.PropTypes.shape({
mail: React.PropTypes.string,
facebook: React.PropTypes.string,
twitter: React.PropTypes.string,
github: React.PropTypes.string,
}),
style: React.PropTypes.shape({
accentColor: React.PropTypes.string,
theme: React.PropTypes.string,
}),
sections: React.PropTypes.arrayOf(React.PropTypes.shape({
rank: React.PropTypes.number.isRequired,
title: React.PropTypes.string,
description: React.PropTypes.string,
color: React.PropTypes.string,
})),
plugins: React.PropTypes.arrayOf(React.PropTypes.shape({
rank: React.PropTypes.number.isRequired,
component: React.PropTypes.string.isRequired,
})),
}
Main.defaultProps = {
style: {
accentColor: 'grey',
}
}
| Set some PropTypes in main.js following the init guidelines | Set some PropTypes in main.js following the init guidelines
WARNING: might be a little out of date, still need to check for certainty
| JavaScript | mpl-2.0 | Quite-nice/generic-website | javascript | ## Code Before:
import React from 'react'
import { readJSON } from '../helpers'
import Title from './Title'
export default class Main extends React.Component {
render() {
const { generic } = this.props
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{generic.title}</title>
</head>
<body>
<Title>{generic.title}</Title>
</body>
</html>
)
}
}
## Instruction:
Set some PropTypes in main.js following the init guidelines
WARNING: might be a little out of date, still need to check for certainty
## Code After:
import React from 'react'
import { readJSON } from '../helpers'
import Title from './Title'
export default class Main extends React.Component {
render() {
const { generic } = this.props
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{generic.title}</title>
</head>
<body>
<Title>{generic.title}</Title>
</body>
</html>
)
}
}
Main.propTypes = {
// Required
head: React.PropTypes.shape({
title: React.PropTypes.string.isRequired,
subtitle: React.PropTypes.string,
description: React.PropTypes.string,
}).isRequired,
// Optional
constact: React.PropTypes.shape({
mail: React.PropTypes.string,
facebook: React.PropTypes.string,
twitter: React.PropTypes.string,
github: React.PropTypes.string,
}),
style: React.PropTypes.shape({
accentColor: React.PropTypes.string,
theme: React.PropTypes.string,
}),
sections: React.PropTypes.arrayOf(React.PropTypes.shape({
rank: React.PropTypes.number.isRequired,
title: React.PropTypes.string,
description: React.PropTypes.string,
color: React.PropTypes.string,
})),
plugins: React.PropTypes.arrayOf(React.PropTypes.shape({
rank: React.PropTypes.number.isRequired,
component: React.PropTypes.string.isRequired,
})),
}
Main.defaultProps = {
style: {
accentColor: 'grey',
}
}
| import React from 'react'
import { readJSON } from '../helpers'
import Title from './Title'
export default class Main extends React.Component {
render() {
const { generic } = this.props
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{generic.title}</title>
</head>
<body>
<Title>{generic.title}</Title>
</body>
</html>
)
}
}
+
+ Main.propTypes = {
+ // Required
+ head: React.PropTypes.shape({
+ title: React.PropTypes.string.isRequired,
+
+ subtitle: React.PropTypes.string,
+ description: React.PropTypes.string,
+ }).isRequired,
+
+ // Optional
+ constact: React.PropTypes.shape({
+ mail: React.PropTypes.string,
+ facebook: React.PropTypes.string,
+ twitter: React.PropTypes.string,
+ github: React.PropTypes.string,
+ }),
+ style: React.PropTypes.shape({
+ accentColor: React.PropTypes.string,
+ theme: React.PropTypes.string,
+ }),
+ sections: React.PropTypes.arrayOf(React.PropTypes.shape({
+ rank: React.PropTypes.number.isRequired,
+
+ title: React.PropTypes.string,
+ description: React.PropTypes.string,
+ color: React.PropTypes.string,
+ })),
+ plugins: React.PropTypes.arrayOf(React.PropTypes.shape({
+ rank: React.PropTypes.number.isRequired,
+ component: React.PropTypes.string.isRequired,
+ })),
+ }
+
+ Main.defaultProps = {
+ style: {
+ accentColor: 'grey',
+ }
+ } | 39 | 1.772727 | 39 | 0 |
95e51a114f9f41626f65adca69d57fd52baa892d | app/services/deal_cards.rb | app/services/deal_cards.rb | class DealCards
attr_reader :errors
def initialize(round, deck)
@round = round
@game = round.game
@deck = deck
end
def call
@round.with_lock do
deal_cards if cards_can_be_dealt
end
success?
end
private
def cards_can_be_dealt
@round.cards.count == 0
end
def deal_cards
deal_hands
deal_kitty
end
def deal_hands
@game.players.each do |player|
@deck.pop(10).each do |card|
card.round = @round
player.cards << card
# TODO for the whole service, just call save.bang! - don't worry about errors
unless card.save
add_error("unable to deal card: #{card.rank} of #{card.suit} to #{player.handle}")
end
end
end
end
def deal_kitty
@deck.each do |card|
card.round = @round
unless card.save
add_error("unable to deal card: #{card.rank} of #{card.suit} to the kitty")
end
end
end
def success?
@round.errors.empty?
end
def add_error(message)
@errors << message
end
end
| class DealCards
def initialize(round, deck)
@round = round
@game = round.game
@deck = deck
end
def call
@round.with_lock do
deal_cards if cards_can_be_dealt
end
@round.cards.present?
end
private
def cards_can_be_dealt
@round.cards.none?
end
def deal_cards
deal_hands
deal_kitty
end
def deal_hands
@game.players.each do |player|
@deck.pop(10).each do |card|
card.round = @round
player.cards << card
card.save!
end
end
end
def deal_kitty
@deck.each do |card|
card.round = @round
card.save!
end
end
end
| Use save! in deal_card service instead of errors | Use save! in deal_card service instead of errors
| Ruby | mit | trezona-lecomte/five-hundred-rails,trezona-lecomte/five-hundred-rails | ruby | ## Code Before:
class DealCards
attr_reader :errors
def initialize(round, deck)
@round = round
@game = round.game
@deck = deck
end
def call
@round.with_lock do
deal_cards if cards_can_be_dealt
end
success?
end
private
def cards_can_be_dealt
@round.cards.count == 0
end
def deal_cards
deal_hands
deal_kitty
end
def deal_hands
@game.players.each do |player|
@deck.pop(10).each do |card|
card.round = @round
player.cards << card
# TODO for the whole service, just call save.bang! - don't worry about errors
unless card.save
add_error("unable to deal card: #{card.rank} of #{card.suit} to #{player.handle}")
end
end
end
end
def deal_kitty
@deck.each do |card|
card.round = @round
unless card.save
add_error("unable to deal card: #{card.rank} of #{card.suit} to the kitty")
end
end
end
def success?
@round.errors.empty?
end
def add_error(message)
@errors << message
end
end
## Instruction:
Use save! in deal_card service instead of errors
## Code After:
class DealCards
def initialize(round, deck)
@round = round
@game = round.game
@deck = deck
end
def call
@round.with_lock do
deal_cards if cards_can_be_dealt
end
@round.cards.present?
end
private
def cards_can_be_dealt
@round.cards.none?
end
def deal_cards
deal_hands
deal_kitty
end
def deal_hands
@game.players.each do |player|
@deck.pop(10).each do |card|
card.round = @round
player.cards << card
card.save!
end
end
end
def deal_kitty
@deck.each do |card|
card.round = @round
card.save!
end
end
end
| class DealCards
- attr_reader :errors
-
def initialize(round, deck)
@round = round
@game = round.game
@deck = deck
end
def call
@round.with_lock do
deal_cards if cards_can_be_dealt
end
- success?
+ @round.cards.present?
end
private
def cards_can_be_dealt
- @round.cards.count == 0
? ^ - ^^^^^^
+ @round.cards.none?
? ^ ^^
end
def deal_cards
deal_hands
deal_kitty
end
def deal_hands
@game.players.each do |player|
@deck.pop(10).each do |card|
card.round = @round
player.cards << card
- # TODO for the whole service, just call save.bang! - don't worry about errors
- unless card.save
? -------
+ card.save!
? +
- add_error("unable to deal card: #{card.rank} of #{card.suit} to #{player.handle}")
- end
end
end
end
def deal_kitty
@deck.each do |card|
card.round = @round
- unless card.save
? -------
+ card.save!
? +
- add_error("unable to deal card: #{card.rank} of #{card.suit} to the kitty")
- end
end
end
-
- def success?
- @round.errors.empty?
- end
-
- def add_error(message)
- @errors << message
- end
end | 23 | 0.370968 | 4 | 19 |
c61929a9f23ad38f5113552d2724b1375252af8e | lib/rubocop/cop/rspec/mixin/top_level_group.rb | lib/rubocop/cop/rspec/mixin/top_level_group.rb |
module RuboCop
module Cop
module RSpec
# Helper methods for top level example group cops
module TopLevelGroup
extend RuboCop::NodePattern::Macros
def on_new_investigation
super
return unless root_node
top_level_groups.each do |node|
on_top_level_example_group(node) if example_group?(node)
on_top_level_group(node)
end
end
def top_level_groups
@top_level_groups ||=
top_level_nodes(root_node).select { |n| spec_group?(n) }
end
private
# Dummy methods to be overridden in the consumer
def on_top_level_example_group(_node); end
def on_top_level_group(_node); end
def top_level_group?(node)
top_level_groups.include?(node)
end
def top_level_nodes(node)
if node.nil?
[]
elsif node.begin_type?
node.children
elsif node.module_type? || node.class_type?
top_level_nodes(node.body)
else
[node]
end
end
def root_node
processed_source.ast
end
end
end
end
end
|
module RuboCop
module Cop
module RSpec
# Helper methods for top level example group cops
module TopLevelGroup
extend RuboCop::NodePattern::Macros
def on_new_investigation
super
top_level_groups.each do |node|
on_top_level_example_group(node) if example_group?(node)
on_top_level_group(node)
end
end
def top_level_groups
@top_level_groups ||=
top_level_nodes(root_node).select { |n| spec_group?(n) }
end
private
# Dummy methods to be overridden in the consumer
def on_top_level_example_group(_node); end
def on_top_level_group(_node); end
def top_level_group?(node)
top_level_groups.include?(node)
end
def top_level_nodes(node)
return [] if node.nil?
case node.type
when :begin
node.children
when :module, :class
top_level_nodes(node.body)
else
[node]
end
end
def root_node
processed_source.ast
end
end
end
end
end
| Use `case` instead of `if` | Use `case` instead of `if`
It reads nicer, and `flog` agrees. Before:
❯ flog lib/rubocop/cop/rspec/mixin/top_level_group.rb
29.7: flog total
5.0: flog/method average
9.8: RuboCop::Cop::RSpec::TopLevelGroup#top_level_nodes lib/rubocop/cop/rspec/mixin/top_level_group.rb:36-44
7.6: RuboCop::Cop::RSpec::TopLevelGroup#on_new_investigation lib/rubocop/cop/rspec/mixin/top_level_group.rb:10-16
4.9: RuboCop::Cop::RSpec::TopLevelGroup#top_level_groups lib/rubocop/cop/rspec/mixin/top_level_group.rb:20-22
After:
❯ flog lib/rubocop/cop/rspec/mixin/top_level_group.rb
25.8: flog total
4.3: flog/method average
7.2: RuboCop::Cop::RSpec::TopLevelGroup#top_level_nodes lib/rubocop/cop/rspec/mixin/top_level_group.rb:35-44
6.3: RuboCop::Cop::RSpec::TopLevelGroup#on_new_investigation lib/rubocop/cop/rspec/mixin/top_level_group.rb:10-15
4.9: RuboCop::Cop::RSpec::TopLevelGroup#top_level_groups lib/rubocop/cop/rspec/mixin/top_level_group.rb:19-21
| Ruby | mit | backus/rubocop-rspec,nevir/rubocop-rspec,bquorning/rubocop-rspec,backus/rubocop-rspec | ruby | ## Code Before:
module RuboCop
module Cop
module RSpec
# Helper methods for top level example group cops
module TopLevelGroup
extend RuboCop::NodePattern::Macros
def on_new_investigation
super
return unless root_node
top_level_groups.each do |node|
on_top_level_example_group(node) if example_group?(node)
on_top_level_group(node)
end
end
def top_level_groups
@top_level_groups ||=
top_level_nodes(root_node).select { |n| spec_group?(n) }
end
private
# Dummy methods to be overridden in the consumer
def on_top_level_example_group(_node); end
def on_top_level_group(_node); end
def top_level_group?(node)
top_level_groups.include?(node)
end
def top_level_nodes(node)
if node.nil?
[]
elsif node.begin_type?
node.children
elsif node.module_type? || node.class_type?
top_level_nodes(node.body)
else
[node]
end
end
def root_node
processed_source.ast
end
end
end
end
end
## Instruction:
Use `case` instead of `if`
It reads nicer, and `flog` agrees. Before:
❯ flog lib/rubocop/cop/rspec/mixin/top_level_group.rb
29.7: flog total
5.0: flog/method average
9.8: RuboCop::Cop::RSpec::TopLevelGroup#top_level_nodes lib/rubocop/cop/rspec/mixin/top_level_group.rb:36-44
7.6: RuboCop::Cop::RSpec::TopLevelGroup#on_new_investigation lib/rubocop/cop/rspec/mixin/top_level_group.rb:10-16
4.9: RuboCop::Cop::RSpec::TopLevelGroup#top_level_groups lib/rubocop/cop/rspec/mixin/top_level_group.rb:20-22
After:
❯ flog lib/rubocop/cop/rspec/mixin/top_level_group.rb
25.8: flog total
4.3: flog/method average
7.2: RuboCop::Cop::RSpec::TopLevelGroup#top_level_nodes lib/rubocop/cop/rspec/mixin/top_level_group.rb:35-44
6.3: RuboCop::Cop::RSpec::TopLevelGroup#on_new_investigation lib/rubocop/cop/rspec/mixin/top_level_group.rb:10-15
4.9: RuboCop::Cop::RSpec::TopLevelGroup#top_level_groups lib/rubocop/cop/rspec/mixin/top_level_group.rb:19-21
## Code After:
module RuboCop
module Cop
module RSpec
# Helper methods for top level example group cops
module TopLevelGroup
extend RuboCop::NodePattern::Macros
def on_new_investigation
super
top_level_groups.each do |node|
on_top_level_example_group(node) if example_group?(node)
on_top_level_group(node)
end
end
def top_level_groups
@top_level_groups ||=
top_level_nodes(root_node).select { |n| spec_group?(n) }
end
private
# Dummy methods to be overridden in the consumer
def on_top_level_example_group(_node); end
def on_top_level_group(_node); end
def top_level_group?(node)
top_level_groups.include?(node)
end
def top_level_nodes(node)
return [] if node.nil?
case node.type
when :begin
node.children
when :module, :class
top_level_nodes(node.body)
else
[node]
end
end
def root_node
processed_source.ast
end
end
end
end
end
|
module RuboCop
module Cop
module RSpec
# Helper methods for top level example group cops
module TopLevelGroup
extend RuboCop::NodePattern::Macros
def on_new_investigation
super
- return unless root_node
top_level_groups.each do |node|
on_top_level_example_group(node) if example_group?(node)
on_top_level_group(node)
end
end
def top_level_groups
@top_level_groups ||=
top_level_nodes(root_node).select { |n| spec_group?(n) }
end
private
# Dummy methods to be overridden in the consumer
def on_top_level_example_group(_node); end
def on_top_level_group(_node); end
def top_level_group?(node)
top_level_groups.include?(node)
end
def top_level_nodes(node)
- if node.nil?
+ return [] if node.nil?
? ++++++++++
- []
+
- elsif node.begin_type?
? ---- ------ -
+ case node.type
? +++
+ when :begin
node.children
- elsif node.module_type? || node.class_type?
+ when :module, :class
top_level_nodes(node.body)
else
[node]
end
end
def root_node
processed_source.ast
end
end
end
end
end | 10 | 0.188679 | 5 | 5 |
92c812699859759006b3d342eaf15a0aac8c6460 | server/trello-microservice/src/api/v1/users/userController.js | server/trello-microservice/src/api/v1/users/userController.js | 'use strict';
import { userModel } from '../../../models/index';
const buildResponse = (statusCode, data, res) => {
if (statusCode === 200) {
return res.status(200).json({
data: {
user: {
_id: data._id,
fullname: data.fullname,
}
}
});
} else {
return res.status(statusCode).json({
data: data
});
}
}
export const getUser = (req, res) => {
const user = req.user;
if (!user) {
buildResponse(401, req.err, res);
} else {
buildResponse(200, user, res);
}
};
export const updateUser = (req, res) => {
const errorMessage = 'Sorry. I could not update that user';
const user = req.user;
user.name = req.body.name;
user.fullname = req.body.fullname;
user.initials = req.body.initials;
user.save()
.then(user => buildResponse(200, user, res))
.catch(error => buildResponse(404, errorMessage, res));
};
export const removeUser = (req, res) => {
const errorMessage = 'Sorry. I could not remove that user';
const user = req.user;
user.remove()
.then(user => buildResponse(200, user, res))
.catch(error => buildResponse(404, errorMessage, res));
}; | 'use strict';
import {
removeUserService,
saveUserService
} from '../../../utils/userService';
import { userModel } from '../../../models/index';
const buildResponse = (statusCode, data, res) => {
if (statusCode === 200) {
return res.status(200).json({
data: {
user: {
_id: data._id,
fullname: data.fullname,
}
}
});
} else {
return res.status(statusCode).json({
data: data
});
}
}
export const getUser = (req, res) => {
const user = req.user;
if (!user) {
buildResponse(401, req.err, res);
} else {
buildResponse(200, user, res);
}
};
export const updateUser = async (req, res) => {
const errorMessage = 'Sorry. I could not update that user';
const user = req.user;
user.name = req.body.name;
user.fullname = req.body.fullname;
user.initials = req.body.initials;
saveUserService(user, res);
};
export const removeUser = (req, res) => {
const errorMessage = 'Sorry. I could not remove that user';
const user = req.user;
removeUserService(user, res);
}; | Use the user service to persist or modify state | Use the user service to persist or modify state
| JavaScript | mit | Madmous/madClones,Madmous/Trello-Clone,Madmous/madClones,Madmous/madClones,Madmous/Trello-Clone,Madmous/Trello-Clone,Madmous/madClones | javascript | ## Code Before:
'use strict';
import { userModel } from '../../../models/index';
const buildResponse = (statusCode, data, res) => {
if (statusCode === 200) {
return res.status(200).json({
data: {
user: {
_id: data._id,
fullname: data.fullname,
}
}
});
} else {
return res.status(statusCode).json({
data: data
});
}
}
export const getUser = (req, res) => {
const user = req.user;
if (!user) {
buildResponse(401, req.err, res);
} else {
buildResponse(200, user, res);
}
};
export const updateUser = (req, res) => {
const errorMessage = 'Sorry. I could not update that user';
const user = req.user;
user.name = req.body.name;
user.fullname = req.body.fullname;
user.initials = req.body.initials;
user.save()
.then(user => buildResponse(200, user, res))
.catch(error => buildResponse(404, errorMessage, res));
};
export const removeUser = (req, res) => {
const errorMessage = 'Sorry. I could not remove that user';
const user = req.user;
user.remove()
.then(user => buildResponse(200, user, res))
.catch(error => buildResponse(404, errorMessage, res));
};
## Instruction:
Use the user service to persist or modify state
## Code After:
'use strict';
import {
removeUserService,
saveUserService
} from '../../../utils/userService';
import { userModel } from '../../../models/index';
const buildResponse = (statusCode, data, res) => {
if (statusCode === 200) {
return res.status(200).json({
data: {
user: {
_id: data._id,
fullname: data.fullname,
}
}
});
} else {
return res.status(statusCode).json({
data: data
});
}
}
export const getUser = (req, res) => {
const user = req.user;
if (!user) {
buildResponse(401, req.err, res);
} else {
buildResponse(200, user, res);
}
};
export const updateUser = async (req, res) => {
const errorMessage = 'Sorry. I could not update that user';
const user = req.user;
user.name = req.body.name;
user.fullname = req.body.fullname;
user.initials = req.body.initials;
saveUserService(user, res);
};
export const removeUser = (req, res) => {
const errorMessage = 'Sorry. I could not remove that user';
const user = req.user;
removeUserService(user, res);
}; | 'use strict';
+
+ import {
+ removeUserService,
+ saveUserService
+ } from '../../../utils/userService';
import { userModel } from '../../../models/index';
const buildResponse = (statusCode, data, res) => {
if (statusCode === 200) {
return res.status(200).json({
data: {
user: {
_id: data._id,
fullname: data.fullname,
}
}
});
} else {
return res.status(statusCode).json({
data: data
});
}
}
export const getUser = (req, res) => {
const user = req.user;
if (!user) {
buildResponse(401, req.err, res);
} else {
buildResponse(200, user, res);
}
};
- export const updateUser = (req, res) => {
+ export const updateUser = async (req, res) => {
? ++++++
const errorMessage = 'Sorry. I could not update that user';
const user = req.user;
user.name = req.body.name;
user.fullname = req.body.fullname;
user.initials = req.body.initials;
+ saveUserService(user, res);
- user.save()
- .then(user => buildResponse(200, user, res))
- .catch(error => buildResponse(404, errorMessage, res));
};
export const removeUser = (req, res) => {
const errorMessage = 'Sorry. I could not remove that user';
const user = req.user;
+ removeUserService(user, res);
- user.remove()
- .then(user => buildResponse(200, user, res))
- .catch(error => buildResponse(404, errorMessage, res));
}; | 15 | 0.288462 | 8 | 7 |
d46af8a66b07502862a3bba663975de2d4dd9278 | vim/mod/set.vim | vim/mod/set.vim | set shell=sh
set shortmess+=I
set runtimepath+=$GOROOT/misc/vim
set backup
set backupdir=~/.cache/vim
set undofile
set undodir=~/.cache/vim
set ai smartindent
set hlsearch
set ignorecase
set smartcase
set showmatch
let c_space_errors=1
if v:version >= 704
set cryptmethod=blowfish2
else
" unsecure, but Debian likes it
set cryptmethod=blowfish
endif
set exrc
set secure
set vb
set modeline
set noexpandtab
set shiftwidth=8
set tabstop=8
set t_Co=256
set wildmenu
set lazyredraw
set history=1000
set autoread
if exists('$DISPLAY')
let &t_SI .= "\<Esc>[5 q"
let &t_EI .= "\<Esc>[2 q"
endif
" Spelling support
set nospell spelllang=en_us,de
set spellfile=~/.vim/spell/spellfile.add
helptags ~/.vim/pack
syntax on
filetype plugin indent on
| set shell=sh
set shortmess+=I
set runtimepath+=$GOROOT/misc/vim
set backup
set backupdir=~/.cache/vim
set undofile
set undodir=~/.cache/vim
set ai smartindent
set hlsearch
set ignorecase
set smartcase
set showmatch
let c_space_errors=1
if v:version >= 704
set cryptmethod=blowfish2
else
" unsecure, but Debian likes it
set cryptmethod=blowfish
endif
set exrc
set secure
set vb
set modeline
set noexpandtab
set shiftwidth=8
set tabstop=8
set t_Co=256
set wildmenu
set lazyredraw
set history=1000
set autoread
if exists('$DISPLAY')
let &t_SI .= "\<Esc>[5 q"
let &t_EI .= "\<Esc>[2 q"
endif
" Spelling support
set nospell spelllang=en_us,de
set spellfile=~/.vim/spell/spellfile.add
for s:v in split(glob("~/.vim/pack/vim/start/*/doc"))
execute "helptags" s:v
endfor
syntax on
filetype plugin indent on
| Fix doc paths for plugins | Fix doc paths for plugins
| VimL | bsd-2-clause | nakal/shell-setup,nakal/shell-setup | viml | ## Code Before:
set shell=sh
set shortmess+=I
set runtimepath+=$GOROOT/misc/vim
set backup
set backupdir=~/.cache/vim
set undofile
set undodir=~/.cache/vim
set ai smartindent
set hlsearch
set ignorecase
set smartcase
set showmatch
let c_space_errors=1
if v:version >= 704
set cryptmethod=blowfish2
else
" unsecure, but Debian likes it
set cryptmethod=blowfish
endif
set exrc
set secure
set vb
set modeline
set noexpandtab
set shiftwidth=8
set tabstop=8
set t_Co=256
set wildmenu
set lazyredraw
set history=1000
set autoread
if exists('$DISPLAY')
let &t_SI .= "\<Esc>[5 q"
let &t_EI .= "\<Esc>[2 q"
endif
" Spelling support
set nospell spelllang=en_us,de
set spellfile=~/.vim/spell/spellfile.add
helptags ~/.vim/pack
syntax on
filetype plugin indent on
## Instruction:
Fix doc paths for plugins
## Code After:
set shell=sh
set shortmess+=I
set runtimepath+=$GOROOT/misc/vim
set backup
set backupdir=~/.cache/vim
set undofile
set undodir=~/.cache/vim
set ai smartindent
set hlsearch
set ignorecase
set smartcase
set showmatch
let c_space_errors=1
if v:version >= 704
set cryptmethod=blowfish2
else
" unsecure, but Debian likes it
set cryptmethod=blowfish
endif
set exrc
set secure
set vb
set modeline
set noexpandtab
set shiftwidth=8
set tabstop=8
set t_Co=256
set wildmenu
set lazyredraw
set history=1000
set autoread
if exists('$DISPLAY')
let &t_SI .= "\<Esc>[5 q"
let &t_EI .= "\<Esc>[2 q"
endif
" Spelling support
set nospell spelllang=en_us,de
set spellfile=~/.vim/spell/spellfile.add
for s:v in split(glob("~/.vim/pack/vim/start/*/doc"))
execute "helptags" s:v
endfor
syntax on
filetype plugin indent on
| set shell=sh
set shortmess+=I
set runtimepath+=$GOROOT/misc/vim
set backup
set backupdir=~/.cache/vim
set undofile
set undodir=~/.cache/vim
set ai smartindent
set hlsearch
set ignorecase
set smartcase
set showmatch
let c_space_errors=1
if v:version >= 704
set cryptmethod=blowfish2
else
" unsecure, but Debian likes it
set cryptmethod=blowfish
endif
set exrc
set secure
set vb
set modeline
set noexpandtab
set shiftwidth=8
set tabstop=8
set t_Co=256
set wildmenu
set lazyredraw
set history=1000
set autoread
if exists('$DISPLAY')
let &t_SI .= "\<Esc>[5 q"
let &t_EI .= "\<Esc>[2 q"
endif
" Spelling support
set nospell spelllang=en_us,de
set spellfile=~/.vim/spell/spellfile.add
- helptags ~/.vim/pack
+ for s:v in split(glob("~/.vim/pack/vim/start/*/doc"))
+ execute "helptags" s:v
+ endfor
syntax on
filetype plugin indent on | 4 | 0.081633 | 3 | 1 |
db5c916a2ee7f88a66bbab7d1dd54fe805114651 | README.md | README.md |
This project aims to be a set of libraries and tools to enable users to:
1. easily create web-based diagrams (static or interactive) for the purposes of
teaching, viewing, and discussing games;
2. easily write AI clients for games in their preferred language, without
spending time on the mechanics (networking, protocols, GUI, etc.)
and spending time on actual AI instead;
3. run a server to enable local or network-based head-to-head competition for
human-to-human, human-to-computer, or computer-to-computer agents;
4. easily create or experiment with new games or rule modifications for
already-existing and known games.
## Howto
See [HOWTO.md](HOWTO.md) for demos and how to get started with development and
testing.
## License
Apache 2.0; see [LICENSE.txt](LICENSE.txt) for details.
|
[![Build Status][travis-shield]][travis-link]
[travis-shield]: https://travis-ci.org/mbrukman/gamebuilder.svg?branch=master
[travis-link]: https://travis-ci.org/mbrukman/gamebuilder
This project aims to be a set of libraries and tools to enable users to:
1. easily create web-based diagrams (static or interactive) for the purposes of
teaching, viewing, and discussing games;
2. easily write AI clients for games in their preferred language, without
spending time on the mechanics (networking, protocols, GUI, etc.)
and spending time on actual AI instead;
3. run a server to enable local or network-based head-to-head competition for
human-to-human, human-to-computer, or computer-to-computer agents;
4. easily create or experiment with new games or rule modifications for
already-existing and known games.
## Howto
See [HOWTO.md](HOWTO.md) for demos and how to get started with development and
testing.
## License
Apache 2.0; see [LICENSE.txt](LICENSE.txt) for details.
| Add Travis CI badge now that we have a build. | Add Travis CI badge now that we have a build.
| Markdown | apache-2.0 | mbrukman/gamebuilder,mbrukman/gamebuilder,mbrukman/gamebuilder,mbrukman/gamebuilder | markdown | ## Code Before:
This project aims to be a set of libraries and tools to enable users to:
1. easily create web-based diagrams (static or interactive) for the purposes of
teaching, viewing, and discussing games;
2. easily write AI clients for games in their preferred language, without
spending time on the mechanics (networking, protocols, GUI, etc.)
and spending time on actual AI instead;
3. run a server to enable local or network-based head-to-head competition for
human-to-human, human-to-computer, or computer-to-computer agents;
4. easily create or experiment with new games or rule modifications for
already-existing and known games.
## Howto
See [HOWTO.md](HOWTO.md) for demos and how to get started with development and
testing.
## License
Apache 2.0; see [LICENSE.txt](LICENSE.txt) for details.
## Instruction:
Add Travis CI badge now that we have a build.
## Code After:
[![Build Status][travis-shield]][travis-link]
[travis-shield]: https://travis-ci.org/mbrukman/gamebuilder.svg?branch=master
[travis-link]: https://travis-ci.org/mbrukman/gamebuilder
This project aims to be a set of libraries and tools to enable users to:
1. easily create web-based diagrams (static or interactive) for the purposes of
teaching, viewing, and discussing games;
2. easily write AI clients for games in their preferred language, without
spending time on the mechanics (networking, protocols, GUI, etc.)
and spending time on actual AI instead;
3. run a server to enable local or network-based head-to-head competition for
human-to-human, human-to-computer, or computer-to-computer agents;
4. easily create or experiment with new games or rule modifications for
already-existing and known games.
## Howto
See [HOWTO.md](HOWTO.md) for demos and how to get started with development and
testing.
## License
Apache 2.0; see [LICENSE.txt](LICENSE.txt) for details.
| +
+ [![Build Status][travis-shield]][travis-link]
+
+ [travis-shield]: https://travis-ci.org/mbrukman/gamebuilder.svg?branch=master
+ [travis-link]: https://travis-ci.org/mbrukman/gamebuilder
This project aims to be a set of libraries and tools to enable users to:
1. easily create web-based diagrams (static or interactive) for the purposes of
teaching, viewing, and discussing games;
2. easily write AI clients for games in their preferred language, without
spending time on the mechanics (networking, protocols, GUI, etc.)
and spending time on actual AI instead;
3. run a server to enable local or network-based head-to-head competition for
human-to-human, human-to-computer, or computer-to-computer agents;
4. easily create or experiment with new games or rule modifications for
already-existing and known games.
## Howto
See [HOWTO.md](HOWTO.md) for demos and how to get started with development and
testing.
## License
Apache 2.0; see [LICENSE.txt](LICENSE.txt) for details. | 5 | 0.208333 | 5 | 0 |
b0fac61f1787ca6eb4988c5ca0141d3266398a57 | local.go | local.go | package main
import (
"github.com/phalaaxx/cdb"
)
/* VerifyLocal checks if named mailbox exist in a local cdb database */
func VerifyLocal(name string) bool {
var value *string
err := cdb.Lookup(
LocalCdb,
func(db *cdb.Reader) (err error) {
value, err = db.Get(name)
return err
},
)
if err == nil && value != nil && len(*value) != 0 {
return true
}
return false
}
| package main
import (
"github.com/phalaaxx/godb"
)
/* VerifyLocal checks if named mailbox exist in a local cdb database */
func VerifyLocal(name string) bool {
var value *string
err := godb.CdbLookup(
LocalCdb,
func(db *godb.CdbReader) (err error) {
value, err = db.Get(name)
return err
},
)
if err == nil && value != nil && len(*value) != 0 {
return true
}
return false
}
| Use godb library instead of cdb. | Use godb library instead of cdb.
| Go | bsd-2-clause | phalaaxx/ratemilter | go | ## Code Before:
package main
import (
"github.com/phalaaxx/cdb"
)
/* VerifyLocal checks if named mailbox exist in a local cdb database */
func VerifyLocal(name string) bool {
var value *string
err := cdb.Lookup(
LocalCdb,
func(db *cdb.Reader) (err error) {
value, err = db.Get(name)
return err
},
)
if err == nil && value != nil && len(*value) != 0 {
return true
}
return false
}
## Instruction:
Use godb library instead of cdb.
## Code After:
package main
import (
"github.com/phalaaxx/godb"
)
/* VerifyLocal checks if named mailbox exist in a local cdb database */
func VerifyLocal(name string) bool {
var value *string
err := godb.CdbLookup(
LocalCdb,
func(db *godb.CdbReader) (err error) {
value, err = db.Get(name)
return err
},
)
if err == nil && value != nil && len(*value) != 0 {
return true
}
return false
}
| package main
import (
- "github.com/phalaaxx/cdb"
? ^
+ "github.com/phalaaxx/godb"
? ^^
)
/* VerifyLocal checks if named mailbox exist in a local cdb database */
func VerifyLocal(name string) bool {
var value *string
- err := cdb.Lookup(
? ^
+ err := godb.CdbLookup(
? ^^ +++
LocalCdb,
- func(db *cdb.Reader) (err error) {
? ^
+ func(db *godb.CdbReader) (err error) {
? ^^ +++
value, err = db.Get(name)
return err
},
)
if err == nil && value != nil && len(*value) != 0 {
return true
}
return false
} | 6 | 0.285714 | 3 | 3 |
c13b2bf8e74dc52a380aefa98a33dd5f00640b93 | spec/acceptance/runtime/init.vim | spec/acceptance/runtime/init.vim | let s:lib_path = getcwd() . "/../../lib/"
let s:bin_path = getcwd() . "/../../bin/neovim-ruby-host"
let g:ruby_host_prog = printf("ruby -I %s %s", s:lib_path, s:bin_path)
set rtp=./runtime,./runtime/vader.vim,$VIMRUNTIME
ruby << EOS
require "rspec"
if ENV["REPORT_COVERAGE"]
require "coveralls"
Coveralls.wear_merged!
SimpleCov.merge_timeout 3600
SimpleCov.command_name "spec:acceptance:#{Process.pid}"
end
EOS
function! RunSuite() abort
ruby $output = ENV["RSPEC_OUTPUT_FILE"]
ruby $result = RSpec::Core::Runner.run([], $output, $output)
ruby Vim.command($result == 0 ? "qa!" : "cq!")
endfunction
| let s:lib_path = getcwd() . "/../../lib/"
let s:bin_path = getcwd() . "/../../bin/neovim-ruby-host"
let g:ruby_host_prog = printf("ruby -I %s %s", s:lib_path, s:bin_path)
set rtp=./runtime,./runtime/vader.vim,$VIMRUNTIME
ruby << EOS
require "rspec"
if ENV["REPORT_COVERAGE"]
require "coveralls"
Coveralls.wear_merged!
SimpleCov.merge_timeout 3600
SimpleCov.command_name "spec:acceptance:#{Process.pid}"
end
$:.unshift File.expand_path("../../../lib", __FILE__)
require "neovim"
EOS
function! RunSuite() abort
ruby $output = ENV["RSPEC_OUTPUT_FILE"]
ruby $result = RSpec::Core::Runner.run([], $output, $output)
ruby Vim.command($result == 0 ? "qa!" : "cq!")
endfunction
| Move neovim require after coveralls loading in acceptance specs | Move neovim require after coveralls loading in acceptance specs
| VimL | mit | alexgenco/neovim-ruby | viml | ## Code Before:
let s:lib_path = getcwd() . "/../../lib/"
let s:bin_path = getcwd() . "/../../bin/neovim-ruby-host"
let g:ruby_host_prog = printf("ruby -I %s %s", s:lib_path, s:bin_path)
set rtp=./runtime,./runtime/vader.vim,$VIMRUNTIME
ruby << EOS
require "rspec"
if ENV["REPORT_COVERAGE"]
require "coveralls"
Coveralls.wear_merged!
SimpleCov.merge_timeout 3600
SimpleCov.command_name "spec:acceptance:#{Process.pid}"
end
EOS
function! RunSuite() abort
ruby $output = ENV["RSPEC_OUTPUT_FILE"]
ruby $result = RSpec::Core::Runner.run([], $output, $output)
ruby Vim.command($result == 0 ? "qa!" : "cq!")
endfunction
## Instruction:
Move neovim require after coveralls loading in acceptance specs
## Code After:
let s:lib_path = getcwd() . "/../../lib/"
let s:bin_path = getcwd() . "/../../bin/neovim-ruby-host"
let g:ruby_host_prog = printf("ruby -I %s %s", s:lib_path, s:bin_path)
set rtp=./runtime,./runtime/vader.vim,$VIMRUNTIME
ruby << EOS
require "rspec"
if ENV["REPORT_COVERAGE"]
require "coveralls"
Coveralls.wear_merged!
SimpleCov.merge_timeout 3600
SimpleCov.command_name "spec:acceptance:#{Process.pid}"
end
$:.unshift File.expand_path("../../../lib", __FILE__)
require "neovim"
EOS
function! RunSuite() abort
ruby $output = ENV["RSPEC_OUTPUT_FILE"]
ruby $result = RSpec::Core::Runner.run([], $output, $output)
ruby Vim.command($result == 0 ? "qa!" : "cq!")
endfunction
| let s:lib_path = getcwd() . "/../../lib/"
let s:bin_path = getcwd() . "/../../bin/neovim-ruby-host"
let g:ruby_host_prog = printf("ruby -I %s %s", s:lib_path, s:bin_path)
set rtp=./runtime,./runtime/vader.vim,$VIMRUNTIME
ruby << EOS
require "rspec"
if ENV["REPORT_COVERAGE"]
require "coveralls"
Coveralls.wear_merged!
SimpleCov.merge_timeout 3600
SimpleCov.command_name "spec:acceptance:#{Process.pid}"
end
+
+ $:.unshift File.expand_path("../../../lib", __FILE__)
+ require "neovim"
EOS
function! RunSuite() abort
ruby $output = ENV["RSPEC_OUTPUT_FILE"]
ruby $result = RSpec::Core::Runner.run([], $output, $output)
ruby Vim.command($result == 0 ? "qa!" : "cq!")
endfunction | 3 | 0.136364 | 3 | 0 |
fc4301189de8abb271c315f9df822fb9c082c379 | aeolus/environments.json | aeolus/environments.json | {
"prod": {
"root": "http://analice.me"
, "version": "v2"
, "poolingStatusTime": 6000
},
"stage": {
"root": "http://analiceme.urdamales.com.ar"
, "version": "v2"
, "poolingStatusTime": 6000
},
"local": {
"root": "http://localhost:3000"
, "version": "v2"
, "poolingStatusTime": false
}
}
| {
"prod": {
"root": "http://analice.me"
, "version": "v2"
, "poolingStatusTime": 6000
},
"stage": {
"root": "http://analice.me"
, "version": "v2"
, "poolingStatusTime": 6000
},
"local": {
"root": "http://localhost:3000"
, "version": "v2"
, "poolingStatusTime": false
}
}
| Change URL on staging environment | [aeolus] Change URL on staging environment
| JSON | mit | analiceme/chaos | json | ## Code Before:
{
"prod": {
"root": "http://analice.me"
, "version": "v2"
, "poolingStatusTime": 6000
},
"stage": {
"root": "http://analiceme.urdamales.com.ar"
, "version": "v2"
, "poolingStatusTime": 6000
},
"local": {
"root": "http://localhost:3000"
, "version": "v2"
, "poolingStatusTime": false
}
}
## Instruction:
[aeolus] Change URL on staging environment
## Code After:
{
"prod": {
"root": "http://analice.me"
, "version": "v2"
, "poolingStatusTime": 6000
},
"stage": {
"root": "http://analice.me"
, "version": "v2"
, "poolingStatusTime": 6000
},
"local": {
"root": "http://localhost:3000"
, "version": "v2"
, "poolingStatusTime": false
}
}
| {
"prod": {
"root": "http://analice.me"
, "version": "v2"
, "poolingStatusTime": 6000
},
"stage": {
- "root": "http://analiceme.urdamales.com.ar"
? -----------------
+ "root": "http://analice.me"
? +
, "version": "v2"
, "poolingStatusTime": 6000
},
"local": {
"root": "http://localhost:3000"
, "version": "v2"
, "poolingStatusTime": false
}
} | 2 | 0.117647 | 1 | 1 |
d98e24fe12509adc51315b4a38bc2120090495ad | .travis.yml | .travis.yml | sudo: required
dist: trusty
language: php
php:
- 5.4
before_install:
- sudo apt-get -y install git zip php5-cli php5-curl
before_script:
- php -r "printf('PHP %s', phpversion());"
- composer self-update
- composer install --no-interaction
script: cd tests/suites/ && php all.php | sudo: false
dist: trusty
language: php
php:
- 5.4
- 7.0
- 7.1
before_script:
- php -r "printf('PHP %s', phpversion());"
- composer self-update
- composer install --no-interaction
script: cd tests/suites/ && php all.php
| Add PHP 7 and 7.1, test with sudo false | Add PHP 7 and 7.1, test with sudo false
| YAML | mit | Mangopay/mangopay2-php-sdk,Mangopay/mangopay2-php-sdk | yaml | ## Code Before:
sudo: required
dist: trusty
language: php
php:
- 5.4
before_install:
- sudo apt-get -y install git zip php5-cli php5-curl
before_script:
- php -r "printf('PHP %s', phpversion());"
- composer self-update
- composer install --no-interaction
script: cd tests/suites/ && php all.php
## Instruction:
Add PHP 7 and 7.1, test with sudo false
## Code After:
sudo: false
dist: trusty
language: php
php:
- 5.4
- 7.0
- 7.1
before_script:
- php -r "printf('PHP %s', phpversion());"
- composer self-update
- composer install --no-interaction
script: cd tests/suites/ && php all.php
| - sudo: required
+ sudo: false
dist: trusty
language: php
php:
- 5.4
+ - 7.0
+ - 7.1
-
- before_install:
- - sudo apt-get -y install git zip php5-cli php5-curl
before_script:
- php -r "printf('PHP %s', phpversion());"
- composer self-update
- composer install --no-interaction
script: cd tests/suites/ && php all.php | 7 | 0.388889 | 3 | 4 |
5178b4174a3d075822cbc31a5b975713c659a616 | README.md | README.md | go-resiliency
=============
[](https://travis-ci.org/eapache/go-resiliency)
[](https://godoc.org/github.com/eapache/go-resiliency)
Resiliency patterns for golang. Currently implemented are:
- circuit-breaker pattern (in the `breaker` directory)
- semaphore pattern (in the `semaphore` directory)
- deadline/timeout pattern (in the `deadline` directory)
- batching pattern (in the `batcher` directory)
- retriable pattern (in the `retrier` directory)
| go-resiliency
=============
[](https://travis-ci.org/eapache/go-resiliency)
[](https://godoc.org/github.com/eapache/go-resiliency)
Resiliency patterns for golang.
Based in part on [Hystrix](https://github.com/Netflix/Hystrix),
[Semian](https://github.com/Shopify/semian), and others.
Currently implemented are:
- circuit-breaker pattern (in the `breaker` directory)
- semaphore pattern (in the `semaphore` directory)
- deadline/timeout pattern (in the `deadline` directory)
- batching pattern (in the `batcher` directory)
- retriable pattern (in the `retrier` directory)
| Add 'based-on' to top-level readme | Add 'based-on' to top-level readme
| Markdown | mit | eapache/go-resiliency,winlinvip/go-resiliency,jgautheron/go-resiliency | markdown | ## Code Before:
go-resiliency
=============
[](https://travis-ci.org/eapache/go-resiliency)
[](https://godoc.org/github.com/eapache/go-resiliency)
Resiliency patterns for golang. Currently implemented are:
- circuit-breaker pattern (in the `breaker` directory)
- semaphore pattern (in the `semaphore` directory)
- deadline/timeout pattern (in the `deadline` directory)
- batching pattern (in the `batcher` directory)
- retriable pattern (in the `retrier` directory)
## Instruction:
Add 'based-on' to top-level readme
## Code After:
go-resiliency
=============
[](https://travis-ci.org/eapache/go-resiliency)
[](https://godoc.org/github.com/eapache/go-resiliency)
Resiliency patterns for golang.
Based in part on [Hystrix](https://github.com/Netflix/Hystrix),
[Semian](https://github.com/Shopify/semian), and others.
Currently implemented are:
- circuit-breaker pattern (in the `breaker` directory)
- semaphore pattern (in the `semaphore` directory)
- deadline/timeout pattern (in the `deadline` directory)
- batching pattern (in the `batcher` directory)
- retriable pattern (in the `retrier` directory)
| go-resiliency
=============
[](https://travis-ci.org/eapache/go-resiliency)
[](https://godoc.org/github.com/eapache/go-resiliency)
- Resiliency patterns for golang. Currently implemented are:
+ Resiliency patterns for golang.
+ Based in part on [Hystrix](https://github.com/Netflix/Hystrix),
+ [Semian](https://github.com/Shopify/semian), and others.
+ Currently implemented are:
- circuit-breaker pattern (in the `breaker` directory)
- semaphore pattern (in the `semaphore` directory)
- deadline/timeout pattern (in the `deadline` directory)
- batching pattern (in the `batcher` directory)
- retriable pattern (in the `retrier` directory) | 5 | 0.416667 | 4 | 1 |
6dfc73b08635f5f797b39f06d7dca8d48f2eea27 | spec/support/shared_examples.rb | spec/support/shared_examples.rb | shared_context "constant numbers" do
let(:one){ Constant.new(1) }
let(:two){ Constant.new(2) }
let(:three){ Constant.new(3) }
let(:four){ Constant.new(4) }
let(:five){ Constant.new(5) }
end
shared_examples_for "correct string output" do |output|
it "shows a correct string representation of #{output}" do
expect(subject.to_s).to eq output
end
end
shared_examples_for "a correct calculator" do |result|
it "returns the correct result" do
expect(subject.result).to eq result
end
end
| shared_context "constant numbers" do
let(:one){ Constant.new(1) }
let(:two){ Constant.new(2) }
let(:three){ Constant.new(3) }
let(:four){ Constant.new(4) }
let(:five){ Constant.new(5) }
end
shared_examples_for "correct string output" do |output|
it "shows a correct string representation of #{output}" do
expect(subject.to_s).to eq output
end
end
shared_examples_for "a correct calculator" do |result|
it "returns the correct result" do
expect(subject.result).to be_within(0.01).of result
end
end
| Change precise equality in shared example to be_within matcher | Change precise equality in shared example to be_within matcher
| Ruby | mit | mvonmaltitz/mathgame | ruby | ## Code Before:
shared_context "constant numbers" do
let(:one){ Constant.new(1) }
let(:two){ Constant.new(2) }
let(:three){ Constant.new(3) }
let(:four){ Constant.new(4) }
let(:five){ Constant.new(5) }
end
shared_examples_for "correct string output" do |output|
it "shows a correct string representation of #{output}" do
expect(subject.to_s).to eq output
end
end
shared_examples_for "a correct calculator" do |result|
it "returns the correct result" do
expect(subject.result).to eq result
end
end
## Instruction:
Change precise equality in shared example to be_within matcher
## Code After:
shared_context "constant numbers" do
let(:one){ Constant.new(1) }
let(:two){ Constant.new(2) }
let(:three){ Constant.new(3) }
let(:four){ Constant.new(4) }
let(:five){ Constant.new(5) }
end
shared_examples_for "correct string output" do |output|
it "shows a correct string representation of #{output}" do
expect(subject.to_s).to eq output
end
end
shared_examples_for "a correct calculator" do |result|
it "returns the correct result" do
expect(subject.result).to be_within(0.01).of result
end
end
| shared_context "constant numbers" do
let(:one){ Constant.new(1) }
let(:two){ Constant.new(2) }
let(:three){ Constant.new(3) }
let(:four){ Constant.new(4) }
let(:five){ Constant.new(5) }
end
shared_examples_for "correct string output" do |output|
it "shows a correct string representation of #{output}" do
expect(subject.to_s).to eq output
end
end
shared_examples_for "a correct calculator" do |result|
it "returns the correct result" do
- expect(subject.result).to eq result
? ^
+ expect(subject.result).to be_within(0.01).of result
? + ^^^^^^^^^^^^^^^^
end
end | 2 | 0.111111 | 1 | 1 |
5f656614f2648b4ca5fa43f7b52c4babba3b8f68 | GHC/Integer/Type.hs | GHC/Integer/Type.hs |
{-# LANGUAGE NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Integer.Type
-- Copyright : (c) Ian Lynagh 2007-2008
-- License : BSD3
--
-- Maintainer : igloo@earth.li
-- Stability : internal
-- Portability : non-portable (GHC Extensions)
--
-- An simple definition of the 'Integer' type.
--
-----------------------------------------------------------------------------
#include "MachDeps.h"
module GHC.Integer.Type (
Integer(..),
Positive, Positives,
Digits(..), Digit,
List(..)
) where
import GHC.Prim
#if !defined(__HADDOCK__)
data Integer = Positive !Positive | Negative !Positive | Naught
-------------------------------------------------------------------
-- The hard work is done on positive numbers
-- Least significant bit is first
-- Positive's have the property that they contain at least one Bit,
-- and their last Bit is One.
type Positive = Digits
type Positives = List Positive
data Digits = Some !Digit !Digits
| None
type Digit = Word#
-- XXX Could move [] above us
data List a = Nil | Cons a (List a)
#endif
|
{-# LANGUAGE NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Integer.Type
-- Copyright : (c) Ian Lynagh 2007-2008
-- License : BSD3
--
-- Maintainer : igloo@earth.li
-- Stability : internal
-- Portability : non-portable (GHC Extensions)
--
-- An simple definition of the 'Integer' type.
--
-----------------------------------------------------------------------------
#include "MachDeps.h"
module GHC.Integer.Type (
Integer(..),
Positive, Positives,
Digits(..), Digit,
List(..)
) where
import GHC.Prim
import GHC.Types ()
#if !defined(__HADDOCK__)
data Integer = Positive !Positive | Negative !Positive | Naught
-------------------------------------------------------------------
-- The hard work is done on positive numbers
-- Least significant bit is first
-- Positive's have the property that they contain at least one Bit,
-- and their last Bit is One.
type Positive = Digits
type Positives = List Positive
data Digits = Some !Digit !Digits
| None
type Digit = Word#
-- XXX Could move [] above us
data List a = Nil | Cons a (List a)
#endif
| Add an import so the deps get sorted out correctly | Add an import so the deps get sorted out correctly | Haskell | bsd-3-clause | haskell-suite/integer-simple | haskell | ## Code Before:
{-# LANGUAGE NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Integer.Type
-- Copyright : (c) Ian Lynagh 2007-2008
-- License : BSD3
--
-- Maintainer : igloo@earth.li
-- Stability : internal
-- Portability : non-portable (GHC Extensions)
--
-- An simple definition of the 'Integer' type.
--
-----------------------------------------------------------------------------
#include "MachDeps.h"
module GHC.Integer.Type (
Integer(..),
Positive, Positives,
Digits(..), Digit,
List(..)
) where
import GHC.Prim
#if !defined(__HADDOCK__)
data Integer = Positive !Positive | Negative !Positive | Naught
-------------------------------------------------------------------
-- The hard work is done on positive numbers
-- Least significant bit is first
-- Positive's have the property that they contain at least one Bit,
-- and their last Bit is One.
type Positive = Digits
type Positives = List Positive
data Digits = Some !Digit !Digits
| None
type Digit = Word#
-- XXX Could move [] above us
data List a = Nil | Cons a (List a)
#endif
## Instruction:
Add an import so the deps get sorted out correctly
## Code After:
{-# LANGUAGE NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Integer.Type
-- Copyright : (c) Ian Lynagh 2007-2008
-- License : BSD3
--
-- Maintainer : igloo@earth.li
-- Stability : internal
-- Portability : non-portable (GHC Extensions)
--
-- An simple definition of the 'Integer' type.
--
-----------------------------------------------------------------------------
#include "MachDeps.h"
module GHC.Integer.Type (
Integer(..),
Positive, Positives,
Digits(..), Digit,
List(..)
) where
import GHC.Prim
import GHC.Types ()
#if !defined(__HADDOCK__)
data Integer = Positive !Positive | Negative !Positive | Naught
-------------------------------------------------------------------
-- The hard work is done on positive numbers
-- Least significant bit is first
-- Positive's have the property that they contain at least one Bit,
-- and their last Bit is One.
type Positive = Digits
type Positives = List Positive
data Digits = Some !Digit !Digits
| None
type Digit = Word#
-- XXX Could move [] above us
data List a = Nil | Cons a (List a)
#endif
|
{-# LANGUAGE NoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Integer.Type
-- Copyright : (c) Ian Lynagh 2007-2008
-- License : BSD3
--
-- Maintainer : igloo@earth.li
-- Stability : internal
-- Portability : non-portable (GHC Extensions)
--
-- An simple definition of the 'Integer' type.
--
-----------------------------------------------------------------------------
#include "MachDeps.h"
module GHC.Integer.Type (
Integer(..),
Positive, Positives,
Digits(..), Digit,
List(..)
) where
import GHC.Prim
+ import GHC.Types ()
#if !defined(__HADDOCK__)
data Integer = Positive !Positive | Negative !Positive | Naught
-------------------------------------------------------------------
-- The hard work is done on positive numbers
-- Least significant bit is first
-- Positive's have the property that they contain at least one Bit,
-- and their last Bit is One.
type Positive = Digits
type Positives = List Positive
data Digits = Some !Digit !Digits
| None
type Digit = Word#
-- XXX Could move [] above us
data List a = Nil | Cons a (List a)
#endif
| 1 | 0.019608 | 1 | 0 |
fe5d09924f6035dddbb3040ec25f4c2c02a4644f | IceFishing/Profile/FollowTableViewCell.swift | IceFishing/Profile/FollowTableViewCell.swift | //
// FollowTableViewCell.swift
// IceFishing
//
// Created by Manuela Rios on 4/19/15.
// Copyright (c) 2015 Lucas Derraugh. All rights reserved.
//
import UIKit
class FollowTableViewCell: UITableViewCell {
@IBOutlet weak var userImage: UIImageView!
@IBOutlet weak var userName: UILabel!
@IBOutlet weak var userHandle: UILabel!
@IBOutlet weak var numFollowLabel: UILabel!
@IBOutlet weak var separator: UIView!
override func didMoveToSuperview() {
selectionStyle = .None
backgroundColor = UIColor.iceDarkGray
separator.backgroundColor = UIColor.iceLightGray
userImage.layer.cornerRadius = userImage.bounds.size.width/2
userImage.clipsToBounds = true
}
@IBAction func userImageClicked(sender: UIButton) {
}
// Custom selected cell view
override func setSelected(selected: Bool, animated: Bool) {
contentView.backgroundColor = selected ? UIColor.iceLightGray : UIColor.clearColor()
}
}
| //
// FollowTableViewCell.swift
// IceFishing
//
// Created by Manuela Rios on 4/19/15.
// Copyright (c) 2015 Lucas Derraugh. All rights reserved.
//
import UIKit
protocol FollowUserDelegate {
func didTapFollowButton(cell: FollowTableViewCell)
}
class FollowTableViewCell: UITableViewCell {
@IBOutlet weak var userImage: UIImageView!
@IBOutlet weak var userName: UILabel!
@IBOutlet weak var userHandle: UILabel!
@IBOutlet weak var numFollowLabel: UILabel!
@IBOutlet weak var separator: UIView!
@IBOutlet weak var followButton: UIButton!
var delegate: FollowUserDelegate?
override func didMoveToSuperview() {
selectionStyle = .None
backgroundColor = UIColor.iceDarkGray
separator.backgroundColor = UIColor.iceLightGray
userImage.layer.cornerRadius = userImage.bounds.size.width/2
userImage.clipsToBounds = true
}
@IBAction func userImageClicked(sender: UIButton) {
}
// Custom selected cell view
override func setSelected(selected: Bool, animated: Bool) {
contentView.backgroundColor = selected ? UIColor.iceLightGray : UIColor.clearColor()
}
@IBAction func didTapFollowButton(sender: AnyObject) {
delegate?.didTapFollowButton(self)
}
}
| Add follow user protocol for user cells | Add follow user protocol for user cells
| Swift | mit | cuappdev/tempo,cuappdev/tempo | swift | ## Code Before:
//
// FollowTableViewCell.swift
// IceFishing
//
// Created by Manuela Rios on 4/19/15.
// Copyright (c) 2015 Lucas Derraugh. All rights reserved.
//
import UIKit
class FollowTableViewCell: UITableViewCell {
@IBOutlet weak var userImage: UIImageView!
@IBOutlet weak var userName: UILabel!
@IBOutlet weak var userHandle: UILabel!
@IBOutlet weak var numFollowLabel: UILabel!
@IBOutlet weak var separator: UIView!
override func didMoveToSuperview() {
selectionStyle = .None
backgroundColor = UIColor.iceDarkGray
separator.backgroundColor = UIColor.iceLightGray
userImage.layer.cornerRadius = userImage.bounds.size.width/2
userImage.clipsToBounds = true
}
@IBAction func userImageClicked(sender: UIButton) {
}
// Custom selected cell view
override func setSelected(selected: Bool, animated: Bool) {
contentView.backgroundColor = selected ? UIColor.iceLightGray : UIColor.clearColor()
}
}
## Instruction:
Add follow user protocol for user cells
## Code After:
//
// FollowTableViewCell.swift
// IceFishing
//
// Created by Manuela Rios on 4/19/15.
// Copyright (c) 2015 Lucas Derraugh. All rights reserved.
//
import UIKit
protocol FollowUserDelegate {
func didTapFollowButton(cell: FollowTableViewCell)
}
class FollowTableViewCell: UITableViewCell {
@IBOutlet weak var userImage: UIImageView!
@IBOutlet weak var userName: UILabel!
@IBOutlet weak var userHandle: UILabel!
@IBOutlet weak var numFollowLabel: UILabel!
@IBOutlet weak var separator: UIView!
@IBOutlet weak var followButton: UIButton!
var delegate: FollowUserDelegate?
override func didMoveToSuperview() {
selectionStyle = .None
backgroundColor = UIColor.iceDarkGray
separator.backgroundColor = UIColor.iceLightGray
userImage.layer.cornerRadius = userImage.bounds.size.width/2
userImage.clipsToBounds = true
}
@IBAction func userImageClicked(sender: UIButton) {
}
// Custom selected cell view
override func setSelected(selected: Bool, animated: Bool) {
contentView.backgroundColor = selected ? UIColor.iceLightGray : UIColor.clearColor()
}
@IBAction func didTapFollowButton(sender: AnyObject) {
delegate?.didTapFollowButton(self)
}
}
| //
// FollowTableViewCell.swift
// IceFishing
//
// Created by Manuela Rios on 4/19/15.
// Copyright (c) 2015 Lucas Derraugh. All rights reserved.
//
import UIKit
+ protocol FollowUserDelegate {
+ func didTapFollowButton(cell: FollowTableViewCell)
+ }
+
class FollowTableViewCell: UITableViewCell {
@IBOutlet weak var userImage: UIImageView!
@IBOutlet weak var userName: UILabel!
@IBOutlet weak var userHandle: UILabel!
@IBOutlet weak var numFollowLabel: UILabel!
@IBOutlet weak var separator: UIView!
+ @IBOutlet weak var followButton: UIButton!
+
+ var delegate: FollowUserDelegate?
override func didMoveToSuperview() {
selectionStyle = .None
backgroundColor = UIColor.iceDarkGray
separator.backgroundColor = UIColor.iceLightGray
userImage.layer.cornerRadius = userImage.bounds.size.width/2
userImage.clipsToBounds = true
}
@IBAction func userImageClicked(sender: UIButton) {
}
// Custom selected cell view
override func setSelected(selected: Bool, animated: Bool) {
contentView.backgroundColor = selected ? UIColor.iceLightGray : UIColor.clearColor()
}
+
+ @IBAction func didTapFollowButton(sender: AnyObject) {
+ delegate?.didTapFollowButton(self)
+ }
}
| 11 | 0.282051 | 11 | 0 |
64f79483566fcd127a1bb649263d9222b03d98de | src/Formats/JekyllFormatService.kt | src/Formats/JekyllFormatService.kt | package org.jetbrains.dokka
public class JekyllFormatService(locationService: LocationService, signatureGenerator: SignatureGenerator)
: MarkdownFormatService(locationService, signatureGenerator) {
override fun format(nodes: Iterable<DocumentationNode>, to: StringBuilder) {
to.appendln("---")
to.appendln("layout: post")
to.appendln("title: ${nodes.first().name}")
to.appendln("---")
super<MarkdownFormatService>.format(nodes, to)
}
} | package org.jetbrains.dokka
public class JekyllFormatService(locationService: LocationService, signatureGenerator: SignatureGenerator)
: MarkdownFormatService(locationService, signatureGenerator) {
override val extension: String = "html"
override fun format(nodes: Iterable<DocumentationNode>, to: StringBuilder) {
to.appendln("---")
to.appendln("layout: post")
to.appendln("title: ${nodes.first().name}")
to.appendln("---")
super<MarkdownFormatService>.format(nodes, to)
}
} | Use html extension for jekyll so that links work | Use html extension for jekyll so that links work
| Kotlin | apache-2.0 | Kotlin/dokka,Kotlin/dokka,Kotlin/dokka,google/dokka,Kotlin/dokka,google/dokka,Kotlin/dokka,Kotlin/dokka | kotlin | ## Code Before:
package org.jetbrains.dokka
public class JekyllFormatService(locationService: LocationService, signatureGenerator: SignatureGenerator)
: MarkdownFormatService(locationService, signatureGenerator) {
override fun format(nodes: Iterable<DocumentationNode>, to: StringBuilder) {
to.appendln("---")
to.appendln("layout: post")
to.appendln("title: ${nodes.first().name}")
to.appendln("---")
super<MarkdownFormatService>.format(nodes, to)
}
}
## Instruction:
Use html extension for jekyll so that links work
## Code After:
package org.jetbrains.dokka
public class JekyllFormatService(locationService: LocationService, signatureGenerator: SignatureGenerator)
: MarkdownFormatService(locationService, signatureGenerator) {
override val extension: String = "html"
override fun format(nodes: Iterable<DocumentationNode>, to: StringBuilder) {
to.appendln("---")
to.appendln("layout: post")
to.appendln("title: ${nodes.first().name}")
to.appendln("---")
super<MarkdownFormatService>.format(nodes, to)
}
} | package org.jetbrains.dokka
public class JekyllFormatService(locationService: LocationService, signatureGenerator: SignatureGenerator)
: MarkdownFormatService(locationService, signatureGenerator) {
-
+ override val extension: String = "html"
override fun format(nodes: Iterable<DocumentationNode>, to: StringBuilder) {
to.appendln("---")
to.appendln("layout: post")
to.appendln("title: ${nodes.first().name}")
to.appendln("---")
super<MarkdownFormatService>.format(nodes, to)
}
} | 2 | 0.153846 | 1 | 1 |
28854e4980070229ab34f08575ea5031ff9da643 | plugins/solr/views/search/search_page.html.erb | plugins/solr/views/search/search_page.html.erb | <% extend SolrPlugin::SearchHelper %>
<% set_facets_variables %>
<%= search_page_title( @titles[@asset], @category ) %>
<% if !@empty_query %>
<div id='search-column-left'>
<%= render :partial => 'facets' %>
</div>
<div id='search-column-right'>
<%= render :partial => 'results' %>
</div>
<% else %>
<%= render :partial => 'results' %>
<% end %>
<div style="clear: both"></div>
<% if @asset == :products %>
<% javascript_tag do %>
jQuery('.search-product-price-details').altBeautify();
<% end %>
<% end %>
| <% extend SolrPlugin::SearchHelper %>
<% set_facets_variables %>
<%= search_page_title( @titles[@asset], @category ) %>
<div id='search-column-left'>
<%= render :partial => 'facets' if !@empty_query %>
</div>
<div id='search-column-right'>
<%= render :partial => 'results' %>
</div>
<div style="clear: both"></div>
<% if @asset == :products %>
<% javascript_tag do %>
jQuery('.search-product-price-details').altBeautify();
<% end %>
<% end %>
| Use same column structure for all pages | Use same column structure for all pages
| HTML+ERB | agpl-3.0 | macartur/noosfero,marcosronaldo/noosfero,AlessandroCaetano/noosfero,alexandreab/noosfero,hackathon-oscs/cartografias,tallysmartins/noosfero,macartur/noosfero,coletivoEITA/noosfero,blogoosfero/noosfero,evandrojr/noosfero,hackathon-oscs/cartografias,marcosronaldo/noosfero,vfcosta/noosfero,hackathon-oscs/rede-osc,evandrojr/noosferogov,danielafeitosa/noosfero,hebertdougl/noosfero,abner/noosfero,cesarfex/noosfero,EcoAlternative/noosfero-ecosol,uniteddiversity/noosfero,abner/noosfero,hackathon-oscs/rede-osc,LuisBelo/tccnoosfero,hackathon-oscs/rede-osc,uniteddiversity/noosfero,larissa/noosfero,blogoosfero/noosfero,LuisBelo/tccnoosfero,cesarfex/noosfero,cesarfex/noosfero,AlessandroCaetano/noosfero,hackathon-oscs/cartografias,samasti/noosfero,hackathon-oscs/rede-osc,CIRANDAS/noosfero-ecosol,samasti/noosfero,evandrojr/noosferogov,tallysmartins/noosfero,hackathon-oscs/rede-osc,evandrojr/noosferogov,larissa/noosfero,hebertdougl/noosfero,alexandreab/noosfero,AlessandroCaetano/noosfero,LuisBelo/tccnoosfero,CIRANDAS/noosfero-ecosol,evandrojr/noosfero,larissa/noosfero,vfcosta/noosfero,coletivoEITA/noosfero,marcosronaldo/noosfero,evandrojr/noosferogov,cesarfex/noosfero,abner/noosfero,AlessandroCaetano/noosfero,coletivoEITA/noosfero-ecosol,hebertdougl/noosfero,coletivoEITA/noosfero,evandrojr/noosfero,evandrojr/noosfero,tallysmartins/noosfero,abner/noosfero,arthurmde/noosfero,coletivoEITA/noosfero,hackathon-oscs/cartografias,cesarfex/noosfero,coletivoEITA/noosfero-ecosol,macartur/noosfero,hebertdougl/noosfero,EcoAlternative/noosfero-ecosol,evandrojr/noosferogov,evandrojr/noosfero,EcoAlternative/noosfero-ecosol,vfcosta/noosfero,abner/noosfero,hackathon-oscs/cartografias,marcosronaldo/noosfero,alexandreab/noosfero,macartur/noosfero,EcoAlternative/noosfero-ecosol,arthurmde/noosfero,abner/noosfero,EcoAlternative/noosfero-ecosol,larissa/noosfero,hebertdougl/noosfero,vfcosta/noosfero,abner/noosfero,LuisBelo/tccnoosfero,arthurmde/noosfero,macartur/noosfero,larissa/noosfero,AlessandroCaetano/noosfero,danielafeitosa/noosfero,coletivoEITA/noosfero-ecosol,cesarfex/noosfero,danielafeitosa/noosfero,blogoosfero/noosfero,tallysmartins/noosfero,coletivoEITA/noosfero,uniteddiversity/noosfero,evandrojr/noosferogov,danielafeitosa/noosfero,CIRANDAS/noosfero-ecosol,uniteddiversity/noosfero,alexandreab/noosfero,samasti/noosfero,CIRANDAS/noosfero-ecosol,evandrojr/noosfero,AlessandroCaetano/noosfero,blogoosfero/noosfero,hebertdougl/noosfero,vfcosta/noosfero,tallysmartins/noosfero,macartur/noosfero,EcoAlternative/noosfero-ecosol,CIRANDAS/noosfero-ecosol,samasti/noosfero,blogoosfero/noosfero,LuisBelo/tccnoosfero,macartur/noosfero,EcoAlternative/noosfero-ecosol,coletivoEITA/noosfero-ecosol,marcosronaldo/noosfero,uniteddiversity/noosfero,tallysmartins/noosfero,hebertdougl/noosfero,hackathon-oscs/rede-osc,tallysmartins/noosfero,hackathon-oscs/cartografias,arthurmde/noosfero,arthurmde/noosfero,samasti/noosfero,larissa/noosfero,arthurmde/noosfero,coletivoEITA/noosfero,coletivoEITA/noosfero-ecosol,hackathon-oscs/cartografias,coletivoEITA/noosfero-ecosol,larissa/noosfero,arthurmde/noosfero,uniteddiversity/noosfero,blogoosfero/noosfero,uniteddiversity/noosfero,LuisBelo/tccnoosfero,AlessandroCaetano/noosfero,evandrojr/noosferogov,evandrojr/noosfero,alexandreab/noosfero,marcosronaldo/noosfero,alexandreab/noosfero,blogoosfero/noosfero,vfcosta/noosfero,samasti/noosfero,danielafeitosa/noosfero,marcosronaldo/noosfero,hackathon-oscs/rede-osc,cesarfex/noosfero,danielafeitosa/noosfero,alexandreab/noosfero,coletivoEITA/noosfero | html+erb | ## Code Before:
<% extend SolrPlugin::SearchHelper %>
<% set_facets_variables %>
<%= search_page_title( @titles[@asset], @category ) %>
<% if !@empty_query %>
<div id='search-column-left'>
<%= render :partial => 'facets' %>
</div>
<div id='search-column-right'>
<%= render :partial => 'results' %>
</div>
<% else %>
<%= render :partial => 'results' %>
<% end %>
<div style="clear: both"></div>
<% if @asset == :products %>
<% javascript_tag do %>
jQuery('.search-product-price-details').altBeautify();
<% end %>
<% end %>
## Instruction:
Use same column structure for all pages
## Code After:
<% extend SolrPlugin::SearchHelper %>
<% set_facets_variables %>
<%= search_page_title( @titles[@asset], @category ) %>
<div id='search-column-left'>
<%= render :partial => 'facets' if !@empty_query %>
</div>
<div id='search-column-right'>
<%= render :partial => 'results' %>
</div>
<div style="clear: both"></div>
<% if @asset == :products %>
<% javascript_tag do %>
jQuery('.search-product-price-details').altBeautify();
<% end %>
<% end %>
| <% extend SolrPlugin::SearchHelper %>
<% set_facets_variables %>
<%= search_page_title( @titles[@asset], @category ) %>
- <% if !@empty_query %>
- <div id='search-column-left'>
? --
+ <div id='search-column-left'>
- <%= render :partial => 'facets' %>
? --
+ <%= render :partial => 'facets' if !@empty_query %>
? +++++++++++++++++
- </div>
? --
+ </div>
- <div id='search-column-right'>
? --
+ <div id='search-column-right'>
- <%= render :partial => 'results' %>
- </div>
- <% else %>
<%= render :partial => 'results' %>
- <% end %>
+ </div>
<div style="clear: both"></div>
<% if @asset == :products %>
<% javascript_tag do %>
jQuery('.search-product-price-details').altBeautify();
<% end %>
<% end %> | 14 | 0.583333 | 5 | 9 |
38427b2e81d1b1ffd2a05c88aa21bbb9605becc4 | src/app.js | src/app.js | const path = require('path');
const favicon = require('serve-favicon');
const compress = require('compression');
const cors = require('cors');
const helmet = require('helmet');
const bodyParser = require('body-parser');
const feathers = require('feathers');
const configuration = require('feathers-configuration');
const hooks = require('feathers-hooks');
const rest = require('feathers-rest');
const middleware = require('./middleware');
const services = require('./services');
const appHooks = require('./app.hooks');
const mongodb = require('./mongodb');
const app = feathers();
// Load app configuration
app.configure(configuration(path.join(__dirname, '..')));
// Enable CORS, security, compression, favicon and body parsing
app.use(cors());
app.use(helmet());
app.use(compress());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', feathers.static(app.get('public')));
// Set up Plugins and providers
app.configure(hooks());
app.configure(mongodb);
app.configure(rest());
// Set up our services (see `services/index.js`)
app.configure(services);
// Configure middleware (see `middleware/index.js`) - always has to be last
app.configure(middleware);
app.hooks(appHooks);
module.exports = app;
| const path = require('path');
const favicon = require('serve-favicon');
const compress = require('compression');
const cors = require('cors');
const helmet = require('helmet');
const bodyParser = require('body-parser');
const feathers = require('feathers');
const configuration = require('feathers-configuration');
const hooks = require('feathers-hooks');
const rest = require('feathers-rest');
const socketio = require('feathers-socketio');
const middleware = require('./middleware');
const services = require('./services');
const appHooks = require('./app.hooks');
const mongodb = require('./mongodb');
const app = feathers();
// Load app configuration
app.configure(configuration(path.join(__dirname, '..')));
// Enable CORS, security, compression, favicon and body parsing
app.use(cors());
app.use(helmet());
app.use(compress());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', feathers.static(app.get('public')));
// Set up Plugins and providers
app.configure(hooks());
app.configure(mongodb);
app.configure(rest());
app.configure(socketio());
// Set up our services (see `services/index.js`)
app.configure(services);
// Configure middleware (see `middleware/index.js`) - always has to be last
app.configure(middleware);
app.hooks(appHooks);
module.exports = app;
| Add socket.io to handle client real-time requests | Add socket.io to handle client real-time requests
| JavaScript | mit | andreafalzetti/watch-gate,andreafalzetti/watch-gate | javascript | ## Code Before:
const path = require('path');
const favicon = require('serve-favicon');
const compress = require('compression');
const cors = require('cors');
const helmet = require('helmet');
const bodyParser = require('body-parser');
const feathers = require('feathers');
const configuration = require('feathers-configuration');
const hooks = require('feathers-hooks');
const rest = require('feathers-rest');
const middleware = require('./middleware');
const services = require('./services');
const appHooks = require('./app.hooks');
const mongodb = require('./mongodb');
const app = feathers();
// Load app configuration
app.configure(configuration(path.join(__dirname, '..')));
// Enable CORS, security, compression, favicon and body parsing
app.use(cors());
app.use(helmet());
app.use(compress());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', feathers.static(app.get('public')));
// Set up Plugins and providers
app.configure(hooks());
app.configure(mongodb);
app.configure(rest());
// Set up our services (see `services/index.js`)
app.configure(services);
// Configure middleware (see `middleware/index.js`) - always has to be last
app.configure(middleware);
app.hooks(appHooks);
module.exports = app;
## Instruction:
Add socket.io to handle client real-time requests
## Code After:
const path = require('path');
const favicon = require('serve-favicon');
const compress = require('compression');
const cors = require('cors');
const helmet = require('helmet');
const bodyParser = require('body-parser');
const feathers = require('feathers');
const configuration = require('feathers-configuration');
const hooks = require('feathers-hooks');
const rest = require('feathers-rest');
const socketio = require('feathers-socketio');
const middleware = require('./middleware');
const services = require('./services');
const appHooks = require('./app.hooks');
const mongodb = require('./mongodb');
const app = feathers();
// Load app configuration
app.configure(configuration(path.join(__dirname, '..')));
// Enable CORS, security, compression, favicon and body parsing
app.use(cors());
app.use(helmet());
app.use(compress());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', feathers.static(app.get('public')));
// Set up Plugins and providers
app.configure(hooks());
app.configure(mongodb);
app.configure(rest());
app.configure(socketio());
// Set up our services (see `services/index.js`)
app.configure(services);
// Configure middleware (see `middleware/index.js`) - always has to be last
app.configure(middleware);
app.hooks(appHooks);
module.exports = app;
| const path = require('path');
const favicon = require('serve-favicon');
const compress = require('compression');
const cors = require('cors');
const helmet = require('helmet');
const bodyParser = require('body-parser');
const feathers = require('feathers');
const configuration = require('feathers-configuration');
const hooks = require('feathers-hooks');
const rest = require('feathers-rest');
-
+ const socketio = require('feathers-socketio');
const middleware = require('./middleware');
const services = require('./services');
const appHooks = require('./app.hooks');
const mongodb = require('./mongodb');
const app = feathers();
// Load app configuration
app.configure(configuration(path.join(__dirname, '..')));
// Enable CORS, security, compression, favicon and body parsing
app.use(cors());
app.use(helmet());
app.use(compress());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', feathers.static(app.get('public')));
// Set up Plugins and providers
app.configure(hooks());
app.configure(mongodb);
app.configure(rest());
-
+ app.configure(socketio());
// Set up our services (see `services/index.js`)
app.configure(services);
// Configure middleware (see `middleware/index.js`) - always has to be last
app.configure(middleware);
app.hooks(appHooks);
module.exports = app; | 4 | 0.086957 | 2 | 2 |
0567bdd91844b3ad88706645a56c484b3fea58f1 | git/exception/GitException.sh | git/exception/GitException.sh | include logger.Logger
GitException(){
curBranchException(){
Logger logErrorMsg "cannot_${1}_${2}_because_${2}_is_the_current_branch"
}
existingBranchException(){
Logger logErrorMsg "cannot_${1}_${2}_because_${2}_already_exists"
}
$@
} | include logger.Logger
GitException(){
branchDoesNotExistException(){
Logger logError "cannot_${1}_${2}_because_${2}_does_not_exist"
}
curBranchException(){
Logger logErrorMsg "cannot_${1}_${2}_because_${2}_is_the_current_branch"
}
existingBranchException(){
Logger logErrorMsg "cannot_${1}_${2}_because_${2}_already_exists"
}
$@
} | Add exception for when branch does not exist | Add exception for when branch does not exist
| Shell | mit | anthony-chu/bash-toolbox | shell | ## Code Before:
include logger.Logger
GitException(){
curBranchException(){
Logger logErrorMsg "cannot_${1}_${2}_because_${2}_is_the_current_branch"
}
existingBranchException(){
Logger logErrorMsg "cannot_${1}_${2}_because_${2}_already_exists"
}
$@
}
## Instruction:
Add exception for when branch does not exist
## Code After:
include logger.Logger
GitException(){
branchDoesNotExistException(){
Logger logError "cannot_${1}_${2}_because_${2}_does_not_exist"
}
curBranchException(){
Logger logErrorMsg "cannot_${1}_${2}_because_${2}_is_the_current_branch"
}
existingBranchException(){
Logger logErrorMsg "cannot_${1}_${2}_because_${2}_already_exists"
}
$@
} | include logger.Logger
GitException(){
+ branchDoesNotExistException(){
+ Logger logError "cannot_${1}_${2}_because_${2}_does_not_exist"
+ }
+
curBranchException(){
Logger logErrorMsg "cannot_${1}_${2}_because_${2}_is_the_current_branch"
}
existingBranchException(){
Logger logErrorMsg "cannot_${1}_${2}_because_${2}_already_exists"
}
$@
} | 4 | 0.307692 | 4 | 0 |
06e00f620e630158c46e02e77397458394531b87 | src/app/components/widgets/menu.component.ts | src/app/components/widgets/menu.component.ts | import {Renderer2} from '@angular/core';
import {MenuContext, MenuService} from '../menu-service';
/**
* @author Daniel de Oliveira
* @author Thomas Kleinke
*/
export abstract class MenuComponent {
public opened: boolean = false;
private removeMouseEventListener: Function|undefined;
constructor(private renderer: Renderer2,
protected menuService: MenuService,
private buttonElementId: string,
private menuElementsPrefix: string) {}
public toggle() {
if (this.opened) {
this.close();
} else {
this.open();
}
}
public open() {
this.opened = true;
this.removeMouseEventListener = this.renderer.listen(
'document',
'click',
event => this.handleMouseEvent(event));
}
public close() {
this.opened = false;
if (this.removeMouseEventListener) this.removeMouseEventListener();
}
private handleMouseEvent(event: any) {
if (this.menuService.getContext() === MenuContext.MODAL) return;
let target = event.target;
let inside = false;
do {
if (target.id === this.buttonElementId || target.id.startsWith(this.menuElementsPrefix)) {
inside = true;
break;
}
target = target.parentNode;
} while (target);
if (!inside) this.close();
}
}
| import {Renderer2} from '@angular/core';
import {MenuContext, MenuService} from '../menu-service';
/**
* @author Daniel de Oliveira
* @author Thomas Kleinke
*/
export abstract class MenuComponent {
public opened: boolean = false;
private removeMouseEventListener: Function|undefined;
constructor(private renderer: Renderer2,
protected menuService: MenuService,
private buttonElementId: string,
private menuElementsPrefix: string) {}
public toggle() {
if (this.opened) {
this.close();
} else {
this.open();
}
}
public open() {
this.opened = true;
this.removeMouseEventListener = this.renderer.listen(
'document',
'click',
event => this.handleMouseEvent(event));
}
public close() {
this.opened = false;
if (this.removeMouseEventListener) this.removeMouseEventListener();
}
private handleMouseEvent(event: any) {
if (this.menuService.getContext() === MenuContext.MODAL) return;
let target = event.target;
let inside = false;
do {
if (target.id && (target.id === this.buttonElementId || target.id.startsWith(this.menuElementsPrefix))) {
inside = true;
break;
}
target = target.parentNode;
} while (target);
if (!inside) this.close();
}
}
| Fix closing layer & matrix menus | Fix closing layer & matrix menus
| TypeScript | apache-2.0 | codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client,codarchlab/idai-field-client | typescript | ## Code Before:
import {Renderer2} from '@angular/core';
import {MenuContext, MenuService} from '../menu-service';
/**
* @author Daniel de Oliveira
* @author Thomas Kleinke
*/
export abstract class MenuComponent {
public opened: boolean = false;
private removeMouseEventListener: Function|undefined;
constructor(private renderer: Renderer2,
protected menuService: MenuService,
private buttonElementId: string,
private menuElementsPrefix: string) {}
public toggle() {
if (this.opened) {
this.close();
} else {
this.open();
}
}
public open() {
this.opened = true;
this.removeMouseEventListener = this.renderer.listen(
'document',
'click',
event => this.handleMouseEvent(event));
}
public close() {
this.opened = false;
if (this.removeMouseEventListener) this.removeMouseEventListener();
}
private handleMouseEvent(event: any) {
if (this.menuService.getContext() === MenuContext.MODAL) return;
let target = event.target;
let inside = false;
do {
if (target.id === this.buttonElementId || target.id.startsWith(this.menuElementsPrefix)) {
inside = true;
break;
}
target = target.parentNode;
} while (target);
if (!inside) this.close();
}
}
## Instruction:
Fix closing layer & matrix menus
## Code After:
import {Renderer2} from '@angular/core';
import {MenuContext, MenuService} from '../menu-service';
/**
* @author Daniel de Oliveira
* @author Thomas Kleinke
*/
export abstract class MenuComponent {
public opened: boolean = false;
private removeMouseEventListener: Function|undefined;
constructor(private renderer: Renderer2,
protected menuService: MenuService,
private buttonElementId: string,
private menuElementsPrefix: string) {}
public toggle() {
if (this.opened) {
this.close();
} else {
this.open();
}
}
public open() {
this.opened = true;
this.removeMouseEventListener = this.renderer.listen(
'document',
'click',
event => this.handleMouseEvent(event));
}
public close() {
this.opened = false;
if (this.removeMouseEventListener) this.removeMouseEventListener();
}
private handleMouseEvent(event: any) {
if (this.menuService.getContext() === MenuContext.MODAL) return;
let target = event.target;
let inside = false;
do {
if (target.id && (target.id === this.buttonElementId || target.id.startsWith(this.menuElementsPrefix))) {
inside = true;
break;
}
target = target.parentNode;
} while (target);
if (!inside) this.close();
}
}
| import {Renderer2} from '@angular/core';
import {MenuContext, MenuService} from '../menu-service';
/**
* @author Daniel de Oliveira
* @author Thomas Kleinke
*/
export abstract class MenuComponent {
public opened: boolean = false;
private removeMouseEventListener: Function|undefined;
constructor(private renderer: Renderer2,
protected menuService: MenuService,
private buttonElementId: string,
private menuElementsPrefix: string) {}
public toggle() {
if (this.opened) {
this.close();
} else {
this.open();
}
}
public open() {
this.opened = true;
this.removeMouseEventListener = this.renderer.listen(
'document',
'click',
event => this.handleMouseEvent(event));
}
public close() {
this.opened = false;
if (this.removeMouseEventListener) this.removeMouseEventListener();
}
private handleMouseEvent(event: any) {
if (this.menuService.getContext() === MenuContext.MODAL) return;
let target = event.target;
let inside = false;
do {
- if (target.id === this.buttonElementId || target.id.startsWith(this.menuElementsPrefix)) {
+ if (target.id && (target.id === this.buttonElementId || target.id.startsWith(this.menuElementsPrefix))) {
? ++++++++++++++ +
inside = true;
break;
}
target = target.parentNode;
} while (target);
if (!inside) this.close();
}
} | 2 | 0.029412 | 1 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.