commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
5
4.84k
subject
stringlengths
15
778
message
stringlengths
16
6.86k
lang
stringlengths
1
30
license
stringclasses
13 values
repos
stringlengths
5
116k
config
stringlengths
1
30
content
stringlengths
105
8.72k
9af4c5f8e6e3fb75dd5d07f12bacbabe7936d636
lib/helpers.coffee
lib/helpers.coffee
path = require "path" module.exports = repoForPath: (goalPath) -> for projectPath, i in atom.project.getPaths() if goalPath is projectPath or goalPath.indexOf(projectPath + path.sep) is 0 return atom.project.getRepositories()[i] null getStyleObject: (el) -> styleProperties = window.getComputedStyle(el) styleObject = {} for property of styleProperties value = styleProperties.getPropertyValue property camelizedAttr = property.replace /\-([a-z])/g, (a, b) -> b.toUpperCase() styleObject[camelizedAttr] = value styleObject getFullExtension: (filePath) -> basename = path.basename(filePath) position = basename.indexOf('.') if position > 0 then basename[position..] else '' updateEditorsForPath: (oldPath, newPath) -> editors = atom.workspace.getTextEditors() for editor in editors filePath = editor.getPath() if filePath?.startsWith(oldPath) editor.getBuffer().setPath(filePath.replace(oldPath, newPath))
path = require "path" module.exports = repoForPath: (goalPath) -> for projectPath, i in atom.project.getPaths() if goalPath is projectPath or goalPath.indexOf(projectPath + path.sep) is 0 return atom.project.getRepositories()[i] null getStyleObject: (el) -> styleProperties = window.getComputedStyle(el) styleObject = {} for property of styleProperties value = styleProperties.getPropertyValue property camelizedAttr = property.replace /\-([a-z])/g, (a, b) -> b.toUpperCase() styleObject[camelizedAttr] = value styleObject getFullExtension: (filePath) -> basename = path.basename(filePath) position = basename.indexOf('.') if position > 0 then basename[position..] else ''
Remove function accidentally committed with merge
Remove function accidentally committed with merge
CoffeeScript
mit
jarig/tree-view,atom/tree-view
coffeescript
## Code Before: path = require "path" module.exports = repoForPath: (goalPath) -> for projectPath, i in atom.project.getPaths() if goalPath is projectPath or goalPath.indexOf(projectPath + path.sep) is 0 return atom.project.getRepositories()[i] null getStyleObject: (el) -> styleProperties = window.getComputedStyle(el) styleObject = {} for property of styleProperties value = styleProperties.getPropertyValue property camelizedAttr = property.replace /\-([a-z])/g, (a, b) -> b.toUpperCase() styleObject[camelizedAttr] = value styleObject getFullExtension: (filePath) -> basename = path.basename(filePath) position = basename.indexOf('.') if position > 0 then basename[position..] else '' updateEditorsForPath: (oldPath, newPath) -> editors = atom.workspace.getTextEditors() for editor in editors filePath = editor.getPath() if filePath?.startsWith(oldPath) editor.getBuffer().setPath(filePath.replace(oldPath, newPath)) ## Instruction: Remove function accidentally committed with merge ## Code After: path = require "path" module.exports = repoForPath: (goalPath) -> for projectPath, i in atom.project.getPaths() if goalPath is projectPath or goalPath.indexOf(projectPath + path.sep) is 0 return atom.project.getRepositories()[i] null getStyleObject: (el) -> styleProperties = window.getComputedStyle(el) styleObject = {} for property of styleProperties value = styleProperties.getPropertyValue property camelizedAttr = property.replace /\-([a-z])/g, (a, b) -> b.toUpperCase() styleObject[camelizedAttr] = value styleObject getFullExtension: (filePath) -> basename = path.basename(filePath) position = basename.indexOf('.') if position > 0 then basename[position..] else ''
bf2a3275677f2e26d0869e07f05cc7b218c375c5
requirements.txt
requirements.txt
biopython==1.66 Django==1.8.3 django-cors-headers==1.1.0 django-countries==3.3 django-environ==0.4.0 django-extensions==1.6.1 django-filter==0.11.0 django-gm2m==0.4.3 django-jsonfield==0.9.15 django-longerusernameandemail==0.5.7 django-model-utils==2.4 django-mptt==0.7.4 django-ordered-model==0.4.2 django-rest-swagger==0.3.7 djangorestframework==3.3.1 drf-extensions==0.2.8 gunicorn==19.4.1 jira==0.50 Markdown==2.6.2 oauthlib==1.0.0 ordereddict==1.1 Pint==0.6 psycopg2==2.6.1 pyparsing==2.0.6 pytz==2015.6 PyYAML==3.11 requests==2.7.0 requests-oauthlib==0.5.0 requests-toolbelt==0.4.0 simple-salesforce==0.68.0 six==1.9.0 tlslite==0.4.8 django-guardian==1.4.4
biopython==1.66 Django==1.8.3 django-cors-headers==1.1.0 django-countries==3.3 django-environ==0.4.0 django-extensions==1.6.1 django-filter==0.11.0 django-gm2m==0.4.3 django-jsonfield==0.9.15 django-longerusernameandemail==0.5.7 django-model-utils==2.4 django-mptt==0.7.4 django-ordered-model==0.4.2 djangorestframework==3.3.1 drf-extensions==0.2.8 gunicorn==19.4.1 Markdown==2.6.2 oauthlib==1.0.0 ordereddict==1.1 Pint==0.6 psycopg2==2.6.1 pyparsing==2.0.6 pytz==2015.6 PyYAML==3.11 requests==2.7.0 requests-oauthlib==0.5.0 requests-toolbelt==0.4.0 simple-salesforce==0.68.0 six==1.9.0 tlslite==0.4.8 django-guardian==1.4.4 drfdocs==0.0.11
Add missing requirement for install
Add missing requirement for install
Text
mit
GETLIMS/LIMS-Backend,GETLIMS/LIMS-Backend
text
## Code Before: biopython==1.66 Django==1.8.3 django-cors-headers==1.1.0 django-countries==3.3 django-environ==0.4.0 django-extensions==1.6.1 django-filter==0.11.0 django-gm2m==0.4.3 django-jsonfield==0.9.15 django-longerusernameandemail==0.5.7 django-model-utils==2.4 django-mptt==0.7.4 django-ordered-model==0.4.2 django-rest-swagger==0.3.7 djangorestframework==3.3.1 drf-extensions==0.2.8 gunicorn==19.4.1 jira==0.50 Markdown==2.6.2 oauthlib==1.0.0 ordereddict==1.1 Pint==0.6 psycopg2==2.6.1 pyparsing==2.0.6 pytz==2015.6 PyYAML==3.11 requests==2.7.0 requests-oauthlib==0.5.0 requests-toolbelt==0.4.0 simple-salesforce==0.68.0 six==1.9.0 tlslite==0.4.8 django-guardian==1.4.4 ## Instruction: Add missing requirement for install ## Code After: biopython==1.66 Django==1.8.3 django-cors-headers==1.1.0 django-countries==3.3 django-environ==0.4.0 django-extensions==1.6.1 django-filter==0.11.0 django-gm2m==0.4.3 django-jsonfield==0.9.15 django-longerusernameandemail==0.5.7 django-model-utils==2.4 django-mptt==0.7.4 django-ordered-model==0.4.2 djangorestframework==3.3.1 drf-extensions==0.2.8 gunicorn==19.4.1 Markdown==2.6.2 oauthlib==1.0.0 ordereddict==1.1 Pint==0.6 psycopg2==2.6.1 pyparsing==2.0.6 pytz==2015.6 PyYAML==3.11 requests==2.7.0 requests-oauthlib==0.5.0 requests-toolbelt==0.4.0 simple-salesforce==0.68.0 six==1.9.0 tlslite==0.4.8 django-guardian==1.4.4 drfdocs==0.0.11
7b577b3bbd2a411cc977c9c1fe2a39b0556d4831
lib/List/Combinations.pm6
lib/List/Combinations.pm6
use v6; unit module List::Combinations; multi sub combos(@array, Int $of --> Array) is export { return [] if $of < 0; my int $size = @array.elems; return [(),] if $size < 1 || $of < 1; my @results; my Str $loops; for ^$of -> $level { $loops ~= qq/{"\t" x $level}loop (my int \$i$level = {$level == 0 ?? 0 !! '$i' ~ $level-1 ~ '+1'}; \$i$level < $size-{$of-$level-1}; \$i$level++) \{\n/; } $loops ~= qq/{"\t" x $of}\@results.push([{join('], ', ('@array[$i' xx $of ) >>~>> ^$of)}]]);\n/; for ^$of -> $level { $loops ~= qq/{"\t" x $of-$level-1}\}\n/; } say $loops; use MONKEY-SEE-NO-EVAL; EVAL $loops; @results; } multi sub combos(Int $n, Int $k --> Array) is export { combos(^$n, $k); }
use v6; unit module List::Combinations; multi sub combos(@array, Int $of --> Array) is export { return [] if $of < 0; my int $size = @array.elems; return [(),] if $size < 1 || $of < 1; my @results; my Str $loops; for ^$of -> $level { $loops ~= qq/{"\t" x $level}loop (my int \$i$level = {$level == 0 ?? 0 !! '$i' ~ $level-1 ~ '+1'}; \$i$level < $size-{$of-$level-1}; \$i$level++) \{\n/; } $loops ~= qq/{"\t" x $of}\@results.push([{join('], ', ^$of .map: '@array[$i' ~ *)}]]);\n/; for ^$of -> $level { $loops ~= qq/{"\t" x $of-$level-1}\}\n/; } use MONKEY-SEE-NO-EVAL; EVAL $loops; @results; } multi sub combos(Int $n, Int $k --> Array) is export { combos(^$n, $k); }
Remove debugging print statement and clean up generating the array elements of a combination.
Remove debugging print statement and clean up generating the array elements of a combination.
Perl6
artistic-2.0
MasterDuke17/List-Combinations
perl6
## Code Before: use v6; unit module List::Combinations; multi sub combos(@array, Int $of --> Array) is export { return [] if $of < 0; my int $size = @array.elems; return [(),] if $size < 1 || $of < 1; my @results; my Str $loops; for ^$of -> $level { $loops ~= qq/{"\t" x $level}loop (my int \$i$level = {$level == 0 ?? 0 !! '$i' ~ $level-1 ~ '+1'}; \$i$level < $size-{$of-$level-1}; \$i$level++) \{\n/; } $loops ~= qq/{"\t" x $of}\@results.push([{join('], ', ('@array[$i' xx $of ) >>~>> ^$of)}]]);\n/; for ^$of -> $level { $loops ~= qq/{"\t" x $of-$level-1}\}\n/; } say $loops; use MONKEY-SEE-NO-EVAL; EVAL $loops; @results; } multi sub combos(Int $n, Int $k --> Array) is export { combos(^$n, $k); } ## Instruction: Remove debugging print statement and clean up generating the array elements of a combination. ## Code After: use v6; unit module List::Combinations; multi sub combos(@array, Int $of --> Array) is export { return [] if $of < 0; my int $size = @array.elems; return [(),] if $size < 1 || $of < 1; my @results; my Str $loops; for ^$of -> $level { $loops ~= qq/{"\t" x $level}loop (my int \$i$level = {$level == 0 ?? 0 !! '$i' ~ $level-1 ~ '+1'}; \$i$level < $size-{$of-$level-1}; \$i$level++) \{\n/; } $loops ~= qq/{"\t" x $of}\@results.push([{join('], ', ^$of .map: '@array[$i' ~ *)}]]);\n/; for ^$of -> $level { $loops ~= qq/{"\t" x $of-$level-1}\}\n/; } use MONKEY-SEE-NO-EVAL; EVAL $loops; @results; } multi sub combos(Int $n, Int $k --> Array) is export { combos(^$n, $k); }
5f10c13c4c8f20e9f9d716c021b0b666f7e1a3ad
classes/RO/Zone.php
classes/RO/Zone.php
<?php /** * Represents a zone * * @author Edward Rudd <urkle at outoforder.cc> */ class RO_Zone extends RO_Base { protected function configSQL() { return "SELECT * FROM zones WHERE zone_id = ?"; } protected function configCache() { return array('zones','zone_id'); } protected function mobs() { FB::log($this->extra); $min_level = empty($this->extra->min_level) ? null : $this->extra->min_level; $max_level = empty($this->extra->max_level) ? null : $this->extra->max_level; $stmt = Database::query("CALL GetAreaMobs(?,?,?)",$this->ID(),$min_level, $max_level); $rows = $stmt->fetchAll(PDO::FETCH_COLUMN); return new ResultIterator($rows,'RO_Mob'); } } ?>
<?php /** * Represents a zone * * @author Edward Rudd <urkle at outoforder.cc> */ class RO_Zone extends RO_Base { protected function configSQL() { return "SELECT * FROM zones WHERE zone_id = ?"; } protected function configCache() { return array('zones','zone_id'); } protected function mobs() { $min_level = empty($this->extra->min_level) ? null : $this->extra->min_level; $max_level = empty($this->extra->max_level) ? null : $this->extra->max_level; $stmt = Database::query("CALL GetAreaMobs(?,?,?)",$this->ID(),$min_level, $max_level); $rows = $stmt->fetchAll(PDO::FETCH_COLUMN); return new ResultIterator($rows,'RO_Mob'); } } ?>
Remove debug line from class
Remove debug line from class
PHP
agpl-3.0
Anpu/INQ-Calculators,Anpu/INQ-Calculators,Anpu/INQ-Calculators
php
## Code Before: <?php /** * Represents a zone * * @author Edward Rudd <urkle at outoforder.cc> */ class RO_Zone extends RO_Base { protected function configSQL() { return "SELECT * FROM zones WHERE zone_id = ?"; } protected function configCache() { return array('zones','zone_id'); } protected function mobs() { FB::log($this->extra); $min_level = empty($this->extra->min_level) ? null : $this->extra->min_level; $max_level = empty($this->extra->max_level) ? null : $this->extra->max_level; $stmt = Database::query("CALL GetAreaMobs(?,?,?)",$this->ID(),$min_level, $max_level); $rows = $stmt->fetchAll(PDO::FETCH_COLUMN); return new ResultIterator($rows,'RO_Mob'); } } ?> ## Instruction: Remove debug line from class ## Code After: <?php /** * Represents a zone * * @author Edward Rudd <urkle at outoforder.cc> */ class RO_Zone extends RO_Base { protected function configSQL() { return "SELECT * FROM zones WHERE zone_id = ?"; } protected function configCache() { return array('zones','zone_id'); } protected function mobs() { $min_level = empty($this->extra->min_level) ? null : $this->extra->min_level; $max_level = empty($this->extra->max_level) ? null : $this->extra->max_level; $stmt = Database::query("CALL GetAreaMobs(?,?,?)",$this->ID(),$min_level, $max_level); $rows = $stmt->fetchAll(PDO::FETCH_COLUMN); return new ResultIterator($rows,'RO_Mob'); } } ?>
9db6bb3bfc8c2c8ee10239e300c5f23de01f047a
README.md
README.md
dateformatconverter =================== Date format converter for Go Programming Language.
dateformatconverter =================== Date format converter for Go Programming Language, created with ♥ by the Indivizo (http://indivizo.com/) team.
Add indivizo to readme file.
Add indivizo to readme file.
Markdown
mit
hosszukalman/dateformatconverter
markdown
## Code Before: dateformatconverter =================== Date format converter for Go Programming Language. ## Instruction: Add indivizo to readme file. ## Code After: dateformatconverter =================== Date format converter for Go Programming Language, created with ♥ by the Indivizo (http://indivizo.com/) team.
8fff5b1810720d0d8b3450e892c0b7906ce2b158
docs/source/pythonapi/index.rst
docs/source/pythonapi/index.rst
.. _pythonapi: ========== Python API ========== OpenMC includes a rich Python API that enables programmatic pre- and post-processing. The easiest way to begin using the API is to take a look at the example Jupyter notebooks provided. The full API documentation serves to provide more information on a given module or class. **Handling nuclear data:** .. toctree:: :maxdepth: 1 ace **Creating input files:** .. toctree:: :maxdepth: 1 cmfd element filter geometry material mesh nuclide opencg_compatible plots settings surface tallies trigger universe **Running OpenMC:** .. toctree:: :maxdepth: 1 executor **Post-processing:** .. toctree:: :maxdepth: 1 particle_restart statepoint summary tallies **Example Jupyter Notebooks:** .. toctree:: :maxdepth: 1 examples/pandas-dataframes examples/tally-arithmetic
.. _pythonapi: ========== Python API ========== OpenMC includes a rich Python API that enables programmatic pre- and post-processing. The easiest way to begin using the API is to take a look at the example Jupyter_ notebooks provided. However, this assumes that you are already familiar with Python and common third-party packages such as NumPy_. If you have never programmed in Python before, there are many good tutorials available online. We recommend going through the modules from Codecademy_ and/or the `Scipy lectures`_. The full API documentation serves to provide more information on a given module or class. **Handling nuclear data:** .. toctree:: :maxdepth: 1 ace **Creating input files:** .. toctree:: :maxdepth: 1 cmfd element filter geometry material mesh nuclide opencg_compatible plots settings surface tallies trigger universe **Running OpenMC:** .. toctree:: :maxdepth: 1 executor **Post-processing:** .. toctree:: :maxdepth: 1 particle_restart statepoint summary tallies **Example Jupyter Notebooks:** .. toctree:: :maxdepth: 1 examples/pandas-dataframes examples/tally-arithmetic .. _Jupyter: https://jupyter.org/ .. _NumPy: http://www.numpy.org/ .. _Codecademy: https://www.codecademy.com/tracks/python .. _Scipy lectures: https://scipy-lectures.github.io/
Add links to Python resources in main Python API doc page
Add links to Python resources in main Python API doc page
reStructuredText
mit
mjlong/openmc,wbinventor/openmc,paulromano/openmc,amandalund/openmc,liangjg/openmc,shikhar413/openmc,mit-crpg/openmc,amandalund/openmc,samuelshaner/openmc,smharper/openmc,walshjon/openmc,bhermanmit/openmc,kellyrowland/openmc,shikhar413/openmc,mit-crpg/openmc,wbinventor/openmc,samuelshaner/openmc,johnnyliu27/openmc,mit-crpg/openmc,amandalund/openmc,paulromano/openmc,liangjg/openmc,bhermanmit/openmc,smharper/openmc,johnnyliu27/openmc,walshjon/openmc,mjlong/openmc,amandalund/openmc,liangjg/openmc,wbinventor/openmc,shikhar413/openmc,wbinventor/openmc,smharper/openmc,mit-crpg/openmc,liangjg/openmc,shikhar413/openmc,paulromano/openmc,walshjon/openmc,kellyrowland/openmc,walshjon/openmc,johnnyliu27/openmc,samuelshaner/openmc,paulromano/openmc,samuelshaner/openmc,smharper/openmc,johnnyliu27/openmc
restructuredtext
## Code Before: .. _pythonapi: ========== Python API ========== OpenMC includes a rich Python API that enables programmatic pre- and post-processing. The easiest way to begin using the API is to take a look at the example Jupyter notebooks provided. The full API documentation serves to provide more information on a given module or class. **Handling nuclear data:** .. toctree:: :maxdepth: 1 ace **Creating input files:** .. toctree:: :maxdepth: 1 cmfd element filter geometry material mesh nuclide opencg_compatible plots settings surface tallies trigger universe **Running OpenMC:** .. toctree:: :maxdepth: 1 executor **Post-processing:** .. toctree:: :maxdepth: 1 particle_restart statepoint summary tallies **Example Jupyter Notebooks:** .. toctree:: :maxdepth: 1 examples/pandas-dataframes examples/tally-arithmetic ## Instruction: Add links to Python resources in main Python API doc page ## Code After: .. _pythonapi: ========== Python API ========== OpenMC includes a rich Python API that enables programmatic pre- and post-processing. The easiest way to begin using the API is to take a look at the example Jupyter_ notebooks provided. However, this assumes that you are already familiar with Python and common third-party packages such as NumPy_. If you have never programmed in Python before, there are many good tutorials available online. We recommend going through the modules from Codecademy_ and/or the `Scipy lectures`_. The full API documentation serves to provide more information on a given module or class. **Handling nuclear data:** .. toctree:: :maxdepth: 1 ace **Creating input files:** .. toctree:: :maxdepth: 1 cmfd element filter geometry material mesh nuclide opencg_compatible plots settings surface tallies trigger universe **Running OpenMC:** .. toctree:: :maxdepth: 1 executor **Post-processing:** .. toctree:: :maxdepth: 1 particle_restart statepoint summary tallies **Example Jupyter Notebooks:** .. toctree:: :maxdepth: 1 examples/pandas-dataframes examples/tally-arithmetic .. _Jupyter: https://jupyter.org/ .. _NumPy: http://www.numpy.org/ .. _Codecademy: https://www.codecademy.com/tracks/python .. _Scipy lectures: https://scipy-lectures.github.io/
c08b8593ffbd3762083af29ea452a09ba5180832
.storybook/webpack.config.js
.storybook/webpack.config.js
const genDefaultConfig = require('@storybook/vue/dist/server/config/defaults/webpack.config.js') const merge = require('webpack-merge') module.exports = (baseConfig, env) => { const storybookConfig = genDefaultConfig(baseConfig, env) const quasarConfig = require('../build/webpack.dev.conf.js') /* when building with storybook we do not want to extract css as we normally do in production */ process.env.DISABLE_EXTRACT_CSS = true const quasarBasePlugins = require('../build/webpack.base.conf.js').plugins // use Quasar config as default let mergedConfig = merge(quasarConfig, storybookConfig) // set Storybook entrypoint mergedConfig.entry = storybookConfig.entry // allow relative module resolution as used in Storybook mergedConfig.resolve.modules = storybookConfig.resolve.modules // only use Quasars loaders mergedConfig.module.rules = quasarConfig.module.rules // enable Storybook http server mergedConfig.plugins = storybookConfig.plugins // get Quasar's DefinePlugin and PostCSS settings mergedConfig.plugins.unshift(quasarBasePlugins[0], quasarBasePlugins[1]) return mergedConfig }
const genDefaultConfig = require('@storybook/vue/dist/server/config/defaults/webpack.config.js') const merge = require('webpack-merge') module.exports = (baseConfig, env) => { /* when building with storybook we do not want to extract css as we normally do in production */ process.env.DISABLE_EXTRACT_CSS = true const storybookConfig = genDefaultConfig(baseConfig, env) const quasarConfig = require('../build/webpack.dev.conf.js') const quasarBasePlugins = require('../build/webpack.base.conf.js').plugins // use Quasar config as default let mergedConfig = merge(quasarConfig, storybookConfig) // set Storybook entrypoint mergedConfig.entry = storybookConfig.entry // allow relative module resolution as used in Storybook mergedConfig.resolve.modules = storybookConfig.resolve.modules // only use Quasars loaders mergedConfig.module.rules = quasarConfig.module.rules // enable Storybook http server mergedConfig.plugins = storybookConfig.plugins // get Quasar's DefinePlugin and PostCSS settings mergedConfig.plugins.unshift(quasarBasePlugins[0], quasarBasePlugins[1]) return mergedConfig }
Set DISABLE_EXTRACT_CSS in correct place
Set DISABLE_EXTRACT_CSS in correct place
JavaScript
mit
yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/foodsaving-frontend,yunity/foodsaving-frontend,yunity/karrot-frontend,yunity/karrot-frontend
javascript
## Code Before: const genDefaultConfig = require('@storybook/vue/dist/server/config/defaults/webpack.config.js') const merge = require('webpack-merge') module.exports = (baseConfig, env) => { const storybookConfig = genDefaultConfig(baseConfig, env) const quasarConfig = require('../build/webpack.dev.conf.js') /* when building with storybook we do not want to extract css as we normally do in production */ process.env.DISABLE_EXTRACT_CSS = true const quasarBasePlugins = require('../build/webpack.base.conf.js').plugins // use Quasar config as default let mergedConfig = merge(quasarConfig, storybookConfig) // set Storybook entrypoint mergedConfig.entry = storybookConfig.entry // allow relative module resolution as used in Storybook mergedConfig.resolve.modules = storybookConfig.resolve.modules // only use Quasars loaders mergedConfig.module.rules = quasarConfig.module.rules // enable Storybook http server mergedConfig.plugins = storybookConfig.plugins // get Quasar's DefinePlugin and PostCSS settings mergedConfig.plugins.unshift(quasarBasePlugins[0], quasarBasePlugins[1]) return mergedConfig } ## Instruction: Set DISABLE_EXTRACT_CSS in correct place ## Code After: const genDefaultConfig = require('@storybook/vue/dist/server/config/defaults/webpack.config.js') const merge = require('webpack-merge') module.exports = (baseConfig, env) => { /* when building with storybook we do not want to extract css as we normally do in production */ process.env.DISABLE_EXTRACT_CSS = true const storybookConfig = genDefaultConfig(baseConfig, env) const quasarConfig = require('../build/webpack.dev.conf.js') const quasarBasePlugins = require('../build/webpack.base.conf.js').plugins // use Quasar config as default let mergedConfig = merge(quasarConfig, storybookConfig) // set Storybook entrypoint mergedConfig.entry = storybookConfig.entry // allow relative module resolution as used in Storybook mergedConfig.resolve.modules = storybookConfig.resolve.modules // only use Quasars loaders mergedConfig.module.rules = quasarConfig.module.rules // enable Storybook http server mergedConfig.plugins = storybookConfig.plugins // get Quasar's DefinePlugin and PostCSS settings mergedConfig.plugins.unshift(quasarBasePlugins[0], quasarBasePlugins[1]) return mergedConfig }
6a590c41feda3158588205f272393b565016089e
step.sh
step.sh
set -e if [ ! -z "${workdir}" ] ; then echo "==> Switching to working directory: ${workdir}" cd "${workdir}" if [ $? -ne 0 ] ; then echo " [!] Failed to switch to working directory: ${workdir}" exit 1 fi fi set -o pipefail && xcodebuild -project $BITRISE_PROJECT_PATH -scheme $BITRISE_SCHEME build test | xcpretty
set -e PROJECT_PATH=$BITRISE_PROJECT_PATH if [ ! -z "${project_path}" ] ; then PROJECT_PATH="${project_path}" fi if [ ! -z "${workdir}" ] ; then echo "==> Switching to working directory: ${workdir}" cd "${workdir}" if [ $? -ne 0 ] ; then echo " [!] Failed to switch to working directory: ${workdir}" exit 1 fi fi set -o pipefail && xcodebuild -project "${PROJECT_PATH}" -scheme $BITRISE_SCHEME build test | xcpretty
Add project path input var
Add project path input var
Shell
mit
vasarhelyia/steps-xcode-test-mac
shell
## Code Before: set -e if [ ! -z "${workdir}" ] ; then echo "==> Switching to working directory: ${workdir}" cd "${workdir}" if [ $? -ne 0 ] ; then echo " [!] Failed to switch to working directory: ${workdir}" exit 1 fi fi set -o pipefail && xcodebuild -project $BITRISE_PROJECT_PATH -scheme $BITRISE_SCHEME build test | xcpretty ## Instruction: Add project path input var ## Code After: set -e PROJECT_PATH=$BITRISE_PROJECT_PATH if [ ! -z "${project_path}" ] ; then PROJECT_PATH="${project_path}" fi if [ ! -z "${workdir}" ] ; then echo "==> Switching to working directory: ${workdir}" cd "${workdir}" if [ $? -ne 0 ] ; then echo " [!] Failed to switch to working directory: ${workdir}" exit 1 fi fi set -o pipefail && xcodebuild -project "${PROJECT_PATH}" -scheme $BITRISE_SCHEME build test | xcpretty
4509beab2ce681415f1f3de3eea10150fbaaa85e
core/database_operations.php
core/database_operations.php
<?php class Database_operations { private $database; private $bird_db; // Class constructor function __construct($bird) { try { $this->bird_db = $bird; $this->database = new PDO( 'mysql:host=localhost;dbname=gonm;charset=utf8', 'root', ''); } catch(Exception $e) { die('Error : '.$e->getMessage()); } } // Return an bird with all the informations function get_birds($code, $color) { $request = $this->database->prepare("SELECT * FROM " . $this->bird_db . " WHERE number = :number AND color = :color LIMIT 1"); $request->execute(array( "number" => $code, "color" => $color) ); return $request; } function get_unique_colors_rings() { return $this->database->query("SELECT DISTINCT color FROM kentish_plover"); //. $this->bird_db . ""); } } ?>
<?php class Database_operations { private $database; private $bird_db; // Class constructor function __construct($bird) { try { $this->bird_db = $bird; $this->database = new PDO( 'mysql:host=localhost;dbname=gonm;charset=utf8', 'root', ''); } catch(Exception $e) { die('Error : '.$e->getMessage()); } } // Return an bird with all the informations function get_birds($code, $color) { $request = $this->database->prepare("SELECT * FROM " . $this->bird_db . " WHERE number = :number AND color = :color LIMIT 1"); $request->execute(array( "number" => $code, "color" => $color) ); return $request; } // Get all the colors from the database function get_unique_colors_rings() { return $this->database->query("SELECT DISTINCT color FROM " . $this->bird_db); } } ?>
Update the function which return the unique colors
Update the function which return the unique colors
PHP
apache-2.0
Carmain/Banding-tracking,Carmain/Banding-tracking,Carmain/Banding-tracking
php
## Code Before: <?php class Database_operations { private $database; private $bird_db; // Class constructor function __construct($bird) { try { $this->bird_db = $bird; $this->database = new PDO( 'mysql:host=localhost;dbname=gonm;charset=utf8', 'root', ''); } catch(Exception $e) { die('Error : '.$e->getMessage()); } } // Return an bird with all the informations function get_birds($code, $color) { $request = $this->database->prepare("SELECT * FROM " . $this->bird_db . " WHERE number = :number AND color = :color LIMIT 1"); $request->execute(array( "number" => $code, "color" => $color) ); return $request; } function get_unique_colors_rings() { return $this->database->query("SELECT DISTINCT color FROM kentish_plover"); //. $this->bird_db . ""); } } ?> ## Instruction: Update the function which return the unique colors ## Code After: <?php class Database_operations { private $database; private $bird_db; // Class constructor function __construct($bird) { try { $this->bird_db = $bird; $this->database = new PDO( 'mysql:host=localhost;dbname=gonm;charset=utf8', 'root', ''); } catch(Exception $e) { die('Error : '.$e->getMessage()); } } // Return an bird with all the informations function get_birds($code, $color) { $request = $this->database->prepare("SELECT * FROM " . $this->bird_db . " WHERE number = :number AND color = :color LIMIT 1"); $request->execute(array( "number" => $code, "color" => $color) ); return $request; } // Get all the colors from the database function get_unique_colors_rings() { return $this->database->query("SELECT DISTINCT color FROM " . $this->bird_db); } } ?>
50f0e5b48c2fd3b7ad72bea71d6d482abd617ff6
deploy/tests/api.sh
deploy/tests/api.sh
OUTPUT="$(curl --silent http://localhost:5001/1.1/bill/2019/sb1604.json | jq '.catch_line')" EXPECTED='"Cruelty to animals; increases penalty."'; if [ "$OUTPUT" != "$EXPECTED" ] then echo "ERROR: Bill's catch line isn't included" ERRORED=true fi # Is the bill's patron shortname correct? OUTPUT="$(curl --silent http://localhost:5001/1.1/bill/2019/sb1604.json | jq '.patron_shortname')" EXPECTED='"wrdesteph"'; if [ "$OUTPUT" != "$EXPECTED" ] then echo "ERROR: Bill's patron shortname isn't correct" ERRORED=true fi # If any tests failed, have this script return that failure if [ "$ERRORED" == true ]; then exit 1 fi
OUTPUT="$(curl --silent http://localhost:5001/1.1/bill/2019/sb1604.json | jq '.catch_line')" EXPECTED='"Cruelty to animals; increases penalty."'; if [ "$OUTPUT" != "$EXPECTED" ] then echo "ERROR: Bill's catch line isn't included" ERRORED=true fi # Is the bill's patron shortname correct? OUTPUT="$(curl --silent http://localhost:5001/1.1/bill/2019/sb1604.json | jq '.patron_shortname')" EXPECTED='"wrdesteph"'; if [ "$OUTPUT" != "$EXPECTED" ] then echo "ERROR: Bill's patron shortname isn't correct" ERRORED=true fi # Is the legislator's formatted name correct? OUTPUT="$(curl --silent http://localhost:5001/1.1/legislator/rbbell.json | jq '.name_formatted')" EXPECTED='"Del. Rob Bell (R-Charlottesville)"'; if [ "$OUTPUT" != "$EXPECTED" ] then echo "ERROR: Legislator's formatted name isn't correct" ERRORED=true fi # If any tests failed, have this script return that failure if [ "$ERRORED" == true ]; then exit 1 fi
Add a legislator endpoint test
Add a legislator endpoint test Toward #114.
Shell
mit
openva/richmondsunlight.com,openva/richmondsunlight.com,openva/richmondsunlight.com,openva/richmondsunlight.com,openva/richmondsunlight.com
shell
## Code Before: OUTPUT="$(curl --silent http://localhost:5001/1.1/bill/2019/sb1604.json | jq '.catch_line')" EXPECTED='"Cruelty to animals; increases penalty."'; if [ "$OUTPUT" != "$EXPECTED" ] then echo "ERROR: Bill's catch line isn't included" ERRORED=true fi # Is the bill's patron shortname correct? OUTPUT="$(curl --silent http://localhost:5001/1.1/bill/2019/sb1604.json | jq '.patron_shortname')" EXPECTED='"wrdesteph"'; if [ "$OUTPUT" != "$EXPECTED" ] then echo "ERROR: Bill's patron shortname isn't correct" ERRORED=true fi # If any tests failed, have this script return that failure if [ "$ERRORED" == true ]; then exit 1 fi ## Instruction: Add a legislator endpoint test Toward #114. ## Code After: OUTPUT="$(curl --silent http://localhost:5001/1.1/bill/2019/sb1604.json | jq '.catch_line')" EXPECTED='"Cruelty to animals; increases penalty."'; if [ "$OUTPUT" != "$EXPECTED" ] then echo "ERROR: Bill's catch line isn't included" ERRORED=true fi # Is the bill's patron shortname correct? OUTPUT="$(curl --silent http://localhost:5001/1.1/bill/2019/sb1604.json | jq '.patron_shortname')" EXPECTED='"wrdesteph"'; if [ "$OUTPUT" != "$EXPECTED" ] then echo "ERROR: Bill's patron shortname isn't correct" ERRORED=true fi # Is the legislator's formatted name correct? OUTPUT="$(curl --silent http://localhost:5001/1.1/legislator/rbbell.json | jq '.name_formatted')" EXPECTED='"Del. Rob Bell (R-Charlottesville)"'; if [ "$OUTPUT" != "$EXPECTED" ] then echo "ERROR: Legislator's formatted name isn't correct" ERRORED=true fi # If any tests failed, have this script return that failure if [ "$ERRORED" == true ]; then exit 1 fi
135c095bad390cfdec05ee9035209245cd5c0fd3
src/util/object-utilities.js
src/util/object-utilities.js
export var ObjectUtilities = { isEqual: function (objA, objB) { var aKeys = Object.keys(objA); var bKeys = Object.keys(objB); if (aKeys.length !== bKeys.length) { return false; } for (var i = 0, len = aKeys.length; i < len; i++) { var key = aKeys[i]; if (!objB.hasOwnProperty(key) || objA[key] !== objB[key]) { return false; } } return true; } }; export var StringUtil = { pluralize: function (str, count) { var s = str; if (count > 1) { if (str.endsWith("y")) { s = str.substring(0, str.length - 2) + 'ies'; } else { s += 's'; } } return s; } };
export var ObjectUtilities = { isEqual: function (objA, objB) { if( !objA || !objB ) { return (!objA && !objB); } var aKeys = Object.keys(objA); var bKeys = Object.keys(objB); if (aKeys.length !== bKeys.length) { return false; } for (var i = 0, len = aKeys.length; i < len; i++) { var key = aKeys[i]; if (!objB.hasOwnProperty(key) || objA[key] !== objB[key]) { return false; } } return true; } }; export var StringUtil = { pluralize: function (str, count) { var s = str; if (count > 1) { if (str.endsWith("y")) { s = str.substring(0, str.length - 2) + 'ies'; } else { s += 's'; } } return s; } };
Fix bug where object comparison is done on null object.
Fix bug where object comparison is done on null object.
JavaScript
apache-2.0
kristianmandrup/stamp-web-aurelia,stamp-web/stamp-web-aurelia,stamp-web/stamp-web-aurelia,kristianmandrup/stamp-web-aurelia
javascript
## Code Before: export var ObjectUtilities = { isEqual: function (objA, objB) { var aKeys = Object.keys(objA); var bKeys = Object.keys(objB); if (aKeys.length !== bKeys.length) { return false; } for (var i = 0, len = aKeys.length; i < len; i++) { var key = aKeys[i]; if (!objB.hasOwnProperty(key) || objA[key] !== objB[key]) { return false; } } return true; } }; export var StringUtil = { pluralize: function (str, count) { var s = str; if (count > 1) { if (str.endsWith("y")) { s = str.substring(0, str.length - 2) + 'ies'; } else { s += 's'; } } return s; } }; ## Instruction: Fix bug where object comparison is done on null object. ## Code After: export var ObjectUtilities = { isEqual: function (objA, objB) { if( !objA || !objB ) { return (!objA && !objB); } var aKeys = Object.keys(objA); var bKeys = Object.keys(objB); if (aKeys.length !== bKeys.length) { return false; } for (var i = 0, len = aKeys.length; i < len; i++) { var key = aKeys[i]; if (!objB.hasOwnProperty(key) || objA[key] !== objB[key]) { return false; } } return true; } }; export var StringUtil = { pluralize: function (str, count) { var s = str; if (count > 1) { if (str.endsWith("y")) { s = str.substring(0, str.length - 2) + 'ies'; } else { s += 's'; } } return s; } };
9bffe54986326a74b84ff0e61a4e836114ab2efc
.travis.yml
.travis.yml
language: go go: - 1.4 - tip before_script: - sudo apt-get install tcl8.5 - git clone https://github.com/antirez/disque.git disque_server - "cd disque_server/src && make && PREFIX=../ make install && cd -" - "./disque_server/bin/disque-server &" - ./disque_server/bin/disque PING install: - go get github.com/robfig/glock - glock sync -n github.com/goware/disque < Glockfile script: - go test
language: go go: - 1.4 - tip before_script: - sudo apt-get install tcl8.5 - git clone https://github.com/antirez/disque.git disque_server - "cd disque_server/src && make && PREFIX=../ make install && cd -" - "./disque_server/bin/disque-server &" - ./disque_server/bin/disque PING install: - go get github.com/robfig/glock - glock sync -n github.com/goware/disque < Glockfile script: - go test -timeout=10s
Add 10s timeout to Travis go tests
Add 10s timeout to Travis go tests
YAML
mit
goware/disque,cv-library/disque
yaml
## Code Before: language: go go: - 1.4 - tip before_script: - sudo apt-get install tcl8.5 - git clone https://github.com/antirez/disque.git disque_server - "cd disque_server/src && make && PREFIX=../ make install && cd -" - "./disque_server/bin/disque-server &" - ./disque_server/bin/disque PING install: - go get github.com/robfig/glock - glock sync -n github.com/goware/disque < Glockfile script: - go test ## Instruction: Add 10s timeout to Travis go tests ## Code After: language: go go: - 1.4 - tip before_script: - sudo apt-get install tcl8.5 - git clone https://github.com/antirez/disque.git disque_server - "cd disque_server/src && make && PREFIX=../ make install && cd -" - "./disque_server/bin/disque-server &" - ./disque_server/bin/disque PING install: - go get github.com/robfig/glock - glock sync -n github.com/goware/disque < Glockfile script: - go test -timeout=10s
3de396b1a912310bb3b563a91c459b50bd565a6f
README.md
README.md
A simple wrapper around reading/writing JSON objects to local storage. Demo: <https://strburst.github.io/dear/>
A simple wrapper around reading/writing JSON objects to local storage. Note that the use cases for this have been superseded by [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API). Demo: <https://strburst.github.io/dear/>
Add note redirecting people to IndexedDB
Add note redirecting people to IndexedDB
Markdown
mit
strburst/dear,strburst/dear
markdown
## Code Before: A simple wrapper around reading/writing JSON objects to local storage. Demo: <https://strburst.github.io/dear/> ## Instruction: Add note redirecting people to IndexedDB ## Code After: A simple wrapper around reading/writing JSON objects to local storage. Note that the use cases for this have been superseded by [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API). Demo: <https://strburst.github.io/dear/>
f555aaa6928e2d012ef778baf8aa04bc6b9cb735
features/server/evaluate-expression/correlating_requests_and_responses.feature
features/server/evaluate-expression/correlating_requests_and_responses.feature
Feature: Correlating requests and responses In order to know which request triggered a specific response As a tool developer I want the response to specify the originating request ID as its correlation ID Scenario: Correlating requests and responses Given a request with the ID "aaaa-bbbb-cccc" And a request with the expression "5" When the evaluate expression service is invoked Then the response should contain the correlation ID "aaaa-bbbb-cccc"
Feature: Correlating requests and responses In order to know which request triggered a specific response As a tool developer I want the response to specify the originating request ID as its correlation ID Scenario: Correlating requests and responses Given a request with the ID "aaaaabbbbbcccccddddd" And a request with the expression "5" When the evaluate expression service is invoked Then the response should contain the correlation ID "aaaaabbbbbcccccddddd"
Change request ID used in acceptance tests
Change request ID used in acceptance tests Running the "Correlating requests and responses" feature against Heroku will fail if the request ID does not follow their rules. Otherwise, Heroku will ignore the request ID and inject their own. We were violating the minimum length rule (20 characters). The tests have been updated to use a request ID that exceeds this minimum length.
Cucumber
mit
ssoloff/dice-server-js,ssoloff/dice-server-js,ssoloff/dice-server-js,ssoloff/dice-server-js
cucumber
## Code Before: Feature: Correlating requests and responses In order to know which request triggered a specific response As a tool developer I want the response to specify the originating request ID as its correlation ID Scenario: Correlating requests and responses Given a request with the ID "aaaa-bbbb-cccc" And a request with the expression "5" When the evaluate expression service is invoked Then the response should contain the correlation ID "aaaa-bbbb-cccc" ## Instruction: Change request ID used in acceptance tests Running the "Correlating requests and responses" feature against Heroku will fail if the request ID does not follow their rules. Otherwise, Heroku will ignore the request ID and inject their own. We were violating the minimum length rule (20 characters). The tests have been updated to use a request ID that exceeds this minimum length. ## Code After: Feature: Correlating requests and responses In order to know which request triggered a specific response As a tool developer I want the response to specify the originating request ID as its correlation ID Scenario: Correlating requests and responses Given a request with the ID "aaaaabbbbbcccccddddd" And a request with the expression "5" When the evaluate expression service is invoked Then the response should contain the correlation ID "aaaaabbbbbcccccddddd"
f32becc18ec04512666357f8defe63f68c165c98
kerberosIV/usr.bin/kauth/Makefile
kerberosIV/usr.bin/kauth/Makefile
PROG= kauth MAN1= ${KRB4DIR}/man/kauth.1 SRCS= kauth.c rkinit.c encdata.c marshall.c CFLAGS+= -I${KRB4DIR}/include \ -I${KRB4DIR}/lib/roken \ -I${KRB4DIR}/lib/kafs \ -I${KRB4DIR}/lib/krb \ -I${KRB4DIR}/appl/kauth LDADD= -L${ROKENOBJDIR} -lroken -L${KAFSOBJDIR} -lkafs \ -L${KRBOBJDIR} -lkrb -ldes DPADD= ${LIBROKEN} ${LIBKAFS} ${LIBKRB} ${LIBDES} .include <bsd.prog.mk> .PATH: ${KRB4DIR}/appl/kauth
PROG= kauth MAN1= ${KRB4DIR}/man/kauth.1 SRCS= kauth.c rkinit.c encdata.c marshall.c CFLAGS+= -I${KRB4DIR}/include \ -I${KRB4DIR}/lib/roken \ -I${KRB4DIR}/lib/kafs \ -I${KRB4DIR}/lib/krb \ -I${KRB4DIR}/appl/kauth LDADD= -L${ROKENOBJDIR} -lroken -L${KAFSOBJDIR} -lkafs \ -L${KRBOBJDIR} -lkrb -ldes -lcrypt DPADD= ${LIBROKEN} ${LIBKAFS} ${LIBKRB} ${LIBDES} ${LIBCRYPT} .include <bsd.prog.mk> .PATH: ${KRB4DIR}/appl/kauth
Add libcrypt. Elf was breaking.
Add libcrypt. Elf was breaking.
unknown
bsd-3-clause
jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase
unknown
## Code Before: PROG= kauth MAN1= ${KRB4DIR}/man/kauth.1 SRCS= kauth.c rkinit.c encdata.c marshall.c CFLAGS+= -I${KRB4DIR}/include \ -I${KRB4DIR}/lib/roken \ -I${KRB4DIR}/lib/kafs \ -I${KRB4DIR}/lib/krb \ -I${KRB4DIR}/appl/kauth LDADD= -L${ROKENOBJDIR} -lroken -L${KAFSOBJDIR} -lkafs \ -L${KRBOBJDIR} -lkrb -ldes DPADD= ${LIBROKEN} ${LIBKAFS} ${LIBKRB} ${LIBDES} .include <bsd.prog.mk> .PATH: ${KRB4DIR}/appl/kauth ## Instruction: Add libcrypt. Elf was breaking. ## Code After: PROG= kauth MAN1= ${KRB4DIR}/man/kauth.1 SRCS= kauth.c rkinit.c encdata.c marshall.c CFLAGS+= -I${KRB4DIR}/include \ -I${KRB4DIR}/lib/roken \ -I${KRB4DIR}/lib/kafs \ -I${KRB4DIR}/lib/krb \ -I${KRB4DIR}/appl/kauth LDADD= -L${ROKENOBJDIR} -lroken -L${KAFSOBJDIR} -lkafs \ -L${KRBOBJDIR} -lkrb -ldes -lcrypt DPADD= ${LIBROKEN} ${LIBKAFS} ${LIBKRB} ${LIBDES} ${LIBCRYPT} .include <bsd.prog.mk> .PATH: ${KRB4DIR}/appl/kauth
8e1f3e687d4e9070609108646cdcb5b014dd3f7c
meta.nabl2.terms/src/main/java/org/metaborg/meta/nabl2/terms/ITermVar.java
meta.nabl2.terms/src/main/java/org/metaborg/meta/nabl2/terms/ITermVar.java
package org.metaborg.meta.nabl2.terms; import com.google.common.collect.ImmutableClassToInstanceMap; public interface ITermVar extends ITerm, IListTerm { String getResource(); String getName(); ITermVar withAttachments(ImmutableClassToInstanceMap<Object> value); }
package org.metaborg.meta.nabl2.terms; import com.google.common.collect.ImmutableClassToInstanceMap; public interface ITermVar extends ITerm, IListTerm { String getResource(); String getName(); ITermVar withAttachments(ImmutableClassToInstanceMap<Object> value); @Override ITermVar withLocked(boolean locked); }
Add override to refine return type.
Add override to refine return type.
Java
apache-2.0
metaborg/nabl,metaborg/nabl,metaborg/nabl
java
## Code Before: package org.metaborg.meta.nabl2.terms; import com.google.common.collect.ImmutableClassToInstanceMap; public interface ITermVar extends ITerm, IListTerm { String getResource(); String getName(); ITermVar withAttachments(ImmutableClassToInstanceMap<Object> value); } ## Instruction: Add override to refine return type. ## Code After: package org.metaborg.meta.nabl2.terms; import com.google.common.collect.ImmutableClassToInstanceMap; public interface ITermVar extends ITerm, IListTerm { String getResource(); String getName(); ITermVar withAttachments(ImmutableClassToInstanceMap<Object> value); @Override ITermVar withLocked(boolean locked); }
460f77dedeba8409207c70764e97ebeed3dd0500
app/views/comments/create.js.haml
app/views/comments/create.js.haml
:plain $(".comments").before("#{escape_javascript(render("comments/comment", comment: @comment))}")
:plain $(".comments").before("#{escape_javascript(render("comments/comment", comment: @comment))}"); $(".comment_form #comment_body").val("");
Clear the comment input after create.
Clear the comment input after create.
Haml
mit
avoinministerio/avoinministerio,avoinministerio/avoinministerio
haml
## Code Before: :plain $(".comments").before("#{escape_javascript(render("comments/comment", comment: @comment))}") ## Instruction: Clear the comment input after create. ## Code After: :plain $(".comments").before("#{escape_javascript(render("comments/comment", comment: @comment))}"); $(".comment_form #comment_body").val("");
0cb87e52f91c85ec99b58f2795c7762354531e7c
python/assemble_BFs.py
python/assemble_BFs.py
import doseresponse as dr import numpy as np import itertools as it import os import argparse import sys parser = argparse.ArgumentParser() requiredNamed = parser.add_argument_group('required arguments') requiredNamed.add_argument("--data-file", type=str, help="csv file from which to read in data, in same format as provided crumb_data.csv", required=True) if len(sys.argv)==1: parser.print_help() sys.exit(1) args = parser.parse_args() dr.setup(args.data_file) drugs_channels_idx = it.product(range(30), range(7)) BFs = np.zeros((30, 7)) for i, j in drugs_channels_idx: top_drug = dr.drugs[i] top_channel = dr.channels[j] drug, channel, chain_file, images_dir = dr.nonhierarchical_chain_file_and_figs_dir(1, top_drug, top_channel, 1) bf_dir = "BFs/" bf_file = bf_dir + "{}_{}_B12.txt".format(drug,channel) BFs[i, j] = np.loadtxt(bf_file) max_idx = np.argmax(BFs) min_idx = np.argmin(BFs) print "max:", BFs[max_idx] print "min:", BFs[min_idx]
import doseresponse as dr import numpy as np import itertools as it import os import argparse import sys parser = argparse.ArgumentParser() requiredNamed = parser.add_argument_group('required arguments') requiredNamed.add_argument("--data-file", type=str, help="csv file from which to read in data, in same format as provided crumb_data.csv", required=True) if len(sys.argv)==1: parser.print_help() sys.exit(1) args = parser.parse_args() dr.setup(args.data_file) drugs_channels_idx = it.product(range(30), range(7)) BFs = np.zeros((30, 7)) for i, j in drugs_channels_idx: top_drug = dr.drugs[i] top_channel = dr.channels[j] drug, channel, chain_file, images_dir = dr.nonhierarchical_chain_file_and_figs_dir(1, top_drug, top_channel, 1) bf_dir = "BFs/" bf_file = bf_dir + "{}_{}_B12.txt".format(drug,channel) BFs[i, j] = np.loadtxt(bf_file) max_idx = np.unravel_index(np.argmax(BFs), (30,7)) min_idx = np.unravel_index(np.argmin(BFs), (30,7)) print "max:", BFs[max_idx] print "min:", BFs[min_idx]
Unravel index for argmin of array
Unravel index for argmin of array
Python
bsd-3-clause
mirams/PyHillFit,mirams/PyHillFit,mirams/PyHillFit
python
## Code Before: import doseresponse as dr import numpy as np import itertools as it import os import argparse import sys parser = argparse.ArgumentParser() requiredNamed = parser.add_argument_group('required arguments') requiredNamed.add_argument("--data-file", type=str, help="csv file from which to read in data, in same format as provided crumb_data.csv", required=True) if len(sys.argv)==1: parser.print_help() sys.exit(1) args = parser.parse_args() dr.setup(args.data_file) drugs_channels_idx = it.product(range(30), range(7)) BFs = np.zeros((30, 7)) for i, j in drugs_channels_idx: top_drug = dr.drugs[i] top_channel = dr.channels[j] drug, channel, chain_file, images_dir = dr.nonhierarchical_chain_file_and_figs_dir(1, top_drug, top_channel, 1) bf_dir = "BFs/" bf_file = bf_dir + "{}_{}_B12.txt".format(drug,channel) BFs[i, j] = np.loadtxt(bf_file) max_idx = np.argmax(BFs) min_idx = np.argmin(BFs) print "max:", BFs[max_idx] print "min:", BFs[min_idx] ## Instruction: Unravel index for argmin of array ## Code After: import doseresponse as dr import numpy as np import itertools as it import os import argparse import sys parser = argparse.ArgumentParser() requiredNamed = parser.add_argument_group('required arguments') requiredNamed.add_argument("--data-file", type=str, help="csv file from which to read in data, in same format as provided crumb_data.csv", required=True) if len(sys.argv)==1: parser.print_help() sys.exit(1) args = parser.parse_args() dr.setup(args.data_file) drugs_channels_idx = it.product(range(30), range(7)) BFs = np.zeros((30, 7)) for i, j in drugs_channels_idx: top_drug = dr.drugs[i] top_channel = dr.channels[j] drug, channel, chain_file, images_dir = dr.nonhierarchical_chain_file_and_figs_dir(1, top_drug, top_channel, 1) bf_dir = "BFs/" bf_file = bf_dir + "{}_{}_B12.txt".format(drug,channel) BFs[i, j] = np.loadtxt(bf_file) max_idx = np.unravel_index(np.argmax(BFs), (30,7)) min_idx = np.unravel_index(np.argmin(BFs), (30,7)) print "max:", BFs[max_idx] print "min:", BFs[min_idx]
0dd024ece2ac11fd26640682e416e7569792eb9c
app/views/admin/markdown/_index.html.haml
app/views/admin/markdown/_index.html.haml
:markdown # # Big title ## ## Medium title ### ### Small title * `*italic*` => *italic* * `**bold**` => **bold** * `[link](http://example.com)` => [link](http://example.com) * `![image](http://image.jpg)` => displays the image in the URL * `<email@example.com>` – <email@example.com> (a link to a mail address) ## Lists Bulleted list (`*` transforms into • ): * this * is a * bulleted * list Numbered list: 1. this 2. is a 3. numbered 4. list ## Paragraphs You separate paragraphs with an empty new line: This is one paragraph. This is another paragraph. To make a line break (without making a new paragraph), use `<br>`: This is one line<br> Which I wanted to break.
:markdown # # Big title ## ## Medium title ### ### Small title * `*italic*` => *italic* * `**bold**` => **bold** * `[link](http://example.com)` => [link](http://example.com) * `![image](http://image.jpg)` => displays the image in the URL * `<email@example.com>` – <email@example.com> (a link to a mail address) Lists -------- Bulleted list (`*` transforms into • ): * this * is a * bulleted * list Numbered list: 1. this 2. is a 3. numbered 4. list Paragraphs ---------- You separate paragraphs with an empty new line: This is one paragraph. This is another paragraph. To make a line break (without making a new paragraph), use `<br>`: This is one line<br> Which I wanted to break. Quotations ---------- In order to make a quotation, put a ">" in the beginning of the paragraph: > The world is a dangerous place to live; not because of the people who are evil, but because of the people who don't do anything about it. And you get some quotation-looking text: > The world is a dangerous place to live; not because of the people who are evil, but because of the people who don't do anything about it.
Update markdown reference with quotations
Update markdown reference with quotations
Haml
mit
twin/synergy,twin/synergy
haml
## Code Before: :markdown # # Big title ## ## Medium title ### ### Small title * `*italic*` => *italic* * `**bold**` => **bold** * `[link](http://example.com)` => [link](http://example.com) * `![image](http://image.jpg)` => displays the image in the URL * `<email@example.com>` – <email@example.com> (a link to a mail address) ## Lists Bulleted list (`*` transforms into • ): * this * is a * bulleted * list Numbered list: 1. this 2. is a 3. numbered 4. list ## Paragraphs You separate paragraphs with an empty new line: This is one paragraph. This is another paragraph. To make a line break (without making a new paragraph), use `<br>`: This is one line<br> Which I wanted to break. ## Instruction: Update markdown reference with quotations ## Code After: :markdown # # Big title ## ## Medium title ### ### Small title * `*italic*` => *italic* * `**bold**` => **bold** * `[link](http://example.com)` => [link](http://example.com) * `![image](http://image.jpg)` => displays the image in the URL * `<email@example.com>` – <email@example.com> (a link to a mail address) Lists -------- Bulleted list (`*` transforms into • ): * this * is a * bulleted * list Numbered list: 1. this 2. is a 3. numbered 4. list Paragraphs ---------- You separate paragraphs with an empty new line: This is one paragraph. This is another paragraph. To make a line break (without making a new paragraph), use `<br>`: This is one line<br> Which I wanted to break. Quotations ---------- In order to make a quotation, put a ">" in the beginning of the paragraph: > The world is a dangerous place to live; not because of the people who are evil, but because of the people who don't do anything about it. And you get some quotation-looking text: > The world is a dangerous place to live; not because of the people who are evil, but because of the people who don't do anything about it.
641812ef5370455ba8ccc0243634a35e3d547b07
.travis.yml
.travis.yml
sudo: false language: java jdk: oraclejdk8 jobs: include: - stage: junit5-maven-consumer script: cd $TRAVIS_BUILD_DIR/junit5-maven-consumer && ./mvnw test - stage: junit5-gradle-consumer script: cd $TRAVIS_BUILD_DIR/junit5-gradle-consumer && ./gradlew test - stage: junit5-mockito-extension script: cd $TRAVIS_BUILD_DIR/junit5-mockito-extension && ./gradlew test - stage: junit5-vanilla-gradle script: cd $TRAVIS_BUILD_DIR/junit5-mockito-extension && ./gradlew test
sudo: false language: java jdk: oraclejdk8 jobs: include: - stage: junit5-maven-consumer script: cd $TRAVIS_BUILD_DIR/junit5-maven-consumer && ./mvnw test - stage: junit5-gradle-consumer script: cd $TRAVIS_BUILD_DIR/junit5-gradle-consumer && ./gradlew test - stage: junit5-mockito-extension script: cd $TRAVIS_BUILD_DIR/junit5-mockito-extension && ./gradlew test - stage: junit5-vanilla-gradle script: cd $TRAVIS_BUILD_DIR/junit5-vanilla-gradle && ./gradlew test
Fix junit5-vanilla-gradle stage by changing to the correct directory
Fix junit5-vanilla-gradle stage by changing to the correct directory
YAML
epl-1.0
marcphilipp/junit5-samples,marcphilipp/junit5-samples
yaml
## Code Before: sudo: false language: java jdk: oraclejdk8 jobs: include: - stage: junit5-maven-consumer script: cd $TRAVIS_BUILD_DIR/junit5-maven-consumer && ./mvnw test - stage: junit5-gradle-consumer script: cd $TRAVIS_BUILD_DIR/junit5-gradle-consumer && ./gradlew test - stage: junit5-mockito-extension script: cd $TRAVIS_BUILD_DIR/junit5-mockito-extension && ./gradlew test - stage: junit5-vanilla-gradle script: cd $TRAVIS_BUILD_DIR/junit5-mockito-extension && ./gradlew test ## Instruction: Fix junit5-vanilla-gradle stage by changing to the correct directory ## Code After: sudo: false language: java jdk: oraclejdk8 jobs: include: - stage: junit5-maven-consumer script: cd $TRAVIS_BUILD_DIR/junit5-maven-consumer && ./mvnw test - stage: junit5-gradle-consumer script: cd $TRAVIS_BUILD_DIR/junit5-gradle-consumer && ./gradlew test - stage: junit5-mockito-extension script: cd $TRAVIS_BUILD_DIR/junit5-mockito-extension && ./gradlew test - stage: junit5-vanilla-gradle script: cd $TRAVIS_BUILD_DIR/junit5-vanilla-gradle && ./gradlew test
205f4c2cf5dbc34fedb2754d5454ec21d7780a0c
CMakeLists.txt
CMakeLists.txt
cmake_minimum_required (VERSION 2.8.11) project (dirent) enable_language (C) install (FILES include/dirent.h DESTINATION include) # Add include directory to path if current system omits dirent.h file. This # step is imporant for compiling the test programs under Linux. include (CheckIncludeFiles) check_include_files (dirent.h HAVE_DIRENT_H) if (NOT HAVE_DIRENT_H) include_directories (${CMAKE_SOURCE_DIR}/include) endif (NOT HAVE_DIRENT_H) # Build example programs add_executable (find examples/find.c) add_executable (ls examples/ls.c) add_executable (locate examples/locate.c) add_executable (updatedb examples/updatedb.c) # Build test programs include (CTest) add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR}) function (add_test_executable TEST_NAME) add_executable (${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN}) add_test (NAME ${TEST_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND $<TARGET_FILE:${TEST_NAME}>) add_dependencies (check ${TEST_NAME}) endfunction (add_test_executable) add_test_executable (t-compile tests/t-compile.c) add_test_executable (t-dirent tests/t-dirent.c)
cmake_minimum_required (VERSION 2.8.11) project (dirent) enable_language (C) # Only use the dirent file on windows systems if (WIN32) include_directories (${CMAKE_SOURCE_DIR}/include) install (FILES include/dirent.h DESTINATION include) endif() # Build example programs add_executable (find examples/find.c) add_executable (ls examples/ls.c) add_executable (locate examples/locate.c) add_executable (updatedb examples/updatedb.c) # Build test programs include (CTest) add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR}) function (add_test_executable TEST_NAME) add_executable (${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN}) add_test (NAME ${TEST_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND $<TARGET_FILE:${TEST_NAME}>) add_dependencies (check ${TEST_NAME}) endfunction (add_test_executable) add_test_executable (t-compile tests/t-compile.c) add_test_executable (t-dirent tests/t-dirent.c)
Update cmake to only use dirent header on windows
Update cmake to only use dirent header on windows
Text
mit
tronkko/dirent,tronkko/dirent
text
## Code Before: cmake_minimum_required (VERSION 2.8.11) project (dirent) enable_language (C) install (FILES include/dirent.h DESTINATION include) # Add include directory to path if current system omits dirent.h file. This # step is imporant for compiling the test programs under Linux. include (CheckIncludeFiles) check_include_files (dirent.h HAVE_DIRENT_H) if (NOT HAVE_DIRENT_H) include_directories (${CMAKE_SOURCE_DIR}/include) endif (NOT HAVE_DIRENT_H) # Build example programs add_executable (find examples/find.c) add_executable (ls examples/ls.c) add_executable (locate examples/locate.c) add_executable (updatedb examples/updatedb.c) # Build test programs include (CTest) add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR}) function (add_test_executable TEST_NAME) add_executable (${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN}) add_test (NAME ${TEST_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND $<TARGET_FILE:${TEST_NAME}>) add_dependencies (check ${TEST_NAME}) endfunction (add_test_executable) add_test_executable (t-compile tests/t-compile.c) add_test_executable (t-dirent tests/t-dirent.c) ## Instruction: Update cmake to only use dirent header on windows ## Code After: cmake_minimum_required (VERSION 2.8.11) project (dirent) enable_language (C) # Only use the dirent file on windows systems if (WIN32) include_directories (${CMAKE_SOURCE_DIR}/include) install (FILES include/dirent.h DESTINATION include) endif() # Build example programs add_executable (find examples/find.c) add_executable (ls examples/ls.c) add_executable (locate examples/locate.c) add_executable (updatedb examples/updatedb.c) # Build test programs include (CTest) add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C ${CMAKE_CFG_INTDIR}) function (add_test_executable TEST_NAME) add_executable (${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN}) add_test (NAME ${TEST_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND $<TARGET_FILE:${TEST_NAME}>) add_dependencies (check ${TEST_NAME}) endfunction (add_test_executable) add_test_executable (t-compile tests/t-compile.c) add_test_executable (t-dirent tests/t-dirent.c)
14658e46771d3fae97f5347684922fd6080d64eb
bin/publish-docs.sh
bin/publish-docs.sh
set -e PAGES_DIR=./gh-pages DOCS_DIR=./out REPO="https://${GH_TOKEN}@github.com/contentful/contentful.js.git" VERSION=`cat package.json|grep version|sed -e 's/.*version": "//g'|sed -e 's/",.*//g'` echo "Publishing docs" if ! [ -d $DOCS_DIR ] ; then echo "Docs can't be found. Maybe you haven't generated them?" exit 1 fi # get the gh-pages branch of the repo if [ ! -d $PAGES_DIR ] ; then git clone --single-branch --branch gh-pages $REPO $PAGES_DIR fi cp -r $DOCS_DIR/* $PAGES_DIR echo "<meta http-equiv=\"refresh\" content=\"0; url=https://contentful.github.io/contentful.js/contentful/${VERSION}/\">" > $PAGES_DIR/index.html pushd $PAGES_DIR git add . git commit -a -m "Docs update" if [ $? -eq 1 ] ; then echo "Nothing to update" else git push origin gh-pages fi popd
set -e PAGES_DIR=./gh-pages DOCS_DIR=./out REPO="https://${GH_TOKEN}@github.com/contentful/contentful.js.git" VERSION=`cat package.json|json version` echo "Publishing docs" if ! [ -d $DOCS_DIR ] ; then echo "Docs can't be found. Maybe you haven't generated them?" exit 1 fi # get the gh-pages branch of the repo if [ ! -d $PAGES_DIR ] ; then git clone --single-branch --branch gh-pages $REPO $PAGES_DIR fi cp -r $DOCS_DIR/* $PAGES_DIR echo "<meta http-equiv=\"refresh\" content=\"0; url=https://contentful.github.io/contentful.js/contentful/${VERSION}/\">" > $PAGES_DIR/index.html pushd $PAGES_DIR git add . git commit -a -m "Docs update" if [ $? -eq 1 ] ; then echo "Nothing to update" else git push origin gh-pages fi popd
Fix version fetching in docs publishing script
fix(docs): Fix version fetching in docs publishing script
Shell
mit
contentful/contentful.js
shell
## Code Before: set -e PAGES_DIR=./gh-pages DOCS_DIR=./out REPO="https://${GH_TOKEN}@github.com/contentful/contentful.js.git" VERSION=`cat package.json|grep version|sed -e 's/.*version": "//g'|sed -e 's/",.*//g'` echo "Publishing docs" if ! [ -d $DOCS_DIR ] ; then echo "Docs can't be found. Maybe you haven't generated them?" exit 1 fi # get the gh-pages branch of the repo if [ ! -d $PAGES_DIR ] ; then git clone --single-branch --branch gh-pages $REPO $PAGES_DIR fi cp -r $DOCS_DIR/* $PAGES_DIR echo "<meta http-equiv=\"refresh\" content=\"0; url=https://contentful.github.io/contentful.js/contentful/${VERSION}/\">" > $PAGES_DIR/index.html pushd $PAGES_DIR git add . git commit -a -m "Docs update" if [ $? -eq 1 ] ; then echo "Nothing to update" else git push origin gh-pages fi popd ## Instruction: fix(docs): Fix version fetching in docs publishing script ## Code After: set -e PAGES_DIR=./gh-pages DOCS_DIR=./out REPO="https://${GH_TOKEN}@github.com/contentful/contentful.js.git" VERSION=`cat package.json|json version` echo "Publishing docs" if ! [ -d $DOCS_DIR ] ; then echo "Docs can't be found. Maybe you haven't generated them?" exit 1 fi # get the gh-pages branch of the repo if [ ! -d $PAGES_DIR ] ; then git clone --single-branch --branch gh-pages $REPO $PAGES_DIR fi cp -r $DOCS_DIR/* $PAGES_DIR echo "<meta http-equiv=\"refresh\" content=\"0; url=https://contentful.github.io/contentful.js/contentful/${VERSION}/\">" > $PAGES_DIR/index.html pushd $PAGES_DIR git add . git commit -a -m "Docs update" if [ $? -eq 1 ] ; then echo "Nothing to update" else git push origin gh-pages fi popd
a1bd341bf50e7bbd5bc1f343bcae405d045255d7
application/modules/skeleton/views/content/pagelet_js_togglable_tabs.php
application/modules/skeleton/views/content/pagelet_js_togglable_tabs.php
<h2 id="js-togglable-tabs">Togglable tabs</h2> <div> <ul class="nav nav-tabs"> <li class="active"><a href="#js-tab-pane1" data-toggle="tab">data-toggle="tab"</a></li> <li><a href="#js-tab-pane2" onclick="$(this).tab('show'); return false;">$(this).tab('show')</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="js-tab-pane1"><p><small>.table-content</small> .tab-pane.active</p></div> <div class="tab-pane" id="js-tab-pane2"><p><small>.table-content</small> .tab-pane</p></div> </div> <p>Events: <code>show.bs.tab</code> <code>shown.bs.tab</code></p> </div>
<h2 id="js-togglable-tabs">Togglable tabs</h2> <div> <ul class="nav nav-tabs"> <li class="active"> <a href="#js-tab-pane1" data-toggle="tab"> data-toggle="tab" </a> </li> <li> <a href="#js-tab-pane2" onclick="$(this).tab('show'); return false;"> $(this).tab('show') </a> </li> </ul> <div class="tab-content"> <div class="tab-pane active" id="js-tab-pane1"> <p><span class="text-muted">.table-content</span> .tab-pane.active</p> </div> <div class="tab-pane" id="js-tab-pane2"> <p><span class="text-muted">.table-content</span> .tab-pane</p> </div> </div> <p>Fade effect</p> <ul class="nav nav-tabs"> <li class="active"> <a href="#js-tab-pane3" data-toggle="tab">Tab #1</a> </li> <li> <a href="#js-tab-pane4" data-toggle="tab">Tab #2</a> </li> </ul> <div class="tab-content"> <div class="tab-pane fade in active" id="js-tab-pane3"> <p><span class="text-muted">.table-content</span> .tab-pane.fade.in.active</p> </div> <div class="tab-pane fade" id="js-tab-pane4"> <p><span class="text-muted">.table-content</span> .tab-pane.fade</p> </div> </div> <p>Events: <code>show.bs.tab</code> <code>shown.bs.tab</code></p> </div>
Add fade effect to togglable tabs section
Add fade effect to togglable tabs section
PHP
mit
amchicas/CodeIgniter-Skeleton,amchicas/CodeIgniter-Skeleton,amchicas/CodeIgniter-Skeleton
php
## Code Before: <h2 id="js-togglable-tabs">Togglable tabs</h2> <div> <ul class="nav nav-tabs"> <li class="active"><a href="#js-tab-pane1" data-toggle="tab">data-toggle="tab"</a></li> <li><a href="#js-tab-pane2" onclick="$(this).tab('show'); return false;">$(this).tab('show')</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="js-tab-pane1"><p><small>.table-content</small> .tab-pane.active</p></div> <div class="tab-pane" id="js-tab-pane2"><p><small>.table-content</small> .tab-pane</p></div> </div> <p>Events: <code>show.bs.tab</code> <code>shown.bs.tab</code></p> </div> ## Instruction: Add fade effect to togglable tabs section ## Code After: <h2 id="js-togglable-tabs">Togglable tabs</h2> <div> <ul class="nav nav-tabs"> <li class="active"> <a href="#js-tab-pane1" data-toggle="tab"> data-toggle="tab" </a> </li> <li> <a href="#js-tab-pane2" onclick="$(this).tab('show'); return false;"> $(this).tab('show') </a> </li> </ul> <div class="tab-content"> <div class="tab-pane active" id="js-tab-pane1"> <p><span class="text-muted">.table-content</span> .tab-pane.active</p> </div> <div class="tab-pane" id="js-tab-pane2"> <p><span class="text-muted">.table-content</span> .tab-pane</p> </div> </div> <p>Fade effect</p> <ul class="nav nav-tabs"> <li class="active"> <a href="#js-tab-pane3" data-toggle="tab">Tab #1</a> </li> <li> <a href="#js-tab-pane4" data-toggle="tab">Tab #2</a> </li> </ul> <div class="tab-content"> <div class="tab-pane fade in active" id="js-tab-pane3"> <p><span class="text-muted">.table-content</span> .tab-pane.fade.in.active</p> </div> <div class="tab-pane fade" id="js-tab-pane4"> <p><span class="text-muted">.table-content</span> .tab-pane.fade</p> </div> </div> <p>Events: <code>show.bs.tab</code> <code>shown.bs.tab</code></p> </div>
c09676d3babda5dbef6cf21e75f035fa5562c9a3
bot.yml
bot.yml
name: jumbobot description: Jumbo helps you remember lists of things. avatar: .beepboop/noun_544584.png # To learn everything supported in the bot.yml file, visit https://beepboophq.com/docs/article/bot-yml
name: jumbobot description: Jumbo helps you remember lists of things. avatar: .beepboop/noun_544584.png config: - name: SECRET friendly_name: DB_ID info: The client id for the database global: false - name: SECRET friendly_name: DB_KEY info: The key for the database global: false # To learn everything supported in the bot.yml file, visit https://beepboophq.com/docs/article/bot-yml
Add the DB_ID and DB_KEY config items.
Add the DB_ID and DB_KEY config items.
YAML
mit
ScriptGadget/jumbo-bot
yaml
## Code Before: name: jumbobot description: Jumbo helps you remember lists of things. avatar: .beepboop/noun_544584.png # To learn everything supported in the bot.yml file, visit https://beepboophq.com/docs/article/bot-yml ## Instruction: Add the DB_ID and DB_KEY config items. ## Code After: name: jumbobot description: Jumbo helps you remember lists of things. avatar: .beepboop/noun_544584.png config: - name: SECRET friendly_name: DB_ID info: The client id for the database global: false - name: SECRET friendly_name: DB_KEY info: The key for the database global: false # To learn everything supported in the bot.yml file, visit https://beepboophq.com/docs/article/bot-yml
a1bc59c8825d82836aa4ab2e3b4affe105a364c9
src/Recurrence/RecurrenceInterface.php
src/Recurrence/RecurrenceInterface.php
<?php namespace Plummer\Calendarful\Recurrence; interface RecurrenceInterface { public function getLabel(); public function getLimit(); public function generateOccurrences(Array $events, $fromDate, $toDate, $limit = null); }
<?php namespace Plummer\Calendarful\Recurrence; interface RecurrenceInterface { public function getLabel(); public function getLimit(); public function generateOccurrences(Array $events, \DateTime $fromDate, \DateTime $toDate, $limit = null); }
Add DateTime type hints for date parameters in method signature.
Add DateTime type hints for date parameters in method signature.
PHP
mit
benplummer/calendarful
php
## Code Before: <?php namespace Plummer\Calendarful\Recurrence; interface RecurrenceInterface { public function getLabel(); public function getLimit(); public function generateOccurrences(Array $events, $fromDate, $toDate, $limit = null); } ## Instruction: Add DateTime type hints for date parameters in method signature. ## Code After: <?php namespace Plummer\Calendarful\Recurrence; interface RecurrenceInterface { public function getLabel(); public function getLimit(); public function generateOccurrences(Array $events, \DateTime $fromDate, \DateTime $toDate, $limit = null); }
de7f3824d378904828e3eb74e6ff109d6a519296
esapi/esapi_internal_test.go
esapi/esapi_internal_test.go
// +build !integration package esapi import ( "testing" ) func TestAPIHelpers(t *testing.T) { t.Run("BoolPtr", func(t *testing.T) { var v *bool v = BoolPtr(false) if v == nil || *v != false { t.Errorf("Expected false, got: %v", v) } v = BoolPtr(true) if v == nil || *v != true { t.Errorf("Expected true, got: %v", v) } }) t.Run("IntPtr", func(t *testing.T) { var v *int v = IntPtr(0) if v == nil || *v != 0 { t.Errorf("Expected 0, got: %v", v) } }) }
// +build !integration package esapi import ( "testing" ) func TestAPIHelpers(t *testing.T) { t.Run("BoolPtr", func(t *testing.T) { v := BoolPtr(false) if v == nil || *v != false { t.Errorf("Expected false, got: %v", v) } v = BoolPtr(true) if v == nil || *v != true { t.Errorf("Expected true, got: %v", v) } }) t.Run("IntPtr", func(t *testing.T) { v := IntPtr(0) if v == nil || *v != 0 { t.Errorf("Expected 0, got: %v", v) } }) }
Simplify tests for API helpers
Simplify tests for API helpers
Go
apache-2.0
elastic/go-elasticsearch,elastic/go-elasticsearch,elastic/go-elasticsearch,elastic/go-elasticsearch
go
## Code Before: // +build !integration package esapi import ( "testing" ) func TestAPIHelpers(t *testing.T) { t.Run("BoolPtr", func(t *testing.T) { var v *bool v = BoolPtr(false) if v == nil || *v != false { t.Errorf("Expected false, got: %v", v) } v = BoolPtr(true) if v == nil || *v != true { t.Errorf("Expected true, got: %v", v) } }) t.Run("IntPtr", func(t *testing.T) { var v *int v = IntPtr(0) if v == nil || *v != 0 { t.Errorf("Expected 0, got: %v", v) } }) } ## Instruction: Simplify tests for API helpers ## Code After: // +build !integration package esapi import ( "testing" ) func TestAPIHelpers(t *testing.T) { t.Run("BoolPtr", func(t *testing.T) { v := BoolPtr(false) if v == nil || *v != false { t.Errorf("Expected false, got: %v", v) } v = BoolPtr(true) if v == nil || *v != true { t.Errorf("Expected true, got: %v", v) } }) t.Run("IntPtr", func(t *testing.T) { v := IntPtr(0) if v == nil || *v != 0 { t.Errorf("Expected 0, got: %v", v) } }) }
b6c8c4c49aa05e66504efbae37a2838ddf046564
public_records_portal/static/js/all_requests.js
public_records_portal/static/js/all_requests.js
$(document).ready(function(){ Modernizr.load({ test: Modernizr.inputtypes.date, nope: ['http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js', 'jquery-ui.css'], complete: function () { $('input[type=date]').datepicker({ dateFormat: 'yy-mm-dd' }); } }); });
$(document).ready(function(){ Modernizr.load({ test: Modernizr.inputtypes.date, nope: ['http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js','http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/base/jquery-ui.css'], complete: function () { $('input[type=date]').datepicker({ dateFormat: 'yy-mm-dd' }); } }); });
Update to use correct jquery-ui.css file
Update to use correct jquery-ui.css file
JavaScript
apache-2.0
CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords
javascript
## Code Before: $(document).ready(function(){ Modernizr.load({ test: Modernizr.inputtypes.date, nope: ['http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js', 'jquery-ui.css'], complete: function () { $('input[type=date]').datepicker({ dateFormat: 'yy-mm-dd' }); } }); }); ## Instruction: Update to use correct jquery-ui.css file ## Code After: $(document).ready(function(){ Modernizr.load({ test: Modernizr.inputtypes.date, nope: ['http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js','http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/themes/base/jquery-ui.css'], complete: function () { $('input[type=date]').datepicker({ dateFormat: 'yy-mm-dd' }); } }); });
9bad0d910ec5b50f947605f7e20fdb5d7e3d2d51
src/test/java/com/alanrusnak/api2048/engine/MoveExecutorTest.java
src/test/java/com/alanrusnak/api2048/engine/MoveExecutorTest.java
package com.alanrusnak.api2048.engine; import com.alanrusnak.api2048.engine.model.Tile; import org.junit.Assert; import org.junit.Test; public class MoveExecutorTest { MoveExecutor moveExecutor = new MoveExecutor(); @Test public void testSlideTile0Spaces(){ Tile[] row = row(0,0,0,2); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile1Spaces(){ Tile[] row = row(0,0,2,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile2Spaces(){ Tile[] row = row(0,2,0,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile3Spaces(){ Tile[] row = row(2,0,0,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } private Tile[] row(int t1, int t2, int t3, int t4){ return new Tile[]{new Tile(t1), new Tile(t2), new Tile(t3), new Tile(t4)}; } }
package com.alanrusnak.api2048.engine; import com.alanrusnak.api2048.engine.model.Tile; import org.junit.Assert; import org.junit.Test; public class MoveExecutorTest { MoveExecutor moveExecutor = new MoveExecutor(); @Test public void testSlideTile0Spaces(){ Tile[] row = row(0,0,0,2); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile1Spaces(){ Tile[] row = row(0,0,2,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile2Spaces(){ Tile[] row = row(0,2,0,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile3Spaces(){ Tile[] row = row(2,0,0,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTileWithSpaceTaken(){ Tile[] row = row(2,0,0,4); moveExecutor.slideRight(row); Assert.assertEquals(2, row[2].getValue()); } @Test public void testMergeTwoTiles(){ Tile[] row = row(2,0,0,2); moveExecutor.slideRight(row); Assert.assertEquals(4, row[3].getValue()); } private Tile[] row(int t1, int t2, int t3, int t4){ return new Tile[]{new Tile(t1), new Tile(t2), new Tile(t3), new Tile(t4)}; } }
Add a new non passing test case for merging
Add a new non passing test case for merging
Java
mit
alanrusnak/2048-web-api,alanrusnak/2048-web-api,alanrusnak/2048-web-api
java
## Code Before: package com.alanrusnak.api2048.engine; import com.alanrusnak.api2048.engine.model.Tile; import org.junit.Assert; import org.junit.Test; public class MoveExecutorTest { MoveExecutor moveExecutor = new MoveExecutor(); @Test public void testSlideTile0Spaces(){ Tile[] row = row(0,0,0,2); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile1Spaces(){ Tile[] row = row(0,0,2,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile2Spaces(){ Tile[] row = row(0,2,0,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile3Spaces(){ Tile[] row = row(2,0,0,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } private Tile[] row(int t1, int t2, int t3, int t4){ return new Tile[]{new Tile(t1), new Tile(t2), new Tile(t3), new Tile(t4)}; } } ## Instruction: Add a new non passing test case for merging ## Code After: package com.alanrusnak.api2048.engine; import com.alanrusnak.api2048.engine.model.Tile; import org.junit.Assert; import org.junit.Test; public class MoveExecutorTest { MoveExecutor moveExecutor = new MoveExecutor(); @Test public void testSlideTile0Spaces(){ Tile[] row = row(0,0,0,2); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile1Spaces(){ Tile[] row = row(0,0,2,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile2Spaces(){ Tile[] row = row(0,2,0,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTile3Spaces(){ Tile[] row = row(2,0,0,0); moveExecutor.slideRight(row); Assert.assertEquals(2, row[3].getValue()); } @Test public void testSlideTileWithSpaceTaken(){ Tile[] row = row(2,0,0,4); moveExecutor.slideRight(row); Assert.assertEquals(2, row[2].getValue()); } @Test public void testMergeTwoTiles(){ Tile[] row = row(2,0,0,2); moveExecutor.slideRight(row); Assert.assertEquals(4, row[3].getValue()); } private Tile[] row(int t1, int t2, int t3, int t4){ return new Tile[]{new Tile(t1), new Tile(t2), new Tile(t3), new Tile(t4)}; } }
d00e9cdaca698f84157d18b30d21468bd38f5da7
lib/faker/role.rb
lib/faker/role.rb
require 'faker' module Faker class Role < Base class << self def name fetch('role.name') end def by_index i all_values.fetch(i) { require 'pry'; binding.pry } end private def all_values @values ||= translate('faker.role.name') end end end end
require 'faker' module Faker class Role < Base class << self def name fetch('role.name') end def by_index i all_values.fetch(i) { raise NotEnoughRoles, "You only have #{i} roles defined, and you tried to access number #{i+1}!" } end private def all_values @values ||= translate('faker.role.name') end end end class NotEnoughRoles < StandardError; end end
Remove random pry in Faker::Role
Remove random pry in Faker::Role
Ruby
mit
ministryofjustice/defence-request-service-auth,ministryofjustice/defence-request-service-auth,ministryofjustice/ds-auth,ministryofjustice/ds-auth,ministryofjustice/defence-request-service-auth,ministryofjustice/defence-request-service-auth,ministryofjustice/ds-auth,ministryofjustice/ds-auth
ruby
## Code Before: require 'faker' module Faker class Role < Base class << self def name fetch('role.name') end def by_index i all_values.fetch(i) { require 'pry'; binding.pry } end private def all_values @values ||= translate('faker.role.name') end end end end ## Instruction: Remove random pry in Faker::Role ## Code After: require 'faker' module Faker class Role < Base class << self def name fetch('role.name') end def by_index i all_values.fetch(i) { raise NotEnoughRoles, "You only have #{i} roles defined, and you tried to access number #{i+1}!" } end private def all_values @values ||= translate('faker.role.name') end end end class NotEnoughRoles < StandardError; end end
cb4aa6bd6e5e922a526bec712c33fd9c3268d272
bs-config.js
bs-config.js
const Bibi = require('./bibi.info.js'); module.exports = { port: 61671, ui: { port: 61672 }, server: { baseDir: Bibi.DIST, index: 'index.html' }, files: [ 'bibi/**' ], startPath: 'bibi/?book=', snippetOptions: { whitelist: [ 'bibi/*', 'bibi/**/', 'bibi/*[?]*/**' ], blacklist: [ '**' ] }, ghostMode: false };
const Bibi = require('./bibi.info.js'); module.exports = { port: 61671, ui: { port: 61672 }, server: { baseDir: Bibi.DIST, index: 'index.html' }, startPath: 'bibi/?book=', ghostMode: false };
Simplify BrowserSync setting (because HTMLs become not to be loaded via src attribute of iframes).
Simplify BrowserSync setting (because HTMLs become not to be loaded via src attribute of iframes).
JavaScript
mit
satorumurmur/bibi,satorumurmur/bibi
javascript
## Code Before: const Bibi = require('./bibi.info.js'); module.exports = { port: 61671, ui: { port: 61672 }, server: { baseDir: Bibi.DIST, index: 'index.html' }, files: [ 'bibi/**' ], startPath: 'bibi/?book=', snippetOptions: { whitelist: [ 'bibi/*', 'bibi/**/', 'bibi/*[?]*/**' ], blacklist: [ '**' ] }, ghostMode: false }; ## Instruction: Simplify BrowserSync setting (because HTMLs become not to be loaded via src attribute of iframes). ## Code After: const Bibi = require('./bibi.info.js'); module.exports = { port: 61671, ui: { port: 61672 }, server: { baseDir: Bibi.DIST, index: 'index.html' }, startPath: 'bibi/?book=', ghostMode: false };
5f065cd0055d653b4768c5d1db3b194342294dc3
log4j.cfg
log4j.cfg
log4j.rootLogger=debug, console, R, S2 log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.target=System.err log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-19l %-5p - %m%n log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=all.log log4j.appender.R.MaxFileSize=100KB # Keep one backup file log4j.appender.R.MaxBackupIndex=1 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-19l %-5p - %m%n log4j.appender.S2=org.apache.log4j.FileAppender log4j.appender.S2.File=my_log.xml log4j.appender.S2.MaxFileSize=100MB log4j.appender.S2.MaxBackupIndex=10 log4j.appender.S2.layout=org.apache.log4j.xml.XMLLayout log4j.appender.S2.append=false
log4j.rootLogger=TRACE, console, XML log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.target=System.err log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-19l %-5p - %m%n log4j.appender.XML=org.apache.log4j.DailyRollingFileAppender log4j.appender.XML.DatePattern='.'yyyy-MM-dd'.log' log4j.appender.XML.File=soundpatty.xml log4j.appender.XML.MaxFileSize=100MB log4j.appender.XML.MaxBackupIndex=10 log4j.appender.XML.layout=org.apache.log4j.xml.XMLLayout log4j.appender.XML.append=false
Add XML logger (so can view it with Chainsaw)
Add XML logger (so can view it with Chainsaw)
INI
mit
Motiejus/SoundPatty,Motiejus/SoundPatty,zyzyis/SoundPatty,zyzyis/SoundPatty,zyzyis/SoundPatty,Motiejus/SoundPatty
ini
## Code Before: log4j.rootLogger=debug, console, R, S2 log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.target=System.err log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-19l %-5p - %m%n log4j.appender.R=org.apache.log4j.RollingFileAppender log4j.appender.R.File=all.log log4j.appender.R.MaxFileSize=100KB # Keep one backup file log4j.appender.R.MaxBackupIndex=1 log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-19l %-5p - %m%n log4j.appender.S2=org.apache.log4j.FileAppender log4j.appender.S2.File=my_log.xml log4j.appender.S2.MaxFileSize=100MB log4j.appender.S2.MaxBackupIndex=10 log4j.appender.S2.layout=org.apache.log4j.xml.XMLLayout log4j.appender.S2.append=false ## Instruction: Add XML logger (so can view it with Chainsaw) ## Code After: log4j.rootLogger=TRACE, console, XML log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.target=System.err log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%t] %-19l %-5p - %m%n log4j.appender.XML=org.apache.log4j.DailyRollingFileAppender log4j.appender.XML.DatePattern='.'yyyy-MM-dd'.log' log4j.appender.XML.File=soundpatty.xml log4j.appender.XML.MaxFileSize=100MB log4j.appender.XML.MaxBackupIndex=10 log4j.appender.XML.layout=org.apache.log4j.xml.XMLLayout log4j.appender.XML.append=false
1cef63ff7984a5d32e1719b4abcb2f3fb502ba1e
src/Types.ts
src/Types.ts
import { IncomingMessage } from 'http'; import { Buffer } from 'buffer'; /** * Simple utility Hash array type */ export type ObjectMap<T> = {[key: string]: T}; /** * A Valid HTTP operation */ export type HttpVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'PATCH'; /** * Enumaration of valid HTTP verbs. */ export const HttpVerbs: ObjectMap<HttpVerb> = { GET: 'GET', POST: 'POST', PUT: 'PUT', DELETE: 'DELETE', OPTIONS: 'OPTIONS', PATCH: 'PATCH' }; /** * An HTTP Request response containing both the response's message information and the response's body. * * Used by `ProxyHandler`. * @type {IncomingMessage} */ export interface ProxyResponse { message: IncomingMessage, body: string | Buffer } /** * Accessible types for a CORS Policy Access-Control headers. */ export type CorsAccessControlValue<T> = T[]|'*'|undefined;
import { IncomingMessage } from 'http'; import { Buffer } from 'buffer'; /** * Simple utility Hash array type */ export type ObjectMap<T> = {[key: string]: T}; /** * A Valid HTTP operation */ export type HttpVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'PATCH'; /** * Enumaration of valid HTTP verbs. */ export const HttpVerbs = Object.freeze({ GET: 'GET', POST: 'POST', PUT: 'PUT', DELETE: 'DELETE', OPTIONS: 'OPTIONS', PATCH: 'PATCH' }); /** * An HTTP Request response containing both the response's message information and the response's body. * * Used by `ProxyHandler`. * @type {IncomingMessage} */ export interface ProxyResponse { message: IncomingMessage, body: string | Buffer } /** * Accessible types for a CORS Policy Access-Control headers. */ export type CorsAccessControlValue<T> = T[]|'*'|undefined;
Update the HttpVerbs enum so intel sense will work with it.
Update the HttpVerbs enum so intel sense will work with it.
TypeScript
mit
syrp-nz/ts-lambda-handler,syrp-nz/ts-lambda-handler
typescript
## Code Before: import { IncomingMessage } from 'http'; import { Buffer } from 'buffer'; /** * Simple utility Hash array type */ export type ObjectMap<T> = {[key: string]: T}; /** * A Valid HTTP operation */ export type HttpVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'PATCH'; /** * Enumaration of valid HTTP verbs. */ export const HttpVerbs: ObjectMap<HttpVerb> = { GET: 'GET', POST: 'POST', PUT: 'PUT', DELETE: 'DELETE', OPTIONS: 'OPTIONS', PATCH: 'PATCH' }; /** * An HTTP Request response containing both the response's message information and the response's body. * * Used by `ProxyHandler`. * @type {IncomingMessage} */ export interface ProxyResponse { message: IncomingMessage, body: string | Buffer } /** * Accessible types for a CORS Policy Access-Control headers. */ export type CorsAccessControlValue<T> = T[]|'*'|undefined; ## Instruction: Update the HttpVerbs enum so intel sense will work with it. ## Code After: import { IncomingMessage } from 'http'; import { Buffer } from 'buffer'; /** * Simple utility Hash array type */ export type ObjectMap<T> = {[key: string]: T}; /** * A Valid HTTP operation */ export type HttpVerb = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS' | 'PATCH'; /** * Enumaration of valid HTTP verbs. */ export const HttpVerbs = Object.freeze({ GET: 'GET', POST: 'POST', PUT: 'PUT', DELETE: 'DELETE', OPTIONS: 'OPTIONS', PATCH: 'PATCH' }); /** * An HTTP Request response containing both the response's message information and the response's body. * * Used by `ProxyHandler`. * @type {IncomingMessage} */ export interface ProxyResponse { message: IncomingMessage, body: string | Buffer } /** * Accessible types for a CORS Policy Access-Control headers. */ export type CorsAccessControlValue<T> = T[]|'*'|undefined;
58402c888eafbbf7b95d533796cd612555aa820d
README.md
README.md
Make webapp components that are easy to write, test, reuse, and scale. Think of it as [The Elm Architecture][arch] (TEA) as a library. [arch]: https://github.com/evancz/elm-architecture-tutorial/
Create infinitely nestable components that are easy to write, test, and reuse.
Update readme for new repo name
Update readme for new repo name
Markdown
bsd-3-clause
purcell/elm-effects,evancz/elm-effects,rtfeldman/elm-effects
markdown
## Code Before: Make webapp components that are easy to write, test, reuse, and scale. Think of it as [The Elm Architecture][arch] (TEA) as a library. [arch]: https://github.com/evancz/elm-architecture-tutorial/ ## Instruction: Update readme for new repo name ## Code After: Create infinitely nestable components that are easy to write, test, and reuse.
cc045ac777181deee31b53ef6e7af15948149a2f
index.js
index.js
var fs = require('fs'); var minify = require('node-json-minify'); var argv = require('minimist')(process.argv.slice(2)); var jsesc = require('jsesc'); var elasticsearch = require('elasticsearch'); var esHost = argv.esHost || 'localhost'; var esPort = argv.esPort || '9200'; if (!argv.dashboard) { console.log('You must specify a file containing the dashboard json with --dashboard.'); process.exit(1); } var es = new elasticsearch.Client({ host: esHost + ':' + esPort, log: 'trace' }); var dashboard = minify(fs.readFileSync(argv.dashboard).toString()); console.log(jsesc(dashboard, {'quotes': 'double'}));
var fs = require('fs'); var minify = require('node-json-minify'); var argv = require('minimist')(process.argv.slice(2)); var jsesc = require('jsesc'); var elasticsearch = require('elasticsearch'); var esHost = argv.esHost || 'localhost'; var esPort = argv.esPort || '9200'; if (!argv.dashboard) { console.log('You must specify a file containing the dashboard json with --dashboard.'); process.exit(1); } var es = new elasticsearch.Client({ host: esHost + ':' + esPort, log: 'trace' }); try { var dashboard = JSON.parse(fs.readFileSync(argv.dashboard).toString()); } catch(e) { console.log('File specified with --dashboard is not valid JSON'); process.exit(1); } es.update({ index: 'grafana-dash', type: 'dashboard', id: dashboard.name, doc: { dashboard: jsesc(minify(JSON.stringify(dashboard.dashboard)), {'quotes': 'double'}) } }, function(err, res) { console.dir(err); console.dir(res); });
Add support for adding dashboard to elastic search
Add support for adding dashboard to elastic search
JavaScript
mit
jirwin/grapr
javascript
## Code Before: var fs = require('fs'); var minify = require('node-json-minify'); var argv = require('minimist')(process.argv.slice(2)); var jsesc = require('jsesc'); var elasticsearch = require('elasticsearch'); var esHost = argv.esHost || 'localhost'; var esPort = argv.esPort || '9200'; if (!argv.dashboard) { console.log('You must specify a file containing the dashboard json with --dashboard.'); process.exit(1); } var es = new elasticsearch.Client({ host: esHost + ':' + esPort, log: 'trace' }); var dashboard = minify(fs.readFileSync(argv.dashboard).toString()); console.log(jsesc(dashboard, {'quotes': 'double'})); ## Instruction: Add support for adding dashboard to elastic search ## Code After: var fs = require('fs'); var minify = require('node-json-minify'); var argv = require('minimist')(process.argv.slice(2)); var jsesc = require('jsesc'); var elasticsearch = require('elasticsearch'); var esHost = argv.esHost || 'localhost'; var esPort = argv.esPort || '9200'; if (!argv.dashboard) { console.log('You must specify a file containing the dashboard json with --dashboard.'); process.exit(1); } var es = new elasticsearch.Client({ host: esHost + ':' + esPort, log: 'trace' }); try { var dashboard = JSON.parse(fs.readFileSync(argv.dashboard).toString()); } catch(e) { console.log('File specified with --dashboard is not valid JSON'); process.exit(1); } es.update({ index: 'grafana-dash', type: 'dashboard', id: dashboard.name, doc: { dashboard: jsesc(minify(JSON.stringify(dashboard.dashboard)), {'quotes': 'double'}) } }, function(err, res) { console.dir(err); console.dir(res); });
5b25b2ce8237a64f843daa8088a5b2eba0a30f1f
custom/gnome-terminal.zsh
custom/gnome-terminal.zsh
bindkey '\e[A' up-line-or-search bindkey '\e[B' down-line-or-search # Delete bindkey '[3~' delete-char # Home/End bindkey 'OH' beginning-of-line bindkey 'OF' end-of-line # Ctrl Left/Right (^[[1;5D & ^[[1;5C) bindkey '' backward-word bindkey '' forward-word
bindkey '\e[A' up-line-or-search bindkey '\e[B' down-line-or-search # Delete bindkey '[3~' delete-char # Home/End bindkey 'OH' beginning-of-line bindkey 'OF' end-of-line bindkey '[1~' beginning-of-line bindkey '[4~' end-of-line # Ctrl Left/Right (^[[1;5D & ^[[1;5C) bindkey '' backward-word bindkey '' forward-word bindkey 'OD' backward-word bindkey 'OC' forward-word
Add more bindings for home/end/ctrl-left/right
Add more bindings for home/end/ctrl-left/right
Shell
mit
jreese/oh-my-zsh,jreese/oh-my-zsh,jreese/oh-my-zsh
shell
## Code Before: bindkey '\e[A' up-line-or-search bindkey '\e[B' down-line-or-search # Delete bindkey '[3~' delete-char # Home/End bindkey 'OH' beginning-of-line bindkey 'OF' end-of-line # Ctrl Left/Right (^[[1;5D & ^[[1;5C) bindkey '' backward-word bindkey '' forward-word ## Instruction: Add more bindings for home/end/ctrl-left/right ## Code After: bindkey '\e[A' up-line-or-search bindkey '\e[B' down-line-or-search # Delete bindkey '[3~' delete-char # Home/End bindkey 'OH' beginning-of-line bindkey 'OF' end-of-line bindkey '[1~' beginning-of-line bindkey '[4~' end-of-line # Ctrl Left/Right (^[[1;5D & ^[[1;5C) bindkey '' backward-word bindkey '' forward-word bindkey 'OD' backward-word bindkey 'OC' forward-word
660fc35a1bb25e728ad86d2b0ce8d3af46645a99
base/apps/storage.py
base/apps/storage.py
import urlparse from django.conf import settings from ecstatic.storage import CachedStaticFilesMixin, StaticManifestMixin from s3_folder_storage.s3 import DefaultStorage, StaticStorage def domain(url): return urlparse.urlparse(url).hostname class MediaFilesStorage(DefaultStorage): def __init__(self, *args, **kwargs): kwargs['bucket'] = settings.AWS_STORAGE_BUCKET_NAME kwargs['custom_domain'] = domain(settings.MEDIA_URL) super(MediaFilesStorage, self).__init__(*args, **kwargs) class StaticFilesStorage(StaticStorage): def __init__(self, *args, **kwargs): kwargs['bucket'] = settings.AWS_STORAGE_BUCKET_NAME kwargs['custom_domain'] = domain(settings.STATIC_URL) super(StaticFilesStorage, self).__init__(*args, **kwargs) class S3ManifestStorage(StaticManifestMixin, CachedStaticFilesMixin, StaticFilesStorage): pass
import urlparse from django.conf import settings from django.contrib.staticfiles.storage import ManifestFilesMixin from s3_folder_storage.s3 import DefaultStorage, StaticStorage def domain(url): return urlparse.urlparse(url).hostname class MediaFilesStorage(DefaultStorage): def __init__(self, *args, **kwargs): kwargs['bucket'] = settings.AWS_STORAGE_BUCKET_NAME kwargs['custom_domain'] = domain(settings.MEDIA_URL) super(MediaFilesStorage, self).__init__(*args, **kwargs) class StaticFilesStorage(StaticStorage): def __init__(self, *args, **kwargs): kwargs['bucket'] = settings.AWS_STORAGE_BUCKET_NAME kwargs['custom_domain'] = domain(settings.STATIC_URL) super(StaticFilesStorage, self).__init__(*args, **kwargs) class S3ManifestStorage(ManifestFilesMixin, StaticFilesStorage): pass
Switch out django-ecstatic for ManifestFilesMixin.
Switch out django-ecstatic for ManifestFilesMixin.
Python
apache-2.0
hello-base/web,hello-base/web,hello-base/web,hello-base/web
python
## Code Before: import urlparse from django.conf import settings from ecstatic.storage import CachedStaticFilesMixin, StaticManifestMixin from s3_folder_storage.s3 import DefaultStorage, StaticStorage def domain(url): return urlparse.urlparse(url).hostname class MediaFilesStorage(DefaultStorage): def __init__(self, *args, **kwargs): kwargs['bucket'] = settings.AWS_STORAGE_BUCKET_NAME kwargs['custom_domain'] = domain(settings.MEDIA_URL) super(MediaFilesStorage, self).__init__(*args, **kwargs) class StaticFilesStorage(StaticStorage): def __init__(self, *args, **kwargs): kwargs['bucket'] = settings.AWS_STORAGE_BUCKET_NAME kwargs['custom_domain'] = domain(settings.STATIC_URL) super(StaticFilesStorage, self).__init__(*args, **kwargs) class S3ManifestStorage(StaticManifestMixin, CachedStaticFilesMixin, StaticFilesStorage): pass ## Instruction: Switch out django-ecstatic for ManifestFilesMixin. ## Code After: import urlparse from django.conf import settings from django.contrib.staticfiles.storage import ManifestFilesMixin from s3_folder_storage.s3 import DefaultStorage, StaticStorage def domain(url): return urlparse.urlparse(url).hostname class MediaFilesStorage(DefaultStorage): def __init__(self, *args, **kwargs): kwargs['bucket'] = settings.AWS_STORAGE_BUCKET_NAME kwargs['custom_domain'] = domain(settings.MEDIA_URL) super(MediaFilesStorage, self).__init__(*args, **kwargs) class StaticFilesStorage(StaticStorage): def __init__(self, *args, **kwargs): kwargs['bucket'] = settings.AWS_STORAGE_BUCKET_NAME kwargs['custom_domain'] = domain(settings.STATIC_URL) super(StaticFilesStorage, self).__init__(*args, **kwargs) class S3ManifestStorage(ManifestFilesMixin, StaticFilesStorage): pass
32ec079e8e0c96cb563d1d5f855fbc3448fa0c71
package.json
package.json
{ "name": "robits", "version": "0.0.1", "license": "MIT", "homepage": "https://github.com/Atlas-/robits", "contributors": [ { "name" : "Tim Nunamaker", "email" : "tim@timnunamaker.com", "url" : "http://github.com/tnunamak" }, { "name" : "Chris Pound", "url" : "http://github.com/Atlas-" }, { "name" : "Stephen Rugh", "url" : "http://github.com/sirugh" } ], "repository": { "type": "git", "url": "https://github.com/Atlas-/robits" }, "description": "robits, the game!", "dependencies": { "bower": "~1.3.5", "express": "~3.2.6", "socket.io": "~1.0.4", "underscore": "~1.6.0" }, "engines": { "node": "0.10.x" } }
{ "name": "robits", "version": "0.0.1", "license": "MIT", "homepage": "https://github.com/Atlas-/robits", "contributors": [ { "name": "Tim Nunamaker", "email": "tim@timnunamaker.com", "url": "http://github.com/tnunamak" }, { "name": "Chris Pound", "url": "http://github.com/Atlas-" }, { "name": "Stephen Rugh", "url": "http://github.com/sirugh" } ], "repository": { "type": "git", "url": "https://github.com/Atlas-/robits" }, "description": "robits, the game!", "dependencies": { "bower": "~1.3.5", "express": "~3.2.6", "socket.io": "~1.0.4", "underscore": "~1.6.0" }, "engines": { "node": "0.10.x" }, "scripts": { "postinstall": "./node_modules/bower/bin/bower install" }, "devDependencies": { "bower": "~1.3.5" } }
Add bower install command to node post-install
Add bower install command to node post-install
JSON
mit
Atlas-/robits,sirchip/robits
json
## Code Before: { "name": "robits", "version": "0.0.1", "license": "MIT", "homepage": "https://github.com/Atlas-/robits", "contributors": [ { "name" : "Tim Nunamaker", "email" : "tim@timnunamaker.com", "url" : "http://github.com/tnunamak" }, { "name" : "Chris Pound", "url" : "http://github.com/Atlas-" }, { "name" : "Stephen Rugh", "url" : "http://github.com/sirugh" } ], "repository": { "type": "git", "url": "https://github.com/Atlas-/robits" }, "description": "robits, the game!", "dependencies": { "bower": "~1.3.5", "express": "~3.2.6", "socket.io": "~1.0.4", "underscore": "~1.6.0" }, "engines": { "node": "0.10.x" } } ## Instruction: Add bower install command to node post-install ## Code After: { "name": "robits", "version": "0.0.1", "license": "MIT", "homepage": "https://github.com/Atlas-/robits", "contributors": [ { "name": "Tim Nunamaker", "email": "tim@timnunamaker.com", "url": "http://github.com/tnunamak" }, { "name": "Chris Pound", "url": "http://github.com/Atlas-" }, { "name": "Stephen Rugh", "url": "http://github.com/sirugh" } ], "repository": { "type": "git", "url": "https://github.com/Atlas-/robits" }, "description": "robits, the game!", "dependencies": { "bower": "~1.3.5", "express": "~3.2.6", "socket.io": "~1.0.4", "underscore": "~1.6.0" }, "engines": { "node": "0.10.x" }, "scripts": { "postinstall": "./node_modules/bower/bin/bower install" }, "devDependencies": { "bower": "~1.3.5" } }
f608337efe5c42400d4c7e6215051da91940c1ed
src/test/java/examples/helloworld/HelloWorldExample.java
src/test/java/examples/helloworld/HelloWorldExample.java
package examples.helloworld; import com.vtence.molecule.WebServer; import java.io.IOException; public class HelloWorldExample { public void run(WebServer server) throws IOException { server.start((request, response) -> response.done("Hello, World!")); } public static void main(String[] args) throws IOException { HelloWorldExample example = new HelloWorldExample(); // Run the default web server WebServer webServer = WebServer.create(); example.run(webServer); System.out.println("Access at " + webServer.uri()); } }
package examples.helloworld; import com.vtence.molecule.WebServer; import java.io.IOException; /** * In this example, we run a single application that responds <i>Hello, World!</i> to all incoming requests. * This is as simple as it can get. */ public class HelloWorldExample { public void run(WebServer server) throws IOException { // Start the default web server and provide a single application, which // responds to all incoming requests. server.start((request, response) -> response.done("Hello, World!")); } public static void main(String[] args) throws IOException { HelloWorldExample example = new HelloWorldExample(); // Run the default web server WebServer webServer = WebServer.create(); example.run(webServer); System.out.println("Access at " + webServer.uri()); } }
Add inline doc for the helloworld example
Add inline doc for the helloworld example
Java
mit
testinfected/molecule,testinfected/molecule,testinfected/molecule,testinfected/molecule,testinfected/molecule
java
## Code Before: package examples.helloworld; import com.vtence.molecule.WebServer; import java.io.IOException; public class HelloWorldExample { public void run(WebServer server) throws IOException { server.start((request, response) -> response.done("Hello, World!")); } public static void main(String[] args) throws IOException { HelloWorldExample example = new HelloWorldExample(); // Run the default web server WebServer webServer = WebServer.create(); example.run(webServer); System.out.println("Access at " + webServer.uri()); } } ## Instruction: Add inline doc for the helloworld example ## Code After: package examples.helloworld; import com.vtence.molecule.WebServer; import java.io.IOException; /** * In this example, we run a single application that responds <i>Hello, World!</i> to all incoming requests. * This is as simple as it can get. */ public class HelloWorldExample { public void run(WebServer server) throws IOException { // Start the default web server and provide a single application, which // responds to all incoming requests. server.start((request, response) -> response.done("Hello, World!")); } public static void main(String[] args) throws IOException { HelloWorldExample example = new HelloWorldExample(); // Run the default web server WebServer webServer = WebServer.create(); example.run(webServer); System.out.println("Access at " + webServer.uri()); } }
7db8845cf38bea20a3330e70c8e205e056a4940c
src/CmsBundle/Security/ContentVoter.php
src/CmsBundle/Security/ContentVoter.php
<?php namespace Opifer\CmsBundle\Security; use Opifer\CmsBundle\Entity\User; use Opifer\ContentBundle\Model\Content; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; use Symfony\Component\Security\Core\Security; class ContentVoter extends Voter { private $security; private $container; private $roles; public function __construct(Security $security, ContainerInterface $container, $roles) { $this->security = $security; $this->container= $container; $this->roles = $roles; } protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { $user = $token->getUser(); if (!$user instanceof User) { // the user must be logged in; if not, deny access return false; } foreach($user->getRoles() as $role) { if (in_array($role, $subject->getRoles())) { return true; } } return false; } protected function supports($attribute, $subject) { return ($subject instanceof Content); } }
<?php namespace Opifer\CmsBundle\Security; use Opifer\CmsBundle\Entity\Content; use Opifer\CmsBundle\Entity\User; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; use Symfony\Component\Security\Core\Security; class ContentVoter extends Voter { private $security; private $container; private $roles; public function __construct(Security $security, ContainerInterface $container, $roles) { $this->security = $security; $this->container= $container; $this->roles = $roles; } protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { // ROLE_SUPER_ADMIN can access all content items if ($this->security->isGranted('ROLE_SUPER_ADMIN')) { return true; } $user = $token->getUser(); if (!$user instanceof User) { // the user must be logged in; if not, deny access return false; } foreach($user->getRoles() as $role) { if (in_array($role, $subject->getRoles())) { return true; } } return false; } protected function supports($attribute, $subject) { return ($subject instanceof Content); } }
Allow super admins to see/edit all content items
Allow super admins to see/edit all content items
PHP
mit
Opifer/Cms,Opifer/Cms,Opifer/Cms
php
## Code Before: <?php namespace Opifer\CmsBundle\Security; use Opifer\CmsBundle\Entity\User; use Opifer\ContentBundle\Model\Content; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; use Symfony\Component\Security\Core\Security; class ContentVoter extends Voter { private $security; private $container; private $roles; public function __construct(Security $security, ContainerInterface $container, $roles) { $this->security = $security; $this->container= $container; $this->roles = $roles; } protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { $user = $token->getUser(); if (!$user instanceof User) { // the user must be logged in; if not, deny access return false; } foreach($user->getRoles() as $role) { if (in_array($role, $subject->getRoles())) { return true; } } return false; } protected function supports($attribute, $subject) { return ($subject instanceof Content); } } ## Instruction: Allow super admins to see/edit all content items ## Code After: <?php namespace Opifer\CmsBundle\Security; use Opifer\CmsBundle\Entity\Content; use Opifer\CmsBundle\Entity\User; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\Voter; use Symfony\Component\Security\Core\Security; class ContentVoter extends Voter { private $security; private $container; private $roles; public function __construct(Security $security, ContainerInterface $container, $roles) { $this->security = $security; $this->container= $container; $this->roles = $roles; } protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { // ROLE_SUPER_ADMIN can access all content items if ($this->security->isGranted('ROLE_SUPER_ADMIN')) { return true; } $user = $token->getUser(); if (!$user instanceof User) { // the user must be logged in; if not, deny access return false; } foreach($user->getRoles() as $role) { if (in_array($role, $subject->getRoles())) { return true; } } return false; } protected function supports($attribute, $subject) { return ($subject instanceof Content); } }
ef90bc439c82bfa1ce39a9cd14282eab6b651e21
app/components/rating-form/template.hbs
app/components/rating-form/template.hbs
{{#bs-form}} {{#each-in questions as |question parts|}} {{#bs-form-group}} <label>{{parts.question}}</label> {{#if (eq parts.type 'radio')}} {{#each-in parts.items as |item data|}} {{#if data.description}} <p>{{data.description}}</p> {{/if}} {{radio-group options=parts.scale labelTop=data.labelTop labels=data.labels value=data.value}} {{/each-in}} {{else if (eq parts.type 'select')}} {{select-input options=parts.scale value=parts.items.item1.value}} {{else if (eq parts.type 'radio-input')}} {{radio-group options=parts.scale value=parts.items.radio.value}} {{#if (eq parts.items.radio.value 'Yes')}} <p>{{parts.items.input.description}}</p> {{#input value=parts.input.value}}{{/input}} <br> {{/if}} {{else if (eq parts.type 'textarea')}} {{#textarea value=parts.input.value cols="100" rows="6"}}{{/textarea}} {{/if}} {{/bs-form-group}} {{/each-in}} <div class='btn btn-primary pull-right {{if (v-get this 'isInvalid') "disabled" "enabled"}}' {{action 'nextSection'}}>Continue</div> {{/bs-form}}
{{#bs-form}} {{#each-in questions as |question parts|}} {{#bs-form-group}} <label>{{parts.question}}</label> {{#if (eq parts.type 'radio')}} {{#each-in parts.items as |item data|}} {{#if data.description}} <p>{{data.description}}</p> {{/if}} {{radio-group options=parts.scale labelTop=data.labelTop labels=data.labels value=data.value}} {{/each-in}} {{else if (eq parts.type 'select')}} {{select-input options=parts.scale value=parts.items.item1.value}} {{else if (eq parts.type 'radio-input')}} {{radio-group options=parts.scale value=parts.items.radio.value}} {{#if (eq parts.items.radio.value 'Yes')}} <p>{{parts.items.input.description}}</p> {{#input value=parts.input.value}}{{/input}} <br> {{/if}} {{else if (eq parts.type 'textarea')}} {{#textarea value=parts.input.value cols="100" rows="6"}}{{/textarea}} {{/if}} {{/bs-form-group}} {{/each-in}} <div class='btn btn-primary pull-right {{if (v-get this 'isInvalid') "disabled" "enabled"}}' {{action 'nextSection'}}>Continue</div> {{progress-bar pageNumber=5}} {{/bs-form}}
Add progress-bar to last page
Add progress-bar to last page
Handlebars
apache-2.0
CenterForOpenScience/isp,samanehsan/isp,CenterForOpenScience/isp,samanehsan/isp,samanehsan/isp,CenterForOpenScience/isp
handlebars
## Code Before: {{#bs-form}} {{#each-in questions as |question parts|}} {{#bs-form-group}} <label>{{parts.question}}</label> {{#if (eq parts.type 'radio')}} {{#each-in parts.items as |item data|}} {{#if data.description}} <p>{{data.description}}</p> {{/if}} {{radio-group options=parts.scale labelTop=data.labelTop labels=data.labels value=data.value}} {{/each-in}} {{else if (eq parts.type 'select')}} {{select-input options=parts.scale value=parts.items.item1.value}} {{else if (eq parts.type 'radio-input')}} {{radio-group options=parts.scale value=parts.items.radio.value}} {{#if (eq parts.items.radio.value 'Yes')}} <p>{{parts.items.input.description}}</p> {{#input value=parts.input.value}}{{/input}} <br> {{/if}} {{else if (eq parts.type 'textarea')}} {{#textarea value=parts.input.value cols="100" rows="6"}}{{/textarea}} {{/if}} {{/bs-form-group}} {{/each-in}} <div class='btn btn-primary pull-right {{if (v-get this 'isInvalid') "disabled" "enabled"}}' {{action 'nextSection'}}>Continue</div> {{/bs-form}} ## Instruction: Add progress-bar to last page ## Code After: {{#bs-form}} {{#each-in questions as |question parts|}} {{#bs-form-group}} <label>{{parts.question}}</label> {{#if (eq parts.type 'radio')}} {{#each-in parts.items as |item data|}} {{#if data.description}} <p>{{data.description}}</p> {{/if}} {{radio-group options=parts.scale labelTop=data.labelTop labels=data.labels value=data.value}} {{/each-in}} {{else if (eq parts.type 'select')}} {{select-input options=parts.scale value=parts.items.item1.value}} {{else if (eq parts.type 'radio-input')}} {{radio-group options=parts.scale value=parts.items.radio.value}} {{#if (eq parts.items.radio.value 'Yes')}} <p>{{parts.items.input.description}}</p> {{#input value=parts.input.value}}{{/input}} <br> {{/if}} {{else if (eq parts.type 'textarea')}} {{#textarea value=parts.input.value cols="100" rows="6"}}{{/textarea}} {{/if}} {{/bs-form-group}} {{/each-in}} <div class='btn btn-primary pull-right {{if (v-get this 'isInvalid') "disabled" "enabled"}}' {{action 'nextSection'}}>Continue</div> {{progress-bar pageNumber=5}} {{/bs-form}}
9a3388d832b734b532f716e34336dc43b8a13edd
gulpfile.js
gulpfile.js
/* gulpfile.js =========== Each task has been broken out into its own file in build/tasks. Any file in that folder gets automatically required by the loop in ./gulp/index.js (required below). To add a new task, simply add a new task file to ./build/tasks. */ var gulp = require('gulp'), config = require('./gulp/config'); var Pack = require('./gulp'); Pack.dev(['lint', 'test']); gulp.task('default', ['dev']);
/* gulpfile.js =========== Each task has been broken out into its own file in build/tasks. Any file in that folder gets automatically required by the loop in ./gulp/index.js (required below). To add a new task, simply add a new task file to ./build/tasks. */ var gulp = require('gulp'), config = require('./gulp/config'); // Our project structure is slightly different as we are a Node module exclusively config.serverSource = ['lib/**/*.js']; config.clientSource = []; config.mochaTests = [ 'test/**/*.js', '!test/client/**/*.js', '!test/fixtures/**/*.js' ]; var Pack = require('./gulp'); Pack.dev(['lint', 'test']); gulp.task('default', ['dev']);
Update mocha tests to better support Zeus projects
Update mocha tests to better support Zeus projects
JavaScript
mit
walmartlabs/circus-handlebars,walmartlabs/circus-handlebars
javascript
## Code Before: /* gulpfile.js =========== Each task has been broken out into its own file in build/tasks. Any file in that folder gets automatically required by the loop in ./gulp/index.js (required below). To add a new task, simply add a new task file to ./build/tasks. */ var gulp = require('gulp'), config = require('./gulp/config'); var Pack = require('./gulp'); Pack.dev(['lint', 'test']); gulp.task('default', ['dev']); ## Instruction: Update mocha tests to better support Zeus projects ## Code After: /* gulpfile.js =========== Each task has been broken out into its own file in build/tasks. Any file in that folder gets automatically required by the loop in ./gulp/index.js (required below). To add a new task, simply add a new task file to ./build/tasks. */ var gulp = require('gulp'), config = require('./gulp/config'); // Our project structure is slightly different as we are a Node module exclusively config.serverSource = ['lib/**/*.js']; config.clientSource = []; config.mochaTests = [ 'test/**/*.js', '!test/client/**/*.js', '!test/fixtures/**/*.js' ]; var Pack = require('./gulp'); Pack.dev(['lint', 'test']); gulp.task('default', ['dev']);
0c4503e7e49686db265df9202817cb2597fdd733
spec/replication/util/schema_structure_spec.rb
spec/replication/util/schema_structure_spec.rb
describe "database schema" do it "is structured as expected" do ret = EvmDatabase.check_schema expect(ret).to be_nil, <<-EOS.gsub!(/^ +/, "") #{Rails.configuration.database_configuration[Rails.env]["database"]} is not structured as expected. #{ret} EOS end end
describe "database schema" do it "is structured as expected" do ret = EvmDatabase.check_schema expect(ret).to be_nil, <<-EOS.gsub!(/^ +/, "") #{Rails.configuration.database_configuration[Rails.env]["database"]} is not structured as expected. #{ret} Refer to http://talk.manageiq.org/t/new-schema-specs-for-new-replication/1404 for detail EOS end end
Add href to explain schema validation spec in error message
Add href to explain schema validation spec in error message
Ruby
apache-2.0
tzumainn/manageiq,KevinLoiseau/manageiq,gerikis/manageiq,aufi/manageiq,juliancheal/manageiq,ailisp/manageiq,mzazrivec/manageiq,mkanoor/manageiq,pkomanek/manageiq,jameswnl/manageiq,tinaafitz/manageiq,matobet/manageiq,romanblanco/manageiq,billfitzgerald0120/manageiq,jvlcek/manageiq,ailisp/manageiq,syncrou/manageiq,skateman/manageiq,NaNi-Z/manageiq,branic/manageiq,mkanoor/manageiq,agrare/manageiq,billfitzgerald0120/manageiq,andyvesel/manageiq,matobet/manageiq,d-m-u/manageiq,gerikis/manageiq,maas-ufcg/manageiq,branic/manageiq,mresti/manageiq,ailisp/manageiq,durandom/manageiq,branic/manageiq,NaNi-Z/manageiq,borod108/manageiq,KevinLoiseau/manageiq,lpichler/manageiq,hstastna/manageiq,tzumainn/manageiq,mresti/manageiq,gmcculloug/manageiq,syncrou/manageiq,jameswnl/manageiq,mzazrivec/manageiq,aufi/manageiq,gmcculloug/manageiq,ilackarms/manageiq,djberg96/manageiq,maas-ufcg/manageiq,jvlcek/manageiq,jrafanie/manageiq,romaintb/manageiq,gerikis/manageiq,borod108/manageiq,romanblanco/manageiq,fbladilo/manageiq,romaintb/manageiq,mfeifer/manageiq,mkanoor/manageiq,d-m-u/manageiq,romaintb/manageiq,maas-ufcg/manageiq,KevinLoiseau/manageiq,israel-hdez/manageiq,fbladilo/manageiq,NaNi-Z/manageiq,lpichler/manageiq,ilackarms/manageiq,jntullo/manageiq,NickLaMuro/manageiq,KevinLoiseau/manageiq,romaintb/manageiq,NaNi-Z/manageiq,jameswnl/manageiq,mzazrivec/manageiq,billfitzgerald0120/manageiq,djberg96/manageiq,mresti/manageiq,hstastna/manageiq,maas-ufcg/manageiq,jrafanie/manageiq,d-m-u/manageiq,agrare/manageiq,gmcculloug/manageiq,maas-ufcg/manageiq,andyvesel/manageiq,ManageIQ/manageiq,djberg96/manageiq,matobet/manageiq,jntullo/manageiq,syncrou/manageiq,josejulio/manageiq,KevinLoiseau/manageiq,ilackarms/manageiq,ailisp/manageiq,yaacov/manageiq,israel-hdez/manageiq,skateman/manageiq,jameswnl/manageiq,KevinLoiseau/manageiq,tzumainn/manageiq,jvlcek/manageiq,josejulio/manageiq,josejulio/manageiq,pkomanek/manageiq,syncrou/manageiq,NickLaMuro/manageiq,borod108/manageiq,mkanoor/manageiq,romaintb/manageiq,durandom/manageiq,jrafanie/manageiq,borod108/manageiq,jvlcek/manageiq,ManageIQ/manageiq,tinaafitz/manageiq,branic/manageiq,kbrock/manageiq,aufi/manageiq,andyvesel/manageiq,lpichler/manageiq,pkomanek/manageiq,romanblanco/manageiq,yaacov/manageiq,chessbyte/manageiq,mresti/manageiq,israel-hdez/manageiq,gerikis/manageiq,tzumainn/manageiq,agrare/manageiq,matobet/manageiq,juliancheal/manageiq,hstastna/manageiq,ManageIQ/manageiq,tinaafitz/manageiq,pkomanek/manageiq,yaacov/manageiq,romaintb/manageiq,ilackarms/manageiq,durandom/manageiq,ManageIQ/manageiq,agrare/manageiq,chessbyte/manageiq,kbrock/manageiq,andyvesel/manageiq,yaacov/manageiq,fbladilo/manageiq,maas-ufcg/manageiq,durandom/manageiq,tinaafitz/manageiq,romanblanco/manageiq,chessbyte/manageiq,kbrock/manageiq,skateman/manageiq,jntullo/manageiq,lpichler/manageiq,billfitzgerald0120/manageiq,fbladilo/manageiq,NickLaMuro/manageiq,mzazrivec/manageiq,juliancheal/manageiq,NickLaMuro/manageiq,d-m-u/manageiq,mfeifer/manageiq,chessbyte/manageiq,hstastna/manageiq,kbrock/manageiq,juliancheal/manageiq,djberg96/manageiq,mfeifer/manageiq,gmcculloug/manageiq,israel-hdez/manageiq,jntullo/manageiq,josejulio/manageiq,aufi/manageiq,mfeifer/manageiq,jrafanie/manageiq,skateman/manageiq
ruby
## Code Before: describe "database schema" do it "is structured as expected" do ret = EvmDatabase.check_schema expect(ret).to be_nil, <<-EOS.gsub!(/^ +/, "") #{Rails.configuration.database_configuration[Rails.env]["database"]} is not structured as expected. #{ret} EOS end end ## Instruction: Add href to explain schema validation spec in error message ## Code After: describe "database schema" do it "is structured as expected" do ret = EvmDatabase.check_schema expect(ret).to be_nil, <<-EOS.gsub!(/^ +/, "") #{Rails.configuration.database_configuration[Rails.env]["database"]} is not structured as expected. #{ret} Refer to http://talk.manageiq.org/t/new-schema-specs-for-new-replication/1404 for detail EOS end end
c1ac883c33a24bd709f1e17bcaa16fb0871ad5b5
api/admin/classes/addclass/matchExec.js
api/admin/classes/addclass/matchExec.js
(function () { var cogClass = function () {}; cogClass.prototype.exec = function (params, request, response) { var oops = this.utils.apiError; if (params.classid) { var db = this.sys.db; db.run('INSERT OR REPLACE INTO classes VALUES (?,?,?)',[params.classid,params.groupid,params.name],function(err){ if (err) {return oops(response,err,'classes/addclass(1)')}; sendClasses(); }) } else { var db = this.sys.db; db.run('INSERT INTO classes VALUES (NULL,?,?)',[params.groupid,params.name],function(err){ if (err) {return oops(response,err,'classes/addclass(2)')}; sendClasses(); }); } function sendClasses () { db.all('SELECT classID,classes.name,ruleGroupID,ruleGroups.name AS ruleGroupName FROM classes JOIN ruleGroups USING(ruleGroupID) ORDER BY classes.name;',function(err,rows){ if (err||!rows) {return oops(response,err,'classes/addclass(3)')}; response.writeHead(200, {'Content-Type': 'application/json'}); response.end(JSON.stringify(rows)); }); } } exports.cogClass = cogClass; })();
(function () { var cogClass = function () {}; cogClass.prototype.exec = function (params, request, response) { var oops = this.utils.apiError; var sys = this.sys; if (params.classid) { sys.db.run('INSERT OR REPLACE INTO classes VALUES (?,?,?)',[params.classid,params.groupid,params.name],function(err){ if (err) {return oops(response,err,'classes/addclass(1)')}; sendClasses(); }) } else { var db = this.sys.db; sys.db.run('INSERT INTO classes VALUES (NULL,?,?)',[params.groupid,params.name],function(err){ if (err) {return oops(response,err,'classes/addclass(2)')}; sys.membershipKeys[this.lastID] = {}; sendClasses(); }); } function sendClasses () { sys.db.all('SELECT classID,classes.name,ruleGroupID,ruleGroups.name AS ruleGroupName FROM classes JOIN ruleGroups USING(ruleGroupID) ORDER BY classes.name;',function(err,rows){ if (err||!rows) {return oops(response,err,'classes/addclass(3)')}; response.writeHead(200, {'Content-Type': 'application/json'}); response.end(JSON.stringify(rows)); }); } } exports.cogClass = cogClass; })();
Update memory object when adding a class
Update memory object when adding a class
JavaScript
agpl-3.0
fbennett/quizzer
javascript
## Code Before: (function () { var cogClass = function () {}; cogClass.prototype.exec = function (params, request, response) { var oops = this.utils.apiError; if (params.classid) { var db = this.sys.db; db.run('INSERT OR REPLACE INTO classes VALUES (?,?,?)',[params.classid,params.groupid,params.name],function(err){ if (err) {return oops(response,err,'classes/addclass(1)')}; sendClasses(); }) } else { var db = this.sys.db; db.run('INSERT INTO classes VALUES (NULL,?,?)',[params.groupid,params.name],function(err){ if (err) {return oops(response,err,'classes/addclass(2)')}; sendClasses(); }); } function sendClasses () { db.all('SELECT classID,classes.name,ruleGroupID,ruleGroups.name AS ruleGroupName FROM classes JOIN ruleGroups USING(ruleGroupID) ORDER BY classes.name;',function(err,rows){ if (err||!rows) {return oops(response,err,'classes/addclass(3)')}; response.writeHead(200, {'Content-Type': 'application/json'}); response.end(JSON.stringify(rows)); }); } } exports.cogClass = cogClass; })(); ## Instruction: Update memory object when adding a class ## Code After: (function () { var cogClass = function () {}; cogClass.prototype.exec = function (params, request, response) { var oops = this.utils.apiError; var sys = this.sys; if (params.classid) { sys.db.run('INSERT OR REPLACE INTO classes VALUES (?,?,?)',[params.classid,params.groupid,params.name],function(err){ if (err) {return oops(response,err,'classes/addclass(1)')}; sendClasses(); }) } else { var db = this.sys.db; sys.db.run('INSERT INTO classes VALUES (NULL,?,?)',[params.groupid,params.name],function(err){ if (err) {return oops(response,err,'classes/addclass(2)')}; sys.membershipKeys[this.lastID] = {}; sendClasses(); }); } function sendClasses () { sys.db.all('SELECT classID,classes.name,ruleGroupID,ruleGroups.name AS ruleGroupName FROM classes JOIN ruleGroups USING(ruleGroupID) ORDER BY classes.name;',function(err,rows){ if (err||!rows) {return oops(response,err,'classes/addclass(3)')}; response.writeHead(200, {'Content-Type': 'application/json'}); response.end(JSON.stringify(rows)); }); } } exports.cogClass = cogClass; })();
e60419b9d9470849f7cb30c5d731cef4bfc465a6
lib/optinnow_api/response/wrapper.rb
lib/optinnow_api/response/wrapper.rb
module OptINnow module Response class Wrapper attr_accessor :errors def initialize(resource_type, response) @status = response.status @resource_type = resource_type @success = (200..299).include? @status attrs = normalize_response_body(response.body) if (@success) if attrs.class == Array resources = Array.new attrs.each do |attribute| resources << OptINnow::Response::Object.new(attribute[resource_type]) end class_eval { attr_accessor resource_type.pluralize} instance_variable_set "@#{resource_type.pluralize}", resources else class_eval { attr_accessor resource_type} instance_variable_set "@#{resource_type}", OptINnow::Response::Object.new(attrs[resource_type]) end else normalize_error_messages(attrs) end end def success? @success end private def normalize_response_body(body) if body.present? begin attrs = JSON.parse(body) rescue attrs = {} attrs['optinnow'] = body end else attrs = {} end attrs end def normalize_error_messages(attrs) self.errors = {} if @status == 404 self.errors[@resource_type] = 'not found' elsif @status == 500 self.errors['optinnow'] = 'server error' else attrs.each do |key, value| self.errors[key] = value end end end end end end
module OptINnow module Response class Wrapper attr_reader :errors, :status, :resource_type def initialize(resource_type, response) @status = response.status @resource_type = resource_type @success = (200..299).include? @status attrs = normalize_response_body(response.body) if (@success) if attrs.class == Array resources = Array.new attrs.each do |attribute| resources << OptINnow::Response::Object.new(attribute[resource_type]) end class_eval { attr_accessor resource_type.pluralize} instance_variable_set "@#{resource_type.pluralize}", resources else class_eval { attr_accessor resource_type} instance_variable_set "@#{resource_type}", OptINnow::Response::Object.new(attrs[resource_type]) end else normalize_error_messages(attrs) end end def success? @success end private def normalize_response_body(body) if body.present? begin attrs = JSON.parse(body) rescue attrs = {} attrs['optinnow'] = body end else attrs = {} end attrs end def normalize_error_messages(attrs) @errors = {} if @status == 404 @errors[@resource_type] = 'not found' elsif @status == 500 @errors['optinnow'] = 'server error' else attrs.each do |key, value| @errors[key] = value end end end end end end
Make status and resource type available as class methods
Make status and resource type available as class methods Also using attr_reader, as there’s no need for clients to update these attributes
Ruby
mit
OpportunityIntl/optinnow_api
ruby
## Code Before: module OptINnow module Response class Wrapper attr_accessor :errors def initialize(resource_type, response) @status = response.status @resource_type = resource_type @success = (200..299).include? @status attrs = normalize_response_body(response.body) if (@success) if attrs.class == Array resources = Array.new attrs.each do |attribute| resources << OptINnow::Response::Object.new(attribute[resource_type]) end class_eval { attr_accessor resource_type.pluralize} instance_variable_set "@#{resource_type.pluralize}", resources else class_eval { attr_accessor resource_type} instance_variable_set "@#{resource_type}", OptINnow::Response::Object.new(attrs[resource_type]) end else normalize_error_messages(attrs) end end def success? @success end private def normalize_response_body(body) if body.present? begin attrs = JSON.parse(body) rescue attrs = {} attrs['optinnow'] = body end else attrs = {} end attrs end def normalize_error_messages(attrs) self.errors = {} if @status == 404 self.errors[@resource_type] = 'not found' elsif @status == 500 self.errors['optinnow'] = 'server error' else attrs.each do |key, value| self.errors[key] = value end end end end end end ## Instruction: Make status and resource type available as class methods Also using attr_reader, as there’s no need for clients to update these attributes ## Code After: module OptINnow module Response class Wrapper attr_reader :errors, :status, :resource_type def initialize(resource_type, response) @status = response.status @resource_type = resource_type @success = (200..299).include? @status attrs = normalize_response_body(response.body) if (@success) if attrs.class == Array resources = Array.new attrs.each do |attribute| resources << OptINnow::Response::Object.new(attribute[resource_type]) end class_eval { attr_accessor resource_type.pluralize} instance_variable_set "@#{resource_type.pluralize}", resources else class_eval { attr_accessor resource_type} instance_variable_set "@#{resource_type}", OptINnow::Response::Object.new(attrs[resource_type]) end else normalize_error_messages(attrs) end end def success? @success end private def normalize_response_body(body) if body.present? begin attrs = JSON.parse(body) rescue attrs = {} attrs['optinnow'] = body end else attrs = {} end attrs end def normalize_error_messages(attrs) @errors = {} if @status == 404 @errors[@resource_type] = 'not found' elsif @status == 500 @errors['optinnow'] = 'server error' else attrs.each do |key, value| @errors[key] = value end end end end end end
ec95df14e483d820dc29464ba9339e4e22177f98
README.md
README.md
[![](https://travis-ci.org/SDG-data/SDGs.svg?branch=master)](https://travis-ci.org/SDG-data/SDGs) > To visualize this data, go to e.g. [this website](http://sdg-data.github.io/web/) which comes from the [website code repository](https://github.com/SDG-data/web) # SDGs Data for the Sustainable Development Goals. A machine readable format for the Goals and Indicators for the SDGs, becuase I could not find one. Sources are declared. If you have any update, please submit a Pull Request.
[![](https://travis-ci.org/SDG-data/SDGs.svg?branch=master)](https://travis-ci.org/SDG-data/SDGs) > To visualize this data, go to e.g. [this website](http://sdg-data.github.io/web/) which comes from the [website code repository](https://github.com/SDG-data/web) # SDGs Data for the Sustainable Development Goals. A machine readable format for the Goals and Indicators for the SDGs, becuase I could not find one. Sources are declared. If you have any update, please submit a Pull Request. ### How to use the data This is a quick example to load into a variable the data from another Github Pages, pulling directly from here ```js var version = "v0.05"; var dataurl = "https://raw.githubusercontent.com/SDG-data/SDGs/"+version+"/"; var sdgs = []; var files = ["goals","targets","indicators"]; function load_data(){ files.forEach(function (f) { console.log("Loading "+f); d3.json(dataurl+f+".json", function (error, data) { sdgs[data.meta.id]=data; }); }); call_your_main_function_that does_the_thing_you_want(); } ```
Add quick example to load data
Add quick example to load data
Markdown
mit
SDG-data/SDGs,SDG-data/SDGs
markdown
## Code Before: [![](https://travis-ci.org/SDG-data/SDGs.svg?branch=master)](https://travis-ci.org/SDG-data/SDGs) > To visualize this data, go to e.g. [this website](http://sdg-data.github.io/web/) which comes from the [website code repository](https://github.com/SDG-data/web) # SDGs Data for the Sustainable Development Goals. A machine readable format for the Goals and Indicators for the SDGs, becuase I could not find one. Sources are declared. If you have any update, please submit a Pull Request. ## Instruction: Add quick example to load data ## Code After: [![](https://travis-ci.org/SDG-data/SDGs.svg?branch=master)](https://travis-ci.org/SDG-data/SDGs) > To visualize this data, go to e.g. [this website](http://sdg-data.github.io/web/) which comes from the [website code repository](https://github.com/SDG-data/web) # SDGs Data for the Sustainable Development Goals. A machine readable format for the Goals and Indicators for the SDGs, becuase I could not find one. Sources are declared. If you have any update, please submit a Pull Request. ### How to use the data This is a quick example to load into a variable the data from another Github Pages, pulling directly from here ```js var version = "v0.05"; var dataurl = "https://raw.githubusercontent.com/SDG-data/SDGs/"+version+"/"; var sdgs = []; var files = ["goals","targets","indicators"]; function load_data(){ files.forEach(function (f) { console.log("Loading "+f); d3.json(dataurl+f+".json", function (error, data) { sdgs[data.meta.id]=data; }); }); call_your_main_function_that does_the_thing_you_want(); } ```
ab0dabe6936844ff57a35abb6d2c328961db4fea
src/components/Navigation/index.js
src/components/Navigation/index.js
import React from 'react'; import { Link } from 'react-router'; import { Nav, Navbar, NavItem } from 'react-bootstrap'; import { LinkContainer } from 'react-router-bootstrap'; const NAV_LINKS = { home: { link: '/home', title: 'Home' }, current: { link: '/current', title: 'Current' }, recent: { link: '/recent', title: 'Recent' }, history: { link: '/history', title: 'History' }, info: { link: '/info', title: 'Info' }, }; class Navigation extends React.Component { renderNavItem(linkName) { const link = NAV_LINKS[linkName]; return ( <LinkContainer to={ { pathname: link.link } } key={ linkName }> <NavItem className={ this.props.activePage === linkName ? 'active' : '' } > { link.title } </NavItem> </LinkContainer> ); } render() { const brand = <Link to="/" className="navbar-brand">Υπερίων</Link>; const links = Object.keys(NAV_LINKS).map((i) => this.renderNavItem(i)); return ( <Navbar staticTop componentClass="header" role="banner"> <Navbar.Header> <Navbar.Brand>{ brand }</Navbar.Brand> </Navbar.Header> <Nav> { links } </Nav> </Navbar> ); } } Navigation.propTypes = { activePage: React.PropTypes.string.isRequired, }; export default Navigation;
import React from 'react'; import { Link } from 'react-router'; import { Nav, Navbar, NavItem } from 'react-bootstrap'; import { LinkContainer } from 'react-router-bootstrap'; const MENU_ITEMS = [ { link: '/home', title: 'Home' }, { link: '/current', title: 'Current' }, { link: '/recent', title: 'Recent' }, { link: '/history', title: 'History' }, { link: '/info', title: 'Info' }, ]; const Navigation = function (props) { return ( <Navbar staticTop componentClass="header" role="banner"> <Navbar.Header> <Navbar.Brand> <Link to="/" className="navbar-brand">Υπερίων</Link> </Navbar.Brand> </Navbar.Header> <Nav> { MENU_ITEMS.map((item) => ( <LinkContainer to={ { pathname: item.link } } key={ item.title } > <NavItem className={ props.activePage === item.link ? 'active' : '' } > { item.title } </NavItem> </LinkContainer>)) } </Nav> </Navbar> ); }; Navigation.propTypes = { activePage: React.PropTypes.string.isRequired, }; export default Navigation;
Rewrite Navigation bar as a stateless function
Rewrite Navigation bar as a stateless function
JavaScript
mit
mthmulders/hyperion-web,mthmulders/hyperion-web,mthmulders/hyperion-web
javascript
## Code Before: import React from 'react'; import { Link } from 'react-router'; import { Nav, Navbar, NavItem } from 'react-bootstrap'; import { LinkContainer } from 'react-router-bootstrap'; const NAV_LINKS = { home: { link: '/home', title: 'Home' }, current: { link: '/current', title: 'Current' }, recent: { link: '/recent', title: 'Recent' }, history: { link: '/history', title: 'History' }, info: { link: '/info', title: 'Info' }, }; class Navigation extends React.Component { renderNavItem(linkName) { const link = NAV_LINKS[linkName]; return ( <LinkContainer to={ { pathname: link.link } } key={ linkName }> <NavItem className={ this.props.activePage === linkName ? 'active' : '' } > { link.title } </NavItem> </LinkContainer> ); } render() { const brand = <Link to="/" className="navbar-brand">Υπερίων</Link>; const links = Object.keys(NAV_LINKS).map((i) => this.renderNavItem(i)); return ( <Navbar staticTop componentClass="header" role="banner"> <Navbar.Header> <Navbar.Brand>{ brand }</Navbar.Brand> </Navbar.Header> <Nav> { links } </Nav> </Navbar> ); } } Navigation.propTypes = { activePage: React.PropTypes.string.isRequired, }; export default Navigation; ## Instruction: Rewrite Navigation bar as a stateless function ## Code After: import React from 'react'; import { Link } from 'react-router'; import { Nav, Navbar, NavItem } from 'react-bootstrap'; import { LinkContainer } from 'react-router-bootstrap'; const MENU_ITEMS = [ { link: '/home', title: 'Home' }, { link: '/current', title: 'Current' }, { link: '/recent', title: 'Recent' }, { link: '/history', title: 'History' }, { link: '/info', title: 'Info' }, ]; const Navigation = function (props) { return ( <Navbar staticTop componentClass="header" role="banner"> <Navbar.Header> <Navbar.Brand> <Link to="/" className="navbar-brand">Υπερίων</Link> </Navbar.Brand> </Navbar.Header> <Nav> { MENU_ITEMS.map((item) => ( <LinkContainer to={ { pathname: item.link } } key={ item.title } > <NavItem className={ props.activePage === item.link ? 'active' : '' } > { item.title } </NavItem> </LinkContainer>)) } </Nav> </Navbar> ); }; Navigation.propTypes = { activePage: React.PropTypes.string.isRequired, }; export default Navigation;
36a1d1c740474935d919e5ff3f7152682a34713a
tox.ini
tox.ini
[tox] envlist = py26, py27, pypy, py33 [testenv] deps = -rrequirements.txt commands = nosetests
[tox] envlist = py26, py27, pypy [testenv] deps = -rrequirements.txt commands = py.test
Drop py3 and switch to py.test
Drop py3 and switch to py.test
INI
mit
goldsborough/changes
ini
## Code Before: [tox] envlist = py26, py27, pypy, py33 [testenv] deps = -rrequirements.txt commands = nosetests ## Instruction: Drop py3 and switch to py.test ## Code After: [tox] envlist = py26, py27, pypy [testenv] deps = -rrequirements.txt commands = py.test
7d24a2fa85efa23ec63fa4e4c9ca46be2c5609f3
app/core/core_templates/media_select_view.html
app/core/core_templates/media_select_view.html
<script id="tpl-media-select-view" type="text/template"> <div class="media-select-view row"> <div class="col-sm-12 add-more"> <a href="">add more</a> </div> <div class="col-sm-12 media-input"> <div class="form-group"> <div class="input-group"> <input placeholder="add media" type="text" class="simple-tag-input form-control" autocomplete="off" size="50"/> <span class="input-group-btn"> <button class="add btn btn-default"><span class="glyphicon glyphicon-plus"></span></button> </span> <span class="input-group-btn"> <button class="explore btn btn-default"><span class="glyphicon glyphicon-search"></span></button> </span> </div> </div> </div> </div> </script>
<script id="tpl-media-select-view" type="text/template"> <div class="media-select-view row"> <div class="col-sm-12 add-more"> <a href="">add more</a> </div> <div class="col-sm-12 media-input"> <div class="form-group"> <div class="input-group"> <input placeholder="add media" type="text" class="simple-tag-input form-control" autocomplete="off" size="50"/> <span class="input-group-btn"> <button type="button" class="add btn btn-default"><span class="glyphicon glyphicon-plus"></span></button> </span> <span class="input-group-btn"> <button type="button" class="explore btn btn-default"><span class="glyphicon glyphicon-search"></span></button> </span> </div> </div> </div> </div> </script>
Make add-media button non-submit to fix query-on-enter bug.
Make add-media button non-submit to fix query-on-enter bug.
HTML
apache-2.0
c4fcm/MediaMeter-Dashboard,c4fcm/MediaMeter-Dashboard,c4fcm/MediaMeter-Skeleton,c4fcm/MediaMeter-Dashboard,c4fcm/MediaMeter-Skeleton,c4fcm/MediaMeter-Skeleton
html
## Code Before: <script id="tpl-media-select-view" type="text/template"> <div class="media-select-view row"> <div class="col-sm-12 add-more"> <a href="">add more</a> </div> <div class="col-sm-12 media-input"> <div class="form-group"> <div class="input-group"> <input placeholder="add media" type="text" class="simple-tag-input form-control" autocomplete="off" size="50"/> <span class="input-group-btn"> <button class="add btn btn-default"><span class="glyphicon glyphicon-plus"></span></button> </span> <span class="input-group-btn"> <button class="explore btn btn-default"><span class="glyphicon glyphicon-search"></span></button> </span> </div> </div> </div> </div> </script> ## Instruction: Make add-media button non-submit to fix query-on-enter bug. ## Code After: <script id="tpl-media-select-view" type="text/template"> <div class="media-select-view row"> <div class="col-sm-12 add-more"> <a href="">add more</a> </div> <div class="col-sm-12 media-input"> <div class="form-group"> <div class="input-group"> <input placeholder="add media" type="text" class="simple-tag-input form-control" autocomplete="off" size="50"/> <span class="input-group-btn"> <button type="button" class="add btn btn-default"><span class="glyphicon glyphicon-plus"></span></button> </span> <span class="input-group-btn"> <button type="button" class="explore btn btn-default"><span class="glyphicon glyphicon-search"></span></button> </span> </div> </div> </div> </div> </script>
43182d69124e89202ed74e1f750825d86fd48ad1
.travis.yml
.travis.yml
language: c sudo: require install: - sudo apt-get update - sudo apt-get install -y libgtk-3-dev - sudo apt-get install -y libwebkitgtk-dev - sudo apt-get install -y xvfb - sudo apt-get install -y metacity - sudo apt-get install -y x11-apps - sudo apt-get install -y imagemagick script: - make - ./test.sh
language: c sudo: require install: - sudo add-apt-repository -y ppa:webkit-team/ppa - sudo apt-get update - sudo apt-get install -y libgtk-3-dev - sudo apt-get install -y libwebkit2gtk-4.0-dev - sudo apt-get install -y xvfb - sudo apt-get install -y metacity - sudo apt-get install -y x11-apps - sudo apt-get install -y imagemagick script: - make - ./test.sh
Add webkit-team PPA for webkit2gtk package
Travis: Add webkit-team PPA for webkit2gtk package Idea from https://github.com/zserge/webview/issues/65
YAML
isc
anko/hudkit,anko/hudkit,anko/hudkit
yaml
## Code Before: language: c sudo: require install: - sudo apt-get update - sudo apt-get install -y libgtk-3-dev - sudo apt-get install -y libwebkitgtk-dev - sudo apt-get install -y xvfb - sudo apt-get install -y metacity - sudo apt-get install -y x11-apps - sudo apt-get install -y imagemagick script: - make - ./test.sh ## Instruction: Travis: Add webkit-team PPA for webkit2gtk package Idea from https://github.com/zserge/webview/issues/65 ## Code After: language: c sudo: require install: - sudo add-apt-repository -y ppa:webkit-team/ppa - sudo apt-get update - sudo apt-get install -y libgtk-3-dev - sudo apt-get install -y libwebkit2gtk-4.0-dev - sudo apt-get install -y xvfb - sudo apt-get install -y metacity - sudo apt-get install -y x11-apps - sudo apt-get install -y imagemagick script: - make - ./test.sh
f56ceeac8dc48ae8aef6ee94d7c5cb975d2a4510
index.js
index.js
'use strict' var EventEmitter = require('events').EventEmitter var dot = require('dot-prop') var Symbol = require('es6-symbol') var traverse = require('traverse') module.exports = EventsTree var EVENTS = Symbol('events') function EventsTree () { this.tree = {} } EventsTree.prototype.node = function node (path) { return path ? dot.get(this.tree, path) : this.tree } EventsTree.prototype.at = function at (path) { var node = this.node(path) if (!node) { node = {} dot.set(this.tree, path, node) } if (!node[EVENTS]) { node[EVENTS] = new EventEmitter() } return node[EVENTS] } EventsTree.prototype.below = function (path, callback) { if (typeof path === 'function') { callback = path path = '' } var node = this.node(path) if (!hasChildren(node)) return traverse(node).forEach(function eachNode (node) { var state = this var emitter = node[EVENTS] if (!emitter) return var fullPath = (path ? [path] : []).concat(state.path).join('.') callback(fullPath, emitter) }) } function hasChildren (node) { return node && !!Object.keys(node).length }
'use strict' var EventEmitter = require('events').EventEmitter var dot = require('dot-prop') var Symbol = require('es6-symbol') var traverse = require('traverse') module.exports = EventsTree var EVENTS = Symbol('events') function EventsTree () { this.tree = {} } EventsTree.prototype.node = function node (path) { return path ? dot.get(this.tree, path) : this.tree } EventsTree.prototype.at = function at (path) { var node = this.node(path) if (!node) { node = {} dot.set(this.tree, path, node) } if (!node[EVENTS]) { node[EVENTS] = new EventEmitter() } return node[EVENTS] } EventsTree.prototype.below = function (path, callback) { if (typeof path === 'function') { callback = path path = '' } var node = this.node(path) if (!hasChildren(node)) return traverse(node).forEach(function eachNode (node) { var state = this var emitter = node[EVENTS] if (!emitter) return var currentPath = (path ? [path] : []).concat(state.path).join('.') callback(currentPath, emitter) }) } function hasChildren (node) { return node && !!Object.keys(node).length }
Clarify variable naming for below
Clarify variable naming for below
JavaScript
mit
bendrucker/events-tree
javascript
## Code Before: 'use strict' var EventEmitter = require('events').EventEmitter var dot = require('dot-prop') var Symbol = require('es6-symbol') var traverse = require('traverse') module.exports = EventsTree var EVENTS = Symbol('events') function EventsTree () { this.tree = {} } EventsTree.prototype.node = function node (path) { return path ? dot.get(this.tree, path) : this.tree } EventsTree.prototype.at = function at (path) { var node = this.node(path) if (!node) { node = {} dot.set(this.tree, path, node) } if (!node[EVENTS]) { node[EVENTS] = new EventEmitter() } return node[EVENTS] } EventsTree.prototype.below = function (path, callback) { if (typeof path === 'function') { callback = path path = '' } var node = this.node(path) if (!hasChildren(node)) return traverse(node).forEach(function eachNode (node) { var state = this var emitter = node[EVENTS] if (!emitter) return var fullPath = (path ? [path] : []).concat(state.path).join('.') callback(fullPath, emitter) }) } function hasChildren (node) { return node && !!Object.keys(node).length } ## Instruction: Clarify variable naming for below ## Code After: 'use strict' var EventEmitter = require('events').EventEmitter var dot = require('dot-prop') var Symbol = require('es6-symbol') var traverse = require('traverse') module.exports = EventsTree var EVENTS = Symbol('events') function EventsTree () { this.tree = {} } EventsTree.prototype.node = function node (path) { return path ? dot.get(this.tree, path) : this.tree } EventsTree.prototype.at = function at (path) { var node = this.node(path) if (!node) { node = {} dot.set(this.tree, path, node) } if (!node[EVENTS]) { node[EVENTS] = new EventEmitter() } return node[EVENTS] } EventsTree.prototype.below = function (path, callback) { if (typeof path === 'function') { callback = path path = '' } var node = this.node(path) if (!hasChildren(node)) return traverse(node).forEach(function eachNode (node) { var state = this var emitter = node[EVENTS] if (!emitter) return var currentPath = (path ? [path] : []).concat(state.path).join('.') callback(currentPath, emitter) }) } function hasChildren (node) { return node && !!Object.keys(node).length }
4391123774e659231b3f5d9c35109cde7a62f901
requirements.txt
requirements.txt
astropy Cython matplotlib>=2.2 numpy scipy scikit-image scikit-learn Sphinx sphinx-astropy
astropy Cython matplotlib>=2.2 numpy setuptools>=39.0 scipy scikit-image scikit-learn Sphinx sphinx-astropy
Use newer setuptools in RTD pip environment [docs only]
Use newer setuptools in RTD pip environment [docs only]
Text
bsd-3-clause
astropy/photutils,larrybradley/photutils
text
## Code Before: astropy Cython matplotlib>=2.2 numpy scipy scikit-image scikit-learn Sphinx sphinx-astropy ## Instruction: Use newer setuptools in RTD pip environment [docs only] ## Code After: astropy Cython matplotlib>=2.2 numpy setuptools>=39.0 scipy scikit-image scikit-learn Sphinx sphinx-astropy
30bbfd242a7c5fbce217bfdf234a95954677d60d
README.md
README.md
Artifacts and demos for our submission to SLE'17 - [Memo table visualization](https://incremental-packrat.github.io/sle/memo-viz.html)
Artifacts and demos for our submission to SLE'17 - [Memo table visualization](https://incremental-packrat.github.io/sle/memo-viz.html) - Factory for ES5 parsers: [`src/es5.js`](https://github.com/incremental-packrat/sle/blob/master/src/es5.js)
Add link to ES5 parser factory.
Add link to ES5 parser factory.
Markdown
mit
incremental-packrat/sle,incremental-packrat/sle,incremental-packrat/sle
markdown
## Code Before: Artifacts and demos for our submission to SLE'17 - [Memo table visualization](https://incremental-packrat.github.io/sle/memo-viz.html) ## Instruction: Add link to ES5 parser factory. ## Code After: Artifacts and demos for our submission to SLE'17 - [Memo table visualization](https://incremental-packrat.github.io/sle/memo-viz.html) - Factory for ES5 parsers: [`src/es5.js`](https://github.com/incremental-packrat/sle/blob/master/src/es5.js)
999b570022d1a2392885c0e4633883e800387619
app/views/message/photos/_new.html.haml
app/views/message/photos/_new.html.haml
= semantic_form_for PhotoMessage.new, url: thread_photos_path(@thread), html: {multipart: true} do |f| = f.inputs do = f.input :photo, as: :file = f.input :retained_photo, as: :hidden = f.input :caption = semantic_fields_for Message.new do |f2| = f2.input :body = f.buttons do = f.commit_button
= semantic_form_for PhotoMessage.new, url: thread_photos_path(@thread), html: {multipart: true} do |f| = f.inputs do = f.input :photo, as: :file = f.input :retained_photo, as: :hidden = f.input :caption = f.buttons do = f.commit_button
Remove message field from photo message, prefer caption.
Remove message field from photo message, prefer caption.
Haml
mit
auto-mat/toolkit,cyclestreets/cyclescape,cyclestreets/cyclescape,auto-mat/toolkit,cyclestreets/cyclescape
haml
## Code Before: = semantic_form_for PhotoMessage.new, url: thread_photos_path(@thread), html: {multipart: true} do |f| = f.inputs do = f.input :photo, as: :file = f.input :retained_photo, as: :hidden = f.input :caption = semantic_fields_for Message.new do |f2| = f2.input :body = f.buttons do = f.commit_button ## Instruction: Remove message field from photo message, prefer caption. ## Code After: = semantic_form_for PhotoMessage.new, url: thread_photos_path(@thread), html: {multipart: true} do |f| = f.inputs do = f.input :photo, as: :file = f.input :retained_photo, as: :hidden = f.input :caption = f.buttons do = f.commit_button
1f30b7af45c4bcee60a1b3d9e9e9793278a372b6
scripts/deploy-gh-pages.sh
scripts/deploy-gh-pages.sh
if [[ $(git log --oneline -n1) != *":rocket:"* ]]; then # build webpage git checkout master yarn build-prod git add -A git commit -m ":rocket:" # push to repository PUSH_URI="https://${GITHUB_TOKEN}@github.com/mattdelsordo/friendo.git" echo "Pushing to master" git push "${PUSH_URI}" >/dev/null 2>&1 # don't print secrets fi
if [[ $(git log --oneline -n1) != *":rocket:"* ]]; then # build webpage git checkout master yarn build-prod git add -A TAG=$(egrep '"version": "([0-9]+\.[0-9]+\.[0-9]+"),' package.json | egrep -o '[0-9]+\.[0-9]+\.[0-9]+') git commit -m ":rocket: v$TAG" git tag -a "v$TAG" -m "v$TAG" # push to repository PUSH_URI="https://${GITHUB_TOKEN}@github.com/mattdelsordo/friendo.git" echo "Pushing to master" git push "${PUSH_URI}" >/dev/null 2>&1 # don't print secrets git push "${PUSH_URI}" --tags >/dev/null 2>&1 fi
Tag master build with new version number
:green_heart: Tag master build with new version number
Shell
mit
mattdelsordo/friendo,mattdelsordo/friendo,mattdelsordo/friendo
shell
## Code Before: if [[ $(git log --oneline -n1) != *":rocket:"* ]]; then # build webpage git checkout master yarn build-prod git add -A git commit -m ":rocket:" # push to repository PUSH_URI="https://${GITHUB_TOKEN}@github.com/mattdelsordo/friendo.git" echo "Pushing to master" git push "${PUSH_URI}" >/dev/null 2>&1 # don't print secrets fi ## Instruction: :green_heart: Tag master build with new version number ## Code After: if [[ $(git log --oneline -n1) != *":rocket:"* ]]; then # build webpage git checkout master yarn build-prod git add -A TAG=$(egrep '"version": "([0-9]+\.[0-9]+\.[0-9]+"),' package.json | egrep -o '[0-9]+\.[0-9]+\.[0-9]+') git commit -m ":rocket: v$TAG" git tag -a "v$TAG" -m "v$TAG" # push to repository PUSH_URI="https://${GITHUB_TOKEN}@github.com/mattdelsordo/friendo.git" echo "Pushing to master" git push "${PUSH_URI}" >/dev/null 2>&1 # don't print secrets git push "${PUSH_URI}" --tags >/dev/null 2>&1 fi
80ea1d25f760f1e8c61d0a4721424d0462e20748
polling_stations/templates/home.html
polling_stations/templates/home.html
{% extends "base.html" %} {% load i18n %} {% block page_title %}Find your polling station{% endblock page_title %} {% block content %} {% block extra_content %}{% endblock extra_content %} <div class="row"> <div class="columns large-centered columns large-6 card"> {% if not is_whitelabel and not form.errors %} <header> <h2>{% trans "Find your polling station" %}</h2> </header> {% endif %} {% if form.errors %} {% blocktrans %} <h2>Sorry, we can't find {{ postcode }}</h2> <p>This doesn't appear to be a valid postcode.</p> {% endblocktrans %} {% endif %} <form method=post class="form form-inline"> {% csrf_token %} <label class="card_header">{% trans "Enter your postcode" %} <input id="id_postcode" name="postcode" type="text" aria-describedby="postcode_help_text" autofocus > </label> <button type="submit" class="button" id="submit-postcode">{% trans "Find your polling station" %}</button> </form> </div> </div> {% endblock content %}
{% extends "base.html" %} {% load dc_forms %} {% load i18n %} {% block page_title %}Find your polling station{% endblock page_title %} {% block content %} {% block extra_content %}{% endblock extra_content %} <div class="row"> <div class="columns large-centered columns large-6 card"> {% if not is_whitelabel and not form.errors %} <header> <h2>{% trans "Find your polling station" %}</h2> </header> {% endif %} {% if form.errors %} {% blocktrans %} <h2>Sorry, we can't find {{ postcode }}</h2> <p>This doesn't appear to be a valid postcode.</p> {% endblocktrans %} {% endif %} <form method=post class="form form-inline"> {% csrf_token %} {{ form|dc_form }} <button type="submit" class="button" id="submit-postcode">{% trans "Find your polling station" %}</button> </form> </div> </div> {% endblock content %}
Use DC forms tag for postcode form
Use DC forms tag for postcode form
HTML
bsd-3-clause
DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations
html
## Code Before: {% extends "base.html" %} {% load i18n %} {% block page_title %}Find your polling station{% endblock page_title %} {% block content %} {% block extra_content %}{% endblock extra_content %} <div class="row"> <div class="columns large-centered columns large-6 card"> {% if not is_whitelabel and not form.errors %} <header> <h2>{% trans "Find your polling station" %}</h2> </header> {% endif %} {% if form.errors %} {% blocktrans %} <h2>Sorry, we can't find {{ postcode }}</h2> <p>This doesn't appear to be a valid postcode.</p> {% endblocktrans %} {% endif %} <form method=post class="form form-inline"> {% csrf_token %} <label class="card_header">{% trans "Enter your postcode" %} <input id="id_postcode" name="postcode" type="text" aria-describedby="postcode_help_text" autofocus > </label> <button type="submit" class="button" id="submit-postcode">{% trans "Find your polling station" %}</button> </form> </div> </div> {% endblock content %} ## Instruction: Use DC forms tag for postcode form ## Code After: {% extends "base.html" %} {% load dc_forms %} {% load i18n %} {% block page_title %}Find your polling station{% endblock page_title %} {% block content %} {% block extra_content %}{% endblock extra_content %} <div class="row"> <div class="columns large-centered columns large-6 card"> {% if not is_whitelabel and not form.errors %} <header> <h2>{% trans "Find your polling station" %}</h2> </header> {% endif %} {% if form.errors %} {% blocktrans %} <h2>Sorry, we can't find {{ postcode }}</h2> <p>This doesn't appear to be a valid postcode.</p> {% endblocktrans %} {% endif %} <form method=post class="form form-inline"> {% csrf_token %} {{ form|dc_form }} <button type="submit" class="button" id="submit-postcode">{% trans "Find your polling station" %}</button> </form> </div> </div> {% endblock content %}
957fbd52d1629e5462157fe65713800a02b33dd6
tests/keywords_test.txt
tests/keywords_test.txt
{* $Id$ *} $Id$ This file is used to text keyword expansion. $Date$ $Date$ $Author$ $Revision$ /* $Author$ $Id$ $Rev$ $URL$ $Date$ */ Why won't $Id$ expand?
{* $Id$ *} $Id$ This file is used to text keyword expansion. $Date$ $Date$ $Author$ $Revision$ /* $Author$ $Id$ $Rev$ $URL$ $Date$ */ Why won't $Id$ expand? good question!
Test first mlpvolt commit yay
Test first mlpvolt commit yay git-svn-id: a7fabbc6a7c54ea5c67cbd16bd322330fd10cc35@14424 b456876b-0849-0410-b77d-98878d47e9d5
Text
lgpl-2.1
tikiorg/tiki,tikiorg/tiki,changi67/tiki,changi67/tiki,changi67/tiki,oregional/tiki,tikiorg/tiki,oregional/tiki,changi67/tiki,changi67/tiki,tikiorg/tiki,oregional/tiki,oregional/tiki
text
## Code Before: {* $Id$ *} $Id$ This file is used to text keyword expansion. $Date$ $Date$ $Author$ $Revision$ /* $Author$ $Id$ $Rev$ $URL$ $Date$ */ Why won't $Id$ expand? ## Instruction: Test first mlpvolt commit yay git-svn-id: a7fabbc6a7c54ea5c67cbd16bd322330fd10cc35@14424 b456876b-0849-0410-b77d-98878d47e9d5 ## Code After: {* $Id$ *} $Id$ This file is used to text keyword expansion. $Date$ $Date$ $Author$ $Revision$ /* $Author$ $Id$ $Rev$ $URL$ $Date$ */ Why won't $Id$ expand? good question!
e48a68bec7e425da78b20aa4f720f640e85d4532
judoscale-ruby/lib/judoscale/job_metrics_collector/active_record_helper.rb
judoscale-ruby/lib/judoscale/job_metrics_collector/active_record_helper.rb
module Judoscale class JobMetricsCollector module ActiveRecordHelper # Cleanup any whitespace characters (including new lines) from the SQL for simpler logging. # Reference: ActiveSupport's `squish!` method. https://api.rubyonrails.org/classes/String.html#method-i-squish def self.cleanse_sql(sql) sql.gsub(/[[:space:]]+/, " ").strip end private def select_rows_silently(sql) if Config.instance.log_level && ::ActiveRecord::Base.logger.respond_to?(:silence) ::ActiveRecord::Base.logger.silence(Config.instance.log_level) { select_rows_tagged(sql) } else select_rows_tagged(sql) end end def select_rows_tagged(sql) if ActiveRecord::Base.logger.respond_to?(:tagged) ActiveRecord::Base.logger.tagged(Judoscale::LoggerProxy::TAG) { select_rows(sql) } else select_rows(sql) end end def select_rows(sql) # This ensures the agent doesn't hold onto a DB connection any longer than necessary ActiveRecord::Base.connection_pool.with_connection { |c| c.select_rows(sql) } end end end end
module Judoscale class JobMetricsCollector module ActiveRecordHelper # Cleanup any whitespace characters (including new lines) from the SQL for simpler logging. # Reference: ActiveSupport's `squish!` method. https://api.rubyonrails.org/classes/String.html#method-i-squish def self.cleanse_sql(sql) sql = sql.dup sql.gsub!(/[[:space:]]+/, " ") sql.strip! sql end private def select_rows_silently(sql) if Config.instance.log_level && ::ActiveRecord::Base.logger.respond_to?(:silence) ::ActiveRecord::Base.logger.silence(Config.instance.log_level) { select_rows_tagged(sql) } else select_rows_tagged(sql) end end def select_rows_tagged(sql) if ActiveRecord::Base.logger.respond_to?(:tagged) ActiveRecord::Base.logger.tagged(Judoscale::LoggerProxy::TAG) { select_rows(sql) } else select_rows(sql) end end def select_rows(sql) # This ensures the agent doesn't hold onto a DB connection any longer than necessary ActiveRecord::Base.connection_pool.with_connection { |c| c.select_rows(sql) } end end end end
Make string modifications in place to avoid creating new objects
Make string modifications in place to avoid creating new objects Save some object creations by making changes in place to the strings. Also add the missing frozen string literal modifier to the file.
Ruby
mit
adamlogic/rails_autoscale_agent,adamlogic/rails_autoscale_agent,adamlogic/rails_autoscale_agent
ruby
## Code Before: module Judoscale class JobMetricsCollector module ActiveRecordHelper # Cleanup any whitespace characters (including new lines) from the SQL for simpler logging. # Reference: ActiveSupport's `squish!` method. https://api.rubyonrails.org/classes/String.html#method-i-squish def self.cleanse_sql(sql) sql.gsub(/[[:space:]]+/, " ").strip end private def select_rows_silently(sql) if Config.instance.log_level && ::ActiveRecord::Base.logger.respond_to?(:silence) ::ActiveRecord::Base.logger.silence(Config.instance.log_level) { select_rows_tagged(sql) } else select_rows_tagged(sql) end end def select_rows_tagged(sql) if ActiveRecord::Base.logger.respond_to?(:tagged) ActiveRecord::Base.logger.tagged(Judoscale::LoggerProxy::TAG) { select_rows(sql) } else select_rows(sql) end end def select_rows(sql) # This ensures the agent doesn't hold onto a DB connection any longer than necessary ActiveRecord::Base.connection_pool.with_connection { |c| c.select_rows(sql) } end end end end ## Instruction: Make string modifications in place to avoid creating new objects Save some object creations by making changes in place to the strings. Also add the missing frozen string literal modifier to the file. ## Code After: module Judoscale class JobMetricsCollector module ActiveRecordHelper # Cleanup any whitespace characters (including new lines) from the SQL for simpler logging. # Reference: ActiveSupport's `squish!` method. https://api.rubyonrails.org/classes/String.html#method-i-squish def self.cleanse_sql(sql) sql = sql.dup sql.gsub!(/[[:space:]]+/, " ") sql.strip! sql end private def select_rows_silently(sql) if Config.instance.log_level && ::ActiveRecord::Base.logger.respond_to?(:silence) ::ActiveRecord::Base.logger.silence(Config.instance.log_level) { select_rows_tagged(sql) } else select_rows_tagged(sql) end end def select_rows_tagged(sql) if ActiveRecord::Base.logger.respond_to?(:tagged) ActiveRecord::Base.logger.tagged(Judoscale::LoggerProxy::TAG) { select_rows(sql) } else select_rows(sql) end end def select_rows(sql) # This ensures the agent doesn't hold onto a DB connection any longer than necessary ActiveRecord::Base.connection_pool.with_connection { |c| c.select_rows(sql) } end end end end
6bb7e58cbd5ec6c7e3e8a90a0fe9feb957f04571
.travis.yml
.travis.yml
language: python python: - "2.7" # command to install dependencies install: "pip install -r requirements/test.txt" # command to run tests script: python manage.py test # publish to PyPI on new tag deploy: provider: pypi user: edx password: secure: A2BrU6qqQHSrJ7jvxOSr1/l4HdHT5EvRWvkufMR+kdq8I8qgTlGio22Tc4OSrD5Oe7Zz7ST7q3fJFRf8Kt/gdZp7DJeeVR5gK113EvquYQUdb+wbKiBHQ3hu7JBWAjrzUQ3mDPk5DJN77dUVByYoZUmWQVMyg2fmUnQxRdertLI= distributions: sdist bdist_wheel on: tags: true
language: python python: - '2.7' install: pip install -r requirements/test.txt script: python manage.py test deploy: provider: pypi user: edx password: secure: 1qOq37zLf1GDkUSf3e4q08pV5OVJ57JIesDd5t/qZ6D0EUQmnIYbLldWBWV9je1jeYdUTmFE20b0vvqCZgHICroX6DJat0dkG/6pncIeLodl64FQngXRDYe7HZpSrLuXavn1x48yzF25lY5WwplOm7kspMVTOcXEmIjaGiywDJByzy7uKAdQDHpc8IOc1zxhGE2ygNBThiozpht3w7Xa91vAKlv4w0TeDzxtOvBzPIqRiocnEper1T3S4E95XUtrp2fXlBaBCdsjbteM0BFeLK0UmCuQCrFd/xT2A0dop0GMSvC2krpfvbD3NDWOhTU6v/5p20ufrbTK0Gpb2LzuGCFJCzmMMXTIBjsZ/z2s8p5q9m/exx9eLBGhIfOV9YY1xqKoVw2IX7xRMHAPJtQmaVw+968aasOJLF6QOZoUiUe1fr6x6KuhXa0V7iJeH0psg7oySAL5Y09MEXCbexRvjcfoNXaT9lK7dQ5Py8Tb2r7COBiN1lGTY2FEA3HRn4d5Q44Ngub6sg58U6S07C5CFZjMosxKN91gHRVfvhQRVH7egjInBSO/2HrYIhAN79dlTwqWNFeII7Vx11QN+8ePdyzKtnL917/atyZDkg29wuHe+lCL0LqYVmg8YwE9k/r6uTGMaoRXjVghV7ketJtDBj39f8n1BilrpV28b/i9zhg= distributions: sdist bdist_wheel on: tags: true
Use an actual password this time
Use an actual password this time
YAML
agpl-3.0
doctoryes/edx-django-release-util
yaml
## Code Before: language: python python: - "2.7" # command to install dependencies install: "pip install -r requirements/test.txt" # command to run tests script: python manage.py test # publish to PyPI on new tag deploy: provider: pypi user: edx password: secure: A2BrU6qqQHSrJ7jvxOSr1/l4HdHT5EvRWvkufMR+kdq8I8qgTlGio22Tc4OSrD5Oe7Zz7ST7q3fJFRf8Kt/gdZp7DJeeVR5gK113EvquYQUdb+wbKiBHQ3hu7JBWAjrzUQ3mDPk5DJN77dUVByYoZUmWQVMyg2fmUnQxRdertLI= distributions: sdist bdist_wheel on: tags: true ## Instruction: Use an actual password this time ## Code After: language: python python: - '2.7' install: pip install -r requirements/test.txt script: python manage.py test deploy: provider: pypi user: edx password: secure: 1qOq37zLf1GDkUSf3e4q08pV5OVJ57JIesDd5t/qZ6D0EUQmnIYbLldWBWV9je1jeYdUTmFE20b0vvqCZgHICroX6DJat0dkG/6pncIeLodl64FQngXRDYe7HZpSrLuXavn1x48yzF25lY5WwplOm7kspMVTOcXEmIjaGiywDJByzy7uKAdQDHpc8IOc1zxhGE2ygNBThiozpht3w7Xa91vAKlv4w0TeDzxtOvBzPIqRiocnEper1T3S4E95XUtrp2fXlBaBCdsjbteM0BFeLK0UmCuQCrFd/xT2A0dop0GMSvC2krpfvbD3NDWOhTU6v/5p20ufrbTK0Gpb2LzuGCFJCzmMMXTIBjsZ/z2s8p5q9m/exx9eLBGhIfOV9YY1xqKoVw2IX7xRMHAPJtQmaVw+968aasOJLF6QOZoUiUe1fr6x6KuhXa0V7iJeH0psg7oySAL5Y09MEXCbexRvjcfoNXaT9lK7dQ5Py8Tb2r7COBiN1lGTY2FEA3HRn4d5Q44Ngub6sg58U6S07C5CFZjMosxKN91gHRVfvhQRVH7egjInBSO/2HrYIhAN79dlTwqWNFeII7Vx11QN+8ePdyzKtnL917/atyZDkg29wuHe+lCL0LqYVmg8YwE9k/r6uTGMaoRXjVghV7ketJtDBj39f8n1BilrpV28b/i9zhg= distributions: sdist bdist_wheel on: tags: true
3b91ce117db10ffcf370a5bdfd3a7e6c8e6fbf84
Resources/views/Admin/Menu/new_child.html.twig
Resources/views/Admin/Menu/new_child.html.twig
{% extends "EkynaAdminBundle:Entity:sided.html.twig" %} {% block title %} <h1>{{ 'ekyna_cms.menu.header.new_child'|trans({'%name%': menu})|raw }}</h1> {% endblock %} {% block actions %} {{ admin_resource_btn(menu, 'list') }} {% endblock %} {% block main %} <form action="{{ path('ekyna_cms_menu_admin_new_child', identifiers|merge({'menuId': menu.id})) }}" {{ form_enctype(form) }} method="post" class="form-horizontal form-with-tabs"> {% include "EkynaCmsBundle:Admin/Menu:_form.html.twig" %} {{ ui_form_footer(form) }} </form> {% endblock %}
{% extends "EkynaAdminBundle:Entity/Default:new.html.twig" %} {% block title %} <h1>{{ 'ekyna_cms.menu.header.new_child'|trans({'%name%': menu})|raw }}</h1> {% endblock %}
Fix menu new child template
Fix menu new child template
Twig
mit
ekyna/CmsBundle,ekyna/CmsBundle,ekyna/CmsBundle
twig
## Code Before: {% extends "EkynaAdminBundle:Entity:sided.html.twig" %} {% block title %} <h1>{{ 'ekyna_cms.menu.header.new_child'|trans({'%name%': menu})|raw }}</h1> {% endblock %} {% block actions %} {{ admin_resource_btn(menu, 'list') }} {% endblock %} {% block main %} <form action="{{ path('ekyna_cms_menu_admin_new_child', identifiers|merge({'menuId': menu.id})) }}" {{ form_enctype(form) }} method="post" class="form-horizontal form-with-tabs"> {% include "EkynaCmsBundle:Admin/Menu:_form.html.twig" %} {{ ui_form_footer(form) }} </form> {% endblock %} ## Instruction: Fix menu new child template ## Code After: {% extends "EkynaAdminBundle:Entity/Default:new.html.twig" %} {% block title %} <h1>{{ 'ekyna_cms.menu.header.new_child'|trans({'%name%': menu})|raw }}</h1> {% endblock %}
892393458612ea78319cceeb98957c34ccb91d2d
django_react_templatetags/encoders.py
django_react_templatetags/encoders.py
from __future__ import unicode_literals from django.core.serializers.json import DjangoJSONEncoder from django_react_templatetags.mixins import RepresentationMixin def json_encoder_cls_factory(context): class ReqReactRepresentationJSONEncoder(ReactRepresentationJSONEncoder): context = None ReqReactRepresentationJSONEncoder.context = context return ReqReactRepresentationJSONEncoder class ReactRepresentationJSONEncoder(DjangoJSONEncoder): ''' Custom json encoder that adds support for RepresentationMixin ''' def default(self, o): if isinstance(o, RepresentationMixin): # Allow backwards compability with react_representation prop if not hasattr(o, 'to_react_representation'): return o.react_representation args = [self.context if hasattr(self, 'context') else None] args = [x for x in args if x is not None] return o.to_react_representation(*args) return super(ReactRepresentationJSONEncoder, self).default(o)
from __future__ import unicode_literals from django.core.serializers.json import DjangoJSONEncoder from django_react_templatetags.mixins import RepresentationMixin def json_encoder_cls_factory(context): class ReqReactRepresentationJSONEncoder(ReactRepresentationJSONEncoder): context = None ReqReactRepresentationJSONEncoder.context = context return ReqReactRepresentationJSONEncoder class ReactRepresentationJSONEncoder(DjangoJSONEncoder): ''' Custom json encoder that adds support for RepresentationMixin ''' def default(self, o): if isinstance(o, RepresentationMixin): args = [self.context if hasattr(self, 'context') else None] args = [x for x in args if x is not None] return o.to_react_representation(*args) return super(ReactRepresentationJSONEncoder, self).default(o)
Drop support for reacct_representation property
Drop support for reacct_representation property
Python
mit
Frojd/django-react-templatetags,Frojd/django-react-templatetags,Frojd/django-react-templatetags
python
## Code Before: from __future__ import unicode_literals from django.core.serializers.json import DjangoJSONEncoder from django_react_templatetags.mixins import RepresentationMixin def json_encoder_cls_factory(context): class ReqReactRepresentationJSONEncoder(ReactRepresentationJSONEncoder): context = None ReqReactRepresentationJSONEncoder.context = context return ReqReactRepresentationJSONEncoder class ReactRepresentationJSONEncoder(DjangoJSONEncoder): ''' Custom json encoder that adds support for RepresentationMixin ''' def default(self, o): if isinstance(o, RepresentationMixin): # Allow backwards compability with react_representation prop if not hasattr(o, 'to_react_representation'): return o.react_representation args = [self.context if hasattr(self, 'context') else None] args = [x for x in args if x is not None] return o.to_react_representation(*args) return super(ReactRepresentationJSONEncoder, self).default(o) ## Instruction: Drop support for reacct_representation property ## Code After: from __future__ import unicode_literals from django.core.serializers.json import DjangoJSONEncoder from django_react_templatetags.mixins import RepresentationMixin def json_encoder_cls_factory(context): class ReqReactRepresentationJSONEncoder(ReactRepresentationJSONEncoder): context = None ReqReactRepresentationJSONEncoder.context = context return ReqReactRepresentationJSONEncoder class ReactRepresentationJSONEncoder(DjangoJSONEncoder): ''' Custom json encoder that adds support for RepresentationMixin ''' def default(self, o): if isinstance(o, RepresentationMixin): args = [self.context if hasattr(self, 'context') else None] args = [x for x in args if x is not None] return o.to_react_representation(*args) return super(ReactRepresentationJSONEncoder, self).default(o)
82ae82332ff37ffdbc17a4d1ae420a01ba4d88cc
README.md
README.md
This is a Hypermedia API example in Rails. It uses several cool gems that are good for hypermedia and/or APIs: * active_model_serializers * rspec_api_documentation * raddocs ## Hypermedia client A basic example of a hypermedia client is included via Frenetic. Make sure to set up a user with the correct auth token.
This is a Hypermedia API example in Rails. It uses several cool gems that are good for hypermedia and/or APIs: * active_model_serializers * rspec_api_documentation * raddocs ## Getting going Here's how to give this a try. First, you'll need Postgres installed and running. Next, run these commands: ```bash $ git clone https://github.com/oestrich/hypermedia_rails.git $ cd hypermedia_rails $ bundle $ RAILS_ENV=test bundle exec rake db:create db:migrate $ RAILS_ENV=development bundle exec rake db:create db:migrate $ bundle exec rake spec ``` You should see all the tests pass. ## Hypermedia client A basic example of a hypermedia client is included via Frenetic. Make sure to set up a user with the correct auth token. To try it, just ```bash $ bundle exec ruby hypermedia.rb ```
Update REAMDE with getting started instructions.
Update REAMDE with getting started instructions. The frenetic ones aren't complete, but here's what I had to do to actually get the app running.
Markdown
mit
oestrich/hypermedia_rails,oestrich/hypermedia_rails
markdown
## Code Before: This is a Hypermedia API example in Rails. It uses several cool gems that are good for hypermedia and/or APIs: * active_model_serializers * rspec_api_documentation * raddocs ## Hypermedia client A basic example of a hypermedia client is included via Frenetic. Make sure to set up a user with the correct auth token. ## Instruction: Update REAMDE with getting started instructions. The frenetic ones aren't complete, but here's what I had to do to actually get the app running. ## Code After: This is a Hypermedia API example in Rails. It uses several cool gems that are good for hypermedia and/or APIs: * active_model_serializers * rspec_api_documentation * raddocs ## Getting going Here's how to give this a try. First, you'll need Postgres installed and running. Next, run these commands: ```bash $ git clone https://github.com/oestrich/hypermedia_rails.git $ cd hypermedia_rails $ bundle $ RAILS_ENV=test bundle exec rake db:create db:migrate $ RAILS_ENV=development bundle exec rake db:create db:migrate $ bundle exec rake spec ``` You should see all the tests pass. ## Hypermedia client A basic example of a hypermedia client is included via Frenetic. Make sure to set up a user with the correct auth token. To try it, just ```bash $ bundle exec ruby hypermedia.rb ```
64246fef8a0272d67db6c92f840babfe3081fc0d
napalm_logs/config/junos/init.yml
napalm_logs/config/junos/init.yml
prefixes: - time_format: "%b %d %H:%M:%S" values: date: (\w+\s+\d+) time: (\d\d:\d\d:\d\d) hostPrefix: (re\d.)? host: ([^ ]+) processName: /?(\w+) # Most log lines have a process ID, however some do not processId: \[?(\d+)?\]? tag: ([\w\s]+) line: '{date} {time} {hostPrefix}{host} {processName}{processId}: {tag}:'
prefixes: - time_format: "%b %d %H:%M:%S" values: date: (\w+\s+\d+) time: (\d\d:\d\d:\d\d) hostPrefix: (re\d.)? host: ([^ ]+) processName: /?(\w+) # Most log lines have a process ID, however some do not processId: \[?(\d+)?\]? tag: ([\w\s]+) line: '{date} {time} {hostPrefix}{host} {processName}{processId}: {tag}:' - time_format: "%b %d %H:%M:%S" values: date: (\w+\s+\d+) time: (\d\d:\d\d:\d\d) hostPrefix: (re\d.)? host: ([^ ]+) tag: (\w+) # Most log lines have a process ID, however some do not processId: (\d+) line: '{date} {time} {hostPrefix}{host} {tag}[{processId}]:'
Add new junos prefix profiler for daemon messages
Add new junos prefix profiler for daemon messages
YAML
apache-2.0
napalm-automation/napalm-logs,napalm-automation/napalm-logs
yaml
## Code Before: prefixes: - time_format: "%b %d %H:%M:%S" values: date: (\w+\s+\d+) time: (\d\d:\d\d:\d\d) hostPrefix: (re\d.)? host: ([^ ]+) processName: /?(\w+) # Most log lines have a process ID, however some do not processId: \[?(\d+)?\]? tag: ([\w\s]+) line: '{date} {time} {hostPrefix}{host} {processName}{processId}: {tag}:' ## Instruction: Add new junos prefix profiler for daemon messages ## Code After: prefixes: - time_format: "%b %d %H:%M:%S" values: date: (\w+\s+\d+) time: (\d\d:\d\d:\d\d) hostPrefix: (re\d.)? host: ([^ ]+) processName: /?(\w+) # Most log lines have a process ID, however some do not processId: \[?(\d+)?\]? tag: ([\w\s]+) line: '{date} {time} {hostPrefix}{host} {processName}{processId}: {tag}:' - time_format: "%b %d %H:%M:%S" values: date: (\w+\s+\d+) time: (\d\d:\d\d:\d\d) hostPrefix: (re\d.)? host: ([^ ]+) tag: (\w+) # Most log lines have a process ID, however some do not processId: (\d+) line: '{date} {time} {hostPrefix}{host} {tag}[{processId}]:'
0095c1c3400951116df0b0462068a0cd429e1e9e
tracpro/templates/polls/poll_list.html
tracpro/templates/polls/poll_list.html
{% extends "smartmin/list.html" %} {% load smartmin i18n %} {% block pre-content %} <div class='page-header'> <h2> {% trans "Polls" %} </h2> </div> {% blocktrans %} Each poll is a flow in RapidPro. {% endblocktrans %} {% endblock %} {% block table-buttons %} {% if org_perms.polls.poll_select %} <a class='btn btn-default pull-right' href='{% url 'polls.poll_select' %}'> <span class='glyphicon glyphicon-download'></span> {% trans "Select Flows" %} </a> {% endif %} {% endblock %}
{% extends "smartmin/list.html" %} {% load smartmin i18n %} {% block pre-content %} <div class='page-header'> <h2> {% trans "Flows" %} </h2> </div> {% blocktrans %} Latest statistics on flows that are being tracked in TracPro. Click on the 'Select Flows' button to change the flows you are tracking. All flow data is tracked going forward. If you need to track flow data for dates in the past, ask your administrator to fetch runs for those dates. {% endblocktrans %} {% endblock %} {% block table-buttons %} {% if org_perms.polls.poll_select %} <a class='btn btn-default pull-right' href='{% url 'polls.poll_select' %}'> <span class='glyphicon glyphicon-download'></span> {% trans "Select Flows" %} </a> {% endif %} {% endblock %}
Update text on flows page
Update text on flows page On the page at "/poll/": New text: Change the wording of "Polls" -> "Flows" on this page New description: "Latest statistics on flows that are being tracked in TracPro. Click on the 'Select Flows' button to change the flows you are tracking. All flow data is tracked going forward. If you need to track flow data for dates in the past, ask your administrator to fetch runs for those dates."
HTML
bsd-3-clause
rapidpro/tracpro,rapidpro/tracpro,rapidpro/tracpro
html
## Code Before: {% extends "smartmin/list.html" %} {% load smartmin i18n %} {% block pre-content %} <div class='page-header'> <h2> {% trans "Polls" %} </h2> </div> {% blocktrans %} Each poll is a flow in RapidPro. {% endblocktrans %} {% endblock %} {% block table-buttons %} {% if org_perms.polls.poll_select %} <a class='btn btn-default pull-right' href='{% url 'polls.poll_select' %}'> <span class='glyphicon glyphicon-download'></span> {% trans "Select Flows" %} </a> {% endif %} {% endblock %} ## Instruction: Update text on flows page On the page at "/poll/": New text: Change the wording of "Polls" -> "Flows" on this page New description: "Latest statistics on flows that are being tracked in TracPro. Click on the 'Select Flows' button to change the flows you are tracking. All flow data is tracked going forward. If you need to track flow data for dates in the past, ask your administrator to fetch runs for those dates." ## Code After: {% extends "smartmin/list.html" %} {% load smartmin i18n %} {% block pre-content %} <div class='page-header'> <h2> {% trans "Flows" %} </h2> </div> {% blocktrans %} Latest statistics on flows that are being tracked in TracPro. Click on the 'Select Flows' button to change the flows you are tracking. All flow data is tracked going forward. If you need to track flow data for dates in the past, ask your administrator to fetch runs for those dates. {% endblocktrans %} {% endblock %} {% block table-buttons %} {% if org_perms.polls.poll_select %} <a class='btn btn-default pull-right' href='{% url 'polls.poll_select' %}'> <span class='glyphicon glyphicon-download'></span> {% trans "Select Flows" %} </a> {% endif %} {% endblock %}
a2fa08880771767faf3d6ae587e89fdfbd9c3c82
src/_layouts/archive.html
src/_layouts/archive.html
--- layout: default --- {% include page-intro.html %} <main id="main" class="page__main" aria-label="Main content"> {% include breadcrumbs.html %} {% if page.introduction %} {{ page.introduction | markdownify }} {% elsif page.layout == 'autopage_tags' %} {% if tag.description %} {{ tag.description | markdownify }} {% else %} <p>An archive of posts tagged <em>{{ page.autopages.display_name }}</em>.</p> {% endif %} {% endif %} {{ content }} {% include posts-paginated.html %} </main>
--- layout: default --- {% include page-intro.html %} <main id="main" class="page__main" aria-label="Main content"> {% include breadcrumbs.html %} {% if page.introduction %} {{ page.introduction | markdownify }} {% elsif page.layout == 'autopage_tags' %} {% if tag.description %} {{ tag.description | markdownify }} {% else %} <p>An archive of posts tagged <em>{{ page.autopages.display_name }}</em>.</p> {% endif %} {% endif %} {{ content }} {% include posts-paginated.html %} {% if page.support == true %} {% include_cached support.html %} {% endif %} </main>
Add support conditional to layout
Add support conditional to layout
HTML
mit
mmistakes/made-mistakes-jekyll,mmistakes/made-mistakes-jekyll,mmistakes/made-mistakes-jekyll
html
## Code Before: --- layout: default --- {% include page-intro.html %} <main id="main" class="page__main" aria-label="Main content"> {% include breadcrumbs.html %} {% if page.introduction %} {{ page.introduction | markdownify }} {% elsif page.layout == 'autopage_tags' %} {% if tag.description %} {{ tag.description | markdownify }} {% else %} <p>An archive of posts tagged <em>{{ page.autopages.display_name }}</em>.</p> {% endif %} {% endif %} {{ content }} {% include posts-paginated.html %} </main> ## Instruction: Add support conditional to layout ## Code After: --- layout: default --- {% include page-intro.html %} <main id="main" class="page__main" aria-label="Main content"> {% include breadcrumbs.html %} {% if page.introduction %} {{ page.introduction | markdownify }} {% elsif page.layout == 'autopage_tags' %} {% if tag.description %} {{ tag.description | markdownify }} {% else %} <p>An archive of posts tagged <em>{{ page.autopages.display_name }}</em>.</p> {% endif %} {% endif %} {{ content }} {% include posts-paginated.html %} {% if page.support == true %} {% include_cached support.html %} {% endif %} </main>
9e3a98f1a122dd3328864dd8e8f2de1c03d84518
lib/redix/uri.ex
lib/redix/uri.ex
defmodule Redix.URI do @moduledoc false @spec opts_from_uri(binary) :: Keyword.t() def opts_from_uri(uri) when is_binary(uri) do %URI{host: host, port: port, scheme: scheme} = uri = URI.parse(uri) unless scheme == "redis" do raise ArgumentError, "expected scheme to be redis://, got: #{scheme}://" end [] |> Keyword.put(:host, host) |> Keyword.put(:port, port) |> put_if_not_nil(:password, password(uri)) |> put_if_not_nil(:database, database(uri)) end defp password(%URI{userinfo: nil}) do nil end defp password(%URI{userinfo: userinfo}) do [_user, password] = String.split(userinfo, ":", parts: 2) password end defp database(%URI{path: path}) when path in [nil, "/"], do: nil defp database(%URI{path: "/" <> db}), do: String.to_integer(db) defp put_if_not_nil(opts, _key, nil), do: opts defp put_if_not_nil(opts, key, value), do: Keyword.put(opts, key, value) end
defmodule Redix.URI do @moduledoc false @spec opts_from_uri(binary) :: Keyword.t() def opts_from_uri(uri) when is_binary(uri) do %URI{host: host, port: port, scheme: scheme} = uri = URI.parse(uri) unless scheme == "redis" do raise ArgumentError, "expected scheme to be redis://, got: #{scheme}://" end [] |> put_if_not_nil(:host, host) |> put_if_not_nil(:port, port) |> put_if_not_nil(:password, password(uri)) |> put_if_not_nil(:database, database(uri)) end defp password(%URI{userinfo: nil}) do nil end defp password(%URI{userinfo: userinfo}) do [_user, password] = String.split(userinfo, ":", parts: 2) password end defp database(%URI{path: path}) when path in [nil, "/"], do: nil defp database(%URI{path: "/" <> db}), do: String.to_integer(db) defp put_if_not_nil(opts, _key, nil), do: opts defp put_if_not_nil(opts, key, value), do: Keyword.put(opts, key, value) end
Allow Redis URIs with empty host/port
Allow Redis URIs with empty host/port Closes #110.
Elixir
mit
whatyouhide/redix
elixir
## Code Before: defmodule Redix.URI do @moduledoc false @spec opts_from_uri(binary) :: Keyword.t() def opts_from_uri(uri) when is_binary(uri) do %URI{host: host, port: port, scheme: scheme} = uri = URI.parse(uri) unless scheme == "redis" do raise ArgumentError, "expected scheme to be redis://, got: #{scheme}://" end [] |> Keyword.put(:host, host) |> Keyword.put(:port, port) |> put_if_not_nil(:password, password(uri)) |> put_if_not_nil(:database, database(uri)) end defp password(%URI{userinfo: nil}) do nil end defp password(%URI{userinfo: userinfo}) do [_user, password] = String.split(userinfo, ":", parts: 2) password end defp database(%URI{path: path}) when path in [nil, "/"], do: nil defp database(%URI{path: "/" <> db}), do: String.to_integer(db) defp put_if_not_nil(opts, _key, nil), do: opts defp put_if_not_nil(opts, key, value), do: Keyword.put(opts, key, value) end ## Instruction: Allow Redis URIs with empty host/port Closes #110. ## Code After: defmodule Redix.URI do @moduledoc false @spec opts_from_uri(binary) :: Keyword.t() def opts_from_uri(uri) when is_binary(uri) do %URI{host: host, port: port, scheme: scheme} = uri = URI.parse(uri) unless scheme == "redis" do raise ArgumentError, "expected scheme to be redis://, got: #{scheme}://" end [] |> put_if_not_nil(:host, host) |> put_if_not_nil(:port, port) |> put_if_not_nil(:password, password(uri)) |> put_if_not_nil(:database, database(uri)) end defp password(%URI{userinfo: nil}) do nil end defp password(%URI{userinfo: userinfo}) do [_user, password] = String.split(userinfo, ":", parts: 2) password end defp database(%URI{path: path}) when path in [nil, "/"], do: nil defp database(%URI{path: "/" <> db}), do: String.to_integer(db) defp put_if_not_nil(opts, _key, nil), do: opts defp put_if_not_nil(opts, key, value), do: Keyword.put(opts, key, value) end
66c76735234688369ef0f36060c727d1fbb48e5c
suppressions.xml
suppressions.xml
<?xml version="1.0"?> <!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.0//EN" "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd"> <suppressions> <suppress checks="HideUtilityClassConstructor" files="/iidm/ddb/model/.*_\.java"/> </suppressions>
<?xml version="1.0"?> <!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.0//EN" "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd"> <suppressions> <suppress checks="HideUtilityClassConstructor" files="[\\/]iidm[\\/]ddb[\\/]model[\\/].*_\.java"/> </suppressions>
Make checkstyle work on Windows
Make checkstyle work on Windows
XML
mpl-2.0
itesla/ipst,itesla/ipst,itesla/ipst,itesla/ipst,itesla/ipst,itesla/ipst,itesla/ipst,itesla/ipst
xml
## Code Before: <?xml version="1.0"?> <!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.0//EN" "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd"> <suppressions> <suppress checks="HideUtilityClassConstructor" files="/iidm/ddb/model/.*_\.java"/> </suppressions> ## Instruction: Make checkstyle work on Windows ## Code After: <?xml version="1.0"?> <!DOCTYPE suppressions PUBLIC "-//Puppy Crawl//DTD Suppressions 1.0//EN" "http://www.puppycrawl.com/dtds/suppressions_1_0.dtd"> <suppressions> <suppress checks="HideUtilityClassConstructor" files="[\\/]iidm[\\/]ddb[\\/]model[\\/].*_\.java"/> </suppressions>
95cb030e7793d251716966da34aec8d4afcc8ca9
lib/templates/setup_hstore91.rb
lib/templates/setup_hstore91.rb
class SetupHstore < ActiveRecord::Migration def self.up execute "CREATE EXTENSION hstore" end def self.down execute "DROP EXTENSION hstore" end end
class SetupHstore < ActiveRecord::Migration def self.up execute "CREATE EXTENSION IF NOT EXISTS hstore" end def self.down execute "DROP EXTENSION IF EXISTS hstore" end end
Create or drop hstore extension only if necessary.
Create or drop hstore extension only if necessary.
Ruby
mit
softa/activerecord-postgres-hstore,diogob/activerecord-postgres-hstore,softa/activerecord-postgres-hstore,joeybaker/activerecord-postgres-hstore,darrencauthon/activerecord-postgres-hstore,joeybaker/activerecord-postgres-hstore
ruby
## Code Before: class SetupHstore < ActiveRecord::Migration def self.up execute "CREATE EXTENSION hstore" end def self.down execute "DROP EXTENSION hstore" end end ## Instruction: Create or drop hstore extension only if necessary. ## Code After: class SetupHstore < ActiveRecord::Migration def self.up execute "CREATE EXTENSION IF NOT EXISTS hstore" end def self.down execute "DROP EXTENSION IF EXISTS hstore" end end
52aeea3fcf586e7feefdda51779478244cf28fe7
.teamcity/ReleaseType.kt
.teamcity/ReleaseType.kt
enum class ReleaseType(val gradleProperty: String, val username: String, val password: String, val userProvidedVersion: Boolean = false) { Snapshot("snapshot", "bot-build-tool", "credentialsJSON:fc942743-b732-4204-a131-26bb066c2073"), Alpha("alpha", "bot-build-tool", "credentialsJSON:fc942743-b732-4204-a131-26bb066c2073", true), Milestone("milestone", "bot-build-tool", "credentialsJSON:fc942743-b732-4204-a131-26bb066c2073"), Release("release", "bot-build-tool", "credentialsJSON:fc942743-b732-4204-a131-26bb066c2073") }
const val gradleInternalRepositoryUsername = "%gradle.internal.repository.build-tool.publish.username%" const val gradleInternalRepositoryPassword = "%gradle.internal.repository.build-tool.publish.password%" enum class ReleaseType(val gradleProperty: String, val username: String, val password: String, val userProvidedVersion: Boolean = false) { Snapshot("snapshot", gradleInternalRepositoryUsername, gradleInternalRepositoryPassword), Alpha("alpha", gradleInternalRepositoryUsername, gradleInternalRepositoryPassword, true), Milestone("milestone", gradleInternalRepositoryUsername, gradleInternalRepositoryPassword), Release("release", gradleInternalRepositoryUsername, gradleInternalRepositoryPassword) }
Use TC variable instead of credentials JSON
Use TC variable instead of credentials JSON
Kotlin
apache-2.0
adammurdoch/native-platform,adammurdoch/native-platform,adammurdoch/native-platform,adammurdoch/native-platform
kotlin
## Code Before: enum class ReleaseType(val gradleProperty: String, val username: String, val password: String, val userProvidedVersion: Boolean = false) { Snapshot("snapshot", "bot-build-tool", "credentialsJSON:fc942743-b732-4204-a131-26bb066c2073"), Alpha("alpha", "bot-build-tool", "credentialsJSON:fc942743-b732-4204-a131-26bb066c2073", true), Milestone("milestone", "bot-build-tool", "credentialsJSON:fc942743-b732-4204-a131-26bb066c2073"), Release("release", "bot-build-tool", "credentialsJSON:fc942743-b732-4204-a131-26bb066c2073") } ## Instruction: Use TC variable instead of credentials JSON ## Code After: const val gradleInternalRepositoryUsername = "%gradle.internal.repository.build-tool.publish.username%" const val gradleInternalRepositoryPassword = "%gradle.internal.repository.build-tool.publish.password%" enum class ReleaseType(val gradleProperty: String, val username: String, val password: String, val userProvidedVersion: Boolean = false) { Snapshot("snapshot", gradleInternalRepositoryUsername, gradleInternalRepositoryPassword), Alpha("alpha", gradleInternalRepositoryUsername, gradleInternalRepositoryPassword, true), Milestone("milestone", gradleInternalRepositoryUsername, gradleInternalRepositoryPassword), Release("release", gradleInternalRepositoryUsername, gradleInternalRepositoryPassword) }
2448e3828de443f8a2a94d58a26fbab98eb0c622
src/app/waitList/waitList.controller.js
src/app/waitList/waitList.controller.js
(function() { 'use strict'; angular .module('app.waitList') .controller('WaitListController', WaitListController); WaitListController.$inject = ['$firebaseArray']; function WaitListController($firebaseArray) { var vm = this; var fireParties = new Firebase('https://waitandeat-v2-demo.firebaseio.com/parties'); var fireTextMessages = new Firebase('https://waitandeat-v2-demo.firebaseio.com/textMessages'); function Party() { this.name = ''; this.phone = ''; this.size = ''; this.done = false; this.notified = false; } vm.newParty = new Party(); vm.parties = $firebaseArray(fireParties); vm.addParty = addParty; vm.removeParty = removeParty; vm.sendTextMessage = sendTextMessage; vm.toggleDone = toggleDone; function addParty() { vm.parties.$add(vm.newParty); vm.newParty = new Party(); } function removeParty(party) { vm.parties.$remove(party); } function sendTextMessage(party) { var newTextMessage = { phoneNumber: party.phone, size: party.size, name: party.name }; fireTextMessages.push(newTextMessage); party.notified = true; vm.parties.$save(party); } function toggleDone(party) { vm.parties.$save(party); } } })();
(function() { 'use strict'; angular .module('app.waitList') .controller('WaitListController', WaitListController); WaitListController.$inject = ['$firebaseArray', 'FIREBASE_URL']; function WaitListController($firebaseArray, FIREBASE_URL) { var vm = this; var fireParties = new Firebase(FIREBASE_URL + 'parties'); var fireTextMessages = new Firebase(FIREBASE_URL + 'textMessages'); function Party() { this.name = ''; this.phone = ''; this.size = ''; this.done = false; this.notified = false; } vm.newParty = new Party(); vm.parties = $firebaseArray(fireParties); vm.addParty = addParty; vm.removeParty = removeParty; vm.sendTextMessage = sendTextMessage; vm.toggleDone = toggleDone; function addParty() { vm.parties.$add(vm.newParty); vm.newParty = new Party(); } function removeParty(party) { vm.parties.$remove(party); } function sendTextMessage(party) { var newTextMessage = { phoneNumber: party.phone, size: party.size, name: party.name }; fireTextMessages.push(newTextMessage); party.notified = true; vm.parties.$save(party); } function toggleDone(party) { vm.parties.$save(party); } } })();
Use FIREBASE_URL in waitList module.
Use FIREBASE_URL in waitList module.
JavaScript
mit
anthonybrown/angular-course-demo-app-v2,anthonybrown/angular-course-demo-app-v2
javascript
## Code Before: (function() { 'use strict'; angular .module('app.waitList') .controller('WaitListController', WaitListController); WaitListController.$inject = ['$firebaseArray']; function WaitListController($firebaseArray) { var vm = this; var fireParties = new Firebase('https://waitandeat-v2-demo.firebaseio.com/parties'); var fireTextMessages = new Firebase('https://waitandeat-v2-demo.firebaseio.com/textMessages'); function Party() { this.name = ''; this.phone = ''; this.size = ''; this.done = false; this.notified = false; } vm.newParty = new Party(); vm.parties = $firebaseArray(fireParties); vm.addParty = addParty; vm.removeParty = removeParty; vm.sendTextMessage = sendTextMessage; vm.toggleDone = toggleDone; function addParty() { vm.parties.$add(vm.newParty); vm.newParty = new Party(); } function removeParty(party) { vm.parties.$remove(party); } function sendTextMessage(party) { var newTextMessage = { phoneNumber: party.phone, size: party.size, name: party.name }; fireTextMessages.push(newTextMessage); party.notified = true; vm.parties.$save(party); } function toggleDone(party) { vm.parties.$save(party); } } })(); ## Instruction: Use FIREBASE_URL in waitList module. ## Code After: (function() { 'use strict'; angular .module('app.waitList') .controller('WaitListController', WaitListController); WaitListController.$inject = ['$firebaseArray', 'FIREBASE_URL']; function WaitListController($firebaseArray, FIREBASE_URL) { var vm = this; var fireParties = new Firebase(FIREBASE_URL + 'parties'); var fireTextMessages = new Firebase(FIREBASE_URL + 'textMessages'); function Party() { this.name = ''; this.phone = ''; this.size = ''; this.done = false; this.notified = false; } vm.newParty = new Party(); vm.parties = $firebaseArray(fireParties); vm.addParty = addParty; vm.removeParty = removeParty; vm.sendTextMessage = sendTextMessage; vm.toggleDone = toggleDone; function addParty() { vm.parties.$add(vm.newParty); vm.newParty = new Party(); } function removeParty(party) { vm.parties.$remove(party); } function sendTextMessage(party) { var newTextMessage = { phoneNumber: party.phone, size: party.size, name: party.name }; fireTextMessages.push(newTextMessage); party.notified = true; vm.parties.$save(party); } function toggleDone(party) { vm.parties.$save(party); } } })();
ba435a6a9b5c0fb82c4f848730831df145cdb941
src/driver/krs_servo/package.xml
src/driver/krs_servo/package.xml
<?xml version="1.0"?> <package> <name>krs_servo</name> <version>0.0.1</version> <description>The KrsServo package</description> <maintainer email="o111027y@mail.kyutech.jp">Yusuke Doi</maintainer> <license>MIT</license> <author email="o111027y@mail.kyutech.jp">Yusuke Doi</author> <run_depend>message_runtime</run_depend> <buildtool_depend>catkin</buildtool_depend> <build_depend>roscpp</build_depend> <build_depend>servo_msgs</build_depend> <run_depend>roscpp</run_depend> <run_depend>servo_msgs</run_depend> </package>
<?xml version="1.0"?> <package format="2"> <name>krs_servo</name> <version>0.0.1</version> <description>The KrsServo package</description> <maintainer email="o111027y@mail.kyutech.jp">Yusuke Doi</maintainer> <license>MIT</license> <author email="o111027y@mail.kyutech.jp">Yusuke Doi</author> <buildtool_depend>catkin</buildtool_depend> <depend>roscpp</depend> <depend>servo_msgs</depend> </package>
Change krs_servo's catkin format to 2
Change krs_servo's catkin format to 2
XML
mit
agrirobo/arcsys2,agrirobo/arcsys2
xml
## Code Before: <?xml version="1.0"?> <package> <name>krs_servo</name> <version>0.0.1</version> <description>The KrsServo package</description> <maintainer email="o111027y@mail.kyutech.jp">Yusuke Doi</maintainer> <license>MIT</license> <author email="o111027y@mail.kyutech.jp">Yusuke Doi</author> <run_depend>message_runtime</run_depend> <buildtool_depend>catkin</buildtool_depend> <build_depend>roscpp</build_depend> <build_depend>servo_msgs</build_depend> <run_depend>roscpp</run_depend> <run_depend>servo_msgs</run_depend> </package> ## Instruction: Change krs_servo's catkin format to 2 ## Code After: <?xml version="1.0"?> <package format="2"> <name>krs_servo</name> <version>0.0.1</version> <description>The KrsServo package</description> <maintainer email="o111027y@mail.kyutech.jp">Yusuke Doi</maintainer> <license>MIT</license> <author email="o111027y@mail.kyutech.jp">Yusuke Doi</author> <buildtool_depend>catkin</buildtool_depend> <depend>roscpp</depend> <depend>servo_msgs</depend> </package>
c42c887e038b03a235ebdcf742518e32fca148d9
message/api/src/main/java/org/eclipse/kapua/message/xml/MetricTypeXmlAdapter.java
message/api/src/main/java/org/eclipse/kapua/message/xml/MetricTypeXmlAdapter.java
/******************************************************************************* * Copyright (c) 2011, 2017 Eurotech and/or its affiliates and others * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Eurotech - initial API and implementation *******************************************************************************/ package org.eclipse.kapua.message.xml; import org.eclipse.kapua.model.xml.ObjectTypeXmlAdapter; public class MetricTypeXmlAdapter extends ObjectTypeXmlAdapter { private static final String TYPE_BASE_64_BINARY = "base64binary"; @Override public String marshal(Class<?> clazz) { String value; if (clazz == byte[].class) { value = TYPE_BASE_64_BINARY; } else { value = super.marshal(clazz); } return value; } @Override public Class<?> unmarshal(String value) throws ClassNotFoundException { Class<?> clazz; if (TYPE_BASE_64_BINARY.equals(value)) { clazz = byte[].class; } else { clazz = super.unmarshal(value); } return clazz; } }
/******************************************************************************* * Copyright (c) 2011, 2017 Eurotech and/or its affiliates and others * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Eurotech - initial API and implementation *******************************************************************************/ package org.eclipse.kapua.message.xml; import org.eclipse.kapua.model.xml.ObjectTypeXmlAdapter; /** * XML Adapter from metric type. <br> * This adapter extends {@link ObjectTypeXmlAdapter} and serialize/deserialize in a different way the * {@link Byte}[] metric type. * * This is because Kapua uses Base64 encoding of binary data. * * @since 1.0.0 */ public class MetricTypeXmlAdapter extends ObjectTypeXmlAdapter { private static final String TYPE_BASE_64_BINARY = "base64binary"; @Override public String marshal(Class<?> clazz) { String value; if (clazz == byte[].class) { value = TYPE_BASE_64_BINARY; } else { value = super.marshal(clazz); } return value; } @Override public Class<?> unmarshal(String value) throws ClassNotFoundException { Class<?> clazz; if (TYPE_BASE_64_BINARY.equals(value)) { clazz = byte[].class; } else { clazz = super.unmarshal(value); } return clazz; } }
Clean up and applyed code formatting
Clean up and applyed code formatting Signed-off-by: coduz <ded987c534c96b462feeee54a345bec2d025746a@eurotech.com>
Java
epl-1.0
stzilli/kapua,stzilli/kapua,LeoNerdoG/kapua,LeoNerdoG/kapua,stzilli/kapua,stzilli/kapua,LeoNerdoG/kapua,LeoNerdoG/kapua,LeoNerdoG/kapua,stzilli/kapua
java
## Code Before: /******************************************************************************* * Copyright (c) 2011, 2017 Eurotech and/or its affiliates and others * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Eurotech - initial API and implementation *******************************************************************************/ package org.eclipse.kapua.message.xml; import org.eclipse.kapua.model.xml.ObjectTypeXmlAdapter; public class MetricTypeXmlAdapter extends ObjectTypeXmlAdapter { private static final String TYPE_BASE_64_BINARY = "base64binary"; @Override public String marshal(Class<?> clazz) { String value; if (clazz == byte[].class) { value = TYPE_BASE_64_BINARY; } else { value = super.marshal(clazz); } return value; } @Override public Class<?> unmarshal(String value) throws ClassNotFoundException { Class<?> clazz; if (TYPE_BASE_64_BINARY.equals(value)) { clazz = byte[].class; } else { clazz = super.unmarshal(value); } return clazz; } } ## Instruction: Clean up and applyed code formatting Signed-off-by: coduz <ded987c534c96b462feeee54a345bec2d025746a@eurotech.com> ## Code After: /******************************************************************************* * Copyright (c) 2011, 2017 Eurotech and/or its affiliates and others * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Eurotech - initial API and implementation *******************************************************************************/ package org.eclipse.kapua.message.xml; import org.eclipse.kapua.model.xml.ObjectTypeXmlAdapter; /** * XML Adapter from metric type. <br> * This adapter extends {@link ObjectTypeXmlAdapter} and serialize/deserialize in a different way the * {@link Byte}[] metric type. * * This is because Kapua uses Base64 encoding of binary data. * * @since 1.0.0 */ public class MetricTypeXmlAdapter extends ObjectTypeXmlAdapter { private static final String TYPE_BASE_64_BINARY = "base64binary"; @Override public String marshal(Class<?> clazz) { String value; if (clazz == byte[].class) { value = TYPE_BASE_64_BINARY; } else { value = super.marshal(clazz); } return value; } @Override public Class<?> unmarshal(String value) throws ClassNotFoundException { Class<?> clazz; if (TYPE_BASE_64_BINARY.equals(value)) { clazz = byte[].class; } else { clazz = super.unmarshal(value); } return clazz; } }
cef56cd7c7cd17a242148ca6e1d755b8d9a6114a
lib/src/protobuf/mixins/map_mixin.dart
lib/src/protobuf/mixins/map_mixin.dart
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library protobuf.mixins.map; import "package:protobuf/protobuf.dart" show BuilderInfo; /// A PbMapMixin provides an experimental implementation of the /// Map interface for a GeneratedMessage. /// /// This mixin is enabled via an option in /// dart_options.proto in dart-protoc-plugin. abstract class PbMapMixin implements Map { // GeneratedMessage properties and methods used by this mixin. BuilderInfo get info_; void clear(); int getTagNumber(String fieldName); getField(int tagNumber); void setField(int tagNumber, var value); @override operator [](key) { if (key is! String) return null; var tag = getTagNumber(key); if (tag == null) return null; return getField(tag); } @override operator []=(String key, val) { var tag = getTagNumber(key); if (tag == null) { throw new ArgumentError( "field '${key}' not found in ${info_.messageName}"); } setField(tag, val); } @override get keys => info_.byName.keys; @override bool containsKey(Object key) => info_.byName.containsKey(key); @override get length => info_.byName.length; @override remove(key) { throw new UnsupportedError( "remove() not supported by ${info_.messageName}"); } }
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library protobuf.mixins.map; import "package:protobuf/protobuf.dart" show BuilderInfo; /// A PbMapMixin provides an experimental implementation of the /// Map interface for a GeneratedMessage. /// /// This mixin is enabled via an option in /// dart_options.proto in dart-protoc-plugin. abstract class PbMapMixin implements Map { // GeneratedMessage properties and methods used by this mixin. BuilderInfo get info_; void clear(); int getTagNumber(String fieldName); getField(int tagNumber); void setField(int tagNumber, var value); @override operator [](key) { if (key is! String) return null; var tag = getTagNumber(key); if (tag == null) return null; return getField(tag); } @override operator []=(key, val) { var tag = getTagNumber(key as String); if (tag == null) { throw new ArgumentError( "field '${key}' not found in ${info_.messageName}"); } setField(tag, val); } @override get keys => info_.byName.keys; @override bool containsKey(Object key) => info_.byName.containsKey(key); @override get length => info_.byName.length; @override remove(key) { throw new UnsupportedError( "remove() not supported by ${info_.messageName}"); } }
Fix strong mode warning in PbMapMixin
Fix strong mode warning in PbMapMixin
Dart
bsd-3-clause
google/protobuf.dart,dart-lang/dart-protobuf,google/protobuf.dart,dart-lang/protobuf,dart-lang/protobuf,google/protobuf.dart,dart-lang/dart-protobuf,dart-lang/protobuf,dart-lang/dart-protobuf
dart
## Code Before: // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library protobuf.mixins.map; import "package:protobuf/protobuf.dart" show BuilderInfo; /// A PbMapMixin provides an experimental implementation of the /// Map interface for a GeneratedMessage. /// /// This mixin is enabled via an option in /// dart_options.proto in dart-protoc-plugin. abstract class PbMapMixin implements Map { // GeneratedMessage properties and methods used by this mixin. BuilderInfo get info_; void clear(); int getTagNumber(String fieldName); getField(int tagNumber); void setField(int tagNumber, var value); @override operator [](key) { if (key is! String) return null; var tag = getTagNumber(key); if (tag == null) return null; return getField(tag); } @override operator []=(String key, val) { var tag = getTagNumber(key); if (tag == null) { throw new ArgumentError( "field '${key}' not found in ${info_.messageName}"); } setField(tag, val); } @override get keys => info_.byName.keys; @override bool containsKey(Object key) => info_.byName.containsKey(key); @override get length => info_.byName.length; @override remove(key) { throw new UnsupportedError( "remove() not supported by ${info_.messageName}"); } } ## Instruction: Fix strong mode warning in PbMapMixin ## Code After: // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. library protobuf.mixins.map; import "package:protobuf/protobuf.dart" show BuilderInfo; /// A PbMapMixin provides an experimental implementation of the /// Map interface for a GeneratedMessage. /// /// This mixin is enabled via an option in /// dart_options.proto in dart-protoc-plugin. abstract class PbMapMixin implements Map { // GeneratedMessage properties and methods used by this mixin. BuilderInfo get info_; void clear(); int getTagNumber(String fieldName); getField(int tagNumber); void setField(int tagNumber, var value); @override operator [](key) { if (key is! String) return null; var tag = getTagNumber(key); if (tag == null) return null; return getField(tag); } @override operator []=(key, val) { var tag = getTagNumber(key as String); if (tag == null) { throw new ArgumentError( "field '${key}' not found in ${info_.messageName}"); } setField(tag, val); } @override get keys => info_.byName.keys; @override bool containsKey(Object key) => info_.byName.containsKey(key); @override get length => info_.byName.length; @override remove(key) { throw new UnsupportedError( "remove() not supported by ${info_.messageName}"); } }
daf3aed57eeb30f090c1ab6ea3dd6e16152eed6d
resources.md
resources.md
--- layout: page title: Resources --- Recommended reading on safety risk management: * [How Complex Systems Fail](http://web.mit.edu/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf) - a short introduction by Richard Cook applying systems thinking to safety * [How Complex Systems Fail, Velocity 2012](https://www.youtube.com/watch?v=2S0k12uZR14) - a talk by Richard Cook relating systems safety to IT * [Engineering a Safer World](https://mitpress.mit.edu/sites/default/files/titles/free_download/9780262016629_Engineering_a_Safer_World.pdf) - a free MIT book introducing STAMP (Systems-Theoretic Accident Modeling and Processes) and STPA (STAMP-Based Process Analysis) * [MIT Partnership for a Systems Approach to Safety (PSAS)](http://psas.scripts.mit.edu/home/)
--- layout: page title: Resources --- Recommended reading on safety risk management: * [How Complex Systems Fail](http://web.mit.edu/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf) - a short introduction by Richard Cook applying systems thinking to safety * [How Complex Systems Fail, Velocity 2012](https://www.youtube.com/watch?v=2S0k12uZR14) - a talk by Richard Cook relating systems safety to IT * [Engineering a Safer World](https://mitpress.mit.edu/books/engineering-safer-world) - a free MIT book introducing STAMP (Systems-Theoretic Accident Modeling and Processes) and STPA (STAMP-Based Process Analysis) * [MIT Partnership for a Systems Approach to Safety (PSAS)](http://psas.scripts.mit.edu/home/)
Update "Engineering a Safer World" URL
Update "Engineering a Safer World" URL
Markdown
mit
information-safety/information-safety.github.io,information-safety/information-safety.github.io,information-safety/information-safety.github.io
markdown
## Code Before: --- layout: page title: Resources --- Recommended reading on safety risk management: * [How Complex Systems Fail](http://web.mit.edu/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf) - a short introduction by Richard Cook applying systems thinking to safety * [How Complex Systems Fail, Velocity 2012](https://www.youtube.com/watch?v=2S0k12uZR14) - a talk by Richard Cook relating systems safety to IT * [Engineering a Safer World](https://mitpress.mit.edu/sites/default/files/titles/free_download/9780262016629_Engineering_a_Safer_World.pdf) - a free MIT book introducing STAMP (Systems-Theoretic Accident Modeling and Processes) and STPA (STAMP-Based Process Analysis) * [MIT Partnership for a Systems Approach to Safety (PSAS)](http://psas.scripts.mit.edu/home/) ## Instruction: Update "Engineering a Safer World" URL ## Code After: --- layout: page title: Resources --- Recommended reading on safety risk management: * [How Complex Systems Fail](http://web.mit.edu/2.75/resources/random/How%20Complex%20Systems%20Fail.pdf) - a short introduction by Richard Cook applying systems thinking to safety * [How Complex Systems Fail, Velocity 2012](https://www.youtube.com/watch?v=2S0k12uZR14) - a talk by Richard Cook relating systems safety to IT * [Engineering a Safer World](https://mitpress.mit.edu/books/engineering-safer-world) - a free MIT book introducing STAMP (Systems-Theoretic Accident Modeling and Processes) and STPA (STAMP-Based Process Analysis) * [MIT Partnership for a Systems Approach to Safety (PSAS)](http://psas.scripts.mit.edu/home/)
b4a2214d84884148760623eb655ac9e538b27370
planterbox/tests/test_hooks/__init__.py
planterbox/tests/test_hooks/__init__.py
from planterbox import ( step, hook, ) hooks_run = set() @hook('before', 'feature') def before_feature_hook(feature_suite): global hooks_run hooks_run.add(('before', 'feature')) @hook('before', 'scenario') def before_scenario_hook(scenario_test): global hooks_run hooks_run.add(('before', 'scenario')) @hook('before', 'step') def before_step_hook(step_text): global hooks_run hooks_run.add(('before', 'step')) @step(r'I verify that all before hooks have run') def verify_before_hooks(world): global hooks_run assert hooks_run == {('before', 'feature'), ('before', 'scenario'), ('before', 'step'), } @hook('after', 'feature') def after_feature_hook(feature_suite): global hooks_run hooks_run.add(('after', 'feature')) assert hooks_run == {('before', 'feature'), ('before', 'scenario'), ('before', 'step'), ('after', 'feature'), ('after', 'scenario'), ('after', 'step'), } @hook('after', 'scenario') def after_scenario_hook(scenario_test): global hooks_run hooks_run.add(('after', 'scenario')) @hook('after', 'step') def after_step_hook(step_text): global hooks_run hooks_run.add(('after', 'step'))
from planterbox import ( step, hook, ) hooks_run = set() @hook('before', 'feature') def before_feature_hook(feature_suite): global hooks_run hooks_run.add(('before', 'feature')) @hook('before', 'scenario') def before_scenario_hook(test): global hooks_run hooks_run.add(('before', 'scenario')) @hook('before', 'step') def before_step_hook(step_text): global hooks_run hooks_run.add(('before', 'step')) @step(r'I verify that all before hooks have run') def verify_before_hooks(test): global hooks_run assert hooks_run == {('before', 'feature'), ('before', 'scenario'), ('before', 'step'), } @hook('after', 'feature') def after_feature_hook(feature_suite): global hooks_run hooks_run.add(('after', 'feature')) assert hooks_run == {('before', 'feature'), ('before', 'scenario'), ('before', 'step'), ('after', 'feature'), ('after', 'scenario'), ('after', 'step'), } @hook('after', 'scenario') def after_scenario_hook(test): global hooks_run hooks_run.add(('after', 'scenario')) @hook('after', 'step') def after_step_hook(step_text): global hooks_run hooks_run.add(('after', 'step'))
Clarify arguments in tests slightly
Clarify arguments in tests slightly
Python
mit
npilon/planterbox
python
## Code Before: from planterbox import ( step, hook, ) hooks_run = set() @hook('before', 'feature') def before_feature_hook(feature_suite): global hooks_run hooks_run.add(('before', 'feature')) @hook('before', 'scenario') def before_scenario_hook(scenario_test): global hooks_run hooks_run.add(('before', 'scenario')) @hook('before', 'step') def before_step_hook(step_text): global hooks_run hooks_run.add(('before', 'step')) @step(r'I verify that all before hooks have run') def verify_before_hooks(world): global hooks_run assert hooks_run == {('before', 'feature'), ('before', 'scenario'), ('before', 'step'), } @hook('after', 'feature') def after_feature_hook(feature_suite): global hooks_run hooks_run.add(('after', 'feature')) assert hooks_run == {('before', 'feature'), ('before', 'scenario'), ('before', 'step'), ('after', 'feature'), ('after', 'scenario'), ('after', 'step'), } @hook('after', 'scenario') def after_scenario_hook(scenario_test): global hooks_run hooks_run.add(('after', 'scenario')) @hook('after', 'step') def after_step_hook(step_text): global hooks_run hooks_run.add(('after', 'step')) ## Instruction: Clarify arguments in tests slightly ## Code After: from planterbox import ( step, hook, ) hooks_run = set() @hook('before', 'feature') def before_feature_hook(feature_suite): global hooks_run hooks_run.add(('before', 'feature')) @hook('before', 'scenario') def before_scenario_hook(test): global hooks_run hooks_run.add(('before', 'scenario')) @hook('before', 'step') def before_step_hook(step_text): global hooks_run hooks_run.add(('before', 'step')) @step(r'I verify that all before hooks have run') def verify_before_hooks(test): global hooks_run assert hooks_run == {('before', 'feature'), ('before', 'scenario'), ('before', 'step'), } @hook('after', 'feature') def after_feature_hook(feature_suite): global hooks_run hooks_run.add(('after', 'feature')) assert hooks_run == {('before', 'feature'), ('before', 'scenario'), ('before', 'step'), ('after', 'feature'), ('after', 'scenario'), ('after', 'step'), } @hook('after', 'scenario') def after_scenario_hook(test): global hooks_run hooks_run.add(('after', 'scenario')) @hook('after', 'step') def after_step_hook(step_text): global hooks_run hooks_run.add(('after', 'step'))
de5d1830e564affb191cc10f08a2d0a684ddd715
Tests/BourneTests/ArrayTests.swift
Tests/BourneTests/ArrayTests.swift
import Foundation import Foundation import XCTest @testable import Bourne class ArrayTests: XCTestCase { func testArrayDecoding() { let json = JSON([1]) XCTAssertEqual(json.array?.first?.int, 1) XCTAssertEqual(json.array?.count, 1) } static var allTests = [ ("testArrayDecoding", testArrayDecoding), ] }
import Foundation import Foundation import XCTest @testable import Bourne class ArrayTests: XCTestCase { func testArrayDecoding() { let json = JSON([1]) XCTAssertEqual(json.array?.first?.int, 1) XCTAssertEqual(json.array?.count, 1) } func testInvalidArrayDecoding() { let notAnArray = JSON(nil) XCTAssertNil(notAnArray.array) XCTAssertEqual(notAnArray.arrayValue, []) } static var allTests = [ ("testArrayDecoding", testArrayDecoding), ("testInvalidArrayDecoding", testInvalidArrayDecoding), ] }
Add cases for invalid arrays
[Tests] Add cases for invalid arrays
Swift
mit
nanoxd/Bourne,nanoxd/Bourne
swift
## Code Before: import Foundation import Foundation import XCTest @testable import Bourne class ArrayTests: XCTestCase { func testArrayDecoding() { let json = JSON([1]) XCTAssertEqual(json.array?.first?.int, 1) XCTAssertEqual(json.array?.count, 1) } static var allTests = [ ("testArrayDecoding", testArrayDecoding), ] } ## Instruction: [Tests] Add cases for invalid arrays ## Code After: import Foundation import Foundation import XCTest @testable import Bourne class ArrayTests: XCTestCase { func testArrayDecoding() { let json = JSON([1]) XCTAssertEqual(json.array?.first?.int, 1) XCTAssertEqual(json.array?.count, 1) } func testInvalidArrayDecoding() { let notAnArray = JSON(nil) XCTAssertNil(notAnArray.array) XCTAssertEqual(notAnArray.arrayValue, []) } static var allTests = [ ("testArrayDecoding", testArrayDecoding), ("testInvalidArrayDecoding", testInvalidArrayDecoding), ] }
d76497aad6a0040c78f816c10081b7ec71a2bec6
src/org/bootstrapjsp/tags/core/carousel/CarouselItem.java
src/org/bootstrapjsp/tags/core/carousel/CarouselItem.java
/* * Copyright (c) 2014 Darren Scott - All Rights Reserved * * This program is distributed under LGPL Version 2.1 in the hope that * it will be useful, but WITHOUT ANY WARRANTY. */ package org.bootstrapjsp.tags.core.carousel; import javax.servlet.jsp.tagext.JspTag; import org.bootstrapjsp.facet.ActiveFacet; import org.bootstrapjsp.tags.html.Div; import org.tldgen.annotations.Attribute; import org.tldgen.annotations.Tag; /** * A carousel item. * <p> * &lt;div class="item"&gt;...&lt;/div&gt; * </p> */ @Tag(name="carouselitem",dynamicAttributes=true) public class CarouselItem extends Div { public CarouselItem() { super("item"); super.addFacet(new ActiveFacet(false)); } /** * Sets a caption for this item. The caption is automatically * wrapped in a &lt;carouselcaption&gt;. */ @Attribute(rtexprvalue=true) public void setCaption(String caption) { super.appendChild(new CarouselCaption(caption), BEFORE_BODY); } @Override public void setParent(JspTag parent) { if (parent != null) { if (parent instanceof Carousel) { ((Carousel) parent).addItem(this); } else { throw new IllegalArgumentException("Illegal parent"); } } super.setParent(parent); } }
/* * Copyright (c) 2014 Darren Scott - All Rights Reserved * * This program is distributed under LGPL Version 2.1 in the hope that * it will be useful, but WITHOUT ANY WARRANTY. */ package org.bootstrapjsp.tags.core.carousel; import javax.servlet.jsp.tagext.JspTag; import org.bootstrapjsp.facet.ActiveFacet; import org.bootstrapjsp.tags.html.Div; import org.tldgen.annotations.Attribute; import org.tldgen.annotations.Tag; /** * A carousel item. * <p> * &lt;div class="item"&gt;...&lt;/div&gt; * </p> */ @Tag(name="carouselitem",dynamicAttributes=true) public class CarouselItem extends Div { @SuppressWarnings("unchecked") public CarouselItem() { super("item"); super.addFacet(new ActiveFacet(false)); super.setValidParents(Carousel.class); } /** * Sets a caption for this item. The caption is automatically * wrapped in a &lt;carouselcaption&gt;. */ @Attribute(rtexprvalue=true) public void setCaption(String caption) { super.appendChild(new CarouselCaption(caption), BEFORE_BODY); } @Override public void setParent(JspTag parent) { if (parent != null) { if (parent instanceof Carousel) { ((Carousel) parent).addItem(this); } } super.setParent(parent); } }
Set valid parents on carousel item
Set valid parents on carousel item
Java
lgpl-2.1
Mrdigs/Bootstrap.jsp,Mrdigs/Bootstrap.jsp,Mrdigs/Bootstrap.jsp
java
## Code Before: /* * Copyright (c) 2014 Darren Scott - All Rights Reserved * * This program is distributed under LGPL Version 2.1 in the hope that * it will be useful, but WITHOUT ANY WARRANTY. */ package org.bootstrapjsp.tags.core.carousel; import javax.servlet.jsp.tagext.JspTag; import org.bootstrapjsp.facet.ActiveFacet; import org.bootstrapjsp.tags.html.Div; import org.tldgen.annotations.Attribute; import org.tldgen.annotations.Tag; /** * A carousel item. * <p> * &lt;div class="item"&gt;...&lt;/div&gt; * </p> */ @Tag(name="carouselitem",dynamicAttributes=true) public class CarouselItem extends Div { public CarouselItem() { super("item"); super.addFacet(new ActiveFacet(false)); } /** * Sets a caption for this item. The caption is automatically * wrapped in a &lt;carouselcaption&gt;. */ @Attribute(rtexprvalue=true) public void setCaption(String caption) { super.appendChild(new CarouselCaption(caption), BEFORE_BODY); } @Override public void setParent(JspTag parent) { if (parent != null) { if (parent instanceof Carousel) { ((Carousel) parent).addItem(this); } else { throw new IllegalArgumentException("Illegal parent"); } } super.setParent(parent); } } ## Instruction: Set valid parents on carousel item ## Code After: /* * Copyright (c) 2014 Darren Scott - All Rights Reserved * * This program is distributed under LGPL Version 2.1 in the hope that * it will be useful, but WITHOUT ANY WARRANTY. */ package org.bootstrapjsp.tags.core.carousel; import javax.servlet.jsp.tagext.JspTag; import org.bootstrapjsp.facet.ActiveFacet; import org.bootstrapjsp.tags.html.Div; import org.tldgen.annotations.Attribute; import org.tldgen.annotations.Tag; /** * A carousel item. * <p> * &lt;div class="item"&gt;...&lt;/div&gt; * </p> */ @Tag(name="carouselitem",dynamicAttributes=true) public class CarouselItem extends Div { @SuppressWarnings("unchecked") public CarouselItem() { super("item"); super.addFacet(new ActiveFacet(false)); super.setValidParents(Carousel.class); } /** * Sets a caption for this item. The caption is automatically * wrapped in a &lt;carouselcaption&gt;. */ @Attribute(rtexprvalue=true) public void setCaption(String caption) { super.appendChild(new CarouselCaption(caption), BEFORE_BODY); } @Override public void setParent(JspTag parent) { if (parent != null) { if (parent instanceof Carousel) { ((Carousel) parent).addItem(this); } } super.setParent(parent); } }
19ede6465eb9102bb59f78842f5c6fa5d0243b4c
.github/PULL_REQUEST_TEMPLATE.md
.github/PULL_REQUEST_TEMPLATE.md
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have read the **CONTRIBUTING** document. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. Pull requests should be thought of as a conversation. There will be some back and forth when trying to get code merged into this or any other project. With all but the simplest changes you can and should expect that the maintainers of the project will request changes to your code. Please be aware of that and check in after you open your PR in order to get your code merged in cleanly. Thanks!
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have read the **[CONTRIBUTING](https://github.com/h5bp/html5-boilerplate/blob/main/.github/CONTRIBUTING.md)** document. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. Pull requests should be thought of as a conversation. There will be some back and forth when trying to get code merged into this or any other project. With all but the simplest changes you can and should expect that the maintainers of the project will request changes to your code. Please be aware of that and check in after you open your PR in order to get your code merged in cleanly. Thanks!
Add link to CONTRIBUTING file
Add link to CONTRIBUTING file It can be easy to miss
Markdown
mit
h5bp/html5-boilerplate,h5bp/html5-boilerplate
markdown
## Code Before: <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have read the **CONTRIBUTING** document. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. Pull requests should be thought of as a conversation. There will be some back and forth when trying to get code merged into this or any other project. With all but the simplest changes you can and should expect that the maintainers of the project will request changes to your code. Please be aware of that and check in after you open your PR in order to get your code merged in cleanly. Thanks! ## Instruction: Add link to CONTRIBUTING file It can be easy to miss ## Code After: <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] My code follows the code style of this project. - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [ ] I have read the **[CONTRIBUTING](https://github.com/h5bp/html5-boilerplate/blob/main/.github/CONTRIBUTING.md)** document. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. Pull requests should be thought of as a conversation. There will be some back and forth when trying to get code merged into this or any other project. With all but the simplest changes you can and should expect that the maintainers of the project will request changes to your code. Please be aware of that and check in after you open your PR in order to get your code merged in cleanly. Thanks!
9db6959a3fa898982232b63e47ea17eacb4de1b7
backup.sh
backup.sh
RDIFF=rdiff-backup # first two arguments are source and destintation SOURCE=${1} DEST=${2} # configuration options VERBOSITY=5 KEEP_FOR=3M echo "Backing up '${SOURCE}' to '${DEST}'..." ${RDIFF} \ --exclude '/tmp/*' \ --exclude '/proc/*' \ --exclude '/sys/*' \ --exclude '/mnt/*/*' \ --exclude-special-files \ --exclude-other-filesystems \ --verbosity "${VERBOSITY}" \ "${SOURCE}" "${DEST}" echo "Purging old backups in '${DEST}'..." ${RDIFF} \ --remove-older-than "${KEEP_FOR}" \ --force \ --verbosity "${VERBOSITY}" \ "${DEST}"
RDIFF=rdiff-backup # always backup the root system SOURCE='/' # only argument is the destination DEST=${1} # configuration options VERBOSITY=5 KEEP_FOR=3M echo "Backing up '${SOURCE}' to '${DEST}'..." echo ${RDIFF} \ --exclude '/home/*/.cache' \ --include '/home' \ --exclude '/tmp/*' \ --exclude '/proc/*' \ --exclude '/sys/*' \ --exclude '/mnt/*/*' \ --exclude-special-files \ --exclude-other-filesystems \ --verbosity "${VERBOSITY}" \ "${SOURCE}" "${DEST}" echo echo "Purging old backups in '${DEST}'..." echo ${RDIFF} \ --remove-older-than "${KEEP_FOR}" \ --force \ --verbosity "${VERBOSITY}" \ "${DEST}"
Include home folder, remove first argument
Include home folder, remove first argument The first argument is unceccesary since we'll always be backing up the entire system. The home folder wasn't being included before since it was on a separate drive. This forces it to be included regardless of where its located.
Shell
mit
jasontbradshaw/backup,jasontbradshaw/backup
shell
## Code Before: RDIFF=rdiff-backup # first two arguments are source and destintation SOURCE=${1} DEST=${2} # configuration options VERBOSITY=5 KEEP_FOR=3M echo "Backing up '${SOURCE}' to '${DEST}'..." ${RDIFF} \ --exclude '/tmp/*' \ --exclude '/proc/*' \ --exclude '/sys/*' \ --exclude '/mnt/*/*' \ --exclude-special-files \ --exclude-other-filesystems \ --verbosity "${VERBOSITY}" \ "${SOURCE}" "${DEST}" echo "Purging old backups in '${DEST}'..." ${RDIFF} \ --remove-older-than "${KEEP_FOR}" \ --force \ --verbosity "${VERBOSITY}" \ "${DEST}" ## Instruction: Include home folder, remove first argument The first argument is unceccesary since we'll always be backing up the entire system. The home folder wasn't being included before since it was on a separate drive. This forces it to be included regardless of where its located. ## Code After: RDIFF=rdiff-backup # always backup the root system SOURCE='/' # only argument is the destination DEST=${1} # configuration options VERBOSITY=5 KEEP_FOR=3M echo "Backing up '${SOURCE}' to '${DEST}'..." echo ${RDIFF} \ --exclude '/home/*/.cache' \ --include '/home' \ --exclude '/tmp/*' \ --exclude '/proc/*' \ --exclude '/sys/*' \ --exclude '/mnt/*/*' \ --exclude-special-files \ --exclude-other-filesystems \ --verbosity "${VERBOSITY}" \ "${SOURCE}" "${DEST}" echo echo "Purging old backups in '${DEST}'..." echo ${RDIFF} \ --remove-older-than "${KEEP_FOR}" \ --force \ --verbosity "${VERBOSITY}" \ "${DEST}"
2c52a5392e82141cf595ade8c0c8859ce6dd674e
metadata/org.deluge.trireme.txt
metadata/org.deluge.trireme.txt
Categories:Internet License:GPL-3.0-or-later Web Site: Source Code:https://github.com/teal77/trireme Issue Tracker:https://github.com/teal77/trireme/issues Name:Trireme for Deluge Auto Name:Deluge Summary:Deluge thin client Description: Use this app to connect and manage your Deluge Daemon. Deluge is a popular torrent client which follows a server client model. This app will act as a client. . Repo Type:git Repo:https://github.com/teal77/trireme.git Build:0.8.1,5 commit=v0.8.1 output=build/app/outputs/apk/fdroid/release/app-fdroid-release.apk srclibs=flutter@beta prebuild=sed -i -e 's|git@github.com:|https://github.com/|' pubspec.lock pubspec.yaml build=export PATH=$$flutter$$/bin:$PATH && \ flutter config --no-analytics && \ flutter build apk --flavor fdroid Auto Update Mode:Version v%v Update Check Mode:Tags Current Version:0.8.1 Current Version Code:5
Categories:Internet License:GPL-3.0-or-later Web Site: Source Code:https://github.com/teal77/trireme Issue Tracker:https://github.com/teal77/trireme/issues Name:Trireme for Deluge Auto Name:Deluge Summary:Deluge thin client Description: Use this app to connect and manage your Deluge Daemon. Deluge is a popular torrent client which follows a server client model. This app will act as a client. . Repo Type:git Repo:https://github.com/teal77/trireme.git Build:0.8.1,5 commit=v0.8.1 output=build/app/outputs/apk/fdroid/release/app-fdroid-release.apk srclibs=flutter@beta prebuild=sed -i -e 's|git@github.com:|https://github.com/|' pubspec.lock pubspec.yaml build=export PATH=$$flutter$$/bin:$PATH && \ flutter config --no-analytics && \ flutter build apk --flavor fdroid Build:0.9,6 commit=v0.9 output=build/app/outputs/apk/fdroid/release/app-fdroid-release.apk srclibs=flutter@beta prebuild=sed -i -e 's|git@github.com:|https://github.com/|' pubspec.lock pubspec.yaml build=export PATH=$$flutter$$/bin:$PATH && \ flutter config --no-analytics && \ flutter build apk --flavor fdroid Auto Update Mode:Version v%v Update Check Mode:Tags Current Version:0.9 Current Version Code:6
Update Trireme for Deluge to 0.9 (6)
Update Trireme for Deluge to 0.9 (6)
Text
agpl-3.0
f-droid/fdroiddata,f-droid/fdroiddata,f-droid/fdroid-data
text
## Code Before: Categories:Internet License:GPL-3.0-or-later Web Site: Source Code:https://github.com/teal77/trireme Issue Tracker:https://github.com/teal77/trireme/issues Name:Trireme for Deluge Auto Name:Deluge Summary:Deluge thin client Description: Use this app to connect and manage your Deluge Daemon. Deluge is a popular torrent client which follows a server client model. This app will act as a client. . Repo Type:git Repo:https://github.com/teal77/trireme.git Build:0.8.1,5 commit=v0.8.1 output=build/app/outputs/apk/fdroid/release/app-fdroid-release.apk srclibs=flutter@beta prebuild=sed -i -e 's|git@github.com:|https://github.com/|' pubspec.lock pubspec.yaml build=export PATH=$$flutter$$/bin:$PATH && \ flutter config --no-analytics && \ flutter build apk --flavor fdroid Auto Update Mode:Version v%v Update Check Mode:Tags Current Version:0.8.1 Current Version Code:5 ## Instruction: Update Trireme for Deluge to 0.9 (6) ## Code After: Categories:Internet License:GPL-3.0-or-later Web Site: Source Code:https://github.com/teal77/trireme Issue Tracker:https://github.com/teal77/trireme/issues Name:Trireme for Deluge Auto Name:Deluge Summary:Deluge thin client Description: Use this app to connect and manage your Deluge Daemon. Deluge is a popular torrent client which follows a server client model. This app will act as a client. . Repo Type:git Repo:https://github.com/teal77/trireme.git Build:0.8.1,5 commit=v0.8.1 output=build/app/outputs/apk/fdroid/release/app-fdroid-release.apk srclibs=flutter@beta prebuild=sed -i -e 's|git@github.com:|https://github.com/|' pubspec.lock pubspec.yaml build=export PATH=$$flutter$$/bin:$PATH && \ flutter config --no-analytics && \ flutter build apk --flavor fdroid Build:0.9,6 commit=v0.9 output=build/app/outputs/apk/fdroid/release/app-fdroid-release.apk srclibs=flutter@beta prebuild=sed -i -e 's|git@github.com:|https://github.com/|' pubspec.lock pubspec.yaml build=export PATH=$$flutter$$/bin:$PATH && \ flutter config --no-analytics && \ flutter build apk --flavor fdroid Auto Update Mode:Version v%v Update Check Mode:Tags Current Version:0.9 Current Version Code:6
932251614ce368e8e300febce3c409246787c047
roles/krb5/tasks/main.yml
roles/krb5/tasks/main.yml
--- # also remember to do the Firefox setup for Kerberos/GSSAPI auth: # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/sso-config-firefox.html - name: Include RH Kerberos infrastructure information include_vars: secrets.yml - dnf: name=krb5-workstation state=latest become: true tags: - packages - template: src: krb5.conf.j2 dest: /etc/krb5.conf mode: '0644' owner: root group: root backup: true become: true
--- # also remember to do the Firefox setup for Kerberos/GSSAPI auth: # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/sso-config-firefox.html - name: Include RH Kerberos infrastructure information include_vars: secrets.yml - dnf: name={{ item }} state=latest become: true with_items: - krb5-workstation - kstart tags: - packages - template: src: krb5.conf.j2 dest: /etc/krb5.conf mode: '0644' owner: root group: root backup: true become: true
Install krenew to keep kerberos ticket fresh and clean
Install krenew to keep kerberos ticket fresh and clean
YAML
mit
ryansb/workstation,ryansb/workstation,ryansb/workstation
yaml
## Code Before: --- # also remember to do the Firefox setup for Kerberos/GSSAPI auth: # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/sso-config-firefox.html - name: Include RH Kerberos infrastructure information include_vars: secrets.yml - dnf: name=krb5-workstation state=latest become: true tags: - packages - template: src: krb5.conf.j2 dest: /etc/krb5.conf mode: '0644' owner: root group: root backup: true become: true ## Instruction: Install krenew to keep kerberos ticket fresh and clean ## Code After: --- # also remember to do the Firefox setup for Kerberos/GSSAPI auth: # https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/sso-config-firefox.html - name: Include RH Kerberos infrastructure information include_vars: secrets.yml - dnf: name={{ item }} state=latest become: true with_items: - krb5-workstation - kstart tags: - packages - template: src: krb5.conf.j2 dest: /etc/krb5.conf mode: '0644' owner: root group: root backup: true become: true
eb7db067f9cb41837602de995543367d322bbaff
test/integration/roles/test_template/files/foo-py26.txt
test/integration/roles/test_template/files/foo-py26.txt
templated_var_loaded { "bool": true, "multi_part": "1Foo", "number": 5, "string_num": "5" }
templated_var_loaded { "bool": true, "multi_part": "1Foo", "null_type": null, "number": 5, "string_num": "5" }
Fix template test results on python2.6
Fix template test results on python2.6
Text
mit
thaim/ansible,thaim/ansible
text
## Code Before: templated_var_loaded { "bool": true, "multi_part": "1Foo", "number": 5, "string_num": "5" } ## Instruction: Fix template test results on python2.6 ## Code After: templated_var_loaded { "bool": true, "multi_part": "1Foo", "null_type": null, "number": 5, "string_num": "5" }
2edc7dc9938d371d249a02f27168e4a153457432
python3.4/Dockerfile
python3.4/Dockerfile
FROM ubuntu:13.10 MAINTAINER Michael Twomey, mick@twomeylee.name RUN echo "deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu saucy main" > /etc/apt/sources.list.d/deadsnakes.list \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C RUN apt-get update \ && apt-get upgrade -y \ && apt-get install -y \ build-essential \ ca-certificates \ curl \ gcc \ git \ libpq-dev \ make \ mercurial \ python3.4 \ python3.4-dev \ ssh \ && apt-get autoremove \ && apt-get clean RUN curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py > /tmp/get-pip.py RUN python3.4 /tmp/get-pip.py RUN pip3.4 install -U "setuptools>=3.4.1" RUN pip3.4 install -U "pip>=1.5.4" RUN pip3.4 install -U "virtualenv>=1.11.4"
FROM ubuntu:13.10 MAINTAINER Michael Twomey, mick@twomeylee.name RUN echo "deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu saucy main" > /etc/apt/sources.list.d/deadsnakes.list \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C RUN apt-get update \ && apt-get upgrade -y \ && apt-get install -y \ build-essential \ ca-certificates \ curl \ gcc \ git \ libpq-dev \ make \ mercurial \ python3.4 \ python3.4-dev \ ssh \ && apt-get autoremove \ && apt-get clean ADD https://github.com/pypa/pip/raw/645180e2714b4ffcf40363a608239e089c9dafab/contrib/get-pip.py /root/get-pip.py RUN python3.4 /root/get-pip.py RUN pip3.4 install -U "setuptools>=3.4.1" RUN pip3.4 install -U "pip>=1.5.4" RUN pip3.4 install -U "virtualenv>=1.11.4"
Use ADD instead of curl to fetch get-pip.py
Use ADD instead of curl to fetch get-pip.py
unknown
mit
micktwomey/docker-python
unknown
## Code Before: FROM ubuntu:13.10 MAINTAINER Michael Twomey, mick@twomeylee.name RUN echo "deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu saucy main" > /etc/apt/sources.list.d/deadsnakes.list \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C RUN apt-get update \ && apt-get upgrade -y \ && apt-get install -y \ build-essential \ ca-certificates \ curl \ gcc \ git \ libpq-dev \ make \ mercurial \ python3.4 \ python3.4-dev \ ssh \ && apt-get autoremove \ && apt-get clean RUN curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py > /tmp/get-pip.py RUN python3.4 /tmp/get-pip.py RUN pip3.4 install -U "setuptools>=3.4.1" RUN pip3.4 install -U "pip>=1.5.4" RUN pip3.4 install -U "virtualenv>=1.11.4" ## Instruction: Use ADD instead of curl to fetch get-pip.py ## Code After: FROM ubuntu:13.10 MAINTAINER Michael Twomey, mick@twomeylee.name RUN echo "deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu saucy main" > /etc/apt/sources.list.d/deadsnakes.list \ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys DB82666C RUN apt-get update \ && apt-get upgrade -y \ && apt-get install -y \ build-essential \ ca-certificates \ curl \ gcc \ git \ libpq-dev \ make \ mercurial \ python3.4 \ python3.4-dev \ ssh \ && apt-get autoremove \ && apt-get clean ADD https://github.com/pypa/pip/raw/645180e2714b4ffcf40363a608239e089c9dafab/contrib/get-pip.py /root/get-pip.py RUN python3.4 /root/get-pip.py RUN pip3.4 install -U "setuptools>=3.4.1" RUN pip3.4 install -U "pip>=1.5.4" RUN pip3.4 install -U "virtualenv>=1.11.4"
4cf96c20253a562b21e8f96488c964758037cb75
.travis.yml
.travis.yml
--- git: depth: 1 sudo: false language: node_js cache: directories: - node_modules node_js: - '6' - '5' - '4' script: npm run test
--- git: depth: 1 sudo: false language: node_js cache: directories: - node_modules node_js: - '6' - '5' - '4' script: npm run bootstrap && npm run build && npm run test
Add all necessary steps for running tests
Add all necessary steps for running tests
YAML
mit
babel/babili,babel/babili,babel/babili,garyjN7/babili,garyjN7/babili,garyjN7/babili
yaml
## Code Before: --- git: depth: 1 sudo: false language: node_js cache: directories: - node_modules node_js: - '6' - '5' - '4' script: npm run test ## Instruction: Add all necessary steps for running tests ## Code After: --- git: depth: 1 sudo: false language: node_js cache: directories: - node_modules node_js: - '6' - '5' - '4' script: npm run bootstrap && npm run build && npm run test
386549b627363ec2c711b740a049d59aaa387bfb
plasmoid/contents/ui/controls/VolumeControl.qml
plasmoid/contents/ui/controls/VolumeControl.qml
import QtQuick 2.8 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.5 import org.kde.kirigami 2.8 as Kirigami RowLayout { property bool showButton: true property bool showSlider: true property bool showLabel: true spacing: 1 CheckButton { icon.name: mute ? "player-volume-muted" : "player-volume" visible: showButton flat: true onClicked: player.setMute(!mute) checked: mute ToolTip.text: mute ? 'Volume is muted' : 'Mute' ToolTip.visible: hovered ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval } Slider { id: control visible: showSlider padding: 0 value: volume Layout.fillWidth: true onMoved: player.setVolume(value) ToolTip { visible: showLabel && control.pressed text: Math.round(control.value*100) + '%' delay: 0 } } }
import QtQuick 2.8 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.5 import org.kde.kirigami 2.8 as Kirigami RowLayout { property bool showButton: true property bool showSlider: true property bool showLabel: true spacing: 1 CheckButton { icon.name: mute ? "volume-level-muted" : "volume-level-high" visible: showButton flat: true onClicked: player.setMute(!mute) checked: mute ToolTip.text: mute ? 'Volume is muted' : 'Mute' ToolTip.visible: hovered ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval } Slider { id: control visible: showSlider padding: 0 value: volume Layout.fillWidth: true onMoved: player.setVolume(value) ToolTip { visible: showLabel && control.pressed text: Math.round(control.value*100) + '%' delay: 0 } } }
Use different icons for mute/muted
Use different icons for mute/muted
QML
mit
noee/mcwsplasmoid
qml
## Code Before: import QtQuick 2.8 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.5 import org.kde.kirigami 2.8 as Kirigami RowLayout { property bool showButton: true property bool showSlider: true property bool showLabel: true spacing: 1 CheckButton { icon.name: mute ? "player-volume-muted" : "player-volume" visible: showButton flat: true onClicked: player.setMute(!mute) checked: mute ToolTip.text: mute ? 'Volume is muted' : 'Mute' ToolTip.visible: hovered ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval } Slider { id: control visible: showSlider padding: 0 value: volume Layout.fillWidth: true onMoved: player.setVolume(value) ToolTip { visible: showLabel && control.pressed text: Math.round(control.value*100) + '%' delay: 0 } } } ## Instruction: Use different icons for mute/muted ## Code After: import QtQuick 2.8 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.5 import org.kde.kirigami 2.8 as Kirigami RowLayout { property bool showButton: true property bool showSlider: true property bool showLabel: true spacing: 1 CheckButton { icon.name: mute ? "volume-level-muted" : "volume-level-high" visible: showButton flat: true onClicked: player.setMute(!mute) checked: mute ToolTip.text: mute ? 'Volume is muted' : 'Mute' ToolTip.visible: hovered ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval } Slider { id: control visible: showSlider padding: 0 value: volume Layout.fillWidth: true onMoved: player.setVolume(value) ToolTip { visible: showLabel && control.pressed text: Math.round(control.value*100) + '%' delay: 0 } } }
f6f5e6f7db67d95ff616bd49af0e5a3c37b9d7dd
.circleci/deploy_fat_lib.sh
.circleci/deploy_fat_lib.sh
if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" == "master" -o "$CIRCLE_BRANCH" == "develop" ]; then cd ../lib-ledger-core-artifacts/ios echo "======> Build Fat Library" pwd #We don't put x86_64/ledger-core.framework/ledger-core otherwise we have a problem when pushing to AppStore lipo -create armv7/ledger-core.framework/ledger-core arm64/ledger-core.framework/ledger-core -o ledger-core mkdir ledger-core.framework mv ledger-core ledger-core.framework/ cp armv7/ledger-core.framework/Info.plist ledger-core.framework/ install_name_tool -add_rpath "@executable_path/Frameworks/universal" ledger-core.framework/ledger-core lipo -info ledger-core.framework/ledger-core aws s3 sync ./ s3://ledger-lib-ledger-core/$LIB_VERSION/ios/universal --acl public-read --exclude "x86_64/*" --exclude "armv7/*" --exclude "arm64/*" && \ aws s3 ls s3://ledger-lib-ledger-core/$LIB_VERSION/ios/universal; fi
if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" == "master" -o "$CIRCLE_BRANCH" == "develop" ]; then cd ../lib-ledger-core-artifacts/ios echo "======> Build Fat Library" pwd lipo -create armv7/ledger-core.framework/ledger-core arm64/ledger-core.framework/ledger-core x86_64/ledger-core.framework/ledger-core -o ledger-core mkdir ledger-core.framework mv ledger-core ledger-core.framework/ cp armv7/ledger-core.framework/Info.plist ledger-core.framework/ install_name_tool -add_rpath "@executable_path/Frameworks/universal" ledger-core.framework/ledger-core lipo -info ledger-core.framework/ledger-core aws s3 sync ./ s3://ledger-lib-ledger-core/$LIB_VERSION/ios/universal --acl public-read --exclude "x86_64/*" --exclude "armv7/*" --exclude "arm64/*" && \ aws s3 ls s3://ledger-lib-ledger-core/$LIB_VERSION/ios/universal; fi
Add x86_64 to fat framework
[iOS] Add x86_64 to fat framework
Shell
mit
LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core,LedgerHQ/lib-ledger-core
shell
## Code Before: if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" == "master" -o "$CIRCLE_BRANCH" == "develop" ]; then cd ../lib-ledger-core-artifacts/ios echo "======> Build Fat Library" pwd #We don't put x86_64/ledger-core.framework/ledger-core otherwise we have a problem when pushing to AppStore lipo -create armv7/ledger-core.framework/ledger-core arm64/ledger-core.framework/ledger-core -o ledger-core mkdir ledger-core.framework mv ledger-core ledger-core.framework/ cp armv7/ledger-core.framework/Info.plist ledger-core.framework/ install_name_tool -add_rpath "@executable_path/Frameworks/universal" ledger-core.framework/ledger-core lipo -info ledger-core.framework/ledger-core aws s3 sync ./ s3://ledger-lib-ledger-core/$LIB_VERSION/ios/universal --acl public-read --exclude "x86_64/*" --exclude "armv7/*" --exclude "arm64/*" && \ aws s3 ls s3://ledger-lib-ledger-core/$LIB_VERSION/ios/universal; fi ## Instruction: [iOS] Add x86_64 to fat framework ## Code After: if [ -n "$CIRCLE_TAG" ] || [ "$CIRCLE_BRANCH" == "master" -o "$CIRCLE_BRANCH" == "develop" ]; then cd ../lib-ledger-core-artifacts/ios echo "======> Build Fat Library" pwd lipo -create armv7/ledger-core.framework/ledger-core arm64/ledger-core.framework/ledger-core x86_64/ledger-core.framework/ledger-core -o ledger-core mkdir ledger-core.framework mv ledger-core ledger-core.framework/ cp armv7/ledger-core.framework/Info.plist ledger-core.framework/ install_name_tool -add_rpath "@executable_path/Frameworks/universal" ledger-core.framework/ledger-core lipo -info ledger-core.framework/ledger-core aws s3 sync ./ s3://ledger-lib-ledger-core/$LIB_VERSION/ios/universal --acl public-read --exclude "x86_64/*" --exclude "armv7/*" --exclude "arm64/*" && \ aws s3 ls s3://ledger-lib-ledger-core/$LIB_VERSION/ios/universal; fi
3b4ea0b053ea0273f6555f6545096f18dc170887
third_party/zefyr/packages/zefyr/pubspec.yaml
third_party/zefyr/packages/zefyr/pubspec.yaml
name: zefyr description: Clean, minimalistic and collaboration-ready rich text editor for Flutter. version: 0.11.0 author: Anatoly Pulyaevskiy <anatoly.pulyaevskiy@gmail.com> homepage: https://github.com/memspace/zefyr environment: sdk: '>=2.2.2 <3.0.0' dependencies: flutter: sdk: flutter collection: ^1.14.6 url_launcher: ^5.0.0 quill_delta: ^1.0.0 notus: ^0.1.0 meta: ^1.1.0 quiver_hashcode: ^2.0.0 dev_dependencies: flutter_test: sdk: flutter pedantic: ^1.0.0
name: zefyr description: Clean, minimalistic and collaboration-ready rich text editor for Flutter. version: 0.11.0 author: Anatoly Pulyaevskiy <anatoly.pulyaevskiy@gmail.com> homepage: https://github.com/memspace/zefyr environment: sdk: '>=2.2.2 <3.0.0' dependencies: flutter: sdk: flutter collection: ^1.14.6 url_launcher: ^5.0.0 quill_delta: ^1.0.0 notus: path: ../notus meta: ^1.1.0 quiver_hashcode: ^2.0.0 dev_dependencies: flutter_test: sdk: flutter pedantic: ^1.0.0
Use the local version of notus by path
Use the local version of notus by path
YAML
apache-2.0
google/note-maps,google/note-maps,google/note-maps,google/note-maps,google/note-maps,google/note-maps,google/note-maps,google/note-maps,google/note-maps,google/note-maps,google/note-maps
yaml
## Code Before: name: zefyr description: Clean, minimalistic and collaboration-ready rich text editor for Flutter. version: 0.11.0 author: Anatoly Pulyaevskiy <anatoly.pulyaevskiy@gmail.com> homepage: https://github.com/memspace/zefyr environment: sdk: '>=2.2.2 <3.0.0' dependencies: flutter: sdk: flutter collection: ^1.14.6 url_launcher: ^5.0.0 quill_delta: ^1.0.0 notus: ^0.1.0 meta: ^1.1.0 quiver_hashcode: ^2.0.0 dev_dependencies: flutter_test: sdk: flutter pedantic: ^1.0.0 ## Instruction: Use the local version of notus by path ## Code After: name: zefyr description: Clean, minimalistic and collaboration-ready rich text editor for Flutter. version: 0.11.0 author: Anatoly Pulyaevskiy <anatoly.pulyaevskiy@gmail.com> homepage: https://github.com/memspace/zefyr environment: sdk: '>=2.2.2 <3.0.0' dependencies: flutter: sdk: flutter collection: ^1.14.6 url_launcher: ^5.0.0 quill_delta: ^1.0.0 notus: path: ../notus meta: ^1.1.0 quiver_hashcode: ^2.0.0 dev_dependencies: flutter_test: sdk: flutter pedantic: ^1.0.0
3b1fc736adb1ace3183e0ce21fe79568bb33e808
templates/navbar.html
templates/navbar.html
{% load i18n %} {% load profiles %} <div class="navbar navbar-inverse navbar-static-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="{% url 'index' %}">Memoir</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> {% url 'quote:top' as top_page %} <li class="{% if request.get_full_path == top_page %}active{% endif %}"> <a href="{{ top_page }}">{% trans "Top" %}</a> </li> </ul> <ul class="nav navbar-nav navbar-right flip"> <li> <div class="btn-nav"> <a class="btn btn-primary navbar-btn" href="{% url 'quote:create' %}">{% trans "Create" %}</a> </div> </li> <li> <div class="navbar-text"> {% if user.is_authenticated %} <span> {% trans "Logged in as " %}<strong>{% profile_link user classes="navbar-link" %}</strong> </span> <span> (<a class="navbar-link" href="{% url 'switch-user' %}">{% trans "switch" %}</a>) </span> {% else %} <a class="navbar-link" href="{% url 'login' %}">{% trans "Login" %}</a> {% endif %} </div> </li> </ul> </div> </div> </div>
{% load i18n %} {% load profiles %} {% url 'quote:top' as top_page %} <div class="navbar navbar-inverse navbar-static-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="{% url 'index' %}">Memoir</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="{% if request.get_full_path == top_page %}active{% endif %}"> <a href="{{ top_page }}">{% trans "Top" %}</a> </li> </ul> <ul class="nav navbar-nav navbar-right flip"> <li> <div class="btn-nav"> <a class="btn btn-primary navbar-btn" href="{% url 'quote:create' %}">{% trans "Create" %}</a> </div> </li> <li> <div class="navbar-text"> {% if user.is_authenticated %} <span> {% trans "Logged in as " %}<strong>{% profile_link user classes="navbar-link" %}</strong> </span> <span> (<a class="navbar-link" href="{% url 'switch-user' %}">{% trans "switch" %}</a>) </span> {% else %} <a class="navbar-link" href="{% url 'login' %}">{% trans "Login" %}</a> {% endif %} </div> </li> </ul> </div> </div> </div>
Move template variable set in html
Move template variable set in html
HTML
mit
nivbend/memoir,nivbend/memoir,nivbend/memoir
html
## Code Before: {% load i18n %} {% load profiles %} <div class="navbar navbar-inverse navbar-static-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="{% url 'index' %}">Memoir</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> {% url 'quote:top' as top_page %} <li class="{% if request.get_full_path == top_page %}active{% endif %}"> <a href="{{ top_page }}">{% trans "Top" %}</a> </li> </ul> <ul class="nav navbar-nav navbar-right flip"> <li> <div class="btn-nav"> <a class="btn btn-primary navbar-btn" href="{% url 'quote:create' %}">{% trans "Create" %}</a> </div> </li> <li> <div class="navbar-text"> {% if user.is_authenticated %} <span> {% trans "Logged in as " %}<strong>{% profile_link user classes="navbar-link" %}</strong> </span> <span> (<a class="navbar-link" href="{% url 'switch-user' %}">{% trans "switch" %}</a>) </span> {% else %} <a class="navbar-link" href="{% url 'login' %}">{% trans "Login" %}</a> {% endif %} </div> </li> </ul> </div> </div> </div> ## Instruction: Move template variable set in html ## Code After: {% load i18n %} {% load profiles %} {% url 'quote:top' as top_page %} <div class="navbar navbar-inverse navbar-static-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="{% url 'index' %}">Memoir</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li class="{% if request.get_full_path == top_page %}active{% endif %}"> <a href="{{ top_page }}">{% trans "Top" %}</a> </li> </ul> <ul class="nav navbar-nav navbar-right flip"> <li> <div class="btn-nav"> <a class="btn btn-primary navbar-btn" href="{% url 'quote:create' %}">{% trans "Create" %}</a> </div> </li> <li> <div class="navbar-text"> {% if user.is_authenticated %} <span> {% trans "Logged in as " %}<strong>{% profile_link user classes="navbar-link" %}</strong> </span> <span> (<a class="navbar-link" href="{% url 'switch-user' %}">{% trans "switch" %}</a>) </span> {% else %} <a class="navbar-link" href="{% url 'login' %}">{% trans "Login" %}</a> {% endif %} </div> </li> </ul> </div> </div> </div>
0c31c9c851ab1b11679221e01b3db2483a628428
README.md
README.md
[![Build Status](https://travis-ci.org/elritsch/python-sharedmock.svg?branch=master)](https://travis-ci.org/elritsch/python-sharedmock) [![Coverage Status](https://coveralls.io/repos/github/elritsch/python-sharedmock/badge.svg?branch=master)](https://coveralls.io/github/elritsch/python-sharedmock?branch=master) # python-sharedmock A multiprocessing-friendly Python mock object
[![Build Status](https://travis-ci.org/elritsch/python-sharedmock.svg?branch=master)](https://travis-ci.org/elritsch/python-sharedmock) [![Coverage Status](https://coveralls.io/repos/github/elritsch/python-sharedmock/badge.svg?branch=master)](https://coveralls.io/github/elritsch/python-sharedmock?branch=master) # python-sharedmock A multiprocessing-friendly Python mock object ## Getting started The `SharedMock` object has an interface similar to Python's own `unittest.mock.Mock`. The main difference is that the state of a `SharedMock` object is shared among subprocesses. This allows you to easily test interactions of subprocesses with your mock instance. ```python from sharedmock.mock import SharedMock sharedmock = SharedMock() subprocess = mp.Process(target=sharedmock, args=('fancyArg',)) subprocess.start() subprocess.join() subprocess.terminate() expected_calls = [call('fancyArg')] sharedmock.assert_has_calls(expected_calls, same_order=False) ``` If the `SharedMock` were to be replaced by a `unittest.mock.Mock` in the example above, the assertion would fail. The interaction with the `unittest.mock.Mock` object would not get propagated to your test code: ```python E AssertionError: Calls not found. E Expected: [call('fancyArg')] E Actual: [] ```
Add getting started section with example
Add getting started section with example
Markdown
apache-2.0
elritsch/python-sharedmock
markdown
## Code Before: [![Build Status](https://travis-ci.org/elritsch/python-sharedmock.svg?branch=master)](https://travis-ci.org/elritsch/python-sharedmock) [![Coverage Status](https://coveralls.io/repos/github/elritsch/python-sharedmock/badge.svg?branch=master)](https://coveralls.io/github/elritsch/python-sharedmock?branch=master) # python-sharedmock A multiprocessing-friendly Python mock object ## Instruction: Add getting started section with example ## Code After: [![Build Status](https://travis-ci.org/elritsch/python-sharedmock.svg?branch=master)](https://travis-ci.org/elritsch/python-sharedmock) [![Coverage Status](https://coveralls.io/repos/github/elritsch/python-sharedmock/badge.svg?branch=master)](https://coveralls.io/github/elritsch/python-sharedmock?branch=master) # python-sharedmock A multiprocessing-friendly Python mock object ## Getting started The `SharedMock` object has an interface similar to Python's own `unittest.mock.Mock`. The main difference is that the state of a `SharedMock` object is shared among subprocesses. This allows you to easily test interactions of subprocesses with your mock instance. ```python from sharedmock.mock import SharedMock sharedmock = SharedMock() subprocess = mp.Process(target=sharedmock, args=('fancyArg',)) subprocess.start() subprocess.join() subprocess.terminate() expected_calls = [call('fancyArg')] sharedmock.assert_has_calls(expected_calls, same_order=False) ``` If the `SharedMock` were to be replaced by a `unittest.mock.Mock` in the example above, the assertion would fail. The interaction with the `unittest.mock.Mock` object would not get propagated to your test code: ```python E AssertionError: Calls not found. E Expected: [call('fancyArg')] E Actual: [] ```
3bc4605780b134b5e2c9d292f70d58c65ddd01a9
wicket/src/test/wicket/util/time/TimeOfDayTest.java
wicket/src/test/wicket/util/time/TimeOfDayTest.java
/* * $Id$ * $Revision$ * $Date$ * * ==================================================================== * 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 wicket.util.time; import junit.framework.Assert; import junit.framework.TestCase; /** * Test cases for this object * @author Jonathan Locke */ public final class TimeOfDayTest extends TestCase { /** * */ public void test() { Assert.assertTrue(TimeOfDay.MIDNIGHT.hour() == 0); Assert.assertTrue(TimeOfDay.valueOf(TimeOfDay.MIDNIGHT.next()).equals(TimeOfDay.MIDNIGHT)); final TimeOfDay three = TimeOfDay.time(3, 0, TimeOfDay.PM); final TimeOfDay five = TimeOfDay.time(5, 0, TimeOfDay.PM); Assert.assertTrue(five.after(three)); } }
/* * $Id$ * $Revision$ * $Date$ * * ==================================================================== * 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 wicket.util.time; import junit.framework.Assert; import junit.framework.TestCase; /** * Test cases for this object * @author Jonathan Locke */ public final class TimeOfDayTest extends TestCase { /** * */ public void test() { Assert.assertEquals(0, TimeOfDay.MIDNIGHT.hour()); Assert.assertEquals(TimeOfDay.MIDNIGHT, TimeOfDay.valueOf(TimeOfDay.MIDNIGHT.next())); final TimeOfDay three = TimeOfDay.time(3, 0, TimeOfDay.PM); final TimeOfDay five = TimeOfDay.time(5, 0, TimeOfDay.PM); Assert.assertTrue(five.after(three)); } }
Use the appropriate methods for checking equality. This gives better results when debugging the errors.
Use the appropriate methods for checking equality. This gives better results when debugging the errors. git-svn-id: ac804e38dcddf5e42ac850d29d9218b7df6087b7@459989 13f79535-47bb-0310-9956-ffa450edef68
Java
apache-2.0
apache/wicket,AlienQueen/wicket,mosoft521/wicket,martin-g/wicket-osgi,mosoft521/wicket,zwsong/wicket,AlienQueen/wicket,mafulafunk/wicket,astrapi69/wicket,apache/wicket,klopfdreh/wicket,mosoft521/wicket,aldaris/wicket,freiheit-com/wicket,dashorst/wicket,topicusonderwijs/wicket,klopfdreh/wicket,Servoy/wicket,mosoft521/wicket,selckin/wicket,freiheit-com/wicket,topicusonderwijs/wicket,dashorst/wicket,zwsong/wicket,selckin/wicket,klopfdreh/wicket,zwsong/wicket,apache/wicket,martin-g/wicket-osgi,freiheit-com/wicket,mafulafunk/wicket,mosoft521/wicket,Servoy/wicket,bitstorm/wicket,astrapi69/wicket,topicusonderwijs/wicket,astrapi69/wicket,bitstorm/wicket,selckin/wicket,bitstorm/wicket,aldaris/wicket,dashorst/wicket,apache/wicket,selckin/wicket,Servoy/wicket,selckin/wicket,aldaris/wicket,martin-g/wicket-osgi,dashorst/wicket,mafulafunk/wicket,apache/wicket,bitstorm/wicket,freiheit-com/wicket,Servoy/wicket,zwsong/wicket,klopfdreh/wicket,aldaris/wicket,freiheit-com/wicket,AlienQueen/wicket,Servoy/wicket,topicusonderwijs/wicket,bitstorm/wicket,klopfdreh/wicket,aldaris/wicket,topicusonderwijs/wicket,dashorst/wicket,AlienQueen/wicket,astrapi69/wicket,AlienQueen/wicket
java
## Code Before: /* * $Id$ * $Revision$ * $Date$ * * ==================================================================== * 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 wicket.util.time; import junit.framework.Assert; import junit.framework.TestCase; /** * Test cases for this object * @author Jonathan Locke */ public final class TimeOfDayTest extends TestCase { /** * */ public void test() { Assert.assertTrue(TimeOfDay.MIDNIGHT.hour() == 0); Assert.assertTrue(TimeOfDay.valueOf(TimeOfDay.MIDNIGHT.next()).equals(TimeOfDay.MIDNIGHT)); final TimeOfDay three = TimeOfDay.time(3, 0, TimeOfDay.PM); final TimeOfDay five = TimeOfDay.time(5, 0, TimeOfDay.PM); Assert.assertTrue(five.after(three)); } } ## Instruction: Use the appropriate methods for checking equality. This gives better results when debugging the errors. git-svn-id: ac804e38dcddf5e42ac850d29d9218b7df6087b7@459989 13f79535-47bb-0310-9956-ffa450edef68 ## Code After: /* * $Id$ * $Revision$ * $Date$ * * ==================================================================== * 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 wicket.util.time; import junit.framework.Assert; import junit.framework.TestCase; /** * Test cases for this object * @author Jonathan Locke */ public final class TimeOfDayTest extends TestCase { /** * */ public void test() { Assert.assertEquals(0, TimeOfDay.MIDNIGHT.hour()); Assert.assertEquals(TimeOfDay.MIDNIGHT, TimeOfDay.valueOf(TimeOfDay.MIDNIGHT.next())); final TimeOfDay three = TimeOfDay.time(3, 0, TimeOfDay.PM); final TimeOfDay five = TimeOfDay.time(5, 0, TimeOfDay.PM); Assert.assertTrue(five.after(three)); } }
6fcb79ec7a43e799b15cdbe9f5c488221eddfafc
.travis.yml
.travis.yml
language: python python: - "3.3" virtualenv: system_site_packages: true before_install: - sudo apt-get -qq update - sudo apt-get -y install python3-pyqt5 install: - "pip install markdown whoosh" before_script: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" script: python test.py
language: python sudo: required dist: trusty python: - "3.3" virtualenv: system_site_packages: true install: - sudo apt-get update -q - sudo apt-get install python3-pyqt5 -y - "pip install markdown whoosh" before_script: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" script: python test.py
Move deps to install hook
Move deps to install hook
YAML
mit
kekh/mikidown,ShadowKyogre/mikidown,kekh/mikidown,ShadowKyogre/mikidown,kekh/mikidown,ShadowKyogre/mikidown
yaml
## Code Before: language: python python: - "3.3" virtualenv: system_site_packages: true before_install: - sudo apt-get -qq update - sudo apt-get -y install python3-pyqt5 install: - "pip install markdown whoosh" before_script: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" script: python test.py ## Instruction: Move deps to install hook ## Code After: language: python sudo: required dist: trusty python: - "3.3" virtualenv: system_site_packages: true install: - sudo apt-get update -q - sudo apt-get install python3-pyqt5 -y - "pip install markdown whoosh" before_script: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" script: python test.py
0cc408e04c0f321bf486d6063b11e9b0762ef8fc
tests/test_tokens.py
tests/test_tokens.py
import pytest from calc import INTEGER, Token def test_no_defaults(): # There's no valid defaults at the moment. with pytest.raises(TypeError): Token() def test_known_type(): # There's no valid defaults at the moment. token = Token(type=INTEGER, value=2) assert token.value == 2 assert token.type == INTEGER def test_str_non_string_value(): token = Token(type=INTEGER, value=2) expected_result = "Token(type=INTEGER, value=2)" assert token.__str__() == expected_result def test_repr(): token = Token(type=INTEGER, value=2) expected_result = "Token(type=INTEGER, value=2)" assert token.__repr__() == expected_result
import pytest from calc import INTEGER, Token def test_no_defaults(): # There's no valid defaults at the moment. with pytest.raises(TypeError): Token() def test_known_type(): # There's no valid defaults at the moment. token = Token(type=INTEGER, value=2) assert token.value == 2 assert token.type == INTEGER def test_str_non_string_value(): token = Token(type=INTEGER, value=2) expected_result = "Token(type=INTEGER, value=2)" assert str(token) == expected_result def test_repr(): token = Token(type=INTEGER, value=2) expected_result = "Token(type=INTEGER, value=2)" assert repr(token) == expected_result
Use str and repr functions instead of magic methods
Use str and repr functions instead of magic methods
Python
isc
bike-barn/red-green-refactor
python
## Code Before: import pytest from calc import INTEGER, Token def test_no_defaults(): # There's no valid defaults at the moment. with pytest.raises(TypeError): Token() def test_known_type(): # There's no valid defaults at the moment. token = Token(type=INTEGER, value=2) assert token.value == 2 assert token.type == INTEGER def test_str_non_string_value(): token = Token(type=INTEGER, value=2) expected_result = "Token(type=INTEGER, value=2)" assert token.__str__() == expected_result def test_repr(): token = Token(type=INTEGER, value=2) expected_result = "Token(type=INTEGER, value=2)" assert token.__repr__() == expected_result ## Instruction: Use str and repr functions instead of magic methods ## Code After: import pytest from calc import INTEGER, Token def test_no_defaults(): # There's no valid defaults at the moment. with pytest.raises(TypeError): Token() def test_known_type(): # There's no valid defaults at the moment. token = Token(type=INTEGER, value=2) assert token.value == 2 assert token.type == INTEGER def test_str_non_string_value(): token = Token(type=INTEGER, value=2) expected_result = "Token(type=INTEGER, value=2)" assert str(token) == expected_result def test_repr(): token = Token(type=INTEGER, value=2) expected_result = "Token(type=INTEGER, value=2)" assert repr(token) == expected_result
7d1487ba1091536006e43b0e431ba2c010f04ab8
config.ru
config.ru
require 'rest-gw2' warmup do RestCore.eagerload RestCore.eagerload(RestGW2) RestGW2::Client.new end run RestGW2::Server
require 'rest-gw2' warmup do RestCore.eagerload RestCore.eagerload(RestGW2) RestGW2::Client.new end if pool_size = ENV['GW2_POOL_SIZE'] RestGW2::Client.pool_size = Integer(pool_size) end run RestGW2::Server
Introduce GW2_POOL_SIZE to setup concurrency
Introduce GW2_POOL_SIZE to setup concurrency
Ruby
apache-2.0
godfat/rest-gw2,godfat/rest-gw2
ruby
## Code Before: require 'rest-gw2' warmup do RestCore.eagerload RestCore.eagerload(RestGW2) RestGW2::Client.new end run RestGW2::Server ## Instruction: Introduce GW2_POOL_SIZE to setup concurrency ## Code After: require 'rest-gw2' warmup do RestCore.eagerload RestCore.eagerload(RestGW2) RestGW2::Client.new end if pool_size = ENV['GW2_POOL_SIZE'] RestGW2::Client.pool_size = Integer(pool_size) end run RestGW2::Server
b2657fd84c0d8fd4e1188a649bb2595651b83adb
kazoo/handlers/util.py
kazoo/handlers/util.py
try: from gevent import monkey [start_new_thread] = monkey.get_original('thread', ['start_new_thread']) except ImportError: from thread import start_new_thread def thread(func): """Thread decorator Takes a function and spawns it as a daemon thread using the real OS thread regardless of monkey patching. """ start_new_thread(func, ())
from __future__ import absolute_import try: from gevent._threading import start_new_thread except ImportError: from thread import start_new_thread def thread(func): """Thread decorator Takes a function and spawns it as a daemon thread using the real OS thread regardless of monkey patching. """ start_new_thread(func, ())
Make sure we use proper gevent with absolute import, pull the start_new_thread directly out.
Make sure we use proper gevent with absolute import, pull the start_new_thread directly out.
Python
apache-2.0
harlowja/kazoo,pombredanne/kazoo,rockerbox/kazoo,AlexanderplUs/kazoo,harlowja/kazoo,pombredanne/kazoo,rgs1/kazoo,Asana/kazoo,jacksontj/kazoo,kormat/kazoo,rackerlabs/kazoo,bsanders/kazoo,tempbottle/kazoo,python-zk/kazoo,rockerbox/kazoo,jacksontj/kazoo,rackerlabs/kazoo,python-zk/kazoo,rgs1/kazoo,tempbottle/kazoo,AlexanderplUs/kazoo,max0d41/kazoo,kormat/kazoo,max0d41/kazoo,bsanders/kazoo
python
## Code Before: try: from gevent import monkey [start_new_thread] = monkey.get_original('thread', ['start_new_thread']) except ImportError: from thread import start_new_thread def thread(func): """Thread decorator Takes a function and spawns it as a daemon thread using the real OS thread regardless of monkey patching. """ start_new_thread(func, ()) ## Instruction: Make sure we use proper gevent with absolute import, pull the start_new_thread directly out. ## Code After: from __future__ import absolute_import try: from gevent._threading import start_new_thread except ImportError: from thread import start_new_thread def thread(func): """Thread decorator Takes a function and spawns it as a daemon thread using the real OS thread regardless of monkey patching. """ start_new_thread(func, ())
2d394beaa74205263705ac18ae66d659329898b3
components/input/InputMetaPropTypes.js
components/input/InputMetaPropTypes.js
import PropTypes from 'prop-types'; const InputMetaPropTypes = PropTypes.shape({ active: PropTypes.bool, autofilled: PropTypes.bool, asyncValidating: PropTypes.bool, dirty: PropTypes.bool, dispatch: PropTypes.func, error: PropTypes.string, form: PropTypes.string, initial: PropTypes.any, invalid: PropTypes.bool, pristine: PropTypes.bool, submitting: PropTypes.bool, submitFailed: PropTypes.bool, touched: PropTypes.bool, valid: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), visited: PropTypes.bool, warning: PropTypes.string, }); export default InputMetaPropTypes;
import PropTypes from 'prop-types'; const InputMetaPropTypes = PropTypes.shape({ active: PropTypes.bool, autofilled: PropTypes.bool, asyncValidating: PropTypes.bool, dirty: PropTypes.bool, dispatch: PropTypes.func, error: PropTypes.string, form: PropTypes.string, initial: PropTypes.any, invalid: PropTypes.bool, pristine: PropTypes.bool, submitting: PropTypes.bool, submitFailed: PropTypes.bool, touched: PropTypes.bool, valid: PropTypes.bool, visited: PropTypes.bool, warning: PropTypes.string, }); export default InputMetaPropTypes;
Rollback the earlier 'valid' property type change
Rollback the earlier 'valid' property type change
JavaScript
mit
teamleadercrm/teamleader-ui
javascript
## Code Before: import PropTypes from 'prop-types'; const InputMetaPropTypes = PropTypes.shape({ active: PropTypes.bool, autofilled: PropTypes.bool, asyncValidating: PropTypes.bool, dirty: PropTypes.bool, dispatch: PropTypes.func, error: PropTypes.string, form: PropTypes.string, initial: PropTypes.any, invalid: PropTypes.bool, pristine: PropTypes.bool, submitting: PropTypes.bool, submitFailed: PropTypes.bool, touched: PropTypes.bool, valid: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]), visited: PropTypes.bool, warning: PropTypes.string, }); export default InputMetaPropTypes; ## Instruction: Rollback the earlier 'valid' property type change ## Code After: import PropTypes from 'prop-types'; const InputMetaPropTypes = PropTypes.shape({ active: PropTypes.bool, autofilled: PropTypes.bool, asyncValidating: PropTypes.bool, dirty: PropTypes.bool, dispatch: PropTypes.func, error: PropTypes.string, form: PropTypes.string, initial: PropTypes.any, invalid: PropTypes.bool, pristine: PropTypes.bool, submitting: PropTypes.bool, submitFailed: PropTypes.bool, touched: PropTypes.bool, valid: PropTypes.bool, visited: PropTypes.bool, warning: PropTypes.string, }); export default InputMetaPropTypes;
1f59477e15dd70051fe6ba1bc90b6767174b4630
tasks/debian/main.yml
tasks/debian/main.yml
--- # file: oracle-java/tasks/debian/main.yml # # Task file to install Oracle Java Development Kit in a system with a Debian based Linux distribution. # - name: accept Oracle license shell: "echo oracle-java{{ oracle_java_version }}-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections" changed_when: no sudo: yes - name: ensure Java is installed apt: name="oracle-java{{ oracle_java_version }}-installer" state={{ oracle_java_state }} cache_valid_time={{ oracle_java_cache_valid_time }} register: oracle_java_task_apt_install sudo: yes - name: set Java version as default apt: name="oracle-java{{ oracle_java_version }}-set-default" state=latest register: oracle_java_task_set_default when: oracle_java_set_as_default sudo: yes when: oracle_java_set_as_default - name: in case there were changes, check host environment again include: ../check_environment.yml when: oracle_java_task_apt_install|changed or oracle_java_task_set_default|changed
--- # file: oracle-java/tasks/debian/main.yml # # Task file to install Oracle Java Development Kit in a system with a Debian based Linux distribution. # - name: accept Oracle license shell: "echo oracle-java{{ oracle_java_version }}-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections" changed_when: no sudo: yes - name: ensure Java is installed apt: name="oracle-java{{ oracle_java_version }}-installer" state={{ oracle_java_state }} cache_valid_time={{ oracle_java_cache_valid_time }} register: oracle_java_task_apt_install sudo: yes - name: set Java version as default apt: name="oracle-java{{ oracle_java_version }}-set-default" state=latest register: oracle_java_task_set_default when: oracle_java_set_as_default sudo: yes - name: in case there were changes, check host environment again include: ../check_environment.yml when: oracle_java_task_apt_install|changed or oracle_java_task_set_default|changed
Remove duplicate when condition for debian task.
Remove duplicate when condition for debian task.
YAML
bsd-3-clause
intuitio/oracle-java,cyfdecyf/oracle-java,cyfdecyf/oracle-java,ansiblebit/oracle-java,ansiblebit/oracle-java,intuitio/oracle-java,cyfdecyf/oracle-java,ansiblebit/oracle-java,intuitio/oracle-java
yaml
## Code Before: --- # file: oracle-java/tasks/debian/main.yml # # Task file to install Oracle Java Development Kit in a system with a Debian based Linux distribution. # - name: accept Oracle license shell: "echo oracle-java{{ oracle_java_version }}-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections" changed_when: no sudo: yes - name: ensure Java is installed apt: name="oracle-java{{ oracle_java_version }}-installer" state={{ oracle_java_state }} cache_valid_time={{ oracle_java_cache_valid_time }} register: oracle_java_task_apt_install sudo: yes - name: set Java version as default apt: name="oracle-java{{ oracle_java_version }}-set-default" state=latest register: oracle_java_task_set_default when: oracle_java_set_as_default sudo: yes when: oracle_java_set_as_default - name: in case there were changes, check host environment again include: ../check_environment.yml when: oracle_java_task_apt_install|changed or oracle_java_task_set_default|changed ## Instruction: Remove duplicate when condition for debian task. ## Code After: --- # file: oracle-java/tasks/debian/main.yml # # Task file to install Oracle Java Development Kit in a system with a Debian based Linux distribution. # - name: accept Oracle license shell: "echo oracle-java{{ oracle_java_version }}-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections" changed_when: no sudo: yes - name: ensure Java is installed apt: name="oracle-java{{ oracle_java_version }}-installer" state={{ oracle_java_state }} cache_valid_time={{ oracle_java_cache_valid_time }} register: oracle_java_task_apt_install sudo: yes - name: set Java version as default apt: name="oracle-java{{ oracle_java_version }}-set-default" state=latest register: oracle_java_task_set_default when: oracle_java_set_as_default sudo: yes - name: in case there were changes, check host environment again include: ../check_environment.yml when: oracle_java_task_apt_install|changed or oracle_java_task_set_default|changed
6a8382c1e7db41398e0ac2a703289ae481e32bd0
auto_backup/auto_backup.cmd
auto_backup/auto_backup.cmd
robocopy C:\Users\user\Documents F:\Backup\Documents /MIR /DCOPY:T /xj /np /tee /log:backup_log.txt robocopy C:\Users\user\Pictures F:\Backup\Pictures /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt robocopy C:\Users\user\Music F:\Backup\Music /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt robocopy C:\Users\user\Downloads F:\Backup\Downloads /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt pause
robocopy "C:\Users\user\Documents" "F:\Backup\Documents" /MIR /DCOPY:T /xj /np /tee /log:backup_log.txt robocopy "C:\Users\user\Pictures" "F:\Backup\Pictures" /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt robocopy "C:\Users\user\Music" "F:\Backup\Music" /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt robocopy "C:\Users\user\Downloads" "F:\Backup\Downloads" /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt pause
Add quotation around dir path.
Add quotation around dir path.
Batchfile
apache-2.0
shianchin/mini_projects,shianchin/mini_projects,shianchin/mini_projects
batchfile
## Code Before: robocopy C:\Users\user\Documents F:\Backup\Documents /MIR /DCOPY:T /xj /np /tee /log:backup_log.txt robocopy C:\Users\user\Pictures F:\Backup\Pictures /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt robocopy C:\Users\user\Music F:\Backup\Music /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt robocopy C:\Users\user\Downloads F:\Backup\Downloads /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt pause ## Instruction: Add quotation around dir path. ## Code After: robocopy "C:\Users\user\Documents" "F:\Backup\Documents" /MIR /DCOPY:T /xj /np /tee /log:backup_log.txt robocopy "C:\Users\user\Pictures" "F:\Backup\Pictures" /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt robocopy "C:\Users\user\Music" "F:\Backup\Music" /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt robocopy "C:\Users\user\Downloads" "F:\Backup\Downloads" /MIR /DCOPY:T /xj /np /tee /log+:backup_log.txt pause
33822f16221ceb496e99dfbc43d81defd16fe2eb
.travis.yml
.travis.yml
language: c++ compiler: - gcc - clang os: - linux - osx install: - wget 'https://googletest.googlecode.com/files/gtest-1.7.0.zip' - unzip gtest-1.7.0.zip - ln -s gtest-1.7.0 gtest - sudo pip install BeautifulSoup - sudo pip install html5lib==0.95 script: - ./autogen.sh && ./configure && make && make check - python python/gumbo/gumboc_test.py - python python/gumbo/html5lib_adapter_test.py - python python/gumbo/soup_adapter_test.py - sudo make install - sudo python setup.py sdist install - python -c 'import gumbo; gumbo.parse("Foo")'
language: c++ compiler: - gcc - clang os: - linux - osx install: - wget 'https://googletest.googlecode.com/files/gtest-1.7.0.zip' - unzip gtest-1.7.0.zip - ln -s gtest-1.7.0 gtest - sudo pip install BeautifulSoup - sudo pip install html5lib==0.95 script: - ./autogen.sh && ./configure && make && make check - python python/gumbo/gumboc_test.py - python python/gumbo/html5lib_adapter_test.py - python python/gumbo/soup_adapter_test.py - sudo make install - g++ examples/clean_text.cc `pkg-config --cflags --libs gumbo` - sudo python setup.py sdist install - python -c 'import gumbo; gumbo.parse("Foo")'
Add a line to the TravisCI config to make sure one of the example programs can build against the installed library.
Add a line to the TravisCI config to make sure one of the example programs can build against the installed library.
YAML
apache-2.0
luoxn28/gumbo-parser,Sigil-Ebook/sigil-gumbo,google/gumbo-parser,kevinhendricks/gumbo-parser,aleksandaratanasov/gumbo-parser,aleksandaratanasov/gumbo-parser,urandu/gumbo-parser,mcanthony/gumbo-parser,luoxn28/gumbo-parser,abc00/gumbo-parser,Sigil-Ebook/sigil-gumbo,Sigil-Ebook/sigil-gumbo,abc00/gumbo-parser,f123h456/gumbo-parser,mcanthony/gumbo-parser,kevinhendricks/gumbo-parser,luoxn28/gumbo-parser,lvchao0428/gumbo-parser,kevinhendricks/gumbo-parser,lvchao0428/gumbo-parser,f123h456/gumbo-parser,Sigil-Ebook/sigil-gumbo,Sigil-Ebook/sigil-gumbo,f123h456/gumbo-parser,urandu/gumbo-parser,aleksandaratanasov/gumbo-parser,urandu/gumbo-parser,urandu/gumbo-parser,abc00/gumbo-parser,google/gumbo-parser,f123h456/gumbo-parser,luoxn28/gumbo-parser,lvchao0428/gumbo-parser,abc00/gumbo-parser,lvchao0428/gumbo-parser,mcanthony/gumbo-parser,google/gumbo-parser,kevinhendricks/gumbo-parser,google/gumbo-parser,mcanthony/gumbo-parser,google/gumbo-parser,f123h456/gumbo-parser,urandu/gumbo-parser,lvchao0428/gumbo-parser,aleksandaratanasov/gumbo-parser,kevinhendricks/gumbo-parser,aleksandaratanasov/gumbo-parser,abc00/gumbo-parser,luoxn28/gumbo-parser,mcanthony/gumbo-parser
yaml
## Code Before: language: c++ compiler: - gcc - clang os: - linux - osx install: - wget 'https://googletest.googlecode.com/files/gtest-1.7.0.zip' - unzip gtest-1.7.0.zip - ln -s gtest-1.7.0 gtest - sudo pip install BeautifulSoup - sudo pip install html5lib==0.95 script: - ./autogen.sh && ./configure && make && make check - python python/gumbo/gumboc_test.py - python python/gumbo/html5lib_adapter_test.py - python python/gumbo/soup_adapter_test.py - sudo make install - sudo python setup.py sdist install - python -c 'import gumbo; gumbo.parse("Foo")' ## Instruction: Add a line to the TravisCI config to make sure one of the example programs can build against the installed library. ## Code After: language: c++ compiler: - gcc - clang os: - linux - osx install: - wget 'https://googletest.googlecode.com/files/gtest-1.7.0.zip' - unzip gtest-1.7.0.zip - ln -s gtest-1.7.0 gtest - sudo pip install BeautifulSoup - sudo pip install html5lib==0.95 script: - ./autogen.sh && ./configure && make && make check - python python/gumbo/gumboc_test.py - python python/gumbo/html5lib_adapter_test.py - python python/gumbo/soup_adapter_test.py - sudo make install - g++ examples/clean_text.cc `pkg-config --cflags --libs gumbo` - sudo python setup.py sdist install - python -c 'import gumbo; gumbo.parse("Foo")'
9d3d891b9c741d26f4b6651cbf8261e5643ba038
app/src/main/java/com/marverenic/music/view/SnappingScroller.java
app/src/main/java/com/marverenic/music/view/SnappingScroller.java
package com.marverenic.music.view; import android.content.Context; import android.support.v7.widget.LinearSmoothScroller; import android.util.DisplayMetrics; public class SnappingScroller extends LinearSmoothScroller { private static final int MIN_SCROLL_TIME_MS = 75; private static final float MILLISECONDS_PER_INCH = 50f; public static final int SNAP_TO_START = LinearSmoothScroller.SNAP_TO_START; public static final int SNAP_TO_END = LinearSmoothScroller.SNAP_TO_END; private int mSnapPreference; public SnappingScroller(Context context, int snap) { super(context); mSnapPreference = snap; } @Override protected int getHorizontalSnapPreference() { return mSnapPreference; } @Override protected int getVerticalSnapPreference() { return mSnapPreference; } @Override protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) { return MILLISECONDS_PER_INCH / displayMetrics.densityDpi; } @Override protected int calculateTimeForScrolling(int dx) { return Math.max(MIN_SCROLL_TIME_MS, super.calculateTimeForScrolling(dx)); } }
package com.marverenic.music.view; import android.content.Context; import android.support.v7.widget.LinearSmoothScroller; import android.util.DisplayMetrics; import android.view.View; public class SnappingScroller extends LinearSmoothScroller { private static final float MILLISECONDS_PER_INCH = 100f; public static final int SNAP_TO_START = LinearSmoothScroller.SNAP_TO_START; public static final int SNAP_TO_END = LinearSmoothScroller.SNAP_TO_END; private Context mContext; private int mSnapPreference; private float mMillisecondsPerPixel; public SnappingScroller(Context context, int snap) { super(context); mContext = context; mSnapPreference = snap; } @Override protected int getHorizontalSnapPreference() { return mSnapPreference; } @Override protected int getVerticalSnapPreference() { return mSnapPreference; } @Override protected void onStart() { super.onStart(); View firstView = getLayoutManager().getChildAt(0); int firstViewPosition = getChildPosition(firstView); int intermediateViewCount = Math.abs(firstViewPosition - getTargetPosition()); DisplayMetrics displayMetrics = mContext.getResources().getDisplayMetrics(); mMillisecondsPerPixel = getSpeedPerPixel(displayMetrics, intermediateViewCount); } private float getSpeedPerPixel(DisplayMetrics displayMetrics, int intermediateViewCount) { int dpi = displayMetrics.densityDpi; return MILLISECONDS_PER_INCH / (float) Math.sqrt(intermediateViewCount) / dpi; } @Override protected int calculateTimeForScrolling(int dx) { return (int) Math.ceil(Math.abs(dx) * mMillisecondsPerPixel); } }
Reduce scroll time when seeking over many views
Reduce scroll time when seeking over many views
Java
apache-2.0
marverenic/Jockey,marverenic/Jockey
java
## Code Before: package com.marverenic.music.view; import android.content.Context; import android.support.v7.widget.LinearSmoothScroller; import android.util.DisplayMetrics; public class SnappingScroller extends LinearSmoothScroller { private static final int MIN_SCROLL_TIME_MS = 75; private static final float MILLISECONDS_PER_INCH = 50f; public static final int SNAP_TO_START = LinearSmoothScroller.SNAP_TO_START; public static final int SNAP_TO_END = LinearSmoothScroller.SNAP_TO_END; private int mSnapPreference; public SnappingScroller(Context context, int snap) { super(context); mSnapPreference = snap; } @Override protected int getHorizontalSnapPreference() { return mSnapPreference; } @Override protected int getVerticalSnapPreference() { return mSnapPreference; } @Override protected float calculateSpeedPerPixel(DisplayMetrics displayMetrics) { return MILLISECONDS_PER_INCH / displayMetrics.densityDpi; } @Override protected int calculateTimeForScrolling(int dx) { return Math.max(MIN_SCROLL_TIME_MS, super.calculateTimeForScrolling(dx)); } } ## Instruction: Reduce scroll time when seeking over many views ## Code After: package com.marverenic.music.view; import android.content.Context; import android.support.v7.widget.LinearSmoothScroller; import android.util.DisplayMetrics; import android.view.View; public class SnappingScroller extends LinearSmoothScroller { private static final float MILLISECONDS_PER_INCH = 100f; public static final int SNAP_TO_START = LinearSmoothScroller.SNAP_TO_START; public static final int SNAP_TO_END = LinearSmoothScroller.SNAP_TO_END; private Context mContext; private int mSnapPreference; private float mMillisecondsPerPixel; public SnappingScroller(Context context, int snap) { super(context); mContext = context; mSnapPreference = snap; } @Override protected int getHorizontalSnapPreference() { return mSnapPreference; } @Override protected int getVerticalSnapPreference() { return mSnapPreference; } @Override protected void onStart() { super.onStart(); View firstView = getLayoutManager().getChildAt(0); int firstViewPosition = getChildPosition(firstView); int intermediateViewCount = Math.abs(firstViewPosition - getTargetPosition()); DisplayMetrics displayMetrics = mContext.getResources().getDisplayMetrics(); mMillisecondsPerPixel = getSpeedPerPixel(displayMetrics, intermediateViewCount); } private float getSpeedPerPixel(DisplayMetrics displayMetrics, int intermediateViewCount) { int dpi = displayMetrics.densityDpi; return MILLISECONDS_PER_INCH / (float) Math.sqrt(intermediateViewCount) / dpi; } @Override protected int calculateTimeForScrolling(int dx) { return (int) Math.ceil(Math.abs(dx) * mMillisecondsPerPixel); } }
0235408539d352562c5919576c130de7c018bebd
app/workers/status_update_worker.rb
app/workers/status_update_worker.rb
class StatusUpdateWorker include Sidekiq::Worker def perform(application_id) # app = Application.find(application_id) # app.update_current_step ap "****** StatusUpdateWorker at #{DateTime.now}" end end
class StatusUpdateWorker include Sidekiq::Worker sidekiq_options :retry => false def perform(application_id) app = Application.find(application_id) app.update_current_step end end
Disable retry option for sidekiq's job. Re-enable before and after create actions.
Disable retry option for sidekiq's job. Re-enable before and after create actions.
Ruby
mit
gguerini/uscis_web,gguerini/uscis_web
ruby
## Code Before: class StatusUpdateWorker include Sidekiq::Worker def perform(application_id) # app = Application.find(application_id) # app.update_current_step ap "****** StatusUpdateWorker at #{DateTime.now}" end end ## Instruction: Disable retry option for sidekiq's job. Re-enable before and after create actions. ## Code After: class StatusUpdateWorker include Sidekiq::Worker sidekiq_options :retry => false def perform(application_id) app = Application.find(application_id) app.update_current_step end end
e6d85d1e42b7a5107fef884ae42efc8f79644ed4
index.html
index.html
<!DOCTYPE html> <html> <head> <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <title>Ping Pong</title/ </head> <body> <div class="jumbotron jumbotronBackground" id="banner"> <h1>Ping Pong</h1> </div> <div class="row"> <div class="container-fluid"> <div class="col-md-2" id="sidebar"> <h3><b>About Ping Pong</b></h3> <br> <h4>Created by:</h4> <p>Kassidy Malone-Douglas</p> <h4>GitHub Username/URL:</h4> <a href="https://github.com/kcmdouglas/pingpong"><p>kcmdouglas</p></a> <h4>Level 2 Test for:</h4> <p>Java</p> </div> <div class="col-md-9"> </div> </div> </div> </html>
<!DOCTYPE html> <html> <head> <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <title>Ping Pong</title/ </head> <body> <div class="jumbotron jumbotronBackground" id="banner"> <h1>Ping Pong</h1> </div> <div class="row"> <div class="container-fluid"> <div class="col-md-3" id="sidebar"> <h3><b>About Ping Pong</b></h3> <br> <h4>Created by:</h4> <p>Kassidy Malone-Douglas</p> <h4>GitHub Username/URL:</h4> <a href="https://github.com/kcmdouglas/pingpong"><p>kcmdouglas</p></a> <h4>Level 2 Test for:</h4> <p>Java</p> </div> <div class="col-md-8" id="main"> <h2>Let's play!</h2> <br> <h4>Rules:</h4> <p>Ping Pong will count to your number from 1 with the following exceptions: <ol> <li>Numbers divisible by 3 are replaced with "ping"</li> <li>Numbers divisible by 5 are replaced with "pong"</li> <li>Numbers divisible by 15 are replaced with "pingpong"</li> </ol> </div> </div> </div> </html>
Add text to unstyled main body of website and add ID tags for sidebar and main
Add text to unstyled main body of website and add ID tags for sidebar and main
HTML
mit
kcmdouglas/pingpong,kcmdouglas/pingpong
html
## Code Before: <!DOCTYPE html> <html> <head> <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <title>Ping Pong</title/ </head> <body> <div class="jumbotron jumbotronBackground" id="banner"> <h1>Ping Pong</h1> </div> <div class="row"> <div class="container-fluid"> <div class="col-md-2" id="sidebar"> <h3><b>About Ping Pong</b></h3> <br> <h4>Created by:</h4> <p>Kassidy Malone-Douglas</p> <h4>GitHub Username/URL:</h4> <a href="https://github.com/kcmdouglas/pingpong"><p>kcmdouglas</p></a> <h4>Level 2 Test for:</h4> <p>Java</p> </div> <div class="col-md-9"> </div> </div> </div> </html> ## Instruction: Add text to unstyled main body of website and add ID tags for sidebar and main ## Code After: <!DOCTYPE html> <html> <head> <link href="css/bootstrap.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <title>Ping Pong</title/ </head> <body> <div class="jumbotron jumbotronBackground" id="banner"> <h1>Ping Pong</h1> </div> <div class="row"> <div class="container-fluid"> <div class="col-md-3" id="sidebar"> <h3><b>About Ping Pong</b></h3> <br> <h4>Created by:</h4> <p>Kassidy Malone-Douglas</p> <h4>GitHub Username/URL:</h4> <a href="https://github.com/kcmdouglas/pingpong"><p>kcmdouglas</p></a> <h4>Level 2 Test for:</h4> <p>Java</p> </div> <div class="col-md-8" id="main"> <h2>Let's play!</h2> <br> <h4>Rules:</h4> <p>Ping Pong will count to your number from 1 with the following exceptions: <ol> <li>Numbers divisible by 3 are replaced with "ping"</li> <li>Numbers divisible by 5 are replaced with "pong"</li> <li>Numbers divisible by 15 are replaced with "pingpong"</li> </ol> </div> </div> </div> </html>