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
6fa9c06ad582f658d513119cec7c3b65237791c1
scripts/run-tests-ci.sh
scripts/run-tests-ci.sh
source scripts/prepare-ci-environment.sh if [[ $IJ_ULTIMATE == "true" ]]; then export TEST_SET="integration" fi rm -rf $IDEA_TEST_HOME mkdir -p $IDEA_TEST_HOME pushd .cache pushd pants if [ -z ${PANTS_SHA+x} ]; then echo "Pulling the latest master..." git pull else echo "Using $PANTS_SHA..." git reset --hard $PANTS_SHA fi popd popd args="test tests:${TEST_SET:-all} $(append_intellij_jvm_options test-junit) $@" echo "Running ./pants $args" ./pants $args
source scripts/prepare-ci-environment.sh if [[ $IJ_ULTIMATE == "true" ]]; then export TEST_SET="integration" fi rm -rf $IDEA_TEST_HOME mkdir -p $IDEA_TEST_HOME pushd .cache pushd pants if [ -z ${PANTS_SHA+x} ]; then echo "Pulling the latest master..." git pull else echo "Using $PANTS_SHA..." git reset --hard $PANTS_SHA fi popd popd args="test tests:${TEST_SET:-all} $(append_intellij_jvm_options test-junit) ${ADDITIONAL_ARGS:-$@}" echo "Running ./pants $args" ./pants $args
Add an env variable to control running tests from travis ui
Add an env variable to control running tests from travis ui While working on https://github.com/pantsbuild/intellij-pants-plugin/issues/130, there were tests mysteriously failing, running the entire test suite takes 20minutes and is not reproducible locally, this allows us to better reproduce problems on travis. Testing Done: Tried in CI, an example usage is to set `ADDITIONAL_ARGS` to a small set of tests, like `"--test-junit-test=com.twitter.intellij.pants.completion.PantsCompletionTest --test-junit-test=com.twitter.intellij.pants.components.impl.PantsProjectCacheTest --test-junit-test=com.twitter.intellij.pants.execution.OSSPantsExamplesRunConfigurationIntegrationTest --test-junit-test=com.twitter.intellij.pants.execution.PantsOutputMessageTest --test-junit-test=com.twitter.intellij.pants.highlighting.PantsHighlightingIntegrationTest --test-junit-test=com.twitter.intellij.pants.highlighting.PantsUnresolvedJavaReferenceQuickFixProviderTest --test-junit-test=com.twitter.intellij.pants.highlighting.PantsUnresolvedScalaReferenceQuickFixProviderTest"` Bugs closed: 131 Reviewed at https://rbcommons.com/s/twitter/r/3824/
Shell
apache-2.0
wisechengyi/intellij-pants-plugin,pantsbuild/intellij-pants-plugin,pantsbuild/intellij-pants-plugin,pantsbuild/intellij-pants-plugin,wisechengyi/intellij-pants-plugin,wisechengyi/intellij-pants-plugin,pantsbuild/intellij-pants-plugin,wisechengyi/intellij-pants-plugin,pantsbuild/intellij-pants-plugin
shell
## Code Before: source scripts/prepare-ci-environment.sh if [[ $IJ_ULTIMATE == "true" ]]; then export TEST_SET="integration" fi rm -rf $IDEA_TEST_HOME mkdir -p $IDEA_TEST_HOME pushd .cache pushd pants if [ -z ${PANTS_SHA+x} ]; then echo "Pulling the latest master..." git pull else echo "Using $PANTS_SHA..." git reset --hard $PANTS_SHA fi popd popd args="test tests:${TEST_SET:-all} $(append_intellij_jvm_options test-junit) $@" echo "Running ./pants $args" ./pants $args ## Instruction: Add an env variable to control running tests from travis ui While working on https://github.com/pantsbuild/intellij-pants-plugin/issues/130, there were tests mysteriously failing, running the entire test suite takes 20minutes and is not reproducible locally, this allows us to better reproduce problems on travis. Testing Done: Tried in CI, an example usage is to set `ADDITIONAL_ARGS` to a small set of tests, like `"--test-junit-test=com.twitter.intellij.pants.completion.PantsCompletionTest --test-junit-test=com.twitter.intellij.pants.components.impl.PantsProjectCacheTest --test-junit-test=com.twitter.intellij.pants.execution.OSSPantsExamplesRunConfigurationIntegrationTest --test-junit-test=com.twitter.intellij.pants.execution.PantsOutputMessageTest --test-junit-test=com.twitter.intellij.pants.highlighting.PantsHighlightingIntegrationTest --test-junit-test=com.twitter.intellij.pants.highlighting.PantsUnresolvedJavaReferenceQuickFixProviderTest --test-junit-test=com.twitter.intellij.pants.highlighting.PantsUnresolvedScalaReferenceQuickFixProviderTest"` Bugs closed: 131 Reviewed at https://rbcommons.com/s/twitter/r/3824/ ## Code After: source scripts/prepare-ci-environment.sh if [[ $IJ_ULTIMATE == "true" ]]; then export TEST_SET="integration" fi rm -rf $IDEA_TEST_HOME mkdir -p $IDEA_TEST_HOME pushd .cache pushd pants if [ -z ${PANTS_SHA+x} ]; then echo "Pulling the latest master..." git pull else echo "Using $PANTS_SHA..." git reset --hard $PANTS_SHA fi popd popd args="test tests:${TEST_SET:-all} $(append_intellij_jvm_options test-junit) ${ADDITIONAL_ARGS:-$@}" echo "Running ./pants $args" ./pants $args
source scripts/prepare-ci-environment.sh if [[ $IJ_ULTIMATE == "true" ]]; then export TEST_SET="integration" fi rm -rf $IDEA_TEST_HOME mkdir -p $IDEA_TEST_HOME pushd .cache pushd pants if [ -z ${PANTS_SHA+x} ]; then echo "Pulling the latest master..." git pull else echo "Using $PANTS_SHA..." git reset --hard $PANTS_SHA fi popd popd - args="test tests:${TEST_SET:-all} $(append_intellij_jvm_options test-junit) $@" + args="test tests:${TEST_SET:-all} $(append_intellij_jvm_options test-junit) ${ADDITIONAL_ARGS:-$@}" ? +++++++++++++++++++ + echo "Running ./pants $args" ./pants $args
2
0.076923
1
1
e32a8ef233cb32a0225313f5673de25e0a2f89d3
lambda/src/options.example.js
lambda/src/options.example.js
// If you setup basic auth in node-sonos-http-api's settings.json, change the username // and password here. Otherwise, just leave this alone and it will work without auth. var auth = new Buffer("YOUR_USERNAME" + ":" + "YOUR_PASSWORD").toString("base64"); var options = { appid: "ENTER_YOUR_APP_ID_FOR_ECHO_HERE", host: "host_for_sonos_api", port: "5005", headers: { 'Authorization': 'Basic ' + auth, 'Content-Type': 'application/json' }, useHttps: false, // Change to true if you setup node-sonos-http-api with HTTPS rejectUnauthorized: true, // Change to false if you self-signed your certificate defaultRoom: '', // Allows you to specify a default room when one is not specified in the utterance defaultMusicService: 'presets', // Supports presets, apple, spotify, deezer, or library advancedMode: false, // Allows you to specify and change default rooms and music services. Requires additional AWS setup useSQS: false // Use AWS SQS and node-sqs-proxy for secure communications }; module.exports = options;
// If you setup basic auth in node-sonos-http-api's settings.json, change the username // and password here. Otherwise, just leave this alone and it will work without auth. var auth = new Buffer(process.env.AUTH_USERNAME + ":" + process.env.AUTH_PASSWORD).toString("base64"); var options = { appid: process.env.APPID, host: process.env.HOST, port: process.env.PORT || '5005', headers: { 'Authorization': 'Basic ' + auth, 'Content-Type': 'application/json' }, useHttps: process.env.USE_HTTPS || false, // Change to true if you setup node-sonos-http-api with HTTPS rejectUnauthorized: process.env.REJECT_UNAUTHORIZED || true, // Change to false if you self-signed your certificate defaultRoom: process.env.DEFAULT_ROOM || '', // Allows you to specify a default room when one is not specified in the utterance defaultMusicService: process.env.DEFAULT_MUSIC_SERVICE || 'presets', // Supports presets, apple, spotify, deezer, or library advancedMode: process.env.ADVANCED_MODE || false, // Allows you to specify and change default rooms and music services. Requires additional AWS setup useSQS: process.env.USE_SQS || false // Use AWS SQS and node-sqs-proxy for secure communications }; module.exports = options;
Allow options to be set with environment variables in lambda
Allow options to be set with environment variables in lambda Prior to this commit, the way to customize your installation of echo-sonos was to make a copy of the options.example.js and hand edit it for your setup. After this commit, the way to customize your installation of echo-sonos can be that you use the same options.js as everyone else but you set the items you want to change as environment variables when you upload to lamdba.
JavaScript
mit
rgraciano/echo-sonos,rgraciano/echo-sonos
javascript
## Code Before: // If you setup basic auth in node-sonos-http-api's settings.json, change the username // and password here. Otherwise, just leave this alone and it will work without auth. var auth = new Buffer("YOUR_USERNAME" + ":" + "YOUR_PASSWORD").toString("base64"); var options = { appid: "ENTER_YOUR_APP_ID_FOR_ECHO_HERE", host: "host_for_sonos_api", port: "5005", headers: { 'Authorization': 'Basic ' + auth, 'Content-Type': 'application/json' }, useHttps: false, // Change to true if you setup node-sonos-http-api with HTTPS rejectUnauthorized: true, // Change to false if you self-signed your certificate defaultRoom: '', // Allows you to specify a default room when one is not specified in the utterance defaultMusicService: 'presets', // Supports presets, apple, spotify, deezer, or library advancedMode: false, // Allows you to specify and change default rooms and music services. Requires additional AWS setup useSQS: false // Use AWS SQS and node-sqs-proxy for secure communications }; module.exports = options; ## Instruction: Allow options to be set with environment variables in lambda Prior to this commit, the way to customize your installation of echo-sonos was to make a copy of the options.example.js and hand edit it for your setup. After this commit, the way to customize your installation of echo-sonos can be that you use the same options.js as everyone else but you set the items you want to change as environment variables when you upload to lamdba. ## Code After: // If you setup basic auth in node-sonos-http-api's settings.json, change the username // and password here. Otherwise, just leave this alone and it will work without auth. var auth = new Buffer(process.env.AUTH_USERNAME + ":" + process.env.AUTH_PASSWORD).toString("base64"); var options = { appid: process.env.APPID, host: process.env.HOST, port: process.env.PORT || '5005', headers: { 'Authorization': 'Basic ' + auth, 'Content-Type': 'application/json' }, useHttps: process.env.USE_HTTPS || false, // Change to true if you setup node-sonos-http-api with HTTPS rejectUnauthorized: process.env.REJECT_UNAUTHORIZED || true, // Change to false if you self-signed your certificate defaultRoom: process.env.DEFAULT_ROOM || '', // Allows you to specify a default room when one is not specified in the utterance defaultMusicService: process.env.DEFAULT_MUSIC_SERVICE || 'presets', // Supports presets, apple, spotify, deezer, or library advancedMode: process.env.ADVANCED_MODE || false, // Allows you to specify and change default rooms and music services. Requires additional AWS setup useSQS: process.env.USE_SQS || false // Use AWS SQS and node-sqs-proxy for secure communications }; module.exports = options;
// If you setup basic auth in node-sonos-http-api's settings.json, change the username // and password here. Otherwise, just leave this alone and it will work without auth. - var auth = new Buffer("YOUR_USERNAME" + ":" + "YOUR_PASSWORD").toString("base64"); ? ^^^ ^ - ^^^ ^ - + var auth = new Buffer(process.env.AUTH_USERNAME + ":" + process.env.AUTH_PASSWORD).toString("base64"); ? ^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^ ^^ var options = { - appid: "ENTER_YOUR_APP_ID_FOR_ECHO_HERE", - host: "host_for_sonos_api", - port: "5005", + appid: process.env.APPID, + host: process.env.HOST, + port: process.env.PORT || '5005', headers: { 'Authorization': 'Basic ' + auth, 'Content-Type': 'application/json' }, - useHttps: false, // Change to true if you setup node-sonos-http-api with HTTPS + useHttps: process.env.USE_HTTPS || false, // Change to true if you setup node-sonos-http-api with HTTPS ? +++++++++++++++++++++++++ - rejectUnauthorized: true, // Change to false if you self-signed your certificate + rejectUnauthorized: process.env.REJECT_UNAUTHORIZED || true, // Change to false if you self-signed your certificate ? +++++++++++++++++++++++++++++++++++ - defaultRoom: '', // Allows you to specify a default room when one is not specified in the utterance ? -- + defaultRoom: process.env.DEFAULT_ROOM || '', // Allows you to specify a default room when one is not specified in the utterance ? ++++++++++++++++++++++++++++ - defaultMusicService: 'presets', // Supports presets, apple, spotify, deezer, or library + defaultMusicService: process.env.DEFAULT_MUSIC_SERVICE || 'presets', // Supports presets, apple, spotify, deezer, or library ? +++++++++++++++++++++++++++++++++++++ - advancedMode: false, // Allows you to specify and change default rooms and music services. Requires additional AWS setup + advancedMode: process.env.ADVANCED_MODE || false, // Allows you to specify and change default rooms and music services. Requires additional AWS setup ? +++++++++++++++++++++++++++++ - useSQS: false // Use AWS SQS and node-sqs-proxy for secure communications + useSQS: process.env.USE_SQS || false // Use AWS SQS and node-sqs-proxy for secure communications ? +++++++++++++++++++++++ }; module.exports = options;
20
0.909091
10
10
87b4bab8ff90754c3fc9bab44cc279cf0ee1ba71
run.sh
run.sh
set -e ansible_run_playbook() { echo "Running Ansible" ansible-playbook ansible/playbook.yml --ask-become-pass -v } ansible_run_playbook
set -e ansible_run_playbook() { echo "Running Ansible" ansible-playbook ansible/playbook.yml --ask-become-pass -v --connection=local } ansible_run_playbook
Make sure we're only using a local connection
Make sure we're only using a local connection
Shell
mit
moritzheiber/laptop-provisioning,moritzheiber/laptop-provisioning
shell
## Code Before: set -e ansible_run_playbook() { echo "Running Ansible" ansible-playbook ansible/playbook.yml --ask-become-pass -v } ansible_run_playbook ## Instruction: Make sure we're only using a local connection ## Code After: set -e ansible_run_playbook() { echo "Running Ansible" ansible-playbook ansible/playbook.yml --ask-become-pass -v --connection=local } ansible_run_playbook
set -e ansible_run_playbook() { echo "Running Ansible" - ansible-playbook ansible/playbook.yml --ask-become-pass -v + ansible-playbook ansible/playbook.yml --ask-become-pass -v --connection=local ? +++++++++++++++++++ } ansible_run_playbook
2
0.222222
1
1
f687a7491568fe99700b7955b5bfa6ad40c64fc3
composer.json
composer.json
{ "name": "shopsys/coding-standards", "description": "Common coding standards for new ShopSys projects", "authors": [ { "name": "Miroslav Sustek", "email": "miroslav.sustek@shopsys.cz" } ], "autoload": { "psr-4": { "ShopSys\\": "src/ShopSys/" } }, "require": { "fabpot/php-cs-fixer": "~1.11", "jakub-onderka/php-parallel-lint": "~0.9", "phpmd/phpmd": "~2.0", "squizlabs/php_codesniffer": "2.3.2" }, "require-dev": { "phpunit/phpunit": "~5.2.9" } }
{ "name": "shopsys/coding-standards", "description": "Common coding standards for new ShopSys projects", "authors": [ { "name": "Miroslav Sustek", "email": "miroslav.sustek@shopsys.cz" } ], "autoload": { "psr-4": { "ShopSys\\": "src/ShopSys/" } }, "require": { "friendsofphp/php-cs-fixer": "~1.11", "jakub-onderka/php-parallel-lint": "~0.9", "phpmd/phpmd": "~2.0", "squizlabs/php_codesniffer": "2.3.2" }, "require-dev": { "phpunit/phpunit": "~5.2.9" } }
Replace abandoned fabpot/php-cs-fixer with friendsofphp/php-cs-fixer
Replace abandoned fabpot/php-cs-fixer with friendsofphp/php-cs-fixer
JSON
mit
shopsys/coding-standards
json
## Code Before: { "name": "shopsys/coding-standards", "description": "Common coding standards for new ShopSys projects", "authors": [ { "name": "Miroslav Sustek", "email": "miroslav.sustek@shopsys.cz" } ], "autoload": { "psr-4": { "ShopSys\\": "src/ShopSys/" } }, "require": { "fabpot/php-cs-fixer": "~1.11", "jakub-onderka/php-parallel-lint": "~0.9", "phpmd/phpmd": "~2.0", "squizlabs/php_codesniffer": "2.3.2" }, "require-dev": { "phpunit/phpunit": "~5.2.9" } } ## Instruction: Replace abandoned fabpot/php-cs-fixer with friendsofphp/php-cs-fixer ## Code After: { "name": "shopsys/coding-standards", "description": "Common coding standards for new ShopSys projects", "authors": [ { "name": "Miroslav Sustek", "email": "miroslav.sustek@shopsys.cz" } ], "autoload": { "psr-4": { "ShopSys\\": "src/ShopSys/" } }, "require": { "friendsofphp/php-cs-fixer": "~1.11", "jakub-onderka/php-parallel-lint": "~0.9", "phpmd/phpmd": "~2.0", "squizlabs/php_codesniffer": "2.3.2" }, "require-dev": { "phpunit/phpunit": "~5.2.9" } }
{ "name": "shopsys/coding-standards", "description": "Common coding standards for new ShopSys projects", "authors": [ { "name": "Miroslav Sustek", "email": "miroslav.sustek@shopsys.cz" } ], "autoload": { "psr-4": { "ShopSys\\": "src/ShopSys/" } }, "require": { - "fabpot/php-cs-fixer": "~1.11", ? ^^ ^^ + "friendsofphp/php-cs-fixer": "~1.11", ? ^^^^^^^^ ^^ "jakub-onderka/php-parallel-lint": "~0.9", "phpmd/phpmd": "~2.0", "squizlabs/php_codesniffer": "2.3.2" }, "require-dev": { "phpunit/phpunit": "~5.2.9" } }
2
0.083333
1
1
96cd717483480b0fc12d6a36fb7dc6dca7003d79
db/migrate/20170322171523_add_owner_to_common_tasks.rb
db/migrate/20170322171523_add_owner_to_common_tasks.rb
class AddOwnerToCommonTasks < ActiveRecord::Migration def change add_reference :common_tasks, :owner, index: true, foreign_key: true end end
class AddOwnerToCommonTasks < ActiveRecord::Migration def change add_reference :common_tasks, :owner, index: true, foreign_key: { to_table: :users } end end
Fix foreign key problem in postgresql
Fix foreign key problem in postgresql Since the CommonTask#owner reference is actually referencing the users table then a :to_table option needs to be added to the foreign key attributed to keep it from trying to use a non-existant owners table rather than the appropriate users table.
Ruby
mit
tmiller/network,tmiller/network,tmiller/network
ruby
## Code Before: class AddOwnerToCommonTasks < ActiveRecord::Migration def change add_reference :common_tasks, :owner, index: true, foreign_key: true end end ## Instruction: Fix foreign key problem in postgresql Since the CommonTask#owner reference is actually referencing the users table then a :to_table option needs to be added to the foreign key attributed to keep it from trying to use a non-existant owners table rather than the appropriate users table. ## Code After: class AddOwnerToCommonTasks < ActiveRecord::Migration def change add_reference :common_tasks, :owner, index: true, foreign_key: { to_table: :users } end end
class AddOwnerToCommonTasks < ActiveRecord::Migration def change - add_reference :common_tasks, :owner, index: true, foreign_key: true ? ^^ + add_reference :common_tasks, :owner, index: true, foreign_key: { to_table: :users } ? ++ +++++++++++++ ^^^ end end
2
0.4
1
1
84c9931526777bb7ab46a4fb81751ba8feff3719
appveyor.yml
appveyor.yml
version: '1.0.{build}' install: - dotnet restore platform: - x86 - x64 - Any CPU
version: '1.0.{build}' install: - dotnet restore platform: - x86 - Any CPU build_script: - dotnet build test_script: - ps: ForEach ($proj in (Get-ChildItem -Path test -Recurse -Filter '*.csproj')) { dotnet test $proj.FullName }
Add Build and Test Setps to Appveyor Config
Add Build and Test Setps to Appveyor Config Copied from PollyTick
YAML
mit
iwillspeak/IronRure,iwillspeak/IronRure
yaml
## Code Before: version: '1.0.{build}' install: - dotnet restore platform: - x86 - x64 - Any CPU ## Instruction: Add Build and Test Setps to Appveyor Config Copied from PollyTick ## Code After: version: '1.0.{build}' install: - dotnet restore platform: - x86 - Any CPU build_script: - dotnet build test_script: - ps: ForEach ($proj in (Get-ChildItem -Path test -Recurse -Filter '*.csproj')) { dotnet test $proj.FullName }
version: '1.0.{build}' install: - dotnet restore platform: - x86 - - x64 - Any CPU + build_script: + - dotnet build + test_script: + - ps: ForEach ($proj in (Get-ChildItem -Path test -Recurse -Filter '*.csproj')) { dotnet test $proj.FullName }
5
0.714286
4
1
b4e39956e4c484a2e4fd3e9d0c8859f7771def4b
buildSrc/src/main/groovy/jp/leafytree/gradle/GradleWrapper.groovy
buildSrc/src/main/groovy/jp/leafytree/gradle/GradleWrapper.groovy
/* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jp.leafytree.gradle import org.apache.tools.ant.taskdefs.condition.Os class GradleWrapper { private final File dir public GradleWrapper(File dir) { this.dir = dir } public Process execute(List<String> options) { def command = [] if (Os.isFamily(Os.FAMILY_WINDOWS)) { command << "gradlew.bat" } else { command += ["/bin/sh", "gradlew"] } def processBuilder = new ProcessBuilder(command + options) processBuilder.directory(dir) processBuilder.start() } public static printProcessOutput(Process process) { def stdout = new StringBuilder() def stderr = new StringBuilder() process.waitForProcessOutput(stdout, stderr) println(""" -- stdout --- $stdout -- stderr --- $stderr """) } }
/* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jp.leafytree.gradle import org.apache.tools.ant.taskdefs.condition.Os class GradleWrapper { private final File dir public GradleWrapper(File dir) { this.dir = dir } public Process execute(List<String> options) { def command = [] if (Os.isFamily(Os.FAMILY_WINDOWS)) { command << dir.absolutePath + File.separator + "gradlew.bat" } else { command += ["/bin/sh", dir.absolutePath + File.separator + "gradlew"] } def processBuilder = new ProcessBuilder(command + options) processBuilder.directory(dir) processBuilder.start() } public static printProcessOutput(Process process) { def stdout = new StringBuilder() def stderr = new StringBuilder() process.waitForProcessOutput(stdout, stderr) println(""" -- stdout --- $stdout -- stderr --- $stderr """) } }
Use absolute path for gradlew
Use absolute path for gradlew
Groovy
apache-2.0
saturday06/gradle-android-scala-plugin,felixvf/gradle-android-mirah-plugin
groovy
## Code Before: /* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jp.leafytree.gradle import org.apache.tools.ant.taskdefs.condition.Os class GradleWrapper { private final File dir public GradleWrapper(File dir) { this.dir = dir } public Process execute(List<String> options) { def command = [] if (Os.isFamily(Os.FAMILY_WINDOWS)) { command << "gradlew.bat" } else { command += ["/bin/sh", "gradlew"] } def processBuilder = new ProcessBuilder(command + options) processBuilder.directory(dir) processBuilder.start() } public static printProcessOutput(Process process) { def stdout = new StringBuilder() def stderr = new StringBuilder() process.waitForProcessOutput(stdout, stderr) println(""" -- stdout --- $stdout -- stderr --- $stderr """) } } ## Instruction: Use absolute path for gradlew ## Code After: /* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jp.leafytree.gradle import org.apache.tools.ant.taskdefs.condition.Os class GradleWrapper { private final File dir public GradleWrapper(File dir) { this.dir = dir } public Process execute(List<String> options) { def command = [] if (Os.isFamily(Os.FAMILY_WINDOWS)) { command << dir.absolutePath + File.separator + "gradlew.bat" } else { command += ["/bin/sh", dir.absolutePath + File.separator + "gradlew"] } def processBuilder = new ProcessBuilder(command + options) processBuilder.directory(dir) processBuilder.start() } public static printProcessOutput(Process process) { def stdout = new StringBuilder() def stderr = new StringBuilder() process.waitForProcessOutput(stdout, stderr) println(""" -- stdout --- $stdout -- stderr --- $stderr """) } }
/* * Copyright 2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package jp.leafytree.gradle import org.apache.tools.ant.taskdefs.condition.Os class GradleWrapper { private final File dir public GradleWrapper(File dir) { this.dir = dir } public Process execute(List<String> options) { def command = [] if (Os.isFamily(Os.FAMILY_WINDOWS)) { - command << "gradlew.bat" + command << dir.absolutePath + File.separator + "gradlew.bat" } else { - command += ["/bin/sh", "gradlew"] + command += ["/bin/sh", dir.absolutePath + File.separator + "gradlew"] } def processBuilder = new ProcessBuilder(command + options) processBuilder.directory(dir) processBuilder.start() } public static printProcessOutput(Process process) { def stdout = new StringBuilder() def stderr = new StringBuilder() process.waitForProcessOutput(stdout, stderr) println(""" -- stdout --- $stdout -- stderr --- $stderr """) } }
4
0.08
2
2
8c4ff3b7dffe7e281a037ed51a2a9838708b00e3
config/initializers/simple_form_foundation.rb
config/initializers/simple_form_foundation.rb
SimpleForm.setup do |config| config.wrappers :foundation, class: :input, hint_class: :field_with_hint, error_class: :error do |b| b.use :html5 b.use :placeholder b.optional :maxlength b.optional :pattern b.optional :min_max b.optional :readonly b.use :label_input b.use :error, wrap_with: { tag: :small } # Uncomment the following line to enable hints. The line is commented out by default since Foundation # does't provide styles for hints. You will need to provide your own CSS styles for hints. # b.use :hint, wrap_with: { tag: :span, class: :hint } end # CSS class for buttons config.button_class = 'button' # CSS class to add for error notification helper. config.error_notification_class = 'alert-box alert' # The default wrapper to be used by the FormBuilder. config.default_wrapper = :foundation end
SimpleForm.setup do |config| config.wrappers :foundation, class: :input, hint_class: :field_with_hint, error_class: :error do |b| b.use :html5 b.use :placeholder b.optional :maxlength b.optional :pattern b.optional :min_max b.optional :readonly b.use :label_input b.use :error, wrap_with: { tag: :small, class: 'error' } # Uncomment the following line to enable hints. The line is commented out by default since Foundation # does't provide styles for hints. You will need to provide your own CSS styles for hints. # b.use :hint, wrap_with: { tag: :span, class: :hint } end # CSS class for buttons config.button_class = 'button' # CSS class to add for error notification helper. config.error_notification_class = 'alert-box alert' # The default wrapper to be used by the FormBuilder. config.default_wrapper = :foundation end
Configure simple_form to use error class for inputs with error
Configure simple_form to use error class for inputs with error
Ruby
mit
raksonibs/raimcrowd,jinutm/silverme,jinutm/silverpro,gustavoguichard/neighborly,jinutm/silverclass,jinutm/silveralms.com,jinutm/silverclass,jinutm/silverme,raksonibs/raimcrowd,rockkhuya/taydantay,rockkhuya/taydantay,jinutm/silveralms.com,gustavoguichard/neighborly,jinutm/silverprod,MicroPasts/micropasts-crowdfunding,jinutm/silverprod,MicroPasts/micropasts-crowdfunding,raksonibs/raimcrowd,rockkhuya/taydantay,jinutm/silvfinal,jinutm/silverpro,MicroPasts/micropasts-crowdfunding,MicroPasts/micropasts-crowdfunding,jinutm/silveralms.com,gustavoguichard/neighborly,jinutm/silvfinal,jinutm/silvfinal,jinutm/silverpro,raksonibs/raimcrowd,jinutm/silverprod,jinutm/silverclass,jinutm/silverme
ruby
## Code Before: SimpleForm.setup do |config| config.wrappers :foundation, class: :input, hint_class: :field_with_hint, error_class: :error do |b| b.use :html5 b.use :placeholder b.optional :maxlength b.optional :pattern b.optional :min_max b.optional :readonly b.use :label_input b.use :error, wrap_with: { tag: :small } # Uncomment the following line to enable hints. The line is commented out by default since Foundation # does't provide styles for hints. You will need to provide your own CSS styles for hints. # b.use :hint, wrap_with: { tag: :span, class: :hint } end # CSS class for buttons config.button_class = 'button' # CSS class to add for error notification helper. config.error_notification_class = 'alert-box alert' # The default wrapper to be used by the FormBuilder. config.default_wrapper = :foundation end ## Instruction: Configure simple_form to use error class for inputs with error ## Code After: SimpleForm.setup do |config| config.wrappers :foundation, class: :input, hint_class: :field_with_hint, error_class: :error do |b| b.use :html5 b.use :placeholder b.optional :maxlength b.optional :pattern b.optional :min_max b.optional :readonly b.use :label_input b.use :error, wrap_with: { tag: :small, class: 'error' } # Uncomment the following line to enable hints. The line is commented out by default since Foundation # does't provide styles for hints. You will need to provide your own CSS styles for hints. # b.use :hint, wrap_with: { tag: :span, class: :hint } end # CSS class for buttons config.button_class = 'button' # CSS class to add for error notification helper. config.error_notification_class = 'alert-box alert' # The default wrapper to be used by the FormBuilder. config.default_wrapper = :foundation end
SimpleForm.setup do |config| config.wrappers :foundation, class: :input, hint_class: :field_with_hint, error_class: :error do |b| b.use :html5 b.use :placeholder b.optional :maxlength b.optional :pattern b.optional :min_max b.optional :readonly b.use :label_input - b.use :error, wrap_with: { tag: :small } + b.use :error, wrap_with: { tag: :small, class: 'error' } ? ++++++++++++++++ # Uncomment the following line to enable hints. The line is commented out by default since Foundation # does't provide styles for hints. You will need to provide your own CSS styles for hints. # b.use :hint, wrap_with: { tag: :span, class: :hint } end # CSS class for buttons config.button_class = 'button' # CSS class to add for error notification helper. config.error_notification_class = 'alert-box alert' # The default wrapper to be used by the FormBuilder. config.default_wrapper = :foundation end
2
0.08
1
1
09bb2260900a4ad37d2d3e7599a6101e51063aea
requirements/default.txt
requirements/default.txt
Django<1.9,>=1.7 FeinCMS==1.11.1 django-extensions==1.5.9 djangorestframework>=3.0.0 django-floppyforms==1.5.1 django-crispy-forms==1.4.0 django_compressor==1.5 Django-Select2==5.2.0 docutils==0.12 django-pyscss>=1.0.3 django-filer==0.9.11 django-markupfield>=1.3.4 django-haystack==2.3.1 sorl-thumbnail==12.2 easy-thumbnails==2.2 leonardo-system>=0.0.8 leonardo-admin>=2015.10.0 horizon-contrib>=2015.10.4 leonardo_horizon==2015.3 leonardo_dbtemplates>=1.0.0a0 leonardo_constance>=1.0.0a1 leonardo-sitestarter>=1.0.0a2 leonardo-ckeditor>=1.0.0a1 django-picklefield==0.3.1 -r extras/static.txt
pbr>=0.11,<2.0 Django<1.9,>=1.7 FeinCMS==1.11.1 django-extensions==1.5.9 djangorestframework>=3.0.0 django-floppyforms==1.5.1 django-crispy-forms==1.4.0 django_compressor==1.5 Django-Select2==5.2.0 docutils==0.12 django-pyscss>=1.0.3 django-filer==0.9.11 django-markupfield>=1.3.4 django-haystack==2.3.1 sorl-thumbnail==12.2 easy-thumbnails==2.2 leonardo-system>=0.0.8 leonardo-admin>=2015.10.0 horizon-contrib>=2015.10.4 leonardo_horizon==2015.3 leonardo_dbtemplates>=1.0.0a0 leonardo_constance>=1.0.0a1 leonardo-sitestarter>=1.0.0a2 leonardo-ckeditor>=1.0.0a1 django-picklefield==0.3.1 -r extras/static.txt
Add pbr depndency. Which is included only in setup.py
Add pbr depndency. Which is included only in setup.py
Text
bsd-3-clause
django-leonardo/django-leonardo,django-leonardo/django-leonardo,django-leonardo/django-leonardo,django-leonardo/django-leonardo
text
## Code Before: Django<1.9,>=1.7 FeinCMS==1.11.1 django-extensions==1.5.9 djangorestframework>=3.0.0 django-floppyforms==1.5.1 django-crispy-forms==1.4.0 django_compressor==1.5 Django-Select2==5.2.0 docutils==0.12 django-pyscss>=1.0.3 django-filer==0.9.11 django-markupfield>=1.3.4 django-haystack==2.3.1 sorl-thumbnail==12.2 easy-thumbnails==2.2 leonardo-system>=0.0.8 leonardo-admin>=2015.10.0 horizon-contrib>=2015.10.4 leonardo_horizon==2015.3 leonardo_dbtemplates>=1.0.0a0 leonardo_constance>=1.0.0a1 leonardo-sitestarter>=1.0.0a2 leonardo-ckeditor>=1.0.0a1 django-picklefield==0.3.1 -r extras/static.txt ## Instruction: Add pbr depndency. Which is included only in setup.py ## Code After: pbr>=0.11,<2.0 Django<1.9,>=1.7 FeinCMS==1.11.1 django-extensions==1.5.9 djangorestframework>=3.0.0 django-floppyforms==1.5.1 django-crispy-forms==1.4.0 django_compressor==1.5 Django-Select2==5.2.0 docutils==0.12 django-pyscss>=1.0.3 django-filer==0.9.11 django-markupfield>=1.3.4 django-haystack==2.3.1 sorl-thumbnail==12.2 easy-thumbnails==2.2 leonardo-system>=0.0.8 leonardo-admin>=2015.10.0 horizon-contrib>=2015.10.4 leonardo_horizon==2015.3 leonardo_dbtemplates>=1.0.0a0 leonardo_constance>=1.0.0a1 leonardo-sitestarter>=1.0.0a2 leonardo-ckeditor>=1.0.0a1 django-picklefield==0.3.1 -r extras/static.txt
+ pbr>=0.11,<2.0 Django<1.9,>=1.7 FeinCMS==1.11.1 django-extensions==1.5.9 djangorestframework>=3.0.0 django-floppyforms==1.5.1 django-crispy-forms==1.4.0 django_compressor==1.5 Django-Select2==5.2.0 docutils==0.12 django-pyscss>=1.0.3 django-filer==0.9.11 django-markupfield>=1.3.4 django-haystack==2.3.1 sorl-thumbnail==12.2 easy-thumbnails==2.2 leonardo-system>=0.0.8 leonardo-admin>=2015.10.0 horizon-contrib>=2015.10.4 leonardo_horizon==2015.3 leonardo_dbtemplates>=1.0.0a0 leonardo_constance>=1.0.0a1 leonardo-sitestarter>=1.0.0a2 leonardo-ckeditor>=1.0.0a1 django-picklefield==0.3.1 -r extras/static.txt
1
0.032258
1
0
2117f8085ed865a5c726ea0e136f2d266d996e20
xroad-catalog-lister/build_rpm.sh
xroad-catalog-lister/build_rpm.sh
gradle build cd packages/xroad-catalog-lister/redhat rpmbuild --define "_topdir `pwd`" -ba SPECS/xroad-catalog-lister.spec
cd packages/xroad-catalog-lister/redhat rpmbuild --define "_topdir `pwd`" -ba SPECS/xroad-catalog-lister.spec
Remove gradle build from rpm build script
Remove gradle build from rpm build script
Shell
mit
vrk-kpa/xroad-catalog,vrk-kpa/xroad-catalog
shell
## Code Before: gradle build cd packages/xroad-catalog-lister/redhat rpmbuild --define "_topdir `pwd`" -ba SPECS/xroad-catalog-lister.spec ## Instruction: Remove gradle build from rpm build script ## Code After: cd packages/xroad-catalog-lister/redhat rpmbuild --define "_topdir `pwd`" -ba SPECS/xroad-catalog-lister.spec
- - gradle build cd packages/xroad-catalog-lister/redhat rpmbuild --define "_topdir `pwd`" -ba SPECS/xroad-catalog-lister.spec
2
0.4
0
2
ea707a1bc78b58f1b2a3776180440bd984f48d89
site-cookbooks/themis/templates/default/nginx.conf.erb
site-cookbooks/themis/templates/default/nginx.conf.erb
upstream app { server 127.0.0.1:3000; } server { listen 80 default; access_log <%= node.themis.basedir %>/logs/nginx_access.log; error_log <%= node.themis.basedir %>/logs/nginx_error.log; keepalive_timeout 100; charset utf-8; location / { root <%= node.themis.basedir %>/www; index index.html; } location /api/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://app/; proxy_redirect off; proxy_http_version 1.1; chunked_transfer_encoding off; proxy_buffering off; proxy_cache off; } }
upstream app { server 127.0.0.1:3000; } server { listen 80 default; access_log <%= node.themis.basedir %>/logs/nginx_access.log; error_log <%= node.themis.basedir %>/logs/nginx_error.log; keepalive_timeout 100; charset utf-8; location / { root <%= node.themis.basedir %>/www; rewrite ^(.*)$ /index.html break; } location /api/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://app/; proxy_redirect off; proxy_http_version 1.1; chunked_transfer_encoding off; proxy_buffering off; proxy_cache off; } }
Rewrite to one and only HTML file
Rewrite to one and only HTML file
HTML+ERB
mit
aspyatkin/themis-finals-infrastructure,aspyatkin/themis-finals-infrastructure
html+erb
## Code Before: upstream app { server 127.0.0.1:3000; } server { listen 80 default; access_log <%= node.themis.basedir %>/logs/nginx_access.log; error_log <%= node.themis.basedir %>/logs/nginx_error.log; keepalive_timeout 100; charset utf-8; location / { root <%= node.themis.basedir %>/www; index index.html; } location /api/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://app/; proxy_redirect off; proxy_http_version 1.1; chunked_transfer_encoding off; proxy_buffering off; proxy_cache off; } } ## Instruction: Rewrite to one and only HTML file ## Code After: upstream app { server 127.0.0.1:3000; } server { listen 80 default; access_log <%= node.themis.basedir %>/logs/nginx_access.log; error_log <%= node.themis.basedir %>/logs/nginx_error.log; keepalive_timeout 100; charset utf-8; location / { root <%= node.themis.basedir %>/www; rewrite ^(.*)$ /index.html break; } location /api/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://app/; proxy_redirect off; proxy_http_version 1.1; chunked_transfer_encoding off; proxy_buffering off; proxy_cache off; } }
upstream app { server 127.0.0.1:3000; } server { listen 80 default; access_log <%= node.themis.basedir %>/logs/nginx_access.log; error_log <%= node.themis.basedir %>/logs/nginx_error.log; keepalive_timeout 100; charset utf-8; location / { root <%= node.themis.basedir %>/www; - index index.html; + rewrite ^(.*)$ /index.html break; } location /api/ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://app/; proxy_redirect off; proxy_http_version 1.1; chunked_transfer_encoding off; proxy_buffering off; proxy_cache off; } }
2
0.060606
1
1
15c8215415d36da4fac9c7333e62239f7b81c12d
test/support/mock_definitions.py
test/support/mock_definitions.py
class MockDefinitions(object): def __init__(self, session_key=None): self.session_key = session_key if session_key is not None else '123456789' @property def metadata(self): host = os.getenv('SPLUNK_API_HOST', 'localhost') port = os.getenv('SPLUNK_API_PORT', 8089), return {'server_uri': 'https://{host}:{port}/', 'session_key': self.session_key, 'name': 'amp4e_events_test_input'}
import os # Generates validation/input definitions as if they were created by splunk for tests class MockDefinitions(object): def __init__(self, session_key=None): self.session_key = session_key if session_key is not None else '123456789' @property def metadata(self): host = os.getenv('SPLUNK_API_HOST', '127.0.0.1') return {'server_uri': 'https://{host}:8089/'.format(host=host), 'session_key': self.session_key, 'name': 'amp4e_events_test_input'}
Change mock to be env dependant
Change mock to be env dependant
Python
bsd-2-clause
Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input,Cisco-AMP/amp4e_splunk_events_input
python
## Code Before: class MockDefinitions(object): def __init__(self, session_key=None): self.session_key = session_key if session_key is not None else '123456789' @property def metadata(self): host = os.getenv('SPLUNK_API_HOST', 'localhost') port = os.getenv('SPLUNK_API_PORT', 8089), return {'server_uri': 'https://{host}:{port}/', 'session_key': self.session_key, 'name': 'amp4e_events_test_input'} ## Instruction: Change mock to be env dependant ## Code After: import os # Generates validation/input definitions as if they were created by splunk for tests class MockDefinitions(object): def __init__(self, session_key=None): self.session_key = session_key if session_key is not None else '123456789' @property def metadata(self): host = os.getenv('SPLUNK_API_HOST', '127.0.0.1') return {'server_uri': 'https://{host}:8089/'.format(host=host), 'session_key': self.session_key, 'name': 'amp4e_events_test_input'}
+ import os + # Generates validation/input definitions as if they were created by splunk for tests class MockDefinitions(object): def __init__(self, session_key=None): self.session_key = session_key if session_key is not None else '123456789' @property def metadata(self): - host = os.getenv('SPLUNK_API_HOST', 'localhost') ? ^^^^^^^^^ + host = os.getenv('SPLUNK_API_HOST', '127.0.0.1') ? ^^^^^^^^^ - port = os.getenv('SPLUNK_API_PORT', 8089), - return {'server_uri': 'https://{host}:{port}/', 'session_key': self.session_key, ? ^^ ^^^ + return {'server_uri': 'https://{host}:8089/'.format(host=host), 'session_key': self.session_key, ? ^^^^^^^^ ++ ^^^^^^^^^^^ 'name': 'amp4e_events_test_input'}
7
0.7
4
3
cd258c5f5a26758646890dabe81a7ca62fafdcc4
routes/index.js
routes/index.js
/* * GET home page. */ exports.index = function(req, res){ res.render('index', { title: 'IndieWebCamp IRC Atom Feed' }); }; exports.atom = function(req, res){ res.render('atom'); }; exports.htmltest =function(req,res) { res.render('htmltest', { title: 'HTML output test' }); };
/* * GET home page. */ exports.index = function(req, res){ res.render('index', { title: 'IndieWebCamp IRC Atom Feed' }); }; exports.atom = function(req, res){ res.contentType('application/atom+xml'); res.render('atom'); }; exports.htmltest =function(req,res) { res.render('htmltest', { title: 'HTML output test' }); };
Set content type to application/atom+xml
Set content type to application/atom+xml
JavaScript
mit
bcomnes/iwc-log-feed
javascript
## Code Before: /* * GET home page. */ exports.index = function(req, res){ res.render('index', { title: 'IndieWebCamp IRC Atom Feed' }); }; exports.atom = function(req, res){ res.render('atom'); }; exports.htmltest =function(req,res) { res.render('htmltest', { title: 'HTML output test' }); }; ## Instruction: Set content type to application/atom+xml ## Code After: /* * GET home page. */ exports.index = function(req, res){ res.render('index', { title: 'IndieWebCamp IRC Atom Feed' }); }; exports.atom = function(req, res){ res.contentType('application/atom+xml'); res.render('atom'); }; exports.htmltest =function(req,res) { res.render('htmltest', { title: 'HTML output test' }); };
/* * GET home page. */ exports.index = function(req, res){ res.render('index', { title: 'IndieWebCamp IRC Atom Feed' }); }; exports.atom = function(req, res){ + res.contentType('application/atom+xml'); res.render('atom'); }; exports.htmltest =function(req,res) { res.render('htmltest', { title: 'HTML output test' }); };
1
0.0625
1
0
db24629b7cc34f9a137c6bc5569dc7a39245fa52
thinglang/compiler/sentinels.py
thinglang/compiler/sentinels.py
from thinglang.compiler.opcodes import MEMBERS, METHODS, FRAME_SIZE, ARGUMENTS from thinglang.compiler.opcodes import Opcode class SentinelThingDefinition(Opcode): """ Signifies the start of thing definition """ ARGS = MEMBERS, METHODS class SentinelMethodDefinition(Opcode): """ Signifies a method definition boundary. """ ARGS = FRAME_SIZE, ARGUMENTS class SentinelMethodEnd(Opcode): """ Signifies a method boundary. """ pass class SentinelCodeEnd(Opcode): """ Signifies the code section boundary. """ pass class SentinelDataEnd(Opcode): """ Signifies the code section boundary. """ pass
from thinglang.compiler.opcodes import MEMBERS, METHODS, FRAME_SIZE, ARGUMENTS from thinglang.compiler.opcodes import Opcode class SentinelImportTableEntry(Opcode): """ Signifies an import table entry """ class SentinelImportTableEnd(Opcode): """ Signifies the end of the import table """ class SentinelThingDefinition(Opcode): """ Signifies the start of thing definition """ ARGS = MEMBERS, METHODS class SentinelMethodDefinition(Opcode): """ Signifies a method definition boundary. """ ARGS = FRAME_SIZE, ARGUMENTS class SentinelMethodEnd(Opcode): """ Signifies a method boundary. """ pass class SentinelCodeEnd(Opcode): """ Signifies the code section boundary. """ pass class SentinelDataEnd(Opcode): """ Signifies the code section boundary. """ pass
Add serialization sentintels for import table
Add serialization sentintels for import table
Python
mit
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
python
## Code Before: from thinglang.compiler.opcodes import MEMBERS, METHODS, FRAME_SIZE, ARGUMENTS from thinglang.compiler.opcodes import Opcode class SentinelThingDefinition(Opcode): """ Signifies the start of thing definition """ ARGS = MEMBERS, METHODS class SentinelMethodDefinition(Opcode): """ Signifies a method definition boundary. """ ARGS = FRAME_SIZE, ARGUMENTS class SentinelMethodEnd(Opcode): """ Signifies a method boundary. """ pass class SentinelCodeEnd(Opcode): """ Signifies the code section boundary. """ pass class SentinelDataEnd(Opcode): """ Signifies the code section boundary. """ pass ## Instruction: Add serialization sentintels for import table ## Code After: from thinglang.compiler.opcodes import MEMBERS, METHODS, FRAME_SIZE, ARGUMENTS from thinglang.compiler.opcodes import Opcode class SentinelImportTableEntry(Opcode): """ Signifies an import table entry """ class SentinelImportTableEnd(Opcode): """ Signifies the end of the import table """ class SentinelThingDefinition(Opcode): """ Signifies the start of thing definition """ ARGS = MEMBERS, METHODS class SentinelMethodDefinition(Opcode): """ Signifies a method definition boundary. """ ARGS = FRAME_SIZE, ARGUMENTS class SentinelMethodEnd(Opcode): """ Signifies a method boundary. """ pass class SentinelCodeEnd(Opcode): """ Signifies the code section boundary. """ pass class SentinelDataEnd(Opcode): """ Signifies the code section boundary. """ pass
from thinglang.compiler.opcodes import MEMBERS, METHODS, FRAME_SIZE, ARGUMENTS from thinglang.compiler.opcodes import Opcode + + + class SentinelImportTableEntry(Opcode): + """ + Signifies an import table entry + """ + + + class SentinelImportTableEnd(Opcode): + """ + Signifies the end of the import table + """ class SentinelThingDefinition(Opcode): """ Signifies the start of thing definition """ ARGS = MEMBERS, METHODS class SentinelMethodDefinition(Opcode): """ Signifies a method definition boundary. """ ARGS = FRAME_SIZE, ARGUMENTS class SentinelMethodEnd(Opcode): """ Signifies a method boundary. """ pass class SentinelCodeEnd(Opcode): """ Signifies the code section boundary. """ pass class SentinelDataEnd(Opcode): """ Signifies the code section boundary. """ pass
12
0.324324
12
0
1d43f9ecebd6d7775074cc22d550247f07f3f558
tests/TypeJugglingTest.php
tests/TypeJugglingTest.php
<?php class TypeJugglingTest extends PHPUnit_Framework_TestCase { public function testFromFalseOrNullToArray() { foreach (array(false, null) as $testValue) { $var = $testValue; $var['foo'] = 10; $this->assertEquals('array', gettype($var)); } } /** * @expectedException PHPUnit_Framework_Error_Warning * @expectedExceptionMessage Creating default object from empty value */ public function testFromFalseToObject() { $var = false; $var->name = 'bob'; } /** * @expectedException PHPUnit_Framework_Error_Warning * @expectedExceptionMessage Cannot use a scalar value as an array */ public function testFromTrueToArray() { $var = true; $var['foo'] = 10; $this->assertEquals('array', gettype($var)); } /** * @expectedException PHPUnit_Framework_Error_Warning */ public function testFromStringToArray() { $this->markTestSkipped('This crash my PHP cli'); $var = '2.5'; $var['foo'] = 10; } }
<?php class TypeJugglingTest extends PHPUnit_Framework_TestCase { public function testFromFalseOrNullToArray() { foreach (array(false, null) as $testValue) { $var = $testValue; $var['foo'] = 10; $this->assertEquals('array', gettype($var)); } } /** * @expectedException PHPUnit_Framework_Error_Warning * @expectedExceptionMessage Creating default object from empty value */ public function testFromFalseToObject() { $var = false; $var->name = 'bob'; } /** * @expectedException PHPUnit_Framework_Error_Warning * @expectedExceptionMessage Cannot use a scalar value as an array */ public function testFromTrueToArray() { $var = true; $var['foo'] = 10; $this->assertEquals('array', gettype($var)); } /** * @expectedException PHPUnit_Framework_Error_Warning */ public function testFromStringToArray() { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $this->markTestSkipped('This crash my PHP cli'); return; } $var = '2.5'; $var['foo'] = 10; } }
Remove skip in type juggling.
Remove skip in type juggling.
PHP
unlicense
4d47/php-learning-experience
php
## Code Before: <?php class TypeJugglingTest extends PHPUnit_Framework_TestCase { public function testFromFalseOrNullToArray() { foreach (array(false, null) as $testValue) { $var = $testValue; $var['foo'] = 10; $this->assertEquals('array', gettype($var)); } } /** * @expectedException PHPUnit_Framework_Error_Warning * @expectedExceptionMessage Creating default object from empty value */ public function testFromFalseToObject() { $var = false; $var->name = 'bob'; } /** * @expectedException PHPUnit_Framework_Error_Warning * @expectedExceptionMessage Cannot use a scalar value as an array */ public function testFromTrueToArray() { $var = true; $var['foo'] = 10; $this->assertEquals('array', gettype($var)); } /** * @expectedException PHPUnit_Framework_Error_Warning */ public function testFromStringToArray() { $this->markTestSkipped('This crash my PHP cli'); $var = '2.5'; $var['foo'] = 10; } } ## Instruction: Remove skip in type juggling. ## Code After: <?php class TypeJugglingTest extends PHPUnit_Framework_TestCase { public function testFromFalseOrNullToArray() { foreach (array(false, null) as $testValue) { $var = $testValue; $var['foo'] = 10; $this->assertEquals('array', gettype($var)); } } /** * @expectedException PHPUnit_Framework_Error_Warning * @expectedExceptionMessage Creating default object from empty value */ public function testFromFalseToObject() { $var = false; $var->name = 'bob'; } /** * @expectedException PHPUnit_Framework_Error_Warning * @expectedExceptionMessage Cannot use a scalar value as an array */ public function testFromTrueToArray() { $var = true; $var['foo'] = 10; $this->assertEquals('array', gettype($var)); } /** * @expectedException PHPUnit_Framework_Error_Warning */ public function testFromStringToArray() { if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $this->markTestSkipped('This crash my PHP cli'); return; } $var = '2.5'; $var['foo'] = 10; } }
<?php class TypeJugglingTest extends PHPUnit_Framework_TestCase { public function testFromFalseOrNullToArray() { foreach (array(false, null) as $testValue) { $var = $testValue; $var['foo'] = 10; $this->assertEquals('array', gettype($var)); } } /** * @expectedException PHPUnit_Framework_Error_Warning * @expectedExceptionMessage Creating default object from empty value */ public function testFromFalseToObject() { $var = false; $var->name = 'bob'; } /** * @expectedException PHPUnit_Framework_Error_Warning * @expectedExceptionMessage Cannot use a scalar value as an array */ public function testFromTrueToArray() { $var = true; $var['foo'] = 10; $this->assertEquals('array', gettype($var)); } /** * @expectedException PHPUnit_Framework_Error_Warning */ public function testFromStringToArray() { + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $this->markTestSkipped('This crash my PHP cli'); + $this->markTestSkipped('This crash my PHP cli'); ? ++++ + return; + } $var = '2.5'; $var['foo'] = 10; } }
5
0.113636
4
1
23043bd2b81aa3ee281b7b64cdeeafe1407a0b49
docs/manual/webapi/2.0/resources/muted-review-request.rst
docs/manual/webapi/2.0/resources/muted-review-request.rst
.. webapi-resource:: :classname: reviewboard.webapi.resources.archived_review_request.ArchivedReviewRequestResource :hide-links: :hide-examples:
.. webapi-resource:: :classname: reviewboard.webapi.resources.muted_review_request.MutedReviewRequestResource :hide-links: :hide-examples:
Fix references to the muted review request resource.
Fix references to the muted review request resource. Trivial copy-o fix.
reStructuredText
mit
chipx86/reviewboard,KnowNo/reviewboard,sgallagher/reviewboard,sgallagher/reviewboard,beol/reviewboard,chipx86/reviewboard,beol/reviewboard,beol/reviewboard,reviewboard/reviewboard,custode/reviewboard,bkochendorfer/reviewboard,sgallagher/reviewboard,custode/reviewboard,davidt/reviewboard,brennie/reviewboard,chipx86/reviewboard,bkochendorfer/reviewboard,beol/reviewboard,brennie/reviewboard,reviewboard/reviewboard,custode/reviewboard,davidt/reviewboard,davidt/reviewboard,bkochendorfer/reviewboard,bkochendorfer/reviewboard,davidt/reviewboard,brennie/reviewboard,custode/reviewboard,reviewboard/reviewboard,sgallagher/reviewboard,brennie/reviewboard,chipx86/reviewboard,KnowNo/reviewboard,KnowNo/reviewboard,reviewboard/reviewboard,KnowNo/reviewboard
restructuredtext
## Code Before: .. webapi-resource:: :classname: reviewboard.webapi.resources.archived_review_request.ArchivedReviewRequestResource :hide-links: :hide-examples: ## Instruction: Fix references to the muted review request resource. Trivial copy-o fix. ## Code After: .. webapi-resource:: :classname: reviewboard.webapi.resources.muted_review_request.MutedReviewRequestResource :hide-links: :hide-examples:
.. webapi-resource:: - :classname: reviewboard.webapi.resources.archived_review_request.ArchivedReviewRequestResource ? ^^^^^^ ^^^^^^ + :classname: reviewboard.webapi.resources.muted_review_request.MutedReviewRequestResource ? ^^^ ^^^ :hide-links: :hide-examples:
2
0.5
1
1
3767de8f1e908033cc1e9fed7abb5ba0a9961008
ee-feature-pack/galleon-common/src/main/resources/layers/standalone/datasources-web-server/layer-spec.xml
ee-feature-pack/galleon-common/src/main/resources/layers/standalone/datasources-web-server/layer-spec.xml
<?xml version="1.0" ?> <layer-spec xmlns="urn:jboss:galleon:layer-spec:1.0" name="datasources-web-server"> <dependencies> <layer name="web-server"/> <layer name="core-server"/> <layer name="core-tools"/> <layer name="datasources" optional="true"/> </dependencies> <feature-group name="undertow-elytron-security"/> <packages> <!-- Support for installing legacy one-off patches --> <package name="org.jboss.as.patching.cli" optional="true"/> </packages> </layer-spec>
<?xml version="1.0" ?> <layer-spec xmlns="urn:jboss:galleon:layer-spec:1.0" name="datasources-web-server"> <dependencies> <layer name="web-server"/> <layer name="core-server"/> <layer name="core-tools" optional="true"/> <layer name="datasources" optional="true"/> </dependencies> <feature-group name="undertow-elytron-security"/> <packages> <!-- Support for installing legacy one-off patches --> <package name="org.jboss.as.patching.cli" optional="true"/> </packages> </layer-spec>
Fix for WFLY-13815, Make core-tools optional in datasources-web-server layer
Fix for WFLY-13815, Make core-tools optional in datasources-web-server layer
XML
lgpl-2.1
jstourac/wildfly,wildfly/wildfly,pferraro/wildfly,iweiss/wildfly,iweiss/wildfly,wildfly/wildfly,iweiss/wildfly,pferraro/wildfly,pferraro/wildfly,rhusar/wildfly,wildfly/wildfly,iweiss/wildfly,rhusar/wildfly,rhusar/wildfly,pferraro/wildfly,rhusar/wildfly,jstourac/wildfly,wildfly/wildfly,jstourac/wildfly,jstourac/wildfly
xml
## Code Before: <?xml version="1.0" ?> <layer-spec xmlns="urn:jboss:galleon:layer-spec:1.0" name="datasources-web-server"> <dependencies> <layer name="web-server"/> <layer name="core-server"/> <layer name="core-tools"/> <layer name="datasources" optional="true"/> </dependencies> <feature-group name="undertow-elytron-security"/> <packages> <!-- Support for installing legacy one-off patches --> <package name="org.jboss.as.patching.cli" optional="true"/> </packages> </layer-spec> ## Instruction: Fix for WFLY-13815, Make core-tools optional in datasources-web-server layer ## Code After: <?xml version="1.0" ?> <layer-spec xmlns="urn:jboss:galleon:layer-spec:1.0" name="datasources-web-server"> <dependencies> <layer name="web-server"/> <layer name="core-server"/> <layer name="core-tools" optional="true"/> <layer name="datasources" optional="true"/> </dependencies> <feature-group name="undertow-elytron-security"/> <packages> <!-- Support for installing legacy one-off patches --> <package name="org.jboss.as.patching.cli" optional="true"/> </packages> </layer-spec>
<?xml version="1.0" ?> <layer-spec xmlns="urn:jboss:galleon:layer-spec:1.0" name="datasources-web-server"> <dependencies> <layer name="web-server"/> <layer name="core-server"/> - <layer name="core-tools"/> + <layer name="core-tools" optional="true"/> ? ++++++++++++++++ <layer name="datasources" optional="true"/> </dependencies> <feature-group name="undertow-elytron-security"/> <packages> <!-- Support for installing legacy one-off patches --> <package name="org.jboss.as.patching.cli" optional="true"/> </packages> </layer-spec>
2
0.142857
1
1
efa2d61d61a744d216d4ea3c35450783952f5d7e
bottomsheet-commons/src/main/java/com/flipboard/bottomsheet/commons/SquareImageView.java
bottomsheet-commons/src/main/java/com/flipboard/bottomsheet/commons/SquareImageView.java
package com.flipboard.bottomsheet.commons; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.util.AttributeSet; import android.widget.ImageView; /** * An ImageView that keeps a 1:1 aspect ratio */ final class SquareImageView extends ImageView { public SquareImageView(Context context) { super(context); } public SquareImageView(Context context, AttributeSet attrs) { super(context, attrs); } public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); } @SuppressWarnings("SuspiciousNameCombination") @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, widthMeasureSpec); } }
package com.flipboard.bottomsheet.commons; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.util.AttributeSet; import android.widget.ImageView; /** * An ImageView that keeps a 1:1 aspect ratio */ final class SquareImageView extends ImageView { public SquareImageView(Context context) { super(context); } public SquareImageView(Context context, AttributeSet attrs) { super(context, attrs); } public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); } @SuppressWarnings("UnnecessaryLocalVariable") @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int bothDimensionsSpec = widthMeasureSpec; super.onMeasure(bothDimensionsSpec, bothDimensionsSpec); } }
Use more accurate name for clarity in measuring
Use more accurate name for clarity in measuring
Java
bsd-3-clause
bernaferrari/bottomsheet,nissiy/bottomsheet,Learn-Android-app/bottomsheet,MaTriXy/bottomsheet,jiangzhonghui/bottomsheet,AKiniyalocts/bottomsheet,eric-sofisoftwarellc/bottomsheet-1,Flipboard/bottomsheet,newmanicspree/bottomsheet,jaohoang/bottomsheet-1
java
## Code Before: package com.flipboard.bottomsheet.commons; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.util.AttributeSet; import android.widget.ImageView; /** * An ImageView that keeps a 1:1 aspect ratio */ final class SquareImageView extends ImageView { public SquareImageView(Context context) { super(context); } public SquareImageView(Context context, AttributeSet attrs) { super(context, attrs); } public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); } @SuppressWarnings("SuspiciousNameCombination") @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(widthMeasureSpec, widthMeasureSpec); } } ## Instruction: Use more accurate name for clarity in measuring ## Code After: package com.flipboard.bottomsheet.commons; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.util.AttributeSet; import android.widget.ImageView; /** * An ImageView that keeps a 1:1 aspect ratio */ final class SquareImageView extends ImageView { public SquareImageView(Context context) { super(context); } public SquareImageView(Context context, AttributeSet attrs) { super(context, attrs); } public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); } @SuppressWarnings("UnnecessaryLocalVariable") @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int bothDimensionsSpec = widthMeasureSpec; super.onMeasure(bothDimensionsSpec, bothDimensionsSpec); } }
package com.flipboard.bottomsheet.commons; import android.annotation.TargetApi; import android.content.Context; import android.os.Build; import android.util.AttributeSet; import android.widget.ImageView; /** * An ImageView that keeps a 1:1 aspect ratio */ final class SquareImageView extends ImageView { public SquareImageView(Context context) { super(context); } public SquareImageView(Context context, AttributeSet attrs) { super(context, attrs); } public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @TargetApi(Build.VERSION_CODES.LOLLIPOP) public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { super(context, attrs, defStyleAttr, defStyleRes); } - @SuppressWarnings("SuspiciousNameCombination") + @SuppressWarnings("UnnecessaryLocalVariable") @Override public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, widthMeasureSpec); + int bothDimensionsSpec = widthMeasureSpec; + super.onMeasure(bothDimensionsSpec, bothDimensionsSpec); } }
5
0.142857
3
2
213813baf2c1651c916ef32feab4c00ccf2ec895
py/pyobject.go
py/pyobject.go
package py /* #include "Python.h" */ import "C" import ( "runtime" ) // Object is a bind of `*C.PyObject` type Object struct { p *C.PyObject } // DecRef decrease reference counter of `C.PyObject` // This function is public for API users and // it acquires GIL of Python interpreter. func (o *Object) DecRef() { ch := make(chan bool, 1) go func() { runtime.LockOSThread() state := GILState_Ensure() defer GILState_Release(state) C.Py_DecRef(o.p) ch <- true }() <-ch } // decRef decrease reference counter of `C.PyObject` // This function doesn't acquire GIL. func (o *Object) decRef() { C.Py_DecRef(o.p) }
package py /* #include "Python.h" void XDecRef(PyObject *o) { Py_XDECREF(o); } */ import "C" import ( "runtime" ) // Object is a bind of `*C.PyObject` type Object struct { p *C.PyObject } // DecRef decrease reference counter of `C.PyObject` // This function is public for API users and // it acquires GIL of Python interpreter. // User can call whenever target object is null. func (o *Object) DecRef() { ch := make(chan bool, 1) go func() { runtime.LockOSThread() state := GILState_Ensure() defer GILState_Release(state) C.XDecRef(o.p) ch <- true }() <-ch } // decRef decrease reference counter of `C.PyObject` // This function doesn't acquire GIL. func (o *Object) decRef() { C.Py_DecRef(o.p) }
Use Py_XDECREF instaed of Py_DecRef in DecRef
Use Py_XDECREF instaed of Py_DecRef in DecRef
Go
mit
sensorbee/py,sensorbee/py
go
## Code Before: package py /* #include "Python.h" */ import "C" import ( "runtime" ) // Object is a bind of `*C.PyObject` type Object struct { p *C.PyObject } // DecRef decrease reference counter of `C.PyObject` // This function is public for API users and // it acquires GIL of Python interpreter. func (o *Object) DecRef() { ch := make(chan bool, 1) go func() { runtime.LockOSThread() state := GILState_Ensure() defer GILState_Release(state) C.Py_DecRef(o.p) ch <- true }() <-ch } // decRef decrease reference counter of `C.PyObject` // This function doesn't acquire GIL. func (o *Object) decRef() { C.Py_DecRef(o.p) } ## Instruction: Use Py_XDECREF instaed of Py_DecRef in DecRef ## Code After: package py /* #include "Python.h" void XDecRef(PyObject *o) { Py_XDECREF(o); } */ import "C" import ( "runtime" ) // Object is a bind of `*C.PyObject` type Object struct { p *C.PyObject } // DecRef decrease reference counter of `C.PyObject` // This function is public for API users and // it acquires GIL of Python interpreter. // User can call whenever target object is null. func (o *Object) DecRef() { ch := make(chan bool, 1) go func() { runtime.LockOSThread() state := GILState_Ensure() defer GILState_Release(state) C.XDecRef(o.p) ch <- true }() <-ch } // decRef decrease reference counter of `C.PyObject` // This function doesn't acquire GIL. func (o *Object) decRef() { C.Py_DecRef(o.p) }
package py /* #include "Python.h" + void XDecRef(PyObject *o) { + Py_XDECREF(o); + } */ import "C" import ( "runtime" ) // Object is a bind of `*C.PyObject` type Object struct { p *C.PyObject } // DecRef decrease reference counter of `C.PyObject` // This function is public for API users and // it acquires GIL of Python interpreter. + // User can call whenever target object is null. func (o *Object) DecRef() { ch := make(chan bool, 1) go func() { runtime.LockOSThread() state := GILState_Ensure() defer GILState_Release(state) - C.Py_DecRef(o.p) ? ^^^ + C.XDecRef(o.p) ? ^ ch <- true }() <-ch } // decRef decrease reference counter of `C.PyObject` // This function doesn't acquire GIL. func (o *Object) decRef() { C.Py_DecRef(o.p) }
6
0.166667
5
1
6c226faa4c5901ee7774dec6a776a0b0ec5f90a8
ClojureScript/project.clj
ClojureScript/project.clj
(defproject clik-clak-joe "0.1.0-SNAPSHOT" :description "React Native tic-tac-toe in ClojureScript" :dependencies [[org.clojure/clojure "1.6.0"] [org.clojure/clojurescript "0.0-3153"] [org.omcljs/om "0.9.0-SNAPSHOT"] [org.omcljs/ambly "0.1.0-SNAPSHOT"]] :plugins [[lein-cljsbuild "1.0.5"]] :source-paths ["src"] :clean-targets ["js" "out"] :cljsbuild {:builds {:dev {:source-paths ["src"] :compiler {:output-dir "out" :output-to "out/main.js" :optimizations :none #_:foreign-libs #_[{:provides ["reactnative"] :file "http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle"}]}} :rel {:source-paths ["src"] :compiler {:output-to "out/main.js" :optimizations :advanced :externs ["externs.js"] :pretty-print false :pseudo-names false}}}})
(defproject clik-clak-joe "0.1.0-SNAPSHOT" :description "React Native tic-tac-toe in ClojureScript" :dependencies [[org.clojure/clojure "1.6.0"] [org.clojure/clojurescript "0.0-3153"] [org.omcljs/om "0.8.8"] [org.omcljs/ambly "0.1.0-SNAPSHOT"]] :plugins [[lein-cljsbuild "1.0.5"]] :source-paths ["src"] :clean-targets ["js" "out"] :cljsbuild {:builds {:dev {:source-paths ["src"] :compiler {:output-dir "out" :output-to "out/main.js" :optimizations :none #_:foreign-libs #_[{:provides ["reactnative"] :file "http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle"}]}} :rel {:source-paths ["src"] :compiler {:output-to "out/main.js" :optimizations :advanced :externs ["externs.js"] :pretty-print false :pseudo-names false}}}})
Revert back to unmodified Om
Revert back to unmodified Om
Clojure
epl-1.0
mfikes/clik-clak-joe
clojure
## Code Before: (defproject clik-clak-joe "0.1.0-SNAPSHOT" :description "React Native tic-tac-toe in ClojureScript" :dependencies [[org.clojure/clojure "1.6.0"] [org.clojure/clojurescript "0.0-3153"] [org.omcljs/om "0.9.0-SNAPSHOT"] [org.omcljs/ambly "0.1.0-SNAPSHOT"]] :plugins [[lein-cljsbuild "1.0.5"]] :source-paths ["src"] :clean-targets ["js" "out"] :cljsbuild {:builds {:dev {:source-paths ["src"] :compiler {:output-dir "out" :output-to "out/main.js" :optimizations :none #_:foreign-libs #_[{:provides ["reactnative"] :file "http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle"}]}} :rel {:source-paths ["src"] :compiler {:output-to "out/main.js" :optimizations :advanced :externs ["externs.js"] :pretty-print false :pseudo-names false}}}}) ## Instruction: Revert back to unmodified Om ## Code After: (defproject clik-clak-joe "0.1.0-SNAPSHOT" :description "React Native tic-tac-toe in ClojureScript" :dependencies [[org.clojure/clojure "1.6.0"] [org.clojure/clojurescript "0.0-3153"] [org.omcljs/om "0.8.8"] [org.omcljs/ambly "0.1.0-SNAPSHOT"]] :plugins [[lein-cljsbuild "1.0.5"]] :source-paths ["src"] :clean-targets ["js" "out"] :cljsbuild {:builds {:dev {:source-paths ["src"] :compiler {:output-dir "out" :output-to "out/main.js" :optimizations :none #_:foreign-libs #_[{:provides ["reactnative"] :file "http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle"}]}} :rel {:source-paths ["src"] :compiler {:output-to "out/main.js" :optimizations :advanced :externs ["externs.js"] :pretty-print false :pseudo-names false}}}})
(defproject clik-clak-joe "0.1.0-SNAPSHOT" :description "React Native tic-tac-toe in ClojureScript" :dependencies [[org.clojure/clojure "1.6.0"] [org.clojure/clojurescript "0.0-3153"] - [org.omcljs/om "0.9.0-SNAPSHOT"] ? ^ ^^^^^^^^^^ + [org.omcljs/om "0.8.8"] ? ^ ^ [org.omcljs/ambly "0.1.0-SNAPSHOT"]] :plugins [[lein-cljsbuild "1.0.5"]] :source-paths ["src"] :clean-targets ["js" "out"] :cljsbuild {:builds {:dev {:source-paths ["src"] :compiler {:output-dir "out" :output-to "out/main.js" :optimizations :none #_:foreign-libs #_[{:provides ["reactnative"] :file "http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle"}]}} :rel {:source-paths ["src"] :compiler {:output-to "out/main.js" :optimizations :advanced :externs ["externs.js"] :pretty-print false :pseudo-names false}}}})
2
0.086957
1
1
4483443faa835acae947c7aafc06321c7dd01bc1
pandata.gemspec
pandata.gemspec
gem_path = File.dirname(__FILE__) Gem::Specification.new do |s| s.name = 'pandata' s.version = '0.1.0' s.date = '2013-01-27' s.summary = 'A Pandora web scraper' s.description = 'A tool for downloading Pandora data (likes, bookmarks, stations, etc.)' s.homepage = 'https://github.com/ustasb/pandata' s.authors = ['Brian Ustas'] s.email = 'brianustas@gmail.com' s.files = Dir["#{gem_path}/lib/**/*.rb"] << "#{gem_path}/bin/pandata" s.executables << 'pandata' end
gem_path = File.dirname(__FILE__) Gem::Specification.new do |s| s.name = 'pandata' s.version = '0.1.0.pre' s.date = '2013-02-25' s.summary = 'A Pandora web scraper' s.description = 'A tool for downloading Pandora data (likes, bookmarks, stations, etc.)' s.homepage = 'https://github.com/ustasb/pandata' s.authors = ['Brian Ustas'] s.email = 'brianustas@gmail.com' s.files = Dir["#{gem_path}/lib/**/*.rb"] << "#{gem_path}/bin/pandata" s.executables << 'pandata' s.add_runtime_dependency 'nokogiri', '>= 1.5.6' s.add_development_dependency 'rspec', '>= 2.12.2' end
Add dependencies to gemspec file
Add dependencies to gemspec file
Ruby
mit
ustasb/pandata
ruby
## Code Before: gem_path = File.dirname(__FILE__) Gem::Specification.new do |s| s.name = 'pandata' s.version = '0.1.0' s.date = '2013-01-27' s.summary = 'A Pandora web scraper' s.description = 'A tool for downloading Pandora data (likes, bookmarks, stations, etc.)' s.homepage = 'https://github.com/ustasb/pandata' s.authors = ['Brian Ustas'] s.email = 'brianustas@gmail.com' s.files = Dir["#{gem_path}/lib/**/*.rb"] << "#{gem_path}/bin/pandata" s.executables << 'pandata' end ## Instruction: Add dependencies to gemspec file ## Code After: gem_path = File.dirname(__FILE__) Gem::Specification.new do |s| s.name = 'pandata' s.version = '0.1.0.pre' s.date = '2013-02-25' s.summary = 'A Pandora web scraper' s.description = 'A tool for downloading Pandora data (likes, bookmarks, stations, etc.)' s.homepage = 'https://github.com/ustasb/pandata' s.authors = ['Brian Ustas'] s.email = 'brianustas@gmail.com' s.files = Dir["#{gem_path}/lib/**/*.rb"] << "#{gem_path}/bin/pandata" s.executables << 'pandata' s.add_runtime_dependency 'nokogiri', '>= 1.5.6' s.add_development_dependency 'rspec', '>= 2.12.2' end
gem_path = File.dirname(__FILE__) Gem::Specification.new do |s| - s.name = 'pandata' + s.name = 'pandata' ? ++++++++++++++ - s.version = '0.1.0' + s.version = '0.1.0.pre' ? ++++++++++++++ ++++ - s.date = '2013-01-27' ? ^ ^ + s.date = '2013-02-25' ? ++++++++++++++ ^ ^ - s.summary = 'A Pandora web scraper' + s.summary = 'A Pandora web scraper' ? ++++++++++++++ - s.description = 'A tool for downloading Pandora data (likes, bookmarks, stations, etc.)' + s.description = 'A tool for downloading Pandora data (likes, bookmarks, stations, etc.)' ? ++++++++++++++ - s.homepage = 'https://github.com/ustasb/pandata' + s.homepage = 'https://github.com/ustasb/pandata' ? ++++++++++++++ - s.authors = ['Brian Ustas'] + s.authors = ['Brian Ustas'] ? ++++++++++++++ - s.email = 'brianustas@gmail.com' + s.email = 'brianustas@gmail.com' ? ++++++++++++++ - s.files = Dir["#{gem_path}/lib/**/*.rb"] << "#{gem_path}/bin/pandata" + s.files = Dir["#{gem_path}/lib/**/*.rb"] << "#{gem_path}/bin/pandata" ? ++++++++++++++ - s.executables << 'pandata' + s.executables << 'pandata' ? ++++++++++++++ + s.add_runtime_dependency 'nokogiri', '>= 1.5.6' + s.add_development_dependency 'rspec', '>= 2.12.2' end
22
1.571429
12
10
458b35d82cbe72a1f8d22070c9c032ef186ee4c6
src/navigation/replace.tsx
src/navigation/replace.tsx
import React from "react"; import { domToReact } from "html-react-parser"; import attributesToProps from "html-react-parser/lib/attributes-to-props"; import { HashLink as Link } from "react-router-hash-link"; export function replace(domNode: any) { if (domNode.name && domNode.name === "a") { const { href, ...rest } = domNode.attribs; const props = attributesToProps(rest); if(href && !href.startsWith("http:") && !href.startsWith("https:") && !href.startsWith("mailto:")){ // Local (relative) links pimped with react router navigation return ( <Link to={href} {...props}> {domToReact(domNode.children, { replace })} </Link> ); }else{ // Default behaviour for links to fully qualified URLs } } // !whitelist.includes(domNode.name) && // domNode.type !== "text" && // console.dir(domNode, { depth: null }); } export const whitelist = [ "a", "span", "li", "ul", "div", "i", "br", "img", "input", "form", "nav", "small", ];
import React from "react"; import { domToReact } from "html-react-parser"; import attributesToProps from "html-react-parser/lib/attributes-to-props"; import { HashLink as Link } from "react-router-hash-link"; export function replace(domNode: any) { if (domNode.name && domNode.name === "a") { const { href, ...rest } = domNode.attribs; const props = attributesToProps(rest); if ( href && !href.startsWith("http:") && !href.startsWith("https:") && !href.startsWith("mailto:") && !href.startsWith("//assets.ctfassets.net") ) { // Local (relative) links pimped with react router navigation return ( <Link to={href} {...props}> {domToReact(domNode.children, { replace })} </Link> ); } else { // Default behaviour for links to fully qualified URLs } } // !whitelist.includes(domNode.name) && // domNode.type !== "text" && // console.dir(domNode, { depth: null }); } export const whitelist = [ "a", "span", "li", "ul", "div", "i", "br", "img", "input", "form", "nav", "small", ];
Fix external links for example reports breaking
DS: Fix external links for example reports breaking
TypeScript
apache-2.0
saasquatch/saasquatch-docs,saasquatch/saasquatch-docs,saasquatch/saasquatch-docs
typescript
## Code Before: import React from "react"; import { domToReact } from "html-react-parser"; import attributesToProps from "html-react-parser/lib/attributes-to-props"; import { HashLink as Link } from "react-router-hash-link"; export function replace(domNode: any) { if (domNode.name && domNode.name === "a") { const { href, ...rest } = domNode.attribs; const props = attributesToProps(rest); if(href && !href.startsWith("http:") && !href.startsWith("https:") && !href.startsWith("mailto:")){ // Local (relative) links pimped with react router navigation return ( <Link to={href} {...props}> {domToReact(domNode.children, { replace })} </Link> ); }else{ // Default behaviour for links to fully qualified URLs } } // !whitelist.includes(domNode.name) && // domNode.type !== "text" && // console.dir(domNode, { depth: null }); } export const whitelist = [ "a", "span", "li", "ul", "div", "i", "br", "img", "input", "form", "nav", "small", ]; ## Instruction: DS: Fix external links for example reports breaking ## Code After: import React from "react"; import { domToReact } from "html-react-parser"; import attributesToProps from "html-react-parser/lib/attributes-to-props"; import { HashLink as Link } from "react-router-hash-link"; export function replace(domNode: any) { if (domNode.name && domNode.name === "a") { const { href, ...rest } = domNode.attribs; const props = attributesToProps(rest); if ( href && !href.startsWith("http:") && !href.startsWith("https:") && !href.startsWith("mailto:") && !href.startsWith("//assets.ctfassets.net") ) { // Local (relative) links pimped with react router navigation return ( <Link to={href} {...props}> {domToReact(domNode.children, { replace })} </Link> ); } else { // Default behaviour for links to fully qualified URLs } } // !whitelist.includes(domNode.name) && // domNode.type !== "text" && // console.dir(domNode, { depth: null }); } export const whitelist = [ "a", "span", "li", "ul", "div", "i", "br", "img", "input", "form", "nav", "small", ];
import React from "react"; import { domToReact } from "html-react-parser"; import attributesToProps from "html-react-parser/lib/attributes-to-props"; import { HashLink as Link } from "react-router-hash-link"; export function replace(domNode: any) { if (domNode.name && domNode.name === "a") { const { href, ...rest } = domNode.attribs; const props = attributesToProps(rest); - if(href && !href.startsWith("http:") && !href.startsWith("https:") && !href.startsWith("mailto:")){ + if ( + href && + !href.startsWith("http:") && + !href.startsWith("https:") && + !href.startsWith("mailto:") && + !href.startsWith("//assets.ctfassets.net") + ) { // Local (relative) links pimped with react router navigation return ( <Link to={href} {...props}> {domToReact(domNode.children, { replace })} </Link> - ); ? -- + ); - }else{ + } else { ? + + // Default behaviour for links to fully qualified URLs } } // !whitelist.includes(domNode.name) && // domNode.type !== "text" && // console.dir(domNode, { depth: null }); } export const whitelist = [ "a", "span", "li", "ul", "div", "i", "br", "img", "input", "form", "nav", "small", ];
12
0.3
9
3
cd88a6ad91bd7fd0ecdc03badd7cc09dd63e2873
Casks/intellij-idea-ultimate-eap.rb
Casks/intellij-idea-ultimate-eap.rb
class IntellijIdeaUltimateEap < Cask version '14-PublicPreview' sha256 '4995c98608506c02348b4dfc0507a6a791c9db0ee555916edfe2fef9aa2dc85a' url "http://download.jetbrains.com/idea/ideaIU-#{version}.dmg" homepage 'https://www.jetbrains.com/idea/index.html' license :unknown app 'IntelliJ IDEA 14 EAP.app' end
class IntellijIdeaUltimateEap < Cask version '139.144.2' sha256 '49ef8ac753287031ae3ed604bbfd7a19e46359b318ac581db0a6100fb5ae0beb' url "http://download.jetbrains.com/idea/ideaIU-#{version}.dmg" homepage 'https://confluence.jetbrains.com/display/IDEADEV/IDEA+14+EAP' license :unknown app 'IntelliJ IDEA 14 EAP.app' end
Upgrade IntelliJ ultimate eap to v139.144.2
Upgrade IntelliJ ultimate eap to v139.144.2
Ruby
bsd-2-clause
3van/homebrew-versions,adjohnson916/homebrew-versions,lukasbestle/homebrew-versions,zchee/homebrew-versions,kstarsinic/homebrew-versions,coeligena/homebrew-verscustomized,lukaselmer/homebrew-versions,invl/homebrew-versions,onewheelskyward/homebrew-versions,noamross/homebrew-versions,pquentin/homebrew-versions,tomschlick/homebrew-versions,dictcp/homebrew-versions,chadcatlett/caskroom-homebrew-versions,n8henrie/homebrew-versions,bimmlerd/homebrew-versions,deizel/homebrew-versions,rkJun/homebrew-versions,elovelan/homebrew-versions,nicday/homebrew-versions,zsjohny/homebrew-versions,visualphoenix/homebrew-versions
ruby
## Code Before: class IntellijIdeaUltimateEap < Cask version '14-PublicPreview' sha256 '4995c98608506c02348b4dfc0507a6a791c9db0ee555916edfe2fef9aa2dc85a' url "http://download.jetbrains.com/idea/ideaIU-#{version}.dmg" homepage 'https://www.jetbrains.com/idea/index.html' license :unknown app 'IntelliJ IDEA 14 EAP.app' end ## Instruction: Upgrade IntelliJ ultimate eap to v139.144.2 ## Code After: class IntellijIdeaUltimateEap < Cask version '139.144.2' sha256 '49ef8ac753287031ae3ed604bbfd7a19e46359b318ac581db0a6100fb5ae0beb' url "http://download.jetbrains.com/idea/ideaIU-#{version}.dmg" homepage 'https://confluence.jetbrains.com/display/IDEADEV/IDEA+14+EAP' license :unknown app 'IntelliJ IDEA 14 EAP.app' end
class IntellijIdeaUltimateEap < Cask - version '14-PublicPreview' - sha256 '4995c98608506c02348b4dfc0507a6a791c9db0ee555916edfe2fef9aa2dc85a' + version '139.144.2' + sha256 '49ef8ac753287031ae3ed604bbfd7a19e46359b318ac581db0a6100fb5ae0beb' url "http://download.jetbrains.com/idea/ideaIU-#{version}.dmg" - homepage 'https://www.jetbrains.com/idea/index.html' + homepage 'https://confluence.jetbrains.com/display/IDEADEV/IDEA+14+EAP' license :unknown app 'IntelliJ IDEA 14 EAP.app' end
6
0.6
3
3
c97fd28fcd79b4703fe9386edc2c33aa08a9eb1f
CHANGELOG.md
CHANGELOG.md
Changelog ========= ## x.y.z - UNRELEASED -------- ## 0.2.0 - 2015-05-20 ### Added * [TextToSpeech] getFile() method to cache webservice calls. * [TextToSpeech] save() method to store the audio on the local filesystem. -------- ## 0.1.0 - 2015-05-19 ### Added * [Providers] Google provider. * [Providers] Voxygen provider. * [Providers] Voice RSS provider.
Changelog ========= ## x.y.z - UNRELEASED -------- ## 0.6.0 - 2015-08-29 ### Changed * [Google] Added the new "client" parameter * [Providers] Acapela provider. -------- ## 0.5.1 - 2015-08-22 ### Changed * [Dependencies] Added PHPUnit to the dev dependencies. -------- ## 0.5.0 - 2015-06-13 ### Changed * [Dependencies] Use Guzzle 6. * [Support] Drop support for php5.4 -------- ## 0.2.0 - 2015-05-20 ### Added * [TextToSpeech] getFile() method to cache webservice calls. * [TextToSpeech] save() method to store the audio on the local filesystem. -------- ## 0.1.0 - 2015-05-19 ### Added * [Providers] Google provider. * [Providers] Voxygen provider. * [Providers] Voice RSS provider.
Update the changelog for 0.6.0
Update the changelog for 0.6.0
Markdown
apache-2.0
duncan3dc/speaker
markdown
## Code Before: Changelog ========= ## x.y.z - UNRELEASED -------- ## 0.2.0 - 2015-05-20 ### Added * [TextToSpeech] getFile() method to cache webservice calls. * [TextToSpeech] save() method to store the audio on the local filesystem. -------- ## 0.1.0 - 2015-05-19 ### Added * [Providers] Google provider. * [Providers] Voxygen provider. * [Providers] Voice RSS provider. ## Instruction: Update the changelog for 0.6.0 ## Code After: Changelog ========= ## x.y.z - UNRELEASED -------- ## 0.6.0 - 2015-08-29 ### Changed * [Google] Added the new "client" parameter * [Providers] Acapela provider. -------- ## 0.5.1 - 2015-08-22 ### Changed * [Dependencies] Added PHPUnit to the dev dependencies. -------- ## 0.5.0 - 2015-06-13 ### Changed * [Dependencies] Use Guzzle 6. * [Support] Drop support for php5.4 -------- ## 0.2.0 - 2015-05-20 ### Added * [TextToSpeech] getFile() method to cache webservice calls. * [TextToSpeech] save() method to store the audio on the local filesystem. -------- ## 0.1.0 - 2015-05-19 ### Added * [Providers] Google provider. * [Providers] Voxygen provider. * [Providers] Voice RSS provider.
Changelog ========= ## x.y.z - UNRELEASED + + -------- + + ## 0.6.0 - 2015-08-29 + + ### Changed + + * [Google] Added the new "client" parameter + * [Providers] Acapela provider. + + -------- + + ## 0.5.1 - 2015-08-22 + + ### Changed + + * [Dependencies] Added PHPUnit to the dev dependencies. + + -------- + + ## 0.5.0 - 2015-06-13 + + ### Changed + + * [Dependencies] Use Guzzle 6. + * [Support] Drop support for php5.4 -------- ## 0.2.0 - 2015-05-20 ### Added * [TextToSpeech] getFile() method to cache webservice calls. * [TextToSpeech] save() method to store the audio on the local filesystem. -------- ## 0.1.0 - 2015-05-19 ### Added * [Providers] Google provider. * [Providers] Voxygen provider. * [Providers] Voice RSS provider.
26
1.130435
26
0
303b113591574fcc162ea4c3b8dedc91ed0db2b3
lib/subway/request.rb
lib/subway/request.rb
module Subway class Request include Anima.new(:raw) include Adamantium::Flat ROUTER_PARAMS_RACK_ENV_KEY = 'router.params'.freeze def self.coerce(raw) new(:raw => ::Request::Rack.new(raw)) end def authenticated? false end def path_params raw.rack_env[ROUTER_PARAMS_RACK_ENV_KEY] end memoize :path_params def query_params raw.query_params_hash end memoize :query_params def cookies raw.cookies end memoize :cookies def body raw.body end memoize :body def authenticated(session) Authenticated.new(:raw => raw, :session => session) end class Authenticated < self include anima.add(:session) def authenticated? true end def session_cookie session.cookie end end # class Authenticated end # class Request end # module Subway
module Subway class Request include Anima.new(:raw) include Adamantium::Flat ROUTER_PARAMS_RACK_ENV_KEY = 'router.params'.freeze def self.coerce(raw) new(:raw => ::Request::Rack.new(raw)) end def authenticated? false end def params path_params.merge(query_params) end memoize :params def path_params raw.rack_env[ROUTER_PARAMS_RACK_ENV_KEY] end memoize :path_params def query_params raw.query_params_hash end memoize :query_params def cookies raw.cookies end memoize :cookies def body raw.body end memoize :body def authenticated(session) Authenticated.new(:raw => raw, :session => session) end class Authenticated < self include anima.add(:session) def prepared(params) Prepared.new(to_h.merge(params: params)) end def authenticated? true end def session_cookie session.cookie end end # class Authenticated class Prepared < Authenticated include anima.add(:params) end end # class Request end # module Subway
Add Request::Prepared for wrapping sanitized params
Add Request::Prepared for wrapping sanitized params This is not yet optimal but works for now
Ruby
mit
snusnu/subway
ruby
## Code Before: module Subway class Request include Anima.new(:raw) include Adamantium::Flat ROUTER_PARAMS_RACK_ENV_KEY = 'router.params'.freeze def self.coerce(raw) new(:raw => ::Request::Rack.new(raw)) end def authenticated? false end def path_params raw.rack_env[ROUTER_PARAMS_RACK_ENV_KEY] end memoize :path_params def query_params raw.query_params_hash end memoize :query_params def cookies raw.cookies end memoize :cookies def body raw.body end memoize :body def authenticated(session) Authenticated.new(:raw => raw, :session => session) end class Authenticated < self include anima.add(:session) def authenticated? true end def session_cookie session.cookie end end # class Authenticated end # class Request end # module Subway ## Instruction: Add Request::Prepared for wrapping sanitized params This is not yet optimal but works for now ## Code After: module Subway class Request include Anima.new(:raw) include Adamantium::Flat ROUTER_PARAMS_RACK_ENV_KEY = 'router.params'.freeze def self.coerce(raw) new(:raw => ::Request::Rack.new(raw)) end def authenticated? false end def params path_params.merge(query_params) end memoize :params def path_params raw.rack_env[ROUTER_PARAMS_RACK_ENV_KEY] end memoize :path_params def query_params raw.query_params_hash end memoize :query_params def cookies raw.cookies end memoize :cookies def body raw.body end memoize :body def authenticated(session) Authenticated.new(:raw => raw, :session => session) end class Authenticated < self include anima.add(:session) def prepared(params) Prepared.new(to_h.merge(params: params)) end def authenticated? true end def session_cookie session.cookie end end # class Authenticated class Prepared < Authenticated include anima.add(:params) end end # class Request end # module Subway
module Subway class Request include Anima.new(:raw) include Adamantium::Flat ROUTER_PARAMS_RACK_ENV_KEY = 'router.params'.freeze def self.coerce(raw) new(:raw => ::Request::Rack.new(raw)) end def authenticated? false end + + def params + path_params.merge(query_params) + end + memoize :params def path_params raw.rack_env[ROUTER_PARAMS_RACK_ENV_KEY] end memoize :path_params def query_params raw.query_params_hash end memoize :query_params def cookies raw.cookies end memoize :cookies def body raw.body end memoize :body def authenticated(session) Authenticated.new(:raw => raw, :session => session) end class Authenticated < self include anima.add(:session) + def prepared(params) + Prepared.new(to_h.merge(params: params)) + end + def authenticated? true end def session_cookie session.cookie end end # class Authenticated + + class Prepared < Authenticated + include anima.add(:params) + end end # class Request end # module Subway
13
0.236364
13
0
c431f99e3de3338f0b68fc0d8ce0d029cf9c0f39
core/app/backbone/views/subchannels_view.coffee
core/app/backbone/views/subchannels_view.coffee
class window.SubchannelsView extends Backbone.Factlink.CompositeView tagName: "div" id: "contained-channels" template: "channels/subchannels" itemView: SubchannelItemView events: "click #more-button": "toggleMore" initialize: -> @collection.bind "remove", @renderCollection, this toggleMore: -> button = @$("#more-button .label") @$(".overflow").slideToggle (e) -> button.text (if button.text() is "more" then "less" else "more") appendHtml: (collectView, itemView) -> @$(".contained-channel-description").show() @$("ul").prepend itemView.el
class window.SubchannelsView extends Backbone.Factlink.CompositeView tagName: "div" id: "contained-channels" template: "channels/subchannels" itemView: SubchannelItemView events: "click #more-button": "toggleMore" initialize: -> @collection.bind "add remove reset", @updateVisibility, @ @collection.bind "remove", @renderCollection, @ toggleMore: -> button = @$("#more-button .label") @$(".overflow").slideToggle (e) -> button.text (if button.text() is "more" then "less" else "more") appendHtml: (collectView, itemView) -> @$(".contained-channel-description").show() @$("ul").prepend itemView.el updateVisibility: -> @$el.toggleClass 'hide', @collection.length <= 0
Hide "Composed of:" element completely if there are no containing channels.
Hide "Composed of:" element completely if there are no containing channels.
CoffeeScript
mit
daukantas/factlink-core,Factlink/factlink-core,daukantas/factlink-core,daukantas/factlink-core,daukantas/factlink-core,Factlink/factlink-core,Factlink/factlink-core,Factlink/factlink-core
coffeescript
## Code Before: class window.SubchannelsView extends Backbone.Factlink.CompositeView tagName: "div" id: "contained-channels" template: "channels/subchannels" itemView: SubchannelItemView events: "click #more-button": "toggleMore" initialize: -> @collection.bind "remove", @renderCollection, this toggleMore: -> button = @$("#more-button .label") @$(".overflow").slideToggle (e) -> button.text (if button.text() is "more" then "less" else "more") appendHtml: (collectView, itemView) -> @$(".contained-channel-description").show() @$("ul").prepend itemView.el ## Instruction: Hide "Composed of:" element completely if there are no containing channels. ## Code After: class window.SubchannelsView extends Backbone.Factlink.CompositeView tagName: "div" id: "contained-channels" template: "channels/subchannels" itemView: SubchannelItemView events: "click #more-button": "toggleMore" initialize: -> @collection.bind "add remove reset", @updateVisibility, @ @collection.bind "remove", @renderCollection, @ toggleMore: -> button = @$("#more-button .label") @$(".overflow").slideToggle (e) -> button.text (if button.text() is "more" then "less" else "more") appendHtml: (collectView, itemView) -> @$(".contained-channel-description").show() @$("ul").prepend itemView.el updateVisibility: -> @$el.toggleClass 'hide', @collection.length <= 0
class window.SubchannelsView extends Backbone.Factlink.CompositeView tagName: "div" id: "contained-channels" template: "channels/subchannels" itemView: SubchannelItemView events: "click #more-button": "toggleMore" initialize: -> + @collection.bind "add remove reset", @updateVisibility, @ - @collection.bind "remove", @renderCollection, this ? ^^^^ + @collection.bind "remove", @renderCollection, @ ? ^ toggleMore: -> button = @$("#more-button .label") @$(".overflow").slideToggle (e) -> button.text (if button.text() is "more" then "less" else "more") appendHtml: (collectView, itemView) -> @$(".contained-channel-description").show() @$("ul").prepend itemView.el + + updateVisibility: -> + @$el.toggleClass 'hide', @collection.length <= 0
6
0.315789
5
1
e2ab39f8a9aefc40d55c04574d8cd300c1e19462
app/api/v1/root.rb
app/api/v1/root.rb
require 'helpers/shared_helpers' module API module V1 # Root api endpoints class Root < Grape::API helpers SharedHelpers helpers do # Metadata communities hash with 'name => url' pairs. # Return: [Hash] # { community1: 'url/for/comm1', ..., communityN : 'url/for/commN' } def metadata_communities communities = EnvelopeCommunity.pluck(:name).flat_map do |name| [name, url(name.dasherize)] end Hash[*communities] end end desc 'API root' get do { api_version: MetadataRegistry::VERSION, total_envelopes: Envelope.count, metadata_communities: metadata_communities, info: url(:info) } end desc 'Gives general info about the api node' get :info do { metadata_communities: metadata_communities, postman: 'https://www.getpostman.com/collections/bc38edc491333b643e23', swagger: url(:swagger_doc), readme: 'https://github.com/CredentialEngine/CredentialRegistry/blob/master/README.md', docs: 'https://github.com/CredentialEngine/CredentialRegistry/tree/master/docs' } end end end end
require 'helpers/shared_helpers' module API module V1 # Root api endpoints class Root < Grape::API helpers SharedHelpers helpers do # Metadata communities hash with 'name => url' pairs. # Return: [Hash] # { community1: 'url/for/comm1', ..., communityN : 'url/for/commN' } def metadata_communities communities = EnvelopeCommunity.pluck(:name).flat_map do |name| [name, url(name.dasherize)] end Hash[*communities] end end desc 'API root' get do { api_version: MetadataRegistry::VERSION, total_envelopes: Envelope.count, metadata_communities: metadata_communities, info: url(:info) } end desc 'Gives general info about the api node' get :info do { metadata_communities: metadata_communities, postman: 'https://www.getpostman.com/collections/bc38edc491333b643e23', swagger: url(:swagger, 'index.html'), readme: 'https://github.com/CredentialEngine/CredentialRegistry/blob/master/README.md', docs: 'https://github.com/CredentialEngine/CredentialRegistry/tree/master/docs' } end end end end
Fix link to swagger in `/info`
Fix link to swagger in `/info`
Ruby
apache-2.0
CredentialEngine/CredentialRegistry,coffeejunk/CredentialRegistry,CredentialEngine/CredentialRegistry,coffeejunk/CredentialRegistry,CredentialEngine/CredentialRegistry,coffeejunk/CredentialRegistry
ruby
## Code Before: require 'helpers/shared_helpers' module API module V1 # Root api endpoints class Root < Grape::API helpers SharedHelpers helpers do # Metadata communities hash with 'name => url' pairs. # Return: [Hash] # { community1: 'url/for/comm1', ..., communityN : 'url/for/commN' } def metadata_communities communities = EnvelopeCommunity.pluck(:name).flat_map do |name| [name, url(name.dasherize)] end Hash[*communities] end end desc 'API root' get do { api_version: MetadataRegistry::VERSION, total_envelopes: Envelope.count, metadata_communities: metadata_communities, info: url(:info) } end desc 'Gives general info about the api node' get :info do { metadata_communities: metadata_communities, postman: 'https://www.getpostman.com/collections/bc38edc491333b643e23', swagger: url(:swagger_doc), readme: 'https://github.com/CredentialEngine/CredentialRegistry/blob/master/README.md', docs: 'https://github.com/CredentialEngine/CredentialRegistry/tree/master/docs' } end end end end ## Instruction: Fix link to swagger in `/info` ## Code After: require 'helpers/shared_helpers' module API module V1 # Root api endpoints class Root < Grape::API helpers SharedHelpers helpers do # Metadata communities hash with 'name => url' pairs. # Return: [Hash] # { community1: 'url/for/comm1', ..., communityN : 'url/for/commN' } def metadata_communities communities = EnvelopeCommunity.pluck(:name).flat_map do |name| [name, url(name.dasherize)] end Hash[*communities] end end desc 'API root' get do { api_version: MetadataRegistry::VERSION, total_envelopes: Envelope.count, metadata_communities: metadata_communities, info: url(:info) } end desc 'Gives general info about the api node' get :info do { metadata_communities: metadata_communities, postman: 'https://www.getpostman.com/collections/bc38edc491333b643e23', swagger: url(:swagger, 'index.html'), readme: 'https://github.com/CredentialEngine/CredentialRegistry/blob/master/README.md', docs: 'https://github.com/CredentialEngine/CredentialRegistry/tree/master/docs' } end end end end
require 'helpers/shared_helpers' module API module V1 # Root api endpoints class Root < Grape::API helpers SharedHelpers helpers do # Metadata communities hash with 'name => url' pairs. # Return: [Hash] # { community1: 'url/for/comm1', ..., communityN : 'url/for/commN' } def metadata_communities communities = EnvelopeCommunity.pluck(:name).flat_map do |name| [name, url(name.dasherize)] end Hash[*communities] end end desc 'API root' get do { api_version: MetadataRegistry::VERSION, total_envelopes: Envelope.count, metadata_communities: metadata_communities, info: url(:info) } end desc 'Gives general info about the api node' get :info do { metadata_communities: metadata_communities, postman: 'https://www.getpostman.com/collections/bc38edc491333b643e23', - swagger: url(:swagger_doc), ? ^ ^^ + swagger: url(:swagger, 'index.html'), ? ^^^^^ ^^^^^^^^ readme: 'https://github.com/CredentialEngine/CredentialRegistry/blob/master/README.md', docs: 'https://github.com/CredentialEngine/CredentialRegistry/tree/master/docs' } end end end end
2
0.047619
1
1
e39bd586ffab1dd9e1844110ed67d3f257a6759d
src/components/HouseholdNotes.js
src/components/HouseholdNotes.js
import React from 'react' import { List } from 'semantic-ui-react' import format from 'date-fns/format' const HouseholdNotes = ({notes}) => { return ( <List> {notes.map(n => <List.Item>{format(new Date(n.created_at), 'MMMM Do, YYYY')} - {n.content}</List.Item>)} </List> ) } export default HouseholdNotes
import React from "react"; import { List } from "semantic-ui-react"; import format from "date-fns/format"; const HouseholdNotes = ({ notes }) => { return ( <List> {notes.map(n => <List.Item key={n.id}> {format(new Date(n.created_at), "MMMM Do, YYYY")} - {n.content} </List.Item> )} </List> ); }; export default HouseholdNotes;
Add key to household notes to avoid warning
Add key to household notes to avoid warning
JavaScript
mit
cernanb/personal-chef-react-app,cernanb/personal-chef-react-app
javascript
## Code Before: import React from 'react' import { List } from 'semantic-ui-react' import format from 'date-fns/format' const HouseholdNotes = ({notes}) => { return ( <List> {notes.map(n => <List.Item>{format(new Date(n.created_at), 'MMMM Do, YYYY')} - {n.content}</List.Item>)} </List> ) } export default HouseholdNotes ## Instruction: Add key to household notes to avoid warning ## Code After: import React from "react"; import { List } from "semantic-ui-react"; import format from "date-fns/format"; const HouseholdNotes = ({ notes }) => { return ( <List> {notes.map(n => <List.Item key={n.id}> {format(new Date(n.created_at), "MMMM Do, YYYY")} - {n.content} </List.Item> )} </List> ); }; export default HouseholdNotes;
- import React from 'react' ? ^ ^ + import React from "react"; ? ^ ^^ - import { List } from 'semantic-ui-react' ? ^ ^ + import { List } from "semantic-ui-react"; ? ^ ^^ - import format from 'date-fns/format' ? ^ ^ + import format from "date-fns/format"; ? ^ ^^ - const HouseholdNotes = ({notes}) => { + const HouseholdNotes = ({ notes }) => { ? + + - return ( ? -- + return ( - <List> ? ---- + <List> + {notes.map(n => + <List.Item key={n.id}> - {notes.map(n => <List.Item>{format(new Date(n.created_at), 'MMMM Do, YYYY')} - {n.content}</List.Item>)} ? ----------------------------- ^ ^ -------------- + {format(new Date(n.created_at), "MMMM Do, YYYY")} - {n.content} ? ^ ^ - </List> + </List.Item> ? +++++ - ) + )} ? ++ + - } + </List> + ); + }; - export default HouseholdNotes + export default HouseholdNotes; ? +
26
2
15
11
a85b127a49701cdf39d3fa7dce03e6f87a5425a5
client/src/js/templates/shipment/dewarregistry.html
client/src/js/templates/shipment/dewarregistry.html
<h1>Registered Dewars</h1> <div class="filter type"></div> <div class="wrapper"></div> <% if (STAFF) { %> <h1>Add Proposal</h1> <div class="wrapper2"></div> <a href="#" class="button addprop"><i class="fa fa-plus"></i> Add Proposal(s)</a> <div class="add"></div> <% } %>
<h1>Registered Dewars</h1> <p class="help">Registered Dewar not listed here? Ask your local contact to associate it with this proposal.</p> <div class="filter type"></div> <div class="wrapper"></div> <% if (STAFF) { %> <h1>Add Proposal</h1> <div class="wrapper2"></div> <a href="#" class="button addprop"><i class="fa fa-plus"></i> Add Proposal(s)</a> <div class="add"></div> <% } %>
Add help message for users on registered dewars page
Add help message for users on registered dewars page
HTML
apache-2.0
DiamondLightSource/SynchWeb,DiamondLightSource/SynchWeb,DiamondLightSource/SynchWeb,DiamondLightSource/SynchWeb,DiamondLightSource/SynchWeb,DiamondLightSource/SynchWeb
html
## Code Before: <h1>Registered Dewars</h1> <div class="filter type"></div> <div class="wrapper"></div> <% if (STAFF) { %> <h1>Add Proposal</h1> <div class="wrapper2"></div> <a href="#" class="button addprop"><i class="fa fa-plus"></i> Add Proposal(s)</a> <div class="add"></div> <% } %> ## Instruction: Add help message for users on registered dewars page ## Code After: <h1>Registered Dewars</h1> <p class="help">Registered Dewar not listed here? Ask your local contact to associate it with this proposal.</p> <div class="filter type"></div> <div class="wrapper"></div> <% if (STAFF) { %> <h1>Add Proposal</h1> <div class="wrapper2"></div> <a href="#" class="button addprop"><i class="fa fa-plus"></i> Add Proposal(s)</a> <div class="add"></div> <% } %>
<h1>Registered Dewars</h1> + <p class="help">Registered Dewar not listed here? Ask your local contact to associate it with this proposal.</p> <div class="filter type"></div> <div class="wrapper"></div> <% if (STAFF) { %> <h1>Add Proposal</h1> <div class="wrapper2"></div> <a href="#" class="button addprop"><i class="fa fa-plus"></i> Add Proposal(s)</a> <div class="add"></div> <% } %>
1
0.090909
1
0
fd4acac45a2c0843368c3e18841531f5c4e8a04f
string/anagrams.js
string/anagrams.js
// Program that returns true if two strings are anagrams of one another function isAnagram(firstStr, secondStr) { // lower case both strings to account for case insensitivity var a = firstStr.toLowerCase(), b = secondStr.toLowerCase(); }
// Program that returns true if two strings are anagrams of one another function isAnagram(firstStr, secondStr) { // lower case both strings to account for case insensitivity var a = firstStr.toLowerCase(), b = secondStr.toLowerCase(); // sort strings and join each resulting array to a string a = a.split("").sort().join(""); b = b.split("").sort().join(""); }
Sort strings and join each resulting array to a string
Sort strings and join each resulting array to a string
JavaScript
mit
derekmpham/interview-prep,derekmpham/interview-prep
javascript
## Code Before: // Program that returns true if two strings are anagrams of one another function isAnagram(firstStr, secondStr) { // lower case both strings to account for case insensitivity var a = firstStr.toLowerCase(), b = secondStr.toLowerCase(); } ## Instruction: Sort strings and join each resulting array to a string ## Code After: // Program that returns true if two strings are anagrams of one another function isAnagram(firstStr, secondStr) { // lower case both strings to account for case insensitivity var a = firstStr.toLowerCase(), b = secondStr.toLowerCase(); // sort strings and join each resulting array to a string a = a.split("").sort().join(""); b = b.split("").sort().join(""); }
// Program that returns true if two strings are anagrams of one another function isAnagram(firstStr, secondStr) { // lower case both strings to account for case insensitivity var a = firstStr.toLowerCase(), b = secondStr.toLowerCase(); + + // sort strings and join each resulting array to a string + a = a.split("").sort().join(""); + b = b.split("").sort().join(""); }
4
0.571429
4
0
a2856fb1d52c7921f0a92ba822987afa64d36f91
CHANGELOG.md
CHANGELOG.md
[Full Changelog](https://github.com/expando-lang/expando/compare/v0.1.0...v0.2.0) **Added** - Enable using config file in current directory. See 1ab20a5 **Closed issues:** - Add new project initialization [\#1](https://github.com/expando-lang/expando/issues/1) **Merged pull requests:** - Add project initialization [\#2](https://github.com/expando-lang/expando/pull/2) ([techpeace](https://github.com/techpeace)) ## [v0.1.0](https://github.com/expando-lang/expando/tree/v0.1.0) (2016-05-27) - Initial release \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
[Full Changelog](https://github.com/expando-lang/expando/compare/v0.1.0...v0.2.0) **Added** - Enable using config file in current directory. See 1ab20a55ffe65db61ec6c7cdaabccb91e470c16e **Closed issues:** - Add new project initialization [\#1](https://github.com/expando-lang/expando/issues/1) **Merged pull requests:** - Add project initialization [\#2](https://github.com/expando-lang/expando/pull/2) ([techpeace](https://github.com/techpeace)) ## [v0.1.0](https://github.com/expando-lang/expando/tree/v0.1.0) (2016-05-27) - Initial release \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
Expand commit reference in changelog
Expand commit reference in changelog
Markdown
mit
expando-lang/expando,voxable-labs/expando,expando-lang/expando,voxable-labs/expando
markdown
## Code Before: [Full Changelog](https://github.com/expando-lang/expando/compare/v0.1.0...v0.2.0) **Added** - Enable using config file in current directory. See 1ab20a5 **Closed issues:** - Add new project initialization [\#1](https://github.com/expando-lang/expando/issues/1) **Merged pull requests:** - Add project initialization [\#2](https://github.com/expando-lang/expando/pull/2) ([techpeace](https://github.com/techpeace)) ## [v0.1.0](https://github.com/expando-lang/expando/tree/v0.1.0) (2016-05-27) - Initial release \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* ## Instruction: Expand commit reference in changelog ## Code After: [Full Changelog](https://github.com/expando-lang/expando/compare/v0.1.0...v0.2.0) **Added** - Enable using config file in current directory. See 1ab20a55ffe65db61ec6c7cdaabccb91e470c16e **Closed issues:** - Add new project initialization [\#1](https://github.com/expando-lang/expando/issues/1) **Merged pull requests:** - Add project initialization [\#2](https://github.com/expando-lang/expando/pull/2) ([techpeace](https://github.com/techpeace)) ## [v0.1.0](https://github.com/expando-lang/expando/tree/v0.1.0) (2016-05-27) - Initial release \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
[Full Changelog](https://github.com/expando-lang/expando/compare/v0.1.0...v0.2.0) **Added** - - Enable using config file in current directory. See 1ab20a5 + - Enable using config file in current directory. See 1ab20a55ffe65db61ec6c7cdaabccb91e470c16e ? +++++++++++++++++++++++++++++++++ **Closed issues:** - Add new project initialization [\#1](https://github.com/expando-lang/expando/issues/1) **Merged pull requests:** - Add project initialization [\#2](https://github.com/expando-lang/expando/pull/2) ([techpeace](https://github.com/techpeace)) ## [v0.1.0](https://github.com/expando-lang/expando/tree/v0.1.0) (2016-05-27) - Initial release \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
2
0.090909
1
1
3a8ee86b43e00076be91cd0d545afcfd92e520ac
README.md
README.md
[![Code Review](http://www.zomis.net/codereview/shield/?qid=95706)](http://codereview.stackexchange.com/q/95706/49181) Features: Toggle & Reset capable Score Display. Adding in player name(s). Part of a series of simple apps made for the sake of learning. Try it out: [TicTacToe.jar](https://github.com/Javaliant/TicTacToe/blob/master/TicTacToe.jar?raw=true) * **Requires at least JRE 8**
[![Code Review](http://www.zomis.net/codereview/shield/?qid=95706)](http://codereview.stackexchange.com/q/95706/49181) **Features**: * Score Display. * May be toggled. * Can reset score. * Adding in player name(s). Part of a series of simple apps made for the sake of learning. Try it out: [TicTacToe.jar](https://github.com/Javaliant/TicTacToe/blob/master/TicTacToe.jar?raw=true) * **Requires at least JRE 8**
Update readme, added bullet points
Update readme, added bullet points
Markdown
mit
Javaliant/TicTacToe
markdown
## Code Before: [![Code Review](http://www.zomis.net/codereview/shield/?qid=95706)](http://codereview.stackexchange.com/q/95706/49181) Features: Toggle & Reset capable Score Display. Adding in player name(s). Part of a series of simple apps made for the sake of learning. Try it out: [TicTacToe.jar](https://github.com/Javaliant/TicTacToe/blob/master/TicTacToe.jar?raw=true) * **Requires at least JRE 8** ## Instruction: Update readme, added bullet points ## Code After: [![Code Review](http://www.zomis.net/codereview/shield/?qid=95706)](http://codereview.stackexchange.com/q/95706/49181) **Features**: * Score Display. * May be toggled. * Can reset score. * Adding in player name(s). Part of a series of simple apps made for the sake of learning. Try it out: [TicTacToe.jar](https://github.com/Javaliant/TicTacToe/blob/master/TicTacToe.jar?raw=true) * **Requires at least JRE 8**
[![Code Review](http://www.zomis.net/codereview/shield/?qid=95706)](http://codereview.stackexchange.com/q/95706/49181) - Features: + **Features**: ? ++ ++ - Toggle & Reset capable Score Display. + * Score Display. + * May be toggled. + * Can reset score. - Adding in player name(s). + * Adding in player name(s). ? ++ Part of a series of simple apps made for the sake of learning. Try it out: [TicTacToe.jar](https://github.com/Javaliant/TicTacToe/blob/master/TicTacToe.jar?raw=true) * **Requires at least JRE 8**
8
0.727273
5
3
5ada6a5084c25bcee71f7a1961f60c5decaed9d4
setup.py
setup.py
import codecs try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import carrot setup( name='carrot', version=carrot.__version__, description=carrot.__doc__, author=carrot.__author__, author_email=carrot.__contact__, url=carrot.__homepage__, platforms=["any"], packages=find_packages(exclude=['ez_setup']), test_suite="nose.collector", install_requires=[ 'amqplib', ], classifiers=[ "Development Status :: 3 - Alpha", "Framework :: Django", "Operating System :: OS Independent", "Programming Language :: Python", ], long_description=codecs.open('README.rst', "r", "utf-8").read(), )
import codecs try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import carrot setup( name='carrot', version=carrot.__version__, description=carrot.__doc__, author=carrot.__author__, author_email=carrot.__contact__, url=carrot.__homepage__, platforms=["any"], packages=find_packages(exclude=['ez_setup']), test_suite="nose.collector", install_requires=[ 'amqplib', ], classifiers=[ "Development Status :: 4 - Beta", "Framework :: Django", "Operating System :: OS Independent", "Programming Language :: Python", "License :: OSI Approved :: BSD License", "Intended Audience :: Developers", "Topic :: Communications", "Topic :: System :: Distributed Computing", "Topic :: Software Development :: Libraries :: Python Modules", ], long_description=codecs.open('README.rst', "r", "utf-8").read(), )
Update development status trove classifier from Alpha to Beta
Update development status trove classifier from Alpha to Beta
Python
bsd-3-clause
runeh/carrot,ask/carrot,ask/carrot
python
## Code Before: import codecs try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import carrot setup( name='carrot', version=carrot.__version__, description=carrot.__doc__, author=carrot.__author__, author_email=carrot.__contact__, url=carrot.__homepage__, platforms=["any"], packages=find_packages(exclude=['ez_setup']), test_suite="nose.collector", install_requires=[ 'amqplib', ], classifiers=[ "Development Status :: 3 - Alpha", "Framework :: Django", "Operating System :: OS Independent", "Programming Language :: Python", ], long_description=codecs.open('README.rst', "r", "utf-8").read(), ) ## Instruction: Update development status trove classifier from Alpha to Beta ## Code After: import codecs try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import carrot setup( name='carrot', version=carrot.__version__, description=carrot.__doc__, author=carrot.__author__, author_email=carrot.__contact__, url=carrot.__homepage__, platforms=["any"], packages=find_packages(exclude=['ez_setup']), test_suite="nose.collector", install_requires=[ 'amqplib', ], classifiers=[ "Development Status :: 4 - Beta", "Framework :: Django", "Operating System :: OS Independent", "Programming Language :: Python", "License :: OSI Approved :: BSD License", "Intended Audience :: Developers", "Topic :: Communications", "Topic :: System :: Distributed Computing", "Topic :: Software Development :: Libraries :: Python Modules", ], long_description=codecs.open('README.rst', "r", "utf-8").read(), )
import codecs try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages import carrot setup( name='carrot', version=carrot.__version__, description=carrot.__doc__, author=carrot.__author__, author_email=carrot.__contact__, url=carrot.__homepage__, platforms=["any"], packages=find_packages(exclude=['ez_setup']), test_suite="nose.collector", install_requires=[ 'amqplib', ], classifiers=[ - "Development Status :: 3 - Alpha", ? ^ ^^^^ + "Development Status :: 4 - Beta", ? ^ ^^^ "Framework :: Django", "Operating System :: OS Independent", "Programming Language :: Python", + "License :: OSI Approved :: BSD License", + "Intended Audience :: Developers", + "Topic :: Communications", + "Topic :: System :: Distributed Computing", + "Topic :: Software Development :: Libraries :: Python Modules", ], long_description=codecs.open('README.rst', "r", "utf-8").read(), )
7
0.21875
6
1
d8ffa36744bcef79c10689a05f3f9d550c7f13f5
README.md
README.md
Generate jekyll site content from annotated TEI facsimile
Generate jekyll site content from annotated TEI facsimile. ## Run local development copy of the import script env RUBYLIB=lib ./bin/jekyllimport_teifacsimile tei-annotated.xml
Document how to run local copy of the script
Document how to run local copy of the script
Markdown
apache-2.0
emory-libraries-ecds/teifacsimile-to-jekyll
markdown
## Code Before: Generate jekyll site content from annotated TEI facsimile ## Instruction: Document how to run local copy of the script ## Code After: Generate jekyll site content from annotated TEI facsimile. ## Run local development copy of the import script env RUBYLIB=lib ./bin/jekyllimport_teifacsimile tei-annotated.xml
- Generate jekyll site content from annotated TEI facsimile + Generate jekyll site content from annotated TEI facsimile. ? + + + + + + ## Run local development copy of the import script + env RUBYLIB=lib ./bin/jekyllimport_teifacsimile tei-annotated.xml
8
8
7
1
84f8088197d7c47b3624aeb41a012f6b96bf4459
src/index.js
src/index.js
const serve = require('serve/lib/server') const relativePaths = require('./relative-paths') // taken from serve cli! process.env.ASSET_DIR = '/' + Math.random().toString(36).substr(2, 10) module.exports = (cookieName) => { const baseURL = process.env.PUBLIC_URL || '' const uiPath = process.env.REACT_APP_BUILD const uiIgnored = [ '.DS_Store', '.git/', 'node_modules' ] let rootUrls = [] route.buildRelativePaths = () => { return ( relativePaths(uiPath) .then((urls) => { rootUrls = urls }) ) } return route function route (req, res) { if (cookieName && baseURL) { const cookieValue = encodeURIComponent(baseURL) const cookie = `${cookieName}=${cookieValue}; Path=/;` res.setHeader('Set-Cookie', cookie) } const uiFlags = { single: true, auth: !!process.env.SERVE_USER } const overrideUrl = rootUrls.find((x) => req.url.indexOf(x) !== -1) if (req.url.startsWith(baseURL)) req.url = req.url.slice(baseURL) if (overrideUrl) req.url = overrideUrl serve(req, res, uiFlags, uiPath, uiIgnored) } }
const serve = require('serve/lib/server') const relativePaths = require('./relative-paths') // taken from serve cli! process.env.ASSET_DIR = '/' + Math.random().toString(36).substr(2, 10) module.exports = (cookieName) => { const baseURL = process.env.PUBLIC_URL || '' const uiPath = process.env.REACT_APP_BUILD const uiIgnored = [ '.DS_Store', '.git/', 'node_modules' ] let rootUrls = [] route.buildRelativePaths = () => { return ( relativePaths(uiPath) .then((urls) => { rootUrls = urls }) ) } return route function route (req, res) { if (cookieName && baseURL) { const cookieValue = encodeURIComponent(baseURL) const cookie = `${cookieName}=${cookieValue}; Path=/;` res.setHeader('Set-Cookie', cookie) } const uiFlags = { single: true, auth: !!process.env.SERVE_USER } const overrideUrl = rootUrls.find((x) => req.url.indexOf(x) !== -1) if (req.url.startsWith(baseURL) && req.url.length > baseUrl.length + 1) { req.url = req.url.slice(baseURL.length + 1) } if (overrideUrl) req.url = overrideUrl serve(req, res, uiFlags, uiPath, uiIgnored) } }
Remove slash after baseUrl and make sure entire url is not removed
Remove slash after baseUrl and make sure entire url is not removed
JavaScript
apache-2.0
JamesKyburz/serve-create-react-app,JamesKyburz/serve-create-react-app
javascript
## Code Before: const serve = require('serve/lib/server') const relativePaths = require('./relative-paths') // taken from serve cli! process.env.ASSET_DIR = '/' + Math.random().toString(36).substr(2, 10) module.exports = (cookieName) => { const baseURL = process.env.PUBLIC_URL || '' const uiPath = process.env.REACT_APP_BUILD const uiIgnored = [ '.DS_Store', '.git/', 'node_modules' ] let rootUrls = [] route.buildRelativePaths = () => { return ( relativePaths(uiPath) .then((urls) => { rootUrls = urls }) ) } return route function route (req, res) { if (cookieName && baseURL) { const cookieValue = encodeURIComponent(baseURL) const cookie = `${cookieName}=${cookieValue}; Path=/;` res.setHeader('Set-Cookie', cookie) } const uiFlags = { single: true, auth: !!process.env.SERVE_USER } const overrideUrl = rootUrls.find((x) => req.url.indexOf(x) !== -1) if (req.url.startsWith(baseURL)) req.url = req.url.slice(baseURL) if (overrideUrl) req.url = overrideUrl serve(req, res, uiFlags, uiPath, uiIgnored) } } ## Instruction: Remove slash after baseUrl and make sure entire url is not removed ## Code After: const serve = require('serve/lib/server') const relativePaths = require('./relative-paths') // taken from serve cli! process.env.ASSET_DIR = '/' + Math.random().toString(36).substr(2, 10) module.exports = (cookieName) => { const baseURL = process.env.PUBLIC_URL || '' const uiPath = process.env.REACT_APP_BUILD const uiIgnored = [ '.DS_Store', '.git/', 'node_modules' ] let rootUrls = [] route.buildRelativePaths = () => { return ( relativePaths(uiPath) .then((urls) => { rootUrls = urls }) ) } return route function route (req, res) { if (cookieName && baseURL) { const cookieValue = encodeURIComponent(baseURL) const cookie = `${cookieName}=${cookieValue}; Path=/;` res.setHeader('Set-Cookie', cookie) } const uiFlags = { single: true, auth: !!process.env.SERVE_USER } const overrideUrl = rootUrls.find((x) => req.url.indexOf(x) !== -1) if (req.url.startsWith(baseURL) && req.url.length > baseUrl.length + 1) { req.url = req.url.slice(baseURL.length + 1) } if (overrideUrl) req.url = overrideUrl serve(req, res, uiFlags, uiPath, uiIgnored) } }
const serve = require('serve/lib/server') const relativePaths = require('./relative-paths') // taken from serve cli! process.env.ASSET_DIR = '/' + Math.random().toString(36).substr(2, 10) module.exports = (cookieName) => { const baseURL = process.env.PUBLIC_URL || '' const uiPath = process.env.REACT_APP_BUILD const uiIgnored = [ '.DS_Store', '.git/', 'node_modules' ] let rootUrls = [] route.buildRelativePaths = () => { return ( relativePaths(uiPath) .then((urls) => { rootUrls = urls }) ) } return route function route (req, res) { if (cookieName && baseURL) { const cookieValue = encodeURIComponent(baseURL) const cookie = `${cookieName}=${cookieValue}; Path=/;` res.setHeader('Set-Cookie', cookie) } const uiFlags = { single: true, auth: !!process.env.SERVE_USER } const overrideUrl = rootUrls.find((x) => req.url.indexOf(x) !== -1) - if (req.url.startsWith(baseURL)) req.url = req.url.slice(baseURL) + if (req.url.startsWith(baseURL) && req.url.length > baseUrl.length + 1) { + req.url = req.url.slice(baseURL.length + 1) + } if (overrideUrl) req.url = overrideUrl serve(req, res, uiFlags, uiPath, uiIgnored) } }
4
0.117647
3
1
2f2470b8114f78f0c5c2d07fd752e7c2ceb3be6d
code/CaptchaField.php
code/CaptchaField.php
<?php class CaptchaField extends TextField { function __construct($name, $title = null, $value = "", $form = null){ parent::__construct($name, $title, $value, $form); } function Field($properties = array()) { $attributes = array( 'type' => 'text', 'class' => 'CaptchaField', 'id' => $this->id(), 'name' => $this->getName(), 'value' => $this->Value(), 'tabindex' => $this->getAttribute("tabindex"), 'maxlength' => 4, 'size' => 30 ); // create link to image to display code $html = '<img src="' . _EnquiryPageBase .'/images/captcha.jpg?' . time() . '" class="customcaptcha-image" alt="CAPTCHA security code" />'; // create input field $html .= $this->createTag('input', $attributes); return $html; } // SERVER-SIDE VALIDATION (to ensure a browser with javascript disabled doesn't bypass validation) function validate($validator){ $this->value = trim($this->value); $SessionCaptcha = Session::get('customcaptcha'); if ( md5(trim($this->value).$_SERVER['REMOTE_ADDR']).'a4xn' != $SessionCaptcha ) { $validator->validationError( $this->name, 'Codes do not match, please try again', 'required' ); } } }
<?php class CaptchaField extends TextField { function __construct($name, $title = null, $value = "", $form = null){ parent::__construct($name, $title, $value, $form); } function Field($properties = array()) { $attributes = array( 'type' => 'text', 'class' => 'CaptchaField', 'id' => $this->id(), 'name' => $this->getName(), 'value' => $this->Value(), 'tabindex' => $this->getAttribute("tabindex"), 'maxlength' => 4, 'size' => 30 ); // create link to image to display code $html = '<img src="' . _EnquiryPageBase .'/images/captcha.jpg?' . time() . '" class="customcaptcha-image" alt="CAPTCHA security code" width="60" height="24" />'; // create input field $html .= $this->createTag('input', $attributes); return $html; } // SERVER-SIDE VALIDATION (to ensure a browser with javascript disabled doesn't bypass validation) function validate($validator){ $this->value = trim($this->value); $SessionCaptcha = Session::get('customcaptcha'); if ( md5(trim($this->value).$_SERVER['REMOTE_ADDR']).'a4xn' != $SessionCaptcha ) { $validator->validationError( $this->name, 'Codes do not match, please try again', 'required' ); } } }
Set verification image height and width in html
Set verification image height and width in html
PHP
mit
axllent/silverstripe-enquiry-page,axllent/silverstripe-enquiry-page
php
## Code Before: <?php class CaptchaField extends TextField { function __construct($name, $title = null, $value = "", $form = null){ parent::__construct($name, $title, $value, $form); } function Field($properties = array()) { $attributes = array( 'type' => 'text', 'class' => 'CaptchaField', 'id' => $this->id(), 'name' => $this->getName(), 'value' => $this->Value(), 'tabindex' => $this->getAttribute("tabindex"), 'maxlength' => 4, 'size' => 30 ); // create link to image to display code $html = '<img src="' . _EnquiryPageBase .'/images/captcha.jpg?' . time() . '" class="customcaptcha-image" alt="CAPTCHA security code" />'; // create input field $html .= $this->createTag('input', $attributes); return $html; } // SERVER-SIDE VALIDATION (to ensure a browser with javascript disabled doesn't bypass validation) function validate($validator){ $this->value = trim($this->value); $SessionCaptcha = Session::get('customcaptcha'); if ( md5(trim($this->value).$_SERVER['REMOTE_ADDR']).'a4xn' != $SessionCaptcha ) { $validator->validationError( $this->name, 'Codes do not match, please try again', 'required' ); } } } ## Instruction: Set verification image height and width in html ## Code After: <?php class CaptchaField extends TextField { function __construct($name, $title = null, $value = "", $form = null){ parent::__construct($name, $title, $value, $form); } function Field($properties = array()) { $attributes = array( 'type' => 'text', 'class' => 'CaptchaField', 'id' => $this->id(), 'name' => $this->getName(), 'value' => $this->Value(), 'tabindex' => $this->getAttribute("tabindex"), 'maxlength' => 4, 'size' => 30 ); // create link to image to display code $html = '<img src="' . _EnquiryPageBase .'/images/captcha.jpg?' . time() . '" class="customcaptcha-image" alt="CAPTCHA security code" width="60" height="24" />'; // create input field $html .= $this->createTag('input', $attributes); return $html; } // SERVER-SIDE VALIDATION (to ensure a browser with javascript disabled doesn't bypass validation) function validate($validator){ $this->value = trim($this->value); $SessionCaptcha = Session::get('customcaptcha'); if ( md5(trim($this->value).$_SERVER['REMOTE_ADDR']).'a4xn' != $SessionCaptcha ) { $validator->validationError( $this->name, 'Codes do not match, please try again', 'required' ); } } }
<?php class CaptchaField extends TextField { function __construct($name, $title = null, $value = "", $form = null){ parent::__construct($name, $title, $value, $form); } function Field($properties = array()) { $attributes = array( 'type' => 'text', 'class' => 'CaptchaField', 'id' => $this->id(), 'name' => $this->getName(), 'value' => $this->Value(), 'tabindex' => $this->getAttribute("tabindex"), 'maxlength' => 4, 'size' => 30 ); // create link to image to display code - $html = '<img src="' . _EnquiryPageBase .'/images/captcha.jpg?' . time() . '" class="customcaptcha-image" alt="CAPTCHA security code" />'; + $html = '<img src="' . _EnquiryPageBase .'/images/captcha.jpg?' . time() . '" class="customcaptcha-image" alt="CAPTCHA security code" width="60" height="24" />'; ? +++++++++++++++++++++++ // create input field $html .= $this->createTag('input', $attributes); return $html; } // SERVER-SIDE VALIDATION (to ensure a browser with javascript disabled doesn't bypass validation) function validate($validator){ $this->value = trim($this->value); $SessionCaptcha = Session::get('customcaptcha'); if ( md5(trim($this->value).$_SERVER['REMOTE_ADDR']).'a4xn' != $SessionCaptcha ) { $validator->validationError( $this->name, 'Codes do not match, please try again', 'required' ); } } }
2
0.040816
1
1
3843d4e209ff4199b4b734a59a3a5ce9de9a3748
res/config/resource_lifecycle.yml
res/config/resource_lifecycle.yml
LifecycleResourceTypes: InstrumentDevice: ResourceLCSM InstrumentAgent: ResourceLCSM PlatformDevice: ResourceLCSM PlatformAgent: ResourceLCSM DataProduct: InformationResourceLCSM # Definition of lifecycle workflows and specializations LifecycleWorkflowDefinitions: - name: ResourceLCSM lcsm_class: pyon.ion.resource.CommonResourceLifeCycleSM initial_state: DRAFT initial_availability: PRIVATE - name: InformationResourceLCSM based_on: ResourceLCSM initial_state: DEPLOYED initial_availability: PRIVATE illegal_states: [] illegal_transitions: []
LifecycleResourceTypes: InstrumentDevice: ResourceLCSM InstrumentAgent: ResourceLCSM PlatformDevice: ResourceLCSM PlatformAgent: ResourceLCSM Deployment: SimplifiedLCSM DataProduct: InformationResourceLCSM # Definition of lifecycle workflows and specializations LifecycleWorkflowDefinitions: # The standard workflow with all states and transitions - name: ResourceLCSM lcsm_class: pyon.ion.resource.CommonResourceLifeCycleSM initial_state: DRAFT initial_availability: PRIVATE # A simplified workflow that does not use DRAFT, DEVELOPED and starts in PLANNED_AVAILABLE - name: SimplifiedLCSM based_on: ResourceLCSM initial_state: PLANNED initial_availability: AVAILABLE illegal_states: [DRAFT, DEVELOPED] # A simplified workflow that does not use DRAFT, DEVELOPED, INTEGRATED and starts in PLANNED_AVAILABLE state - name: InformationResourceLCSM based_on: ResourceLCSM initial_state: PLANNED initial_availability: AVAILABLE illegal_states: [DRAFT, DEVELOPED, INTEGRATED]
Change config to activate lcstate for Deployment and change initial states for DataProduct
Change config to activate lcstate for Deployment and change initial states for DataProduct
YAML
bsd-2-clause
ooici/ion-definitions
yaml
## Code Before: LifecycleResourceTypes: InstrumentDevice: ResourceLCSM InstrumentAgent: ResourceLCSM PlatformDevice: ResourceLCSM PlatformAgent: ResourceLCSM DataProduct: InformationResourceLCSM # Definition of lifecycle workflows and specializations LifecycleWorkflowDefinitions: - name: ResourceLCSM lcsm_class: pyon.ion.resource.CommonResourceLifeCycleSM initial_state: DRAFT initial_availability: PRIVATE - name: InformationResourceLCSM based_on: ResourceLCSM initial_state: DEPLOYED initial_availability: PRIVATE illegal_states: [] illegal_transitions: [] ## Instruction: Change config to activate lcstate for Deployment and change initial states for DataProduct ## Code After: LifecycleResourceTypes: InstrumentDevice: ResourceLCSM InstrumentAgent: ResourceLCSM PlatformDevice: ResourceLCSM PlatformAgent: ResourceLCSM Deployment: SimplifiedLCSM DataProduct: InformationResourceLCSM # Definition of lifecycle workflows and specializations LifecycleWorkflowDefinitions: # The standard workflow with all states and transitions - name: ResourceLCSM lcsm_class: pyon.ion.resource.CommonResourceLifeCycleSM initial_state: DRAFT initial_availability: PRIVATE # A simplified workflow that does not use DRAFT, DEVELOPED and starts in PLANNED_AVAILABLE - name: SimplifiedLCSM based_on: ResourceLCSM initial_state: PLANNED initial_availability: AVAILABLE illegal_states: [DRAFT, DEVELOPED] # A simplified workflow that does not use DRAFT, DEVELOPED, INTEGRATED and starts in PLANNED_AVAILABLE state - name: InformationResourceLCSM based_on: ResourceLCSM initial_state: PLANNED initial_availability: AVAILABLE illegal_states: [DRAFT, DEVELOPED, INTEGRATED]
LifecycleResourceTypes: InstrumentDevice: ResourceLCSM InstrumentAgent: ResourceLCSM PlatformDevice: ResourceLCSM PlatformAgent: ResourceLCSM + + Deployment: SimplifiedLCSM + DataProduct: InformationResourceLCSM # Definition of lifecycle workflows and specializations LifecycleWorkflowDefinitions: + + # The standard workflow with all states and transitions - name: ResourceLCSM lcsm_class: pyon.ion.resource.CommonResourceLifeCycleSM initial_state: DRAFT initial_availability: PRIVATE + # A simplified workflow that does not use DRAFT, DEVELOPED and starts in PLANNED_AVAILABLE + - name: SimplifiedLCSM + based_on: ResourceLCSM + initial_state: PLANNED + initial_availability: AVAILABLE + illegal_states: [DRAFT, DEVELOPED] + + # A simplified workflow that does not use DRAFT, DEVELOPED, INTEGRATED and starts in PLANNED_AVAILABLE state - name: InformationResourceLCSM based_on: ResourceLCSM - initial_state: DEPLOYED ? -- ^^ + initial_state: PLANNED ? ^^^ - initial_availability: PRIVATE ? ^^^ ^ + initial_availability: AVAILABLE ? ^ ^^^^^ + illegal_states: [DRAFT, DEVELOPED, INTEGRATED] - illegal_states: [] - illegal_transitions: []
20
0.952381
16
4
cc94a217aad0d3af2c4f8c7e51a69c9167e0b6ce
Source/OEXStyles+Swift.swift
Source/OEXStyles+Swift.swift
// // OEXStyles+Swift.swift // edX // // Created by Ehmad Zubair Chughtai on 25/05/2015. // Copyright (c) 2015 edX. All rights reserved. // import Foundation import UIKit extension OEXStyles { func applyGlobalAppearance() { //Probably want to set the tintColor of UIWindow but it didn't seem necessary right now let textAttrs = [NSForegroundColorAttributeName : navigationItemTintColor()] UINavigationBar.appearance().barTintColor = self.primaryAccentColor() UINavigationBar.appearance().tintColor = self.standardBackgroundColor() UINavigationBar.appearance().translucent = false UINavigationBar.appearance().titleTextAttributes = textAttrs } }
// // OEXStyles+Swift.swift // edX // // Created by Ehmad Zubair Chughtai on 25/05/2015. // Copyright (c) 2015 edX. All rights reserved. // import Foundation import UIKit extension OEXStyles { func applyGlobalAppearance() { //Probably want to set the tintColor of UIWindow but it didn't seem necessary right now let textAttrs = [NSForegroundColorAttributeName : navigationItemTintColor()] UINavigationBar.appearance().barTintColor = self.primaryAccentColor() UINavigationBar.appearance().tintColor = self.standardBackgroundColor() UINavigationBar.appearance().translucent = false UINavigationBar.appearance().titleTextAttributes = textAttrs UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false) } }
Set status bar globally to match requirement
Set status bar globally to match requirement
Swift
apache-2.0
appsembler/edx-app-ios,lovehhf/edx-app-ios,lovehhf/edx-app-ios,Ben21hao/edx-app-ios-enterprise-new,proversity-org/edx-app-ios,keyeMyria/edx-app-ios,edx/edx-app-ios,edx/edx-app-ios,yrchen/edx-app-ios,proversity-org/edx-app-ios,nagyistoce/edx-app-ios,proversity-org/edx-app-ios,lovehhf/edx-app-ios,keyeMyria/edx-app-ios,edx/edx-app-ios,proversity-org/edx-app-ios,knehez/edx-app-ios,nagyistoce/edx-app-ios,adoosii/edx-app-ios,Ben21hao/edx-app-ios-new,edx/edx-app-ios,keyeMyria/edx-app-ios,Ben21hao/edx-app-ios-new,Ben21hao/edx-app-ios-enterprise-new,nagyistoce/edx-app-ios,proversity-org/edx-app-ios,Ben21hao/edx-app-ios-new,nagyistoce/edx-app-ios,appsembler/edx-app-ios,adoosii/edx-app-ios,Ben21hao/edx-app-ios-new,yrchen/edx-app-ios,knehez/edx-app-ios,Ben21hao/edx-app-ios-enterprise-new,Ben21hao/edx-app-ios-enterprise-new,keyeMyria/edx-app-ios,edx/edx-app-ios,knehez/edx-app-ios,appsembler/edx-app-ios,chinlam91/edx-app-ios,adoosii/edx-app-ios,chinlam91/edx-app-ios,yrchen/edx-app-ios,chinlam91/edx-app-ios,edx/edx-app-ios,Ben21hao/edx-app-ios-enterprise-new,nagyistoce/edx-app-ios,chinlam91/edx-app-ios,knehez/edx-app-ios,proversity-org/edx-app-ios,Ben21hao/edx-app-ios-new,appsembler/edx-app-ios,lovehhf/edx-app-ios,knehez/edx-app-ios,edx/edx-app-ios,adoosii/edx-app-ios,appsembler/edx-app-ios
swift
## Code Before: // // OEXStyles+Swift.swift // edX // // Created by Ehmad Zubair Chughtai on 25/05/2015. // Copyright (c) 2015 edX. All rights reserved. // import Foundation import UIKit extension OEXStyles { func applyGlobalAppearance() { //Probably want to set the tintColor of UIWindow but it didn't seem necessary right now let textAttrs = [NSForegroundColorAttributeName : navigationItemTintColor()] UINavigationBar.appearance().barTintColor = self.primaryAccentColor() UINavigationBar.appearance().tintColor = self.standardBackgroundColor() UINavigationBar.appearance().translucent = false UINavigationBar.appearance().titleTextAttributes = textAttrs } } ## Instruction: Set status bar globally to match requirement ## Code After: // // OEXStyles+Swift.swift // edX // // Created by Ehmad Zubair Chughtai on 25/05/2015. // Copyright (c) 2015 edX. All rights reserved. // import Foundation import UIKit extension OEXStyles { func applyGlobalAppearance() { //Probably want to set the tintColor of UIWindow but it didn't seem necessary right now let textAttrs = [NSForegroundColorAttributeName : navigationItemTintColor()] UINavigationBar.appearance().barTintColor = self.primaryAccentColor() UINavigationBar.appearance().tintColor = self.standardBackgroundColor() UINavigationBar.appearance().translucent = false UINavigationBar.appearance().titleTextAttributes = textAttrs UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false) } }
// // OEXStyles+Swift.swift // edX // // Created by Ehmad Zubair Chughtai on 25/05/2015. // Copyright (c) 2015 edX. All rights reserved. // import Foundation import UIKit extension OEXStyles { func applyGlobalAppearance() { //Probably want to set the tintColor of UIWindow but it didn't seem necessary right now let textAttrs = [NSForegroundColorAttributeName : navigationItemTintColor()] UINavigationBar.appearance().barTintColor = self.primaryAccentColor() UINavigationBar.appearance().tintColor = self.standardBackgroundColor() UINavigationBar.appearance().translucent = false UINavigationBar.appearance().titleTextAttributes = textAttrs + UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: false) } }
1
0.04
1
0
52547ce99d28300d64bfdac12d82829e5485456a
packages/sn/snaplet-purescript.yaml
packages/sn/snaplet-purescript.yaml
homepage: '' changelog-type: '' hash: f2a5e27c73500f5708a6d3ba1d1a16c1a530b1ed01629790bcdde6efb45a6a8a test-bench-deps: {} maintainer: alfredo.dinapoli@gmail.com synopsis: Automatic (re)compilation of purescript projects changelog: '' basic-deps: snap: ! '>=1.1.2.0' shelly: ! '>=0.4.1' base: ! '>=4.6 && <5.1' configurator: ! '>=0.2.0.0' text: ! '>0.11 && <1.4.0.0' string-conv: -any snap-core: <1.1.0.0 raw-strings-qq: ! '>=1.0.2' mtl: -any transformers: -any all-versions: - 0.1.0.0 - 0.2.0.0 - 0.3.0.0 - 0.4.0.0 - 0.4.1.0 - 0.5.1.0 - 0.5.2.0 - 0.5.2.3 author: Alfredo Di Napoli latest: 0.5.2.3 description-type: haddock description: Automatic (re)compilation of purescript projects license-name: MIT
homepage: '' changelog-type: '' hash: 71f1b063364fe0eade75b6b7980dc01e97e7024695c8f8a56c33e978c749fc87 test-bench-deps: {} maintainer: alfredo.dinapoli@gmail.com synopsis: Automatic (re)compilation of purescript projects changelog: '' basic-deps: snap: '>=1.1.2.0' shelly: '>=0.4.1' base: '>=4.6 && <5.1' configurator: '>=0.2.0.0' text: '>0.11 && <1.4.0.0' string-conv: -any snap-core: <1.1.0.0 raw-strings-qq: '>=1.0.2' mtl: -any transformers: -any all-versions: - 0.1.0.0 - 0.2.0.0 - 0.3.0.0 - 0.4.0.0 - 0.4.1.0 - 0.5.1.0 - 0.5.2.0 - 0.5.2.3 - 0.6.0.0 author: Alfredo Di Napoli latest: 0.6.0.0 description-type: haddock description: Automatic (re)compilation of purescript projects license-name: MIT
Update from Hackage at 2021-04-09T13:56:15Z
Update from Hackage at 2021-04-09T13:56:15Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: '' changelog-type: '' hash: f2a5e27c73500f5708a6d3ba1d1a16c1a530b1ed01629790bcdde6efb45a6a8a test-bench-deps: {} maintainer: alfredo.dinapoli@gmail.com synopsis: Automatic (re)compilation of purescript projects changelog: '' basic-deps: snap: ! '>=1.1.2.0' shelly: ! '>=0.4.1' base: ! '>=4.6 && <5.1' configurator: ! '>=0.2.0.0' text: ! '>0.11 && <1.4.0.0' string-conv: -any snap-core: <1.1.0.0 raw-strings-qq: ! '>=1.0.2' mtl: -any transformers: -any all-versions: - 0.1.0.0 - 0.2.0.0 - 0.3.0.0 - 0.4.0.0 - 0.4.1.0 - 0.5.1.0 - 0.5.2.0 - 0.5.2.3 author: Alfredo Di Napoli latest: 0.5.2.3 description-type: haddock description: Automatic (re)compilation of purescript projects license-name: MIT ## Instruction: Update from Hackage at 2021-04-09T13:56:15Z ## Code After: homepage: '' changelog-type: '' hash: 71f1b063364fe0eade75b6b7980dc01e97e7024695c8f8a56c33e978c749fc87 test-bench-deps: {} maintainer: alfredo.dinapoli@gmail.com synopsis: Automatic (re)compilation of purescript projects changelog: '' basic-deps: snap: '>=1.1.2.0' shelly: '>=0.4.1' base: '>=4.6 && <5.1' configurator: '>=0.2.0.0' text: '>0.11 && <1.4.0.0' string-conv: -any snap-core: <1.1.0.0 raw-strings-qq: '>=1.0.2' mtl: -any transformers: -any all-versions: - 0.1.0.0 - 0.2.0.0 - 0.3.0.0 - 0.4.0.0 - 0.4.1.0 - 0.5.1.0 - 0.5.2.0 - 0.5.2.3 - 0.6.0.0 author: Alfredo Di Napoli latest: 0.6.0.0 description-type: haddock description: Automatic (re)compilation of purescript projects license-name: MIT
homepage: '' changelog-type: '' - hash: f2a5e27c73500f5708a6d3ba1d1a16c1a530b1ed01629790bcdde6efb45a6a8a + hash: 71f1b063364fe0eade75b6b7980dc01e97e7024695c8f8a56c33e978c749fc87 test-bench-deps: {} maintainer: alfredo.dinapoli@gmail.com synopsis: Automatic (re)compilation of purescript projects changelog: '' basic-deps: - snap: ! '>=1.1.2.0' ? -- + snap: '>=1.1.2.0' - shelly: ! '>=0.4.1' ? -- + shelly: '>=0.4.1' - base: ! '>=4.6 && <5.1' ? -- + base: '>=4.6 && <5.1' - configurator: ! '>=0.2.0.0' ? -- + configurator: '>=0.2.0.0' - text: ! '>0.11 && <1.4.0.0' ? -- + text: '>0.11 && <1.4.0.0' string-conv: -any snap-core: <1.1.0.0 - raw-strings-qq: ! '>=1.0.2' ? -- + raw-strings-qq: '>=1.0.2' mtl: -any transformers: -any all-versions: - 0.1.0.0 - 0.2.0.0 - 0.3.0.0 - 0.4.0.0 - 0.4.1.0 - 0.5.1.0 - 0.5.2.0 - 0.5.2.3 + - 0.6.0.0 author: Alfredo Di Napoli - latest: 0.5.2.3 ? ^ ^ ^ + latest: 0.6.0.0 ? ^ ^ ^ description-type: haddock description: Automatic (re)compilation of purescript projects license-name: MIT
17
0.53125
9
8
cdf7add34d2179813b2325317fc4d54a01266dd7
tsan_suppressions.txt
tsan_suppressions.txt
race:crossbeam_epoch::internal::Global::collect # Arc::drop is not properly detected by TSAN due to the use # of a raw atomic Acquire fence after the strong-count # atomic subtraction with a Release fence in the Drop impl. race:Arc*drop # lazy_static and thread_local rely on implicit barriers not # picked-up by TSAN race:lazy_static race:std::thread::local # tsan doesn't seem to pick up parking_lot RwLock-protected accesses # that sometimes use lock elision race:current_iobuf
race:sled::ebr::internal::Global::collect # Arc::drop is not properly detected by TSAN due to the use # of a raw atomic Acquire fence after the strong-count # atomic subtraction with a Release fence in the Drop impl. race:Arc*drop # lazy_static and thread_local rely on implicit barriers not # picked-up by TSAN race:lazy_static race:std::thread::local
Update TSAN suppressions file for the new location of the EBR
Update TSAN suppressions file for the new location of the EBR
Text
apache-2.0
spacejam/sled,spacejam/sled,spacejam/sled
text
## Code Before: race:crossbeam_epoch::internal::Global::collect # Arc::drop is not properly detected by TSAN due to the use # of a raw atomic Acquire fence after the strong-count # atomic subtraction with a Release fence in the Drop impl. race:Arc*drop # lazy_static and thread_local rely on implicit barriers not # picked-up by TSAN race:lazy_static race:std::thread::local # tsan doesn't seem to pick up parking_lot RwLock-protected accesses # that sometimes use lock elision race:current_iobuf ## Instruction: Update TSAN suppressions file for the new location of the EBR ## Code After: race:sled::ebr::internal::Global::collect # Arc::drop is not properly detected by TSAN due to the use # of a raw atomic Acquire fence after the strong-count # atomic subtraction with a Release fence in the Drop impl. race:Arc*drop # lazy_static and thread_local rely on implicit barriers not # picked-up by TSAN race:lazy_static race:std::thread::local
- race:crossbeam_epoch::internal::Global::collect ? ^ ------------- + race:sled::ebr::internal::Global::collect ? ^^^^^^^^ # Arc::drop is not properly detected by TSAN due to the use # of a raw atomic Acquire fence after the strong-count # atomic subtraction with a Release fence in the Drop impl. race:Arc*drop # lazy_static and thread_local rely on implicit barriers not # picked-up by TSAN race:lazy_static race:std::thread::local - - # tsan doesn't seem to pick up parking_lot RwLock-protected accesses - # that sometimes use lock elision - race:current_iobuf
6
0.4
1
5
1f67ddb4222b45389b8cd92257c78ae9b3a7abb6
recipes/chruby_install.rb
recipes/chruby_install.rb
node.default['chruby_install']['users'] = { 'jason' => {} } include_recipe 'chruby_install::user'
node.default['chruby_install']['users'] = { 'jason' => { auto: true } } include_recipe 'chruby_install::user'
Add auto change to chruby recipe
Add auto change to chruby recipe
Ruby
mit
jasonblalock-cookbooks/dev_box
ruby
## Code Before: node.default['chruby_install']['users'] = { 'jason' => {} } include_recipe 'chruby_install::user' ## Instruction: Add auto change to chruby recipe ## Code After: node.default['chruby_install']['users'] = { 'jason' => { auto: true } } include_recipe 'chruby_install::user'
- node.default['chruby_install']['users'] = { 'jason' => {} } + node.default['chruby_install']['users'] = { 'jason' => { auto: true } } ? ++++++++++++ include_recipe 'chruby_install::user'
2
1
1
1
8cf628c0abf5da7c16a2200e5d641c43b470ebde
index.html
index.html
<!doctype html> <meta charset=utf-8> <title>Happy Birthday, Sindre!</title> <style> body { margin: 0; padding: 0; background-color: #eee; color: #333; font-family: helvetica; } canvas { position: absolute; } .hud { position: absolute; margin-left: 1em; } .hit { font-weight: bold; color: red; } footer { position: fixed; bottom: 4em; left: 2em; } .winimg { width: 100%; } </style> <div class="hud"> <h1 id="level"></h1> <p>It's Sindre's Birthday! Hit the boxes!</p> <p id="score"></p> </div> <div id="webgl-container"></div> <footer> Based on <a href="http://codepen.io/chris-creditdesign/pen/emKQwY">a Codepen by chris-creditdesign</a> </footer> <script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.3.1/lodash.min.js"></script> <script src="game.js"></script>
<!doctype html> <meta charset=utf-8> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#000000"> <title>Happy Birthday, Sindre!</title> <style> body { margin: 0; padding: 0; background-color: #eee; color: #333; font-family: helvetica; } canvas { position: absolute; } .hud { position: absolute; margin-left: 1em; } .hit { font-weight: bold; color: red; } footer { position: fixed; bottom: 4em; left: 2em; } .winimg { width: 100%; } </style> <div class="hud"> <h1 id="level"></h1> <p>It's Sindre's Birthday! Hit the boxes!</p> <p id="score"></p> </div> <div id="webgl-container"></div> <footer> Based on <a href="http://codepen.io/chris-creditdesign/pen/emKQwY">a Codepen by chris-creditdesign</a> </footer> <script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.3.1/lodash.min.js"></script> <script src="game.js"></script>
Add meta viewport, theme color
Add meta viewport, theme color
HTML
mit
passy/sindrebday,passy/sindrebday
html
## Code Before: <!doctype html> <meta charset=utf-8> <title>Happy Birthday, Sindre!</title> <style> body { margin: 0; padding: 0; background-color: #eee; color: #333; font-family: helvetica; } canvas { position: absolute; } .hud { position: absolute; margin-left: 1em; } .hit { font-weight: bold; color: red; } footer { position: fixed; bottom: 4em; left: 2em; } .winimg { width: 100%; } </style> <div class="hud"> <h1 id="level"></h1> <p>It's Sindre's Birthday! Hit the boxes!</p> <p id="score"></p> </div> <div id="webgl-container"></div> <footer> Based on <a href="http://codepen.io/chris-creditdesign/pen/emKQwY">a Codepen by chris-creditdesign</a> </footer> <script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.3.1/lodash.min.js"></script> <script src="game.js"></script> ## Instruction: Add meta viewport, theme color ## Code After: <!doctype html> <meta charset=utf-8> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="theme-color" content="#000000"> <title>Happy Birthday, Sindre!</title> <style> body { margin: 0; padding: 0; background-color: #eee; color: #333; font-family: helvetica; } canvas { position: absolute; } .hud { position: absolute; margin-left: 1em; } .hit { font-weight: bold; color: red; } footer { position: fixed; bottom: 4em; left: 2em; } .winimg { width: 100%; } </style> <div class="hud"> <h1 id="level"></h1> <p>It's Sindre's Birthday! Hit the boxes!</p> <p id="score"></p> </div> <div id="webgl-container"></div> <footer> Based on <a href="http://codepen.io/chris-creditdesign/pen/emKQwY">a Codepen by chris-creditdesign</a> </footer> <script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.3.1/lodash.min.js"></script> <script src="game.js"></script>
<!doctype html> <meta charset=utf-8> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <meta name="theme-color" content="#000000"> <title>Happy Birthday, Sindre!</title> + <style> body { margin: 0; padding: 0; background-color: #eee; color: #333; font-family: helvetica; } canvas { position: absolute; } .hud { position: absolute; margin-left: 1em; } .hit { font-weight: bold; color: red; } footer { position: fixed; bottom: 4em; left: 2em; } .winimg { width: 100%; } </style> <div class="hud"> <h1 id="level"></h1> <p>It's Sindre's Birthday! Hit the boxes!</p> <p id="score"></p> </div> <div id="webgl-container"></div> <footer> Based on <a href="http://codepen.io/chris-creditdesign/pen/emKQwY">a Codepen by chris-creditdesign</a> </footer> <script src="//cdnjs.cloudflare.com/ajax/libs/three.js/r70/three.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.3.1/lodash.min.js"></script> <script src="game.js"></script>
3
0.055556
3
0
2313efa85a70473eb43da99adb1f4d10fe8dde5b
tenant.properties
tenant.properties
template.tenant.shortname= # The short name for the new tenant to be created tenant.shortname= # The ID for the new tenant to be created # (currently an integer; e.g. '5', '23') tenant.id= # The internet domain for the new tenant to be created tenant.internet.domain=
template.tenant.shortname= # The short name for the new tenant to be created # ex. tenant.shortname=mymuseum tenant.shortname= # The ID for the new tenant to be created # (currently an integer; e.g. 5, 23) # ex. tenant.id=5 tenant.id= # The internet domain for the new tenant to be created # ex. tenant.internet.domain=mymuseum.example.org tenant.internet.domain=
Add verbose comments and examples to ant properties file
Add verbose comments and examples to ant properties file
INI
apache-2.0
cherryhill/collectionspace-services,cherryhill/collectionspace-services
ini
## Code Before: template.tenant.shortname= # The short name for the new tenant to be created tenant.shortname= # The ID for the new tenant to be created # (currently an integer; e.g. '5', '23') tenant.id= # The internet domain for the new tenant to be created tenant.internet.domain= ## Instruction: Add verbose comments and examples to ant properties file ## Code After: template.tenant.shortname= # The short name for the new tenant to be created # ex. tenant.shortname=mymuseum tenant.shortname= # The ID for the new tenant to be created # (currently an integer; e.g. 5, 23) # ex. tenant.id=5 tenant.id= # The internet domain for the new tenant to be created # ex. tenant.internet.domain=mymuseum.example.org tenant.internet.domain=
template.tenant.shortname= # The short name for the new tenant to be created + # ex. tenant.shortname=mymuseum tenant.shortname= # The ID for the new tenant to be created - # (currently an integer; e.g. '5', '23') ? - - - - + # (currently an integer; e.g. 5, 23) + # ex. tenant.id=5 tenant.id= # The internet domain for the new tenant to be created + # ex. tenant.internet.domain=mymuseum.example.org tenant.internet.domain=
5
0.416667
4
1
bfb029f6ff779c828039be7f0d1eb061376d5006
tests/testCaseSingleton.h
tests/testCaseSingleton.h
class IEngine { public: virtual double getVolume() const = 0; virtual ~IEngine() = default; }; class Engine : public IEngine { public: virtual double getVolume() const override { return 10.5; } }; TEST_CASE( "Singleton Test", "Check if two instances of a registered singleton are equal" ){ CppDiFactory::DiFactory myFactory; myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); auto engine = myFactory.getInstance<IEngine>(); auto engine2 = myFactory.getInstance<IEngine>(); CHECK(engine == engine2); } #endif // TESTCASESINGLETON_H
namespace testCaseSingleton { class IEngine { public: virtual double getVolume() const = 0; virtual ~IEngine() = default; }; class Engine : public IEngine { private: static bool _valid; public: Engine() { _valid = true; } virtual ~Engine () { _valid = false; } virtual double getVolume() const override { return 10.5; } static bool isValid() { return _valid; } }; bool Engine::_valid = false; TEST_CASE( "Singleton Test", "Check if two instances of a registered singleton are equal" ){ CppDiFactory::DiFactory myFactory; myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); auto engine = myFactory.getInstance<IEngine>(); auto engine2 = myFactory.getInstance<IEngine>(); CHECK(engine == engine2); } TEST_CASE( "Singleton Lifetime test", "Check that the lifetime of the singleton is correct (alive while used)" ){ CppDiFactory::DiFactory myFactory; myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); std::shared_ptr<IEngine> spEngine; std::weak_ptr<IEngine> wpEngine; // no request yet --> Engine shouldn't exist yet. CHECK(!Engine::isValid()); //NOTE: use sub-block to ensure that no temporary shared-pointers remain alive { //First call to getInstance should create the engine spEngine = myFactory.getInstance<IEngine>(); CHECK(Engine::isValid()); } //shared pointer is alive --> engine should still exist //NOTE: use sub-block to ensure that no temporary shared-pointers remain alive { CHECK(Engine::isValid()); //second call should get same instance wpEngine = myFactory.getInstance<IEngine>(); CHECK(wpEngine.lock() == spEngine); } //remove the only shared pointer to the engine (--> engine should get destroyed) spEngine.reset(); //shared pointer is not alive anymore --> engine should have been destroyed. CHECK(wpEngine.expired()); CHECK(!Engine::isValid()); } } #endif // TESTCASESINGLETON_H
Add tests for singleton lifetime
Add tests for singleton lifetime
C
apache-2.0
bbvch/CppDiFactory
c
## Code Before: class IEngine { public: virtual double getVolume() const = 0; virtual ~IEngine() = default; }; class Engine : public IEngine { public: virtual double getVolume() const override { return 10.5; } }; TEST_CASE( "Singleton Test", "Check if two instances of a registered singleton are equal" ){ CppDiFactory::DiFactory myFactory; myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); auto engine = myFactory.getInstance<IEngine>(); auto engine2 = myFactory.getInstance<IEngine>(); CHECK(engine == engine2); } #endif // TESTCASESINGLETON_H ## Instruction: Add tests for singleton lifetime ## Code After: namespace testCaseSingleton { class IEngine { public: virtual double getVolume() const = 0; virtual ~IEngine() = default; }; class Engine : public IEngine { private: static bool _valid; public: Engine() { _valid = true; } virtual ~Engine () { _valid = false; } virtual double getVolume() const override { return 10.5; } static bool isValid() { return _valid; } }; bool Engine::_valid = false; TEST_CASE( "Singleton Test", "Check if two instances of a registered singleton are equal" ){ CppDiFactory::DiFactory myFactory; myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); auto engine = myFactory.getInstance<IEngine>(); auto engine2 = myFactory.getInstance<IEngine>(); CHECK(engine == engine2); } TEST_CASE( "Singleton Lifetime test", "Check that the lifetime of the singleton is correct (alive while used)" ){ CppDiFactory::DiFactory myFactory; myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); std::shared_ptr<IEngine> spEngine; std::weak_ptr<IEngine> wpEngine; // no request yet --> Engine shouldn't exist yet. CHECK(!Engine::isValid()); //NOTE: use sub-block to ensure that no temporary shared-pointers remain alive { //First call to getInstance should create the engine spEngine = myFactory.getInstance<IEngine>(); CHECK(Engine::isValid()); } //shared pointer is alive --> engine should still exist //NOTE: use sub-block to ensure that no temporary shared-pointers remain alive { CHECK(Engine::isValid()); //second call should get same instance wpEngine = myFactory.getInstance<IEngine>(); CHECK(wpEngine.lock() == spEngine); } //remove the only shared pointer to the engine (--> engine should get destroyed) spEngine.reset(); //shared pointer is not alive anymore --> engine should have been destroyed. CHECK(wpEngine.expired()); CHECK(!Engine::isValid()); } } #endif // TESTCASESINGLETON_H
+ + namespace testCaseSingleton + { + class IEngine { public: virtual double getVolume() const = 0; virtual ~IEngine() = default; }; class Engine : public IEngine { + private: + static bool _valid; public: + Engine() { _valid = true; } + virtual ~Engine () { _valid = false; } + virtual double getVolume() const override { return 10.5; } + + static bool isValid() { return _valid; } }; - + bool Engine::_valid = false; TEST_CASE( "Singleton Test", "Check if two instances of a registered singleton are equal" ){ - CppDiFactory::DiFactory myFactory; ? ^ + CppDiFactory::DiFactory myFactory; ? ^^^^ - myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); ? ^ + myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); ? ^^^^ - auto engine = myFactory.getInstance<IEngine>(); ? ^ + auto engine = myFactory.getInstance<IEngine>(); ? ^^^^ - auto engine2 = myFactory.getInstance<IEngine>(); ? ^ + auto engine2 = myFactory.getInstance<IEngine>(); ? ^^^^ - CHECK(engine == engine2); ? ^ + CHECK(engine == engine2); ? ^^^^ + } + + TEST_CASE( "Singleton Lifetime test", "Check that the lifetime of the singleton is correct (alive while used)" ){ + + CppDiFactory::DiFactory myFactory; + myFactory.registerSingleton<Engine>().withInterfaces<IEngine>(); + + std::shared_ptr<IEngine> spEngine; + std::weak_ptr<IEngine> wpEngine; + + // no request yet --> Engine shouldn't exist yet. + CHECK(!Engine::isValid()); + + //NOTE: use sub-block to ensure that no temporary shared-pointers remain alive + { + //First call to getInstance should create the engine + spEngine = myFactory.getInstance<IEngine>(); + CHECK(Engine::isValid()); + } + + //shared pointer is alive --> engine should still exist + //NOTE: use sub-block to ensure that no temporary shared-pointers remain alive + { + CHECK(Engine::isValid()); + + //second call should get same instance + wpEngine = myFactory.getInstance<IEngine>(); + CHECK(wpEngine.lock() == spEngine); + } + + //remove the only shared pointer to the engine (--> engine should get destroyed) + spEngine.reset(); + + //shared pointer is not alive anymore --> engine should have been destroyed. + CHECK(wpEngine.expired()); + CHECK(!Engine::isValid()); + } + } #endif // TESTCASESINGLETON_H
61
1.967742
55
6
c015b33013f5972947829bcf6806a5b099f75ee8
.travis.yml
.travis.yml
language: go go: - 1.3 - tip install: make deps script: make test matrix: allow_failures: - go: tip notifications: slack: secure: IXaOhnCq7GHFQjGWxCv+XPOKRLn9GWWmUhZNaa97Fbrtfz4BL1oNKJ3Cz+7hlj4FY2qRpiyklLJxNxLcWLdR5n1t2uOYZMT05+YNpanRQO2mKANhZlFNle840FAAGU9tLgnkoubY4NcAz9KCeucqz/Wd7vIoVkBEnd9l5f/WwTU=
language: go go: - 1.3 - tip install: make deps before_script: - git --version script: make test matrix: allow_failures: - go: tip notifications: slack: secure: IXaOhnCq7GHFQjGWxCv+XPOKRLn9GWWmUhZNaa97Fbrtfz4BL1oNKJ3Cz+7hlj4FY2qRpiyklLJxNxLcWLdR5n1t2uOYZMT05+YNpanRQO2mKANhZlFNle840FAAGU9tLgnkoubY4NcAz9KCeucqz/Wd7vIoVkBEnd9l5f/WwTU=
Print git version before build
Print git version before build
YAML
agpl-3.0
gitorious/git-archive-daemon,Gitorious-backup/git-archive-daemon,Gitorious-backup/git-archive-daemon,gitorious/git-archive-daemon
yaml
## Code Before: language: go go: - 1.3 - tip install: make deps script: make test matrix: allow_failures: - go: tip notifications: slack: secure: IXaOhnCq7GHFQjGWxCv+XPOKRLn9GWWmUhZNaa97Fbrtfz4BL1oNKJ3Cz+7hlj4FY2qRpiyklLJxNxLcWLdR5n1t2uOYZMT05+YNpanRQO2mKANhZlFNle840FAAGU9tLgnkoubY4NcAz9KCeucqz/Wd7vIoVkBEnd9l5f/WwTU= ## Instruction: Print git version before build ## Code After: language: go go: - 1.3 - tip install: make deps before_script: - git --version script: make test matrix: allow_failures: - go: tip notifications: slack: secure: IXaOhnCq7GHFQjGWxCv+XPOKRLn9GWWmUhZNaa97Fbrtfz4BL1oNKJ3Cz+7hlj4FY2qRpiyklLJxNxLcWLdR5n1t2uOYZMT05+YNpanRQO2mKANhZlFNle840FAAGU9tLgnkoubY4NcAz9KCeucqz/Wd7vIoVkBEnd9l5f/WwTU=
language: go go: - 1.3 - tip install: make deps + before_script: + - git --version script: make test matrix: allow_failures: - go: tip notifications: slack: secure: IXaOhnCq7GHFQjGWxCv+XPOKRLn9GWWmUhZNaa97Fbrtfz4BL1oNKJ3Cz+7hlj4FY2qRpiyklLJxNxLcWLdR5n1t2uOYZMT05+YNpanRQO2mKANhZlFNle840FAAGU9tLgnkoubY4NcAz9KCeucqz/Wd7vIoVkBEnd9l5f/WwTU=
2
0.153846
2
0
29fe72cf753ca904fe9c38c5548405e055f4eb65
config-sample/mongo.init.js
config-sample/mongo.init.js
// WARNING This script creates MongoDB users and their permissions // as required by TresDB development. Do not use this script in production // without careful modification of all the credentials below. // NOTE This script needs a MongoDB instance without --auth flag // to be running and listening the default port. conn = new Mongo(); admin = conn.getDB('admin'); admin.createUser({ user: 'mongoadmin', pwd: 'mongoadminpwd', roles: ['userAdminAnyDatabase'] }); tresdb = admin.getSiblingDB('tresdb'); tresdb.createUser({ user: 'mongouser', pwd: 'mongouserpwd', roles: ['readWrite'] }); testdb = admin.getSiblingDB('test'); testdb.createUser({ user: 'testuser', pwd: 'testuserpwd', roles: ['readWrite'] });
// WARNING This script creates MongoDB users and their permissions // as required by TresDB development. Do not use this script in production // without careful modification of all the credentials below. // NOTE This script needs a MongoDB instance without --auth flag // to be running and listening the default port. conn = new Mongo(); admin = conn.getDB('admin'); admin.createUser({ user: 'mongoadmin', pwd: 'mongoadminpwd', roles: ['userAdminAnyDatabase', 'backup'] }); tresdb = admin.getSiblingDB('tresdb'); tresdb.createUser({ user: 'mongouser', pwd: 'mongouserpwd', roles: ['readWrite'] }); testdb = admin.getSiblingDB('test'); testdb.createUser({ user: 'testuser', pwd: 'testuserpwd', roles: ['readWrite'] });
Add backup role to enable mongodump
Add backup role to enable mongodump
JavaScript
mit
axelpale/tresdb,axelpale/tresdb
javascript
## Code Before: // WARNING This script creates MongoDB users and their permissions // as required by TresDB development. Do not use this script in production // without careful modification of all the credentials below. // NOTE This script needs a MongoDB instance without --auth flag // to be running and listening the default port. conn = new Mongo(); admin = conn.getDB('admin'); admin.createUser({ user: 'mongoadmin', pwd: 'mongoadminpwd', roles: ['userAdminAnyDatabase'] }); tresdb = admin.getSiblingDB('tresdb'); tresdb.createUser({ user: 'mongouser', pwd: 'mongouserpwd', roles: ['readWrite'] }); testdb = admin.getSiblingDB('test'); testdb.createUser({ user: 'testuser', pwd: 'testuserpwd', roles: ['readWrite'] }); ## Instruction: Add backup role to enable mongodump ## Code After: // WARNING This script creates MongoDB users and their permissions // as required by TresDB development. Do not use this script in production // without careful modification of all the credentials below. // NOTE This script needs a MongoDB instance without --auth flag // to be running and listening the default port. conn = new Mongo(); admin = conn.getDB('admin'); admin.createUser({ user: 'mongoadmin', pwd: 'mongoadminpwd', roles: ['userAdminAnyDatabase', 'backup'] }); tresdb = admin.getSiblingDB('tresdb'); tresdb.createUser({ user: 'mongouser', pwd: 'mongouserpwd', roles: ['readWrite'] }); testdb = admin.getSiblingDB('test'); testdb.createUser({ user: 'testuser', pwd: 'testuserpwd', roles: ['readWrite'] });
// WARNING This script creates MongoDB users and their permissions // as required by TresDB development. Do not use this script in production // without careful modification of all the credentials below. // NOTE This script needs a MongoDB instance without --auth flag // to be running and listening the default port. conn = new Mongo(); admin = conn.getDB('admin'); admin.createUser({ user: 'mongoadmin', pwd: 'mongoadminpwd', - roles: ['userAdminAnyDatabase'] + roles: ['userAdminAnyDatabase', 'backup'] ? ++++++++++ }); tresdb = admin.getSiblingDB('tresdb'); tresdb.createUser({ user: 'mongouser', pwd: 'mongouserpwd', roles: ['readWrite'] }); testdb = admin.getSiblingDB('test'); testdb.createUser({ user: 'testuser', pwd: 'testuserpwd', roles: ['readWrite'] });
2
0.083333
1
1
f9d787a45976c8dc0eafb564a67124d6b385293a
src/dotnetcore/integration/deploy_app_with_multiple_projects_test.go
src/dotnetcore/integration/deploy_app_with_multiple_projects_test.go
package integration_test import ( "path/filepath" "github.com/cloudfoundry/libbuildpack/cutlass" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("CF Dotnet Buildpack", func() { var ( app *cutlass.App fixtureName string ) AfterEach(func() { app = DestroyApp(app) }) JustBeforeEach(func() { app = cutlass.New(filepath.Join(bpDir, "fixtures", fixtureName)) }) Context("Deploying an app with multiple projects", func() { BeforeEach(func() { fixtureName = "multiple_projects_msbuild" }) It("compiles both apps", func() { PushAppAndConfirm(app) Expect(app.GetBody("/")).To(ContainSubstring("Hello, I'm a string!")) Expect(app.Stdout.String()).To(ContainSubstring("Hello from a secondary project!")) }) }) })
package integration_test import ( "path/filepath" "time" "github.com/cloudfoundry/libbuildpack/cutlass" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("CF Dotnet Buildpack", func() { var ( app *cutlass.App fixtureName string ) AfterEach(func() { app = DestroyApp(app) }) JustBeforeEach(func() { app = cutlass.New(filepath.Join(bpDir, "fixtures", fixtureName)) }) Context("Deploying an app with multiple projects", func() { BeforeEach(func() { fixtureName = "multiple_projects_msbuild" }) It("compiles both apps", func() { PushAppAndConfirm(app) Expect(app.GetBody("/")).To(ContainSubstring("Hello, I'm a string!")) Eventually(app.Stdout.String, 10*time.Second).Should(ContainSubstring("Hello from a secondary project!")) }) }) })
Test correctly waits for expected log output
Test correctly waits for expected log output [#153093345]
Go
apache-2.0
cloudfoundry-community/asp.net5-buildpack
go
## Code Before: package integration_test import ( "path/filepath" "github.com/cloudfoundry/libbuildpack/cutlass" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("CF Dotnet Buildpack", func() { var ( app *cutlass.App fixtureName string ) AfterEach(func() { app = DestroyApp(app) }) JustBeforeEach(func() { app = cutlass.New(filepath.Join(bpDir, "fixtures", fixtureName)) }) Context("Deploying an app with multiple projects", func() { BeforeEach(func() { fixtureName = "multiple_projects_msbuild" }) It("compiles both apps", func() { PushAppAndConfirm(app) Expect(app.GetBody("/")).To(ContainSubstring("Hello, I'm a string!")) Expect(app.Stdout.String()).To(ContainSubstring("Hello from a secondary project!")) }) }) }) ## Instruction: Test correctly waits for expected log output [#153093345] ## Code After: package integration_test import ( "path/filepath" "time" "github.com/cloudfoundry/libbuildpack/cutlass" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("CF Dotnet Buildpack", func() { var ( app *cutlass.App fixtureName string ) AfterEach(func() { app = DestroyApp(app) }) JustBeforeEach(func() { app = cutlass.New(filepath.Join(bpDir, "fixtures", fixtureName)) }) Context("Deploying an app with multiple projects", func() { BeforeEach(func() { fixtureName = "multiple_projects_msbuild" }) It("compiles both apps", func() { PushAppAndConfirm(app) Expect(app.GetBody("/")).To(ContainSubstring("Hello, I'm a string!")) Eventually(app.Stdout.String, 10*time.Second).Should(ContainSubstring("Hello from a secondary project!")) }) }) })
package integration_test import ( "path/filepath" + "time" "github.com/cloudfoundry/libbuildpack/cutlass" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("CF Dotnet Buildpack", func() { var ( app *cutlass.App fixtureName string ) AfterEach(func() { app = DestroyApp(app) }) JustBeforeEach(func() { app = cutlass.New(filepath.Join(bpDir, "fixtures", fixtureName)) }) Context("Deploying an app with multiple projects", func() { BeforeEach(func() { fixtureName = "multiple_projects_msbuild" }) It("compiles both apps", func() { PushAppAndConfirm(app) Expect(app.GetBody("/")).To(ContainSubstring("Hello, I'm a string!")) - Expect(app.Stdout.String()).To(ContainSubstring("Hello from a secondary project!")) ? ^^ ^ ^^ ^ + Eventually(app.Stdout.String, 10*time.Second).Should(ContainSubstring("Hello from a secondary project!")) ? ^ ^ +++++ ^^^^^^^^^^^^^^^^ ^^ +++ }) }) })
3
0.090909
2
1
5f5a98c39988cb915c26165e50994323ace74224
lib/lims-laboratory-app/laboratory/sample/swap_samples.rb
lib/lims-laboratory-app/laboratory/sample/swap_samples.rb
require 'lims-core/actions/action' module Lims::LaboratoryApp module Laboratory class Sample class SwapSamples include Lims::Core::Actions::Action attribute :swap_samples, Array, :required => true, :writer => :private def _call_in_session(session) resources = [] swap_samples.each do |swap_sample| resource = swap_sample["resource"] swaps = swap_sample["swaps"] swaps.each do |old_sample_uuid, new_sample_uuid| old_sample = session[old_sample_uuid] new_sample = session[new_sample_uuid] # For plates, tube_racks... if resource.is_a?(Container) resource.each do |aliquots| if aliquots aliquots.each do |aliquot| if aliquot.sample == old_sample aliquot.sample = new_sample end end end end # For tubes, spin columns... else resource.each do |aliquot| if aliquot.sample == old_sample aliquot.sample = new_sample end end end resources << resource end end {:resources => resources} end end end end end
require 'lims-core/actions/action' module Lims::LaboratoryApp module Laboratory class Sample InvalidSample = Class.new(StandardError) class SwapSamples include Lims::Core::Actions::Action attribute :swap_samples, Array, :required => true, :writer => :private def _call_in_session(session) resources = [] swap_samples.each do |swap_sample| resource = swap_sample["resource"] swaps = swap_sample["swaps"] swaps.each do |old_sample_uuid, new_sample_uuid| old_sample = session[old_sample_uuid] new_sample = session[new_sample_uuid] raise InvalidSample, "The sample #{old_sample_uuid} cannot be found" unless old_sample raise InvalidSample, "The sample #{new_sample_uuid} cannot be found" unless new_sample # For plates, tube_racks... if resource.is_a?(Container) resource.each do |aliquots| if aliquots aliquots.each do |aliquot| if aliquot.sample == old_sample aliquot.sample = new_sample end end end end # For tubes, spin columns... else resource.each do |aliquot| if aliquot.sample == old_sample aliquot.sample = new_sample end end end resources << resource end end {:resources => resources} end end end end end
Raise an error if one of the sample cannot be found
Raise an error if one of the sample cannot be found
Ruby
mit
sanger/lims-laboratory-app,sanger/lims-laboratory-app,sanger/lims-laboratory-app
ruby
## Code Before: require 'lims-core/actions/action' module Lims::LaboratoryApp module Laboratory class Sample class SwapSamples include Lims::Core::Actions::Action attribute :swap_samples, Array, :required => true, :writer => :private def _call_in_session(session) resources = [] swap_samples.each do |swap_sample| resource = swap_sample["resource"] swaps = swap_sample["swaps"] swaps.each do |old_sample_uuid, new_sample_uuid| old_sample = session[old_sample_uuid] new_sample = session[new_sample_uuid] # For plates, tube_racks... if resource.is_a?(Container) resource.each do |aliquots| if aliquots aliquots.each do |aliquot| if aliquot.sample == old_sample aliquot.sample = new_sample end end end end # For tubes, spin columns... else resource.each do |aliquot| if aliquot.sample == old_sample aliquot.sample = new_sample end end end resources << resource end end {:resources => resources} end end end end end ## Instruction: Raise an error if one of the sample cannot be found ## Code After: require 'lims-core/actions/action' module Lims::LaboratoryApp module Laboratory class Sample InvalidSample = Class.new(StandardError) class SwapSamples include Lims::Core::Actions::Action attribute :swap_samples, Array, :required => true, :writer => :private def _call_in_session(session) resources = [] swap_samples.each do |swap_sample| resource = swap_sample["resource"] swaps = swap_sample["swaps"] swaps.each do |old_sample_uuid, new_sample_uuid| old_sample = session[old_sample_uuid] new_sample = session[new_sample_uuid] raise InvalidSample, "The sample #{old_sample_uuid} cannot be found" unless old_sample raise InvalidSample, "The sample #{new_sample_uuid} cannot be found" unless new_sample # For plates, tube_racks... if resource.is_a?(Container) resource.each do |aliquots| if aliquots aliquots.each do |aliquot| if aliquot.sample == old_sample aliquot.sample = new_sample end end end end # For tubes, spin columns... else resource.each do |aliquot| if aliquot.sample == old_sample aliquot.sample = new_sample end end end resources << resource end end {:resources => resources} end end end end end
require 'lims-core/actions/action' module Lims::LaboratoryApp module Laboratory class Sample + + InvalidSample = Class.new(StandardError) + class SwapSamples include Lims::Core::Actions::Action attribute :swap_samples, Array, :required => true, :writer => :private def _call_in_session(session) resources = [] swap_samples.each do |swap_sample| resource = swap_sample["resource"] swaps = swap_sample["swaps"] swaps.each do |old_sample_uuid, new_sample_uuid| old_sample = session[old_sample_uuid] new_sample = session[new_sample_uuid] + + raise InvalidSample, "The sample #{old_sample_uuid} cannot be found" unless old_sample + raise InvalidSample, "The sample #{new_sample_uuid} cannot be found" unless new_sample # For plates, tube_racks... if resource.is_a?(Container) resource.each do |aliquots| if aliquots aliquots.each do |aliquot| if aliquot.sample == old_sample aliquot.sample = new_sample end end end end # For tubes, spin columns... else resource.each do |aliquot| if aliquot.sample == old_sample aliquot.sample = new_sample end end end resources << resource end end {:resources => resources} end end end end end
6
0.117647
6
0
284c177fdc84906dcecc2f4770ac979377255a45
atmega32a/ddr_pin_port_1/main.c
atmega32a/ddr_pin_port_1/main.c
/* * @file main.c * @brief Set PORTC I/O pins using data direction register, * read input from pins and set high PORTC.0 2 and 3 * if input pin PORTC.6 is high. * @date 06 Jun 2016 10:28 PM */ #include <avr/io.h> #include <util/delay.h> #define __DELAY_BACKWARD_COMPATIBLE__ #ifndef F_CPU #define F_CPU 16000000UL /* 16 MHz clock speed */ #endif int main(void) { DDRC = 0x0F; PORTC = 0x0C; /* lets assume a 4V supply comes to PORTC.6 and Vcc = 5V */ if (PINC == 0b01000000) { PORTC = 0x0B; _delay_ms(1000); /* delay 1s */ } else { PORTC = 0x00; } return 0; }
/* * @file main.c * @brief Set PORTC I/O pins using data direction register, * read input from pins and set high PORTC.0 2 and 3 * if input pin PORTC.6 is high. * @date 06 Jun 2016 10:28 PM */ #define __DELAY_BACKWARD_COMPATIBLE__ #ifndef F_CPU #define F_CPU 16000000UL /* 16 MHz clock speed */ #endif #include <avr/io.h> #include <util/delay.h> int main(void) { DDRC = 0x0F; PORTC = 0x0C; /* lets assume a 4V supply comes to PORTC.6 and Vcc = 5V */ if (PINC == 0b01000000) { PORTC = 0x0B; _delay_ms(1000); /* delay 1s */ } else { PORTC = 0x00; } return 0; }
Define clock frequency before includes
Define clock frequency before includes
C
lgpl-2.1
spinlockirqsave/avr
c
## Code Before: /* * @file main.c * @brief Set PORTC I/O pins using data direction register, * read input from pins and set high PORTC.0 2 and 3 * if input pin PORTC.6 is high. * @date 06 Jun 2016 10:28 PM */ #include <avr/io.h> #include <util/delay.h> #define __DELAY_BACKWARD_COMPATIBLE__ #ifndef F_CPU #define F_CPU 16000000UL /* 16 MHz clock speed */ #endif int main(void) { DDRC = 0x0F; PORTC = 0x0C; /* lets assume a 4V supply comes to PORTC.6 and Vcc = 5V */ if (PINC == 0b01000000) { PORTC = 0x0B; _delay_ms(1000); /* delay 1s */ } else { PORTC = 0x00; } return 0; } ## Instruction: Define clock frequency before includes ## Code After: /* * @file main.c * @brief Set PORTC I/O pins using data direction register, * read input from pins and set high PORTC.0 2 and 3 * if input pin PORTC.6 is high. * @date 06 Jun 2016 10:28 PM */ #define __DELAY_BACKWARD_COMPATIBLE__ #ifndef F_CPU #define F_CPU 16000000UL /* 16 MHz clock speed */ #endif #include <avr/io.h> #include <util/delay.h> int main(void) { DDRC = 0x0F; PORTC = 0x0C; /* lets assume a 4V supply comes to PORTC.6 and Vcc = 5V */ if (PINC == 0b01000000) { PORTC = 0x0B; _delay_ms(1000); /* delay 1s */ } else { PORTC = 0x00; } return 0; }
/* * @file main.c * @brief Set PORTC I/O pins using data direction register, * read input from pins and set high PORTC.0 2 and 3 * if input pin PORTC.6 is high. * @date 06 Jun 2016 10:28 PM */ - #include <avr/io.h> - #include <util/delay.h> - - #define __DELAY_BACKWARD_COMPATIBLE__ #ifndef F_CPU #define F_CPU 16000000UL /* 16 MHz clock speed */ #endif + + #include <avr/io.h> + #include <util/delay.h> + int main(void) { DDRC = 0x0F; PORTC = 0x0C; /* lets assume a 4V supply comes to PORTC.6 and Vcc = 5V */ if (PINC == 0b01000000) { PORTC = 0x0B; _delay_ms(1000); /* delay 1s */ } else { PORTC = 0x00; } return 0; }
8
0.235294
4
4
6157e7c7381c025ae8abe7c1114a8d5b283829ba
spec/models/user_spec.rb
spec/models/user_spec.rb
require 'spec_helper' describe User do describe "associations" do it { should have_many(:subscriptions) } it { should have_many(:comics).through(:subscriptions) } end describe "validations" do it { should validate_presence_of(:username) } end describe "subscriptions" do let(:user) { Factory(:user) } let(:comic) { Factory(:comic) } it "has no subscribed comics" do user.subscriptions.should be_empty end it "can subscribe to a comic" do expect { user.subscribe!(comic) }.to change { user.subscriptions.count }.by(1) end it "cannot subscribe to the same comic twice" do user.subscribe!(comic) expect { user.subscribe!(comic) }.to_not change { user.subscriptions.count } end end end
require 'spec_helper' describe User do describe "associations" do it { should have_many(:subscriptions) } it { should have_many(:comics).through(:subscriptions) } end describe "validations" do it { should validate_presence_of(:username) } end describe "subscriptions" do let(:user) { Factory(:user) } let(:comic) { Factory(:comic) } it "has no subscribed comics" do user.subscriptions.should be_empty end it "can subscribe to a comic" do expect { user.subscribe!(comic) }.to change(user.subscriptions, :count).by(1) end it "cannot subscribe to the same comic twice" do user.subscribe!(comic) expect { user.subscribe!(comic) }.to_not change(user.subscriptions, :count) end end end
Update syntax of expect in User spec
Update syntax of expect in User spec - This is a better way of formatting the change expectation
Ruby
apache-2.0
martinisoft/funnies,martinisoft/funnies
ruby
## Code Before: require 'spec_helper' describe User do describe "associations" do it { should have_many(:subscriptions) } it { should have_many(:comics).through(:subscriptions) } end describe "validations" do it { should validate_presence_of(:username) } end describe "subscriptions" do let(:user) { Factory(:user) } let(:comic) { Factory(:comic) } it "has no subscribed comics" do user.subscriptions.should be_empty end it "can subscribe to a comic" do expect { user.subscribe!(comic) }.to change { user.subscriptions.count }.by(1) end it "cannot subscribe to the same comic twice" do user.subscribe!(comic) expect { user.subscribe!(comic) }.to_not change { user.subscriptions.count } end end end ## Instruction: Update syntax of expect in User spec - This is a better way of formatting the change expectation ## Code After: require 'spec_helper' describe User do describe "associations" do it { should have_many(:subscriptions) } it { should have_many(:comics).through(:subscriptions) } end describe "validations" do it { should validate_presence_of(:username) } end describe "subscriptions" do let(:user) { Factory(:user) } let(:comic) { Factory(:comic) } it "has no subscribed comics" do user.subscriptions.should be_empty end it "can subscribe to a comic" do expect { user.subscribe!(comic) }.to change(user.subscriptions, :count).by(1) end it "cannot subscribe to the same comic twice" do user.subscribe!(comic) expect { user.subscribe!(comic) }.to_not change(user.subscriptions, :count) end end end
require 'spec_helper' describe User do describe "associations" do it { should have_many(:subscriptions) } it { should have_many(:comics).through(:subscriptions) } end describe "validations" do it { should validate_presence_of(:username) } end describe "subscriptions" do let(:user) { Factory(:user) } let(:comic) { Factory(:comic) } it "has no subscribed comics" do user.subscriptions.should be_empty end it "can subscribe to a comic" do expect { user.subscribe!(comic) - }.to change { user.subscriptions.count }.by(1) ? ^^^ ^ ^^ + }.to change(user.subscriptions, :count).by(1) ? ^ ^^^ ^ end it "cannot subscribe to the same comic twice" do user.subscribe!(comic) expect { user.subscribe!(comic) - }.to_not change { user.subscriptions.count } ? ^^^ ^ ^^ + }.to_not change(user.subscriptions, :count) ? ^ ^^^ ^ end end end
4
0.114286
2
2
30812061de0d8b4a6087a7082194500dc0c63e32
CHANGELOG.rdoc
CHANGELOG.rdoc
= Changelog Per-release changes to Handler. == 0.8.0 (2009 Oct 12) First release.
= Changelog Per-release changes to GoogleCustomSearch. == 0.3.0 (2009 Oct 14) First release.
Fix changelog (was boilerplate copied from Handler gem).
Fix changelog (was boilerplate copied from Handler gem).
RDoc
mit
alexreisner/google_custom_search
rdoc
## Code Before: = Changelog Per-release changes to Handler. == 0.8.0 (2009 Oct 12) First release. ## Instruction: Fix changelog (was boilerplate copied from Handler gem). ## Code After: = Changelog Per-release changes to GoogleCustomSearch. == 0.3.0 (2009 Oct 14) First release.
= Changelog - Per-release changes to Handler. + Per-release changes to GoogleCustomSearch. - == 0.8.0 (2009 Oct 12) ? ^ ^ + == 0.3.0 (2009 Oct 14) ? ^ ^ First release.
4
0.5
2
2
593716bfc1230f3baee550dfe98bfad212d23798
lib/auth_plugins/mysql_clear_password.js
lib/auth_plugins/mysql_clear_password.js
'use strict' module.exports = pluginOptions => ({ connection, command }) => { const password = command.password || pluginOptions.password || connection.config.password; return Buffer.from(`${password}\0`) };
'use strict' module.exports = pluginOptions => ({ connection, command }) => { const password = command.password || pluginOptions.password || connection.config.password; const cleartextPassword = function(password) { return Buffer.from(`${password}\0`) }; return cleartextPassword(password) };
Change so that it returns a function instead of the password value
Change so that it returns a function instead of the password value
JavaScript
mit
sidorares/node-mysql2,sidorares/node-mysql2,sidorares/node-mysql2,sidorares/node-mysql2
javascript
## Code Before: 'use strict' module.exports = pluginOptions => ({ connection, command }) => { const password = command.password || pluginOptions.password || connection.config.password; return Buffer.from(`${password}\0`) }; ## Instruction: Change so that it returns a function instead of the password value ## Code After: 'use strict' module.exports = pluginOptions => ({ connection, command }) => { const password = command.password || pluginOptions.password || connection.config.password; const cleartextPassword = function(password) { return Buffer.from(`${password}\0`) }; return cleartextPassword(password) };
'use strict' module.exports = pluginOptions => ({ connection, command }) => { const password = command.password || pluginOptions.password || connection.config.password; + const cleartextPassword = function(password) { - return Buffer.from(`${password}\0`) + return Buffer.from(`${password}\0`) ? ++ + }; + + return cleartextPassword(password) };
6
0.75
5
1
ab232b3c5b5a684e04b5c5e17d5f36420fa253aa
src/CMakeLists.txt
src/CMakeLists.txt
include_directories(${LIBGGPK_SOURCE_DIR}/include/ggpk) add_library(libggpk Node.cpp Archive.cpp) # libggpk must link with Qt4 target_link_libraries(libggpk ${QT_LIBRARIES})
include_directories(${LIBGGPK_SOURCE_DIR}/include/ggpk) add_library(libggpk Node.cpp Archive.cpp) set_target_properties(libggpk PROPERTIES OUTPUT_NAME ggpk) # libggpk must link with Qt4 target_link_libraries(libggpk ${QT_LIBRARIES})
Fix build to name the lib properly
Fix build to name the lib properly
Text
mit
nohbdy/libggpk
text
## Code Before: include_directories(${LIBGGPK_SOURCE_DIR}/include/ggpk) add_library(libggpk Node.cpp Archive.cpp) # libggpk must link with Qt4 target_link_libraries(libggpk ${QT_LIBRARIES}) ## Instruction: Fix build to name the lib properly ## Code After: include_directories(${LIBGGPK_SOURCE_DIR}/include/ggpk) add_library(libggpk Node.cpp Archive.cpp) set_target_properties(libggpk PROPERTIES OUTPUT_NAME ggpk) # libggpk must link with Qt4 target_link_libraries(libggpk ${QT_LIBRARIES})
include_directories(${LIBGGPK_SOURCE_DIR}/include/ggpk) add_library(libggpk Node.cpp Archive.cpp) + set_target_properties(libggpk PROPERTIES OUTPUT_NAME ggpk) # libggpk must link with Qt4 target_link_libraries(libggpk ${QT_LIBRARIES})
1
0.2
1
0
e4297691f20ec4185ed4491ab41553df14a05a91
pycc/pycompat.py
pycc/pycompat.py
"""Compatibility helpers for Py2 and Py3.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import sys class VERSION(object): """Stand in for sys.version_info. The values from sys only have named parameters starting in PY27. This allows us to use named parameters for all versions of Python. """ major, minor, micro, releaselevel, serial = sys.version_info PY2 = VERSION.major == 2 PY25 = PY2 and VERSION.minor == 5 PY26 = PY2 and VERSION.minor == 6 PY27 = PY2 and VERSION.minor == 7 PY3 = not PY2 PY31 = PY3 and VERSION.minor == 1 PY32 = PY3 and VERSION.minor == 2 PY33 = PY3 and VERSION.minor == 3 py34 = PY3 and VERSION.minor == 4 # Provide a nice range function for py2. try: range = xrange except NameError: pass
"""Compatibility helpers for Py2 and Py3.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import sys class VERSION(object): """Stand in for sys.version_info. The values from sys only have named parameters starting in PY27. This allows us to use named parameters for all versions of Python. """ major, minor, micro, releaselevel, serial = sys.version_info PY2 = VERSION.major == 2 PY25 = PY2 and VERSION.minor == 5 PY26 = PY2 and VERSION.minor == 6 PY27 = PY2 and VERSION.minor == 7 PY3 = not PY2 PY31 = PY3 and VERSION.minor == 1 PY32 = PY3 and VERSION.minor == 2 PY33 = PY3 and VERSION.minor == 3 py34 = PY3 and VERSION.minor == 4 # Provide a nice range function for py2. try: range = xrange except NameError: pass # Provide a long type for py3. try: long = long except NameError: long = int
Add a long type backfill for PY3 compat
Add a long type backfill for PY3 compat PY3 combined the long and int types which makes some compiler operations difficult. Adding a backfill to help with PY2/PY3 compat. Signed-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com>
Python
apache-2.0
kevinconway/pycc,kevinconway/pycc
python
## Code Before: """Compatibility helpers for Py2 and Py3.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import sys class VERSION(object): """Stand in for sys.version_info. The values from sys only have named parameters starting in PY27. This allows us to use named parameters for all versions of Python. """ major, minor, micro, releaselevel, serial = sys.version_info PY2 = VERSION.major == 2 PY25 = PY2 and VERSION.minor == 5 PY26 = PY2 and VERSION.minor == 6 PY27 = PY2 and VERSION.minor == 7 PY3 = not PY2 PY31 = PY3 and VERSION.minor == 1 PY32 = PY3 and VERSION.minor == 2 PY33 = PY3 and VERSION.minor == 3 py34 = PY3 and VERSION.minor == 4 # Provide a nice range function for py2. try: range = xrange except NameError: pass ## Instruction: Add a long type backfill for PY3 compat PY3 combined the long and int types which makes some compiler operations difficult. Adding a backfill to help with PY2/PY3 compat. Signed-off-by: Kevin Conway <3473c1f185ca03eadc40ad288d84425b54fd7d57@gmail.com> ## Code After: """Compatibility helpers for Py2 and Py3.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import sys class VERSION(object): """Stand in for sys.version_info. The values from sys only have named parameters starting in PY27. This allows us to use named parameters for all versions of Python. """ major, minor, micro, releaselevel, serial = sys.version_info PY2 = VERSION.major == 2 PY25 = PY2 and VERSION.minor == 5 PY26 = PY2 and VERSION.minor == 6 PY27 = PY2 and VERSION.minor == 7 PY3 = not PY2 PY31 = PY3 and VERSION.minor == 1 PY32 = PY3 and VERSION.minor == 2 PY33 = PY3 and VERSION.minor == 3 py34 = PY3 and VERSION.minor == 4 # Provide a nice range function for py2. try: range = xrange except NameError: pass # Provide a long type for py3. try: long = long except NameError: long = int
"""Compatibility helpers for Py2 and Py3.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import sys class VERSION(object): """Stand in for sys.version_info. The values from sys only have named parameters starting in PY27. This allows us to use named parameters for all versions of Python. """ major, minor, micro, releaselevel, serial = sys.version_info PY2 = VERSION.major == 2 PY25 = PY2 and VERSION.minor == 5 PY26 = PY2 and VERSION.minor == 6 PY27 = PY2 and VERSION.minor == 7 PY3 = not PY2 PY31 = PY3 and VERSION.minor == 1 PY32 = PY3 and VERSION.minor == 2 PY33 = PY3 and VERSION.minor == 3 py34 = PY3 and VERSION.minor == 4 # Provide a nice range function for py2. try: range = xrange except NameError: pass + + # Provide a long type for py3. + try: + long = long + except NameError: + long = int
6
0.176471
6
0
0f8f1bd24feebdbb0f59d31c049c06132456aeb4
website/static/css/pages/home-page.css
website/static/css/pages/home-page.css
h3, h4 { font-weight: 400; } .quickSearch { min-height: 700px; background: #C5D6E6 url('/static/img/bg6.jpg') top center repeat-y; } .newAndNoteworthy { min-height: 650px; background: #34495e; padding-top: 25px; color: #FFF; } .meetings { background: #166595 url("/static/img/front-page/bg-web.png") no-repeat center top; background-size: cover; color: #fff; } .meetings .btn { box-shadow: 0 0 9px -4px #000; } .meetings .btn:hover { background: #eee; color: #000; } .footer { margin-top: 0; /* Override footer margin for this page only */ }
h3, h4 { font-weight: 400; } .quickSearch { min-height: 700px; background: #C5D6E6 url('/static/img/bg6.jpg') top center repeat-y; } .newAndNoteworthy { min-height: 650px; background: #34495e; padding-top: 25px; color: #FFF; } .meetings { background: #166595 url("/static/img/front-page/bg-web.png") no-repeat center top; background-size: cover; color: #fff; } .meetings .btn { box-shadow: 0 0 9px -4px #000; } .footer { margin-top: 0; /* Override footer margin for this page only */ }
Remove hover style from meetings button on home page
Remove hover style from meetings button on home page
CSS
apache-2.0
CenterForOpenScience/osf.io,samchrisinger/osf.io,emetsger/osf.io,laurenrevere/osf.io,amyshi188/osf.io,mattclark/osf.io,amyshi188/osf.io,kwierman/osf.io,doublebits/osf.io,abought/osf.io,hmoco/osf.io,sloria/osf.io,mluo613/osf.io,Nesiehr/osf.io,rdhyee/osf.io,hmoco/osf.io,chennan47/osf.io,laurenrevere/osf.io,DanielSBrown/osf.io,leb2dg/osf.io,cwisecarver/osf.io,zachjanicki/osf.io,wearpants/osf.io,acshi/osf.io,zachjanicki/osf.io,caseyrollins/osf.io,acshi/osf.io,crcresearch/osf.io,mluke93/osf.io,binoculars/osf.io,erinspace/osf.io,sloria/osf.io,kch8qx/osf.io,mluke93/osf.io,alexschiller/osf.io,alexschiller/osf.io,hmoco/osf.io,DanielSBrown/osf.io,jnayak1/osf.io,zamattiac/osf.io,chennan47/osf.io,mluo613/osf.io,jnayak1/osf.io,aaxelb/osf.io,Nesiehr/osf.io,monikagrabowska/osf.io,icereval/osf.io,cwisecarver/osf.io,felliott/osf.io,cwisecarver/osf.io,leb2dg/osf.io,TomBaxter/osf.io,RomanZWang/osf.io,mattclark/osf.io,HalcyonChimera/osf.io,zamattiac/osf.io,felliott/osf.io,wearpants/osf.io,caseyrollins/osf.io,adlius/osf.io,sloria/osf.io,mfraezz/osf.io,alexschiller/osf.io,Johnetordoff/osf.io,aaxelb/osf.io,doublebits/osf.io,Johnetordoff/osf.io,amyshi188/osf.io,abought/osf.io,SSJohns/osf.io,amyshi188/osf.io,asanfilippo7/osf.io,cslzchen/osf.io,aaxelb/osf.io,monikagrabowska/osf.io,kch8qx/osf.io,SSJohns/osf.io,mluke93/osf.io,cslzchen/osf.io,mluke93/osf.io,zamattiac/osf.io,HalcyonChimera/osf.io,kch8qx/osf.io,abought/osf.io,kch8qx/osf.io,erinspace/osf.io,erinspace/osf.io,emetsger/osf.io,jnayak1/osf.io,brianjgeiger/osf.io,caneruguz/osf.io,Nesiehr/osf.io,Johnetordoff/osf.io,monikagrabowska/osf.io,acshi/osf.io,saradbowman/osf.io,TomBaxter/osf.io,TomHeatwole/osf.io,monikagrabowska/osf.io,adlius/osf.io,wearpants/osf.io,HalcyonChimera/osf.io,kwierman/osf.io,pattisdr/osf.io,alexschiller/osf.io,samchrisinger/osf.io,cslzchen/osf.io,RomanZWang/osf.io,rdhyee/osf.io,asanfilippo7/osf.io,laurenrevere/osf.io,DanielSBrown/osf.io,TomHeatwole/osf.io,samchrisinger/osf.io,icereval/osf.io,Johnetordoff/osf.io,binoculars/osf.io,emetsger/osf.io,hmoco/osf.io,CenterForOpenScience/osf.io,CenterForOpenScience/osf.io,mluo613/osf.io,pattisdr/osf.io,felliott/osf.io,zachjanicki/osf.io,RomanZWang/osf.io,crcresearch/osf.io,asanfilippo7/osf.io,jnayak1/osf.io,TomHeatwole/osf.io,caneruguz/osf.io,SSJohns/osf.io,TomBaxter/osf.io,RomanZWang/osf.io,Nesiehr/osf.io,chrisseto/osf.io,mattclark/osf.io,brianjgeiger/osf.io,monikagrabowska/osf.io,mfraezz/osf.io,chennan47/osf.io,brianjgeiger/osf.io,leb2dg/osf.io,chrisseto/osf.io,binoculars/osf.io,adlius/osf.io,caneruguz/osf.io,doublebits/osf.io,samchrisinger/osf.io,doublebits/osf.io,kch8qx/osf.io,kwierman/osf.io,RomanZWang/osf.io,crcresearch/osf.io,saradbowman/osf.io,acshi/osf.io,aaxelb/osf.io,abought/osf.io,leb2dg/osf.io,doublebits/osf.io,brianjgeiger/osf.io,chrisseto/osf.io,cwisecarver/osf.io,caseyrollins/osf.io,alexschiller/osf.io,HalcyonChimera/osf.io,DanielSBrown/osf.io,rdhyee/osf.io,emetsger/osf.io,icereval/osf.io,kwierman/osf.io,SSJohns/osf.io,baylee-d/osf.io,caneruguz/osf.io,cslzchen/osf.io,acshi/osf.io,rdhyee/osf.io,pattisdr/osf.io,asanfilippo7/osf.io,TomHeatwole/osf.io,zachjanicki/osf.io,mluo613/osf.io,mfraezz/osf.io,mluo613/osf.io,mfraezz/osf.io,baylee-d/osf.io,zamattiac/osf.io,felliott/osf.io,wearpants/osf.io,adlius/osf.io,CenterForOpenScience/osf.io,baylee-d/osf.io,chrisseto/osf.io
css
## Code Before: h3, h4 { font-weight: 400; } .quickSearch { min-height: 700px; background: #C5D6E6 url('/static/img/bg6.jpg') top center repeat-y; } .newAndNoteworthy { min-height: 650px; background: #34495e; padding-top: 25px; color: #FFF; } .meetings { background: #166595 url("/static/img/front-page/bg-web.png") no-repeat center top; background-size: cover; color: #fff; } .meetings .btn { box-shadow: 0 0 9px -4px #000; } .meetings .btn:hover { background: #eee; color: #000; } .footer { margin-top: 0; /* Override footer margin for this page only */ } ## Instruction: Remove hover style from meetings button on home page ## Code After: h3, h4 { font-weight: 400; } .quickSearch { min-height: 700px; background: #C5D6E6 url('/static/img/bg6.jpg') top center repeat-y; } .newAndNoteworthy { min-height: 650px; background: #34495e; padding-top: 25px; color: #FFF; } .meetings { background: #166595 url("/static/img/front-page/bg-web.png") no-repeat center top; background-size: cover; color: #fff; } .meetings .btn { box-shadow: 0 0 9px -4px #000; } .footer { margin-top: 0; /* Override footer margin for this page only */ }
h3, h4 { font-weight: 400; } .quickSearch { min-height: 700px; background: #C5D6E6 url('/static/img/bg6.jpg') top center repeat-y; } .newAndNoteworthy { min-height: 650px; background: #34495e; padding-top: 25px; color: #FFF; } .meetings { background: #166595 url("/static/img/front-page/bg-web.png") no-repeat center top; background-size: cover; color: #fff; } .meetings .btn { box-shadow: 0 0 9px -4px #000; } - .meetings .btn:hover { - background: #eee; - color: #000; - } - .footer { margin-top: 0; /* Override footer margin for this page only */ }
5
0.15625
0
5
4798977968699acbeb6b57f208b4b17f2c64bc1e
layouts/_default/single.html
layouts/_default/single.html
<!DOCTYPE html> <html> {{ partial "head.html" . }} <body> <div id="wrapper"> {{ partial "header.html" . }} <div id="main"> <div id="aside"> {{partial "social-buttons.html" .}} {{if eq .Type "news"}} {{partial "tags.html" .}} {{end}} </div> <div id="contents"> {{if eq .Type "news"}} <div class="date">{{.Date.Format "2 Jan 2006"}}</div> {{end}} <h1>{{.Title}}</h1> {{.Content}} {{if isset .Params "tags"}} {{partial "article-tags.html" .}} {{end}} </div> </div> {{partial "newsletter.html" .}} {{partial "footer.html" .}} </div> </body> </html>
<!DOCTYPE html> <html> {{ partial "head.html" . }} <body{{if .IsPage}} class="{{.Slug}}"{{end}}> <div id="wrapper"> {{ partial "header.html" . }} <div id="main"> <div id="aside"> {{partial "social-buttons.html" .}} {{if eq .Type "news"}} {{partial "tags.html" .}} {{end}} </div> <div id="contents"> {{if eq .Type "news"}} <div class="date">{{.Date.Format "2 Jan 2006"}}</div> {{end}} <h1>{{.Title}}</h1> {{.Content}} {{if isset .Params "tags"}} {{partial "article-tags.html" .}} {{end}} </div> </div> {{partial "newsletter.html" .}} {{partial "footer.html" .}} </div> </body> </html>
Add slug to body class
Add slug to body class
HTML
mit
burrbd/pp-hugo-theme,burrbd/pp-hugo-theme
html
## Code Before: <!DOCTYPE html> <html> {{ partial "head.html" . }} <body> <div id="wrapper"> {{ partial "header.html" . }} <div id="main"> <div id="aside"> {{partial "social-buttons.html" .}} {{if eq .Type "news"}} {{partial "tags.html" .}} {{end}} </div> <div id="contents"> {{if eq .Type "news"}} <div class="date">{{.Date.Format "2 Jan 2006"}}</div> {{end}} <h1>{{.Title}}</h1> {{.Content}} {{if isset .Params "tags"}} {{partial "article-tags.html" .}} {{end}} </div> </div> {{partial "newsletter.html" .}} {{partial "footer.html" .}} </div> </body> </html> ## Instruction: Add slug to body class ## Code After: <!DOCTYPE html> <html> {{ partial "head.html" . }} <body{{if .IsPage}} class="{{.Slug}}"{{end}}> <div id="wrapper"> {{ partial "header.html" . }} <div id="main"> <div id="aside"> {{partial "social-buttons.html" .}} {{if eq .Type "news"}} {{partial "tags.html" .}} {{end}} </div> <div id="contents"> {{if eq .Type "news"}} <div class="date">{{.Date.Format "2 Jan 2006"}}</div> {{end}} <h1>{{.Title}}</h1> {{.Content}} {{if isset .Params "tags"}} {{partial "article-tags.html" .}} {{end}} </div> </div> {{partial "newsletter.html" .}} {{partial "footer.html" .}} </div> </body> </html>
<!DOCTYPE html> <html> {{ partial "head.html" . }} - <body> + <body{{if .IsPage}} class="{{.Slug}}"{{end}}> <div id="wrapper"> {{ partial "header.html" . }} <div id="main"> <div id="aside"> {{partial "social-buttons.html" .}} {{if eq .Type "news"}} {{partial "tags.html" .}} {{end}} </div> <div id="contents"> {{if eq .Type "news"}} <div class="date">{{.Date.Format "2 Jan 2006"}}</div> {{end}} <h1>{{.Title}}</h1> {{.Content}} {{if isset .Params "tags"}} {{partial "article-tags.html" .}} {{end}} </div> </div> {{partial "newsletter.html" .}} {{partial "footer.html" .}} </div> </body> </html>
2
0.068966
1
1
c9c39d970be583916e08d98cca7ac0167f33f102
README.md
README.md
Synth ===== A synthetic intelligence is our name for a truly general, human-level artificial intelligence.
Synth ===== A synthetic intelligence is our name for a truly general, human-level artificial intelligence. Follow us on Twitter for live updates on the development: http://twitter.com/AINow2014
Add reference to Twitter feed to Readme
Add reference to Twitter feed to Readme
Markdown
mit
AI-Now/Synth,AI-Now/Synth
markdown
## Code Before: Synth ===== A synthetic intelligence is our name for a truly general, human-level artificial intelligence. ## Instruction: Add reference to Twitter feed to Readme ## Code After: Synth ===== A synthetic intelligence is our name for a truly general, human-level artificial intelligence. Follow us on Twitter for live updates on the development: http://twitter.com/AINow2014
Synth ===== A synthetic intelligence is our name for a truly general, human-level artificial intelligence. + + Follow us on Twitter for live updates on the development: http://twitter.com/AINow2014
2
0.5
2
0
9b341ab7ae139bdbffaf3c6c596378d534d79a70
lib/tasks/data_feeds/meteostat_loader.rake
lib/tasks/data_feeds/meteostat_loader.rake
namespace :data_feeds do desc 'Load dark meteostat data' task :meteostat_loader, [:start_date, :end_date] => :environment do |_t, args| start_date = args[:start_date].present? ? Date.parse(args[:start_date]) : Date.yesterday - 1 end_date = args[:end_date].present? ? Date.parse(args[:end_date]) : Date.yesterday loader = DataFeeds::MeteostatLoader.new(start_date, end_date) loader.import p "Imported #{loader.insert_count} records, Updated #{loader.update_count} records from #{loader.stations} stations" end end
namespace :data_feeds do desc 'Load dark meteostat data' task :meteostat_loader, [:start_date, :end_date] => :environment do |_t, args| start_date = args[:start_date].present? ? Date.parse(args[:start_date]) : Date.yesterday - 1 end_date = args[:end_date].present? ? Date.parse(args[:end_date]) : Date.yesterday loader = DataFeeds::MeteostatLoader.new(start_date, end_date) loader.import p "Imported #{loader.insert_count} records, Updated #{loader.update_count} records from #{loader.stations_processed} stations" end end
Fix error in log message
Fix error in log message
Ruby
mit
BathHacked/energy-sparks,BathHacked/energy-sparks,BathHacked/energy-sparks,BathHacked/energy-sparks
ruby
## Code Before: namespace :data_feeds do desc 'Load dark meteostat data' task :meteostat_loader, [:start_date, :end_date] => :environment do |_t, args| start_date = args[:start_date].present? ? Date.parse(args[:start_date]) : Date.yesterday - 1 end_date = args[:end_date].present? ? Date.parse(args[:end_date]) : Date.yesterday loader = DataFeeds::MeteostatLoader.new(start_date, end_date) loader.import p "Imported #{loader.insert_count} records, Updated #{loader.update_count} records from #{loader.stations} stations" end end ## Instruction: Fix error in log message ## Code After: namespace :data_feeds do desc 'Load dark meteostat data' task :meteostat_loader, [:start_date, :end_date] => :environment do |_t, args| start_date = args[:start_date].present? ? Date.parse(args[:start_date]) : Date.yesterday - 1 end_date = args[:end_date].present? ? Date.parse(args[:end_date]) : Date.yesterday loader = DataFeeds::MeteostatLoader.new(start_date, end_date) loader.import p "Imported #{loader.insert_count} records, Updated #{loader.update_count} records from #{loader.stations_processed} stations" end end
namespace :data_feeds do desc 'Load dark meteostat data' task :meteostat_loader, [:start_date, :end_date] => :environment do |_t, args| start_date = args[:start_date].present? ? Date.parse(args[:start_date]) : Date.yesterday - 1 end_date = args[:end_date].present? ? Date.parse(args[:end_date]) : Date.yesterday loader = DataFeeds::MeteostatLoader.new(start_date, end_date) loader.import - p "Imported #{loader.insert_count} records, Updated #{loader.update_count} records from #{loader.stations} stations" + p "Imported #{loader.insert_count} records, Updated #{loader.update_count} records from #{loader.stations_processed} stations" ? ++++++++++ end end
2
0.181818
1
1
8e37f38f7ff98bfa05ffcaac14195244c052088c
app/views/bookings/_new_form.html.haml
app/views/bookings/_new_form.html.haml
= simple_form_for @booking, :url => select_bookings_path do |f| = hidden_field_tag :stage, 'select' = f.input :title, :input_html => {'data-autofocus' => true} = f.input :value_date, :as => :date_field, :input_html => {:size => 10, :style => 'text-align: right'} = f.button :submit
= simple_form_for @booking, :url => select_bookings_path do |f| = hidden_field_tag :stage, 'select' .row-fluid .span8= f.input :title, :input_html => {'data-autofocus' => true} .span4= f.input :value_date, :as => :date_field, :input_html => {:size => 10, :style => 'text-align: right'} .form-actions = f.button :submit
Use proper bootstrap markup for bookings/new_form.
Use proper bootstrap markup for bookings/new_form.
Haml
mit
huerlisi/has_accounts_engine,huerlisi/has_accounts_engine,hauledev/has_account_engine,hauledev/has_account_engine,huerlisi/has_accounts_engine,hauledev/has_account_engine
haml
## Code Before: = simple_form_for @booking, :url => select_bookings_path do |f| = hidden_field_tag :stage, 'select' = f.input :title, :input_html => {'data-autofocus' => true} = f.input :value_date, :as => :date_field, :input_html => {:size => 10, :style => 'text-align: right'} = f.button :submit ## Instruction: Use proper bootstrap markup for bookings/new_form. ## Code After: = simple_form_for @booking, :url => select_bookings_path do |f| = hidden_field_tag :stage, 'select' .row-fluid .span8= f.input :title, :input_html => {'data-autofocus' => true} .span4= f.input :value_date, :as => :date_field, :input_html => {:size => 10, :style => 'text-align: right'} .form-actions = f.button :submit
= simple_form_for @booking, :url => select_bookings_path do |f| = hidden_field_tag :stage, 'select' + .row-fluid - = f.input :title, :input_html => {'data-autofocus' => true} + .span8= f.input :title, :input_html => {'data-autofocus' => true} ? ++++++++ - = f.input :value_date, :as => :date_field, :input_html => {:size => 10, :style => 'text-align: right'} + .span4= f.input :value_date, :as => :date_field, :input_html => {:size => 10, :style => 'text-align: right'} ? ++++++++ + + .form-actions - = f.button :submit + = f.button :submit ? ++
9
1.8
6
3
c7cd5d46b7bc5762b78599766b99d129f0f9d8b0
nvim/init.vim
nvim/init.vim
call plug#begin() " Plugins Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " Themes Plug 'sickill/vim-monokai' " Git Plug 'airblade/vim-gitgutter' call plug#end() " Use UTF-8 encoding set encoding=utf-8 " View line numbers set number " Configure vim-airline let g:airline_theme='simple' set laststatus=2 " Configure vim-monokai with syntax highlighting syntax enable colorscheme monokai " Enable clipboard yanking set clipboard+=unnamedplus
call plug#begin() " Plugins Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " Themes Plug 'sickill/vim-monokai' " Git Plug 'airblade/vim-gitgutter' " Config Plug 'tpope/vim-sensible' call plug#end() " View line numbers set number " Configure vim-airline let g:airline_theme='simple' " Configure vim-monokai with syntax highlighting colorscheme monokai " Enable clipboard yanking set clipboard+=unnamedplus
Update nvim config to use vim-sensible plugin
Update nvim config to use vim-sensible plugin
VimL
mit
grawlinson/.dotfiles,grawlinson/dotfiles
viml
## Code Before: call plug#begin() " Plugins Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " Themes Plug 'sickill/vim-monokai' " Git Plug 'airblade/vim-gitgutter' call plug#end() " Use UTF-8 encoding set encoding=utf-8 " View line numbers set number " Configure vim-airline let g:airline_theme='simple' set laststatus=2 " Configure vim-monokai with syntax highlighting syntax enable colorscheme monokai " Enable clipboard yanking set clipboard+=unnamedplus ## Instruction: Update nvim config to use vim-sensible plugin ## Code After: call plug#begin() " Plugins Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " Themes Plug 'sickill/vim-monokai' " Git Plug 'airblade/vim-gitgutter' " Config Plug 'tpope/vim-sensible' call plug#end() " View line numbers set number " Configure vim-airline let g:airline_theme='simple' " Configure vim-monokai with syntax highlighting colorscheme monokai " Enable clipboard yanking set clipboard+=unnamedplus
call plug#begin() " Plugins Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' " Themes Plug 'sickill/vim-monokai' " Git Plug 'airblade/vim-gitgutter' + " Config + Plug 'tpope/vim-sensible' + call plug#end() - - " Use UTF-8 encoding - set encoding=utf-8 " View line numbers set number " Configure vim-airline let g:airline_theme='simple' - set laststatus=2 " Configure vim-monokai with syntax highlighting - syntax enable colorscheme monokai " Enable clipboard yanking set clipboard+=unnamedplus
8
0.266667
3
5
d7dd1059c38b4f4a80f55ee3f07fc6df802bce40
doc/getting-started.rst
doc/getting-started.rst
Getting started =============== All amounts are represented in the smallest unit (eg. cents), so USD 5.00 is written as .. code-block:: php use Money\Currency; use Money\Money; $fiver = new Money(500, new Currency('USD')); // or shorter: $fiver = Money::USD(500); Installation ------------ Install the library using composer. Execute the following command in your command line. .. code-block:: bash $ composer require mathiasverraes/money
Getting started =============== All amounts are represented in the smallest unit (eg. cents), so USD 5.00 is written as .. code-block:: php use Money\Currency; use Money\Money; $fiver = new Money(500, new Currency('USD')); // or shorter: $fiver = Money::USD(500); Installation ------------ Install the library using composer. Execute the following command in your command line. .. code-block:: bash $ composer require moneyphp/money
Change package name in documentation
Change package name in documentation
reStructuredText
mit
mathiasverraes/money,moneyphp/money,moneyphp/money,josecelano/money
restructuredtext
## Code Before: Getting started =============== All amounts are represented in the smallest unit (eg. cents), so USD 5.00 is written as .. code-block:: php use Money\Currency; use Money\Money; $fiver = new Money(500, new Currency('USD')); // or shorter: $fiver = Money::USD(500); Installation ------------ Install the library using composer. Execute the following command in your command line. .. code-block:: bash $ composer require mathiasverraes/money ## Instruction: Change package name in documentation ## Code After: Getting started =============== All amounts are represented in the smallest unit (eg. cents), so USD 5.00 is written as .. code-block:: php use Money\Currency; use Money\Money; $fiver = new Money(500, new Currency('USD')); // or shorter: $fiver = Money::USD(500); Installation ------------ Install the library using composer. Execute the following command in your command line. .. code-block:: bash $ composer require moneyphp/money
Getting started =============== All amounts are represented in the smallest unit (eg. cents), so USD 5.00 is written as .. code-block:: php use Money\Currency; use Money\Money; $fiver = new Money(500, new Currency('USD')); // or shorter: $fiver = Money::USD(500); Installation ------------ Install the library using composer. Execute the following command in your command line. .. code-block:: bash - $ composer require mathiasverraes/money ? ^^ ^^^^^^^^^^ + $ composer require moneyphp/money ? ^^^^^ ^
2
0.086957
1
1
9ce7e1baa8db05d63843292dd8482fc5e9351712
README.md
README.md
An updated version of parkrunpb using Spring Boot
An updated version of parkrunpb using Spring Boot This application is used in two tutorials - > Can Spring Security be auto-generated? (https://glenware.wordpress.com/2016/10/02/can-we-auto-generate-spring-security/ and https://dzone.com/articles/can-spring-security-benbspauto-generated) > Auto-generating Spring Security Tutorial – Memory Realms (https://glenware.wordpress.com/2016/10/09/auto-generating-spring-security-tutorial-memory-realms/ and https://dzone.com/articles/auto-generating-spring-security-tutorial-memorynbs) To run this project either clone or download the zip, then - > mvn clean install Then to run the server - > mvn spring-boot:run
Add some notes on running the application
Add some notes on running the application
Markdown
mit
farrelmr/parkrunpbreboot,farrelmr/parkrunpbreboot
markdown
## Code Before: An updated version of parkrunpb using Spring Boot ## Instruction: Add some notes on running the application ## Code After: An updated version of parkrunpb using Spring Boot This application is used in two tutorials - > Can Spring Security be auto-generated? (https://glenware.wordpress.com/2016/10/02/can-we-auto-generate-spring-security/ and https://dzone.com/articles/can-spring-security-benbspauto-generated) > Auto-generating Spring Security Tutorial – Memory Realms (https://glenware.wordpress.com/2016/10/09/auto-generating-spring-security-tutorial-memory-realms/ and https://dzone.com/articles/auto-generating-spring-security-tutorial-memorynbs) To run this project either clone or download the zip, then - > mvn clean install Then to run the server - > mvn spring-boot:run
An updated version of parkrunpb using Spring Boot + + This application is used in two tutorials - + + > Can Spring Security be auto-generated? (https://glenware.wordpress.com/2016/10/02/can-we-auto-generate-spring-security/ and https://dzone.com/articles/can-spring-security-benbspauto-generated) + > Auto-generating Spring Security Tutorial – Memory Realms (https://glenware.wordpress.com/2016/10/09/auto-generating-spring-security-tutorial-memory-realms/ and https://dzone.com/articles/auto-generating-spring-security-tutorial-memorynbs) + + To run this project either clone or download the zip, then - + + > mvn clean install + + Then to run the server - + + > mvn spring-boot:run
13
13
13
0
33d128e3ccce2443856a336da24574052eb21ddd
about.md
about.md
--- layout: page title: About --- ## hi! i'm james :) ![or jamie](/public/img/jamie.jpg) i'm currently attempting to be the nicest person on the internet... not sure how healthy that is though. ## Find me around Rochester You can find me eating garbage plates, going to church, or whatever else it is i do. ## Find me around the internet * [@jugglingnutcase](https://twitter.com/jugglingnutcase) on Twitter * @jugglingnutcase on GitHub * [@jugglingnutcase](http://www.flickr.com/photos/jugglingnutcase/) on Flickr ## Colophon This site uses [Lanyon](https://github.com/poole/lanyon) from [Poole](http://getpoole.com/) (thanks @mdo) and [jekyll](http://jekyllrb.com).
--- layout: page title: About --- ## hi! i'm james :) ![or jamie](/public/img/jamie.jpg) i'm currently attempting to be the nicest person on the internet... not sure how healthy that is though. ## Find me around Rochester You can find me eating garbage plates, going to church, or whatever else it is i do. ## Find me around the internet * [@jugglingnutcase](https://twitter.com/jugglingnutcase) on Twitter * [@jugglingnutcase](https://github.com/jugglingnutcase) on GitHub * [@jugglingnutcase](http://www.flickr.com/photos/jugglingnutcase/) on Flickr ## Colophon This site uses [Lanyon](https://github.com/poole/lanyon) from [Poole](http://getpoole.com/) (thanks [@mdo](http://github.com/mdo)) and [jekyll](http://jekyllrb.com).
Revert "Does this new mention thing work?"
Revert "Does this new mention thing work?" This reverts commit ba676c95b9262fccac4f1b7232cf856cfd18ae0d.
Markdown
mit
jugglingnutcase/jugglingnutcase.github.io,jugglingnutcase/jugglingnutcase.github.io,jugglingnutcase/jugglingnutcase.github.io
markdown
## Code Before: --- layout: page title: About --- ## hi! i'm james :) ![or jamie](/public/img/jamie.jpg) i'm currently attempting to be the nicest person on the internet... not sure how healthy that is though. ## Find me around Rochester You can find me eating garbage plates, going to church, or whatever else it is i do. ## Find me around the internet * [@jugglingnutcase](https://twitter.com/jugglingnutcase) on Twitter * @jugglingnutcase on GitHub * [@jugglingnutcase](http://www.flickr.com/photos/jugglingnutcase/) on Flickr ## Colophon This site uses [Lanyon](https://github.com/poole/lanyon) from [Poole](http://getpoole.com/) (thanks @mdo) and [jekyll](http://jekyllrb.com). ## Instruction: Revert "Does this new mention thing work?" This reverts commit ba676c95b9262fccac4f1b7232cf856cfd18ae0d. ## Code After: --- layout: page title: About --- ## hi! i'm james :) ![or jamie](/public/img/jamie.jpg) i'm currently attempting to be the nicest person on the internet... not sure how healthy that is though. ## Find me around Rochester You can find me eating garbage plates, going to church, or whatever else it is i do. ## Find me around the internet * [@jugglingnutcase](https://twitter.com/jugglingnutcase) on Twitter * [@jugglingnutcase](https://github.com/jugglingnutcase) on GitHub * [@jugglingnutcase](http://www.flickr.com/photos/jugglingnutcase/) on Flickr ## Colophon This site uses [Lanyon](https://github.com/poole/lanyon) from [Poole](http://getpoole.com/) (thanks [@mdo](http://github.com/mdo)) and [jekyll](http://jekyllrb.com).
--- layout: page title: About --- ## hi! i'm james :) ![or jamie](/public/img/jamie.jpg) i'm currently attempting to be the nicest person on the internet... not sure how healthy that is though. ## Find me around Rochester You can find me eating garbage plates, going to church, or whatever else it is i do. ## Find me around the internet * [@jugglingnutcase](https://twitter.com/jugglingnutcase) on Twitter - * @jugglingnutcase on GitHub + * [@jugglingnutcase](https://github.com/jugglingnutcase) on GitHub * [@jugglingnutcase](http://www.flickr.com/photos/jugglingnutcase/) on Flickr ## Colophon - This site uses [Lanyon](https://github.com/poole/lanyon) from [Poole](http://getpoole.com/) (thanks @mdo) and [jekyll](http://jekyllrb.com). + This site uses [Lanyon](https://github.com/poole/lanyon) from [Poole](http://getpoole.com/) (thanks [@mdo](http://github.com/mdo)) and [jekyll](http://jekyllrb.com). ? + ++++++++++++++++++++++++
4
0.16
2
2
99b2012d26e3b3b0750ab612958555b038185650
recipes/images/base-rootfs-ext2.bb
recipes/images/base-rootfs-ext2.bb
require base-rootfs.inc RECIPE_OPTIONS = "base_rootfs_ext2_options" inherit ext2-image DEFAULT_CONFIG_base_rootfs_ext2_options = "--faketime --squash" EXT2_IMAGE_OPTIONS = "${RECIPE_OPTION_base_rootfs_ext2_options}" inherit tar-image
require base-rootfs.inc RECIPE_OPTIONS = "base_rootfs_ext2_options" inherit ext2-image DEFAULT_CONFIG_base_rootfs_ext2_options = "-z -q -f" EXT2_IMAGE_OPTIONS = "${RECIPE_OPTION_base_rootfs_ext2_options}" inherit tar-image
Change default base_rootfs_ext2_options to also --allow-holes
Change default base_rootfs_ext2_options to also --allow-holes
BitBake
mit
oe-lite/base,sknsean/base,sknsean/base,esben/base,oe-lite-rpi/base,jacobbarsoe/rpi-base,esben/base,kimrhh/base,hundeboll/base,hundeboll/base,moths/base,hundeboll/base,hundeboll/base,diorcety/oe-lite-base,jacobbarsoe/rpi-base,esben/base,kimrhh/base,kimrhh/base,moths/base,esben/base,sknsean/base,hundeboll/base,kimrhh/base,esben/base,sknsean/base,oe-lite/base,oe-lite/base,oe-lite/base,oe-lite/base,moths/base,diorcety/oe-lite-base,sknsean/base,kimrhh/base,moths/base,esben/base,moths/base,oe-lite/base,moths/base,oe-lite-rpi/base,hundeboll/base,sknsean/base,kimrhh/base
bitbake
## Code Before: require base-rootfs.inc RECIPE_OPTIONS = "base_rootfs_ext2_options" inherit ext2-image DEFAULT_CONFIG_base_rootfs_ext2_options = "--faketime --squash" EXT2_IMAGE_OPTIONS = "${RECIPE_OPTION_base_rootfs_ext2_options}" inherit tar-image ## Instruction: Change default base_rootfs_ext2_options to also --allow-holes ## Code After: require base-rootfs.inc RECIPE_OPTIONS = "base_rootfs_ext2_options" inherit ext2-image DEFAULT_CONFIG_base_rootfs_ext2_options = "-z -q -f" EXT2_IMAGE_OPTIONS = "${RECIPE_OPTION_base_rootfs_ext2_options}" inherit tar-image
require base-rootfs.inc RECIPE_OPTIONS = "base_rootfs_ext2_options" inherit ext2-image - DEFAULT_CONFIG_base_rootfs_ext2_options = "--faketime --squash" ? ---------------- + DEFAULT_CONFIG_base_rootfs_ext2_options = "-z -q -f" ? +++++ EXT2_IMAGE_OPTIONS = "${RECIPE_OPTION_base_rootfs_ext2_options}" inherit tar-image
2
0.222222
1
1
7c03c2a41e2836a0933a84c103253624435e9dae
Kwc/Basic/DownloadTag/Update/20210906UpdateSeoFields.sql
Kwc/Basic/DownloadTag/Update/20210906UpdateSeoFields.sql
ALTER TABLE `kwc_basic_downloadtag` CHANGE `open_type` `open_type` ENUM('self','blank') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'self'; ALTER TABLE `kwc_basic_downloadtag` DROP `width`; ALTER TABLE `kwc_basic_downloadtag` DROP `height`; ALTER TABLE `kwc_basic_downloadtag` DROP `menubar`; ALTER TABLE `kwc_basic_downloadtag` DROP `toolbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `locationbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `statusbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `scrollbars`; ALTER TABLE `kwc_basic_downloadtag` DROP `resizable`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_nofollow`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_noopener`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_noreferrer`; ALTER TABLE `kwc_basic_downloadtag` ADD `rel_noindex` TINYINT NOT NULL ;
UPDATE `kwc_basic_downloadtag` SET `open_type` = 'blank' WHERE `open_type` = 'popup'; ALTER TABLE `kwc_basic_downloadtag` CHANGE `open_type` `open_type` ENUM('self','blank') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'self'; ALTER TABLE `kwc_basic_downloadtag` DROP `width`; ALTER TABLE `kwc_basic_downloadtag` DROP `height`; ALTER TABLE `kwc_basic_downloadtag` DROP `menubar`; ALTER TABLE `kwc_basic_downloadtag` DROP `toolbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `locationbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `statusbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `scrollbars`; ALTER TABLE `kwc_basic_downloadtag` DROP `resizable`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_nofollow`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_noopener`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_noreferrer`; ALTER TABLE `kwc_basic_downloadtag` ADD `rel_noindex` TINYINT NOT NULL ;
Change all open types from popup to blank for download tag
Change all open types from popup to blank for download tag
SQL
bsd-2-clause
koala-framework/koala-framework,koala-framework/koala-framework
sql
## Code Before: ALTER TABLE `kwc_basic_downloadtag` CHANGE `open_type` `open_type` ENUM('self','blank') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'self'; ALTER TABLE `kwc_basic_downloadtag` DROP `width`; ALTER TABLE `kwc_basic_downloadtag` DROP `height`; ALTER TABLE `kwc_basic_downloadtag` DROP `menubar`; ALTER TABLE `kwc_basic_downloadtag` DROP `toolbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `locationbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `statusbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `scrollbars`; ALTER TABLE `kwc_basic_downloadtag` DROP `resizable`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_nofollow`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_noopener`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_noreferrer`; ALTER TABLE `kwc_basic_downloadtag` ADD `rel_noindex` TINYINT NOT NULL ; ## Instruction: Change all open types from popup to blank for download tag ## Code After: UPDATE `kwc_basic_downloadtag` SET `open_type` = 'blank' WHERE `open_type` = 'popup'; ALTER TABLE `kwc_basic_downloadtag` CHANGE `open_type` `open_type` ENUM('self','blank') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'self'; ALTER TABLE `kwc_basic_downloadtag` DROP `width`; ALTER TABLE `kwc_basic_downloadtag` DROP `height`; ALTER TABLE `kwc_basic_downloadtag` DROP `menubar`; ALTER TABLE `kwc_basic_downloadtag` DROP `toolbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `locationbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `statusbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `scrollbars`; ALTER TABLE `kwc_basic_downloadtag` DROP `resizable`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_nofollow`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_noopener`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_noreferrer`; ALTER TABLE `kwc_basic_downloadtag` ADD `rel_noindex` TINYINT NOT NULL ;
+ UPDATE `kwc_basic_downloadtag` SET `open_type` = 'blank' WHERE `open_type` = 'popup'; ALTER TABLE `kwc_basic_downloadtag` CHANGE `open_type` `open_type` ENUM('self','blank') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'self'; ALTER TABLE `kwc_basic_downloadtag` DROP `width`; ALTER TABLE `kwc_basic_downloadtag` DROP `height`; ALTER TABLE `kwc_basic_downloadtag` DROP `menubar`; ALTER TABLE `kwc_basic_downloadtag` DROP `toolbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `locationbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `statusbar`; ALTER TABLE `kwc_basic_downloadtag` DROP `scrollbars`; ALTER TABLE `kwc_basic_downloadtag` DROP `resizable`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_nofollow`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_noopener`; ALTER TABLE `kwc_basic_downloadtag` DROP `rel_noreferrer`; ALTER TABLE `kwc_basic_downloadtag` ADD `rel_noindex` TINYINT NOT NULL ;
1
0.076923
1
0
9f83be276ac6b54c6acdde1408cc8b82d857378d
setup.cfg
setup.cfg
[metadata] description-file = README.md [aliases] test=pytest
[metadata] description-file = README.md [aliases] test=pytest [pytest] testpaths = heatmiserV3/test
Set tests to run on the right folder
Set tests to run on the right folder
INI
mit
andylockran/heatmiserV3
ini
## Code Before: [metadata] description-file = README.md [aliases] test=pytest ## Instruction: Set tests to run on the right folder ## Code After: [metadata] description-file = README.md [aliases] test=pytest [pytest] testpaths = heatmiserV3/test
[metadata] description-file = README.md [aliases] test=pytest + + [pytest] + testpaths = heatmiserV3/test
3
0.6
3
0
ee607051c822cb3f8708fea7b2c308fc16361b80
README.md
README.md
apcaccess ========= A pure Python version of [apcaccess](http://linux.die.net/man/8/apcaccess). This library may be used as part of a Python project to offer programmatic access to the status information provided by [apcupsd](http://www.apcupsd.org/) over its Network Information Server (NIS) which usually listens on TCP port 3551.
![build status](https://travis-ci.org/flyte/apcaccess.svg?branch=develop) apcaccess ========= A pure Python version of [apcaccess](http://linux.die.net/man/8/apcaccess). This library may be used as part of a Python project to offer programmatic access to the status information provided by [apcupsd](http://www.apcupsd.org/) over its Network Information Server (NIS) which usually listens on TCP port 3551.
Add Travis build status to readme.
Add Travis build status to readme.
Markdown
mit
flyte/apcaccess
markdown
## Code Before: apcaccess ========= A pure Python version of [apcaccess](http://linux.die.net/man/8/apcaccess). This library may be used as part of a Python project to offer programmatic access to the status information provided by [apcupsd](http://www.apcupsd.org/) over its Network Information Server (NIS) which usually listens on TCP port 3551. ## Instruction: Add Travis build status to readme. ## Code After: ![build status](https://travis-ci.org/flyte/apcaccess.svg?branch=develop) apcaccess ========= A pure Python version of [apcaccess](http://linux.die.net/man/8/apcaccess). This library may be used as part of a Python project to offer programmatic access to the status information provided by [apcupsd](http://www.apcupsd.org/) over its Network Information Server (NIS) which usually listens on TCP port 3551.
+ ![build status](https://travis-ci.org/flyte/apcaccess.svg?branch=develop) + apcaccess ========= A pure Python version of [apcaccess](http://linux.die.net/man/8/apcaccess). This library may be used as part of a Python project to offer programmatic access to the status information provided by [apcupsd](http://www.apcupsd.org/) over its Network Information Server (NIS) which usually listens on TCP port 3551.
2
0.5
2
0
2099376f115625c742e160d65c769368ebab4121
bin/circleci-demo-sync.sh
bin/circleci-demo-sync.sh
set -ex [[ "$CIRCLE_BRANCH" != demo__* ]] && exit 0 DEBUG=False DEV=True DATABASE_URL=sqlite:///bedrock.db DOCKER_CACHE_PATH=~/docker MOFO_SECURITY_ADVISORIES_PATH=$DOCKER_CACHE_PATH/security_advisories PROD_DETAILS_STORAGE=product_details.storage.PDDatabaseStorage mkdir -p $DOCKER_CACHE_PATH if [[ -f $DOCKER_CACHE_PATH/bedrock.db ]]; then cp $DOCKER_CACHE_PATH/bedrock.db ./ fi ./manage.py migrate --noinput ./manage.py rnasync ./manage.py cron update_ical_feeds ./manage.py update_product_details ./manage.py update_externalfiles ./manage.py update_security_advisories cp -f bedrock.db $DOCKER_CACHE_PATH/ if [[ -e $DOCKER_CACHE_PATH/image.tar ]]; then docker load --input ~/docker/image.tar; fi echo "ENV GIT_SHA ${CIRCLE_SHA1}" >> Dockerfile docker build -t "$DOCKER_IMAGE_TAG" --pull=true . docker save "$DOCKER_IMAGE_TAG" > $DOCKER_CACHE_PATH/image.tar
set -ex [[ "$CIRCLE_BRANCH" != demo__* ]] && exit 0 export DOCKER_CACHE_PATH=~/docker mkdir -p $DOCKER_CACHE_PATH if [[ -f $DOCKER_CACHE_PATH/bedrock.db ]]; then cp $DOCKER_CACHE_PATH/bedrock.db ./ fi # use settings in manage.py runs cp .bedrock_demo_env .env echo "MOFO_SECURITY_ADVISORIES_PATH=$DOCKER_CACHE_PATH/security_advisories" >> .env ./manage.py migrate --noinput ./manage.py rnasync ./manage.py cron update_ical_feeds ./manage.py cron cleanup_ical_events ./manage.py cron update_tweets ./manage.py update_product_details ./manage.py update_externalfiles ./manage.py update_security_advisories ./manage.py runscript update_firefox_os_feeds cp -f bedrock.db $DOCKER_CACHE_PATH/ # don't include in built container rm -f .env if [[ -e $DOCKER_CACHE_PATH/image.tar ]]; then docker load --input $DOCKER_CACHE_PATH/image.tar; fi echo "ENV GIT_SHA ${CIRCLE_SHA1}" >> Dockerfile docker build -t "$DOCKER_IMAGE_TAG" --pull=true . docker save "$DOCKER_IMAGE_TAG" > $DOCKER_CACHE_PATH/image.tar
Fix CircleCI demo deploy data
Fix CircleCI demo deploy data * Have it run the fxos feed update * Have it use the .bedrock-demo-env settings
Shell
mpl-2.0
CSCI-462-01-2017/bedrock,pascalchevrel/bedrock,alexgibson/bedrock,TheoChevalier/bedrock,TheoChevalier/bedrock,sylvestre/bedrock,glogiotatidis/bedrock,ericawright/bedrock,glogiotatidis/bedrock,kyoshino/bedrock,analytics-pros/mozilla-bedrock,analytics-pros/mozilla-bedrock,mozilla/bedrock,TheJJ100100/bedrock,glogiotatidis/bedrock,hoosteeno/bedrock,TheoChevalier/bedrock,CSCI-462-01-2017/bedrock,MichaelKohler/bedrock,Sancus/bedrock,gerv/bedrock,kyoshino/bedrock,ericawright/bedrock,pascalchevrel/bedrock,schalkneethling/bedrock,flodolo/bedrock,TheJJ100100/bedrock,sgarrity/bedrock,Sancus/bedrock,glogiotatidis/bedrock,Sancus/bedrock,kyoshino/bedrock,craigcook/bedrock,sgarrity/bedrock,jgmize/bedrock,TheoChevalier/bedrock,sylvestre/bedrock,TheJJ100100/bedrock,mkmelin/bedrock,sgarrity/bedrock,mkmelin/bedrock,CSCI-462-01-2017/bedrock,sgarrity/bedrock,MichaelKohler/bedrock,mkmelin/bedrock,ericawright/bedrock,MichaelKohler/bedrock,jgmize/bedrock,alexgibson/bedrock,jgmize/bedrock,gerv/bedrock,craigcook/bedrock,sylvestre/bedrock,ericawright/bedrock,flodolo/bedrock,schalkneethling/bedrock,hoosteeno/bedrock,schalkneethling/bedrock,CSCI-462-01-2017/bedrock,gerv/bedrock,mozilla/bedrock,pascalchevrel/bedrock,pascalchevrel/bedrock,hoosteeno/bedrock,craigcook/bedrock,analytics-pros/mozilla-bedrock,mozilla/bedrock,schalkneethling/bedrock,alexgibson/bedrock,TheJJ100100/bedrock,craigcook/bedrock,hoosteeno/bedrock,flodolo/bedrock,jgmize/bedrock,analytics-pros/mozilla-bedrock,kyoshino/bedrock,flodolo/bedrock,mkmelin/bedrock,alexgibson/bedrock,mozilla/bedrock,sylvestre/bedrock,MichaelKohler/bedrock,Sancus/bedrock,gerv/bedrock
shell
## Code Before: set -ex [[ "$CIRCLE_BRANCH" != demo__* ]] && exit 0 DEBUG=False DEV=True DATABASE_URL=sqlite:///bedrock.db DOCKER_CACHE_PATH=~/docker MOFO_SECURITY_ADVISORIES_PATH=$DOCKER_CACHE_PATH/security_advisories PROD_DETAILS_STORAGE=product_details.storage.PDDatabaseStorage mkdir -p $DOCKER_CACHE_PATH if [[ -f $DOCKER_CACHE_PATH/bedrock.db ]]; then cp $DOCKER_CACHE_PATH/bedrock.db ./ fi ./manage.py migrate --noinput ./manage.py rnasync ./manage.py cron update_ical_feeds ./manage.py update_product_details ./manage.py update_externalfiles ./manage.py update_security_advisories cp -f bedrock.db $DOCKER_CACHE_PATH/ if [[ -e $DOCKER_CACHE_PATH/image.tar ]]; then docker load --input ~/docker/image.tar; fi echo "ENV GIT_SHA ${CIRCLE_SHA1}" >> Dockerfile docker build -t "$DOCKER_IMAGE_TAG" --pull=true . docker save "$DOCKER_IMAGE_TAG" > $DOCKER_CACHE_PATH/image.tar ## Instruction: Fix CircleCI demo deploy data * Have it run the fxos feed update * Have it use the .bedrock-demo-env settings ## Code After: set -ex [[ "$CIRCLE_BRANCH" != demo__* ]] && exit 0 export DOCKER_CACHE_PATH=~/docker mkdir -p $DOCKER_CACHE_PATH if [[ -f $DOCKER_CACHE_PATH/bedrock.db ]]; then cp $DOCKER_CACHE_PATH/bedrock.db ./ fi # use settings in manage.py runs cp .bedrock_demo_env .env echo "MOFO_SECURITY_ADVISORIES_PATH=$DOCKER_CACHE_PATH/security_advisories" >> .env ./manage.py migrate --noinput ./manage.py rnasync ./manage.py cron update_ical_feeds ./manage.py cron cleanup_ical_events ./manage.py cron update_tweets ./manage.py update_product_details ./manage.py update_externalfiles ./manage.py update_security_advisories ./manage.py runscript update_firefox_os_feeds cp -f bedrock.db $DOCKER_CACHE_PATH/ # don't include in built container rm -f .env if [[ -e $DOCKER_CACHE_PATH/image.tar ]]; then docker load --input $DOCKER_CACHE_PATH/image.tar; fi echo "ENV GIT_SHA ${CIRCLE_SHA1}" >> Dockerfile docker build -t "$DOCKER_IMAGE_TAG" --pull=true . docker save "$DOCKER_IMAGE_TAG" > $DOCKER_CACHE_PATH/image.tar
set -ex [[ "$CIRCLE_BRANCH" != demo__* ]] && exit 0 - DEBUG=False - DEV=True - DATABASE_URL=sqlite:///bedrock.db - DOCKER_CACHE_PATH=~/docker + export DOCKER_CACHE_PATH=~/docker ? +++++++ - MOFO_SECURITY_ADVISORIES_PATH=$DOCKER_CACHE_PATH/security_advisories - PROD_DETAILS_STORAGE=product_details.storage.PDDatabaseStorage mkdir -p $DOCKER_CACHE_PATH if [[ -f $DOCKER_CACHE_PATH/bedrock.db ]]; then cp $DOCKER_CACHE_PATH/bedrock.db ./ fi + # use settings in manage.py runs + cp .bedrock_demo_env .env + + echo "MOFO_SECURITY_ADVISORIES_PATH=$DOCKER_CACHE_PATH/security_advisories" >> .env + ./manage.py migrate --noinput ./manage.py rnasync ./manage.py cron update_ical_feeds + ./manage.py cron cleanup_ical_events + ./manage.py cron update_tweets ./manage.py update_product_details ./manage.py update_externalfiles ./manage.py update_security_advisories + ./manage.py runscript update_firefox_os_feeds cp -f bedrock.db $DOCKER_CACHE_PATH/ + # don't include in built container + rm -f .env - if [[ -e $DOCKER_CACHE_PATH/image.tar ]]; then docker load --input ~/docker/image.tar; fi ? ^^^^^^^^ + if [[ -e $DOCKER_CACHE_PATH/image.tar ]]; then docker load --input $DOCKER_CACHE_PATH/image.tar; fi ? ^^^^^^^^^^^^^^^^^^ echo "ENV GIT_SHA ${CIRCLE_SHA1}" >> Dockerfile docker build -t "$DOCKER_IMAGE_TAG" --pull=true . docker save "$DOCKER_IMAGE_TAG" > $DOCKER_CACHE_PATH/image.tar
19
0.633333
12
7
948dc7e7e6d54e4f4e41288ab014cc2e0aa53e98
scraper.py
scraper.py
import os import sys from selenium import webdriver def scrape(): browser = webdriver.Chrome('/home/lowercase/Desktop/scheduler/chromedriver') if __name__ == "__main__": scrape()
import os import sys import getpass from selenium import webdriver def scrape(): browser = webdriver.Chrome('/home/lowercase/Desktop/scheduler/chromedriver') browser.get('https://my.unt.edu/psp/papd01/EMPLOYEE/EMPL/h/?tab=NTPA_GUEST') euid = input('What is your EUID?') password = getpass.getpass('What is your password?') euid_field = browser.find_element_by_name('userid') password_field = browser.find_element_by_name('pwd') euid_field.send_keys(euid) password_field.send_keys(password) if __name__ == "__main__": scrape()
Load sign in page and collect password.
Load sign in page and collect password.
Python
mit
undercase/scheduler
python
## Code Before: import os import sys from selenium import webdriver def scrape(): browser = webdriver.Chrome('/home/lowercase/Desktop/scheduler/chromedriver') if __name__ == "__main__": scrape() ## Instruction: Load sign in page and collect password. ## Code After: import os import sys import getpass from selenium import webdriver def scrape(): browser = webdriver.Chrome('/home/lowercase/Desktop/scheduler/chromedriver') browser.get('https://my.unt.edu/psp/papd01/EMPLOYEE/EMPL/h/?tab=NTPA_GUEST') euid = input('What is your EUID?') password = getpass.getpass('What is your password?') euid_field = browser.find_element_by_name('userid') password_field = browser.find_element_by_name('pwd') euid_field.send_keys(euid) password_field.send_keys(password) if __name__ == "__main__": scrape()
import os import sys + + import getpass from selenium import webdriver def scrape(): browser = webdriver.Chrome('/home/lowercase/Desktop/scheduler/chromedriver') + browser.get('https://my.unt.edu/psp/papd01/EMPLOYEE/EMPL/h/?tab=NTPA_GUEST') + + euid = input('What is your EUID?') + password = getpass.getpass('What is your password?') + + euid_field = browser.find_element_by_name('userid') + password_field = browser.find_element_by_name('pwd') + + euid_field.send_keys(euid) + password_field.send_keys(password) if __name__ == "__main__": scrape()
12
1.2
12
0
714f9ac8f430f661c8a62bcbc9acc9f12f3e669a
tutorial-try.redis.io/tutorial-try.redis.io.md
tutorial-try.redis.io/tutorial-try.redis.io.md
TRY REDIS === Source: [Try Redis majestic tutorial][url-tutorial] Redis is a key-value store, often referred as a NoSQL database. ###Store and retrieve {% gist 8729128 %} [url-tutorial]: http://try.redis.io/ [comment]: Gist filenames: following-tutorial-try.redis.io-NUMBER [notes][comment]
TRY REDIS === Source: [Try Redis majestic tutorial][url-tutorial] Redis is a key-value store, often referred as a NoSQL database. ###Store and retrieve ``` SET server:name "fido" GET server:name => "fido" ``` [url-tutorial]: http://try.redis.io/ <!--- Gist filenames: following-tutorial-try.redis.io-NUMBER -->
Stop using {% gist %} which does not render code
Stop using {% gist %} which does not render code Stop using {% gist %} which does not render code Contact: 0a00ae03c9edd21d50a229f9fa1f98d9b3912b9e@isla.io
Markdown
unlicense
joaquindev/redis101
markdown
## Code Before: TRY REDIS === Source: [Try Redis majestic tutorial][url-tutorial] Redis is a key-value store, often referred as a NoSQL database. ###Store and retrieve {% gist 8729128 %} [url-tutorial]: http://try.redis.io/ [comment]: Gist filenames: following-tutorial-try.redis.io-NUMBER [notes][comment] ## Instruction: Stop using {% gist %} which does not render code Stop using {% gist %} which does not render code Contact: 0a00ae03c9edd21d50a229f9fa1f98d9b3912b9e@isla.io ## Code After: TRY REDIS === Source: [Try Redis majestic tutorial][url-tutorial] Redis is a key-value store, often referred as a NoSQL database. ###Store and retrieve ``` SET server:name "fido" GET server:name => "fido" ``` [url-tutorial]: http://try.redis.io/ <!--- Gist filenames: following-tutorial-try.redis.io-NUMBER -->
TRY REDIS === Source: [Try Redis majestic tutorial][url-tutorial] Redis is a key-value store, often referred as a NoSQL database. ###Store and retrieve - {% gist 8729128 %} - + ``` + SET server:name "fido" + GET server:name => "fido" + ``` [url-tutorial]: http://try.redis.io/ - [comment]: Gist filenames: following-tutorial-try.redis.io-NUMBER ? ^^^^^^^^^^ + <!--- Gist filenames: following-tutorial-try.redis.io-NUMBER --> ? ^^^^^ ++++ - [notes][comment]
9
0.5
5
4
97bbe575a7223bf2116b5e427f6866f68fb3a9cb
www/templates/default/html/sidebar.tpl.php
www/templates/default/html/sidebar.tpl.php
<div class="calendar"> <?php echo $savvy->render($context->getMonthWidget()); ?> </div> <div id="subscribe"> <span>Subscribe to this calendar</span> <ul id="droplist"> <li id="eventrss"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=rss&amp;limit=100" title="RSS feed of upcoming events" class="wdn-icon-rss-squared">RSS</a></li> <li id="eventical"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=ics&amp;limit=100" title="ICS format of upcoming events" class="wdn-icon-calendar">ICS</a></li> </ul> </div>
<div class="calendar"> <?php echo $savvy->render($context->getMonthWidget()); ?> </div> <div id="subscribe"> <span>Subscribe to this calendar</span> <ul id="droplist"> <li id="eventrss"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=rss&amp;limit=100" title="RSS feed of upcoming events" class="eventicon-rss">RSS</a></li> <li id="eventical"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=ics&amp;limit=100" title="ICS format of upcoming events" class="wdn-icon-calendar">ICS</a></li> </ul> </div>
Use eventicon in sidebar links
Use eventicon in sidebar links
PHP
bsd-3-clause
unl/UNL_UCBCN_System,unl/UNL_UCBCN_System,unl/UNL_UCBCN_System,unl/UNL_UCBCN_System,unl/UNL_UCBCN_System
php
## Code Before: <div class="calendar"> <?php echo $savvy->render($context->getMonthWidget()); ?> </div> <div id="subscribe"> <span>Subscribe to this calendar</span> <ul id="droplist"> <li id="eventrss"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=rss&amp;limit=100" title="RSS feed of upcoming events" class="wdn-icon-rss-squared">RSS</a></li> <li id="eventical"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=ics&amp;limit=100" title="ICS format of upcoming events" class="wdn-icon-calendar">ICS</a></li> </ul> </div> ## Instruction: Use eventicon in sidebar links ## Code After: <div class="calendar"> <?php echo $savvy->render($context->getMonthWidget()); ?> </div> <div id="subscribe"> <span>Subscribe to this calendar</span> <ul id="droplist"> <li id="eventrss"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=rss&amp;limit=100" title="RSS feed of upcoming events" class="eventicon-rss">RSS</a></li> <li id="eventical"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=ics&amp;limit=100" title="ICS format of upcoming events" class="wdn-icon-calendar">ICS</a></li> </ul> </div>
<div class="calendar"> <?php echo $savvy->render($context->getMonthWidget()); ?> </div> <div id="subscribe"> <span>Subscribe to this calendar</span> <ul id="droplist"> - <li id="eventrss"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=rss&amp;limit=100" title="RSS feed of upcoming events" class="wdn-icon-rss-squared">RSS</a></li> ? ^^ ^ -------- + <li id="eventrss"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=rss&amp;limit=100" title="RSS feed of upcoming events" class="eventicon-rss">RSS</a></li> ? ^^^ ^ <li id="eventical"><a href="<?php echo $frontend->getUpcomingURL(); ?>?format=ics&amp;limit=100" title="ICS format of upcoming events" class="wdn-icon-calendar">ICS</a></li> </ul> </div>
2
0.181818
1
1
c744ca4ed851eb1edb93ea6d30cc0fe190df4ce8
README.md
README.md
Creating a sample that shows how to create and test custom tslint rules
Creating a sample that shows how to create and test custom tslint rules Based upon documentation in tslint for building and testing custom rules * http://palantir.github.io/tslint/develop/custom-rules/ * http://palantir.github.io/tslint/develop/testing-rules/
Update readme with links to docs.
Update readme with links to docs.
Markdown
unlicense
abierbaum/tslint_custom_rule_seed,abierbaum/tslint_custom_rule_seed
markdown
## Code Before: Creating a sample that shows how to create and test custom tslint rules ## Instruction: Update readme with links to docs. ## Code After: Creating a sample that shows how to create and test custom tslint rules Based upon documentation in tslint for building and testing custom rules * http://palantir.github.io/tslint/develop/custom-rules/ * http://palantir.github.io/tslint/develop/testing-rules/
Creating a sample that shows how to create and test custom tslint rules + + Based upon documentation in tslint for building and testing custom rules + + * http://palantir.github.io/tslint/develop/custom-rules/ + * http://palantir.github.io/tslint/develop/testing-rules/
5
5
5
0
98d7334b28859b34de37dc58909693720eb0277d
meta/main.yml
meta/main.yml
--- galaxy_info: author: Jakub Jirutka company: CTU in Prague description: A role to install and configure Roundcube. license: MIT min_ansible_version: 1.8 platforms: - name: Gentoo categories: - web dependencies: - role: nginx - role: php-fpm-pool php_fpm_pool_name: "{{ roundcube_name }}" php_fpm_user: "{{ roundcube_user }}" php_fpm_group: "{{ roundcube_group }}" php_fpm_chroot_enabled: "{{ roundcube_chroot_enabled }}" php_fpm_chroot_dir: "{{ roundcube_base_dir }}" php_fpm_logs_dir: "{{ roundcube_logs_dir }}" php_fpm_temp_dir: "{{ roundcube_temp_dir }}" php_fpm_upload_max_size: "{{ roundcube_upload_max_size }}" php_fpm_memory_limit: 25 php_fpm_ini_overrides: mbstring.func_overload: false
--- galaxy_info: author: Jakub Jirutka company: CTU in Prague description: A role to install and configure Roundcube. license: MIT min_ansible_version: 1.8 platforms: - name: Gentoo categories: - web dependencies: - role: nginx - role: php-fpm-pool php_fpm_pool_name: "{{ roundcube_name }}" php_fpm_user: "{{ roundcube_user }}" php_fpm_group: "{{ roundcube_group }}" php_fpm_chroot_enabled: "{{ roundcube_chroot_enabled }}" php_fpm_chroot_dir: "{{ roundcube_base_dir }}" php_fpm_logs_dir: "{{ roundcube_logs_dir }}" php_fpm_temp_dir: "{{ roundcube_temp_dir }}" php_fpm_upload_max_size: "{{ roundcube_upload_max_size }}" php_fpm_memory_limit: 25 php_fpm_ini_overrides: mbstring.func_overload: false php_fpm_disable_functions: [exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source]
Set php_fpm_disable_functions for php-fpm-pool role
Set php_fpm_disable_functions for php-fpm-pool role
YAML
mit
jirutka/ansible-role-roundcube,gentoo-ansible/role-roundcube
yaml
## Code Before: --- galaxy_info: author: Jakub Jirutka company: CTU in Prague description: A role to install and configure Roundcube. license: MIT min_ansible_version: 1.8 platforms: - name: Gentoo categories: - web dependencies: - role: nginx - role: php-fpm-pool php_fpm_pool_name: "{{ roundcube_name }}" php_fpm_user: "{{ roundcube_user }}" php_fpm_group: "{{ roundcube_group }}" php_fpm_chroot_enabled: "{{ roundcube_chroot_enabled }}" php_fpm_chroot_dir: "{{ roundcube_base_dir }}" php_fpm_logs_dir: "{{ roundcube_logs_dir }}" php_fpm_temp_dir: "{{ roundcube_temp_dir }}" php_fpm_upload_max_size: "{{ roundcube_upload_max_size }}" php_fpm_memory_limit: 25 php_fpm_ini_overrides: mbstring.func_overload: false ## Instruction: Set php_fpm_disable_functions for php-fpm-pool role ## Code After: --- galaxy_info: author: Jakub Jirutka company: CTU in Prague description: A role to install and configure Roundcube. license: MIT min_ansible_version: 1.8 platforms: - name: Gentoo categories: - web dependencies: - role: nginx - role: php-fpm-pool php_fpm_pool_name: "{{ roundcube_name }}" php_fpm_user: "{{ roundcube_user }}" php_fpm_group: "{{ roundcube_group }}" php_fpm_chroot_enabled: "{{ roundcube_chroot_enabled }}" php_fpm_chroot_dir: "{{ roundcube_base_dir }}" php_fpm_logs_dir: "{{ roundcube_logs_dir }}" php_fpm_temp_dir: "{{ roundcube_temp_dir }}" php_fpm_upload_max_size: "{{ roundcube_upload_max_size }}" php_fpm_memory_limit: 25 php_fpm_ini_overrides: mbstring.func_overload: false php_fpm_disable_functions: [exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source]
--- galaxy_info: author: Jakub Jirutka company: CTU in Prague description: A role to install and configure Roundcube. license: MIT min_ansible_version: 1.8 platforms: - name: Gentoo categories: - web dependencies: - role: nginx - role: php-fpm-pool php_fpm_pool_name: "{{ roundcube_name }}" php_fpm_user: "{{ roundcube_user }}" php_fpm_group: "{{ roundcube_group }}" php_fpm_chroot_enabled: "{{ roundcube_chroot_enabled }}" php_fpm_chroot_dir: "{{ roundcube_base_dir }}" php_fpm_logs_dir: "{{ roundcube_logs_dir }}" php_fpm_temp_dir: "{{ roundcube_temp_dir }}" php_fpm_upload_max_size: "{{ roundcube_upload_max_size }}" php_fpm_memory_limit: 25 php_fpm_ini_overrides: mbstring.func_overload: false + php_fpm_disable_functions: [exec,passthru,shell_exec,system,proc_open,popen,curl_exec,curl_multi_exec,parse_ini_file,show_source]
1
0.038462
1
0
f1ee7b0771576d5af9538cd77fd77217db1a8e9a
module/Directorzone/view/directorzone/directory/company-list.phtml
module/Directorzone/view/directorzone/directory/company-list.phtml
<?php echo $this->partial('directory-nav.phtml'); ?> <h3>Company directory</h3> <h5><a href="/directories/company/<?php echo $this->companydirectoryid; ?>/overview">Add new company</a></h5> <table id="companies" data-link="row" class="rowlink table table-striped table-bordered table-hover"> <tr><th>Number</th><th>Name</th><th>CEO</th><th>Sectors</th><th>Turnover</th></tr> </table> <ul class="pager"> <li class="previous" id="previous" class="disabled"><a href="#">&larr; Previous</a></li> <li class="next" id="next"><a href="#">Next &rarr;</a></li> </ul> <script> $(document).ready(function() { netsensia_Pager( 1, 10, 'companies', '/ajax/company/list', function(key, value) { var url = '/directories/company/' + value.internalId; var newRow = '<tr>'; newRow += '<td><a href="' + url + '">' + value.number + '</a></td>'; newRow += '<td>' + value.name + '</td>'; newRow += '<td>&nbsp;</td>'; newRow += '<td>&nbsp;</td>'; newRow += '<td>&nbsp;</td>'; newRow += '</tr>'; return newRow; } ); }); </script>
<?php echo $this->partial('directory-nav.phtml'); ?> <h3>Company directory</h3> <h5><a href="/directories/company/new">Add new company</a></h5> <table id="companies" data-link="row" class="rowlink table table-striped table-bordered table-hover"> <tr><th>Number</th><th>Name</th><th>CEO</th><th>Sectors</th><th>Turnover</th></tr> </table> <ul class="pager"> <li class="previous" id="previous" class="disabled"><a href="#">&larr; Previous</a></li> <li class="next" id="next"><a href="#">Next &rarr;</a></li> </ul> <script> $(document).ready(function() { netsensia_Pager( 1, 10, 'companies', '/ajax/company/list', function(key, value) { var url = '/directories/company/' + value.internalId; var newRow = '<tr>'; newRow += '<td><a href="' + url + '">' + value.number + '</a></td>'; newRow += '<td>' + value.name + '</td>'; newRow += '<td>&nbsp;</td>'; newRow += '<td>&nbsp;</td>'; newRow += '<td>&nbsp;</td>'; newRow += '</tr>'; return newRow; } ); }); </script>
Allow non-CH companies to be added
Allow non-CH companies to be added
HTML+PHP
bsd-3-clause
Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone,Netsensia/directorzone
html+php
## Code Before: <?php echo $this->partial('directory-nav.phtml'); ?> <h3>Company directory</h3> <h5><a href="/directories/company/<?php echo $this->companydirectoryid; ?>/overview">Add new company</a></h5> <table id="companies" data-link="row" class="rowlink table table-striped table-bordered table-hover"> <tr><th>Number</th><th>Name</th><th>CEO</th><th>Sectors</th><th>Turnover</th></tr> </table> <ul class="pager"> <li class="previous" id="previous" class="disabled"><a href="#">&larr; Previous</a></li> <li class="next" id="next"><a href="#">Next &rarr;</a></li> </ul> <script> $(document).ready(function() { netsensia_Pager( 1, 10, 'companies', '/ajax/company/list', function(key, value) { var url = '/directories/company/' + value.internalId; var newRow = '<tr>'; newRow += '<td><a href="' + url + '">' + value.number + '</a></td>'; newRow += '<td>' + value.name + '</td>'; newRow += '<td>&nbsp;</td>'; newRow += '<td>&nbsp;</td>'; newRow += '<td>&nbsp;</td>'; newRow += '</tr>'; return newRow; } ); }); </script> ## Instruction: Allow non-CH companies to be added ## Code After: <?php echo $this->partial('directory-nav.phtml'); ?> <h3>Company directory</h3> <h5><a href="/directories/company/new">Add new company</a></h5> <table id="companies" data-link="row" class="rowlink table table-striped table-bordered table-hover"> <tr><th>Number</th><th>Name</th><th>CEO</th><th>Sectors</th><th>Turnover</th></tr> </table> <ul class="pager"> <li class="previous" id="previous" class="disabled"><a href="#">&larr; Previous</a></li> <li class="next" id="next"><a href="#">Next &rarr;</a></li> </ul> <script> $(document).ready(function() { netsensia_Pager( 1, 10, 'companies', '/ajax/company/list', function(key, value) { var url = '/directories/company/' + value.internalId; var newRow = '<tr>'; newRow += '<td><a href="' + url + '">' + value.number + '</a></td>'; newRow += '<td>' + value.name + '</td>'; newRow += '<td>&nbsp;</td>'; newRow += '<td>&nbsp;</td>'; newRow += '<td>&nbsp;</td>'; newRow += '</tr>'; return newRow; } ); }); </script>
<?php echo $this->partial('directory-nav.phtml'); ?> <h3>Company directory</h3> - <h5><a href="/directories/company/<?php echo $this->companydirectoryid; ?>/overview">Add new company</a></h5> + <h5><a href="/directories/company/new">Add new company</a></h5> <table id="companies" data-link="row" class="rowlink table table-striped table-bordered table-hover"> <tr><th>Number</th><th>Name</th><th>CEO</th><th>Sectors</th><th>Turnover</th></tr> </table> <ul class="pager"> <li class="previous" id="previous" class="disabled"><a href="#">&larr; Previous</a></li> <li class="next" id="next"><a href="#">Next &rarr;</a></li> </ul> <script> $(document).ready(function() { netsensia_Pager( 1, 10, 'companies', '/ajax/company/list', function(key, value) { var url = '/directories/company/' + value.internalId; var newRow = '<tr>'; newRow += '<td><a href="' + url + '">' + value.number + '</a></td>'; newRow += '<td>' + value.name + '</td>'; newRow += '<td>&nbsp;</td>'; newRow += '<td>&nbsp;</td>'; newRow += '<td>&nbsp;</td>'; newRow += '</tr>'; return newRow; } ); }); </script>
2
0.051282
1
1
bd357e2c5676d8bdb1c2a9534e7d597b8d8cf23a
src/Adapters/AwsS3.php
src/Adapters/AwsS3.php
<?php /* * This file is part of flagrow/upload. * * Copyright (c) Flagrow. * * http://flagrow.github.io * * For the full copyright and license information, please view the license.md * file that was distributed with this source code. */ namespace Flagrow\Upload\Adapters; use Flagrow\Upload\Contracts\UploadAdapter; use Flagrow\Upload\File; use Illuminate\Support\Arr; class AwsS3 extends Flysystem implements UploadAdapter { /** * @param File $file */ protected function generateUrl(File $file) { $region = $this->adapter->getClient()->getRegion(); $bucket = $this->adapter->getBucket(); $baseUrl = in_array($region, [null, 'us-east-1']) ? 'https://s3.amazonaws.com/' : sprintf('https://s3-%s.amazonaws.com/', $region); $file->url = sprintf( $baseUrl . '%s/%s', $bucket, Arr::get($this->meta, 'path', $file->path) ); } }
<?php /* * This file is part of flagrow/upload. * * Copyright (c) Flagrow. * * http://flagrow.github.io * * For the full copyright and license information, please view the license.md * file that was distributed with this source code. */ namespace Flagrow\Upload\Adapters; use Flagrow\Upload\Contracts\UploadAdapter; use Flagrow\Upload\File; use Illuminate\Support\Arr; class AwsS3 extends Flysystem implements UploadAdapter { /** * @param File $file */ protected function generateUrl(File $file) { $region = $this->adapter->getClient()->getRegion(); $bucket = $this->adapter->getBucket(); $baseUrl = in_array($region, [null, 'us-east-1']) ? sprintf('http://%s.s3-website-us-east-1.amazonaws.com/', $bucket) : sprintf('http://%s.s3-website-%s.amazonaws.com/', $bucket, $region); $file->url = sprintf( $baseUrl . '%s', Arr::get($this->meta, 'path', $file->path) ); } }
Use S3 Static website hosting instead
Use S3 Static website hosting instead As best practice on AWS, you should use the static website hosting feature instead of making your bucket become public. With the static website hosting feature, you could also utilise its redirection feature to utilise CDN like AWS Cloudfront to serve public traffic to your S3 bucket. For more information, please read: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html
PHP
mit
flagrow/upload,flagrow/upload,flagrow/upload
php
## Code Before: <?php /* * This file is part of flagrow/upload. * * Copyright (c) Flagrow. * * http://flagrow.github.io * * For the full copyright and license information, please view the license.md * file that was distributed with this source code. */ namespace Flagrow\Upload\Adapters; use Flagrow\Upload\Contracts\UploadAdapter; use Flagrow\Upload\File; use Illuminate\Support\Arr; class AwsS3 extends Flysystem implements UploadAdapter { /** * @param File $file */ protected function generateUrl(File $file) { $region = $this->adapter->getClient()->getRegion(); $bucket = $this->adapter->getBucket(); $baseUrl = in_array($region, [null, 'us-east-1']) ? 'https://s3.amazonaws.com/' : sprintf('https://s3-%s.amazonaws.com/', $region); $file->url = sprintf( $baseUrl . '%s/%s', $bucket, Arr::get($this->meta, 'path', $file->path) ); } } ## Instruction: Use S3 Static website hosting instead As best practice on AWS, you should use the static website hosting feature instead of making your bucket become public. With the static website hosting feature, you could also utilise its redirection feature to utilise CDN like AWS Cloudfront to serve public traffic to your S3 bucket. For more information, please read: https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html ## Code After: <?php /* * This file is part of flagrow/upload. * * Copyright (c) Flagrow. * * http://flagrow.github.io * * For the full copyright and license information, please view the license.md * file that was distributed with this source code. */ namespace Flagrow\Upload\Adapters; use Flagrow\Upload\Contracts\UploadAdapter; use Flagrow\Upload\File; use Illuminate\Support\Arr; class AwsS3 extends Flysystem implements UploadAdapter { /** * @param File $file */ protected function generateUrl(File $file) { $region = $this->adapter->getClient()->getRegion(); $bucket = $this->adapter->getBucket(); $baseUrl = in_array($region, [null, 'us-east-1']) ? sprintf('http://%s.s3-website-us-east-1.amazonaws.com/', $bucket) : sprintf('http://%s.s3-website-%s.amazonaws.com/', $bucket, $region); $file->url = sprintf( $baseUrl . '%s', Arr::get($this->meta, 'path', $file->path) ); } }
<?php /* * This file is part of flagrow/upload. * * Copyright (c) Flagrow. * * http://flagrow.github.io * * For the full copyright and license information, please view the license.md * file that was distributed with this source code. */ namespace Flagrow\Upload\Adapters; use Flagrow\Upload\Contracts\UploadAdapter; use Flagrow\Upload\File; use Illuminate\Support\Arr; class AwsS3 extends Flysystem implements UploadAdapter { /** * @param File $file */ protected function generateUrl(File $file) { $region = $this->adapter->getClient()->getRegion(); $bucket = $this->adapter->getBucket(); $baseUrl = in_array($region, [null, 'us-east-1']) ? - 'https://s3.amazonaws.com/' : + sprintf('http://%s.s3-website-us-east-1.amazonaws.com/', $bucket) : - sprintf('https://s3-%s.amazonaws.com/', $region); ? - + sprintf('http://%s.s3-website-%s.amazonaws.com/', $bucket, $region); ? +++ ++++++++ +++++++++ $file->url = sprintf( - $baseUrl . '%s/%s', ? --- + $baseUrl . '%s', - $bucket, Arr::get($this->meta, 'path', $file->path) ); } }
7
0.175
3
4
4b1931def8712e6689556a5c6e122f3f86c14eeb
README.md
README.md
DoGet ===== [![Build Status on TravisCI](https://secure.travis-ci.org/tueftler/doget.png)](http://travis-ci.org/tueftler/doget) Dockerfiles can only inherit from one source. What if you want to want to your favorite application on your own base image? Then you're down to copy&pasting Dockerfile code all over the place. **DoGet solves this**. Think of DoGet as "compiler-assisted copy&paste". Here's an example: ```dockerfile FROM corporate.example.com/images/debian:8 # Our own base image PROVIDES debian:jessie # ...which is basically Debian Jessie USE github.com/docker-library/php/7.0 # On top of that, use official PHP 7.0 # <Insert app here> ``` DoGet extends Dockerfile syntax with `PROVIDES` and `USE` instructions. The `USE` instruction downloads the Dockerfile from the specified location and includes its contents (as if it had been copy&pasted). The `FROM` instruction in included files is checked for compatibility. The `PROVIDES` instruction serves the purpose of satisfying the compatibility check. To use the tool, copy the above into a file called `Dockerfile.in` and type: ```sh $ doget build ``` This will resolve traits, downloading if necessary, and pass on the created Dockerfile to *docker build*.
DoGet ===== [![Build Status on TravisCI](https://secure.travis-ci.org/tueftler/doget.png)](http://travis-ci.org/tueftler/doget) Dockerfiles can only inherit from one source. What if you want to want to your favorite application on your own base image? Then you're down to copy&pasting Dockerfile code all over the place. **DoGet solves this**. Think of DoGet as "compiler-assisted copy&paste". Here's an example: ```dockerfile FROM corporate.example.com/images/debian:8 # Our own base image PROVIDES debian:jessie # ...which is basically Debian Jessie USE github.com/docker-library/php/7.0 # On top of that, use official PHP 7.0 # <Insert app here> ``` DoGet extends Dockerfile syntax with `PROVIDES` and `USE` instructions. The `USE` instruction downloads the Dockerfile from the specified location and includes its contents (as if it had been copy&pasted). The `FROM` instruction in included files is checked for compatibility. The `PROVIDES` instruction serves the purpose of satisfying the compatibility check. To use the tool, copy the above into a file called `Dockerfile.in` and type: ```sh $ doget build -t [tag] . ``` This will resolve traits, downloading if necessary, and pass on the created Dockerfile to *docker build*.
Fix instruction how to run build
Fix instruction how to run build
Markdown
bsd-3-clause
tueftler/doget,tueftler/doget
markdown
## Code Before: DoGet ===== [![Build Status on TravisCI](https://secure.travis-ci.org/tueftler/doget.png)](http://travis-ci.org/tueftler/doget) Dockerfiles can only inherit from one source. What if you want to want to your favorite application on your own base image? Then you're down to copy&pasting Dockerfile code all over the place. **DoGet solves this**. Think of DoGet as "compiler-assisted copy&paste". Here's an example: ```dockerfile FROM corporate.example.com/images/debian:8 # Our own base image PROVIDES debian:jessie # ...which is basically Debian Jessie USE github.com/docker-library/php/7.0 # On top of that, use official PHP 7.0 # <Insert app here> ``` DoGet extends Dockerfile syntax with `PROVIDES` and `USE` instructions. The `USE` instruction downloads the Dockerfile from the specified location and includes its contents (as if it had been copy&pasted). The `FROM` instruction in included files is checked for compatibility. The `PROVIDES` instruction serves the purpose of satisfying the compatibility check. To use the tool, copy the above into a file called `Dockerfile.in` and type: ```sh $ doget build ``` This will resolve traits, downloading if necessary, and pass on the created Dockerfile to *docker build*. ## Instruction: Fix instruction how to run build ## Code After: DoGet ===== [![Build Status on TravisCI](https://secure.travis-ci.org/tueftler/doget.png)](http://travis-ci.org/tueftler/doget) Dockerfiles can only inherit from one source. What if you want to want to your favorite application on your own base image? Then you're down to copy&pasting Dockerfile code all over the place. **DoGet solves this**. Think of DoGet as "compiler-assisted copy&paste". Here's an example: ```dockerfile FROM corporate.example.com/images/debian:8 # Our own base image PROVIDES debian:jessie # ...which is basically Debian Jessie USE github.com/docker-library/php/7.0 # On top of that, use official PHP 7.0 # <Insert app here> ``` DoGet extends Dockerfile syntax with `PROVIDES` and `USE` instructions. The `USE` instruction downloads the Dockerfile from the specified location and includes its contents (as if it had been copy&pasted). The `FROM` instruction in included files is checked for compatibility. The `PROVIDES` instruction serves the purpose of satisfying the compatibility check. To use the tool, copy the above into a file called `Dockerfile.in` and type: ```sh $ doget build -t [tag] . ``` This will resolve traits, downloading if necessary, and pass on the created Dockerfile to *docker build*.
DoGet ===== [![Build Status on TravisCI](https://secure.travis-ci.org/tueftler/doget.png)](http://travis-ci.org/tueftler/doget) Dockerfiles can only inherit from one source. What if you want to want to your favorite application on your own base image? Then you're down to copy&pasting Dockerfile code all over the place. **DoGet solves this**. Think of DoGet as "compiler-assisted copy&paste". Here's an example: ```dockerfile FROM corporate.example.com/images/debian:8 # Our own base image PROVIDES debian:jessie # ...which is basically Debian Jessie USE github.com/docker-library/php/7.0 # On top of that, use official PHP 7.0 # <Insert app here> ``` DoGet extends Dockerfile syntax with `PROVIDES` and `USE` instructions. The `USE` instruction downloads the Dockerfile from the specified location and includes its contents (as if it had been copy&pasted). The `FROM` instruction in included files is checked for compatibility. The `PROVIDES` instruction serves the purpose of satisfying the compatibility check. To use the tool, copy the above into a file called `Dockerfile.in` and type: ```sh - $ doget build + $ doget build -t [tag] . ``` This will resolve traits, downloading if necessary, and pass on the created Dockerfile to *docker build*.
2
0.074074
1
1
c464afc916bae74829687e9122014d9d396726c8
sonar-project.properties
sonar-project.properties
sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.exclusions=*/*.config, */__pycache__/**, env/**, vendor/**, doc/**, */*.pyc, *.yml, *.yaml, *.xml, *.txt, *.md, *.old, *.v1, Jenkinsfile, LICENSE, *.sh, *.properties, appengine_config.py sonar.language=py sonar.projectKey=cowbull_server
sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.exclusions=*/*.config, */__pycache__/**, env/**, vendor/**, doc/**, */*.pyc, */*.pytry, *.yml, *.yaml, *.xml, *.txt, *.md, *.old, *.v1, Jenkinsfile, LICENSE, *.sh, *.properties, appengine_config.py sonar.language=py sonar.projectKey=cowbull_server
Add pytry to exception list
Add pytry to exception list
INI
apache-2.0
dsandersAzure/python_cowbull_server,dsandersAzure/python_cowbull_server
ini
## Code Before: sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.exclusions=*/*.config, */__pycache__/**, env/**, vendor/**, doc/**, */*.pyc, *.yml, *.yaml, *.xml, *.txt, *.md, *.old, *.v1, Jenkinsfile, LICENSE, *.sh, *.properties, appengine_config.py sonar.language=py sonar.projectKey=cowbull_server ## Instruction: Add pytry to exception list ## Code After: sonar.sources=. sonar.sourceEncoding=UTF-8 sonar.exclusions=*/*.config, */__pycache__/**, env/**, vendor/**, doc/**, */*.pyc, */*.pytry, *.yml, *.yaml, *.xml, *.txt, *.md, *.old, *.v1, Jenkinsfile, LICENSE, *.sh, *.properties, appengine_config.py sonar.language=py sonar.projectKey=cowbull_server
sonar.sources=. sonar.sourceEncoding=UTF-8 - sonar.exclusions=*/*.config, */__pycache__/**, env/**, vendor/**, doc/**, */*.pyc, *.yml, *.yaml, *.xml, *.txt, *.md, *.old, *.v1, Jenkinsfile, LICENSE, *.sh, *.properties, appengine_config.py + sonar.exclusions=*/*.config, */__pycache__/**, env/**, vendor/**, doc/**, */*.pyc, */*.pytry, *.yml, *.yaml, *.xml, *.txt, *.md, *.old, *.v1, Jenkinsfile, LICENSE, *.sh, *.properties, appengine_config.py ? +++++++++++ sonar.language=py sonar.projectKey=cowbull_server
2
0.4
1
1
35b6120f355e3913534e654dbd40cd6b4a10dd64
vim/settings/ctrlp.vim
vim/settings/ctrlp.vim
let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/]\.(git|hg|svn)$', \ 'file': '\v\.(exe|so|dll)$', \ }
let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/]\.(git|hg|svn)$', \ 'file': '\v\.(exe|so|dll)$', \ } map <leader>C :CtrlPClearCache<cr>
Add CtrlP cache clearing shortcut
Add CtrlP cache clearing shortcut
VimL
mit
paulfioravanti/dotfiles,paulfioravanti/dotfiles,paulfioravanti/dotfiles
viml
## Code Before: let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/]\.(git|hg|svn)$', \ 'file': '\v\.(exe|so|dll)$', \ } ## Instruction: Add CtrlP cache clearing shortcut ## Code After: let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/]\.(git|hg|svn)$', \ 'file': '\v\.(exe|so|dll)$', \ } map <leader>C :CtrlPClearCache<cr>
let g:ctrlp_custom_ignore = { \ 'dir': '\v[\/]\.(git|hg|svn)$', \ 'file': '\v\.(exe|so|dll)$', \ } + + map <leader>C :CtrlPClearCache<cr>
2
0.5
2
0
dea02c4f70086f5c3da0e712240c00a21204c7f5
data/FR.json
data/FR.json
[ { "name" : "Jour de l'an", "rule" : "January 1st" }, { "name" : "Fête du Travail", "rule" : "May 1st" }, { "name" : "Fête de la Victoire 1945", "rule" : "May 8th" }, { "name" : "Fête nationale", "rule" : "July 14th" }, { "name" : "Assomption", "rule" : "August 15th" }, { "name" : "Toussaint", "rule" : "November 1th" }, { "name" : "Armistice de 1918", "rule" : "November 11th" }, { "name" : "Noël", "rule" : "December 25th" }, { "name" : "Lundi de Pâques", "rule" : "%EASTER" }, { "name" : "Jeudi de l'Ascension", "rule" : "%EASTER +39 days" }, { "name" : "Lundi de Pentecôte", "rule" : "%EASTER +50 days" } ]
[ { "name" : "Jour de l'an", "rule" : "January 1st" }, { "name" : "Fête du Travail", "rule" : "May 1st" }, { "name" : "Fête de la Victoire 1945", "rule" : "May 8th" }, { "name" : "Fête nationale", "rule" : "July 14th" }, { "name" : "Assomption", "rule" : "August 15th" }, { "name" : "Toussaint", "rule" : "November 1th" }, { "name" : "Armistice de 1918", "rule" : "November 11th" }, { "name" : "Noël", "rule" : "December 25th" }, { "name" : "Lundi de Pâques", "rule" : "%EASTER +1 days" }, { "name" : "Jeudi de l'Ascension", "rule" : "%EASTER +39 days" }, { "name" : "Lundi de Pentecôte", "rule" : "%EASTER +50 days" } ]
Fix for Lundi de Pâques
Fix for Lundi de Pâques
JSON
mit
Sazed/holidayapi.com,calvera/holidayapi.com,igitur/holidayapi.com,calvera/holidayapi.com,igitur/holidayapi.com,Memphis335/holidayapi.com,Sazed/holidayapi.com,Memphis335/holidayapi.com
json
## Code Before: [ { "name" : "Jour de l'an", "rule" : "January 1st" }, { "name" : "Fête du Travail", "rule" : "May 1st" }, { "name" : "Fête de la Victoire 1945", "rule" : "May 8th" }, { "name" : "Fête nationale", "rule" : "July 14th" }, { "name" : "Assomption", "rule" : "August 15th" }, { "name" : "Toussaint", "rule" : "November 1th" }, { "name" : "Armistice de 1918", "rule" : "November 11th" }, { "name" : "Noël", "rule" : "December 25th" }, { "name" : "Lundi de Pâques", "rule" : "%EASTER" }, { "name" : "Jeudi de l'Ascension", "rule" : "%EASTER +39 days" }, { "name" : "Lundi de Pentecôte", "rule" : "%EASTER +50 days" } ] ## Instruction: Fix for Lundi de Pâques ## Code After: [ { "name" : "Jour de l'an", "rule" : "January 1st" }, { "name" : "Fête du Travail", "rule" : "May 1st" }, { "name" : "Fête de la Victoire 1945", "rule" : "May 8th" }, { "name" : "Fête nationale", "rule" : "July 14th" }, { "name" : "Assomption", "rule" : "August 15th" }, { "name" : "Toussaint", "rule" : "November 1th" }, { "name" : "Armistice de 1918", "rule" : "November 11th" }, { "name" : "Noël", "rule" : "December 25th" }, { "name" : "Lundi de Pâques", "rule" : "%EASTER +1 days" }, { "name" : "Jeudi de l'Ascension", "rule" : "%EASTER +39 days" }, { "name" : "Lundi de Pentecôte", "rule" : "%EASTER +50 days" } ]
[ { "name" : "Jour de l'an", "rule" : "January 1st" }, { "name" : "Fête du Travail", "rule" : "May 1st" }, { "name" : "Fête de la Victoire 1945", "rule" : "May 8th" }, { "name" : "Fête nationale", "rule" : "July 14th" }, { "name" : "Assomption", "rule" : "August 15th" }, { "name" : "Toussaint", "rule" : "November 1th" }, { "name" : "Armistice de 1918", "rule" : "November 11th" }, { "name" : "Noël", "rule" : "December 25th" }, - { "name" : "Lundi de Pâques", "rule" : "%EASTER" }, ? ^^^^^^^^^^^^^^^^^ + { "name" : "Lundi de Pâques", "rule" : "%EASTER +1 days" }, ? ++++++++ ^^^ { "name" : "Jeudi de l'Ascension", "rule" : "%EASTER +39 days" }, { "name" : "Lundi de Pentecôte", "rule" : "%EASTER +50 days" } ]
2
0.153846
1
1
405e57ee7043fb733c2fc0e5d94551ee1c4ce1e4
app/Resources/views/user/event_info.html.twig
app/Resources/views/user/event_info.html.twig
{% extends 'base.html.twig' %} {% block body %} <div class="container-fluid"> <table class="table table-striped"> <caption>Hosted events</caption> <thead> <tr> <th>Pavadinimas</th> <th>Bendra suma</th> <th></th> </tr> </thead> <tbody> {% for hosted_event in hosted_events %} <tr> <td>{{ hosted_event.name }}</td> <td>{{ hosted_event.getTotalPrice() }}</td> <td><a class="btn btn-primary" href="{{ path('dashboard', { 'hash' : hosted_event.hash }) }}">Žiūrėti</a></td> </tr> {% endfor %} </tbody> </table> </div> {% endblock %}
{% extends 'base.html.twig' %} {% block body %} <div class="container-fluid"> <table class="table table-striped"> <caption>Hosted events</caption> <thead> <tr> <th>Pavadinimas</th> <th>Bendra suma</th> <th>Bendra skola</th> <th></th> </tr> </thead> <tbody> {% for hosted_event in hosted_events %} <tr> <td>{{ hosted_event.name }}</td> <td>{{ hosted_event.totalPrice }}</td> <td>{{ hosted_event.totalDebt }}</td> <td><a class="btn btn-primary" href="{{ path('dashboard', { 'hash' : hosted_event.hash }) }}">Žiūrėti</a></td> </tr> {% endfor %} </tbody> </table> </div> {% endblock %}
Add totalDebt column to user info table.
Add totalDebt column to user info table.
Twig
mit
nfqakademija/dydis-turi-reiksme,nfqakademija/dydis-turi-reiksme,nfqakademija/dydis-turi-reiksme,nfqakademija/dydis-turi-reiksme
twig
## Code Before: {% extends 'base.html.twig' %} {% block body %} <div class="container-fluid"> <table class="table table-striped"> <caption>Hosted events</caption> <thead> <tr> <th>Pavadinimas</th> <th>Bendra suma</th> <th></th> </tr> </thead> <tbody> {% for hosted_event in hosted_events %} <tr> <td>{{ hosted_event.name }}</td> <td>{{ hosted_event.getTotalPrice() }}</td> <td><a class="btn btn-primary" href="{{ path('dashboard', { 'hash' : hosted_event.hash }) }}">Žiūrėti</a></td> </tr> {% endfor %} </tbody> </table> </div> {% endblock %} ## Instruction: Add totalDebt column to user info table. ## Code After: {% extends 'base.html.twig' %} {% block body %} <div class="container-fluid"> <table class="table table-striped"> <caption>Hosted events</caption> <thead> <tr> <th>Pavadinimas</th> <th>Bendra suma</th> <th>Bendra skola</th> <th></th> </tr> </thead> <tbody> {% for hosted_event in hosted_events %} <tr> <td>{{ hosted_event.name }}</td> <td>{{ hosted_event.totalPrice }}</td> <td>{{ hosted_event.totalDebt }}</td> <td><a class="btn btn-primary" href="{{ path('dashboard', { 'hash' : hosted_event.hash }) }}">Žiūrėti</a></td> </tr> {% endfor %} </tbody> </table> </div> {% endblock %}
{% extends 'base.html.twig' %} {% block body %} <div class="container-fluid"> <table class="table table-striped"> <caption>Hosted events</caption> <thead> <tr> <th>Pavadinimas</th> <th>Bendra suma</th> + <th>Bendra skola</th> <th></th> </tr> </thead> <tbody> {% for hosted_event in hosted_events %} <tr> <td>{{ hosted_event.name }}</td> - <td>{{ hosted_event.getTotalPrice() }}</td> ? -- - -- + <td>{{ hosted_event.totalPrice }}</td> + <td>{{ hosted_event.totalDebt }}</td> <td><a class="btn btn-primary" href="{{ path('dashboard', { 'hash' : hosted_event.hash }) }}">Žiūrėti</a></td> </tr> {% endfor %} </tbody> </table> </div> {% endblock %}
4
0.16
3
1
886fac0476d05806c5d396f0740bc24f3fa343ed
rslinac/pkcli/beam_solver.py
rslinac/pkcli/beam_solver.py
import rslinac def run(ini_filename, input_filename, output_filename): rslinac.run_beam_solver(ini_filename, input_filename, output_filename)
import rslinac from argh import arg @arg('ini', help='path configuration file in INI format') @arg('input', help='path to file with input data') @arg('output', help='path to file to write output data') def run(ini, input, output): """runs the beam solver""" rslinac.run_beam_solver(ini, input, output)
Add documentation to cli command arguments
Add documentation to cli command arguments
Python
apache-2.0
elventear/rslinac,radiasoft/rslinac,radiasoft/rslinac,elventear/rslinac,elventear/rslinac,radiasoft/rslinac,radiasoft/rslinac,radiasoft/rslinac,elventear/rslinac,elventear/rslinac,elventear/rslinac
python
## Code Before: import rslinac def run(ini_filename, input_filename, output_filename): rslinac.run_beam_solver(ini_filename, input_filename, output_filename) ## Instruction: Add documentation to cli command arguments ## Code After: import rslinac from argh import arg @arg('ini', help='path configuration file in INI format') @arg('input', help='path to file with input data') @arg('output', help='path to file to write output data') def run(ini, input, output): """runs the beam solver""" rslinac.run_beam_solver(ini, input, output)
import rslinac + from argh import arg - def run(ini_filename, input_filename, output_filename): + @arg('ini', help='path configuration file in INI format') + @arg('input', help='path to file with input data') + @arg('output', help='path to file to write output data') + def run(ini, input, output): + """runs the beam solver""" - rslinac.run_beam_solver(ini_filename, input_filename, output_filename) ? --------- --------- --------- + rslinac.run_beam_solver(ini, input, output)
9
2.25
7
2
45610d67370fb003f009cda3dd9f9077730756ca
src/CMakeLists.txt
src/CMakeLists.txt
add_executable(DisplayImage DisplayImage.cpp) target_sources(DisplayImage PUBLIC Effect.hpp Effect.cpp) target_sources(DisplayImage PUBLIC BasicHighlight.hpp BasicHighlight.cpp) target_sources(DisplayImage PUBLIC BasicTracer.hpp BasicTracer.cpp) target_sources(DisplayImage PUBLIC FlickerShadow.hpp FlickerShadow.cpp) target_sources(DisplayImage PUBLIC HighlightEdge.hpp HighlightEdge.cpp) target_sources(DisplayImage PUBLIC RgbSplit.hpp RgbSplit.cpp) target_sources(DisplayImage PUBLIC RollingShutter.hpp RollingShutter.cpp) target_link_libraries(DisplayImage ${SDL2_LIBRARY} ${OpenCV_LIBS} ${OPENGLES3_LIRARIES} ${EGL_LIBRARIES}) install(TARGETS DisplayImage RUNTIME DESTINATION ${BIN_DIR})
file(GLOB Effects_SRC "*.hpp" "*.cpp") list(REMOVE_ITEM Effects_SRC "DisplayImage.cpp") add_library(Effects ${Effects_SRC}) add_executable(DisplayImage DisplayImage.cpp) target_link_libraries(DisplayImage Effects ${SDL2_LIBRARY} ${OpenCV_LIBS} ${OPENGLES3_LIRARIES} ${EGL_LIBRARIES}) install(TARGETS DisplayImage RUNTIME DESTINATION ${BIN_DIR})
Refactor src cmake into library and executable
Refactor src cmake into library and executable
Text
mit
ademuri/shadowbox,ademuri/shadowbox
text
## Code Before: add_executable(DisplayImage DisplayImage.cpp) target_sources(DisplayImage PUBLIC Effect.hpp Effect.cpp) target_sources(DisplayImage PUBLIC BasicHighlight.hpp BasicHighlight.cpp) target_sources(DisplayImage PUBLIC BasicTracer.hpp BasicTracer.cpp) target_sources(DisplayImage PUBLIC FlickerShadow.hpp FlickerShadow.cpp) target_sources(DisplayImage PUBLIC HighlightEdge.hpp HighlightEdge.cpp) target_sources(DisplayImage PUBLIC RgbSplit.hpp RgbSplit.cpp) target_sources(DisplayImage PUBLIC RollingShutter.hpp RollingShutter.cpp) target_link_libraries(DisplayImage ${SDL2_LIBRARY} ${OpenCV_LIBS} ${OPENGLES3_LIRARIES} ${EGL_LIBRARIES}) install(TARGETS DisplayImage RUNTIME DESTINATION ${BIN_DIR}) ## Instruction: Refactor src cmake into library and executable ## Code After: file(GLOB Effects_SRC "*.hpp" "*.cpp") list(REMOVE_ITEM Effects_SRC "DisplayImage.cpp") add_library(Effects ${Effects_SRC}) add_executable(DisplayImage DisplayImage.cpp) target_link_libraries(DisplayImage Effects ${SDL2_LIBRARY} ${OpenCV_LIBS} ${OPENGLES3_LIRARIES} ${EGL_LIBRARIES}) install(TARGETS DisplayImage RUNTIME DESTINATION ${BIN_DIR})
+ file(GLOB Effects_SRC "*.hpp" "*.cpp") + list(REMOVE_ITEM Effects_SRC "DisplayImage.cpp") + + add_library(Effects ${Effects_SRC}) add_executable(DisplayImage DisplayImage.cpp) - target_sources(DisplayImage PUBLIC Effect.hpp Effect.cpp) - target_sources(DisplayImage PUBLIC BasicHighlight.hpp BasicHighlight.cpp) - target_sources(DisplayImage PUBLIC BasicTracer.hpp BasicTracer.cpp) - target_sources(DisplayImage PUBLIC FlickerShadow.hpp FlickerShadow.cpp) - target_sources(DisplayImage PUBLIC HighlightEdge.hpp HighlightEdge.cpp) - target_sources(DisplayImage PUBLIC RgbSplit.hpp RgbSplit.cpp) - target_sources(DisplayImage PUBLIC RollingShutter.hpp RollingShutter.cpp) - target_link_libraries(DisplayImage ${SDL2_LIBRARY} ${OpenCV_LIBS} ${OPENGLES3_LIRARIES} ${EGL_LIBRARIES}) + target_link_libraries(DisplayImage Effects ${SDL2_LIBRARY} ${OpenCV_LIBS} ${OPENGLES3_LIRARIES} ${EGL_LIBRARIES}) ? ++++++++ install(TARGETS DisplayImage RUNTIME DESTINATION ${BIN_DIR})
13
1.3
5
8
9985afe2bb228012408ad3af77caf9eea6a4423b
lib/datamapper_json.rb
lib/datamapper_json.rb
module DataMapper module Model # module Json def to_json_schema # usable_properties = properties.select{|p| p.name != :id } # "{ \"id\" : \"#{self.name}\",\n \t\"properties\": {\n" + usable_properties.collect{|p| "\t\t\"#{p.name}\" : { \"type\" : \"#{to_json_type(p.type)}\" }" }.join(",\n ") + "\n\t}\n}" to_json_schema_compatable_hash.to_json end private def to_json_schema_compatable_hash usable_properties = properties.select{|p| p.name != :id } schema_hash = {} schema_hash['id'] = self.storage_name properties_hash = {} properties.each{|p| properties_hash[p.name]=to_json_type(p.type) if p.name != :id} schema_hash['properties'] = properties_hash return schema_hash end def to_json_type(type) # A case statement doesn't seem to be working when comparing classes. # That's why we're using a if elseif block. if type == DataMapper::Types::Serial return "string" elsif type == String return "string" elsif type == Float return "number" elsif type == DataMapper::Types::Boolean return "boolean" elsif type == DataMapper::Types::Text elsif type == "string" elsif type == Integer return "integer" else return"string" end end # end end end
module DataMapper module Model # module Json def to_json_schema # usable_properties = properties.select{|p| p.name != :id } # "{ \"id\" : \"#{self.name}\",\n \t\"properties\": {\n" + usable_properties.collect{|p| "\t\t\"#{p.name}\" : { \"type\" : \"#{to_json_type(p.type)}\" }" }.join(",\n ") + "\n\t}\n}" to_json_schema_compatable_hash.to_json end private def to_json_schema_compatable_hash usable_properties = properties.select{|p| p.name != :id } schema_hash = {} schema_hash['id'] = self.storage_name properties_hash = {} properties.each{|p| properties_hash[p.name]={ "type" => to_json_type(p.type) } if p.name != :id} schema_hash['properties'] = properties_hash return schema_hash end def to_json_type(type) # A case statement doesn't seem to be working when comparing classes. # That's why we're using a if elseif block. if type == DataMapper::Types::Serial return "string" elsif type == String return "string" elsif type == Float return "number" elsif type == DataMapper::Types::Boolean return "boolean" elsif type == DataMapper::Types::Text elsif type == "string" elsif type == Integer return "integer" else return"string" end end # end end end
Create better json schema from models.
Create better json schema from models.
Ruby
mit
yogo/yogo,yogo/VOEIS,yogo/yogo,yogo/VOEIS,yogo/crux,yogo/yogo,yogo/crux,yogo/VOEIS
ruby
## Code Before: module DataMapper module Model # module Json def to_json_schema # usable_properties = properties.select{|p| p.name != :id } # "{ \"id\" : \"#{self.name}\",\n \t\"properties\": {\n" + usable_properties.collect{|p| "\t\t\"#{p.name}\" : { \"type\" : \"#{to_json_type(p.type)}\" }" }.join(",\n ") + "\n\t}\n}" to_json_schema_compatable_hash.to_json end private def to_json_schema_compatable_hash usable_properties = properties.select{|p| p.name != :id } schema_hash = {} schema_hash['id'] = self.storage_name properties_hash = {} properties.each{|p| properties_hash[p.name]=to_json_type(p.type) if p.name != :id} schema_hash['properties'] = properties_hash return schema_hash end def to_json_type(type) # A case statement doesn't seem to be working when comparing classes. # That's why we're using a if elseif block. if type == DataMapper::Types::Serial return "string" elsif type == String return "string" elsif type == Float return "number" elsif type == DataMapper::Types::Boolean return "boolean" elsif type == DataMapper::Types::Text elsif type == "string" elsif type == Integer return "integer" else return"string" end end # end end end ## Instruction: Create better json schema from models. ## Code After: module DataMapper module Model # module Json def to_json_schema # usable_properties = properties.select{|p| p.name != :id } # "{ \"id\" : \"#{self.name}\",\n \t\"properties\": {\n" + usable_properties.collect{|p| "\t\t\"#{p.name}\" : { \"type\" : \"#{to_json_type(p.type)}\" }" }.join(",\n ") + "\n\t}\n}" to_json_schema_compatable_hash.to_json end private def to_json_schema_compatable_hash usable_properties = properties.select{|p| p.name != :id } schema_hash = {} schema_hash['id'] = self.storage_name properties_hash = {} properties.each{|p| properties_hash[p.name]={ "type" => to_json_type(p.type) } if p.name != :id} schema_hash['properties'] = properties_hash return schema_hash end def to_json_type(type) # A case statement doesn't seem to be working when comparing classes. # That's why we're using a if elseif block. if type == DataMapper::Types::Serial return "string" elsif type == String return "string" elsif type == Float return "number" elsif type == DataMapper::Types::Boolean return "boolean" elsif type == DataMapper::Types::Text elsif type == "string" elsif type == Integer return "integer" else return"string" end end # end end end
module DataMapper module Model # module Json def to_json_schema # usable_properties = properties.select{|p| p.name != :id } # "{ \"id\" : \"#{self.name}\",\n \t\"properties\": {\n" + usable_properties.collect{|p| "\t\t\"#{p.name}\" : { \"type\" : \"#{to_json_type(p.type)}\" }" }.join(",\n ") + "\n\t}\n}" to_json_schema_compatable_hash.to_json end private def to_json_schema_compatable_hash usable_properties = properties.select{|p| p.name != :id } schema_hash = {} schema_hash['id'] = self.storage_name properties_hash = {} - properties.each{|p| properties_hash[p.name]=to_json_type(p.type) if p.name != :id} + properties.each{|p| properties_hash[p.name]={ "type" => to_json_type(p.type) } if p.name != :id} ? ++++++++++++ ++ schema_hash['properties'] = properties_hash return schema_hash end def to_json_type(type) # A case statement doesn't seem to be working when comparing classes. # That's why we're using a if elseif block. if type == DataMapper::Types::Serial return "string" elsif type == String return "string" elsif type == Float return "number" elsif type == DataMapper::Types::Boolean return "boolean" elsif type == DataMapper::Types::Text elsif type == "string" elsif type == Integer return "integer" else return"string" end end # end end end
2
0.044444
1
1
6bbdde01c515164bcae51cd2717d37ea9e41abeb
README.md
README.md
Provides a means of using model binding to get and validate HTTP headers in Web API 2
Provides a means of using model binding to get and validate HTTP headers in Web API 2. A blog post explaining this code and approach will be available shortly at https://river.red/. The included sample app demonstrates usage of the attribute. Just open a web browser and access the URLs `/demo/headers` to see some standard headers echoed back. Try your hand at retrieving the `/demo/penguinOnlyInformation` to see what kind of validation model binding can provide (only certain browsers and penguins can access this data!).
Add initial guidance to readme
Add initial guidance to readme
Markdown
mit
RedRiverSoftware/FromHeaderAttribute
markdown
## Code Before: Provides a means of using model binding to get and validate HTTP headers in Web API 2 ## Instruction: Add initial guidance to readme ## Code After: Provides a means of using model binding to get and validate HTTP headers in Web API 2. A blog post explaining this code and approach will be available shortly at https://river.red/. The included sample app demonstrates usage of the attribute. Just open a web browser and access the URLs `/demo/headers` to see some standard headers echoed back. Try your hand at retrieving the `/demo/penguinOnlyInformation` to see what kind of validation model binding can provide (only certain browsers and penguins can access this data!).
- Provides a means of using model binding to get and validate HTTP headers in Web API 2 + Provides a means of using model binding to get and validate HTTP headers in Web API 2. ? + + + A blog post explaining this code and approach will be available shortly at https://river.red/. + + The included sample app demonstrates usage of the attribute. Just open a web browser and access the URLs `/demo/headers` to see some standard headers echoed back. Try your hand at retrieving the `/demo/penguinOnlyInformation` to see what kind of validation model binding can provide (only certain browsers and penguins can access this data!).
6
6
5
1
7b6ba59b367e90de2137c5300b264578d67e85e1
src/sprites/Turret.js
src/sprites/Turret.js
import Obstacle from './Obstacle' export default class extends Obstacle { constructor (game, player, x, y, frame, bulletFrame) { super(game, player, x, y, frame) this.weapon = this.game.plugins.add(Phaser.Weapon) this.weapon.trackSprite(this) this.weapon.createBullets(50, 'chars_small', bulletFrame) this.weapon.bulletSpeed = 600 this.weapon.fireRate = 200 this.target = null } update () { super.update() this.game.physics.arcade.overlap(this.player, this.weapon.bullets, this.onCollision, null, this) if (!this.inCamera) { return } if (this.target != null) { this.weapon.fireAtSprite(this.target) } else if (this.weapon.fire()) { this.weapon.fireAngle += 30 } } onCollision () { super.onCollision() const saved = this.target this.target = null setTimeout(() => this.target = saved, 1000) } }
import Obstacle from './Obstacle' export default class extends Obstacle { constructor (game, player, x, y, frame, bulletFrame) { super(game, player, x, y, frame) this.weapon = this.game.plugins.add(Phaser.Weapon) this.weapon.trackSprite(this) this.weapon.createBullets(50, 'chars_small', bulletFrame) this.weapon.bulletSpeed = 600 this.weapon.fireRate = 200 this.target = null } update () { super.update() this.game.physics.arcade.overlap(this.player, this.weapon.bullets, this.onCollision, null, this) if (!this.inCamera) { return } if (this.target != null) { this.weapon.fireAtSprite(this.target) } else if (this.weapon.fire()) { this.weapon.fireAngle += 30 } } onCollision () { super.onCollision() if (this.target != null) { const saved = this.target this.target = null setTimeout(() => this.target = saved, 1000) } } }
Fix reaggroing when player gets hit while deaggrod.
Fix reaggroing when player gets hit while deaggrod.
JavaScript
mit
mikkpr/LD38,mikkpr/LD38
javascript
## Code Before: import Obstacle from './Obstacle' export default class extends Obstacle { constructor (game, player, x, y, frame, bulletFrame) { super(game, player, x, y, frame) this.weapon = this.game.plugins.add(Phaser.Weapon) this.weapon.trackSprite(this) this.weapon.createBullets(50, 'chars_small', bulletFrame) this.weapon.bulletSpeed = 600 this.weapon.fireRate = 200 this.target = null } update () { super.update() this.game.physics.arcade.overlap(this.player, this.weapon.bullets, this.onCollision, null, this) if (!this.inCamera) { return } if (this.target != null) { this.weapon.fireAtSprite(this.target) } else if (this.weapon.fire()) { this.weapon.fireAngle += 30 } } onCollision () { super.onCollision() const saved = this.target this.target = null setTimeout(() => this.target = saved, 1000) } } ## Instruction: Fix reaggroing when player gets hit while deaggrod. ## Code After: import Obstacle from './Obstacle' export default class extends Obstacle { constructor (game, player, x, y, frame, bulletFrame) { super(game, player, x, y, frame) this.weapon = this.game.plugins.add(Phaser.Weapon) this.weapon.trackSprite(this) this.weapon.createBullets(50, 'chars_small', bulletFrame) this.weapon.bulletSpeed = 600 this.weapon.fireRate = 200 this.target = null } update () { super.update() this.game.physics.arcade.overlap(this.player, this.weapon.bullets, this.onCollision, null, this) if (!this.inCamera) { return } if (this.target != null) { this.weapon.fireAtSprite(this.target) } else if (this.weapon.fire()) { this.weapon.fireAngle += 30 } } onCollision () { super.onCollision() if (this.target != null) { const saved = this.target this.target = null setTimeout(() => this.target = saved, 1000) } } }
import Obstacle from './Obstacle' export default class extends Obstacle { constructor (game, player, x, y, frame, bulletFrame) { super(game, player, x, y, frame) this.weapon = this.game.plugins.add(Phaser.Weapon) this.weapon.trackSprite(this) this.weapon.createBullets(50, 'chars_small', bulletFrame) this.weapon.bulletSpeed = 600 this.weapon.fireRate = 200 this.target = null } update () { super.update() this.game.physics.arcade.overlap(this.player, this.weapon.bullets, this.onCollision, null, this) if (!this.inCamera) { return } if (this.target != null) { this.weapon.fireAtSprite(this.target) } else if (this.weapon.fire()) { this.weapon.fireAngle += 30 } } onCollision () { super.onCollision() + if (this.target != null) { - const saved = this.target + const saved = this.target ? ++ - this.target = null + this.target = null ? ++ - setTimeout(() => this.target = saved, 1000) + setTimeout(() => this.target = saved, 1000) ? ++ + } } }
8
0.210526
5
3
076a2e8b68b2a6efd9494f3e61906feab77f7533
zoom/zrs.cpp
zoom/zrs.cpp
// $Header: /home/cvsroot/yaz++/zoom/zrs.cpp,v 1.5 2003-07-02 10:25:13 adam Exp $ // Z39.50 Result Set class #include "zoom.h" namespace ZOOM { resultSet::resultSet(connection &c, const query &q) : owner(c) { ZOOM_connection yazc = c._getYazConnection(); rs = ZOOM_connection_search(yazc, q._getYazQuery()); int errcode; const char *errmsg; // unused: carries same info as `errcode' const char *addinfo; if ((errcode = ZOOM_connection_error(yazc, &errmsg, &addinfo)) != 0) { throw bib1Exception(errcode, addinfo); } } resultSet::~resultSet() { ZOOM_resultset_destroy(rs); } std::string resultSet::option(const std::string &key) const { return ZOOM_resultset_option_get(rs, key.c_str()); } bool resultSet::option(const std::string &key, const std::string &val) { ZOOM_resultset_option_set(rs, key.c_str(), val.c_str()); return true; } size_t resultSet::size() const { return ZOOM_resultset_size(rs); } }
// $Header: /home/cvsroot/yaz++/zoom/zrs.cpp,v 1.6 2003-09-22 13:04:52 mike Exp $ // Z39.50 Result Set class #include "zoom.h" namespace ZOOM { resultSet::resultSet(connection &c, const query &q) : owner(c) { ZOOM_connection yazc = c._getYazConnection(); rs = ZOOM_connection_search(yazc, q._getYazQuery()); int errcode; const char *errmsg; // unused: carries same info as `errcode' const char *addinfo; if ((errcode = ZOOM_connection_error(yazc, &errmsg, &addinfo)) != 0) { ZOOM_resultset_destroy(rs); throw bib1Exception(errcode, addinfo); } } resultSet::~resultSet() { ZOOM_resultset_destroy(rs); } std::string resultSet::option(const std::string &key) const { return ZOOM_resultset_option_get(rs, key.c_str()); } bool resultSet::option(const std::string &key, const std::string &val) { ZOOM_resultset_option_set(rs, key.c_str(), val.c_str()); return true; } size_t resultSet::size() const { return ZOOM_resultset_size(rs); } }
Destroy half-created ZOOM-C result-set on failure, thanks to Phil Dennis <phil@booksys.com>
Destroy half-created ZOOM-C result-set on failure, thanks to Phil Dennis <phil@booksys.com>
C++
bsd-3-clause
indexgeo/yazpp,indexgeo/yazpp
c++
## Code Before: // $Header: /home/cvsroot/yaz++/zoom/zrs.cpp,v 1.5 2003-07-02 10:25:13 adam Exp $ // Z39.50 Result Set class #include "zoom.h" namespace ZOOM { resultSet::resultSet(connection &c, const query &q) : owner(c) { ZOOM_connection yazc = c._getYazConnection(); rs = ZOOM_connection_search(yazc, q._getYazQuery()); int errcode; const char *errmsg; // unused: carries same info as `errcode' const char *addinfo; if ((errcode = ZOOM_connection_error(yazc, &errmsg, &addinfo)) != 0) { throw bib1Exception(errcode, addinfo); } } resultSet::~resultSet() { ZOOM_resultset_destroy(rs); } std::string resultSet::option(const std::string &key) const { return ZOOM_resultset_option_get(rs, key.c_str()); } bool resultSet::option(const std::string &key, const std::string &val) { ZOOM_resultset_option_set(rs, key.c_str(), val.c_str()); return true; } size_t resultSet::size() const { return ZOOM_resultset_size(rs); } } ## Instruction: Destroy half-created ZOOM-C result-set on failure, thanks to Phil Dennis <phil@booksys.com> ## Code After: // $Header: /home/cvsroot/yaz++/zoom/zrs.cpp,v 1.6 2003-09-22 13:04:52 mike Exp $ // Z39.50 Result Set class #include "zoom.h" namespace ZOOM { resultSet::resultSet(connection &c, const query &q) : owner(c) { ZOOM_connection yazc = c._getYazConnection(); rs = ZOOM_connection_search(yazc, q._getYazQuery()); int errcode; const char *errmsg; // unused: carries same info as `errcode' const char *addinfo; if ((errcode = ZOOM_connection_error(yazc, &errmsg, &addinfo)) != 0) { ZOOM_resultset_destroy(rs); throw bib1Exception(errcode, addinfo); } } resultSet::~resultSet() { ZOOM_resultset_destroy(rs); } std::string resultSet::option(const std::string &key) const { return ZOOM_resultset_option_get(rs, key.c_str()); } bool resultSet::option(const std::string &key, const std::string &val) { ZOOM_resultset_option_set(rs, key.c_str(), val.c_str()); return true; } size_t resultSet::size() const { return ZOOM_resultset_size(rs); } }
- // $Header: /home/cvsroot/yaz++/zoom/zrs.cpp,v 1.5 2003-07-02 10:25:13 adam Exp $ ? ^ ^ ^ ---- --- + // $Header: /home/cvsroot/yaz++/zoom/zrs.cpp,v 1.6 2003-09-22 13:04:52 mike Exp $ ? ^ ^ ^ ++ + + +++ // Z39.50 Result Set class #include "zoom.h" namespace ZOOM { resultSet::resultSet(connection &c, const query &q) : owner(c) { ZOOM_connection yazc = c._getYazConnection(); rs = ZOOM_connection_search(yazc, q._getYazQuery()); int errcode; const char *errmsg; // unused: carries same info as `errcode' const char *addinfo; if ((errcode = ZOOM_connection_error(yazc, &errmsg, &addinfo)) != 0) { + ZOOM_resultset_destroy(rs); throw bib1Exception(errcode, addinfo); } } resultSet::~resultSet() { ZOOM_resultset_destroy(rs); } std::string resultSet::option(const std::string &key) const { return ZOOM_resultset_option_get(rs, key.c_str()); } bool resultSet::option(const std::string &key, const std::string &val) { ZOOM_resultset_option_set(rs, key.c_str(), val.c_str()); return true; } size_t resultSet::size() const { return ZOOM_resultset_size(rs); } }
3
0.081081
2
1
0abdfdf35ef4d5d75aaf69fcaf22c2089a22692d
ShirleyTests/TestUtilities.swift
ShirleyTests/TestUtilities.swift
// Shirley // Written in 2015 by Nate Stedman <nate@natestedman.com> // // To the extent possible under law, the author(s) have dedicated all copyright and // related and neighboring rights to this software to the public domain worldwide. // This software is distributed without any warranty. // // You should have received a copy of the CC0 Public Domain Dedication along with // this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. import ReactiveCocoa import Shirley struct SquareSession: SessionType { typealias Request = Int typealias Value = Int typealias Error = NoError func producerForRequest(request: Int) -> SignalProducer<Int, NoError> { return SignalProducer(value: request * request) } } struct ErrorSession: SessionType { typealias Request = Int typealias Value = Int typealias Error = TestError func producerForRequest(request: Int) -> SignalProducer<Int, TestError> { return SignalProducer(error: TestError(value: request)) } } struct TestError: ErrorType { let value: Int }
// Shirley // Written in 2015 by Nate Stedman <nate@natestedman.com> // // To the extent possible under law, the author(s) have dedicated all copyright and // related and neighboring rights to this software to the public domain worldwide. // This software is distributed without any warranty. // // You should have received a copy of the CC0 Public Domain Dedication along with // this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. import ReactiveCocoa import Result import Shirley struct SquareSession: SessionType { typealias Request = Int typealias Value = Int typealias Error = NoError func producerForRequest(request: Int) -> SignalProducer<Int, NoError> { return SignalProducer(value: request * request) } } struct ErrorSession: SessionType { typealias Request = Int typealias Value = Int typealias Error = TestError func producerForRequest(request: Int) -> SignalProducer<Int, TestError> { return SignalProducer(error: TestError(value: request)) } } struct TestError: ErrorType { let value: Int }
Add "import Result" to tests using NoError.
Add "import Result" to tests using NoError.
Swift
cc0-1.0
natestedman/Shirley
swift
## Code Before: // Shirley // Written in 2015 by Nate Stedman <nate@natestedman.com> // // To the extent possible under law, the author(s) have dedicated all copyright and // related and neighboring rights to this software to the public domain worldwide. // This software is distributed without any warranty. // // You should have received a copy of the CC0 Public Domain Dedication along with // this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. import ReactiveCocoa import Shirley struct SquareSession: SessionType { typealias Request = Int typealias Value = Int typealias Error = NoError func producerForRequest(request: Int) -> SignalProducer<Int, NoError> { return SignalProducer(value: request * request) } } struct ErrorSession: SessionType { typealias Request = Int typealias Value = Int typealias Error = TestError func producerForRequest(request: Int) -> SignalProducer<Int, TestError> { return SignalProducer(error: TestError(value: request)) } } struct TestError: ErrorType { let value: Int } ## Instruction: Add "import Result" to tests using NoError. ## Code After: // Shirley // Written in 2015 by Nate Stedman <nate@natestedman.com> // // To the extent possible under law, the author(s) have dedicated all copyright and // related and neighboring rights to this software to the public domain worldwide. // This software is distributed without any warranty. // // You should have received a copy of the CC0 Public Domain Dedication along with // this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. import ReactiveCocoa import Result import Shirley struct SquareSession: SessionType { typealias Request = Int typealias Value = Int typealias Error = NoError func producerForRequest(request: Int) -> SignalProducer<Int, NoError> { return SignalProducer(value: request * request) } } struct ErrorSession: SessionType { typealias Request = Int typealias Value = Int typealias Error = TestError func producerForRequest(request: Int) -> SignalProducer<Int, TestError> { return SignalProducer(error: TestError(value: request)) } } struct TestError: ErrorType { let value: Int }
// Shirley // Written in 2015 by Nate Stedman <nate@natestedman.com> // // To the extent possible under law, the author(s) have dedicated all copyright and // related and neighboring rights to this software to the public domain worldwide. // This software is distributed without any warranty. // // You should have received a copy of the CC0 Public Domain Dedication along with // this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>. import ReactiveCocoa + import Result import Shirley struct SquareSession: SessionType { typealias Request = Int typealias Value = Int typealias Error = NoError func producerForRequest(request: Int) -> SignalProducer<Int, NoError> { return SignalProducer(value: request * request) } } struct ErrorSession: SessionType { typealias Request = Int typealias Value = Int typealias Error = TestError func producerForRequest(request: Int) -> SignalProducer<Int, TestError> { return SignalProducer(error: TestError(value: request)) } } struct TestError: ErrorType { let value: Int }
1
0.02439
1
0
4c5e9035afa331177c8cfce6dd28c3067225e7ce
packages/ti/timezone-olson-th.yaml
packages/ti/timezone-olson-th.yaml
homepage: http://github.com/jonpetterbergman/timezone-olson-th changelog-type: '' hash: 1bc76c990f92654a7c9afef0a135e6fddca0e34e224be585f49374b2d85a8129 test-bench-deps: {} maintainer: jon.petter.bergman@gmail.com synopsis: Load TimeZoneSeries from an Olson file at compile time. changelog: '' basic-deps: base: ! '>=4.7 && <4.10' time: ! '>=1.4 && <1.7' timezone-series: ! '>=0.1 && <0.2' timezone-olson: ! '>=0.1 && <0.2' template-haskell: -any all-versions: - '0.1.0.0' - '0.1.0.1' - '0.1.0.2' author: Petter Bergman latest: '0.1.0.2' description-type: markdown description: ! "# timezone-olson-th\nTemplate Haskell to load a TimeZoneSeries from an Olson file at compile time.\n\nFor Example:\n\n myTimeZoneSeries :: TimeZoneSeries\n \ myTimeZoneSeries = $(loadTZFile \"/usr/share/zoneinfo/Europe/Stockholm\")\n\n" license-name: BSD3
homepage: http://github.com/jonpetterbergman/timezone-olson-th changelog-type: '' hash: 6ac15b8fd48a49fc6b7f176008ed908cd8c4b2017bada06ff9f8710366888905 test-bench-deps: {} maintainer: jon.petter.bergman@gmail.com synopsis: Load TimeZoneSeries from an Olson file at compile time. changelog: '' basic-deps: base: ! '>=4.7 && <4.10' time: ! '>=1.4 && <1.9' timezone-series: ! '>=0.1 && <0.2' timezone-olson: ! '>=0.1 && <0.2' template-haskell: -any all-versions: - '0.1.0.0' - '0.1.0.1' - '0.1.0.2' - '0.1.0.3' author: Petter Bergman latest: '0.1.0.3' description-type: markdown description: ! "# timezone-olson-th\nTemplate Haskell to load a TimeZoneSeries from an Olson file at compile time.\n\nFor Example:\n\n myTimeZoneSeries :: TimeZoneSeries\n \ myTimeZoneSeries = $(loadTZFile \"/usr/share/zoneinfo/Europe/Stockholm\")\n\n" license-name: BSD3
Update from Hackage at 2017-06-04T19:01:45Z
Update from Hackage at 2017-06-04T19:01:45Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: http://github.com/jonpetterbergman/timezone-olson-th changelog-type: '' hash: 1bc76c990f92654a7c9afef0a135e6fddca0e34e224be585f49374b2d85a8129 test-bench-deps: {} maintainer: jon.petter.bergman@gmail.com synopsis: Load TimeZoneSeries from an Olson file at compile time. changelog: '' basic-deps: base: ! '>=4.7 && <4.10' time: ! '>=1.4 && <1.7' timezone-series: ! '>=0.1 && <0.2' timezone-olson: ! '>=0.1 && <0.2' template-haskell: -any all-versions: - '0.1.0.0' - '0.1.0.1' - '0.1.0.2' author: Petter Bergman latest: '0.1.0.2' description-type: markdown description: ! "# timezone-olson-th\nTemplate Haskell to load a TimeZoneSeries from an Olson file at compile time.\n\nFor Example:\n\n myTimeZoneSeries :: TimeZoneSeries\n \ myTimeZoneSeries = $(loadTZFile \"/usr/share/zoneinfo/Europe/Stockholm\")\n\n" license-name: BSD3 ## Instruction: Update from Hackage at 2017-06-04T19:01:45Z ## Code After: homepage: http://github.com/jonpetterbergman/timezone-olson-th changelog-type: '' hash: 6ac15b8fd48a49fc6b7f176008ed908cd8c4b2017bada06ff9f8710366888905 test-bench-deps: {} maintainer: jon.petter.bergman@gmail.com synopsis: Load TimeZoneSeries from an Olson file at compile time. changelog: '' basic-deps: base: ! '>=4.7 && <4.10' time: ! '>=1.4 && <1.9' timezone-series: ! '>=0.1 && <0.2' timezone-olson: ! '>=0.1 && <0.2' template-haskell: -any all-versions: - '0.1.0.0' - '0.1.0.1' - '0.1.0.2' - '0.1.0.3' author: Petter Bergman latest: '0.1.0.3' description-type: markdown description: ! "# timezone-olson-th\nTemplate Haskell to load a TimeZoneSeries from an Olson file at compile time.\n\nFor Example:\n\n myTimeZoneSeries :: TimeZoneSeries\n \ myTimeZoneSeries = $(loadTZFile \"/usr/share/zoneinfo/Europe/Stockholm\")\n\n" license-name: BSD3
homepage: http://github.com/jonpetterbergman/timezone-olson-th changelog-type: '' - hash: 1bc76c990f92654a7c9afef0a135e6fddca0e34e224be585f49374b2d85a8129 + hash: 6ac15b8fd48a49fc6b7f176008ed908cd8c4b2017bada06ff9f8710366888905 test-bench-deps: {} maintainer: jon.petter.bergman@gmail.com synopsis: Load TimeZoneSeries from an Olson file at compile time. changelog: '' basic-deps: base: ! '>=4.7 && <4.10' - time: ! '>=1.4 && <1.7' ? ^ + time: ! '>=1.4 && <1.9' ? ^ timezone-series: ! '>=0.1 && <0.2' timezone-olson: ! '>=0.1 && <0.2' template-haskell: -any all-versions: - '0.1.0.0' - '0.1.0.1' - '0.1.0.2' + - '0.1.0.3' author: Petter Bergman - latest: '0.1.0.2' ? ^ + latest: '0.1.0.3' ? ^ description-type: markdown description: ! "# timezone-olson-th\nTemplate Haskell to load a TimeZoneSeries from an Olson file at compile time.\n\nFor Example:\n\n myTimeZoneSeries :: TimeZoneSeries\n \ myTimeZoneSeries = $(loadTZFile \"/usr/share/zoneinfo/Europe/Stockholm\")\n\n" license-name: BSD3
7
0.291667
4
3
984c015792babac22ef303c325482119367d259f
spec/spec_helper.rb
spec/spec_helper.rb
require 'rubygems' require 'spec' require File.dirname(__FILE__) + '/../lib/github' module GitHub load 'helpers.rb' load 'commands.rb' end # prevent the use of `` in tests Spec::Runner.configure do |configuration| backtick = nil # establish the variable in this scope configuration.prepend_before(:all) do # raise an exception if the `` operator is used # in our tests, we want to ensure we're fully self-contained Kernel.instance_eval do backtick = instance_method(:`) alias_method(:_backtick, :`) define_method :` do |str| raise "Cannot use backticks in tests" end end end configuration.prepend_after(:all) do # and now restore the `` operator Kernel.instance_eval do define_method :`, backtick end end end
require 'rubygems' require 'spec' require File.dirname(__FILE__) + '/../lib/github' # prevent the use of `` in tests Spec::Runner.configure do |configuration| # load this here so it's covered by the `` guard configuration.prepend_before(:all) do module GitHub load 'helpers.rb' load 'commands.rb' end end backtick = nil # establish the variable in this scope configuration.prepend_before(:all) do # raise an exception if the `` operator is used # in our tests, we want to ensure we're fully self-contained Kernel.instance_eval do backtick = instance_method(:`) alias_method(:_backtick, :`) define_method :` do |str| raise "Cannot use backticks in tests" end end end configuration.prepend_after(:all) do # and now restore the `` operator Kernel.instance_eval do define_method :`, backtick end end end
Load helpers.rb and commands.rb inside the `` guard
Load helpers.rb and commands.rb inside the `` guard
Ruby
mit
bfg-repo-cleaner-demos/github-gem-after-bfg
ruby
## Code Before: require 'rubygems' require 'spec' require File.dirname(__FILE__) + '/../lib/github' module GitHub load 'helpers.rb' load 'commands.rb' end # prevent the use of `` in tests Spec::Runner.configure do |configuration| backtick = nil # establish the variable in this scope configuration.prepend_before(:all) do # raise an exception if the `` operator is used # in our tests, we want to ensure we're fully self-contained Kernel.instance_eval do backtick = instance_method(:`) alias_method(:_backtick, :`) define_method :` do |str| raise "Cannot use backticks in tests" end end end configuration.prepend_after(:all) do # and now restore the `` operator Kernel.instance_eval do define_method :`, backtick end end end ## Instruction: Load helpers.rb and commands.rb inside the `` guard ## Code After: require 'rubygems' require 'spec' require File.dirname(__FILE__) + '/../lib/github' # prevent the use of `` in tests Spec::Runner.configure do |configuration| # load this here so it's covered by the `` guard configuration.prepend_before(:all) do module GitHub load 'helpers.rb' load 'commands.rb' end end backtick = nil # establish the variable in this scope configuration.prepend_before(:all) do # raise an exception if the `` operator is used # in our tests, we want to ensure we're fully self-contained Kernel.instance_eval do backtick = instance_method(:`) alias_method(:_backtick, :`) define_method :` do |str| raise "Cannot use backticks in tests" end end end configuration.prepend_after(:all) do # and now restore the `` operator Kernel.instance_eval do define_method :`, backtick end end end
require 'rubygems' require 'spec' require File.dirname(__FILE__) + '/../lib/github' - module GitHub - load 'helpers.rb' - load 'commands.rb' - end - # prevent the use of `` in tests Spec::Runner.configure do |configuration| + # load this here so it's covered by the `` guard + configuration.prepend_before(:all) do + module GitHub + load 'helpers.rb' + load 'commands.rb' + end + end + backtick = nil # establish the variable in this scope configuration.prepend_before(:all) do # raise an exception if the `` operator is used # in our tests, we want to ensure we're fully self-contained Kernel.instance_eval do backtick = instance_method(:`) alias_method(:_backtick, :`) define_method :` do |str| raise "Cannot use backticks in tests" end end end configuration.prepend_after(:all) do # and now restore the `` operator Kernel.instance_eval do define_method :`, backtick end end end
13
0.40625
8
5
af010c5e924a779a37495905efc32aecdfd358ea
whalelinter/commands/common.py
whalelinter/commands/common.py
import re from whalelinter.app import App from whalelinter.dispatcher import Dispatcher from whalelinter.commands.command import ShellCommand from whalelinter.commands.apt import Apt @Dispatcher.register(token='run', command='cd') class Cd(ShellCommand): def __init__(self, **kwargs): App._collecter.throw(2002, self.line) return False @Dispatcher.register(token='run', command='rm') class Rm(ShellCommand): def __init__(self, **kwargs): rf_flags_regex = re.compile("(-.*[rRf].+-?[rRf]|-[rR]f|-f[rR])") rf_flags = True if [i for i in kwargs.get('args') if rf_flags_regex.search(i)] else False cache_path_regex = re.compile("/var/lib/apt/lists(\/\*?)?") cache_path = True if [i for i in kwargs.get('args') if cache_path_regex.search(i)] else False if rf_flags and cache_path: if (int(Apt._has_been_used) < int(kwargs.get('lineno'))): Apt._has_been_used = 0
import re from whalelinter.app import App from whalelinter.dispatcher import Dispatcher from whalelinter.commands.command import ShellCommand from whalelinter.commands.apt import Apt @Dispatcher.register(token='run', command='cd') class Cd(ShellCommand): def __init__(self, **kwargs): App._collecter.throw(2002, kwargs.get('lineno')) @Dispatcher.register(token='run', command='rm') class Rm(ShellCommand): def __init__(self, **kwargs): rf_flags_regex = re.compile("(-.*[rRf].+-?[rRf]|-[rR]f|-f[rR])") rf_flags = True if [i for i in kwargs.get('args') if rf_flags_regex.search(i)] else False cache_path_regex = re.compile("/var/lib/apt/lists(\/\*?)?") cache_path = True if [i for i in kwargs.get('args') if cache_path_regex.search(i)] else False if rf_flags and cache_path: if (int(Apt._has_been_used) < int(kwargs.get('lineno'))): Apt._has_been_used = 0
Fix line addressing issue on 'cd' command
Fix line addressing issue on 'cd' command
Python
mit
jeromepin/whale-linter
python
## Code Before: import re from whalelinter.app import App from whalelinter.dispatcher import Dispatcher from whalelinter.commands.command import ShellCommand from whalelinter.commands.apt import Apt @Dispatcher.register(token='run', command='cd') class Cd(ShellCommand): def __init__(self, **kwargs): App._collecter.throw(2002, self.line) return False @Dispatcher.register(token='run', command='rm') class Rm(ShellCommand): def __init__(self, **kwargs): rf_flags_regex = re.compile("(-.*[rRf].+-?[rRf]|-[rR]f|-f[rR])") rf_flags = True if [i for i in kwargs.get('args') if rf_flags_regex.search(i)] else False cache_path_regex = re.compile("/var/lib/apt/lists(\/\*?)?") cache_path = True if [i for i in kwargs.get('args') if cache_path_regex.search(i)] else False if rf_flags and cache_path: if (int(Apt._has_been_used) < int(kwargs.get('lineno'))): Apt._has_been_used = 0 ## Instruction: Fix line addressing issue on 'cd' command ## Code After: import re from whalelinter.app import App from whalelinter.dispatcher import Dispatcher from whalelinter.commands.command import ShellCommand from whalelinter.commands.apt import Apt @Dispatcher.register(token='run', command='cd') class Cd(ShellCommand): def __init__(self, **kwargs): App._collecter.throw(2002, kwargs.get('lineno')) @Dispatcher.register(token='run', command='rm') class Rm(ShellCommand): def __init__(self, **kwargs): rf_flags_regex = re.compile("(-.*[rRf].+-?[rRf]|-[rR]f|-f[rR])") rf_flags = True if [i for i in kwargs.get('args') if rf_flags_regex.search(i)] else False cache_path_regex = re.compile("/var/lib/apt/lists(\/\*?)?") cache_path = True if [i for i in kwargs.get('args') if cache_path_regex.search(i)] else False if rf_flags and cache_path: if (int(Apt._has_been_used) < int(kwargs.get('lineno'))): Apt._has_been_used = 0
import re from whalelinter.app import App from whalelinter.dispatcher import Dispatcher from whalelinter.commands.command import ShellCommand from whalelinter.commands.apt import Apt @Dispatcher.register(token='run', command='cd') class Cd(ShellCommand): def __init__(self, **kwargs): - App._collecter.throw(2002, self.line) ? ^^^ + App._collecter.throw(2002, kwargs.get('lineno')) ? +++++ ++ ^^^ +++ + - return False @Dispatcher.register(token='run', command='rm') class Rm(ShellCommand): def __init__(self, **kwargs): rf_flags_regex = re.compile("(-.*[rRf].+-?[rRf]|-[rR]f|-f[rR])") rf_flags = True if [i for i in kwargs.get('args') if rf_flags_regex.search(i)] else False cache_path_regex = re.compile("/var/lib/apt/lists(\/\*?)?") cache_path = True if [i for i in kwargs.get('args') if cache_path_regex.search(i)] else False if rf_flags and cache_path: if (int(Apt._has_been_used) < int(kwargs.get('lineno'))): Apt._has_been_used = 0
3
0.115385
1
2
e3dcf7b3bee8c6034b1d338222d8f0db44b4f814
git/aliases.zsh
git/aliases.zsh
if [ -f /usr/local/rbenv/shims/hub ]; then alias git="hub" fi # The rest of my fun git aliases alias ungit="find . -name '.git' -exec rm -rf {} \;" alias gb='git branch' alias gba='git branch -a' alias gc='git commit -v' alias gca='git commit -v -a' # Commit pending changes and quote all args as message function gg() { git commit -v -a -m "$*" } alias gco='git checkout' alias gd='git diff' alias gdm='git diff master' alias gl='git smart-log' alias gnp="git-notpushed" alias gp='git push' alias gpr='git open-pr' alias gam='git commit --amend -C HEAD' alias gst='git status' alias gt='git status' alias g='git status --short' alias gup='git smart-pull' alias gm='smart-merge' alias eg='code .git/config' alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"
if [ -f /usr/local/rbenv/shims/hub ]; then alias git="hub" fi # The rest of my fun git aliases alias ungit="find . -name '.git' -exec rm -rf {} \;" alias gb='git branch' alias gba='git branch -a' alias gc='git commit -v' alias gca='git commit -v -a' # Commit pending changes and quote all args as message function gg() { git commit -v -a -m "$*" } alias gco='git checkout' alias gd='git diff' alias gdm='git diff master' alias gl='git smart-log' alias gnp="git-notpushed" alias gp='git push' alias gpr='git open-pr' alias gam='git commit --amend -C HEAD' alias gst='git status' alias gt='git status' alias g='git status --short' alias gup='git smart-pull' alias gm='smart-merge' alias eg='code .git/config' alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" alias ghv="gh repo view --web"
Add gh repo view alias
Add gh repo view alias
Shell
mit
zenjoy/dotfiles,zenjoy/dotfiles,zenjoy/dotfiles,zenjoy/dotfiles
shell
## Code Before: if [ -f /usr/local/rbenv/shims/hub ]; then alias git="hub" fi # The rest of my fun git aliases alias ungit="find . -name '.git' -exec rm -rf {} \;" alias gb='git branch' alias gba='git branch -a' alias gc='git commit -v' alias gca='git commit -v -a' # Commit pending changes and quote all args as message function gg() { git commit -v -a -m "$*" } alias gco='git checkout' alias gd='git diff' alias gdm='git diff master' alias gl='git smart-log' alias gnp="git-notpushed" alias gp='git push' alias gpr='git open-pr' alias gam='git commit --amend -C HEAD' alias gst='git status' alias gt='git status' alias g='git status --short' alias gup='git smart-pull' alias gm='smart-merge' alias eg='code .git/config' alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" ## Instruction: Add gh repo view alias ## Code After: if [ -f /usr/local/rbenv/shims/hub ]; then alias git="hub" fi # The rest of my fun git aliases alias ungit="find . -name '.git' -exec rm -rf {} \;" alias gb='git branch' alias gba='git branch -a' alias gc='git commit -v' alias gca='git commit -v -a' # Commit pending changes and quote all args as message function gg() { git commit -v -a -m "$*" } alias gco='git checkout' alias gd='git diff' alias gdm='git diff master' alias gl='git smart-log' alias gnp="git-notpushed" alias gp='git push' alias gpr='git open-pr' alias gam='git commit --amend -C HEAD' alias gst='git status' alias gt='git status' alias g='git status --short' alias gup='git smart-pull' alias gm='smart-merge' alias eg='code .git/config' alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" alias ghv="gh repo view --web"
if [ -f /usr/local/rbenv/shims/hub ]; then alias git="hub" fi # The rest of my fun git aliases alias ungit="find . -name '.git' -exec rm -rf {} \;" alias gb='git branch' alias gba='git branch -a' alias gc='git commit -v' alias gca='git commit -v -a' # Commit pending changes and quote all args as message function gg() { git commit -v -a -m "$*" } alias gco='git checkout' alias gd='git diff' alias gdm='git diff master' alias gl='git smart-log' alias gnp="git-notpushed" alias gp='git push' alias gpr='git open-pr' alias gam='git commit --amend -C HEAD' alias gst='git status' alias gt='git status' alias g='git status --short' alias gup='git smart-pull' alias gm='smart-merge' alias eg='code .git/config' alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" + alias ghv="gh repo view --web"
1
0.034483
1
0
cd0f4cde8c46ea5673e4b55afc3517f52e482343
lib/owners/path.rb
lib/owners/path.rb
module Owners # Accepts a single file and returns an array of OWNERS # files found when searching recursively up the directory # tree. # # @api private class Path CONFIG = 'OWNERS' attr_reader :file def initialize(file) @file = file end def configs configs = [] file = @file until file.dirname == file file = file.dirname config = file.join(CONFIG) if config.exist? && !config.directory? configs << config end end configs end end end
module Owners # Accepts a single file and returns an array of OWNERS # files found when searching recursively up the directory # tree. # # @api private class Path CONFIG = 'OWNERS' attr_reader :file def initialize(file) @file = file end def configs configs = [] file = @file until file == file.dirname file = file.dirname config = file.join(CONFIG) if config.exist? && !config.directory? configs << config end end configs end end end
Swap conditional args for consistency
Swap conditional args for consistency
Ruby
mit
shuber/owners
ruby
## Code Before: module Owners # Accepts a single file and returns an array of OWNERS # files found when searching recursively up the directory # tree. # # @api private class Path CONFIG = 'OWNERS' attr_reader :file def initialize(file) @file = file end def configs configs = [] file = @file until file.dirname == file file = file.dirname config = file.join(CONFIG) if config.exist? && !config.directory? configs << config end end configs end end end ## Instruction: Swap conditional args for consistency ## Code After: module Owners # Accepts a single file and returns an array of OWNERS # files found when searching recursively up the directory # tree. # # @api private class Path CONFIG = 'OWNERS' attr_reader :file def initialize(file) @file = file end def configs configs = [] file = @file until file == file.dirname file = file.dirname config = file.join(CONFIG) if config.exist? && !config.directory? configs << config end end configs end end end
module Owners # Accepts a single file and returns an array of OWNERS # files found when searching recursively up the directory # tree. # # @api private class Path CONFIG = 'OWNERS' attr_reader :file def initialize(file) @file = file end def configs configs = [] file = @file - until file.dirname == file ? -------- + until file == file.dirname ? ++++++++ file = file.dirname config = file.join(CONFIG) if config.exist? && !config.directory? configs << config end end configs end end end
2
0.0625
1
1
245d636db9740a86f7396ba677b5f0a46bfca192
app/views/one_click/coop/checklist.html.haml
app/views/one_click/coop/checklist.html.haml
%h2 Checklist %p Welcome to your draft co-op. There are several things you need to do before you can submit your registration. %ul.checklist %li{:class => co.members.active.count >= 3 ? 'done' : ''} %h3 Invite at least three Founder Members. %p You currently have = pluralize(co.members.active.count, "Founder Member.", "Founder Members.") %li{:class => co.directors.count >= 1 ? 'done' : ''} %h3 Appoint your initial Directors. %p You currently have = pluralize(co.directors.count, "Director.", "Directors.") %li{:class => co.secretary ? 'done' : ''} %h3 Appoint a Secretary. %p - if co.secretary Your secretary is = co.secretary.name + '.' - else You have not appointed a Secretary yet. %li{:class => co.rules_filled? ? 'done' : ''} %h3 Fill out and choose options for your co-op's Rules. %p - if co.rules_filled? The necessary fields in your Rules have been filled in. - else You still have some choices to make about your Rules. %li{:class => co.registration_form_filled? ? 'done' : ''} %h3 Fill out the Registration Form %p - if co.registration_form_filled? The Registration Form has been filled in. - else The Registration Form has not been filled in yet.
%h2 Checklist %p Welcome to your draft co-op. There are several things you need to do before you can submit your registration. %ul.checklist %li{:class => co.members.active.count >= 3 ? 'done' : ''} %h3 Invite at least three Founder Members. %p You currently have = pluralize(co.members.active.count, "Founder Member.", "Founder Members.") %li{:class => co.directors.count >= 3 ? 'done' : ''} %h3 Appoint at least three initial Directors. %p You currently have = pluralize(co.directors.count, "Director.", "Directors.") %li{:class => co.secretary ? 'done' : ''} %h3 Appoint a Secretary. %p - if co.secretary Your secretary is = co.secretary.name + '.' - else You have not appointed a Secretary yet. %li{:class => co.rules_filled? ? 'done' : ''} %h3 Fill out and choose options for your co-op's Rules. %p - if co.rules_filled? The necessary fields in your Rules have been filled in. - else You still have some choices to make about your Rules. %li{:class => co.registration_form_filled? ? 'done' : ''} %h3 Fill out the Registration Form %p - if co.registration_form_filled? The Registration Form has been filled in. - else The Registration Form has not been filled in yet.
Fix checklist to check for correct minimum number of Directors.
Fix checklist to check for correct minimum number of Directors.
Haml
agpl-3.0
oneclickorgs/one-click-orgs,oneclickorgs/one-click-orgs,oneclickorgs/one-click-orgs,oneclickorgs/one-click-orgs
haml
## Code Before: %h2 Checklist %p Welcome to your draft co-op. There are several things you need to do before you can submit your registration. %ul.checklist %li{:class => co.members.active.count >= 3 ? 'done' : ''} %h3 Invite at least three Founder Members. %p You currently have = pluralize(co.members.active.count, "Founder Member.", "Founder Members.") %li{:class => co.directors.count >= 1 ? 'done' : ''} %h3 Appoint your initial Directors. %p You currently have = pluralize(co.directors.count, "Director.", "Directors.") %li{:class => co.secretary ? 'done' : ''} %h3 Appoint a Secretary. %p - if co.secretary Your secretary is = co.secretary.name + '.' - else You have not appointed a Secretary yet. %li{:class => co.rules_filled? ? 'done' : ''} %h3 Fill out and choose options for your co-op's Rules. %p - if co.rules_filled? The necessary fields in your Rules have been filled in. - else You still have some choices to make about your Rules. %li{:class => co.registration_form_filled? ? 'done' : ''} %h3 Fill out the Registration Form %p - if co.registration_form_filled? The Registration Form has been filled in. - else The Registration Form has not been filled in yet. ## Instruction: Fix checklist to check for correct minimum number of Directors. ## Code After: %h2 Checklist %p Welcome to your draft co-op. There are several things you need to do before you can submit your registration. %ul.checklist %li{:class => co.members.active.count >= 3 ? 'done' : ''} %h3 Invite at least three Founder Members. %p You currently have = pluralize(co.members.active.count, "Founder Member.", "Founder Members.") %li{:class => co.directors.count >= 3 ? 'done' : ''} %h3 Appoint at least three initial Directors. %p You currently have = pluralize(co.directors.count, "Director.", "Directors.") %li{:class => co.secretary ? 'done' : ''} %h3 Appoint a Secretary. %p - if co.secretary Your secretary is = co.secretary.name + '.' - else You have not appointed a Secretary yet. %li{:class => co.rules_filled? ? 'done' : ''} %h3 Fill out and choose options for your co-op's Rules. %p - if co.rules_filled? The necessary fields in your Rules have been filled in. - else You still have some choices to make about your Rules. %li{:class => co.registration_form_filled? ? 'done' : ''} %h3 Fill out the Registration Form %p - if co.registration_form_filled? The Registration Form has been filled in. - else The Registration Form has not been filled in yet.
%h2 Checklist %p Welcome to your draft co-op. There are several things you need to do before you can submit your registration. %ul.checklist %li{:class => co.members.active.count >= 3 ? 'done' : ''} %h3 Invite at least three Founder Members. %p You currently have = pluralize(co.members.active.count, "Founder Member.", "Founder Members.") - %li{:class => co.directors.count >= 1 ? 'done' : ''} ? ^ + %li{:class => co.directors.count >= 3 ? 'done' : ''} ? ^ - %h3 Appoint your initial Directors. ? ^^^ + %h3 Appoint at least three initial Directors. ? ^^^^^^^^^^^ ++ %p You currently have = pluralize(co.directors.count, "Director.", "Directors.") %li{:class => co.secretary ? 'done' : ''} %h3 Appoint a Secretary. %p - if co.secretary Your secretary is = co.secretary.name + '.' - else You have not appointed a Secretary yet. %li{:class => co.rules_filled? ? 'done' : ''} %h3 Fill out and choose options for your co-op's Rules. %p - if co.rules_filled? The necessary fields in your Rules have been filled in. - else You still have some choices to make about your Rules. %li{:class => co.registration_form_filled? ? 'done' : ''} %h3 Fill out the Registration Form %p - if co.registration_form_filled? The Registration Form has been filled in. - else The Registration Form has not been filled in yet.
4
0.108108
2
2
5535ec43d13cd7c78414282513f87753222bd7bc
internal_packages/message-list/lib/message-toolbar-items.cjsx
internal_packages/message-list/lib/message-toolbar-items.cjsx
_ = require 'underscore' React = require 'react' classNames = require 'classnames' {Actions, WorkspaceStore, FocusedContentStore} = require 'nylas-exports' {Menu, Popover, RetinaImg, InjectedComponentSet} = require 'nylas-component-kit' class MessageToolbarItems extends React.Component @displayName: "MessageToolbarItems" constructor: (@props) -> @state = thread: FocusedContentStore.focused('thread') render: => classes = classNames "message-toolbar-items": true "hidden": !@state.thread <div className={classes}> <InjectedComponentSet matching={role: "message:Toolbar"} exposedProps={thread: @state.thread}/> </div> componentDidMount: => @_unsubscribers = [] @_unsubscribers.push FocusedContentStore.listen @_onChange componentWillUnmount: => unsubscribe() for unsubscribe in @_unsubscribers _onChange: => @setState thread: FocusedContentStore.focused('thread') module.exports = MessageToolbarItems
_ = require 'underscore' React = require 'react' classNames = require 'classnames' {Actions, WorkspaceStore, FocusedContentStore} = require 'nylas-exports' {Menu, Popover, RetinaImg, InjectedComponentSet} = require 'nylas-component-kit' class MessageToolbarItems extends React.Component @displayName: "MessageToolbarItems" constructor: (@props) -> @state = thread: FocusedContentStore.focused('thread') render: => classes = classNames "message-toolbar-items": true "hidden": !@state.thread <div className={classes}> <InjectedComponentSet matching={role: "message:Toolbar"} exposedProps={thread: @state.thread}/> </div> componentDidMount: => @_unsubscribers = [] @_unsubscribers.push FocusedContentStore.listen @_onChange componentWillUnmount: => return unless @_unsubscribers unsubscribe() for unsubscribe in @_unsubscribers _onChange: => @setState thread: FocusedContentStore.focused('thread') module.exports = MessageToolbarItems
Handle scenario where toolbar items rapidly removed (Sentry 2861)
fix(message-toolbar): Handle scenario where toolbar items rapidly removed (Sentry 2861)
CoffeeScript
mit
simonft/nylas-mail,nylas/nylas-mail,nylas/nylas-mail,nylas-mail-lives/nylas-mail,simonft/nylas-mail,simonft/nylas-mail,nirmit/nylas-mail,nylas-mail-lives/nylas-mail,nylas/nylas-mail,nylas-mail-lives/nylas-mail,simonft/nylas-mail,simonft/nylas-mail,nylas-mail-lives/nylas-mail,nirmit/nylas-mail,nylas/nylas-mail,nylas-mail-lives/nylas-mail,nylas/nylas-mail,nirmit/nylas-mail,nirmit/nylas-mail,nirmit/nylas-mail
coffeescript
## Code Before: _ = require 'underscore' React = require 'react' classNames = require 'classnames' {Actions, WorkspaceStore, FocusedContentStore} = require 'nylas-exports' {Menu, Popover, RetinaImg, InjectedComponentSet} = require 'nylas-component-kit' class MessageToolbarItems extends React.Component @displayName: "MessageToolbarItems" constructor: (@props) -> @state = thread: FocusedContentStore.focused('thread') render: => classes = classNames "message-toolbar-items": true "hidden": !@state.thread <div className={classes}> <InjectedComponentSet matching={role: "message:Toolbar"} exposedProps={thread: @state.thread}/> </div> componentDidMount: => @_unsubscribers = [] @_unsubscribers.push FocusedContentStore.listen @_onChange componentWillUnmount: => unsubscribe() for unsubscribe in @_unsubscribers _onChange: => @setState thread: FocusedContentStore.focused('thread') module.exports = MessageToolbarItems ## Instruction: fix(message-toolbar): Handle scenario where toolbar items rapidly removed (Sentry 2861) ## Code After: _ = require 'underscore' React = require 'react' classNames = require 'classnames' {Actions, WorkspaceStore, FocusedContentStore} = require 'nylas-exports' {Menu, Popover, RetinaImg, InjectedComponentSet} = require 'nylas-component-kit' class MessageToolbarItems extends React.Component @displayName: "MessageToolbarItems" constructor: (@props) -> @state = thread: FocusedContentStore.focused('thread') render: => classes = classNames "message-toolbar-items": true "hidden": !@state.thread <div className={classes}> <InjectedComponentSet matching={role: "message:Toolbar"} exposedProps={thread: @state.thread}/> </div> componentDidMount: => @_unsubscribers = [] @_unsubscribers.push FocusedContentStore.listen @_onChange componentWillUnmount: => return unless @_unsubscribers unsubscribe() for unsubscribe in @_unsubscribers _onChange: => @setState thread: FocusedContentStore.focused('thread') module.exports = MessageToolbarItems
_ = require 'underscore' React = require 'react' classNames = require 'classnames' {Actions, WorkspaceStore, FocusedContentStore} = require 'nylas-exports' {Menu, Popover, RetinaImg, InjectedComponentSet} = require 'nylas-component-kit' class MessageToolbarItems extends React.Component @displayName: "MessageToolbarItems" constructor: (@props) -> @state = thread: FocusedContentStore.focused('thread') render: => classes = classNames "message-toolbar-items": true "hidden": !@state.thread <div className={classes}> <InjectedComponentSet matching={role: "message:Toolbar"} exposedProps={thread: @state.thread}/> </div> componentDidMount: => @_unsubscribers = [] @_unsubscribers.push FocusedContentStore.listen @_onChange componentWillUnmount: => + return unless @_unsubscribers unsubscribe() for unsubscribe in @_unsubscribers _onChange: => @setState thread: FocusedContentStore.focused('thread') module.exports = MessageToolbarItems
1
0.02381
1
0
d373404a496713596bed91f62082c5a01b1891fb
ydf/cli.py
ydf/cli.py
import click import sys from ydf import templating, yaml_ext @click.command('ydf') @click.argument('yaml', type=click.File('r')) @click.option('-v', '--variables', type=click.Path(dir_okay=False), help='YAML file containing variables to be exposed to YAML file and template during rendering') @click.option('-t', '--template', type=str, default=templating.DEFAULT_TEMPLATE_NAME, help='Name of Jinja2 template used to build Dockerfile') @click.option('-s', '--search-path', type=click.Path(file_okay=False), default=templating.DEFAULT_TEMPLATE_PATH, help='File system paths to search for templates') @click.option('-o', '--output', type=click.File('w'), help='Dockerfile generated from translation', default=sys.stdout) def main(yaml, variables, template, search_path, output): """ YAML to Dockerfile """ yaml = yaml_ext.load(yaml.read()) env = templating.environ(search_path) rendered = env.get_template(template).render(templating.render_vars(yaml)) output.write(rendered) if __name__ == '__main__': main()
import click import sys from ydf import templating, yaml_ext @click.command('ydf') @click.argument('yaml', type=click.Path(dir_okay=False)) @click.option('-v', '--variables', type=click.Path(dir_okay=False), help='YAML file containing variables to be exposed to YAML file and template during rendering') @click.option('-t', '--template', type=str, default=templating.DEFAULT_TEMPLATE_NAME, help='Name of Jinja2 template used to build Dockerfile') @click.option('-s', '--search-path', type=click.Path(file_okay=False), default=templating.DEFAULT_TEMPLATE_PATH, help='File system paths to search for templates') @click.option('-o', '--output', type=click.File('w'), help='Dockerfile generated from translation', default=sys.stdout) def main(yaml, variables, template, search_path, output): """ YAML to Dockerfile """ yaml = yaml_ext.load(yaml.read()) env = templating.environ(search_path) rendered = env.get_template(template).render(templating.render_vars(yaml)) output.write(rendered) if __name__ == '__main__': main()
Switch yaml CLI argument from file to file path.
Switch yaml CLI argument from file to file path.
Python
apache-2.0
ahawker/ydf
python
## Code Before: import click import sys from ydf import templating, yaml_ext @click.command('ydf') @click.argument('yaml', type=click.File('r')) @click.option('-v', '--variables', type=click.Path(dir_okay=False), help='YAML file containing variables to be exposed to YAML file and template during rendering') @click.option('-t', '--template', type=str, default=templating.DEFAULT_TEMPLATE_NAME, help='Name of Jinja2 template used to build Dockerfile') @click.option('-s', '--search-path', type=click.Path(file_okay=False), default=templating.DEFAULT_TEMPLATE_PATH, help='File system paths to search for templates') @click.option('-o', '--output', type=click.File('w'), help='Dockerfile generated from translation', default=sys.stdout) def main(yaml, variables, template, search_path, output): """ YAML to Dockerfile """ yaml = yaml_ext.load(yaml.read()) env = templating.environ(search_path) rendered = env.get_template(template).render(templating.render_vars(yaml)) output.write(rendered) if __name__ == '__main__': main() ## Instruction: Switch yaml CLI argument from file to file path. ## Code After: import click import sys from ydf import templating, yaml_ext @click.command('ydf') @click.argument('yaml', type=click.Path(dir_okay=False)) @click.option('-v', '--variables', type=click.Path(dir_okay=False), help='YAML file containing variables to be exposed to YAML file and template during rendering') @click.option('-t', '--template', type=str, default=templating.DEFAULT_TEMPLATE_NAME, help='Name of Jinja2 template used to build Dockerfile') @click.option('-s', '--search-path', type=click.Path(file_okay=False), default=templating.DEFAULT_TEMPLATE_PATH, help='File system paths to search for templates') @click.option('-o', '--output', type=click.File('w'), help='Dockerfile generated from translation', default=sys.stdout) def main(yaml, variables, template, search_path, output): """ YAML to Dockerfile """ yaml = yaml_ext.load(yaml.read()) env = templating.environ(search_path) rendered = env.get_template(template).render(templating.render_vars(yaml)) output.write(rendered) if __name__ == '__main__': main()
import click import sys from ydf import templating, yaml_ext @click.command('ydf') @click.argument('yaml', - type=click.File('r')) ? ^ ---- + type=click.Path(dir_okay=False)) ? ++++++++++++++ ^ + @click.option('-v', '--variables', type=click.Path(dir_okay=False), help='YAML file containing variables to be exposed to YAML file and template during rendering') @click.option('-t', '--template', type=str, default=templating.DEFAULT_TEMPLATE_NAME, help='Name of Jinja2 template used to build Dockerfile') @click.option('-s', '--search-path', type=click.Path(file_okay=False), default=templating.DEFAULT_TEMPLATE_PATH, help='File system paths to search for templates') @click.option('-o', '--output', type=click.File('w'), help='Dockerfile generated from translation', default=sys.stdout) def main(yaml, variables, template, search_path, output): """ YAML to Dockerfile """ yaml = yaml_ext.load(yaml.read()) env = templating.environ(search_path) rendered = env.get_template(template).render(templating.render_vars(yaml)) output.write(rendered) if __name__ == '__main__': main()
2
0.054054
1
1
3313d611d7cc66bf607a341a5d9a6a5d96dfbec5
clowder_server/emailer.py
clowder_server/emailer.py
import os import requests from django.core.mail import send_mail from clowder_account.models import ClowderUser ADMIN_EMAIL = 'admin@clowder.io' def send_alert(company, name): for user in ClowderUser.objects.filter(company=company, allow_email_notifications=True): subject = 'FAILURE: %s' % (name) body = subject if user.company_id == 86: slack_token = os.getenv('PARKME_SLACK_TOKEN') url = 'https://hooks.slack.com/services/%s' % (slack_token) payload = {"username": "devopsbot", "text": body, "icon_emoji": ":robot_face:"} requests.post(url, json=payload) send_mail(subject, body, ADMIN_EMAIL, [user.email], fail_silently=True)
import os import requests from django.core.mail import send_mail from clowder_account.models import ClowderUser ADMIN_EMAIL = 'admin@clowder.io' def send_alert(company, name): slack_sent = False for user in ClowderUser.objects.filter(company=company, allow_email_notifications=True): subject = 'FAILURE: %s' % (name) body = subject if user.company_id == 86 and not slack_sent: slack_token = os.getenv('PARKME_SLACK_TOKEN') url = 'https://hooks.slack.com/services/%s' % (slack_token) payload = {"username": "clowder", "text": body, "icon_emoji": ":clowder:"} requests.post(url, json=payload) slack_sent = True send_mail(subject, body, ADMIN_EMAIL, [user.email], fail_silently=True)
Rename bot and prevent channel spamming
Rename bot and prevent channel spamming
Python
agpl-3.0
keithhackbarth/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server,keithhackbarth/clowder_server
python
## Code Before: import os import requests from django.core.mail import send_mail from clowder_account.models import ClowderUser ADMIN_EMAIL = 'admin@clowder.io' def send_alert(company, name): for user in ClowderUser.objects.filter(company=company, allow_email_notifications=True): subject = 'FAILURE: %s' % (name) body = subject if user.company_id == 86: slack_token = os.getenv('PARKME_SLACK_TOKEN') url = 'https://hooks.slack.com/services/%s' % (slack_token) payload = {"username": "devopsbot", "text": body, "icon_emoji": ":robot_face:"} requests.post(url, json=payload) send_mail(subject, body, ADMIN_EMAIL, [user.email], fail_silently=True) ## Instruction: Rename bot and prevent channel spamming ## Code After: import os import requests from django.core.mail import send_mail from clowder_account.models import ClowderUser ADMIN_EMAIL = 'admin@clowder.io' def send_alert(company, name): slack_sent = False for user in ClowderUser.objects.filter(company=company, allow_email_notifications=True): subject = 'FAILURE: %s' % (name) body = subject if user.company_id == 86 and not slack_sent: slack_token = os.getenv('PARKME_SLACK_TOKEN') url = 'https://hooks.slack.com/services/%s' % (slack_token) payload = {"username": "clowder", "text": body, "icon_emoji": ":clowder:"} requests.post(url, json=payload) slack_sent = True send_mail(subject, body, ADMIN_EMAIL, [user.email], fail_silently=True)
import os import requests from django.core.mail import send_mail from clowder_account.models import ClowderUser ADMIN_EMAIL = 'admin@clowder.io' def send_alert(company, name): + slack_sent = False for user in ClowderUser.objects.filter(company=company, allow_email_notifications=True): subject = 'FAILURE: %s' % (name) body = subject - if user.company_id == 86: + if user.company_id == 86 and not slack_sent: ? +++++++++++++++++++ slack_token = os.getenv('PARKME_SLACK_TOKEN') url = 'https://hooks.slack.com/services/%s' % (slack_token) - payload = {"username": "devopsbot", "text": body, "icon_emoji": ":robot_face:"} ? ^^^^^^^ --------- + payload = {"username": "clowder", "text": body, "icon_emoji": ":clowder:"} ? ++++ ^ ++++++ requests.post(url, json=payload) + slack_sent = True send_mail(subject, body, ADMIN_EMAIL, [user.email], fail_silently=True)
6
0.333333
4
2
e805bf724000d1d93723aeb96e61c1a8e3dbcf19
app/views/components/cards/_shop_card.html.haml
app/views/components/cards/_shop_card.html.haml
:ruby css_classes = [ "card", "card--shop", "card--destination", "card--icon", "icon--destination--pin--before", card[:double?] ? "card--double card--full-image" : "card--single card--extended-content--half" ].join(" ") %article.js-card{class: css_classes} %a.link--wrapper{href: card[:shop_link]} %figure.card__hero = safe_image_tag("cards/shop.jpg", class: 'card__image', alt: "destination guides", lazyload: defined?(lazyload)) .card__content %span.card__context Shop %h2.card__name.js-card-name = card[:place_name] destination guides
:ruby css_classes = [ "card", "card--shop", "card--destination", "card--icon", "icon--destination--pin--before", "card--single card--extended-content--half" ].join(" ") %article.js-card{class: css_classes} %a.link--wrapper{href: card[:shop_link]} %figure.card__hero = safe_image_tag("cards/shop.jpg", class: 'card__image', alt: "destination guides", lazyload: defined?(lazyload)) .card__content %span.card__context Shop %h2.card__name.js-card-name = card[:place_name] destination guides
Remove the ability for shop cards to be double width
Remove the ability for shop cards to be double width
Haml
mit
Lostmyname/rizzo,lonelyplanet/rizzo,lonelyplanet/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo,Lostmyname/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo,Lostmyname/rizzo,lonelyplanet/rizzo
haml
## Code Before: :ruby css_classes = [ "card", "card--shop", "card--destination", "card--icon", "icon--destination--pin--before", card[:double?] ? "card--double card--full-image" : "card--single card--extended-content--half" ].join(" ") %article.js-card{class: css_classes} %a.link--wrapper{href: card[:shop_link]} %figure.card__hero = safe_image_tag("cards/shop.jpg", class: 'card__image', alt: "destination guides", lazyload: defined?(lazyload)) .card__content %span.card__context Shop %h2.card__name.js-card-name = card[:place_name] destination guides ## Instruction: Remove the ability for shop cards to be double width ## Code After: :ruby css_classes = [ "card", "card--shop", "card--destination", "card--icon", "icon--destination--pin--before", "card--single card--extended-content--half" ].join(" ") %article.js-card{class: css_classes} %a.link--wrapper{href: card[:shop_link]} %figure.card__hero = safe_image_tag("cards/shop.jpg", class: 'card__image', alt: "destination guides", lazyload: defined?(lazyload)) .card__content %span.card__context Shop %h2.card__name.js-card-name = card[:place_name] destination guides
:ruby css_classes = [ "card", "card--shop", "card--destination", "card--icon", "icon--destination--pin--before", - card[:double?] ? "card--double card--full-image" : "card--single card--extended-content--half" + "card--single card--extended-content--half" ].join(" ") %article.js-card{class: css_classes} %a.link--wrapper{href: card[:shop_link]} %figure.card__hero = safe_image_tag("cards/shop.jpg", class: 'card__image', alt: "destination guides", lazyload: defined?(lazyload)) .card__content %span.card__context Shop %h2.card__name.js-card-name = card[:place_name] destination guides
2
0.074074
1
1
60a6f7c896230d54d7b040d6be332c66d770d703
src/metadata-db/main.go
src/metadata-db/main.go
package main import ( "log" "os" ) const ( DATAFILE_SIZE = 1024 * 1024 * 256 // 256 MB DATABLOCK_SIZE = 1024 * 4 // 4KB ) func main() { file, err := os.Create("metadata-db.dat") if err != nil { panic(err) } log.Println("Creating datafile...") file.Truncate(DATAFILE_SIZE) log.Println("DONE") }
package main import ( "encoding/binary" "io" "log" "os" ) const ( DATAFILE_SIZE = 1024 * 1024 * 256 // 256 MB DATABLOCK_SIZE = 1024 * 4 // 4KB ) var ( DatablockByteOrder = binary.BigEndian ) func main() { file, err := createDatafile() if err != nil { panic(err) } writeInt16(file, 7) writeInt16(file, 1) if _, err := file.Seek(0, 0); err != nil { panic(err) } for i := 0; i < 10; i++ { i, err := readInt16(file) if err != nil { panic(err) } println(i) } } func createDatafile() (*os.File, error) { file, err := os.Create("metadata-db.dat") if err != nil { return nil, err } log.Println("Creating datafile...") file.Truncate(DATAFILE_SIZE) log.Println("DONE") return file, nil } func writeInt16(f io.Writer, i uint16) error { log.Printf("Writing int16 `%d`", i) return binary.Write(f, DatablockByteOrder, i) } func readInt16(f io.Reader) (ret uint16, err error) { log.Println("Reading int16") err = binary.Read(f, DatablockByteOrder, &ret) return }
Read and write from file
Read and write from file
Go
mit
fgrehm/pucrs-simple-json-db,fgrehm/pucrs-metadata-db
go
## Code Before: package main import ( "log" "os" ) const ( DATAFILE_SIZE = 1024 * 1024 * 256 // 256 MB DATABLOCK_SIZE = 1024 * 4 // 4KB ) func main() { file, err := os.Create("metadata-db.dat") if err != nil { panic(err) } log.Println("Creating datafile...") file.Truncate(DATAFILE_SIZE) log.Println("DONE") } ## Instruction: Read and write from file ## Code After: package main import ( "encoding/binary" "io" "log" "os" ) const ( DATAFILE_SIZE = 1024 * 1024 * 256 // 256 MB DATABLOCK_SIZE = 1024 * 4 // 4KB ) var ( DatablockByteOrder = binary.BigEndian ) func main() { file, err := createDatafile() if err != nil { panic(err) } writeInt16(file, 7) writeInt16(file, 1) if _, err := file.Seek(0, 0); err != nil { panic(err) } for i := 0; i < 10; i++ { i, err := readInt16(file) if err != nil { panic(err) } println(i) } } func createDatafile() (*os.File, error) { file, err := os.Create("metadata-db.dat") if err != nil { return nil, err } log.Println("Creating datafile...") file.Truncate(DATAFILE_SIZE) log.Println("DONE") return file, nil } func writeInt16(f io.Writer, i uint16) error { log.Printf("Writing int16 `%d`", i) return binary.Write(f, DatablockByteOrder, i) } func readInt16(f io.Reader) (ret uint16, err error) { log.Println("Reading int16") err = binary.Read(f, DatablockByteOrder, &ret) return }
package main import ( + "encoding/binary" + "io" "log" "os" ) const ( DATAFILE_SIZE = 1024 * 1024 * 256 // 256 MB DATABLOCK_SIZE = 1024 * 4 // 4KB ) + var ( + DatablockByteOrder = binary.BigEndian + ) + func main() { + file, err := createDatafile() + if err != nil { + panic(err) + } + + writeInt16(file, 7) + writeInt16(file, 1) + + if _, err := file.Seek(0, 0); err != nil { + panic(err) + } + + for i := 0; i < 10; i++ { + i, err := readInt16(file) + if err != nil { + panic(err) + } + + println(i) + } + } + + func createDatafile() (*os.File, error) { file, err := os.Create("metadata-db.dat") if err != nil { - panic(err) + return nil, err } log.Println("Creating datafile...") file.Truncate(DATAFILE_SIZE) log.Println("DONE") + + return file, nil } + + func writeInt16(f io.Writer, i uint16) error { + log.Printf("Writing int16 `%d`", i) + return binary.Write(f, DatablockByteOrder, i) + } + + func readInt16(f io.Reader) (ret uint16, err error) { + log.Println("Reading int16") + err = binary.Read(f, DatablockByteOrder, &ret) + return + }
44
2
43
1
a68a9d94bd860f142d5ea172b607abc34b36464f
packages/fl/flags-applicative.yaml
packages/fl/flags-applicative.yaml
homepage: https://github.com/mtth/flags-applicative changelog-type: '' hash: 58796129e4ee70f1d3eccb7efd524db95d27ff18266cce6d0d4298d1459af81d test-bench-deps: base: ! '>=4.7 && <5' hspec: ! '>=2.6 && <2.7' text: ! '>=1.2 && <1.3' flags-applicative: -any maintainer: matthieu.monsch@gmail.com synopsis: Applicative flag parsing changelog: '' basic-deps: base: ! '>=4.7 && <5' text: ==1.2.* containers: ! '>=0.6 && <0.7' flags-applicative: -any mtl: ! '>=2.2 && <2.3' all-versions: - 0.0.1.0 - 0.0.2.0 - 0.0.3.0 - 0.0.4.0 author: Matthieu Monsch latest: 0.0.4.0 description-type: markdown description: | # Applicative flags Simple flags parsing, inspired by [`optparse-applicative`](http://hackage.haskell.org/package/optparse-applicative). See the [documentation](http://hackage.haskell.org/package/flags-applicative) on Hackage for more information. license-name: BSD-3-Clause
homepage: https://github.com/mtth/flags-applicative changelog-type: '' hash: 83338d3409c39b216fdda98383e1d05711e6d46a2fbf6545b03dd681644b042f test-bench-deps: base: ! '>=4.7 && <5' hspec: ! '>=2.6 && <2.7' text: ! '>=1.2 && <1.3' flags-applicative: -any maintainer: matthieu.monsch@gmail.com synopsis: Applicative flag parsing changelog: '' basic-deps: base: ! '>=4.7 && <5' text: ==1.2.* containers: ! '>=0.6 && <0.7' flags-applicative: -any mtl: ! '>=2.2 && <2.3' all-versions: - 0.0.1.0 - 0.0.2.0 - 0.0.3.0 - 0.0.4.0 - 0.0.4.1 author: Matthieu Monsch latest: 0.0.4.1 description-type: markdown description: | # Applicative flags Simple flags parsing, inspired by [`optparse-applicative`](http://hackage.haskell.org/package/optparse-applicative). See the [documentation](http://hackage.haskell.org/package/flags-applicative) on Hackage for more information. license-name: BSD-3-Clause
Update from Hackage at 2019-05-26T18:23:58Z
Update from Hackage at 2019-05-26T18:23:58Z
YAML
mit
commercialhaskell/all-cabal-metadata
yaml
## Code Before: homepage: https://github.com/mtth/flags-applicative changelog-type: '' hash: 58796129e4ee70f1d3eccb7efd524db95d27ff18266cce6d0d4298d1459af81d test-bench-deps: base: ! '>=4.7 && <5' hspec: ! '>=2.6 && <2.7' text: ! '>=1.2 && <1.3' flags-applicative: -any maintainer: matthieu.monsch@gmail.com synopsis: Applicative flag parsing changelog: '' basic-deps: base: ! '>=4.7 && <5' text: ==1.2.* containers: ! '>=0.6 && <0.7' flags-applicative: -any mtl: ! '>=2.2 && <2.3' all-versions: - 0.0.1.0 - 0.0.2.0 - 0.0.3.0 - 0.0.4.0 author: Matthieu Monsch latest: 0.0.4.0 description-type: markdown description: | # Applicative flags Simple flags parsing, inspired by [`optparse-applicative`](http://hackage.haskell.org/package/optparse-applicative). See the [documentation](http://hackage.haskell.org/package/flags-applicative) on Hackage for more information. license-name: BSD-3-Clause ## Instruction: Update from Hackage at 2019-05-26T18:23:58Z ## Code After: homepage: https://github.com/mtth/flags-applicative changelog-type: '' hash: 83338d3409c39b216fdda98383e1d05711e6d46a2fbf6545b03dd681644b042f test-bench-deps: base: ! '>=4.7 && <5' hspec: ! '>=2.6 && <2.7' text: ! '>=1.2 && <1.3' flags-applicative: -any maintainer: matthieu.monsch@gmail.com synopsis: Applicative flag parsing changelog: '' basic-deps: base: ! '>=4.7 && <5' text: ==1.2.* containers: ! '>=0.6 && <0.7' flags-applicative: -any mtl: ! '>=2.2 && <2.3' all-versions: - 0.0.1.0 - 0.0.2.0 - 0.0.3.0 - 0.0.4.0 - 0.0.4.1 author: Matthieu Monsch latest: 0.0.4.1 description-type: markdown description: | # Applicative flags Simple flags parsing, inspired by [`optparse-applicative`](http://hackage.haskell.org/package/optparse-applicative). See the [documentation](http://hackage.haskell.org/package/flags-applicative) on Hackage for more information. license-name: BSD-3-Clause
homepage: https://github.com/mtth/flags-applicative changelog-type: '' - hash: 58796129e4ee70f1d3eccb7efd524db95d27ff18266cce6d0d4298d1459af81d + hash: 83338d3409c39b216fdda98383e1d05711e6d46a2fbf6545b03dd681644b042f test-bench-deps: base: ! '>=4.7 && <5' hspec: ! '>=2.6 && <2.7' text: ! '>=1.2 && <1.3' flags-applicative: -any maintainer: matthieu.monsch@gmail.com synopsis: Applicative flag parsing changelog: '' basic-deps: base: ! '>=4.7 && <5' text: ==1.2.* containers: ! '>=0.6 && <0.7' flags-applicative: -any mtl: ! '>=2.2 && <2.3' all-versions: - 0.0.1.0 - 0.0.2.0 - 0.0.3.0 - 0.0.4.0 + - 0.0.4.1 author: Matthieu Monsch - latest: 0.0.4.0 ? ^ + latest: 0.0.4.1 ? ^ description-type: markdown description: | # Applicative flags Simple flags parsing, inspired by [`optparse-applicative`](http://hackage.haskell.org/package/optparse-applicative). See the [documentation](http://hackage.haskell.org/package/flags-applicative) on Hackage for more information. license-name: BSD-3-Clause
5
0.151515
3
2
cee89f88699af1ab45015ad947830cf8172ae3fa
app/controllers/spree/admin/variants_controller_decorator.rb
app/controllers/spree/admin/variants_controller_decorator.rb
Spree::Admin::VariantsController.class_eval do update.before :before_update respond_override :update => {:html => { :success => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) }, :failure => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) } } } def load_resource_instance parent if new_actions.include?(params[:action].to_sym) build_resource elsif params[:id] ::Spree::Variant.find(params[:id]) end end def volume_prices @product = @variant.product end end
Spree::Admin::VariantsController.class_eval do respond_override :update => {:html => { :success => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) }, :failure => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) } } } def load_resource_instance parent if new_actions.include?(params[:action].to_sym) build_resource elsif params[:id] ::Spree::Variant.find(params[:id]) end end def volume_prices @product = @variant.product end end
Remove call to non-existant before_update hook in Admin::VariantsController decorator
Remove call to non-existant before_update hook in Admin::VariantsController decorator
Ruby
bsd-3-clause
juancroca/spree_volume_pricing,juancroca/spree_volume_pricing,juancroca/spree_volume_pricing
ruby
## Code Before: Spree::Admin::VariantsController.class_eval do update.before :before_update respond_override :update => {:html => { :success => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) }, :failure => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) } } } def load_resource_instance parent if new_actions.include?(params[:action].to_sym) build_resource elsif params[:id] ::Spree::Variant.find(params[:id]) end end def volume_prices @product = @variant.product end end ## Instruction: Remove call to non-existant before_update hook in Admin::VariantsController decorator ## Code After: Spree::Admin::VariantsController.class_eval do respond_override :update => {:html => { :success => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) }, :failure => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) } } } def load_resource_instance parent if new_actions.include?(params[:action].to_sym) build_resource elsif params[:id] ::Spree::Variant.find(params[:id]) end end def volume_prices @product = @variant.product end end
Spree::Admin::VariantsController.class_eval do - update.before :before_update - respond_override :update => {:html => { :success => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) }, :failure => lambda { redirect_to(@variant.is_master ? volume_prices_admin_product_variant_url(@variant.product, @variant) : collection_url) } } } def load_resource_instance parent if new_actions.include?(params[:action].to_sym) build_resource elsif params[:id] ::Spree::Variant.find(params[:id]) end end def volume_prices @product = @variant.product end end
2
0.095238
0
2