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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2e871be688e565cbc589f563ab3a219087c41e8c | lib/cucumber/rails.rb | lib/cucumber/rails.rb | begin
require 'capybara/rails'
require 'capybara/cucumber'
rescue LoadError
end
module Cucumber
module Rails
module World
def visit(*)
if defined?(super)
super
else
raise Cucumber::Pending, "Capybara not loaded, please add it to your Gemfile:\n\ngem \"capybara\"\n\n"
end
end
end
end
end
World(Cucumber::Rails::World)
| begin
require 'capybara/rails'
require 'capybara/cucumber'
rescue LoadError
end
module Cucumber
module Rails
module World
def visit(*)
if defined?(super)
super
else
raise Cucumber::Pending, "Capybara not loaded, please add it to your Gemfile:\n\ngem \"capybara\"\n\n"
end
end
end
end
end
World(Cucumber::Rails::World)
ActionController::Base.class_eval do
cattr_accessor :allow_rescue
end
ActionDispatch::ShowExceptions.class_eval do
alias __cucumber_orig_call__ call
def call(env)
env['action_dispatch.show_exceptions'] = !!ActionController::Base.allow_rescue
__cucumber_orig_call__(env)
end
end
Before('@allow-rescue') do
@__orig_allow_rescue = ActionController::Base.allow_rescue
ActionController::Base.allow_rescue = true
end
After('@allow-rescue') do
ActionController::Base.allow_rescue = @__orig_allow_rescue
end
| Allow user to control show_exceptions in tests | Allow user to control show_exceptions in tests
| Ruby | mit | tooky/cucumber-rails2,tooky/cucumber-rails2,tooky/cucumber-rails2 | ruby | ## Code Before:
begin
require 'capybara/rails'
require 'capybara/cucumber'
rescue LoadError
end
module Cucumber
module Rails
module World
def visit(*)
if defined?(super)
super
else
raise Cucumber::Pending, "Capybara not loaded, please add it to your Gemfile:\n\ngem \"capybara\"\n\n"
end
end
end
end
end
World(Cucumber::Rails::World)
## Instruction:
Allow user to control show_exceptions in tests
## Code After:
begin
require 'capybara/rails'
require 'capybara/cucumber'
rescue LoadError
end
module Cucumber
module Rails
module World
def visit(*)
if defined?(super)
super
else
raise Cucumber::Pending, "Capybara not loaded, please add it to your Gemfile:\n\ngem \"capybara\"\n\n"
end
end
end
end
end
World(Cucumber::Rails::World)
ActionController::Base.class_eval do
cattr_accessor :allow_rescue
end
ActionDispatch::ShowExceptions.class_eval do
alias __cucumber_orig_call__ call
def call(env)
env['action_dispatch.show_exceptions'] = !!ActionController::Base.allow_rescue
__cucumber_orig_call__(env)
end
end
Before('@allow-rescue') do
@__orig_allow_rescue = ActionController::Base.allow_rescue
ActionController::Base.allow_rescue = true
end
After('@allow-rescue') do
ActionController::Base.allow_rescue = @__orig_allow_rescue
end
| begin
require 'capybara/rails'
require 'capybara/cucumber'
rescue LoadError
end
module Cucumber
module Rails
module World
def visit(*)
if defined?(super)
super
else
raise Cucumber::Pending, "Capybara not loaded, please add it to your Gemfile:\n\ngem \"capybara\"\n\n"
end
end
end
end
end
World(Cucumber::Rails::World)
+ ActionController::Base.class_eval do
+ cattr_accessor :allow_rescue
+ end
+
+ ActionDispatch::ShowExceptions.class_eval do
+ alias __cucumber_orig_call__ call
+
+ def call(env)
+ env['action_dispatch.show_exceptions'] = !!ActionController::Base.allow_rescue
+ __cucumber_orig_call__(env)
+ end
+ end
+
+ Before('@allow-rescue') do
+ @__orig_allow_rescue = ActionController::Base.allow_rescue
+ ActionController::Base.allow_rescue = true
+ end
+
+ After('@allow-rescue') do
+ ActionController::Base.allow_rescue = @__orig_allow_rescue
+ end | 21 | 0.954545 | 21 | 0 |
5ec446a52dfdab5f0b85cb8d9360e1ecf2ecb8e1 | docs-gen/content/introduction/quickstart.md | docs-gen/content/introduction/quickstart.md | ---
title: "Quickstart"
date: 2019-07-31T15:22:34+02:00
weight: 3
---
A serialization of the data definition of the vehicle signal specification is checked in
as ```vss_$VERSION.json```, where ```$VERSION``` is the content of
the ```VERSION``` file.
A web-based JSON viewer can be used to view the current version.
Click **[here](https://jsoneditoronline.org/?url=https://raw.githubusercontent.com/GENIVI/vehicle_signal_specification/746bbadc303ffa0645d4b547af925a041b25aa08/vss_rel_1.0.json)**
| ---
title: "Quickstart"
date: 2019-07-31T15:22:34+02:00
weight: 3
---
A serialization of the data definition of the vehicle signal specification is checked in
as ```vss_$VERSION.json```, where ```$VERSION``` is the content of
the ```VERSION``` file.
A web-based JSON viewer can be used to view the spec.
- View [VSS version 2.1](https://jsoneditoronline.org/?url=https://genivi.github.io/vehicle_signal_specification/releases/v2.1/vss_release_2.1.json)
- View [VSS version 2.0](https://jsoneditoronline.org/?url=https://genivi.github.io/vehicle_signal_specification/releases/v2.0/vss_release_2.0.json)
- View [VSS version 1.0](https://jsoneditoronline.org/?url=https://genivi.github.io/vehicle_signal_specification/releases/v1.0/vss_rel_1.0.json)
| Add links to view versions 2.0 and 2.1 of spec in online JSON editor | Add links to view versions 2.0 and 2.1 of spec in online JSON editor
Signed-off-by: Sebastian Schildt <91497c7302326481c2282b256198d10de876e889@de.bosch.com>
| Markdown | mpl-2.0 | GENIVI/vehicle_signal_specification,GENIVI/vehicle_signal_specification | markdown | ## Code Before:
---
title: "Quickstart"
date: 2019-07-31T15:22:34+02:00
weight: 3
---
A serialization of the data definition of the vehicle signal specification is checked in
as ```vss_$VERSION.json```, where ```$VERSION``` is the content of
the ```VERSION``` file.
A web-based JSON viewer can be used to view the current version.
Click **[here](https://jsoneditoronline.org/?url=https://raw.githubusercontent.com/GENIVI/vehicle_signal_specification/746bbadc303ffa0645d4b547af925a041b25aa08/vss_rel_1.0.json)**
## Instruction:
Add links to view versions 2.0 and 2.1 of spec in online JSON editor
Signed-off-by: Sebastian Schildt <91497c7302326481c2282b256198d10de876e889@de.bosch.com>
## Code After:
---
title: "Quickstart"
date: 2019-07-31T15:22:34+02:00
weight: 3
---
A serialization of the data definition of the vehicle signal specification is checked in
as ```vss_$VERSION.json```, where ```$VERSION``` is the content of
the ```VERSION``` file.
A web-based JSON viewer can be used to view the spec.
- View [VSS version 2.1](https://jsoneditoronline.org/?url=https://genivi.github.io/vehicle_signal_specification/releases/v2.1/vss_release_2.1.json)
- View [VSS version 2.0](https://jsoneditoronline.org/?url=https://genivi.github.io/vehicle_signal_specification/releases/v2.0/vss_release_2.0.json)
- View [VSS version 1.0](https://jsoneditoronline.org/?url=https://genivi.github.io/vehicle_signal_specification/releases/v1.0/vss_rel_1.0.json)
| ---
title: "Quickstart"
date: 2019-07-31T15:22:34+02:00
weight: 3
---
A serialization of the data definition of the vehicle signal specification is checked in
as ```vss_$VERSION.json```, where ```$VERSION``` is the content of
the ```VERSION``` file.
- A web-based JSON viewer can be used to view the current version.
? --------------
+ A web-based JSON viewer can be used to view the spec.
? +++
- Click **[here](https://jsoneditoronline.org/?url=https://raw.githubusercontent.com/GENIVI/vehicle_signal_specification/746bbadc303ffa0645d4b547af925a041b25aa08/vss_rel_1.0.json)**
+
+ - View [VSS version 2.1](https://jsoneditoronline.org/?url=https://genivi.github.io/vehicle_signal_specification/releases/v2.1/vss_release_2.1.json)
+ - View [VSS version 2.0](https://jsoneditoronline.org/?url=https://genivi.github.io/vehicle_signal_specification/releases/v2.0/vss_release_2.0.json)
+ - View [VSS version 1.0](https://jsoneditoronline.org/?url=https://genivi.github.io/vehicle_signal_specification/releases/v1.0/vss_rel_1.0.json)
+ | 8 | 0.615385 | 6 | 2 |
f6806df951e618fe072d2885643763f75d436965 | .config/locale.conf.m4 | .config/locale.conf.m4 | m4_include(env_config.m4)m4_dnl
m4_ifdef(??[[<<m4_env_config_LANG>>]]??,LANG=m4_env_config_LANG)
m4_ifdef(??[[<<m4_env_config_LC_TIME>>]]??,LC_TIME=m4_env_config_LC_TIME)
| m4_include(env_config.m4)m4_dnl
m4_ifdef(??[[<<m4_env_config_LANG>>]]??,m4_dnl
LANG=m4_env_config_LANG
LC_ALL=m4_env_config_LANG)
| Set LC_ALL (and removed useless LC_TIME) | locale: Set LC_ALL (and removed useless LC_TIME)
| M4 | mit | EdTsft/dotfiles,EdTsft/dotfiles | m4 | ## Code Before:
m4_include(env_config.m4)m4_dnl
m4_ifdef(??[[<<m4_env_config_LANG>>]]??,LANG=m4_env_config_LANG)
m4_ifdef(??[[<<m4_env_config_LC_TIME>>]]??,LC_TIME=m4_env_config_LC_TIME)
## Instruction:
locale: Set LC_ALL (and removed useless LC_TIME)
## Code After:
m4_include(env_config.m4)m4_dnl
m4_ifdef(??[[<<m4_env_config_LANG>>]]??,m4_dnl
LANG=m4_env_config_LANG
LC_ALL=m4_env_config_LANG)
| m4_include(env_config.m4)m4_dnl
- m4_ifdef(??[[<<m4_env_config_LANG>>]]??,LANG=m4_env_config_LANG)
? ----- ^ ^^^^^^^^^^^^^^
+ m4_ifdef(??[[<<m4_env_config_LANG>>]]??,m4_dnl
? ^ ^
- m4_ifdef(??[[<<m4_env_config_LC_TIME>>]]??,LC_TIME=m4_env_config_LC_TIME)
+ LANG=m4_env_config_LANG
+ LC_ALL=m4_env_config_LANG) | 5 | 1.666667 | 3 | 2 |
ef82619995ce71b5877228988bce2830eb25baff | download_and_unzip_files.py | download_and_unzip_files.py | import os
import datetime
current_year = datetime.datetime.now().year
years_with_data = range(2011, current_year + 1)
remote_path = "https://ssl.netfile.com/pub2/excel/COAKBrowsable/"
for year in years_with_data:
print "Downloading " + str(year) + " data..."
filename_for_year = "efile_newest_COAK_" + str(year) + ".zip"
os.system("wget " + remote_path + filename_for_year)
os.system("unzip " + filename_for_year)
os.system("rm " + filename_for_year)
| import os
import datetime
current_year = datetime.datetime.now().year
years_with_data = range(2011, current_year + 1)
remote_path = "https://ssl.netfile.com/pub2/excel/COAKBrowsable/"
for year in years_with_data:
print "Downloading " + str(year) + " data..."
filename_for_year = "efile_newest_COAK_" + str(year) + ".zip"
os.system("curl -f -L -O " + remote_path + filename_for_year)
os.system("unzip " + filename_for_year)
os.system("rm " + filename_for_year)
| Replace wget with curl to avoid Heroku buildpack sadness | Replace wget with curl to avoid Heroku buildpack sadness
| Python | bsd-3-clause | daguar/netfile-etl,daguar/netfile-etl | python | ## Code Before:
import os
import datetime
current_year = datetime.datetime.now().year
years_with_data = range(2011, current_year + 1)
remote_path = "https://ssl.netfile.com/pub2/excel/COAKBrowsable/"
for year in years_with_data:
print "Downloading " + str(year) + " data..."
filename_for_year = "efile_newest_COAK_" + str(year) + ".zip"
os.system("wget " + remote_path + filename_for_year)
os.system("unzip " + filename_for_year)
os.system("rm " + filename_for_year)
## Instruction:
Replace wget with curl to avoid Heroku buildpack sadness
## Code After:
import os
import datetime
current_year = datetime.datetime.now().year
years_with_data = range(2011, current_year + 1)
remote_path = "https://ssl.netfile.com/pub2/excel/COAKBrowsable/"
for year in years_with_data:
print "Downloading " + str(year) + " data..."
filename_for_year = "efile_newest_COAK_" + str(year) + ".zip"
os.system("curl -f -L -O " + remote_path + filename_for_year)
os.system("unzip " + filename_for_year)
os.system("rm " + filename_for_year)
| import os
import datetime
current_year = datetime.datetime.now().year
years_with_data = range(2011, current_year + 1)
remote_path = "https://ssl.netfile.com/pub2/excel/COAKBrowsable/"
for year in years_with_data:
print "Downloading " + str(year) + " data..."
filename_for_year = "efile_newest_COAK_" + str(year) + ".zip"
- os.system("wget " + remote_path + filename_for_year)
? ^^^^
+ os.system("curl -f -L -O " + remote_path + filename_for_year)
? ^^^^^^^^^^^^^
os.system("unzip " + filename_for_year)
os.system("rm " + filename_for_year) | 2 | 0.153846 | 1 | 1 |
b09a1cffaeef3b4d51df635770651a9ce2fe776d | .travis.yml | .travis.yml | language: ruby
rvm:
- 2.3.0
env:
- TRAVIS_NODE_VERSION="4"
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# - bundle exec rails server -p 3000 &
- sleep 5
install:
# - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- npm install
# - npm run update-webdriver
script:
- bundle exec rake
- node_modules/.bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox
# - node_modules/.bin/protractor e2e-tests/protractor.conf.js --browser=firefox
notifications:
email: false
| language: ruby
rvm:
- 2.3.0
env:
- TRAVIS_NODE_VERSION="4"
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# - bundle exec rails server -p 3000 &
- sleep 5
install:
- bundle install --jobs=3 --retry=3
# - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- npm install
# - npm run update-webdriver
script:
- bundle exec rake
- node_modules/.bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox
# - node_modules/.bin/protractor e2e-tests/protractor.conf.js --browser=firefox
notifications:
email: false
| Install Ruby dependencies in Travis | Install Ruby dependencies in Travis
| YAML | mit | UniversityofHelsinki/OC-webgui,UniversityofHelsinki/OC-webgui,UniversityofHelsinki/OC-webgui,UniversityofHelsinki/OC-webgui | yaml | ## Code Before:
language: ruby
rvm:
- 2.3.0
env:
- TRAVIS_NODE_VERSION="4"
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# - bundle exec rails server -p 3000 &
- sleep 5
install:
# - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- npm install
# - npm run update-webdriver
script:
- bundle exec rake
- node_modules/.bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox
# - node_modules/.bin/protractor e2e-tests/protractor.conf.js --browser=firefox
notifications:
email: false
## Instruction:
Install Ruby dependencies in Travis
## Code After:
language: ruby
rvm:
- 2.3.0
env:
- TRAVIS_NODE_VERSION="4"
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# - bundle exec rails server -p 3000 &
- sleep 5
install:
- bundle install --jobs=3 --retry=3
# - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- npm install
# - npm run update-webdriver
script:
- bundle exec rake
- node_modules/.bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox
# - node_modules/.bin/protractor e2e-tests/protractor.conf.js --browser=firefox
notifications:
email: false
| language: ruby
rvm:
- 2.3.0
env:
- TRAVIS_NODE_VERSION="4"
before_install:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# - bundle exec rails server -p 3000 &
- sleep 5
install:
+ - bundle install --jobs=3 --retry=3
# - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- npm install
# - npm run update-webdriver
script:
- bundle exec rake
- node_modules/.bin/karma start karma.conf.js --no-auto-watch --single-run --reporters=dots --browsers=Firefox
# - node_modules/.bin/protractor e2e-tests/protractor.conf.js --browser=firefox
notifications:
email: false | 1 | 0.04 | 1 | 0 |
315751e8cc1575361150c37f4a4ec35605d7b8da | bower.json | bower.json | {
"name": "forms-angular",
"author": "Mark Chapman <support@forms-angular.org>",
"version": "0.4.0",
"homepage": "https://github.com/forms-angular/forms-angular",
"description": "No nonsense forms for the MEAN stack",
"keywords": [
"Mongoose",
"Mongo",
"Express",
"Angular",
"Node",
"Bootstrap",
"Forms"
],
"license": "MIT",
"main": [
"dist/forms-angular.js"
],
"dependencies": {
"angular": ">=1.3.0",
"angular-sanitize": ">=1.3.0",
"angular-ui-bootstrap-bower": ">=0.8.0",
"underscore": "1.6",
"ngInfiniteScroll": "^1.1.2",
"angular-elastic": "~2"
},
"devDependencies": {
"angular-mocks": ">=1.3.0",
"bootstrap-3-1-1": "git://github.com/twbs/bootstrap.git#v3.1.1",
"bootstrap-2-3-2": "git://github.com/twbs/bootstrap.git#v2.3.2"
},
"ignore": [
"**/.*",
"node_modules",
"components",
"server",
"template",
"config",
"scripts",
"test",
"Gruntfile.js",
"package.json"
]
}
| {
"name": "forms-angular",
"author": "Mark Chapman <support@forms-angular.org>",
"version": "0.4.0",
"homepage": "https://github.com/forms-angular/forms-angular",
"description": "No nonsense forms for the MEAN stack",
"keywords": [
"Mongoose",
"Mongo",
"Express",
"Angular",
"Node",
"Bootstrap",
"Forms"
],
"license": "MIT",
"main": [
"dist/forms-angular.js"
],
"comments": [
"Use SHA to get a version of ngInfiniteScroll that has no jQuery dependency"
],
"dependencies": {
"angular": ">=1.3.0",
"angular-sanitize": ">=1.3.0",
"angular-ui-bootstrap-bower": ">=0.8.0",
"underscore": "1.6",
"ngInfiniteScroll": "564f3d15bbbc6ee9b7cf537ba33e79067553da03",
"angular-elastic": "~2"
},
"devDependencies": {
"angular-mocks": ">=1.3.0",
"bootstrap-3-1-1": "git://github.com/twbs/bootstrap.git#v3.1.1",
"bootstrap-2-3-2": "git://github.com/twbs/bootstrap.git#v2.3.2"
},
"ignore": [
"**/.*",
"node_modules",
"components",
"server",
"template",
"config",
"scripts",
"test",
"Gruntfile.js",
"package.json"
]
}
| Use a version of infinitescroll that is not dependent on jQuery | Use a version of infinitescroll that is not dependent on jQuery
| JSON | mit | forms-angular/forms-angular,forms-angular/forms-angular,forms-angular/forms-angular | json | ## Code Before:
{
"name": "forms-angular",
"author": "Mark Chapman <support@forms-angular.org>",
"version": "0.4.0",
"homepage": "https://github.com/forms-angular/forms-angular",
"description": "No nonsense forms for the MEAN stack",
"keywords": [
"Mongoose",
"Mongo",
"Express",
"Angular",
"Node",
"Bootstrap",
"Forms"
],
"license": "MIT",
"main": [
"dist/forms-angular.js"
],
"dependencies": {
"angular": ">=1.3.0",
"angular-sanitize": ">=1.3.0",
"angular-ui-bootstrap-bower": ">=0.8.0",
"underscore": "1.6",
"ngInfiniteScroll": "^1.1.2",
"angular-elastic": "~2"
},
"devDependencies": {
"angular-mocks": ">=1.3.0",
"bootstrap-3-1-1": "git://github.com/twbs/bootstrap.git#v3.1.1",
"bootstrap-2-3-2": "git://github.com/twbs/bootstrap.git#v2.3.2"
},
"ignore": [
"**/.*",
"node_modules",
"components",
"server",
"template",
"config",
"scripts",
"test",
"Gruntfile.js",
"package.json"
]
}
## Instruction:
Use a version of infinitescroll that is not dependent on jQuery
## Code After:
{
"name": "forms-angular",
"author": "Mark Chapman <support@forms-angular.org>",
"version": "0.4.0",
"homepage": "https://github.com/forms-angular/forms-angular",
"description": "No nonsense forms for the MEAN stack",
"keywords": [
"Mongoose",
"Mongo",
"Express",
"Angular",
"Node",
"Bootstrap",
"Forms"
],
"license": "MIT",
"main": [
"dist/forms-angular.js"
],
"comments": [
"Use SHA to get a version of ngInfiniteScroll that has no jQuery dependency"
],
"dependencies": {
"angular": ">=1.3.0",
"angular-sanitize": ">=1.3.0",
"angular-ui-bootstrap-bower": ">=0.8.0",
"underscore": "1.6",
"ngInfiniteScroll": "564f3d15bbbc6ee9b7cf537ba33e79067553da03",
"angular-elastic": "~2"
},
"devDependencies": {
"angular-mocks": ">=1.3.0",
"bootstrap-3-1-1": "git://github.com/twbs/bootstrap.git#v3.1.1",
"bootstrap-2-3-2": "git://github.com/twbs/bootstrap.git#v2.3.2"
},
"ignore": [
"**/.*",
"node_modules",
"components",
"server",
"template",
"config",
"scripts",
"test",
"Gruntfile.js",
"package.json"
]
}
| {
"name": "forms-angular",
"author": "Mark Chapman <support@forms-angular.org>",
"version": "0.4.0",
"homepage": "https://github.com/forms-angular/forms-angular",
"description": "No nonsense forms for the MEAN stack",
"keywords": [
"Mongoose",
"Mongo",
"Express",
"Angular",
"Node",
"Bootstrap",
"Forms"
],
"license": "MIT",
"main": [
"dist/forms-angular.js"
],
+ "comments": [
+ "Use SHA to get a version of ngInfiniteScroll that has no jQuery dependency"
+ ],
"dependencies": {
"angular": ">=1.3.0",
"angular-sanitize": ">=1.3.0",
"angular-ui-bootstrap-bower": ">=0.8.0",
"underscore": "1.6",
- "ngInfiniteScroll": "^1.1.2",
+ "ngInfiniteScroll": "564f3d15bbbc6ee9b7cf537ba33e79067553da03",
"angular-elastic": "~2"
},
"devDependencies": {
"angular-mocks": ">=1.3.0",
"bootstrap-3-1-1": "git://github.com/twbs/bootstrap.git#v3.1.1",
"bootstrap-2-3-2": "git://github.com/twbs/bootstrap.git#v2.3.2"
},
"ignore": [
"**/.*",
"node_modules",
"components",
"server",
"template",
"config",
"scripts",
"test",
"Gruntfile.js",
"package.json"
]
} | 5 | 0.108696 | 4 | 1 |
23456a32038f13c6219b6af5ff9fff7e1daae242 | abusehelper/core/tests/test_utils.py | abusehelper/core/tests/test_utils.py | import pickle
import unittest
from .. import utils
class TestCompressedCollection(unittest.TestCase):
def test_collection_can_be_pickled_and_unpickled(self):
original = utils.CompressedCollection()
original.append("ab")
original.append("cd")
unpickled = pickle.loads(pickle.dumps(original))
self.assertEqual(["ab", "cd"], list(unpickled))
def test_objects_can_be_appended_to_an_unpickled_collection(self):
original = utils.CompressedCollection()
original.append("ab")
unpickled = pickle.loads(pickle.dumps(original))
self.assertEqual(["ab"], list(unpickled))
unpickled.append("cd")
self.assertEqual(["ab", "cd"], list(unpickled))
def test_objects_can_be_appended_a_collection_after_pickling(self):
original = utils.CompressedCollection()
original.append("ab")
pickle.dumps(original)
original.append("cd")
self.assertEqual(["ab", "cd"], list(original))
| import socket
import pickle
import urllib2
import unittest
import idiokit
from .. import utils
class TestFetchUrl(unittest.TestCase):
def test_should_raise_TypeError_when_passing_in_an_opener(self):
sock = socket.socket()
try:
sock.bind(("localhost", 0))
sock.listen(1)
_, port = sock.getsockname()
opener = urllib2.build_opener()
fetch = utils.fetch_url("http://localhost:{0}".format(port), opener=opener)
self.assertRaises(TypeError, idiokit.main_loop, fetch)
finally:
sock.close()
class TestCompressedCollection(unittest.TestCase):
def test_collection_can_be_pickled_and_unpickled(self):
original = utils.CompressedCollection()
original.append("ab")
original.append("cd")
unpickled = pickle.loads(pickle.dumps(original))
self.assertEqual(["ab", "cd"], list(unpickled))
def test_objects_can_be_appended_to_an_unpickled_collection(self):
original = utils.CompressedCollection()
original.append("ab")
unpickled = pickle.loads(pickle.dumps(original))
self.assertEqual(["ab"], list(unpickled))
unpickled.append("cd")
self.assertEqual(["ab", "cd"], list(unpickled))
def test_objects_can_be_appended_a_collection_after_pickling(self):
original = utils.CompressedCollection()
original.append("ab")
pickle.dumps(original)
original.append("cd")
self.assertEqual(["ab", "cd"], list(original))
| Add a test for utils.fetch_url(..., opener=...) | Add a test for utils.fetch_url(..., opener=...)
Signed-off-by: Ossi Herrala <37524b811d80bbe1732e3577b04d7a5fd222cfc5@gmail.com>
| Python | mit | abusesa/abusehelper | python | ## Code Before:
import pickle
import unittest
from .. import utils
class TestCompressedCollection(unittest.TestCase):
def test_collection_can_be_pickled_and_unpickled(self):
original = utils.CompressedCollection()
original.append("ab")
original.append("cd")
unpickled = pickle.loads(pickle.dumps(original))
self.assertEqual(["ab", "cd"], list(unpickled))
def test_objects_can_be_appended_to_an_unpickled_collection(self):
original = utils.CompressedCollection()
original.append("ab")
unpickled = pickle.loads(pickle.dumps(original))
self.assertEqual(["ab"], list(unpickled))
unpickled.append("cd")
self.assertEqual(["ab", "cd"], list(unpickled))
def test_objects_can_be_appended_a_collection_after_pickling(self):
original = utils.CompressedCollection()
original.append("ab")
pickle.dumps(original)
original.append("cd")
self.assertEqual(["ab", "cd"], list(original))
## Instruction:
Add a test for utils.fetch_url(..., opener=...)
Signed-off-by: Ossi Herrala <37524b811d80bbe1732e3577b04d7a5fd222cfc5@gmail.com>
## Code After:
import socket
import pickle
import urllib2
import unittest
import idiokit
from .. import utils
class TestFetchUrl(unittest.TestCase):
def test_should_raise_TypeError_when_passing_in_an_opener(self):
sock = socket.socket()
try:
sock.bind(("localhost", 0))
sock.listen(1)
_, port = sock.getsockname()
opener = urllib2.build_opener()
fetch = utils.fetch_url("http://localhost:{0}".format(port), opener=opener)
self.assertRaises(TypeError, idiokit.main_loop, fetch)
finally:
sock.close()
class TestCompressedCollection(unittest.TestCase):
def test_collection_can_be_pickled_and_unpickled(self):
original = utils.CompressedCollection()
original.append("ab")
original.append("cd")
unpickled = pickle.loads(pickle.dumps(original))
self.assertEqual(["ab", "cd"], list(unpickled))
def test_objects_can_be_appended_to_an_unpickled_collection(self):
original = utils.CompressedCollection()
original.append("ab")
unpickled = pickle.loads(pickle.dumps(original))
self.assertEqual(["ab"], list(unpickled))
unpickled.append("cd")
self.assertEqual(["ab", "cd"], list(unpickled))
def test_objects_can_be_appended_a_collection_after_pickling(self):
original = utils.CompressedCollection()
original.append("ab")
pickle.dumps(original)
original.append("cd")
self.assertEqual(["ab", "cd"], list(original))
| + import socket
import pickle
+ import urllib2
import unittest
+ import idiokit
+
from .. import utils
+
+
+ class TestFetchUrl(unittest.TestCase):
+ def test_should_raise_TypeError_when_passing_in_an_opener(self):
+ sock = socket.socket()
+ try:
+ sock.bind(("localhost", 0))
+ sock.listen(1)
+ _, port = sock.getsockname()
+
+ opener = urllib2.build_opener()
+ fetch = utils.fetch_url("http://localhost:{0}".format(port), opener=opener)
+ self.assertRaises(TypeError, idiokit.main_loop, fetch)
+ finally:
+ sock.close()
class TestCompressedCollection(unittest.TestCase):
def test_collection_can_be_pickled_and_unpickled(self):
original = utils.CompressedCollection()
original.append("ab")
original.append("cd")
unpickled = pickle.loads(pickle.dumps(original))
self.assertEqual(["ab", "cd"], list(unpickled))
def test_objects_can_be_appended_to_an_unpickled_collection(self):
original = utils.CompressedCollection()
original.append("ab")
unpickled = pickle.loads(pickle.dumps(original))
self.assertEqual(["ab"], list(unpickled))
unpickled.append("cd")
self.assertEqual(["ab", "cd"], list(unpickled))
def test_objects_can_be_appended_a_collection_after_pickling(self):
original = utils.CompressedCollection()
original.append("ab")
pickle.dumps(original)
original.append("cd")
self.assertEqual(["ab", "cd"], list(original)) | 19 | 0.575758 | 19 | 0 |
3fed999782406636c51c766ac9ab95793cbfb0bf | step-capstone/src/scripts/MapScripts.js | step-capstone/src/scripts/MapScripts.js | const APIKEY = process.env.REACT_APP_IP_RESTRICTED
const getTimezoneFromCoordinates = (lat, lng) => {
return new Promise(resolve => {
fetch("https://maps.googleapis.com/maps/api/timezone/json?location=" + lat + "," + lng + "×tamp=1458000000&key=" + APIKEY)
.then(result => result.json())
.then(data => {
resolve(data.timeZoneName);
});
});
}
export default { getTimezoneFromCoordinates }
| const APIKEY = process.env.REACT_APP_IP_RESTRICTED
const getTimezoneFromCoordinates = (lat, lng) => {
return new Promise(resolve => {
fetch("https://maps.googleapis.com/maps/api/timezone/json?location=" + lat + "," + lng + "×tamp=1458000000&key=" + APIKEY)
.then(result => result.json())
.then(data => {
resolve(data.timeZoneName);
});
});
}
/* Gets placeID and returns string representation of address and coordinates */
const getLocation = (placeID) => {
return new Promise(resolve => {
fetch("https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJd8BlQ2BZwokRAFUEcm_qrcA&key=" + APIKEY)
.then(result => result.json())
.then(data => {
resolve({address: data.results[0].formatted_address, coordinates: data.results[0].geometry.location});
});
});
}
export default { getTimezoneFromCoordinates, getLocation}
| Add funciton that takes place id and returns location data | Add funciton that takes place id and returns location data
| JavaScript | apache-2.0 | googleinterns/step98-2020,googleinterns/step98-2020 | javascript | ## Code Before:
const APIKEY = process.env.REACT_APP_IP_RESTRICTED
const getTimezoneFromCoordinates = (lat, lng) => {
return new Promise(resolve => {
fetch("https://maps.googleapis.com/maps/api/timezone/json?location=" + lat + "," + lng + "×tamp=1458000000&key=" + APIKEY)
.then(result => result.json())
.then(data => {
resolve(data.timeZoneName);
});
});
}
export default { getTimezoneFromCoordinates }
## Instruction:
Add funciton that takes place id and returns location data
## Code After:
const APIKEY = process.env.REACT_APP_IP_RESTRICTED
const getTimezoneFromCoordinates = (lat, lng) => {
return new Promise(resolve => {
fetch("https://maps.googleapis.com/maps/api/timezone/json?location=" + lat + "," + lng + "×tamp=1458000000&key=" + APIKEY)
.then(result => result.json())
.then(data => {
resolve(data.timeZoneName);
});
});
}
/* Gets placeID and returns string representation of address and coordinates */
const getLocation = (placeID) => {
return new Promise(resolve => {
fetch("https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJd8BlQ2BZwokRAFUEcm_qrcA&key=" + APIKEY)
.then(result => result.json())
.then(data => {
resolve({address: data.results[0].formatted_address, coordinates: data.results[0].geometry.location});
});
});
}
export default { getTimezoneFromCoordinates, getLocation}
| const APIKEY = process.env.REACT_APP_IP_RESTRICTED
const getTimezoneFromCoordinates = (lat, lng) => {
return new Promise(resolve => {
fetch("https://maps.googleapis.com/maps/api/timezone/json?location=" + lat + "," + lng + "×tamp=1458000000&key=" + APIKEY)
.then(result => result.json())
.then(data => {
resolve(data.timeZoneName);
});
});
}
+ /* Gets placeID and returns string representation of address and coordinates */
+ const getLocation = (placeID) => {
+ return new Promise(resolve => {
+ fetch("https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJd8BlQ2BZwokRAFUEcm_qrcA&key=" + APIKEY)
+ .then(result => result.json())
+ .then(data => {
+ resolve({address: data.results[0].formatted_address, coordinates: data.results[0].geometry.location});
+ });
+ });
+ }
- export default { getTimezoneFromCoordinates }
+ export default { getTimezoneFromCoordinates, getLocation}
+ | 13 | 0.8125 | 12 | 1 |
c3e1ae0ac5f5bf44b1cf1e09a16ae1b120a7ee77 | appveyor.yml | appveyor.yml | version: '{build}'
skip_tags: true
skip_commits:
message: /\[ci skip\]/
clone_depth: 10
environment:
TERM: dumb
matrix:
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
init:
- git config --global --unset core.autocrlf
install:
- SET PATH=%JAVA_HOME%\bin;%PATH%
# remove Ruby entry (C:\Ruby193\bin;) from PATH
- SET PATH=%PATH:C:\Ruby193\bin;=%
- echo %PATH%
- java -version
- gradlew.bat --version
build_script:
- gradlew.bat -u -i assemble -PwarningsAsErrors=true
test_script:
- gradlew.bat -u -i -S test -PwarningsAsErrors=true
| version: '{build}'
skip_tags: true
skip_commits:
message: /\[ci skip\]/
clone_depth: 10
environment:
TERM: dumb
matrix:
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
- JAVA_HOME: C:\Program Files\Java\jdk9
init:
- git config --global --unset core.autocrlf
install:
- SET PATH=%JAVA_HOME%\bin;%PATH%
# remove Ruby entry (C:\Ruby193\bin;) from PATH
- SET PATH=%PATH:C:\Ruby193\bin;=%
- echo %PATH%
- java -version
- gradlew.bat --version
build_script:
- gradlew.bat -u -i assemble -PwarningsAsErrors=true
test_script:
- gradlew.bat -u -i -S test -PwarningsAsErrors=true
| Test Windows build on Java 9 | CI: Test Windows build on Java 9 | YAML | apache-2.0 | arturbosch/detekt,rock3r/detekt,Mauin/detekt,arturbosch/detekt,Mauin/detekt,rock3r/detekt,arturbosch/detekt,rock3r/detekt,Mauin/detekt,Mauin/detekt | yaml | ## Code Before:
version: '{build}'
skip_tags: true
skip_commits:
message: /\[ci skip\]/
clone_depth: 10
environment:
TERM: dumb
matrix:
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
init:
- git config --global --unset core.autocrlf
install:
- SET PATH=%JAVA_HOME%\bin;%PATH%
# remove Ruby entry (C:\Ruby193\bin;) from PATH
- SET PATH=%PATH:C:\Ruby193\bin;=%
- echo %PATH%
- java -version
- gradlew.bat --version
build_script:
- gradlew.bat -u -i assemble -PwarningsAsErrors=true
test_script:
- gradlew.bat -u -i -S test -PwarningsAsErrors=true
## Instruction:
CI: Test Windows build on Java 9
## Code After:
version: '{build}'
skip_tags: true
skip_commits:
message: /\[ci skip\]/
clone_depth: 10
environment:
TERM: dumb
matrix:
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
- JAVA_HOME: C:\Program Files\Java\jdk9
init:
- git config --global --unset core.autocrlf
install:
- SET PATH=%JAVA_HOME%\bin;%PATH%
# remove Ruby entry (C:\Ruby193\bin;) from PATH
- SET PATH=%PATH:C:\Ruby193\bin;=%
- echo %PATH%
- java -version
- gradlew.bat --version
build_script:
- gradlew.bat -u -i assemble -PwarningsAsErrors=true
test_script:
- gradlew.bat -u -i -S test -PwarningsAsErrors=true
| version: '{build}'
skip_tags: true
skip_commits:
message: /\[ci skip\]/
clone_depth: 10
environment:
TERM: dumb
matrix:
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
+ - JAVA_HOME: C:\Program Files\Java\jdk9
init:
- git config --global --unset core.autocrlf
install:
- SET PATH=%JAVA_HOME%\bin;%PATH%
# remove Ruby entry (C:\Ruby193\bin;) from PATH
- SET PATH=%PATH:C:\Ruby193\bin;=%
- echo %PATH%
- java -version
- gradlew.bat --version
build_script:
- gradlew.bat -u -i assemble -PwarningsAsErrors=true
test_script:
- gradlew.bat -u -i -S test -PwarningsAsErrors=true | 1 | 0.045455 | 1 | 0 |
f69a9418bd0e313090c1c8f3ae4ec8c07dfc5758 | _config.yml | _config.yml | encoding: utf-8
prose:
media: "files"
#siteurl: "http://team178.github.io" | encoding: utf-8
markdown: kramdown
prose:
media: "files"
#siteurl: "http://team178.github.io"
| Use kramdown as markdown interpreter | Use kramdown as markdown interpreter
| YAML | mpl-2.0 | team178/team178.github.io,team178/team178.github.io,team178/team178.github.io | yaml | ## Code Before:
encoding: utf-8
prose:
media: "files"
#siteurl: "http://team178.github.io"
## Instruction:
Use kramdown as markdown interpreter
## Code After:
encoding: utf-8
markdown: kramdown
prose:
media: "files"
#siteurl: "http://team178.github.io"
| encoding: utf-8
+ markdown: kramdown
prose:
media: "files"
#siteurl: "http://team178.github.io" | 1 | 0.25 | 1 | 0 |
4ae12db99c73101be00ffeb0a680ceb0a1d4b013 | docker-compose.yml | docker-compose.yml | version: "3"
services:
web:
build: .
links:
- redis
ports:
- "1443:1443"
environment:
- REDIS_HOST=redis
- NODE_ENV=production
redis:
image: redis:alpine
| version: "3"
services:
web:
build: .
links:
- redis
ports:
- "1443:1443"
environment:
- REDIS_HOST=redis
redis:
image: redis:alpine
| Make develop the default NODE_ENV | Make develop the default NODE_ENV
| YAML | mpl-2.0 | mozilla/send,mozilla/send,mozilla/send,mozilla/send,mozilla/send | yaml | ## Code Before:
version: "3"
services:
web:
build: .
links:
- redis
ports:
- "1443:1443"
environment:
- REDIS_HOST=redis
- NODE_ENV=production
redis:
image: redis:alpine
## Instruction:
Make develop the default NODE_ENV
## Code After:
version: "3"
services:
web:
build: .
links:
- redis
ports:
- "1443:1443"
environment:
- REDIS_HOST=redis
redis:
image: redis:alpine
| version: "3"
services:
web:
build: .
links:
- redis
ports:
- "1443:1443"
environment:
- REDIS_HOST=redis
- - NODE_ENV=production
redis:
image: redis:alpine | 1 | 0.076923 | 0 | 1 |
40da9ada036a5692c9863cddd0d25e75d1430f4c | src/Config/ProxyHandlerConfig.ts | src/Config/ProxyHandlerConfig.ts | import { HandlerConfig } from './HandlerConfig';
/**
* Configuration settings for a Handler object.
*/
export interface ProxyHandlerConfig extends HandlerConfig {
/**
* Remote root path where the request will be redirected. Defaults to '/'. e.g.
*/
remotePath?: string;
/**
* Name of the Path Parameter on the AWS request that contains the path of the request. This will default to `path`
* if not specified.
*/
pathParameterName?: string;
/**
* Whatever the request should be handle over HTTPS. Default to true.
*/
ssl?: boolean;
/**
* Remote Port where the request should be directed. Defaults to 443 for HTTPS request and 80 for HTTP request.
*/
remotePort?: number;
/**
* whatever OPTIONS request should be process locally. If set to `true`, pre-flight OPTIONS request will be handle
* locally. An empty response will be sent and the cors headers will be defined via the HandlerConfig options.
*
* If set to false, the the request will be relayed to the remtoe server.
*
* Defaults to true.
*/
processOptionsLocally?: boolean;
/**
* List of headers that should be copied over from the original request to the proxy request.
*/
whiteListedHeader?: string[];
}
| import { HandlerConfig } from './HandlerConfig';
/**
* Configuration settings for a Handler object.
*/
export interface ProxyHandlerConfig extends HandlerConfig {
/**
* Remote root path where the request will be redirected. Defaults to '/'. e.g.
*/
baseUrl?: string;
/**
* Name of the Path Parameter on the AWS request that contains the path of the request. This will default to `path`
* if not specified.
*/
pathParameterName?: string;
/**
* Whatever the request should be handle over HTTPS. Default to true.
*/
ssl?: boolean;
/**
* Remote Port where the request should be directed. Defaults to 443 for HTTPS request and 80 for HTTP request.
*/
port?: number;
/**
* whatever OPTIONS request should be process locally. If set to `true`, pre-flight OPTIONS request will be handle
* locally. An empty response will be sent and the cors headers will be defined via the HandlerConfig options.
*
* If set to false, the the request will be relayed to the remtoe server.
*
* Defaults to true.
*/
processOptionsLocally?: boolean;
/**
* List of headers that should be copied over from the original request to the proxy request.
*/
whiteListedHeader?: string[];
}
| Tweak the config to reflect the fact we are using the request library rather than the native node one. | Tweak the config to reflect the fact we are using the request library rather than the native node one.
| TypeScript | mit | syrp-nz/ts-lambda-handler,syrp-nz/ts-lambda-handler | typescript | ## Code Before:
import { HandlerConfig } from './HandlerConfig';
/**
* Configuration settings for a Handler object.
*/
export interface ProxyHandlerConfig extends HandlerConfig {
/**
* Remote root path where the request will be redirected. Defaults to '/'. e.g.
*/
remotePath?: string;
/**
* Name of the Path Parameter on the AWS request that contains the path of the request. This will default to `path`
* if not specified.
*/
pathParameterName?: string;
/**
* Whatever the request should be handle over HTTPS. Default to true.
*/
ssl?: boolean;
/**
* Remote Port where the request should be directed. Defaults to 443 for HTTPS request and 80 for HTTP request.
*/
remotePort?: number;
/**
* whatever OPTIONS request should be process locally. If set to `true`, pre-flight OPTIONS request will be handle
* locally. An empty response will be sent and the cors headers will be defined via the HandlerConfig options.
*
* If set to false, the the request will be relayed to the remtoe server.
*
* Defaults to true.
*/
processOptionsLocally?: boolean;
/**
* List of headers that should be copied over from the original request to the proxy request.
*/
whiteListedHeader?: string[];
}
## Instruction:
Tweak the config to reflect the fact we are using the request library rather than the native node one.
## Code After:
import { HandlerConfig } from './HandlerConfig';
/**
* Configuration settings for a Handler object.
*/
export interface ProxyHandlerConfig extends HandlerConfig {
/**
* Remote root path where the request will be redirected. Defaults to '/'. e.g.
*/
baseUrl?: string;
/**
* Name of the Path Parameter on the AWS request that contains the path of the request. This will default to `path`
* if not specified.
*/
pathParameterName?: string;
/**
* Whatever the request should be handle over HTTPS. Default to true.
*/
ssl?: boolean;
/**
* Remote Port where the request should be directed. Defaults to 443 for HTTPS request and 80 for HTTP request.
*/
port?: number;
/**
* whatever OPTIONS request should be process locally. If set to `true`, pre-flight OPTIONS request will be handle
* locally. An empty response will be sent and the cors headers will be defined via the HandlerConfig options.
*
* If set to false, the the request will be relayed to the remtoe server.
*
* Defaults to true.
*/
processOptionsLocally?: boolean;
/**
* List of headers that should be copied over from the original request to the proxy request.
*/
whiteListedHeader?: string[];
}
| import { HandlerConfig } from './HandlerConfig';
/**
* Configuration settings for a Handler object.
*/
export interface ProxyHandlerConfig extends HandlerConfig {
/**
* Remote root path where the request will be redirected. Defaults to '/'. e.g.
*/
- remotePath?: string;
+ baseUrl?: string;
/**
* Name of the Path Parameter on the AWS request that contains the path of the request. This will default to `path`
* if not specified.
*/
pathParameterName?: string;
/**
* Whatever the request should be handle over HTTPS. Default to true.
*/
ssl?: boolean;
/**
* Remote Port where the request should be directed. Defaults to 443 for HTTPS request and 80 for HTTP request.
*/
- remotePort?: number;
? ^^^^^^^
+ port?: number;
? ^
/**
* whatever OPTIONS request should be process locally. If set to `true`, pre-flight OPTIONS request will be handle
* locally. An empty response will be sent and the cors headers will be defined via the HandlerConfig options.
*
* If set to false, the the request will be relayed to the remtoe server.
*
* Defaults to true.
*/
processOptionsLocally?: boolean;
/**
* List of headers that should be copied over from the original request to the proxy request.
*/
whiteListedHeader?: string[];
-
} | 5 | 0.111111 | 2 | 3 |
81a7c5c2add96b627b8f21e311c8a6b3f2111766 | .travis.yml | .travis.yml | language: python
python:
- "2.7"
install:
- "pip install -r requirements.txt"
before_script:
- psql -c 'create database db;' -U postgres
env:
- DATABASE_URL=postgresql://postgres@localhost/db
script:
- nosetests --with-coverage --cover-erase --cover-package wallace
after_success:
- coveralls
| language: python
python:
- '2.7'
install:
- pip install -r requirements.txt
before_script:
- psql -c 'create database db;' -U postgres
env:
global:
- DATABASE_URL=postgresql://postgres@localhost/db
- PORT=5000
- secure: isabc6zJWlMBizW/5MbjmWJ9Q2shDj0rjTPmtQmq7QZrrmxczjWfgiQE0i6tcw3wPvBIOgsA4M806ddgM/oeUPWt892BlPHUESb7j96zHtig9B/P4kwH11EPK4pEPcvg90NfVeDCqYHVSNcMtsRTSf93Fg7aT081URb7vRUykxg=
- secure: rWBAifHvKlQabe6gvz+edMEtjtDnpwI4RFHJB1ytYSNVKQ59s7fIk2q39IZc8K3Uix7ZtP3G7ws6ufQhOj44Pm4j1J+rbLnDjdMtmcDN5aiSnwb05JpltZXCNjUqAu/CBFZ44lnNenZp4uSLhU/kLVhB2Q+UPvyWNFgApEVoiHM=
- secure: fd4hFOH60UV8laBN4Mjva0w/EmVK3SVC5p/0O1oqPriPhUpoJ3eVVRvITbdvPctEJJgRR9t62rPk+Rv4EOXeRFfsjZK9gOfQqv/9VhJBebdQfOx2dwQLjDiGTrklkokDIDyfpyYOoJzZ/oP+6EneD403ilHnXC4fd/4EDQmaIRI=
- secure: 3rnkGugv5Hp71gjwQMUj5tup7/xk94p5IXEh0VItSXTziKn0pBY+yrCzAuIzlylbrl0baLaZOFGEFn2K+Jf+tr9mmN23X+zOUNsIqC4swlLLJx6hzH5AZaRmqzGjURM2gLISUayXGT9flOXyOKzzCGFELJKG9KlVyEOJ4fk04wQ=
script:
- nosetests --with-coverage --cover-erase --cover-package wallace
after_success:
- coveralls
| Update and configure Travis environment variables | Update and configure Travis environment variables
| YAML | mit | berkeley-cocosci/Wallace,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,suchow/Wallace,jcpeterson/Dallinger,berkeley-cocosci/Wallace,suchow/Wallace,Dallinger/Dallinger,jcpeterson/Dallinger,Dallinger/Dallinger,jcpeterson/Dallinger,berkeley-cocosci/Wallace,Dallinger/Dallinger,Dallinger/Dallinger,suchow/Wallace | yaml | ## Code Before:
language: python
python:
- "2.7"
install:
- "pip install -r requirements.txt"
before_script:
- psql -c 'create database db;' -U postgres
env:
- DATABASE_URL=postgresql://postgres@localhost/db
script:
- nosetests --with-coverage --cover-erase --cover-package wallace
after_success:
- coveralls
## Instruction:
Update and configure Travis environment variables
## Code After:
language: python
python:
- '2.7'
install:
- pip install -r requirements.txt
before_script:
- psql -c 'create database db;' -U postgres
env:
global:
- DATABASE_URL=postgresql://postgres@localhost/db
- PORT=5000
- secure: isabc6zJWlMBizW/5MbjmWJ9Q2shDj0rjTPmtQmq7QZrrmxczjWfgiQE0i6tcw3wPvBIOgsA4M806ddgM/oeUPWt892BlPHUESb7j96zHtig9B/P4kwH11EPK4pEPcvg90NfVeDCqYHVSNcMtsRTSf93Fg7aT081URb7vRUykxg=
- secure: rWBAifHvKlQabe6gvz+edMEtjtDnpwI4RFHJB1ytYSNVKQ59s7fIk2q39IZc8K3Uix7ZtP3G7ws6ufQhOj44Pm4j1J+rbLnDjdMtmcDN5aiSnwb05JpltZXCNjUqAu/CBFZ44lnNenZp4uSLhU/kLVhB2Q+UPvyWNFgApEVoiHM=
- secure: fd4hFOH60UV8laBN4Mjva0w/EmVK3SVC5p/0O1oqPriPhUpoJ3eVVRvITbdvPctEJJgRR9t62rPk+Rv4EOXeRFfsjZK9gOfQqv/9VhJBebdQfOx2dwQLjDiGTrklkokDIDyfpyYOoJzZ/oP+6EneD403ilHnXC4fd/4EDQmaIRI=
- secure: 3rnkGugv5Hp71gjwQMUj5tup7/xk94p5IXEh0VItSXTziKn0pBY+yrCzAuIzlylbrl0baLaZOFGEFn2K+Jf+tr9mmN23X+zOUNsIqC4swlLLJx6hzH5AZaRmqzGjURM2gLISUayXGT9flOXyOKzzCGFELJKG9KlVyEOJ4fk04wQ=
script:
- nosetests --with-coverage --cover-erase --cover-package wallace
after_success:
- coveralls
| language: python
python:
- - "2.7"
+ - '2.7'
install:
- - "pip install -r requirements.txt"
? -- - -
+ - pip install -r requirements.txt
before_script:
- - psql -c 'create database db;' -U postgres
? --
+ - psql -c 'create database db;' -U postgres
env:
+ global:
- DATABASE_URL=postgresql://postgres@localhost/db
+ - PORT=5000
+ - secure: isabc6zJWlMBizW/5MbjmWJ9Q2shDj0rjTPmtQmq7QZrrmxczjWfgiQE0i6tcw3wPvBIOgsA4M806ddgM/oeUPWt892BlPHUESb7j96zHtig9B/P4kwH11EPK4pEPcvg90NfVeDCqYHVSNcMtsRTSf93Fg7aT081URb7vRUykxg=
+ - secure: rWBAifHvKlQabe6gvz+edMEtjtDnpwI4RFHJB1ytYSNVKQ59s7fIk2q39IZc8K3Uix7ZtP3G7ws6ufQhOj44Pm4j1J+rbLnDjdMtmcDN5aiSnwb05JpltZXCNjUqAu/CBFZ44lnNenZp4uSLhU/kLVhB2Q+UPvyWNFgApEVoiHM=
+ - secure: fd4hFOH60UV8laBN4Mjva0w/EmVK3SVC5p/0O1oqPriPhUpoJ3eVVRvITbdvPctEJJgRR9t62rPk+Rv4EOXeRFfsjZK9gOfQqv/9VhJBebdQfOx2dwQLjDiGTrklkokDIDyfpyYOoJzZ/oP+6EneD403ilHnXC4fd/4EDQmaIRI=
+ - secure: 3rnkGugv5Hp71gjwQMUj5tup7/xk94p5IXEh0VItSXTziKn0pBY+yrCzAuIzlylbrl0baLaZOFGEFn2K+Jf+tr9mmN23X+zOUNsIqC4swlLLJx6hzH5AZaRmqzGjURM2gLISUayXGT9flOXyOKzzCGFELJKG9KlVyEOJ4fk04wQ=
script:
- - nosetests --with-coverage --cover-erase --cover-package wallace
? --
+ - nosetests --with-coverage --cover-erase --cover-package wallace
after_success:
- - coveralls
? --
+ - coveralls | 16 | 1.230769 | 11 | 5 |
d7ddf2018c7f1e1f43f1d65ea89368a6a852aa2f | types/filenamify/filenamify-tests.ts | types/filenamify/filenamify-tests.ts | import * as filenamify from 'filenamify';
filenamify('<foo/bar>');
// => 'foo!bar'
filenamify('foo:"bar"', {replacement: '🐴'});
// => 'foo🐴bar'
filenamify.path('/some/!path');
// => '/some/path'
| import filenamify = require('filenamify');
filenamify('<foo/bar>');
// => 'foo!bar'
filenamify('foo:"bar"', {replacement: '🐴'});
// => 'foo🐴bar'
filenamify.path('/some/!path');
// => '/some/path'
| Update import expression in filenamify-test.ts | Update import expression in filenamify-test.ts
See here for the futher information : https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19550#discussion_r137169189
| TypeScript | mit | georgemarshall/DefinitelyTyped,mcliment/DefinitelyTyped,zuzusik/DefinitelyTyped,AgentME/DefinitelyTyped,rolandzwaga/DefinitelyTyped,AgentME/DefinitelyTyped,borisyankov/DefinitelyTyped,one-pieces/DefinitelyTyped,jimthedev/DefinitelyTyped,magny/DefinitelyTyped,aciccarello/DefinitelyTyped,chrootsu/DefinitelyTyped,AbraaoAlves/DefinitelyTyped,aciccarello/DefinitelyTyped,magny/DefinitelyTyped,chrootsu/DefinitelyTyped,benliddicott/DefinitelyTyped,arusakov/DefinitelyTyped,AgentME/DefinitelyTyped,benishouga/DefinitelyTyped,dsebastien/DefinitelyTyped,markogresak/DefinitelyTyped,benishouga/DefinitelyTyped,nycdotnet/DefinitelyTyped,benishouga/DefinitelyTyped,arusakov/DefinitelyTyped,zuzusik/DefinitelyTyped,georgemarshall/DefinitelyTyped,dsebastien/DefinitelyTyped,laurentiustamate94/DefinitelyTyped,AbraaoAlves/DefinitelyTyped,alexdresko/DefinitelyTyped,borisyankov/DefinitelyTyped,aciccarello/DefinitelyTyped,georgemarshall/DefinitelyTyped,georgemarshall/DefinitelyTyped,AbraaoAlves/DefinitelyTyped,rolandzwaga/DefinitelyTyped,nycdotnet/DefinitelyTyped,jimthedev/DefinitelyTyped,arusakov/DefinitelyTyped,jimthedev/DefinitelyTyped,alexdresko/DefinitelyTyped,AgentME/DefinitelyTyped,zuzusik/DefinitelyTyped | typescript | ## Code Before:
import * as filenamify from 'filenamify';
filenamify('<foo/bar>');
// => 'foo!bar'
filenamify('foo:"bar"', {replacement: '🐴'});
// => 'foo🐴bar'
filenamify.path('/some/!path');
// => '/some/path'
## Instruction:
Update import expression in filenamify-test.ts
See here for the futher information : https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19550#discussion_r137169189
## Code After:
import filenamify = require('filenamify');
filenamify('<foo/bar>');
// => 'foo!bar'
filenamify('foo:"bar"', {replacement: '🐴'});
// => 'foo🐴bar'
filenamify.path('/some/!path');
// => '/some/path'
| - import * as filenamify from 'filenamify';
? ----- ^ ^^^
+ import filenamify = require('filenamify');
? ^^ ^^^^^^^ +
filenamify('<foo/bar>');
// => 'foo!bar'
filenamify('foo:"bar"', {replacement: '🐴'});
// => 'foo🐴bar'
filenamify.path('/some/!path');
// => '/some/path' | 2 | 0.2 | 1 | 1 |
3fe64158616291cbadd17d80d15d66e0c7fec9cb | spec/spec_helper.rb | spec/spec_helper.rb | require 'simplecov'
SimpleCov.start do
add_filter 'spec'
add_group 'Controllers', 'app/controllers'
add_group 'Models', 'app/models'
add_group 'Overrides', 'app/overrides'
add_group 'Libraries', 'lib'
end
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../dummy/config/environment.rb', __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/rails'
require 'shoulda-matchers'
require 'ffaker'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.mock_with :rspec
config.use_transactional_fixtures = false
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus
config.run_all_when_everything_filtered = true
end
| require 'simplecov'
SimpleCov.start do
add_filter 'spec'
add_group 'Controllers', 'app/controllers'
add_group 'Models', 'app/models'
add_group 'Overrides', 'app/overrides'
add_group 'Libraries', 'lib'
end
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../dummy/config/environment.rb', __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/rails'
require 'shoulda-matchers'
require 'ffaker'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
Excon.defaults[:ssl_verify_peer] = false
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.mock_with :rspec
config.use_transactional_fixtures = false
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus
config.run_all_when_everything_filtered = true
end
| Set Excon SSL Verification To False During Tests | Set Excon SSL Verification To False During Tests
No SSL Verification is required during the testing runs. Clients
however, should be running SSL on their store fronts.
| Ruby | bsd-3-clause | WalkerAndCoBrandsInc/spree_chimpy,WalkerAndCoBrandsInc/spree_chimpy,WalkerAndCoBrandsInc/spree_chimpy | ruby | ## Code Before:
require 'simplecov'
SimpleCov.start do
add_filter 'spec'
add_group 'Controllers', 'app/controllers'
add_group 'Models', 'app/models'
add_group 'Overrides', 'app/overrides'
add_group 'Libraries', 'lib'
end
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../dummy/config/environment.rb', __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/rails'
require 'shoulda-matchers'
require 'ffaker'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.mock_with :rspec
config.use_transactional_fixtures = false
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus
config.run_all_when_everything_filtered = true
end
## Instruction:
Set Excon SSL Verification To False During Tests
No SSL Verification is required during the testing runs. Clients
however, should be running SSL on their store fronts.
## Code After:
require 'simplecov'
SimpleCov.start do
add_filter 'spec'
add_group 'Controllers', 'app/controllers'
add_group 'Models', 'app/models'
add_group 'Overrides', 'app/overrides'
add_group 'Libraries', 'lib'
end
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../dummy/config/environment.rb', __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/rails'
require 'shoulda-matchers'
require 'ffaker'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
Excon.defaults[:ssl_verify_peer] = false
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.mock_with :rspec
config.use_transactional_fixtures = false
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus
config.run_all_when_everything_filtered = true
end
| require 'simplecov'
SimpleCov.start do
add_filter 'spec'
add_group 'Controllers', 'app/controllers'
add_group 'Models', 'app/models'
add_group 'Overrides', 'app/overrides'
add_group 'Libraries', 'lib'
end
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../dummy/config/environment.rb', __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'capybara/rails'
require 'shoulda-matchers'
require 'ffaker'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist
+ Excon.defaults[:ssl_verify_peer] = false
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.mock_with :rspec
config.use_transactional_fixtures = false
config.treat_symbols_as_metadata_keys_with_true_values = true
config.filter_run :focus
config.run_all_when_everything_filtered = true
end | 1 | 0.033333 | 1 | 0 |
4445ba93ee7cba5271fc4889286911f3e42bcaa3 | src/VueJsTypeScriptAspNetCoreSample/src/components/Hello.ts | src/VueJsTypeScriptAspNetCoreSample/src/components/Hello.ts | import * as Vue from "vue";
import Component from "vue-class-component";
@Component({
name: "Hello",
})
export default class Hello extends Vue {
msg: string = "Welcome to Your Vue.js App";
// created (): void {
// axios
// .get('/api/hello')
// .then((res) => {
// this.msg = res.data.message
// })
// .catch((ex) => console.log(ex))
// }
}
| import * as Vue from "vue";
import Component from "vue-class-component";
import axios from "axios";
@Component({
name: "Hello",
})
export default class Hello extends Vue {
msg: string = "Welcome to Your Vue.js App";
created (): void {
axios
.get("/api/hello")
.then((res) => {
this.msg = res.data.message;
})
.catch((ex) => console.log(ex))
}
}
| Add AJAX call sample using axios | Add AJAX call sample using axios
| TypeScript | mit | devkimchi/Vue.js-with-ASP.NET-Core-Sample,devkimchi/Vue.js-with-ASP.NET-Core-Sample,devkimchi/Vue.js-with-ASP.NET-Core-Sample,devkimchi/Vue.js-with-ASP.NET-Core-Sample | typescript | ## Code Before:
import * as Vue from "vue";
import Component from "vue-class-component";
@Component({
name: "Hello",
})
export default class Hello extends Vue {
msg: string = "Welcome to Your Vue.js App";
// created (): void {
// axios
// .get('/api/hello')
// .then((res) => {
// this.msg = res.data.message
// })
// .catch((ex) => console.log(ex))
// }
}
## Instruction:
Add AJAX call sample using axios
## Code After:
import * as Vue from "vue";
import Component from "vue-class-component";
import axios from "axios";
@Component({
name: "Hello",
})
export default class Hello extends Vue {
msg: string = "Welcome to Your Vue.js App";
created (): void {
axios
.get("/api/hello")
.then((res) => {
this.msg = res.data.message;
})
.catch((ex) => console.log(ex))
}
}
| import * as Vue from "vue";
import Component from "vue-class-component";
+ import axios from "axios";
@Component({
name: "Hello",
})
export default class Hello extends Vue {
msg: string = "Welcome to Your Vue.js App";
- // created (): void {
? ---
+ created (): void {
- // axios
? ---
+ axios
- // .get('/api/hello')
? --- ^ ^
+ .get("/api/hello")
? ^ ^
- // .then((res) => {
? ---
+ .then((res) => {
- // this.msg = res.data.message
? ---
+ this.msg = res.data.message;
? +
- // })
? ---
+ })
- // .catch((ex) => console.log(ex))
? ---
+ .catch((ex) => console.log(ex))
- // }
+ }
} | 17 | 1 | 9 | 8 |
c53a53f705908c79fcb330de6d612b8eae1ea28b | apps/files/templates/appnavigation.php | apps/files/templates/appnavigation.php | <div id="app-navigation">
<ul class="with-icon">
<?php foreach ($_['navigationItems'] as $item) { ?>
<li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?>">
<a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
class="nav-icon-<?php p($item['id']) ?> svg">
<?php p($item['name']);?>
</a>
</li>
<?php } ?>
</ul>
<div id="app-settings">
<div id="app-settings-header">
<button class="settings-button" data-apps-slide-toggle="#app-settings-content">
<span><?php p($l->t('Settings'));?></span>
</button>
</div>
<div id="app-settings-content">
<h2>
<label for="webdavurl"><?php p($l->t('WebDAV'));?></label>
</h2>
<input id="webdavurl" type="text" readonly="readonly" value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>" />
<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
</div>
</div>
</div>
| <div id="app-navigation">
<ul class="with-icon">
<?php foreach ($_['navigationItems'] as $item) { ?>
<li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?>">
<a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg">
<?php p($item['name']);?>
</a>
</li>
<?php } ?>
</ul>
<div id="app-settings">
<div id="app-settings-header">
<button class="settings-button" data-apps-slide-toggle="#app-settings-content">
<span><?php p($l->t('Settings'));?></span>
</button>
</div>
<div id="app-settings-content">
<h2>
<label for="webdavurl"><?php p($l->t('WebDAV'));?></label>
</h2>
<input id="webdavurl" type="text" readonly="readonly" value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>" />
<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
</div>
</div>
</div>
| Allow files app nav entries to have a different icon class | Allow files app nav entries to have a different icon class
| PHP | agpl-3.0 | pixelipo/server,endsguy/server,xx621998xx/server,pmattern/server,bluelml/core,pixelipo/server,bluelml/core,owncloud/core,nextcloud/server,pixelipo/server,endsguy/server,xx621998xx/server,bluelml/core,whitekiba/server,IljaN/core,endsguy/server,Ardinis/server,andreas-p/nextcloud-server,cernbox/core,pmattern/server,andreas-p/nextcloud-server,IljaN/core,cernbox/core,pollopolea/core,pollopolea/core,cernbox/core,whitekiba/server,bluelml/core,michaelletzgus/nextcloud-server,whitekiba/server,IljaN/core,owncloud/core,lrytz/core,whitekiba/server,nextcloud/server,xx621998xx/server,owncloud/core,sharidas/core,lrytz/core,pixelipo/server,Ardinis/server,lrytz/core,pmattern/server,owncloud/core,andreas-p/nextcloud-server,IljaN/core,endsguy/server,pmattern/server,pollopolea/core,jbicha/server,sharidas/core,jbicha/server,michaelletzgus/nextcloud-server,pmattern/server,michaelletzgus/nextcloud-server,jbicha/server,xx621998xx/server,sharidas/core,owncloud/core,pollopolea/core,nextcloud/server,whitekiba/server,andreas-p/nextcloud-server,andreas-p/nextcloud-server,Ardinis/server,lrytz/core,phil-davis/core,lrytz/core,sharidas/core,Ardinis/server,sharidas/core,cernbox/core,cernbox/core,Ardinis/server,bluelml/core,pixelipo/server,pollopolea/core,jbicha/server,endsguy/server,xx621998xx/server,jbicha/server,michaelletzgus/nextcloud-server,nextcloud/server,IljaN/core | php | ## Code Before:
<div id="app-navigation">
<ul class="with-icon">
<?php foreach ($_['navigationItems'] as $item) { ?>
<li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?>">
<a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
class="nav-icon-<?php p($item['id']) ?> svg">
<?php p($item['name']);?>
</a>
</li>
<?php } ?>
</ul>
<div id="app-settings">
<div id="app-settings-header">
<button class="settings-button" data-apps-slide-toggle="#app-settings-content">
<span><?php p($l->t('Settings'));?></span>
</button>
</div>
<div id="app-settings-content">
<h2>
<label for="webdavurl"><?php p($l->t('WebDAV'));?></label>
</h2>
<input id="webdavurl" type="text" readonly="readonly" value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>" />
<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
</div>
</div>
</div>
## Instruction:
Allow files app nav entries to have a different icon class
## Code After:
<div id="app-navigation">
<ul class="with-icon">
<?php foreach ($_['navigationItems'] as $item) { ?>
<li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?>">
<a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg">
<?php p($item['name']);?>
</a>
</li>
<?php } ?>
</ul>
<div id="app-settings">
<div id="app-settings-header">
<button class="settings-button" data-apps-slide-toggle="#app-settings-content">
<span><?php p($l->t('Settings'));?></span>
</button>
</div>
<div id="app-settings-content">
<h2>
<label for="webdavurl"><?php p($l->t('WebDAV'));?></label>
</h2>
<input id="webdavurl" type="text" readonly="readonly" value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>" />
<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
</div>
</div>
</div>
| <div id="app-navigation">
<ul class="with-icon">
<?php foreach ($_['navigationItems'] as $item) { ?>
<li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?>">
<a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
- class="nav-icon-<?php p($item['id']) ?> svg">
+ class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg">
<?php p($item['name']);?>
</a>
</li>
<?php } ?>
</ul>
<div id="app-settings">
<div id="app-settings-header">
<button class="settings-button" data-apps-slide-toggle="#app-settings-content">
<span><?php p($l->t('Settings'));?></span>
</button>
</div>
<div id="app-settings-content">
<h2>
<label for="webdavurl"><?php p($l->t('WebDAV'));?></label>
</h2>
<input id="webdavurl" type="text" readonly="readonly" value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>" />
<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
</div>
</div>
</div> | 2 | 0.076923 | 1 | 1 |
2261b3c6cb579ae65c1119db45f291e246f536c2 | examples/main.py | examples/main.py | import asyncio
import sys
from contextlib import suppress
sys.path.append("..")
from asynccmd import Cmd
class Commander(Cmd):
def __init__(self, intro, prompt):
if sys.platform == 'win32':
super().__init__(mode="Run", run_loop=False)
else:
super().__init__(mode="Reader", run_loop=False)
self.intro = intro
self.prompt = prompt
self.loop = None
def do_tasks(self, arg):
"""
Fake command. Type "prodigy {arg}"
:param arg: args occurred from cmd after command
:return:
"""
print(print(asyncio.Task.all_tasks(loop=self.loop)))
def start(self, loop=None):
self.loop = loop
super().cmdloop(loop)
loop = asyncio.ProactorEventLoop()
#loop = asyncio.get_event_loop()
cmd = Commander(intro="This is example", prompt="example> ")
cmd.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
loop.stop()
pending = asyncio.Task.all_tasks(loop=loop)
for task in pending:
task.cancel()
with suppress(asyncio.CancelledError):
loop.run_until_complete(task)
| import asyncio
import sys
from contextlib import suppress
sys.path.append("..")
from asynccmd import Cmd
class Commander(Cmd):
def __init__(self, intro, prompt):
if sys.platform == 'win32':
super().__init__(mode="Run", run_loop=False)
else:
super().__init__(mode="Reader", run_loop=False)
self.intro = intro
self.prompt = prompt
self.loop = None
def do_tasks(self, arg):
"""
Fake command. Type "prodigy {arg}"
:param arg: args occurred from cmd after command
:return:
"""
print(print(asyncio.Task.all_tasks(loop=self.loop)))
def start(self, loop=None):
self.loop = loop
super().cmdloop(loop)
if sys.platform == 'win32':
loop = asyncio.ProactorEventLoop()
else:
loop = asyncio.get_event_loop()
cmd = Commander(intro="This is example", prompt="example> ")
cmd.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
loop.stop()
pending = asyncio.Task.all_tasks(loop=loop)
for task in pending:
task.cancel()
with suppress(asyncio.CancelledError):
loop.run_until_complete(task)
| FIX example for both Win and NIX | FIX example for both Win and NIX
TODO: tasks wont work
| Python | apache-2.0 | valentinmk/asynccmd | python | ## Code Before:
import asyncio
import sys
from contextlib import suppress
sys.path.append("..")
from asynccmd import Cmd
class Commander(Cmd):
def __init__(self, intro, prompt):
if sys.platform == 'win32':
super().__init__(mode="Run", run_loop=False)
else:
super().__init__(mode="Reader", run_loop=False)
self.intro = intro
self.prompt = prompt
self.loop = None
def do_tasks(self, arg):
"""
Fake command. Type "prodigy {arg}"
:param arg: args occurred from cmd after command
:return:
"""
print(print(asyncio.Task.all_tasks(loop=self.loop)))
def start(self, loop=None):
self.loop = loop
super().cmdloop(loop)
loop = asyncio.ProactorEventLoop()
#loop = asyncio.get_event_loop()
cmd = Commander(intro="This is example", prompt="example> ")
cmd.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
loop.stop()
pending = asyncio.Task.all_tasks(loop=loop)
for task in pending:
task.cancel()
with suppress(asyncio.CancelledError):
loop.run_until_complete(task)
## Instruction:
FIX example for both Win and NIX
TODO: tasks wont work
## Code After:
import asyncio
import sys
from contextlib import suppress
sys.path.append("..")
from asynccmd import Cmd
class Commander(Cmd):
def __init__(self, intro, prompt):
if sys.platform == 'win32':
super().__init__(mode="Run", run_loop=False)
else:
super().__init__(mode="Reader", run_loop=False)
self.intro = intro
self.prompt = prompt
self.loop = None
def do_tasks(self, arg):
"""
Fake command. Type "prodigy {arg}"
:param arg: args occurred from cmd after command
:return:
"""
print(print(asyncio.Task.all_tasks(loop=self.loop)))
def start(self, loop=None):
self.loop = loop
super().cmdloop(loop)
if sys.platform == 'win32':
loop = asyncio.ProactorEventLoop()
else:
loop = asyncio.get_event_loop()
cmd = Commander(intro="This is example", prompt="example> ")
cmd.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
loop.stop()
pending = asyncio.Task.all_tasks(loop=loop)
for task in pending:
task.cancel()
with suppress(asyncio.CancelledError):
loop.run_until_complete(task)
| import asyncio
import sys
from contextlib import suppress
sys.path.append("..")
from asynccmd import Cmd
class Commander(Cmd):
def __init__(self, intro, prompt):
if sys.platform == 'win32':
super().__init__(mode="Run", run_loop=False)
else:
super().__init__(mode="Reader", run_loop=False)
self.intro = intro
self.prompt = prompt
self.loop = None
def do_tasks(self, arg):
"""
Fake command. Type "prodigy {arg}"
:param arg: args occurred from cmd after command
:return:
"""
print(print(asyncio.Task.all_tasks(loop=self.loop)))
def start(self, loop=None):
self.loop = loop
super().cmdloop(loop)
+ if sys.platform == 'win32':
- loop = asyncio.ProactorEventLoop()
+ loop = asyncio.ProactorEventLoop()
? +++
+ else:
- #loop = asyncio.get_event_loop()
? ^
+ loop = asyncio.get_event_loop()
? ^^^
cmd = Commander(intro="This is example", prompt="example> ")
cmd.start(loop)
try:
loop.run_forever()
except KeyboardInterrupt:
loop.stop()
pending = asyncio.Task.all_tasks(loop=loop)
for task in pending:
task.cancel()
with suppress(asyncio.CancelledError):
loop.run_until_complete(task) | 6 | 0.146341 | 4 | 2 |
874190cce40c51d9e180f649e3fb338d7e1c3e75 | public/visifile_drivers/apps/blank_microservice.js | public/visifile_drivers/apps/blank_microservice.js | function new_microservice(args) {
/*
base_component_id("new_microservice")
display_name("New microservice")
only_run_on_server(true)
visibility("PRIVATE")
rest_api("change_this_url")
logo_url("/driver_icons/rest.png")
*/
console.log("Hello World")
return args
}
| function new_microservice(args) {
/*
base_component_id("new_microservice")
display_name("New microservice")
only_run_on_server(true)
visibility("PRIVATE")
rest_api("change_this_url")
logo_url("/driver_icons/rest.png")
*/
console.log("Hello World")
//return args
return {a: 1, b: 2, c: "Hello Pilot!"}
}
| Make more sane default Microservice return vaues | Make more sane default Microservice return vaues
| JavaScript | mit | zubairq/yazz,zubairq/gosharedata,zubairq/gosharedata,zubairq/yazz | javascript | ## Code Before:
function new_microservice(args) {
/*
base_component_id("new_microservice")
display_name("New microservice")
only_run_on_server(true)
visibility("PRIVATE")
rest_api("change_this_url")
logo_url("/driver_icons/rest.png")
*/
console.log("Hello World")
return args
}
## Instruction:
Make more sane default Microservice return vaues
## Code After:
function new_microservice(args) {
/*
base_component_id("new_microservice")
display_name("New microservice")
only_run_on_server(true)
visibility("PRIVATE")
rest_api("change_this_url")
logo_url("/driver_icons/rest.png")
*/
console.log("Hello World")
//return args
return {a: 1, b: 2, c: "Hello Pilot!"}
}
| function new_microservice(args) {
/*
base_component_id("new_microservice")
display_name("New microservice")
only_run_on_server(true)
visibility("PRIVATE")
rest_api("change_this_url")
logo_url("/driver_icons/rest.png")
*/
console.log("Hello World")
- return args
+ //return args
? ++
+ return {a: 1, b: 2, c: "Hello Pilot!"}
} | 3 | 0.230769 | 2 | 1 |
6adb86a9a926f309ab2c378d2bd6d49f730f26cb | app/controllers/appointment_summaries_controller.rb | app/controllers/appointment_summaries_controller.rb | class AppointmentSummariesController < ApplicationController
before_action :authenticate_user!
def new
@appointment_summary = AppointmentSummary.new
end
def create
@appointment_summary = AppointmentSummary.create(appointment_summary_params)
if @appointment_summary.persisted?
IssueOutputDocument.new(@appointment_summary).call
else
render :new
end
end
def show
appointment_summary = AppointmentSummary.find(params[:id])
output_document = OutputDocument.new(appointment_summary)
respond_to do |format|
format.html { render html: output_document.html.html_safe }
format.pdf do
send_data output_document.pdf,
filename: 'pension_wise.pdf', type: 'application/pdf',
disposition: :inline
end
end
end
private
def appointment_summary_params
params.require(:appointment_summary).permit(:name, :email_address, :address,
:date_of_appointment, :value_of_pension_pots,
:income_in_retirement, :guider_name,
:guider_organisation, :continue_working, :unsure,
:leave_inheritance, :wants_flexibility,
:wants_security, :wants_lump_sum, :poor_health)
end
end
| class AppointmentSummariesController < ApplicationController
before_action :authenticate_user!
def new
@appointment_summary = AppointmentSummary.new
end
def create
@appointment_summary = AppointmentSummary.create(appointment_summary_params.merge(user: current_user))
if @appointment_summary.persisted?
IssueOutputDocument.new(@appointment_summary).call
else
render :new
end
end
def show
appointment_summary = AppointmentSummary.find(params[:id])
output_document = OutputDocument.new(appointment_summary)
respond_to do |format|
format.html { render html: output_document.html.html_safe }
format.pdf do
send_data output_document.pdf,
filename: 'pension_wise.pdf', type: 'application/pdf',
disposition: :inline
end
end
end
private
def appointment_summary_params
params.require(:appointment_summary).permit(:name, :email_address, :address,
:date_of_appointment, :value_of_pension_pots,
:income_in_retirement, :guider_name,
:guider_organisation, :continue_working, :unsure,
:leave_inheritance, :wants_flexibility,
:wants_security, :wants_lump_sum, :poor_health)
end
end
| Set current_user when creating AppointmentSummary | Set current_user when creating AppointmentSummary
| Ruby | mit | guidance-guarantee-programme/output,guidance-guarantee-programme/output,guidance-guarantee-programme/output | ruby | ## Code Before:
class AppointmentSummariesController < ApplicationController
before_action :authenticate_user!
def new
@appointment_summary = AppointmentSummary.new
end
def create
@appointment_summary = AppointmentSummary.create(appointment_summary_params)
if @appointment_summary.persisted?
IssueOutputDocument.new(@appointment_summary).call
else
render :new
end
end
def show
appointment_summary = AppointmentSummary.find(params[:id])
output_document = OutputDocument.new(appointment_summary)
respond_to do |format|
format.html { render html: output_document.html.html_safe }
format.pdf do
send_data output_document.pdf,
filename: 'pension_wise.pdf', type: 'application/pdf',
disposition: :inline
end
end
end
private
def appointment_summary_params
params.require(:appointment_summary).permit(:name, :email_address, :address,
:date_of_appointment, :value_of_pension_pots,
:income_in_retirement, :guider_name,
:guider_organisation, :continue_working, :unsure,
:leave_inheritance, :wants_flexibility,
:wants_security, :wants_lump_sum, :poor_health)
end
end
## Instruction:
Set current_user when creating AppointmentSummary
## Code After:
class AppointmentSummariesController < ApplicationController
before_action :authenticate_user!
def new
@appointment_summary = AppointmentSummary.new
end
def create
@appointment_summary = AppointmentSummary.create(appointment_summary_params.merge(user: current_user))
if @appointment_summary.persisted?
IssueOutputDocument.new(@appointment_summary).call
else
render :new
end
end
def show
appointment_summary = AppointmentSummary.find(params[:id])
output_document = OutputDocument.new(appointment_summary)
respond_to do |format|
format.html { render html: output_document.html.html_safe }
format.pdf do
send_data output_document.pdf,
filename: 'pension_wise.pdf', type: 'application/pdf',
disposition: :inline
end
end
end
private
def appointment_summary_params
params.require(:appointment_summary).permit(:name, :email_address, :address,
:date_of_appointment, :value_of_pension_pots,
:income_in_retirement, :guider_name,
:guider_organisation, :continue_working, :unsure,
:leave_inheritance, :wants_flexibility,
:wants_security, :wants_lump_sum, :poor_health)
end
end
| class AppointmentSummariesController < ApplicationController
before_action :authenticate_user!
def new
@appointment_summary = AppointmentSummary.new
end
def create
- @appointment_summary = AppointmentSummary.create(appointment_summary_params)
+ @appointment_summary = AppointmentSummary.create(appointment_summary_params.merge(user: current_user))
? +++++++++++++++++++++++++ +
if @appointment_summary.persisted?
IssueOutputDocument.new(@appointment_summary).call
else
render :new
end
end
def show
appointment_summary = AppointmentSummary.find(params[:id])
output_document = OutputDocument.new(appointment_summary)
respond_to do |format|
format.html { render html: output_document.html.html_safe }
format.pdf do
send_data output_document.pdf,
filename: 'pension_wise.pdf', type: 'application/pdf',
disposition: :inline
end
end
end
private
def appointment_summary_params
params.require(:appointment_summary).permit(:name, :email_address, :address,
:date_of_appointment, :value_of_pension_pots,
:income_in_retirement, :guider_name,
:guider_organisation, :continue_working, :unsure,
:leave_inheritance, :wants_flexibility,
:wants_security, :wants_lump_sum, :poor_health)
end
end | 2 | 0.04878 | 1 | 1 |
32421fa082a93c7429e65fbf6f39941cee3da5c4 | spec/lib/html_processors/node_replacer_spec.rb | spec/lib/html_processors/node_replacer_spec.rb | require 'html_processor/node_replacer'
describe HTMLProcessor::NodeReplacer do
let(:html) {
<<-EOHTML
<div>
<h3>a rather important title</h3>
</div>
EOHTML
}
let(:processor) { described_class.new(html) }
describe '.process' do
subject(:processed_html) { processor.process('//h3', 'h2') }
it 'replaces the target XPath with the new tag' do
expect(Nokogiri::HTML(processed_html).xpath('//h2')).to have(1).item
end
end
end
| require 'nokogiri'
require 'html_processor/node_replacer'
describe HTMLProcessor::NodeReplacer do
subject(:processor) { described_class.new(html) }
let(:html) {
<<-EOHTML
<div>
<h3>a rather important title</h3>
</div>
EOHTML
}
describe '.process' do
subject(:processed_html) { processor.process('//h3', 'h2') }
it 'replaces the target elements with the specified element' do
expect(Nokogiri::HTML(processed_html).xpath('//h2')).to have(1).item
end
end
end
| Improve output of HTMLProcessor::NodeReplacer spec | Improve output of HTMLProcessor::NodeReplacer spec | Ruby | mit | moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend,moneyadviceservice/frontend | ruby | ## Code Before:
require 'html_processor/node_replacer'
describe HTMLProcessor::NodeReplacer do
let(:html) {
<<-EOHTML
<div>
<h3>a rather important title</h3>
</div>
EOHTML
}
let(:processor) { described_class.new(html) }
describe '.process' do
subject(:processed_html) { processor.process('//h3', 'h2') }
it 'replaces the target XPath with the new tag' do
expect(Nokogiri::HTML(processed_html).xpath('//h2')).to have(1).item
end
end
end
## Instruction:
Improve output of HTMLProcessor::NodeReplacer spec
## Code After:
require 'nokogiri'
require 'html_processor/node_replacer'
describe HTMLProcessor::NodeReplacer do
subject(:processor) { described_class.new(html) }
let(:html) {
<<-EOHTML
<div>
<h3>a rather important title</h3>
</div>
EOHTML
}
describe '.process' do
subject(:processed_html) { processor.process('//h3', 'h2') }
it 'replaces the target elements with the specified element' do
expect(Nokogiri::HTML(processed_html).xpath('//h2')).to have(1).item
end
end
end
| + require 'nokogiri'
require 'html_processor/node_replacer'
describe HTMLProcessor::NodeReplacer do
+ subject(:processor) { described_class.new(html) }
+
let(:html) {
<<-EOHTML
<div>
<h3>a rather important title</h3>
</div>
EOHTML
}
- let(:processor) { described_class.new(html) }
-
describe '.process' do
subject(:processed_html) { processor.process('//h3', 'h2') }
- it 'replaces the target XPath with the new tag' do
+ it 'replaces the target elements with the specified element' do
expect(Nokogiri::HTML(processed_html).xpath('//h2')).to have(1).item
end
end
end | 7 | 0.333333 | 4 | 3 |
95cb030e7793d251716966da34aec8d4afcc8ca9 | lib/templates/setup_hstore91.rb | lib/templates/setup_hstore91.rb | class SetupHstore < ActiveRecord::Migration
def self.up
execute "CREATE EXTENSION hstore"
end
def self.down
execute "DROP EXTENSION hstore"
end
end
| class SetupHstore < ActiveRecord::Migration
def self.up
execute "CREATE EXTENSION IF NOT EXISTS hstore"
end
def self.down
execute "DROP EXTENSION IF EXISTS hstore"
end
end
| Create or drop hstore extension only if necessary. | Create or drop hstore extension only if necessary. | Ruby | mit | softa/activerecord-postgres-hstore,diogob/activerecord-postgres-hstore,softa/activerecord-postgres-hstore,joeybaker/activerecord-postgres-hstore,darrencauthon/activerecord-postgres-hstore,joeybaker/activerecord-postgres-hstore | ruby | ## Code Before:
class SetupHstore < ActiveRecord::Migration
def self.up
execute "CREATE EXTENSION hstore"
end
def self.down
execute "DROP EXTENSION hstore"
end
end
## Instruction:
Create or drop hstore extension only if necessary.
## Code After:
class SetupHstore < ActiveRecord::Migration
def self.up
execute "CREATE EXTENSION IF NOT EXISTS hstore"
end
def self.down
execute "DROP EXTENSION IF EXISTS hstore"
end
end
| class SetupHstore < ActiveRecord::Migration
def self.up
- execute "CREATE EXTENSION hstore"
+ execute "CREATE EXTENSION IF NOT EXISTS hstore"
? ++++++++++++++
end
def self.down
- execute "DROP EXTENSION hstore"
+ execute "DROP EXTENSION IF EXISTS hstore"
? ++++++++++
end
end | 4 | 0.444444 | 2 | 2 |
94e5e9279953a4098ef01695586c4bea155cb1a2 | Library/Application-Support/Firefox/Profiles/robgant.default/gm_scripts/Remove_Position_Fixed/Remove_Position_Fixed.user.js | Library/Application-Support/Firefox/Profiles/robgant.default/gm_scripts/Remove_Position_Fixed/Remove_Position_Fixed.user.js | // ==UserScript==
// @name Remove Position Fixed
// @namespace name.robgant
// @description Makes anything on the page with position fixed become static
// @include *
// @version 1
// @grant GM_registerMenuCommand
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
function unfix_position() {
// console.log("Unfixing Positions!!");
Array.forEach(
document.querySelectorAll("div, header, section, nav")
,function(el) {
if (window.getComputedStyle(el).position === 'fixed') {
el.style.position = 'static';
el.style.cssText += ';position:static !important;';
}
}
);
}
GM_registerMenuCommand("Position Unfixed", unfix_position);
function set_default_unfix() {
var domain = window.location.host;
GM_setValue(domain, true);
}
GM_registerMenuCommand("Default Unfixed", set_default_unfix);
var domain = window.location.host;
if (GM_getValue(domain, false)) {
// console.log("Default Unfixed Position");
window.addEventListener("scroll", function(evt){
unfix_position();
window.removeEventListener("scroll", arguments.callee);
}, false);
}
//else { console.log("Not Default Unfixed Position"); }
| // ==UserScript==
// @name Remove Position Fixed
// @namespace name.robgant
// @description Makes some things on the page with position fixed become static. Adds a menu command to run the script.
// @include *
// @grant GM_registerMenuCommand
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
function unfix_position() {
// console.log("Unfixing Positions!!");
Array.forEach(
document.querySelectorAll("div, header, section, nav")
,function(el) {
if (window.getComputedStyle(el).position === 'fixed') {
el.style.position = 'static';
el.style.cssText += ';position:static !important;';
}
}
);
}
GM_registerMenuCommand("Position Unfixed", unfix_position);
function set_default_unfix() {
var domain = window.location.host;
GM_setValue(domain, true);
}
GM_registerMenuCommand("Default Unfixed", set_default_unfix);
var domain = window.location.host;
if (GM_getValue(domain, false)) {
// console.log("Default Unfixed Position");
window.addEventListener("scroll", function(evt){
window.setTimeout(unfix_position, 800);
window.removeEventListener("scroll", arguments.callee);
}, false);
}
//else { console.log("Not Default Unfixed Position"); }
| Use a timeout to handle position fixed only on scroll | Use a timeout to handle position fixed only on scroll | JavaScript | mit | rgant/homedir,rgant/homedir,rgant/homedir | javascript | ## Code Before:
// ==UserScript==
// @name Remove Position Fixed
// @namespace name.robgant
// @description Makes anything on the page with position fixed become static
// @include *
// @version 1
// @grant GM_registerMenuCommand
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
function unfix_position() {
// console.log("Unfixing Positions!!");
Array.forEach(
document.querySelectorAll("div, header, section, nav")
,function(el) {
if (window.getComputedStyle(el).position === 'fixed') {
el.style.position = 'static';
el.style.cssText += ';position:static !important;';
}
}
);
}
GM_registerMenuCommand("Position Unfixed", unfix_position);
function set_default_unfix() {
var domain = window.location.host;
GM_setValue(domain, true);
}
GM_registerMenuCommand("Default Unfixed", set_default_unfix);
var domain = window.location.host;
if (GM_getValue(domain, false)) {
// console.log("Default Unfixed Position");
window.addEventListener("scroll", function(evt){
unfix_position();
window.removeEventListener("scroll", arguments.callee);
}, false);
}
//else { console.log("Not Default Unfixed Position"); }
## Instruction:
Use a timeout to handle position fixed only on scroll
## Code After:
// ==UserScript==
// @name Remove Position Fixed
// @namespace name.robgant
// @description Makes some things on the page with position fixed become static. Adds a menu command to run the script.
// @include *
// @grant GM_registerMenuCommand
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
function unfix_position() {
// console.log("Unfixing Positions!!");
Array.forEach(
document.querySelectorAll("div, header, section, nav")
,function(el) {
if (window.getComputedStyle(el).position === 'fixed') {
el.style.position = 'static';
el.style.cssText += ';position:static !important;';
}
}
);
}
GM_registerMenuCommand("Position Unfixed", unfix_position);
function set_default_unfix() {
var domain = window.location.host;
GM_setValue(domain, true);
}
GM_registerMenuCommand("Default Unfixed", set_default_unfix);
var domain = window.location.host;
if (GM_getValue(domain, false)) {
// console.log("Default Unfixed Position");
window.addEventListener("scroll", function(evt){
window.setTimeout(unfix_position, 800);
window.removeEventListener("scroll", arguments.callee);
}, false);
}
//else { console.log("Not Default Unfixed Position"); }
| // ==UserScript==
// @name Remove Position Fixed
// @namespace name.robgant
- // @description Makes anything on the page with position fixed become static
+ // @description Makes some things on the page with position fixed become static. Adds a menu command to run the script.
// @include *
- // @version 1
// @grant GM_registerMenuCommand
// @grant GM_getValue
// @grant GM_setValue
// ==/UserScript==
function unfix_position() {
// console.log("Unfixing Positions!!");
Array.forEach(
document.querySelectorAll("div, header, section, nav")
,function(el) {
if (window.getComputedStyle(el).position === 'fixed') {
el.style.position = 'static';
el.style.cssText += ';position:static !important;';
}
}
);
}
GM_registerMenuCommand("Position Unfixed", unfix_position);
function set_default_unfix() {
var domain = window.location.host;
GM_setValue(domain, true);
}
GM_registerMenuCommand("Default Unfixed", set_default_unfix);
var domain = window.location.host;
if (GM_getValue(domain, false)) {
// console.log("Default Unfixed Position");
window.addEventListener("scroll", function(evt){
- unfix_position();
+ window.setTimeout(unfix_position, 800);
window.removeEventListener("scroll", arguments.callee);
}, false);
}
//else { console.log("Not Default Unfixed Position"); } | 5 | 0.119048 | 2 | 3 |
c269debb2819db246483551d512c33b784bbfd22 | test.py | test.py | print "----- import lua -----"
import lua
print "----- lg = lua.globals() -----"
lg = lua.globals()
print "----- lg.foo = \"bar\" -----"
lg.foo = 'bar'
print "----- lg.tmp = [] -----"
lg.tmp = []
print "----- print lg.tmp -----"
print lg.tmp
print "----- lua.execute(\"xxx = {1,2,3,foo={4,5}}\") -----"
lua.execute("xxx = {1,2,3,foo={4,5}}")
print "----- print lg.xxx[1] -----"
print lg.xxx[1]
print "----- print lg.xxx[2] -----"
print lg.xxx[2]
print "----- print lg.xxx[3] -----"
print lg.xxx[3]
print "----- print lg.xxx['foo'][1] -----"
print lg.xxx['foo'][1]
| print "----- import lua -----"
import lua
print "----- lg = lua.globals() -----"
lg = lua.globals()
print "lg:", lg
print "lg._G:", lg._G
print "lg['_G']:", lg['_G']
print "----- lg.foo = \"bar\" -----"
lg.foo = 'bar'
print "----- lg.tmp = [] -----"
lg.tmp = []
print "----- print lg.tmp -----"
print lg.tmp
print "----- lua.execute(\"xxx = {1,2,3,foo={4,5}}\") -----"
lua.execute("xxx = {1,2,3,foo={4,5}}")
print "----- print lg.xxx[1] -----"
print lg.xxx[1]
print "----- print lg.xxx[2] -----"
print lg.xxx[2]
print "----- print lg.xxx[3] -----"
print lg.xxx[3]
print "----- print lg.xxx['foo'][1] -----"
print lg.xxx['foo'][1]
print "lua.require =", lua.require
try:
lua.require("foo")
except:
print "lua.require('foo') raised an exception"
| Test Lua's globals() and require() from Python | Test Lua's globals() and require() from Python
| Python | lgpl-2.1 | albanD/lunatic-python,bastibe/lunatic-python,bastibe/lunatic-python,greatwolf/lunatic-python,alexsilva/lunatic-python,greatwolf/lunatic-python,hughperkins/lunatic-python,alexsilva/lunatic-python,hughperkins/lunatic-python,alexsilva/lunatic-python,albanD/lunatic-python | python | ## Code Before:
print "----- import lua -----"
import lua
print "----- lg = lua.globals() -----"
lg = lua.globals()
print "----- lg.foo = \"bar\" -----"
lg.foo = 'bar'
print "----- lg.tmp = [] -----"
lg.tmp = []
print "----- print lg.tmp -----"
print lg.tmp
print "----- lua.execute(\"xxx = {1,2,3,foo={4,5}}\") -----"
lua.execute("xxx = {1,2,3,foo={4,5}}")
print "----- print lg.xxx[1] -----"
print lg.xxx[1]
print "----- print lg.xxx[2] -----"
print lg.xxx[2]
print "----- print lg.xxx[3] -----"
print lg.xxx[3]
print "----- print lg.xxx['foo'][1] -----"
print lg.xxx['foo'][1]
## Instruction:
Test Lua's globals() and require() from Python
## Code After:
print "----- import lua -----"
import lua
print "----- lg = lua.globals() -----"
lg = lua.globals()
print "lg:", lg
print "lg._G:", lg._G
print "lg['_G']:", lg['_G']
print "----- lg.foo = \"bar\" -----"
lg.foo = 'bar'
print "----- lg.tmp = [] -----"
lg.tmp = []
print "----- print lg.tmp -----"
print lg.tmp
print "----- lua.execute(\"xxx = {1,2,3,foo={4,5}}\") -----"
lua.execute("xxx = {1,2,3,foo={4,5}}")
print "----- print lg.xxx[1] -----"
print lg.xxx[1]
print "----- print lg.xxx[2] -----"
print lg.xxx[2]
print "----- print lg.xxx[3] -----"
print lg.xxx[3]
print "----- print lg.xxx['foo'][1] -----"
print lg.xxx['foo'][1]
print "lua.require =", lua.require
try:
lua.require("foo")
except:
print "lua.require('foo') raised an exception"
| print "----- import lua -----"
import lua
print "----- lg = lua.globals() -----"
lg = lua.globals()
+ print "lg:", lg
+ print "lg._G:", lg._G
+ print "lg['_G']:", lg['_G']
print "----- lg.foo = \"bar\" -----"
lg.foo = 'bar'
print "----- lg.tmp = [] -----"
lg.tmp = []
print "----- print lg.tmp -----"
print lg.tmp
print "----- lua.execute(\"xxx = {1,2,3,foo={4,5}}\") -----"
lua.execute("xxx = {1,2,3,foo={4,5}}")
print "----- print lg.xxx[1] -----"
print lg.xxx[1]
print "----- print lg.xxx[2] -----"
print lg.xxx[2]
print "----- print lg.xxx[3] -----"
print lg.xxx[3]
print "----- print lg.xxx['foo'][1] -----"
print lg.xxx['foo'][1]
+ print "lua.require =", lua.require
+ try:
+ lua.require("foo")
+ except:
+ print "lua.require('foo') raised an exception"
+ | 9 | 0.45 | 9 | 0 |
54800d70683c1c44725ec28bbba3475f0a6802c3 | ansible/roles/configure_sphinx/tasks/main.yml | ansible/roles/configure_sphinx/tasks/main.yml | ---
# Playbook to setup sphinx server, index sentences and start the search daemon
- name: Check whether code directory is present or not
shell: ' [ -d {{code_dir}} ] '
register: code_status
ignore_errors: yes
- name: Database import/update fail message
fail: msg="The code directory is not present in {{code_dir}}. Please run update_code.yml first to create these directories. Also, you need to have the tatoeba database setup. Use setup_database.yml for that."
when: code_status|failed
- name: Create directories for sphinx
file: path={{item}} state=directory recurse=yes mode=744 owner=sphinxsearch group=sphinxsearch
with_items:
- "{{sphinx_index_dir}}"
- "{{sphinx_log_dir}}"
- "{{sphinx_binlog_path}}"
- name: Generate sphinx.conf
shell: ./app/Console/cake sphinx_conf > /etc/sphinxsearch/sphinx.conf chdir={{code_dir}}
- name: Create indexes
command: indexer --all
when: sphinx_create_indexes == true
- name: Set sphinxsearch to start with system startup
command: sed -i 's/START=no/START=yes/' /etc/default/sphinxsearch
- name: Start the search daemon
service: name=sphinxsearch state=started enabled=yes
| ---
# Playbook to setup sphinx server, index sentences and start the search daemon
- name: Check whether code directory is present or not
shell: ' [ -d {{code_dir}} ] '
register: code_status
ignore_errors: yes
- name: Database import/update fail message
fail: msg="The code directory is not present in {{code_dir}}. Please run update_code.yml first to create these directories. Also, you need to have the tatoeba database setup. Use setup_database.yml for that."
when: code_status|failed
- name: Create directories for sphinx
file: path={{item}} state=directory recurse=yes mode=744 owner=sphinxsearch group=sphinxsearch
with_items:
- "{{sphinx_index_dir}}"
- "{{sphinx_log_dir}}"
- "{{sphinx_binlog_path}}"
- name: Generate sphinx.conf
shell: ./app/Console/cake sphinx_conf > /etc/sphinxsearch/sphinx.conf chdir={{code_dir}}
- name: Create indexes
become: true
become_user: sphinxsearch
command: indexer --all
when: sphinx_create_indexes == true
- name: Set sphinxsearch to start with system startup
command: sed -i 's/START=no/START=yes/' /etc/default/sphinxsearch
- name: Start the search daemon
service: name=sphinxsearch state=started enabled=yes
| Make sure Sphinx indexes are created by sphinx user | Make sure Sphinx indexes are created by sphinx user
| YAML | agpl-3.0 | Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2,Tatoeba/tatoeba2 | yaml | ## Code Before:
---
# Playbook to setup sphinx server, index sentences and start the search daemon
- name: Check whether code directory is present or not
shell: ' [ -d {{code_dir}} ] '
register: code_status
ignore_errors: yes
- name: Database import/update fail message
fail: msg="The code directory is not present in {{code_dir}}. Please run update_code.yml first to create these directories. Also, you need to have the tatoeba database setup. Use setup_database.yml for that."
when: code_status|failed
- name: Create directories for sphinx
file: path={{item}} state=directory recurse=yes mode=744 owner=sphinxsearch group=sphinxsearch
with_items:
- "{{sphinx_index_dir}}"
- "{{sphinx_log_dir}}"
- "{{sphinx_binlog_path}}"
- name: Generate sphinx.conf
shell: ./app/Console/cake sphinx_conf > /etc/sphinxsearch/sphinx.conf chdir={{code_dir}}
- name: Create indexes
command: indexer --all
when: sphinx_create_indexes == true
- name: Set sphinxsearch to start with system startup
command: sed -i 's/START=no/START=yes/' /etc/default/sphinxsearch
- name: Start the search daemon
service: name=sphinxsearch state=started enabled=yes
## Instruction:
Make sure Sphinx indexes are created by sphinx user
## Code After:
---
# Playbook to setup sphinx server, index sentences and start the search daemon
- name: Check whether code directory is present or not
shell: ' [ -d {{code_dir}} ] '
register: code_status
ignore_errors: yes
- name: Database import/update fail message
fail: msg="The code directory is not present in {{code_dir}}. Please run update_code.yml first to create these directories. Also, you need to have the tatoeba database setup. Use setup_database.yml for that."
when: code_status|failed
- name: Create directories for sphinx
file: path={{item}} state=directory recurse=yes mode=744 owner=sphinxsearch group=sphinxsearch
with_items:
- "{{sphinx_index_dir}}"
- "{{sphinx_log_dir}}"
- "{{sphinx_binlog_path}}"
- name: Generate sphinx.conf
shell: ./app/Console/cake sphinx_conf > /etc/sphinxsearch/sphinx.conf chdir={{code_dir}}
- name: Create indexes
become: true
become_user: sphinxsearch
command: indexer --all
when: sphinx_create_indexes == true
- name: Set sphinxsearch to start with system startup
command: sed -i 's/START=no/START=yes/' /etc/default/sphinxsearch
- name: Start the search daemon
service: name=sphinxsearch state=started enabled=yes
| ---
# Playbook to setup sphinx server, index sentences and start the search daemon
- name: Check whether code directory is present or not
shell: ' [ -d {{code_dir}} ] '
register: code_status
ignore_errors: yes
- name: Database import/update fail message
fail: msg="The code directory is not present in {{code_dir}}. Please run update_code.yml first to create these directories. Also, you need to have the tatoeba database setup. Use setup_database.yml for that."
when: code_status|failed
- name: Create directories for sphinx
file: path={{item}} state=directory recurse=yes mode=744 owner=sphinxsearch group=sphinxsearch
with_items:
- "{{sphinx_index_dir}}"
- "{{sphinx_log_dir}}"
- "{{sphinx_binlog_path}}"
- name: Generate sphinx.conf
shell: ./app/Console/cake sphinx_conf > /etc/sphinxsearch/sphinx.conf chdir={{code_dir}}
- name: Create indexes
+ become: true
+ become_user: sphinxsearch
command: indexer --all
when: sphinx_create_indexes == true
- name: Set sphinxsearch to start with system startup
command: sed -i 's/START=no/START=yes/' /etc/default/sphinxsearch
- name: Start the search daemon
service: name=sphinxsearch state=started enabled=yes | 2 | 0.076923 | 2 | 0 |
6cd520631ed499d5d1201f1398a3493014d83c74 | parity-net/src/main/java/org/jvirtanen/parity/net/poe/POEServerParser.java | parity-net/src/main/java/org/jvirtanen/parity/net/poe/POEServerParser.java | package org.jvirtanen.parity.net.poe;
import static org.jvirtanen.parity.net.poe.POE.*;
import com.paritytrading.nassau.MessageListener;
import java.io.IOException;
import java.nio.ByteBuffer;
/**
* A parser for inbound messages on the server side.
*/
public class POEServerParser implements MessageListener {
private EnterOrder enterOrder;
private CancelOrder cancelOrder;
private POEServerListener listener;
/**
* Create a parser for inbound messages on the server side.
*
* @param listener the message listener
*/
public POEServerParser(POEServerListener listener) {
this.enterOrder = new EnterOrder();
this.cancelOrder = new CancelOrder();
this.listener = listener;
}
@Override
public void message(ByteBuffer buffer) throws IOException {
byte messageType = buffer.get();
switch (messageType) {
case MESSAGE_TYPE_ENTER_ORDER:
enterOrder(buffer);
break;
case MESSAGE_TYPE_CANCEL_ORDER:
cancelOrder(buffer);
break;
default:
throw new POEException("Unknown message type: " + (char)messageType);
}
}
private void enterOrder(ByteBuffer buffer) throws IOException {
enterOrder.get(buffer);
listener.enterOrder(enterOrder);
}
private void cancelOrder(ByteBuffer buffer) throws IOException {
cancelOrder.get(buffer);
listener.cancelOrder(cancelOrder);
}
}
| package org.jvirtanen.parity.net.poe;
import static org.jvirtanen.parity.net.poe.POE.*;
import com.paritytrading.nassau.MessageListener;
import java.io.IOException;
import java.nio.ByteBuffer;
/**
* A parser for inbound messages on the server side.
*/
public class POEServerParser implements MessageListener {
private EnterOrder enterOrder;
private CancelOrder cancelOrder;
private POEServerListener listener;
/**
* Create a parser for inbound messages on the server side.
*
* @param listener the message listener
*/
public POEServerParser(POEServerListener listener) {
this.enterOrder = new EnterOrder();
this.cancelOrder = new CancelOrder();
this.listener = listener;
}
@Override
public void message(ByteBuffer buffer) throws IOException {
byte messageType = buffer.get();
switch (messageType) {
case MESSAGE_TYPE_ENTER_ORDER:
enterOrder.get(buffer);
listener.enterOrder(enterOrder);
break;
case MESSAGE_TYPE_CANCEL_ORDER:
cancelOrder.get(buffer);
listener.cancelOrder(cancelOrder);
break;
default:
throw new POEException("Unknown message type: " + (char)messageType);
}
}
}
| Simplify POE server parser in network protocols | Simplify POE server parser in network protocols
| Java | apache-2.0 | pmcs/parity,paritytrading/parity,pmcs/parity,paritytrading/parity | java | ## Code Before:
package org.jvirtanen.parity.net.poe;
import static org.jvirtanen.parity.net.poe.POE.*;
import com.paritytrading.nassau.MessageListener;
import java.io.IOException;
import java.nio.ByteBuffer;
/**
* A parser for inbound messages on the server side.
*/
public class POEServerParser implements MessageListener {
private EnterOrder enterOrder;
private CancelOrder cancelOrder;
private POEServerListener listener;
/**
* Create a parser for inbound messages on the server side.
*
* @param listener the message listener
*/
public POEServerParser(POEServerListener listener) {
this.enterOrder = new EnterOrder();
this.cancelOrder = new CancelOrder();
this.listener = listener;
}
@Override
public void message(ByteBuffer buffer) throws IOException {
byte messageType = buffer.get();
switch (messageType) {
case MESSAGE_TYPE_ENTER_ORDER:
enterOrder(buffer);
break;
case MESSAGE_TYPE_CANCEL_ORDER:
cancelOrder(buffer);
break;
default:
throw new POEException("Unknown message type: " + (char)messageType);
}
}
private void enterOrder(ByteBuffer buffer) throws IOException {
enterOrder.get(buffer);
listener.enterOrder(enterOrder);
}
private void cancelOrder(ByteBuffer buffer) throws IOException {
cancelOrder.get(buffer);
listener.cancelOrder(cancelOrder);
}
}
## Instruction:
Simplify POE server parser in network protocols
## Code After:
package org.jvirtanen.parity.net.poe;
import static org.jvirtanen.parity.net.poe.POE.*;
import com.paritytrading.nassau.MessageListener;
import java.io.IOException;
import java.nio.ByteBuffer;
/**
* A parser for inbound messages on the server side.
*/
public class POEServerParser implements MessageListener {
private EnterOrder enterOrder;
private CancelOrder cancelOrder;
private POEServerListener listener;
/**
* Create a parser for inbound messages on the server side.
*
* @param listener the message listener
*/
public POEServerParser(POEServerListener listener) {
this.enterOrder = new EnterOrder();
this.cancelOrder = new CancelOrder();
this.listener = listener;
}
@Override
public void message(ByteBuffer buffer) throws IOException {
byte messageType = buffer.get();
switch (messageType) {
case MESSAGE_TYPE_ENTER_ORDER:
enterOrder.get(buffer);
listener.enterOrder(enterOrder);
break;
case MESSAGE_TYPE_CANCEL_ORDER:
cancelOrder.get(buffer);
listener.cancelOrder(cancelOrder);
break;
default:
throw new POEException("Unknown message type: " + (char)messageType);
}
}
}
| package org.jvirtanen.parity.net.poe;
import static org.jvirtanen.parity.net.poe.POE.*;
import com.paritytrading.nassau.MessageListener;
import java.io.IOException;
import java.nio.ByteBuffer;
/**
* A parser for inbound messages on the server side.
*/
public class POEServerParser implements MessageListener {
private EnterOrder enterOrder;
private CancelOrder cancelOrder;
private POEServerListener listener;
/**
* Create a parser for inbound messages on the server side.
*
* @param listener the message listener
*/
public POEServerParser(POEServerListener listener) {
this.enterOrder = new EnterOrder();
this.cancelOrder = new CancelOrder();
this.listener = listener;
}
@Override
public void message(ByteBuffer buffer) throws IOException {
byte messageType = buffer.get();
switch (messageType) {
case MESSAGE_TYPE_ENTER_ORDER:
- enterOrder(buffer);
+ enterOrder.get(buffer);
? ++++
+ listener.enterOrder(enterOrder);
break;
case MESSAGE_TYPE_CANCEL_ORDER:
- cancelOrder(buffer);
+ cancelOrder.get(buffer);
? ++++
+ listener.cancelOrder(cancelOrder);
break;
default:
throw new POEException("Unknown message type: " + (char)messageType);
}
}
- private void enterOrder(ByteBuffer buffer) throws IOException {
- enterOrder.get(buffer);
-
- listener.enterOrder(enterOrder);
- }
-
- private void cancelOrder(ByteBuffer buffer) throws IOException {
- cancelOrder.get(buffer);
-
- listener.cancelOrder(cancelOrder);
- }
-
} | 18 | 0.305085 | 4 | 14 |
6f56c1c6993560838832f6802c61e1b59ed9b5bb | Sources/UUID/CMakeLists.txt | Sources/UUID/CMakeLists.txt | add_library(uuid STATIC
uuid.h
uuid.c)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_compile_definitions(uuid PRIVATE
_CRT_NONSTDC_NO_WARNINGS
_CRT_SECURE_NO_DEPRECATE
_CRT_SECURE_NO_WARNINGS)
endif()
# Add an include directory for the CoreFoundation framework headers to satisfy
# the dependency on TargetConditionals.h
add_dependencies(uuid CoreFoundation)
target_include_directories(uuid PUBLIC
${CMAKE_BINARY_DIR}/CoreFoundation.framework/Headers)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_link_libraries(uuid PRIVATE Bcrypt)
endif()
set_target_properties(uuid PROPERTIES
POSITION_INDEPENDENT_CODE YES)
if(NOT BUILD_SHARED_LIBS)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS uuid)
endif()
| add_library(uuid STATIC
uuid.h
uuid.c)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_compile_definitions(uuid PRIVATE
_CRT_NONSTDC_NO_WARNINGS
_CRT_SECURE_NO_DEPRECATE
_CRT_SECURE_NO_WARNINGS)
endif()
# Add an include directory for the CoreFoundation framework headers to satisfy
# the dependency on TargetConditionals.h
add_dependencies(uuid CoreFoundation)
target_include_directories(uuid PUBLIC
${CMAKE_BINARY_DIR}/CoreFoundation.framework/Headers)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_link_libraries(uuid PRIVATE Bcrypt)
endif()
set_target_properties(uuid PROPERTIES
POSITION_INDEPENDENT_CODE YES)
if(NOT BUILD_SHARED_LIBS)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS uuid)
get_swift_host_arch(swift_arch)
install(TARGETS uuid
ARCHIVE DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch}
LIBRARY DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch}
RUNTIME DESTINATION bin)
endif()
| Install uuid when statically building Foundation | Install uuid when statically building Foundation
| Text | apache-2.0 | apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation | text | ## Code Before:
add_library(uuid STATIC
uuid.h
uuid.c)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_compile_definitions(uuid PRIVATE
_CRT_NONSTDC_NO_WARNINGS
_CRT_SECURE_NO_DEPRECATE
_CRT_SECURE_NO_WARNINGS)
endif()
# Add an include directory for the CoreFoundation framework headers to satisfy
# the dependency on TargetConditionals.h
add_dependencies(uuid CoreFoundation)
target_include_directories(uuid PUBLIC
${CMAKE_BINARY_DIR}/CoreFoundation.framework/Headers)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_link_libraries(uuid PRIVATE Bcrypt)
endif()
set_target_properties(uuid PROPERTIES
POSITION_INDEPENDENT_CODE YES)
if(NOT BUILD_SHARED_LIBS)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS uuid)
endif()
## Instruction:
Install uuid when statically building Foundation
## Code After:
add_library(uuid STATIC
uuid.h
uuid.c)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_compile_definitions(uuid PRIVATE
_CRT_NONSTDC_NO_WARNINGS
_CRT_SECURE_NO_DEPRECATE
_CRT_SECURE_NO_WARNINGS)
endif()
# Add an include directory for the CoreFoundation framework headers to satisfy
# the dependency on TargetConditionals.h
add_dependencies(uuid CoreFoundation)
target_include_directories(uuid PUBLIC
${CMAKE_BINARY_DIR}/CoreFoundation.framework/Headers)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_link_libraries(uuid PRIVATE Bcrypt)
endif()
set_target_properties(uuid PROPERTIES
POSITION_INDEPENDENT_CODE YES)
if(NOT BUILD_SHARED_LIBS)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS uuid)
get_swift_host_arch(swift_arch)
install(TARGETS uuid
ARCHIVE DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch}
LIBRARY DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch}
RUNTIME DESTINATION bin)
endif()
| add_library(uuid STATIC
uuid.h
uuid.c)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_compile_definitions(uuid PRIVATE
_CRT_NONSTDC_NO_WARNINGS
_CRT_SECURE_NO_DEPRECATE
_CRT_SECURE_NO_WARNINGS)
endif()
# Add an include directory for the CoreFoundation framework headers to satisfy
# the dependency on TargetConditionals.h
add_dependencies(uuid CoreFoundation)
target_include_directories(uuid PUBLIC
${CMAKE_BINARY_DIR}/CoreFoundation.framework/Headers)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
target_link_libraries(uuid PRIVATE Bcrypt)
endif()
set_target_properties(uuid PROPERTIES
POSITION_INDEPENDENT_CODE YES)
if(NOT BUILD_SHARED_LIBS)
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS uuid)
+
+ get_swift_host_arch(swift_arch)
+ install(TARGETS uuid
+ ARCHIVE DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch}
+ LIBRARY DESTINATION lib/swift_static/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch}
+ RUNTIME DESTINATION bin)
endif() | 6 | 0.24 | 6 | 0 |
fe95b4e4dabca469944620c2fc4662e9ac47ab16 | reactiveandroid-support-v4/src/main/kotlin/com/github/kittinunf/reactiveandroid/support/v4/widget/SwipeRefreshLayoutAction.kt | reactiveandroid-support-v4/src/main/kotlin/com/github/kittinunf/reactiveandroid/support/v4/widget/SwipeRefreshLayoutAction.kt | package com.github.kittinunf.reactiveandroid.support.v4.widget
import android.support.v4.widget.SwipeRefreshLayout
import com.github.kittinunf.reactiveandroid.Action
import com.github.kittinunf.reactiveandroid.rx.addTo
import com.github.kittinunf.reactiveandroid.rx.bindTo
import rx.Subscription
import rx.subscriptions.CompositeSubscription
fun SwipeRefreshLayout.rx_applyAction(action: Action<Unit, *>): Subscription {
val subscriptions = CompositeSubscription()
rx_refreshing.bindTo(action.enabled).addTo(subscriptions)
rx_refresh().map { Unit }.bindTo(action, Action<Unit, *>::execute).addTo(subscriptions)
return subscriptions
}
| package com.github.kittinunf.reactiveandroid.support.v4.widget
import android.support.v4.widget.SwipeRefreshLayout
import com.github.kittinunf.reactiveandroid.Action
import com.github.kittinunf.reactiveandroid.rx.addTo
import com.github.kittinunf.reactiveandroid.rx.bindTo
import rx.Subscription
import rx.subscriptions.CompositeSubscription
fun SwipeRefreshLayout.rx_applyAction(action: Action<Unit, *>): Subscription {
val subscriptions = CompositeSubscription()
rx_refreshing.bindTo(action.executing).addTo(subscriptions)
rx_refresh().map { Unit }.bindTo(action, Action<Unit, *>::execute).addTo(subscriptions)
return subscriptions
}
| Fix bugs in refresh layout | Fix bugs in refresh layout
| Kotlin | mit | kittinunf/ReactiveAndroid,kittinunf/ReactiveAndroid,kittinunf/ReactiveAndroid | kotlin | ## Code Before:
package com.github.kittinunf.reactiveandroid.support.v4.widget
import android.support.v4.widget.SwipeRefreshLayout
import com.github.kittinunf.reactiveandroid.Action
import com.github.kittinunf.reactiveandroid.rx.addTo
import com.github.kittinunf.reactiveandroid.rx.bindTo
import rx.Subscription
import rx.subscriptions.CompositeSubscription
fun SwipeRefreshLayout.rx_applyAction(action: Action<Unit, *>): Subscription {
val subscriptions = CompositeSubscription()
rx_refreshing.bindTo(action.enabled).addTo(subscriptions)
rx_refresh().map { Unit }.bindTo(action, Action<Unit, *>::execute).addTo(subscriptions)
return subscriptions
}
## Instruction:
Fix bugs in refresh layout
## Code After:
package com.github.kittinunf.reactiveandroid.support.v4.widget
import android.support.v4.widget.SwipeRefreshLayout
import com.github.kittinunf.reactiveandroid.Action
import com.github.kittinunf.reactiveandroid.rx.addTo
import com.github.kittinunf.reactiveandroid.rx.bindTo
import rx.Subscription
import rx.subscriptions.CompositeSubscription
fun SwipeRefreshLayout.rx_applyAction(action: Action<Unit, *>): Subscription {
val subscriptions = CompositeSubscription()
rx_refreshing.bindTo(action.executing).addTo(subscriptions)
rx_refresh().map { Unit }.bindTo(action, Action<Unit, *>::execute).addTo(subscriptions)
return subscriptions
}
| package com.github.kittinunf.reactiveandroid.support.v4.widget
import android.support.v4.widget.SwipeRefreshLayout
import com.github.kittinunf.reactiveandroid.Action
import com.github.kittinunf.reactiveandroid.rx.addTo
import com.github.kittinunf.reactiveandroid.rx.bindTo
import rx.Subscription
import rx.subscriptions.CompositeSubscription
fun SwipeRefreshLayout.rx_applyAction(action: Action<Unit, *>): Subscription {
val subscriptions = CompositeSubscription()
- rx_refreshing.bindTo(action.enabled).addTo(subscriptions)
? ^^^^^
+ rx_refreshing.bindTo(action.executing).addTo(subscriptions)
? ++++++ ^
rx_refresh().map { Unit }.bindTo(action, Action<Unit, *>::execute).addTo(subscriptions)
return subscriptions
}
-
- | 4 | 0.235294 | 1 | 3 |
d0f21c62a13e9c80108394081196609ccbc8338b | lib/rip/parsers/block_expression.rb | lib/rip/parsers/block_expression.rb | require 'parslet'
require 'rip'
require 'rip/parsers/helpers'
module Rip::Parsers
module BlockExpression
include Parslet
include Rip::Parsers::Helpers
rule(:block_expression) { condition | loop_block | exception_handling }
rule(:block) { surround_with('{', statements.as(:body), '}') }
end
end
| require 'parslet'
require 'rip'
require 'rip/parsers/helpers'
module Rip::Parsers
module BlockExpression
include Parslet
include Rip::Parsers::Helpers
rule(:block_expression) { condition | loop_block | exception_handling }
def block(body = statements)
surround_with('{', body.as(:body), '}')
end
end
end
| Refactor block rule to allow custom body | Refactor block rule to allow custom body
| Ruby | mit | rip-lang/rip,rip-lang/rip | ruby | ## Code Before:
require 'parslet'
require 'rip'
require 'rip/parsers/helpers'
module Rip::Parsers
module BlockExpression
include Parslet
include Rip::Parsers::Helpers
rule(:block_expression) { condition | loop_block | exception_handling }
rule(:block) { surround_with('{', statements.as(:body), '}') }
end
end
## Instruction:
Refactor block rule to allow custom body
## Code After:
require 'parslet'
require 'rip'
require 'rip/parsers/helpers'
module Rip::Parsers
module BlockExpression
include Parslet
include Rip::Parsers::Helpers
rule(:block_expression) { condition | loop_block | exception_handling }
def block(body = statements)
surround_with('{', body.as(:body), '}')
end
end
end
| require 'parslet'
require 'rip'
require 'rip/parsers/helpers'
module Rip::Parsers
module BlockExpression
include Parslet
include Rip::Parsers::Helpers
rule(:block_expression) { condition | loop_block | exception_handling }
- rule(:block) { surround_with('{', statements.as(:body), '}') }
+ def block(body = statements)
+ surround_with('{', body.as(:body), '}')
+ end
end
end | 4 | 0.266667 | 3 | 1 |
540273ac75880925934e69275c9da1de61fbd699 | PyBingWallpaper.py | PyBingWallpaper.py |
import win32gui
from urllib.request import urlopen, urlretrieve
from xml.dom import minidom
from PIL import Image
import os
#Variables:
saveDir = 'C:\BingWallPaper\\'
i = 0
while i<1:
try:
usock = urlopen('http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=zh-CN')
except:
i = 0
else:
i = 1
xmldoc = minidom.parse(usock)
num = 1
#Parsing the XML File
for element in xmldoc.getElementsByTagName('url'):
url = 'http://www.bing.com' + element.firstChild.nodeValue
#Get Current Date as fileName for the downloaded Picture
picPath = saveDir + 'bingwallpaper' + '%d'%num + '.jpg'
urlretrieve(url, picPath)
#Convert Image
picData = Image.open(picPath)
picData.save(picPath.replace('jpg','bmp'))
picPath = picPath.replace('jpg','bmp')
num = num+1
#Set Wallpaper:
win32gui.SystemParametersInfo(0x0014, picPath, 1+2)
|
import win32gui
from urllib.request import urlopen, urlretrieve
from xml.dom import minidom
from PIL import Image
import os
if __name__=="__main__":
#Variables:
saveDir = "C:\\BingWallPaper\\"
if (not os.path.exists(saveDir)):
os.mkdir(saveDir)
i = 0
while i<1:
try:
usock = urlopen('http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=zh-CN')
except:
i = 0
else:
i = 1
xmldoc = minidom.parse(usock)
num = 1
#Parsing the XML File
for element in xmldoc.getElementsByTagName('url'):
url = 'http://www.bing.com' + element.firstChild.nodeValue
#Get Current Date as fileName for the downloaded Picture
picPath = saveDir + 'bingwallpaper' + '%d'%num + '.jpg'
urlretrieve(url, picPath)
#Convert Image
picData = Image.open(picPath)
picData.save(picPath.replace('jpg','bmp'))
picPath = picPath.replace('jpg','bmp')
num = num+1
#Set Wallpaper:
win32gui.SystemParametersInfo(0x0014, picPath, 1+2)
| Create directory in case not exist | Create directory in case not exist | Python | mit | adamadanandy/PyBingWallpaper | python | ## Code Before:
import win32gui
from urllib.request import urlopen, urlretrieve
from xml.dom import minidom
from PIL import Image
import os
#Variables:
saveDir = 'C:\BingWallPaper\\'
i = 0
while i<1:
try:
usock = urlopen('http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=zh-CN')
except:
i = 0
else:
i = 1
xmldoc = minidom.parse(usock)
num = 1
#Parsing the XML File
for element in xmldoc.getElementsByTagName('url'):
url = 'http://www.bing.com' + element.firstChild.nodeValue
#Get Current Date as fileName for the downloaded Picture
picPath = saveDir + 'bingwallpaper' + '%d'%num + '.jpg'
urlretrieve(url, picPath)
#Convert Image
picData = Image.open(picPath)
picData.save(picPath.replace('jpg','bmp'))
picPath = picPath.replace('jpg','bmp')
num = num+1
#Set Wallpaper:
win32gui.SystemParametersInfo(0x0014, picPath, 1+2)
## Instruction:
Create directory in case not exist
## Code After:
import win32gui
from urllib.request import urlopen, urlretrieve
from xml.dom import minidom
from PIL import Image
import os
if __name__=="__main__":
#Variables:
saveDir = "C:\\BingWallPaper\\"
if (not os.path.exists(saveDir)):
os.mkdir(saveDir)
i = 0
while i<1:
try:
usock = urlopen('http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=zh-CN')
except:
i = 0
else:
i = 1
xmldoc = minidom.parse(usock)
num = 1
#Parsing the XML File
for element in xmldoc.getElementsByTagName('url'):
url = 'http://www.bing.com' + element.firstChild.nodeValue
#Get Current Date as fileName for the downloaded Picture
picPath = saveDir + 'bingwallpaper' + '%d'%num + '.jpg'
urlretrieve(url, picPath)
#Convert Image
picData = Image.open(picPath)
picData.save(picPath.replace('jpg','bmp'))
picPath = picPath.replace('jpg','bmp')
num = num+1
#Set Wallpaper:
win32gui.SystemParametersInfo(0x0014, picPath, 1+2)
|
import win32gui
from urllib.request import urlopen, urlretrieve
from xml.dom import minidom
from PIL import Image
import os
-
+ if __name__=="__main__":
- #Variables:
+ #Variables:
? ++++
- saveDir = 'C:\BingWallPaper\\'
? ^ ^
+ saveDir = "C:\\BingWallPaper\\"
? ++++ ^ + ^
- i = 0
+
+ if (not os.path.exists(saveDir)):
+ os.mkdir(saveDir)
+
+ i = 0
- while i<1:
+ while i<1:
? ++++
- try:
+ try:
? ++++
- usock = urlopen('http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=zh-CN')
+ usock = urlopen('http://www.bing.com/HPImageArchive.aspx?format=xml&idx=0&n=1&mkt=zh-CN')
? ++++
- except:
+ except:
? ++++
- i = 0
+ i = 0
? ++++
- else:
+ else:
? ++++
- i = 1
+ i = 1
? ++++
- xmldoc = minidom.parse(usock)
+ xmldoc = minidom.parse(usock)
? ++++
- num = 1
+ num = 1
? ++++
+
- #Parsing the XML File
+ #Parsing the XML File
? ++++
- for element in xmldoc.getElementsByTagName('url'):
+ for element in xmldoc.getElementsByTagName('url'):
? ++++
- url = 'http://www.bing.com' + element.firstChild.nodeValue
+ url = 'http://www.bing.com' + element.firstChild.nodeValue
? ++++
-
+
- #Get Current Date as fileName for the downloaded Picture
+ #Get Current Date as fileName for the downloaded Picture
? ++++
- picPath = saveDir + 'bingwallpaper' + '%d'%num + '.jpg'
+ picPath = saveDir + 'bingwallpaper' + '%d'%num + '.jpg'
? ++++
- urlretrieve(url, picPath)
+ urlretrieve(url, picPath)
? ++++
- #Convert Image
+ #Convert Image
? ++++
- picData = Image.open(picPath)
+ picData = Image.open(picPath)
? ++++
- picData.save(picPath.replace('jpg','bmp'))
+ picData.save(picPath.replace('jpg','bmp'))
? ++++
- picPath = picPath.replace('jpg','bmp')
+ picPath = picPath.replace('jpg','bmp')
? ++++
- num = num+1
+ num = num+1
? ++++
- #Set Wallpaper:
+ #Set Wallpaper:
? ++++
- win32gui.SystemParametersInfo(0x0014, picPath, 1+2)
+ win32gui.SystemParametersInfo(0x0014, picPath, 1+2)
? ++++
| 59 | 1.735294 | 32 | 27 |
1bb0f972bd282999a510729ee3658bc7ce330762 | recipes/install.rb | recipes/install.rb | install = node['remote_syslog2']['install']
bin_file = "#{install['bin_path']}/#{install['bin']}"
remote_file install['download_path'] do
source install['download_file']
mode '0644'
not_if { ::File.exists?(bin_file) }
end
bash 'extract_module' do
cwd '/tmp'
code <<-EOH
mkdir -p #{install['extracted_path']}
tar xzf #{install['download_path']} -C #{install['extract_path']}
mv #{install['extracted_path']}/#{install['extracted_bin']} #{bin_file}
EOH
not_if { ::File.exists?(bin_file) }
end
file bin_file do
user 'root'
group 'root'
mode 0755
end | install = node['remote_syslog2']['install']
bin_file = "#{install['bin_path']}/#{install['bin']}"
remote_file install['download_path'] do
source install['download_file']
mode '0644'
not_if { ::File.exists?(bin_file) }
end
bash 'extract remote_syslog2' do
cwd '/tmp'
code <<-EOH
mkdir -p #{install['extracted_path']}
tar xzf #{install['download_path']} -C #{install['extract_path']}
mv #{install['extracted_path']}/#{install['extracted_bin']} #{bin_file}
EOH
not_if { ::File.exists?(bin_file) }
end
file bin_file do
user 'root'
group 'root'
mode 0755
end | Update extract resource name so it's less generic | Update extract resource name so it's less generic
| Ruby | apache-2.0 | jayceeb/remote_syslog2-cookbook,trappar/remote_syslog2-cookbook,trappar/remote_syslog2-cookbook,derby-developers/remote_syslog2-cookbook,jayceeb/remote_syslog2-cookbook,derby-developers/remote_syslog2-cookbook | ruby | ## Code Before:
install = node['remote_syslog2']['install']
bin_file = "#{install['bin_path']}/#{install['bin']}"
remote_file install['download_path'] do
source install['download_file']
mode '0644'
not_if { ::File.exists?(bin_file) }
end
bash 'extract_module' do
cwd '/tmp'
code <<-EOH
mkdir -p #{install['extracted_path']}
tar xzf #{install['download_path']} -C #{install['extract_path']}
mv #{install['extracted_path']}/#{install['extracted_bin']} #{bin_file}
EOH
not_if { ::File.exists?(bin_file) }
end
file bin_file do
user 'root'
group 'root'
mode 0755
end
## Instruction:
Update extract resource name so it's less generic
## Code After:
install = node['remote_syslog2']['install']
bin_file = "#{install['bin_path']}/#{install['bin']}"
remote_file install['download_path'] do
source install['download_file']
mode '0644'
not_if { ::File.exists?(bin_file) }
end
bash 'extract remote_syslog2' do
cwd '/tmp'
code <<-EOH
mkdir -p #{install['extracted_path']}
tar xzf #{install['download_path']} -C #{install['extract_path']}
mv #{install['extracted_path']}/#{install['extracted_bin']} #{bin_file}
EOH
not_if { ::File.exists?(bin_file) }
end
file bin_file do
user 'root'
group 'root'
mode 0755
end | install = node['remote_syslog2']['install']
bin_file = "#{install['bin_path']}/#{install['bin']}"
remote_file install['download_path'] do
source install['download_file']
mode '0644'
not_if { ::File.exists?(bin_file) }
end
- bash 'extract_module' do
+ bash 'extract remote_syslog2' do
cwd '/tmp'
code <<-EOH
mkdir -p #{install['extracted_path']}
tar xzf #{install['download_path']} -C #{install['extract_path']}
mv #{install['extracted_path']}/#{install['extracted_bin']} #{bin_file}
EOH
not_if { ::File.exists?(bin_file) }
end
file bin_file do
user 'root'
group 'root'
mode 0755
end | 2 | 0.083333 | 1 | 1 |
aa49cfaf731f36bb7af1a261b1fb0bd7f652a717 | src/Handler.php | src/Handler.php | <?php
namespace Bolt;
use Bolt\Api\Response;
class Handler
{
public static function error($level, $message, $file, $line, $context)
{
throw new Exceptions\Error($message, 0, $level, $file, $line);
}
public static function exception($exception)
{
$className = get_class($exception);
$type = $className;
if ($exception instanceof Exception)
{
$type .= "::" . $exception->getCodeKey();
}
if (DEPLOYMENT === Deployment::PRODUCTION)
{
$data = $type;
}
else
{
$data = array(
"type" => $type,
"message" => $exception->getMessage(),
"code" => $exception->getCode(),
"line" => $exception->getLine(),
"file" => $exception->getFile(),
"trace" => $exception->getTrace()
);
}
if (php_sapi_name() == "cli")
{
if (!is_string($data))
{
$data = json_encode($data, JSON_PRETTY_PRINT);
}
echo($data . "\n");
}
else
{
$response = new Response();
$response->status(500, $data);
}
return true;
}
}
?>
| <?php
namespace Bolt;
use Bolt\Api\Response;
use Bolt\Exceptions\Output;
class Handler
{
public static function error($level, $message, $file, $line, $context)
{
throw new Exceptions\Error($message, 0, $level, $file, $line);
}
public static function exception($exception)
{
$className = get_class($exception);
$type = $className;
if ($exception instanceof Exception)
{
$type .= "::" . $exception->getCodeKey();
}
if ($exception instanceof Output)
{
$data = $exception->getMessage();
}
elseif (DEPLOYMENT === Deployment::PRODUCTION)
{
$data = $type;
}
else
{
$data = array(
"type" => $type,
"message" => $exception->getMessage(),
"code" => $exception->getCode(),
"line" => $exception->getLine(),
"file" => $exception->getFile(),
"trace" => $exception->getTrace()
);
}
if (php_sapi_name() == "cli")
{
if (!is_string($data))
{
$data = json_encode($data, JSON_PRETTY_PRINT);
}
echo($data . "\n");
}
else
{
$response = new Response();
$response->status(500, $data);
}
return true;
}
}
?>
| Update handler to output api response with Output exceptions | Update handler to output api response with Output exceptions
| PHP | apache-2.0 | irwtdvoys/bolt-api | php | ## Code Before:
<?php
namespace Bolt;
use Bolt\Api\Response;
class Handler
{
public static function error($level, $message, $file, $line, $context)
{
throw new Exceptions\Error($message, 0, $level, $file, $line);
}
public static function exception($exception)
{
$className = get_class($exception);
$type = $className;
if ($exception instanceof Exception)
{
$type .= "::" . $exception->getCodeKey();
}
if (DEPLOYMENT === Deployment::PRODUCTION)
{
$data = $type;
}
else
{
$data = array(
"type" => $type,
"message" => $exception->getMessage(),
"code" => $exception->getCode(),
"line" => $exception->getLine(),
"file" => $exception->getFile(),
"trace" => $exception->getTrace()
);
}
if (php_sapi_name() == "cli")
{
if (!is_string($data))
{
$data = json_encode($data, JSON_PRETTY_PRINT);
}
echo($data . "\n");
}
else
{
$response = new Response();
$response->status(500, $data);
}
return true;
}
}
?>
## Instruction:
Update handler to output api response with Output exceptions
## Code After:
<?php
namespace Bolt;
use Bolt\Api\Response;
use Bolt\Exceptions\Output;
class Handler
{
public static function error($level, $message, $file, $line, $context)
{
throw new Exceptions\Error($message, 0, $level, $file, $line);
}
public static function exception($exception)
{
$className = get_class($exception);
$type = $className;
if ($exception instanceof Exception)
{
$type .= "::" . $exception->getCodeKey();
}
if ($exception instanceof Output)
{
$data = $exception->getMessage();
}
elseif (DEPLOYMENT === Deployment::PRODUCTION)
{
$data = $type;
}
else
{
$data = array(
"type" => $type,
"message" => $exception->getMessage(),
"code" => $exception->getCode(),
"line" => $exception->getLine(),
"file" => $exception->getFile(),
"trace" => $exception->getTrace()
);
}
if (php_sapi_name() == "cli")
{
if (!is_string($data))
{
$data = json_encode($data, JSON_PRETTY_PRINT);
}
echo($data . "\n");
}
else
{
$response = new Response();
$response->status(500, $data);
}
return true;
}
}
?>
| <?php
namespace Bolt;
use Bolt\Api\Response;
+ use Bolt\Exceptions\Output;
class Handler
{
public static function error($level, $message, $file, $line, $context)
{
throw new Exceptions\Error($message, 0, $level, $file, $line);
}
public static function exception($exception)
{
$className = get_class($exception);
$type = $className;
if ($exception instanceof Exception)
{
$type .= "::" . $exception->getCodeKey();
}
+ if ($exception instanceof Output)
+ {
+ $data = $exception->getMessage();
+ }
- if (DEPLOYMENT === Deployment::PRODUCTION)
+ elseif (DEPLOYMENT === Deployment::PRODUCTION)
? ++++
{
$data = $type;
}
else
{
$data = array(
"type" => $type,
"message" => $exception->getMessage(),
"code" => $exception->getCode(),
"line" => $exception->getLine(),
"file" => $exception->getFile(),
"trace" => $exception->getTrace()
);
}
if (php_sapi_name() == "cli")
{
if (!is_string($data))
{
$data = json_encode($data, JSON_PRETTY_PRINT);
}
echo($data . "\n");
}
else
{
$response = new Response();
$response->status(500, $data);
}
return true;
}
}
?> | 7 | 0.12069 | 6 | 1 |
eb2b91d30244fd44b45ffc21b963256150b59152 | frappe/patches/v11_0/reload_and_rename_view_log.py | frappe/patches/v11_0/reload_and_rename_view_log.py | import frappe
def execute():
if frappe.db.exists('DocType', 'View log'):
frappe.reload_doc('core', 'doctype', 'view_log', force=True)
frappe.db.sql("INSERT INTO `tabView Log` SELECT * from `tabView log`")
frappe.delete_doc('DocType', 'View log')
frappe.reload_doc('core', 'doctype', 'view_log', force=True)
else:
frappe.reload_doc('core', 'doctype', 'view_log')
| import frappe
def execute():
if frappe.db.exists('DocType', 'View log'):
# for mac users direct renaming would not work since mysql for mac saves table name in lower case
# so while renaming `tabView log` to `tabView Log` we get "Table 'tabView Log' already exists" error
# more info https://stackoverflow.com/a/44753093/5955589 ,
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names
# here we are creating a temp table to store view log data
frappe.db.sql("CREATE TABLE `ViewLogTemp` AS SELECT * FROM `tabView log`")
# deleting old View log table
frappe.db.sql("DROP table `tabView log`")
frappe.delete_doc('DocType', 'View log')
# reloading view log doctype to create `tabView Log` table
frappe.reload_doc('core', 'doctype', 'view_log')
frappe.db.commit()
# Move the data to newly created `tabView Log` table
frappe.db.sql("INSERT INTO `tabView Log` SELECT * FROM `ViewLogTemp`")
# Delete temporary table
frappe.db.sql("DROP table `ViewLogTemp`")
else:
frappe.reload_doc('core', 'doctype', 'view_log')
| Fix rename view log patch for mac users | Fix rename view log patch for mac users
for mac users direct renaming would not work
since mysql for mac saves table name in lower case,
so while renaming `tabView log` to `tabView Log` we get
"Table 'tabView Log' already exists" error
# more info https://stackoverflow.com/a/44753093/5955589
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names
| Python | mit | mhbu50/frappe,yashodhank/frappe,vjFaLk/frappe,adityahase/frappe,mhbu50/frappe,almeidapaulopt/frappe,saurabh6790/frappe,adityahase/frappe,vjFaLk/frappe,yashodhank/frappe,saurabh6790/frappe,frappe/frappe,frappe/frappe,vjFaLk/frappe,yashodhank/frappe,almeidapaulopt/frappe,almeidapaulopt/frappe,StrellaGroup/frappe,mhbu50/frappe,StrellaGroup/frappe,yashodhank/frappe,vjFaLk/frappe,mhbu50/frappe,adityahase/frappe,StrellaGroup/frappe,almeidapaulopt/frappe,saurabh6790/frappe,frappe/frappe,saurabh6790/frappe,adityahase/frappe | python | ## Code Before:
import frappe
def execute():
if frappe.db.exists('DocType', 'View log'):
frappe.reload_doc('core', 'doctype', 'view_log', force=True)
frappe.db.sql("INSERT INTO `tabView Log` SELECT * from `tabView log`")
frappe.delete_doc('DocType', 'View log')
frappe.reload_doc('core', 'doctype', 'view_log', force=True)
else:
frappe.reload_doc('core', 'doctype', 'view_log')
## Instruction:
Fix rename view log patch for mac users
for mac users direct renaming would not work
since mysql for mac saves table name in lower case,
so while renaming `tabView log` to `tabView Log` we get
"Table 'tabView Log' already exists" error
# more info https://stackoverflow.com/a/44753093/5955589
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names
## Code After:
import frappe
def execute():
if frappe.db.exists('DocType', 'View log'):
# for mac users direct renaming would not work since mysql for mac saves table name in lower case
# so while renaming `tabView log` to `tabView Log` we get "Table 'tabView Log' already exists" error
# more info https://stackoverflow.com/a/44753093/5955589 ,
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names
# here we are creating a temp table to store view log data
frappe.db.sql("CREATE TABLE `ViewLogTemp` AS SELECT * FROM `tabView log`")
# deleting old View log table
frappe.db.sql("DROP table `tabView log`")
frappe.delete_doc('DocType', 'View log')
# reloading view log doctype to create `tabView Log` table
frappe.reload_doc('core', 'doctype', 'view_log')
frappe.db.commit()
# Move the data to newly created `tabView Log` table
frappe.db.sql("INSERT INTO `tabView Log` SELECT * FROM `ViewLogTemp`")
# Delete temporary table
frappe.db.sql("DROP table `ViewLogTemp`")
else:
frappe.reload_doc('core', 'doctype', 'view_log')
| import frappe
def execute():
if frappe.db.exists('DocType', 'View log'):
- frappe.reload_doc('core', 'doctype', 'view_log', force=True)
+ # for mac users direct renaming would not work since mysql for mac saves table name in lower case
+ # so while renaming `tabView log` to `tabView Log` we get "Table 'tabView Log' already exists" error
+ # more info https://stackoverflow.com/a/44753093/5955589 ,
+ # https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names
+
+ # here we are creating a temp table to store view log data
- frappe.db.sql("INSERT INTO `tabView Log` SELECT * from `tabView log`")
? ^^^ ^ -- ^ --- - ^^^^
+ frappe.db.sql("CREATE TABLE `ViewLogTemp` AS SELECT * FROM `tabView log`")
? ^^ ^ + ^^^^ ++++ +++ ^^^^
+
+ # deleting old View log table
+ frappe.db.sql("DROP table `tabView log`")
frappe.delete_doc('DocType', 'View log')
+
+ # reloading view log doctype to create `tabView Log` table
- frappe.reload_doc('core', 'doctype', 'view_log', force=True)
? ------------
+ frappe.reload_doc('core', 'doctype', 'view_log')
+ frappe.db.commit()
+
+ # Move the data to newly created `tabView Log` table
+ frappe.db.sql("INSERT INTO `tabView Log` SELECT * FROM `ViewLogTemp`")
+
+ # Delete temporary table
+ frappe.db.sql("DROP table `ViewLogTemp`")
else:
frappe.reload_doc('core', 'doctype', 'view_log') | 23 | 2.3 | 20 | 3 |
4844daa41bc653401f7863fa2296722b5f35525e | promo/app/models/spree/promotion/rules/item_total.rb | promo/app/models/spree/promotion/rules/item_total.rb | module Spree
class Promotion::Rules::ItemTotal < PromotionRule
preference :amount, :decimal, :default => 100.00
preference :operator, :string, :default => '>'
OPERATORS = ['gt', 'gte']
def eligible?(order, options = {})
item_total = order.line_items.map(&:amount).sum
item_total.send(preferred_operator == 'gte' ? :>= : :>, BigDecimal.new(preferred_amount.to_s))
end
end
end
| module Spree
class Promotion::Rules::ItemTotal < PromotionRule
preference :amount, :decimal, :default => 100.00
preference :operator, :string, :default => '>'
attr_accessible :preferred_amount, :preferred_operator
OPERATORS = ['gt', 'gte']
def eligible?(order, options = {})
item_total = order.line_items.map(&:amount).sum
item_total.send(preferred_operator == 'gte' ? :>= : :>, BigDecimal.new(preferred_amount.to_s))
end
end
end
| Add preferred_amount and preferred_operator to accessible attributes for item total | Add preferred_amount and preferred_operator to accessible attributes for item total
| Ruby | bsd-3-clause | forkata/solidus,omarsar/spree,kitwalker12/spree,Arpsara/solidus,urimikhli/spree,Machpowersystems/spree_mach,sliaquat/spree,firman/spree,jeffboulet/spree,assembledbrands/spree,volpejoaquin/spree,jeffboulet/spree,berkes/spree,jspizziri/spree,priyank-gupta/spree,forkata/solidus,watg/spree,fahidnasir/spree,JDutil/spree,azranel/spree,degica/spree,Nevensoft/spree,Antdesk/karpal-spree,tesserakt/clean_spree,jeffboulet/spree,Boomkat/spree,gautamsawhney/spree,TrialGuides/spree,patdec/spree,miyazawatomoka/spree,omarsar/spree,SadTreeFriends/spree,patdec/spree,dandanwei/spree,lsirivong/spree,volpejoaquin/spree,madetech/spree,Senjai/solidus,jimblesm/spree,woboinc/spree,bjornlinder/Spree,DynamoMTL/spree,DarkoP/spree,jordan-brough/solidus,Lostmyname/spree,Lostmyname/spree,JDutil/spree,brchristian/spree,shioyama/spree,Boomkat/spree,calvinl/spree,keatonrow/spree,project-eutopia/spree,surfdome/spree,tomash/spree,judaro13/spree-fork,edgward/spree,surfdome/spree,dandanwei/spree,odk211/spree,caiqinghua/spree,LBRapid/spree,gautamsawhney/spree,grzlus/spree,rakibulislam/spree,alvinjean/spree,Hawaiideveloper/shoppingcart,net2b/spree,azclick/spree,odk211/spree,Senjai/solidus,imella/spree,jordan-brough/solidus,forkata/solidus,Senjai/solidus,piousbox/spree,lsirivong/solidus,kewaunited/spree,dafontaine/spree,APohio/spree,raow/spree,jhawthorn/spree,shaywood2/spree,richardnuno/solidus,adaddeo/spree,caiqinghua/spree,miyazawatomoka/spree,zamiang/spree,quentinuys/spree,moneyspyder/spree,carlesjove/spree,lyzxsc/spree,forkata/solidus,lzcabrera/spree-1-3-stable,fahidnasir/spree,gregoryrikson/spree-sample,camelmasa/spree,lzcabrera/spree-1-3-stable,grzlus/solidus,robodisco/spree,rajeevriitm/spree,DarkoP/spree,moneyspyder/spree,Hates/spree,richardnuno/solidus,JDutil/spree,degica/spree,ramkumar-kr/spree,project-eutopia/spree,JuandGirald/spree,locomotivapro/spree,Migweld/spree,quentinuys/spree,reinaris/spree,builtbybuffalo/spree,CJMrozek/spree,pjmj777/spree,jaspreet21anand/spree,firman/spree,shaywood2/spree,shekibobo/spree,jsurdilla/solidus,FadliKun/spree,Antdesk/karpal-spree,NerdsvilleCEO/spree,thogg4/spree,camelmasa/spree,sunny2601/spree,zamiang/spree,patdec/spree,dafontaine/spree,sliaquat/spree,LBRapid/spree,pervino/spree,Hates/spree,orenf/spree,abhishekjain16/spree,gregoryrikson/spree-sample,jimblesm/spree,edgward/spree,alejandromangione/spree,zaeznet/spree,groundctrl/spree,adaddeo/spree,beni55/spree,jordan-brough/spree,LBRapid/spree,gautamsawhney/spree,athal7/solidus,dotandbo/spree,trigrass2/spree,JuandGirald/spree,softr8/spree,freerunningtech/spree,Arpsara/solidus,jordan-brough/solidus,thogg4/spree,SadTreeFriends/spree,CiscoCloud/spree,scottcrawford03/solidus,Machpowersystems/spree_mach,SadTreeFriends/spree,codesavvy/sandbox,jspizziri/spree,progsri/spree,KMikhaylovCTG/spree,jspizziri/spree,PhoenixTeam/spree_phoenix,calvinl/spree,Nevensoft/spree,JuandGirald/spree,knuepwebdev/FloatTubeRodHolders,zaeznet/spree,abhishekjain16/spree,raow/spree,orenf/spree,caiqinghua/spree,pulkit21/spree,trigrass2/spree,vinsol/spree,vcavallo/spree,Boomkat/spree,moneyspyder/spree,Ropeney/spree,karlitxo/spree,wolfieorama/spree,camelmasa/spree,progsri/spree,lsirivong/spree,volpejoaquin/spree,cutefrank/spree,piousbox/spree,sunny2601/spree,tesserakt/clean_spree,derekluo/spree,azranel/spree,welitonfreitas/spree,StemboltHQ/spree,groundctrl/spree,softr8/spree,yiqing95/spree,sliaquat/spree,alvinjean/spree,thogg4/spree,pervino/solidus,vcavallo/spree,tancnle/spree,tomash/spree,assembledbrands/spree,hoanghiep90/spree,dafontaine/spree,Mayvenn/spree,watg/spree,jasonfb/spree,sfcgeorge/spree,reidblomquist/spree,fahidnasir/spree,hifly/spree,TimurTarasenko/spree,Nevensoft/spree,archSeer/spree,dotandbo/spree,keatonrow/spree,hoanghiep90/spree,njerrywerry/spree,brchristian/spree,project-eutopia/spree,nooysters/spree,StemboltHQ/spree,rakibulislam/spree,useiichi/spree,tancnle/spree,builtbybuffalo/spree,athal7/solidus,jordan-brough/spree,archSeer/spree,TrialGuides/spree,codesavvy/sandbox,joanblake/spree,vcavallo/spree,bjornlinder/Spree,zamiang/spree,vinayvinsol/spree,DarkoP/spree,vulk/spree,pervino/solidus,beni55/spree,athal7/solidus,caiqinghua/spree,net2b/spree,maybii/spree,bonobos/solidus,degica/spree,Engeltj/spree,APohio/spree,berkes/spree,alejandromangione/spree,xuewenfei/solidus,alepore/spree,siddharth28/spree,wolfieorama/spree,scottcrawford03/solidus,radarseesradar/spree,lsirivong/spree,firman/spree,rbngzlv/spree,welitonfreitas/spree,priyank-gupta/spree,dotandbo/spree,grzlus/spree,welitonfreitas/spree,gregoryrikson/spree-sample,KMikhaylovCTG/spree,adaddeo/spree,rakibulislam/spree,berkes/spree,net2b/spree,jaspreet21anand/spree,azranel/spree,CiscoCloud/spree,zamiang/spree,ckk-scratch/solidus,keatonrow/spree,Nevensoft/spree,surfdome/spree,ayb/spree,delphsoft/spree-store-ballchair,KMikhaylovCTG/spree,azclick/spree,bonobos/solidus,Senjai/solidus,beni55/spree,vcavallo/spree,grzlus/solidus,ckk-scratch/solidus,Kagetsuki/spree,HealthWave/spree,siddharth28/spree,zaeznet/spree,devilcoders/solidus,trigrass2/spree,bjornlinder/Spree,reinaris/spree,urimikhli/spree,jordan-brough/spree,tomash/spree,gautamsawhney/spree,azclick/spree,mleglise/spree,karlitxo/spree,useiichi/spree,ramkumar-kr/spree,xuewenfei/solidus,jsurdilla/solidus,mleglise/spree,APohio/spree,radarseesradar/spree,Ropeney/spree,archSeer/spree,piousbox/spree,reidblomquist/spree,Migweld/spree,odk211/spree,devilcoders/solidus,pervino/spree,Mayvenn/spree,sfcgeorge/spree,carlesjove/spree,JDutil/spree,DynamoMTL/spree,vmatekole/spree,biagidp/spree,thogg4/spree,edgward/spree,ramkumar-kr/spree,Mayvenn/spree,FadliKun/spree,NerdsvilleCEO/spree,pervino/solidus,alejandromangione/spree,RatioClothing/spree,PhoenixTeam/spree_phoenix,edgward/spree,ujai/spree,quentinuys/spree,shekibobo/spree,jasonfb/spree,grzlus/spree,woboinc/spree,DynamoMTL/spree,builtbybuffalo/spree,joanblake/spree,ramkumar-kr/spree,ayb/spree,jparr/spree,njerrywerry/spree,Machpowersystems/spree_mach,reinaris/spree,mindvolt/spree,Kagetsuki/spree,CiscoCloud/spree,tailic/spree,softr8/spree,Ropeney/spree,Senjai/spree,RatioClothing/spree,sfcgeorge/spree,ayb/spree,NerdsvilleCEO/spree,vulk/spree,vmatekole/spree,xuewenfei/solidus,miyazawatomoka/spree,dandanwei/spree,wolfieorama/spree,tailic/spree,gregoryrikson/spree-sample,alepore/spree,sfcgeorge/spree,yushine/spree,builtbybuffalo/spree,dotandbo/spree,beni55/spree,Engeltj/spree,scottcrawford03/solidus,cutefrank/spree,bricesanchez/spree,lsirivong/solidus,orenf/spree,hifly/spree,locomotivapro/spree,Lostmyname/spree,njerrywerry/spree,shioyama/spree,kitwalker12/spree,carlesjove/spree,TimurTarasenko/spree,sliaquat/spree,vinayvinsol/spree,pervino/spree,SadTreeFriends/spree,jasonfb/spree,delphsoft/spree-store-ballchair,vulk/spree,yushine/spree,sideci-sample/sideci-sample-spree,judaro13/spree-fork,vinsol/spree,vinsol/spree,jparr/spree,azranel/spree,DynamoMTL/spree,raow/spree,locomotivapro/spree,imella/spree,firman/spree,alvinjean/spree,Hawaiideveloper/shoppingcart,biagidp/spree,ckk-scratch/solidus,grzlus/spree,brchristian/spree,lsirivong/solidus,pulkit21/spree,alejandromangione/spree,agient/agientstorefront,yomishra/pce,pervino/solidus,knuepwebdev/FloatTubeRodHolders,pervino/spree,woboinc/spree,groundctrl/spree,welitonfreitas/spree,richardnuno/solidus,nooysters/spree,hifly/spree,bricesanchez/spree,radarseesradar/spree,vmatekole/spree,TrialGuides/spree,robodisco/spree,rbngzlv/spree,TrialGuides/spree,codesavvy/sandbox,DarkoP/spree,Hates/spree,jparr/spree,karlitxo/spree,camelmasa/spree,vulk/spree,yiqing95/spree,jimblesm/spree,agient/agientstorefront,Senjai/spree,urimikhli/spree,Boomkat/spree,carlesjove/spree,progsri/spree,bonobos/solidus,delphsoft/spree-store-ballchair,imella/spree,NerdsvilleCEO/spree,yushine/spree,jimblesm/spree,jsurdilla/solidus,vinayvinsol/spree,surfdome/spree,kitwalker12/spree,useiichi/spree,devilcoders/solidus,Kagetsuki/spree,HealthWave/spree,richardnuno/solidus,net2b/spree,zaeznet/spree,PhoenixTeam/spree_phoenix,joanblake/spree,Hawaiideveloper/shoppingcart,berkes/spree,nooysters/spree,wolfieorama/spree,sideci-sample/sideci-sample-spree,shioyama/spree,jparr/spree,tancnle/spree,mleglise/spree,keatonrow/spree,ayb/spree,AgilTec/spree,lzcabrera/spree-1-3-stable,Hawaiideveloper/shoppingcart,madetech/spree,FadliKun/spree,kewaunited/spree,abhishekjain16/spree,jasonfb/spree,APohio/spree,Arpsara/solidus,FadliKun/spree,mindvolt/spree,Senjai/spree,PhoenixTeam/spree_phoenix,cutefrank/spree,freerunningtech/spree,yomishra/pce,sunny2601/spree,watg/spree,CJMrozek/spree,scottcrawford03/solidus,bonobos/solidus,jhawthorn/spree,jaspreet21anand/spree,ahmetabdi/spree,Hates/spree,adaddeo/spree,quentinuys/spree,karlitxo/spree,knuepwebdev/FloatTubeRodHolders,kewaunited/spree,mleglise/spree,ujai/spree,biagidp/spree,AgilTec/spree,ujai/spree,lyzxsc/spree,joanblake/spree,pjmj777/spree,jhawthorn/spree,reidblomquist/spree,rakibulislam/spree,hoanghiep90/spree,Arpsara/solidus,yushine/spree,shaywood2/spree,tesserakt/clean_spree,madetech/spree,rbngzlv/spree,rajeevriitm/spree,jsurdilla/solidus,shekibobo/spree,delphsoft/spree-store-ballchair,hoanghiep90/spree,HealthWave/spree,xuewenfei/solidus,project-eutopia/spree,lyzxsc/spree,ckk-scratch/solidus,tancnle/spree,radarseesradar/spree,TimurTarasenko/spree,progsri/spree,alepore/spree,sunny2601/spree,miyazawatomoka/spree,orenf/spree,bricesanchez/spree,Kagetsuki/spree,jaspreet21anand/spree,maybii/spree,tailic/spree,StemboltHQ/spree,trigrass2/spree,shaywood2/spree,priyank-gupta/spree,omarsar/spree,TimurTarasenko/spree,calvinl/spree,JuandGirald/spree,mindvolt/spree,robodisco/spree,rbngzlv/spree,cutefrank/spree,CJMrozek/spree,grzlus/solidus,jordan-brough/solidus,RatioClothing/spree,assembledbrands/spree,dafontaine/spree,volpejoaquin/spree,lyzxsc/spree,jspizziri/spree,Engeltj/spree,AgilTec/spree,reinaris/spree,groundctrl/spree,yiqing95/spree,jeffboulet/spree,kewaunited/spree,omarsar/spree,Ropeney/spree,siddharth28/spree,devilcoders/solidus,KMikhaylovCTG/spree,dandanwei/spree,vinayvinsol/spree,Migweld/spree,archSeer/spree,ahmetabdi/spree,derekluo/spree,vmatekole/spree,abhishekjain16/spree,sideci-sample/sideci-sample-spree,codesavvy/sandbox,locomotivapro/spree,azclick/spree,useiichi/spree,Migweld/spree,pjmj777/spree,nooysters/spree,robodisco/spree,calvinl/spree,judaro13/spree-fork,raow/spree,piousbox/spree,njerrywerry/spree,CiscoCloud/spree,hifly/spree,yomishra/pce,shekibobo/spree,AgilTec/spree,reidblomquist/spree,ahmetabdi/spree,Mayvenn/spree,rajeevriitm/spree,priyank-gupta/spree,vinsol/spree,patdec/spree,Engeltj/spree,lsirivong/spree,pulkit21/spree,fahidnasir/spree,agient/agientstorefront,maybii/spree,derekluo/spree,tesserakt/clean_spree,moneyspyder/spree,derekluo/spree,siddharth28/spree,pulkit21/spree,agient/agientstorefront,rajeevriitm/spree,odk211/spree,mindvolt/spree,freerunningtech/spree,madetech/spree,softr8/spree,CJMrozek/spree,tomash/spree,maybii/spree,Antdesk/karpal-spree,grzlus/solidus,Lostmyname/spree,lsirivong/solidus,brchristian/spree,athal7/solidus,alvinjean/spree,ahmetabdi/spree,yiqing95/spree | ruby | ## Code Before:
module Spree
class Promotion::Rules::ItemTotal < PromotionRule
preference :amount, :decimal, :default => 100.00
preference :operator, :string, :default => '>'
OPERATORS = ['gt', 'gte']
def eligible?(order, options = {})
item_total = order.line_items.map(&:amount).sum
item_total.send(preferred_operator == 'gte' ? :>= : :>, BigDecimal.new(preferred_amount.to_s))
end
end
end
## Instruction:
Add preferred_amount and preferred_operator to accessible attributes for item total
## Code After:
module Spree
class Promotion::Rules::ItemTotal < PromotionRule
preference :amount, :decimal, :default => 100.00
preference :operator, :string, :default => '>'
attr_accessible :preferred_amount, :preferred_operator
OPERATORS = ['gt', 'gte']
def eligible?(order, options = {})
item_total = order.line_items.map(&:amount).sum
item_total.send(preferred_operator == 'gte' ? :>= : :>, BigDecimal.new(preferred_amount.to_s))
end
end
end
| module Spree
class Promotion::Rules::ItemTotal < PromotionRule
preference :amount, :decimal, :default => 100.00
preference :operator, :string, :default => '>'
+
+ attr_accessible :preferred_amount, :preferred_operator
OPERATORS = ['gt', 'gte']
def eligible?(order, options = {})
item_total = order.line_items.map(&:amount).sum
item_total.send(preferred_operator == 'gte' ? :>= : :>, BigDecimal.new(preferred_amount.to_s))
end
end
end | 2 | 0.153846 | 2 | 0 |
57d8274a9eaa4790450614a6fa96d14a0295cd17 | OptionTrait.php | OptionTrait.php | <?php
namespace Plugin\Model;
trait OptionTrait {
public static function getOptionList($id, $cond = []) {
$list = self::create()->getList($cond);
$ids = [];
if (is_array($id)) {
$ids = $id;
} else {
$ids = [$id];
}
foreach ($list as &$item) {
$item['selected'] = in_array($item['id'], $ids);
}
return $list;
}
}
| <?php
namespace Plugin\Model;
trait OptionTrait {
public static function getOptionList($id, $cond = [], $sorting = []) {
$list = self::create()->getList($cond, $sorting);
$ids = [];
if (is_array($id)) {
$ids = $id;
} else {
$ids = [$id];
}
foreach ($list as &$item) {
$item['selected'] = in_array($item['id'], $ids);
}
return $list;
}
}
| Add possibility to use sorting in option trait | Add possibility to use sorting in option trait
| PHP | mit | dmitrykuzmenkov/kisscore-plugin-Model | php | ## Code Before:
<?php
namespace Plugin\Model;
trait OptionTrait {
public static function getOptionList($id, $cond = []) {
$list = self::create()->getList($cond);
$ids = [];
if (is_array($id)) {
$ids = $id;
} else {
$ids = [$id];
}
foreach ($list as &$item) {
$item['selected'] = in_array($item['id'], $ids);
}
return $list;
}
}
## Instruction:
Add possibility to use sorting in option trait
## Code After:
<?php
namespace Plugin\Model;
trait OptionTrait {
public static function getOptionList($id, $cond = [], $sorting = []) {
$list = self::create()->getList($cond, $sorting);
$ids = [];
if (is_array($id)) {
$ids = $id;
} else {
$ids = [$id];
}
foreach ($list as &$item) {
$item['selected'] = in_array($item['id'], $ids);
}
return $list;
}
}
| <?php
namespace Plugin\Model;
trait OptionTrait {
- public static function getOptionList($id, $cond = []) {
+ public static function getOptionList($id, $cond = [], $sorting = []) {
? +++++++++++++++
- $list = self::create()->getList($cond);
+ $list = self::create()->getList($cond, $sorting);
? ++++++++++
$ids = [];
if (is_array($id)) {
$ids = $id;
} else {
$ids = [$id];
}
foreach ($list as &$item) {
$item['selected'] = in_array($item['id'], $ids);
}
return $list;
}
} | 4 | 0.181818 | 2 | 2 |
048d583d31c250545a7954c8a2190ff2d58442a0 | cookbooks/passenger-gem/recipes/default.rb | cookbooks/passenger-gem/recipes/default.rb |
gem_package "passenger" do
gem_binary "/usr/bin/gem1.9.1"
action :install
end
#Fix the stupid path issues
link "/usr/bin/passenger-install-apache2-module" do
to "/var/lib/gems/1.9.1/bin/passenger-install-apache2-module"
end
script "install the passenger module" do
interpreter "bash"
cwd "/tmp"
code <<-EOH
/usr/bin/passenger-install-apache2-module --auto
EOH
not_if "test -f /var/lib/gems/1.9.1/gems/passenger-3.0.9/ext/apache2/mod_passenger.so"
end
template "/etc/apache2/mods-available/passenger.load" do
source "passenger.module.conf"
mode "0644"
notifies :restart, "service[apache2]"
end
link "/etc/apache2/mods-enabled/passenger.load" do
to "/etc/apache2/mods-available/passenger.load"
notifies :restart, "service[apache2]"
end |
["libcurl4-openssl-dev", "libssl-dev", "zlib1g-dev", "apache2-prefork-dev", "libapr1-dev", "libaprutil1-dev"].each do |p|
package p
end
gem_package "passenger" do
gem_binary "/usr/bin/gem1.9.1"
action :install
end
#Fix the stupid path issues
link "/usr/bin/passenger-install-apache2-module" do
to "/var/lib/gems/1.9.1/bin/passenger-install-apache2-module"
end
script "install the passenger module" do
interpreter "bash"
cwd "/tmp"
code <<-EOH
/usr/bin/passenger-install-apache2-module --auto
EOH
not_if "test -f /var/lib/gems/1.9.1/gems/passenger-3.0.9/ext/apache2/mod_passenger.so"
end
template "/etc/apache2/mods-available/passenger.load" do
source "passenger.module.conf"
mode "0644"
notifies :restart, "service[apache2]"
end
link "/etc/apache2/mods-enabled/passenger.load" do
to "/etc/apache2/mods-available/passenger.load"
notifies :restart, "service[apache2]"
end | Add some explicit dependencies that were hidden during development | Add some explicit dependencies that were hidden during development
| Ruby | mit | cyclestreets/cyclescape-chef,cyclestreets/cyclescape-chef,cyclestreets/cyclescape-chef,auto-mat/toolkit-chef,auto-mat/toolkit-chef,auto-mat/toolkit-chef | ruby | ## Code Before:
gem_package "passenger" do
gem_binary "/usr/bin/gem1.9.1"
action :install
end
#Fix the stupid path issues
link "/usr/bin/passenger-install-apache2-module" do
to "/var/lib/gems/1.9.1/bin/passenger-install-apache2-module"
end
script "install the passenger module" do
interpreter "bash"
cwd "/tmp"
code <<-EOH
/usr/bin/passenger-install-apache2-module --auto
EOH
not_if "test -f /var/lib/gems/1.9.1/gems/passenger-3.0.9/ext/apache2/mod_passenger.so"
end
template "/etc/apache2/mods-available/passenger.load" do
source "passenger.module.conf"
mode "0644"
notifies :restart, "service[apache2]"
end
link "/etc/apache2/mods-enabled/passenger.load" do
to "/etc/apache2/mods-available/passenger.load"
notifies :restart, "service[apache2]"
end
## Instruction:
Add some explicit dependencies that were hidden during development
## Code After:
["libcurl4-openssl-dev", "libssl-dev", "zlib1g-dev", "apache2-prefork-dev", "libapr1-dev", "libaprutil1-dev"].each do |p|
package p
end
gem_package "passenger" do
gem_binary "/usr/bin/gem1.9.1"
action :install
end
#Fix the stupid path issues
link "/usr/bin/passenger-install-apache2-module" do
to "/var/lib/gems/1.9.1/bin/passenger-install-apache2-module"
end
script "install the passenger module" do
interpreter "bash"
cwd "/tmp"
code <<-EOH
/usr/bin/passenger-install-apache2-module --auto
EOH
not_if "test -f /var/lib/gems/1.9.1/gems/passenger-3.0.9/ext/apache2/mod_passenger.so"
end
template "/etc/apache2/mods-available/passenger.load" do
source "passenger.module.conf"
mode "0644"
notifies :restart, "service[apache2]"
end
link "/etc/apache2/mods-enabled/passenger.load" do
to "/etc/apache2/mods-available/passenger.load"
notifies :restart, "service[apache2]"
end | +
+ ["libcurl4-openssl-dev", "libssl-dev", "zlib1g-dev", "apache2-prefork-dev", "libapr1-dev", "libaprutil1-dev"].each do |p|
+ package p
+ end
gem_package "passenger" do
gem_binary "/usr/bin/gem1.9.1"
action :install
end
#Fix the stupid path issues
link "/usr/bin/passenger-install-apache2-module" do
to "/var/lib/gems/1.9.1/bin/passenger-install-apache2-module"
end
script "install the passenger module" do
interpreter "bash"
cwd "/tmp"
code <<-EOH
/usr/bin/passenger-install-apache2-module --auto
EOH
not_if "test -f /var/lib/gems/1.9.1/gems/passenger-3.0.9/ext/apache2/mod_passenger.so"
end
template "/etc/apache2/mods-available/passenger.load" do
source "passenger.module.conf"
mode "0644"
notifies :restart, "service[apache2]"
end
link "/etc/apache2/mods-enabled/passenger.load" do
to "/etc/apache2/mods-available/passenger.load"
notifies :restart, "service[apache2]"
end | 4 | 0.133333 | 4 | 0 |
b50ed783bebc87b7085645089de9383015547a45 | app/src/main/java/com/veyndan/hermes/BaseActivity.java | app/src/main/java/com/veyndan/hermes/BaseActivity.java | package com.veyndan.hermes;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;
public class BaseActivity extends RxAppCompatActivity {
@Nullable private Toolbar toolbar;
@Nullable
protected Toolbar getToolbar() {
if (toolbar == null) {
toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
}
}
return toolbar;
}
@Override
public void setContentView(@LayoutRes int layoutResID) {
super.setContentView(layoutResID);
getToolbar();
}
}
| package com.veyndan.hermes;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
public class BaseActivity extends RxAppCompatActivity {
@Nullable @BindView(R.id.toolbar) Toolbar toolbar;
@Override
public void setContentView(@LayoutRes int layoutResID) {
super.setContentView(layoutResID);
ButterKnife.bind(this);
setSupportActionBar(toolbar);
}
}
| Use Butterknife to tidy up toolbar initialisation | Use Butterknife to tidy up toolbar initialisation
| Java | mit | veyndan/hermes | java | ## Code Before:
package com.veyndan.hermes;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;
public class BaseActivity extends RxAppCompatActivity {
@Nullable private Toolbar toolbar;
@Nullable
protected Toolbar getToolbar() {
if (toolbar == null) {
toolbar = (Toolbar) findViewById(R.id.toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
}
}
return toolbar;
}
@Override
public void setContentView(@LayoutRes int layoutResID) {
super.setContentView(layoutResID);
getToolbar();
}
}
## Instruction:
Use Butterknife to tidy up toolbar initialisation
## Code After:
package com.veyndan.hermes;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;
import butterknife.BindView;
import butterknife.ButterKnife;
public class BaseActivity extends RxAppCompatActivity {
@Nullable @BindView(R.id.toolbar) Toolbar toolbar;
@Override
public void setContentView(@LayoutRes int layoutResID) {
super.setContentView(layoutResID);
ButterKnife.bind(this);
setSupportActionBar(toolbar);
}
}
| package com.veyndan.hermes;
import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;
+ import butterknife.BindView;
+ import butterknife.ButterKnife;
+
public class BaseActivity extends RxAppCompatActivity {
+ @Nullable @BindView(R.id.toolbar) Toolbar toolbar;
- @Nullable private Toolbar toolbar;
-
- @Nullable
- protected Toolbar getToolbar() {
- if (toolbar == null) {
- toolbar = (Toolbar) findViewById(R.id.toolbar);
- if (toolbar != null) {
- setSupportActionBar(toolbar);
- }
- }
- return toolbar;
- }
@Override
public void setContentView(@LayoutRes int layoutResID) {
super.setContentView(layoutResID);
- getToolbar();
+ ButterKnife.bind(this);
+ setSupportActionBar(toolbar);
}
} | 19 | 0.655172 | 6 | 13 |
4ffd87f43414627c83c08c6d9fa1408d0c27cd5e | bin/updateDynamoDocumentation.sh | bin/updateDynamoDocumentation.sh |
pwd=`pwd`
basedir=`basename $pwd`
if [ "$basedir" != 'dynamo-docs' ]
then
echo ' ERROR - you are not in the right directory. [should be: dynamo-docs]'
exit 1
fi
git pull
echo -n "continue ? [N/y]"
read YES
if [ "$YES" != 'y' ]
then
echo "EXIT - fix the pull"
exit 0
fi
git commit -am 'Working on v0.0'
git push -u origin master
sphinx-build -a -E . ~/dynamo-documentation
rsync -Cavz --delete ~/dynamo-documentation t3home000.mit.edu:public_html
exit 0
|
LOCAL=$1
pwd=`pwd`
basedir=`basename $pwd`
if [ "$basedir" != 'dynamo-docs' ]
then
echo ' ERROR - you are not in the right directory. [should be: dynamo-docs]'
exit 1
fi
if [ "$LOCAL" == "" ]
then
git pull
echo -n "continue ? [N/y]"
read YES
if [ "$YES" != 'y' ]
then
echo "EXIT - fix the pull"
exit 0
fi
git commit -am 'Working on v0.0'
git push -u origin master
fi
sphinx-build -a -E . ~/dynamo-documentation
rsync -Cavz --delete ~/dynamo-documentation t3home000.mit.edu:public_html
exit 0
| INtroduce option to only build locally. | INtroduce option to only build locally.
| Shell | mit | cpausmit/Config,cpausmit/Config,cpausmit/Config,cpausmit/Config,cpausmit/Config | shell | ## Code Before:
pwd=`pwd`
basedir=`basename $pwd`
if [ "$basedir" != 'dynamo-docs' ]
then
echo ' ERROR - you are not in the right directory. [should be: dynamo-docs]'
exit 1
fi
git pull
echo -n "continue ? [N/y]"
read YES
if [ "$YES" != 'y' ]
then
echo "EXIT - fix the pull"
exit 0
fi
git commit -am 'Working on v0.0'
git push -u origin master
sphinx-build -a -E . ~/dynamo-documentation
rsync -Cavz --delete ~/dynamo-documentation t3home000.mit.edu:public_html
exit 0
## Instruction:
INtroduce option to only build locally.
## Code After:
LOCAL=$1
pwd=`pwd`
basedir=`basename $pwd`
if [ "$basedir" != 'dynamo-docs' ]
then
echo ' ERROR - you are not in the right directory. [should be: dynamo-docs]'
exit 1
fi
if [ "$LOCAL" == "" ]
then
git pull
echo -n "continue ? [N/y]"
read YES
if [ "$YES" != 'y' ]
then
echo "EXIT - fix the pull"
exit 0
fi
git commit -am 'Working on v0.0'
git push -u origin master
fi
sphinx-build -a -E . ~/dynamo-documentation
rsync -Cavz --delete ~/dynamo-documentation t3home000.mit.edu:public_html
exit 0
| +
+ LOCAL=$1
pwd=`pwd`
basedir=`basename $pwd`
if [ "$basedir" != 'dynamo-docs' ]
then
echo ' ERROR - you are not in the right directory. [should be: dynamo-docs]'
exit 1
fi
+
+ if [ "$LOCAL" == "" ]
- git pull
- echo -n "continue ? [N/y]"
- read YES
- if [ "$YES" != 'y' ]
then
+ git pull
+ echo -n "continue ? [N/y]"
+ read YES
+ if [ "$YES" != 'y' ]
+ then
- echo "EXIT - fix the pull"
? ^^^^
+ echo "EXIT - fix the pull"
? ^
- exit 0
+ exit 0
+ fi
+ git commit -am 'Working on v0.0'
+ git push -u origin master
fi
- git commit -am 'Working on v0.0'
- git push -u origin master
-
sphinx-build -a -E . ~/dynamo-documentation
-
rsync -Cavz --delete ~/dynamo-documentation t3home000.mit.edu:public_html
exit 0 | 24 | 0.923077 | 14 | 10 |
c0d80b9b9d5a498109d95e825b623927a072e3d1 | cpp/README.rst | cpp/README.rst | Table of Contents
=================
1. `Books`_
Books
=====
#. `The C++ Programming Language (4th Edition) <http://www.stroustrup.com/4th.html>`__
| Table of Contents
=================
1. `Books`_
2. `Documentation`_
3. `Coding Style`_
Books
=====
#. `The C++ Programming Language (4th Edition) <http://www.stroustrup.com/4th.html>`__
Documentation
=============
Use `doxygen <http://www.stack.nl/~dimitri/doxygen/>`__ for generating
documentation from annotated source code.
Coding Style
============
Naming Conventions
^^^^^^^^^^^^^^^^^^
#. **Types** must be in ``UpperCamelCase``.
.. code-block:: c++
class FileSystem { };
struct User { };
#. **Variables** must be in ``lowerCamelCase``.
.. code-block:: c++
int userCount;
int balance;
#. **Functions** must be verbs written in ``lowerCamelCase``.
.. code-block:: c++
int computeTotal();
void clear();
#. **Namespaces** must be written in ``lowercase``.
.. code-block:: c++
namespace io { };
namespace math { };
| Add initial set of naming convention guidelines for c++ | Add initial set of naming convention guidelines for c++
| reStructuredText | mit | lufte/guidelines | restructuredtext | ## Code Before:
Table of Contents
=================
1. `Books`_
Books
=====
#. `The C++ Programming Language (4th Edition) <http://www.stroustrup.com/4th.html>`__
## Instruction:
Add initial set of naming convention guidelines for c++
## Code After:
Table of Contents
=================
1. `Books`_
2. `Documentation`_
3. `Coding Style`_
Books
=====
#. `The C++ Programming Language (4th Edition) <http://www.stroustrup.com/4th.html>`__
Documentation
=============
Use `doxygen <http://www.stack.nl/~dimitri/doxygen/>`__ for generating
documentation from annotated source code.
Coding Style
============
Naming Conventions
^^^^^^^^^^^^^^^^^^
#. **Types** must be in ``UpperCamelCase``.
.. code-block:: c++
class FileSystem { };
struct User { };
#. **Variables** must be in ``lowerCamelCase``.
.. code-block:: c++
int userCount;
int balance;
#. **Functions** must be verbs written in ``lowerCamelCase``.
.. code-block:: c++
int computeTotal();
void clear();
#. **Namespaces** must be written in ``lowercase``.
.. code-block:: c++
namespace io { };
namespace math { };
| Table of Contents
=================
1. `Books`_
+ 2. `Documentation`_
+ 3. `Coding Style`_
Books
=====
#. `The C++ Programming Language (4th Edition) <http://www.stroustrup.com/4th.html>`__
+
+
+ Documentation
+ =============
+
+ Use `doxygen <http://www.stack.nl/~dimitri/doxygen/>`__ for generating
+ documentation from annotated source code.
+
+
+ Coding Style
+ ============
+
+ Naming Conventions
+ ^^^^^^^^^^^^^^^^^^
+
+ #. **Types** must be in ``UpperCamelCase``.
+
+ .. code-block:: c++
+
+ class FileSystem { };
+ struct User { };
+
+ #. **Variables** must be in ``lowerCamelCase``.
+
+ .. code-block:: c++
+
+ int userCount;
+ int balance;
+
+ #. **Functions** must be verbs written in ``lowerCamelCase``.
+
+ .. code-block:: c++
+
+ int computeTotal();
+ void clear();
+
+ #. **Namespaces** must be written in ``lowercase``.
+
+ .. code-block:: c++
+
+ namespace io { };
+ namespace math { }; | 44 | 4.4 | 44 | 0 |
a1c8f110a0b46330cfa03046d2b085dc71aa9219 | recipes/optima/conda_build_config.yaml | recipes/optima/conda_build_config.yaml | MACOSX_SDK_VERSION: # [osx]
- 10.14 # [osx]
MACOSX_DEPLOYMENT_TARGET: # [osx]
- 10.14 # [osx]
c_compiler: # [win]
- vs2019 # [win]
cxx_compiler: # [win]
- vs2019 # [win]
| MACOSX_DEPLOYMENT_TARGET: # [osx]
- 10.14 # [osx]
cxx_compiler: # [win]
- vs2019 # [win]
| Remove MACOSX_SDK_VERSION and c_compiler for win | Remove MACOSX_SDK_VERSION and c_compiler for win
| YAML | bsd-3-clause | jakirkham/staged-recipes,ocefpaf/staged-recipes,ocefpaf/staged-recipes,igortg/staged-recipes,hadim/staged-recipes,johanneskoester/staged-recipes,mariusvniekerk/staged-recipes,mariusvniekerk/staged-recipes,ReimarBauer/staged-recipes,johanneskoester/staged-recipes,conda-forge/staged-recipes,jochym/staged-recipes,jakirkham/staged-recipes,goanpeca/staged-recipes,hadim/staged-recipes,stuertz/staged-recipes,goanpeca/staged-recipes,conda-forge/staged-recipes,igortg/staged-recipes,stuertz/staged-recipes,kwilcox/staged-recipes,ReimarBauer/staged-recipes,jochym/staged-recipes,kwilcox/staged-recipes | yaml | ## Code Before:
MACOSX_SDK_VERSION: # [osx]
- 10.14 # [osx]
MACOSX_DEPLOYMENT_TARGET: # [osx]
- 10.14 # [osx]
c_compiler: # [win]
- vs2019 # [win]
cxx_compiler: # [win]
- vs2019 # [win]
## Instruction:
Remove MACOSX_SDK_VERSION and c_compiler for win
## Code After:
MACOSX_DEPLOYMENT_TARGET: # [osx]
- 10.14 # [osx]
cxx_compiler: # [win]
- vs2019 # [win]
| - MACOSX_SDK_VERSION: # [osx]
- - 10.14 # [osx]
MACOSX_DEPLOYMENT_TARGET: # [osx]
- 10.14 # [osx]
-
- c_compiler: # [win]
- - vs2019 # [win]
cxx_compiler: # [win]
- vs2019 # [win]
| 5 | 0.5 | 0 | 5 |
1e7543d99657a980f22993d406f0ee36e5eeaa74 | Casks/deezer.rb | Casks/deezer.rb | cask :v1 => 'deezer' do
version '1.1_4191'
sha256 'f9d491fb8d4b055a60b3d4a13a4e8b19e4b9b8d70dc8740df734afeee5482a34'
url "https://cdns-content.deezer.com/builds/mac/Deezer_#{version.sub(%r{^[^_]*_(\d+)},'\1')}.dmg"
name 'Deezer'
homepage 'https://www.deezer.com/formac'
license :gratis
app 'Deezer.app'
zap :delete => [
'~/Library/Application Support/Deezer',
'~/Library/Preferences/com.deezer.Deezer.plist',
]
end
| cask :v1 => 'deezer' do
version '1.1_4191'
sha256 'f9d491fb8d4b055a60b3d4a13a4e8b19e4b9b8d70dc8740df734afeee5482a34'
url "http://e-cdn-content.deezer.com/builds/mac/Deezer_#{version.sub(%r{.*_},'')}.dmg"
name 'Deezer'
homepage 'https://www.deezer.com/formac'
license :gratis
app 'Deezer.app'
zap :delete => [
'~/Library/Application Support/Deezer',
'~/Library/Preferences/com.deezer.Deezer.plist',
]
end
| Fix urls in Deezer.app Cask | Fix urls in Deezer.app Cask
The old url pointed to an outdated https Deezer domain for which the
SSL certificate has expired. This resulted in the following error
when trying to run brew cask install deezer:
curl: (60) SSL certificate problem: Invalid certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html
This commit updates the url to reflect the url used when downloading
via a browser. The homepage url has also been updated as it
doesn't use https.
| Ruby | bsd-2-clause | vin047/homebrew-cask,samnung/homebrew-cask,zerrot/homebrew-cask,MircoT/homebrew-cask,perfide/homebrew-cask,flaviocamilo/homebrew-cask,maxnordlund/homebrew-cask,mathbunnyru/homebrew-cask,fharbe/homebrew-cask,m3nu/homebrew-cask,n8henrie/homebrew-cask,Keloran/homebrew-cask,franklouwers/homebrew-cask,nathancahill/homebrew-cask,chadcatlett/caskroom-homebrew-cask,mlocher/homebrew-cask,stephenwade/homebrew-cask,alexg0/homebrew-cask,tjt263/homebrew-cask,cedwardsmedia/homebrew-cask,retrography/homebrew-cask,imgarylai/homebrew-cask,asbachb/homebrew-cask,syscrusher/homebrew-cask,FinalDes/homebrew-cask,rickychilcott/homebrew-cask,usami-k/homebrew-cask,kongslund/homebrew-cask,zmwangx/homebrew-cask,stonehippo/homebrew-cask,yuhki50/homebrew-cask,sebcode/homebrew-cask,stephenwade/homebrew-cask,julionc/homebrew-cask,goxberry/homebrew-cask,vigosan/homebrew-cask,jellyfishcoder/homebrew-cask,guerrero/homebrew-cask,mauricerkelly/homebrew-cask,wickles/homebrew-cask,stephenwade/homebrew-cask,Amorymeltzer/homebrew-cask,deiga/homebrew-cask,markhuber/homebrew-cask,okket/homebrew-cask,larseggert/homebrew-cask,JacopKane/homebrew-cask,alebcay/homebrew-cask,jellyfishcoder/homebrew-cask,johndbritton/homebrew-cask,codeurge/homebrew-cask,lukasbestle/homebrew-cask,alebcay/homebrew-cask,corbt/homebrew-cask,xyb/homebrew-cask,devmynd/homebrew-cask,singingwolfboy/homebrew-cask,howie/homebrew-cask,jconley/homebrew-cask,shorshe/homebrew-cask,squid314/homebrew-cask,stonehippo/homebrew-cask,Fedalto/homebrew-cask,hristozov/homebrew-cask,kkdd/homebrew-cask,ericbn/homebrew-cask,caskroom/homebrew-cask,boecko/homebrew-cask,reitermarkus/homebrew-cask,thehunmonkgroup/homebrew-cask,koenrh/homebrew-cask,Ephemera/homebrew-cask,yurikoles/homebrew-cask,vigosan/homebrew-cask,wickedsp1d3r/homebrew-cask,jaredsampson/homebrew-cask,wmorin/homebrew-cask,samnung/homebrew-cask,xtian/homebrew-cask,mahori/homebrew-cask,casidiablo/homebrew-cask,miku/homebrew-cask,sjackman/homebrew-cask,neverfox/homebrew-cask,farmerchris/homebrew-cask,opsdev-ws/homebrew-cask,kronicd/homebrew-cask,renard/homebrew-cask,sosedoff/homebrew-cask,reelsense/homebrew-cask,gyndav/homebrew-cask,nathanielvarona/homebrew-cask,tedski/homebrew-cask,lcasey001/homebrew-cask,maxnordlund/homebrew-cask,retrography/homebrew-cask,mwean/homebrew-cask,samdoran/homebrew-cask,BenjaminHCCarr/homebrew-cask,jiashuw/homebrew-cask,Ngrd/homebrew-cask,deanmorin/homebrew-cask,a1russell/homebrew-cask,optikfluffel/homebrew-cask,robertgzr/homebrew-cask,samshadwell/homebrew-cask,elnappo/homebrew-cask,dictcp/homebrew-cask,scottsuch/homebrew-cask,inta/homebrew-cask,tangestani/homebrew-cask,albertico/homebrew-cask,cprecioso/homebrew-cask,stonehippo/homebrew-cask,diguage/homebrew-cask,gmkey/homebrew-cask,a1russell/homebrew-cask,linc01n/homebrew-cask,hakamadare/homebrew-cask,fanquake/homebrew-cask,okket/homebrew-cask,gabrielizaias/homebrew-cask,hovancik/homebrew-cask,ywfwj2008/homebrew-cask,esebastian/homebrew-cask,lucasmezencio/homebrew-cask,Bombenleger/homebrew-cask,Ephemera/homebrew-cask,hakamadare/homebrew-cask,xcezx/homebrew-cask,mgryszko/homebrew-cask,skatsuta/homebrew-cask,inz/homebrew-cask,cprecioso/homebrew-cask,kkdd/homebrew-cask,tolbkni/homebrew-cask,kassi/homebrew-cask,daften/homebrew-cask,janlugt/homebrew-cask,jpmat296/homebrew-cask,RJHsiao/homebrew-cask,klane/homebrew-cask,tan9/homebrew-cask,mikem/homebrew-cask,andrewdisley/homebrew-cask,kingthorin/homebrew-cask,jalaziz/homebrew-cask,FranklinChen/homebrew-cask,diguage/homebrew-cask,malford/homebrew-cask,jangalinski/homebrew-cask,mchlrmrz/homebrew-cask,miccal/homebrew-cask,axodys/homebrew-cask,mazehall/homebrew-cask,jmeridth/homebrew-cask,lukeadams/homebrew-cask,ddm/homebrew-cask,julionc/homebrew-cask,colindunn/homebrew-cask,skatsuta/homebrew-cask,bric3/homebrew-cask,blainesch/homebrew-cask,cblecker/homebrew-cask,yumitsu/homebrew-cask,cobyism/homebrew-cask,cobyism/homebrew-cask,AnastasiaSulyagina/homebrew-cask,bdhess/homebrew-cask,lantrix/homebrew-cask,mjgardner/homebrew-cask,hyuna917/homebrew-cask,albertico/homebrew-cask,giannitm/homebrew-cask,ptb/homebrew-cask,mrmachine/homebrew-cask,wickles/homebrew-cask,sanyer/homebrew-cask,joschi/homebrew-cask,cedwardsmedia/homebrew-cask,jgarber623/homebrew-cask,sjackman/homebrew-cask,pacav69/homebrew-cask,bric3/homebrew-cask,hanxue/caskroom,hellosky806/homebrew-cask,brianshumate/homebrew-cask,feigaochn/homebrew-cask,sscotth/homebrew-cask,inz/homebrew-cask,asins/homebrew-cask,moimikey/homebrew-cask,jeanregisser/homebrew-cask,zmwangx/homebrew-cask,renaudguerin/homebrew-cask,fanquake/homebrew-cask,chuanxd/homebrew-cask,forevergenin/homebrew-cask,alexg0/homebrew-cask,seanzxx/homebrew-cask,0xadada/homebrew-cask,Labutin/homebrew-cask,gmkey/homebrew-cask,kTitan/homebrew-cask,coeligena/homebrew-customized,jpmat296/homebrew-cask,afh/homebrew-cask,tjt263/homebrew-cask,tolbkni/homebrew-cask,ianyh/homebrew-cask,nathansgreen/homebrew-cask,jbeagley52/homebrew-cask,6uclz1/homebrew-cask,jconley/homebrew-cask,BenjaminHCCarr/homebrew-cask,miguelfrde/homebrew-cask,m3nu/homebrew-cask,sscotth/homebrew-cask,napaxton/homebrew-cask,tsparber/homebrew-cask,mishari/homebrew-cask,feigaochn/homebrew-cask,uetchy/homebrew-cask,esebastian/homebrew-cask,kronicd/homebrew-cask,kteru/homebrew-cask,stigkj/homebrew-caskroom-cask,lucasmezencio/homebrew-cask,moimikey/homebrew-cask,tjnycum/homebrew-cask,afh/homebrew-cask,imgarylai/homebrew-cask,seanorama/homebrew-cask,haha1903/homebrew-cask,wKovacs64/homebrew-cask,CameronGarrett/homebrew-cask,FinalDes/homebrew-cask,MerelyAPseudonym/homebrew-cask,Cottser/homebrew-cask,michelegera/homebrew-cask,jgarber623/homebrew-cask,jiashuw/homebrew-cask,MoOx/homebrew-cask,wmorin/homebrew-cask,daften/homebrew-cask,chadcatlett/caskroom-homebrew-cask,tedbundyjr/homebrew-cask,asins/homebrew-cask,xight/homebrew-cask,pkq/homebrew-cask,mingzhi22/homebrew-cask,koenrh/homebrew-cask,gilesdring/homebrew-cask,williamboman/homebrew-cask,uetchy/homebrew-cask,stigkj/homebrew-caskroom-cask,pacav69/homebrew-cask,gabrielizaias/homebrew-cask,nathancahill/homebrew-cask,jgarber623/homebrew-cask,vitorgalvao/homebrew-cask,shoichiaizawa/homebrew-cask,colindean/homebrew-cask,anbotero/homebrew-cask,winkelsdorf/homebrew-cask,0xadada/homebrew-cask,xcezx/homebrew-cask,reitermarkus/homebrew-cask,kteru/homebrew-cask,napaxton/homebrew-cask,johnjelinek/homebrew-cask,miccal/homebrew-cask,mwean/homebrew-cask,renard/homebrew-cask,exherb/homebrew-cask,arronmabrey/homebrew-cask,ninjahoahong/homebrew-cask,blogabe/homebrew-cask,markhuber/homebrew-cask,cliffcotino/homebrew-cask,decrement/homebrew-cask,tedbundyjr/homebrew-cask,shonjir/homebrew-cask,Amorymeltzer/homebrew-cask,casidiablo/homebrew-cask,kamilboratynski/homebrew-cask,cfillion/homebrew-cask,alexg0/homebrew-cask,lifepillar/homebrew-cask,claui/homebrew-cask,athrunsun/homebrew-cask,patresi/homebrew-cask,victorpopkov/homebrew-cask,leipert/homebrew-cask,bcomnes/homebrew-cask,kingthorin/homebrew-cask,arronmabrey/homebrew-cask,scottsuch/homebrew-cask,danielbayley/homebrew-cask,claui/homebrew-cask,ksato9700/homebrew-cask,mrmachine/homebrew-cask,FranklinChen/homebrew-cask,giannitm/homebrew-cask,hanxue/caskroom,kpearson/homebrew-cask,michelegera/homebrew-cask,JikkuJose/homebrew-cask,Amorymeltzer/homebrew-cask,ksato9700/homebrew-cask,yuhki50/homebrew-cask,sebcode/homebrew-cask,syscrusher/homebrew-cask,exherb/homebrew-cask,scribblemaniac/homebrew-cask,Ngrd/homebrew-cask,mazehall/homebrew-cask,tyage/homebrew-cask,thehunmonkgroup/homebrew-cask,cfillion/homebrew-cask,dvdoliveira/homebrew-cask,mchlrmrz/homebrew-cask,morganestes/homebrew-cask,seanorama/homebrew-cask,sanyer/homebrew-cask,chrisfinazzo/homebrew-cask,kpearson/homebrew-cask,markthetech/homebrew-cask,FredLackeyOfficial/homebrew-cask,xyb/homebrew-cask,shorshe/homebrew-cask,xyb/homebrew-cask,markthetech/homebrew-cask,muan/homebrew-cask,dictcp/homebrew-cask,mishari/homebrew-cask,kingthorin/homebrew-cask,toonetown/homebrew-cask,mhubig/homebrew-cask,axodys/homebrew-cask,y00rb/homebrew-cask,deanmorin/homebrew-cask,robertgzr/homebrew-cask,troyxmccall/homebrew-cask,onlynone/homebrew-cask,fharbe/homebrew-cask,nrlquaker/homebrew-cask,jacobbednarz/homebrew-cask,haha1903/homebrew-cask,gyndav/homebrew-cask,tsparber/homebrew-cask,miku/homebrew-cask,morganestes/homebrew-cask,athrunsun/homebrew-cask,perfide/homebrew-cask,chrisfinazzo/homebrew-cask,caskroom/homebrew-cask,esebastian/homebrew-cask,jeanregisser/homebrew-cask,shonjir/homebrew-cask,SentinelWarren/homebrew-cask,franklouwers/homebrew-cask,timsutton/homebrew-cask,otaran/homebrew-cask,renaudguerin/homebrew-cask,asbachb/homebrew-cask,thii/homebrew-cask,nathanielvarona/homebrew-cask,lukeadams/homebrew-cask,mauricerkelly/homebrew-cask,bcomnes/homebrew-cask,JosephViolago/homebrew-cask,larseggert/homebrew-cask,tan9/homebrew-cask,m3nu/homebrew-cask,thomanq/homebrew-cask,riyad/homebrew-cask,coeligena/homebrew-customized,joschi/homebrew-cask,RJHsiao/homebrew-cask,nshemonsky/homebrew-cask,optikfluffel/homebrew-cask,JosephViolago/homebrew-cask,ddm/homebrew-cask,ywfwj2008/homebrew-cask,wmorin/homebrew-cask,scribblemaniac/homebrew-cask,flaviocamilo/homebrew-cask,doits/homebrew-cask,goxberry/homebrew-cask,elyscape/homebrew-cask,nshemonsky/homebrew-cask,patresi/homebrew-cask,vin047/homebrew-cask,winkelsdorf/homebrew-cask,Keloran/homebrew-cask,bosr/homebrew-cask,winkelsdorf/homebrew-cask,mjdescy/homebrew-cask,nathanielvarona/homebrew-cask,danielbayley/homebrew-cask,My2ndAngelic/homebrew-cask,paour/homebrew-cask,n8henrie/homebrew-cask,johnjelinek/homebrew-cask,moogar0880/homebrew-cask,a1russell/homebrew-cask,bdhess/homebrew-cask,artdevjs/homebrew-cask,mjgardner/homebrew-cask,shoichiaizawa/homebrew-cask,imgarylai/homebrew-cask,SentinelWarren/homebrew-cask,lifepillar/homebrew-cask,codeurge/homebrew-cask,thii/homebrew-cask,mchlrmrz/homebrew-cask,kesara/homebrew-cask,jawshooah/homebrew-cask,Fedalto/homebrew-cask,colindean/homebrew-cask,jasmas/homebrew-cask,dictcp/homebrew-cask,xight/homebrew-cask,janlugt/homebrew-cask,jalaziz/homebrew-cask,antogg/homebrew-cask,joshka/homebrew-cask,gurghet/homebrew-cask,colindunn/homebrew-cask,muan/homebrew-cask,sohtsuka/homebrew-cask,6uclz1/homebrew-cask,theoriginalgri/homebrew-cask,mattrobenolt/homebrew-cask,danielbayley/homebrew-cask,williamboman/homebrew-cask,kongslund/homebrew-cask,ksylvan/homebrew-cask,greg5green/homebrew-cask,jbeagley52/homebrew-cask,rajiv/homebrew-cask,jalaziz/homebrew-cask,rickychilcott/homebrew-cask,klane/homebrew-cask,Gasol/homebrew-cask,amatos/homebrew-cask,jaredsampson/homebrew-cask,ericbn/homebrew-cask,corbt/homebrew-cask,toonetown/homebrew-cask,cblecker/homebrew-cask,alebcay/homebrew-cask,anbotero/homebrew-cask,jawshooah/homebrew-cask,yutarody/homebrew-cask,blogabe/homebrew-cask,amatos/homebrew-cask,kassi/homebrew-cask,claui/homebrew-cask,joschi/homebrew-cask,bosr/homebrew-cask,malob/homebrew-cask,mikem/homebrew-cask,devmynd/homebrew-cask,hellosky806/homebrew-cask,wastrachan/homebrew-cask,malford/homebrew-cask,chuanxd/homebrew-cask,BenjaminHCCarr/homebrew-cask,adrianchia/homebrew-cask,usami-k/homebrew-cask,singingwolfboy/homebrew-cask,Labutin/homebrew-cask,deiga/homebrew-cask,ianyh/homebrew-cask,pkq/homebrew-cask,sscotth/homebrew-cask,doits/homebrew-cask,adrianchia/homebrew-cask,MichaelPei/homebrew-cask,n0ts/homebrew-cask,My2ndAngelic/homebrew-cask,miguelfrde/homebrew-cask,blogabe/homebrew-cask,paour/homebrew-cask,coeligena/homebrew-customized,psibre/homebrew-cask,rogeriopradoj/homebrew-cask,lumaxis/homebrew-cask,nrlquaker/homebrew-cask,MircoT/homebrew-cask,miccal/homebrew-cask,hovancik/homebrew-cask,rajiv/homebrew-cask,schneidmaster/homebrew-cask,moimikey/homebrew-cask,moogar0880/homebrew-cask,hristozov/homebrew-cask,scribblemaniac/homebrew-cask,howie/homebrew-cask,inta/homebrew-cask,JacopKane/homebrew-cask,artdevjs/homebrew-cask,lumaxis/homebrew-cask,xakraz/homebrew-cask,mjdescy/homebrew-cask,tjnycum/homebrew-cask,Ketouem/homebrew-cask,blainesch/homebrew-cask,joshka/homebrew-cask,mattrobenolt/homebrew-cask,sanchezm/homebrew-cask,malob/homebrew-cask,uetchy/homebrew-cask,puffdad/homebrew-cask,schneidmaster/homebrew-cask,ksylvan/homebrew-cask,paour/homebrew-cask,slack4u/homebrew-cask,n0ts/homebrew-cask,KosherBacon/homebrew-cask,FredLackeyOfficial/homebrew-cask,jacobbednarz/homebrew-cask,ericbn/homebrew-cask,AnastasiaSulyagina/homebrew-cask,optikfluffel/homebrew-cask,mhubig/homebrew-cask,jeroenj/homebrew-cask,chrisfinazzo/homebrew-cask,reitermarkus/homebrew-cask,yurikoles/homebrew-cask,samshadwell/homebrew-cask,jedahan/homebrew-cask,shoichiaizawa/homebrew-cask,seanzxx/homebrew-cask,psibre/homebrew-cask,0rax/homebrew-cask,rogeriopradoj/homebrew-cask,neverfox/homebrew-cask,theoriginalgri/homebrew-cask,jppelteret/homebrew-cask,yumitsu/homebrew-cask,thomanq/homebrew-cask,lcasey001/homebrew-cask,tedski/homebrew-cask,xtian/homebrew-cask,riyad/homebrew-cask,andyli/homebrew-cask,Saklad5/homebrew-cask,nathansgreen/homebrew-cask,farmerchris/homebrew-cask,leipert/homebrew-cask,guerrero/homebrew-cask,pkq/homebrew-cask,nightscape/homebrew-cask,timsutton/homebrew-cask,otaran/homebrew-cask,y00rb/homebrew-cask,rajiv/homebrew-cask,puffdad/homebrew-cask,xakraz/homebrew-cask,andrewdisley/homebrew-cask,KosherBacon/homebrew-cask,samdoran/homebrew-cask,mgryszko/homebrew-cask,kTitan/homebrew-cask,jppelteret/homebrew-cask,jangalinski/homebrew-cask,kesara/homebrew-cask,MerelyAPseudonym/homebrew-cask,kamilboratynski/homebrew-cask,neverfox/homebrew-cask,sosedoff/homebrew-cask,greg5green/homebrew-cask,malob/homebrew-cask,yutarody/homebrew-cask,mingzhi22/homebrew-cask,decrement/homebrew-cask,nightscape/homebrew-cask,cliffcotino/homebrew-cask,Ketouem/homebrew-cask,Ephemera/homebrew-cask,troyxmccall/homebrew-cask,ptb/homebrew-cask,Saklad5/homebrew-cask,adrianchia/homebrew-cask,gerrypower/homebrew-cask,MichaelPei/homebrew-cask,sanyer/homebrew-cask,scottsuch/homebrew-cask,JikkuJose/homebrew-cask,slack4u/homebrew-cask,tangestani/homebrew-cask,tjnycum/homebrew-cask,ebraminio/homebrew-cask,deiga/homebrew-cask,onlynone/homebrew-cask,vitorgalvao/homebrew-cask,wKovacs64/homebrew-cask,dvdoliveira/homebrew-cask,johndbritton/homebrew-cask,mahori/homebrew-cask,victorpopkov/homebrew-cask,ninjahoahong/homebrew-cask,opsdev-ws/homebrew-cask,mjgardner/homebrew-cask,josa42/homebrew-cask,mahori/homebrew-cask,xight/homebrew-cask,joshka/homebrew-cask,josa42/homebrew-cask,singingwolfboy/homebrew-cask,hyuna917/homebrew-cask,elyscape/homebrew-cask,brianshumate/homebrew-cask,gilesdring/homebrew-cask,dcondrey/homebrew-cask,JacopKane/homebrew-cask,bric3/homebrew-cask,julionc/homebrew-cask,zerrot/homebrew-cask,ebraminio/homebrew-cask,sohtsuka/homebrew-cask,jedahan/homebrew-cask,jmeridth/homebrew-cask,andyli/homebrew-cask,sanchezm/homebrew-cask,Bombenleger/homebrew-cask,yutarody/homebrew-cask,forevergenin/homebrew-cask,Gasol/homebrew-cask,MoOx/homebrew-cask,dcondrey/homebrew-cask,squid314/homebrew-cask,reelsense/homebrew-cask,timsutton/homebrew-cask,hanxue/caskroom,phpwutz/homebrew-cask,jasmas/homebrew-cask,mathbunnyru/homebrew-cask,antogg/homebrew-cask,shonjir/homebrew-cask,wastrachan/homebrew-cask,josa42/homebrew-cask,gerrypower/homebrew-cask,cobyism/homebrew-cask,mathbunnyru/homebrew-cask,cblecker/homebrew-cask,jeroenj/homebrew-cask,mattrobenolt/homebrew-cask,antogg/homebrew-cask,aguynamedryan/homebrew-cask,wickedsp1d3r/homebrew-cask,gurghet/homebrew-cask,0rax/homebrew-cask,CameronGarrett/homebrew-cask,JosephViolago/homebrew-cask,mlocher/homebrew-cask,boecko/homebrew-cask,tyage/homebrew-cask,gyndav/homebrew-cask,kesara/homebrew-cask,tangestani/homebrew-cask,diogodamiani/homebrew-cask,andrewdisley/homebrew-cask,elnappo/homebrew-cask,rogeriopradoj/homebrew-cask,yurikoles/homebrew-cask,phpwutz/homebrew-cask,nrlquaker/homebrew-cask,sgnh/homebrew-cask,aguynamedryan/homebrew-cask,lantrix/homebrew-cask,sgnh/homebrew-cask,13k/homebrew-cask,13k/homebrew-cask,linc01n/homebrew-cask,lukasbestle/homebrew-cask,diogodamiani/homebrew-cask,Cottser/homebrew-cask | ruby | ## Code Before:
cask :v1 => 'deezer' do
version '1.1_4191'
sha256 'f9d491fb8d4b055a60b3d4a13a4e8b19e4b9b8d70dc8740df734afeee5482a34'
url "https://cdns-content.deezer.com/builds/mac/Deezer_#{version.sub(%r{^[^_]*_(\d+)},'\1')}.dmg"
name 'Deezer'
homepage 'https://www.deezer.com/formac'
license :gratis
app 'Deezer.app'
zap :delete => [
'~/Library/Application Support/Deezer',
'~/Library/Preferences/com.deezer.Deezer.plist',
]
end
## Instruction:
Fix urls in Deezer.app Cask
The old url pointed to an outdated https Deezer domain for which the
SSL certificate has expired. This resulted in the following error
when trying to run brew cask install deezer:
curl: (60) SSL certificate problem: Invalid certificate chain
More details here: http://curl.haxx.se/docs/sslcerts.html
This commit updates the url to reflect the url used when downloading
via a browser. The homepage url has also been updated as it
doesn't use https.
## Code After:
cask :v1 => 'deezer' do
version '1.1_4191'
sha256 'f9d491fb8d4b055a60b3d4a13a4e8b19e4b9b8d70dc8740df734afeee5482a34'
url "http://e-cdn-content.deezer.com/builds/mac/Deezer_#{version.sub(%r{.*_},'')}.dmg"
name 'Deezer'
homepage 'https://www.deezer.com/formac'
license :gratis
app 'Deezer.app'
zap :delete => [
'~/Library/Application Support/Deezer',
'~/Library/Preferences/com.deezer.Deezer.plist',
]
end
| cask :v1 => 'deezer' do
version '1.1_4191'
sha256 'f9d491fb8d4b055a60b3d4a13a4e8b19e4b9b8d70dc8740df734afeee5482a34'
- url "https://cdns-content.deezer.com/builds/mac/Deezer_#{version.sub(%r{^[^_]*_(\d+)},'\1')}.dmg"
? - - ^^^^^ ----- --
+ url "http://e-cdn-content.deezer.com/builds/mac/Deezer_#{version.sub(%r{.*_},'')}.dmg"
? ++ ^
name 'Deezer'
homepage 'https://www.deezer.com/formac'
license :gratis
app 'Deezer.app'
zap :delete => [
'~/Library/Application Support/Deezer',
'~/Library/Preferences/com.deezer.Deezer.plist',
]
end | 2 | 0.125 | 1 | 1 |
ad3f052a69889e8b303ddf9f5c91cb90ba04c48c | pyproject.toml | pyproject.toml | [build-system]
requires = [
"setuptools >= 35.0.2",
"setuptools_scm >= 3.1.0, <4",
]
build-backend = "setuptools.build_meta"
[tool.black]
py36 = true
skip-string-normalization = true
| [build-system]
requires = [
"setuptools >= 35.0.2",
"setuptools_scm >= 3.1.0, <4",
]
build-backend = "setuptools.build_meta"
[tool.black]
target_version = ['py36', 'py37']
skip-string-normalization = true
| Update target_version argument for black | Update target_version argument for black
Include Python3.7 formatting support in linters.
| TOML | apache-2.0 | genialis/django-rest-framework-reactive,genialis/django-rest-framework-reactive | toml | ## Code Before:
[build-system]
requires = [
"setuptools >= 35.0.2",
"setuptools_scm >= 3.1.0, <4",
]
build-backend = "setuptools.build_meta"
[tool.black]
py36 = true
skip-string-normalization = true
## Instruction:
Update target_version argument for black
Include Python3.7 formatting support in linters.
## Code After:
[build-system]
requires = [
"setuptools >= 35.0.2",
"setuptools_scm >= 3.1.0, <4",
]
build-backend = "setuptools.build_meta"
[tool.black]
target_version = ['py36', 'py37']
skip-string-normalization = true
| [build-system]
requires = [
"setuptools >= 35.0.2",
"setuptools_scm >= 3.1.0, <4",
]
build-backend = "setuptools.build_meta"
[tool.black]
- py36 = true
+ target_version = ['py36', 'py37']
skip-string-normalization = true | 2 | 0.2 | 1 | 1 |
cefde706226db48957a3f6c1777af16682d5c7cb | src/main/java/com/hubspot/jinjava/interpret/LazyExpression.java | src/main/java/com/hubspot/jinjava/interpret/LazyExpression.java | package com.hubspot.jinjava.interpret;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.function.Supplier;
public class LazyExpression implements Supplier {
private final Supplier supplier;
private final String image;
private final boolean memoize;
private Object jsonValue = null;
private LazyExpression(Supplier supplier, String image, boolean memoize) {
this.supplier = supplier;
this.image = image;
this.memoize = memoize;
}
public static LazyExpression of(Supplier supplier, String image) {
return new LazyExpression(supplier, image, true);
}
public static LazyExpression of(Supplier supplier, String image, boolean memoize) {
return new LazyExpression(supplier, image, memoize);
}
@Override
public Object get() {
if (jsonValue == null || !memoize) {
jsonValue = supplier.get();
}
return jsonValue;
}
@Override
public String toString() {
return image;
}
@JsonValue
public Object getJsonValue() {
return jsonValue == null ? "" : jsonValue;
}
}
| package com.hubspot.jinjava.interpret;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.function.Supplier;
public class LazyExpression implements Supplier {
private final Supplier supplier;
private final String image;
private final MEMOIZATION memoization;
private Object jsonValue = null;
public enum MEMOIZATION {
ON,
OFF
}
private LazyExpression(Supplier supplier, String image, MEMOIZATION memoization) {
this.supplier = supplier;
this.image = image;
this.memoization = memoization;
}
public static LazyExpression of(Supplier supplier, String image) {
return new LazyExpression(supplier, image, MEMOIZATION.ON);
}
public static LazyExpression of(
Supplier supplier,
String image,
MEMOIZATION memoization
) {
return new LazyExpression(supplier, image, memoization);
}
@Override
public Object get() {
if (jsonValue == null || memoization == MEMOIZATION.OFF) {
jsonValue = supplier.get();
}
return jsonValue;
}
@Override
public String toString() {
return image;
}
@JsonValue
public Object getJsonValue() {
return jsonValue == null ? "" : jsonValue;
}
}
| Switch from boolean to enum for memoization argument | Switch from boolean to enum for memoization argument
| Java | apache-2.0 | HubSpot/jinjava,HubSpot/jinjava | java | ## Code Before:
package com.hubspot.jinjava.interpret;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.function.Supplier;
public class LazyExpression implements Supplier {
private final Supplier supplier;
private final String image;
private final boolean memoize;
private Object jsonValue = null;
private LazyExpression(Supplier supplier, String image, boolean memoize) {
this.supplier = supplier;
this.image = image;
this.memoize = memoize;
}
public static LazyExpression of(Supplier supplier, String image) {
return new LazyExpression(supplier, image, true);
}
public static LazyExpression of(Supplier supplier, String image, boolean memoize) {
return new LazyExpression(supplier, image, memoize);
}
@Override
public Object get() {
if (jsonValue == null || !memoize) {
jsonValue = supplier.get();
}
return jsonValue;
}
@Override
public String toString() {
return image;
}
@JsonValue
public Object getJsonValue() {
return jsonValue == null ? "" : jsonValue;
}
}
## Instruction:
Switch from boolean to enum for memoization argument
## Code After:
package com.hubspot.jinjava.interpret;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.function.Supplier;
public class LazyExpression implements Supplier {
private final Supplier supplier;
private final String image;
private final MEMOIZATION memoization;
private Object jsonValue = null;
public enum MEMOIZATION {
ON,
OFF
}
private LazyExpression(Supplier supplier, String image, MEMOIZATION memoization) {
this.supplier = supplier;
this.image = image;
this.memoization = memoization;
}
public static LazyExpression of(Supplier supplier, String image) {
return new LazyExpression(supplier, image, MEMOIZATION.ON);
}
public static LazyExpression of(
Supplier supplier,
String image,
MEMOIZATION memoization
) {
return new LazyExpression(supplier, image, memoization);
}
@Override
public Object get() {
if (jsonValue == null || memoization == MEMOIZATION.OFF) {
jsonValue = supplier.get();
}
return jsonValue;
}
@Override
public String toString() {
return image;
}
@JsonValue
public Object getJsonValue() {
return jsonValue == null ? "" : jsonValue;
}
}
| package com.hubspot.jinjava.interpret;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.function.Supplier;
public class LazyExpression implements Supplier {
private final Supplier supplier;
private final String image;
- private final boolean memoize;
+ private final MEMOIZATION memoization;
private Object jsonValue = null;
+ public enum MEMOIZATION {
+ ON,
+ OFF
+ }
+
- private LazyExpression(Supplier supplier, String image, boolean memoize) {
? ^^^^^^^ ^
+ private LazyExpression(Supplier supplier, String image, MEMOIZATION memoization) {
? ^^^^^^^^^^^ ^^^^^
this.supplier = supplier;
this.image = image;
- this.memoize = memoize;
? ^ ^
+ this.memoization = memoization;
? ^^^^^ ^^^^^
}
public static LazyExpression of(Supplier supplier, String image) {
- return new LazyExpression(supplier, image, true);
? ^^^^
+ return new LazyExpression(supplier, image, MEMOIZATION.ON);
? ^^^^^^^^^^^^^^
}
- public static LazyExpression of(Supplier supplier, String image, boolean memoize) {
+ public static LazyExpression of(
+ Supplier supplier,
+ String image,
+ MEMOIZATION memoization
+ ) {
- return new LazyExpression(supplier, image, memoize);
? ^
+ return new LazyExpression(supplier, image, memoization);
? ^^^^^
}
@Override
public Object get() {
- if (jsonValue == null || !memoize) {
+ if (jsonValue == null || memoization == MEMOIZATION.OFF) {
jsonValue = supplier.get();
}
return jsonValue;
}
@Override
public String toString() {
return image;
}
@JsonValue
public Object getJsonValue() {
return jsonValue == null ? "" : jsonValue;
}
} | 23 | 0.534884 | 16 | 7 |
09c58206c35cd1f90cb6b5cfe7a87c88546a3688 | README.md | README.md | An inventory management system, based on buckets you can place items in
# Installation
This is a Python 3 Django module and cannot be used standalone. Also needs `crispy_forms`, which on debianoid systems is available as `python3-django-crispy-forms`.
| An inventory management system, based on buckets you can place items in
# Installation
This is a python 3 django module and cannot be used standalone. Also needs `crispy_forms`, which on debianoid systems is available as `python3-django-crispy-forms`. Create a project, add the contents of this repositories as a directory named `inventory`.
| Add slightly more verbose installation instructions | Add slightly more verbose installation instructions | Markdown | mit | dadrc/python3-django-inventory,dadrc/python3-django-inventory,dadrc/python3-django-inventory | markdown | ## Code Before:
An inventory management system, based on buckets you can place items in
# Installation
This is a Python 3 Django module and cannot be used standalone. Also needs `crispy_forms`, which on debianoid systems is available as `python3-django-crispy-forms`.
## Instruction:
Add slightly more verbose installation instructions
## Code After:
An inventory management system, based on buckets you can place items in
# Installation
This is a python 3 django module and cannot be used standalone. Also needs `crispy_forms`, which on debianoid systems is available as `python3-django-crispy-forms`. Create a project, add the contents of this repositories as a directory named `inventory`.
| An inventory management system, based on buckets you can place items in
# Installation
- This is a Python 3 Django module and cannot be used standalone. Also needs `crispy_forms`, which on debianoid systems is available as `python3-django-crispy-forms`.
? ^ ^
+ This is a python 3 django module and cannot be used standalone. Also needs `crispy_forms`, which on debianoid systems is available as `python3-django-crispy-forms`. Create a project, add the contents of this repositories as a directory named `inventory`.
? ^ ^ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
| 2 | 0.5 | 1 | 1 |
f4ba70c19b26ae701e5ea6cd0b24b0102f3518f2 | remove-manual-juju.bash | remove-manual-juju.bash |
JUJU_DIR="/var/lib/juju"
DUMMY_DIR="/var/run/dummy-sink"
ips="$@"
for ip in $ips; do
ssh -i $JUJU_HOME/staging-juju-rsa ubuntu@$ip <<EOT
#!/bin/bash
set -ux
if [[ -n "$(ps ax | grep jujud | grep -v grep)" ]]; then
sudo killall -SIGABRT jujud
sudo killall -9 mongod
fi
if [[ -d $JUJU_DIR ]]; then
sudo rm -r $JUJU_DIR
fi
if [[ -d $DUMMY_DIR ]]; then
sudo rm -r $DUMMY_DIR
fi
sudo find /etc/init -name 'juju*' -delete
EOT
done
|
JUJU_DIR="/var/lib/juju"
DUMMY_DIR="/var/run/dummy-sink"
ips="$@"
for ip in $ips; do
ssh -i $JUJU_HOME/staging-juju-rsa ubuntu@$ip <<"EOT"
#!/bin/bash
set -ux
if [[ -n "$(ps ax | grep jujud | grep -v grep)" ]]; then
sudo touch /var/lib/juju/uninstall-agent
sudo killall -SIGABRT jujud
sudo killall -9 mongod
fi
if [[ -d $JUJU_DIR ]]; then
sudo rm -r $JUJU_DIR
fi
if [[ -d $DUMMY_DIR ]]; then
sudo rm -r $DUMMY_DIR
fi
sudo find /etc/init -name 'juju*' -delete
EOT
done
| Fix quoting in remove manual script and add new uninstall handling | Fix quoting in remove manual script and add new uninstall handling
| Shell | agpl-3.0 | mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju | shell | ## Code Before:
JUJU_DIR="/var/lib/juju"
DUMMY_DIR="/var/run/dummy-sink"
ips="$@"
for ip in $ips; do
ssh -i $JUJU_HOME/staging-juju-rsa ubuntu@$ip <<EOT
#!/bin/bash
set -ux
if [[ -n "$(ps ax | grep jujud | grep -v grep)" ]]; then
sudo killall -SIGABRT jujud
sudo killall -9 mongod
fi
if [[ -d $JUJU_DIR ]]; then
sudo rm -r $JUJU_DIR
fi
if [[ -d $DUMMY_DIR ]]; then
sudo rm -r $DUMMY_DIR
fi
sudo find /etc/init -name 'juju*' -delete
EOT
done
## Instruction:
Fix quoting in remove manual script and add new uninstall handling
## Code After:
JUJU_DIR="/var/lib/juju"
DUMMY_DIR="/var/run/dummy-sink"
ips="$@"
for ip in $ips; do
ssh -i $JUJU_HOME/staging-juju-rsa ubuntu@$ip <<"EOT"
#!/bin/bash
set -ux
if [[ -n "$(ps ax | grep jujud | grep -v grep)" ]]; then
sudo touch /var/lib/juju/uninstall-agent
sudo killall -SIGABRT jujud
sudo killall -9 mongod
fi
if [[ -d $JUJU_DIR ]]; then
sudo rm -r $JUJU_DIR
fi
if [[ -d $DUMMY_DIR ]]; then
sudo rm -r $DUMMY_DIR
fi
sudo find /etc/init -name 'juju*' -delete
EOT
done
|
JUJU_DIR="/var/lib/juju"
DUMMY_DIR="/var/run/dummy-sink"
ips="$@"
for ip in $ips; do
- ssh -i $JUJU_HOME/staging-juju-rsa ubuntu@$ip <<EOT
+ ssh -i $JUJU_HOME/staging-juju-rsa ubuntu@$ip <<"EOT"
? + +
#!/bin/bash
set -ux
if [[ -n "$(ps ax | grep jujud | grep -v grep)" ]]; then
+ sudo touch /var/lib/juju/uninstall-agent
sudo killall -SIGABRT jujud
sudo killall -9 mongod
fi
if [[ -d $JUJU_DIR ]]; then
sudo rm -r $JUJU_DIR
fi
if [[ -d $DUMMY_DIR ]]; then
sudo rm -r $DUMMY_DIR
fi
sudo find /etc/init -name 'juju*' -delete
EOT
done | 3 | 0.142857 | 2 | 1 |
6d38920c1867921235c002b6ad411fd08378dd1f | fluent_contents/tests/test_models.py | fluent_contents/tests/test_models.py | from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter what, the ContentItem.__str__() should work.
This would break the admin delete screen otherwise.
"""
c = ContentType()
a = ContentItem(polymorphic_ctype=c)
self.assertEqual(str(a), "'(type deleted) 0' in 'None None'")
| from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter what, the ContentItem.__str__() should work.
This would break the admin delete screen otherwise.
"""
c = ContentType()
c.save()
a = ContentItem(polymorphic_ctype=c)
self.assertEqual(str(a), "'(type deleted) 0' in 'None None'")
| Fix Django 1.8+ tests for stale content type | Fix Django 1.8+ tests for stale content type
| Python | apache-2.0 | django-fluent/django-fluent-contents,edoburu/django-fluent-contents,edoburu/django-fluent-contents,django-fluent/django-fluent-contents,django-fluent/django-fluent-contents,edoburu/django-fluent-contents | python | ## Code Before:
from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter what, the ContentItem.__str__() should work.
This would break the admin delete screen otherwise.
"""
c = ContentType()
a = ContentItem(polymorphic_ctype=c)
self.assertEqual(str(a), "'(type deleted) 0' in 'None None'")
## Instruction:
Fix Django 1.8+ tests for stale content type
## Code After:
from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter what, the ContentItem.__str__() should work.
This would break the admin delete screen otherwise.
"""
c = ContentType()
c.save()
a = ContentItem(polymorphic_ctype=c)
self.assertEqual(str(a), "'(type deleted) 0' in 'None None'")
| from django.contrib.contenttypes.models import ContentType
from fluent_contents.models import ContentItem
from fluent_contents.tests.utils import AppTestCase
class ModelTests(AppTestCase):
"""
Testing the data model.
"""
def test_stale_model_str(self):
"""
No matter what, the ContentItem.__str__() should work.
This would break the admin delete screen otherwise.
"""
c = ContentType()
+ c.save()
a = ContentItem(polymorphic_ctype=c)
self.assertEqual(str(a), "'(type deleted) 0' in 'None None'") | 1 | 0.052632 | 1 | 0 |
36b82b346454b4d0d0c4c19e0e9ca9e888f23a3e | .travis-create-release.sh | .travis-create-release.sh |
if [ "$1" == osx ]; then
make -f Makefile.in \
DISTTARVARS="NAME=_srcdist TAR_COMMAND='\$\$(TAR) \$\$(TARFLAGS) -s \"|^|\$\$(NAME)/|\" -T \$\$(TARFILE).list -cvf -' TARFLAGS='-n' TARFILE=_srcdist.tar" SHELL='sh -vx' dist
else
make -f Makefile.in DISTTARVARS='TARFILE=_srcdist.tar NAME=_srcdist' SHELL='sh -v' dist
fi
|
./Configure dist
if [ "$1" == osx ]; then
make NAME='_srcdist' TARFLAGS='-n' TARFILE='_srcdist.tar' \
TAR_COMMAND='$(TAR) $(TARFLAGS) -s "|^|$(NAME)/|" -T $(TARFILE).list -cvf -' \
SHELL='sh -vx' tar
else
make TARFILE='_srcdist.tar' NAME='_srcdist' SHELL='sh -v' dist
fi
| Configure first in travis create release | Configure first in travis create release
Reviewed-by: Rich Salz <c04971a99e5a9ee80eaab4b1deb37e845b0bd697@openssl.org>
| Shell | apache-2.0 | openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl,openssl/openssl | shell | ## Code Before:
if [ "$1" == osx ]; then
make -f Makefile.in \
DISTTARVARS="NAME=_srcdist TAR_COMMAND='\$\$(TAR) \$\$(TARFLAGS) -s \"|^|\$\$(NAME)/|\" -T \$\$(TARFILE).list -cvf -' TARFLAGS='-n' TARFILE=_srcdist.tar" SHELL='sh -vx' dist
else
make -f Makefile.in DISTTARVARS='TARFILE=_srcdist.tar NAME=_srcdist' SHELL='sh -v' dist
fi
## Instruction:
Configure first in travis create release
Reviewed-by: Rich Salz <c04971a99e5a9ee80eaab4b1deb37e845b0bd697@openssl.org>
## Code After:
./Configure dist
if [ "$1" == osx ]; then
make NAME='_srcdist' TARFLAGS='-n' TARFILE='_srcdist.tar' \
TAR_COMMAND='$(TAR) $(TARFLAGS) -s "|^|$(NAME)/|" -T $(TARFILE).list -cvf -' \
SHELL='sh -vx' tar
else
make TARFILE='_srcdist.tar' NAME='_srcdist' SHELL='sh -v' dist
fi
|
+ ./Configure dist
if [ "$1" == osx ]; then
- make -f Makefile.in \
- DISTTARVARS="NAME=_srcdist TAR_COMMAND='\$\$(TAR) \$\$(TARFLAGS) -s \"|^|\$\$(NAME)/|\" -T \$\$(TARFILE).list -cvf -' TARFLAGS='-n' TARFILE=_srcdist.tar" SHELL='sh -vx' dist
+ make NAME='_srcdist' TARFLAGS='-n' TARFILE='_srcdist.tar' \
+ TAR_COMMAND='$(TAR) $(TARFLAGS) -s "|^|$(NAME)/|" -T $(TARFILE).list -cvf -' \
+ SHELL='sh -vx' tar
else
- make -f Makefile.in DISTTARVARS='TARFILE=_srcdist.tar NAME=_srcdist' SHELL='sh -v' dist
? ----------------------------
+ make TARFILE='_srcdist.tar' NAME='_srcdist' SHELL='sh -v' dist
? + + +
fi | 8 | 1.142857 | 5 | 3 |
234f6f8f9c8170ee1f8ef181eb8edeea23abeb70 | app/workers/extract_extension_license_worker.rb | app/workers/extract_extension_license_worker.rb | class ExtractExtensionLicenseWorker
include Sidekiq::Worker
def perform(extension_id)
@extension = Extension.find(extension_id)
@repo = octokit.repo(@extension.github_repo, accept: "application/vnd.github.drax-preview+json")
if @repo[:license]
license = octokit.license(@repo[:license][:key], accept: "application/vnd.github.drax-preview+json")
@extension.update_attributes(
license_name: license[:name],
license_text: license[:body]
)
end
end
private
def octokit
@octokit ||= @extension.octokit
end
end
| class ExtractExtensionLicenseWorker
include Sidekiq::Worker
def perform(extension_id)
@extension = Extension.find(extension_id)
@repo = octokit.repo(@extension.github_repo, accept: "application/vnd.github.drax-preview+json")
if @repo[:license]
begin
license = octokit.license(@repo[:license][:key], accept: "application/vnd.github.drax-preview+json")
rescue Octokit::NotFound
license = {
name: @repo[:license][:name],
body: ""
}
end
@extension.update_attributes(
license_name: license[:name],
license_text: license[:body]
)
end
end
private
def octokit
@octokit ||= @extension.octokit
end
end
| Handle licenses with nonexistent keys | Handle licenses with nonexistent keys
| Ruby | apache-2.0 | ManageIQ/depot.manageiq.org,ManageIQ/depot.manageiq.org,ManageIQ/depot.manageiq.org,ManageIQ/depot.manageiq.org | ruby | ## Code Before:
class ExtractExtensionLicenseWorker
include Sidekiq::Worker
def perform(extension_id)
@extension = Extension.find(extension_id)
@repo = octokit.repo(@extension.github_repo, accept: "application/vnd.github.drax-preview+json")
if @repo[:license]
license = octokit.license(@repo[:license][:key], accept: "application/vnd.github.drax-preview+json")
@extension.update_attributes(
license_name: license[:name],
license_text: license[:body]
)
end
end
private
def octokit
@octokit ||= @extension.octokit
end
end
## Instruction:
Handle licenses with nonexistent keys
## Code After:
class ExtractExtensionLicenseWorker
include Sidekiq::Worker
def perform(extension_id)
@extension = Extension.find(extension_id)
@repo = octokit.repo(@extension.github_repo, accept: "application/vnd.github.drax-preview+json")
if @repo[:license]
begin
license = octokit.license(@repo[:license][:key], accept: "application/vnd.github.drax-preview+json")
rescue Octokit::NotFound
license = {
name: @repo[:license][:name],
body: ""
}
end
@extension.update_attributes(
license_name: license[:name],
license_text: license[:body]
)
end
end
private
def octokit
@octokit ||= @extension.octokit
end
end
| class ExtractExtensionLicenseWorker
include Sidekiq::Worker
def perform(extension_id)
@extension = Extension.find(extension_id)
@repo = octokit.repo(@extension.github_repo, accept: "application/vnd.github.drax-preview+json")
if @repo[:license]
+ begin
- license = octokit.license(@repo[:license][:key], accept: "application/vnd.github.drax-preview+json")
+ license = octokit.license(@repo[:license][:key], accept: "application/vnd.github.drax-preview+json")
? ++
+ rescue Octokit::NotFound
+ license = {
+ name: @repo[:license][:name],
+ body: ""
+ }
+ end
@extension.update_attributes(
license_name: license[:name],
license_text: license[:body]
)
end
end
private
def octokit
@octokit ||= @extension.octokit
end
end | 9 | 0.375 | 8 | 1 |
26c6d87461298602b6f1cef7623654d4eb1c9e10 | postfix/adjust-postfix-configuration-file.sh | postfix/adjust-postfix-configuration-file.sh | . /tmp/settings.conf
sed -i -e "s/%primaryhost%/${MAILHOSTNAME}/g" /etc/php5/fpm/php.ini
| . /tmp/settings.conf
sed -i -e "s/%primaryhost%/${MAILHOSTNAME}/g" /etc/postfix/main.cf
| Fix typo in sed command | Fix typo in sed command
| Shell | mit | frdmn/docker-mailbox | shell | ## Code Before:
. /tmp/settings.conf
sed -i -e "s/%primaryhost%/${MAILHOSTNAME}/g" /etc/php5/fpm/php.ini
## Instruction:
Fix typo in sed command
## Code After:
. /tmp/settings.conf
sed -i -e "s/%primaryhost%/${MAILHOSTNAME}/g" /etc/postfix/main.cf
| . /tmp/settings.conf
- sed -i -e "s/%primaryhost%/${MAILHOSTNAME}/g" /etc/php5/fpm/php.ini
? ^^^ -- ^^^^^ ^
+ sed -i -e "s/%primaryhost%/${MAILHOSTNAME}/g" /etc/postfix/main.cf
? ^^^^^^ ^ ^^^
| 2 | 0.666667 | 1 | 1 |
978e06b860edfb8ab2a51048f375837231687517 | django/tasks/50-server/10-supervisor.yml | django/tasks/50-server/10-supervisor.yml | ---
# setup the django service in supervisor
- name: create service log directory
file: path="{{ service_log_path }}"
owner={{ service_user }}
group={{ service_group }}
mode=0755
state=directory
- name: configure service in supervisor
template: >
src="supervisor/service_group.conf.j2"
dest="/etc/supervisor/conf.d/{{ service_name }}.conf"
backup=yes
notify:
- supervisor reread
- supervisor update
- restart service group
| ---
# setup the django service in supervisor
- name: create service log directory
file: path="{{ service_log_path }}"
owner={{ service_user }}
group={{ service_group }}
mode=0755
state=directory
- name: stop all
supervisorctl: >
name="all"
state=stopped
- name: configure service in supervisor
template: >
src="supervisor/service_group.conf.j2"
dest="/etc/supervisor/conf.d/{{ service_name }}.conf"
backup=yes
notify:
- supervisor reread
- supervisor update
- restart service group
| Stop all processes before reconfiguring | Stop all processes before reconfiguring
| YAML | mit | fdemmer/ansible_roles | yaml | ## Code Before:
---
# setup the django service in supervisor
- name: create service log directory
file: path="{{ service_log_path }}"
owner={{ service_user }}
group={{ service_group }}
mode=0755
state=directory
- name: configure service in supervisor
template: >
src="supervisor/service_group.conf.j2"
dest="/etc/supervisor/conf.d/{{ service_name }}.conf"
backup=yes
notify:
- supervisor reread
- supervisor update
- restart service group
## Instruction:
Stop all processes before reconfiguring
## Code After:
---
# setup the django service in supervisor
- name: create service log directory
file: path="{{ service_log_path }}"
owner={{ service_user }}
group={{ service_group }}
mode=0755
state=directory
- name: stop all
supervisorctl: >
name="all"
state=stopped
- name: configure service in supervisor
template: >
src="supervisor/service_group.conf.j2"
dest="/etc/supervisor/conf.d/{{ service_name }}.conf"
backup=yes
notify:
- supervisor reread
- supervisor update
- restart service group
| ---
# setup the django service in supervisor
- name: create service log directory
file: path="{{ service_log_path }}"
owner={{ service_user }}
group={{ service_group }}
mode=0755
state=directory
+ - name: stop all
+ supervisorctl: >
+ name="all"
+ state=stopped
+
- name: configure service in supervisor
template: >
src="supervisor/service_group.conf.j2"
dest="/etc/supervisor/conf.d/{{ service_name }}.conf"
backup=yes
notify:
- supervisor reread
- supervisor update
- restart service group | 5 | 0.263158 | 5 | 0 |
7a81ad86f0ba2b247241f9cbdd7d515e7d13ff3a | src/Manifest-Core/ClassTestCase.extension.st | src/Manifest-Core/ClassTestCase.extension.st | Extension { #name : #ClassTestCase }
{ #category : #'*Manifest-Core' }
ClassTestCase >> assertValidLintRule: aLintRule [
| runner |
runner := ReSmalllintChecker new.
runner
rule: {aLintRule};
environment: RBBrowserEnvironment default;
run.
self
assert: (runner criticsOf: aLintRule) isEmpty
description: [ aLintRule rationale ]
]
{ #category : #'*Manifest-Core' }
ClassTestCase >> targetClassEnvironment [
^RBClassEnvironment class: self targetClass.
]
| Extension { #name : #ClassTestCase }
{ #category : #'*Manifest-Core' }
ClassTestCase >> assertValidLintRule: aLintRule [
| runner |
runner := ReSmalllintChecker new.
runner
rule: {aLintRule};
environment: self targetClassEnvironment;
run.
self
assert: (runner criticsOf: aLintRule) isEmpty
description: [ aLintRule rationale ]
]
{ #category : #'*Manifest-Core' }
ClassTestCase >> targetClassEnvironment [
^RBClassEnvironment class: self targetClass.
]
| Use targetClassEnvironment in ClassTestCase rule validation | Use targetClassEnvironment in ClassTestCase rule validation | Smalltalk | mit | estebanlm/pharo,estebanlm/pharo,estebanlm/pharo | smalltalk | ## Code Before:
Extension { #name : #ClassTestCase }
{ #category : #'*Manifest-Core' }
ClassTestCase >> assertValidLintRule: aLintRule [
| runner |
runner := ReSmalllintChecker new.
runner
rule: {aLintRule};
environment: RBBrowserEnvironment default;
run.
self
assert: (runner criticsOf: aLintRule) isEmpty
description: [ aLintRule rationale ]
]
{ #category : #'*Manifest-Core' }
ClassTestCase >> targetClassEnvironment [
^RBClassEnvironment class: self targetClass.
]
## Instruction:
Use targetClassEnvironment in ClassTestCase rule validation
## Code After:
Extension { #name : #ClassTestCase }
{ #category : #'*Manifest-Core' }
ClassTestCase >> assertValidLintRule: aLintRule [
| runner |
runner := ReSmalllintChecker new.
runner
rule: {aLintRule};
environment: self targetClassEnvironment;
run.
self
assert: (runner criticsOf: aLintRule) isEmpty
description: [ aLintRule rationale ]
]
{ #category : #'*Manifest-Core' }
ClassTestCase >> targetClassEnvironment [
^RBClassEnvironment class: self targetClass.
]
| Extension { #name : #ClassTestCase }
{ #category : #'*Manifest-Core' }
ClassTestCase >> assertValidLintRule: aLintRule [
| runner |
runner := ReSmalllintChecker new.
runner
rule: {aLintRule};
- environment: RBBrowserEnvironment default;
+ environment: self targetClassEnvironment;
run.
self
assert: (runner criticsOf: aLintRule) isEmpty
description: [ aLintRule rationale ]
]
{ #category : #'*Manifest-Core' }
ClassTestCase >> targetClassEnvironment [
^RBClassEnvironment class: self targetClass.
] | 2 | 0.105263 | 1 | 1 |
6964fe3c9a5435398b54e6feba719ba88e4d6179 | README.md | README.md | ZainRizvi.github.io
===================
My GitHub site
| ZainRizvi.github.io
===================
[](https://travis-ci.org/ZainRizvi/ZainRizvi.github.io)
My GitHub site
| Add Travis CI build status tag | Add Travis CI build status tag
| Markdown | mit | ZainRizvi/ZainRizvi.github.io,ZainRizvi/ZainRizvi.github.io,ZainRizvi/ZainRizvi.github.io | markdown | ## Code Before:
ZainRizvi.github.io
===================
My GitHub site
## Instruction:
Add Travis CI build status tag
## Code After:
ZainRizvi.github.io
===================
[](https://travis-ci.org/ZainRizvi/ZainRizvi.github.io)
My GitHub site
| ZainRizvi.github.io
===================
+ [](https://travis-ci.org/ZainRizvi/ZainRizvi.github.io)
+
My GitHub site | 2 | 0.5 | 2 | 0 |
ef2e93fc9e65289464f733175e6e6577cc93ecc1 | _data/navigation.yml | _data/navigation.yml | main:
- title: 'News'
url: /news
- title: 'Demo'
url: /demo
- title: 'Hosting'
url: /foodsoft-hosting
- title: '<i class="fa fa-github"></i>'
url: https://github.com/foodcoops/foodsoft
links:
- title: 'Foodsoft'
children:
- title: 'Demo'
url: /demo
- title: 'Hosting'
url: /foodsoft-hosting
- title: 'Wiki'
url: https://github.com/foodcoops/foodsoft/wiki
- title: 'Support'
url: https://github.com/foodcoops/foodsoft/wiki/Support
- title: 'Mailing-list'
url: http://foodsoft.274.s1.nabble.com/foodsoft-discuss-f5.html
- title: 'List of users'
url: https://github.com/foodcoops/foodsoft/wiki/Users
- title: 'German'
children:
- title: 'Foodcoopedia'
url: http://foodcoopedia.de.fcoop.org
- title: 'Gründungsleitfaden'
url: https://food-coop-einstieg.de/
- title: 'foodcoops.net'
url: https://foodcoops.net/
- title: 'foodcoops.at'
url: https://foodcoops.at/
- title: 'foodcoops.de'
url: http://foodcoops.de/
| main:
- title: 'News'
url: /news
- title: 'Demo'
url: /demo
- title: 'Hosting'
url: /foodsoft-hosting
- title: '<i class="fa fa-github"></i>'
url: https://github.com/foodcoops/foodsoft
links:
- title: 'Foodsoft'
children:
- title: 'Demo'
url: /demo
- title: 'Hosting'
url: /foodsoft-hosting
- title: 'Status page'
url: https://status.foodcoops.net
- title: 'Wiki'
url: https://github.com/foodcoops/foodsoft/wiki
- title: 'Support'
url: https://github.com/foodcoops/foodsoft/wiki/Support
- title: 'Mailing list'
url: http://foodsoft.274.s1.nabble.com/foodsoft-discuss-f5.html
- title: 'List of users'
url: https://github.com/foodcoops/foodsoft/wiki/Users
- title: 'German'
children:
- title: 'Foodcoopedia'
url: http://foodcoopedia.de.fcoop.org
- title: 'Gründungsleitfaden'
url: https://food-coop-einstieg.de/
- title: 'foodcoops.net'
url: https://foodcoops.net/
- title: 'foodcoops.at'
url: https://foodcoops.at/
- title: 'foodcoops.de'
url: http://foodcoops.de/
| Add link to status page | Add link to status page | YAML | mit | foodcoops/foodcoops.github.io,foodcoops/foodcoops.github.io,foodcoops/foodcoops.github.io | yaml | ## Code Before:
main:
- title: 'News'
url: /news
- title: 'Demo'
url: /demo
- title: 'Hosting'
url: /foodsoft-hosting
- title: '<i class="fa fa-github"></i>'
url: https://github.com/foodcoops/foodsoft
links:
- title: 'Foodsoft'
children:
- title: 'Demo'
url: /demo
- title: 'Hosting'
url: /foodsoft-hosting
- title: 'Wiki'
url: https://github.com/foodcoops/foodsoft/wiki
- title: 'Support'
url: https://github.com/foodcoops/foodsoft/wiki/Support
- title: 'Mailing-list'
url: http://foodsoft.274.s1.nabble.com/foodsoft-discuss-f5.html
- title: 'List of users'
url: https://github.com/foodcoops/foodsoft/wiki/Users
- title: 'German'
children:
- title: 'Foodcoopedia'
url: http://foodcoopedia.de.fcoop.org
- title: 'Gründungsleitfaden'
url: https://food-coop-einstieg.de/
- title: 'foodcoops.net'
url: https://foodcoops.net/
- title: 'foodcoops.at'
url: https://foodcoops.at/
- title: 'foodcoops.de'
url: http://foodcoops.de/
## Instruction:
Add link to status page
## Code After:
main:
- title: 'News'
url: /news
- title: 'Demo'
url: /demo
- title: 'Hosting'
url: /foodsoft-hosting
- title: '<i class="fa fa-github"></i>'
url: https://github.com/foodcoops/foodsoft
links:
- title: 'Foodsoft'
children:
- title: 'Demo'
url: /demo
- title: 'Hosting'
url: /foodsoft-hosting
- title: 'Status page'
url: https://status.foodcoops.net
- title: 'Wiki'
url: https://github.com/foodcoops/foodsoft/wiki
- title: 'Support'
url: https://github.com/foodcoops/foodsoft/wiki/Support
- title: 'Mailing list'
url: http://foodsoft.274.s1.nabble.com/foodsoft-discuss-f5.html
- title: 'List of users'
url: https://github.com/foodcoops/foodsoft/wiki/Users
- title: 'German'
children:
- title: 'Foodcoopedia'
url: http://foodcoopedia.de.fcoop.org
- title: 'Gründungsleitfaden'
url: https://food-coop-einstieg.de/
- title: 'foodcoops.net'
url: https://foodcoops.net/
- title: 'foodcoops.at'
url: https://foodcoops.at/
- title: 'foodcoops.de'
url: http://foodcoops.de/
| main:
- title: 'News'
url: /news
- title: 'Demo'
url: /demo
- title: 'Hosting'
url: /foodsoft-hosting
- title: '<i class="fa fa-github"></i>'
url: https://github.com/foodcoops/foodsoft
links:
- title: 'Foodsoft'
children:
- title: 'Demo'
url: /demo
- title: 'Hosting'
url: /foodsoft-hosting
+ - title: 'Status page'
+ url: https://status.foodcoops.net
- title: 'Wiki'
url: https://github.com/foodcoops/foodsoft/wiki
- title: 'Support'
url: https://github.com/foodcoops/foodsoft/wiki/Support
- - title: 'Mailing-list'
? ^
+ - title: 'Mailing list'
? ^
url: http://foodsoft.274.s1.nabble.com/foodsoft-discuss-f5.html
- title: 'List of users'
url: https://github.com/foodcoops/foodsoft/wiki/Users
- title: 'German'
children:
- title: 'Foodcoopedia'
url: http://foodcoopedia.de.fcoop.org
- title: 'Gründungsleitfaden'
url: https://food-coop-einstieg.de/
- title: 'foodcoops.net'
url: https://foodcoops.net/
- title: 'foodcoops.at'
url: https://foodcoops.at/
- title: 'foodcoops.de'
url: http://foodcoops.de/ | 4 | 0.105263 | 3 | 1 |
f2f692d91b8d9be7d7a68e4882a35d329e2490df | README.md | README.md |
A JOSE implementation in Python
### Principles
This is a JOSE implementation that is meant to be simple to use, both on and off of AppEngine.
### Thanks
This library is based heavily on the work of the guys over at [PyJWT](https://github.com/jpadilla/pyjwt).
|
A JOSE implementation in Python
[](https://travis-ci.org/mpdavis/jose)
### Principles
This is a JOSE implementation that is meant to be simple to use, both on and off of AppEngine.
### Thanks
This library is based heavily on the work of the guys over at [PyJWT](https://github.com/jpadilla/pyjwt).
| Add travis ci build badge | Add travis ci build badge
| Markdown | mit | mpdavis/python-jose | markdown | ## Code Before:
A JOSE implementation in Python
### Principles
This is a JOSE implementation that is meant to be simple to use, both on and off of AppEngine.
### Thanks
This library is based heavily on the work of the guys over at [PyJWT](https://github.com/jpadilla/pyjwt).
## Instruction:
Add travis ci build badge
## Code After:
A JOSE implementation in Python
[](https://travis-ci.org/mpdavis/jose)
### Principles
This is a JOSE implementation that is meant to be simple to use, both on and off of AppEngine.
### Thanks
This library is based heavily on the work of the guys over at [PyJWT](https://github.com/jpadilla/pyjwt).
|
A JOSE implementation in Python
+
+ [](https://travis-ci.org/mpdavis/jose)
### Principles
This is a JOSE implementation that is meant to be simple to use, both on and off of AppEngine.
### Thanks
This library is based heavily on the work of the guys over at [PyJWT](https://github.com/jpadilla/pyjwt). | 2 | 0.181818 | 2 | 0 |
b460ef197fbc662e7689369142ddab3a0971a33b | app/directives/SelectOnClick.js | app/directives/SelectOnClick.js | angular.module('app')
.directive('selectOnClick', function () {
return {
restrict: 'A',
link: function (scope, element) {
var focusedElement;
element.on('click', function () {
if (focusedElement != this) {
this.select();
focusedElement = this;
}
});
element.on('blur', function () {
focusedElement = null;
});
}
};
}) | angular.module('app')
.directive('selectOnClick', function () {
return {
restrict: 'A',
link: function (scope, element) {
var focusedElement;
element.on('click', function () {
if (focusedElement != this) {
this.setSelectionRange(0, this.value.length);
focusedElement = this;
}
});
element.on('blur', function () {
focusedElement = null;
});
}
};
}) | Fix issue with selecting text input on iOS | Fix issue with selecting text input on iOS
| JavaScript | mit | olyckne/FO,olyckne/FO | javascript | ## Code Before:
angular.module('app')
.directive('selectOnClick', function () {
return {
restrict: 'A',
link: function (scope, element) {
var focusedElement;
element.on('click', function () {
if (focusedElement != this) {
this.select();
focusedElement = this;
}
});
element.on('blur', function () {
focusedElement = null;
});
}
};
})
## Instruction:
Fix issue with selecting text input on iOS
## Code After:
angular.module('app')
.directive('selectOnClick', function () {
return {
restrict: 'A',
link: function (scope, element) {
var focusedElement;
element.on('click', function () {
if (focusedElement != this) {
this.setSelectionRange(0, this.value.length);
focusedElement = this;
}
});
element.on('blur', function () {
focusedElement = null;
});
}
};
}) | angular.module('app')
.directive('selectOnClick', function () {
return {
restrict: 'A',
link: function (scope, element) {
var focusedElement;
element.on('click', function () {
if (focusedElement != this) {
- this.select();
+ this.setSelectionRange(0, this.value.length);
focusedElement = this;
}
});
element.on('blur', function () {
focusedElement = null;
});
}
};
}) | 2 | 0.111111 | 1 | 1 |
07512634d5e87390d640971cc03cea1ab7fd22a4 | app/views/plans/edit.html.erb | app/views/plans/edit.html.erb | <%= render 'form' %>
<%= render partial: 'change_visibility', locals: {:plan_id => params[:id]} %>
<%= render partial: 'comments/form', locals: {:plan_id => params[:id]} %> | <%= render 'form' %>
<div id = 'visibility_dialog_form'>
<%= render partial: 'change_visibility', locals: {:plan_id => params[:id]} %>
</div>
<div id = "comment_dialog_form">
<%= render partial: 'comments/form', locals: {:plan_id => params[:id]} %>
</div> | Refactor edit view in Plans | Refactor edit view in Plans
| HTML+ERB | mit | derDaywalker/dmptool,derDaywalker/dmptool,2015SebINF1340/dmptool,2015SebINF1340/dmptool,derDaywalker/dmptool,derDaywalker/dmptool,2015SebINF1340/dmptool | html+erb | ## Code Before:
<%= render 'form' %>
<%= render partial: 'change_visibility', locals: {:plan_id => params[:id]} %>
<%= render partial: 'comments/form', locals: {:plan_id => params[:id]} %>
## Instruction:
Refactor edit view in Plans
## Code After:
<%= render 'form' %>
<div id = 'visibility_dialog_form'>
<%= render partial: 'change_visibility', locals: {:plan_id => params[:id]} %>
</div>
<div id = "comment_dialog_form">
<%= render partial: 'comments/form', locals: {:plan_id => params[:id]} %>
</div> | <%= render 'form' %>
+
+ <div id = 'visibility_dialog_form'>
- <%= render partial: 'change_visibility', locals: {:plan_id => params[:id]} %>
+ <%= render partial: 'change_visibility', locals: {:plan_id => params[:id]} %>
? +
+ </div>
+ <div id = "comment_dialog_form">
- <%= render partial: 'comments/form', locals: {:plan_id => params[:id]} %>
+ <%= render partial: 'comments/form', locals: {:plan_id => params[:id]} %>
? +
+ </div> | 9 | 3 | 7 | 2 |
cfe60e7eb55f1c0bfc6912477e8e768e71d07cf0 | app/frontend/root.jsx | app/frontend/root.jsx | import React from "react"
import {linkTo} from "./utils"
class Header extends React.Component {
onClick = (ev) => {
ev.preventDefault()
window.location = linkTo("/")
}
render() {
return <header id="header" onClick={this.onClick}>
<h1>Cashout</h1>
</header>
}
}
class Root extends React.Component {
render() {
return <div>
<Header />
{this.props.children}
</div>
}
}
export {Root}
| import React from "react"
import {linkTo} from "./utils"
class Header extends React.Component {
render() {
return <header id="header">
<h1>Cashout</h1>
</header>
}
}
class Root extends React.Component {
render() {
return <div>
<Header />
{this.props.children}
</div>
}
}
export {Root}
| Remove reload on header click | Remove reload on header click
| JSX | mit | daGrevis/cashout,daGrevis/cashout,daGrevis/cashout | jsx | ## Code Before:
import React from "react"
import {linkTo} from "./utils"
class Header extends React.Component {
onClick = (ev) => {
ev.preventDefault()
window.location = linkTo("/")
}
render() {
return <header id="header" onClick={this.onClick}>
<h1>Cashout</h1>
</header>
}
}
class Root extends React.Component {
render() {
return <div>
<Header />
{this.props.children}
</div>
}
}
export {Root}
## Instruction:
Remove reload on header click
## Code After:
import React from "react"
import {linkTo} from "./utils"
class Header extends React.Component {
render() {
return <header id="header">
<h1>Cashout</h1>
</header>
}
}
class Root extends React.Component {
render() {
return <div>
<Header />
{this.props.children}
</div>
}
}
export {Root}
| import React from "react"
import {linkTo} from "./utils"
class Header extends React.Component {
- onClick = (ev) => {
- ev.preventDefault()
-
- window.location = linkTo("/")
- }
-
render() {
- return <header id="header" onClick={this.onClick}>
? -----------------------
+ return <header id="header">
<h1>Cashout</h1>
</header>
}
}
class Root extends React.Component {
render() {
return <div>
<Header />
{this.props.children}
</div>
}
}
export {Root} | 8 | 0.25 | 1 | 7 |
a4806dbbd99494b4e92340e213b63dbf6218ff3e | statirator/blog/templates/blog/post_excerpt.html | statirator/blog/templates/blog/post_excerpt.html | {% load i18n %}
<article class="post-excerpt">
<header>
<h1>{{ post.title }}</h1>
</header>
{% with post_url=post.get_absolute_url %}
{% if post.image %}
<div class="post-image"><a href="{{ post_url }}"><img src="{{ STATIC_URL }}{{ post.image }}" alt="{{ post.title }}"></a></div>
{% endif %}
{{ post.excerpt }}
<footer>
<a href="{{ post_url }}">{% trans "Read more" %}</a>
</footer>
{% endwith %}
</article>
| {% load i18n disqus_tags %}
<article class="post-excerpt">
<header>
<h1>{{ post.title }}</h1>
</header>
{% with post_url=post.get_absolute_url %}
{% if post.image %}
<div class="post-image"><a href="{{ post_url }}"><img src="{{ STATIC_URL }}{{ post.image }}" alt="{{ post.title }}"></a></div>
{% endif %}
{{ post.excerpt }}
<footer>
<a href="{{ post_url }}">{% trans "Read more" %}</a>
<a href="{{ post_url }}#disqus_thread" data-disqus-identifier="{{ post.slug }}_{{ post.lang }}">{% trans "Read more" %}</a>{% disqus_num_replies %}
</footer>
{% endwith %}
</article>
| Add num replies to post excerpt | Add num replies to post excerpt
| HTML | mit | MeirKriheli/statirator,MeirKriheli/statirator,MeirKriheli/statirator | html | ## Code Before:
{% load i18n %}
<article class="post-excerpt">
<header>
<h1>{{ post.title }}</h1>
</header>
{% with post_url=post.get_absolute_url %}
{% if post.image %}
<div class="post-image"><a href="{{ post_url }}"><img src="{{ STATIC_URL }}{{ post.image }}" alt="{{ post.title }}"></a></div>
{% endif %}
{{ post.excerpt }}
<footer>
<a href="{{ post_url }}">{% trans "Read more" %}</a>
</footer>
{% endwith %}
</article>
## Instruction:
Add num replies to post excerpt
## Code After:
{% load i18n disqus_tags %}
<article class="post-excerpt">
<header>
<h1>{{ post.title }}</h1>
</header>
{% with post_url=post.get_absolute_url %}
{% if post.image %}
<div class="post-image"><a href="{{ post_url }}"><img src="{{ STATIC_URL }}{{ post.image }}" alt="{{ post.title }}"></a></div>
{% endif %}
{{ post.excerpt }}
<footer>
<a href="{{ post_url }}">{% trans "Read more" %}</a>
<a href="{{ post_url }}#disqus_thread" data-disqus-identifier="{{ post.slug }}_{{ post.lang }}">{% trans "Read more" %}</a>{% disqus_num_replies %}
</footer>
{% endwith %}
</article>
| - {% load i18n %}
+ {% load i18n disqus_tags %}
<article class="post-excerpt">
<header>
<h1>{{ post.title }}</h1>
</header>
{% with post_url=post.get_absolute_url %}
{% if post.image %}
<div class="post-image"><a href="{{ post_url }}"><img src="{{ STATIC_URL }}{{ post.image }}" alt="{{ post.title }}"></a></div>
{% endif %}
{{ post.excerpt }}
<footer>
<a href="{{ post_url }}">{% trans "Read more" %}</a>
+ <a href="{{ post_url }}#disqus_thread" data-disqus-identifier="{{ post.slug }}_{{ post.lang }}">{% trans "Read more" %}</a>{% disqus_num_replies %}
</footer>
{% endwith %}
</article> | 3 | 0.2 | 2 | 1 |
a8f2c35fd603f82699840b5c1069e60a4a2fd31f | config/environments.yml | config/environments.yml | qa:
servers:
api: http://qa.mobcastdev.com/service/catalogue/
dev_int:
servers:
api: https://api.dev.bbbtest2.com/service/catalogue/
local:
servers:
api: http://localhost:9128/catalogue/
| dev_int:
servers:
api: https://api.dev.bbbtest2.com/service/catalogue/
search: https://api.dev.bbbtest2.com/service/search/
local:
servers:
api: http://localhost:7001/catalogue/
search: http://localhost:9595/catalogue/search/
| Add config for search service | Add config for search service
| YAML | mit | blinkboxbooks/catalogue-v2.scala | yaml | ## Code Before:
qa:
servers:
api: http://qa.mobcastdev.com/service/catalogue/
dev_int:
servers:
api: https://api.dev.bbbtest2.com/service/catalogue/
local:
servers:
api: http://localhost:9128/catalogue/
## Instruction:
Add config for search service
## Code After:
dev_int:
servers:
api: https://api.dev.bbbtest2.com/service/catalogue/
search: https://api.dev.bbbtest2.com/service/search/
local:
servers:
api: http://localhost:7001/catalogue/
search: http://localhost:9595/catalogue/search/
| - qa:
- servers:
- api: http://qa.mobcastdev.com/service/catalogue/
-
dev_int:
servers:
api: https://api.dev.bbbtest2.com/service/catalogue/
+ search: https://api.dev.bbbtest2.com/service/search/
local:
servers:
- api: http://localhost:9128/catalogue/
? ^ --
+ api: http://localhost:7001/catalogue/
? ^^^
+ search: http://localhost:9595/catalogue/search/ | 8 | 0.727273 | 3 | 5 |
46089f35c0c03fc249e73eb8f0523e80ed268853 | docs/static/custom.css | docs/static/custom.css | /* foo bar! */
.navbar-default {
background-color: #545f66;
}
.navbar-default .navbar-brand {
color: #ffffff;
}
.navbar-default .navbar-nav>li>a {
color: #ffffff;
}
.alert-info {
background-color: #b6dcfe;
}
.alert {
color: #6b6b6b;
}
| /* foo bar! */
.navbar-default {
background-color: #545f66;
}
.navbar-default .navbar-brand {
color: #ffffff;
}
.navbar-default .navbar-nav>li>a {
color: #ffffff;
}
.alert-info {
background-color: #b6dcfe;
}
.alert {
color: #6b6b6b;
}
.alert a:not(.close) {
color: #545f66;
} | Fix color of links in doc note boxes. | Fix color of links in doc note boxes.
| CSS | mit | wglass/collectd-haproxy | css | ## Code Before:
/* foo bar! */
.navbar-default {
background-color: #545f66;
}
.navbar-default .navbar-brand {
color: #ffffff;
}
.navbar-default .navbar-nav>li>a {
color: #ffffff;
}
.alert-info {
background-color: #b6dcfe;
}
.alert {
color: #6b6b6b;
}
## Instruction:
Fix color of links in doc note boxes.
## Code After:
/* foo bar! */
.navbar-default {
background-color: #545f66;
}
.navbar-default .navbar-brand {
color: #ffffff;
}
.navbar-default .navbar-nav>li>a {
color: #ffffff;
}
.alert-info {
background-color: #b6dcfe;
}
.alert {
color: #6b6b6b;
}
.alert a:not(.close) {
color: #545f66;
} | /* foo bar! */
.navbar-default {
background-color: #545f66;
}
.navbar-default .navbar-brand {
color: #ffffff;
}
.navbar-default .navbar-nav>li>a {
color: #ffffff;
}
.alert-info {
background-color: #b6dcfe;
}
.alert {
color: #6b6b6b;
}
+ .alert a:not(.close) {
+ color: #545f66;
+ } | 3 | 0.1875 | 3 | 0 |
eb40ba04518b76bc074865114e46e8bc9f549333 | .travis.yml | .travis.yml | cache: bundler
language: ruby
sudo: false
rvm:
- 2.1
- 2.2.4
- 2.3.0
before_install:
- gem install bundler -v '~> 1.10'
env:
- rails=4.2.0
- rails=5.0.0.beta3
matrix:
exclude:
- env: rails=5.0.0.beta3
rvm: 2.1
| cache: bundler
language: ruby
sudo: false
rvm:
- 2.1
- 2.2.4
- 2.3.0
before_install:
- gem install bundler -v '~> 1.10'
env:
- rails=4.2.0
- rails=5.0.0.rc1
matrix:
exclude:
- env: rails=5.0.0.rc1
rvm: 2.1
| Test against Rails 5 RC1 | Test against Rails 5 RC1
| YAML | mit | EasterAndJay/doorkeeper,moneytree/doorkeeper,jasl/doorkeeper,nbulaj/doorkeeper,doorkeeper-gem/doorkeeper,moneytree/doorkeeper,mavenlink/doorkeeper,doorkeeper-gem/doorkeeper,mavenlink/doorkeeper,nbulaj/doorkeeper,jasl/doorkeeper,mavenlink/doorkeeper,doorkeeper-gem/doorkeeper,jasl/doorkeeper,outstand/doorkeeper,outstand/doorkeeper,outstand/doorkeeper,EasterAndJay/doorkeeper | yaml | ## Code Before:
cache: bundler
language: ruby
sudo: false
rvm:
- 2.1
- 2.2.4
- 2.3.0
before_install:
- gem install bundler -v '~> 1.10'
env:
- rails=4.2.0
- rails=5.0.0.beta3
matrix:
exclude:
- env: rails=5.0.0.beta3
rvm: 2.1
## Instruction:
Test against Rails 5 RC1
## Code After:
cache: bundler
language: ruby
sudo: false
rvm:
- 2.1
- 2.2.4
- 2.3.0
before_install:
- gem install bundler -v '~> 1.10'
env:
- rails=4.2.0
- rails=5.0.0.rc1
matrix:
exclude:
- env: rails=5.0.0.rc1
rvm: 2.1
| cache: bundler
language: ruby
sudo: false
rvm:
- 2.1
- 2.2.4
- 2.3.0
before_install:
- gem install bundler -v '~> 1.10'
env:
- rails=4.2.0
- - rails=5.0.0.beta3
? ^^^^^
+ - rails=5.0.0.rc1
? ^^^
matrix:
exclude:
- - env: rails=5.0.0.beta3
? ^^^^^
+ - env: rails=5.0.0.rc1
? ^^^
rvm: 2.1 | 4 | 0.2 | 2 | 2 |
34f6adfcea8bb8d222c48d0d46567bf934146c13 | README.rdoc | README.rdoc | = Outpost
A Rails Engine for quickly standing up a CMS for a Newsroom.
**WIP, do not use.**
| = Outpost
{<img src="https://travis-ci.org/scpr/outpost.png?branch=master" alt="Build Status" />}[https://travis-ci.org/scpr/outpost]
A Rails Engine for quickly standing up a CMS for a Newsroom.
**WIP, do not use.**
| Add build status to Readme | Add build status to Readme
| RDoc | mit | SCPR/outpost,Ravenstine/outpost,SCPR/outpost,bricker/outpost,bricker/outpost,Ravenstine/outpost,SCPR/outpost,Ravenstine/outpost | rdoc | ## Code Before:
= Outpost
A Rails Engine for quickly standing up a CMS for a Newsroom.
**WIP, do not use.**
## Instruction:
Add build status to Readme
## Code After:
= Outpost
{<img src="https://travis-ci.org/scpr/outpost.png?branch=master" alt="Build Status" />}[https://travis-ci.org/scpr/outpost]
A Rails Engine for quickly standing up a CMS for a Newsroom.
**WIP, do not use.**
| = Outpost
+
+ {<img src="https://travis-ci.org/scpr/outpost.png?branch=master" alt="Build Status" />}[https://travis-ci.org/scpr/outpost]
A Rails Engine for quickly standing up a CMS for a Newsroom.
**WIP, do not use.** | 2 | 0.4 | 2 | 0 |
24a40d890b2e4fd7298f40758becf0d18fabc122 | requirements.txt | requirements.txt | AppDirs==1.4.3
argparse==1.2.1
boto==2.33.0
future==0.15.2
hiredis==0.2.0
Jinja2==2.8
MarkupSafe==0.23
ModestMaps==1.4.6
protobuf==2.6.0
psycopg2==2.5.4
pyclipper==1.0.5
pycountry==1.20
pyproj==1.9.5.1
python-dateutil==2.4.2
PyYAML==3.11
redis==2.10.5
requests==2.10.0
Shapely==1.4.3
six==1.10.0
StreetNames==0.1.5
ujson==1.35
Werkzeug==0.9.6
wsgiref==0.1.2
zope.dottedname==4.1.0
edtf==0.9.3
mapbox-vector-tile==1.2.0
git+https://github.com/mapzen/tilequeue@master#egg=tilequeue
git+https://github.com/tilezen/raw_tiles@master#egg=raw_tiles
| AppDirs==1.4.3
argparse==1.4.0
boto==2.48.0
future==0.16.0
hiredis==0.2.0
Jinja2==2.9.6
MarkupSafe==1.0
ModestMaps==1.4.7
protobuf==3.4.0
psycopg2==2.7.3.2
pyclipper==1.0.6
pycountry==17.9.23
pyproj==1.9.5.1
python-dateutil==2.6.1
PyYAML==3.12
redis==2.10.6
requests==2.18.4
Shapely==1.6.2.post1
six==1.11.0
StreetNames==0.1.5
ujson==1.35
Werkzeug==0.12.2
wsgiref==0.1.2
zope.dottedname==4.2
edtf==2.6.0
mapbox-vector-tile==1.2.0
git+https://github.com/mapzen/tilequeue@master#egg=tilequeue
git+https://github.com/tilezen/raw_tiles@master#egg=raw_tiles
| Update package versions to latest. | Update package versions to latest.
| Text | mit | tilezen/tileserver,tilezen/tileserver,mapzen/tileserver | text | ## Code Before:
AppDirs==1.4.3
argparse==1.2.1
boto==2.33.0
future==0.15.2
hiredis==0.2.0
Jinja2==2.8
MarkupSafe==0.23
ModestMaps==1.4.6
protobuf==2.6.0
psycopg2==2.5.4
pyclipper==1.0.5
pycountry==1.20
pyproj==1.9.5.1
python-dateutil==2.4.2
PyYAML==3.11
redis==2.10.5
requests==2.10.0
Shapely==1.4.3
six==1.10.0
StreetNames==0.1.5
ujson==1.35
Werkzeug==0.9.6
wsgiref==0.1.2
zope.dottedname==4.1.0
edtf==0.9.3
mapbox-vector-tile==1.2.0
git+https://github.com/mapzen/tilequeue@master#egg=tilequeue
git+https://github.com/tilezen/raw_tiles@master#egg=raw_tiles
## Instruction:
Update package versions to latest.
## Code After:
AppDirs==1.4.3
argparse==1.4.0
boto==2.48.0
future==0.16.0
hiredis==0.2.0
Jinja2==2.9.6
MarkupSafe==1.0
ModestMaps==1.4.7
protobuf==3.4.0
psycopg2==2.7.3.2
pyclipper==1.0.6
pycountry==17.9.23
pyproj==1.9.5.1
python-dateutil==2.6.1
PyYAML==3.12
redis==2.10.6
requests==2.18.4
Shapely==1.6.2.post1
six==1.11.0
StreetNames==0.1.5
ujson==1.35
Werkzeug==0.12.2
wsgiref==0.1.2
zope.dottedname==4.2
edtf==2.6.0
mapbox-vector-tile==1.2.0
git+https://github.com/mapzen/tilequeue@master#egg=tilequeue
git+https://github.com/tilezen/raw_tiles@master#egg=raw_tiles
| AppDirs==1.4.3
- argparse==1.2.1
? ^ ^
+ argparse==1.4.0
? ^ ^
- boto==2.33.0
? ^^
+ boto==2.48.0
? ^^
- future==0.15.2
? ^ ^
+ future==0.16.0
? ^ ^
hiredis==0.2.0
- Jinja2==2.8
? ^
+ Jinja2==2.9.6
? ^^^
- MarkupSafe==0.23
? ---
+ MarkupSafe==1.0
? ++
- ModestMaps==1.4.6
? ^
+ ModestMaps==1.4.7
? ^
- protobuf==2.6.0
? ^ ^
+ protobuf==3.4.0
? ^ ^
- psycopg2==2.5.4
? ^ ^
+ psycopg2==2.7.3.2
? ^ ^^^
- pyclipper==1.0.5
? ^
+ pyclipper==1.0.6
? ^
- pycountry==1.20
? ^
+ pycountry==17.9.23
? +++ ^
pyproj==1.9.5.1
- python-dateutil==2.4.2
? ^ ^
+ python-dateutil==2.6.1
? ^ ^
- PyYAML==3.11
? ^
+ PyYAML==3.12
? ^
- redis==2.10.5
? ^
+ redis==2.10.6
? ^
- requests==2.10.0
? ^ ^
+ requests==2.18.4
? ^ ^
- Shapely==1.4.3
+ Shapely==1.6.2.post1
- six==1.10.0
? ^
+ six==1.11.0
? ^
StreetNames==0.1.5
ujson==1.35
- Werkzeug==0.9.6
? ^ ^
+ Werkzeug==0.12.2
? ^^ ^
wsgiref==0.1.2
- zope.dottedname==4.1.0
? ^^^
+ zope.dottedname==4.2
? ^
- edtf==0.9.3
+ edtf==2.6.0
mapbox-vector-tile==1.2.0
git+https://github.com/mapzen/tilequeue@master#egg=tilequeue
git+https://github.com/tilezen/raw_tiles@master#egg=raw_tiles | 38 | 1.357143 | 19 | 19 |
961e235d3ec14d4634a8fb800e0b4670a81510e0 | recipes/server_streaming_master.rb | recipes/server_streaming_master.rb |
if node['postgresql']['version'].to_f < 9.3
Chef::Log.fatal!("Streaming replication requires postgresql 9.3 or greater and
you have configured #{node['postgresql']['version']}. Bail.")
node.override['postgresql']['version'] = "9.3"
end
node['postgresql']['streaming']['master']['config'].each do |k,v|
node.default['postgresql']['config'][k] = v
end
node.default['postgresql']['pg_hba'] =
node['postgresql']['streaming']['master']['pg_hba']
include_recipe 'postgresql::server'
directory node['postgresql']['shared_archive'] do
owner "postgres"
group "postgres"
mode 00755
action :create
end |
if node['postgresql']['version'].to_f < 9.3
Chef::Log.fatal!("Streaming replication requires postgresql 9.3 or greater and
you have configured #{node['postgresql']['version']}. Bail.")
end
node['postgresql']['streaming']['master']['config'].each do |k,v|
node.default['postgresql']['config'][k] = v
end
node.default['postgresql']['pg_hba'] =
node['postgresql']['streaming']['master']['pg_hba']
include_recipe 'postgresql::server'
if node['postgresql'].attribute? 'shared_archive'
directory node['postgresql']['shared_archive'] do
owner "postgres"
group "postgres"
mode 00755
action :create
end
end | Remove unused line. Make archive dir creation conditional | Remove unused line. Make archive dir creation conditional
| Ruby | apache-2.0 | clearstorydata/chef-postgresql,jayceeb/chef-postgresql,clearstorydata/chef-postgresql,jharveysmith/postgresql,jayceeb/chef-postgresql,clearstorydata/chef-postgresql | ruby | ## Code Before:
if node['postgresql']['version'].to_f < 9.3
Chef::Log.fatal!("Streaming replication requires postgresql 9.3 or greater and
you have configured #{node['postgresql']['version']}. Bail.")
node.override['postgresql']['version'] = "9.3"
end
node['postgresql']['streaming']['master']['config'].each do |k,v|
node.default['postgresql']['config'][k] = v
end
node.default['postgresql']['pg_hba'] =
node['postgresql']['streaming']['master']['pg_hba']
include_recipe 'postgresql::server'
directory node['postgresql']['shared_archive'] do
owner "postgres"
group "postgres"
mode 00755
action :create
end
## Instruction:
Remove unused line. Make archive dir creation conditional
## Code After:
if node['postgresql']['version'].to_f < 9.3
Chef::Log.fatal!("Streaming replication requires postgresql 9.3 or greater and
you have configured #{node['postgresql']['version']}. Bail.")
end
node['postgresql']['streaming']['master']['config'].each do |k,v|
node.default['postgresql']['config'][k] = v
end
node.default['postgresql']['pg_hba'] =
node['postgresql']['streaming']['master']['pg_hba']
include_recipe 'postgresql::server'
if node['postgresql'].attribute? 'shared_archive'
directory node['postgresql']['shared_archive'] do
owner "postgres"
group "postgres"
mode 00755
action :create
end
end |
if node['postgresql']['version'].to_f < 9.3
Chef::Log.fatal!("Streaming replication requires postgresql 9.3 or greater and
you have configured #{node['postgresql']['version']}. Bail.")
- node.override['postgresql']['version'] = "9.3"
end
node['postgresql']['streaming']['master']['config'].each do |k,v|
node.default['postgresql']['config'][k] = v
end
node.default['postgresql']['pg_hba'] =
node['postgresql']['streaming']['master']['pg_hba']
include_recipe 'postgresql::server'
+ if node['postgresql'].attribute? 'shared_archive'
- directory node['postgresql']['shared_archive'] do
+ directory node['postgresql']['shared_archive'] do
? ++
- owner "postgres"
+ owner "postgres"
? ++
- group "postgres"
+ group "postgres"
? ++
- mode 00755
+ mode 00755
? ++
- action :create
+ action :create
? ++
+ end
end | 13 | 0.590909 | 7 | 6 |
b77d24a91a9ad7bb6b76780843a39cadc1741d61 | rdiodj/static/css/style.css | rdiodj/static/css/style.css | html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
#push,
#footer {
height: 60px;
}
#footer {
background-color: #f5f5f5;
}
/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}
.container .credit {
margin: 20px 0;
}
/* Search View */
.dropdown img {
margin-right: 10px;
width: 50px;
}
.dropdown .name {
font-weight: bold;
}
.dropdown .artist {
font-size: 12px;
}
| html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
#push,
#footer {
height: 60px;
}
#footer {
background-color: #f5f5f5;
}
/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}
.container .credit {
margin: 20px 0;
}
/* Search View */
.dropdown img {
margin-right: 10px;
width: 50px;
}
.dropdown .name {
font-weight: bold;
}
.dropdown .artist {
font-size: 12px;
}
.presence {
margin-top: 20px;
}
| Add space between now playing and user list | Add space between now playing and user list
| CSS | mit | sutrofm/sutrofm,jmullan/sutrofm,mkapolka/rdiodj,superemily/sutrofm,jmullan/sutrofm,superemily/sutrofm,mkapolka/rdiodj,sutrofm/sutrofm,sutrofm/sutrofm,superemily/sutrofm,jmullan/sutrofm,sutrofm/sutrofm,superemily/sutrofm,jmullan/sutrofm,mkapolka/rdiodj | css | ## Code Before:
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
#push,
#footer {
height: 60px;
}
#footer {
background-color: #f5f5f5;
}
/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}
.container .credit {
margin: 20px 0;
}
/* Search View */
.dropdown img {
margin-right: 10px;
width: 50px;
}
.dropdown .name {
font-weight: bold;
}
.dropdown .artist {
font-size: 12px;
}
## Instruction:
Add space between now playing and user list
## Code After:
html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
#push,
#footer {
height: 60px;
}
#footer {
background-color: #f5f5f5;
}
/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}
.container .credit {
margin: 20px 0;
}
/* Search View */
.dropdown img {
margin-right: 10px;
width: 50px;
}
.dropdown .name {
font-weight: bold;
}
.dropdown .artist {
font-size: 12px;
}
.presence {
margin-top: 20px;
}
| html,
body {
height: 100%;
/* The html and body elements cannot have any padding or margin. */
}
/* Wrapper for page content to push down footer */
#wrap {
min-height: 100%;
height: auto !important;
height: 100%;
/* Negative indent footer by it's height */
margin: 0 auto -60px;
}
/* Set the fixed height of the footer here */
#push,
#footer {
height: 60px;
}
#footer {
background-color: #f5f5f5;
}
/* Lastly, apply responsive CSS fixes as necessary */
@media (max-width: 767px) {
#footer {
margin-left: -20px;
margin-right: -20px;
padding-left: 20px;
padding-right: 20px;
}
}
.container .credit {
margin: 20px 0;
}
/* Search View */
.dropdown img {
margin-right: 10px;
width: 50px;
}
.dropdown .name {
font-weight: bold;
}
.dropdown .artist {
font-size: 12px;
}
+
+ .presence {
+ margin-top: 20px;
+ } | 4 | 0.076923 | 4 | 0 |
1f8dd980e567f3d7abd37ffe71b714c87e3170a7 | README.md | README.md | This project is a webpage written in yesod. It is the home page of
the "computer department" of Chalmers University of Technology.
Installation and maintaining instructions are on the github wiki,
but since this is intendet only for the local students of Chalmers
it's in Swedish.
| [](http://travis-ci.org/dtekcth/DtekPortalen)
[](http://dtek.se:8080/job/DtekPortalen/)
This project is a webpage written in yesod. It is the home page of
the "computer department" of Chalmers University of Technology.
Installation and maintaining instructions are on the github wiki,
but since this is intendet only for the local students of Chalmers
it's in Swedish.
| Add build status images (jenkins+travis) | Add build status images (jenkins+travis)
| Markdown | bsd-2-clause | dtekcth/DtekPortalen | markdown | ## Code Before:
This project is a webpage written in yesod. It is the home page of
the "computer department" of Chalmers University of Technology.
Installation and maintaining instructions are on the github wiki,
but since this is intendet only for the local students of Chalmers
it's in Swedish.
## Instruction:
Add build status images (jenkins+travis)
## Code After:
[](http://travis-ci.org/dtekcth/DtekPortalen)
[](http://dtek.se:8080/job/DtekPortalen/)
This project is a webpage written in yesod. It is the home page of
the "computer department" of Chalmers University of Technology.
Installation and maintaining instructions are on the github wiki,
but since this is intendet only for the local students of Chalmers
it's in Swedish.
| + [](http://travis-ci.org/dtekcth/DtekPortalen)
+ [](http://dtek.se:8080/job/DtekPortalen/)
+
This project is a webpage written in yesod. It is the home page of
the "computer department" of Chalmers University of Technology.
Installation and maintaining instructions are on the github wiki,
but since this is intendet only for the local students of Chalmers
it's in Swedish. | 3 | 0.5 | 3 | 0 |
bc57354474c6d12b3b5952045d4a0612bd0e53b1 | README.md | README.md |
Start a postgres database:
`docker run -d --name=pg-netdisco postgres`
Link it to netdisco:
`docker run -d --name=netdisco -e NETDISCO_WR_COMMUNITY="private" --link pg-netdisco:db -p 5000:5000 sheeprine/docker-netdisco`
Connect using your browser to http://<IP-of-docker-host>:5000/
|
Start a postgres database:
`docker run -d --name=pg-netdisco postgres`
Link it to netdisco:
`docker run -d --name=netdisco -e NETDISCO_WR_COMMUNITY="private" --link pg-netdisco:db -p 5000:5000 sheeprine/docker-netdisco`
Connect using your browser to http://IP-of-docker-host:5000/ with a username "admin" and a password of "password"
| Add username and password option | Add username and password option | Markdown | apache-2.0 | sheeprine/docker-netdisco | markdown | ## Code Before:
Start a postgres database:
`docker run -d --name=pg-netdisco postgres`
Link it to netdisco:
`docker run -d --name=netdisco -e NETDISCO_WR_COMMUNITY="private" --link pg-netdisco:db -p 5000:5000 sheeprine/docker-netdisco`
Connect using your browser to http://<IP-of-docker-host>:5000/
## Instruction:
Add username and password option
## Code After:
Start a postgres database:
`docker run -d --name=pg-netdisco postgres`
Link it to netdisco:
`docker run -d --name=netdisco -e NETDISCO_WR_COMMUNITY="private" --link pg-netdisco:db -p 5000:5000 sheeprine/docker-netdisco`
Connect using your browser to http://IP-of-docker-host:5000/ with a username "admin" and a password of "password"
|
Start a postgres database:
`docker run -d --name=pg-netdisco postgres`
Link it to netdisco:
`docker run -d --name=netdisco -e NETDISCO_WR_COMMUNITY="private" --link pg-netdisco:db -p 5000:5000 sheeprine/docker-netdisco`
- Connect using your browser to http://<IP-of-docker-host>:5000/
+ Connect using your browser to http://IP-of-docker-host:5000/ with a username "admin" and a password of "password" | 2 | 0.2 | 1 | 1 |
299674a9ece878c8b36196891337785be8f535c2 | src/Channels/GcmChannel.php | src/Channels/GcmChannel.php | <?php
namespace Edujugon\PushNotification\Channels;
use Edujugon\PushNotification\Messages\PushMessage;
class GcmChannel extends PushChannel
{
/**
* {@inheritdoc}
*/
protected function pushServiceName()
{
return 'gcm';
}
/**
* {@inheritdoc}
*/
protected function buildData(PushMessage $message)
{
$data = [];
if ($message->title != null || $message->body != null || $message->click_action != null) {
$data = [
'notification' => [
'title' => $message->title,
'body' => $message->body,
'sound' => $message->sound,
'click_action' => $message->click_action,
],
];
}
if (! empty($message->extra)) {
$data['data'] = $message->extra;
}
return $data;
}
}
| <?php
namespace Edujugon\PushNotification\Channels;
use Edujugon\PushNotification\Messages\PushMessage;
class GcmChannel extends PushChannel
{
/**
* {@inheritdoc}
*/
protected function pushServiceName()
{
return 'gcm';
}
/**
* {@inheritdoc}
*/
protected function buildData(PushMessage $message)
{
$data = [];
if ($message->title != null || $message->body != null || $message->click_action != null) {
$data = [
'notification' => [
'title' => $message->title,
'body' => $message->body,
'sound' => $message->sound,
'click_action' => $message->click_action,
],
];
// Set custom badge number when isset in PushMessage
if (! empty($message->badge)) {
$data['notification']['badge'] = $message->badge;
}
}
if (! empty($message->extra)) {
$data['data'] = $message->extra;
}
return $data;
}
}
| Fix badge support for FCM and GCM via channel | Fix badge support for FCM and GCM via channel
| PHP | mit | Edujugon/PushNotification | php | ## Code Before:
<?php
namespace Edujugon\PushNotification\Channels;
use Edujugon\PushNotification\Messages\PushMessage;
class GcmChannel extends PushChannel
{
/**
* {@inheritdoc}
*/
protected function pushServiceName()
{
return 'gcm';
}
/**
* {@inheritdoc}
*/
protected function buildData(PushMessage $message)
{
$data = [];
if ($message->title != null || $message->body != null || $message->click_action != null) {
$data = [
'notification' => [
'title' => $message->title,
'body' => $message->body,
'sound' => $message->sound,
'click_action' => $message->click_action,
],
];
}
if (! empty($message->extra)) {
$data['data'] = $message->extra;
}
return $data;
}
}
## Instruction:
Fix badge support for FCM and GCM via channel
## Code After:
<?php
namespace Edujugon\PushNotification\Channels;
use Edujugon\PushNotification\Messages\PushMessage;
class GcmChannel extends PushChannel
{
/**
* {@inheritdoc}
*/
protected function pushServiceName()
{
return 'gcm';
}
/**
* {@inheritdoc}
*/
protected function buildData(PushMessage $message)
{
$data = [];
if ($message->title != null || $message->body != null || $message->click_action != null) {
$data = [
'notification' => [
'title' => $message->title,
'body' => $message->body,
'sound' => $message->sound,
'click_action' => $message->click_action,
],
];
// Set custom badge number when isset in PushMessage
if (! empty($message->badge)) {
$data['notification']['badge'] = $message->badge;
}
}
if (! empty($message->extra)) {
$data['data'] = $message->extra;
}
return $data;
}
}
| <?php
namespace Edujugon\PushNotification\Channels;
use Edujugon\PushNotification\Messages\PushMessage;
class GcmChannel extends PushChannel
{
/**
* {@inheritdoc}
*/
protected function pushServiceName()
{
return 'gcm';
}
/**
* {@inheritdoc}
*/
protected function buildData(PushMessage $message)
{
$data = [];
if ($message->title != null || $message->body != null || $message->click_action != null) {
$data = [
'notification' => [
'title' => $message->title,
'body' => $message->body,
'sound' => $message->sound,
'click_action' => $message->click_action,
],
];
+
+ // Set custom badge number when isset in PushMessage
+ if (! empty($message->badge)) {
+ $data['notification']['badge'] = $message->badge;
+ }
}
if (! empty($message->extra)) {
$data['data'] = $message->extra;
}
return $data;
}
} | 5 | 0.125 | 5 | 0 |
5348063770e60558ea1266c3ec31d03d0b2f189e | lib/lnsr.js | lib/lnsr.js | const queue = require('./queue.js');
const error = require('./error.js');
const filter = require('./filter.js');
const passFilter = require('./filters/pass.js');
const blockFilter = require('./filters/block.js');
const hostFilter = require('./filters/host.js');
const protocolFilter = require('.filters/protocol');
const methodFilter = require('.filters/method');
const pathFilter = require('.filters/path');
module.exports = {
queue: queue,
error: error,
filter: filter,
filters: {
pass: passFilter,
block: blockFilter,
host: hostFilter,
protocol: protocolFilter,
method: methodFilter,
path: pathFilter
}
}
| const queue = require('./queue.js');
const error = require('./error.js');
const filter = require('./filter.js');
const passFilter = require('./filters/pass.js');
const blockFilter = require('./filters/block.js');
const hostFilter = require('./filters/host.js');
const protocolFilter = require('.filters/protocol');
const methodFilter = require('.filters/method');
const pathFilter = require('.filters/path');
const simplePathFilter = require('.filters/simple-path');
module.exports = {
queue: queue,
error: error,
filter: filter,
filters: {
pass: passFilter,
block: blockFilter,
host: hostFilter,
protocol: protocolFilter,
method: methodFilter,
path: pathFilter,
simplePath: simplePathFilter
}
}
| Add simple path filter to lib | Add simple path filter to lib
| JavaScript | mit | matths/lnsr | javascript | ## Code Before:
const queue = require('./queue.js');
const error = require('./error.js');
const filter = require('./filter.js');
const passFilter = require('./filters/pass.js');
const blockFilter = require('./filters/block.js');
const hostFilter = require('./filters/host.js');
const protocolFilter = require('.filters/protocol');
const methodFilter = require('.filters/method');
const pathFilter = require('.filters/path');
module.exports = {
queue: queue,
error: error,
filter: filter,
filters: {
pass: passFilter,
block: blockFilter,
host: hostFilter,
protocol: protocolFilter,
method: methodFilter,
path: pathFilter
}
}
## Instruction:
Add simple path filter to lib
## Code After:
const queue = require('./queue.js');
const error = require('./error.js');
const filter = require('./filter.js');
const passFilter = require('./filters/pass.js');
const blockFilter = require('./filters/block.js');
const hostFilter = require('./filters/host.js');
const protocolFilter = require('.filters/protocol');
const methodFilter = require('.filters/method');
const pathFilter = require('.filters/path');
const simplePathFilter = require('.filters/simple-path');
module.exports = {
queue: queue,
error: error,
filter: filter,
filters: {
pass: passFilter,
block: blockFilter,
host: hostFilter,
protocol: protocolFilter,
method: methodFilter,
path: pathFilter,
simplePath: simplePathFilter
}
}
| const queue = require('./queue.js');
const error = require('./error.js');
const filter = require('./filter.js');
const passFilter = require('./filters/pass.js');
const blockFilter = require('./filters/block.js');
const hostFilter = require('./filters/host.js');
const protocolFilter = require('.filters/protocol');
const methodFilter = require('.filters/method');
const pathFilter = require('.filters/path');
+ const simplePathFilter = require('.filters/simple-path');
module.exports = {
queue: queue,
error: error,
filter: filter,
filters: {
pass: passFilter,
block: blockFilter,
host: hostFilter,
protocol: protocolFilter,
method: methodFilter,
- path: pathFilter
+ path: pathFilter,
? +
+ simplePath: simplePathFilter
}
} | 4 | 0.173913 | 3 | 1 |
bc50210afc3cfb43441fe431e34e04db612f87c7 | importkit/yaml/schema.py | importkit/yaml/schema.py | import subprocess
class YamlValidationError(Exception): pass
class Base(object):
schema_file = ''
@classmethod
def validate(cls, filename):
kwalify = subprocess.Popen(['kwalify', '-lf', cls.schema_file, filename],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdout, stderr) = kwalify.communicate()
if stdout.find('INVALID') >= 0 or stderr.find('ERROR') >= 0:
raise YamlValidationError('Failed to validate file: %s\n\nValidator output: \n%s' %
(filename, stderr + stdout))
@classmethod
def _create_class(cls, meta, dct):
cls.schema_file = meta['filename']
return type(meta['class']['name'], (Base,), {'schema_file': meta['filename']})
| import subprocess
class YamlValidationError(Exception): pass
class Base(object):
schema_file = ''
@classmethod
def validate(cls, meta):
if 'marshalled' in meta and meta['marshalled']:
return
cls.validatefile(meta['filename'])
@classmethod
def validatefile(cls, filename):
kwalify = subprocess.Popen(['kwalify', '-lf', cls.schema_file, filename],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdout, stderr) = kwalify.communicate()
if stdout.find('INVALID') >= 0 or stderr.find('ERROR') >= 0:
raise YamlValidationError('Failed to validate file: %s\n\nValidator output: \n%s' %
(filename, stderr + stdout))
@classmethod
def _create_class(cls, meta, dct):
cls.schema_file = meta['filename']
return type(meta['class']['name'], (Base,), {'schema_file': meta['filename']})
| Implement YAML file compilation into 'bytecode' | import: Implement YAML file compilation into 'bytecode'
Store serialized Python structures resulted from loading YAML source in
the .ymlc files, a-la .pyc
| Python | mit | sprymix/importkit | python | ## Code Before:
import subprocess
class YamlValidationError(Exception): pass
class Base(object):
schema_file = ''
@classmethod
def validate(cls, filename):
kwalify = subprocess.Popen(['kwalify', '-lf', cls.schema_file, filename],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdout, stderr) = kwalify.communicate()
if stdout.find('INVALID') >= 0 or stderr.find('ERROR') >= 0:
raise YamlValidationError('Failed to validate file: %s\n\nValidator output: \n%s' %
(filename, stderr + stdout))
@classmethod
def _create_class(cls, meta, dct):
cls.schema_file = meta['filename']
return type(meta['class']['name'], (Base,), {'schema_file': meta['filename']})
## Instruction:
import: Implement YAML file compilation into 'bytecode'
Store serialized Python structures resulted from loading YAML source in
the .ymlc files, a-la .pyc
## Code After:
import subprocess
class YamlValidationError(Exception): pass
class Base(object):
schema_file = ''
@classmethod
def validate(cls, meta):
if 'marshalled' in meta and meta['marshalled']:
return
cls.validatefile(meta['filename'])
@classmethod
def validatefile(cls, filename):
kwalify = subprocess.Popen(['kwalify', '-lf', cls.schema_file, filename],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdout, stderr) = kwalify.communicate()
if stdout.find('INVALID') >= 0 or stderr.find('ERROR') >= 0:
raise YamlValidationError('Failed to validate file: %s\n\nValidator output: \n%s' %
(filename, stderr + stdout))
@classmethod
def _create_class(cls, meta, dct):
cls.schema_file = meta['filename']
return type(meta['class']['name'], (Base,), {'schema_file': meta['filename']})
| import subprocess
class YamlValidationError(Exception): pass
class Base(object):
schema_file = ''
@classmethod
+ def validate(cls, meta):
+ if 'marshalled' in meta and meta['marshalled']:
+ return
+
+ cls.validatefile(meta['filename'])
+
+ @classmethod
- def validate(cls, filename):
+ def validatefile(cls, filename):
? ++++
kwalify = subprocess.Popen(['kwalify', '-lf', cls.schema_file, filename],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
(stdout, stderr) = kwalify.communicate()
if stdout.find('INVALID') >= 0 or stderr.find('ERROR') >= 0:
raise YamlValidationError('Failed to validate file: %s\n\nValidator output: \n%s' %
(filename, stderr + stdout))
@classmethod
def _create_class(cls, meta, dct):
cls.schema_file = meta['filename']
return type(meta['class']['name'], (Base,), {'schema_file': meta['filename']}) | 9 | 0.428571 | 8 | 1 |
d981d66305d3e8342e74cf5a130339aab1eb5396 | Changelog.draft.rst | Changelog.draft.rst | =========
ChangeLog
=========
Users should ignore this content: **it is draft**.
Contributors should add entries here in the following section, on top of the
others.
`WIP (coming releases)`
=======================
New Features
------------
* add a --info command line switch that outputs useful information about
the server and the configuration for all enabled accounts.
Changes
-------
* Indicate progress when copying many messages (slightly change log format)
* Output how long an account sync took (min:sec).
Bug Fixes
---------
* Syncing multiple accounts in single-threaded mode would fail as we try
to "register" a thread as belonging to two accounts which was
fatal. Make it non-fatal (it can be legitimate).
* New folders on the remote would be skipped on the very sync run they
are created and only by synced in subsequent runs. Fixed.
* Make NOOPs to keep a server connection open more resistant against dropped
connections.
| =========
ChangeLog
=========
Users should ignore this content: **it is draft**.
Contributors should add entries here in the following section, on top of the
others.
`WIP (coming releases)`
=======================
New Features
------------
* add a --info command line switch that outputs useful information about
the server and the configuration for all enabled accounts.
Changes
-------
* Indicate progress when copying many messages (slightly change log format)
* Output how long an account sync took (min:sec).
* Reworked logging which was reported to e.g. not flush output to files
often enough. User-visible changes:
a) console output goes to stderr (for now).
b) file output has timestamps and looks identical in the basic and
ttyui UIs.
c) File output should be flushed after logging by default (do
report if not).
Bug Fixes
---------
* Syncing multiple accounts in single-threaded mode would fail as we try
to "register" a thread as belonging to two accounts which was
fatal. Make it non-fatal (it can be legitimate).
* New folders on the remote would be skipped on the very sync run they
are created and only by synced in subsequent runs. Fixed.
* Make NOOPs to keep a server connection open more resistant against dropped
connections.
| Add changelog entry for reworked UI backends | Add changelog entry for reworked UI backends
Signed-off-by: Sebastian Spaeth <98dcb2717ddae152d5b359c6ea97e4fe34a29d4c@SSpaeth.de>
| reStructuredText | apache-2.0 | frioux/offlineimap,frioux/offlineimap | restructuredtext | ## Code Before:
=========
ChangeLog
=========
Users should ignore this content: **it is draft**.
Contributors should add entries here in the following section, on top of the
others.
`WIP (coming releases)`
=======================
New Features
------------
* add a --info command line switch that outputs useful information about
the server and the configuration for all enabled accounts.
Changes
-------
* Indicate progress when copying many messages (slightly change log format)
* Output how long an account sync took (min:sec).
Bug Fixes
---------
* Syncing multiple accounts in single-threaded mode would fail as we try
to "register" a thread as belonging to two accounts which was
fatal. Make it non-fatal (it can be legitimate).
* New folders on the remote would be skipped on the very sync run they
are created and only by synced in subsequent runs. Fixed.
* Make NOOPs to keep a server connection open more resistant against dropped
connections.
## Instruction:
Add changelog entry for reworked UI backends
Signed-off-by: Sebastian Spaeth <98dcb2717ddae152d5b359c6ea97e4fe34a29d4c@SSpaeth.de>
## Code After:
=========
ChangeLog
=========
Users should ignore this content: **it is draft**.
Contributors should add entries here in the following section, on top of the
others.
`WIP (coming releases)`
=======================
New Features
------------
* add a --info command line switch that outputs useful information about
the server and the configuration for all enabled accounts.
Changes
-------
* Indicate progress when copying many messages (slightly change log format)
* Output how long an account sync took (min:sec).
* Reworked logging which was reported to e.g. not flush output to files
often enough. User-visible changes:
a) console output goes to stderr (for now).
b) file output has timestamps and looks identical in the basic and
ttyui UIs.
c) File output should be flushed after logging by default (do
report if not).
Bug Fixes
---------
* Syncing multiple accounts in single-threaded mode would fail as we try
to "register" a thread as belonging to two accounts which was
fatal. Make it non-fatal (it can be legitimate).
* New folders on the remote would be skipped on the very sync run they
are created and only by synced in subsequent runs. Fixed.
* Make NOOPs to keep a server connection open more resistant against dropped
connections.
| =========
ChangeLog
=========
Users should ignore this content: **it is draft**.
Contributors should add entries here in the following section, on top of the
others.
`WIP (coming releases)`
=======================
New Features
------------
* add a --info command line switch that outputs useful information about
the server and the configuration for all enabled accounts.
-
+
Changes
-------
* Indicate progress when copying many messages (slightly change log format)
* Output how long an account sync took (min:sec).
+
+ * Reworked logging which was reported to e.g. not flush output to files
+ often enough. User-visible changes:
+ a) console output goes to stderr (for now).
+ b) file output has timestamps and looks identical in the basic and
+ ttyui UIs.
+ c) File output should be flushed after logging by default (do
+ report if not).
Bug Fixes
---------
* Syncing multiple accounts in single-threaded mode would fail as we try
to "register" a thread as belonging to two accounts which was
fatal. Make it non-fatal (it can be legitimate).
* New folders on the remote would be skipped on the very sync run they
are created and only by synced in subsequent runs. Fixed.
* Make NOOPs to keep a server connection open more resistant against dropped
connections. | 10 | 0.27027 | 9 | 1 |
163fb89b20845fcb73f30e266b79a4f1c5a1fc2b | .eslintrc.js | .eslintrc.js | module.exports = {
root: true,
parserOptions: {
ecmaVersion: 8,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
/* Possible Errors http://eslint.org/docs/rules/#possible-errors */
"comma-dangle": [2, "only-multiline"],
/* Stylistic Issues http://eslint.org/docs/rules/#stylistic-issues */
indent: [2, 2], /* two-space indentation */
semi: 2, /* require semi-colons */
'no-shadow': [2, {
builtinGlobals: true,
allow: ['event', 'i', 'name', 'parent', 'resolve', 'self', 'select', 'scrollTo', 'status']
},], /* Prevent shadowing globals like Object*/
}
};
| module.exports = {
root: true,
parserOptions: {
ecmaVersion: 8,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
/* Possible Errors http://eslint.org/docs/rules/#possible-errors */
"comma-dangle": [2, "only-multiline"],
/* Stylistic Issues http://eslint.org/docs/rules/#stylistic-issues */
indent: [2, 2], /* two-space indentation */
semi: 2, /* require semi-colons */
camelcase: 2, /* require camelcase variables */
'no-shadow': [2, {
builtinGlobals: true,
allow: ['event', 'i', 'name', 'parent', 'resolve', 'self', 'select', 'scrollTo', 'status']
},], /* Prevent shadowing globals like Object*/
}
};
| Enforce camelcase variables with eslint | Enforce camelcase variables with eslint
This has been our practice, now it is THE RULE.
| JavaScript | mit | gabycampagna/frontend,dartajax/frontend,jrjohnson/frontend,gboushey/frontend,dartajax/frontend,ilios/frontend,djvoa12/frontend,jrjohnson/frontend,djvoa12/frontend,gabycampagna/frontend,thecoolestguy/frontend,thecoolestguy/frontend,gboushey/frontend,ilios/frontend | javascript | ## Code Before:
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 8,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
/* Possible Errors http://eslint.org/docs/rules/#possible-errors */
"comma-dangle": [2, "only-multiline"],
/* Stylistic Issues http://eslint.org/docs/rules/#stylistic-issues */
indent: [2, 2], /* two-space indentation */
semi: 2, /* require semi-colons */
'no-shadow': [2, {
builtinGlobals: true,
allow: ['event', 'i', 'name', 'parent', 'resolve', 'self', 'select', 'scrollTo', 'status']
},], /* Prevent shadowing globals like Object*/
}
};
## Instruction:
Enforce camelcase variables with eslint
This has been our practice, now it is THE RULE.
## Code After:
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 8,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
/* Possible Errors http://eslint.org/docs/rules/#possible-errors */
"comma-dangle": [2, "only-multiline"],
/* Stylistic Issues http://eslint.org/docs/rules/#stylistic-issues */
indent: [2, 2], /* two-space indentation */
semi: 2, /* require semi-colons */
camelcase: 2, /* require camelcase variables */
'no-shadow': [2, {
builtinGlobals: true,
allow: ['event', 'i', 'name', 'parent', 'resolve', 'self', 'select', 'scrollTo', 'status']
},], /* Prevent shadowing globals like Object*/
}
};
| module.exports = {
root: true,
parserOptions: {
ecmaVersion: 8,
sourceType: 'module'
},
extends: 'eslint:recommended',
env: {
browser: true
},
rules: {
/* Possible Errors http://eslint.org/docs/rules/#possible-errors */
"comma-dangle": [2, "only-multiline"],
/* Stylistic Issues http://eslint.org/docs/rules/#stylistic-issues */
indent: [2, 2], /* two-space indentation */
semi: 2, /* require semi-colons */
+ camelcase: 2, /* require camelcase variables */
'no-shadow': [2, {
builtinGlobals: true,
allow: ['event', 'i', 'name', 'parent', 'resolve', 'self', 'select', 'scrollTo', 'status']
},], /* Prevent shadowing globals like Object*/
}
}; | 1 | 0.043478 | 1 | 0 |
92ed4c5686b6afd54020c2b8d8d10bc9d0476319 | README.md | README.md |
This reporter is to be used with JSHint to log errors out to a file
in markdown. This is useful for creating error files that are easy
to view in any markdown viewer.
### Example Output
test
### Installation
To use `jshint-md-reporter`, you have to have JSHint installed on your system.
```bash
$ npm install jshint -g
```
Now install the reporter:
```bash
$ npm install jshint-md-reporter --save-dev
```
### Usage
Simple example using [Grunt](http://gruntjs.com):
```javascript
console.log();
```
And [Gulp](http://gulpjs.com/):
```javascript
console.log();
```
### Testing
test
|
This reporter is to be used with JSHint to log errors out to a file
in markdown. This is useful for creating error files that are easy
to view in any markdown viewer.
### Example Output
test
### Installation
To use `jshint-md-reporter`, you have to have JSHint installed on your system.
```bash
$ npm install jshint -g
```
Now install the reporter:
```bash
$ npm install jshint-md-reporter --save-dev
```
### Usage
Simple example using [Grunt](http://gruntjs.com):
```javascript
console.log();
```
And [Gulp](http://gulpjs.com/):
```javascript
console.log();
```
### Testing
To run the tests, you have to first make sure the dependencies are installed on
your system by running:
```bash
$ npm install
```
Then run mocha from the command line:
```bash
$ mocha
```
| Update readme with test command | Update readme with test command
| Markdown | mit | justinchmura/jshint-md-reporter | markdown | ## Code Before:
This reporter is to be used with JSHint to log errors out to a file
in markdown. This is useful for creating error files that are easy
to view in any markdown viewer.
### Example Output
test
### Installation
To use `jshint-md-reporter`, you have to have JSHint installed on your system.
```bash
$ npm install jshint -g
```
Now install the reporter:
```bash
$ npm install jshint-md-reporter --save-dev
```
### Usage
Simple example using [Grunt](http://gruntjs.com):
```javascript
console.log();
```
And [Gulp](http://gulpjs.com/):
```javascript
console.log();
```
### Testing
test
## Instruction:
Update readme with test command
## Code After:
This reporter is to be used with JSHint to log errors out to a file
in markdown. This is useful for creating error files that are easy
to view in any markdown viewer.
### Example Output
test
### Installation
To use `jshint-md-reporter`, you have to have JSHint installed on your system.
```bash
$ npm install jshint -g
```
Now install the reporter:
```bash
$ npm install jshint-md-reporter --save-dev
```
### Usage
Simple example using [Grunt](http://gruntjs.com):
```javascript
console.log();
```
And [Gulp](http://gulpjs.com/):
```javascript
console.log();
```
### Testing
To run the tests, you have to first make sure the dependencies are installed on
your system by running:
```bash
$ npm install
```
Then run mocha from the command line:
```bash
$ mocha
```
|
This reporter is to be used with JSHint to log errors out to a file
in markdown. This is useful for creating error files that are easy
to view in any markdown viewer.
### Example Output
test
### Installation
To use `jshint-md-reporter`, you have to have JSHint installed on your system.
```bash
$ npm install jshint -g
```
Now install the reporter:
```bash
$ npm install jshint-md-reporter --save-dev
```
### Usage
Simple example using [Grunt](http://gruntjs.com):
```javascript
console.log();
```
And [Gulp](http://gulpjs.com/):
```javascript
console.log();
```
### Testing
- test
+ To run the tests, you have to first make sure the dependencies are installed on
+ your system by running:
+
+ ```bash
+ $ npm install
+ ```
+
+ Then run mocha from the command line:
+
+ ```bash
+ $ mocha
+ ``` | 13 | 0.325 | 12 | 1 |
f7108b212c596ba5c3f2bbf0184d186714130e93 | app/assets/javascripts/ng-app/services/control-panel-service.js | app/assets/javascripts/ng-app/services/control-panel-service.js | angular.module('myApp')
.factory('ctrlPanelService', ['$rootScope', 'userService', 'locationService','transactionService',
function($rootScope, $userService, locationService, transactionService) {
var settings = { users: null, userId: null };
settings.updateUsers = function(users) {
settings.users = users;
$rootScope.$broadcast('updateUsers');
}
settings.setUserId = function(userId) {
settings.userId = userId;
$rootScope.$broadcast('updateUserId');
}
// define generic submit event for other controllers to use
settings.submit = function() { $rootScope.$broadcast('submit') };
return settings;
}]); | angular.module('myApp')
.factory('ctrlPanelService', ['$rootScope', 'userService', 'locationService','transactionService',
function($rootScope, $userService, locationService, transactionService) {
// this service is responsible for storing and broadcasting changes
// to any of the control panel's settings. These settings are intended
// to be available to the entire app to be synced with whatever portion
// uses them. For example, transactions tab in charts will react to a
// selected userId via 'updateUserId' event on the $rootScope.
var settings = { users: null, userId: null };
settings.updateUsers = function(users) {
settings.users = users;
$rootScope.$broadcast('updateUsers');
}
settings.setUserId = function(userId) {
settings.userId = userId;
$rootScope.$broadcast('updateUserId');
}
// define generic submit event for other controllers to use
settings.submit = function() { $rootScope.$broadcast('submit') };
return settings;
}]); | Add comments for ctrlPanelService and its role | Add comments for ctrlPanelService and its role
| JavaScript | mit | godspeedyoo/Breeze-Mapper,godspeedyoo/Breeze-Mapper,godspeedyoo/Breeze-Mapper | javascript | ## Code Before:
angular.module('myApp')
.factory('ctrlPanelService', ['$rootScope', 'userService', 'locationService','transactionService',
function($rootScope, $userService, locationService, transactionService) {
var settings = { users: null, userId: null };
settings.updateUsers = function(users) {
settings.users = users;
$rootScope.$broadcast('updateUsers');
}
settings.setUserId = function(userId) {
settings.userId = userId;
$rootScope.$broadcast('updateUserId');
}
// define generic submit event for other controllers to use
settings.submit = function() { $rootScope.$broadcast('submit') };
return settings;
}]);
## Instruction:
Add comments for ctrlPanelService and its role
## Code After:
angular.module('myApp')
.factory('ctrlPanelService', ['$rootScope', 'userService', 'locationService','transactionService',
function($rootScope, $userService, locationService, transactionService) {
// this service is responsible for storing and broadcasting changes
// to any of the control panel's settings. These settings are intended
// to be available to the entire app to be synced with whatever portion
// uses them. For example, transactions tab in charts will react to a
// selected userId via 'updateUserId' event on the $rootScope.
var settings = { users: null, userId: null };
settings.updateUsers = function(users) {
settings.users = users;
$rootScope.$broadcast('updateUsers');
}
settings.setUserId = function(userId) {
settings.userId = userId;
$rootScope.$broadcast('updateUserId');
}
// define generic submit event for other controllers to use
settings.submit = function() { $rootScope.$broadcast('submit') };
return settings;
}]); | angular.module('myApp')
.factory('ctrlPanelService', ['$rootScope', 'userService', 'locationService','transactionService',
function($rootScope, $userService, locationService, transactionService) {
+ // this service is responsible for storing and broadcasting changes
+ // to any of the control panel's settings. These settings are intended
+ // to be available to the entire app to be synced with whatever portion
+ // uses them. For example, transactions tab in charts will react to a
+ // selected userId via 'updateUserId' event on the $rootScope.
var settings = { users: null, userId: null };
settings.updateUsers = function(users) {
settings.users = users;
$rootScope.$broadcast('updateUsers');
}
settings.setUserId = function(userId) {
settings.userId = userId;
$rootScope.$broadcast('updateUserId');
}
// define generic submit event for other controllers to use
settings.submit = function() { $rootScope.$broadcast('submit') };
return settings;
}]); | 5 | 0.217391 | 5 | 0 |
f03e2624fe48172be654736a3c3eeecfd71c714d | extension.js | extension.js | var iframeID = 1408059618092;
function hideMenus() {
var iframe = document.getElementById(iframeID);
iframe.hidden = true;
}
| var iframeID = 1408059618092;
function hideMenus() {
var iframe = document.getElementById(iframeID);
iframe.hidden = true;
console.log("Menu hidden");
}
| Add console message that describes behavior | Add console message that describes behavior
| JavaScript | mit | KentDenverSchool/KentLunchExtension | javascript | ## Code Before:
var iframeID = 1408059618092;
function hideMenus() {
var iframe = document.getElementById(iframeID);
iframe.hidden = true;
}
## Instruction:
Add console message that describes behavior
## Code After:
var iframeID = 1408059618092;
function hideMenus() {
var iframe = document.getElementById(iframeID);
iframe.hidden = true;
console.log("Menu hidden");
}
| var iframeID = 1408059618092;
function hideMenus() {
var iframe = document.getElementById(iframeID);
iframe.hidden = true;
+ console.log("Menu hidden");
} | 1 | 0.166667 | 1 | 0 |
7106b4b997121899323722ac67ab7a4605bcb6a6 | .travis.yml | .travis.yml | before_install:
- npm install -g grunt-cli
install:
- npm install -d
- webdriver-manager update
script:
- grunt production
env:
global:
- secure: OAm/M2exphl1FGXcCtjI+C41quNZXrfLLVHJMKG8ydSHgswxfKrIu9cEQcgMZH/hfHlnxIBiXjXDQXFsgTCUlYbiUqEgZSYOpNN6yGZMUThxZyN1eOo7UexOYmWB2tZ/a6XZTJFH/6lHpphigcs8Izc9QAWHmeivdJrK+DiRxqs=
- secure: RLLKjq6I+k+5vDmJqk/PC1Krm9Zo1VgAZlpeoLON5wgsTdMm5Z3dO3B8LtNsYG/+YhkctT5yG6hf18ehKypDz/5CAiq3ejPDWQrK+84I68zz81vj+TULy+WVM8WDf3oreK/ri0JXxm7jKbArsPzf3WubCEjLGkiBg3injdNWNdo=
| before_install:
- npm install -g grunt-cli
install:
- npm install -d
- webdriver-manager update
script:
- grunt production
- grunt coveralls
env:
global:
- secure: OAm/M2exphl1FGXcCtjI+C41quNZXrfLLVHJMKG8ydSHgswxfKrIu9cEQcgMZH/hfHlnxIBiXjXDQXFsgTCUlYbiUqEgZSYOpNN6yGZMUThxZyN1eOo7UexOYmWB2tZ/a6XZTJFH/6lHpphigcs8Izc9QAWHmeivdJrK+DiRxqs=
- secure: RLLKjq6I+k+5vDmJqk/PC1Krm9Zo1VgAZlpeoLON5wgsTdMm5Z3dO3B8LtNsYG/+YhkctT5yG6hf18ehKypDz/5CAiq3ejPDWQrK+84I68zz81vj+TULy+WVM8WDf3oreK/ri0JXxm7jKbArsPzf3WubCEjLGkiBg3injdNWNdo=
- secure: M8m44lrZL96VsldOQ0at0X23S/RGIn6gnKa+TA9MqcsjKk9oKNRhLgMrvhJ7GQ5TZSgAbU7coVKAZ6Ogi06z6dWKTeyy2KJ2zvB4g1rPcbclIDn2/a9osoh8wY4/0QvP5SE3WiQS1ZpppDetYdhFXHxiWB6r7N1M8IYWGmP+ED8=
| Update Travis to use Coveralls | Update Travis to use Coveralls
| YAML | mit | SquadraCorse/ng-lazy-image | yaml | ## Code Before:
before_install:
- npm install -g grunt-cli
install:
- npm install -d
- webdriver-manager update
script:
- grunt production
env:
global:
- secure: OAm/M2exphl1FGXcCtjI+C41quNZXrfLLVHJMKG8ydSHgswxfKrIu9cEQcgMZH/hfHlnxIBiXjXDQXFsgTCUlYbiUqEgZSYOpNN6yGZMUThxZyN1eOo7UexOYmWB2tZ/a6XZTJFH/6lHpphigcs8Izc9QAWHmeivdJrK+DiRxqs=
- secure: RLLKjq6I+k+5vDmJqk/PC1Krm9Zo1VgAZlpeoLON5wgsTdMm5Z3dO3B8LtNsYG/+YhkctT5yG6hf18ehKypDz/5CAiq3ejPDWQrK+84I68zz81vj+TULy+WVM8WDf3oreK/ri0JXxm7jKbArsPzf3WubCEjLGkiBg3injdNWNdo=
## Instruction:
Update Travis to use Coveralls
## Code After:
before_install:
- npm install -g grunt-cli
install:
- npm install -d
- webdriver-manager update
script:
- grunt production
- grunt coveralls
env:
global:
- secure: OAm/M2exphl1FGXcCtjI+C41quNZXrfLLVHJMKG8ydSHgswxfKrIu9cEQcgMZH/hfHlnxIBiXjXDQXFsgTCUlYbiUqEgZSYOpNN6yGZMUThxZyN1eOo7UexOYmWB2tZ/a6XZTJFH/6lHpphigcs8Izc9QAWHmeivdJrK+DiRxqs=
- secure: RLLKjq6I+k+5vDmJqk/PC1Krm9Zo1VgAZlpeoLON5wgsTdMm5Z3dO3B8LtNsYG/+YhkctT5yG6hf18ehKypDz/5CAiq3ejPDWQrK+84I68zz81vj+TULy+WVM8WDf3oreK/ri0JXxm7jKbArsPzf3WubCEjLGkiBg3injdNWNdo=
- secure: M8m44lrZL96VsldOQ0at0X23S/RGIn6gnKa+TA9MqcsjKk9oKNRhLgMrvhJ7GQ5TZSgAbU7coVKAZ6Ogi06z6dWKTeyy2KJ2zvB4g1rPcbclIDn2/a9osoh8wY4/0QvP5SE3WiQS1ZpppDetYdhFXHxiWB6r7N1M8IYWGmP+ED8=
| before_install:
- - npm install -g grunt-cli
? -
+ - npm install -g grunt-cli
-
install:
- - npm install -d
? -
+ - npm install -d
- - webdriver-manager update
? -
+ - webdriver-manager update
-
script:
- - grunt production
? --
+ - grunt production
-
+ - grunt coveralls
env:
global:
- secure: OAm/M2exphl1FGXcCtjI+C41quNZXrfLLVHJMKG8ydSHgswxfKrIu9cEQcgMZH/hfHlnxIBiXjXDQXFsgTCUlYbiUqEgZSYOpNN6yGZMUThxZyN1eOo7UexOYmWB2tZ/a6XZTJFH/6lHpphigcs8Izc9QAWHmeivdJrK+DiRxqs=
- secure: RLLKjq6I+k+5vDmJqk/PC1Krm9Zo1VgAZlpeoLON5wgsTdMm5Z3dO3B8LtNsYG/+YhkctT5yG6hf18ehKypDz/5CAiq3ejPDWQrK+84I68zz81vj+TULy+WVM8WDf3oreK/ri0JXxm7jKbArsPzf3WubCEjLGkiBg3injdNWNdo=
+ - secure: M8m44lrZL96VsldOQ0at0X23S/RGIn6gnKa+TA9MqcsjKk9oKNRhLgMrvhJ7GQ5TZSgAbU7coVKAZ6Ogi06z6dWKTeyy2KJ2zvB4g1rPcbclIDn2/a9osoh8wY4/0QvP5SE3WiQS1ZpppDetYdhFXHxiWB6r7N1M8IYWGmP+ED8= | 13 | 0.928571 | 6 | 7 |
eef76adb085c8e79fa0b3c1825e9db19069f0e66 | features/import.feature | features/import.feature | Feature: CSV import
In order to optimize read-performance of a CSV file
As a user
I want to import a CSV file into a P-Store database
Scenario: Uncompressed import
Given a 32K long CSV file
When I run "pstore import"
Then the database should contain the same data in column order
Scenario: FastLZ compressed import
Given a 32K long CSV file
When I run "pstore import --compress=fastlz"
Then the database should contain the same data in column order
Scenario: Uncompressed append
Given a 2K long CSV file
And a 4K long database
When I run "pstore import --append"
Then the database should contain the same data in column order
| Feature: CSV import
In order to optimize read-performance of a CSV file
As a user
I want to import a CSV file into a P-Store database
Scenario: Uncompressed import
Given a 32K long CSV file
When I run "pstore import"
Then the database should contain the same data in column order
Scenario: FastLZ compressed import
Given a 32K long CSV file
When I run "pstore import --compress=fastlz"
Then the database should contain the same data in column order
Scenario: Uncompressed append
Given a 2K long CSV file
And a 4K long database
When I run "pstore import --append"
Then the database should contain the same data in column order
Scenario: Significantly smaller window length than file size
Given a 32K long CSV file
When I run "pstore import --window-len=1K"
Then the database should contain the same data in column order
| Add scenario for small window length | features: Add scenario for small window length
When implementing builtin-export, it was noticed that a 1 GiB CSV
file is not correctly imported and that the problem appears to be
related to mmap() window handling.
This scenario exposes the failure with a 32 KiB CSV file by
setting the mmap() window length to minimum.
Signed-off-by: Jussi Virtanen <688853f2098600ecc93a73ab459c4906661052bb@reaktor.fi>
Signed-off-by: Pekka Enberg <add4fcd06328a394f0ad91feda7ee057316dc5ed@kernel.org>
| Cucumber | lgpl-2.1 | penberg/pstore,penberg/pstore,penberg/pstore,penberg/pstore | cucumber | ## Code Before:
Feature: CSV import
In order to optimize read-performance of a CSV file
As a user
I want to import a CSV file into a P-Store database
Scenario: Uncompressed import
Given a 32K long CSV file
When I run "pstore import"
Then the database should contain the same data in column order
Scenario: FastLZ compressed import
Given a 32K long CSV file
When I run "pstore import --compress=fastlz"
Then the database should contain the same data in column order
Scenario: Uncompressed append
Given a 2K long CSV file
And a 4K long database
When I run "pstore import --append"
Then the database should contain the same data in column order
## Instruction:
features: Add scenario for small window length
When implementing builtin-export, it was noticed that a 1 GiB CSV
file is not correctly imported and that the problem appears to be
related to mmap() window handling.
This scenario exposes the failure with a 32 KiB CSV file by
setting the mmap() window length to minimum.
Signed-off-by: Jussi Virtanen <688853f2098600ecc93a73ab459c4906661052bb@reaktor.fi>
Signed-off-by: Pekka Enberg <add4fcd06328a394f0ad91feda7ee057316dc5ed@kernel.org>
## Code After:
Feature: CSV import
In order to optimize read-performance of a CSV file
As a user
I want to import a CSV file into a P-Store database
Scenario: Uncompressed import
Given a 32K long CSV file
When I run "pstore import"
Then the database should contain the same data in column order
Scenario: FastLZ compressed import
Given a 32K long CSV file
When I run "pstore import --compress=fastlz"
Then the database should contain the same data in column order
Scenario: Uncompressed append
Given a 2K long CSV file
And a 4K long database
When I run "pstore import --append"
Then the database should contain the same data in column order
Scenario: Significantly smaller window length than file size
Given a 32K long CSV file
When I run "pstore import --window-len=1K"
Then the database should contain the same data in column order
| Feature: CSV import
In order to optimize read-performance of a CSV file
As a user
I want to import a CSV file into a P-Store database
Scenario: Uncompressed import
Given a 32K long CSV file
When I run "pstore import"
Then the database should contain the same data in column order
Scenario: FastLZ compressed import
Given a 32K long CSV file
When I run "pstore import --compress=fastlz"
Then the database should contain the same data in column order
Scenario: Uncompressed append
Given a 2K long CSV file
And a 4K long database
When I run "pstore import --append"
Then the database should contain the same data in column order
+
+ Scenario: Significantly smaller window length than file size
+ Given a 32K long CSV file
+ When I run "pstore import --window-len=1K"
+ Then the database should contain the same data in column order | 5 | 0.25 | 5 | 0 |
76830b92f5d2c4abe7ba6e98b0806a464813ca0b | src/java/com/iselsoft/ptest/runLineMarker/PTestRunLineMarkerContributor.java | src/java/com/iselsoft/ptest/runLineMarker/PTestRunLineMarkerContributor.java | package com.iselsoft.ptest.runLineMarker;
import com.intellij.execution.lineMarker.RunLineMarkerContributor;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.util.Function;
import com.iselsoft.ptest.runConfiguration.PTestConfigurationProducer;
import com.jetbrains.python.psi.PyClass;
import com.jetbrains.python.psi.PyFunction;
import org.jetbrains.annotations.Nullable;
public class PTestRunLineMarkerContributor extends RunLineMarkerContributor {
private static final PTestConfigurationProducer CONFIG_PRODUCER = new PTestConfigurationProducer();
private static final Function<PsiElement, String> TOOLTIP_PROVIDER = new Function<PsiElement, String>() {
@Override
public String fun(PsiElement psiElement) {
return "Run ptest";
}
};
@Nullable
@Override
public Info getInfo(PsiElement psiElement) {
if (psiElement instanceof PyFunction && CONFIG_PRODUCER.isPTestMethod(psiElement, null)) {
return new Info(AllIcons.RunConfigurations.TestState.Run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
} else if (psiElement instanceof PyClass && CONFIG_PRODUCER.isPTestClass(psiElement, null)) {
try {
return new Info(AllIcons.RunConfigurations.TestState.Run_run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
} catch (NoSuchFieldError e) {
return new Info(AllIcons.RunConfigurations.TestState.Run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
}
}
return null;
}
}
| package com.iselsoft.ptest.runLineMarker;
import com.intellij.execution.lineMarker.RunLineMarkerContributor;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.util.Function;
import com.iselsoft.ptest.runConfiguration.PTestConfigurationProducer;
import com.jetbrains.python.psi.PyClass;
import com.jetbrains.python.psi.PyFunction;
import org.jetbrains.annotations.Nullable;
public class PTestRunLineMarkerContributor extends RunLineMarkerContributor {
private static final PTestConfigurationProducer CONFIG_PRODUCER = new PTestConfigurationProducer();
private static final Function<PsiElement, String> TOOLTIP_PROVIDER = new Function<PsiElement, String>() {
@Override
public String fun(PsiElement psiElement) {
return "Run ptest";
}
};
@Nullable
@Override
public Info getInfo(PsiElement psiElement) {
if (psiElement instanceof PyFunction && CONFIG_PRODUCER.isPTestMethod(psiElement, null)) {
return new Info(AllIcons.RunConfigurations.TestState.Run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
} else if (psiElement instanceof PyClass && CONFIG_PRODUCER.isPTestClass(psiElement, null)) {
return new Info(AllIcons.RunConfigurations.TestState.Run_run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
}
return null;
}
}
| Remove old pycharm icon support. | Remove old pycharm icon support.
| Java | apache-2.0 | KarlGong/ptest-pycharm-plugin,KarlGong/ptest-pycharm-plugin,KarlGong/ptest-pycharm-plugin | java | ## Code Before:
package com.iselsoft.ptest.runLineMarker;
import com.intellij.execution.lineMarker.RunLineMarkerContributor;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.util.Function;
import com.iselsoft.ptest.runConfiguration.PTestConfigurationProducer;
import com.jetbrains.python.psi.PyClass;
import com.jetbrains.python.psi.PyFunction;
import org.jetbrains.annotations.Nullable;
public class PTestRunLineMarkerContributor extends RunLineMarkerContributor {
private static final PTestConfigurationProducer CONFIG_PRODUCER = new PTestConfigurationProducer();
private static final Function<PsiElement, String> TOOLTIP_PROVIDER = new Function<PsiElement, String>() {
@Override
public String fun(PsiElement psiElement) {
return "Run ptest";
}
};
@Nullable
@Override
public Info getInfo(PsiElement psiElement) {
if (psiElement instanceof PyFunction && CONFIG_PRODUCER.isPTestMethod(psiElement, null)) {
return new Info(AllIcons.RunConfigurations.TestState.Run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
} else if (psiElement instanceof PyClass && CONFIG_PRODUCER.isPTestClass(psiElement, null)) {
try {
return new Info(AllIcons.RunConfigurations.TestState.Run_run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
} catch (NoSuchFieldError e) {
return new Info(AllIcons.RunConfigurations.TestState.Run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
}
}
return null;
}
}
## Instruction:
Remove old pycharm icon support.
## Code After:
package com.iselsoft.ptest.runLineMarker;
import com.intellij.execution.lineMarker.RunLineMarkerContributor;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.util.Function;
import com.iselsoft.ptest.runConfiguration.PTestConfigurationProducer;
import com.jetbrains.python.psi.PyClass;
import com.jetbrains.python.psi.PyFunction;
import org.jetbrains.annotations.Nullable;
public class PTestRunLineMarkerContributor extends RunLineMarkerContributor {
private static final PTestConfigurationProducer CONFIG_PRODUCER = new PTestConfigurationProducer();
private static final Function<PsiElement, String> TOOLTIP_PROVIDER = new Function<PsiElement, String>() {
@Override
public String fun(PsiElement psiElement) {
return "Run ptest";
}
};
@Nullable
@Override
public Info getInfo(PsiElement psiElement) {
if (psiElement instanceof PyFunction && CONFIG_PRODUCER.isPTestMethod(psiElement, null)) {
return new Info(AllIcons.RunConfigurations.TestState.Run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
} else if (psiElement instanceof PyClass && CONFIG_PRODUCER.isPTestClass(psiElement, null)) {
return new Info(AllIcons.RunConfigurations.TestState.Run_run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
}
return null;
}
}
| package com.iselsoft.ptest.runLineMarker;
import com.intellij.execution.lineMarker.RunLineMarkerContributor;
import com.intellij.icons.AllIcons;
import com.intellij.psi.PsiElement;
import com.intellij.util.Function;
import com.iselsoft.ptest.runConfiguration.PTestConfigurationProducer;
import com.jetbrains.python.psi.PyClass;
import com.jetbrains.python.psi.PyFunction;
import org.jetbrains.annotations.Nullable;
public class PTestRunLineMarkerContributor extends RunLineMarkerContributor {
private static final PTestConfigurationProducer CONFIG_PRODUCER = new PTestConfigurationProducer();
private static final Function<PsiElement, String> TOOLTIP_PROVIDER = new Function<PsiElement, String>() {
@Override
public String fun(PsiElement psiElement) {
return "Run ptest";
}
};
@Nullable
@Override
public Info getInfo(PsiElement psiElement) {
if (psiElement instanceof PyFunction && CONFIG_PRODUCER.isPTestMethod(psiElement, null)) {
return new Info(AllIcons.RunConfigurations.TestState.Run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
} else if (psiElement instanceof PyClass && CONFIG_PRODUCER.isPTestClass(psiElement, null)) {
- try {
- return new Info(AllIcons.RunConfigurations.TestState.Run_run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
? ----
+ return new Info(AllIcons.RunConfigurations.TestState.Run_run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
- } catch (NoSuchFieldError e) {
- return new Info(AllIcons.RunConfigurations.TestState.Run, TOOLTIP_PROVIDER, PTestRunLineMarkerAction.getActions());
- }
}
return null;
}
} | 6 | 0.171429 | 1 | 5 |
f7bf2035b865c041f8774509896786376c2ff415 | init/10_osx.sh | init/10_osx.sh | [[ "$OSTYPE" =~ ^darwin ]] || return 1
# Install Homebrew.
if [[ ! "$(type -P brew)" ]]; then
e_header "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
fi
# Update Homebrew.
if [[ "$(type -P brew)" ]]; then
e_header "Updating Homebrew"
brew update
fi
# Install Homebrew recipes.
if [[ "$(type -P brew)" ]]; then
recipes=(git node tree sl lesspipe id3tool nmap git-extras)
list="$(to_install "${recipes[*]}" "$(brew list)")"
if [[ "$list" ]]; then
e_header "Installing Homebrew recipes: $list"
brew install $list
fi
# Newer OSX XCode comes with an LLVM gcc which rbenv can't use.
source ~/.dotfiles/source/50_rbenv.sh
if [[ ! "$RBENV_CC" && ! "$(brew list | grep -w "gcc")" ]]; then
e_header "Installing Homebrew-alt gcc recipe"
echo "Note: this step can take 15+ minutes, but a non-LLVM gcc is required by rbenv."
skip || brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/gcc.rb
fi
fi
| [[ "$OSTYPE" =~ ^darwin ]] || return 1
# Install Homebrew.
if [[ ! "$(type -P brew)" ]]; then
e_header "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
fi
# Update Homebrew.
if [[ "$(type -P brew)" ]]; then
e_header "Updating Homebrew"
brew update
fi
# Install Homebrew recipes.
if [[ "$(type -P brew)" ]]; then
recipes=(git sl lesspipe git-extras)
list="$(to_install "${recipes[*]}" "$(brew list)")"
if [[ "$list" ]]; then
e_header "Installing Homebrew recipes: $list"
brew install $list
fi
# Newer OSX XCode comes with an LLVM gcc which rbenv can't use.
source ~/.dotfiles/source/50_rbenv.sh
if [[ ! "$RBENV_CC" && ! "$(brew list | grep -w "gcc")" ]]; then
e_header "Installing Homebrew-alt gcc recipe"
echo "Note: this step can take 15+ minutes, but a non-LLVM gcc is required by rbenv."
skip || brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/gcc.rb
fi
fi
| Remove unneeded packages from OSX init script. | Remove unneeded packages from OSX init script.
| Shell | mit | monsendag/dotfiles,monsendag/dotfiles,monsendag/dotfiles,monsendag/dotfiles,monsendag/dotfiles,monsendag/dotfiles | shell | ## Code Before:
[[ "$OSTYPE" =~ ^darwin ]] || return 1
# Install Homebrew.
if [[ ! "$(type -P brew)" ]]; then
e_header "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
fi
# Update Homebrew.
if [[ "$(type -P brew)" ]]; then
e_header "Updating Homebrew"
brew update
fi
# Install Homebrew recipes.
if [[ "$(type -P brew)" ]]; then
recipes=(git node tree sl lesspipe id3tool nmap git-extras)
list="$(to_install "${recipes[*]}" "$(brew list)")"
if [[ "$list" ]]; then
e_header "Installing Homebrew recipes: $list"
brew install $list
fi
# Newer OSX XCode comes with an LLVM gcc which rbenv can't use.
source ~/.dotfiles/source/50_rbenv.sh
if [[ ! "$RBENV_CC" && ! "$(brew list | grep -w "gcc")" ]]; then
e_header "Installing Homebrew-alt gcc recipe"
echo "Note: this step can take 15+ minutes, but a non-LLVM gcc is required by rbenv."
skip || brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/gcc.rb
fi
fi
## Instruction:
Remove unneeded packages from OSX init script.
## Code After:
[[ "$OSTYPE" =~ ^darwin ]] || return 1
# Install Homebrew.
if [[ ! "$(type -P brew)" ]]; then
e_header "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
fi
# Update Homebrew.
if [[ "$(type -P brew)" ]]; then
e_header "Updating Homebrew"
brew update
fi
# Install Homebrew recipes.
if [[ "$(type -P brew)" ]]; then
recipes=(git sl lesspipe git-extras)
list="$(to_install "${recipes[*]}" "$(brew list)")"
if [[ "$list" ]]; then
e_header "Installing Homebrew recipes: $list"
brew install $list
fi
# Newer OSX XCode comes with an LLVM gcc which rbenv can't use.
source ~/.dotfiles/source/50_rbenv.sh
if [[ ! "$RBENV_CC" && ! "$(brew list | grep -w "gcc")" ]]; then
e_header "Installing Homebrew-alt gcc recipe"
echo "Note: this step can take 15+ minutes, but a non-LLVM gcc is required by rbenv."
skip || brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/gcc.rb
fi
fi
| [[ "$OSTYPE" =~ ^darwin ]] || return 1
# Install Homebrew.
if [[ ! "$(type -P brew)" ]]; then
e_header "Installing Homebrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
fi
# Update Homebrew.
if [[ "$(type -P brew)" ]]; then
e_header "Updating Homebrew"
brew update
fi
# Install Homebrew recipes.
if [[ "$(type -P brew)" ]]; then
- recipes=(git node tree sl lesspipe id3tool nmap git-extras)
? ---------- -------------
+ recipes=(git sl lesspipe git-extras)
list="$(to_install "${recipes[*]}" "$(brew list)")"
if [[ "$list" ]]; then
e_header "Installing Homebrew recipes: $list"
brew install $list
fi
# Newer OSX XCode comes with an LLVM gcc which rbenv can't use.
source ~/.dotfiles/source/50_rbenv.sh
if [[ ! "$RBENV_CC" && ! "$(brew list | grep -w "gcc")" ]]; then
e_header "Installing Homebrew-alt gcc recipe"
echo "Note: this step can take 15+ minutes, but a non-LLVM gcc is required by rbenv."
skip || brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/gcc.rb
fi
fi | 2 | 0.0625 | 1 | 1 |
f23208d881501901e232e652503f0707256adf94 | lib/sonia/widgets/icinga.rb | lib/sonia/widgets/icinga.rb | require 'nokogiri'
require 'em-http'
module Sonia
module Widgets
class Icinga < Sonia::Widget
def initial_push
fetch_data
EventMachine::add_periodic_timer(61) { fetch_data }
end
def format_status(stat)
{
:count => stat.match(/(\d*)\s(\w*)/)[1],
:status => stat.match(/(\d*)\s(\w*)/)[2]
}
end
private
def headers
{ :head => { 'Authorization' => [config[:username], config[:password]] } }
end
def fetch_data
http = EventMachine::HttpRequest.new(config[:url]).get(headers)
http.callback {
statuses = Nokogiri::HTML(http.response).xpath("//td/a[contains(@class,'serviceHeader')]").map do |node|
format_status(node.content)
end
push statuses
}
end
end # class
end # module
end # module | require 'nokogiri'
require 'em-http'
module Sonia
module Widgets
class Icinga < Sonia::Widget
def initial_push
fetch_data
EventMachine::add_periodic_timer(60) { fetch_data }
end
def format_status(stat)
{
:count => stat.match(/(\d*)\s(\w*)/)[1],
:status => stat.match(/(\d*)\s(\w*)/)[2]
}
end
private
def headers
{ :head => { 'Authorization' => [config[:username], config[:password]] } }
end
def fetch_data
http = EventMachine::HttpRequest.new(config[:url]).get(headers)
http.callback {
statuses = Nokogiri::HTML(http.response).xpath("//td/a[contains(@class,'serviceHeader')]").map do |node|
format_status(node.content)
end
push statuses
}
end
end # class
end # module
end # module
| Set timer to 60 seconds | Set timer to 60 seconds
| Ruby | mit | tachikomapocket/pusewicz-_-sonia,tachikomapocket/pusewicz-_-sonia,pusewicz/sonia,pusewicz/sonia,pusewicz/sonia,tachikomapocket/pusewicz-_-sonia | ruby | ## Code Before:
require 'nokogiri'
require 'em-http'
module Sonia
module Widgets
class Icinga < Sonia::Widget
def initial_push
fetch_data
EventMachine::add_periodic_timer(61) { fetch_data }
end
def format_status(stat)
{
:count => stat.match(/(\d*)\s(\w*)/)[1],
:status => stat.match(/(\d*)\s(\w*)/)[2]
}
end
private
def headers
{ :head => { 'Authorization' => [config[:username], config[:password]] } }
end
def fetch_data
http = EventMachine::HttpRequest.new(config[:url]).get(headers)
http.callback {
statuses = Nokogiri::HTML(http.response).xpath("//td/a[contains(@class,'serviceHeader')]").map do |node|
format_status(node.content)
end
push statuses
}
end
end # class
end # module
end # module
## Instruction:
Set timer to 60 seconds
## Code After:
require 'nokogiri'
require 'em-http'
module Sonia
module Widgets
class Icinga < Sonia::Widget
def initial_push
fetch_data
EventMachine::add_periodic_timer(60) { fetch_data }
end
def format_status(stat)
{
:count => stat.match(/(\d*)\s(\w*)/)[1],
:status => stat.match(/(\d*)\s(\w*)/)[2]
}
end
private
def headers
{ :head => { 'Authorization' => [config[:username], config[:password]] } }
end
def fetch_data
http = EventMachine::HttpRequest.new(config[:url]).get(headers)
http.callback {
statuses = Nokogiri::HTML(http.response).xpath("//td/a[contains(@class,'serviceHeader')]").map do |node|
format_status(node.content)
end
push statuses
}
end
end # class
end # module
end # module
| require 'nokogiri'
require 'em-http'
module Sonia
module Widgets
class Icinga < Sonia::Widget
def initial_push
fetch_data
- EventMachine::add_periodic_timer(61) { fetch_data }
? ^
+ EventMachine::add_periodic_timer(60) { fetch_data }
? ^
end
def format_status(stat)
{
:count => stat.match(/(\d*)\s(\w*)/)[1],
:status => stat.match(/(\d*)\s(\w*)/)[2]
}
end
private
-
+
def headers
{ :head => { 'Authorization' => [config[:username], config[:password]] } }
end
-
+
def fetch_data
http = EventMachine::HttpRequest.new(config[:url]).get(headers)
http.callback {
statuses = Nokogiri::HTML(http.response).xpath("//td/a[contains(@class,'serviceHeader')]").map do |node|
format_status(node.content)
end
push statuses
}
end
-
+
end # class
end # module
end # module | 8 | 0.210526 | 4 | 4 |
b07738fad5f3e3b88ec55576cff4e08356df8cd0 | math/vectorHelpers.js | math/vectorHelpers.js | // This file could have a better name
function rand(min = 0, max = 1) {
return min + Math.random() * (max - min);
}
function randStart(rangeX, rangeY, rangeZ) {
return {
x: rand(-rangeX/2, rangeX/2),
y: rand(-rangeY/2, rangeY/2),
z: rand(-rangeZ/2, rangeZ/2),
};
}
module.exports = {
rand,
randStart,
}
| // This file could have a better name
function rand(min, max) {
min = min || 0;
max = max || 1;
return min + Math.random() * (max - min);
}
function randStart(rangeX, rangeY, rangeZ) {
return {
x: rand(-rangeX/2, rangeX/2),
y: rand(-rangeY/2, rangeY/2),
z: rand(-rangeZ/2, rangeZ/2),
};
}
module.exports = {
rand,
randStart,
}
| Fix mobile by removing default param values from vectorHelper | Fix mobile by removing default param values from vectorHelper
| JavaScript | mit | ourvrisrealerthanyours/tanks,elliotaplant/tanks,ourvrisrealerthanyours/tanks,elliotaplant/tanks | javascript | ## Code Before:
// This file could have a better name
function rand(min = 0, max = 1) {
return min + Math.random() * (max - min);
}
function randStart(rangeX, rangeY, rangeZ) {
return {
x: rand(-rangeX/2, rangeX/2),
y: rand(-rangeY/2, rangeY/2),
z: rand(-rangeZ/2, rangeZ/2),
};
}
module.exports = {
rand,
randStart,
}
## Instruction:
Fix mobile by removing default param values from vectorHelper
## Code After:
// This file could have a better name
function rand(min, max) {
min = min || 0;
max = max || 1;
return min + Math.random() * (max - min);
}
function randStart(rangeX, rangeY, rangeZ) {
return {
x: rand(-rangeX/2, rangeX/2),
y: rand(-rangeY/2, rangeY/2),
z: rand(-rangeZ/2, rangeZ/2),
};
}
module.exports = {
rand,
randStart,
}
| // This file could have a better name
- function rand(min = 0, max = 1) {
? ---- ----
+ function rand(min, max) {
+ min = min || 0;
+ max = max || 1;
return min + Math.random() * (max - min);
}
function randStart(rangeX, rangeY, rangeZ) {
return {
x: rand(-rangeX/2, rangeX/2),
y: rand(-rangeY/2, rangeY/2),
z: rand(-rangeZ/2, rangeZ/2),
};
}
module.exports = {
rand,
randStart,
} | 4 | 0.222222 | 3 | 1 |
d94444f2482714eb34ee11bb481af1066730d2ec | lib/templates/index.html | lib/templates/index.html | <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{ product }}</title>
</head>
<body>
<img src="{{ thumb }}" />
<ul>
{% for file in files %}
<li><a href="{{ file }}">{{ file }}</a></li>
{% endfor %}
</ul>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{ product }}</title>
</head>
<body>
<h1>{{ product }}</h1>
<img src="{{ thumb }}" />
<h2>Files</h2>
<ul>
{% for file in files %}
<li><a href="{{ file }}">{{ file }}</a></li>
{% endfor %}
</ul>
</body>
</html>
| Update html to better match landsat | Update html to better match landsat
| HTML | mit | AstroDigital/modis-ingestor,AstroDigital/modis-ingestor | html | ## Code Before:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{ product }}</title>
</head>
<body>
<img src="{{ thumb }}" />
<ul>
{% for file in files %}
<li><a href="{{ file }}">{{ file }}</a></li>
{% endfor %}
</ul>
</body>
</html>
## Instruction:
Update html to better match landsat
## Code After:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{ product }}</title>
</head>
<body>
<h1>{{ product }}</h1>
<img src="{{ thumb }}" />
<h2>Files</h2>
<ul>
{% for file in files %}
<li><a href="{{ file }}">{{ file }}</a></li>
{% endfor %}
</ul>
</body>
</html>
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{ product }}</title>
</head>
<body>
+ <h1>{{ product }}</h1>
<img src="{{ thumb }}" />
+ <h2>Files</h2>
<ul>
{% for file in files %}
<li><a href="{{ file }}">{{ file }}</a></li>
{% endfor %}
</ul>
</body>
</html> | 2 | 0.133333 | 2 | 0 |
53bb4a9634e1ea2c5473382313ed4b97417876c2 | templates/teamlogic/match_set.html | templates/teamlogic/match_set.html | {% extends "base.html" %}
{% block content %}
<ul class="breadcrumb">
<li><a href="#"> АДФС </a> <span class="divider"></span></li>
<li><a href="#"> Матчи </a> <span class="divider"></span></li>
</ul>
{% for match in matches %}
<a href="{{match.home.get_absolute_url}}">{{ match.home }}</a> - <a href="{{match.away.get_absolute_url}}">{{ match.away }}</a>
<a href="{{match.get_absolute_url}}"> {{ match.home_goal }}:{{ match.away_goal }} </a>
<br>
{% endfor %}
{% endblock %}
| {% extends "base.html" %}
{% block content %}
<ul class="breadcrumb">
<li><a href="#"> АДФС </a> <span class="divider"></span></li>
<li><a href="#"> Матчи </a> <span class="divider"></span></li>
</ul>
{% for match in matches %}
<div class="media">
<div class="media-body">
<div class="col-xs-3">
<a href="{{match.home.get_absolute_url}}">{{ match.home }}</a>
</div>
<div class="col-xs-2">
<a href="{{match.get_absolute_url}}">{{ match.home_goal }}:{{ match.away_goal }}</a>
</div>
<div class="col-xs-3">
<a href="{{match.away.get_absolute_url}}">{{ match.away }}</a>
</div>
</div>
</div>
{% endfor %}
{% endblock %}
| Use media objects for list of matchs | Use media objects for list of matchs
| HTML | apache-2.0 | SarFootball/backend,SarFootball/backend,SarFootball/backend | html | ## Code Before:
{% extends "base.html" %}
{% block content %}
<ul class="breadcrumb">
<li><a href="#"> АДФС </a> <span class="divider"></span></li>
<li><a href="#"> Матчи </a> <span class="divider"></span></li>
</ul>
{% for match in matches %}
<a href="{{match.home.get_absolute_url}}">{{ match.home }}</a> - <a href="{{match.away.get_absolute_url}}">{{ match.away }}</a>
<a href="{{match.get_absolute_url}}"> {{ match.home_goal }}:{{ match.away_goal }} </a>
<br>
{% endfor %}
{% endblock %}
## Instruction:
Use media objects for list of matchs
## Code After:
{% extends "base.html" %}
{% block content %}
<ul class="breadcrumb">
<li><a href="#"> АДФС </a> <span class="divider"></span></li>
<li><a href="#"> Матчи </a> <span class="divider"></span></li>
</ul>
{% for match in matches %}
<div class="media">
<div class="media-body">
<div class="col-xs-3">
<a href="{{match.home.get_absolute_url}}">{{ match.home }}</a>
</div>
<div class="col-xs-2">
<a href="{{match.get_absolute_url}}">{{ match.home_goal }}:{{ match.away_goal }}</a>
</div>
<div class="col-xs-3">
<a href="{{match.away.get_absolute_url}}">{{ match.away }}</a>
</div>
</div>
</div>
{% endfor %}
{% endblock %}
| {% extends "base.html" %}
{% block content %}
<ul class="breadcrumb">
<li><a href="#"> АДФС </a> <span class="divider"></span></li>
<li><a href="#"> Матчи </a> <span class="divider"></span></li>
</ul>
{% for match in matches %}
- <a href="{{match.home.get_absolute_url}}">{{ match.home }}</a> - <a href="{{match.away.get_absolute_url}}">{{ match.away }}</a>
+ <div class="media">
+ <div class="media-body">
+ <div class="col-xs-3">
+ <a href="{{match.home.get_absolute_url}}">{{ match.home }}</a>
+ </div>
+ <div class="col-xs-2">
- <a href="{{match.get_absolute_url}}"> {{ match.home_goal }}:{{ match.away_goal }} </a>
? - -
+ <a href="{{match.get_absolute_url}}">{{ match.home_goal }}:{{ match.away_goal }}</a>
? ++++++
- <br>
+ </div>
+ <div class="col-xs-3">
+ <a href="{{match.away.get_absolute_url}}">{{ match.away }}</a>
+ </div>
+ </div>
+ </div>
{% endfor %}
{% endblock %} | 16 | 1.066667 | 13 | 3 |
1fea733349dc86ac18989a32d76fa6bc9ad42363 | pyprika/tests/kit/fixtures/simple/water.yaml | pyprika/tests/kit/fixtures/simple/water.yaml | index: w01
name: Water
ingredients:
- water
directions:
- drink
| index: w01
name: Water
categories:
- Liquid
ingredients:
- water
directions:
- drink
| Add `categories` field to fixture as sanity check | Add `categories` field to fixture as sanity check
| YAML | mit | OEP/pyprika | yaml | ## Code Before:
index: w01
name: Water
ingredients:
- water
directions:
- drink
## Instruction:
Add `categories` field to fixture as sanity check
## Code After:
index: w01
name: Water
categories:
- Liquid
ingredients:
- water
directions:
- drink
| index: w01
name: Water
+ categories:
+ - Liquid
ingredients:
- water
directions:
- drink | 2 | 0.25 | 2 | 0 |
8a68938391b97000e7fe58b92c941ea0876450c6 | edison-status/src/main/java/de/otto/edison/status/configuration/SystemInfoConfiguration.java | edison-status/src/main/java/de/otto/edison/status/configuration/SystemInfoConfiguration.java | package de.otto.edison.status.configuration;
import de.otto.edison.status.domain.SystemInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.net.InetAddress;
import java.net.UnknownHostException;
@Configuration
public class SystemInfoConfiguration {
private static final String defaultHostname;
static {
String localHost = null;
try {
localHost = InetAddress.getLocalHost().getHostName();
} catch (final UnknownHostException ignored) { }
defaultHostname = localHost;
}
@Value("${HOSTNAME:}")
private String hostname;
@Value("${server.hostname:}")
private String envhostname;
@Value("${server.port:}")
private int port;
@Bean
@ConditionalOnMissingBean(SystemInfo.class)
public SystemInfo systemInfo() {
return SystemInfo.systemInfo(hostname(), port);
}
private String hostname() {
if (envhostname != null && !envhostname.isEmpty()) {
return envhostname;
}
if(hostname != null && !hostname.isEmpty()) {
return hostname;
}
return defaultHostname;
}
}
| package de.otto.edison.status.configuration;
import de.otto.edison.status.domain.SystemInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
import java.net.InetAddress;
import java.net.UnknownHostException;
@Configuration
public class SystemInfoConfiguration {
private static final String defaultHostname;
static {
String localHost = null;
try {
localHost = InetAddress.getLocalHost().getHostName();
} catch (final UnknownHostException ignored) {
}
defaultHostname = localHost;
}
@Value("${HOSTNAME:}")
private String hostname;
@Value("${server.hostname:}")
private String envhostname;
@Value("${server.port:8080}")
private int port;
@Bean
@ConditionalOnMissingBean(SystemInfo.class)
public SystemInfo systemInfo() {
return SystemInfo.systemInfo(hostname(), port);
}
private String hostname() {
if (!StringUtils.isEmpty(envhostname)) {
return envhostname;
}
if (!StringUtils.isEmpty(hostname)) {
return hostname;
}
return defaultHostname;
}
}
| Set default for server port. | Set default for server port.
| Java | apache-2.0 | otto-de/edison-microservice,otto-de/edison-microservice,otto-de/edison-microservice,otto-de/edison-microservice | java | ## Code Before:
package de.otto.edison.status.configuration;
import de.otto.edison.status.domain.SystemInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.net.InetAddress;
import java.net.UnknownHostException;
@Configuration
public class SystemInfoConfiguration {
private static final String defaultHostname;
static {
String localHost = null;
try {
localHost = InetAddress.getLocalHost().getHostName();
} catch (final UnknownHostException ignored) { }
defaultHostname = localHost;
}
@Value("${HOSTNAME:}")
private String hostname;
@Value("${server.hostname:}")
private String envhostname;
@Value("${server.port:}")
private int port;
@Bean
@ConditionalOnMissingBean(SystemInfo.class)
public SystemInfo systemInfo() {
return SystemInfo.systemInfo(hostname(), port);
}
private String hostname() {
if (envhostname != null && !envhostname.isEmpty()) {
return envhostname;
}
if(hostname != null && !hostname.isEmpty()) {
return hostname;
}
return defaultHostname;
}
}
## Instruction:
Set default for server port.
## Code After:
package de.otto.edison.status.configuration;
import de.otto.edison.status.domain.SystemInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.StringUtils;
import java.net.InetAddress;
import java.net.UnknownHostException;
@Configuration
public class SystemInfoConfiguration {
private static final String defaultHostname;
static {
String localHost = null;
try {
localHost = InetAddress.getLocalHost().getHostName();
} catch (final UnknownHostException ignored) {
}
defaultHostname = localHost;
}
@Value("${HOSTNAME:}")
private String hostname;
@Value("${server.hostname:}")
private String envhostname;
@Value("${server.port:8080}")
private int port;
@Bean
@ConditionalOnMissingBean(SystemInfo.class)
public SystemInfo systemInfo() {
return SystemInfo.systemInfo(hostname(), port);
}
private String hostname() {
if (!StringUtils.isEmpty(envhostname)) {
return envhostname;
}
if (!StringUtils.isEmpty(hostname)) {
return hostname;
}
return defaultHostname;
}
}
| package de.otto.edison.status.configuration;
import de.otto.edison.status.domain.SystemInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+ import org.springframework.util.StringUtils;
import java.net.InetAddress;
import java.net.UnknownHostException;
@Configuration
public class SystemInfoConfiguration {
private static final String defaultHostname;
static {
String localHost = null;
try {
localHost = InetAddress.getLocalHost().getHostName();
- } catch (final UnknownHostException ignored) { }
? --
+ } catch (final UnknownHostException ignored) {
+ }
defaultHostname = localHost;
}
@Value("${HOSTNAME:}")
private String hostname;
@Value("${server.hostname:}")
private String envhostname;
- @Value("${server.port:}")
+ @Value("${server.port:8080}")
? ++++
private int port;
@Bean
@ConditionalOnMissingBean(SystemInfo.class)
public SystemInfo systemInfo() {
return SystemInfo.systemInfo(hostname(), port);
}
private String hostname() {
- if (envhostname != null && !envhostname.isEmpty()) {
+ if (!StringUtils.isEmpty(envhostname)) {
return envhostname;
}
- if(hostname != null && !hostname.isEmpty()) {
+ if (!StringUtils.isEmpty(hostname)) {
return hostname;
}
return defaultHostname;
}
} | 10 | 0.212766 | 6 | 4 |
c6e0bcdcc3912cfc5f3c07f6012e597d0e914339 | src/Action/Test.hs | src/Action/Test.hs | {-# LANGUAGE ViewPatterns, TupleSections, RecordWildCards, ScopedTypeVariables, PatternGuards #-}
module Action.Test(testMain) where
import Data.Monoid
import Query
import Action.CmdLine
testMain :: CmdLine -> IO ()
testMain Test{} = do
testQuery
putStrLn ""
testQuery :: IO ()
testQuery = do
let a === b | parseQuery a == b = putChar '.'
| otherwise = error $ show ("testQuery",a,b)
"" === mempty
| {-# LANGUAGE ViewPatterns, TupleSections, RecordWildCards, ScopedTypeVariables, PatternGuards #-}
module Action.Test(testMain) where
import Data.Monoid
import Query
import Action.CmdLine
import Language.Haskell.Exts
testMain :: CmdLine -> IO ()
testMain Test{} = do
testQuery
putStrLn ""
testQuery :: IO ()
testQuery = do
let a === b | parseQuery a == b = putChar '.'
| otherwise = error $ show ("testQuery",a,b)
let typ = fromParseResult . parseType
let q = mempty
"" === mempty
"map" === q{names = ["map"]}
"#" === q{names = ["#"]}
"c#" === q{names = ["c#"]}
"-" === q{names = ["-"]}
"/" === q{names = ["/"]}
"->" === q{names = ["->"]}
"foldl'" === q{names = ["foldl'"]}
"fold'l" === q{names = ["fold'l"]}
"Int#" === q{names = ["Int#"]}
"concat map" === q{names = ["concat","map"]}
"a -> b" === q{sig = Just (typ "a -> b")}
"(a b)" === q{sig = Just (typ "(a b)")}
"map :: a -> b" === q{names = ["map"], sig = Just (typ "a -> b")}
"+Data.Map map" === q{scope = [Scope True "module" "Data.Map"], names = ["map"]}
"a -> b package:foo" === q{scope = [Scope True "package" "foo"], sig = Just (typ "a -> b")}
"a -> b package:foo-bar" === q{scope = [Scope True "package" "foo-bar"], sig = Just (typ "a -> b")}
"Data.Map.map" === q{scope = [Scope True "module" "Data.Map"], names = ["map"]}
"[a]" === q{sig = Just (typ "[a]")}
"++" === q{names = ["++"]}
"(++)" === q{names = ["++"]}
":+:" === q{names = [":+:"]}
"bytestring-cvs +hackage" === q{scope=[Scope True "package" "hackage"], names=["bytestring-cvs"]}
| Add the Hoogle query parser test suite | Add the Hoogle query parser test suite
| Haskell | bsd-3-clause | ndmitchell/hoogle,BartAdv/hoogle,wolftune/hoogle,BartAdv/hoogle,wolftune/hoogle,wolftune/hoogle,ndmitchell/hoogle,ndmitchell/hogle-dead,wolftune/hoogle,ndmitchell/hoogle,BartAdv/hoogle,BartAdv/hoogle,ndmitchell/hogle-dead | haskell | ## Code Before:
{-# LANGUAGE ViewPatterns, TupleSections, RecordWildCards, ScopedTypeVariables, PatternGuards #-}
module Action.Test(testMain) where
import Data.Monoid
import Query
import Action.CmdLine
testMain :: CmdLine -> IO ()
testMain Test{} = do
testQuery
putStrLn ""
testQuery :: IO ()
testQuery = do
let a === b | parseQuery a == b = putChar '.'
| otherwise = error $ show ("testQuery",a,b)
"" === mempty
## Instruction:
Add the Hoogle query parser test suite
## Code After:
{-# LANGUAGE ViewPatterns, TupleSections, RecordWildCards, ScopedTypeVariables, PatternGuards #-}
module Action.Test(testMain) where
import Data.Monoid
import Query
import Action.CmdLine
import Language.Haskell.Exts
testMain :: CmdLine -> IO ()
testMain Test{} = do
testQuery
putStrLn ""
testQuery :: IO ()
testQuery = do
let a === b | parseQuery a == b = putChar '.'
| otherwise = error $ show ("testQuery",a,b)
let typ = fromParseResult . parseType
let q = mempty
"" === mempty
"map" === q{names = ["map"]}
"#" === q{names = ["#"]}
"c#" === q{names = ["c#"]}
"-" === q{names = ["-"]}
"/" === q{names = ["/"]}
"->" === q{names = ["->"]}
"foldl'" === q{names = ["foldl'"]}
"fold'l" === q{names = ["fold'l"]}
"Int#" === q{names = ["Int#"]}
"concat map" === q{names = ["concat","map"]}
"a -> b" === q{sig = Just (typ "a -> b")}
"(a b)" === q{sig = Just (typ "(a b)")}
"map :: a -> b" === q{names = ["map"], sig = Just (typ "a -> b")}
"+Data.Map map" === q{scope = [Scope True "module" "Data.Map"], names = ["map"]}
"a -> b package:foo" === q{scope = [Scope True "package" "foo"], sig = Just (typ "a -> b")}
"a -> b package:foo-bar" === q{scope = [Scope True "package" "foo-bar"], sig = Just (typ "a -> b")}
"Data.Map.map" === q{scope = [Scope True "module" "Data.Map"], names = ["map"]}
"[a]" === q{sig = Just (typ "[a]")}
"++" === q{names = ["++"]}
"(++)" === q{names = ["++"]}
":+:" === q{names = [":+:"]}
"bytestring-cvs +hackage" === q{scope=[Scope True "package" "hackage"], names=["bytestring-cvs"]}
| {-# LANGUAGE ViewPatterns, TupleSections, RecordWildCards, ScopedTypeVariables, PatternGuards #-}
module Action.Test(testMain) where
import Data.Monoid
import Query
import Action.CmdLine
+ import Language.Haskell.Exts
testMain :: CmdLine -> IO ()
testMain Test{} = do
testQuery
putStrLn ""
testQuery :: IO ()
testQuery = do
let a === b | parseQuery a == b = putChar '.'
| otherwise = error $ show ("testQuery",a,b)
+ let typ = fromParseResult . parseType
+ let q = mempty
"" === mempty
+ "map" === q{names = ["map"]}
+ "#" === q{names = ["#"]}
+ "c#" === q{names = ["c#"]}
+ "-" === q{names = ["-"]}
+ "/" === q{names = ["/"]}
+ "->" === q{names = ["->"]}
+ "foldl'" === q{names = ["foldl'"]}
+ "fold'l" === q{names = ["fold'l"]}
+ "Int#" === q{names = ["Int#"]}
+ "concat map" === q{names = ["concat","map"]}
+ "a -> b" === q{sig = Just (typ "a -> b")}
+ "(a b)" === q{sig = Just (typ "(a b)")}
+ "map :: a -> b" === q{names = ["map"], sig = Just (typ "a -> b")}
+ "+Data.Map map" === q{scope = [Scope True "module" "Data.Map"], names = ["map"]}
+ "a -> b package:foo" === q{scope = [Scope True "package" "foo"], sig = Just (typ "a -> b")}
+ "a -> b package:foo-bar" === q{scope = [Scope True "package" "foo-bar"], sig = Just (typ "a -> b")}
+ "Data.Map.map" === q{scope = [Scope True "module" "Data.Map"], names = ["map"]}
+ "[a]" === q{sig = Just (typ "[a]")}
+ "++" === q{names = ["++"]}
+ "(++)" === q{names = ["++"]}
+ ":+:" === q{names = [":+:"]}
+ "bytestring-cvs +hackage" === q{scope=[Scope True "package" "hackage"], names=["bytestring-cvs"]} | 25 | 1.25 | 25 | 0 |
308c17ae0cede2b6cd70daa3581e0c1685fec4c8 | shibboleth-rebuild.sh | shibboleth-rebuild.sh | set -e
if [ -x "$(command -v dnf)" ]; then
pkgmanager="dnf"
download_cmd="dnf download"
builddep_cmd="dnf builddep"
# For build dependencies: doxygen
dnf config-manager --set-enabled PowerTools
else
pkgmanager="yum"
download_cmd="yumdownloader"
builddep_cmd="yum-builddep"
fi
# Download specific Shibboleth version or just the latest version
if [ "$_SHIBBOLETH_VERSION" ]; then
$download_cmd --source "shibboleth-$_SHIBBOLETH_VERSION"
else
$download_cmd --source shibboleth
fi
# Install the SRPM's dependencies
sudo $builddep_cmd -y shibboleth*.src.rpm
# At time of writing (Sep 2020) there is no way of engaging conditional flags
# with dnf builddep (or yum-builddep) so the optional PreReq packages need to
# be manually installed Info is scarce on this topic but see
# https://github.com/ceph/ceph/pull/8016
sudo $pkgmanager install -y fcgi-devel
# Rebuild with FastCGI support
rpmbuild --rebuild shibboleth*.src.rpm --with fastcgi
# Remove original SRPM
rm shibboleth*.src.rpm -f
| set -e
# Handle different package manager changes
if [ -x "$(command -v dnf)" ]; then
pkgmanager="dnf"
download_cmd="dnf download"
builddep_cmd="dnf builddep"
# For build dependencies: doxygen
dnf config-manager --set-enabled PowerTools
else
pkgmanager="yum"
download_cmd="yumdownloader"
builddep_cmd="yum-builddep"
fi
# EL6 requires specific packages
os_version=$(rpm -qa --queryformat '%{VERSION}' '(redhat|sl|slf|centos|oraclelinux)-release(|-server|-workstation|-client|-computenode)')
case $os_version in
6*)
builddep_pkgs="httpd-devel"
;;
esac
# Download specific Shibboleth version or just the latest version
if [ "$_SHIBBOLETH_VERSION" ]; then
$download_cmd --source "shibboleth-$_SHIBBOLETH_VERSION"
else
$download_cmd --source shibboleth
fi
# Install the SRPM's dependencies
sudo $builddep_cmd -y shibboleth*.src.rpm
# At time of writing (Sep 2020) there is no way of engaging conditional flags
# with dnf builddep (or yum-builddep) so the optional PreReq packages need to
# be manually installed Info is scarce on this topic but see
# https://github.com/ceph/ceph/pull/8016
sudo $pkgmanager install -y \
fcgi-devel \
$builddep_pkgs
# Rebuild with FastCGI support
rpmbuild --rebuild shibboleth*.src.rpm --with fastcgi
# Remove original SRPM
rm shibboleth*.src.rpm -f
| Fix build on CentOS 6 | Fix build on CentOS 6
| Shell | mit | nginx-shib/shibboleth-fastcgi | shell | ## Code Before:
set -e
if [ -x "$(command -v dnf)" ]; then
pkgmanager="dnf"
download_cmd="dnf download"
builddep_cmd="dnf builddep"
# For build dependencies: doxygen
dnf config-manager --set-enabled PowerTools
else
pkgmanager="yum"
download_cmd="yumdownloader"
builddep_cmd="yum-builddep"
fi
# Download specific Shibboleth version or just the latest version
if [ "$_SHIBBOLETH_VERSION" ]; then
$download_cmd --source "shibboleth-$_SHIBBOLETH_VERSION"
else
$download_cmd --source shibboleth
fi
# Install the SRPM's dependencies
sudo $builddep_cmd -y shibboleth*.src.rpm
# At time of writing (Sep 2020) there is no way of engaging conditional flags
# with dnf builddep (or yum-builddep) so the optional PreReq packages need to
# be manually installed Info is scarce on this topic but see
# https://github.com/ceph/ceph/pull/8016
sudo $pkgmanager install -y fcgi-devel
# Rebuild with FastCGI support
rpmbuild --rebuild shibboleth*.src.rpm --with fastcgi
# Remove original SRPM
rm shibboleth*.src.rpm -f
## Instruction:
Fix build on CentOS 6
## Code After:
set -e
# Handle different package manager changes
if [ -x "$(command -v dnf)" ]; then
pkgmanager="dnf"
download_cmd="dnf download"
builddep_cmd="dnf builddep"
# For build dependencies: doxygen
dnf config-manager --set-enabled PowerTools
else
pkgmanager="yum"
download_cmd="yumdownloader"
builddep_cmd="yum-builddep"
fi
# EL6 requires specific packages
os_version=$(rpm -qa --queryformat '%{VERSION}' '(redhat|sl|slf|centos|oraclelinux)-release(|-server|-workstation|-client|-computenode)')
case $os_version in
6*)
builddep_pkgs="httpd-devel"
;;
esac
# Download specific Shibboleth version or just the latest version
if [ "$_SHIBBOLETH_VERSION" ]; then
$download_cmd --source "shibboleth-$_SHIBBOLETH_VERSION"
else
$download_cmd --source shibboleth
fi
# Install the SRPM's dependencies
sudo $builddep_cmd -y shibboleth*.src.rpm
# At time of writing (Sep 2020) there is no way of engaging conditional flags
# with dnf builddep (or yum-builddep) so the optional PreReq packages need to
# be manually installed Info is scarce on this topic but see
# https://github.com/ceph/ceph/pull/8016
sudo $pkgmanager install -y \
fcgi-devel \
$builddep_pkgs
# Rebuild with FastCGI support
rpmbuild --rebuild shibboleth*.src.rpm --with fastcgi
# Remove original SRPM
rm shibboleth*.src.rpm -f
| set -e
+ # Handle different package manager changes
if [ -x "$(command -v dnf)" ]; then
pkgmanager="dnf"
download_cmd="dnf download"
builddep_cmd="dnf builddep"
# For build dependencies: doxygen
dnf config-manager --set-enabled PowerTools
else
pkgmanager="yum"
download_cmd="yumdownloader"
builddep_cmd="yum-builddep"
fi
+
+ # EL6 requires specific packages
+ os_version=$(rpm -qa --queryformat '%{VERSION}' '(redhat|sl|slf|centos|oraclelinux)-release(|-server|-workstation|-client|-computenode)')
+ case $os_version in
+ 6*)
+ builddep_pkgs="httpd-devel"
+ ;;
+ esac
# Download specific Shibboleth version or just the latest version
if [ "$_SHIBBOLETH_VERSION" ]; then
$download_cmd --source "shibboleth-$_SHIBBOLETH_VERSION"
else
$download_cmd --source shibboleth
fi
# Install the SRPM's dependencies
sudo $builddep_cmd -y shibboleth*.src.rpm
# At time of writing (Sep 2020) there is no way of engaging conditional flags
# with dnf builddep (or yum-builddep) so the optional PreReq packages need to
# be manually installed Info is scarce on this topic but see
# https://github.com/ceph/ceph/pull/8016
- sudo $pkgmanager install -y fcgi-devel
? ^^^^^^^^^^
+ sudo $pkgmanager install -y \
? ^
+ fcgi-devel \
+ $builddep_pkgs
# Rebuild with FastCGI support
rpmbuild --rebuild shibboleth*.src.rpm --with fastcgi
# Remove original SRPM
rm shibboleth*.src.rpm -f | 13 | 0.361111 | 12 | 1 |
e7278521d8ee387acc5bc94c39f041c7e08c6cc6 | lab_members/views.py | lab_members/views.py | from django.views.generic import DetailView, ListView
from lab_members.models import Scientist
class ScientistListView(ListView):
model = Scientist
queryset = Scientist.objects.all()
class ScientistDetailView(DetailView):
model = Scientist
| from django.views.generic import DetailView, ListView
from lab_members.models import Scientist
class ScientistListView(ListView):
model = Scientist
def get_context_data(self, **kwargs):
context = super(ScientistListView, self).get_context_data(**kwargs)
context['scientist_list'] = Scientist.objects.filter(current=True)
context['alumni_list'] = Scientist.objects.filter(current=False)
return context
class ScientistDetailView(DetailView):
model = Scientist
| Return both scientist_list and alumni_list for ScientistListView | Return both scientist_list and alumni_list for ScientistListView
| Python | bsd-3-clause | mfcovington/django-lab-members,mfcovington/django-lab-members,mfcovington/django-lab-members | python | ## Code Before:
from django.views.generic import DetailView, ListView
from lab_members.models import Scientist
class ScientistListView(ListView):
model = Scientist
queryset = Scientist.objects.all()
class ScientistDetailView(DetailView):
model = Scientist
## Instruction:
Return both scientist_list and alumni_list for ScientistListView
## Code After:
from django.views.generic import DetailView, ListView
from lab_members.models import Scientist
class ScientistListView(ListView):
model = Scientist
def get_context_data(self, **kwargs):
context = super(ScientistListView, self).get_context_data(**kwargs)
context['scientist_list'] = Scientist.objects.filter(current=True)
context['alumni_list'] = Scientist.objects.filter(current=False)
return context
class ScientistDetailView(DetailView):
model = Scientist
| from django.views.generic import DetailView, ListView
from lab_members.models import Scientist
class ScientistListView(ListView):
model = Scientist
- queryset = Scientist.objects.all()
+
+ def get_context_data(self, **kwargs):
+ context = super(ScientistListView, self).get_context_data(**kwargs)
+ context['scientist_list'] = Scientist.objects.filter(current=True)
+ context['alumni_list'] = Scientist.objects.filter(current=False)
+ return context
class ScientistDetailView(DetailView):
model = Scientist | 7 | 0.777778 | 6 | 1 |
d03467971de5a3a89e7583fcbb485ff6454adbf0 | diesel/src/pg/mod.rs | diesel/src/pg/mod.rs | //! Provides types and functions related to working with PostgreSQL
//!
//! Much of this module is re-exported from database agnostic locations.
//! However, if you are writing code specifically to extend Diesel on
//! PostgreSQL, you may need to work with this module directly.
pub mod expression;
pub mod types;
#[doc(hidden)]
#[cfg(feature = "with-deprecated")]
#[deprecated(since = "2.0.0", note = "Use `diesel::upsert` instead")]
pub use crate::upsert;
mod backend;
mod connection;
mod metadata_lookup;
pub(crate) mod query_builder;
pub(crate) mod serialize;
mod transaction;
mod value;
pub use self::backend::{Pg, PgTypeMetadata};
pub use self::connection::PgConnection;
pub use self::metadata_lookup::PgMetadataLookup;
pub use self::query_builder::DistinctOnClause;
pub use self::query_builder::PgQueryBuilder;
pub use self::transaction::TransactionBuilder;
pub use self::value::PgValue;
/// Data structures for PG types which have no corresponding Rust type
///
/// Most of these types are used to implement `ToSql` and `FromSql` for higher
/// level types.
pub mod data_types {
#[doc(inline)]
pub use super::types::date_and_time::{PgDate, PgInterval, PgTime, PgTimestamp};
#[doc(inline)]
pub use super::types::floats::PgNumeric;
#[doc(inline)]
pub use super::types::money::PgMoney;
pub use super::types::money::PgMoney as Cents;
}
| //! Provides types and functions related to working with PostgreSQL
//!
//! Much of this module is re-exported from database agnostic locations.
//! However, if you are writing code specifically to extend Diesel on
//! PostgreSQL, you may need to work with this module directly.
pub mod expression;
pub mod types;
mod backend;
mod connection;
mod metadata_lookup;
pub(crate) mod query_builder;
pub(crate) mod serialize;
mod transaction;
mod value;
pub use self::backend::{Pg, PgTypeMetadata};
pub use self::connection::PgConnection;
pub use self::metadata_lookup::PgMetadataLookup;
pub use self::query_builder::DistinctOnClause;
pub use self::query_builder::PgQueryBuilder;
pub use self::transaction::TransactionBuilder;
pub use self::value::PgValue;
#[doc(hidden)]
#[cfg(feature = "with-deprecated")]
#[deprecated(since = "2.0.0", note = "Use `diesel::upsert` instead")]
pub use crate::upsert;
/// Data structures for PG types which have no corresponding Rust type
///
/// Most of these types are used to implement `ToSql` and `FromSql` for higher
/// level types.
pub mod data_types {
#[doc(inline)]
pub use super::types::date_and_time::{PgDate, PgInterval, PgTime, PgTimestamp};
#[doc(inline)]
pub use super::types::floats::PgNumeric;
#[doc(inline)]
pub use super::types::money::PgMoney;
pub use super::types::money::PgMoney as Cents;
}
| Move reexport to the other reexports | Move reexport to the other reexports
| Rust | apache-2.0 | diesel-rs/diesel,sgrif/diesel,diesel-rs/diesel,sgrif/diesel | rust | ## Code Before:
//! Provides types and functions related to working with PostgreSQL
//!
//! Much of this module is re-exported from database agnostic locations.
//! However, if you are writing code specifically to extend Diesel on
//! PostgreSQL, you may need to work with this module directly.
pub mod expression;
pub mod types;
#[doc(hidden)]
#[cfg(feature = "with-deprecated")]
#[deprecated(since = "2.0.0", note = "Use `diesel::upsert` instead")]
pub use crate::upsert;
mod backend;
mod connection;
mod metadata_lookup;
pub(crate) mod query_builder;
pub(crate) mod serialize;
mod transaction;
mod value;
pub use self::backend::{Pg, PgTypeMetadata};
pub use self::connection::PgConnection;
pub use self::metadata_lookup::PgMetadataLookup;
pub use self::query_builder::DistinctOnClause;
pub use self::query_builder::PgQueryBuilder;
pub use self::transaction::TransactionBuilder;
pub use self::value::PgValue;
/// Data structures for PG types which have no corresponding Rust type
///
/// Most of these types are used to implement `ToSql` and `FromSql` for higher
/// level types.
pub mod data_types {
#[doc(inline)]
pub use super::types::date_and_time::{PgDate, PgInterval, PgTime, PgTimestamp};
#[doc(inline)]
pub use super::types::floats::PgNumeric;
#[doc(inline)]
pub use super::types::money::PgMoney;
pub use super::types::money::PgMoney as Cents;
}
## Instruction:
Move reexport to the other reexports
## Code After:
//! Provides types and functions related to working with PostgreSQL
//!
//! Much of this module is re-exported from database agnostic locations.
//! However, if you are writing code specifically to extend Diesel on
//! PostgreSQL, you may need to work with this module directly.
pub mod expression;
pub mod types;
mod backend;
mod connection;
mod metadata_lookup;
pub(crate) mod query_builder;
pub(crate) mod serialize;
mod transaction;
mod value;
pub use self::backend::{Pg, PgTypeMetadata};
pub use self::connection::PgConnection;
pub use self::metadata_lookup::PgMetadataLookup;
pub use self::query_builder::DistinctOnClause;
pub use self::query_builder::PgQueryBuilder;
pub use self::transaction::TransactionBuilder;
pub use self::value::PgValue;
#[doc(hidden)]
#[cfg(feature = "with-deprecated")]
#[deprecated(since = "2.0.0", note = "Use `diesel::upsert` instead")]
pub use crate::upsert;
/// Data structures for PG types which have no corresponding Rust type
///
/// Most of these types are used to implement `ToSql` and `FromSql` for higher
/// level types.
pub mod data_types {
#[doc(inline)]
pub use super::types::date_and_time::{PgDate, PgInterval, PgTime, PgTimestamp};
#[doc(inline)]
pub use super::types::floats::PgNumeric;
#[doc(inline)]
pub use super::types::money::PgMoney;
pub use super::types::money::PgMoney as Cents;
}
| //! Provides types and functions related to working with PostgreSQL
//!
//! Much of this module is re-exported from database agnostic locations.
//! However, if you are writing code specifically to extend Diesel on
//! PostgreSQL, you may need to work with this module directly.
pub mod expression;
pub mod types;
-
- #[doc(hidden)]
- #[cfg(feature = "with-deprecated")]
- #[deprecated(since = "2.0.0", note = "Use `diesel::upsert` instead")]
- pub use crate::upsert;
mod backend;
mod connection;
mod metadata_lookup;
pub(crate) mod query_builder;
pub(crate) mod serialize;
mod transaction;
mod value;
pub use self::backend::{Pg, PgTypeMetadata};
pub use self::connection::PgConnection;
pub use self::metadata_lookup::PgMetadataLookup;
pub use self::query_builder::DistinctOnClause;
pub use self::query_builder::PgQueryBuilder;
pub use self::transaction::TransactionBuilder;
pub use self::value::PgValue;
+ #[doc(hidden)]
+ #[cfg(feature = "with-deprecated")]
+ #[deprecated(since = "2.0.0", note = "Use `diesel::upsert` instead")]
+ pub use crate::upsert;
/// Data structures for PG types which have no corresponding Rust type
///
/// Most of these types are used to implement `ToSql` and `FromSql` for higher
/// level types.
pub mod data_types {
#[doc(inline)]
pub use super::types::date_and_time::{PgDate, PgInterval, PgTime, PgTimestamp};
#[doc(inline)]
pub use super::types::floats::PgNumeric;
#[doc(inline)]
pub use super::types::money::PgMoney;
pub use super::types::money::PgMoney as Cents;
} | 9 | 0.209302 | 4 | 5 |
8f73d9087fb8503beb1f07ba3cfd2fcd368cb54d | spec/spec_helper.rb | spec/spec_helper.rb | ENV['RACK_ENV'] = 'test'
require 'bundler'
Bundler.setup(:default, :test)
root = File.expand_path("../../", __FILE__)
ENV.update(Pliny::Utils.parse_env("#{root}/.env")) if File.exists?("#{root}/.env") # Load default env…
ENV.update(Pliny::Utils.parse_env("#{root}/.env.test")) # and overwrite it.
require 'simplecov'
require 'rspec'
require 'fabrication'
require_relative "../lib/initializer"
# pull in test initializers
Pliny::Utils.require_glob("#{Config.root}/spec/support/**/*.rb")
RSpec.configure do |config|
config.include KOSapiClientConfigurator
config.order = 'random'
config.before(:suite) do
require 'database_cleaner'
DatabaseCleaner[:sequel, {:connection => DB}]
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
end
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.order = 'random'
end
| ENV['RACK_ENV'] = 'test'
require 'bundler'
require 'pliny/utils'
root = File.expand_path("../../", __FILE__)
ENV.update(Pliny::Utils.parse_env("#{root}/.env")) if File.exists?("#{root}/.env") # Load default env…
ENV.update(Pliny::Utils.parse_env("#{root}/.env.test")) # and overwrite it.
require 'simplecov'
require 'rspec'
require 'fabrication'
require_relative "../lib/initializer"
# pull in test initializers
Pliny::Utils.require_glob("#{Config.root}/spec/support/**/*.rb")
RSpec.configure do |config|
config.include KOSapiClientConfigurator
config.order = 'random'
config.before(:suite) do
require 'database_cleaner'
DatabaseCleaner[:sequel, {:connection => DB}]
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
end
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.order = 'random'
end
| Fix Pliny dependencies in spec helper | Fix Pliny dependencies in spec helper
| Ruby | mit | cvut/sirius,cvut/sirius | ruby | ## Code Before:
ENV['RACK_ENV'] = 'test'
require 'bundler'
Bundler.setup(:default, :test)
root = File.expand_path("../../", __FILE__)
ENV.update(Pliny::Utils.parse_env("#{root}/.env")) if File.exists?("#{root}/.env") # Load default env…
ENV.update(Pliny::Utils.parse_env("#{root}/.env.test")) # and overwrite it.
require 'simplecov'
require 'rspec'
require 'fabrication'
require_relative "../lib/initializer"
# pull in test initializers
Pliny::Utils.require_glob("#{Config.root}/spec/support/**/*.rb")
RSpec.configure do |config|
config.include KOSapiClientConfigurator
config.order = 'random'
config.before(:suite) do
require 'database_cleaner'
DatabaseCleaner[:sequel, {:connection => DB}]
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
end
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.order = 'random'
end
## Instruction:
Fix Pliny dependencies in spec helper
## Code After:
ENV['RACK_ENV'] = 'test'
require 'bundler'
require 'pliny/utils'
root = File.expand_path("../../", __FILE__)
ENV.update(Pliny::Utils.parse_env("#{root}/.env")) if File.exists?("#{root}/.env") # Load default env…
ENV.update(Pliny::Utils.parse_env("#{root}/.env.test")) # and overwrite it.
require 'simplecov'
require 'rspec'
require 'fabrication'
require_relative "../lib/initializer"
# pull in test initializers
Pliny::Utils.require_glob("#{Config.root}/spec/support/**/*.rb")
RSpec.configure do |config|
config.include KOSapiClientConfigurator
config.order = 'random'
config.before(:suite) do
require 'database_cleaner'
DatabaseCleaner[:sequel, {:connection => DB}]
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
end
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.order = 'random'
end
| ENV['RACK_ENV'] = 'test'
require 'bundler'
- Bundler.setup(:default, :test)
+ require 'pliny/utils'
root = File.expand_path("../../", __FILE__)
ENV.update(Pliny::Utils.parse_env("#{root}/.env")) if File.exists?("#{root}/.env") # Load default env…
ENV.update(Pliny::Utils.parse_env("#{root}/.env.test")) # and overwrite it.
require 'simplecov'
require 'rspec'
require 'fabrication'
require_relative "../lib/initializer"
# pull in test initializers
Pliny::Utils.require_glob("#{Config.root}/spec/support/**/*.rb")
RSpec.configure do |config|
config.include KOSapiClientConfigurator
config.order = 'random'
config.before(:suite) do
require 'database_cleaner'
DatabaseCleaner[:sequel, {:connection => DB}]
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
end
config.around(:each) do |example|
DatabaseCleaner.cleaning do
example.run
end
end
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.order = 'random'
end
| 2 | 0.046512 | 1 | 1 |
3db0a1efbd280bf7bdc3f4600fdee87719708ed8 | src/components/UISrefActive.tsx | src/components/UISrefActive.tsx | import {Component, PropTypes, cloneElement} from 'react';
import * as classNames from 'classnames';
import UIRouterReact, { UISref } from '../index';
import {find} from '../utils';
export class UISrefActive extends Component<any,any> {
uiSref;
static propTypes = {
class: PropTypes.string.isRequired,
children: PropTypes.element.isRequired
}
constructor (props) {
super(props);
}
componentWillMount () {
const child = this.props.children;
this.uiSref = find(child, component => {
return typeof component.type === 'function' && component.type.name === 'UISref';
});
}
isActive = () => {
let currentState = UIRouterReact.instance.globals.current.name;
return this.uiSref && this.uiSref.props.to === currentState;
}
render () {
let isActive = this.isActive();
return (
!isActive
? this.props.children
: cloneElement(this.props.children, Object.assign({}, this.props.children.props, {
className: classNames(this.props.children.props.className, this.props.class)
}))
);
}
} | import {Component, PropTypes, cloneElement, ValidationMap} from 'react';
import * as classNames from 'classnames';
import UIRouterReact, { UISref } from '../index';
import {UIViewAddress} from "./UIView";
import {find} from '../utils';
export interface IProps {
class?: string;
children?: any;
}
export class UISrefActive extends Component<IProps,any> {
uiSref;
static propTypes = {
class: PropTypes.string.isRequired,
children: PropTypes.element.isRequired
}
static contextTypes: ValidationMap<any> = {
parentUIViewAddress: PropTypes.object
}
componentWillMount () {
const child = this.props.children;
this.uiSref = find(child, component => {
return typeof component.type === 'function' && component.type.name === 'UISref';
});
}
isActive = () => {
let parentUIViewAddress: UIViewAddress = this.context['parentUIViewAddress'];
let {to, params} = this.uiSref.props, {stateService} = UIRouterReact.instance;
let state = stateService.get(to, parentUIViewAddress.context) || { name: to };
return this.uiSref && (stateService.is(state.name, params) || stateService.includes(state.name, params));
}
render () {
let isActive = this.isActive();
return (
!isActive
? this.props.children
: cloneElement(this.props.children, Object.assign({}, this.props.children.props, {
className: classNames(this.props.children.props.className, this.props.class)
}))
);
}
} | Support active state checking relative to parent UIView | fix(UISrefAcive): Support active state checking relative to parent UIView
chore(UISrefActive): add Props typings (TS)
| TypeScript | mit | ui-router/react,ui-router/react | typescript | ## Code Before:
import {Component, PropTypes, cloneElement} from 'react';
import * as classNames from 'classnames';
import UIRouterReact, { UISref } from '../index';
import {find} from '../utils';
export class UISrefActive extends Component<any,any> {
uiSref;
static propTypes = {
class: PropTypes.string.isRequired,
children: PropTypes.element.isRequired
}
constructor (props) {
super(props);
}
componentWillMount () {
const child = this.props.children;
this.uiSref = find(child, component => {
return typeof component.type === 'function' && component.type.name === 'UISref';
});
}
isActive = () => {
let currentState = UIRouterReact.instance.globals.current.name;
return this.uiSref && this.uiSref.props.to === currentState;
}
render () {
let isActive = this.isActive();
return (
!isActive
? this.props.children
: cloneElement(this.props.children, Object.assign({}, this.props.children.props, {
className: classNames(this.props.children.props.className, this.props.class)
}))
);
}
}
## Instruction:
fix(UISrefAcive): Support active state checking relative to parent UIView
chore(UISrefActive): add Props typings (TS)
## Code After:
import {Component, PropTypes, cloneElement, ValidationMap} from 'react';
import * as classNames from 'classnames';
import UIRouterReact, { UISref } from '../index';
import {UIViewAddress} from "./UIView";
import {find} from '../utils';
export interface IProps {
class?: string;
children?: any;
}
export class UISrefActive extends Component<IProps,any> {
uiSref;
static propTypes = {
class: PropTypes.string.isRequired,
children: PropTypes.element.isRequired
}
static contextTypes: ValidationMap<any> = {
parentUIViewAddress: PropTypes.object
}
componentWillMount () {
const child = this.props.children;
this.uiSref = find(child, component => {
return typeof component.type === 'function' && component.type.name === 'UISref';
});
}
isActive = () => {
let parentUIViewAddress: UIViewAddress = this.context['parentUIViewAddress'];
let {to, params} = this.uiSref.props, {stateService} = UIRouterReact.instance;
let state = stateService.get(to, parentUIViewAddress.context) || { name: to };
return this.uiSref && (stateService.is(state.name, params) || stateService.includes(state.name, params));
}
render () {
let isActive = this.isActive();
return (
!isActive
? this.props.children
: cloneElement(this.props.children, Object.assign({}, this.props.children.props, {
className: classNames(this.props.children.props.className, this.props.class)
}))
);
}
} | - import {Component, PropTypes, cloneElement} from 'react';
+ import {Component, PropTypes, cloneElement, ValidationMap} from 'react';
? +++++++++++++++
import * as classNames from 'classnames';
import UIRouterReact, { UISref } from '../index';
+ import {UIViewAddress} from "./UIView";
import {find} from '../utils';
+ export interface IProps {
+ class?: string;
+ children?: any;
+ }
+
- export class UISrefActive extends Component<any,any> {
? ^^^
+ export class UISrefActive extends Component<IProps,any> {
? ^^^^^^
uiSref;
static propTypes = {
class: PropTypes.string.isRequired,
children: PropTypes.element.isRequired
}
- constructor (props) {
- super(props);
+ static contextTypes: ValidationMap<any> = {
+ parentUIViewAddress: PropTypes.object
}
componentWillMount () {
const child = this.props.children;
this.uiSref = find(child, component => {
return typeof component.type === 'function' && component.type.name === 'UISref';
});
}
isActive = () => {
- let currentState = UIRouterReact.instance.globals.current.name;
- return this.uiSref && this.uiSref.props.to === currentState;
+ let parentUIViewAddress: UIViewAddress = this.context['parentUIViewAddress'];
+ let {to, params} = this.uiSref.props, {stateService} = UIRouterReact.instance;
+ let state = stateService.get(to, parentUIViewAddress.context) || { name: to };
+ return this.uiSref && (stateService.is(state.name, params) || stateService.includes(state.name, params));
}
render () {
let isActive = this.isActive();
return (
!isActive
? this.props.children
: cloneElement(this.props.children, Object.assign({}, this.props.children.props, {
className: classNames(this.props.children.props.className, this.props.class)
}))
);
}
} | 20 | 0.5 | 14 | 6 |
31e8087fddd3b2565f1c623cf0e752d54c307b5b | README.md | README.md |
A way to simply tweet out a quote (with an image) to your blog post, AND create
a URL to tweet out the same.
## example:
## Article URL
http://blog.texmexconsulting.com/how-much-money-can-you-really-make-as-a-freelancer/
### ScreenShot
![assets/twitter-image-quote.png]
### Example URL
https://twitter.com/intent/tweet?text=Until+you+hear+%22Your+rates+are+too+high%22+on+a+frequent+basis%2C+your+rates+are+too+low+http://blog.texmexconsulting.com/how-much-money-can-you-really-make-as-a-freelancer/+http://pic.twitter.com/Dg4dRfLKfT
## How to Use
1. Clone locally
2. `cp .env.sample .env`
3. Edit the .env with values from Twitter Application (both the application's
secrets and your oauth secrets). Recommended way to get these: the `t` gem
authorize process. Follow the instructions, and find the values in ~/.trc
4. `ruby twitter-image-quote` and answer the questions
You'll need:
* The quote (100 characters)
* The article URL
* The image file path
## Copyright
|
A way to simply tweet out a quote (with an image) to your blog post, AND create
a URL to tweet out the same.
## example:
## Article URL
http://blog.texmexconsulting.com/how-much-money-can-you-really-make-as-a-freelancer/
### ScreenShot

### Example URL
https://twitter.com/intent/tweet?text=Until+you+hear+%22Your+rates+are+too+high%22+on+a+frequent+basis%2C+your+rates+are+too+low+http://blog.texmexconsulting.com/how-much-money-can-you-really-make-as-a-freelancer/+http://pic.twitter.com/Dg4dRfLKfT
## How to Use
1. Clone locally
2. `cp .env.sample .env`
3. Edit the .env with values from Twitter Application (both the application's
secrets and your oauth secrets). Recommended way to get these: the `t` gem
authorize process. Follow the instructions, and find the values in ~/.trc
4. `ruby twitter-image-quote` and answer the questions
You'll need:
* The quote (100 characters)
* The article URL
* The image file path
## Copyright
| Use images in markdown without fail | Use images in markdown without fail
| Markdown | mit | jwo/twitter-image-quote | markdown | ## Code Before:
A way to simply tweet out a quote (with an image) to your blog post, AND create
a URL to tweet out the same.
## example:
## Article URL
http://blog.texmexconsulting.com/how-much-money-can-you-really-make-as-a-freelancer/
### ScreenShot
![assets/twitter-image-quote.png]
### Example URL
https://twitter.com/intent/tweet?text=Until+you+hear+%22Your+rates+are+too+high%22+on+a+frequent+basis%2C+your+rates+are+too+low+http://blog.texmexconsulting.com/how-much-money-can-you-really-make-as-a-freelancer/+http://pic.twitter.com/Dg4dRfLKfT
## How to Use
1. Clone locally
2. `cp .env.sample .env`
3. Edit the .env with values from Twitter Application (both the application's
secrets and your oauth secrets). Recommended way to get these: the `t` gem
authorize process. Follow the instructions, and find the values in ~/.trc
4. `ruby twitter-image-quote` and answer the questions
You'll need:
* The quote (100 characters)
* The article URL
* The image file path
## Copyright
## Instruction:
Use images in markdown without fail
## Code After:
A way to simply tweet out a quote (with an image) to your blog post, AND create
a URL to tweet out the same.
## example:
## Article URL
http://blog.texmexconsulting.com/how-much-money-can-you-really-make-as-a-freelancer/
### ScreenShot

### Example URL
https://twitter.com/intent/tweet?text=Until+you+hear+%22Your+rates+are+too+high%22+on+a+frequent+basis%2C+your+rates+are+too+low+http://blog.texmexconsulting.com/how-much-money-can-you-really-make-as-a-freelancer/+http://pic.twitter.com/Dg4dRfLKfT
## How to Use
1. Clone locally
2. `cp .env.sample .env`
3. Edit the .env with values from Twitter Application (both the application's
secrets and your oauth secrets). Recommended way to get these: the `t` gem
authorize process. Follow the instructions, and find the values in ~/.trc
4. `ruby twitter-image-quote` and answer the questions
You'll need:
* The quote (100 characters)
* The article URL
* The image file path
## Copyright
|
A way to simply tweet out a quote (with an image) to your blog post, AND create
a URL to tweet out the same.
## example:
## Article URL
http://blog.texmexconsulting.com/how-much-money-can-you-really-make-as-a-freelancer/
### ScreenShot
- ![assets/twitter-image-quote.png]
? ^
+ 
? +++++++++++++ ^
### Example URL
https://twitter.com/intent/tweet?text=Until+you+hear+%22Your+rates+are+too+high%22+on+a+frequent+basis%2C+your+rates+are+too+low+http://blog.texmexconsulting.com/how-much-money-can-you-really-make-as-a-freelancer/+http://pic.twitter.com/Dg4dRfLKfT
## How to Use
1. Clone locally
2. `cp .env.sample .env`
3. Edit the .env with values from Twitter Application (both the application's
secrets and your oauth secrets). Recommended way to get these: the `t` gem
authorize process. Follow the instructions, and find the values in ~/.trc
4. `ruby twitter-image-quote` and answer the questions
You'll need:
* The quote (100 characters)
* The article URL
* The image file path
## Copyright
| 2 | 0.058824 | 1 | 1 |
491ce4e51d666fc068e4bed14ab410b90e5b1ea8 | extraction/utils.py | extraction/utils.py | import subprocess32 as subprocess
import threading
import signal
def external_process(process_args, input_data='', timeout=None):
'''
Pipes input_data via stdin to the process specified by process_args and returns the results
Arguments:
process_args -- passed directly to subprocess.Popen(), see there for more details
input_data -- the data to pipe in via STDIN (optional)
timeout -- number of seconds to time out the process after (optional)
IF the process timesout, a subprocess32.TimeoutExpired exception will be raised
Returns:
(exit_status, stdout, stderr) -- a tuple of the exit status code and strings containing stdout and stderr data
Examples:
>>> external_process(['grep', 'Data'], input_data="Some String\nWith Data")
(0, 'With Data\n', '')
'''
process = subprocess.Popen(process_args,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
(stdout, stderr) = process.communicate(input_data, timeout)
except subprocess.TimeoutExpired as e:
# cleanup process
# see https://docs.python.org/3.3/library/subprocess.html?highlight=subprocess#subprocess.Popen.communicate
process.kill()
process.communicate()
raise e
exit_status = process.returncode
return (exit_status, stdout, stderr)
| import subprocess32 as subprocess
import threading
import signal
import tempfile
import os
def external_process(process_args, input_data='', timeout=None):
'''
Pipes input_data via stdin to the process specified by process_args and returns the results
Arguments:
process_args -- passed directly to subprocess.Popen(), see there for more details
input_data -- the data to pipe in via STDIN (optional)
timeout -- number of seconds to time out the process after (optional)
IF the process timesout, a subprocess32.TimeoutExpired exception will be raised
Returns:
(exit_status, stdout, stderr) -- a tuple of the exit status code and strings containing stdout and stderr data
Examples:
>>> external_process(['grep', 'Data'], input_data="Some String\nWith Data")
(0, 'With Data\n', '')
'''
process = subprocess.Popen(process_args,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
(stdout, stderr) = process.communicate(input_data, timeout)
except subprocess.TimeoutExpired as e:
# cleanup process
# see https://docs.python.org/3.3/library/subprocess.html?highlight=subprocess#subprocess.Popen.communicate
process.kill()
process.communicate()
raise e
exit_status = process.returncode
return (exit_status, stdout, stderr)
def temp_file(data, suffix=''):
handle, file_path = tempfile.mkstemp(suffix=suffix)
f = os.fdopen(handle, 'w')
f.write(data)
f.close()
return file_path
| Add method to create tempfile with content easily | Add method to create tempfile with content easily
| Python | apache-2.0 | SeerLabs/extractor-framework,Tiger66639/extractor-framework | python | ## Code Before:
import subprocess32 as subprocess
import threading
import signal
def external_process(process_args, input_data='', timeout=None):
'''
Pipes input_data via stdin to the process specified by process_args and returns the results
Arguments:
process_args -- passed directly to subprocess.Popen(), see there for more details
input_data -- the data to pipe in via STDIN (optional)
timeout -- number of seconds to time out the process after (optional)
IF the process timesout, a subprocess32.TimeoutExpired exception will be raised
Returns:
(exit_status, stdout, stderr) -- a tuple of the exit status code and strings containing stdout and stderr data
Examples:
>>> external_process(['grep', 'Data'], input_data="Some String\nWith Data")
(0, 'With Data\n', '')
'''
process = subprocess.Popen(process_args,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
(stdout, stderr) = process.communicate(input_data, timeout)
except subprocess.TimeoutExpired as e:
# cleanup process
# see https://docs.python.org/3.3/library/subprocess.html?highlight=subprocess#subprocess.Popen.communicate
process.kill()
process.communicate()
raise e
exit_status = process.returncode
return (exit_status, stdout, stderr)
## Instruction:
Add method to create tempfile with content easily
## Code After:
import subprocess32 as subprocess
import threading
import signal
import tempfile
import os
def external_process(process_args, input_data='', timeout=None):
'''
Pipes input_data via stdin to the process specified by process_args and returns the results
Arguments:
process_args -- passed directly to subprocess.Popen(), see there for more details
input_data -- the data to pipe in via STDIN (optional)
timeout -- number of seconds to time out the process after (optional)
IF the process timesout, a subprocess32.TimeoutExpired exception will be raised
Returns:
(exit_status, stdout, stderr) -- a tuple of the exit status code and strings containing stdout and stderr data
Examples:
>>> external_process(['grep', 'Data'], input_data="Some String\nWith Data")
(0, 'With Data\n', '')
'''
process = subprocess.Popen(process_args,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
(stdout, stderr) = process.communicate(input_data, timeout)
except subprocess.TimeoutExpired as e:
# cleanup process
# see https://docs.python.org/3.3/library/subprocess.html?highlight=subprocess#subprocess.Popen.communicate
process.kill()
process.communicate()
raise e
exit_status = process.returncode
return (exit_status, stdout, stderr)
def temp_file(data, suffix=''):
handle, file_path = tempfile.mkstemp(suffix=suffix)
f = os.fdopen(handle, 'w')
f.write(data)
f.close()
return file_path
| import subprocess32 as subprocess
import threading
import signal
+ import tempfile
+ import os
def external_process(process_args, input_data='', timeout=None):
'''
Pipes input_data via stdin to the process specified by process_args and returns the results
Arguments:
process_args -- passed directly to subprocess.Popen(), see there for more details
input_data -- the data to pipe in via STDIN (optional)
timeout -- number of seconds to time out the process after (optional)
IF the process timesout, a subprocess32.TimeoutExpired exception will be raised
Returns:
(exit_status, stdout, stderr) -- a tuple of the exit status code and strings containing stdout and stderr data
Examples:
>>> external_process(['grep', 'Data'], input_data="Some String\nWith Data")
(0, 'With Data\n', '')
'''
process = subprocess.Popen(process_args,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
(stdout, stderr) = process.communicate(input_data, timeout)
except subprocess.TimeoutExpired as e:
# cleanup process
# see https://docs.python.org/3.3/library/subprocess.html?highlight=subprocess#subprocess.Popen.communicate
process.kill()
process.communicate()
raise e
exit_status = process.returncode
return (exit_status, stdout, stderr)
+
+ def temp_file(data, suffix=''):
+ handle, file_path = tempfile.mkstemp(suffix=suffix)
+ f = os.fdopen(handle, 'w')
+ f.write(data)
+ f.close()
+ return file_path
+
+
+ | 12 | 0.324324 | 12 | 0 |
73d444c234ddb734ac14b688f6542750ea09de78 | api/init/graphqlapi/routes.py | api/init/graphqlapi/routes.py | from graphqlapi.proxy import proxy_request
from graphqlapi.interceptor import RequestException
from flask_restplus import Resource, fields, Namespace, Api
from docker.errors import APIError
from flask import request, jsonify, make_response
def register_graphql(namespace: Namespace, api: Api):
"""Method used to register the GraphQL namespace and endpoint."""
# Create expected headers and payload
headers = api.parser()
payload = api.model('Payload', {'query': fields.String(
required=True,
description='GraphQL query or mutation',
example='{allIndicatorTypes{nodes{id,name}}}')})
@namespace.route('/graphql', endpoint='with-parser')
@namespace.doc()
class GraphQL(Resource):
@namespace.expect(headers, payload, validate=True)
def post(self):
"""
Execute GraphQL queries and mutations
Use this endpoint to send http request to the GraphQL API.
"""
payload = request.json
try:
status, response = proxy_request(payload)
return make_response(jsonify(response), status)
except RequestException as ex:
return ex.to_response()
except APIError as apiError:
return make_response(jsonify({'message': apiError.explanation}), apiError.status_code)
| from docker.errors import APIError
from flask import request, jsonify, make_response
from flask_restplus import Resource, fields, Namespace, Api
from graphqlapi.exceptions import RequestException
from graphqlapi.proxy import proxy_request
def register_graphql(namespace: Namespace, api: Api):
"""Method used to register the GraphQL namespace and endpoint."""
# Create expected headers and payload
headers = api.parser()
payload = api.model('Payload', {'query': fields.String(
required=True,
description='GraphQL query or mutation',
example='{allIndicatorTypes{nodes{id,name}}}')})
@namespace.route('/graphql', endpoint='with-parser')
@namespace.doc()
class GraphQL(Resource):
@namespace.expect(headers, payload, validate=True)
def post(self):
"""
Execute GraphQL queries and mutations
Use this endpoint to send http request to the GraphQL API.
"""
payload = request.json
try:
status, response = proxy_request(payload)
return make_response(jsonify(response), status)
except RequestException as ex:
return ex.to_response()
except APIError as apiError:
return make_response(jsonify({'message': apiError.explanation}), apiError.status_code)
| Reorder imports in alphabetical order | Reorder imports in alphabetical order
| Python | apache-2.0 | alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality | python | ## Code Before:
from graphqlapi.proxy import proxy_request
from graphqlapi.interceptor import RequestException
from flask_restplus import Resource, fields, Namespace, Api
from docker.errors import APIError
from flask import request, jsonify, make_response
def register_graphql(namespace: Namespace, api: Api):
"""Method used to register the GraphQL namespace and endpoint."""
# Create expected headers and payload
headers = api.parser()
payload = api.model('Payload', {'query': fields.String(
required=True,
description='GraphQL query or mutation',
example='{allIndicatorTypes{nodes{id,name}}}')})
@namespace.route('/graphql', endpoint='with-parser')
@namespace.doc()
class GraphQL(Resource):
@namespace.expect(headers, payload, validate=True)
def post(self):
"""
Execute GraphQL queries and mutations
Use this endpoint to send http request to the GraphQL API.
"""
payload = request.json
try:
status, response = proxy_request(payload)
return make_response(jsonify(response), status)
except RequestException as ex:
return ex.to_response()
except APIError as apiError:
return make_response(jsonify({'message': apiError.explanation}), apiError.status_code)
## Instruction:
Reorder imports in alphabetical order
## Code After:
from docker.errors import APIError
from flask import request, jsonify, make_response
from flask_restplus import Resource, fields, Namespace, Api
from graphqlapi.exceptions import RequestException
from graphqlapi.proxy import proxy_request
def register_graphql(namespace: Namespace, api: Api):
"""Method used to register the GraphQL namespace and endpoint."""
# Create expected headers and payload
headers = api.parser()
payload = api.model('Payload', {'query': fields.String(
required=True,
description='GraphQL query or mutation',
example='{allIndicatorTypes{nodes{id,name}}}')})
@namespace.route('/graphql', endpoint='with-parser')
@namespace.doc()
class GraphQL(Resource):
@namespace.expect(headers, payload, validate=True)
def post(self):
"""
Execute GraphQL queries and mutations
Use this endpoint to send http request to the GraphQL API.
"""
payload = request.json
try:
status, response = proxy_request(payload)
return make_response(jsonify(response), status)
except RequestException as ex:
return ex.to_response()
except APIError as apiError:
return make_response(jsonify({'message': apiError.explanation}), apiError.status_code)
| - from graphqlapi.proxy import proxy_request
- from graphqlapi.interceptor import RequestException
- from flask_restplus import Resource, fields, Namespace, Api
from docker.errors import APIError
from flask import request, jsonify, make_response
+ from flask_restplus import Resource, fields, Namespace, Api
+ from graphqlapi.exceptions import RequestException
+ from graphqlapi.proxy import proxy_request
def register_graphql(namespace: Namespace, api: Api):
"""Method used to register the GraphQL namespace and endpoint."""
# Create expected headers and payload
headers = api.parser()
payload = api.model('Payload', {'query': fields.String(
required=True,
description='GraphQL query or mutation',
example='{allIndicatorTypes{nodes{id,name}}}')})
@namespace.route('/graphql', endpoint='with-parser')
@namespace.doc()
class GraphQL(Resource):
@namespace.expect(headers, payload, validate=True)
def post(self):
"""
Execute GraphQL queries and mutations
Use this endpoint to send http request to the GraphQL API.
"""
payload = request.json
try:
status, response = proxy_request(payload)
return make_response(jsonify(response), status)
except RequestException as ex:
return ex.to_response()
except APIError as apiError:
return make_response(jsonify({'message': apiError.explanation}), apiError.status_code) | 6 | 0.176471 | 3 | 3 |
5c03fff8cd38b6ea47fea0bdc1e7d974b9bbdcc8 | frontend/views/welcome-2.html | frontend/views/welcome-2.html | <div class="welcome-tour">
<div class="welcome-box material-box">
<ul class="step-bar">
<li class="done">
<span>Welcome</span>
</li>
<li class="active">
<span>Password</span>
</li>
<li>
<span>SSH Public Key</span>
</li>
<li>
<span>Internet Access</span>
</li>
</ul>
<p>
Choose a password that allows access to the administration interface. This will also be your SSH root password. Make sure you don’t forget it. <strong>There's no easy way to reset it.</strong>
</p>
<form ng-submit="setPassword()">
<input type="password" placeholder="Set a password" class="full-width" autofocus ng-model="password" ng-disabled="loading">
<input type="password" placeholder="Repeat password" class="full-width" ng-model="passwordConfirmation" ng-disabled="loading">
<button class="btn cta" type="submit">Next Step</button>
</form>
</div>
</div> | <div class="welcome-tour">
<div class="welcome-box material-box">
<ul class="step-bar">
<li class="done">
<span>Welcome</span>
</li>
<li class="active">
<span>Password</span>
</li>
<li>
<span>SSH Public Key</span>
</li>
<li>
<span>Internet Access</span>
</li>
</ul>
<p>
Choose a password that allows access to the administration interface. Make sure you don’t forget it. <strong>There's no easy way to reset it.</strong>
</p>
<form ng-submit="setPassword()">
<input type="password" placeholder="Set a password" class="full-width" autofocus ng-model="password" ng-disabled="loading">
<input type="password" placeholder="Repeat password" class="full-width" ng-model="passwordConfirmation" ng-disabled="loading">
<button class="btn cta" type="submit">Next Step</button>
</form>
</div>
</div> | Fix another misleading SSH password hint | Fix another misleading SSH password hint
| HTML | apache-2.0 | DarkSwoop/platform-frontend,experimental-platform/platform-frontend,experimental-platform/platform-frontend,DarkSwoop/platform-frontend,DarkSwoop/platform-frontend,experimental-platform/platform-frontend | html | ## Code Before:
<div class="welcome-tour">
<div class="welcome-box material-box">
<ul class="step-bar">
<li class="done">
<span>Welcome</span>
</li>
<li class="active">
<span>Password</span>
</li>
<li>
<span>SSH Public Key</span>
</li>
<li>
<span>Internet Access</span>
</li>
</ul>
<p>
Choose a password that allows access to the administration interface. This will also be your SSH root password. Make sure you don’t forget it. <strong>There's no easy way to reset it.</strong>
</p>
<form ng-submit="setPassword()">
<input type="password" placeholder="Set a password" class="full-width" autofocus ng-model="password" ng-disabled="loading">
<input type="password" placeholder="Repeat password" class="full-width" ng-model="passwordConfirmation" ng-disabled="loading">
<button class="btn cta" type="submit">Next Step</button>
</form>
</div>
</div>
## Instruction:
Fix another misleading SSH password hint
## Code After:
<div class="welcome-tour">
<div class="welcome-box material-box">
<ul class="step-bar">
<li class="done">
<span>Welcome</span>
</li>
<li class="active">
<span>Password</span>
</li>
<li>
<span>SSH Public Key</span>
</li>
<li>
<span>Internet Access</span>
</li>
</ul>
<p>
Choose a password that allows access to the administration interface. Make sure you don’t forget it. <strong>There's no easy way to reset it.</strong>
</p>
<form ng-submit="setPassword()">
<input type="password" placeholder="Set a password" class="full-width" autofocus ng-model="password" ng-disabled="loading">
<input type="password" placeholder="Repeat password" class="full-width" ng-model="passwordConfirmation" ng-disabled="loading">
<button class="btn cta" type="submit">Next Step</button>
</form>
</div>
</div> | <div class="welcome-tour">
<div class="welcome-box material-box">
<ul class="step-bar">
<li class="done">
<span>Welcome</span>
</li>
<li class="active">
<span>Password</span>
</li>
<li>
<span>SSH Public Key</span>
</li>
<li>
<span>Internet Access</span>
</li>
</ul>
<p>
- Choose a password that allows access to the administration interface. This will also be your SSH root password. Make sure you don’t forget it. <strong>There's no easy way to reset it.</strong>
? ------------------------------------------
+ Choose a password that allows access to the administration interface. Make sure you don’t forget it. <strong>There's no easy way to reset it.</strong>
</p>
<form ng-submit="setPassword()">
<input type="password" placeholder="Set a password" class="full-width" autofocus ng-model="password" ng-disabled="loading">
<input type="password" placeholder="Repeat password" class="full-width" ng-model="passwordConfirmation" ng-disabled="loading">
<button class="btn cta" type="submit">Next Step</button>
</form>
</div>
</div> | 2 | 0.071429 | 1 | 1 |
6dab43543e1b6a1e1e8119db9b38cc685dd81f82 | ckanext/qa/controllers/base.py | ckanext/qa/controllers/base.py | from ckan.lib.base import BaseController
from pylons import config
class QAController(BaseController):
def __init__(self, *args, **kwargs):
super(QAController, self).__init(*args, **kwargs) | from ckan.lib.base import BaseController
from pylons import config
class QAController(BaseController):
pass
| Fix typo in constructor. Seems unnecessary anyway. | Fix typo in constructor. Seems unnecessary anyway.
| Python | mit | ckan/ckanext-qa,ckan/ckanext-qa,ckan/ckanext-qa | python | ## Code Before:
from ckan.lib.base import BaseController
from pylons import config
class QAController(BaseController):
def __init__(self, *args, **kwargs):
super(QAController, self).__init(*args, **kwargs)
## Instruction:
Fix typo in constructor. Seems unnecessary anyway.
## Code After:
from ckan.lib.base import BaseController
from pylons import config
class QAController(BaseController):
pass
| from ckan.lib.base import BaseController
from pylons import config
class QAController(BaseController):
+ pass
-
- def __init__(self, *args, **kwargs):
- super(QAController, self).__init(*args, **kwargs) | 4 | 0.571429 | 1 | 3 |
abd65032e6f91eb60459366154543ac6f6c80061 | classes/cli.php | classes/cli.php | <?php
namespace mageekguy\atoum;
use
mageekguy\atoum
;
class cli
{
private static $isTerminal = null;
public function __construct(atoum\adapter $adapter = null)
{
if ($adapter === null)
{
$adapter = new atoum\adapter();
}
if (self::$isTerminal === null)
{
self::$isTerminal = ($adapter->defined('STDOUT') === true && $adapter->function_exists('posix_isatty') === true && $adapter->posix_isatty($adapter->constant('STDOUT')) === true);
}
}
public function setAdapter(atoum\adapter $adapter)
{
$this->adapter = $adapter;
return $this;
}
public function getAdapter()
{
return $this->adapter;
}
public function isTerminal()
{
return self::$isTerminal;
}
public static function forceTerminal()
{
self::$isTerminal = true;
}
}
?>
| <?php
namespace mageekguy\atoum;
use
mageekguy\atoum
;
class cli
{
private static $isTerminal = null;
public function __construct(atoum\adapter $adapter = null)
{
if ($adapter === null)
{
$adapter = new atoum\adapter();
}
if (self::$isTerminal === null)
{
self::$isTerminal = $adapter->defined('PHP_WINDOWS_VERSION_BUILD') ? (Boolean) $adapter->getenv('ANSICON') : ($adapter->defined('STDOUT') === true && $adapter->function_exists('posix_isatty') === true && $adapter->posix_isatty($adapter->constant('STDOUT')) === true);
}
}
public function setAdapter(atoum\adapter $adapter)
{
$this->adapter = $adapter;
return $this;
}
public function getAdapter()
{
return $this->adapter;
}
public function isTerminal()
{
return self::$isTerminal;
}
public static function forceTerminal()
{
self::$isTerminal = true;
}
}
?>
| Support Windows color with ANSICON | Support Windows color with ANSICON
| PHP | bsd-3-clause | agallou/atoum,GuillaumeDievart/atoum,tejerka/atoum,mageekguy/atoum,jubianchi/atoum,mikaelrandy/atoum,Tiross/atoum,vonglasow/atoum,jubianchi/atoum,mikaelrandy/atoum,GuillaumeDievart/atoum,gpaton/atoum,agallou/atoum,tejerka/atoum,CedCannes/atoum,Tiross/atoum,mageekguy/atoum,gpaton/atoum,vonglasow/atoum,CedCannes/atoum | php | ## Code Before:
<?php
namespace mageekguy\atoum;
use
mageekguy\atoum
;
class cli
{
private static $isTerminal = null;
public function __construct(atoum\adapter $adapter = null)
{
if ($adapter === null)
{
$adapter = new atoum\adapter();
}
if (self::$isTerminal === null)
{
self::$isTerminal = ($adapter->defined('STDOUT') === true && $adapter->function_exists('posix_isatty') === true && $adapter->posix_isatty($adapter->constant('STDOUT')) === true);
}
}
public function setAdapter(atoum\adapter $adapter)
{
$this->adapter = $adapter;
return $this;
}
public function getAdapter()
{
return $this->adapter;
}
public function isTerminal()
{
return self::$isTerminal;
}
public static function forceTerminal()
{
self::$isTerminal = true;
}
}
?>
## Instruction:
Support Windows color with ANSICON
## Code After:
<?php
namespace mageekguy\atoum;
use
mageekguy\atoum
;
class cli
{
private static $isTerminal = null;
public function __construct(atoum\adapter $adapter = null)
{
if ($adapter === null)
{
$adapter = new atoum\adapter();
}
if (self::$isTerminal === null)
{
self::$isTerminal = $adapter->defined('PHP_WINDOWS_VERSION_BUILD') ? (Boolean) $adapter->getenv('ANSICON') : ($adapter->defined('STDOUT') === true && $adapter->function_exists('posix_isatty') === true && $adapter->posix_isatty($adapter->constant('STDOUT')) === true);
}
}
public function setAdapter(atoum\adapter $adapter)
{
$this->adapter = $adapter;
return $this;
}
public function getAdapter()
{
return $this->adapter;
}
public function isTerminal()
{
return self::$isTerminal;
}
public static function forceTerminal()
{
self::$isTerminal = true;
}
}
?>
| <?php
namespace mageekguy\atoum;
use
mageekguy\atoum
;
class cli
{
private static $isTerminal = null;
public function __construct(atoum\adapter $adapter = null)
{
if ($adapter === null)
{
$adapter = new atoum\adapter();
}
if (self::$isTerminal === null)
{
- self::$isTerminal = ($adapter->defined('STDOUT') === true && $adapter->function_exists('posix_isatty') === true && $adapter->posix_isatty($adapter->constant('STDOUT')) === true);
+ self::$isTerminal = $adapter->defined('PHP_WINDOWS_VERSION_BUILD') ? (Boolean) $adapter->getenv('ANSICON') : ($adapter->defined('STDOUT') === true && $adapter->function_exists('posix_isatty') === true && $adapter->posix_isatty($adapter->constant('STDOUT')) === true);
}
}
public function setAdapter(atoum\adapter $adapter)
{
$this->adapter = $adapter;
return $this;
}
public function getAdapter()
{
return $this->adapter;
}
public function isTerminal()
{
return self::$isTerminal;
}
public static function forceTerminal()
{
self::$isTerminal = true;
}
}
?> | 2 | 0.040816 | 1 | 1 |
cd95123631a88130583acafd31df5cf93354aa75 | spec/dummy/config/database.yml | spec/dummy/config/database.yml | default: &default
adapter: mysql2
username: root
test:
<<: *default
database: stripe_webhooks_test
| default: &default
adapter: mysql2
username: <%= ENV['DATABASE_USERNAME'] || 'root' %>
test:
<<: *default
database: <%= ENV['DATABASE_NAME_TEST'] || 'stripe_webhooks_test' %>
password: <%= ENV['DATABASE_PASSWORD'] %>
| Change db configs for semaphore | Change db configs for semaphore
| YAML | mit | westlakedesign/stripe_webhooks,westlakedesign/stripe_webhooks,westlakedesign/stripe_webhooks | yaml | ## Code Before:
default: &default
adapter: mysql2
username: root
test:
<<: *default
database: stripe_webhooks_test
## Instruction:
Change db configs for semaphore
## Code After:
default: &default
adapter: mysql2
username: <%= ENV['DATABASE_USERNAME'] || 'root' %>
test:
<<: *default
database: <%= ENV['DATABASE_NAME_TEST'] || 'stripe_webhooks_test' %>
password: <%= ENV['DATABASE_PASSWORD'] %>
| default: &default
adapter: mysql2
- username: root
+ username: <%= ENV['DATABASE_USERNAME'] || 'root' %>
test:
<<: *default
- database: stripe_webhooks_test
+ database: <%= ENV['DATABASE_NAME_TEST'] || 'stripe_webhooks_test' %>
+ password: <%= ENV['DATABASE_PASSWORD'] %> | 5 | 0.714286 | 3 | 2 |
29d929c4a4b07ec8c6d91df2e25bdc37e1ab3f80 | README.rst | README.rst | Emmaus House Food Pantry Inventory Management
=============================================
Food Pantry inventory management program for Emmaus House Episcopal Church.
Designed for use with modern USB barcode scanners.
Installation
------------
Simply download the program to your desktop and double-click.
Development
-----------
Building
........
::
python setup.py --help
usage: setup.py [-h] [-c] [-p] [-b]
Emmaus House Food Pantry Setup
optional arguments:
-h, --help show this help message and exit
-c, --clean Clean all built files.
-p, --pack Pack app files into archive.
-b, --build Build executable.
Webapp Testing
..............
::
python webapp.py --package food_pantry.zip
| Emmaus House Food Pantry Inventory Management
=============================================
Food Pantry inventory management program for Emmaus House Episcopal Church.
Designed for use with modern USB barcode scanners.
Installation
------------
Simply download the program to your desktop and double-click.
`Click here <https://github.com/downloads/grantjenks/emmaus_house_food_pantry/pantry.exe>`_ to download the latest version of the program.
Development
-----------
Building
........
::
python setup.py --help
usage: setup.py [-h] [-c] [-p] [-b]
Emmaus House Food Pantry Setup
optional arguments:
-h, --help show this help message and exit
-c, --clean Clean all built files.
-p, --pack Pack app files into archive.
-b, --build Build executable.
Webapp Testing
..............
::
python webapp.py --package food_pantry.zip
| Create link to latest version of pantry. | Create link to latest version of pantry. | reStructuredText | mit | grantjenks/emmaus_house_food_pantry,grantjenks/emmaus_house_food_pantry | restructuredtext | ## Code Before:
Emmaus House Food Pantry Inventory Management
=============================================
Food Pantry inventory management program for Emmaus House Episcopal Church.
Designed for use with modern USB barcode scanners.
Installation
------------
Simply download the program to your desktop and double-click.
Development
-----------
Building
........
::
python setup.py --help
usage: setup.py [-h] [-c] [-p] [-b]
Emmaus House Food Pantry Setup
optional arguments:
-h, --help show this help message and exit
-c, --clean Clean all built files.
-p, --pack Pack app files into archive.
-b, --build Build executable.
Webapp Testing
..............
::
python webapp.py --package food_pantry.zip
## Instruction:
Create link to latest version of pantry.
## Code After:
Emmaus House Food Pantry Inventory Management
=============================================
Food Pantry inventory management program for Emmaus House Episcopal Church.
Designed for use with modern USB barcode scanners.
Installation
------------
Simply download the program to your desktop and double-click.
`Click here <https://github.com/downloads/grantjenks/emmaus_house_food_pantry/pantry.exe>`_ to download the latest version of the program.
Development
-----------
Building
........
::
python setup.py --help
usage: setup.py [-h] [-c] [-p] [-b]
Emmaus House Food Pantry Setup
optional arguments:
-h, --help show this help message and exit
-c, --clean Clean all built files.
-p, --pack Pack app files into archive.
-b, --build Build executable.
Webapp Testing
..............
::
python webapp.py --package food_pantry.zip
| Emmaus House Food Pantry Inventory Management
=============================================
Food Pantry inventory management program for Emmaus House Episcopal Church.
Designed for use with modern USB barcode scanners.
Installation
------------
Simply download the program to your desktop and double-click.
+
+ `Click here <https://github.com/downloads/grantjenks/emmaus_house_food_pantry/pantry.exe>`_ to download the latest version of the program.
Development
-----------
Building
........
::
python setup.py --help
usage: setup.py [-h] [-c] [-p] [-b]
Emmaus House Food Pantry Setup
optional arguments:
-h, --help show this help message and exit
-c, --clean Clean all built files.
-p, --pack Pack app files into archive.
-b, --build Build executable.
Webapp Testing
..............
::
python webapp.py --package food_pantry.zip | 2 | 0.054054 | 2 | 0 |
ddb26faa11a22858f93493677fdbe7d278ecf582 | conda/meta.yaml | conda/meta.yaml | package:
name: flaapluc
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
source:
git_url: https://github.com/jlenain/flaapluc.git
requirements:
build:
- python 2.7*
- email
- numpy 1.13*
- scipy
- astropy >=2.*
- matplotlib >=2.*
- ephem
- uncertainties
run:
- python 2.7*
- email
- numpy 1.13*
- scipy
- astropy >=2.*
- matplotlib >=2.*
- ephem
- uncertainties
about:
home: https://github.com/jlenain/flaapluc
license: BSD
license_file: LICENSE
| package:
name: flaapluc
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
source:
git_url: https://github.com/jlenain/flaapluc.git
requirements:
build:
- python 2.7*
- email
- numpy 1.13*
- scipy
- astropy >=2.*
- matplotlib >=2.*
- ephem
- setuptools
- uncertainties
run:
- python 2.7*
- email
- numpy 1.13*
- scipy
- astropy >=2.*
- matplotlib >=2.*
- ephem
- setuptools
- uncertainties
about:
home: https://github.com/jlenain/flaapluc
license: BSD
license_file: LICENSE
| Add dependency on setuptools to properly build conda package | Add dependency on setuptools to properly build conda package
| YAML | bsd-3-clause | jlenain/flaapluc,jlenain/flaapluc | yaml | ## Code Before:
package:
name: flaapluc
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
source:
git_url: https://github.com/jlenain/flaapluc.git
requirements:
build:
- python 2.7*
- email
- numpy 1.13*
- scipy
- astropy >=2.*
- matplotlib >=2.*
- ephem
- uncertainties
run:
- python 2.7*
- email
- numpy 1.13*
- scipy
- astropy >=2.*
- matplotlib >=2.*
- ephem
- uncertainties
about:
home: https://github.com/jlenain/flaapluc
license: BSD
license_file: LICENSE
## Instruction:
Add dependency on setuptools to properly build conda package
## Code After:
package:
name: flaapluc
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
source:
git_url: https://github.com/jlenain/flaapluc.git
requirements:
build:
- python 2.7*
- email
- numpy 1.13*
- scipy
- astropy >=2.*
- matplotlib >=2.*
- ephem
- setuptools
- uncertainties
run:
- python 2.7*
- email
- numpy 1.13*
- scipy
- astropy >=2.*
- matplotlib >=2.*
- ephem
- setuptools
- uncertainties
about:
home: https://github.com/jlenain/flaapluc
license: BSD
license_file: LICENSE
| package:
name: flaapluc
version: {{ environ.get('GIT_DESCRIBE_TAG', '') }}
source:
git_url: https://github.com/jlenain/flaapluc.git
requirements:
build:
- python 2.7*
- email
- numpy 1.13*
- scipy
- astropy >=2.*
- matplotlib >=2.*
- ephem
+ - setuptools
- uncertainties
run:
- python 2.7*
- email
- numpy 1.13*
- scipy
- astropy >=2.*
- matplotlib >=2.*
- ephem
+ - setuptools
- uncertainties
about:
home: https://github.com/jlenain/flaapluc
license: BSD
license_file: LICENSE | 2 | 0.0625 | 2 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.