commit
stringlengths
40
40
old_file
stringlengths
4
184
new_file
stringlengths
4
184
old_contents
stringlengths
1
3.6k
new_contents
stringlengths
5
3.38k
subject
stringlengths
15
778
message
stringlengths
16
6.74k
lang
stringclasses
201 values
license
stringclasses
13 values
repos
stringlengths
6
116k
config
stringclasses
201 values
content
stringlengths
137
7.24k
diff
stringlengths
26
5.55k
diff_length
int64
1
123
relative_diff_length
float64
0.01
89
n_lines_added
int64
0
108
n_lines_deleted
int64
0
106
95cbf8e26d0794bc1da3f7dbd876bc3da04bd107
.travis.yml
.travis.yml
language: c before_install: - sudo apt-get update -qq - sudo apt-get install -y libavutil-dev libavcodec-dev libavformat-dev libavresample-dev script: - cmake . && cmake --build . - make test compiler: - gcc - clang
language: c addons: apt: packages: - libavutil-dev - libavcodec-dev - libavformat-dev - libavresample-dev script: - cmake . && cmake --build . - make test compiler: - gcc - clang
Use Travis-CI docker infrastructure, which makes build run faster
Use Travis-CI docker infrastructure, which makes build run faster
YAML
mit
Polochon-street/bliss,Polochon-street/bliss,Phyks/bliss,Polochon-street/bliss,Phyks/bliss
yaml
## Code Before: language: c before_install: - sudo apt-get update -qq - sudo apt-get install -y libavutil-dev libavcodec-dev libavformat-dev libavresample-dev script: - cmake . && cmake --build . - make test compiler: - gcc - clang ## Instruction: Use Travis-CI docker infrastructure, which makes build run faster ## Code After: language: c addons: apt: packages: - libavutil-dev - libavcodec-dev - libavformat-dev - libavresample-dev script: - cmake . && cmake --build . - make test compiler: - gcc - clang
language: c - before_install: - - sudo apt-get update -qq - - sudo apt-get install -y libavutil-dev libavcodec-dev libavformat-dev libavresample-dev + addons: + apt: + packages: + - libavutil-dev + - libavcodec-dev + - libavformat-dev + - libavresample-dev script: - cmake . && cmake --build . - make test compiler: - gcc - clang
10
1
7
3
7723715d8e996d9389f0961571ba663b6016029a
bin/password.bat
bin/password.bat
@echo off if "%OS%" == "Windows_NT" setlocal if not defined JAVA_HOME goto no_java_home if not defined VTPASS_HOME goto no_vtpass_home set JAVA=%JAVA_HOME%\bin\java set PASS_JAR=%VTPASS_HOME%\jars\vt-password-${project.version}.jar set CLASSPATH=%LIBDIR%\vt-dictionary-3.0-SNAPSHOT.jar;%LIBDIR%\vt-crypt-2.1.1.jar;%LIBDIR%\commons-logging-1.1.1.jar;%PASS_JAR% call "%JAVA%" -cp "%CLASSPATH%" edu.vt.middleware.password.PasswordValidator %* goto end :no_vtpass_home echo ERROR: VTPASS_HOME environment variable must be set to VT Password install path. goto end :no_java_home echo ERROR: JAVA_HOME environment variable must be set to JRE/JDK install path. :end
@echo off if "%OS%" == "Windows_NT" setlocal if not defined JAVA_HOME goto no_java_home if not defined VTPASS_HOME goto no_vtpass_home set JAVA=%JAVA_HOME%\bin\java set PASS_JAR=%VTPASS_HOME%\jars\vt-password-${project.version}.jar set LIBDIR=%VTPASS_HOME%\lib set CLASSPATH=%LIBDIR%\vt-dictionary-3.0.jar;%LIBDIR%\vt-crypt-2.1.1.jar;%LIBDIR%\commons-logging-1.1.1.jar;%PASS_JAR% call "%JAVA%" -cp "%CLASSPATH%" edu.vt.middleware.password.PasswordValidator %* goto end :no_vtpass_home echo ERROR: VTPASS_HOME environment variable must be set to VT Password install path. goto end :no_java_home echo ERROR: JAVA_HOME environment variable must be set to JRE/JDK install path. :end
Update script for latest vt-dictionary.
Update script for latest vt-dictionary.
Batchfile
apache-2.0
dfish3r/vt-password,dfish3r/vt-password
batchfile
## Code Before: @echo off if "%OS%" == "Windows_NT" setlocal if not defined JAVA_HOME goto no_java_home if not defined VTPASS_HOME goto no_vtpass_home set JAVA=%JAVA_HOME%\bin\java set PASS_JAR=%VTPASS_HOME%\jars\vt-password-${project.version}.jar set CLASSPATH=%LIBDIR%\vt-dictionary-3.0-SNAPSHOT.jar;%LIBDIR%\vt-crypt-2.1.1.jar;%LIBDIR%\commons-logging-1.1.1.jar;%PASS_JAR% call "%JAVA%" -cp "%CLASSPATH%" edu.vt.middleware.password.PasswordValidator %* goto end :no_vtpass_home echo ERROR: VTPASS_HOME environment variable must be set to VT Password install path. goto end :no_java_home echo ERROR: JAVA_HOME environment variable must be set to JRE/JDK install path. :end ## Instruction: Update script for latest vt-dictionary. ## Code After: @echo off if "%OS%" == "Windows_NT" setlocal if not defined JAVA_HOME goto no_java_home if not defined VTPASS_HOME goto no_vtpass_home set JAVA=%JAVA_HOME%\bin\java set PASS_JAR=%VTPASS_HOME%\jars\vt-password-${project.version}.jar set LIBDIR=%VTPASS_HOME%\lib set CLASSPATH=%LIBDIR%\vt-dictionary-3.0.jar;%LIBDIR%\vt-crypt-2.1.1.jar;%LIBDIR%\commons-logging-1.1.1.jar;%PASS_JAR% call "%JAVA%" -cp "%CLASSPATH%" edu.vt.middleware.password.PasswordValidator %* goto end :no_vtpass_home echo ERROR: VTPASS_HOME environment variable must be set to VT Password install path. goto end :no_java_home echo ERROR: JAVA_HOME environment variable must be set to JRE/JDK install path. :end
@echo off if "%OS%" == "Windows_NT" setlocal if not defined JAVA_HOME goto no_java_home if not defined VTPASS_HOME goto no_vtpass_home set JAVA=%JAVA_HOME%\bin\java set PASS_JAR=%VTPASS_HOME%\jars\vt-password-${project.version}.jar + set LIBDIR=%VTPASS_HOME%\lib - set CLASSPATH=%LIBDIR%\vt-dictionary-3.0-SNAPSHOT.jar;%LIBDIR%\vt-crypt-2.1.1.jar;%LIBDIR%\commons-logging-1.1.1.jar;%PASS_JAR% ? --------- + set CLASSPATH=%LIBDIR%\vt-dictionary-3.0.jar;%LIBDIR%\vt-crypt-2.1.1.jar;%LIBDIR%\commons-logging-1.1.1.jar;%PASS_JAR% call "%JAVA%" -cp "%CLASSPATH%" edu.vt.middleware.password.PasswordValidator %* goto end :no_vtpass_home echo ERROR: VTPASS_HOME environment variable must be set to VT Password install path. goto end :no_java_home echo ERROR: JAVA_HOME environment variable must be set to JRE/JDK install path. :end
3
0.130435
2
1
90a94b1d511aa17f167d783992fe0f874ad529c1
examples/python_interop/python_interop.py
examples/python_interop/python_interop.py
from __future__ import print_function import legion @legion.task def f(ctx): print("inside task f") @legion.task def main_task(ctx): print("%x" % legion.c.legion_runtime_get_executing_processor(ctx.runtime, ctx.context).id) f(ctx)
from __future__ import print_function import legion @legion.task def f(ctx, *args): print("inside task f%s" % (args,)) @legion.task def main_task(ctx): print("inside main()") f(ctx, 1, "asdf", True)
Test Python support for arguments.
examples: Test Python support for arguments.
Python
apache-2.0
StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion
python
## Code Before: from __future__ import print_function import legion @legion.task def f(ctx): print("inside task f") @legion.task def main_task(ctx): print("%x" % legion.c.legion_runtime_get_executing_processor(ctx.runtime, ctx.context).id) f(ctx) ## Instruction: examples: Test Python support for arguments. ## Code After: from __future__ import print_function import legion @legion.task def f(ctx, *args): print("inside task f%s" % (args,)) @legion.task def main_task(ctx): print("inside main()") f(ctx, 1, "asdf", True)
from __future__ import print_function import legion @legion.task - def f(ctx): + def f(ctx, *args): ? +++++++ - print("inside task f") + print("inside task f%s" % (args,)) ? ++ +++++++++ + @legion.task def main_task(ctx): - print("%x" % legion.c.legion_runtime_get_executing_processor(ctx.runtime, ctx.context).id) - f(ctx) + print("inside main()") + f(ctx, 1, "asdf", True)
8
0.615385
4
4
5a9573a4b361ae9c92ac529d47d19e6d7f7af59a
scripts/switch-clang-version.sh
scripts/switch-clang-version.sh
if [ -z "$1" ]; then exit fi export LLVM_VERSION=$1 sudo rm /usr/bin/llvm-config sudo rm /usr/lib/x86_64-linux-gnu/libclang.so sudo apt-get install -y clang-$LLVM_VERSION libclang1-$LLVM_VERSION libclang-$LLVM_VERSION-dev llvm-$LLVM_VERSION llvm-$LLVM_VERSION-dev llvm-$LLVM_VERSION-runtime libclang-common-$LLVM_VERSION-dev sudo ln -s /usr/bin/llvm-config-$LLVM_VERSION /usr/bin/llvm-config sudo ln -s /usr/lib/x86_64-linux-gnu/libclang-$LLVM_VERSION.so /usr/lib/x86_64-linux-gnu/libclang.so
if [ -z "$1" ]; then exit fi export CODENAME=$(lsb_release --codename --short) export LLVM_VERSION=$1 # Add repositories sudo add-apt-repository --enable-source "deb http://llvm.org/apt/${CODENAME}/ llvm-toolchain-${CODENAME}-${LLVM_VERSION} main" sudo apt-get update sudo rm /usr/bin/llvm-config sudo rm /usr/lib/x86_64-linux-gnu/libclang.so sudo apt-get install -y clang-$LLVM_VERSION libclang1-$LLVM_VERSION libclang-$LLVM_VERSION-dev llvm-$LLVM_VERSION llvm-$LLVM_VERSION-dev llvm-$LLVM_VERSION-runtime libclang-common-$LLVM_VERSION-dev sudo ln -s /usr/bin/llvm-config-$LLVM_VERSION /usr/bin/llvm-config sudo ln -s /usr/lib/x86_64-linux-gnu/libclang-$LLVM_VERSION.so /usr/lib/x86_64-linux-gnu/libclang.so
Add clang repository for each version
Add clang repository for each version
Shell
mit
zimmski/go-clang-phoenix,zimmski/go-clang-phoenix
shell
## Code Before: if [ -z "$1" ]; then exit fi export LLVM_VERSION=$1 sudo rm /usr/bin/llvm-config sudo rm /usr/lib/x86_64-linux-gnu/libclang.so sudo apt-get install -y clang-$LLVM_VERSION libclang1-$LLVM_VERSION libclang-$LLVM_VERSION-dev llvm-$LLVM_VERSION llvm-$LLVM_VERSION-dev llvm-$LLVM_VERSION-runtime libclang-common-$LLVM_VERSION-dev sudo ln -s /usr/bin/llvm-config-$LLVM_VERSION /usr/bin/llvm-config sudo ln -s /usr/lib/x86_64-linux-gnu/libclang-$LLVM_VERSION.so /usr/lib/x86_64-linux-gnu/libclang.so ## Instruction: Add clang repository for each version ## Code After: if [ -z "$1" ]; then exit fi export CODENAME=$(lsb_release --codename --short) export LLVM_VERSION=$1 # Add repositories sudo add-apt-repository --enable-source "deb http://llvm.org/apt/${CODENAME}/ llvm-toolchain-${CODENAME}-${LLVM_VERSION} main" sudo apt-get update sudo rm /usr/bin/llvm-config sudo rm /usr/lib/x86_64-linux-gnu/libclang.so sudo apt-get install -y clang-$LLVM_VERSION libclang1-$LLVM_VERSION libclang-$LLVM_VERSION-dev llvm-$LLVM_VERSION llvm-$LLVM_VERSION-dev llvm-$LLVM_VERSION-runtime libclang-common-$LLVM_VERSION-dev sudo ln -s /usr/bin/llvm-config-$LLVM_VERSION /usr/bin/llvm-config sudo ln -s /usr/lib/x86_64-linux-gnu/libclang-$LLVM_VERSION.so /usr/lib/x86_64-linux-gnu/libclang.so
if [ -z "$1" ]; then exit fi + export CODENAME=$(lsb_release --codename --short) export LLVM_VERSION=$1 + + # Add repositories + sudo add-apt-repository --enable-source "deb http://llvm.org/apt/${CODENAME}/ llvm-toolchain-${CODENAME}-${LLVM_VERSION} main" + sudo apt-get update sudo rm /usr/bin/llvm-config sudo rm /usr/lib/x86_64-linux-gnu/libclang.so sudo apt-get install -y clang-$LLVM_VERSION libclang1-$LLVM_VERSION libclang-$LLVM_VERSION-dev llvm-$LLVM_VERSION llvm-$LLVM_VERSION-dev llvm-$LLVM_VERSION-runtime libclang-common-$LLVM_VERSION-dev sudo ln -s /usr/bin/llvm-config-$LLVM_VERSION /usr/bin/llvm-config sudo ln -s /usr/lib/x86_64-linux-gnu/libclang-$LLVM_VERSION.so /usr/lib/x86_64-linux-gnu/libclang.so
5
0.416667
5
0
8030eb6fbc974c1fdcab19535c637c60e1fb276a
app/views/sessions/login.html.erb
app/views/sessions/login.html.erb
<%= form_for(:user, html: {class: "small-6 small-centered columns"}) do |f| %> <%= f.label :email %> <%= f.text_field :email %> <%= f.label :password %> <%= f.text_field :password %> <%= f.submit "Login" %> <% end %>
<%= form_for(:user, html: {class: "small-6 small-centered columns"}) do |f| %> <%= f.label :email %> <%= f.text_field :email %> <%= f.label :password %> <%= f.text_field :password %> <%= f.submit "Login", :class => "button radius" %> <% end %>
Update login button with style
Update login button with style
HTML+ERB
mit
jjparseghian/only_chai_proto,jjparseghian/only_chai_proto,jjparseghian/only_chai_proto
html+erb
## Code Before: <%= form_for(:user, html: {class: "small-6 small-centered columns"}) do |f| %> <%= f.label :email %> <%= f.text_field :email %> <%= f.label :password %> <%= f.text_field :password %> <%= f.submit "Login" %> <% end %> ## Instruction: Update login button with style ## Code After: <%= form_for(:user, html: {class: "small-6 small-centered columns"}) do |f| %> <%= f.label :email %> <%= f.text_field :email %> <%= f.label :password %> <%= f.text_field :password %> <%= f.submit "Login", :class => "button radius" %> <% end %>
<%= form_for(:user, html: {class: "small-6 small-centered columns"}) do |f| %> <%= f.label :email %> <%= f.text_field :email %> <%= f.label :password %> <%= f.text_field :password %> - <%= f.submit "Login" %> + <%= f.submit "Login", :class => "button radius" %> <% end %>
2
0.222222
1
1
734c85c0ed13c6316966022930128b03a774f900
api-error.js
api-error.js
'use strict'; var inherits = require('inherits'); inherits(APIError, Error); module.exports = APIError; function APIError (error, request) { if (!(this instanceof APIError)) { return new APIError(error); } this.name = error.sys.id; this.message = [request.method, request.uri, formatMessage(error)].join(' '); this.request = request; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } var customFormatters = { ValidationFailed: function (error) { if (!(error.details && error.details.errors)) { return JSON.stringify(error); } return error.details.errors.reduce(function (messages, validationError) { var message = '(' + validationError.name + ' path=' + validationError.path.join('.') + ' value=' + JSON.stringify(validationError.value) + ')'; return messages.concat(message); }, []).join(', '); } }; function formatMessage (error) { if ('message' in error) { return error.message; } if (customFormatters[error.sys.id]) { return customFormatters[error.sys.id](error); } // stringify on one line return JSON.stringify(error); }
'use strict'; var inherits = require('inherits'); inherits(APIError, Error); module.exports = APIError; function APIError (error, request) { if (!(this instanceof APIError)) { return new APIError(error); } this.name = error.sys.id; this.message = [request.method, request.uri, formatMessage(error)].join(' '); this.request = request; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } var customFormatters = { ValidationFailed: function (error) { if (!(error.details && error.details.errors)) { return JSON.stringify(error); } return error.details.errors.reduce(function (messages, validationError) { var message = '(' + validationError.name + ' path=' + validationError.path.join('.') + ' value=' + JSON.stringify(validationError.value) + ')'; return messages.concat(message); }, []).join(', '); } }; function formatMessage (error) { if ('message' in error) { return error.message + ' ' + JSON.stringify(error); } if (customFormatters[error.sys.id]) { return customFormatters[error.sys.id](error); } // stringify on one line return JSON.stringify(error); }
Add single-line-stringified error to error.message case
Add single-line-stringified error to error.message case
JavaScript
mit
contentful/contentful-management.js,contentful/contentful-management.js
javascript
## Code Before: 'use strict'; var inherits = require('inherits'); inherits(APIError, Error); module.exports = APIError; function APIError (error, request) { if (!(this instanceof APIError)) { return new APIError(error); } this.name = error.sys.id; this.message = [request.method, request.uri, formatMessage(error)].join(' '); this.request = request; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } var customFormatters = { ValidationFailed: function (error) { if (!(error.details && error.details.errors)) { return JSON.stringify(error); } return error.details.errors.reduce(function (messages, validationError) { var message = '(' + validationError.name + ' path=' + validationError.path.join('.') + ' value=' + JSON.stringify(validationError.value) + ')'; return messages.concat(message); }, []).join(', '); } }; function formatMessage (error) { if ('message' in error) { return error.message; } if (customFormatters[error.sys.id]) { return customFormatters[error.sys.id](error); } // stringify on one line return JSON.stringify(error); } ## Instruction: Add single-line-stringified error to error.message case ## Code After: 'use strict'; var inherits = require('inherits'); inherits(APIError, Error); module.exports = APIError; function APIError (error, request) { if (!(this instanceof APIError)) { return new APIError(error); } this.name = error.sys.id; this.message = [request.method, request.uri, formatMessage(error)].join(' '); this.request = request; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } var customFormatters = { ValidationFailed: function (error) { if (!(error.details && error.details.errors)) { return JSON.stringify(error); } return error.details.errors.reduce(function (messages, validationError) { var message = '(' + validationError.name + ' path=' + validationError.path.join('.') + ' value=' + JSON.stringify(validationError.value) + ')'; return messages.concat(message); }, []).join(', '); } }; function formatMessage (error) { if ('message' in error) { return error.message + ' ' + JSON.stringify(error); } if (customFormatters[error.sys.id]) { return customFormatters[error.sys.id](error); } // stringify on one line return JSON.stringify(error); }
'use strict'; var inherits = require('inherits'); inherits(APIError, Error); module.exports = APIError; function APIError (error, request) { if (!(this instanceof APIError)) { return new APIError(error); } this.name = error.sys.id; this.message = [request.method, request.uri, formatMessage(error)].join(' '); this.request = request; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } var customFormatters = { ValidationFailed: function (error) { if (!(error.details && error.details.errors)) { return JSON.stringify(error); } return error.details.errors.reduce(function (messages, validationError) { var message = '(' + validationError.name + ' path=' + validationError.path.join('.') + ' value=' + JSON.stringify(validationError.value) + ')'; return messages.concat(message); }, []).join(', '); } }; function formatMessage (error) { if ('message' in error) { - return error.message; + return error.message + ' ' + JSON.stringify(error); } if (customFormatters[error.sys.id]) { return customFormatters[error.sys.id](error); } // stringify on one line return JSON.stringify(error); }
2
0.046512
1
1
0e98bc0417a6f25504dad5c8d224fb758a12c791
src/Client/Configuration/Macros.hs
src/Client/Configuration/Macros.hs
{-# LANGUAGE ApplicativeDo, OverloadedStrings #-} {-| Module : Client.Configuration.Macros Description : Configuration schema for macros Copyright : (c) Eric Mertens, 2017 License : ISC Maintainer : emertens@gmail.com -} module Client.Configuration.Macros ( macroMapSpec , macroCommandSpec ) where import Config.Schema.Spec import Client.Commands.Interpolation import Client.Commands.Recognizer import Data.Maybe (fromMaybe) import Data.Text (Text) macroMapSpec :: ValueSpecs (Recognizer Macro) macroMapSpec = fromCommands <$> listSpec macroValueSpecs macroValueSpecs :: ValueSpecs (Text, Macro) macroValueSpecs = sectionsSpec "macro" $ do name <- reqSection "name" "" spec <- fromMaybe noMacroArguments <$> optSection' "arguments" macroArgumentsSpec "" commands <- reqSection' "commands" (listSpec macroCommandSpec) "" return (name, Macro spec commands) macroArgumentsSpec :: ValueSpecs MacroSpec macroArgumentsSpec = customSpec "macro arguments" valuesSpec parseMacroSpecs macroCommandSpec :: ValueSpecs [ExpansionChunk] macroCommandSpec = customSpec "macro command" valuesSpec parseExpansion
{-# LANGUAGE ApplicativeDo, OverloadedStrings #-} {-| Module : Client.Configuration.Macros Description : Configuration schema for macros Copyright : (c) Eric Mertens, 2017 License : ISC Maintainer : emertens@gmail.com -} module Client.Configuration.Macros ( macroMapSpec , macroCommandSpec ) where import Config.Schema.Spec import Client.Commands.Interpolation import Client.Commands.Recognizer import Data.Maybe (fromMaybe) import Data.Text (Text) macroMapSpec :: ValueSpecs (Recognizer Macro) macroMapSpec = fromCommands <$> listSpec macroValueSpecs macroValueSpecs :: ValueSpecs (Text, Macro) macroValueSpecs = sectionsSpec "macro" $ do name <- reqSection "name" "" spec <- fromMaybe noMacroArguments <$> optSection' "arguments" macroArgumentsSpec "" commands <- reqSection' "commands" (oneOrList macroCommandSpec) "" return (name, Macro spec commands) macroArgumentsSpec :: ValueSpecs MacroSpec macroArgumentsSpec = customSpec "macro-arguments" valuesSpec parseMacroSpecs macroCommandSpec :: ValueSpecs [ExpansionChunk] macroCommandSpec = customSpec "macro-command" valuesSpec parseExpansion
Allow single command in macro-commands
Allow single command in macro-commands
Haskell
isc
glguy/irc-core,dolio/irc-core,glguy/irc-core,glguy/irc-core,dolio/irc-core,dolio/irc-core
haskell
## Code Before: {-# LANGUAGE ApplicativeDo, OverloadedStrings #-} {-| Module : Client.Configuration.Macros Description : Configuration schema for macros Copyright : (c) Eric Mertens, 2017 License : ISC Maintainer : emertens@gmail.com -} module Client.Configuration.Macros ( macroMapSpec , macroCommandSpec ) where import Config.Schema.Spec import Client.Commands.Interpolation import Client.Commands.Recognizer import Data.Maybe (fromMaybe) import Data.Text (Text) macroMapSpec :: ValueSpecs (Recognizer Macro) macroMapSpec = fromCommands <$> listSpec macroValueSpecs macroValueSpecs :: ValueSpecs (Text, Macro) macroValueSpecs = sectionsSpec "macro" $ do name <- reqSection "name" "" spec <- fromMaybe noMacroArguments <$> optSection' "arguments" macroArgumentsSpec "" commands <- reqSection' "commands" (listSpec macroCommandSpec) "" return (name, Macro spec commands) macroArgumentsSpec :: ValueSpecs MacroSpec macroArgumentsSpec = customSpec "macro arguments" valuesSpec parseMacroSpecs macroCommandSpec :: ValueSpecs [ExpansionChunk] macroCommandSpec = customSpec "macro command" valuesSpec parseExpansion ## Instruction: Allow single command in macro-commands ## Code After: {-# LANGUAGE ApplicativeDo, OverloadedStrings #-} {-| Module : Client.Configuration.Macros Description : Configuration schema for macros Copyright : (c) Eric Mertens, 2017 License : ISC Maintainer : emertens@gmail.com -} module Client.Configuration.Macros ( macroMapSpec , macroCommandSpec ) where import Config.Schema.Spec import Client.Commands.Interpolation import Client.Commands.Recognizer import Data.Maybe (fromMaybe) import Data.Text (Text) macroMapSpec :: ValueSpecs (Recognizer Macro) macroMapSpec = fromCommands <$> listSpec macroValueSpecs macroValueSpecs :: ValueSpecs (Text, Macro) macroValueSpecs = sectionsSpec "macro" $ do name <- reqSection "name" "" spec <- fromMaybe noMacroArguments <$> optSection' "arguments" macroArgumentsSpec "" commands <- reqSection' "commands" (oneOrList macroCommandSpec) "" return (name, Macro spec commands) macroArgumentsSpec :: ValueSpecs MacroSpec macroArgumentsSpec = customSpec "macro-arguments" valuesSpec parseMacroSpecs macroCommandSpec :: ValueSpecs [ExpansionChunk] macroCommandSpec = customSpec "macro-command" valuesSpec parseExpansion
{-# LANGUAGE ApplicativeDo, OverloadedStrings #-} {-| Module : Client.Configuration.Macros Description : Configuration schema for macros Copyright : (c) Eric Mertens, 2017 License : ISC Maintainer : emertens@gmail.com -} module Client.Configuration.Macros ( macroMapSpec , macroCommandSpec ) where import Config.Schema.Spec import Client.Commands.Interpolation import Client.Commands.Recognizer import Data.Maybe (fromMaybe) import Data.Text (Text) macroMapSpec :: ValueSpecs (Recognizer Macro) macroMapSpec = fromCommands <$> listSpec macroValueSpecs macroValueSpecs :: ValueSpecs (Text, Macro) macroValueSpecs = sectionsSpec "macro" $ do name <- reqSection "name" "" spec <- fromMaybe noMacroArguments <$> optSection' "arguments" macroArgumentsSpec "" - commands <- reqSection' "commands" (listSpec macroCommandSpec) "" ? ^ ---- + commands <- reqSection' "commands" (oneOrList macroCommandSpec) "" ? ^^^^^^ return (name, Macro spec commands) macroArgumentsSpec :: ValueSpecs MacroSpec - macroArgumentsSpec = customSpec "macro arguments" valuesSpec parseMacroSpecs ? ^ + macroArgumentsSpec = customSpec "macro-arguments" valuesSpec parseMacroSpecs ? ^ macroCommandSpec :: ValueSpecs [ExpansionChunk] - macroCommandSpec = customSpec "macro command" valuesSpec parseExpansion ? ^ + macroCommandSpec = customSpec "macro-command" valuesSpec parseExpansion ? ^
6
0.157895
3
3
75949a62feb0fbbac42afb2fa0914d1e8cc47e33
config/locales/en.yml
config/locales/en.yml
en: hello: "Hello world" # responders gem flash: actions: create: success: "%{resource_name} was successfully created." update: success: "%{resource_name} was successfully updated." destroy: success: "%{resource_name} was successfully destroyed." danger: "%{resource_name} could not be destroyed."
en: hello: "Hello world" helpers: label: profile: secondary_email: 'Alternate e-mail' total_years: 'Total years of study'
Move responders localization, add form label localizations
Move responders localization, add form label localizations
YAML
mit
jrhorn424/recruiter,jrhorn424/recruiter
yaml
## Code Before: en: hello: "Hello world" # responders gem flash: actions: create: success: "%{resource_name} was successfully created." update: success: "%{resource_name} was successfully updated." destroy: success: "%{resource_name} was successfully destroyed." danger: "%{resource_name} could not be destroyed." ## Instruction: Move responders localization, add form label localizations ## Code After: en: hello: "Hello world" helpers: label: profile: secondary_email: 'Alternate e-mail' total_years: 'Total years of study'
en: hello: "Hello world" + helpers: + label: + profile: + secondary_email: 'Alternate e-mail' + total_years: 'Total years of study' - - # responders gem - flash: - actions: - create: - success: "%{resource_name} was successfully created." - update: - success: "%{resource_name} was successfully updated." - destroy: - success: "%{resource_name} was successfully destroyed." - danger: "%{resource_name} could not be destroyed."
16
1.142857
5
11
b421d632c3154a219019571d23a9af71ad58e197
app/controllers/sessions_controller.rb
app/controllers/sessions_controller.rb
class SessionsController < ApplicationController def create user = User.auth_case_insens(params[:email], params[:password]) if user session[:user_id] = user.id return_to = session.delete(:return_to) redirect_to(return_to || my_url, notice: 'Logged in.') else flash[:error] = 'Login failed.' render :new end end def destroy if session[:user_id] session.delete :user_id redirect_to root_url, notice: 'Logged out.' else redirect_to root_url end end end
class SessionsController < ApplicationController def create user = User.auth_case_insens(params[:email], params[:password]) if user login(user) else flash[:error] = 'Login failed.' render :new end end def destroy if session[:user_id] session.delete :user_id redirect_to root_url, notice: 'Logged out.' else redirect_to root_url end end private def login(user) session[:user_id] = user.id return_to = session.delete(:return_to) redirect_to(return_to || my_url, notice: 'Logged in.') end end
Move login code to its own method.
Move login code to its own method.
Ruby
mit
mmb/meme_captain_web,mmb/meme_captain_web,mmb/meme_captain_web,mmb/meme_captain_web
ruby
## Code Before: class SessionsController < ApplicationController def create user = User.auth_case_insens(params[:email], params[:password]) if user session[:user_id] = user.id return_to = session.delete(:return_to) redirect_to(return_to || my_url, notice: 'Logged in.') else flash[:error] = 'Login failed.' render :new end end def destroy if session[:user_id] session.delete :user_id redirect_to root_url, notice: 'Logged out.' else redirect_to root_url end end end ## Instruction: Move login code to its own method. ## Code After: class SessionsController < ApplicationController def create user = User.auth_case_insens(params[:email], params[:password]) if user login(user) else flash[:error] = 'Login failed.' render :new end end def destroy if session[:user_id] session.delete :user_id redirect_to root_url, notice: 'Logged out.' else redirect_to root_url end end private def login(user) session[:user_id] = user.id return_to = session.delete(:return_to) redirect_to(return_to || my_url, notice: 'Logged in.') end end
class SessionsController < ApplicationController def create user = User.auth_case_insens(params[:email], params[:password]) if user + login(user) - session[:user_id] = user.id - return_to = session.delete(:return_to) - redirect_to(return_to || my_url, notice: 'Logged in.') else flash[:error] = 'Login failed.' render :new end end def destroy if session[:user_id] session.delete :user_id redirect_to root_url, notice: 'Logged out.' else redirect_to root_url end end + + private + + def login(user) + session[:user_id] = user.id + return_to = session.delete(:return_to) + redirect_to(return_to || my_url, notice: 'Logged in.') + end end
12
0.5
9
3
7b37efdfa368f739fad70cab64310b475b76661b
docs/source/api_reference/marker_cluster.rst
docs/source/api_reference/marker_cluster.rst
Marker Cluster ============== Example ------- .. code:: from ipyleaflet import Map, Marker, MarkerCluster m = Map(center=(50, 354), zoom=5) marker1 = Marker(location=(50, 354)) marker2 = Marker(location=(52, 356)) marker3 = Marker(location=(48, 352)) marker_cluster = MarkerCluster( markers=(marker1, marker2, marker3) ) m.add_layer(marker_cluster); m Attributes ---------- ============ ================ === Attribute Default Value Doc ============ ================ === markers () Tuple of markers ============ ================ ===
Marker Cluster ============== Example ------- .. code:: from ipyleaflet import Map, Marker, MarkerCluster m = Map(center=(50, 0), zoom=5) marker1 = Marker(location=(48, -2)) marker2 = Marker(location=(50, 0)) marker3 = Marker(location=(52, 2)) marker_cluster = MarkerCluster( markers=(marker1, marker2, marker3) ) m.add_layer(marker_cluster); m Attributes ---------- ============ ================ === Attribute Default Value Doc ============ ================ === markers () Tuple of markers ============ ================ ===
Change example longitudes to more reasonable values inside (-180, 180)
Change example longitudes to more reasonable values inside (-180, 180)
reStructuredText
mit
ellisonbg/leafletwidget,ellisonbg/leafletwidget,ellisonbg/ipyleaflet,ellisonbg/ipyleaflet
restructuredtext
## Code Before: Marker Cluster ============== Example ------- .. code:: from ipyleaflet import Map, Marker, MarkerCluster m = Map(center=(50, 354), zoom=5) marker1 = Marker(location=(50, 354)) marker2 = Marker(location=(52, 356)) marker3 = Marker(location=(48, 352)) marker_cluster = MarkerCluster( markers=(marker1, marker2, marker3) ) m.add_layer(marker_cluster); m Attributes ---------- ============ ================ === Attribute Default Value Doc ============ ================ === markers () Tuple of markers ============ ================ === ## Instruction: Change example longitudes to more reasonable values inside (-180, 180) ## Code After: Marker Cluster ============== Example ------- .. code:: from ipyleaflet import Map, Marker, MarkerCluster m = Map(center=(50, 0), zoom=5) marker1 = Marker(location=(48, -2)) marker2 = Marker(location=(50, 0)) marker3 = Marker(location=(52, 2)) marker_cluster = MarkerCluster( markers=(marker1, marker2, marker3) ) m.add_layer(marker_cluster); m Attributes ---------- ============ ================ === Attribute Default Value Doc ============ ================ === markers () Tuple of markers ============ ================ ===
Marker Cluster ============== Example ------- .. code:: from ipyleaflet import Map, Marker, MarkerCluster - m = Map(center=(50, 354), zoom=5) ? ^^^ + m = Map(center=(50, 0), zoom=5) ? ^ - marker1 = Marker(location=(50, 354)) - marker2 = Marker(location=(52, 356)) - marker3 = Marker(location=(48, 352)) ? ^ ^^ + marker1 = Marker(location=(48, -2)) ? ^ ^ + marker2 = Marker(location=(50, 0)) + marker3 = Marker(location=(52, 2)) marker_cluster = MarkerCluster( markers=(marker1, marker2, marker3) ) m.add_layer(marker_cluster); m Attributes ---------- ============ ================ === Attribute Default Value Doc ============ ================ === markers () Tuple of markers ============ ================ ===
8
0.25
4
4
92de971285137229eb8a4fbe94ef0de7841bef88
src/components/GlobalSearch.scss
src/components/GlobalSearch.scss
@import '../styles/colors'; .gs-input-wrapper { display: inline-block; width: 100%; padding: 0; position: relative; } .gs-input-wrapper::after { background-color: $gh-box-fill-color; display: inline-block; font-family: FontAwesome; color: white; content: "\f002"; padding: 8px 10px; height: 37px !important; top: 0; position: relative; border: 2px solid $gh-box-color; } .gs-input { font-size: 0.8em !important; width: 100%; padding: 6px; height: 37px; border-right: none; } .gs-input::-webkit-input-placeholder { text-transform: uppercase; }
@import '../styles/colors'; .gs-input-wrapper { display: inline-block; width: 100%; padding: 0; position: relative; } .gs-input-wrapper::after { background-color: $gh-box-fill-color; display: inline-block; font-family: FontAwesome; color: white; content: "\f002"; padding: 8px 13px; height: 37px !important; top: 0; position: relative; border: 2px solid $gh-box-color; border-left: none; } .gs-input { font-size: 0.8em !important; width: 100%; padding: 6px; height: 37px; border-right: none; } .gs-input::-webkit-input-placeholder { text-transform: uppercase; }
Make the search icon better match the drop down icons on the header widgets by removing the left border and adjusting its size.
Make the search icon better match the drop down icons on the header widgets by removing the left border and adjusting its size.
SCSS
bsd-3-clause
FiviumAustralia/RNSH-Pilot,FiviumAustralia/RNSH-Pilot,FiviumAustralia/RNSH-Pilot
scss
## Code Before: @import '../styles/colors'; .gs-input-wrapper { display: inline-block; width: 100%; padding: 0; position: relative; } .gs-input-wrapper::after { background-color: $gh-box-fill-color; display: inline-block; font-family: FontAwesome; color: white; content: "\f002"; padding: 8px 10px; height: 37px !important; top: 0; position: relative; border: 2px solid $gh-box-color; } .gs-input { font-size: 0.8em !important; width: 100%; padding: 6px; height: 37px; border-right: none; } .gs-input::-webkit-input-placeholder { text-transform: uppercase; } ## Instruction: Make the search icon better match the drop down icons on the header widgets by removing the left border and adjusting its size. ## Code After: @import '../styles/colors'; .gs-input-wrapper { display: inline-block; width: 100%; padding: 0; position: relative; } .gs-input-wrapper::after { background-color: $gh-box-fill-color; display: inline-block; font-family: FontAwesome; color: white; content: "\f002"; padding: 8px 13px; height: 37px !important; top: 0; position: relative; border: 2px solid $gh-box-color; border-left: none; } .gs-input { font-size: 0.8em !important; width: 100%; padding: 6px; height: 37px; border-right: none; } .gs-input::-webkit-input-placeholder { text-transform: uppercase; }
@import '../styles/colors'; .gs-input-wrapper { display: inline-block; width: 100%; padding: 0; position: relative; } .gs-input-wrapper::after { background-color: $gh-box-fill-color; display: inline-block; font-family: FontAwesome; color: white; content: "\f002"; - padding: 8px 10px; ? ^ + padding: 8px 13px; ? ^ height: 37px !important; top: 0; position: relative; border: 2px solid $gh-box-color; + border-left: none; } .gs-input { font-size: 0.8em !important; width: 100%; padding: 6px; height: 37px; border-right: none; } .gs-input::-webkit-input-placeholder { text-transform: uppercase; }
3
0.090909
2
1
c0204cf718377783ebd14bfab04d9ab15ed53216
lib/slackMessage.js
lib/slackMessage.js
const RESPONSE_PUBLIC = 'in_channel'; const RESPONSE_PRIVATE = 'ephemeral'; // Required names for slack /*eslint-disable camelcase */ const baseResponse = { parse: 'full', text: '', unfurl_media: true }; /*eslint-enable camelcase */ function getImageAttachment(image) { // Required names for slack /*eslint-disable camelcase */ return [{ fallback: 'Image failed to load', image_url: encodeURI(image) }]; /*eslint-enable camelcase */ } module.exports = function create(data) { let responseObject = Object.assign({}, baseResponse); responseObject.text = data.text; if(data.image) { responseObject.attachments = getImageAttachment(data.image); } // Required names for slack /*eslint-disable camelcase */ responseObject.response_type = (!data.isPrivate ? RESPONSE_PUBLIC : RESPONSE_PRIVATE); /*eslint-enable camelcase */ return responseObject; };
const RESPONSE_PUBLIC = 'in_channel'; const RESPONSE_PRIVATE = 'ephemeral'; const baseResponse = { // Required names for slack /*eslint-disable camelcase */ parse: 'full', text: '', unfurl_media: true /*eslint-enable camelcase */ }; function getImageAttachment(image) { // Required names for slack /*eslint-disable camelcase */ return [{ fallback: 'Image failed to load', image_url: encodeURI(image) }]; /*eslint-enable camelcase */ } module.exports = function create(data) { let responseObject = Object.assign({}, baseResponse); responseObject.text = data.text; if(data.image) { responseObject.attachments = getImageAttachment(data.image); } // Required names for slack /*eslint-disable camelcase */ responseObject.response_type = (!data.isPrivate ? RESPONSE_PUBLIC : RESPONSE_PRIVATE); /*eslint-enable camelcase */ return responseObject; };
Tidy up the eslint excludes
chore: Tidy up the eslint excludes
JavaScript
mit
bmds/SlackXWingCardCmd
javascript
## Code Before: const RESPONSE_PUBLIC = 'in_channel'; const RESPONSE_PRIVATE = 'ephemeral'; // Required names for slack /*eslint-disable camelcase */ const baseResponse = { parse: 'full', text: '', unfurl_media: true }; /*eslint-enable camelcase */ function getImageAttachment(image) { // Required names for slack /*eslint-disable camelcase */ return [{ fallback: 'Image failed to load', image_url: encodeURI(image) }]; /*eslint-enable camelcase */ } module.exports = function create(data) { let responseObject = Object.assign({}, baseResponse); responseObject.text = data.text; if(data.image) { responseObject.attachments = getImageAttachment(data.image); } // Required names for slack /*eslint-disable camelcase */ responseObject.response_type = (!data.isPrivate ? RESPONSE_PUBLIC : RESPONSE_PRIVATE); /*eslint-enable camelcase */ return responseObject; }; ## Instruction: chore: Tidy up the eslint excludes ## Code After: const RESPONSE_PUBLIC = 'in_channel'; const RESPONSE_PRIVATE = 'ephemeral'; const baseResponse = { // Required names for slack /*eslint-disable camelcase */ parse: 'full', text: '', unfurl_media: true /*eslint-enable camelcase */ }; function getImageAttachment(image) { // Required names for slack /*eslint-disable camelcase */ return [{ fallback: 'Image failed to load', image_url: encodeURI(image) }]; /*eslint-enable camelcase */ } module.exports = function create(data) { let responseObject = Object.assign({}, baseResponse); responseObject.text = data.text; if(data.image) { responseObject.attachments = getImageAttachment(data.image); } // Required names for slack /*eslint-disable camelcase */ responseObject.response_type = (!data.isPrivate ? RESPONSE_PUBLIC : RESPONSE_PRIVATE); /*eslint-enable camelcase */ return responseObject; };
const RESPONSE_PUBLIC = 'in_channel'; const RESPONSE_PRIVATE = 'ephemeral'; - // Required names for slack - /*eslint-disable camelcase */ const baseResponse = { + // Required names for slack + /*eslint-disable camelcase */ parse: 'full', text: '', unfurl_media: true + /*eslint-enable camelcase */ }; - /*eslint-enable camelcase */ function getImageAttachment(image) { // Required names for slack /*eslint-disable camelcase */ return [{ fallback: 'Image failed to load', image_url: encodeURI(image) }]; /*eslint-enable camelcase */ } module.exports = function create(data) { let responseObject = Object.assign({}, baseResponse); responseObject.text = data.text; if(data.image) { responseObject.attachments = getImageAttachment(data.image); } // Required names for slack /*eslint-disable camelcase */ responseObject.response_type = (!data.isPrivate ? RESPONSE_PUBLIC : RESPONSE_PRIVATE); /*eslint-enable camelcase */ return responseObject; };
6
0.157895
3
3
f153c277ad0dd29c8c04a8cca90fe41d290b0e2b
_protected/framework/Layout/Form/Engine/PFBC/Validation.php
_protected/framework/Layout/Form/Engine/PFBC/Validation.php
<?php /** * Many changes have been made in this file. * By Pierre-Henry SORIA. */ namespace PFBC; use PH7\Framework\Security\Validate\Validate; abstract class Validation extends Base { protected $oValidate, $message; public function __construct($message = '') { $this->oValidate = new Validate; if (!empty($message)) { $this->message = t('%element% is invalid.'); } } public function getMessage() { return $this->message; } public function isNotApplicable($value) { return (is_null($value) || is_array($value) || $value === ''); } public abstract function isValid($value); }
<?php /** * Many changes have been made in this file. * By Pierre-Henry SORIA. */ namespace PFBC; use PH7\Framework\Security\Validate\Validate; abstract class Validation extends Base { protected $oValidate, $message; public function __construct($message = '') { $this->oValidate = new Validate; if (!empty($message)) { $this->message = t('%element% is invalid.'); } } public function getMessage() { return $this->message; } public function isNotApplicable($value) { return ($value === null || is_array($value) || $value === ''); } public abstract function isValid($value); }
Replace is_null with strict identical operator
[Optimization:Speed] Replace is_null with strict identical operator
PHP
mit
pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS,pH7Software/pH7-Social-Dating-CMS
php
## Code Before: <?php /** * Many changes have been made in this file. * By Pierre-Henry SORIA. */ namespace PFBC; use PH7\Framework\Security\Validate\Validate; abstract class Validation extends Base { protected $oValidate, $message; public function __construct($message = '') { $this->oValidate = new Validate; if (!empty($message)) { $this->message = t('%element% is invalid.'); } } public function getMessage() { return $this->message; } public function isNotApplicable($value) { return (is_null($value) || is_array($value) || $value === ''); } public abstract function isValid($value); } ## Instruction: [Optimization:Speed] Replace is_null with strict identical operator ## Code After: <?php /** * Many changes have been made in this file. * By Pierre-Henry SORIA. */ namespace PFBC; use PH7\Framework\Security\Validate\Validate; abstract class Validation extends Base { protected $oValidate, $message; public function __construct($message = '') { $this->oValidate = new Validate; if (!empty($message)) { $this->message = t('%element% is invalid.'); } } public function getMessage() { return $this->message; } public function isNotApplicable($value) { return ($value === null || is_array($value) || $value === ''); } public abstract function isValid($value); }
<?php /** * Many changes have been made in this file. * By Pierre-Henry SORIA. */ namespace PFBC; use PH7\Framework\Security\Validate\Validate; abstract class Validation extends Base { protected $oValidate, $message; public function __construct($message = '') { $this->oValidate = new Validate; if (!empty($message)) { $this->message = t('%element% is invalid.'); } } public function getMessage() { return $this->message; } public function isNotApplicable($value) { - return (is_null($value) || is_array($value) || $value === ''); ? -------- ^ + return ($value === null || is_array($value) || $value === ''); ? ^^^^^^^^^ } public abstract function isValid($value); }
2
0.057143
1
1
adc886313ce5b308ab72982be1fdbba9681ae7f3
README.md
README.md
gpuush ====== This is a very basic puush.me client for linux written in golang. **gpuush** can either use imagemagick's import command to select an area/window to upload or upload a file from command line. The protocol has been reverse engineering in order to upload files without the official client, which does not support linux. Usage ----- Once compiled (via `go build` or `go install`), the executable should be placed in /usr/local/bin/ gpuush [filename] Upload any file to puush.me gpuush -screenshot Take a screenshot (for use with hotkeys) gpuush -background Stay open as a tray icon The icon file is read from /usr/local/share/gpuush/icon.png Some external dependencies that may need to be installed are: - imagemagick - libnotify - xclip
gpuush ====== This is a very basic puush.me client for linux written in golang. **gpuush** can either use imagemagick's import command to select an area/window to upload or upload a file from command line. The protocol has been reverse engineering in order to upload files without the official client, which does not support linux. Usage ----- Once compiled (via `go build` or `go install`), the executable should be placed in /usr/local/bin/ gpuush [filename] Upload any file to puush.me gpuush -screenshot Take a screenshot (for use with hotkeys) gpuush -background Stay open as a tray icon The icon file is read from /usr/local/share/gpuush/icon.png To configure the user gpuush will upload as, create the file `~/.gpuush` with the contents: { "email": "example@example.com", "pass": "hunter2" } Some external dependencies that may need to be installed are: - imagemagick - libnotify - xclip
Update readme to contain configuration info
Update readme to contain configuration info
Markdown
mit
xthexder/gpuush
markdown
## Code Before: gpuush ====== This is a very basic puush.me client for linux written in golang. **gpuush** can either use imagemagick's import command to select an area/window to upload or upload a file from command line. The protocol has been reverse engineering in order to upload files without the official client, which does not support linux. Usage ----- Once compiled (via `go build` or `go install`), the executable should be placed in /usr/local/bin/ gpuush [filename] Upload any file to puush.me gpuush -screenshot Take a screenshot (for use with hotkeys) gpuush -background Stay open as a tray icon The icon file is read from /usr/local/share/gpuush/icon.png Some external dependencies that may need to be installed are: - imagemagick - libnotify - xclip ## Instruction: Update readme to contain configuration info ## Code After: gpuush ====== This is a very basic puush.me client for linux written in golang. **gpuush** can either use imagemagick's import command to select an area/window to upload or upload a file from command line. The protocol has been reverse engineering in order to upload files without the official client, which does not support linux. Usage ----- Once compiled (via `go build` or `go install`), the executable should be placed in /usr/local/bin/ gpuush [filename] Upload any file to puush.me gpuush -screenshot Take a screenshot (for use with hotkeys) gpuush -background Stay open as a tray icon The icon file is read from /usr/local/share/gpuush/icon.png To configure the user gpuush will upload as, create the file `~/.gpuush` with the contents: { "email": "example@example.com", "pass": "hunter2" } Some external dependencies that may need to be installed are: - imagemagick - libnotify - xclip
gpuush ====== This is a very basic puush.me client for linux written in golang. **gpuush** can either use imagemagick's import command to select an area/window to upload or upload a file from command line. The protocol has been reverse engineering in order to upload files without the official client, which does not support linux. Usage ----- Once compiled (via `go build` or `go install`), the executable should be placed in /usr/local/bin/ gpuush [filename] Upload any file to puush.me gpuush -screenshot Take a screenshot (for use with hotkeys) gpuush -background Stay open as a tray icon The icon file is read from /usr/local/share/gpuush/icon.png + To configure the user gpuush will upload as, create the file `~/.gpuush` with the contents: + + { + "email": "example@example.com", + "pass": "hunter2" + } + Some external dependencies that may need to be installed are: - imagemagick - libnotify - xclip
7
0.291667
7
0
b5337fa5cf373ef169ce014d0303106f0db5e01c
example_app_generator/generate_action_mailer_specs.rb
example_app_generator/generate_action_mailer_specs.rb
require 'active_support' require 'active_support/core_ext/module' using_source_path(File.expand_path(__dir__)) do # Comment out the default mailer stuff comment_lines 'config/environments/development.rb', /action_mailer/ comment_lines 'config/environments/test.rb', /action_mailer/ initializer 'action_mailer.rb', <<-CODE require "action_view/base" if ENV['DEFAULT_URL'] ExampleApp::Application.configure do config.action_mailer.default_url_options = { :host => ENV['DEFAULT_URL'] } end end CODE gsub_file 'config/initializers/action_mailer.rb', /ExampleApp/, Rails.application.class.parent.to_s copy_file 'spec/support/default_preview_path' chmod 'spec/support/default_preview_path', 0755 gsub_file 'spec/support/default_preview_path', /ExampleApp/, Rails.application.class.parent.to_s if skip_active_record? comment_lines 'spec/support/default_preview_path', /active_record/ comment_lines 'spec/support/default_preview_path', /active_storage/ end copy_file 'spec/verify_mailer_preview_path_spec.rb' end
require 'active_support' require 'active_support/core_ext/module' using_source_path(File.expand_path(__dir__)) do # Comment out the default mailer stuff comment_lines 'config/environments/development.rb', /action_mailer/ comment_lines 'config/environments/test.rb', /action_mailer/ initializer 'action_mailer.rb', <<-CODE require "action_view/base" if ENV['DEFAULT_URL'] ExampleApp::Application.configure do config.action_mailer.default_url_options = { :host => ENV['DEFAULT_URL'] } end end CODE rails_parent = if Rails.version.to_f >= 6.0 Rails.application.class.module_parent.to_s else Rails.application.class.parent.to_s end gsub_file 'config/initializers/action_mailer.rb', /ExampleApp/, rails_parent copy_file 'spec/support/default_preview_path' chmod 'spec/support/default_preview_path', 0755 gsub_file 'spec/support/default_preview_path', /ExampleApp/, rails_parent if skip_active_record? comment_lines 'spec/support/default_preview_path', /active_record/ comment_lines 'spec/support/default_preview_path', /active_storage/ end copy_file 'spec/verify_mailer_preview_path_spec.rb' end
Replace deprecated parent method with module_parent
Replace deprecated parent method with module_parent
Ruby
mit
rspec/rspec-rails,rspec/rspec-rails,rspec/rspec-rails
ruby
## Code Before: require 'active_support' require 'active_support/core_ext/module' using_source_path(File.expand_path(__dir__)) do # Comment out the default mailer stuff comment_lines 'config/environments/development.rb', /action_mailer/ comment_lines 'config/environments/test.rb', /action_mailer/ initializer 'action_mailer.rb', <<-CODE require "action_view/base" if ENV['DEFAULT_URL'] ExampleApp::Application.configure do config.action_mailer.default_url_options = { :host => ENV['DEFAULT_URL'] } end end CODE gsub_file 'config/initializers/action_mailer.rb', /ExampleApp/, Rails.application.class.parent.to_s copy_file 'spec/support/default_preview_path' chmod 'spec/support/default_preview_path', 0755 gsub_file 'spec/support/default_preview_path', /ExampleApp/, Rails.application.class.parent.to_s if skip_active_record? comment_lines 'spec/support/default_preview_path', /active_record/ comment_lines 'spec/support/default_preview_path', /active_storage/ end copy_file 'spec/verify_mailer_preview_path_spec.rb' end ## Instruction: Replace deprecated parent method with module_parent ## Code After: require 'active_support' require 'active_support/core_ext/module' using_source_path(File.expand_path(__dir__)) do # Comment out the default mailer stuff comment_lines 'config/environments/development.rb', /action_mailer/ comment_lines 'config/environments/test.rb', /action_mailer/ initializer 'action_mailer.rb', <<-CODE require "action_view/base" if ENV['DEFAULT_URL'] ExampleApp::Application.configure do config.action_mailer.default_url_options = { :host => ENV['DEFAULT_URL'] } end end CODE rails_parent = if Rails.version.to_f >= 6.0 Rails.application.class.module_parent.to_s else Rails.application.class.parent.to_s end gsub_file 'config/initializers/action_mailer.rb', /ExampleApp/, rails_parent copy_file 'spec/support/default_preview_path' chmod 'spec/support/default_preview_path', 0755 gsub_file 'spec/support/default_preview_path', /ExampleApp/, rails_parent if skip_active_record? comment_lines 'spec/support/default_preview_path', /active_record/ comment_lines 'spec/support/default_preview_path', /active_storage/ end copy_file 'spec/verify_mailer_preview_path_spec.rb' end
require 'active_support' require 'active_support/core_ext/module' using_source_path(File.expand_path(__dir__)) do # Comment out the default mailer stuff comment_lines 'config/environments/development.rb', /action_mailer/ comment_lines 'config/environments/test.rb', /action_mailer/ initializer 'action_mailer.rb', <<-CODE require "action_view/base" if ENV['DEFAULT_URL'] ExampleApp::Application.configure do config.action_mailer.default_url_options = { :host => ENV['DEFAULT_URL'] } end end CODE - gsub_file 'config/initializers/action_mailer.rb', - /ExampleApp/, + + rails_parent = + if Rails.version.to_f >= 6.0 + Rails.application.class.module_parent.to_s + else - Rails.application.class.parent.to_s ? ------ + Rails.application.class.parent.to_s + end + + gsub_file 'config/initializers/action_mailer.rb', /ExampleApp/, rails_parent copy_file 'spec/support/default_preview_path' chmod 'spec/support/default_preview_path', 0755 - gsub_file 'spec/support/default_preview_path', + gsub_file 'spec/support/default_preview_path', /ExampleApp/, rails_parent ? +++++++++++++++++++++++++++ + - /ExampleApp/, - Rails.application.class.parent.to_s if skip_active_record? comment_lines 'spec/support/default_preview_path', /active_record/ comment_lines 'spec/support/default_preview_path', /active_storage/ end copy_file 'spec/verify_mailer_preview_path_spec.rb' end
17
0.548387
11
6
029b9de65f189345ec8ef630757aa1f2e280007a
parity-top/src/main/java/org/jvirtanen/parity/top/MarketListener.java
parity-top/src/main/java/org/jvirtanen/parity/top/MarketListener.java
package org.jvirtanen.parity.top; /** * <code>MarketListener</code> is the interface for outbound events from the * order book reconstruction. */ public interface MarketListener { /** * An event indicating that the best bid and offer (BBO) has changed. * * @param instrument the instrument * @param bidPrice the bid price or zero if there are no bids * @param bidSize the bid size or zero if there are no bids * @param askPrice the ask price or zero if there are no asks * @param askSize the ask size or zero if there are no asks */ void bbo(long instrument, long bidPrice, long bidSize, long askPrice, long askSize); /** * An event indicating that a trade has taken place. * * @param instrument the instrument * @param side the side of the resting order * @param price the trade price * @param size the trade size */ void trade(long instrument, Side side, long price, long size); }
package org.jvirtanen.parity.top; /** * The interface for outbound events from the order book reconstruction. */ public interface MarketListener { /** * An event indicating that the best bid and offer (BBO) has changed. * * @param instrument the instrument * @param bidPrice the bid price or zero if there are no bids * @param bidSize the bid size or zero if there are no bids * @param askPrice the ask price or zero if there are no asks * @param askSize the ask size or zero if there are no asks */ void bbo(long instrument, long bidPrice, long bidSize, long askPrice, long askSize); /** * An event indicating that a trade has taken place. * * @param instrument the instrument * @param side the side of the resting order * @param price the trade price * @param size the trade size */ void trade(long instrument, Side side, long price, long size); }
Tweak documentation for market listener in order book reconstruction
Tweak documentation for market listener in order book reconstruction
Java
apache-2.0
pmcs/parity,pmcs/parity,paritytrading/parity,paritytrading/parity
java
## Code Before: package org.jvirtanen.parity.top; /** * <code>MarketListener</code> is the interface for outbound events from the * order book reconstruction. */ public interface MarketListener { /** * An event indicating that the best bid and offer (BBO) has changed. * * @param instrument the instrument * @param bidPrice the bid price or zero if there are no bids * @param bidSize the bid size or zero if there are no bids * @param askPrice the ask price or zero if there are no asks * @param askSize the ask size or zero if there are no asks */ void bbo(long instrument, long bidPrice, long bidSize, long askPrice, long askSize); /** * An event indicating that a trade has taken place. * * @param instrument the instrument * @param side the side of the resting order * @param price the trade price * @param size the trade size */ void trade(long instrument, Side side, long price, long size); } ## Instruction: Tweak documentation for market listener in order book reconstruction ## Code After: package org.jvirtanen.parity.top; /** * The interface for outbound events from the order book reconstruction. */ public interface MarketListener { /** * An event indicating that the best bid and offer (BBO) has changed. * * @param instrument the instrument * @param bidPrice the bid price or zero if there are no bids * @param bidSize the bid size or zero if there are no bids * @param askPrice the ask price or zero if there are no asks * @param askSize the ask size or zero if there are no asks */ void bbo(long instrument, long bidPrice, long bidSize, long askPrice, long askSize); /** * An event indicating that a trade has taken place. * * @param instrument the instrument * @param side the side of the resting order * @param price the trade price * @param size the trade size */ void trade(long instrument, Side side, long price, long size); }
package org.jvirtanen.parity.top; /** + * The interface for outbound events from the order book reconstruction. - * <code>MarketListener</code> is the interface for outbound events from the - * order book reconstruction. */ public interface MarketListener { /** * An event indicating that the best bid and offer (BBO) has changed. * * @param instrument the instrument * @param bidPrice the bid price or zero if there are no bids * @param bidSize the bid size or zero if there are no bids * @param askPrice the ask price or zero if there are no asks * @param askSize the ask size or zero if there are no asks */ void bbo(long instrument, long bidPrice, long bidSize, long askPrice, long askSize); /** * An event indicating that a trade has taken place. * * @param instrument the instrument * @param side the side of the resting order * @param price the trade price * @param size the trade size */ void trade(long instrument, Side side, long price, long size); }
3
0.1
1
2
1dcacbc8a960279db61610185b7155719f5046d5
find-core/src/main/public/static/js/find/app/pages.js
find-core/src/main/public/static/js/find/app/pages.js
/* * Copyright 2014-2015 Hewlett-Packard Development Company, L.P. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. */ define([ 'find/app/find-pages', 'find/app/page/find-search', 'find/app/page/find-settings-page', 'i18n!find/nls/bundle' ], function(FindPages, FindSearch, SettingsPage) { return FindPages.extend({ initializePages: function() { this.pages = [ { constructor: SettingsPage , pageName: 'settings' , classes: 'hide-from-non-useradmin' } ]; } }); });
/* * Copyright 2014-2015 Hewlett-Packard Development Company, L.P. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. */ define([ 'find/app/find-pages', 'find/app/page/find-settings-page', 'i18n!find/nls/bundle' ], function(FindPages, SettingsPage) { return FindPages.extend({ initializePages: function() { this.pages = [ { constructor: SettingsPage , pageName: 'settings' , classes: 'hide-from-non-useradmin' } ]; } }); });
Remove unnecessary import [rev: minor]
Remove unnecessary import [rev: minor]
JavaScript
mit
hpautonomy/find,hpautonomy/find,LinkPowerHK/find,hpe-idol/find,hpe-idol/find,LinkPowerHK/find,hpe-idol/find,hpautonomy/find,LinkPowerHK/find,LinkPowerHK/find,hpe-idol/find,hpautonomy/find,hpe-idol/java-powerpoint-report,hpe-idol/java-powerpoint-report,LinkPowerHK/find,hpautonomy/find,hpe-idol/find
javascript
## Code Before: /* * Copyright 2014-2015 Hewlett-Packard Development Company, L.P. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. */ define([ 'find/app/find-pages', 'find/app/page/find-search', 'find/app/page/find-settings-page', 'i18n!find/nls/bundle' ], function(FindPages, FindSearch, SettingsPage) { return FindPages.extend({ initializePages: function() { this.pages = [ { constructor: SettingsPage , pageName: 'settings' , classes: 'hide-from-non-useradmin' } ]; } }); }); ## Instruction: Remove unnecessary import [rev: minor] ## Code After: /* * Copyright 2014-2015 Hewlett-Packard Development Company, L.P. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. */ define([ 'find/app/find-pages', 'find/app/page/find-settings-page', 'i18n!find/nls/bundle' ], function(FindPages, SettingsPage) { return FindPages.extend({ initializePages: function() { this.pages = [ { constructor: SettingsPage , pageName: 'settings' , classes: 'hide-from-non-useradmin' } ]; } }); });
/* * Copyright 2014-2015 Hewlett-Packard Development Company, L.P. * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. */ define([ 'find/app/find-pages', - 'find/app/page/find-search', 'find/app/page/find-settings-page', 'i18n!find/nls/bundle' - ], function(FindPages, FindSearch, SettingsPage) { ? ------------ + ], function(FindPages, SettingsPage) { return FindPages.extend({ initializePages: function() { this.pages = [ { constructor: SettingsPage , pageName: 'settings' , classes: 'hide-from-non-useradmin' } ]; } }); });
3
0.125
1
2
6ffef37cd27e45733479ec3b652c09ff030b9557
roles/firewall/tasks/main.yml
roles/firewall/tasks/main.yml
--- - name: Firewall block: - name: Install iptables apt: state: present name: - iptables - netfilter-persistent - iptables-persistent - name: Put ip4tables template: src=ip4tables.j2 dest='/etc/iptables/rules.v4' notify: - restart netfilter-persistent - name: Put ip6tables template: src=ip6tables.j2 dest='/etc/iptables/rules.v6' notify: - restart netfilter-persistent - name: Start and enable netfilter-persistent service: name=netfilter-persistent.service state=started enabled="yes" when: ansible_virtualization_type != "docker"
--- - name: Firewall block: - name: Install iptables apt: state: present name: - iptables - netfilter-persistent - iptables-persistent - name: Put ip4tables template: src=ip4tables.j2 dest='/etc/iptables/rules.v4' notify: - restart netfilter-persistent - name: Put ip6tables template: src=ip6tables.j2 dest='/etc/iptables/rules.v6' notify: - restart netfilter-persistent - name: Start and enable netfilter-persistent service: name=netfilter-persistent.service state=started enabled="yes" when: environment_name != 'vm'
Fix to prevent configuration of a firewall in the case of VMs. This was previously blocked only for Docker configuration
Fix to prevent configuration of a firewall in the case of VMs. This was previously blocked only for Docker configuration
YAML
apache-2.0
SURFscz/SCZ-deploy,SURFscz/SCZ-deploy,SURFscz/SCZ-deploy,SURFscz/SCZ-deploy
yaml
## Code Before: --- - name: Firewall block: - name: Install iptables apt: state: present name: - iptables - netfilter-persistent - iptables-persistent - name: Put ip4tables template: src=ip4tables.j2 dest='/etc/iptables/rules.v4' notify: - restart netfilter-persistent - name: Put ip6tables template: src=ip6tables.j2 dest='/etc/iptables/rules.v6' notify: - restart netfilter-persistent - name: Start and enable netfilter-persistent service: name=netfilter-persistent.service state=started enabled="yes" when: ansible_virtualization_type != "docker" ## Instruction: Fix to prevent configuration of a firewall in the case of VMs. This was previously blocked only for Docker configuration ## Code After: --- - name: Firewall block: - name: Install iptables apt: state: present name: - iptables - netfilter-persistent - iptables-persistent - name: Put ip4tables template: src=ip4tables.j2 dest='/etc/iptables/rules.v4' notify: - restart netfilter-persistent - name: Put ip6tables template: src=ip6tables.j2 dest='/etc/iptables/rules.v6' notify: - restart netfilter-persistent - name: Start and enable netfilter-persistent service: name=netfilter-persistent.service state=started enabled="yes" when: environment_name != 'vm'
--- - name: Firewall block: - name: Install iptables apt: state: present name: - iptables - netfilter-persistent - iptables-persistent - name: Put ip4tables template: src=ip4tables.j2 dest='/etc/iptables/rules.v4' notify: - restart netfilter-persistent - name: Put ip6tables template: src=ip6tables.j2 dest='/etc/iptables/rules.v6' notify: - restart netfilter-persistent - name: Start and enable netfilter-persistent service: name=netfilter-persistent.service state=started enabled="yes" - when: ansible_virtualization_type != "docker" + when: environment_name != 'vm'
2
0.076923
1
1
5796a54d10eb3baebda51e3420a818a251406a5c
python/test.py
python/test.py
import sys from PyQt5 import QtWidgets from QHexEdit import QHexEdit, QHexEditData class HexEdit(QHexEdit): def __init__(self, fileName=None): super(HexEdit, self).__init__() file = open(fileName) data = file.read() self.setData(data) self.setReadOnly(False) if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) # QHexEditData* hexeditdata = QHexEditData::fromFile("data.bin"); data = QHexEditData.fromFile('test.py') # QHexEdit* hexedit = new QHexEdit(); # hexedit->setData(hexeditdata); mainWin = QHexEdit() mainWin.setData(data) mainWin.show() sys.exit(app.exec_())
import sys from PyQt5 import QtWidgets, QtGui from QHexEdit import QHexEdit, QHexEditData if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) # QHexEditData* hexeditdata = QHexEditData::fromFile("test.py"); hexeditdata = QHexEditData.fromFile('test.py') # QHexEdit* hexedit = new QHexEdit(); # hexedit->setData(hexeditdata); hexedit = QHexEdit() hexedit.setData(hexeditdata) hexedit.show() # hexedit->commentRange(0, 12, "I'm a comment!"); hexedit.commentRange(0, 12, "I'm a comment!") # hexedit->highlightBackground(0, 10, QColor(Qt::Red)); hexedit.highlightBackground(0, 10, QtGui.QColor(255, 0, 0)) sys.exit(app.exec_())
Test more stuff in python
Test more stuff in python
Python
mit
parallaxinc/QHexEdit,parallaxinc/QHexEdit
python
## Code Before: import sys from PyQt5 import QtWidgets from QHexEdit import QHexEdit, QHexEditData class HexEdit(QHexEdit): def __init__(self, fileName=None): super(HexEdit, self).__init__() file = open(fileName) data = file.read() self.setData(data) self.setReadOnly(False) if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) # QHexEditData* hexeditdata = QHexEditData::fromFile("data.bin"); data = QHexEditData.fromFile('test.py') # QHexEdit* hexedit = new QHexEdit(); # hexedit->setData(hexeditdata); mainWin = QHexEdit() mainWin.setData(data) mainWin.show() sys.exit(app.exec_()) ## Instruction: Test more stuff in python ## Code After: import sys from PyQt5 import QtWidgets, QtGui from QHexEdit import QHexEdit, QHexEditData if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) # QHexEditData* hexeditdata = QHexEditData::fromFile("test.py"); hexeditdata = QHexEditData.fromFile('test.py') # QHexEdit* hexedit = new QHexEdit(); # hexedit->setData(hexeditdata); hexedit = QHexEdit() hexedit.setData(hexeditdata) hexedit.show() # hexedit->commentRange(0, 12, "I'm a comment!"); hexedit.commentRange(0, 12, "I'm a comment!") # hexedit->highlightBackground(0, 10, QColor(Qt::Red)); hexedit.highlightBackground(0, 10, QtGui.QColor(255, 0, 0)) sys.exit(app.exec_())
import sys - from PyQt5 import QtWidgets + from PyQt5 import QtWidgets, QtGui ? +++++++ from QHexEdit import QHexEdit, QHexEditData - - - class HexEdit(QHexEdit): - - def __init__(self, fileName=None): - super(HexEdit, self).__init__() - file = open(fileName) - data = file.read() - self.setData(data) - self.setReadOnly(False) - if __name__ == '__main__': app = QtWidgets.QApplication(sys.argv) - # QHexEditData* hexeditdata = QHexEditData::fromFile("data.bin"); ? -- ^ ^^^ + # QHexEditData* hexeditdata = QHexEditData::fromFile("test.py"); ? ^^^ ^^ - data = QHexEditData.fromFile('test.py') + hexeditdata = QHexEditData.fromFile('test.py') ? +++++++ # QHexEdit* hexedit = new QHexEdit(); # hexedit->setData(hexeditdata); - mainWin = QHexEdit() ? ^^ ^^^^ + hexedit = QHexEdit() ? ^^^^^ ^ - mainWin.setData(data) + hexedit.setData(hexeditdata) - mainWin.show() + hexedit.show() + + # hexedit->commentRange(0, 12, "I'm a comment!"); + hexedit.commentRange(0, 12, "I'm a comment!") + + # hexedit->highlightBackground(0, 10, QColor(Qt::Red)); + hexedit.highlightBackground(0, 10, QtGui.QColor(255, 0, 0)) + sys.exit(app.exec_())
30
1.071429
13
17
323b195642bab258001da6b0a85ca998e8697d3d
static/js/submit.js
static/js/submit.js
$(document).ready(function() { $("#invite-form").on('submit', function() { var inviteeEmail = $("#email").val(); console.log(inviteeEmail) if (!inviteeEmail || !inviteeEmail.length) { alert('Please enter an email'); return false; } $.ajax({ type: "POST", url: "/", headers: { 'X-CSRFToken': csrfToken, }, data: { email: inviteeEmail}, success: function(data) { handleResponse(data); } }); return false; }); }); function handleResponse(data) { document.data = data if (data.status === 'success') { console.log('success') } if (data.status === 'fail') { console.log('failed') } }
$(document).ready(function() { $("#invite-form").on('submit', function() { var inviteeEmail = $("#email").val(); console.log(inviteeEmail) if (!inviteeEmail || !inviteeEmail.length) { alert('Please enter an email'); return false; } $.ajax({ type: "POST", url: "/", headers: { 'X-CSRFToken': csrfToken, }, data: { email: inviteeEmail}, success: function(data) { handleResponse(data); } }); return false; }); }); function handleResponse(data) { document.data = data if (data.status === 'success') { console.log('success') Materialize.toast('Success!', 4000) } if (data.status === 'fail') { Materialize.toast(data.error, 4000) } }
Use Materialize toasts to show the status
Use Materialize toasts to show the status
JavaScript
mit
avinassh/slackipy,avinassh/slackipy,avinassh/slackipy
javascript
## Code Before: $(document).ready(function() { $("#invite-form").on('submit', function() { var inviteeEmail = $("#email").val(); console.log(inviteeEmail) if (!inviteeEmail || !inviteeEmail.length) { alert('Please enter an email'); return false; } $.ajax({ type: "POST", url: "/", headers: { 'X-CSRFToken': csrfToken, }, data: { email: inviteeEmail}, success: function(data) { handleResponse(data); } }); return false; }); }); function handleResponse(data) { document.data = data if (data.status === 'success') { console.log('success') } if (data.status === 'fail') { console.log('failed') } } ## Instruction: Use Materialize toasts to show the status ## Code After: $(document).ready(function() { $("#invite-form").on('submit', function() { var inviteeEmail = $("#email").val(); console.log(inviteeEmail) if (!inviteeEmail || !inviteeEmail.length) { alert('Please enter an email'); return false; } $.ajax({ type: "POST", url: "/", headers: { 'X-CSRFToken': csrfToken, }, data: { email: inviteeEmail}, success: function(data) { handleResponse(data); } }); return false; }); }); function handleResponse(data) { document.data = data if (data.status === 'success') { console.log('success') Materialize.toast('Success!', 4000) } if (data.status === 'fail') { Materialize.toast(data.error, 4000) } }
$(document).ready(function() { $("#invite-form").on('submit', function() { var inviteeEmail = $("#email").val(); console.log(inviteeEmail) if (!inviteeEmail || !inviteeEmail.length) { alert('Please enter an email'); return false; } $.ajax({ type: "POST", url: "/", headers: { 'X-CSRFToken': csrfToken, }, data: { email: inviteeEmail}, success: function(data) { handleResponse(data); } }); return false; }); }); function handleResponse(data) { document.data = data if (data.status === 'success') { console.log('success') + Materialize.toast('Success!', 4000) } if (data.status === 'fail') { - console.log('failed') + Materialize.toast(data.error, 4000) } }
3
0.083333
2
1
76f901532fdc63aab1c0c19a1b25895e5ba6ca56
tests/verify.sh
tests/verify.sh
repo_dir="`dirname $0`/.." original="$repo_dir/original/spamsum" spamspy="$repo_dir/spamsum/spamsum.py" target_files="original/spamsum.c LICENSE README.md tests/data/*" (cd "$repo_dir/original"; make) for target_file in $target_files; do echo -n "Comparing $target_file - " target_file="$repo_dir/$target_file" original_out=`$original $target_file` spamspy_out=`$spamspy $target_file` if [ "$original_out" = "$spamspy_out" ]; then echo "OK" else echo "differ" return 1 fi done
repo_dir="`dirname $0`/.." cd "$repo_dir" original=original/spamsum spamspy=spamsum/spamsum.py target_files="original/spamsum.c LICENSE README.md tests/data/*" (cd original/; make) for target_file in $target_files; do echo -n "Comparing $target_file - " original_out=`$original $target_file` spamspy_out=`$spamspy $target_file` if [ "$original_out" = "$spamspy_out" ]; then echo "OK" else echo "differ" return 1 fi done
Verify does not depend on current directory
Verify does not depend on current directory
Shell
mit
barahilia/spamspy,barahilia/spamspy,barahilia/spamspy
shell
## Code Before: repo_dir="`dirname $0`/.." original="$repo_dir/original/spamsum" spamspy="$repo_dir/spamsum/spamsum.py" target_files="original/spamsum.c LICENSE README.md tests/data/*" (cd "$repo_dir/original"; make) for target_file in $target_files; do echo -n "Comparing $target_file - " target_file="$repo_dir/$target_file" original_out=`$original $target_file` spamspy_out=`$spamspy $target_file` if [ "$original_out" = "$spamspy_out" ]; then echo "OK" else echo "differ" return 1 fi done ## Instruction: Verify does not depend on current directory ## Code After: repo_dir="`dirname $0`/.." cd "$repo_dir" original=original/spamsum spamspy=spamsum/spamsum.py target_files="original/spamsum.c LICENSE README.md tests/data/*" (cd original/; make) for target_file in $target_files; do echo -n "Comparing $target_file - " original_out=`$original $target_file` spamspy_out=`$spamspy $target_file` if [ "$original_out" = "$spamspy_out" ]; then echo "OK" else echo "differ" return 1 fi done
repo_dir="`dirname $0`/.." + cd "$repo_dir" - original="$repo_dir/original/spamsum" ? ----------- - + original=original/spamsum - spamspy="$repo_dir/spamsum/spamsum.py" ? ----------- - + spamspy=spamsum/spamsum.py target_files="original/spamsum.c LICENSE README.md tests/data/*" - (cd "$repo_dir/original"; make) + (cd original/; make) for target_file in $target_files; do echo -n "Comparing $target_file - " - target_file="$repo_dir/$target_file" original_out=`$original $target_file` spamspy_out=`$spamspy $target_file` if [ "$original_out" = "$spamspy_out" ]; then echo "OK" else echo "differ" return 1 fi done
8
0.32
4
4
63decb5e6f6f94447d752d94931bc704575967e0
due/Oscilloscope/README.md
due/Oscilloscope/README.md
Oscilloscope in XY mode can be used as a vector monitor. The beam is then controlled directly by two analog signals applied to X and Y inputs. [<img src="https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Documentation/Overview_en.png?raw=true" alt="Arduino DACs control oscilloscope" width="800" height="248"/>](https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Documentation/Overview_en.png?raw=true "Arduino DACs control oscilloscope") C code running on Arduino generates sequence of numbers that are sent to two on-board digital-to-analog converters. One controls the voltage on the input X, the second cares about the Y coordinate. [<img src="https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Images/HelloWorld.jpg?raw=true" alt="Hello World" width="480" height="320"/>](https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Images/HelloWorld.jpg?raw=true "Hello World")
Oscilloscope in XY mode can be used as a vector monitor. The beam is then controlled directly by two analog signals applied to X and Y inputs. [<img src="https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Documentation/Overview_en.png?raw=true" alt="Arduino DACs control oscilloscope" width="800" height="248"/>](https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Documentation/Overview_en.png?raw=true "Arduino DACs control oscilloscope") C code running on Arduino generates sequence of numbers that are sent to two on-board digital-to-analog converters. One controls the voltage on the input X, the second cares about the Y coordinate. [![Demo video](http://img.youtube.com/vi/opy2YYgtyNw/0.jpg)](http://www.youtube.com/watch?v=opy2YYgtyNw)
Add link to youtube video
Add link to youtube video
Markdown
mit
cazacov/Arduino,cazacov/Arduino
markdown
## Code Before: Oscilloscope in XY mode can be used as a vector monitor. The beam is then controlled directly by two analog signals applied to X and Y inputs. [<img src="https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Documentation/Overview_en.png?raw=true" alt="Arduino DACs control oscilloscope" width="800" height="248"/>](https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Documentation/Overview_en.png?raw=true "Arduino DACs control oscilloscope") C code running on Arduino generates sequence of numbers that are sent to two on-board digital-to-analog converters. One controls the voltage on the input X, the second cares about the Y coordinate. [<img src="https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Images/HelloWorld.jpg?raw=true" alt="Hello World" width="480" height="320"/>](https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Images/HelloWorld.jpg?raw=true "Hello World") ## Instruction: Add link to youtube video ## Code After: Oscilloscope in XY mode can be used as a vector monitor. The beam is then controlled directly by two analog signals applied to X and Y inputs. [<img src="https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Documentation/Overview_en.png?raw=true" alt="Arduino DACs control oscilloscope" width="800" height="248"/>](https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Documentation/Overview_en.png?raw=true "Arduino DACs control oscilloscope") C code running on Arduino generates sequence of numbers that are sent to two on-board digital-to-analog converters. One controls the voltage on the input X, the second cares about the Y coordinate. [![Demo video](http://img.youtube.com/vi/opy2YYgtyNw/0.jpg)](http://www.youtube.com/watch?v=opy2YYgtyNw)
Oscilloscope in XY mode can be used as a vector monitor. The beam is then controlled directly by two analog signals applied to X and Y inputs. [<img src="https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Documentation/Overview_en.png?raw=true" alt="Arduino DACs control oscilloscope" width="800" height="248"/>](https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Documentation/Overview_en.png?raw=true "Arduino DACs control oscilloscope") C code running on Arduino generates sequence of numbers that are sent to two on-board digital-to-analog converters. One controls the voltage on the input X, the second cares about the Y coordinate. - [<img src="https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Images/HelloWorld.jpg?raw=true" alt="Hello World" width="480" height="320"/>](https://github.com/cazacov/Arduino/blob/master/due/Oscilloscope/Images/HelloWorld.jpg?raw=true "Hello World") + [![Demo video](http://img.youtube.com/vi/opy2YYgtyNw/0.jpg)](http://www.youtube.com/watch?v=opy2YYgtyNw)
2
0.2
1
1
afa24a55bbceca98c07f360f792485614937bb93
rt/01-ext.ll
rt/01-ext.ll
declare i8* @malloc(i64) declare void @free(i8*) declare i64 @write(i32, i8*, i64) declare i32 @asprintf(i8**, i8*, ...) declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1) %IBool = type { i64 (i8*, i1*)* } %IBool.wrap = type { %IBool*, i8* } %str = type { i1, i64, i8* } %IStr = type { i64 (i8*, %str*)* } %IStr.wrap = type { %IStr*, i8* } define i8* @lang.malloc(i64 %sz) alwaysinline { %1 = call i8* @malloc(i64 %sz) ret i8* %1 } define void @lang.free(i8* %ptr) alwaysinline { call void @free(i8* %ptr) ret void }
declare i8* @malloc(i64) declare void @free(i8*) declare i64 @write(i32, i8*, i64) declare i32 @asprintf(i8**, i8*, ...) declare i32 @printf(i8*, ...) declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1) %IBool = type { i64 (i8*, i1*)* } %IBool.wrap = type { %IBool*, i8* } %str = type { i1, i64, i8* } %IStr = type { i64 (i8*, %str*)* } %IStr.wrap = type { %IStr*, i8* } @fmt_MALLOC = constant [15 x i8] c"malloc(%ld) %p\0a" @fmt_FREE = constant [9 x i8] c"free(%p)\0a" define i8* @lang.malloc(i64 %sz) alwaysinline { %ptr = call i8* @malloc(i64 %sz) ; %fmt = getelementptr inbounds [15 x i8]* @fmt_MALLOC, i32 0, i32 0 ; call i32 (i8*, ...)* @printf(i8* %fmt, i64 %sz, i8* %ptr) ret i8* %ptr } define void @lang.free(i8* %ptr) alwaysinline { ; %fmt = getelementptr inbounds [9 x i8]* @fmt_FREE, i32 0, i32 0 ; call i32 (i8*, ...)* @printf(i8* %fmt, i8* %ptr) call void @free(i8* %ptr) ret void }
Add some stuff to help debugging memory issues.
Add some stuff to help debugging memory issues.
LLVM
mit
djc/runa,djc/runa,djc/runa,djc/runa
llvm
## Code Before: declare i8* @malloc(i64) declare void @free(i8*) declare i64 @write(i32, i8*, i64) declare i32 @asprintf(i8**, i8*, ...) declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1) %IBool = type { i64 (i8*, i1*)* } %IBool.wrap = type { %IBool*, i8* } %str = type { i1, i64, i8* } %IStr = type { i64 (i8*, %str*)* } %IStr.wrap = type { %IStr*, i8* } define i8* @lang.malloc(i64 %sz) alwaysinline { %1 = call i8* @malloc(i64 %sz) ret i8* %1 } define void @lang.free(i8* %ptr) alwaysinline { call void @free(i8* %ptr) ret void } ## Instruction: Add some stuff to help debugging memory issues. ## Code After: declare i8* @malloc(i64) declare void @free(i8*) declare i64 @write(i32, i8*, i64) declare i32 @asprintf(i8**, i8*, ...) declare i32 @printf(i8*, ...) declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1) %IBool = type { i64 (i8*, i1*)* } %IBool.wrap = type { %IBool*, i8* } %str = type { i1, i64, i8* } %IStr = type { i64 (i8*, %str*)* } %IStr.wrap = type { %IStr*, i8* } @fmt_MALLOC = constant [15 x i8] c"malloc(%ld) %p\0a" @fmt_FREE = constant [9 x i8] c"free(%p)\0a" define i8* @lang.malloc(i64 %sz) alwaysinline { %ptr = call i8* @malloc(i64 %sz) ; %fmt = getelementptr inbounds [15 x i8]* @fmt_MALLOC, i32 0, i32 0 ; call i32 (i8*, ...)* @printf(i8* %fmt, i64 %sz, i8* %ptr) ret i8* %ptr } define void @lang.free(i8* %ptr) alwaysinline { ; %fmt = getelementptr inbounds [9 x i8]* @fmt_FREE, i32 0, i32 0 ; call i32 (i8*, ...)* @printf(i8* %fmt, i8* %ptr) call void @free(i8* %ptr) ret void }
declare i8* @malloc(i64) declare void @free(i8*) declare i64 @write(i32, i8*, i64) declare i32 @asprintf(i8**, i8*, ...) + declare i32 @printf(i8*, ...) declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1) %IBool = type { i64 (i8*, i1*)* } %IBool.wrap = type { %IBool*, i8* } %str = type { i1, i64, i8* } %IStr = type { i64 (i8*, %str*)* } %IStr.wrap = type { %IStr*, i8* } + @fmt_MALLOC = constant [15 x i8] c"malloc(%ld) %p\0a" + @fmt_FREE = constant [9 x i8] c"free(%p)\0a" + define i8* @lang.malloc(i64 %sz) alwaysinline { - %1 = call i8* @malloc(i64 %sz) ? ^ + %ptr = call i8* @malloc(i64 %sz) ? ^^^ + ; %fmt = getelementptr inbounds [15 x i8]* @fmt_MALLOC, i32 0, i32 0 + ; call i32 (i8*, ...)* @printf(i8* %fmt, i64 %sz, i8* %ptr) - ret i8* %1 ? ^ + ret i8* %ptr ? ^^^ } define void @lang.free(i8* %ptr) alwaysinline { + ; %fmt = getelementptr inbounds [9 x i8]* @fmt_FREE, i32 0, i32 0 + ; call i32 (i8*, ...)* @printf(i8* %fmt, i8* %ptr) call void @free(i8* %ptr) ret void }
12
0.545455
10
2
482d865f9913650f4057100950db6614cc2c2330
.travis.yml
.travis.yml
language: ruby install: - bundle - bundle exec rake db:migrate RAILS_ENV=test script: - cucumber branches: only: - master
language: ruby install: - bundle - bundle exec rake db:migrate RAILS_ENV=test - git config --global user.name "Example User" - git config --global user.email "user@example.com" script: - cucumber branches: only: - master
Add example Git user info
Add example Git user info
YAML
mit
oponder/big-gollum,501st-alpha1/big-gollum,501st-alpha1/big-gollum,oponder/big-gollum,oponder/big-gollum,501st-alpha1/big-gollum
yaml
## Code Before: language: ruby install: - bundle - bundle exec rake db:migrate RAILS_ENV=test script: - cucumber branches: only: - master ## Instruction: Add example Git user info ## Code After: language: ruby install: - bundle - bundle exec rake db:migrate RAILS_ENV=test - git config --global user.name "Example User" - git config --global user.email "user@example.com" script: - cucumber branches: only: - master
language: ruby install: - bundle - bundle exec rake db:migrate RAILS_ENV=test + - git config --global user.name "Example User" + - git config --global user.email "user@example.com" script: - cucumber branches: only: - master
2
0.222222
2
0
2df1b7da323b75692fed7db2697d021b9fe5e0c6
deploy-aws.js
deploy-aws.js
/** * aws - deploys "earth" files to AWS S3 */ "use strict"; var util = require("util"); var tool = require("./tool"); var aws = require("./aws"); console.log("============================================================"); console.log(new Date().toISOString() + " - Starting"); // UNDONE: delete objects in S3 but not in the list below // UNDONE: super awesome logic that defines and iterates file sets, to eliminate this list: [ "about.html", "index.html", "natural-earth.png", "css/styles.css", "css/mplus-2p-light-057.ttf", "data/earth-topo.json", "libs/d3.geo/0.0.0/d3.geo.polyhedron.v0.min.js", "libs/d3.geo/0.0.0/d3.geo.projection.v0.min.js", "libs/earth/1.0.0/earth.js", "libs/earth/1.0.0/globes.js", "libs/earth/1.0.0/layers.js", "libs/earth/1.0.0/micro.js", "libs/when/2.6.0/when.js" ].forEach(function(key) { aws.uploadFile("public/" + key, aws.S3_BUCKET, key).then(function(result) { console.log(key + ": " + util.inspect(result)); }, tool.report); });
/** * aws - deploys "earth" files to AWS S3 */ "use strict"; var util = require("util"); var tool = require("./tool"); var aws = require("./aws"); console.log("============================================================"); console.log(new Date().toISOString() + " - Starting"); // UNDONE: delete objects in S3 but not in the list below // UNDONE: super awesome logic that defines and iterates file sets, to eliminate this list: [ "about.html", "index.html", "natural-earth.png", "css/styles.css", "css/mplus-2p-light-057.ttf", "css/mplus-2p-light-sub-1.ttf", "data/earth-topo.json", "libs/d3.geo/0.0.0/d3.geo.polyhedron.v0.min.js", "libs/d3.geo/0.0.0/d3.geo.projection.v0.min.js", "libs/earth/1.0.0/earth.js", "libs/earth/1.0.0/globes.js", "libs/earth/1.0.0/layers.js", "libs/earth/1.0.0/micro.js", "libs/when/2.6.0/when.js" ].forEach(function(key) { aws.uploadFile("public/" + key, aws.S3_BUCKET, key).then(function(result) { console.log(key + ": " + util.inspect(result)); }, tool.report); });
Define M+ font subset that contains only those characters necessary for the site.
Define M+ font subset that contains only those characters necessary for the site.
JavaScript
mit
awdesch/earth,gardart/earth,sobetn/earth,DougFirErickson/earth,ianynchen/earth,Colbey/earth,bernardodiasc/earth,cambecc/earth,fengxw/earth,Colbey/earth,ianynchen/earth,icedwater/earth,jaythaceo/earth,bernardodiasc/earth,chenr6/earth,grahamrobbo/demojam14,icedwater/earth,fuchao2012/earth,m-funky/earth,Colbey/earth,fuchao2012/earth,robinj/earth,emirhartato/earth,kidaa/earth,Burste/earth,renzomacedo/Clima,emirhartato/earth,fengxw/earth,jaythaceo/earth,gardart/earth,zenway33/earth,awdesch/earth,heatery/earth,kidaa/earth,DougFirErickson/earth,tuapuikia/earth,zenway33/earth,tuapuikia/earth,renzomacedo/Clima,chenr6/earth,sobetn/earth,Burste/earth,m-funky/earth,heatery/earth,robinj/earth,cambecc/earth
javascript
## Code Before: /** * aws - deploys "earth" files to AWS S3 */ "use strict"; var util = require("util"); var tool = require("./tool"); var aws = require("./aws"); console.log("============================================================"); console.log(new Date().toISOString() + " - Starting"); // UNDONE: delete objects in S3 but not in the list below // UNDONE: super awesome logic that defines and iterates file sets, to eliminate this list: [ "about.html", "index.html", "natural-earth.png", "css/styles.css", "css/mplus-2p-light-057.ttf", "data/earth-topo.json", "libs/d3.geo/0.0.0/d3.geo.polyhedron.v0.min.js", "libs/d3.geo/0.0.0/d3.geo.projection.v0.min.js", "libs/earth/1.0.0/earth.js", "libs/earth/1.0.0/globes.js", "libs/earth/1.0.0/layers.js", "libs/earth/1.0.0/micro.js", "libs/when/2.6.0/when.js" ].forEach(function(key) { aws.uploadFile("public/" + key, aws.S3_BUCKET, key).then(function(result) { console.log(key + ": " + util.inspect(result)); }, tool.report); }); ## Instruction: Define M+ font subset that contains only those characters necessary for the site. ## Code After: /** * aws - deploys "earth" files to AWS S3 */ "use strict"; var util = require("util"); var tool = require("./tool"); var aws = require("./aws"); console.log("============================================================"); console.log(new Date().toISOString() + " - Starting"); // UNDONE: delete objects in S3 but not in the list below // UNDONE: super awesome logic that defines and iterates file sets, to eliminate this list: [ "about.html", "index.html", "natural-earth.png", "css/styles.css", "css/mplus-2p-light-057.ttf", "css/mplus-2p-light-sub-1.ttf", "data/earth-topo.json", "libs/d3.geo/0.0.0/d3.geo.polyhedron.v0.min.js", "libs/d3.geo/0.0.0/d3.geo.projection.v0.min.js", "libs/earth/1.0.0/earth.js", "libs/earth/1.0.0/globes.js", "libs/earth/1.0.0/layers.js", "libs/earth/1.0.0/micro.js", "libs/when/2.6.0/when.js" ].forEach(function(key) { aws.uploadFile("public/" + key, aws.S3_BUCKET, key).then(function(result) { console.log(key + ": " + util.inspect(result)); }, tool.report); });
/** * aws - deploys "earth" files to AWS S3 */ "use strict"; var util = require("util"); var tool = require("./tool"); var aws = require("./aws"); console.log("============================================================"); console.log(new Date().toISOString() + " - Starting"); // UNDONE: delete objects in S3 but not in the list below // UNDONE: super awesome logic that defines and iterates file sets, to eliminate this list: [ "about.html", "index.html", "natural-earth.png", "css/styles.css", "css/mplus-2p-light-057.ttf", + "css/mplus-2p-light-sub-1.ttf", "data/earth-topo.json", "libs/d3.geo/0.0.0/d3.geo.polyhedron.v0.min.js", "libs/d3.geo/0.0.0/d3.geo.projection.v0.min.js", "libs/earth/1.0.0/earth.js", "libs/earth/1.0.0/globes.js", "libs/earth/1.0.0/layers.js", "libs/earth/1.0.0/micro.js", "libs/when/2.6.0/when.js" ].forEach(function(key) { aws.uploadFile("public/" + key, aws.S3_BUCKET, key).then(function(result) { console.log(key + ": " + util.inspect(result)); }, tool.report); });
1
0.027778
1
0
62bdec3e2ffa390b0eb4d5467c369ba9c47c4dcc
README.md
README.md
Precircuit a Vectorworks plot using the most efficient pairing of lights and dimmers. ## Binary Download [<img src="http://precircuiter.harryshamansky.com/appstore.svg">](https://itunes.apple.com/us/app/precircuiter/id1041643812?ls=1&mt=12) ## Caveats - Precircuiter needs to know where outlets are. These must be added to your Vectorworks plot as lighting instruments with "Power" as their device type. This only needs to be done once and saved as part of your venue's template. - Precircuiter doesn't support flyspaces (yet), or any venue where grouped receptacles travel in a bunch. - Want to make Precircuiter better? Submit a pull request.
Precircuit a Vectorworks plot using the most efficient pairing of lights and dimmers. ## Binary Download [<img src="http://harryshamansky.com/precircuiter/appstore.svg">](https://itunes.apple.com/us/app/precircuiter/id1041643812?ls=1&mt=12) ## Caveats - Precircuiter needs to know where outlets are. These must be added to your Vectorworks plot as lighting instruments with "Power" as their device type. This only needs to be done once and saved as part of your venue's template. - Precircuiter doesn't support flyspaces (yet), or any venue where grouped receptacles travel in a bunch. - Want to make Precircuiter better? Submit a pull request.
Update binary download button image URL in readme
Update binary download button image URL in readme
Markdown
mit
shamanskyh/Precircuiter,shamanskyh/Precircuiter
markdown
## Code Before: Precircuit a Vectorworks plot using the most efficient pairing of lights and dimmers. ## Binary Download [<img src="http://precircuiter.harryshamansky.com/appstore.svg">](https://itunes.apple.com/us/app/precircuiter/id1041643812?ls=1&mt=12) ## Caveats - Precircuiter needs to know where outlets are. These must be added to your Vectorworks plot as lighting instruments with "Power" as their device type. This only needs to be done once and saved as part of your venue's template. - Precircuiter doesn't support flyspaces (yet), or any venue where grouped receptacles travel in a bunch. - Want to make Precircuiter better? Submit a pull request. ## Instruction: Update binary download button image URL in readme ## Code After: Precircuit a Vectorworks plot using the most efficient pairing of lights and dimmers. ## Binary Download [<img src="http://harryshamansky.com/precircuiter/appstore.svg">](https://itunes.apple.com/us/app/precircuiter/id1041643812?ls=1&mt=12) ## Caveats - Precircuiter needs to know where outlets are. These must be added to your Vectorworks plot as lighting instruments with "Power" as their device type. This only needs to be done once and saved as part of your venue's template. - Precircuiter doesn't support flyspaces (yet), or any venue where grouped receptacles travel in a bunch. - Want to make Precircuiter better? Submit a pull request.
Precircuit a Vectorworks plot using the most efficient pairing of lights and dimmers. ## Binary Download - [<img src="http://precircuiter.harryshamansky.com/appstore.svg">](https://itunes.apple.com/us/app/precircuiter/id1041643812?ls=1&mt=12) ? ------------- + [<img src="http://harryshamansky.com/precircuiter/appstore.svg">](https://itunes.apple.com/us/app/precircuiter/id1041643812?ls=1&mt=12) ? +++++++++++++ ## Caveats - Precircuiter needs to know where outlets are. These must be added to your Vectorworks plot as lighting instruments with "Power" as their device type. This only needs to be done once and saved as part of your venue's template. - Precircuiter doesn't support flyspaces (yet), or any venue where grouped receptacles travel in a bunch. - Want to make Precircuiter better? Submit a pull request.
2
0.222222
1
1
b8839302c0a4d8ada99a695f8829027fa433e05e
zerver/migrations/0232_make_archive_transaction_field_not_nullable.py
zerver/migrations/0232_make_archive_transaction_field_not_nullable.py
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('zerver', '0231_add_archive_transaction_model'), ] operations = [ migrations.RunSQL("DELETE FROM zerver_archivedusermessage"), migrations.RunSQL("DELETE FROM zerver_archivedreaction"), migrations.RunSQL("DELETE FROM zerver_archivedsubmessage"), migrations.RunSQL("DELETE FROM zerver_archivedattachment"), migrations.RunSQL("DELETE FROM zerver_archivedattachment_messages"), migrations.RunSQL("DELETE FROM zerver_archivedmessage"), migrations.RunSQL("DELETE FROM zerver_archivetransaction"), migrations.AlterField( model_name='archivedmessage', name='archive_transaction', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zerver.ArchiveTransaction'), ), ]
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): """ Tables cannot have data deleted from them and be altered in a single transaction, but we need the DELETEs to be atomic together. So we set atomic=False for the migration in general, and run the DELETEs in one transaction, and AlterField in another. """ atomic = False dependencies = [ ('zerver', '0231_add_archive_transaction_model'), ] operations = [ migrations.RunSQL(""" BEGIN; DELETE FROM zerver_archivedusermessage; DELETE FROM zerver_archivedreaction; DELETE FROM zerver_archivedsubmessage; DELETE FROM zerver_archivedattachment_messages; DELETE FROM zerver_archivedattachment; DELETE FROM zerver_archivedmessage; DELETE FROM zerver_archivetransaction; COMMIT; """), migrations.AlterField( model_name='archivedmessage', name='archive_transaction', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zerver.ArchiveTransaction'), ), ]
Fix migration making archive_transaction field not null.
retention: Fix migration making archive_transaction field not null. DELETing from archive tables and ALTERing ArchivedMessage needs to be split into separate transactions. zerver_archivedattachment_messages needs to be cleared out before zerver_archivedattachment.
Python
apache-2.0
eeshangarg/zulip,shubhamdhama/zulip,zulip/zulip,brainwane/zulip,synicalsyntax/zulip,eeshangarg/zulip,andersk/zulip,hackerkid/zulip,hackerkid/zulip,timabbott/zulip,zulip/zulip,timabbott/zulip,synicalsyntax/zulip,tommyip/zulip,tommyip/zulip,rht/zulip,andersk/zulip,rishig/zulip,rht/zulip,timabbott/zulip,brainwane/zulip,eeshangarg/zulip,showell/zulip,rht/zulip,showell/zulip,andersk/zulip,tommyip/zulip,showell/zulip,showell/zulip,synicalsyntax/zulip,hackerkid/zulip,punchagan/zulip,shubhamdhama/zulip,rishig/zulip,brainwane/zulip,andersk/zulip,rht/zulip,brainwane/zulip,brainwane/zulip,shubhamdhama/zulip,eeshangarg/zulip,timabbott/zulip,rishig/zulip,punchagan/zulip,zulip/zulip,zulip/zulip,showell/zulip,kou/zulip,synicalsyntax/zulip,showell/zulip,timabbott/zulip,andersk/zulip,rishig/zulip,timabbott/zulip,kou/zulip,kou/zulip,brainwane/zulip,rishig/zulip,kou/zulip,eeshangarg/zulip,tommyip/zulip,showell/zulip,tommyip/zulip,shubhamdhama/zulip,punchagan/zulip,synicalsyntax/zulip,rishig/zulip,shubhamdhama/zulip,zulip/zulip,kou/zulip,shubhamdhama/zulip,eeshangarg/zulip,andersk/zulip,andersk/zulip,synicalsyntax/zulip,tommyip/zulip,shubhamdhama/zulip,kou/zulip,punchagan/zulip,rishig/zulip,tommyip/zulip,kou/zulip,hackerkid/zulip,punchagan/zulip,rht/zulip,hackerkid/zulip,rht/zulip,timabbott/zulip,punchagan/zulip,rht/zulip,synicalsyntax/zulip,brainwane/zulip,punchagan/zulip,hackerkid/zulip,hackerkid/zulip,eeshangarg/zulip,zulip/zulip,zulip/zulip
python
## Code Before: from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('zerver', '0231_add_archive_transaction_model'), ] operations = [ migrations.RunSQL("DELETE FROM zerver_archivedusermessage"), migrations.RunSQL("DELETE FROM zerver_archivedreaction"), migrations.RunSQL("DELETE FROM zerver_archivedsubmessage"), migrations.RunSQL("DELETE FROM zerver_archivedattachment"), migrations.RunSQL("DELETE FROM zerver_archivedattachment_messages"), migrations.RunSQL("DELETE FROM zerver_archivedmessage"), migrations.RunSQL("DELETE FROM zerver_archivetransaction"), migrations.AlterField( model_name='archivedmessage', name='archive_transaction', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zerver.ArchiveTransaction'), ), ] ## Instruction: retention: Fix migration making archive_transaction field not null. DELETing from archive tables and ALTERing ArchivedMessage needs to be split into separate transactions. zerver_archivedattachment_messages needs to be cleared out before zerver_archivedattachment. ## Code After: from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): """ Tables cannot have data deleted from them and be altered in a single transaction, but we need the DELETEs to be atomic together. So we set atomic=False for the migration in general, and run the DELETEs in one transaction, and AlterField in another. """ atomic = False dependencies = [ ('zerver', '0231_add_archive_transaction_model'), ] operations = [ migrations.RunSQL(""" BEGIN; DELETE FROM zerver_archivedusermessage; DELETE FROM zerver_archivedreaction; DELETE FROM zerver_archivedsubmessage; DELETE FROM zerver_archivedattachment_messages; DELETE FROM zerver_archivedattachment; DELETE FROM zerver_archivedmessage; DELETE FROM zerver_archivetransaction; COMMIT; """), migrations.AlterField( model_name='archivedmessage', name='archive_transaction', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zerver.ArchiveTransaction'), ), ]
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion - class Migration(migrations.Migration): + """ + Tables cannot have data deleted from them and be altered in a single transaction, + but we need the DELETEs to be atomic together. So we set atomic=False for the migration + in general, and run the DELETEs in one transaction, and AlterField in another. + """ + atomic = False dependencies = [ ('zerver', '0231_add_archive_transaction_model'), ] operations = [ + migrations.RunSQL(""" + BEGIN; - migrations.RunSQL("DELETE FROM zerver_archivedusermessage"), ? ------------------- ^^^ + DELETE FROM zerver_archivedusermessage; ? ^ - migrations.RunSQL("DELETE FROM zerver_archivedreaction"), ? ------------------- ^^^ + DELETE FROM zerver_archivedreaction; ? ^ - migrations.RunSQL("DELETE FROM zerver_archivedsubmessage"), ? ------------------- ^^^ + DELETE FROM zerver_archivedsubmessage; ? ^ - migrations.RunSQL("DELETE FROM zerver_archivedattachment"), - migrations.RunSQL("DELETE FROM zerver_archivedattachment_messages"), ? ------------------- ^^^ + DELETE FROM zerver_archivedattachment_messages; ? ^ + DELETE FROM zerver_archivedattachment; - migrations.RunSQL("DELETE FROM zerver_archivedmessage"), ? ------------------- ^^^ + DELETE FROM zerver_archivedmessage; ? ^ - migrations.RunSQL("DELETE FROM zerver_archivetransaction"), ? ------------------- ^^^ + DELETE FROM zerver_archivetransaction; ? ^ + COMMIT; + """), migrations.AlterField( model_name='archivedmessage', name='archive_transaction', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='zerver.ArchiveTransaction'), ), ]
25
0.961538
17
8
24abf5759883beff7e6c101eb06d1a4d076695c7
appveyor.yml
appveyor.yml
init: - git config --global core.autocrlf input environment: matrix: - nodejs_version: "0.12" - nodejs_version: "4" - nodejs_version: "5" - nodejs_version: "6" - nodejs_version: "7" skip_tags: true platform: - x86 - x64 version: "{build}" build: off install: - ps: Install-Product node $env:nodejs_version $env:platform - set PATH=%APPDATA%\npm;%PATH% - node --version - npm --version - npm install test_script: - cmd: npm run test
init: - git config --global core.autocrlf input environment: matrix: - nodejs_version: "0.12" - nodejs_version: "4" - nodejs_version: "5" - nodejs_version: "6" - nodejs_version: "7" skip_tags: true version: "{build}" build: off install: - ps: Install-Product node $env:nodejs_version - set PATH=%APPDATA%\npm;%PATH% - node --version - npm --version - npm install test_script: - cmd: npm run test
Drop platform in Appveyor, really too long to test
Drop platform in Appveyor, really too long to test
YAML
mit
srod/node-minify
yaml
## Code Before: init: - git config --global core.autocrlf input environment: matrix: - nodejs_version: "0.12" - nodejs_version: "4" - nodejs_version: "5" - nodejs_version: "6" - nodejs_version: "7" skip_tags: true platform: - x86 - x64 version: "{build}" build: off install: - ps: Install-Product node $env:nodejs_version $env:platform - set PATH=%APPDATA%\npm;%PATH% - node --version - npm --version - npm install test_script: - cmd: npm run test ## Instruction: Drop platform in Appveyor, really too long to test ## Code After: init: - git config --global core.autocrlf input environment: matrix: - nodejs_version: "0.12" - nodejs_version: "4" - nodejs_version: "5" - nodejs_version: "6" - nodejs_version: "7" skip_tags: true version: "{build}" build: off install: - ps: Install-Product node $env:nodejs_version - set PATH=%APPDATA%\npm;%PATH% - node --version - npm --version - npm install test_script: - cmd: npm run test
init: - git config --global core.autocrlf input environment: matrix: - nodejs_version: "0.12" - nodejs_version: "4" - nodejs_version: "5" - nodejs_version: "6" - nodejs_version: "7" skip_tags: true - platform: - - x86 - - x64 - version: "{build}" build: off install: - - ps: Install-Product node $env:nodejs_version $env:platform ? -------------- + - ps: Install-Product node $env:nodejs_version - set PATH=%APPDATA%\npm;%PATH% - node --version - npm --version - npm install test_script: - cmd: npm run test
6
0.2
1
5
ec448b60e22e8fd830e13ba7138aa5ebc26ca3fa
app/models/government.rb
app/models/government.rb
class Government < ActiveRecord::Base validates :name, presence: true, uniqueness: true validates :slug, presence: true, uniqueness: true validates :start_date, presence: true has_many :documents before_validation on: :create do |government| government.slug = government.name.to_s.parameterize end scope :current, -> { order(start_date: :desc).first } def self.on_date(date) return nil if date.to_date > Date.today self.where('start_date <= ?', date).order(start_date: :desc).first end end
class Government < ActiveRecord::Base validates :name, presence: true, uniqueness: true validates :slug, presence: true, uniqueness: true validates :start_date, presence: true before_validation on: :create do |government| government.slug = government.name.to_s.parameterize end scope :current, -> { order(start_date: :desc).first } def self.on_date(date) return nil if date.to_date > Date.today self.where('start_date <= ?', date).order(start_date: :desc).first end end
Remove unused association on Government
Remove unused association on Government This association is not used anywhere in the app. Getting rid of it as a pre step to refactoring the derivation of government on editions.
Ruby
mit
askl56/whitehall,ggoral/whitehall,robinwhittleton/whitehall,robinwhittleton/whitehall,YOTOV-LIMITED/whitehall,alphagov/whitehall,alphagov/whitehall,hotvulcan/whitehall,alphagov/whitehall,robinwhittleton/whitehall,hotvulcan/whitehall,askl56/whitehall,ggoral/whitehall,YOTOV-LIMITED/whitehall,robinwhittleton/whitehall,YOTOV-LIMITED/whitehall,hotvulcan/whitehall,YOTOV-LIMITED/whitehall,hotvulcan/whitehall,askl56/whitehall,alphagov/whitehall,askl56/whitehall,ggoral/whitehall,ggoral/whitehall
ruby
## Code Before: class Government < ActiveRecord::Base validates :name, presence: true, uniqueness: true validates :slug, presence: true, uniqueness: true validates :start_date, presence: true has_many :documents before_validation on: :create do |government| government.slug = government.name.to_s.parameterize end scope :current, -> { order(start_date: :desc).first } def self.on_date(date) return nil if date.to_date > Date.today self.where('start_date <= ?', date).order(start_date: :desc).first end end ## Instruction: Remove unused association on Government This association is not used anywhere in the app. Getting rid of it as a pre step to refactoring the derivation of government on editions. ## Code After: class Government < ActiveRecord::Base validates :name, presence: true, uniqueness: true validates :slug, presence: true, uniqueness: true validates :start_date, presence: true before_validation on: :create do |government| government.slug = government.name.to_s.parameterize end scope :current, -> { order(start_date: :desc).first } def self.on_date(date) return nil if date.to_date > Date.today self.where('start_date <= ?', date).order(start_date: :desc).first end end
class Government < ActiveRecord::Base validates :name, presence: true, uniqueness: true validates :slug, presence: true, uniqueness: true validates :start_date, presence: true - - has_many :documents before_validation on: :create do |government| government.slug = government.name.to_s.parameterize end scope :current, -> { order(start_date: :desc).first } def self.on_date(date) return nil if date.to_date > Date.today self.where('start_date <= ?', date).order(start_date: :desc).first end end
2
0.111111
0
2
881141cf06d2f4b2e2adad2a97116811b2a5b17b
lib/capistrano-info/capistrano.rb
lib/capistrano-info/capistrano.rb
Capistrano::Configuration.instance.load do namespace :info do desc <<-DESC Tail all or a single remote file The logfile can be specified with a LOGFILE-environment variable. It defaults to RAILS_ENV.log DESC task :tail, :roles => :app do ENV["LOGFILE"] ||= "#{fetch(:rails_env, 'production')}.log" begin stream "tail -f #{shared_path}/log/#{ENV["LOGFILE"]}" rescue Interrupt puts "\n--interrupted by user--" puts "" end end desc "Display the currently deployed Application, Revision and Release" task :version, :roles => :app, :except => { :no_release => true } do rev = current_revision rel = current_release.split('/').pop rel_date = Time.local(*rel.unpack("a4a2a2a2a2a2")) version_file = "#{current_path}/VERSION" version = capture("test -r #{version_file} && cat #{version_file}").chomp message = <<-EOT AppName: #{fetch(:application)} Version: #{rev} Release: #{rel} Deploy: #{rel_date} EOT message << <<-EOT if version != "" Version: #{version} EOT message << <<-EOT EOT puts message end desc "Display the uname" task :uname do run "uname -a" end end end
Capistrano::Configuration.instance.load do namespace :info do desc <<-DESC Tail all or a single remote file The logfile can be specified with a LOGFILE-environment variable. It defaults to RAILS_ENV.log DESC task :tail, :roles => :app do ENV["LOGFILE"] ||= "#{fetch(:rails_env, 'production')}.log" begin stream "tail -f #{shared_path}/log/#{ENV["LOGFILE"]}" rescue Interrupt puts "\n--interrupted by user--" puts "" end end desc "Display the currently deployed Application, Revision and Release" task :version, :roles => :app, :except => { :no_release => true } do rev = current_revision rel = current_release.split('/').pop rel_date = Time.local(*rel.unpack("a4a2a2a2a2a2")) version_file = "#{current_path}/VERSION" version = begin capture("test -r #{version_file} && cat #{version_file}").chomp rescue Capistrano::CommandError "" end message = <<-EOT AppName: #{fetch(:application)} Version: #{rev} Release: #{rel} Deploy: #{rel_date} EOT message << <<-EOT if version != "" Version: #{version} EOT message << <<-EOT EOT puts message end desc "Display the uname" task :uname do run "uname -a" end end end
Handle "failed" reading of VERSION-file silently
Handle "failed" reading of VERSION-file silently
Ruby
mit
kronn/capistrano-info
ruby
## Code Before: Capistrano::Configuration.instance.load do namespace :info do desc <<-DESC Tail all or a single remote file The logfile can be specified with a LOGFILE-environment variable. It defaults to RAILS_ENV.log DESC task :tail, :roles => :app do ENV["LOGFILE"] ||= "#{fetch(:rails_env, 'production')}.log" begin stream "tail -f #{shared_path}/log/#{ENV["LOGFILE"]}" rescue Interrupt puts "\n--interrupted by user--" puts "" end end desc "Display the currently deployed Application, Revision and Release" task :version, :roles => :app, :except => { :no_release => true } do rev = current_revision rel = current_release.split('/').pop rel_date = Time.local(*rel.unpack("a4a2a2a2a2a2")) version_file = "#{current_path}/VERSION" version = capture("test -r #{version_file} && cat #{version_file}").chomp message = <<-EOT AppName: #{fetch(:application)} Version: #{rev} Release: #{rel} Deploy: #{rel_date} EOT message << <<-EOT if version != "" Version: #{version} EOT message << <<-EOT EOT puts message end desc "Display the uname" task :uname do run "uname -a" end end end ## Instruction: Handle "failed" reading of VERSION-file silently ## Code After: Capistrano::Configuration.instance.load do namespace :info do desc <<-DESC Tail all or a single remote file The logfile can be specified with a LOGFILE-environment variable. It defaults to RAILS_ENV.log DESC task :tail, :roles => :app do ENV["LOGFILE"] ||= "#{fetch(:rails_env, 'production')}.log" begin stream "tail -f #{shared_path}/log/#{ENV["LOGFILE"]}" rescue Interrupt puts "\n--interrupted by user--" puts "" end end desc "Display the currently deployed Application, Revision and Release" task :version, :roles => :app, :except => { :no_release => true } do rev = current_revision rel = current_release.split('/').pop rel_date = Time.local(*rel.unpack("a4a2a2a2a2a2")) version_file = "#{current_path}/VERSION" version = begin capture("test -r #{version_file} && cat #{version_file}").chomp rescue Capistrano::CommandError "" end message = <<-EOT AppName: #{fetch(:application)} Version: #{rev} Release: #{rel} Deploy: #{rel_date} EOT message << <<-EOT if version != "" Version: #{version} EOT message << <<-EOT EOT puts message end desc "Display the uname" task :uname do run "uname -a" end end end
Capistrano::Configuration.instance.load do namespace :info do desc <<-DESC Tail all or a single remote file The logfile can be specified with a LOGFILE-environment variable. It defaults to RAILS_ENV.log DESC task :tail, :roles => :app do ENV["LOGFILE"] ||= "#{fetch(:rails_env, 'production')}.log" begin stream "tail -f #{shared_path}/log/#{ENV["LOGFILE"]}" rescue Interrupt puts "\n--interrupted by user--" puts "" end end desc "Display the currently deployed Application, Revision and Release" task :version, :roles => :app, :except => { :no_release => true } do rev = current_revision rel = current_release.split('/').pop rel_date = Time.local(*rel.unpack("a4a2a2a2a2a2")) version_file = "#{current_path}/VERSION" + version = begin - version = capture("test -r #{version_file} && cat #{version_file}").chomp ? ------- ^ + capture("test -r #{version_file} && cat #{version_file}").chomp ? ^^^^^^^^^^ + rescue Capistrano::CommandError + "" + end message = <<-EOT AppName: #{fetch(:application)} Version: #{rev} Release: #{rel} Deploy: #{rel_date} EOT message << <<-EOT if version != "" Version: #{version} EOT message << <<-EOT EOT puts message end desc "Display the uname" task :uname do run "uname -a" end end end
6
0.113208
5
1
3a59ae67834165ec18dc85563992ae58f9c38969
test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp
test/std/atomics/atomics.types.operations/atomics.types.operations.req/ctor.pass.cpp
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03 // <atomic> // constexpr atomic<T>::atomic(T value) #include <atomic> #include <type_traits> #include <cassert> struct UserType { int i; UserType() noexcept {} constexpr explicit UserType(int d) noexcept : i(d) {} friend bool operator==(const UserType& x, const UserType& y) { return x.i == y.i; } }; template <class Tp> void test() { typedef std::atomic<Tp> Atomic; static_assert(std::is_literal_type<Atomic>::value, ""); constexpr Tp t(42); { constexpr Atomic a(t); assert(a == t); } { constexpr Atomic a{t}; assert(a == t); } { constexpr Atomic a = ATOMIC_VAR_INIT(t); assert(a == t); } } int main() { test<int>(); test<UserType>(); }
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03 // NOTE: atomic<> of a TriviallyCopyable class is wrongly rejected by older // clang versions. It was fixed right before the llvm 3.5 release. See PR18097. // XFAIL: apple-clang-6.0, clang-3.4, clang-3.3 // <atomic> // constexpr atomic<T>::atomic(T value) #include <atomic> #include <type_traits> #include <cassert> struct UserType { int i; UserType() noexcept {} constexpr explicit UserType(int d) noexcept : i(d) {} friend bool operator==(const UserType& x, const UserType& y) { return x.i == y.i; } }; template <class Tp> void test() { typedef std::atomic<Tp> Atomic; static_assert(std::is_literal_type<Atomic>::value, ""); constexpr Tp t(42); { constexpr Atomic a(t); assert(a == t); } { constexpr Atomic a{t}; assert(a == t); } { constexpr Atomic a = ATOMIC_VAR_INIT(t); assert(a == t); } } int main() { test<int>(); test<UserType>(); }
Mark this test as XFAIL with older compilers, since they hit PR18097
Mark this test as XFAIL with older compilers, since they hit PR18097 git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@242967 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx,llvm-mirror/libcxx
c++
## Code Before: //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03 // <atomic> // constexpr atomic<T>::atomic(T value) #include <atomic> #include <type_traits> #include <cassert> struct UserType { int i; UserType() noexcept {} constexpr explicit UserType(int d) noexcept : i(d) {} friend bool operator==(const UserType& x, const UserType& y) { return x.i == y.i; } }; template <class Tp> void test() { typedef std::atomic<Tp> Atomic; static_assert(std::is_literal_type<Atomic>::value, ""); constexpr Tp t(42); { constexpr Atomic a(t); assert(a == t); } { constexpr Atomic a{t}; assert(a == t); } { constexpr Atomic a = ATOMIC_VAR_INIT(t); assert(a == t); } } int main() { test<int>(); test<UserType>(); } ## Instruction: Mark this test as XFAIL with older compilers, since they hit PR18097 git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@242967 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03 // NOTE: atomic<> of a TriviallyCopyable class is wrongly rejected by older // clang versions. It was fixed right before the llvm 3.5 release. See PR18097. // XFAIL: apple-clang-6.0, clang-3.4, clang-3.3 // <atomic> // constexpr atomic<T>::atomic(T value) #include <atomic> #include <type_traits> #include <cassert> struct UserType { int i; UserType() noexcept {} constexpr explicit UserType(int d) noexcept : i(d) {} friend bool operator==(const UserType& x, const UserType& y) { return x.i == y.i; } }; template <class Tp> void test() { typedef std::atomic<Tp> Atomic; static_assert(std::is_literal_type<Atomic>::value, ""); constexpr Tp t(42); { constexpr Atomic a(t); assert(a == t); } { constexpr Atomic a{t}; assert(a == t); } { constexpr Atomic a = ATOMIC_VAR_INIT(t); assert(a == t); } } int main() { test<int>(); test<UserType>(); }
//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // UNSUPPORTED: libcpp-has-no-threads // UNSUPPORTED: c++98, c++03 + + // NOTE: atomic<> of a TriviallyCopyable class is wrongly rejected by older + // clang versions. It was fixed right before the llvm 3.5 release. See PR18097. + // XFAIL: apple-clang-6.0, clang-3.4, clang-3.3 // <atomic> // constexpr atomic<T>::atomic(T value) #include <atomic> #include <type_traits> #include <cassert> struct UserType { int i; UserType() noexcept {} constexpr explicit UserType(int d) noexcept : i(d) {} friend bool operator==(const UserType& x, const UserType& y) { return x.i == y.i; } }; template <class Tp> void test() { typedef std::atomic<Tp> Atomic; static_assert(std::is_literal_type<Atomic>::value, ""); constexpr Tp t(42); { constexpr Atomic a(t); assert(a == t); } { constexpr Atomic a{t}; assert(a == t); } { constexpr Atomic a = ATOMIC_VAR_INIT(t); assert(a == t); } } int main() { test<int>(); test<UserType>(); }
4
0.071429
4
0
730db8392e67363ea657fde22e3e5705738934a9
tests/Transport/fsockopen.php
tests/Transport/fsockopen.php
<?php class RequestsTest_Transport_fsockopen extends RequestsTest_Transport_Base { protected $transport = 'Requests_Transport_fsockopen'; public function testHTTPS() { // If OpenSSL isn't loaded, this should fail if (!defined('OPENSSL_VERSION_NUMBER')) { $this->setExpectedException('Requests_Exception'); } return parent::testHTTPS(); } public function testHostHeader() { $hooks = new Requests_Hooks(); $hooks->register('fsockopen.after_headers', function(&$transport) { preg_match('/Host:\s+(.+)\r\n/m', $transport, $headerMatch); $this->assertEquals('portquiz.positon.org:8080', $headerMatch[1]); }); $request = Requests::get( 'http://portquiz.positon.org:8080/', array(), $this->getOptions(array('hooks' => $hooks)) ); } }
<?php class RequestsTest_Transport_fsockopen extends RequestsTest_Transport_Base { protected $transport = 'Requests_Transport_fsockopen'; public function testHTTPS() { // If OpenSSL isn't loaded, this should fail if (!defined('OPENSSL_VERSION_NUMBER')) { $this->setExpectedException('Requests_Exception'); } return parent::testHTTPS(); } public function testHostHeader() { $hooks = new Requests_Hooks(); $hooks->register('fsockopen.after_headers', array($this, 'headerParseCallback')); $request = Requests::get( 'http://portquiz.positon.org:8080/', array(), $this->getOptions(array('hooks' => $hooks)) ); } public function headerParseCallback($transport) { preg_match('/Host:\s+(.+)\r\n/m', $transport, $headerMatch); $this->assertEquals('portquiz.positon.org:8080', $headerMatch[1]); } }
Remove closure for 5.2 and 5.3 support
Remove closure for 5.2 and 5.3 support
PHP
bsd-3-clause
meox/Requests,dskanth/Requests,andreipetcu/Requests,ifwe/Requests,mubassirhayat/Requests,meox/Requests,meox/Requests
php
## Code Before: <?php class RequestsTest_Transport_fsockopen extends RequestsTest_Transport_Base { protected $transport = 'Requests_Transport_fsockopen'; public function testHTTPS() { // If OpenSSL isn't loaded, this should fail if (!defined('OPENSSL_VERSION_NUMBER')) { $this->setExpectedException('Requests_Exception'); } return parent::testHTTPS(); } public function testHostHeader() { $hooks = new Requests_Hooks(); $hooks->register('fsockopen.after_headers', function(&$transport) { preg_match('/Host:\s+(.+)\r\n/m', $transport, $headerMatch); $this->assertEquals('portquiz.positon.org:8080', $headerMatch[1]); }); $request = Requests::get( 'http://portquiz.positon.org:8080/', array(), $this->getOptions(array('hooks' => $hooks)) ); } } ## Instruction: Remove closure for 5.2 and 5.3 support ## Code After: <?php class RequestsTest_Transport_fsockopen extends RequestsTest_Transport_Base { protected $transport = 'Requests_Transport_fsockopen'; public function testHTTPS() { // If OpenSSL isn't loaded, this should fail if (!defined('OPENSSL_VERSION_NUMBER')) { $this->setExpectedException('Requests_Exception'); } return parent::testHTTPS(); } public function testHostHeader() { $hooks = new Requests_Hooks(); $hooks->register('fsockopen.after_headers', array($this, 'headerParseCallback')); $request = Requests::get( 'http://portquiz.positon.org:8080/', array(), $this->getOptions(array('hooks' => $hooks)) ); } public function headerParseCallback($transport) { preg_match('/Host:\s+(.+)\r\n/m', $transport, $headerMatch); $this->assertEquals('portquiz.positon.org:8080', $headerMatch[1]); } }
<?php class RequestsTest_Transport_fsockopen extends RequestsTest_Transport_Base { protected $transport = 'Requests_Transport_fsockopen'; public function testHTTPS() { // If OpenSSL isn't loaded, this should fail if (!defined('OPENSSL_VERSION_NUMBER')) { $this->setExpectedException('Requests_Exception'); } return parent::testHTTPS(); } - public function testHostHeader() + public function testHostHeader() { ? ++ - { $hooks = new Requests_Hooks(); + $hooks->register('fsockopen.after_headers', array($this, 'headerParseCallback')); - $hooks->register('fsockopen.after_headers', function(&$transport) { - preg_match('/Host:\s+(.+)\r\n/m', $transport, $headerMatch); - $this->assertEquals('portquiz.positon.org:8080', $headerMatch[1]); - }); $request = Requests::get( 'http://portquiz.positon.org:8080/', array(), $this->getOptions(array('hooks' => $hooks)) ); } + + public function headerParseCallback($transport) { + preg_match('/Host:\s+(.+)\r\n/m', $transport, $headerMatch); + $this->assertEquals('portquiz.positon.org:8080', $headerMatch[1]); + } }
13
0.448276
7
6
33c7bd546236497aae9b0c96d6ae4c41f317a00e
saau/sections/transportation/data.py
saau/sections/transportation/data.py
from operator import itemgetter from itertools import chain from typing import List from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np def get_layers(service): layers = service.layers return { layer.name: layer for layer in layers } def mend_extent(extent): extent.wkid = extent.spatialReference.wkid return extent def get_data(requested_layers: List[str]): catalog = Catalog('http://services.ga.gov.au/site_7/rest/services') service = catalog['NM_Transport_Infrastructure'] layers = get_layers(service) return chain.from_iterable( layers[layer].QueryLayer(Geometry=mend_extent(layers[layer].extent)) for layer in requested_layers ) def get_paths(request_layers: List[str]) -> np.array: paths = get_data(request_layers) paths = map(itemgetter('geometry'), paths) paths = chain.from_iterable( geometry.paths for geometry in paths if hasattr(geometry, 'paths') ) return np.array([ tuple( (part.x, part.y) for part in path ) for path in paths ])
from operator import itemgetter from itertools import chain from typing import List import cgi from urllib.parse import parse_qs from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np cgi.parse_qs = parse_qs def get_layers(service): layers = service.layers return { layer.name: layer for layer in layers } def mend_extent(extent): extent.wkid = extent.spatialReference.wkid return extent def get_data(requested_layers: List[str]): catalog = Catalog('http://services.ga.gov.au/site_7/rest/services') service = catalog['NM_Transport_Infrastructure'] layers = get_layers(service) return chain.from_iterable( layers[layer].QueryLayer(Geometry=mend_extent(layers[layer].extent)) for layer in requested_layers ) def get_paths(request_layers: List[str]) -> np.array: paths = get_data(request_layers) paths = map(itemgetter('geometry'), paths) paths = chain.from_iterable( geometry.paths for geometry in paths if hasattr(geometry, 'paths') ) return np.array([ tuple( (part.x, part.y) for part in path ) for path in paths ])
Patch missing method on cgi package
Patch missing method on cgi package
Python
mit
Mause/statistical_atlas_of_au
python
## Code Before: from operator import itemgetter from itertools import chain from typing import List from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np def get_layers(service): layers = service.layers return { layer.name: layer for layer in layers } def mend_extent(extent): extent.wkid = extent.spatialReference.wkid return extent def get_data(requested_layers: List[str]): catalog = Catalog('http://services.ga.gov.au/site_7/rest/services') service = catalog['NM_Transport_Infrastructure'] layers = get_layers(service) return chain.from_iterable( layers[layer].QueryLayer(Geometry=mend_extent(layers[layer].extent)) for layer in requested_layers ) def get_paths(request_layers: List[str]) -> np.array: paths = get_data(request_layers) paths = map(itemgetter('geometry'), paths) paths = chain.from_iterable( geometry.paths for geometry in paths if hasattr(geometry, 'paths') ) return np.array([ tuple( (part.x, part.y) for part in path ) for path in paths ]) ## Instruction: Patch missing method on cgi package ## Code After: from operator import itemgetter from itertools import chain from typing import List import cgi from urllib.parse import parse_qs from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np cgi.parse_qs = parse_qs def get_layers(service): layers = service.layers return { layer.name: layer for layer in layers } def mend_extent(extent): extent.wkid = extent.spatialReference.wkid return extent def get_data(requested_layers: List[str]): catalog = Catalog('http://services.ga.gov.au/site_7/rest/services') service = catalog['NM_Transport_Infrastructure'] layers = get_layers(service) return chain.from_iterable( layers[layer].QueryLayer(Geometry=mend_extent(layers[layer].extent)) for layer in requested_layers ) def get_paths(request_layers: List[str]) -> np.array: paths = get_data(request_layers) paths = map(itemgetter('geometry'), paths) paths = chain.from_iterable( geometry.paths for geometry in paths if hasattr(geometry, 'paths') ) return np.array([ tuple( (part.x, part.y) for part in path ) for path in paths ])
from operator import itemgetter from itertools import chain from typing import List + + import cgi + from urllib.parse import parse_qs from ...utils.py3_hook import with_hook with with_hook(): from arcrest import Catalog import numpy as np + + + cgi.parse_qs = parse_qs def get_layers(service): layers = service.layers return { layer.name: layer for layer in layers } def mend_extent(extent): extent.wkid = extent.spatialReference.wkid return extent def get_data(requested_layers: List[str]): catalog = Catalog('http://services.ga.gov.au/site_7/rest/services') service = catalog['NM_Transport_Infrastructure'] layers = get_layers(service) return chain.from_iterable( layers[layer].QueryLayer(Geometry=mend_extent(layers[layer].extent)) for layer in requested_layers ) def get_paths(request_layers: List[str]) -> np.array: paths = get_data(request_layers) paths = map(itemgetter('geometry'), paths) paths = chain.from_iterable( geometry.paths for geometry in paths if hasattr(geometry, 'paths') ) return np.array([ tuple( (part.x, part.y) for part in path ) for path in paths ])
6
0.117647
6
0
1016d5481d3dd72571fbfe060d8b8eb4783a66e3
src/Oro/Bundle/UIBundle/Resources/public/blank/scss/components/page-content.scss
src/Oro/Bundle/UIBundle/Resources/public/blank/scss/components/page-content.scss
// @theme: blank .page-content { width: $page-content-width; @include clearfix(); &--has-sidebar { padding: $page-content-with-sidebar-inner-offset; order: $page-content-with-sidebar-order; } } @include breakpoint('desktop') { .page-content { &--has-sidebar { width: calc(#{$page-content-width} - #{$page-sidebar-width}); flex: 1; } } } @include breakpoint('tablet') { .page-content { &--has-sidebar { padding: $page-content-with-sidebar-tables-s-inner-offset; } } }
// @theme: blank .page-content { width: $page-content-width; @include clearfix(); &--has-sidebar { padding: $page-content-with-sidebar-inner-offset; order: $page-content-with-sidebar-order; } } @include breakpoint('desktop') { .page-content { &--has-sidebar { width: calc(#{$page-content-width} - #{$page-sidebar-width}); } } } @include breakpoint('tablet') { .page-content { &--has-sidebar { padding: $page-content-with-sidebar-tables-s-inner-offset; } } }
Order History - page is broken after click "Select All" in "Manage Grid" popup in Firefox browser
BB-7983: Order History - page is broken after click "Select All" in "Manage Grid" popup in Firefox browser
SCSS
mit
orocrm/platform,Djamy/platform,Djamy/platform,Djamy/platform,orocrm/platform,orocrm/platform,geoffroycochard/platform,geoffroycochard/platform,geoffroycochard/platform
scss
## Code Before: // @theme: blank .page-content { width: $page-content-width; @include clearfix(); &--has-sidebar { padding: $page-content-with-sidebar-inner-offset; order: $page-content-with-sidebar-order; } } @include breakpoint('desktop') { .page-content { &--has-sidebar { width: calc(#{$page-content-width} - #{$page-sidebar-width}); flex: 1; } } } @include breakpoint('tablet') { .page-content { &--has-sidebar { padding: $page-content-with-sidebar-tables-s-inner-offset; } } } ## Instruction: BB-7983: Order History - page is broken after click "Select All" in "Manage Grid" popup in Firefox browser ## Code After: // @theme: blank .page-content { width: $page-content-width; @include clearfix(); &--has-sidebar { padding: $page-content-with-sidebar-inner-offset; order: $page-content-with-sidebar-order; } } @include breakpoint('desktop') { .page-content { &--has-sidebar { width: calc(#{$page-content-width} - #{$page-sidebar-width}); } } } @include breakpoint('tablet') { .page-content { &--has-sidebar { padding: $page-content-with-sidebar-tables-s-inner-offset; } } }
// @theme: blank .page-content { width: $page-content-width; @include clearfix(); &--has-sidebar { padding: $page-content-with-sidebar-inner-offset; order: $page-content-with-sidebar-order; } } @include breakpoint('desktop') { .page-content { &--has-sidebar { width: calc(#{$page-content-width} - #{$page-sidebar-width}); - - flex: 1; } } } @include breakpoint('tablet') { .page-content { &--has-sidebar { padding: $page-content-with-sidebar-tables-s-inner-offset; } } }
2
0.064516
0
2
7eab1d3486ba89cda4d0ff2bb70d6af9c3fdfc57
test/00/t0034a.sh
test/00/t0034a.sh
here=`pwd` if test $? -ne 0; then exit 2; fi tmp=/tmp/$$ mkdir $tmp if test $? -ne 0; then exit 2; fi cd $tmp if test $? -ne 0; then exit 2; fi fail() { echo "FAILED" 1>&2 cd $here chmod -R u+w $tmp rm -rf $tmp exit 1 } pass() { echo "PASSED" 1>&2 cd $here chmod -R u+w $tmp rm -rf $tmp exit 0 } trap "fail" 1 2 3 15 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH $here/test/testCairo $here/test/testCairo.tcl if test $? -ne 0; then fail; fi pass
here=`pwd` if test $? -ne 0; then exit 2; fi tmp=/tmp/$$ mkdir $tmp if test $? -ne 0; then exit 2; fi cd $tmp if test $? -ne 0; then exit 2; fi fail() { echo "FAILED" 1>&2 cd $here chmod -R u+w $tmp rm -rf $tmp exit 1 } pass() { echo "PASSED" 1>&2 cd $here chmod -R u+w $tmp rm -rf $tmp exit 0 } trap "fail" 1 2 3 15 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH Xvfb :0& export DISPLAY=:0 $here/test/testCairo $here/test/testCairo.tcl if test $? -ne 0; then fail; fi pass
Add xvfb line into test script
Add xvfb line into test script
Shell
mit
highperformancecoder/ecolab,highperformancecoder/ecolab,highperformancecoder/ecolab,highperformancecoder/ecolab
shell
## Code Before: here=`pwd` if test $? -ne 0; then exit 2; fi tmp=/tmp/$$ mkdir $tmp if test $? -ne 0; then exit 2; fi cd $tmp if test $? -ne 0; then exit 2; fi fail() { echo "FAILED" 1>&2 cd $here chmod -R u+w $tmp rm -rf $tmp exit 1 } pass() { echo "PASSED" 1>&2 cd $here chmod -R u+w $tmp rm -rf $tmp exit 0 } trap "fail" 1 2 3 15 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH $here/test/testCairo $here/test/testCairo.tcl if test $? -ne 0; then fail; fi pass ## Instruction: Add xvfb line into test script ## Code After: here=`pwd` if test $? -ne 0; then exit 2; fi tmp=/tmp/$$ mkdir $tmp if test $? -ne 0; then exit 2; fi cd $tmp if test $? -ne 0; then exit 2; fi fail() { echo "FAILED" 1>&2 cd $here chmod -R u+w $tmp rm -rf $tmp exit 1 } pass() { echo "PASSED" 1>&2 cd $here chmod -R u+w $tmp rm -rf $tmp exit 0 } trap "fail" 1 2 3 15 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH Xvfb :0& export DISPLAY=:0 $here/test/testCairo $here/test/testCairo.tcl if test $? -ne 0; then fail; fi pass
here=`pwd` if test $? -ne 0; then exit 2; fi tmp=/tmp/$$ mkdir $tmp if test $? -ne 0; then exit 2; fi cd $tmp if test $? -ne 0; then exit 2; fi fail() { echo "FAILED" 1>&2 cd $here chmod -R u+w $tmp rm -rf $tmp exit 1 } pass() { echo "PASSED" 1>&2 cd $here chmod -R u+w $tmp rm -rf $tmp exit 0 } trap "fail" 1 2 3 15 export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH - + Xvfb :0& + export DISPLAY=:0 $here/test/testCairo $here/test/testCairo.tcl if test $? -ne 0; then fail; fi pass
3
0.083333
2
1
641092d5cdb87924c2a486bb95fb2f750f7b21c0
README.md
README.md
Synchronize remote files with local directory. # Installation If you don't have `pipsi` installed, you can find the instructions to install it [here](https://github.com/mitsuhiko/pipsi#readme). Otherwise, simply run: $ pipsi install . Note: `pipsi` relies on `pip` and `virtualenv` which may need to be installed. # Getting Started To use it: $ kdr --help ### Initializing a repository ### Synchronizing files and directories ### Conflicts
Synchronize remote files with local directory. # Installation If you don't have `pipsi` installed, you can find the instructions to install it [here](https://github.com/mitsuhiko/pipsi#readme). Otherwise, simply run: $ pipsi install . Note: `pipsi` depends on [pip](https://github.com/pypa/pip) and [virtualenv](https://github.com/pypa/virtualenv) which may need to be installed. # Getting Started To use it: $ kdr --help ### Initializing a repository ### Synchronizing files and directories ### Conflicts If a file is modified on different devices simultaneously, the file on the device with the larger value of the first 63 bits for their device ID will be marked as the conflicting file. The file will be renamed to '<filename>.sync- conflict-<date>-<time>.<ext>' It will be up to the users to resolve conflicts and update their files in this case. Please note that if users modify conflict files, it is possible to end up with conflicting conflict files. Those will be named as 'sync-conflict-...sync-conflict -...-sync-conflict' files.
Update to Installation and Conflict
Update to Installation and Conflict
Markdown
mit
Jvlythical/KoDrive,Jvlythical/KoDrive
markdown
## Code Before: Synchronize remote files with local directory. # Installation If you don't have `pipsi` installed, you can find the instructions to install it [here](https://github.com/mitsuhiko/pipsi#readme). Otherwise, simply run: $ pipsi install . Note: `pipsi` relies on `pip` and `virtualenv` which may need to be installed. # Getting Started To use it: $ kdr --help ### Initializing a repository ### Synchronizing files and directories ### Conflicts ## Instruction: Update to Installation and Conflict ## Code After: Synchronize remote files with local directory. # Installation If you don't have `pipsi` installed, you can find the instructions to install it [here](https://github.com/mitsuhiko/pipsi#readme). Otherwise, simply run: $ pipsi install . Note: `pipsi` depends on [pip](https://github.com/pypa/pip) and [virtualenv](https://github.com/pypa/virtualenv) which may need to be installed. # Getting Started To use it: $ kdr --help ### Initializing a repository ### Synchronizing files and directories ### Conflicts If a file is modified on different devices simultaneously, the file on the device with the larger value of the first 63 bits for their device ID will be marked as the conflicting file. The file will be renamed to '<filename>.sync- conflict-<date>-<time>.<ext>' It will be up to the users to resolve conflicts and update their files in this case. Please note that if users modify conflict files, it is possible to end up with conflicting conflict files. Those will be named as 'sync-conflict-...sync-conflict -...-sync-conflict' files.
Synchronize remote files with local directory. # Installation If you don't have `pipsi` installed, you can find the instructions to install it [here](https://github.com/mitsuhiko/pipsi#readme). Otherwise, simply run: $ pipsi install . - Note: `pipsi` relies on `pip` and `virtualenv` which may need to be installed. + Note: `pipsi` depends on [pip](https://github.com/pypa/pip) and [virtualenv](https://github.com/pypa/virtualenv) which may need to be installed. # Getting Started To use it: $ kdr --help ### Initializing a repository ### Synchronizing files and directories ### Conflicts + + If a file is modified on different devices simultaneously, the file on the device with the larger value of the first 63 bits for their device ID will be marked as the conflicting file. The file will be renamed to '<filename>.sync- conflict-<date>-<time>.<ext>' + + It will be up to the users to resolve conflicts and update their files in this case. + + Please note that if users modify conflict files, it is possible to end up with conflicting conflict files. + Those will be named as 'sync-conflict-...sync-conflict -...-sync-conflict' files.
9
0.333333
8
1
5f3859a3b1e672874e035984dcc79d1e77405c63
README.md
README.md
Cecil ===== Mono.Cecil is a library to generate and inspect programs and libraries in the ECMA CIL form. To put it simply, you can use Cecil to: * Analyze .NET binaries using a simple and powerful object model, without having to load assemblies to use Reflection. * Modify .NET binaries, add new metadata structures and alter the IL code. Cecil has been around since 2004 and is [widely used](https://github.com/jbevain/cecil/wiki/Users) in the .NET community. The best way to learn how to use Cecil is to dive into the [Cecil.Samples](https://github.com/jbevain/cecil.samples) repository. It's a growing collection of samples with the goal of showing how to get things done using Cecil, as IL manipulation can sometime get tricky. Cecil is a project under the benevolent umbrella of the [.NET Foundation](http://www.dotnetfoundation.org/). To discuss Cecil, the best place is the [mono-cecil](https://groups.google.com/group/mono-cecil) google group. [![Build status](https://ci.appveyor.com/api/projects/status/fmhutmhidy1fahl4?svg=true)](https://ci.appveyor.com/project/jbevain/cecil)
Cecil ===== Mono.Cecil is a library to generate and inspect programs and libraries in the ECMA CIL form. To put it simply, you can use Cecil to: * Analyze .NET binaries using a simple and powerful object model, without having to load assemblies to use Reflection. * Modify .NET binaries, add new metadata structures and alter the IL code. Cecil has been around since 2004 and is [widely used](https://github.com/jbevain/cecil/wiki/Users) in the .NET community. The best way to learn how to use Cecil is to dive into the [Cecil.Samples](https://github.com/jbevain/cecil.samples) repository. It's a growing collection of samples with the goal of showing how to get things done using Cecil, as IL manipulation can sometime get tricky. Read about the Cecil development on the [development log](http://cecil.pe). To discuss Cecil, the best place is the [mono-cecil](https://groups.google.com/group/mono-cecil) Google Group. Cecil is a project under the benevolent umbrella of the [.NET Foundation](http://www.dotnetfoundation.org/). [![Build status](https://ci.appveyor.com/api/projects/status/fmhutmhidy1fahl4?svg=true)](https://ci.appveyor.com/project/jbevain/cecil)
Add link to the devlog
Add link to the devlog
Markdown
mit
SiliconStudio/Mono.Cecil,saynomoo/cecil,ttRevan/cecil,mono/cecil,gluck/cecil,cgourlay/cecil,kzu/cecil,jbevain/cecil,furesoft/cecil,fnajera-rac-de/cecil,sailro/cecil
markdown
## Code Before: Cecil ===== Mono.Cecil is a library to generate and inspect programs and libraries in the ECMA CIL form. To put it simply, you can use Cecil to: * Analyze .NET binaries using a simple and powerful object model, without having to load assemblies to use Reflection. * Modify .NET binaries, add new metadata structures and alter the IL code. Cecil has been around since 2004 and is [widely used](https://github.com/jbevain/cecil/wiki/Users) in the .NET community. The best way to learn how to use Cecil is to dive into the [Cecil.Samples](https://github.com/jbevain/cecil.samples) repository. It's a growing collection of samples with the goal of showing how to get things done using Cecil, as IL manipulation can sometime get tricky. Cecil is a project under the benevolent umbrella of the [.NET Foundation](http://www.dotnetfoundation.org/). To discuss Cecil, the best place is the [mono-cecil](https://groups.google.com/group/mono-cecil) google group. [![Build status](https://ci.appveyor.com/api/projects/status/fmhutmhidy1fahl4?svg=true)](https://ci.appveyor.com/project/jbevain/cecil) ## Instruction: Add link to the devlog ## Code After: Cecil ===== Mono.Cecil is a library to generate and inspect programs and libraries in the ECMA CIL form. To put it simply, you can use Cecil to: * Analyze .NET binaries using a simple and powerful object model, without having to load assemblies to use Reflection. * Modify .NET binaries, add new metadata structures and alter the IL code. Cecil has been around since 2004 and is [widely used](https://github.com/jbevain/cecil/wiki/Users) in the .NET community. The best way to learn how to use Cecil is to dive into the [Cecil.Samples](https://github.com/jbevain/cecil.samples) repository. It's a growing collection of samples with the goal of showing how to get things done using Cecil, as IL manipulation can sometime get tricky. Read about the Cecil development on the [development log](http://cecil.pe). To discuss Cecil, the best place is the [mono-cecil](https://groups.google.com/group/mono-cecil) Google Group. Cecil is a project under the benevolent umbrella of the [.NET Foundation](http://www.dotnetfoundation.org/). [![Build status](https://ci.appveyor.com/api/projects/status/fmhutmhidy1fahl4?svg=true)](https://ci.appveyor.com/project/jbevain/cecil)
Cecil ===== Mono.Cecil is a library to generate and inspect programs and libraries in the ECMA CIL form. To put it simply, you can use Cecil to: * Analyze .NET binaries using a simple and powerful object model, without having to load assemblies to use Reflection. * Modify .NET binaries, add new metadata structures and alter the IL code. Cecil has been around since 2004 and is [widely used](https://github.com/jbevain/cecil/wiki/Users) in the .NET community. The best way to learn how to use Cecil is to dive into the [Cecil.Samples](https://github.com/jbevain/cecil.samples) repository. It's a growing collection of samples with the goal of showing how to get things done using Cecil, as IL manipulation can sometime get tricky. + Read about the Cecil development on the [development log](http://cecil.pe). + + To discuss Cecil, the best place is the [mono-cecil](https://groups.google.com/group/mono-cecil) Google Group. + Cecil is a project under the benevolent umbrella of the [.NET Foundation](http://www.dotnetfoundation.org/). - To discuss Cecil, the best place is the [mono-cecil](https://groups.google.com/group/mono-cecil) google group. - [![Build status](https://ci.appveyor.com/api/projects/status/fmhutmhidy1fahl4?svg=true)](https://ci.appveyor.com/project/jbevain/cecil)
6
0.315789
4
2
a528d6b800144f46e2ec1be111323496b6d906bc
lib/manage_engine/app_manager/api/version11.rb
lib/manage_engine/app_manager/api/version11.rb
module ManageEngine module AppManager module Api class Version11 attr_reader :connect_path def connect_path "/AppManager/xml/ListDashboards?apikey=%{api_key}" end def connect_response_valid?(response) doc = Nokogiri::XML response status = doc.xpath("/AppManager-response/result/response") return (!status[0].nil? and status[0].attr("response-code") == "4000") end end end end end
module ManageEngine module AppManager module Api class Version11 attr_reader :connect_path ########################### # URL Response Methods ########################### def connect_path "/AppManager/xml/ListDashboards?apikey=%{api_key}" end def host_path "/AppManager/xml/ListServer?apikey=%{api_key}&type=%{type}" end ########################### # Processing Methods ########################### def connect_response_valid?(response) doc = Nokogiri::XML response status = doc.xpath("/AppManager-response/result/response") return (!status[0].nil? and status[0].attr("response-code") == "4000") end def hosts(response) host_list = Hash.new doc = Nokogiri::XML response doc.xpath("/AppManager-response/result/response/Server").each do |server_xml| (host_list[server_xml.attr("Name")] = Array.new).tap do |server_monitors| server_xml.xpath("./Service").each_with_index do |service_xml, i| server_monitors.push service_xml.attr("TYPE") end end end host_list end end end end end
Update Version11 Class for hosts and host_path
Update Version11 Class for hosts and host_path Update the Version11 class to include the hosts method and host_path.
Ruby
mit
jekhokie/manage-engine-app-manager
ruby
## Code Before: module ManageEngine module AppManager module Api class Version11 attr_reader :connect_path def connect_path "/AppManager/xml/ListDashboards?apikey=%{api_key}" end def connect_response_valid?(response) doc = Nokogiri::XML response status = doc.xpath("/AppManager-response/result/response") return (!status[0].nil? and status[0].attr("response-code") == "4000") end end end end end ## Instruction: Update Version11 Class for hosts and host_path Update the Version11 class to include the hosts method and host_path. ## Code After: module ManageEngine module AppManager module Api class Version11 attr_reader :connect_path ########################### # URL Response Methods ########################### def connect_path "/AppManager/xml/ListDashboards?apikey=%{api_key}" end def host_path "/AppManager/xml/ListServer?apikey=%{api_key}&type=%{type}" end ########################### # Processing Methods ########################### def connect_response_valid?(response) doc = Nokogiri::XML response status = doc.xpath("/AppManager-response/result/response") return (!status[0].nil? and status[0].attr("response-code") == "4000") end def hosts(response) host_list = Hash.new doc = Nokogiri::XML response doc.xpath("/AppManager-response/result/response/Server").each do |server_xml| (host_list[server_xml.attr("Name")] = Array.new).tap do |server_monitors| server_xml.xpath("./Service").each_with_index do |service_xml, i| server_monitors.push service_xml.attr("TYPE") end end end host_list end end end end end
module ManageEngine module AppManager module Api class Version11 attr_reader :connect_path + ########################### + # URL Response Methods + ########################### + def connect_path "/AppManager/xml/ListDashboards?apikey=%{api_key}" end + + def host_path + "/AppManager/xml/ListServer?apikey=%{api_key}&type=%{type}" + end + + ########################### + # Processing Methods + ########################### def connect_response_valid?(response) doc = Nokogiri::XML response status = doc.xpath("/AppManager-response/result/response") return (!status[0].nil? and status[0].attr("response-code") == "4000") end + + def hosts(response) + host_list = Hash.new + doc = Nokogiri::XML response + + doc.xpath("/AppManager-response/result/response/Server").each do |server_xml| + (host_list[server_xml.attr("Name")] = Array.new).tap do |server_monitors| + server_xml.xpath("./Service").each_with_index do |service_xml, i| + server_monitors.push service_xml.attr("TYPE") + end + end + end + + host_list + end end end end end
27
1.35
27
0
657c9cd539f474c475aeeea0d90c2342083e46a4
CMakeLists.txt
CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(ninja) # Additional CXX/C Flags SET(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags") SET(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags") SET(cflags "-Wno-deprecated") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT} ${cflags} ${ADDITIONAL_C_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} ${cflags} ${ADDITIONAL_CXX_FLAGS}") CONFIGURE_FILE( src/browse.py ${CMAKE_CURRENT_BINARY_DIR}/src/browse.py COPY) SET(ninja_lib_sources src/build.cc src/build_log.cc src/eval_env.cc src/graph.cc src/parsers.cc src/subprocess.cc src/util.cc src/ninja_jumble.cc ) ADD_LIBRARY(ninjaLib STATIC ${ninja_lib_sources}) ADD_EXECUTABLE(ninja src/ninja.cc) TARGET_LINK_LIBRARIES(ninja ninjaLib)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(ninja) OPTION(BUILD_TESTING "Enable testing" ON) # Additional CXX/C Flags SET(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags") SET(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags") SET(cflags "-Wno-deprecated") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT} ${cflags} ${ADDITIONAL_C_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} ${cflags} ${ADDITIONAL_CXX_FLAGS}") CONFIGURE_FILE( src/browse.py ${CMAKE_CURRENT_BINARY_DIR}/src/browse.py COPY) SET(ninja_lib_sources src/build.cc src/build_log.cc src/eval_env.cc src/graph.cc src/parsers.cc src/subprocess.cc src/util.cc src/ninja_jumble.cc ) ADD_LIBRARY(ninjaLib STATIC ${ninja_lib_sources}) ADD_EXECUTABLE(ninja src/ninja.cc) TARGET_LINK_LIBRARIES(ninja ninjaLib) IF(BUILD_TESTING) ENABLE_TESTING() INCLUDE(CTest) MARK_AS_ADVANCED(DART_TESTING_TIMEOUT) CONFIGURE_FILE( README ${CMAKE_CURRENT_BINARY_DIR}/README COPY) ADD_TEST(LongSlowBuild ninja -f ${CMAKE_CURRENT_SOURCE_DIR}/misc/long-slow-build.ninja all) ENDIF()
Add BUILD_TESTING option and add "LongSlowBuild" test
Add BUILD_TESTING option and add "LongSlowBuild" test
Text
apache-2.0
jcfr/ninja,jcfr/ninja,jcfr/ninja,jcfr/ninja
text
## Code Before: CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(ninja) # Additional CXX/C Flags SET(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags") SET(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags") SET(cflags "-Wno-deprecated") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT} ${cflags} ${ADDITIONAL_C_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} ${cflags} ${ADDITIONAL_CXX_FLAGS}") CONFIGURE_FILE( src/browse.py ${CMAKE_CURRENT_BINARY_DIR}/src/browse.py COPY) SET(ninja_lib_sources src/build.cc src/build_log.cc src/eval_env.cc src/graph.cc src/parsers.cc src/subprocess.cc src/util.cc src/ninja_jumble.cc ) ADD_LIBRARY(ninjaLib STATIC ${ninja_lib_sources}) ADD_EXECUTABLE(ninja src/ninja.cc) TARGET_LINK_LIBRARIES(ninja ninjaLib) ## Instruction: Add BUILD_TESTING option and add "LongSlowBuild" test ## Code After: CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(ninja) OPTION(BUILD_TESTING "Enable testing" ON) # Additional CXX/C Flags SET(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags") SET(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags") SET(cflags "-Wno-deprecated") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT} ${cflags} ${ADDITIONAL_C_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} ${cflags} ${ADDITIONAL_CXX_FLAGS}") CONFIGURE_FILE( src/browse.py ${CMAKE_CURRENT_BINARY_DIR}/src/browse.py COPY) SET(ninja_lib_sources src/build.cc src/build_log.cc src/eval_env.cc src/graph.cc src/parsers.cc src/subprocess.cc src/util.cc src/ninja_jumble.cc ) ADD_LIBRARY(ninjaLib STATIC ${ninja_lib_sources}) ADD_EXECUTABLE(ninja src/ninja.cc) TARGET_LINK_LIBRARIES(ninja ninjaLib) IF(BUILD_TESTING) ENABLE_TESTING() INCLUDE(CTest) MARK_AS_ADVANCED(DART_TESTING_TIMEOUT) CONFIGURE_FILE( README ${CMAKE_CURRENT_BINARY_DIR}/README COPY) ADD_TEST(LongSlowBuild ninja -f ${CMAKE_CURRENT_SOURCE_DIR}/misc/long-slow-build.ninja all) ENDIF()
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(ninja) + + OPTION(BUILD_TESTING "Enable testing" ON) # Additional CXX/C Flags SET(ADDITIONAL_C_FLAGS "" CACHE STRING "Additional C Flags") SET(ADDITIONAL_CXX_FLAGS "" CACHE STRING "Additional CXX Flags") SET(cflags "-Wno-deprecated") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT} ${cflags} ${ADDITIONAL_C_FLAGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT} ${cflags} ${ADDITIONAL_CXX_FLAGS}") CONFIGURE_FILE( src/browse.py ${CMAKE_CURRENT_BINARY_DIR}/src/browse.py COPY) SET(ninja_lib_sources src/build.cc src/build_log.cc src/eval_env.cc src/graph.cc src/parsers.cc src/subprocess.cc src/util.cc src/ninja_jumble.cc ) ADD_LIBRARY(ninjaLib STATIC ${ninja_lib_sources}) ADD_EXECUTABLE(ninja src/ninja.cc) TARGET_LINK_LIBRARIES(ninja ninjaLib) + IF(BUILD_TESTING) + ENABLE_TESTING() + INCLUDE(CTest) + MARK_AS_ADVANCED(DART_TESTING_TIMEOUT) + CONFIGURE_FILE( + README + ${CMAKE_CURRENT_BINARY_DIR}/README COPY) + ADD_TEST(LongSlowBuild ninja -f ${CMAKE_CURRENT_SOURCE_DIR}/misc/long-slow-build.ninja all) + ENDIF() +
12
0.363636
12
0
30bf3804322184808a6ec29a73d49f13db6fdaf7
begin/package.json
begin/package.json
{ "private": true, "devDependencies": { "gulp": "^3.8.8" }, "dependencies": { "babel-core": "^6.3.26", "babel-plugin-transform-runtime": "^6.3.13", "babel-preset-es2015": "^6.3.13", "babel-runtime": "^5.8.34", "bootstrap-sass": "^3.0.0", "laravel-elixir": "^4.0.0", "laravel-elixir-vueify": "^1.0.1", "vue": "^1.0.13", "vue-hot-reload-api": "^1.2.2", "vue-resource": "^0.5.1", "vue-router": "^0.7.7", "vueify": "^8.0.0", "vueify-insert-css": "^1.0.0" } }
{ "private": true, "devDependencies": { "gulp": "^3.8.8" }, "dependencies": { "babel-core": "^6.3.26", "babel-plugin-transform-runtime": "^6.3.13", "babel-preset-es2015": "^6.3.13", "babel-runtime": "^5.8.34", "blueimp-md5": "^2.1.0", "bootstrap-sass": "^3.0.0", "ladda": "^0.9.8", "laravel-elixir": "^4.0.0", "laravel-elixir-vueify": "^1.0.1", "vue": "^1.0.13", "vue-hot-reload-api": "^1.2.2", "vue-resource": "^0.5.1", "vue-router": "^0.7.7", "vueify": "^8.0.0", "vueify-insert-css": "^1.0.0" } }
Use the facade ability in the application
Use the facade ability in the application
JSON
mit
rajabishek/begin,rajabishek/begin,rajabishek/begin
json
## Code Before: { "private": true, "devDependencies": { "gulp": "^3.8.8" }, "dependencies": { "babel-core": "^6.3.26", "babel-plugin-transform-runtime": "^6.3.13", "babel-preset-es2015": "^6.3.13", "babel-runtime": "^5.8.34", "bootstrap-sass": "^3.0.0", "laravel-elixir": "^4.0.0", "laravel-elixir-vueify": "^1.0.1", "vue": "^1.0.13", "vue-hot-reload-api": "^1.2.2", "vue-resource": "^0.5.1", "vue-router": "^0.7.7", "vueify": "^8.0.0", "vueify-insert-css": "^1.0.0" } } ## Instruction: Use the facade ability in the application ## Code After: { "private": true, "devDependencies": { "gulp": "^3.8.8" }, "dependencies": { "babel-core": "^6.3.26", "babel-plugin-transform-runtime": "^6.3.13", "babel-preset-es2015": "^6.3.13", "babel-runtime": "^5.8.34", "blueimp-md5": "^2.1.0", "bootstrap-sass": "^3.0.0", "ladda": "^0.9.8", "laravel-elixir": "^4.0.0", "laravel-elixir-vueify": "^1.0.1", "vue": "^1.0.13", "vue-hot-reload-api": "^1.2.2", "vue-resource": "^0.5.1", "vue-router": "^0.7.7", "vueify": "^8.0.0", "vueify-insert-css": "^1.0.0" } }
{ "private": true, "devDependencies": { "gulp": "^3.8.8" }, "dependencies": { "babel-core": "^6.3.26", "babel-plugin-transform-runtime": "^6.3.13", "babel-preset-es2015": "^6.3.13", "babel-runtime": "^5.8.34", + "blueimp-md5": "^2.1.0", "bootstrap-sass": "^3.0.0", + "ladda": "^0.9.8", "laravel-elixir": "^4.0.0", "laravel-elixir-vueify": "^1.0.1", "vue": "^1.0.13", "vue-hot-reload-api": "^1.2.2", "vue-resource": "^0.5.1", "vue-router": "^0.7.7", "vueify": "^8.0.0", "vueify-insert-css": "^1.0.0" } }
2
0.095238
2
0
55ae2b505cb2b9d58544cb535e6645a3ec764316
mobile-tap-targets.html
mobile-tap-targets.html
<!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css"> <title>Andres Castillo</title> <meta name="viewport" content="width=device-width, initial-scale=invalid-value, unknown-property=1"> <h2>Andres Castillo Ormaechea</h2> <h3>Developer<span style="color:black"> |</span> Athlete <span style="color:black"> |</span> Musician <span style="color:black"> |</span> Agile Enthusiast</h3> </head> <body> <div class="row1"> <h1>Mobile Tap Targets Analysis</h1> <p>Here is a very small button:</p> <button type="button"></button> <p>Here is a very small link:</p> <a href="#">.</a> </div> <div class="row2"> <h1>Mobile Tap Targets Analysis</h1> <p>Here is another very small button:</p> <button type="button"></button> <p>Here is another very small link:</p> <a href="#">.</a> </div> </body> </html>
<!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css"> <title>Andres Castillo</title> <meta name="viewport" content="width=device-width, initial-scale=invalid-value, unknown-property=1"> <style> .triangle-up { width: 0; height: 0; border-left: 25px solid transparent; border-right: 25px solid transparent; border-bottom: 50px solid #555; } </style> <h2>Andres Castillo Ormaechea</h2> <h3>Developer<span style="color:black"> |</span> Athlete <span style="color:black"> |</span> Musician <span style="color:black"> |</span> Agile Enthusiast</h3> </head> <body> <!-- <div class="row1"> --> <h1>Mobile Tap Targets Analysis</h1> <p>Here is a very small button:</p> <button type="button" class="triangle-up"></button> <p>Here is a very small link:</p> <a href="#">.</a> <!-- </div> --> <div class="row2"> <h1>Mobile Tap Targets Analysis</h1> <p>Here is another very small button:</p> <button type="button"></button> <button type="button"></button> <p>Here is another very small link:</p> <a href="#">.</a> </div> </body> </html>
Add buttons and links close to eachother
Add buttons and links close to eachother
HTML
mit
ormaechea/ormaechea.github.io
html
## Code Before: <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css"> <title>Andres Castillo</title> <meta name="viewport" content="width=device-width, initial-scale=invalid-value, unknown-property=1"> <h2>Andres Castillo Ormaechea</h2> <h3>Developer<span style="color:black"> |</span> Athlete <span style="color:black"> |</span> Musician <span style="color:black"> |</span> Agile Enthusiast</h3> </head> <body> <div class="row1"> <h1>Mobile Tap Targets Analysis</h1> <p>Here is a very small button:</p> <button type="button"></button> <p>Here is a very small link:</p> <a href="#">.</a> </div> <div class="row2"> <h1>Mobile Tap Targets Analysis</h1> <p>Here is another very small button:</p> <button type="button"></button> <p>Here is another very small link:</p> <a href="#">.</a> </div> </body> </html> ## Instruction: Add buttons and links close to eachother ## Code After: <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css"> <title>Andres Castillo</title> <meta name="viewport" content="width=device-width, initial-scale=invalid-value, unknown-property=1"> <style> .triangle-up { width: 0; height: 0; border-left: 25px solid transparent; border-right: 25px solid transparent; border-bottom: 50px solid #555; } </style> <h2>Andres Castillo Ormaechea</h2> <h3>Developer<span style="color:black"> |</span> Athlete <span style="color:black"> |</span> Musician <span style="color:black"> |</span> Agile Enthusiast</h3> </head> <body> <!-- <div class="row1"> --> <h1>Mobile Tap Targets Analysis</h1> <p>Here is a very small button:</p> <button type="button" class="triangle-up"></button> <p>Here is a very small link:</p> <a href="#">.</a> <!-- </div> --> <div class="row2"> <h1>Mobile Tap Targets Analysis</h1> <p>Here is another very small button:</p> <button type="button"></button> <button type="button"></button> <p>Here is another very small link:</p> <a href="#">.</a> </div> </body> </html>
<!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css"> <title>Andres Castillo</title> <meta name="viewport" content="width=device-width, initial-scale=invalid-value, unknown-property=1"> + <style> + .triangle-up { + width: 0; + height: 0; + border-left: 25px solid transparent; + border-right: 25px solid transparent; + border-bottom: 50px solid #555; + } + </style> <h2>Andres Castillo Ormaechea</h2> <h3>Developer<span style="color:black"> |</span> Athlete <span style="color:black"> |</span> Musician <span style="color:black"> |</span> Agile Enthusiast</h3> </head> <body> - <div class="row1"> + <!-- <div class="row1"> --> ? +++++ ++++ <h1>Mobile Tap Targets Analysis</h1> <p>Here is a very small button:</p> - <button type="button"></button> + <button type="button" class="triangle-up"></button> ? ++++++++++++++++++++ <p>Here is a very small link:</p> <a href="#">.</a> - </div> + <!-- </div> --> <div class="row2"> <h1>Mobile Tap Targets Analysis</h1> <p>Here is another very small button:</p> + <button type="button"></button> <button type="button"></button> <p>Here is another very small link:</p> <a href="#">.</a> </div> </body> </html>
16
0.571429
13
3
09e1d2ff59bdbb66944c1235d130b77900eb7918
snap/snapcraft.yaml
snap/snapcraft.yaml
name: geocoder # you probably want to 'snapcraft register <name>' version: '1.23.2' # just for humans, typically '1.2+git' or '1.3.2' summary: Geocoder is a simple and consistent geocoding library. description: | Simple and consistent geocoding library written in Python. Many online providers such as Google & Bing have geocoding services, these providers do not include Python libraries and have different JSON responses between each other. grade: stable # must be 'stable' to release into candidate/stable channels confinement: strict # use 'strict' once you have the right plugs and slots apps: geocoder: command: bin/geocode parts: geocoder: # See 'snapcraft plugins' plugin: python python-version: python2
name: geocoder # you probably want to 'snapcraft register <name>' version: '1.23.2' # just for humans, typically '1.2+git' or '1.3.2' summary: Geocoder is a simple and consistent geocoding library. description: | Simple and consistent geocoding library written in Python. Many online providers such as Google & Bing have geocoding services, these providers do not include Python libraries and have different JSON responses between each other. grade: stable # must be 'stable' to release into candidate/stable channels confinement: strict # use 'strict' once you have the right plugs and slots apps: geocoder: command: bin/geocode plugs: [network] parts: geocoder: # See 'snapcraft plugins' plugin: python python-version: python2
Add the network plug to the snap
Add the network plug to the snap In order to make network requests on a strict snap, it is required to declare the plug.
YAML
mit
DenisCarriere/geocoder
yaml
## Code Before: name: geocoder # you probably want to 'snapcraft register <name>' version: '1.23.2' # just for humans, typically '1.2+git' or '1.3.2' summary: Geocoder is a simple and consistent geocoding library. description: | Simple and consistent geocoding library written in Python. Many online providers such as Google & Bing have geocoding services, these providers do not include Python libraries and have different JSON responses between each other. grade: stable # must be 'stable' to release into candidate/stable channels confinement: strict # use 'strict' once you have the right plugs and slots apps: geocoder: command: bin/geocode parts: geocoder: # See 'snapcraft plugins' plugin: python python-version: python2 ## Instruction: Add the network plug to the snap In order to make network requests on a strict snap, it is required to declare the plug. ## Code After: name: geocoder # you probably want to 'snapcraft register <name>' version: '1.23.2' # just for humans, typically '1.2+git' or '1.3.2' summary: Geocoder is a simple and consistent geocoding library. description: | Simple and consistent geocoding library written in Python. Many online providers such as Google & Bing have geocoding services, these providers do not include Python libraries and have different JSON responses between each other. grade: stable # must be 'stable' to release into candidate/stable channels confinement: strict # use 'strict' once you have the right plugs and slots apps: geocoder: command: bin/geocode plugs: [network] parts: geocoder: # See 'snapcraft plugins' plugin: python python-version: python2
name: geocoder # you probably want to 'snapcraft register <name>' version: '1.23.2' # just for humans, typically '1.2+git' or '1.3.2' summary: Geocoder is a simple and consistent geocoding library. description: | Simple and consistent geocoding library written in Python. Many online providers such as Google & Bing have geocoding services, these providers do not include Python libraries and have different JSON responses between each other. grade: stable # must be 'stable' to release into candidate/stable channels confinement: strict # use 'strict' once you have the right plugs and slots apps: geocoder: command: bin/geocode + plugs: [network] parts: geocoder: # See 'snapcraft plugins' plugin: python python-version: python2
1
0.052632
1
0
a0632359d6e6c2a91e98a5261d98a957692e99bd
server/methods/projects.js
server/methods/projects.js
Meteor.methods({ addProject: function(project) { project.createdAt = new Date(); Projects.insert(project); } });
Meteor.methods({ addProject: function(project) { _.extend(project, {createdAt: new Date()}); Projects.insert(project); } });
Use underscore .extend() to add fields instead of being a moron
Use underscore .extend() to add fields instead of being a moron
JavaScript
mit
PUMATeam/puma,PUMATeam/puma
javascript
## Code Before: Meteor.methods({ addProject: function(project) { project.createdAt = new Date(); Projects.insert(project); } }); ## Instruction: Use underscore .extend() to add fields instead of being a moron ## Code After: Meteor.methods({ addProject: function(project) { _.extend(project, {createdAt: new Date()}); Projects.insert(project); } });
Meteor.methods({ addProject: function(project) { - project.createdAt = new Date(); ? ^ ^^ + _.extend(project, {createdAt: new Date()}); ? +++++++++ ^^^ ^ ++ Projects.insert(project); } });
2
0.333333
1
1
b4bf872f784fed5bd56d2abdd5ea1e1339bd2d0a
README.md
README.md
Asp.NET Web API client generator for TypeScript files This tool help you generating the complete client api in typescript to consume an web api made in .net It's generate the interface, class and all types needed. The generate is based on a template mode, wich read the api (.net) and generate the client api in typescript with a template using the razor engine. ## Usage First you need to install the nuget package, you can do it with that command: ``` Install-Package WebApiClientTS ``` Them you need to implement an specific controller in your api to explore your api and generate the client api when you call that. ![](./assets/Controller.png) You need to indicate an **.cshtml** template to the generator, use it like line 21. Now you can run the web api and them acess the controller to generate the typescript client api. ![](./assets/RunCodeGenerator.png) It's done, the typescript client api was generated ![](./assets/TSClientApi.png) Danke [WebApiClientTS on nuget.org](https://www.nuget.org/packages/WebApiClientTS/)
Asp.NET Web API client generator for TypeScript files This tool helps you generating the complete client API in TypeScript to consume a Web API made in .NET . It generates interfaces for all the types exposed by the API and classes to request each controller. The generation is based on the ASP.NET ApiExplorer class. wich defines metadata for all the controllers exposed. This metadata is fed on a template (using the RazorEngine), wich generates the client API files in TypeScript. ## Usage First, you need to install the NuGet package, you can do it with that command: ``` Install-Package WebApiClientTS ``` Them you need to implement a specific controller in your API to explore your API and generate the client API when you call that. ![](./assets/Controller.png) You need to indicate a **.cshtml** template to the generator, use it like line 21. Now you can run the web API and then access the controller to generate the typescript client API. ![](./assets/RunCodeGenerator.png) It's done, the typescript client api was generated ![](./assets/TSClientApi.png) Danke [WebApiClientTS on nuget.org](https://www.nuget.org/packages/WebApiClientTS/)
Fix the introduction section in Readme.md
Fix the introduction section in Readme.md
Markdown
mit
eberlitz/WebApiClientTS,eberlitz/WebApiClientTS,eberlitz/WebApiClientTS
markdown
## Code Before: Asp.NET Web API client generator for TypeScript files This tool help you generating the complete client api in typescript to consume an web api made in .net It's generate the interface, class and all types needed. The generate is based on a template mode, wich read the api (.net) and generate the client api in typescript with a template using the razor engine. ## Usage First you need to install the nuget package, you can do it with that command: ``` Install-Package WebApiClientTS ``` Them you need to implement an specific controller in your api to explore your api and generate the client api when you call that. ![](./assets/Controller.png) You need to indicate an **.cshtml** template to the generator, use it like line 21. Now you can run the web api and them acess the controller to generate the typescript client api. ![](./assets/RunCodeGenerator.png) It's done, the typescript client api was generated ![](./assets/TSClientApi.png) Danke [WebApiClientTS on nuget.org](https://www.nuget.org/packages/WebApiClientTS/) ## Instruction: Fix the introduction section in Readme.md ## Code After: Asp.NET Web API client generator for TypeScript files This tool helps you generating the complete client API in TypeScript to consume a Web API made in .NET . It generates interfaces for all the types exposed by the API and classes to request each controller. The generation is based on the ASP.NET ApiExplorer class. wich defines metadata for all the controllers exposed. This metadata is fed on a template (using the RazorEngine), wich generates the client API files in TypeScript. ## Usage First, you need to install the NuGet package, you can do it with that command: ``` Install-Package WebApiClientTS ``` Them you need to implement a specific controller in your API to explore your API and generate the client API when you call that. ![](./assets/Controller.png) You need to indicate a **.cshtml** template to the generator, use it like line 21. Now you can run the web API and then access the controller to generate the typescript client API. ![](./assets/RunCodeGenerator.png) It's done, the typescript client api was generated ![](./assets/TSClientApi.png) Danke [WebApiClientTS on nuget.org](https://www.nuget.org/packages/WebApiClientTS/)
Asp.NET Web API client generator for TypeScript files + This tool helps you generating the complete client API in TypeScript to consume a Web API made in .NET . It generates interfaces for all the types exposed by the API and classes to request each controller. + + The generation is based on the ASP.NET ApiExplorer class. wich defines metadata for all the controllers exposed. This metadata is fed on a template (using the RazorEngine), wich generates the client API files in TypeScript. - This tool help you generating the complete client api in typescript to consume an web api made in .net - It's generate the interface, class and all types needed. - - The generate is based on a template mode, wich read the api (.net) and generate the client api in typescript with a template using the razor engine. ## Usage - First you need to install the nuget package, you can do it with that command: ? ^ ^ + First, you need to install the NuGet package, you can do it with that command: ? + ^ ^ ``` Install-Package WebApiClientTS ``` - Them you need to implement an specific controller in your api to explore your api and generate the client api when you call that. ? - ^^^ ^^^ ^^^ + Them you need to implement a specific controller in your API to explore your API and generate the client API when you call that. ? ^^^ ^^^ ^^^ ![](./assets/Controller.png) - You need to indicate an **.cshtml** template to the generator, use it like line 21. ? - + You need to indicate a **.cshtml** template to the generator, use it like line 21. - Now you can run the web api and them acess the controller to generate the typescript client api. ? ^^^ ^ ^^^ + Now you can run the web API and then access the controller to generate the typescript client API. ? ^^^ ^ + ^^^ ![](./assets/RunCodeGenerator.png) It's done, the typescript client api was generated ![](./assets/TSClientApi.png) Danke [WebApiClientTS on nuget.org](https://www.nuget.org/packages/WebApiClientTS/)
15
0.535714
7
8
29397c351748ac94bf802ffe52237acb7cccc746
resources/views/users/beatmapset_activities.blade.php
resources/views/users/beatmapset_activities.blade.php
{{-- Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. See the LICENCE file in the repository root for full licence text. --}} @extends('master', [ 'titlePrepend' => $user->username, 'pageDescription' => trans('users.show.page_description', ['username' => $user->username]), ]) @section('content') @if (Auth::user() && Auth::user()->isAdmin() && $user->isRestricted()) @include('objects._notification_banner', [ 'type' => 'warning', 'title' => trans('admin.users.restricted_banner.title'), 'message' => trans('admin.users.restricted_banner.message'), ]) @endif <div class="js-react--modding-profile osu-layout osu-layout--full"></div> @endsection @section ("script") @parent @foreach ($jsonChunks as $name => $data) <script id="json-{{$name}}" type="application/json"> {!! json_encode($data) !!} </script> @endforeach @include('layout._extra_js', ['src' => 'js/react/modding-profile.js']) @endsection
{{-- Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. See the LICENCE file in the repository root for full licence text. --}} @extends('master', [ 'titlePrepend' => blade_safe(str_replace(' ', '&nbsp;', e($user->username))), 'pageDescription' => page_description($user->username), ]) @section('content') @if (Auth::user() && Auth::user()->isAdmin() && $user->isRestricted()) @include('objects._notification_banner', [ 'type' => 'warning', 'title' => trans('admin.users.restricted_banner.title'), 'message' => trans('admin.users.restricted_banner.message'), ]) @endif <div class="js-react--modding-profile osu-layout osu-layout--full"></div> @endsection @section ("script") @parent @foreach ($jsonChunks as $name => $data) <script id="json-{{$name}}" type="application/json"> {!! json_encode($data) !!} </script> @endforeach @include('layout._extra_js', ['src' => 'js/react/modding-profile.js']) @endsection
Fix user modding page title and description
Fix user modding page title and description
PHP
agpl-3.0
nekodex/osu-web,notbakaneko/osu-web,notbakaneko/osu-web,nekodex/osu-web,LiquidPL/osu-web,nanaya/osu-web,nanaya/osu-web,ppy/osu-web,ppy/osu-web,notbakaneko/osu-web,ppy/osu-web,notbakaneko/osu-web,ppy/osu-web,nekodex/osu-web,omkelderman/osu-web,notbakaneko/osu-web,nekodex/osu-web,LiquidPL/osu-web,nanaya/osu-web,omkelderman/osu-web,ppy/osu-web,nekodex/osu-web,nanaya/osu-web,omkelderman/osu-web,nanaya/osu-web,LiquidPL/osu-web,LiquidPL/osu-web,omkelderman/osu-web,LiquidPL/osu-web
php
## Code Before: {{-- Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. See the LICENCE file in the repository root for full licence text. --}} @extends('master', [ 'titlePrepend' => $user->username, 'pageDescription' => trans('users.show.page_description', ['username' => $user->username]), ]) @section('content') @if (Auth::user() && Auth::user()->isAdmin() && $user->isRestricted()) @include('objects._notification_banner', [ 'type' => 'warning', 'title' => trans('admin.users.restricted_banner.title'), 'message' => trans('admin.users.restricted_banner.message'), ]) @endif <div class="js-react--modding-profile osu-layout osu-layout--full"></div> @endsection @section ("script") @parent @foreach ($jsonChunks as $name => $data) <script id="json-{{$name}}" type="application/json"> {!! json_encode($data) !!} </script> @endforeach @include('layout._extra_js', ['src' => 'js/react/modding-profile.js']) @endsection ## Instruction: Fix user modding page title and description ## Code After: {{-- Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. See the LICENCE file in the repository root for full licence text. --}} @extends('master', [ 'titlePrepend' => blade_safe(str_replace(' ', '&nbsp;', e($user->username))), 'pageDescription' => page_description($user->username), ]) @section('content') @if (Auth::user() && Auth::user()->isAdmin() && $user->isRestricted()) @include('objects._notification_banner', [ 'type' => 'warning', 'title' => trans('admin.users.restricted_banner.title'), 'message' => trans('admin.users.restricted_banner.message'), ]) @endif <div class="js-react--modding-profile osu-layout osu-layout--full"></div> @endsection @section ("script") @parent @foreach ($jsonChunks as $name => $data) <script id="json-{{$name}}" type="application/json"> {!! json_encode($data) !!} </script> @endforeach @include('layout._extra_js', ['src' => 'js/react/modding-profile.js']) @endsection
{{-- Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0. See the LICENCE file in the repository root for full licence text. --}} @extends('master', [ - 'titlePrepend' => $user->username, + 'titlePrepend' => blade_safe(str_replace(' ', '&nbsp;', e($user->username))), - 'pageDescription' => trans('users.show.page_description', ['username' => $user->username]), ? ------------------ ^^^^^^^^^^^^^^^^^^ - + 'pageDescription' => page_description($user->username), ? ^ ]) @section('content') @if (Auth::user() && Auth::user()->isAdmin() && $user->isRestricted()) @include('objects._notification_banner', [ 'type' => 'warning', 'title' => trans('admin.users.restricted_banner.title'), 'message' => trans('admin.users.restricted_banner.message'), ]) @endif <div class="js-react--modding-profile osu-layout osu-layout--full"></div> @endsection @section ("script") @parent @foreach ($jsonChunks as $name => $data) <script id="json-{{$name}}" type="application/json"> {!! json_encode($data) !!} </script> @endforeach @include('layout._extra_js', ['src' => 'js/react/modding-profile.js']) @endsection
4
0.125
2
2
d3291512db02304c0948992436817d36f86046fd
stdlib/public/SDK/simd/CMakeLists.txt
stdlib/public/SDK/simd/CMakeLists.txt
add_swift_library(swiftsimd SHARED IS_STDLIB simd.swift.gyb SWIFT_COMPILE_FLAGS -Xfrontend -sil-serialize-all SWIFT_MODULE_DEPENDS Darwin INSTALL_IN_COMPONENT stdlib)
add_swift_library(swiftsimd IS_SDK_OVERLAY simd.swift.gyb SWIFT_COMPILE_FLAGS -Xfrontend -sil-serialize-all SWIFT_MODULE_DEPENDS Darwin)
Make the 'simd' module build like the rest of the overlays.
Make the 'simd' module build like the rest of the overlays. At one point we were considering it to be a replacement rather than an overlay, but that's not where we are today. We can revisit that later. Necessary for next commit. Swift SVN r29438
Text
apache-2.0
airspeedswift/swift,djwbrown/swift,apple/swift,hughbe/swift,hughbe/swift,xedin/swift,IngmarStein/swift,calebd/swift,tinysun212/swift-windows,JaSpa/swift,tardieu/swift,glessard/swift,emilstahl/swift,kentya6/swift,aschwaighofer/swift,arvedviehweger/swift,gregomni/swift,tjw/swift,return/swift,bitjammer/swift,jmgc/swift,arvedviehweger/swift,modocache/swift,gottesmm/swift,SwiftAndroid/swift,gmilos/swift,devincoughlin/swift,austinzheng/swift,russbishop/swift,gribozavr/swift,natecook1000/swift,atrick/swift,kusl/swift,natecook1000/swift,shajrawi/swift,alblue/swift,modocache/swift,jtbandes/swift,apple/swift,manavgabhawala/swift,JaSpa/swift,jopamer/swift,tinysun212/swift-windows,hooman/swift,jtbandes/swift,return/swift,aschwaighofer/swift,harlanhaskins/swift,KrishMunot/swift,codestergit/swift,khizkhiz/swift,jtbandes/swift,natecook1000/swift,xedin/swift,benlangmuir/swift,milseman/swift,felix91gr/swift,frootloops/swift,bitjammer/swift,karwa/swift,swiftix/swift,shajrawi/swift,shajrawi/swift,jopamer/swift,milseman/swift,atrick/swift,sschiau/swift,jckarter/swift,gmilos/swift,aschwaighofer/swift,swiftix/swift.old,mightydeveloper/swift,ben-ng/swift,JaSpa/swift,xwu/swift,gottesmm/swift,gottesmm/swift,therealbnut/swift,xwu/swift,djwbrown/swift,alblue/swift,xwu/swift,OscarSwanros/swift,cbrentharris/swift,SwiftAndroid/swift,OscarSwanros/swift,kusl/swift,gribozavr/swift,zisko/swift,amraboelela/swift,austinzheng/swift,stephentyrone/swift,milseman/swift,JaSpa/swift,benlangmuir/swift,emilstahl/swift,mightydeveloper/swift,KrishMunot/swift,uasys/swift,kperryua/swift,arvedviehweger/swift,tardieu/swift,Ivacker/swift,ken0nek/swift,bitjammer/swift,airspeedswift/swift,airspeedswift/swift,zisko/swift,slavapestov/swift,xwu/swift,KrishMunot/swift,frootloops/swift,sdulal/swift,benlangmuir/swift,codestergit/swift,lorentey/swift,stephentyrone/swift,djwbrown/swift,rudkx/swift,calebd/swift,parkera/swift,MukeshKumarS/Swift,swiftix/swift,alblue/swift,bitjammer/swift,tjw/swift,KrishMunot/swift,airspeedswift/swift,frootloops/swift,kperryua/swift,CodaFi/swift,russbishop/swift,zisko/swift,sdulal/swift,cbrentharris/swift,practicalswift/swift,dduan/swift,nathawes/swift,atrick/swift,calebd/swift,therealbnut/swift,johnno1962d/swift,gregomni/swift,devincoughlin/swift,practicalswift/swift,allevato/swift,alblue/swift,dduan/swift,JGiola/swift,jckarter/swift,modocache/swift,gottesmm/swift,shahmishal/swift,karwa/swift,benlangmuir/swift,cbrentharris/swift,kusl/swift,adrfer/swift,djwbrown/swift,uasys/swift,xwu/swift,nathawes/swift,jmgc/swift,MukeshKumarS/Swift,ken0nek/swift,jmgc/swift,gmilos/swift,kentya6/swift,xwu/swift,jopamer/swift,dduan/swift,amraboelela/swift,aschwaighofer/swift,adrfer/swift,devincoughlin/swift,russbishop/swift,natecook1000/swift,MukeshKumarS/Swift,shahmishal/swift,JGiola/swift,lorentey/swift,jmgc/swift,alblue/swift,hughbe/swift,atrick/swift,manavgabhawala/swift,Jnosh/swift,swiftix/swift.old,bitjammer/swift,nathawes/swift,gmilos/swift,therealbnut/swift,russbishop/swift,milseman/swift,modocache/swift,xedin/swift,sdulal/swift,gmilos/swift,xedin/swift,return/swift,Ivacker/swift,kstaring/swift,sdulal/swift,adrfer/swift,Jnosh/swift,JGiola/swift,danielmartin/swift,codestergit/swift,johnno1962d/swift,therealbnut/swift,johnno1962d/swift,ken0nek/swift,codestergit/swift,amraboelela/swift,CodaFi/swift,glessard/swift,felix91gr/swift,calebd/swift,practicalswift/swift,gregomni/swift,emilstahl/swift,adrfer/swift,roambotics/swift,kentya6/swift,tkremenek/swift,tkremenek/swift,jckarter/swift,return/swift,roambotics/swift,shajrawi/swift,arvedviehweger/swift,sdulal/swift,glessard/swift,sdulal/swift,slavapestov/swift,danielmartin/swift,codestergit/swift,glessard/swift,zisko/swift,parkera/swift,aschwaighofer/swift,manavgabhawala/swift,deyton/swift,tjw/swift,tjw/swift,kusl/swift,nathawes/swift,MukeshKumarS/Swift,milseman/swift,return/swift,tardieu/swift,shahmishal/swift,tardieu/swift,LeoShimonaka/swift,airspeedswift/swift,austinzheng/swift,johnno1962d/swift,felix91gr/swift,IngmarStein/swift,parkera/swift,tardieu/swift,kusl/swift,stephentyrone/swift,huonw/swift,devincoughlin/swift,amraboelela/swift,danielmartin/swift,jopamer/swift,OscarSwanros/swift,MukeshKumarS/Swift,felix91gr/swift,codestergit/swift,stephentyrone/swift,practicalswift/swift,mightydeveloper/swift,jckarter/swift,sschiau/swift,kentya6/swift,LeoShimonaka/swift,dduan/swift,djwbrown/swift,slavapestov/swift,gribozavr/swift,roambotics/swift,SwiftAndroid/swift,sdulal/swift,amraboelela/swift,kstaring/swift,therealbnut/swift,slavapestov/swift,uasys/swift,slavapestov/swift,airspeedswift/swift,milseman/swift,IngmarStein/swift,shajrawi/swift,dduan/swift,allevato/swift,tinysun212/swift-windows,karwa/swift,sschiau/swift,jckarter/swift,kstaring/swift,adrfer/swift,ken0nek/swift,mightydeveloper/swift,apple/swift,cbrentharris/swift,rudkx/swift,ahoppen/swift,karwa/swift,austinzheng/swift,sschiau/swift,SwiftAndroid/swift,gregomni/swift,Jnosh/swift,devincoughlin/swift,parkera/swift,xedin/swift,gottesmm/swift,SwiftAndroid/swift,jopamer/swift,codestergit/swift,ben-ng/swift,ben-ng/swift,lorentey/swift,IngmarStein/swift,kperryua/swift,bitjammer/swift,gribozavr/swift,xedin/swift,johnno1962d/swift,shahmishal/swift,ken0nek/swift,therealbnut/swift,mightydeveloper/swift,natecook1000/swift,gottesmm/swift,russbishop/swift,IngmarStein/swift,tinysun212/swift-windows,allevato/swift,OscarSwanros/swift,harlanhaskins/swift,benlangmuir/swift,shajrawi/swift,swiftix/swift.old,MukeshKumarS/Swift,kentya6/swift,aschwaighofer/swift,swiftix/swift.old,jtbandes/swift,huonw/swift,practicalswift/swift,huonw/swift,harlanhaskins/swift,deyton/swift,sschiau/swift,shajrawi/swift,rudkx/swift,tjw/swift,lorentey/swift,khizkhiz/swift,cbrentharris/swift,ben-ng/swift,SwiftAndroid/swift,emilstahl/swift,hooman/swift,practicalswift/swift,swiftix/swift,SwiftAndroid/swift,stephentyrone/swift,emilstahl/swift,gregomni/swift,LeoShimonaka/swift,practicalswift/swift,stephentyrone/swift,uasys/swift,jtbandes/swift,khizkhiz/swift,airspeedswift/swift,harlanhaskins/swift,russbishop/swift,deyton/swift,djwbrown/swift,mightydeveloper/swift,kusl/swift,Ivacker/swift,lorentey/swift,CodaFi/swift,deyton/swift,shajrawi/swift,deyton/swift,arvedviehweger/swift,danielmartin/swift,tardieu/swift,khizkhiz/swift,kusl/swift,amraboelela/swift,kusl/swift,sdulal/swift,ken0nek/swift,parkera/swift,jopamer/swift,devincoughlin/swift,xedin/swift,KrishMunot/swift,IngmarStein/swift,dreamsxin/swift,rudkx/swift,cbrentharris/swift,JaSpa/swift,arvedviehweger/swift,emilstahl/swift,ahoppen/swift,ahoppen/swift,adrfer/swift,glessard/swift,cbrentharris/swift,dduan/swift,djwbrown/swift,cbrentharris/swift,LeoShimonaka/swift,sschiau/swift,brentdax/swift,tkremenek/swift,swiftix/swift,return/swift,jckarter/swift,hughbe/swift,tinysun212/swift-windows,OscarSwanros/swift,shahmishal/swift,huonw/swift,harlanhaskins/swift,KrishMunot/swift,gmilos/swift,brentdax/swift,frootloops/swift,calebd/swift,kstaring/swift,xedin/swift,nathawes/swift,MukeshKumarS/Swift,ben-ng/swift,practicalswift/swift,parkera/swift,kentya6/swift,huonw/swift,ken0nek/swift,nathawes/swift,CodaFi/swift,ben-ng/swift,OscarSwanros/swift,danielmartin/swift,emilstahl/swift,LeoShimonaka/swift,brentdax/swift,shahmishal/swift,therealbnut/swift,apple/swift,jtbandes/swift,dduan/swift,Jnosh/swift,swiftix/swift,Ivacker/swift,devincoughlin/swift,ahoppen/swift,Ivacker/swift,lorentey/swift,benlangmuir/swift,sschiau/swift,danielmartin/swift,CodaFi/swift,felix91gr/swift,roambotics/swift,kperryua/swift,IngmarStein/swift,KrishMunot/swift,apple/swift,swiftix/swift.old,deyton/swift,jmgc/swift,calebd/swift,alblue/swift,shahmishal/swift,JGiola/swift,Jnosh/swift,JGiola/swift,LeoShimonaka/swift,CodaFi/swift,lorentey/swift,gribozavr/swift,rudkx/swift,tjw/swift,atrick/swift,jmgc/swift,natecook1000/swift,calebd/swift,brentdax/swift,return/swift,danielmartin/swift,gribozavr/swift,frootloops/swift,zisko/swift,khizkhiz/swift,khizkhiz/swift,austinzheng/swift,kstaring/swift,uasys/swift,huonw/swift,tkremenek/swift,dreamsxin/swift,ben-ng/swift,gottesmm/swift,devincoughlin/swift,mightydeveloper/swift,parkera/swift,johnno1962d/swift,hughbe/swift,tinysun212/swift-windows,hooman/swift,tinysun212/swift-windows,zisko/swift,harlanhaskins/swift,tkremenek/swift,kstaring/swift,manavgabhawala/swift,alblue/swift,manavgabhawala/swift,harlanhaskins/swift,Jnosh/swift,xwu/swift,Jnosh/swift,gmilos/swift,mightydeveloper/swift,allevato/swift,hughbe/swift,Ivacker/swift,sschiau/swift,brentdax/swift,hooman/swift,swiftix/swift.old,JaSpa/swift,kentya6/swift,austinzheng/swift,uasys/swift,modocache/swift,karwa/swift,karwa/swift,zisko/swift,roambotics/swift,milseman/swift,amraboelela/swift,huonw/swift,lorentey/swift,deyton/swift,felix91gr/swift,kentya6/swift,khizkhiz/swift,allevato/swift,JGiola/swift,johnno1962d/swift,hooman/swift,natecook1000/swift,LeoShimonaka/swift,tardieu/swift,jtbandes/swift,apple/swift,karwa/swift,ahoppen/swift,swiftix/swift.old,Ivacker/swift,brentdax/swift,tjw/swift,Ivacker/swift,modocache/swift,allevato/swift,jckarter/swift,roambotics/swift,felix91gr/swift,gribozavr/swift,nathawes/swift,hughbe/swift,hooman/swift,swiftix/swift,brentdax/swift,shahmishal/swift,kstaring/swift,ahoppen/swift,kperryua/swift,tkremenek/swift,gribozavr/swift,adrfer/swift,frootloops/swift,kperryua/swift,modocache/swift,allevato/swift,JaSpa/swift,stephentyrone/swift,hooman/swift,aschwaighofer/swift,swiftix/swift,rudkx/swift,glessard/swift,karwa/swift,gregomni/swift,swiftix/swift.old,uasys/swift,LeoShimonaka/swift,kperryua/swift,manavgabhawala/swift,bitjammer/swift,jopamer/swift,russbishop/swift,CodaFi/swift,manavgabhawala/swift,arvedviehweger/swift,OscarSwanros/swift,frootloops/swift,austinzheng/swift,parkera/swift,slavapestov/swift,jmgc/swift,slavapestov/swift,emilstahl/swift,tkremenek/swift,atrick/swift
text
## Code Before: add_swift_library(swiftsimd SHARED IS_STDLIB simd.swift.gyb SWIFT_COMPILE_FLAGS -Xfrontend -sil-serialize-all SWIFT_MODULE_DEPENDS Darwin INSTALL_IN_COMPONENT stdlib) ## Instruction: Make the 'simd' module build like the rest of the overlays. At one point we were considering it to be a replacement rather than an overlay, but that's not where we are today. We can revisit that later. Necessary for next commit. Swift SVN r29438 ## Code After: add_swift_library(swiftsimd IS_SDK_OVERLAY simd.swift.gyb SWIFT_COMPILE_FLAGS -Xfrontend -sil-serialize-all SWIFT_MODULE_DEPENDS Darwin)
- add_swift_library(swiftsimd SHARED IS_STDLIB ? ------- - ^^ + add_swift_library(swiftsimd IS_SDK_OVERLAY ? ++++++ ^^ simd.swift.gyb SWIFT_COMPILE_FLAGS -Xfrontend -sil-serialize-all - SWIFT_MODULE_DEPENDS Darwin + SWIFT_MODULE_DEPENDS Darwin) ? + - INSTALL_IN_COMPONENT stdlib)
5
0.833333
2
3
a4709d4d9b8d50a2c2bd3b3af1a9005e739d8a21
src/de/gurkenlabs/litiengine/graphics/PositionLockCamera.java
src/de/gurkenlabs/litiengine/graphics/PositionLockCamera.java
package de.gurkenlabs.litiengine.graphics; import java.awt.geom.Point2D; import de.gurkenlabs.litiengine.Game; import de.gurkenlabs.litiengine.entities.IEntity; import de.gurkenlabs.litiengine.graphics.animation.IAnimationController; /** * The Class LocalPlayerCamera. */ public class PositionLockCamera extends Camera { private final IEntity entity; public PositionLockCamera(final IEntity entity) { super(); this.entity = entity; this.updateFocus(); } public IEntity getLockedEntity() { return this.entity; } @Override public Point2D getViewPortLocation(final IEntity entity) { if (entity == null) { return null; } // always render the local player at the same location otherwise the // localplayer camera causes flickering and bouncing of the sprite final IAnimationController animationController = Game.getEntityControllerManager().getAnimationController(entity); if (entity.equals(this.getLockedEntity()) && animationController != null && animationController.getCurrentAnimation() != null && animationController.getCurrentAnimation().getSpritesheet() != null) { final Spritesheet spriteSheet = animationController.getCurrentAnimation().getSpritesheet(); final Point2D location = new Point2D.Double(this.getFocus().getX() - entity.getWidth() / 2 - (spriteSheet.getSpriteWidth() - entity.getWidth()) * 0.5, this.getFocus().getY() - entity.getHeight() / 2 - (spriteSheet.getSpriteHeight() - entity.getHeight()) * 0.5); return this.getViewPortLocation(location); } return super.getViewPortLocation(entity); } @Override public void updateFocus() { final Point2D cameraLocation = this.getLockedCameraLocation(); this.setFocus(new Point2D.Double(cameraLocation.getX(), cameraLocation.getY())); super.updateFocus(); } protected Point2D getLockedCameraLocation() { return this.getLockedEntity().getDimensionCenter(); } }
package de.gurkenlabs.litiengine.graphics; import java.awt.geom.Point2D; import de.gurkenlabs.litiengine.entities.IEntity; /** * The Class LocalPlayerCamera. */ public class PositionLockCamera extends Camera { private final IEntity entity; public PositionLockCamera(final IEntity entity) { super(); this.entity = entity; this.updateFocus(); } public IEntity getLockedEntity() { return this.entity; } @Override public void updateFocus() { final Point2D cameraLocation = this.getLockedCameraLocation(); this.setFocus(new Point2D.Double(cameraLocation.getX(), cameraLocation.getY())); super.updateFocus(); } protected Point2D getLockedCameraLocation() { return this.getLockedEntity().getDimensionCenter(); } }
Remove the additional handling for the focused entity because this was only a result of the the gameloop having a lower updaterate than the renderloop which causes flickering because the position of entities is not updates as often as it is rendered.
Remove the additional handling for the focused entity because this was only a result of the the gameloop having a lower updaterate than the renderloop which causes flickering because the position of entities is not updates as often as it is rendered.
Java
mit
gurkenlabs/litiengine,gurkenlabs/litiengine
java
## Code Before: package de.gurkenlabs.litiengine.graphics; import java.awt.geom.Point2D; import de.gurkenlabs.litiengine.Game; import de.gurkenlabs.litiengine.entities.IEntity; import de.gurkenlabs.litiengine.graphics.animation.IAnimationController; /** * The Class LocalPlayerCamera. */ public class PositionLockCamera extends Camera { private final IEntity entity; public PositionLockCamera(final IEntity entity) { super(); this.entity = entity; this.updateFocus(); } public IEntity getLockedEntity() { return this.entity; } @Override public Point2D getViewPortLocation(final IEntity entity) { if (entity == null) { return null; } // always render the local player at the same location otherwise the // localplayer camera causes flickering and bouncing of the sprite final IAnimationController animationController = Game.getEntityControllerManager().getAnimationController(entity); if (entity.equals(this.getLockedEntity()) && animationController != null && animationController.getCurrentAnimation() != null && animationController.getCurrentAnimation().getSpritesheet() != null) { final Spritesheet spriteSheet = animationController.getCurrentAnimation().getSpritesheet(); final Point2D location = new Point2D.Double(this.getFocus().getX() - entity.getWidth() / 2 - (spriteSheet.getSpriteWidth() - entity.getWidth()) * 0.5, this.getFocus().getY() - entity.getHeight() / 2 - (spriteSheet.getSpriteHeight() - entity.getHeight()) * 0.5); return this.getViewPortLocation(location); } return super.getViewPortLocation(entity); } @Override public void updateFocus() { final Point2D cameraLocation = this.getLockedCameraLocation(); this.setFocus(new Point2D.Double(cameraLocation.getX(), cameraLocation.getY())); super.updateFocus(); } protected Point2D getLockedCameraLocation() { return this.getLockedEntity().getDimensionCenter(); } } ## Instruction: Remove the additional handling for the focused entity because this was only a result of the the gameloop having a lower updaterate than the renderloop which causes flickering because the position of entities is not updates as often as it is rendered. ## Code After: package de.gurkenlabs.litiengine.graphics; import java.awt.geom.Point2D; import de.gurkenlabs.litiengine.entities.IEntity; /** * The Class LocalPlayerCamera. */ public class PositionLockCamera extends Camera { private final IEntity entity; public PositionLockCamera(final IEntity entity) { super(); this.entity = entity; this.updateFocus(); } public IEntity getLockedEntity() { return this.entity; } @Override public void updateFocus() { final Point2D cameraLocation = this.getLockedCameraLocation(); this.setFocus(new Point2D.Double(cameraLocation.getX(), cameraLocation.getY())); super.updateFocus(); } protected Point2D getLockedCameraLocation() { return this.getLockedEntity().getDimensionCenter(); } }
package de.gurkenlabs.litiengine.graphics; import java.awt.geom.Point2D; - import de.gurkenlabs.litiengine.Game; import de.gurkenlabs.litiengine.entities.IEntity; - import de.gurkenlabs.litiengine.graphics.animation.IAnimationController; /** * The Class LocalPlayerCamera. */ public class PositionLockCamera extends Camera { private final IEntity entity; public PositionLockCamera(final IEntity entity) { super(); this.entity = entity; this.updateFocus(); } public IEntity getLockedEntity() { return this.entity; } @Override - public Point2D getViewPortLocation(final IEntity entity) { - if (entity == null) { - return null; - } - - // always render the local player at the same location otherwise the - // localplayer camera causes flickering and bouncing of the sprite - final IAnimationController animationController = Game.getEntityControllerManager().getAnimationController(entity); - if (entity.equals(this.getLockedEntity()) && animationController != null && animationController.getCurrentAnimation() != null && animationController.getCurrentAnimation().getSpritesheet() != null) { - final Spritesheet spriteSheet = animationController.getCurrentAnimation().getSpritesheet(); - final Point2D location = new Point2D.Double(this.getFocus().getX() - entity.getWidth() / 2 - (spriteSheet.getSpriteWidth() - entity.getWidth()) * 0.5, this.getFocus().getY() - entity.getHeight() / 2 - (spriteSheet.getSpriteHeight() - entity.getHeight()) * 0.5); - return this.getViewPortLocation(location); - } - - return super.getViewPortLocation(entity); - } - - @Override public void updateFocus() { final Point2D cameraLocation = this.getLockedCameraLocation(); this.setFocus(new Point2D.Double(cameraLocation.getX(), cameraLocation.getY())); super.updateFocus(); } protected Point2D getLockedCameraLocation() { return this.getLockedEntity().getDimensionCenter(); } }
20
0.37037
0
20
be856e1f4afaf0e7171aa8edc1b12ab09aa2f24a
README.md
README.md
kramer-python-control ===================== Simple python-based [Kramer 8x8](http://www.kramerelectronics.com/products/model.asp?pid=387) (and alike) Computer Graphics Video Matrix Switcher; more of a PoC as of now with autoswitch capability, but simple enough to get started. ### Basic protocol syntax Messages use 4 bytes: [INSTRUCTION][INPUT][OUTPUT][MACHINE_NUMBER] For instance, msg = 0x01818081, (\x01\x81\x80\x81) will switch all outputs to input #1. Full protocol documentation can be found [here](http://www.kramerelectronics.com/downloads/protocols/protocol_2000_rev0_51.pdf)
kramer-python-control ===================== Simple python-based [Kramer 8x8](http://www.kramerelectronics.com/products/model.asp?pid=387) (and alike) Computer Graphics Video Matrix Switcher (the protocol is called "Protocol 2000"); more of a PoC as of now with autoswitch capability, but simple enough to get started. ### Basic protocol syntax Messages use 4 bytes: [INSTRUCTION][INPUT][OUTPUT][MACHINE_NUMBER] For instance, msg = 0x01818081, (\x01\x81\x80\x81) will switch all outputs to input #1. Full protocol documentation can be found [here](http://www.kramerelectronics.com/downloads/protocols/protocol_2000_rev0_51.pdf) Default ip address is 192.168.1.39, and port is 5000 ### Kramer tools For quicker message determination, you can use kramer's [Protocol 2000 Calculator](http://www.kramerelectronics.com/support/download.asp?f=35567) (windows only)
Add links to kramer helper tools
Add links to kramer helper tools
Markdown
unlicense
UbiCastTeam/kramer-python-control
markdown
## Code Before: kramer-python-control ===================== Simple python-based [Kramer 8x8](http://www.kramerelectronics.com/products/model.asp?pid=387) (and alike) Computer Graphics Video Matrix Switcher; more of a PoC as of now with autoswitch capability, but simple enough to get started. ### Basic protocol syntax Messages use 4 bytes: [INSTRUCTION][INPUT][OUTPUT][MACHINE_NUMBER] For instance, msg = 0x01818081, (\x01\x81\x80\x81) will switch all outputs to input #1. Full protocol documentation can be found [here](http://www.kramerelectronics.com/downloads/protocols/protocol_2000_rev0_51.pdf) ## Instruction: Add links to kramer helper tools ## Code After: kramer-python-control ===================== Simple python-based [Kramer 8x8](http://www.kramerelectronics.com/products/model.asp?pid=387) (and alike) Computer Graphics Video Matrix Switcher (the protocol is called "Protocol 2000"); more of a PoC as of now with autoswitch capability, but simple enough to get started. ### Basic protocol syntax Messages use 4 bytes: [INSTRUCTION][INPUT][OUTPUT][MACHINE_NUMBER] For instance, msg = 0x01818081, (\x01\x81\x80\x81) will switch all outputs to input #1. Full protocol documentation can be found [here](http://www.kramerelectronics.com/downloads/protocols/protocol_2000_rev0_51.pdf) Default ip address is 192.168.1.39, and port is 5000 ### Kramer tools For quicker message determination, you can use kramer's [Protocol 2000 Calculator](http://www.kramerelectronics.com/support/download.asp?f=35567) (windows only)
kramer-python-control ===================== - Simple python-based [Kramer 8x8](http://www.kramerelectronics.com/products/model.asp?pid=387) (and alike) Computer Graphics Video Matrix Switcher; more of a PoC as of now with autoswitch capability, but simple enough to get started. + Simple python-based [Kramer 8x8](http://www.kramerelectronics.com/products/model.asp?pid=387) (and alike) Computer Graphics Video Matrix Switcher (the protocol is called "Protocol 2000"); more of a PoC as of now with autoswitch capability, but simple enough to get started. ? +++++++++++++++++++++++++++++++++++++++++ ### Basic protocol syntax Messages use 4 bytes: [INSTRUCTION][INPUT][OUTPUT][MACHINE_NUMBER] For instance, msg = 0x01818081, (\x01\x81\x80\x81) will switch all outputs to input #1. - Full protocol documentation can be found [here](http://www.kramerelectronics.com/downloads/protocols/protocol_2000_rev0_51.pdf) + Full protocol documentation can be found [here](http://www.kramerelectronics.com/downloads/protocols/protocol_2000_rev0_51.pdf) ? ++ + + Default ip address is 192.168.1.39, and port is 5000 + + ### Kramer tools + For quicker message determination, you can use kramer's [Protocol 2000 Calculator](http://www.kramerelectronics.com/support/download.asp?f=35567) (windows only)
9
0.9
7
2
6d113c9716e9c1f629e13d777396a81544e22ad7
include/automations/lighting.yaml
include/automations/lighting.yaml
- alias: Turn On Living Dusk Devices trigger: - platform: event event_type: button_pressed event_data: entity_id: switch.living_wallswitch_left state: 'on' action: - service: light.turn_on entity_id: group.dusk_living_lights - service: logbook.log data: name: Schemerverlichting message: ingeschakeld - alias: Turn Off Living Devices trigger: - platform: event event_type: button_pressed event_data: entity_id: switch.living_wallswitch_left state: 'off' action: - service: light.turn_off entity_id: group.living_lights - service: logbook.log data: name: Woonkamerverlichting message: uitgeschakeld
- alias: Turn On Living Lights trigger: - platform: event event_type: button_pressed event_data: entity_id: switch.living_wallswitch_left state: 'on' action: - service: light.turn_on entity_id: group.living_lights - service: logbook.log data: name: Woonkamerverlichting message: ingeschakeld - alias: Turn Off Living Lights trigger: - platform: event event_type: button_pressed event_data: entity_id: switch.living_wallswitch_left state: 'off' action: - service: light.turn_off entity_id: group.living_lights - service: logbook.log data: name: Woonkamerverlichting message: uitgeschakeld
Change from switching dusk to all lights
Change from switching dusk to all lights
YAML
mit
rtvb/home-assistant-config
yaml
## Code Before: - alias: Turn On Living Dusk Devices trigger: - platform: event event_type: button_pressed event_data: entity_id: switch.living_wallswitch_left state: 'on' action: - service: light.turn_on entity_id: group.dusk_living_lights - service: logbook.log data: name: Schemerverlichting message: ingeschakeld - alias: Turn Off Living Devices trigger: - platform: event event_type: button_pressed event_data: entity_id: switch.living_wallswitch_left state: 'off' action: - service: light.turn_off entity_id: group.living_lights - service: logbook.log data: name: Woonkamerverlichting message: uitgeschakeld ## Instruction: Change from switching dusk to all lights ## Code After: - alias: Turn On Living Lights trigger: - platform: event event_type: button_pressed event_data: entity_id: switch.living_wallswitch_left state: 'on' action: - service: light.turn_on entity_id: group.living_lights - service: logbook.log data: name: Woonkamerverlichting message: ingeschakeld - alias: Turn Off Living Lights trigger: - platform: event event_type: button_pressed event_data: entity_id: switch.living_wallswitch_left state: 'off' action: - service: light.turn_off entity_id: group.living_lights - service: logbook.log data: name: Woonkamerverlichting message: uitgeschakeld
- - alias: Turn On Living Dusk Devices ? ^^ --------- + - alias: Turn On Living Lights ? ^^^^^ trigger: - platform: event event_type: button_pressed event_data: entity_id: switch.living_wallswitch_left state: 'on' action: - service: light.turn_on - entity_id: group.dusk_living_lights ? ----- + entity_id: group.living_lights - service: logbook.log data: - name: Schemerverlichting ? ^^^^ + name: Woonkamerverlichting ? ^^^^^^ message: ingeschakeld - - alias: Turn Off Living Devices ? ^^^ ^^ + - alias: Turn Off Living Lights ? ^ ^^^ trigger: - platform: event event_type: button_pressed event_data: entity_id: switch.living_wallswitch_left state: 'off' action: - service: light.turn_off entity_id: group.living_lights - service: logbook.log data: name: Woonkamerverlichting message: uitgeschakeld
8
0.275862
4
4
89b463c5ce29e89bfcf444de9a8d73bc1ad78fc8
omop_harvest/migrations/0003_avocado_metadata_migration.py
omop_harvest/migrations/0003_avocado_metadata_migration.py
from south.v2 import DataMigration class Migration(DataMigration): def forwards(self, orm): "Perform a 'safe' load using Avocado's backup utilities." from avocado.core import backup backup.safe_load(u'0001_avocado_metadata', backup_path=None, using='default') def backwards(self, orm): "No backwards migration applicable." pass
from south.v2 import DataMigration class Migration(DataMigration): depends_on = ( ("avocado", "0031_auto__add_field_dataquery_tree__add_field_datacontext_tree"), ) def forwards(self, orm): "Perform a 'safe' load using Avocado's backup utilities." from avocado.core import backup backup.safe_load(u'0001_avocado_metadata', backup_path=None, using='default') def backwards(self, orm): "No backwards migration applicable." pass
Add avocado dependency to metadata migration.
Add avocado dependency to metadata migration. Signed-off-by: Aaron Browne <a437ff1f67cf5e38cd2f6119addad5bba3897ae0@gmail.com>
Python
bsd-2-clause
chop-dbhi/omop_harvest,chop-dbhi/omop_harvest,chop-dbhi/omop_harvest
python
## Code Before: from south.v2 import DataMigration class Migration(DataMigration): def forwards(self, orm): "Perform a 'safe' load using Avocado's backup utilities." from avocado.core import backup backup.safe_load(u'0001_avocado_metadata', backup_path=None, using='default') def backwards(self, orm): "No backwards migration applicable." pass ## Instruction: Add avocado dependency to metadata migration. Signed-off-by: Aaron Browne <a437ff1f67cf5e38cd2f6119addad5bba3897ae0@gmail.com> ## Code After: from south.v2 import DataMigration class Migration(DataMigration): depends_on = ( ("avocado", "0031_auto__add_field_dataquery_tree__add_field_datacontext_tree"), ) def forwards(self, orm): "Perform a 'safe' load using Avocado's backup utilities." from avocado.core import backup backup.safe_load(u'0001_avocado_metadata', backup_path=None, using='default') def backwards(self, orm): "No backwards migration applicable." pass
from south.v2 import DataMigration class Migration(DataMigration): + + depends_on = ( + ("avocado", "0031_auto__add_field_dataquery_tree__add_field_datacontext_tree"), + ) def forwards(self, orm): "Perform a 'safe' load using Avocado's backup utilities." from avocado.core import backup backup.safe_load(u'0001_avocado_metadata', backup_path=None, using='default') def backwards(self, orm): "No backwards migration applicable." pass
4
0.307692
4
0
6744ad7a6fec39bde2f002736439f25417416dd6
client/app/bundles/HelloWorld/components/accounts/new/new_teacher.jsx
client/app/bundles/HelloWorld/components/accounts/new/new_teacher.jsx
'use strict'; import React from 'react' import BasicTeacherInfo from './basic_teacher_info' import EducatorType from './educator_type' import AnalyticsWrapper from '../../shared/analytics_wrapper' export default React.createClass({ propTypes: { signUp: React.PropTypes.func.isRequired, errors: React.PropTypes.object, stage: React.PropTypes.number.isRequired, update: React.PropTypes.func.isRequired, textInputGenerator: React.PropTypes.object.isRequired }, render: function () { if (this.props.stage === 1) { return ( <BasicTeacherInfo textInputGenerator={this.props.textInputGenerator} signUp={this.props.signUp} update={this.props.update}/> ) } else if (this.props.stage === 2) { return ( <EducatorType analytics={new AnalyticsWrapper()}/> ) } } });
'use strict'; import React from 'react' import BasicTeacherInfo from './basic_teacher_info' import EducatorType from './educator_type' import AnalyticsWrapper from '../../shared/analytics_wrapper' export default React.createClass({ propTypes: { signUp: React.PropTypes.func.isRequired, errors: React.PropTypes.object, stage: React.PropTypes.number.isRequired, update: React.PropTypes.func.isRequired, textInputGenerator: React.PropTypes.object.isRequired, sendNewsletter: React.PropTypes.bool }, render: function () { if (this.props.stage === 1) { return ( <BasicTeacherInfo textInputGenerator={this.props.textInputGenerator} signUp={this.props.signUp} update={this.props.update} sendNewsletter={this.props.sendNewsletter} /> ) } else if (this.props.stage === 2) { return ( <EducatorType analytics={new AnalyticsWrapper()}/> ) } } });
Fix newsletter checkbox default state on signup form for teachers
Fix newsletter checkbox default state on signup form for teachers
JSX
agpl-3.0
empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core,empirical-org/Empirical-Core
jsx
## Code Before: 'use strict'; import React from 'react' import BasicTeacherInfo from './basic_teacher_info' import EducatorType from './educator_type' import AnalyticsWrapper from '../../shared/analytics_wrapper' export default React.createClass({ propTypes: { signUp: React.PropTypes.func.isRequired, errors: React.PropTypes.object, stage: React.PropTypes.number.isRequired, update: React.PropTypes.func.isRequired, textInputGenerator: React.PropTypes.object.isRequired }, render: function () { if (this.props.stage === 1) { return ( <BasicTeacherInfo textInputGenerator={this.props.textInputGenerator} signUp={this.props.signUp} update={this.props.update}/> ) } else if (this.props.stage === 2) { return ( <EducatorType analytics={new AnalyticsWrapper()}/> ) } } }); ## Instruction: Fix newsletter checkbox default state on signup form for teachers ## Code After: 'use strict'; import React from 'react' import BasicTeacherInfo from './basic_teacher_info' import EducatorType from './educator_type' import AnalyticsWrapper from '../../shared/analytics_wrapper' export default React.createClass({ propTypes: { signUp: React.PropTypes.func.isRequired, errors: React.PropTypes.object, stage: React.PropTypes.number.isRequired, update: React.PropTypes.func.isRequired, textInputGenerator: React.PropTypes.object.isRequired, sendNewsletter: React.PropTypes.bool }, render: function () { if (this.props.stage === 1) { return ( <BasicTeacherInfo textInputGenerator={this.props.textInputGenerator} signUp={this.props.signUp} update={this.props.update} sendNewsletter={this.props.sendNewsletter} /> ) } else if (this.props.stage === 2) { return ( <EducatorType analytics={new AnalyticsWrapper()}/> ) } } });
'use strict'; import React from 'react' import BasicTeacherInfo from './basic_teacher_info' import EducatorType from './educator_type' import AnalyticsWrapper from '../../shared/analytics_wrapper' export default React.createClass({ propTypes: { signUp: React.PropTypes.func.isRequired, errors: React.PropTypes.object, stage: React.PropTypes.number.isRequired, update: React.PropTypes.func.isRequired, - textInputGenerator: React.PropTypes.object.isRequired + textInputGenerator: React.PropTypes.object.isRequired, ? + + sendNewsletter: React.PropTypes.bool }, render: function () { if (this.props.stage === 1) { return ( - <BasicTeacherInfo textInputGenerator={this.props.textInputGenerator} signUp={this.props.signUp} update={this.props.update}/> + <BasicTeacherInfo textInputGenerator={this.props.textInputGenerator} signUp={this.props.signUp} update={this.props.update} sendNewsletter={this.props.sendNewsletter} /> ? ++++++++++++++++++++++++++++++++++++++++++++ ) } else if (this.props.stage === 2) { return ( <EducatorType analytics={new AnalyticsWrapper()}/> ) } } });
5
0.172414
3
2
765939fc174dce23c47b689f4bdc3d7c9f4a86c8
test/model/record.js
test/model/record.js
/*globals describe, it*/ var Record = require('../../lib/model/record'), Rx = require('rx'); require('should'); describe('Record', function () { describe('#has(key)', function () { var r = new Record({ foo: 'foo' }); it('should return true if record has the property', function () { r.has('foo').should.be.true; }); it('should return false if record does not have the property', function () { r.has('bar').should.be.false; }); }); describe('#get([key]', function () { var r = new Record({ foo: 'foo', bar: 'bar' }); it('should return an Observable', function () { r.get('foo').should.be.instanceOf(Rx.Observable); r.get('baz').should.be.instanceOf(Rx.Observable); // r.get().should.be.instanceOf(Rx.Observable); }); }); });
/*globals describe, it*/ var Record = require('../../lib/model/record'), Rx = require('../../lib/util/rx'); require('should'); describe('Record', function () { describe('#has(key)', function () { var r = new Record({ foo: 'foo' }); it('should return true if record has the property', function () { r.has('foo').should.be.true; }); it('should return false if record does not have the property', function () { r.has('bar').should.be.false; }); }); describe('#get([key]', function () { var r = new Record({ foo: 'foo', bar: 'bar' }); it('should return an Observable', function () { r.get('foo').should.be.instanceOf(Rx.Observable); r.get('baz').should.be.instanceOf(Rx.Observable); // r.get().should.be.instanceOf(Rx.Observable); }); }); });
Update Rx require to point to local utility version
Update Rx require to point to local utility version
JavaScript
mit
jhamlet/rpg-kit
javascript
## Code Before: /*globals describe, it*/ var Record = require('../../lib/model/record'), Rx = require('rx'); require('should'); describe('Record', function () { describe('#has(key)', function () { var r = new Record({ foo: 'foo' }); it('should return true if record has the property', function () { r.has('foo').should.be.true; }); it('should return false if record does not have the property', function () { r.has('bar').should.be.false; }); }); describe('#get([key]', function () { var r = new Record({ foo: 'foo', bar: 'bar' }); it('should return an Observable', function () { r.get('foo').should.be.instanceOf(Rx.Observable); r.get('baz').should.be.instanceOf(Rx.Observable); // r.get().should.be.instanceOf(Rx.Observable); }); }); }); ## Instruction: Update Rx require to point to local utility version ## Code After: /*globals describe, it*/ var Record = require('../../lib/model/record'), Rx = require('../../lib/util/rx'); require('should'); describe('Record', function () { describe('#has(key)', function () { var r = new Record({ foo: 'foo' }); it('should return true if record has the property', function () { r.has('foo').should.be.true; }); it('should return false if record does not have the property', function () { r.has('bar').should.be.false; }); }); describe('#get([key]', function () { var r = new Record({ foo: 'foo', bar: 'bar' }); it('should return an Observable', function () { r.get('foo').should.be.instanceOf(Rx.Observable); r.get('baz').should.be.instanceOf(Rx.Observable); // r.get().should.be.instanceOf(Rx.Observable); }); }); });
/*globals describe, it*/ var Record = require('../../lib/model/record'), - Rx = require('rx'); + Rx = require('../../lib/util/rx'); ? +++++++++++++++ require('should'); describe('Record', function () { describe('#has(key)', function () { var r = new Record({ foo: 'foo' }); it('should return true if record has the property', function () { r.has('foo').should.be.true; }); it('should return false if record does not have the property', function () { r.has('bar').should.be.false; }); }); describe('#get([key]', function () { var r = new Record({ foo: 'foo', bar: 'bar' }); it('should return an Observable', function () { r.get('foo').should.be.instanceOf(Rx.Observable); r.get('baz').should.be.instanceOf(Rx.Observable); // r.get().should.be.instanceOf(Rx.Observable); }); }); });
2
0.068966
1
1
a62bdd5fe37c39327a49fae8f1f94280789b9a84
php-classes/Jarvus/Sencha/Framework/Touch.php
php-classes/Jarvus/Sencha/Framework/Touch.php
<?php namespace Jarvus\Sencha\Framework; class Touch extends \Jarvus\Sencha\Framework { }
<?php namespace Jarvus\Sencha\Framework; class Touch extends \Jarvus\Sencha\Framework { public function getDownloadUrl() { return parent::getDownloadUrl() ?: preg_replace('/^(\\d+\\.\\d+\\.\\d+)(\\.\\d*)?$/', 'http://cdn.sencha.com/touch/gpl/sencha-touch-$1-gpl.zip', $this->version); } }
Add download URL for touch
Add download URL for touch
PHP
mit
JarvusInnovations/emergence-sencha,JarvusInnovations/emergence-sencha
php
## Code Before: <?php namespace Jarvus\Sencha\Framework; class Touch extends \Jarvus\Sencha\Framework { } ## Instruction: Add download URL for touch ## Code After: <?php namespace Jarvus\Sencha\Framework; class Touch extends \Jarvus\Sencha\Framework { public function getDownloadUrl() { return parent::getDownloadUrl() ?: preg_replace('/^(\\d+\\.\\d+\\.\\d+)(\\.\\d*)?$/', 'http://cdn.sencha.com/touch/gpl/sencha-touch-$1-gpl.zip', $this->version); } }
<?php namespace Jarvus\Sencha\Framework; class Touch extends \Jarvus\Sencha\Framework { - + public function getDownloadUrl() + { + return parent::getDownloadUrl() ?: preg_replace('/^(\\d+\\.\\d+\\.\\d+)(\\.\\d*)?$/', 'http://cdn.sencha.com/touch/gpl/sencha-touch-$1-gpl.zip', $this->version); + } }
5
0.625
4
1
0b80b573049b771f551b2fa47e570d849cd14ea4
packages/syft/src/syft/core/node/common/node_manager/node_route_manager.py
packages/syft/src/syft/core/node/common/node_manager/node_route_manager.py
from sqlalchemy.engine import Engine # relative from ..node_table.node_route import NodeRoute from .database_manager import DatabaseManager class NodeRouteManager(DatabaseManager): schema = NodeRoute def __init__(self, database: Engine) -> None: super().__init__(schema=NodeRouteManager.schema, db=database) def update_route_for_node( self, node_id: int, host_or_ip: str, is_vpn: bool = False ) -> NodeRoute: # node_id is a database int id # host_or_ip can have a port as well node_route = self.first(host_or_ip=host_or_ip) if node_route: self.modify( query={"host_or_ip": host_or_ip}, values={"is_vpn": is_vpn, "node_id": node_id}, ) else: self.register( **{"node_id": node_id, "host_or_ip": host_or_ip, "is_vpn": is_vpn} ) node_route = self.first(host_or_ip=host_or_ip) return node_route
from sqlalchemy.engine import Engine # relative from ..node_table.node_route import NodeRoute from .database_manager import DatabaseManager class NodeRouteManager(DatabaseManager): schema = NodeRoute def __init__(self, database: Engine) -> None: super().__init__(schema=NodeRouteManager.schema, db=database) def update_route_for_node( self, node_id: int, host_or_ip: str, is_vpn: bool = False, vpn_endpoint: str = "", vpn_key: str = "", ) -> NodeRoute: # node_id is a database int id # host_or_ip can have a port as well node_route = self.first(host_or_ip=host_or_ip) values = {"is_vpn": is_vpn, "node_id": node_id, "host_or_ip": host_or_ip} # Only change optional columns if parameters aren't empty strings. if vpn_endpoint: values["vpn_endpoint"] = vpn_endpoint if vpn_key: values["vpn_key"] = vpn_key if node_route: self.modify( query={"host_or_ip": host_or_ip}, values=values, ) else: values["node_id"] = node_id self.register(**values) node_route = self.first(host_or_ip=host_or_ip) return node_route
UPDATE update_route_for_node method to accept new parameters (vpn_endpoint/vpn_key)
UPDATE update_route_for_node method to accept new parameters (vpn_endpoint/vpn_key)
Python
apache-2.0
OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft
python
## Code Before: from sqlalchemy.engine import Engine # relative from ..node_table.node_route import NodeRoute from .database_manager import DatabaseManager class NodeRouteManager(DatabaseManager): schema = NodeRoute def __init__(self, database: Engine) -> None: super().__init__(schema=NodeRouteManager.schema, db=database) def update_route_for_node( self, node_id: int, host_or_ip: str, is_vpn: bool = False ) -> NodeRoute: # node_id is a database int id # host_or_ip can have a port as well node_route = self.first(host_or_ip=host_or_ip) if node_route: self.modify( query={"host_or_ip": host_or_ip}, values={"is_vpn": is_vpn, "node_id": node_id}, ) else: self.register( **{"node_id": node_id, "host_or_ip": host_or_ip, "is_vpn": is_vpn} ) node_route = self.first(host_or_ip=host_or_ip) return node_route ## Instruction: UPDATE update_route_for_node method to accept new parameters (vpn_endpoint/vpn_key) ## Code After: from sqlalchemy.engine import Engine # relative from ..node_table.node_route import NodeRoute from .database_manager import DatabaseManager class NodeRouteManager(DatabaseManager): schema = NodeRoute def __init__(self, database: Engine) -> None: super().__init__(schema=NodeRouteManager.schema, db=database) def update_route_for_node( self, node_id: int, host_or_ip: str, is_vpn: bool = False, vpn_endpoint: str = "", vpn_key: str = "", ) -> NodeRoute: # node_id is a database int id # host_or_ip can have a port as well node_route = self.first(host_or_ip=host_or_ip) values = {"is_vpn": is_vpn, "node_id": node_id, "host_or_ip": host_or_ip} # Only change optional columns if parameters aren't empty strings. if vpn_endpoint: values["vpn_endpoint"] = vpn_endpoint if vpn_key: values["vpn_key"] = vpn_key if node_route: self.modify( query={"host_or_ip": host_or_ip}, values=values, ) else: values["node_id"] = node_id self.register(**values) node_route = self.first(host_or_ip=host_or_ip) return node_route
from sqlalchemy.engine import Engine # relative from ..node_table.node_route import NodeRoute from .database_manager import DatabaseManager class NodeRouteManager(DatabaseManager): schema = NodeRoute def __init__(self, database: Engine) -> None: super().__init__(schema=NodeRouteManager.schema, db=database) def update_route_for_node( - self, node_id: int, host_or_ip: str, is_vpn: bool = False + self, + node_id: int, + host_or_ip: str, + is_vpn: bool = False, + vpn_endpoint: str = "", + vpn_key: str = "", ) -> NodeRoute: # node_id is a database int id # host_or_ip can have a port as well node_route = self.first(host_or_ip=host_or_ip) + values = {"is_vpn": is_vpn, "node_id": node_id, "host_or_ip": host_or_ip} + + # Only change optional columns if parameters aren't empty strings. + if vpn_endpoint: + values["vpn_endpoint"] = vpn_endpoint + if vpn_key: + values["vpn_key"] = vpn_key + if node_route: self.modify( query={"host_or_ip": host_or_ip}, - values={"is_vpn": is_vpn, "node_id": node_id}, + values=values, ) else: + values["node_id"] = node_id - self.register( + self.register(**values) ? +++++++++ - **{"node_id": node_id, "host_or_ip": host_or_ip, "is_vpn": is_vpn} - ) node_route = self.first(host_or_ip=host_or_ip) return node_route
22
0.709677
17
5
8a5558e989b4c34221d3ceb7ca66e3081e183b3a
README.md
README.md
BeanPurée ========= **BeanPurée** is a middle layer between JavaBeans and [shapeless][shapeless]. [![Build Status](https://travis-ci.org/limansky/beanpuree.svg?branch=master)](https://travis-ci.org/limansky/beanpuree) [shapeless]: http://github.com/milessabin/shapeless
BeanPurée ========= **BeanPurée** is a middle layer between JavaBeans and [shapeless][shapeless]. The library is in very beginning of development and isn't ready for any usage. [![Build Status](https://travis-ci.org/limansky/beanpuree.svg?branch=master)](https://travis-ci.org/limansky/beanpuree) [shapeless]: http://github.com/milessabin/shapeless
Add not ready note to readme.
Add not ready note to readme.
Markdown
apache-2.0
limansky/beanpuree
markdown
## Code Before: BeanPurée ========= **BeanPurée** is a middle layer between JavaBeans and [shapeless][shapeless]. [![Build Status](https://travis-ci.org/limansky/beanpuree.svg?branch=master)](https://travis-ci.org/limansky/beanpuree) [shapeless]: http://github.com/milessabin/shapeless ## Instruction: Add not ready note to readme. ## Code After: BeanPurée ========= **BeanPurée** is a middle layer between JavaBeans and [shapeless][shapeless]. The library is in very beginning of development and isn't ready for any usage. [![Build Status](https://travis-ci.org/limansky/beanpuree.svg?branch=master)](https://travis-ci.org/limansky/beanpuree) [shapeless]: http://github.com/milessabin/shapeless
BeanPurée ========= **BeanPurée** is a middle layer between JavaBeans and [shapeless][shapeless]. + The library is in very beginning of development and isn't ready for any usage. + [![Build Status](https://travis-ci.org/limansky/beanpuree.svg?branch=master)](https://travis-ci.org/limansky/beanpuree) [shapeless]: http://github.com/milessabin/shapeless
2
0.25
2
0
4d2194b91599eb7a1fbe98b76ecb33d809a3285f
about.md
about.md
--- layout: page title: About --- Hi, I'm [Prem Ganeshkumar](mailto:ganeprem at gmail). I'm a Natural Language Processing Engineer at [Agolo](http://agolo.com/) in New York City. Before this, I was a Masters student in Computer Science at [Columbia University](http://www.columbia.edu/), New York City. My concentration was in Natural Language Processing. Previously, I worked on the Social Shopping team at [Amazon.com](http://www.amazon.com/) in Seattle. Specifically, I worked on the [Amazon Wish List](http://amazon.com/wishlist). I did my undergrad at [University of Michigan, Ann Arbor](http://umich.edu/). There, I worked with the [CLAIR research group](http://clairlib.org/) as a research assistant. You can find my old blog [here](http://premgane.wordpress.com) and my Instagram [here](http://instagram.com/premtagram). To prove my identity, this is my [Keybase](https://keybase.io/pgkr).
--- layout: page title: About --- Hi, I'm [Prem Ganeshkumar](mailto:ganeprem at gmail). I'm a Natural Language Processing Engineer at [Agolo](http://agolo.com/) in New York City. Before this, I was a Masters student in Computer Science at [Columbia University](http://www.columbia.edu/), New York City. My concentration was in Natural Language Processing. Previously, I worked on the Social Shopping team at [Amazon.com](http://www.amazon.com/) in Seattle. Specifically, I worked on the [Amazon Wish List](http://amazon.com/wishlist). I did my undergrad at [University of Michigan, Ann Arbor](http://umich.edu/). There, I worked with the [CLAIR research group](http://clairlib.org/) as a research assistant. You can find my old blog [here](http://premgane.wordpress.com) and my Instagram [here](http://instagram.com/premtagram). To prove my identity, this is my [Keybase](https://keybase.io/pgkr). This site uses the [Lanyon](http://lanyon.getpoole.com/) theme.
Add attribution for theme to About.
Add attribution for theme to About.
Markdown
mit
premgane/premgane.github.io,premgane/premgane.github.io,premgane/premgane.github.io
markdown
## Code Before: --- layout: page title: About --- Hi, I'm [Prem Ganeshkumar](mailto:ganeprem at gmail). I'm a Natural Language Processing Engineer at [Agolo](http://agolo.com/) in New York City. Before this, I was a Masters student in Computer Science at [Columbia University](http://www.columbia.edu/), New York City. My concentration was in Natural Language Processing. Previously, I worked on the Social Shopping team at [Amazon.com](http://www.amazon.com/) in Seattle. Specifically, I worked on the [Amazon Wish List](http://amazon.com/wishlist). I did my undergrad at [University of Michigan, Ann Arbor](http://umich.edu/). There, I worked with the [CLAIR research group](http://clairlib.org/) as a research assistant. You can find my old blog [here](http://premgane.wordpress.com) and my Instagram [here](http://instagram.com/premtagram). To prove my identity, this is my [Keybase](https://keybase.io/pgkr). ## Instruction: Add attribution for theme to About. ## Code After: --- layout: page title: About --- Hi, I'm [Prem Ganeshkumar](mailto:ganeprem at gmail). I'm a Natural Language Processing Engineer at [Agolo](http://agolo.com/) in New York City. Before this, I was a Masters student in Computer Science at [Columbia University](http://www.columbia.edu/), New York City. My concentration was in Natural Language Processing. Previously, I worked on the Social Shopping team at [Amazon.com](http://www.amazon.com/) in Seattle. Specifically, I worked on the [Amazon Wish List](http://amazon.com/wishlist). I did my undergrad at [University of Michigan, Ann Arbor](http://umich.edu/). There, I worked with the [CLAIR research group](http://clairlib.org/) as a research assistant. You can find my old blog [here](http://premgane.wordpress.com) and my Instagram [here](http://instagram.com/premtagram). To prove my identity, this is my [Keybase](https://keybase.io/pgkr). This site uses the [Lanyon](http://lanyon.getpoole.com/) theme.
--- layout: page title: About --- Hi, I'm [Prem Ganeshkumar](mailto:ganeprem at gmail). I'm a Natural Language Processing Engineer at [Agolo](http://agolo.com/) in New York City. Before this, I was a Masters student in Computer Science at [Columbia University](http://www.columbia.edu/), New York City. My concentration was in Natural Language Processing. Previously, I worked on the Social Shopping team at [Amazon.com](http://www.amazon.com/) in Seattle. Specifically, I worked on the [Amazon Wish List](http://amazon.com/wishlist). I did my undergrad at [University of Michigan, Ann Arbor](http://umich.edu/). There, I worked with the [CLAIR research group](http://clairlib.org/) as a research assistant. You can find my old blog [here](http://premgane.wordpress.com) and my Instagram [here](http://instagram.com/premtagram). To prove my identity, this is my [Keybase](https://keybase.io/pgkr). + + This site uses the [Lanyon](http://lanyon.getpoole.com/) theme.
2
0.125
2
0
635bbbb07005be82f03f85c48864132670af265a
keymaps/simple-align.cson
keymaps/simple-align.cson
'atom-workspace': 'ctrl-cmd-a': 'simple-align:align'
'.platform-darwin': 'ctrl-cmd-a': 'simple-align:align' '.platform-win32, .platform-linux': 'ctrl-alt-a': 'simple-align:align'
Add keymaps supported by Linux and Windows
Add keymaps supported by Linux and Windows
CoffeeScript
mit
stevenhauser/atom-simple-align
coffeescript
## Code Before: 'atom-workspace': 'ctrl-cmd-a': 'simple-align:align' ## Instruction: Add keymaps supported by Linux and Windows ## Code After: '.platform-darwin': 'ctrl-cmd-a': 'simple-align:align' '.platform-win32, .platform-linux': 'ctrl-alt-a': 'simple-align:align'
- 'atom-workspace': + '.platform-darwin': 'ctrl-cmd-a': 'simple-align:align' + + '.platform-win32, .platform-linux': + 'ctrl-alt-a': 'simple-align:align'
5
2.5
4
1
0f0fb6928ba790cc8aaae72d4cc17735c26990a7
src/services/index.js
src/services/index.js
'use strict'; // const userLessonTokens = require('./user-lesson-tokens'); // const lessons = require('./lessons'); const users = require('./users'); const mongoose = require('mongoose') module.exports = function() { const app = this; mongoose.connect(app.get('mongodb')); mongoose.Promise = global.Promise; app.configure(users); // app.configure(lessons); // app.configure(userLessonTokens); };
'use strict'; const userLessonTokens = require('./user-lesson-tokens'); const lessons = require('./lessons'); const users = require('./users'); const mongoose = require('mongoose'); module.exports = function() { const app = this; mongoose.connect(app.get('mongodb')); mongoose.Promise = global.Promise; app.configure(users); app.configure(lessons); app.configure(userLessonTokens); };
Add lessons and other service
Add lessons and other service
JavaScript
mit
tum-ase-33/rest-server
javascript
## Code Before: 'use strict'; // const userLessonTokens = require('./user-lesson-tokens'); // const lessons = require('./lessons'); const users = require('./users'); const mongoose = require('mongoose') module.exports = function() { const app = this; mongoose.connect(app.get('mongodb')); mongoose.Promise = global.Promise; app.configure(users); // app.configure(lessons); // app.configure(userLessonTokens); }; ## Instruction: Add lessons and other service ## Code After: 'use strict'; const userLessonTokens = require('./user-lesson-tokens'); const lessons = require('./lessons'); const users = require('./users'); const mongoose = require('mongoose'); module.exports = function() { const app = this; mongoose.connect(app.get('mongodb')); mongoose.Promise = global.Promise; app.configure(users); app.configure(lessons); app.configure(userLessonTokens); };
'use strict'; - // const userLessonTokens = require('./user-lesson-tokens'); ? --- + const userLessonTokens = require('./user-lesson-tokens'); - - // const lessons = require('./lessons'); ? --- + const lessons = require('./lessons'); const users = require('./users'); - const mongoose = require('mongoose') + const mongoose = require('mongoose'); ? + module.exports = function() { const app = this; mongoose.connect(app.get('mongodb')); mongoose.Promise = global.Promise; app.configure(users); - // app.configure(lessons); ? --- + app.configure(lessons); - // app.configure(userLessonTokens); ? --- + app.configure(userLessonTokens); };
11
0.55
5
6
f9a2bd05a3cb1bea8f1febbdf3adb4e6bb901787
docs/campaign-pages.md
docs/campaign-pages.md
Collections currently renders the following campaign pages: ## Brexit landing page ([/brexit](https://www.gov.uk/brexit)) All content for the transition landing pages are currently read from yaml files. [Welsh](config/locales/cy/brexit_landing_page.yml) and [English](config/locales/en/brexit_landing_page.yml) translations are available. ## Coronavirus pages: - Landing page ([gov.uk/coronavirus](https://www.gov.uk/coronavirus)) - Hub pages ([/getting-tested-for-coronavirus](https://www.gov.uk/getting-tested-for-coronavirus), [/worker-support](https://www.gov.uk/coronavirus/worker-support), [/business-support](https://www.gov.uk/coronavirus/business-support) and [/education-and-childcare](https://www.gov.uk/coronavirus/education-and-childcare))
Collections currently renders the following campaign pages: ## Brexit landing page ([/brexit](https://www.gov.uk/brexit)) All content for the transition landing pages are currently read from yaml files. [Welsh](config/locales/cy/brexit_landing_page.yml) and [English](config/locales/en/brexit_landing_page.yml) translations are available. ## Coronavirus pages: - Landing page ([gov.uk/coronavirus](https://www.gov.uk/coronavirus))
Remove coronavirus hub pages from campaign docs
Remove coronavirus hub pages from campaign docs We have been given permission to retire the coronavirus hub pages. The links to the hub pages have already been removed and the content in the hubs as already been added to the accordions and the hub pages have been unpublished, so the page rendering code can be removed.
Markdown
mit
alphagov/collections,alphagov/collections,alphagov/collections,alphagov/collections
markdown
## Code Before: Collections currently renders the following campaign pages: ## Brexit landing page ([/brexit](https://www.gov.uk/brexit)) All content for the transition landing pages are currently read from yaml files. [Welsh](config/locales/cy/brexit_landing_page.yml) and [English](config/locales/en/brexit_landing_page.yml) translations are available. ## Coronavirus pages: - Landing page ([gov.uk/coronavirus](https://www.gov.uk/coronavirus)) - Hub pages ([/getting-tested-for-coronavirus](https://www.gov.uk/getting-tested-for-coronavirus), [/worker-support](https://www.gov.uk/coronavirus/worker-support), [/business-support](https://www.gov.uk/coronavirus/business-support) and [/education-and-childcare](https://www.gov.uk/coronavirus/education-and-childcare)) ## Instruction: Remove coronavirus hub pages from campaign docs We have been given permission to retire the coronavirus hub pages. The links to the hub pages have already been removed and the content in the hubs as already been added to the accordions and the hub pages have been unpublished, so the page rendering code can be removed. ## Code After: Collections currently renders the following campaign pages: ## Brexit landing page ([/brexit](https://www.gov.uk/brexit)) All content for the transition landing pages are currently read from yaml files. [Welsh](config/locales/cy/brexit_landing_page.yml) and [English](config/locales/en/brexit_landing_page.yml) translations are available. ## Coronavirus pages: - Landing page ([gov.uk/coronavirus](https://www.gov.uk/coronavirus))
Collections currently renders the following campaign pages: ## Brexit landing page ([/brexit](https://www.gov.uk/brexit)) All content for the transition landing pages are currently read from yaml files. [Welsh](config/locales/cy/brexit_landing_page.yml) and [English](config/locales/en/brexit_landing_page.yml) translations are available. ## Coronavirus pages: - Landing page ([gov.uk/coronavirus](https://www.gov.uk/coronavirus)) - - Hub pages ([/getting-tested-for-coronavirus](https://www.gov.uk/getting-tested-for-coronavirus), [/worker-support](https://www.gov.uk/coronavirus/worker-support), [/business-support](https://www.gov.uk/coronavirus/business-support) and [/education-and-childcare](https://www.gov.uk/coronavirus/education-and-childcare))
1
0.090909
0
1
0e4f2fbdfff3312d2ff80bba32ed19cc5762702b
reload_on_resume.js
reload_on_resume.js
// Hook into the hot-reload to // 1) wait until the application has resumed to reload the app // 2) show the splashscreen while the app is reloading var hasResumed = false; var retryReloadFunc = null; var retryReloadOnResume = function () { // Set resumed to true so _onMigrate performs the reload hasResumed = true; // Show the splashscreen during the reload // it will be hidden when the app starts navigator.splashscreen.show(); // Re-run the onMigrate hooks retryReloadFunc(); }; Reload._onMigrate(function (retryReload) { retryReloadFunc = retryReload; // Prevent duplicate listeners in case _onMigrate is called multiple times document.removeEventListener("resume", retryReloadOnResume, false); if (!hasResumed) { document.addEventListener("resume", retryReloadOnResume, false); } // Reload the app if we have resumed return [hasResumed]; });
// Hook into the hot-reload to // 1) wait until the application has resumed to reload the app // 2) show the splashscreen while the app is reloading var hasResumed = false; var retryReloadFunc = null; var retryReloadOnResume = function () { // Set hasResumed to true so _onMigrate performs the reload hasResumed = true; // Show the splashscreen during the reload // it will hide when the app starts if (navigator.splashscreen) { navigator.splashscreen.show(); } // Re-run the onMigrate hooks retryReloadFunc(); }; Reload._onMigrate(function (retry) { retryReloadFunc = retry; // Prevent duplicate listeners in case _onMigrate is called multiple times document.removeEventListener("resume", retryReloadOnResume, false); if (!hasResumed) { document.addEventListener("resume", retryReloadOnResume, false); } // Reload the app if we resumed return [hasResumed]; });
Add check around splashscreen object
Add check around splashscreen object Minor cleanup. From: https://gist.github.com/jperl/60d02a5d4301c1e29eec
JavaScript
mit
DispatchMe/meteor-reload-on-resume
javascript
## Code Before: // Hook into the hot-reload to // 1) wait until the application has resumed to reload the app // 2) show the splashscreen while the app is reloading var hasResumed = false; var retryReloadFunc = null; var retryReloadOnResume = function () { // Set resumed to true so _onMigrate performs the reload hasResumed = true; // Show the splashscreen during the reload // it will be hidden when the app starts navigator.splashscreen.show(); // Re-run the onMigrate hooks retryReloadFunc(); }; Reload._onMigrate(function (retryReload) { retryReloadFunc = retryReload; // Prevent duplicate listeners in case _onMigrate is called multiple times document.removeEventListener("resume", retryReloadOnResume, false); if (!hasResumed) { document.addEventListener("resume", retryReloadOnResume, false); } // Reload the app if we have resumed return [hasResumed]; }); ## Instruction: Add check around splashscreen object Minor cleanup. From: https://gist.github.com/jperl/60d02a5d4301c1e29eec ## Code After: // Hook into the hot-reload to // 1) wait until the application has resumed to reload the app // 2) show the splashscreen while the app is reloading var hasResumed = false; var retryReloadFunc = null; var retryReloadOnResume = function () { // Set hasResumed to true so _onMigrate performs the reload hasResumed = true; // Show the splashscreen during the reload // it will hide when the app starts if (navigator.splashscreen) { navigator.splashscreen.show(); } // Re-run the onMigrate hooks retryReloadFunc(); }; Reload._onMigrate(function (retry) { retryReloadFunc = retry; // Prevent duplicate listeners in case _onMigrate is called multiple times document.removeEventListener("resume", retryReloadOnResume, false); if (!hasResumed) { document.addEventListener("resume", retryReloadOnResume, false); } // Reload the app if we resumed return [hasResumed]; });
// Hook into the hot-reload to // 1) wait until the application has resumed to reload the app // 2) show the splashscreen while the app is reloading var hasResumed = false; var retryReloadFunc = null; var retryReloadOnResume = function () { - // Set resumed to true so _onMigrate performs the reload ? ^ + // Set hasResumed to true so _onMigrate performs the reload ? ^^^^ hasResumed = true; // Show the splashscreen during the reload - // it will be hidden when the app starts ? --- - - + // it will hide when the app starts + if (navigator.splashscreen) { - navigator.splashscreen.show(); + navigator.splashscreen.show(); ? ++ + } // Re-run the onMigrate hooks retryReloadFunc(); }; - Reload._onMigrate(function (retryReload) { ? ------ + Reload._onMigrate(function (retry) { - retryReloadFunc = retryReload; ? ------ + retryReloadFunc = retry; // Prevent duplicate listeners in case _onMigrate is called multiple times document.removeEventListener("resume", retryReloadOnResume, false); if (!hasResumed) { document.addEventListener("resume", retryReloadOnResume, false); } - // Reload the app if we have resumed ? ----- + // Reload the app if we resumed return [hasResumed]; });
14
0.4375
8
6
b3d6c0b130a1704292bf818c75a456f71a7b2ead
homebrew/install.sh
homebrew/install.sh
if test ! $(which brew) then echo " x You should probably install Homebrew first:" echo " https://github.com/mxcl/homebrew/wiki/installation" exit fi # Install homebrew packages brew install grc coreutils spark ack ctags ffmpeg git mutt siege tidy tmux tofrodos watch wget youtube-dl yuicompressor node exit 0
if test ! $(which brew) then echo " x You should probably install Homebrew first:" echo " https://github.com/mxcl/homebrew/wiki/installation" exit fi # Install homebrew packages brew install grc coreutils spark ack ctags ffmpeg git mutt siege tidy tmux tofrodos watch wget youtube-dl yuicompressor node # Tap Cask, to allow us to install GUI's brew tap phinze/cask # Install Cask brew install brew-cask # Install GUI's brew cask install acorn brew cask install adium brew cask install alfred brew cask install caffeine brew cask install dropbox brew cask install filezilla brew cask install google-chrome brew cask install iterm2 brew cask install mou brew cask install mysql-workbench brew cask install phpstorm brew cask install skype brew cask install sublime-text exit 0
Add brew cask and some apps
Add brew cask and some apps
Shell
mit
caseyw/dotfiles,caseyw/dotfiles
shell
## Code Before: if test ! $(which brew) then echo " x You should probably install Homebrew first:" echo " https://github.com/mxcl/homebrew/wiki/installation" exit fi # Install homebrew packages brew install grc coreutils spark ack ctags ffmpeg git mutt siege tidy tmux tofrodos watch wget youtube-dl yuicompressor node exit 0 ## Instruction: Add brew cask and some apps ## Code After: if test ! $(which brew) then echo " x You should probably install Homebrew first:" echo " https://github.com/mxcl/homebrew/wiki/installation" exit fi # Install homebrew packages brew install grc coreutils spark ack ctags ffmpeg git mutt siege tidy tmux tofrodos watch wget youtube-dl yuicompressor node # Tap Cask, to allow us to install GUI's brew tap phinze/cask # Install Cask brew install brew-cask # Install GUI's brew cask install acorn brew cask install adium brew cask install alfred brew cask install caffeine brew cask install dropbox brew cask install filezilla brew cask install google-chrome brew cask install iterm2 brew cask install mou brew cask install mysql-workbench brew cask install phpstorm brew cask install skype brew cask install sublime-text exit 0
if test ! $(which brew) then echo " x You should probably install Homebrew first:" echo " https://github.com/mxcl/homebrew/wiki/installation" exit fi # Install homebrew packages brew install grc coreutils spark ack ctags ffmpeg git mutt siege tidy tmux tofrodos watch wget youtube-dl yuicompressor node + # Tap Cask, to allow us to install GUI's + brew tap phinze/cask + + # Install Cask + brew install brew-cask + + # Install GUI's + brew cask install acorn + brew cask install adium + brew cask install alfred + brew cask install caffeine + brew cask install dropbox + brew cask install filezilla + brew cask install google-chrome + brew cask install iterm2 + brew cask install mou + brew cask install mysql-workbench + brew cask install phpstorm + brew cask install skype + brew cask install sublime-text + + exit 0
22
2
22
0
5645c6c5b8624296868ce95832ab366457eebc81
.travis.yml
.travis.yml
language: go go_import_path: googlemaps.github.io/maps # See https://github.com/travis-ci/gimme/blob/master/.known-binary-versions-linux for known golang versions go: - 1.7.x - 1.8.x - tip
language: go go_import_path: googlemaps.github.io/maps # See https://github.com/travis-ci/gimme/blob/master/.testdata/binary-linux for known golang versions go: - 1.7.x - 1.8.x - tip
Correct location of known Go versions
Correct location of known Go versions
YAML
apache-2.0
domesticmouse/google-maps-services-go,googlemaps/google-maps-services-go
yaml
## Code Before: language: go go_import_path: googlemaps.github.io/maps # See https://github.com/travis-ci/gimme/blob/master/.known-binary-versions-linux for known golang versions go: - 1.7.x - 1.8.x - tip ## Instruction: Correct location of known Go versions ## Code After: language: go go_import_path: googlemaps.github.io/maps # See https://github.com/travis-ci/gimme/blob/master/.testdata/binary-linux for known golang versions go: - 1.7.x - 1.8.x - tip
language: go go_import_path: googlemaps.github.io/maps - # See https://github.com/travis-ci/gimme/blob/master/.known-binary-versions-linux for known golang versions ? ^^^^^^ --------- + # See https://github.com/travis-ci/gimme/blob/master/.testdata/binary-linux for known golang versions ? ^^^^^^^^^ go: - 1.7.x - 1.8.x - tip
2
0.25
1
1
508fa276ed35f52d39224d6045ea277e78d46ab8
lib/sugar.rb
lib/sugar.rb
module Sugar class << self attr_writer :redis def aws_s3? if config.amazon_aws_key && config.amazon_aws_secret && config.amazon_s3_bucket true else false end end def redis @redis ||= Redis.new(driver: :hiredis, url: redis_url) end def redis_url=(new_url) @redis = nil @redis_url = new_url end def redis_url @redis_url ||= "redis://127.0.0.1:6379/1" end def config(_key = nil, *_args) @config ||= Configuration.new.tap(&:load) end def public_browsing? config.public_browsing end end end
module Sugar class << self attr_writer :redis def aws_s3? if config.amazon_aws_key && config.amazon_aws_secret && config.amazon_s3_bucket true else false end end def redis @redis ||= Redis.new(driver: :hiredis, url: redis_url) end def redis_url=(new_url) @redis = nil @config = nil @redis_url = new_url end def redis_url @redis_url ||= "redis://127.0.0.1:6379/1" end def config(_key = nil, *_args) @config ||= Configuration.new.tap(&:load) end def public_browsing? config.public_browsing end end end
Reset config when Redis URL changes
Reset config when Redis URL changes
Ruby
mit
elektronaut/sugar,elektronaut/sugar,elektronaut/sugar,elektronaut/sugar
ruby
## Code Before: module Sugar class << self attr_writer :redis def aws_s3? if config.amazon_aws_key && config.amazon_aws_secret && config.amazon_s3_bucket true else false end end def redis @redis ||= Redis.new(driver: :hiredis, url: redis_url) end def redis_url=(new_url) @redis = nil @redis_url = new_url end def redis_url @redis_url ||= "redis://127.0.0.1:6379/1" end def config(_key = nil, *_args) @config ||= Configuration.new.tap(&:load) end def public_browsing? config.public_browsing end end end ## Instruction: Reset config when Redis URL changes ## Code After: module Sugar class << self attr_writer :redis def aws_s3? if config.amazon_aws_key && config.amazon_aws_secret && config.amazon_s3_bucket true else false end end def redis @redis ||= Redis.new(driver: :hiredis, url: redis_url) end def redis_url=(new_url) @redis = nil @config = nil @redis_url = new_url end def redis_url @redis_url ||= "redis://127.0.0.1:6379/1" end def config(_key = nil, *_args) @config ||= Configuration.new.tap(&:load) end def public_browsing? config.public_browsing end end end
module Sugar class << self attr_writer :redis def aws_s3? if config.amazon_aws_key && config.amazon_aws_secret && config.amazon_s3_bucket true else false end end def redis @redis ||= Redis.new(driver: :hiredis, url: redis_url) end def redis_url=(new_url) @redis = nil + @config = nil @redis_url = new_url end def redis_url @redis_url ||= "redis://127.0.0.1:6379/1" end def config(_key = nil, *_args) @config ||= Configuration.new.tap(&:load) end def public_browsing? config.public_browsing end end end
1
0.027027
1
0
16e1afe930e80a55ef8572e53408f4cab3b49b9a
test/libs/queue/format/add.spec.js
test/libs/queue/format/add.spec.js
'use strict'; // Load chai const chai = require('chai'); const expect = chai.expect; // Load our module const format = require('../../../../app/lib/queue/format'); // Describe the module describe('Function "add"', () => { afterEach(() => { format.reset(); }); it('should export a function', () => { expect(format.add).to.be.a('function'); }); it('should add a single new item', () => { let addResult = format.add('foo'); expect(addResult).to.be.true; expect(format.formats).to.include('foo'); }); it('should add multiple formats when given an array', () => { let addResult = format.add(['foo', 'bar']); expect(addResult).to.be.true; expect(format.formats).to.include.members(['foo', 'bar']); }); it('should update the regex pattern on change', () => { let addResult = format.add('foo'); expect(addResult).to.be.true; let matchResult = 'test file.foo'.match(format.pattern); expect(matchResult).to.not.be.null; }); it('should still be successful when passing an existing format', () => { let addResult = format.add('mkv'); expect(addResult).to.be.true; }); it('should handle an invalid or no argument given', () => { let addResult = format.add(); expect(addResult).to.be.false; }); });
'use strict'; // Load chai const chai = require('chai'); const expect = chai.expect; // Load our module const format = require('../../../../app/lib/queue/format'); // Describe the module describe('Function "add"', () => { beforeEach(() => { format.reset(); }); afterEach(() => { format.reset(); }); it('should export a function', () => { expect(format.add).to.be.a('function'); }); it('should add a single new item', () => { let addResult = format.add('foo'); expect(addResult).to.be.true; expect(format.formats).to.include('foo'); }); it('should add multiple formats when given an array', () => { let addResult = format.add(['foo', 'bar']); expect(addResult).to.be.true; expect(format.formats).to.include.members(['foo', 'bar']); }); it('should update the regex pattern on change', () => { let addResult = format.add('foo'); expect(addResult).to.be.true; let matchResult = 'test file.foo'.match(format.pattern); expect(matchResult).to.not.be.null; }); it('should still be successful when passing an existing format', () => { let addResult = format.add('mkv'); expect(addResult).to.be.true; }); it('should handle an invalid or no argument given', () => { let addResult = format.add(); expect(addResult).to.be.false; }); });
Add before each reset to format add
Add before each reset to format add
JavaScript
apache-2.0
transmutejs/core
javascript
## Code Before: 'use strict'; // Load chai const chai = require('chai'); const expect = chai.expect; // Load our module const format = require('../../../../app/lib/queue/format'); // Describe the module describe('Function "add"', () => { afterEach(() => { format.reset(); }); it('should export a function', () => { expect(format.add).to.be.a('function'); }); it('should add a single new item', () => { let addResult = format.add('foo'); expect(addResult).to.be.true; expect(format.formats).to.include('foo'); }); it('should add multiple formats when given an array', () => { let addResult = format.add(['foo', 'bar']); expect(addResult).to.be.true; expect(format.formats).to.include.members(['foo', 'bar']); }); it('should update the regex pattern on change', () => { let addResult = format.add('foo'); expect(addResult).to.be.true; let matchResult = 'test file.foo'.match(format.pattern); expect(matchResult).to.not.be.null; }); it('should still be successful when passing an existing format', () => { let addResult = format.add('mkv'); expect(addResult).to.be.true; }); it('should handle an invalid or no argument given', () => { let addResult = format.add(); expect(addResult).to.be.false; }); }); ## Instruction: Add before each reset to format add ## Code After: 'use strict'; // Load chai const chai = require('chai'); const expect = chai.expect; // Load our module const format = require('../../../../app/lib/queue/format'); // Describe the module describe('Function "add"', () => { beforeEach(() => { format.reset(); }); afterEach(() => { format.reset(); }); it('should export a function', () => { expect(format.add).to.be.a('function'); }); it('should add a single new item', () => { let addResult = format.add('foo'); expect(addResult).to.be.true; expect(format.formats).to.include('foo'); }); it('should add multiple formats when given an array', () => { let addResult = format.add(['foo', 'bar']); expect(addResult).to.be.true; expect(format.formats).to.include.members(['foo', 'bar']); }); it('should update the regex pattern on change', () => { let addResult = format.add('foo'); expect(addResult).to.be.true; let matchResult = 'test file.foo'.match(format.pattern); expect(matchResult).to.not.be.null; }); it('should still be successful when passing an existing format', () => { let addResult = format.add('mkv'); expect(addResult).to.be.true; }); it('should handle an invalid or no argument given', () => { let addResult = format.add(); expect(addResult).to.be.false; }); });
'use strict'; // Load chai const chai = require('chai'); const expect = chai.expect; // Load our module const format = require('../../../../app/lib/queue/format'); // Describe the module describe('Function "add"', () => { + + beforeEach(() => { format.reset(); }); afterEach(() => { format.reset(); }); it('should export a function', () => { expect(format.add).to.be.a('function'); }); it('should add a single new item', () => { let addResult = format.add('foo'); expect(addResult).to.be.true; expect(format.formats).to.include('foo'); }); it('should add multiple formats when given an array', () => { let addResult = format.add(['foo', 'bar']); expect(addResult).to.be.true; expect(format.formats).to.include.members(['foo', 'bar']); }); it('should update the regex pattern on change', () => { let addResult = format.add('foo'); expect(addResult).to.be.true; let matchResult = 'test file.foo'.match(format.pattern); expect(matchResult).to.not.be.null; }); it('should still be successful when passing an existing format', () => { let addResult = format.add('mkv'); expect(addResult).to.be.true; }); it('should handle an invalid or no argument given', () => { let addResult = format.add(); expect(addResult).to.be.false; }); });
2
0.033333
2
0
9c593e10c013d0000c3b61e6a0ee97a89418eff9
ObjectiveRocks/RocksDBCuckooTableOptions.h
ObjectiveRocks/RocksDBCuckooTableOptions.h
// // RocksDBCuckooTableOptions.h // ObjectiveRocks // // Created by Iska on 04/01/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface RocksDBCuckooTableOptions : NSObject @property (nonatomic, assign) double hashTableRatio; @property (nonatomic, assign) uint32_t maxSearchDepth; @property (nonatomic, assign) uint32_t cuckooBlockSize; @property (nonatomic, assign) BOOL identityAsFirstHash; @property (nonatomic, assign) BOOL useModuleHash; @end
// // RocksDBCuckooTableOptions.h // ObjectiveRocks // // Created by Iska on 04/01/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface RocksDBCuckooTableOptions : NSObject /** @brief Determines the utilization of hash tables. Smaller values result in larger hash tables with fewer collisions. */ @property (nonatomic, assign) double hashTableRatio; /** @brief A property used by builder to determine the depth to go to to search for a path to displace elements in case of collision. Higher values result in more efficient hash tables with fewer lookups but take more time to build. */ @property (nonatomic, assign) uint32_t maxSearchDepth; /** @brief In case of collision while inserting, the builder attempts to insert in the next `cuckooBlockSize` locations before skipping over to the next Cuckoo hash function. This makes lookups more cache friendly in case of collisions. */ @property (nonatomic, assign) uint32_t cuckooBlockSize; /** @brief If this option is enabled, user key is treated as uint64_t and its value is used as hash value directly. This option changes builder's behavior. Reader ignore this option and behave according to what specified in table property. */ @property (nonatomic, assign) BOOL identityAsFirstHash; /** @brief If this option is set to true, module is used during hash calculation. This often yields better space efficiency at the cost of performance. If this optino is set to false, # of entries in table is constrained to be power of two, and bit and is used to calculate hash, which is faster in general. */ @property (nonatomic, assign) BOOL useModuleHash; @end
Add source code documentation for the RocksDB Cuckoo Table Options class
Add source code documentation for the RocksDB Cuckoo Table Options class
C
mit
iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks
c
## Code Before: // // RocksDBCuckooTableOptions.h // ObjectiveRocks // // Created by Iska on 04/01/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface RocksDBCuckooTableOptions : NSObject @property (nonatomic, assign) double hashTableRatio; @property (nonatomic, assign) uint32_t maxSearchDepth; @property (nonatomic, assign) uint32_t cuckooBlockSize; @property (nonatomic, assign) BOOL identityAsFirstHash; @property (nonatomic, assign) BOOL useModuleHash; @end ## Instruction: Add source code documentation for the RocksDB Cuckoo Table Options class ## Code After: // // RocksDBCuckooTableOptions.h // ObjectiveRocks // // Created by Iska on 04/01/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface RocksDBCuckooTableOptions : NSObject /** @brief Determines the utilization of hash tables. Smaller values result in larger hash tables with fewer collisions. */ @property (nonatomic, assign) double hashTableRatio; /** @brief A property used by builder to determine the depth to go to to search for a path to displace elements in case of collision. Higher values result in more efficient hash tables with fewer lookups but take more time to build. */ @property (nonatomic, assign) uint32_t maxSearchDepth; /** @brief In case of collision while inserting, the builder attempts to insert in the next `cuckooBlockSize` locations before skipping over to the next Cuckoo hash function. This makes lookups more cache friendly in case of collisions. */ @property (nonatomic, assign) uint32_t cuckooBlockSize; /** @brief If this option is enabled, user key is treated as uint64_t and its value is used as hash value directly. This option changes builder's behavior. Reader ignore this option and behave according to what specified in table property. */ @property (nonatomic, assign) BOOL identityAsFirstHash; /** @brief If this option is set to true, module is used during hash calculation. This often yields better space efficiency at the cost of performance. If this optino is set to false, # of entries in table is constrained to be power of two, and bit and is used to calculate hash, which is faster in general. */ @property (nonatomic, assign) BOOL useModuleHash; @end
// // RocksDBCuckooTableOptions.h // ObjectiveRocks // // Created by Iska on 04/01/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface RocksDBCuckooTableOptions : NSObject + /** + @brief + Determines the utilization of hash tables. Smaller values + result in larger hash tables with fewer collisions. + */ @property (nonatomic, assign) double hashTableRatio; + + /** + @brief + A property used by builder to determine the depth to go to + to search for a path to displace elements in case of + collision. Higher values result in more efficient hash tables + with fewer lookups but take more time to build. + */ @property (nonatomic, assign) uint32_t maxSearchDepth; + + /** + @brief + In case of collision while inserting, the builder + attempts to insert in the next `cuckooBlockSize` + locations before skipping over to the next Cuckoo hash + function. This makes lookups more cache friendly in case + of collisions. + */ @property (nonatomic, assign) uint32_t cuckooBlockSize; + + /** + @brief + If this option is enabled, user key is treated as uint64_t and its value + is used as hash value directly. This option changes builder's behavior. + Reader ignore this option and behave according to what specified in table + property. + */ @property (nonatomic, assign) BOOL identityAsFirstHash; + + /** + @brief + If this option is set to true, module is used during hash calculation. + This often yields better space efficiency at the cost of performance. + If this optino is set to false, # of entries in table is constrained to be + power of two, and bit and is used to calculate hash, which is faster in + general. + */ @property (nonatomic, assign) BOOL useModuleHash; @end
39
2.052632
39
0
a6c205b9a8575376f971f74e7fc1cd907a6c920a
src/gulp/test.js
src/gulp/test.js
import extend from 'extend' import gulp, {tasks} from 'gulp' import karma from 'karma' import rump from 'rump' const name = ::rump.taskName, task = ::gulp.task, {configs} = rump task(name('scripts:test'), () => { const options = extend(true, {}, configs.karma, { singleRun: !configs.watch, webpackServer: {quiet: configs.watch}, }) karma.server.start(options) }) tasks[name('test')].dep.push(name('scripts:test')) tasks[name('test:watch')].dep.push(name('scripts:test'))
import extend from 'extend' import gulp, {tasks} from 'gulp' import {Server} from 'karma' import rump from 'rump' const name = ::rump.taskName, task = ::gulp.task, {configs} = rump task(name('scripts:test'), done => { const server = new Server(extend(true, {}, configs.karma, { singleRun: !configs.watch, webpackServer: {quiet: configs.watch}, }), done) server.start() }) tasks[name('test')].dep.push(name('scripts:test')) tasks[name('test:watch')].dep.push(name('scripts:test'))
Use non deprecating Karma API
Use non deprecating Karma API
JavaScript
mit
rumps/rump-scripts-test,rumps/scripts-test
javascript
## Code Before: import extend from 'extend' import gulp, {tasks} from 'gulp' import karma from 'karma' import rump from 'rump' const name = ::rump.taskName, task = ::gulp.task, {configs} = rump task(name('scripts:test'), () => { const options = extend(true, {}, configs.karma, { singleRun: !configs.watch, webpackServer: {quiet: configs.watch}, }) karma.server.start(options) }) tasks[name('test')].dep.push(name('scripts:test')) tasks[name('test:watch')].dep.push(name('scripts:test')) ## Instruction: Use non deprecating Karma API ## Code After: import extend from 'extend' import gulp, {tasks} from 'gulp' import {Server} from 'karma' import rump from 'rump' const name = ::rump.taskName, task = ::gulp.task, {configs} = rump task(name('scripts:test'), done => { const server = new Server(extend(true, {}, configs.karma, { singleRun: !configs.watch, webpackServer: {quiet: configs.watch}, }), done) server.start() }) tasks[name('test')].dep.push(name('scripts:test')) tasks[name('test:watch')].dep.push(name('scripts:test'))
import extend from 'extend' import gulp, {tasks} from 'gulp' - import karma from 'karma' ? ^^ ^^ + import {Server} from 'karma' ? ^^^ ^^^^ import rump from 'rump' const name = ::rump.taskName, task = ::gulp.task, {configs} = rump - task(name('scripts:test'), () => { ? ^^ + task(name('scripts:test'), done => { ? ^^^^ - const options = extend(true, {}, configs.karma, { ? ------ + const server = new Server(extend(true, {}, configs.karma, { ? +++++ +++++++++++ singleRun: !configs.watch, webpackServer: {quiet: configs.watch}, - }) - karma.server.start(options) + }), done) + server.start() }) tasks[name('test')].dep.push(name('scripts:test')) tasks[name('test:watch')].dep.push(name('scripts:test'))
10
0.526316
5
5
0330c3e3c05f7b4a2969cee1ad2a86bb44dabbfc
circle.yml
circle.yml
machine: services: - docker checkout: post: - ([[ "$CIRCLE_BRANCH" = pull/* ]] && git merge --no-ff master) || [[ "$CIRCLE_BRANCH" != pull/* ]] - rm -rf ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - mkdir -p ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} dependencies: pre: - make deps - go generate - cp -R $(pwd) ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/ override: - make test: override: - cd ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} && ./coverage.sh --coveralls - | formatted="$(go fmt ./...)" && \ ( ( [[ -n $formatted ]] && echo "gofmt failed on the following files:" && echo -ne $formatted && exit 1) || (( [[ -z $formatted ]] && echo "gofmt passed") ) )
machine: services: - docker checkout: post: - ([[ "$CIRCLE_BRANCH" = pull/* ]] && git merge --no-ff master) || [[ "$CIRCLE_BRANCH" != pull/* ]] - rm -rf ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - mkdir -p ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} dependencies: pre: - make deps - go generate - cp -R $(pwd) ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/ override: - make test: override: - cd ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} && ./coverage.sh --coveralls - | git clean -fdx && \ formatted="$(go fmt ./...)" && \ ( ( [[ -n $formatted ]] && echo "gofmt failed on the following files:" && echo -ne $formatted && exit 1) || (( [[ -z $formatted ]] && echo "gofmt passed") ) )
Sort go fmt stuff for generated code
Sort go fmt stuff for generated code
YAML
apache-2.0
jimmidyson/kadvisor,jimmidyson/kadvisor
yaml
## Code Before: machine: services: - docker checkout: post: - ([[ "$CIRCLE_BRANCH" = pull/* ]] && git merge --no-ff master) || [[ "$CIRCLE_BRANCH" != pull/* ]] - rm -rf ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - mkdir -p ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} dependencies: pre: - make deps - go generate - cp -R $(pwd) ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/ override: - make test: override: - cd ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} && ./coverage.sh --coveralls - | formatted="$(go fmt ./...)" && \ ( ( [[ -n $formatted ]] && echo "gofmt failed on the following files:" && echo -ne $formatted && exit 1) || (( [[ -z $formatted ]] && echo "gofmt passed") ) ) ## Instruction: Sort go fmt stuff for generated code ## Code After: machine: services: - docker checkout: post: - ([[ "$CIRCLE_BRANCH" = pull/* ]] && git merge --no-ff master) || [[ "$CIRCLE_BRANCH" != pull/* ]] - rm -rf ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - mkdir -p ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} dependencies: pre: - make deps - go generate - cp -R $(pwd) ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/ override: - make test: override: - cd ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} && ./coverage.sh --coveralls - | git clean -fdx && \ formatted="$(go fmt ./...)" && \ ( ( [[ -n $formatted ]] && echo "gofmt failed on the following files:" && echo -ne $formatted && exit 1) || (( [[ -z $formatted ]] && echo "gofmt passed") ) )
machine: services: - docker checkout: post: - ([[ "$CIRCLE_BRANCH" = pull/* ]] && git merge --no-ff master) || [[ "$CIRCLE_BRANCH" != pull/* ]] - rm -rf ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} - mkdir -p ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} dependencies: pre: - make deps - go generate - cp -R $(pwd) ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/ override: - make test: override: - cd ${GOPATH%%:*}/src/github.com/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} && ./coverage.sh --coveralls - | + git clean -fdx && \ formatted="$(go fmt ./...)" && \ ( ( [[ -n $formatted ]] && echo "gofmt failed on the following files:" && echo -ne $formatted && exit 1) || (( [[ -z $formatted ]] && echo "gofmt passed") ) )
1
0.04
1
0
33f909f49018584fbdc78eaaab4470199c4095e8
public/stylesheets/style.css
public/stylesheets/style.css
padding: 0; margin: 0; } span.icon { margin: 0 auto; display: block; position: relative; top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); } span.icon.small { width: 18px; } span.icon.medium { width: 24px; } span.icon.large { width: 40px; } span.icon svg { width: 100%; -webkit-border-radius: 40px; -moz-border-radius: 40px; border-radius: 40px; } span.icon.black svg path.svg__bg { fill: black; } span.icon.black svg path.svg__fg { fill: white; } span.icon.white svg path.svg__bg { fill: white; } span.icon.white svg path.svg__fg { fill: black; }
padding: 0; margin: 0; } span.icon { margin: 0 auto; display: block; position: relative; top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); -moz-transform: translateY(0); } span.icon.small { width: 18px; } span.icon.medium { width: 24px; } span.icon.large { width: 40px; } span.icon svg { width: 100%; -webkit-border-radius: 40px; -moz-border-radius: 40px; border-radius: 40px; } span.icon.black svg path.svg__bg { fill: black; } span.icon.black svg path.svg__fg { fill: white; } span.icon.white svg path.svg__bg { fill: white; } span.icon.white svg path.svg__fg { fill: black; }
Make sure mozilla doesnt transform
Make sure mozilla doesnt transform
CSS
mit
ello/ello-button,ello/ello-button
css
## Code Before: padding: 0; margin: 0; } span.icon { margin: 0 auto; display: block; position: relative; top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); } span.icon.small { width: 18px; } span.icon.medium { width: 24px; } span.icon.large { width: 40px; } span.icon svg { width: 100%; -webkit-border-radius: 40px; -moz-border-radius: 40px; border-radius: 40px; } span.icon.black svg path.svg__bg { fill: black; } span.icon.black svg path.svg__fg { fill: white; } span.icon.white svg path.svg__bg { fill: white; } span.icon.white svg path.svg__fg { fill: black; } ## Instruction: Make sure mozilla doesnt transform ## Code After: padding: 0; margin: 0; } span.icon { margin: 0 auto; display: block; position: relative; top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); -moz-transform: translateY(0); } span.icon.small { width: 18px; } span.icon.medium { width: 24px; } span.icon.large { width: 40px; } span.icon svg { width: 100%; -webkit-border-radius: 40px; -moz-border-radius: 40px; border-radius: 40px; } span.icon.black svg path.svg__bg { fill: black; } span.icon.black svg path.svg__fg { fill: white; } span.icon.white svg path.svg__bg { fill: white; } span.icon.white svg path.svg__fg { fill: black; }
padding: 0; margin: 0; } span.icon { margin: 0 auto; display: block; position: relative; top: 50%; -webkit-transform: translateY(-50%); -ms-transform: translateY(-50%); + -moz-transform: translateY(0); } span.icon.small { width: 18px; } span.icon.medium { width: 24px; } span.icon.large { width: 40px; } span.icon svg { width: 100%; -webkit-border-radius: 40px; -moz-border-radius: 40px; border-radius: 40px; } span.icon.black svg path.svg__bg { fill: black; } span.icon.black svg path.svg__fg { fill: white; } span.icon.white svg path.svg__bg { fill: white; } span.icon.white svg path.svg__fg { fill: black; }
1
0.021277
1
0
bf78c8f7b1c0b45e7c7429bc6e1f7f79f92cd20e
app/controllers/monologue/tags_controller.rb
app/controllers/monologue/tags_controller.rb
class Monologue::TagsController < Monologue::ApplicationController def show @tag = retrieve_tag if @tag @page = nil @posts = @tag.posts_with_tag else redirect_to :root ,notice: "No post found with label \"#{params[:tag]}\"" end end private def retrieve_tag Monologue::Tag.where("lower(name) = ?", params[:tag].downcase).first end end
class Monologue::TagsController < Monologue::ApplicationController def show @tag = retrieve_tag if @tag @page = nil @posts = @tag.posts_with_tag else redirect_to :root ,notice: "No post found with label \"#{params[:tag]}\"" end end private def retrieve_tag Monologue::Tag.where("lower(name) = ?", params[:tag].mb_chars.downcase.to_s).first end end
Use non-latin symbols for tags
Use non-latin symbols for tags
Ruby
mit
GapIntelligence/monologue,munirent/monologue,paresharma/monologue,kyle-annen/monologue,jipiboily/monologue,tam-vo/monologue,bertomartin/monologue,kyle-annen/monologue,jipiboily/monologue,thiesa/monologue,caitlingoldman/monologue,jaimerson/monologue,jaimerson/monologue,caitlingoldman/monologue,thiesa/monologue,jipiboily/monologue,GapIntelligence/monologue,abreckner/monologue,paresharma/monologue,thiesa/monologue,bertomartin/monologue,munirent/monologue,jaimerson/monologue,tam-vo/monologue,bertomartin/monologue,paresharma/monologue,kyle-annen/monologue,GapIntelligence/monologue,tam-vo/monologue,abreckner/monologue,abreckner/monologue,caitlingoldman/monologue
ruby
## Code Before: class Monologue::TagsController < Monologue::ApplicationController def show @tag = retrieve_tag if @tag @page = nil @posts = @tag.posts_with_tag else redirect_to :root ,notice: "No post found with label \"#{params[:tag]}\"" end end private def retrieve_tag Monologue::Tag.where("lower(name) = ?", params[:tag].downcase).first end end ## Instruction: Use non-latin symbols for tags ## Code After: class Monologue::TagsController < Monologue::ApplicationController def show @tag = retrieve_tag if @tag @page = nil @posts = @tag.posts_with_tag else redirect_to :root ,notice: "No post found with label \"#{params[:tag]}\"" end end private def retrieve_tag Monologue::Tag.where("lower(name) = ?", params[:tag].mb_chars.downcase.to_s).first end end
class Monologue::TagsController < Monologue::ApplicationController def show @tag = retrieve_tag if @tag @page = nil @posts = @tag.posts_with_tag else redirect_to :root ,notice: "No post found with label \"#{params[:tag]}\"" end end private def retrieve_tag - Monologue::Tag.where("lower(name) = ?", params[:tag].downcase).first + Monologue::Tag.where("lower(name) = ?", params[:tag].mb_chars.downcase.to_s).first ? +++++++++ +++++ end end
2
0.125
1
1
ccb1d0fb3b0ac37379a57359e9c1cfb4817eb23a
lib/backlogjp/base.rb
lib/backlogjp/base.rb
module Backlogjp class Base URI_FORMAT = "https://%s.backlog.jp/XML-RPC" def initialize(space, user, pass) if space.empty? || user.empty? || pass.empty? raise ArgumentException("Provide a valid space, user and password") end @base_uri = URI.parse( URI_FORMAT % space ) @client = XMLRPC::Client.new(@base_uri.host, @base_uri.path, @base_uri.port, nil, nil, # proxy user, pass, true, # SSL nil # timeout ) end def _command(method, *args) @client.call(:"backlog.#{method}", *args) end end class Container def self.attributes *attributes instance_variable_set :@attributes, attributes attr_reader(*attributes) end def initialize(hash) attributes = self.class.instance_variable_get(:@attributes) attributes.each do |var| instance_variable_set(:"@#{var}", hash[var.to_s]) end end def to_s attributes = self.class.instance_variable_get(:@attributes) attribute_map = attributes.map do |attribute| value = instance_variable_get(:"@#{attribute}").inspect "#{attribute}=#{value}" end "#<#{self.class} #{attribute_map.join(', ')}>" end end end
module Backlogjp class Base URI_FORMAT = "https://%s.backlog.jp/XML-RPC" def initialize(space, user, pass) if space.empty? || user.empty? || pass.empty? raise ArgumentException("Provide a valid space, user and password") end @base_uri = URI.parse( URI_FORMAT % space ) @client = XMLRPC::Client.new(@base_uri.host, @base_uri.path, @base_uri.port, nil, nil, # proxy user, pass, true, # SSL nil # timeout ) end def _command(method, *args) @client.call(:"backlog.#{method}", *args) end end class Container def self.attributes *attributes instance_variable_set :@attributes, attributes attr_reader(*attributes) end def initialize(hash) attributes = self.class.instance_variable_get(:@attributes) attributes.each do |var| instance_variable_set(:"@#{var}", hash[var.to_s] || hash[var.to_sym]) end end def to_s attributes = self.class.instance_variable_get(:@attributes) attribute_map = attributes.map do |attribute| value = instance_variable_get(:"@#{attribute}").inspect "#{attribute}=#{value}" end "#<#{self.class} #{attribute_map.join(', ')}>" end end end
Allow symbol-keyed hashes in creating objects
Allow symbol-keyed hashes in creating objects
Ruby
mit
zaki/backlogjp
ruby
## Code Before: module Backlogjp class Base URI_FORMAT = "https://%s.backlog.jp/XML-RPC" def initialize(space, user, pass) if space.empty? || user.empty? || pass.empty? raise ArgumentException("Provide a valid space, user and password") end @base_uri = URI.parse( URI_FORMAT % space ) @client = XMLRPC::Client.new(@base_uri.host, @base_uri.path, @base_uri.port, nil, nil, # proxy user, pass, true, # SSL nil # timeout ) end def _command(method, *args) @client.call(:"backlog.#{method}", *args) end end class Container def self.attributes *attributes instance_variable_set :@attributes, attributes attr_reader(*attributes) end def initialize(hash) attributes = self.class.instance_variable_get(:@attributes) attributes.each do |var| instance_variable_set(:"@#{var}", hash[var.to_s]) end end def to_s attributes = self.class.instance_variable_get(:@attributes) attribute_map = attributes.map do |attribute| value = instance_variable_get(:"@#{attribute}").inspect "#{attribute}=#{value}" end "#<#{self.class} #{attribute_map.join(', ')}>" end end end ## Instruction: Allow symbol-keyed hashes in creating objects ## Code After: module Backlogjp class Base URI_FORMAT = "https://%s.backlog.jp/XML-RPC" def initialize(space, user, pass) if space.empty? || user.empty? || pass.empty? raise ArgumentException("Provide a valid space, user and password") end @base_uri = URI.parse( URI_FORMAT % space ) @client = XMLRPC::Client.new(@base_uri.host, @base_uri.path, @base_uri.port, nil, nil, # proxy user, pass, true, # SSL nil # timeout ) end def _command(method, *args) @client.call(:"backlog.#{method}", *args) end end class Container def self.attributes *attributes instance_variable_set :@attributes, attributes attr_reader(*attributes) end def initialize(hash) attributes = self.class.instance_variable_get(:@attributes) attributes.each do |var| instance_variable_set(:"@#{var}", hash[var.to_s] || hash[var.to_sym]) end end def to_s attributes = self.class.instance_variable_get(:@attributes) attribute_map = attributes.map do |attribute| value = instance_variable_get(:"@#{attribute}").inspect "#{attribute}=#{value}" end "#<#{self.class} #{attribute_map.join(', ')}>" end end end
module Backlogjp class Base URI_FORMAT = "https://%s.backlog.jp/XML-RPC" def initialize(space, user, pass) if space.empty? || user.empty? || pass.empty? raise ArgumentException("Provide a valid space, user and password") end @base_uri = URI.parse( URI_FORMAT % space ) @client = XMLRPC::Client.new(@base_uri.host, @base_uri.path, @base_uri.port, nil, nil, # proxy user, pass, true, # SSL nil # timeout ) end def _command(method, *args) @client.call(:"backlog.#{method}", *args) end end class Container def self.attributes *attributes instance_variable_set :@attributes, attributes attr_reader(*attributes) end def initialize(hash) attributes = self.class.instance_variable_get(:@attributes) attributes.each do |var| - instance_variable_set(:"@#{var}", hash[var.to_s]) + instance_variable_set(:"@#{var}", hash[var.to_s] || hash[var.to_sym]) ? ++++++++++++++++++++ end end def to_s attributes = self.class.instance_variable_get(:@attributes) attribute_map = attributes.map do |attribute| value = instance_variable_get(:"@#{attribute}").inspect "#{attribute}=#{value}" end "#<#{self.class} #{attribute_map.join(', ')}>" end end end
2
0.038462
1
1
b63d8d2609985c26835c3890a3a929af6a4a6d1e
lib/Basic/OpenMPKinds.cpp
lib/Basic/OpenMPKinds.cpp
//===--- OpenMPKinds.cpp - Token Kinds Support ----------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// \file /// \brief This file implements the OpenMP enum and support functions. /// //===----------------------------------------------------------------------===// #include "clang/Basic/OpenMPKinds.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Lex/Token.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/ErrorHandling.h" #include <cassert> using namespace clang; OpenMPDirectiveKind clang::getOpenMPDirectiveKind(StringRef Str) { return llvm::StringSwitch<OpenMPDirectiveKind>(Str) #define OPENMP_DIRECTIVE(Name) \ .Case(#Name, OMPD_##Name) #include "clang/Basic/OpenMPKinds.def" .Default(OMPD_unknown); } const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) { assert(Kind < NUM_OPENMP_DIRECTIVES); switch (Kind) { case OMPD_unknown: return ("unknown"); #define OPENMP_DIRECTIVE(Name) \ case OMPD_##Name : return #Name; #include "clang/Basic/OpenMPKinds.def" default: break; } llvm_unreachable("Invalid OpenMP directive kind"); }
//===--- OpenMPKinds.cpp - Token Kinds Support ----------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// \file /// \brief This file implements the OpenMP enum and support functions. /// //===----------------------------------------------------------------------===// #include "clang/Basic/OpenMPKinds.h" #include "clang/Basic/IdentifierTable.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/ErrorHandling.h" #include <cassert> using namespace clang; OpenMPDirectiveKind clang::getOpenMPDirectiveKind(StringRef Str) { return llvm::StringSwitch<OpenMPDirectiveKind>(Str) #define OPENMP_DIRECTIVE(Name) \ .Case(#Name, OMPD_##Name) #include "clang/Basic/OpenMPKinds.def" .Default(OMPD_unknown); } const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) { assert(Kind < NUM_OPENMP_DIRECTIVES); switch (Kind) { case OMPD_unknown: return ("unknown"); #define OPENMP_DIRECTIVE(Name) \ case OMPD_##Name : return #Name; #include "clang/Basic/OpenMPKinds.def" default: break; } llvm_unreachable("Invalid OpenMP directive kind"); }
Fix a layering violation introduced in r177705.
Fix a layering violation introduced in r177705. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@177922 91177308-0d34-0410-b5e6-96231b3b80d8
C++
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
c++
## Code Before: //===--- OpenMPKinds.cpp - Token Kinds Support ----------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// \file /// \brief This file implements the OpenMP enum and support functions. /// //===----------------------------------------------------------------------===// #include "clang/Basic/OpenMPKinds.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Lex/Token.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/ErrorHandling.h" #include <cassert> using namespace clang; OpenMPDirectiveKind clang::getOpenMPDirectiveKind(StringRef Str) { return llvm::StringSwitch<OpenMPDirectiveKind>(Str) #define OPENMP_DIRECTIVE(Name) \ .Case(#Name, OMPD_##Name) #include "clang/Basic/OpenMPKinds.def" .Default(OMPD_unknown); } const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) { assert(Kind < NUM_OPENMP_DIRECTIVES); switch (Kind) { case OMPD_unknown: return ("unknown"); #define OPENMP_DIRECTIVE(Name) \ case OMPD_##Name : return #Name; #include "clang/Basic/OpenMPKinds.def" default: break; } llvm_unreachable("Invalid OpenMP directive kind"); } ## Instruction: Fix a layering violation introduced in r177705. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@177922 91177308-0d34-0410-b5e6-96231b3b80d8 ## Code After: //===--- OpenMPKinds.cpp - Token Kinds Support ----------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// \file /// \brief This file implements the OpenMP enum and support functions. /// //===----------------------------------------------------------------------===// #include "clang/Basic/OpenMPKinds.h" #include "clang/Basic/IdentifierTable.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/ErrorHandling.h" #include <cassert> using namespace clang; OpenMPDirectiveKind clang::getOpenMPDirectiveKind(StringRef Str) { return llvm::StringSwitch<OpenMPDirectiveKind>(Str) #define OPENMP_DIRECTIVE(Name) \ .Case(#Name, OMPD_##Name) #include "clang/Basic/OpenMPKinds.def" .Default(OMPD_unknown); } const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) { assert(Kind < NUM_OPENMP_DIRECTIVES); switch (Kind) { case OMPD_unknown: return ("unknown"); #define OPENMP_DIRECTIVE(Name) \ case OMPD_##Name : return #Name; #include "clang/Basic/OpenMPKinds.def" default: break; } llvm_unreachable("Invalid OpenMP directive kind"); }
//===--- OpenMPKinds.cpp - Token Kinds Support ----------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// /// \file /// \brief This file implements the OpenMP enum and support functions. /// //===----------------------------------------------------------------------===// #include "clang/Basic/OpenMPKinds.h" #include "clang/Basic/IdentifierTable.h" - #include "clang/Lex/Token.h" + #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" #include "llvm/Support/ErrorHandling.h" #include <cassert> using namespace clang; OpenMPDirectiveKind clang::getOpenMPDirectiveKind(StringRef Str) { return llvm::StringSwitch<OpenMPDirectiveKind>(Str) #define OPENMP_DIRECTIVE(Name) \ .Case(#Name, OMPD_##Name) #include "clang/Basic/OpenMPKinds.def" .Default(OMPD_unknown); } const char *clang::getOpenMPDirectiveName(OpenMPDirectiveKind Kind) { assert(Kind < NUM_OPENMP_DIRECTIVES); switch (Kind) { case OMPD_unknown: return ("unknown"); #define OPENMP_DIRECTIVE(Name) \ case OMPD_##Name : return #Name; #include "clang/Basic/OpenMPKinds.def" default: break; } llvm_unreachable("Invalid OpenMP directive kind"); }
2
0.046512
1
1
7b97be8d840160b1f19325d77619e916233a8c06
priv/templates/release_rc_win_exec.eex
priv/templates/release_rc_win_exec.eex
:: Discover the current release directory from the directory :: of this script and the start_erl.data file @echo off set script_dir=%~dp0 for %%A in ("%script_dir%\..") do ( set release_root_dir=%%~fA ) set rel_name=<%= release_name %> set rel_vsn=<%= release_version %> set boot_script=%release_root_dir%\releases\%rel_vsn%\%rel_name%.ps1 powershell -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "& "%boot_script%" @args" %*
:: Discover the current release directory from the directory :: of this script and the start_erl.data file @echo off set script_dir=%~dp0 for %%A in ("%script_dir%\..") do ( set release_root_dir=%%~fA ) set rel_name=<%= release_name %> set rel_vsn=<%= release_version %> set boot_script=%release_root_dir%\releases\%rel_vsn%\%rel_name%.ps1 :: Use pwsh.exe rather than powershell.exe if available set prog=powershell where pwsh if %ERRORLEVEL% eq 0 ( set prog=pwsh ) %prog% -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "& "%boot_script%" @args" %*
Update exec script to use pwsh over powershell, when available
Update exec script to use pwsh over powershell, when available
HTML+EEX
mit
bitwalker/distillery,bitwalker/distillery
html+eex
## Code Before: :: Discover the current release directory from the directory :: of this script and the start_erl.data file @echo off set script_dir=%~dp0 for %%A in ("%script_dir%\..") do ( set release_root_dir=%%~fA ) set rel_name=<%= release_name %> set rel_vsn=<%= release_version %> set boot_script=%release_root_dir%\releases\%rel_vsn%\%rel_name%.ps1 powershell -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "& "%boot_script%" @args" %* ## Instruction: Update exec script to use pwsh over powershell, when available ## Code After: :: Discover the current release directory from the directory :: of this script and the start_erl.data file @echo off set script_dir=%~dp0 for %%A in ("%script_dir%\..") do ( set release_root_dir=%%~fA ) set rel_name=<%= release_name %> set rel_vsn=<%= release_version %> set boot_script=%release_root_dir%\releases\%rel_vsn%\%rel_name%.ps1 :: Use pwsh.exe rather than powershell.exe if available set prog=powershell where pwsh if %ERRORLEVEL% eq 0 ( set prog=pwsh ) %prog% -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "& "%boot_script%" @args" %*
:: Discover the current release directory from the directory :: of this script and the start_erl.data file @echo off set script_dir=%~dp0 for %%A in ("%script_dir%\..") do ( set release_root_dir=%%~fA ) set rel_name=<%= release_name %> set rel_vsn=<%= release_version %> set boot_script=%release_root_dir%\releases\%rel_vsn%\%rel_name%.ps1 + + :: Use pwsh.exe rather than powershell.exe if available + set prog=powershell + where pwsh + if %ERRORLEVEL% eq 0 ( + set prog=pwsh + ) - powershell -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "& "%boot_script%" @args" %* ? ^^^^^^^^ + %prog% -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "& "%boot_script%" @args" %* ? + + ^^
9
0.818182
8
1
b9e60d25f735f389ca9f1de21f69d48cea7cfac7
routes/scrape.js
routes/scrape.js
var express = require('express'); var router = express.Router(); const { getEntry, getAllEntries, addEntry, deleteEntry } = require('./../db/entries') const { getDataFromUrl, getDataFromName } = require('./../scrape/getData') const getPeopleFromWiki = require('./../scrape/getPeopleFromWiki') /* GET entries */ router.get('/', function(req, res) { getPeopleFromWiki('https://en.wikipedia.org/wiki/Category:Living_people?from=D') .then(urls => { urls.forEach(url => { getDataFromUrl(url) .then(data => addEntry(data)) .catch(error => console.log(error)) }) }) .then(() => res.send('Wikipedia scraped and entered')) .catch(error => { res.send('Error!', error) }) }); module.exports = router;
var express = require('express'); var router = express.Router(); const { getEntry, getAllEntries, addEntry, deleteEntry } = require('./../db/entries') const { getDataFromUrl, getDataFromName } = require('./../scrape/getData') const getPeopleFromWiki = require('./../scrape/getPeopleFromWiki') /* GET entries */ router.get('/:letter', function(req, res) { getPeopleFromWiki(`https://en.wikipedia.org/wiki/Category:Living_people?from=${req.params.letter}`) .then(urls => { urls.forEach(url => { getDataFromUrl(url) .then(data => addEntry(data)) .then(response => console.log(response, "added")) .catch(error => console.log(error)) }) }) .then(() => res.send('Wikipedia scraped and entered')) .catch(error => { res.send('Error!', error) }) }); module.exports = router;
Set up route for scraping wikipedia
Set up route for scraping wikipedia
JavaScript
mit
michael-lowe-nz/ageGuessAPI,michael-lowe-nz/ageGuessAPI
javascript
## Code Before: var express = require('express'); var router = express.Router(); const { getEntry, getAllEntries, addEntry, deleteEntry } = require('./../db/entries') const { getDataFromUrl, getDataFromName } = require('./../scrape/getData') const getPeopleFromWiki = require('./../scrape/getPeopleFromWiki') /* GET entries */ router.get('/', function(req, res) { getPeopleFromWiki('https://en.wikipedia.org/wiki/Category:Living_people?from=D') .then(urls => { urls.forEach(url => { getDataFromUrl(url) .then(data => addEntry(data)) .catch(error => console.log(error)) }) }) .then(() => res.send('Wikipedia scraped and entered')) .catch(error => { res.send('Error!', error) }) }); module.exports = router; ## Instruction: Set up route for scraping wikipedia ## Code After: var express = require('express'); var router = express.Router(); const { getEntry, getAllEntries, addEntry, deleteEntry } = require('./../db/entries') const { getDataFromUrl, getDataFromName } = require('./../scrape/getData') const getPeopleFromWiki = require('./../scrape/getPeopleFromWiki') /* GET entries */ router.get('/:letter', function(req, res) { getPeopleFromWiki(`https://en.wikipedia.org/wiki/Category:Living_people?from=${req.params.letter}`) .then(urls => { urls.forEach(url => { getDataFromUrl(url) .then(data => addEntry(data)) .then(response => console.log(response, "added")) .catch(error => console.log(error)) }) }) .then(() => res.send('Wikipedia scraped and entered')) .catch(error => { res.send('Error!', error) }) }); module.exports = router;
var express = require('express'); var router = express.Router(); const { getEntry, getAllEntries, addEntry, deleteEntry } = require('./../db/entries') const { getDataFromUrl, getDataFromName } = require('./../scrape/getData') const getPeopleFromWiki = require('./../scrape/getPeopleFromWiki') /* GET entries */ - router.get('/', function(req, res) { + router.get('/:letter', function(req, res) { ? +++++++ - getPeopleFromWiki('https://en.wikipedia.org/wiki/Category:Living_people?from=D') ? ^ ^^ + getPeopleFromWiki(`https://en.wikipedia.org/wiki/Category:Living_people?from=${req.params.letter}`) ? ^ ^^^^^^^^^^^^^^^^^^^^^ - .then(urls => { ? -- + .then(urls => { - urls.forEach(url => { ? -- + urls.forEach(url => { - getDataFromUrl(url) ? -- + getDataFromUrl(url) - .then(data => addEntry(data)) ? ---- + .then(data => addEntry(data)) + .then(response => console.log(response, "added")) - .catch(error => console.log(error)) ? ---- + .catch(error => console.log(error)) - }) }) + }) - .then(() => res.send('Wikipedia scraped and entered')) ? -- + .then(() => res.send('Wikipedia scraped and entered')) - .catch(error => { ? -- + .catch(error => { - res.send('Error!', error) ? -- + res.send('Error!', error) - }) ? -- + }) }); module.exports = router;
25
0.78125
13
12
c4069a9169a38b175fe71cd2cb1a5e8c53a101a9
src/assets/js/scrolling-nav.js
src/assets/js/scrolling-nav.js
function scrollTo(e) { var distanceToTop = function(el) { try { return Math.floor(el.getBoundingClientRect().top); } catch(err) { console.log(err); } }; var checkIfDone = setInterval(function() { var atBottom = window.innerHeight + window.pageYOffset >= document.body.offsetHeight - 2; if (distanceToTop(targetAnchor) === 0 || atBottom) { targetAnchor.tabIndex = "-1"; targetAnchor.focus(); window.history.pushState("", "", targetID); clearInterval(checkIfDone); } }, 100); var targetID = this.getAttribute("href"); var targetAnchor = document.querySelector(targetID); var originalTop = distanceToTop(targetAnchor); var offset = document.querySelector('.l-nav-primary-desktop').offsetHeight; e.preventDefault(); if (!targetAnchor) { return; } window.scrollBy({ top: originalTop - offset, left: 0, behavior: "smooth" }); } // grab links var linksToAnchors = document.querySelectorAll('a.page-scroll'); // Event handler for clicking on links linksToAnchors.forEach(function(each) { each.onclick = scrollTo; });
function scrollTo(e) { var distanceToTop = function (el) { try { return Math.floor(el.getBoundingClientRect().top); } catch (err) { console.log(err); } }, targetID = this.getAttribute("href"), targetAnchor = document.querySelector(targetID), originalTop = distanceToTop(targetAnchor), offset = document.querySelector('.l-nav-primary-desktop').offsetHeight; e.preventDefault(); if (!targetAnchor) { return; } window.scrollBy({ top: originalTop - offset, left: 0, behavior: "smooth" }); } // grab links var linksToAnchors = document.querySelectorAll('a.page-scroll'); // Event handler for clicking on links linksToAnchors.forEach(function (each) { each.onclick = scrollTo; });
Remove timing function, which was causing issues. Fixed some eslint configuration recommendations for the codebase.
Remove timing function, which was causing issues. Fixed some eslint configuration recommendations for the codebase. * Note: right now the scroll is working with chrome and firefox but not safari.
JavaScript
mit
deduced/bov-personal-portfolio,deduced/bov-personal-portfolio
javascript
## Code Before: function scrollTo(e) { var distanceToTop = function(el) { try { return Math.floor(el.getBoundingClientRect().top); } catch(err) { console.log(err); } }; var checkIfDone = setInterval(function() { var atBottom = window.innerHeight + window.pageYOffset >= document.body.offsetHeight - 2; if (distanceToTop(targetAnchor) === 0 || atBottom) { targetAnchor.tabIndex = "-1"; targetAnchor.focus(); window.history.pushState("", "", targetID); clearInterval(checkIfDone); } }, 100); var targetID = this.getAttribute("href"); var targetAnchor = document.querySelector(targetID); var originalTop = distanceToTop(targetAnchor); var offset = document.querySelector('.l-nav-primary-desktop').offsetHeight; e.preventDefault(); if (!targetAnchor) { return; } window.scrollBy({ top: originalTop - offset, left: 0, behavior: "smooth" }); } // grab links var linksToAnchors = document.querySelectorAll('a.page-scroll'); // Event handler for clicking on links linksToAnchors.forEach(function(each) { each.onclick = scrollTo; }); ## Instruction: Remove timing function, which was causing issues. Fixed some eslint configuration recommendations for the codebase. * Note: right now the scroll is working with chrome and firefox but not safari. ## Code After: function scrollTo(e) { var distanceToTop = function (el) { try { return Math.floor(el.getBoundingClientRect().top); } catch (err) { console.log(err); } }, targetID = this.getAttribute("href"), targetAnchor = document.querySelector(targetID), originalTop = distanceToTop(targetAnchor), offset = document.querySelector('.l-nav-primary-desktop').offsetHeight; e.preventDefault(); if (!targetAnchor) { return; } window.scrollBy({ top: originalTop - offset, left: 0, behavior: "smooth" }); } // grab links var linksToAnchors = document.querySelectorAll('a.page-scroll'); // Event handler for clicking on links linksToAnchors.forEach(function (each) { each.onclick = scrollTo; });
function scrollTo(e) { - var distanceToTop = function(el) { + var distanceToTop = function (el) { ? + - try { + try { ? ++++ - return Math.floor(el.getBoundingClientRect().top); + return Math.floor(el.getBoundingClientRect().top); ? ++++ - } catch(err) { + } catch (err) { ? ++++ + - console.log(err); + console.log(err); ? ++++ + } - } + }, ? + - }; - - var checkIfDone = setInterval(function() { - var atBottom = window.innerHeight + window.pageYOffset >= document.body.offsetHeight - 2; - if (distanceToTop(targetAnchor) === 0 || atBottom) { - targetAnchor.tabIndex = "-1"; - targetAnchor.focus(); - window.history.pushState("", "", targetID); - clearInterval(checkIfDone); - } - }, 100); - - var targetID = this.getAttribute("href"); ? ^^^ ^ + targetID = this.getAttribute("href"), ? ^^^ ^ - var targetAnchor = document.querySelector(targetID); ? ^^^ ^ + targetAnchor = document.querySelector(targetID), ? ^^^ ^ - var originalTop = distanceToTop(targetAnchor); ? ^^^ ^ + originalTop = distanceToTop(targetAnchor), ? ^^^ ^ - var offset = document.querySelector('.l-nav-primary-desktop').offsetHeight; ? ^^^ + offset = document.querySelector('.l-nav-primary-desktop').offsetHeight; ? ^^^ e.preventDefault(); if (!targetAnchor) { return; } window.scrollBy({ top: originalTop - offset, left: 0, behavior: "smooth" }); } // grab links var linksToAnchors = document.querySelectorAll('a.page-scroll'); // Event handler for clicking on links - linksToAnchors.forEach(function(each) { each.onclick = scrollTo; }); + linksToAnchors.forEach(function (each) { + each.onclick = scrollTo; + });
37
0.973684
14
23
e9eb18b754a6ad243f0458488e1146b4d9f957c7
app/views/emarketing/index.rhtml
app/views/emarketing/index.rhtml
<script> SourcesCharts = { chart: null, date: "<%= @date.strftime('%F') %>", next: function() { $j.getJSON("<%= url_for :action => 'referrer_sources' %>", {date: SourcesCharts.date, direction: 'next'}, function(res) {SourcesCharts.load(res);}); }, prev: function() { $j.getJSON("<%= url_for :action => 'referrer_sources' %>", {date: SourcesCharts.date, direction: 'prev'}, function(res) {SourcesCharts.load(res);}); }, load: function(data) { SourcesCharts.date = data.date; SourcesCharts.chart.load(data); for(var i=0; i<data.total_values.length; i++) { $j('#chart_day' + (i+1)).text(data.days[i]); $j('#chart_date' + (i+1)).text(data.dates[i]); $j('#chart_value' + (i+1)).text(data.total_values[i] == '' ? '' : data.total_values[i]); } SourcesCharts.chart.draw(); } } </script> <div class='admin_content'> <%= subpage_display :emarketing, @subpages %> <br/> <br/> <div align="center"> <%= render :partial => 'referrer_sources' %> </div> </div>
<script> SourcesCharts = { chart: null, date: "<%= @date.strftime('%F') %>", next: function() { $j.getJSON("<%= url_for :action => 'referrer_sources' %>", {date: SourcesCharts.date, direction: 'next'}, function(res) {SourcesCharts.load(res);}); }, prev: function() { $j.getJSON("<%= url_for :action => 'referrer_sources' %>", {date: SourcesCharts.date, direction: 'prev'}, function(res) {SourcesCharts.load(res);}); }, load: function(data) { SourcesCharts.date = data.date; SourcesCharts.chart.load(data); for(var i=0; i<data.total_values.length; i++) { $j('#chart_day' + (i+1)).text(data.days[i]); $j('#chart_date' + (i+1)).text(data.dates[i]); $j('#chart_value' + (i+1)).html(data.total_values[i] == '' ? '&nbsp;' : data.total_values[i]); } SourcesCharts.chart.draw(); } } </script> <% action_panel :more => true do |p| -%> <% end -%> <% more_action_panel do |p| -%> <% @subpages.each do |page| -%> <%= p.link page[0], page[3] %> <% end -%> <% end -%> <hr/> <div class='admin_content'> <div align="center"> <%= render :partial => 'referrer_sources' %> </div> </div>
Add more actions button for the rest of the stats
Add more actions button for the rest of the stats
RHTML
mit
cykod/Webiva,treybean/Webiva-lis,cykod/Webiva,cykod/Webiva,treybean/Webiva-lis,treybean/Webiva-lis,treybean/Webiva-lis,cykod/Webiva,cykod/Webiva,treybean/Webiva-lis
rhtml
## Code Before: <script> SourcesCharts = { chart: null, date: "<%= @date.strftime('%F') %>", next: function() { $j.getJSON("<%= url_for :action => 'referrer_sources' %>", {date: SourcesCharts.date, direction: 'next'}, function(res) {SourcesCharts.load(res);}); }, prev: function() { $j.getJSON("<%= url_for :action => 'referrer_sources' %>", {date: SourcesCharts.date, direction: 'prev'}, function(res) {SourcesCharts.load(res);}); }, load: function(data) { SourcesCharts.date = data.date; SourcesCharts.chart.load(data); for(var i=0; i<data.total_values.length; i++) { $j('#chart_day' + (i+1)).text(data.days[i]); $j('#chart_date' + (i+1)).text(data.dates[i]); $j('#chart_value' + (i+1)).text(data.total_values[i] == '' ? '' : data.total_values[i]); } SourcesCharts.chart.draw(); } } </script> <div class='admin_content'> <%= subpage_display :emarketing, @subpages %> <br/> <br/> <div align="center"> <%= render :partial => 'referrer_sources' %> </div> </div> ## Instruction: Add more actions button for the rest of the stats ## Code After: <script> SourcesCharts = { chart: null, date: "<%= @date.strftime('%F') %>", next: function() { $j.getJSON("<%= url_for :action => 'referrer_sources' %>", {date: SourcesCharts.date, direction: 'next'}, function(res) {SourcesCharts.load(res);}); }, prev: function() { $j.getJSON("<%= url_for :action => 'referrer_sources' %>", {date: SourcesCharts.date, direction: 'prev'}, function(res) {SourcesCharts.load(res);}); }, load: function(data) { SourcesCharts.date = data.date; SourcesCharts.chart.load(data); for(var i=0; i<data.total_values.length; i++) { $j('#chart_day' + (i+1)).text(data.days[i]); $j('#chart_date' + (i+1)).text(data.dates[i]); $j('#chart_value' + (i+1)).html(data.total_values[i] == '' ? '&nbsp;' : data.total_values[i]); } SourcesCharts.chart.draw(); } } </script> <% action_panel :more => true do |p| -%> <% end -%> <% more_action_panel do |p| -%> <% @subpages.each do |page| -%> <%= p.link page[0], page[3] %> <% end -%> <% end -%> <hr/> <div class='admin_content'> <div align="center"> <%= render :partial => 'referrer_sources' %> </div> </div>
<script> SourcesCharts = { chart: null, date: "<%= @date.strftime('%F') %>", next: function() { $j.getJSON("<%= url_for :action => 'referrer_sources' %>", {date: SourcesCharts.date, direction: 'next'}, function(res) {SourcesCharts.load(res);}); }, prev: function() { $j.getJSON("<%= url_for :action => 'referrer_sources' %>", {date: SourcesCharts.date, direction: 'prev'}, function(res) {SourcesCharts.load(res);}); }, load: function(data) { SourcesCharts.date = data.date; SourcesCharts.chart.load(data); for(var i=0; i<data.total_values.length; i++) { $j('#chart_day' + (i+1)).text(data.days[i]); $j('#chart_date' + (i+1)).text(data.dates[i]); - $j('#chart_value' + (i+1)).text(data.total_values[i] == '' ? '' : data.total_values[i]); ? ^^^ + $j('#chart_value' + (i+1)).html(data.total_values[i] == '' ? '&nbsp;' : data.total_values[i]); ? + ^^ ++++++ } SourcesCharts.chart.draw(); } } </script> + <% action_panel :more => true do |p| -%> + <% end -%> + + <% more_action_panel do |p| -%> + <% @subpages.each do |page| -%> + <%= p.link page[0], page[3] %> + <% end -%> + <% end -%> + + <hr/> + <div class='admin_content'> - - <%= subpage_display :emarketing, @subpages %> - - <br/> - <br/> <div align="center"> <%= render :partial => 'referrer_sources' %> </div> </div>
18
0.45
12
6
d8bb247dfce89796164c4b146a1d0adc92ca6182
templates/studygroups/studygroupmeeting_form.html
templates/studygroups/studygroupmeeting_form.html
{% extends 'base.html' %} {% load crispy_forms_tags %} {% block content %} <div class="container learning-circle-signup"> <div class="row"> <div class="col-md-8 col-sm-12"> <form action="" method="POST"> {% csrf_token %} {% crispy form %} <p><button type="submit" class="btn btn-default">Save</button></p> </form> </div> </div> </div> {% endblock %}
{% extends 'base.html' %} {% load crispy_forms_tags %} {% block content %} <div class="container learning-circle-signup"> <div class="row"> <div class="col-md-8 col-sm-12"> <form action="" method="POST"> {% csrf_token %} {{ form|crispy }} <p><button type="submit" class="btn btn-default">Save</button></p> </form> </div> </div> </div> {% endblock %}
Fix problem with crispy forms
Fix problem with crispy forms
HTML
mit
p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles
html
## Code Before: {% extends 'base.html' %} {% load crispy_forms_tags %} {% block content %} <div class="container learning-circle-signup"> <div class="row"> <div class="col-md-8 col-sm-12"> <form action="" method="POST"> {% csrf_token %} {% crispy form %} <p><button type="submit" class="btn btn-default">Save</button></p> </form> </div> </div> </div> {% endblock %} ## Instruction: Fix problem with crispy forms ## Code After: {% extends 'base.html' %} {% load crispy_forms_tags %} {% block content %} <div class="container learning-circle-signup"> <div class="row"> <div class="col-md-8 col-sm-12"> <form action="" method="POST"> {% csrf_token %} {{ form|crispy }} <p><button type="submit" class="btn btn-default">Save</button></p> </form> </div> </div> </div> {% endblock %}
{% extends 'base.html' %} {% load crispy_forms_tags %} {% block content %} <div class="container learning-circle-signup"> <div class="row"> <div class="col-md-8 col-sm-12"> <form action="" method="POST"> {% csrf_token %} - {% crispy form %} + {{ form|crispy }} <p><button type="submit" class="btn btn-default">Save</button></p> </form> </div> </div> </div> {% endblock %}
2
0.125
1
1
197e27200e8d22a0d912dfceda846bb1ea6a402d
src/main/scala/modules/counter/guice/modules/CounterModule.scala
src/main/scala/modules/counter/guice/modules/CounterModule.scala
package modules.counter.guice.modules import akka.actor.{ActorRef, ActorSystem} import com.google.inject.name.Named import com.google.inject.{AbstractModule, Provides, Singleton} import core.services.persistence.PersistenceCleanup import modules.counter.services.count.CounterPersistentActor import net.codingwell.scalaguice.ScalaModule class CounterModule extends AbstractModule with ScalaModule { @Provides @Singleton @Named(CounterPersistentActor.name) def counterActor(actorSystem: ActorSystem, persistenceCleanup: PersistenceCleanup): ActorRef = { actorSystem.actorOf(CounterPersistentActor.props(persistenceCleanup)) } }
package modules.counter.guice.modules import akka.actor.{ActorRef, ActorSystem} import com.google.inject.Provides import com.google.inject.name.Named import modules.counter.repositories.{CounterRepo, CounterRepoImpl} import modules.counter.services.count.CounterActor import net.codingwell.scalaguice.ScalaModule import scala.concurrent.ExecutionContext class CounterModule extends ScalaModule { override def configure() { bind[CounterRepo].to[CounterRepoImpl] } @Provides @Named(CounterActor.name) def counterActor(actorSystem: ActorSystem, counterRepo: CounterRepo) (implicit executionContext: ExecutionContext): ActorRef = { actorSystem.actorOf(CounterActor.props(counterRepo)) } }
Add bind of 'CounterRepo' to implementation
Add bind of 'CounterRepo' to implementation
Scala
mit
sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-fullstack-starter-kit,sysgears/apollo-universal-starter-kit,sysgears/apollo-universal-starter-kit
scala
## Code Before: package modules.counter.guice.modules import akka.actor.{ActorRef, ActorSystem} import com.google.inject.name.Named import com.google.inject.{AbstractModule, Provides, Singleton} import core.services.persistence.PersistenceCleanup import modules.counter.services.count.CounterPersistentActor import net.codingwell.scalaguice.ScalaModule class CounterModule extends AbstractModule with ScalaModule { @Provides @Singleton @Named(CounterPersistentActor.name) def counterActor(actorSystem: ActorSystem, persistenceCleanup: PersistenceCleanup): ActorRef = { actorSystem.actorOf(CounterPersistentActor.props(persistenceCleanup)) } } ## Instruction: Add bind of 'CounterRepo' to implementation ## Code After: package modules.counter.guice.modules import akka.actor.{ActorRef, ActorSystem} import com.google.inject.Provides import com.google.inject.name.Named import modules.counter.repositories.{CounterRepo, CounterRepoImpl} import modules.counter.services.count.CounterActor import net.codingwell.scalaguice.ScalaModule import scala.concurrent.ExecutionContext class CounterModule extends ScalaModule { override def configure() { bind[CounterRepo].to[CounterRepoImpl] } @Provides @Named(CounterActor.name) def counterActor(actorSystem: ActorSystem, counterRepo: CounterRepo) (implicit executionContext: ExecutionContext): ActorRef = { actorSystem.actorOf(CounterActor.props(counterRepo)) } }
package modules.counter.guice.modules import akka.actor.{ActorRef, ActorSystem} + import com.google.inject.Provides import com.google.inject.name.Named + import modules.counter.repositories.{CounterRepo, CounterRepoImpl} - import com.google.inject.{AbstractModule, Provides, Singleton} - import core.services.persistence.PersistenceCleanup - import modules.counter.services.count.CounterPersistentActor ? ---------- + import modules.counter.services.count.CounterActor import net.codingwell.scalaguice.ScalaModule + import scala.concurrent.ExecutionContext + - class CounterModule extends AbstractModule with ScalaModule { ? -------------------- + class CounterModule extends ScalaModule { + + override def configure() { + bind[CounterRepo].to[CounterRepoImpl] + } @Provides - @Singleton - @Named(CounterPersistentActor.name) ? ---------- + @Named(CounterActor.name) - def counterActor(actorSystem: ActorSystem, persistenceCleanup: PersistenceCleanup): ActorRef = { + def counterActor(actorSystem: ActorSystem, counterRepo: CounterRepo) + (implicit executionContext: ExecutionContext): ActorRef = { - actorSystem.actorOf(CounterPersistentActor.props(persistenceCleanup)) ? ---------- ^ ^^^^ --------- + actorSystem.actorOf(CounterActor.props(counterRepo)) ? ^^^^^ ^ + } }
22
1.222222
14
8
8237291e194aa900857fe382d0b8cefb7806c331
ocradmin/ocrmodels/models.py
ocradmin/ocrmodels/models.py
from django.db import models from django.contrib.auth.models import User from tagging.fields import TagField import tagging # OCR model, erm, model class OcrModel(models.Model): """ OCR model objects. """ user = models.ForeignKey(User) derived_from = models.ForeignKey("self", null=True, blank=True) tags = TagField() name = models.CharField(max_length=100, unique=True) description = models.TextField(null=True, blank=True) created_on = models.DateField(auto_now_add=True) updated_on = models.DateField(null=True, blank=True) public = models.BooleanField(default=True) file = models.FileField(upload_to="models") type = models.CharField(max_length=20, choices=[("char", "Character"), ("lang", "Language")]) app = models.CharField(max_length=20, choices=[("ocropus", "Ocropus"), ("tesseract", "Tesseract")]) def __unicode__(self): """ String representation. """ return self.name
from django.db import models from django.contrib.auth.models import User from tagging.fields import TagField import tagging # OCR model, erm, model class OcrModel(models.Model): """ OCR model objects. """ user = models.ForeignKey(User) derived_from = models.ForeignKey("self", null=True, blank=True) tags = TagField() name = models.CharField(max_length=100, unique=True) description = models.TextField(null=True, blank=True) created_on = models.DateField(auto_now_add=True) updated_on = models.DateField(null=True, blank=True) public = models.BooleanField(default=True) file = models.FileField(upload_to="models") type = models.CharField(max_length=20, choices=[("char", "Character"), ("lang", "Language")]) app = models.CharField(max_length=20, choices=[("ocropus", "Ocropus"), ("tesseract", "Tesseract")]) def __unicode__(self): """ String representation. """ return "<%s: %s>" % (self.__class__.__name__, self.name)
Improve unicode method. Whitespace cleanup
Improve unicode method. Whitespace cleanup
Python
apache-2.0
vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium
python
## Code Before: from django.db import models from django.contrib.auth.models import User from tagging.fields import TagField import tagging # OCR model, erm, model class OcrModel(models.Model): """ OCR model objects. """ user = models.ForeignKey(User) derived_from = models.ForeignKey("self", null=True, blank=True) tags = TagField() name = models.CharField(max_length=100, unique=True) description = models.TextField(null=True, blank=True) created_on = models.DateField(auto_now_add=True) updated_on = models.DateField(null=True, blank=True) public = models.BooleanField(default=True) file = models.FileField(upload_to="models") type = models.CharField(max_length=20, choices=[("char", "Character"), ("lang", "Language")]) app = models.CharField(max_length=20, choices=[("ocropus", "Ocropus"), ("tesseract", "Tesseract")]) def __unicode__(self): """ String representation. """ return self.name ## Instruction: Improve unicode method. Whitespace cleanup ## Code After: from django.db import models from django.contrib.auth.models import User from tagging.fields import TagField import tagging # OCR model, erm, model class OcrModel(models.Model): """ OCR model objects. """ user = models.ForeignKey(User) derived_from = models.ForeignKey("self", null=True, blank=True) tags = TagField() name = models.CharField(max_length=100, unique=True) description = models.TextField(null=True, blank=True) created_on = models.DateField(auto_now_add=True) updated_on = models.DateField(null=True, blank=True) public = models.BooleanField(default=True) file = models.FileField(upload_to="models") type = models.CharField(max_length=20, choices=[("char", "Character"), ("lang", "Language")]) app = models.CharField(max_length=20, choices=[("ocropus", "Ocropus"), ("tesseract", "Tesseract")]) def __unicode__(self): """ String representation. """ return "<%s: %s>" % (self.__class__.__name__, self.name)
from django.db import models from django.contrib.auth.models import User from tagging.fields import TagField import tagging # OCR model, erm, model class OcrModel(models.Model): """ OCR model objects. """ user = models.ForeignKey(User) derived_from = models.ForeignKey("self", null=True, blank=True) tags = TagField() name = models.CharField(max_length=100, unique=True) description = models.TextField(null=True, blank=True) created_on = models.DateField(auto_now_add=True) updated_on = models.DateField(null=True, blank=True) public = models.BooleanField(default=True) file = models.FileField(upload_to="models") type = models.CharField(max_length=20, choices=[("char", "Character"), ("lang", "Language")]) app = models.CharField(max_length=20, choices=[("ocropus", "Ocropus"), ("tesseract", "Tesseract")]) - def __unicode__(self): """ String representation. """ - return self.name + return "<%s: %s>" % (self.__class__.__name__, self.name) - +
5
0.151515
2
3
51ac844e88a6cd30af2a9f2c0367eaada1e9c8dc
nassau/src/main/java/org/jvirtanen/nassau/MessageListener.java
nassau/src/main/java/org/jvirtanen/nassau/MessageListener.java
package org.jvirtanen.nassau; import java.io.IOException; import java.nio.ByteBuffer; /** * <code>MessageListener</code> is the interface for inbound messages. */ public interface MessageListener { /** * Receive a message. The message is contained in the buffer between the * current position and the limit. * * @param buffer a buffer * @throws IOException if an I/O error occurs */ void message(ByteBuffer buffer) throws IOException; }
package org.jvirtanen.nassau; import java.io.IOException; import java.nio.ByteBuffer; /** * The interface for inbound messages. */ public interface MessageListener { /** * Receive a message. The message is contained in the buffer between the * current position and the limit. * * @param buffer a buffer * @throws IOException if an I/O error occurs */ void message(ByteBuffer buffer) throws IOException; }
Tweak documentation for message listener
Tweak documentation for message listener
Java
apache-2.0
pmcs/nassau,pmcs/nassau,paritytrading/nassau,paritytrading/nassau
java
## Code Before: package org.jvirtanen.nassau; import java.io.IOException; import java.nio.ByteBuffer; /** * <code>MessageListener</code> is the interface for inbound messages. */ public interface MessageListener { /** * Receive a message. The message is contained in the buffer between the * current position and the limit. * * @param buffer a buffer * @throws IOException if an I/O error occurs */ void message(ByteBuffer buffer) throws IOException; } ## Instruction: Tweak documentation for message listener ## Code After: package org.jvirtanen.nassau; import java.io.IOException; import java.nio.ByteBuffer; /** * The interface for inbound messages. */ public interface MessageListener { /** * Receive a message. The message is contained in the buffer between the * current position and the limit. * * @param buffer a buffer * @throws IOException if an I/O error occurs */ void message(ByteBuffer buffer) throws IOException; }
package org.jvirtanen.nassau; import java.io.IOException; import java.nio.ByteBuffer; /** - * <code>MessageListener</code> is the interface for inbound messages. + * The interface for inbound messages. */ public interface MessageListener { /** * Receive a message. The message is contained in the buffer between the * current position and the limit. * * @param buffer a buffer * @throws IOException if an I/O error occurs */ void message(ByteBuffer buffer) throws IOException; }
2
0.1
1
1
b1b51c56f372adf4658200b7332bfd0ad19052ca
lib/simple_form/inputs/numeric_input.rb
lib/simple_form/inputs/numeric_input.rb
module SimpleForm module Inputs class NumericInput < Base def input @builder.text_field(attribute_name, input_html_options) end def input_html_options input_options = super input_options[:type] ||= "number" input_options[:size] ||= SimpleForm.default_input_size infer_attrs_from_validations(input_options) input_options end def input_html_classes super.unshift("numeric") end protected def infer_attrs_from_validations(input_options) obj = @builder.object return unless obj.class.respond_to?(:validators_on) validators = obj.class.validators_on(attribute_name) num_validator = validators.find {|v| v.is_a?(ActiveModel::Validations::NumericalityValidator) } return if num_validator.nil? options = num_validator.__send__(:options) input_options[:min] ||= options[:greater_than_or_equal_to] input_options[:max] ||= options[:less_than_or_equal_to] input_options[:step] ||= options[:only_integer] && 1 end end end end
module SimpleForm module Inputs class NumericInput < Base def input @builder.text_field(attribute_name, input_html_options) end def input_html_options input_options = super input_options[:type] ||= "number" input_options[:size] ||= SimpleForm.default_input_size infer_attrs_from_validations(input_options) input_options end def input_html_classes super.unshift("numeric") end protected def infer_attrs_from_validations(input_options) model_class = @builder.object.class # The model should include ActiveModel::Validations. return unless model_class.respond_to?(:validators_on) num_validator = find_numericality_validator(model_class) or return options = num_validator.__send__(:options) input_options[:min] ||= options[:greater_than_or_equal_to] input_options[:max] ||= options[:less_than_or_equal_to] input_options[:step] ||= options[:only_integer] && 1 end def find_numericality_validator(model_class) validators = model_class.validators_on(attribute_name) validators.find {|v| ActiveModel::Validations::NumericalityValidator === v } end end end end
Refactor the code a bit
Refactor the code a bit
Ruby
mit
jasnow/simple_form,wethu/simple_form,westonganger/simple_form,ktw1222/simple_form,patrick99e99/simple_form,alesshh/simple_form,dwilkie/simple_form,zlx/simple_form_bootstrap3,joshsoftware/simple_form,pcantrell/simple_form,mikeahmarani/simple_form,jobteaser/simple_form,alesshh/simple_form,Eric-Guo/simple_form,stevestmartin/simple_form,michael-gabenna/simple_form,makkrnic/simple_form,ktw1222/simple_form,PikachuEXE/simple_form,westonganger/simple_form,gauravtiwari/simple_form,maxArturo/simple_form,imton/simple_form,tingi/simple_form,react2media/simple_form,grnsimplicity/simple_form,tingi/simple_form,danielevans/simple_form,mikeahmarani/simple_form,zlx/simple_form_bootstrap3,gregmolnar/simple_form,react2media/simple_form,shaistaansari/simple_form,plataformatec/simple_form,cuongnguyen2503/simple_form,plataformatec/simple_form,sserrato/simple_form,travis-repos/simple_form,joshsoftware/simple_form,michael-gabenna/simple_form,gauravtiwari/simple_form,munirent/simple_form,makkrnic/simple_form,wethu/simple_form,stevestmartin/simple_form,sharma1nitish/simple_form,maxArturo/simple_form,munirent/simple_form,sserrato/simple_form,sharma1nitish/simple_form,grnsimplicity/simple_form,danielevans/simple_form,cuongnguyen2503/simple_form,jasnow/simple_form,Eric-Guo/simple_form,jobteaser/simple_form,sideci-sample/sideci-sample-simple_form,imton/simple_form,shaistaansari/simple_form,dwilkie/simple_form,gregmolnar/simple_form
ruby
## Code Before: module SimpleForm module Inputs class NumericInput < Base def input @builder.text_field(attribute_name, input_html_options) end def input_html_options input_options = super input_options[:type] ||= "number" input_options[:size] ||= SimpleForm.default_input_size infer_attrs_from_validations(input_options) input_options end def input_html_classes super.unshift("numeric") end protected def infer_attrs_from_validations(input_options) obj = @builder.object return unless obj.class.respond_to?(:validators_on) validators = obj.class.validators_on(attribute_name) num_validator = validators.find {|v| v.is_a?(ActiveModel::Validations::NumericalityValidator) } return if num_validator.nil? options = num_validator.__send__(:options) input_options[:min] ||= options[:greater_than_or_equal_to] input_options[:max] ||= options[:less_than_or_equal_to] input_options[:step] ||= options[:only_integer] && 1 end end end end ## Instruction: Refactor the code a bit ## Code After: module SimpleForm module Inputs class NumericInput < Base def input @builder.text_field(attribute_name, input_html_options) end def input_html_options input_options = super input_options[:type] ||= "number" input_options[:size] ||= SimpleForm.default_input_size infer_attrs_from_validations(input_options) input_options end def input_html_classes super.unshift("numeric") end protected def infer_attrs_from_validations(input_options) model_class = @builder.object.class # The model should include ActiveModel::Validations. return unless model_class.respond_to?(:validators_on) num_validator = find_numericality_validator(model_class) or return options = num_validator.__send__(:options) input_options[:min] ||= options[:greater_than_or_equal_to] input_options[:max] ||= options[:less_than_or_equal_to] input_options[:step] ||= options[:only_integer] && 1 end def find_numericality_validator(model_class) validators = model_class.validators_on(attribute_name) validators.find {|v| ActiveModel::Validations::NumericalityValidator === v } end end end end
module SimpleForm module Inputs class NumericInput < Base def input @builder.text_field(attribute_name, input_html_options) end def input_html_options input_options = super input_options[:type] ||= "number" input_options[:size] ||= SimpleForm.default_input_size infer_attrs_from_validations(input_options) input_options end def input_html_classes super.unshift("numeric") end protected def infer_attrs_from_validations(input_options) - obj = @builder.object ? ^^ + model_class = @builder.object.class ? + ^^^^^^^^^ ++++++ + # The model should include ActiveModel::Validations. - return unless obj.class.respond_to?(:validators_on) ? ^^^ + return unless model_class.respond_to?(:validators_on) ? + ^^^^ + num_validator = find_numericality_validator(model_class) or return - validators = obj.class.validators_on(attribute_name) - num_validator = validators.find {|v| v.is_a?(ActiveModel::Validations::NumericalityValidator) } - - return if num_validator.nil? options = num_validator.__send__(:options) input_options[:min] ||= options[:greater_than_or_equal_to] input_options[:max] ||= options[:less_than_or_equal_to] input_options[:step] ||= options[:only_integer] && 1 end + + def find_numericality_validator(model_class) + validators = model_class.validators_on(attribute_name) + validators.find {|v| ActiveModel::Validations::NumericalityValidator === v } + end end end end
15
0.357143
9
6
846a1145c3f9b49e61871229851886440313bcee
.travis.yml
.travis.yml
dist: trusty before_install: - sudo add-apt-repository ppa:jonathonf/texlive-2016 -y - sudo apt-get update install: - sudo apt-get install -y texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra texlive-lang-german texlive-generic-extra - wget https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/2.4/binaries/Linux/biber-linux_x86_64.tar.gz/download --output-document biber-linux_x86_64.tar.gz - tar -xvzf biber-linux_x86_64.tar.gz - sudo mv biber /usr/bin/ script: - pdflatex --version - biber --version - ./compile.sh
dist: trusty before_install: - sudo add-apt-repository ppa:jonathonf/texlive-2016 -y - sudo apt-get update install: - sudo apt-get install -y texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra texlive-lang-german texlive-generic-extra biber --no-install-recommends script: - pdflatex --version - biber --version - ./compile.sh
Install the same on TravisCI like in the Dockerfile
Install the same on TravisCI like in the Dockerfile
YAML
mit
koep/FOM-LaTeX-Template,andygrunwald/FOM-LaTeX-Template,andygrunwald/FOM-LaTeX-Template,koep/FOM-LaTeX-Template
yaml
## Code Before: dist: trusty before_install: - sudo add-apt-repository ppa:jonathonf/texlive-2016 -y - sudo apt-get update install: - sudo apt-get install -y texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra texlive-lang-german texlive-generic-extra - wget https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/2.4/binaries/Linux/biber-linux_x86_64.tar.gz/download --output-document biber-linux_x86_64.tar.gz - tar -xvzf biber-linux_x86_64.tar.gz - sudo mv biber /usr/bin/ script: - pdflatex --version - biber --version - ./compile.sh ## Instruction: Install the same on TravisCI like in the Dockerfile ## Code After: dist: trusty before_install: - sudo add-apt-repository ppa:jonathonf/texlive-2016 -y - sudo apt-get update install: - sudo apt-get install -y texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra texlive-lang-german texlive-generic-extra biber --no-install-recommends script: - pdflatex --version - biber --version - ./compile.sh
dist: trusty before_install: - sudo add-apt-repository ppa:jonathonf/texlive-2016 -y - sudo apt-get update install: - - sudo apt-get install -y texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra texlive-lang-german texlive-generic-extra + - sudo apt-get install -y texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-bibtex-extra texlive-lang-german texlive-generic-extra biber --no-install-recommends ? ++++++++++++++++++++++++++++++ - - wget https://sourceforge.net/projects/biblatex-biber/files/biblatex-biber/2.4/binaries/Linux/biber-linux_x86_64.tar.gz/download --output-document biber-linux_x86_64.tar.gz - - tar -xvzf biber-linux_x86_64.tar.gz - - sudo mv biber /usr/bin/ script: - pdflatex --version - biber --version - ./compile.sh
5
0.333333
1
4
723617ee5f627f7eb8b8204660482605a3aaffa5
docker-paas.yml
docker-paas.yml
www: build: public links: - turadmin ports: - "8080" restart: always turadmin: build: . ports: - "8080" environment: - APP_PORT=8080 - APP_URL - DNT_CONNECT_KEY - DNT_CONNECT_USER - NEW_RELIC_APP_NAME=Turadmin - NEW_RELIC_LICENSE_KEY - NEW_RELIC_LOG=stdout - NEW_RELIC_NO_CONFIG_FILE=true - NODE_ENV=production - NTB_API_ENV=api - NTB_API_KEY - NTB_API_URL=http://api.nasjonalturbase.no - ROUTING_API_URL - SENTRY_DNS restart: always
www: build: public links: - turadmin ports: - "8080" restart: always turadmin: build: . ports: - "8080" environment: - APP_PORT=8080 - APP_URL=http://tur.app.dnt.no - DNT_CONNECT_KEY - DNT_CONNECT_USER - NEW_RELIC_APP_NAME=Turadmin - NEW_RELIC_LICENSE_KEY - NEW_RELIC_LOG=stdout - NEW_RELIC_NO_CONFIG_FILE=true - NODE_ENV=production - NTB_API_ENV=api - NTB_API_KEY - NTB_API_URL=http://api.nasjonalturbase.no - ROUTING_API_URL - SENTRY_DNS restart: always
Set default APP_URL for Docker PaaS config
Set default APP_URL for Docker PaaS config
YAML
mit
Turistforeningen/Turadmin,Turistforeningen/Turadmin,Turistforeningen/Turadmin,Turistforeningen/Turadmin
yaml
## Code Before: www: build: public links: - turadmin ports: - "8080" restart: always turadmin: build: . ports: - "8080" environment: - APP_PORT=8080 - APP_URL - DNT_CONNECT_KEY - DNT_CONNECT_USER - NEW_RELIC_APP_NAME=Turadmin - NEW_RELIC_LICENSE_KEY - NEW_RELIC_LOG=stdout - NEW_RELIC_NO_CONFIG_FILE=true - NODE_ENV=production - NTB_API_ENV=api - NTB_API_KEY - NTB_API_URL=http://api.nasjonalturbase.no - ROUTING_API_URL - SENTRY_DNS restart: always ## Instruction: Set default APP_URL for Docker PaaS config ## Code After: www: build: public links: - turadmin ports: - "8080" restart: always turadmin: build: . ports: - "8080" environment: - APP_PORT=8080 - APP_URL=http://tur.app.dnt.no - DNT_CONNECT_KEY - DNT_CONNECT_USER - NEW_RELIC_APP_NAME=Turadmin - NEW_RELIC_LICENSE_KEY - NEW_RELIC_LOG=stdout - NEW_RELIC_NO_CONFIG_FILE=true - NODE_ENV=production - NTB_API_ENV=api - NTB_API_KEY - NTB_API_URL=http://api.nasjonalturbase.no - ROUTING_API_URL - SENTRY_DNS restart: always
www: build: public links: - turadmin ports: - "8080" restart: always turadmin: build: . ports: - "8080" environment: - APP_PORT=8080 - - APP_URL + - APP_URL=http://tur.app.dnt.no - DNT_CONNECT_KEY - DNT_CONNECT_USER - NEW_RELIC_APP_NAME=Turadmin - NEW_RELIC_LICENSE_KEY - NEW_RELIC_LOG=stdout - NEW_RELIC_NO_CONFIG_FILE=true - NODE_ENV=production - NTB_API_ENV=api - NTB_API_KEY - NTB_API_URL=http://api.nasjonalturbase.no - ROUTING_API_URL - SENTRY_DNS restart: always
2
0.071429
1
1
7f54079273ecc4d65cfd80b2a61391210b85604b
_config.yml
_config.yml
name: Nick Williams tagline: Full-stack developer with a passion for JavaScript. location: Leicestershire, UK twitter: http://twitter.com/nickwuh github: https://github.com/nilliams markdown: redcarpet pygments: false sass: sass_dir: _sass
name: Nick Williams tagline: Full-stack developer with a passion for JavaScript. location: Leicestershire, UK twitter: http://twitter.com/nickwuh github: https://github.com/nilliams markdown: redcarpet pygments: false permalink: /:title sass: sass_dir: _sass
Use blog-post title for url by default (reverts e0d914f)
Use blog-post title for url by default (reverts e0d914f)
YAML
mit
nilliams/jekyll-minimal-blog-theme,nilliams/jekyll-minimal-blog-theme,nilliams/jekyll-minimal-blog-theme
yaml
## Code Before: name: Nick Williams tagline: Full-stack developer with a passion for JavaScript. location: Leicestershire, UK twitter: http://twitter.com/nickwuh github: https://github.com/nilliams markdown: redcarpet pygments: false sass: sass_dir: _sass ## Instruction: Use blog-post title for url by default (reverts e0d914f) ## Code After: name: Nick Williams tagline: Full-stack developer with a passion for JavaScript. location: Leicestershire, UK twitter: http://twitter.com/nickwuh github: https://github.com/nilliams markdown: redcarpet pygments: false permalink: /:title sass: sass_dir: _sass
name: Nick Williams tagline: Full-stack developer with a passion for JavaScript. location: Leicestershire, UK twitter: http://twitter.com/nickwuh github: https://github.com/nilliams markdown: redcarpet pygments: false + permalink: /:title sass: sass_dir: _sass
1
0.111111
1
0
6438fc8108d214c6cb56e5d75253cad9acfd0334
templates/plugin.template.php
templates/plugin.template.php
<?php /** * Template file for notifications * * @package Dragooon:WeNotif * @author Shitiz "Dragooon" Garg <Email mail@dragooon.net> <Url http://smf-media.com> * @copyright 2012, Shitiz "Dragooon" Garg <mail@dragooon.net> * @license * Licensed under "New BSD License (3-clause version)" * http://www.opensource.org/licenses/BSD-3-Clause * @version 1.0 */ function template_notifications_block() { global $txt, $context, $settings, $scripturl; echo ' <section> <span class="note', $context['unread_notifications'] ? 'nice' : '', '" style="font-size: 9pt;">', $context['unread_notifications'], '</span>&nbsp; <a href="', $scripturl, '?action=notification" class="title">', $txt['notification_unread_title'], '</a>'; foreach ($context['quick_notifications'] as $notification) { echo ' <p class="description" style="font-size: 1em;" onclick="document.location = \'', $scripturl, '?action=notification;area=redirect;id=', $notification->getID(), '\'"> ', $notification->getText(), '<br /> <span class="smalltext">', timeformat($notification->getTime()), '</span> </p>'; } echo ' </section>'; } ?>
<?php /** * Template file for notifications * * @package Dragooon:WeNotif * @author Shitiz "Dragooon" Garg <Email mail@dragooon.net> <Url http://smf-media.com> * @copyright 2012, Shitiz "Dragooon" Garg <mail@dragooon.net> * @license * Licensed under "New BSD License (3-clause version)" * http://www.opensource.org/licenses/BSD-3-Clause * @version 1.0 */ function template_notifications_block() { global $txt, $context, $settings, $scripturl; echo ' <section> <span class="note', $context['unread_notifications'] ? 'nice' : '', '" style="font-size: 9pt;">', $context['unread_notifications'], '</span>&nbsp; <a href="', $scripturl, '?action=notification" class="title">', $txt['notification_unread_title'], '</a>'; foreach ($context['quick_notifications'] as $notification) { echo ' <p class="description" style="font-size: 1em; cursor: pointer;" onclick="document.location = \'', $scripturl, '?action=notification;area=redirect;id=', $notification->getID(), '\'"> ', $notification->getText(), '<br /> <span class="smalltext">', timeformat($notification->getTime()), '</span> </p>'; } echo ' </section>'; } ?>
Make the cursor as pointer for quick notifications
Make the cursor as pointer for quick notifications
PHP
bsd-3-clause
Dragooon/WeNotif,Dragooon/WeNotif,Dragooon/WeNotif
php
## Code Before: <?php /** * Template file for notifications * * @package Dragooon:WeNotif * @author Shitiz "Dragooon" Garg <Email mail@dragooon.net> <Url http://smf-media.com> * @copyright 2012, Shitiz "Dragooon" Garg <mail@dragooon.net> * @license * Licensed under "New BSD License (3-clause version)" * http://www.opensource.org/licenses/BSD-3-Clause * @version 1.0 */ function template_notifications_block() { global $txt, $context, $settings, $scripturl; echo ' <section> <span class="note', $context['unread_notifications'] ? 'nice' : '', '" style="font-size: 9pt;">', $context['unread_notifications'], '</span>&nbsp; <a href="', $scripturl, '?action=notification" class="title">', $txt['notification_unread_title'], '</a>'; foreach ($context['quick_notifications'] as $notification) { echo ' <p class="description" style="font-size: 1em;" onclick="document.location = \'', $scripturl, '?action=notification;area=redirect;id=', $notification->getID(), '\'"> ', $notification->getText(), '<br /> <span class="smalltext">', timeformat($notification->getTime()), '</span> </p>'; } echo ' </section>'; } ?> ## Instruction: Make the cursor as pointer for quick notifications ## Code After: <?php /** * Template file for notifications * * @package Dragooon:WeNotif * @author Shitiz "Dragooon" Garg <Email mail@dragooon.net> <Url http://smf-media.com> * @copyright 2012, Shitiz "Dragooon" Garg <mail@dragooon.net> * @license * Licensed under "New BSD License (3-clause version)" * http://www.opensource.org/licenses/BSD-3-Clause * @version 1.0 */ function template_notifications_block() { global $txt, $context, $settings, $scripturl; echo ' <section> <span class="note', $context['unread_notifications'] ? 'nice' : '', '" style="font-size: 9pt;">', $context['unread_notifications'], '</span>&nbsp; <a href="', $scripturl, '?action=notification" class="title">', $txt['notification_unread_title'], '</a>'; foreach ($context['quick_notifications'] as $notification) { echo ' <p class="description" style="font-size: 1em; cursor: pointer;" onclick="document.location = \'', $scripturl, '?action=notification;area=redirect;id=', $notification->getID(), '\'"> ', $notification->getText(), '<br /> <span class="smalltext">', timeformat($notification->getTime()), '</span> </p>'; } echo ' </section>'; } ?>
<?php /** * Template file for notifications * * @package Dragooon:WeNotif * @author Shitiz "Dragooon" Garg <Email mail@dragooon.net> <Url http://smf-media.com> * @copyright 2012, Shitiz "Dragooon" Garg <mail@dragooon.net> * @license * Licensed under "New BSD License (3-clause version)" * http://www.opensource.org/licenses/BSD-3-Clause * @version 1.0 */ function template_notifications_block() { global $txt, $context, $settings, $scripturl; echo ' <section> <span class="note', $context['unread_notifications'] ? 'nice' : '', '" style="font-size: 9pt;">', $context['unread_notifications'], '</span>&nbsp; <a href="', $scripturl, '?action=notification" class="title">', $txt['notification_unread_title'], '</a>'; foreach ($context['quick_notifications'] as $notification) { echo ' - <p class="description" style="font-size: 1em;" onclick="document.location = \'', $scripturl, '?action=notification;area=redirect;id=', $notification->getID(), '\'"> + <p class="description" style="font-size: 1em; cursor: pointer;" onclick="document.location = \'', $scripturl, '?action=notification;area=redirect;id=', $notification->getID(), '\'"> ? +++++++++++++++++ ', $notification->getText(), '<br /> <span class="smalltext">', timeformat($notification->getTime()), '</span> </p>'; } echo ' </section>'; } ?>
2
0.060606
1
1
68b3c1b5a93b20ffcbeffb051b3c4fdf6c1eab23
client/desktop/app/components/Profile.js
client/desktop/app/components/Profile.js
import React from 'react' import {Route, RouteHandler, Link, Button} from 'react-router' class Profile extends React.Component { constructor(props){ super(props); this.state = { teacherData: { name: 'Teachy McTeacherton', email: 'teachy@teach.er' } }; } render(){ return( <div> <h2 className='sectionHeading'>Settings</h2> <div className='profile' style={{marginLeft: '20%'}}> <div > <span>Name: </span><span>{this.state.teacherData.name}</span> </div> <div> <span>Email: </span><span>{this.state.teacherData.email}</span> </div> <li onClick={()=>{ auth.logout(); }}> </li> </div> <button style={{marginLeft: '20%'}}>Logout</button> </div> ) } } module.exports = Profile;
import React from 'react' import {Route, RouteHandler, Link, Button} from 'react-router' var auth = require('./../utils/auth'); class Profile extends React.Component { constructor(props){ super(props); this.state = { teacherData: { name: 'Teachy McTeacherton', email: 'teachy@teach.er' } }; } handleLogout() { auth.logout(); this.context.router.push({ pathname: '/login' }); } render(){ return( <div> <h2 className='sectionHeading'>Settings</h2> <div className='profile' style={{marginLeft: '20%'}}> <div > <span>Name: </span><span>{this.state.teacherData.name}</span> </div> <div> <span>Email: </span><span>{this.state.teacherData.email}</span> </div> <li onClick={this.handleLogout.bind(this)}> </li> </div> <button style={{marginLeft: '20%'}}>Logout</button> </div> ) } } Profile.contextTypes = { router: React.PropTypes.any.isRequired }; module.exports = Profile;
Add functionality to logout button
Add functionality to logout button
JavaScript
mit
absurdSquid/thumbroll,Jakeyrob/thumbroll,Jakeyrob/thumbroll,shanemcgraw/thumbroll,Jakeyrob/thumbroll,shanemcgraw/thumbroll,shanemcgraw/thumbroll,absurdSquid/thumbroll
javascript
## Code Before: import React from 'react' import {Route, RouteHandler, Link, Button} from 'react-router' class Profile extends React.Component { constructor(props){ super(props); this.state = { teacherData: { name: 'Teachy McTeacherton', email: 'teachy@teach.er' } }; } render(){ return( <div> <h2 className='sectionHeading'>Settings</h2> <div className='profile' style={{marginLeft: '20%'}}> <div > <span>Name: </span><span>{this.state.teacherData.name}</span> </div> <div> <span>Email: </span><span>{this.state.teacherData.email}</span> </div> <li onClick={()=>{ auth.logout(); }}> </li> </div> <button style={{marginLeft: '20%'}}>Logout</button> </div> ) } } module.exports = Profile; ## Instruction: Add functionality to logout button ## Code After: import React from 'react' import {Route, RouteHandler, Link, Button} from 'react-router' var auth = require('./../utils/auth'); class Profile extends React.Component { constructor(props){ super(props); this.state = { teacherData: { name: 'Teachy McTeacherton', email: 'teachy@teach.er' } }; } handleLogout() { auth.logout(); this.context.router.push({ pathname: '/login' }); } render(){ return( <div> <h2 className='sectionHeading'>Settings</h2> <div className='profile' style={{marginLeft: '20%'}}> <div > <span>Name: </span><span>{this.state.teacherData.name}</span> </div> <div> <span>Email: </span><span>{this.state.teacherData.email}</span> </div> <li onClick={this.handleLogout.bind(this)}> </li> </div> <button style={{marginLeft: '20%'}}>Logout</button> </div> ) } } Profile.contextTypes = { router: React.PropTypes.any.isRequired }; module.exports = Profile;
import React from 'react' import {Route, RouteHandler, Link, Button} from 'react-router' + var auth = require('./../utils/auth'); class Profile extends React.Component { constructor(props){ super(props); this.state = { teacherData: { name: 'Teachy McTeacherton', email: 'teachy@teach.er' } }; + } + + handleLogout() { + auth.logout(); + this.context.router.push({ + pathname: '/login' + }); } render(){ return( <div> <h2 className='sectionHeading'>Settings</h2> <div className='profile' style={{marginLeft: '20%'}}> <div > <span>Name: </span><span>{this.state.teacherData.name}</span> </div> <div> <span>Email: </span><span>{this.state.teacherData.email}</span> </div> + <li onClick={this.handleLogout.bind(this)}> - - <li onClick={()=>{ auth.logout(); - }}> </li> </div> <button style={{marginLeft: '20%'}}>Logout</button> </div> ) } } + Profile.contextTypes = { + router: React.PropTypes.any.isRequired + }; module.exports = Profile;
15
0.375
12
3
235a226ac582e25a05f4e69cb5f6415049ea01ed
.travis.yml
.travis.yml
language: python python: - 3.5 sudo: false env: - TOXENV=py27-django18 - TOXENV=pypy-django18 - TOXENV=py34-django18 - TOXENV=py27-django19 - TOXENV=pypy-django19 - TOXENV=py34-django19 - TOXENV=py35-django19 docsinstall: pip install -q tox script: tox deploy: provider: pypi user: jazzband distributions: "sdist bdist_wheel" password: secure: rECBwGxp/D0BcaNe6lW0XSjLOMkQLXm/Etft+l+wxhZZxkoaS5t38pWb1/wvWBuPa9I0GagRPbqap72PYJeEgS4BIgsIP8YRTxkggDJ6+CtecyMBxWWSKc94QW/x2HETQ1cYGsLwXgMEGV4WkjzKUUM3SYTjfz0jkMfMv0szufQ= on: tags: true repo: jazzband/django-pipeline condition: "$TOXENV = py27-django19" notifications: email: false
language: python python: - 3.5 sudo: false env: - TOXENV=py27-django16 - TOXENV=py34-django16 - TOXENV=pypy-django16 - TOXENV=py27-django17 - TOXENV=py34-django17 - TOXENV=pypy-django17 - TOXENV=py27-django18 - TOXENV=pypy-django18 - TOXENV=py34-django18 - TOXENV=py27-django19 - TOXENV=pypy-django19 - TOXENV=py34-django19 - TOXENV=py35-django19 docsinstall: pip install -q tox script: tox deploy: provider: pypi user: jazzband distributions: "sdist bdist_wheel" password: secure: rECBwGxp/D0BcaNe6lW0XSjLOMkQLXm/Etft+l+wxhZZxkoaS5t38pWb1/wvWBuPa9I0GagRPbqap72PYJeEgS4BIgsIP8YRTxkggDJ6+CtecyMBxWWSKc94QW/x2HETQ1cYGsLwXgMEGV4WkjzKUUM3SYTjfz0jkMfMv0szufQ= on: tags: true repo: jazzband/django-pipeline condition: "$TOXENV = py27-django19" notifications: email: false
Add new Django versions to TravisCI file
Add new Django versions to TravisCI file
YAML
mit
chipx86/django-pipeline,beedesk/django-pipeline,sideffect0/django-pipeline,kronion/django-pipeline,chipx86/django-pipeline,theatlantic/django-pipeline,d9pouces/django-pipeline,theatlantic/django-pipeline,kronion/django-pipeline,sideffect0/django-pipeline,d9pouces/django-pipeline,lexqt/django-pipeline,theatlantic/django-pipeline,cyberdelia/django-pipeline,cyberdelia/django-pipeline,lexqt/django-pipeline,jazzband/django-pipeline,beedesk/django-pipeline,beedesk/django-pipeline,jazzband/django-pipeline,kronion/django-pipeline,sideffect0/django-pipeline,jazzband/django-pipeline,d9pouces/django-pipeline,chipx86/django-pipeline,lexqt/django-pipeline,cyberdelia/django-pipeline
yaml
## Code Before: language: python python: - 3.5 sudo: false env: - TOXENV=py27-django18 - TOXENV=pypy-django18 - TOXENV=py34-django18 - TOXENV=py27-django19 - TOXENV=pypy-django19 - TOXENV=py34-django19 - TOXENV=py35-django19 docsinstall: pip install -q tox script: tox deploy: provider: pypi user: jazzband distributions: "sdist bdist_wheel" password: secure: rECBwGxp/D0BcaNe6lW0XSjLOMkQLXm/Etft+l+wxhZZxkoaS5t38pWb1/wvWBuPa9I0GagRPbqap72PYJeEgS4BIgsIP8YRTxkggDJ6+CtecyMBxWWSKc94QW/x2HETQ1cYGsLwXgMEGV4WkjzKUUM3SYTjfz0jkMfMv0szufQ= on: tags: true repo: jazzband/django-pipeline condition: "$TOXENV = py27-django19" notifications: email: false ## Instruction: Add new Django versions to TravisCI file ## Code After: language: python python: - 3.5 sudo: false env: - TOXENV=py27-django16 - TOXENV=py34-django16 - TOXENV=pypy-django16 - TOXENV=py27-django17 - TOXENV=py34-django17 - TOXENV=pypy-django17 - TOXENV=py27-django18 - TOXENV=pypy-django18 - TOXENV=py34-django18 - TOXENV=py27-django19 - TOXENV=pypy-django19 - TOXENV=py34-django19 - TOXENV=py35-django19 docsinstall: pip install -q tox script: tox deploy: provider: pypi user: jazzband distributions: "sdist bdist_wheel" password: secure: rECBwGxp/D0BcaNe6lW0XSjLOMkQLXm/Etft+l+wxhZZxkoaS5t38pWb1/wvWBuPa9I0GagRPbqap72PYJeEgS4BIgsIP8YRTxkggDJ6+CtecyMBxWWSKc94QW/x2HETQ1cYGsLwXgMEGV4WkjzKUUM3SYTjfz0jkMfMv0szufQ= on: tags: true repo: jazzband/django-pipeline condition: "$TOXENV = py27-django19" notifications: email: false
language: python python: - 3.5 sudo: false env: + - TOXENV=py27-django16 + - TOXENV=py34-django16 + - TOXENV=pypy-django16 + - TOXENV=py27-django17 + - TOXENV=py34-django17 + - TOXENV=pypy-django17 - TOXENV=py27-django18 - TOXENV=pypy-django18 - TOXENV=py34-django18 - TOXENV=py27-django19 - TOXENV=pypy-django19 - TOXENV=py34-django19 - TOXENV=py35-django19 docsinstall: pip install -q tox script: tox deploy: provider: pypi user: jazzband distributions: "sdist bdist_wheel" password: secure: rECBwGxp/D0BcaNe6lW0XSjLOMkQLXm/Etft+l+wxhZZxkoaS5t38pWb1/wvWBuPa9I0GagRPbqap72PYJeEgS4BIgsIP8YRTxkggDJ6+CtecyMBxWWSKc94QW/x2HETQ1cYGsLwXgMEGV4WkjzKUUM3SYTjfz0jkMfMv0szufQ= on: tags: true repo: jazzband/django-pipeline condition: "$TOXENV = py27-django19" notifications: email: false
6
0.230769
6
0
09c2c73e46b974e33f7d7aab4515510484b4538b
app/views/article/_article_links.html.erb
app/views/article/_article_links.html.erb
<div id="context_wrapper" class="inside-column"> <p> <%= link_to("Read pages that mention #{@article.title} in all works.", :controller => 'display', :action => 'read_all_works', :article_id => @article.id) %> </p> <p><%= link_to("Graph of subjects related to #{@article.title}", { :controller => 'article', :action => 'graph', :article_id => @article.id }) %> </p> <p>Pages that refer to <%= @article.title %>:</p> <p> <% for link in @article.page_article_links %> <%= link_to(link.page.title, { :controller => 'display', :action=> 'display_page', :page_id => link.page.id })%> (<%= raw(link.display_text) %>)<br /> <% end %> </p> <p>Subject articles that refer to <%= @article.title %>:</p> <p> <% for link in @article.target_article_links %> <%= link_to(link.source_article.title, { :controller => 'article', :action=> 'show', :article_id => link.source_article.id })%> (<%= link.display_text %>)<br /> <% end %> </p> </div> </div>
<div id="context_wrapper" class="inside-column"> <p> <%= link_to("Read pages that mention #{@article.title} in all works.", :controller => 'display', :action => 'read_all_works', :article_id => @article.id) %> </p> <p><%= link_to("Graph of subjects related to #{@article.title}", { :controller => 'article', :action => 'graph', :article_id => @article.id }) %> </p> <p>Pages that refer to <%= @article.title %>:</p> <p> <% for link in @article.page_article_links %> <%= link_to(link.page.title, { :controller => 'display', :action=> 'display_page', :page_id => link.page.id })%> (<%= raw(link.display_text) %>)<br /> <% end %> </p> <% if @article.target_article_links.count > 0 %> <p>Subject articles that refer to <%= @article.title %>:</p> <p> <% for link in @article.target_article_links %> <%= link_to(link.source_article.title, { :controller => 'article', :action=> 'show', :article_id => link.source_article.id })%> (<%= link.display_text %>)<br /> <% end %> </p> <% end %> </div> </div>
Remove inter-article links section unless they exist
Remove inter-article links section unless they exist
HTML+ERB
agpl-3.0
benwbrum/fromthepage,benwbrum/fromthepage,benwbrum/fromthepage,benwbrum/fromthepage
html+erb
## Code Before: <div id="context_wrapper" class="inside-column"> <p> <%= link_to("Read pages that mention #{@article.title} in all works.", :controller => 'display', :action => 'read_all_works', :article_id => @article.id) %> </p> <p><%= link_to("Graph of subjects related to #{@article.title}", { :controller => 'article', :action => 'graph', :article_id => @article.id }) %> </p> <p>Pages that refer to <%= @article.title %>:</p> <p> <% for link in @article.page_article_links %> <%= link_to(link.page.title, { :controller => 'display', :action=> 'display_page', :page_id => link.page.id })%> (<%= raw(link.display_text) %>)<br /> <% end %> </p> <p>Subject articles that refer to <%= @article.title %>:</p> <p> <% for link in @article.target_article_links %> <%= link_to(link.source_article.title, { :controller => 'article', :action=> 'show', :article_id => link.source_article.id })%> (<%= link.display_text %>)<br /> <% end %> </p> </div> </div> ## Instruction: Remove inter-article links section unless they exist ## Code After: <div id="context_wrapper" class="inside-column"> <p> <%= link_to("Read pages that mention #{@article.title} in all works.", :controller => 'display', :action => 'read_all_works', :article_id => @article.id) %> </p> <p><%= link_to("Graph of subjects related to #{@article.title}", { :controller => 'article', :action => 'graph', :article_id => @article.id }) %> </p> <p>Pages that refer to <%= @article.title %>:</p> <p> <% for link in @article.page_article_links %> <%= link_to(link.page.title, { :controller => 'display', :action=> 'display_page', :page_id => link.page.id })%> (<%= raw(link.display_text) %>)<br /> <% end %> </p> <% if @article.target_article_links.count > 0 %> <p>Subject articles that refer to <%= @article.title %>:</p> <p> <% for link in @article.target_article_links %> <%= link_to(link.source_article.title, { :controller => 'article', :action=> 'show', :article_id => link.source_article.id })%> (<%= link.display_text %>)<br /> <% end %> </p> <% end %> </div> </div>
<div id="context_wrapper" class="inside-column"> <p> <%= link_to("Read pages that mention #{@article.title} in all works.", :controller => 'display', :action => 'read_all_works', :article_id => @article.id) %> </p> <p><%= link_to("Graph of subjects related to #{@article.title}", { :controller => 'article', :action => 'graph', :article_id => @article.id }) %> </p> <p>Pages that refer to <%= @article.title %>:</p> <p> <% for link in @article.page_article_links %> <%= link_to(link.page.title, { :controller => 'display', :action=> 'display_page', :page_id => link.page.id })%> (<%= raw(link.display_text) %>)<br /> <% end %> </p> + <% if @article.target_article_links.count > 0 %> - <p>Subject articles that refer to <%= @article.title %>:</p> + <p>Subject articles that refer to <%= @article.title %>:</p> ? + - <p> + <p> ? + - <% for link in @article.target_article_links %> + <% for link in @article.target_article_links %> ? + - <%= link_to(link.source_article.title, + <%= link_to(link.source_article.title, ? + - { :controller => 'article', + { :controller => 'article', ? + - :action=> 'show', + :action=> 'show', ? + - :article_id => link.source_article.id })%> + :article_id => link.source_article.id })%> ? + - (<%= link.display_text %>)<br /> + (<%= link.display_text %>)<br /> ? + - <% end %> + <% end %> ? + - </p> + </p> ? + + <% end %> </div> </div>
22
0.647059
12
10
49e601a6e9327046407cf748df53a5c27e4c2123
test/test_main.ml
test/test_main.ml
open OUnit let base_suite = "base_suite" >::: [ Test_config.test; ] let _ = run_test_tt_main base_suite
open OUnit let base_suite = "base_suite" >::: [ Test_config.test; ] let () = OUnit2.run_test_tt_main (OUnit.ounit2_of_ounit1 base_suite)
Make sure tests don't exit 0 even when they fail
Make sure tests don't exit 0 even when they fail Signed-off-by: John Else <37b74501daa612e48fea94f9846ed4ddeb6a8f07@citrix.com>
OCaml
isc
johnelse/gpumon,johnelse/gpumon,xenserver/gpumon
ocaml
## Code Before: open OUnit let base_suite = "base_suite" >::: [ Test_config.test; ] let _ = run_test_tt_main base_suite ## Instruction: Make sure tests don't exit 0 even when they fail Signed-off-by: John Else <37b74501daa612e48fea94f9846ed4ddeb6a8f07@citrix.com> ## Code After: open OUnit let base_suite = "base_suite" >::: [ Test_config.test; ] let () = OUnit2.run_test_tt_main (OUnit.ounit2_of_ounit1 base_suite)
open OUnit let base_suite = "base_suite" >::: [ Test_config.test; ] - let _ = run_test_tt_main base_suite + let () = + OUnit2.run_test_tt_main (OUnit.ounit2_of_ounit1 base_suite)
3
0.333333
2
1
730a394e755102fadfb7b378ad7297c695944601
pkgs/tools/security/hologram/default.nix
pkgs/tools/security/hologram/default.nix
{ stdenv, lib, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }: buildGoPackage rec { name = "hologram-${version}"; version = "20170130-${stdenv.lib.strings.substring 0 7 rev}"; rev = "d20d1c30379e7010e8f9c428a5b9e82f54d390e1"; src = fetchgit { inherit rev; url = "https://github.com/AdRoll/hologram"; sha256 = "0dg5kfs16kf2gzhpmzsg83qzi2pxgnc9g81lw5zpa6fmzpa9kgsn"; }; goPackagePath = "github.com/AdRoll/hologram"; goDeps = ./deps.nix; meta = with stdenv.lib; { homepage = https://github.com/AdRoll/hologram/; description = "Easy, painless AWS credentials on developer laptops."; maintainers = with maintainers; [ nand0p ]; platforms = platforms.all; license = licenses.asl20; }; }
{ stdenv, lib, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }: buildGoPackage rec { name = "hologram-${version}"; version = "20170130-${stdenv.lib.strings.substring 0 7 rev}"; rev = "d20d1c30379e7010e8f9c428a5b9e82f54d390e1"; src = fetchgit { inherit rev; url = "https://github.com/AdRoll/hologram"; sha256 = "0dg5kfs16kf2gzhpmzsg83qzi2pxgnc9g81lw5zpa6fmzpa9kgsn"; }; goPackagePath = "github.com/AdRoll/hologram"; goDeps = ./deps.nix; preConfigure = '' sed -i 's|cacheTimeout != 3600|cacheTimeout != 0|' cmd/hologram-server/main.go ''; meta = with stdenv.lib; { homepage = https://github.com/AdRoll/hologram/; description = "Easy, painless AWS credentials on developer laptops."; maintainers = with maintainers; [ nand0p ]; platforms = platforms.all; license = licenses.asl20; }; }
Fix hologram server with go versions > 1.4, no fix yet upstream.
Fix hologram server with go versions > 1.4, no fix yet upstream. (cherry picked from commit cbfb35a145287f9c18c801ffaf4f36967f1bd563)
Nix
mit
NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs
nix
## Code Before: { stdenv, lib, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }: buildGoPackage rec { name = "hologram-${version}"; version = "20170130-${stdenv.lib.strings.substring 0 7 rev}"; rev = "d20d1c30379e7010e8f9c428a5b9e82f54d390e1"; src = fetchgit { inherit rev; url = "https://github.com/AdRoll/hologram"; sha256 = "0dg5kfs16kf2gzhpmzsg83qzi2pxgnc9g81lw5zpa6fmzpa9kgsn"; }; goPackagePath = "github.com/AdRoll/hologram"; goDeps = ./deps.nix; meta = with stdenv.lib; { homepage = https://github.com/AdRoll/hologram/; description = "Easy, painless AWS credentials on developer laptops."; maintainers = with maintainers; [ nand0p ]; platforms = platforms.all; license = licenses.asl20; }; } ## Instruction: Fix hologram server with go versions > 1.4, no fix yet upstream. (cherry picked from commit cbfb35a145287f9c18c801ffaf4f36967f1bd563) ## Code After: { stdenv, lib, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }: buildGoPackage rec { name = "hologram-${version}"; version = "20170130-${stdenv.lib.strings.substring 0 7 rev}"; rev = "d20d1c30379e7010e8f9c428a5b9e82f54d390e1"; src = fetchgit { inherit rev; url = "https://github.com/AdRoll/hologram"; sha256 = "0dg5kfs16kf2gzhpmzsg83qzi2pxgnc9g81lw5zpa6fmzpa9kgsn"; }; goPackagePath = "github.com/AdRoll/hologram"; goDeps = ./deps.nix; preConfigure = '' sed -i 's|cacheTimeout != 3600|cacheTimeout != 0|' cmd/hologram-server/main.go ''; meta = with stdenv.lib; { homepage = https://github.com/AdRoll/hologram/; description = "Easy, painless AWS credentials on developer laptops."; maintainers = with maintainers; [ nand0p ]; platforms = platforms.all; license = licenses.asl20; }; }
{ stdenv, lib, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }: buildGoPackage rec { name = "hologram-${version}"; version = "20170130-${stdenv.lib.strings.substring 0 7 rev}"; rev = "d20d1c30379e7010e8f9c428a5b9e82f54d390e1"; src = fetchgit { inherit rev; url = "https://github.com/AdRoll/hologram"; sha256 = "0dg5kfs16kf2gzhpmzsg83qzi2pxgnc9g81lw5zpa6fmzpa9kgsn"; }; goPackagePath = "github.com/AdRoll/hologram"; goDeps = ./deps.nix; + preConfigure = '' + sed -i 's|cacheTimeout != 3600|cacheTimeout != 0|' cmd/hologram-server/main.go + ''; + meta = with stdenv.lib; { homepage = https://github.com/AdRoll/hologram/; description = "Easy, painless AWS credentials on developer laptops."; maintainers = with maintainers; [ nand0p ]; platforms = platforms.all; license = licenses.asl20; }; }
4
0.16
4
0
af5f2c4a3ee20bc18308ffa4d508588a7b5d0f59
.travis.yml
.travis.yml
language: cpp compiler: clang script: - mkdir _build - cd _build - cmake .. - cmake --build .
language: cpp compiler: clang before_install: - sudo add-apt-repository --yes ppa:jamie-snape/tubetk - sudo apt-get update -qq - sudo apt-get install -qq libgdcm2-dev libinsighttoolkit-dev script: - mkdir _build - cd _build - cmake -DUSE_SYSTEM_ITK:BOOL=ON .. - cmake --build .
Use binary Debian package of ITK for Travis CI builds
ENH: Use binary Debian package of ITK for Travis CI builds
YAML
apache-2.0
KitwareMedical/ImageViewer,thewtex/ImageViewer,aylward/ImageViewer
yaml
## Code Before: language: cpp compiler: clang script: - mkdir _build - cd _build - cmake .. - cmake --build . ## Instruction: ENH: Use binary Debian package of ITK for Travis CI builds ## Code After: language: cpp compiler: clang before_install: - sudo add-apt-repository --yes ppa:jamie-snape/tubetk - sudo apt-get update -qq - sudo apt-get install -qq libgdcm2-dev libinsighttoolkit-dev script: - mkdir _build - cd _build - cmake -DUSE_SYSTEM_ITK:BOOL=ON .. - cmake --build .
language: cpp compiler: clang + before_install: + - sudo add-apt-repository --yes ppa:jamie-snape/tubetk + - sudo apt-get update -qq + - sudo apt-get install -qq libgdcm2-dev libinsighttoolkit-dev + script: - mkdir _build - cd _build - - cmake .. + - cmake -DUSE_SYSTEM_ITK:BOOL=ON .. - cmake --build .
7
0.777778
6
1
f0945d30ba8a2581467397abae00db1e55847ef7
_config.yml
_config.yml
title: Martin Seeler email: blog@chasmo.de description: "About programming and trading" baseurl: "" url: "http://martinseeler.github.io" twitter_username: Chasmo90 github_username: MartinSeeler timezone: "Europe/Berlin" lsi: false # Build settings markdown: kramdown kramdown: input: GFM #redcarpet: # extensions: ["smart", "tables", "no_intra_emphasis", "fenced_code_blocks", "autolink", "strikethrough", "superscript", "with_toc_data"] permalink: "/:title.html" safe: true exclude: ["bower_components/", "node_modules/", "package.json", "bower.json", "Gulpfile.*", "LICENSE", "README.md"]
title: Martin Seeler email: blog@chasmo.de description: "About programming and trading" baseurl: "" url: "http://www.martinseeler.com" twitter_username: Chasmo90 github_username: MartinSeeler timezone: "Europe/Berlin" lsi: false # Build settings markdown: kramdown kramdown: input: GFM permalink: "/:title.html" safe: true exclude: ["bower_components/", "node_modules/", "package.json", "bower.json", "Gulpfile.*", "LICENSE", "README.md"]
Change url of jekyll page to martinseeler.com
Change url of jekyll page to martinseeler.com
YAML
mit
MartinSeeler/MartinSeeler.github.io,MartinSeeler/MartinSeeler.github.io
yaml
## Code Before: title: Martin Seeler email: blog@chasmo.de description: "About programming and trading" baseurl: "" url: "http://martinseeler.github.io" twitter_username: Chasmo90 github_username: MartinSeeler timezone: "Europe/Berlin" lsi: false # Build settings markdown: kramdown kramdown: input: GFM #redcarpet: # extensions: ["smart", "tables", "no_intra_emphasis", "fenced_code_blocks", "autolink", "strikethrough", "superscript", "with_toc_data"] permalink: "/:title.html" safe: true exclude: ["bower_components/", "node_modules/", "package.json", "bower.json", "Gulpfile.*", "LICENSE", "README.md"] ## Instruction: Change url of jekyll page to martinseeler.com ## Code After: title: Martin Seeler email: blog@chasmo.de description: "About programming and trading" baseurl: "" url: "http://www.martinseeler.com" twitter_username: Chasmo90 github_username: MartinSeeler timezone: "Europe/Berlin" lsi: false # Build settings markdown: kramdown kramdown: input: GFM permalink: "/:title.html" safe: true exclude: ["bower_components/", "node_modules/", "package.json", "bower.json", "Gulpfile.*", "LICENSE", "README.md"]
title: Martin Seeler email: blog@chasmo.de description: "About programming and trading" baseurl: "" - url: "http://martinseeler.github.io" ? ^^^^^^^^ + url: "http://www.martinseeler.com" ? ++++ ^ + twitter_username: Chasmo90 github_username: MartinSeeler timezone: "Europe/Berlin" lsi: false # Build settings markdown: kramdown kramdown: input: GFM - #redcarpet: - # extensions: ["smart", "tables", "no_intra_emphasis", "fenced_code_blocks", "autolink", "strikethrough", "superscript", "with_toc_data"] permalink: "/:title.html" safe: true exclude: ["bower_components/", "node_modules/", "package.json", "bower.json", "Gulpfile.*", "LICENSE", "README.md"]
4
0.190476
1
3
60661e5cbcba4aea817f7fa1625287dbb7a1aeb4
.travis.yml
.travis.yml
language: cpp compiler: - gcc - clang before_install: - ./Install-OpenCV/get_latest_version_download_file.sh before_script: - mkdir bin script: make skin-detect
language: cpp compiler: - gcc - clang before_install: - chmod +x Install-OpenCV/Ubuntu/opencv_latest.sh - ./Install-OpenCV/Ubuntu/opencv_latest.sh before_script: - mkdir bin script: make skin-detect
Set execute flag before trying to execute
Set execute flag before trying to execute
YAML
mit
JamieMagee/skin-detect
yaml
## Code Before: language: cpp compiler: - gcc - clang before_install: - ./Install-OpenCV/get_latest_version_download_file.sh before_script: - mkdir bin script: make skin-detect ## Instruction: Set execute flag before trying to execute ## Code After: language: cpp compiler: - gcc - clang before_install: - chmod +x Install-OpenCV/Ubuntu/opencv_latest.sh - ./Install-OpenCV/Ubuntu/opencv_latest.sh before_script: - mkdir bin script: make skin-detect
language: cpp compiler: - gcc - clang before_install: - - ./Install-OpenCV/get_latest_version_download_file.sh + - chmod +x Install-OpenCV/Ubuntu/opencv_latest.sh + - ./Install-OpenCV/Ubuntu/opencv_latest.sh before_script: - mkdir bin script: make skin-detect
3
0.230769
2
1
fb6f02f42efc172bed02a29244a8e9eace4631de
contrib/packs/actions/install.meta.yaml
contrib/packs/actions/install.meta.yaml
--- name: "install" runner_type: "action-chain" description: "Installs packs from st2-contrib into local content repository. Will download pack, load the actions, sensors and rules from the pack. Note that install require reboot of some st2 services." enabled: true entry_point: "workflows/install.yaml" parameters: packs: type: "array" items: type: "string" required: true repo_url: type: "string" default: "StackStorm/st2contrib" branch: type: "string" default: "master" subtree: type: "boolean" description: "Set to true if packs are located in a packs/ directory and not in the repository root" default: false register: type: "string" default: "actions,aliases,sensors" description: "Possible options are all, sensors, actions, rules, aliases." env: type: "object" description: "Optional environment variables" required: false
--- name: "install" runner_type: "action-chain" description: "Installs packs from st2-contrib into local content repository. Will download pack, load the actions, sensors and rules from the pack. Note that install require reboot of some st2 services." enabled: true entry_point: "workflows/install.yaml" parameters: packs: type: "array" items: type: "string" required: true repo_url: type: "string" default: "StackStorm/st2contrib" branch: type: "string" default: "master" subtree: type: "boolean" description: "Set to true if packs are located in a packs/ directory and not in the repository root" default: false register: type: "string" default: "actions,aliases,sensors,triggers" description: "Possible options are all, triggers, sensors, actions, rules, aliases." env: type: "object" description: "Optional environment variables" required: false
Update packs.install to also register triggers (trigger types) by default.
Update packs.install to also register triggers (trigger types) by default.
YAML
apache-2.0
nzlosh/st2,nzlosh/st2,StackStorm/st2,emedvedev/st2,StackStorm/st2,punalpatel/st2,peak6/st2,pixelrebel/st2,emedvedev/st2,nzlosh/st2,Plexxi/st2,peak6/st2,StackStorm/st2,peak6/st2,StackStorm/st2,nzlosh/st2,tonybaloney/st2,pixelrebel/st2,Plexxi/st2,punalpatel/st2,Plexxi/st2,tonybaloney/st2,lakshmi-kannan/st2,lakshmi-kannan/st2,pixelrebel/st2,emedvedev/st2,Plexxi/st2,lakshmi-kannan/st2,punalpatel/st2,tonybaloney/st2
yaml
## Code Before: --- name: "install" runner_type: "action-chain" description: "Installs packs from st2-contrib into local content repository. Will download pack, load the actions, sensors and rules from the pack. Note that install require reboot of some st2 services." enabled: true entry_point: "workflows/install.yaml" parameters: packs: type: "array" items: type: "string" required: true repo_url: type: "string" default: "StackStorm/st2contrib" branch: type: "string" default: "master" subtree: type: "boolean" description: "Set to true if packs are located in a packs/ directory and not in the repository root" default: false register: type: "string" default: "actions,aliases,sensors" description: "Possible options are all, sensors, actions, rules, aliases." env: type: "object" description: "Optional environment variables" required: false ## Instruction: Update packs.install to also register triggers (trigger types) by default. ## Code After: --- name: "install" runner_type: "action-chain" description: "Installs packs from st2-contrib into local content repository. Will download pack, load the actions, sensors and rules from the pack. Note that install require reboot of some st2 services." enabled: true entry_point: "workflows/install.yaml" parameters: packs: type: "array" items: type: "string" required: true repo_url: type: "string" default: "StackStorm/st2contrib" branch: type: "string" default: "master" subtree: type: "boolean" description: "Set to true if packs are located in a packs/ directory and not in the repository root" default: false register: type: "string" default: "actions,aliases,sensors,triggers" description: "Possible options are all, triggers, sensors, actions, rules, aliases." env: type: "object" description: "Optional environment variables" required: false
--- name: "install" runner_type: "action-chain" description: "Installs packs from st2-contrib into local content repository. Will download pack, load the actions, sensors and rules from the pack. Note that install require reboot of some st2 services." enabled: true entry_point: "workflows/install.yaml" parameters: packs: type: "array" items: type: "string" required: true repo_url: type: "string" default: "StackStorm/st2contrib" branch: type: "string" default: "master" subtree: type: "boolean" description: "Set to true if packs are located in a packs/ directory and not in the repository root" default: false register: type: "string" - default: "actions,aliases,sensors" + default: "actions,aliases,sensors,triggers" ? +++++++++ - description: "Possible options are all, sensors, actions, rules, aliases." + description: "Possible options are all, triggers, sensors, actions, rules, aliases." ? ++++++++++ env: type: "object" description: "Optional environment variables" required: false
4
0.125
2
2
78b3f2c509e3bda127fa78f00b534b25e8dd83c1
metadata.json
metadata.json
{ "name": "zleslie-ldapquery", "version": "1.0.3", "author": "Zach Leslie", "summary": "Query an LDAP server using Puppet.", "license": "Apache-2.0", "source": "https://github.com/xaque208/puppet-ldapquery", "project_page": "https://github.com/xaque208/puppet-ldapquery", "issues_url": "https://github.com/xaque208/puppet-ldapquery/issues", "dependencies": [ ] }
{ "name": "zleslie-ldapquery", "version": "1.0.3", "author": "Zach Leslie", "summary": "Query an LDAP server using Puppet.", "license": "Apache-2.0", "source": "https://github.com/xaque208/puppet-ldapquery", "project_page": "https://github.com/xaque208/puppet-ldapquery", "issues_url": "https://github.com/xaque208/puppet-ldapquery/issues", "requirements": [ { "name": "puppet", "version_requirement": ">= 5.5.8 < 7.0.0" } ], "dependencies": [ ] }
Declare support for Puppet 5 & 6
Declare support for Puppet 5 & 6
JSON
apache-2.0
xaque208/puppet-ldapquery,xaque208/puppet-ldapquery
json
## Code Before: { "name": "zleslie-ldapquery", "version": "1.0.3", "author": "Zach Leslie", "summary": "Query an LDAP server using Puppet.", "license": "Apache-2.0", "source": "https://github.com/xaque208/puppet-ldapquery", "project_page": "https://github.com/xaque208/puppet-ldapquery", "issues_url": "https://github.com/xaque208/puppet-ldapquery/issues", "dependencies": [ ] } ## Instruction: Declare support for Puppet 5 & 6 ## Code After: { "name": "zleslie-ldapquery", "version": "1.0.3", "author": "Zach Leslie", "summary": "Query an LDAP server using Puppet.", "license": "Apache-2.0", "source": "https://github.com/xaque208/puppet-ldapquery", "project_page": "https://github.com/xaque208/puppet-ldapquery", "issues_url": "https://github.com/xaque208/puppet-ldapquery/issues", "requirements": [ { "name": "puppet", "version_requirement": ">= 5.5.8 < 7.0.0" } ], "dependencies": [ ] }
{ "name": "zleslie-ldapquery", "version": "1.0.3", "author": "Zach Leslie", "summary": "Query an LDAP server using Puppet.", "license": "Apache-2.0", "source": "https://github.com/xaque208/puppet-ldapquery", "project_page": "https://github.com/xaque208/puppet-ldapquery", "issues_url": "https://github.com/xaque208/puppet-ldapquery/issues", + "requirements": [ + { + "name": "puppet", + "version_requirement": ">= 5.5.8 < 7.0.0" + } + ], "dependencies": [ ] }
6
0.461538
6
0
2077023bb0022a89d6bc4bb93b0ebb45ea3af045
utils/jenkins/deploy-to-local-docker.sh
utils/jenkins/deploy-to-local-docker.sh
echo "Creating Working Directory" mkdir server/target/docker_deploy # Copying Dockerfile to working Directory echo "Copying Dockerfile" cp utils/jenkins/Dockerfile server/target/docker_deploy # Copying server.jar in working Directory echo "Copying server.jar" cp server/target/server-1.0-SNAPSHOT.jar server/target/docker_deploy/server.jar echo "Navigating into Working Directory" cd server/target/docker_deploy echo "Stopping old container (if running)" docker stop toscana || true echo "Deleting Container" docker rm toscana || true echo "Deleting Docker image (if present)" docker rmi toscana/toscana:alpine-build || true echo "Building Docker image" docker build . -t toscana/toscana:alpine-build echo "Running Docker image" docker run -d -p 9001:8080 -v toscana_data:/toscana/data --restart=unless-stopped --name=toscana toscana/toscana:alpine-build cd .. echo "Removing Working Directory" rm -r docker_deploy
echo "Creating Working Directory" mkdir server/target/docker_deploy # Copying Dockerfile to working Directory echo "Copying Dockerfile" cp utils/jenkins/Dockerfile server/target/docker_deploy # Copying server.jar in working Directory echo "Copying server.jar" cp server/target/server-1.0-SNAPSHOT.jar server/target/docker_deploy/server.jar echo "Navigating into Working Directory" cd server/target/docker_deploy echo "Stopping old container (if running)" docker stop toscana || true echo "Deleting Container" docker rm toscana || true echo "Deleting Docker image (if present)" docker rmi toscana/toscana:alpine-build || true echo "Building Docker image" docker build . -t toscana/toscana:alpine-build echo "Running Docker image" docker run -d -p 127.0.0.1:9001:8080 -v toscana_data:/toscana/data --restart=unless-stopped --name=toscana toscana/toscana:alpine-build cd .. echo "Removing Working Directory" rm -r docker_deploy
Fix Port binding of TOSCAna deployed by jenkins
Fix Port binding of TOSCAna deployed by jenkins The script not binds the instance to 127.0.0.1. To forward it some sort of proxy is needed. This step is necessary, because firewall restrictions dont apply to docker.
Shell
apache-2.0
StuPro-TOSCAna/TOSCAna,StuPro-TOSCAna/TOSCAna,StuPro-TOSCAna/TOSCAna,StuPro-TOSCAna/TOSCAna,StuPro-TOSCAna/TOSCAna,StuPro-TOSCAna/TOSCAna,StuPro-TOSCAna/TOSCAna
shell
## Code Before: echo "Creating Working Directory" mkdir server/target/docker_deploy # Copying Dockerfile to working Directory echo "Copying Dockerfile" cp utils/jenkins/Dockerfile server/target/docker_deploy # Copying server.jar in working Directory echo "Copying server.jar" cp server/target/server-1.0-SNAPSHOT.jar server/target/docker_deploy/server.jar echo "Navigating into Working Directory" cd server/target/docker_deploy echo "Stopping old container (if running)" docker stop toscana || true echo "Deleting Container" docker rm toscana || true echo "Deleting Docker image (if present)" docker rmi toscana/toscana:alpine-build || true echo "Building Docker image" docker build . -t toscana/toscana:alpine-build echo "Running Docker image" docker run -d -p 9001:8080 -v toscana_data:/toscana/data --restart=unless-stopped --name=toscana toscana/toscana:alpine-build cd .. echo "Removing Working Directory" rm -r docker_deploy ## Instruction: Fix Port binding of TOSCAna deployed by jenkins The script not binds the instance to 127.0.0.1. To forward it some sort of proxy is needed. This step is necessary, because firewall restrictions dont apply to docker. ## Code After: echo "Creating Working Directory" mkdir server/target/docker_deploy # Copying Dockerfile to working Directory echo "Copying Dockerfile" cp utils/jenkins/Dockerfile server/target/docker_deploy # Copying server.jar in working Directory echo "Copying server.jar" cp server/target/server-1.0-SNAPSHOT.jar server/target/docker_deploy/server.jar echo "Navigating into Working Directory" cd server/target/docker_deploy echo "Stopping old container (if running)" docker stop toscana || true echo "Deleting Container" docker rm toscana || true echo "Deleting Docker image (if present)" docker rmi toscana/toscana:alpine-build || true echo "Building Docker image" docker build . -t toscana/toscana:alpine-build echo "Running Docker image" docker run -d -p 127.0.0.1:9001:8080 -v toscana_data:/toscana/data --restart=unless-stopped --name=toscana toscana/toscana:alpine-build cd .. echo "Removing Working Directory" rm -r docker_deploy
echo "Creating Working Directory" mkdir server/target/docker_deploy # Copying Dockerfile to working Directory echo "Copying Dockerfile" cp utils/jenkins/Dockerfile server/target/docker_deploy # Copying server.jar in working Directory echo "Copying server.jar" cp server/target/server-1.0-SNAPSHOT.jar server/target/docker_deploy/server.jar echo "Navigating into Working Directory" cd server/target/docker_deploy echo "Stopping old container (if running)" docker stop toscana || true echo "Deleting Container" docker rm toscana || true echo "Deleting Docker image (if present)" docker rmi toscana/toscana:alpine-build || true echo "Building Docker image" docker build . -t toscana/toscana:alpine-build echo "Running Docker image" - docker run -d -p 9001:8080 -v toscana_data:/toscana/data --restart=unless-stopped --name=toscana toscana/toscana:alpine-build + docker run -d -p 127.0.0.1:9001:8080 -v toscana_data:/toscana/data --restart=unless-stopped --name=toscana toscana/toscana:alpine-build ? ++++++++++ cd .. echo "Removing Working Directory" rm -r docker_deploy
2
0.066667
1
1
3cbf04d036beff8e1a980bd81e9e28fe0683f118
templates/markdown/cv.md
templates/markdown/cv.md
--- layout: layout title: CV --- <section class="content"> # {{ name.first }} {{ name.last }} <section class="byline"> [PDF]({{ pdf }}) &bull; [source]({{ src }}) &bull; Generated on {{ today }} </section> {{ body }} </section>
--- layout: layout title: 'Brandon Amos: CV' --- <section class="content"> # {{ name.first }} {{ name.last }}: CV <section class="byline"> [PDF]({{ pdf }}) &bull; [source]({{ src }}) &bull; Generated on {{ today }} </section> {{ body }} </section>
Tweak heading and markdown title.
Tweak heading and markdown title.
Markdown
mit
bamos/cv
markdown
## Code Before: --- layout: layout title: CV --- <section class="content"> # {{ name.first }} {{ name.last }} <section class="byline"> [PDF]({{ pdf }}) &bull; [source]({{ src }}) &bull; Generated on {{ today }} </section> {{ body }} </section> ## Instruction: Tweak heading and markdown title. ## Code After: --- layout: layout title: 'Brandon Amos: CV' --- <section class="content"> # {{ name.first }} {{ name.last }}: CV <section class="byline"> [PDF]({{ pdf }}) &bull; [source]({{ src }}) &bull; Generated on {{ today }} </section> {{ body }} </section>
--- layout: layout - title: CV + title: 'Brandon Amos: CV' --- <section class="content"> - # {{ name.first }} {{ name.last }} + # {{ name.first }} {{ name.last }}: CV ? ++++ <section class="byline"> [PDF]({{ pdf }}) &bull; [source]({{ src }}) &bull; Generated on {{ today }} </section> {{ body }} </section>
4
0.210526
2
2
1dc7383a2f51c225f0138792eff6d35dc35dac8c
infinite_memcached/tests.py
infinite_memcached/tests.py
import time from django.test import TestCase from infinite_memcached.cache import MemcachedCache class InfiniteMemcached(TestCase): def test_handle_timeouts(self): mc = MemcachedCache( server="127.0.0.1:11211", params={}, ) self.assertEqual(0, mc._get_memcache_timeout(0)) self.assertEqual(60, mc._get_memcache_timeout(60)) self.assertEqual(300, mc._get_memcache_timeout(None)) # For timeouts over 30 days, the expire time is stored as a # UNIX timestamp. Just make sure that happens. sixty_days = (60*60*24*60) self.assertEqual(int(time.time() + sixty_days), mc._get_memcache_timeout(sixty_days))
import time from django.test import TestCase from django.core.cache import get_cache class InfiniteMemcached(TestCase): def test_handle_timeouts(self): mc = get_cache('infinite_memcached.cache.MemcachedCache', LOCATION='127.0.0.1:11211') self.assertEqual(0, mc._get_memcache_timeout(0)) self.assertEqual(60, mc._get_memcache_timeout(60)) self.assertEqual(300, mc._get_memcache_timeout(None)) # For timeouts over 30 days, the expire time is stored as a # UNIX timestamp. Just make sure that happens. sixty_days = (60*60*24*60) self.assertEqual(int(time.time() + sixty_days), mc._get_memcache_timeout(sixty_days))
Load the backend with get_cache
Load the backend with get_cache
Python
bsd-3-clause
edavis/django-infinite-memcached,edavis/django-infinite-memcached
python
## Code Before: import time from django.test import TestCase from infinite_memcached.cache import MemcachedCache class InfiniteMemcached(TestCase): def test_handle_timeouts(self): mc = MemcachedCache( server="127.0.0.1:11211", params={}, ) self.assertEqual(0, mc._get_memcache_timeout(0)) self.assertEqual(60, mc._get_memcache_timeout(60)) self.assertEqual(300, mc._get_memcache_timeout(None)) # For timeouts over 30 days, the expire time is stored as a # UNIX timestamp. Just make sure that happens. sixty_days = (60*60*24*60) self.assertEqual(int(time.time() + sixty_days), mc._get_memcache_timeout(sixty_days)) ## Instruction: Load the backend with get_cache ## Code After: import time from django.test import TestCase from django.core.cache import get_cache class InfiniteMemcached(TestCase): def test_handle_timeouts(self): mc = get_cache('infinite_memcached.cache.MemcachedCache', LOCATION='127.0.0.1:11211') self.assertEqual(0, mc._get_memcache_timeout(0)) self.assertEqual(60, mc._get_memcache_timeout(60)) self.assertEqual(300, mc._get_memcache_timeout(None)) # For timeouts over 30 days, the expire time is stored as a # UNIX timestamp. Just make sure that happens. sixty_days = (60*60*24*60) self.assertEqual(int(time.time() + sixty_days), mc._get_memcache_timeout(sixty_days))
import time from django.test import TestCase - from infinite_memcached.cache import MemcachedCache + from django.core.cache import get_cache class InfiniteMemcached(TestCase): def test_handle_timeouts(self): + mc = get_cache('infinite_memcached.cache.MemcachedCache', + LOCATION='127.0.0.1:11211') + - mc = MemcachedCache( - server="127.0.0.1:11211", - params={}, - ) self.assertEqual(0, mc._get_memcache_timeout(0)) self.assertEqual(60, mc._get_memcache_timeout(60)) self.assertEqual(300, mc._get_memcache_timeout(None)) # For timeouts over 30 days, the expire time is stored as a # UNIX timestamp. Just make sure that happens. sixty_days = (60*60*24*60) self.assertEqual(int(time.time() + sixty_days), mc._get_memcache_timeout(sixty_days))
9
0.473684
4
5
b1c7efd773495a84b383868e9e812d7170480d02
src/MessageBus/WrapsMessageHandlingInTransaction.php
src/MessageBus/WrapsMessageHandlingInTransaction.php
<?php namespace SimpleBus\DoctrineORMBridge\MessageBus; use Doctrine\ORM\EntityManager; use Doctrine\Persistence\ManagerRegistry; use SimpleBus\Message\Bus\Middleware\MessageBusMiddleware; use Throwable; class WrapsMessageHandlingInTransaction implements MessageBusMiddleware { /** * @var ManagerRegistry */ private $managerRegistry; /** * @var string */ private $entityManagerName; /** * @param string $entityManagerName */ public function __construct(ManagerRegistry $managerRegistry, $entityManagerName) { $this->managerRegistry = $managerRegistry; $this->entityManagerName = $entityManagerName; } public function handle($message, callable $next) { $entityManager = $this->managerRegistry->getManager($this->entityManagerName); /* @var $entityManager EntityManager */ try { $entityManager->transactional( function () use ($message, $next) { $next($message); } ); } catch (Throwable $error) { $this->managerRegistry->resetManager($this->entityManagerName); throw $error; } } }
<?php namespace SimpleBus\DoctrineORMBridge\MessageBus; use Doctrine\ORM\EntityManager; use Doctrine\Persistence\ManagerRegistry; use SimpleBus\Message\Bus\Middleware\MessageBusMiddleware; use Throwable; class WrapsMessageHandlingInTransaction implements MessageBusMiddleware { /** * @var ManagerRegistry */ private $managerRegistry; /** * @var string */ private $entityManagerName; /** * @param string $entityManagerName */ public function __construct(ManagerRegistry $managerRegistry, $entityManagerName) { $this->managerRegistry = $managerRegistry; $this->entityManagerName = $entityManagerName; } public function handle($message, callable $next) { /** @var $entityManager EntityManager */ $entityManager = $this->managerRegistry->getManager($this->entityManagerName); try { $entityManager->transactional( function () use ($message, $next) { $next($message); } ); } catch (Throwable $error) { $this->managerRegistry->resetManager($this->entityManagerName); throw $error; } } }
Move the `/* @var` syntax above
Move the `/* @var` syntax above
PHP
mit
SimpleBus/DoctrineORMBridge
php
## Code Before: <?php namespace SimpleBus\DoctrineORMBridge\MessageBus; use Doctrine\ORM\EntityManager; use Doctrine\Persistence\ManagerRegistry; use SimpleBus\Message\Bus\Middleware\MessageBusMiddleware; use Throwable; class WrapsMessageHandlingInTransaction implements MessageBusMiddleware { /** * @var ManagerRegistry */ private $managerRegistry; /** * @var string */ private $entityManagerName; /** * @param string $entityManagerName */ public function __construct(ManagerRegistry $managerRegistry, $entityManagerName) { $this->managerRegistry = $managerRegistry; $this->entityManagerName = $entityManagerName; } public function handle($message, callable $next) { $entityManager = $this->managerRegistry->getManager($this->entityManagerName); /* @var $entityManager EntityManager */ try { $entityManager->transactional( function () use ($message, $next) { $next($message); } ); } catch (Throwable $error) { $this->managerRegistry->resetManager($this->entityManagerName); throw $error; } } } ## Instruction: Move the `/* @var` syntax above ## Code After: <?php namespace SimpleBus\DoctrineORMBridge\MessageBus; use Doctrine\ORM\EntityManager; use Doctrine\Persistence\ManagerRegistry; use SimpleBus\Message\Bus\Middleware\MessageBusMiddleware; use Throwable; class WrapsMessageHandlingInTransaction implements MessageBusMiddleware { /** * @var ManagerRegistry */ private $managerRegistry; /** * @var string */ private $entityManagerName; /** * @param string $entityManagerName */ public function __construct(ManagerRegistry $managerRegistry, $entityManagerName) { $this->managerRegistry = $managerRegistry; $this->entityManagerName = $entityManagerName; } public function handle($message, callable $next) { /** @var $entityManager EntityManager */ $entityManager = $this->managerRegistry->getManager($this->entityManagerName); try { $entityManager->transactional( function () use ($message, $next) { $next($message); } ); } catch (Throwable $error) { $this->managerRegistry->resetManager($this->entityManagerName); throw $error; } } }
<?php namespace SimpleBus\DoctrineORMBridge\MessageBus; use Doctrine\ORM\EntityManager; use Doctrine\Persistence\ManagerRegistry; use SimpleBus\Message\Bus\Middleware\MessageBusMiddleware; use Throwable; class WrapsMessageHandlingInTransaction implements MessageBusMiddleware { /** * @var ManagerRegistry */ private $managerRegistry; /** * @var string */ private $entityManagerName; /** * @param string $entityManagerName */ public function __construct(ManagerRegistry $managerRegistry, $entityManagerName) { $this->managerRegistry = $managerRegistry; $this->entityManagerName = $entityManagerName; } public function handle($message, callable $next) { + /** @var $entityManager EntityManager */ $entityManager = $this->managerRegistry->getManager($this->entityManagerName); - /* @var $entityManager EntityManager */ try { $entityManager->transactional( function () use ($message, $next) { $next($message); } ); } catch (Throwable $error) { $this->managerRegistry->resetManager($this->entityManagerName); throw $error; } } }
2
0.041667
1
1
94a8cf63a91f371314fd6a8e93d97b3ef266ceff
src/clj/aspire/templates.clj
src/clj/aspire/templates.clj
(ns aspire.templates (:require [net.cgrand.enlive-html :as en] [hiccup.core :as hc])) (en/deftemplate index "public/index.html" [user-display-name] [:script] nil [:body] (en/append {:tag "script" :attrs {:type "text/javascript" :src "js/aspire.js"}}))
(ns aspire.templates (:require [net.cgrand.enlive-html :as en] [hiccup.core :as hc])) (defn render [template] (reduce str template)) (en/deftemplate index "public/index.html" [user-display-name] [:script] nil [:body] (en/append {:tag "script" :attrs {:type "text/javascript" :src "js/aspire.js"}}))
Add a 'render fn for deftemplate --> strings.
Add a 'render fn for deftemplate --> strings. This keeps liberator happier.
Clojure
epl-1.0
vlacs/navigator-archive
clojure
## Code Before: (ns aspire.templates (:require [net.cgrand.enlive-html :as en] [hiccup.core :as hc])) (en/deftemplate index "public/index.html" [user-display-name] [:script] nil [:body] (en/append {:tag "script" :attrs {:type "text/javascript" :src "js/aspire.js"}})) ## Instruction: Add a 'render fn for deftemplate --> strings. This keeps liberator happier. ## Code After: (ns aspire.templates (:require [net.cgrand.enlive-html :as en] [hiccup.core :as hc])) (defn render [template] (reduce str template)) (en/deftemplate index "public/index.html" [user-display-name] [:script] nil [:body] (en/append {:tag "script" :attrs {:type "text/javascript" :src "js/aspire.js"}}))
(ns aspire.templates (:require [net.cgrand.enlive-html :as en] [hiccup.core :as hc])) + + (defn render [template] + (reduce str template)) (en/deftemplate index "public/index.html" [user-display-name] [:script] nil [:body] (en/append {:tag "script" :attrs {:type "text/javascript" :src "js/aspire.js"}}))
3
0.25
3
0
730de95b183cdd885f4bae58b6b2f7d38f50ed40
src/Wave/Framework/External/Phroute/Filters/After/Encoding.php
src/Wave/Framework/External/Phroute/Filters/After/Encoding.php
<?php namespace Wave\Framework\External\Phroute\Filters\After; use Wave\Framework\Application\Wave; class Encoding { /** * Sets the content type to `application/json` */ public function useJSON() { Wave::getResponse()->withHeader('content-type', 'application/json'); } /** * Sets the content type to `text/xml` */ public function useXML() { Wave::getResponse()->withHeader('content-type', 'text/xml'); } /** * Sets the content type to `text/html` */ public function useHTML() { Wave::getResponse()->withHeader('content-type', 'text/html'); } public function usePlain() { Wave::getResponse()->withHeader('content-type', 'text/plain'); } }
<?php namespace Wave\Framework\External\Phroute\Filters\After; use Wave\Framework\Application\Wave; class Encoding { const ENC_JSON = 'application/json'; const ENC_XML = 'text/xml'; const ENC_HTML = 'text/html'; const ENC_PLAIN = 'text/plain'; private function verifyAcceptance($type) { $header = '*/*'; if (Wave::getRequest()->hasHeader('Accept')) { $header = Wave::getRequest()->getHeader('Accept'); } /** * if wildcard is not provided (* / *) and the content type is not found * in the Accept header, set the response to 406 (Not Acceptable). * * Assumes that if no content type is provided, the client accepts anything (* / *) */ if (strpos($header, $type) === false && strpos($header, '*/*') === false) { Wave::getResponse()->withStatus(406); } } /** * Sets the content type to `application/json` */ public function useJSON() { $this->verifyAcceptance(self::ENC_JSON); Wave::getResponse()->withHeader('content-type', 'application/json'); } /** * Sets the content type to `text/xml` */ public function useXML() { $this->verifyAcceptance(self::ENC_XML); Wave::getResponse()->withHeader('content-type', 'text/xml'); } /** * Sets the content type to `text/html` */ public function useHTML() { $this->verifyAcceptance(self::ENC_HTML); Wave::getResponse()->withHeader('content-type', 'text/html'); } public function usePlain() { $this->verifyAcceptance(self::ENC_PLAIN); Wave::getResponse()->withHeader('content-type', 'text/plain'); } }
Check if the return content type is within the Accept header
Check if the return content type is within the Accept header
PHP
mit
DaGhostman/codewave
php
## Code Before: <?php namespace Wave\Framework\External\Phroute\Filters\After; use Wave\Framework\Application\Wave; class Encoding { /** * Sets the content type to `application/json` */ public function useJSON() { Wave::getResponse()->withHeader('content-type', 'application/json'); } /** * Sets the content type to `text/xml` */ public function useXML() { Wave::getResponse()->withHeader('content-type', 'text/xml'); } /** * Sets the content type to `text/html` */ public function useHTML() { Wave::getResponse()->withHeader('content-type', 'text/html'); } public function usePlain() { Wave::getResponse()->withHeader('content-type', 'text/plain'); } } ## Instruction: Check if the return content type is within the Accept header ## Code After: <?php namespace Wave\Framework\External\Phroute\Filters\After; use Wave\Framework\Application\Wave; class Encoding { const ENC_JSON = 'application/json'; const ENC_XML = 'text/xml'; const ENC_HTML = 'text/html'; const ENC_PLAIN = 'text/plain'; private function verifyAcceptance($type) { $header = '*/*'; if (Wave::getRequest()->hasHeader('Accept')) { $header = Wave::getRequest()->getHeader('Accept'); } /** * if wildcard is not provided (* / *) and the content type is not found * in the Accept header, set the response to 406 (Not Acceptable). * * Assumes that if no content type is provided, the client accepts anything (* / *) */ if (strpos($header, $type) === false && strpos($header, '*/*') === false) { Wave::getResponse()->withStatus(406); } } /** * Sets the content type to `application/json` */ public function useJSON() { $this->verifyAcceptance(self::ENC_JSON); Wave::getResponse()->withHeader('content-type', 'application/json'); } /** * Sets the content type to `text/xml` */ public function useXML() { $this->verifyAcceptance(self::ENC_XML); Wave::getResponse()->withHeader('content-type', 'text/xml'); } /** * Sets the content type to `text/html` */ public function useHTML() { $this->verifyAcceptance(self::ENC_HTML); Wave::getResponse()->withHeader('content-type', 'text/html'); } public function usePlain() { $this->verifyAcceptance(self::ENC_PLAIN); Wave::getResponse()->withHeader('content-type', 'text/plain'); } }
<?php namespace Wave\Framework\External\Phroute\Filters\After; use Wave\Framework\Application\Wave; class Encoding { + const ENC_JSON = 'application/json'; + const ENC_XML = 'text/xml'; + const ENC_HTML = 'text/html'; + const ENC_PLAIN = 'text/plain'; + + private function verifyAcceptance($type) + { + $header = '*/*'; + if (Wave::getRequest()->hasHeader('Accept')) { + $header = Wave::getRequest()->getHeader('Accept'); + } + + /** + * if wildcard is not provided (* / *) and the content type is not found + * in the Accept header, set the response to 406 (Not Acceptable). + * + * Assumes that if no content type is provided, the client accepts anything (* / *) + */ + if (strpos($header, $type) === false && strpos($header, '*/*') === false) { + Wave::getResponse()->withStatus(406); + } + } + + /** * Sets the content type to `application/json` */ public function useJSON() { + $this->verifyAcceptance(self::ENC_JSON); Wave::getResponse()->withHeader('content-type', 'application/json'); } /** * Sets the content type to `text/xml` */ public function useXML() { + $this->verifyAcceptance(self::ENC_XML); Wave::getResponse()->withHeader('content-type', 'text/xml'); } /** * Sets the content type to `text/html` */ public function useHTML() { + $this->verifyAcceptance(self::ENC_HTML); Wave::getResponse()->withHeader('content-type', 'text/html'); } public function usePlain() { + $this->verifyAcceptance(self::ENC_PLAIN); Wave::getResponse()->withHeader('content-type', 'text/plain'); } }
28
0.777778
28
0